Files
QuickLook/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga/index.min.js
2025-07-05 09:50:54 +08:00

3 lines
59 KiB
JavaScript
Vendored

// SVGA.Lite v2.1.1
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SVGA={})}(this,(function(exports){"use strict";function __awaiter(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((i=i.apply(e,t||[])).next())}))}function __generator(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var INLINE_WORKER_FLAG="function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}!function(){\"use strict\";function t(t,e,r,i){return new(r||(r=Promise))((function(n,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))}function e(t,e){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError(\"Generator is already executing.\");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var r={exports:{}},i={exports:{}},n={};n.build=\"minimal\";var s,o=a;function a(t,e){this.options=e,this.name=t,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}a.className=\"ReflectionObject\",a.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;var e=t.root;e instanceof s&&e._handleAdd(this)},a.prototype.resolve=function(){return this.resolved||this.root instanceof s&&(this.resolved=!0),this},a.prototype.getOption=function(t){if(this.options)return this.options[t]},a._configure=function(t){s=t};var l=h,f=o;function h(t,e,r,i,n){if(f.call(this,t,r),e&&\"object\"!==_typeof(e))throw TypeError(\"values must be an object\");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=n||{},this.reserved=void 0,e)for(var s=Object.keys(e),o=0;o<s.length;++o)\"number\"==typeof e[s[o]]&&(this.valuesById[this.values[s[o]]=e[s[o]]]=s[o])}((h.prototype=Object.create(f.prototype)).constructor=h).className=\"Enum\",h.fromJSON=function(t,e){var r=new h(t,e.values,e.options,e.comment,e.comments);return r.reserved=e.reserved,r};var u={},p={exports:{}},d={},c=y(y);function y(t){return\"undefined\"!=typeof Float32Array?function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),i=128===r[3];function n(t,i,n){e[0]=t,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function s(t,i,n){e[0]=t,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function o(t,i){return r[0]=t[i],r[1]=t[i+1],r[2]=t[i+2],r[3]=t[i+3],e[0]}function a(t,i){return r[3]=t[i],r[2]=t[i+1],r[1]=t[i+2],r[0]=t[i+3],e[0]}t.writeFloatLE=i?n:s,t.writeFloatBE=i?s:n,t.readFloatLE=i?o:a,t.readFloatBE=i?a:o}():function(){function e(t,e,r,i){var n=e<0?1:0;if(n&&(e=-e),0===e)t(1/e>0?0:2147483648,r,i);else if(isNaN(e))t(2143289344,r,i);else if(e>34028234663852886e22)t((n<<31|2139095040)>>>0,r,i);else if(e<11754943508222875e-54)t((n<<31|Math.round(e/1401298464324817e-60))>>>0,r,i);else{var s=Math.floor(Math.log(e)/Math.LN2);t((n<<31|s+127<<23|8388607&Math.round(e*Math.pow(2,-s)*8388608))>>>0,r,i)}}function r(t,e,r){var i=t(e,r),n=2*(i>>31)+1,s=i>>>23&255,o=8388607&i;return 255===s?o?NaN:n*(1/0):0===s?1401298464324817e-60*n*o:n*Math.pow(2,s-150)*(o+8388608)}t.writeFloatLE=e.bind(null,v),t.writeFloatBE=e.bind(null,m),t.readFloatLE=r.bind(null,g),t.readFloatBE=r.bind(null,b)}(),\"undefined\"!=typeof Float64Array?function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),i=128===r[7];function n(t,i,n){e[0]=t,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function s(t,i,n){e[0]=t,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function o(t,i){return r[0]=t[i],r[1]=t[i+1],r[2]=t[i+2],r[3]=t[i+3],r[4]=t[i+4],r[5]=t[i+5],r[6]=t[i+6],r[7]=t[i+7],e[0]}function a(t,i){return r[7]=t[i],r[6]=t[i+1],r[5]=t[i+2],r[4]=t[i+3],r[3]=t[i+4],r[2]=t[i+5],r[1]=t[i+6],r[0]=t[i+7],e[0]}t.writeDoubleLE=i?n:s,t.writeDoubleBE=i?s:n,t.readDoubleLE=i?o:a,t.readDoubleBE=i?a:o}():function(){function e(t,e,r,i,n,s){var o=i<0?1:0;if(o&&(i=-i),0===i)t(0,n,s+e),t(1/i>0?0:2147483648,n,s+r);else if(isNaN(i))t(0,n,s+e),t(2146959360,n,s+r);else if(i>17976931348623157e292)t(0,n,s+e),t((o<<31|2146435072)>>>0,n,s+r);else{var a;if(i<22250738585072014e-324)t((a=i/5e-324)>>>0,n,s+e),t((o<<31|a/4294967296)>>>0,n,s+r);else{var l=Math.floor(Math.log(i)/Math.LN2);1024===l&&(l=1023),t(4503599627370496*(a=i*Math.pow(2,-l))>>>0,n,s+e),t((o<<31|l+1023<<20|1048576*a&1048575)>>>0,n,s+r)}}}function r(t,e,r,i,n){var s=t(i,n+e),o=t(i,n+r),a=2*(o>>31)+1,l=o>>>20&2047,f=4294967296*(1048575&o)+s;return 2047===l?f?NaN:a*(1/0):0===l?5e-324*a*f:a*Math.pow(2,l-1075)*(f+4503599627370496)}t.writeDoubleLE=e.bind(null,v,0,4),t.writeDoubleBE=e.bind(null,m,4,0),t.readDoubleLE=r.bind(null,g,0,4),t.readDoubleBE=r.bind(null,b,4,0)}(),t}function v(t,e,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function m(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=255&t}function g(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function b(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}var w={};!function(t){var e=t;e.length=function(t){for(var e=0,r=0,i=0;i<t.length;++i)(r=t.charCodeAt(i))<128?e+=1:r<2048?e+=2:55296==(64512&r)&&56320==(64512&t.charCodeAt(i+1))?(++i,e+=4):e+=3;return e},e.read=function(t,e,r){if(r-e<1)return\"\";for(var i,n=null,s=[],o=0;e<r;)(i=t[e++])<128?s[o++]=i:i>191&&i<224?s[o++]=(31&i)<<6|63&t[e++]:i>239&&i<365?(i=((7&i)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,s[o++]=55296+(i>>10),s[o++]=56320+(1023&i)):s[o++]=(15&i)<<12|(63&t[e++])<<6|63&t[e++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join(\"\")):String.fromCharCode.apply(String,s.slice(0,o))},e.write=function(t,e,r){for(var i,n,s=r,o=0;o<t.length;++o)(i=t.charCodeAt(o))<128?e[r++]=i:i<2048?(e[r++]=i>>6|192,e[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=t.charCodeAt(o+1)))?(i=65536+((1023&i)<<10)+(1023&n),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=63&i|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=63&i|128);return r-s}}(w),function(t){var e=t;e.float=c,e.utf8=w,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(t){return\"number\"==typeof t&&isFinite(t)&&Math.floor(t)===t},e.isString=function(t){return\"string\"==typeof t||t instanceof String},e.isObject=function(t){return t&&\"object\"===_typeof(t)},e.Array=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,e._configure=function(){var t=e.Buffer;t?(e._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},e._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):e._Buffer_from=e._Buffer_allocUnsafe=null}}(d);var A=k;function k(t,e){\"string\"==typeof t&&(e=t,t=void 0);var r=[];function i(t){if(\"string\"!=typeof t){var e=n();if(k.verbose&&console.log(\"codegen: \"+e),e=\"return \"+e,t){for(var s=Object.keys(t),o=new Array(s.length+1),a=new Array(s.length),l=0;l<s.length;)o[l]=s[l],a[l]=t[s[l++]];return o[l]=e,Function.apply(null,o).apply(null,a)}return Function(e)()}for(var f=new Array(arguments.length-1),h=0;h<f.length;)f[h]=arguments[++h];if(h=0,t=t.replace(/%([%dfijs])/g,(function(t,e){var r=f[h++];switch(e){case\"d\":case\"f\":return String(Number(r));case\"i\":return String(Math.floor(r));case\"j\":return JSON.stringify(r);case\"s\":return String(r)}return\"%\"})),h!==f.length)throw Error(\"parameter count mismatch\");return r.push(t),i}function n(i){return\"function \"+(i||e||\"\")+\"(\"+(t&&t.join(\",\")||\"\")+\"){\\n \"+r.join(\"\\n \")+\"\\n}\"}return i.toString=n,i}k.verbose=!1;var E=p.exports=d;E.codegen=A,E.toArray=function(t){if(t){for(var e=Object.keys(t),r=new Array(e.length),i=0;i<e.length;)r[i]=t[e[i++]];return r}return[]};var O=/\\\\/g,S=/\"/g;E.isReserved=function(t){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(t)},E.safeProp=function(t){return!/^[$\\w_]+$/.test(t)||E.isReserved(t)?'[\"'+t.replace(O,\"\\\\\\\\\").replace(S,'\\\\\"')+'\"]':\".\"+t},function(t){var e=t,r=p.exports,i=[\"double\",\"float\",\"int32\",\"uint32\",\"sint32\",\"fixed32\",\"sfixed32\",\"int64\",\"uint64\",\"sint64\",\"fixed64\",\"sfixed64\",\"bool\",\"string\",\"bytes\"];function n(t,e){var r=0,n={};for(e|=0;r<t.length;)n[i[r+e]]=t[r++];return n}e.basic=n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),e.defaults=n([0,0,0,0,0,0,0,0,0,0,0,0,!1,\"\",r.emptyArray,null]),e.long=n([0,0,0,1,1],7),e.mapKey=n([0,0,0,5,5,0,0,0,1,1,0,2],2),e.packed=n([1,5,0,0,0,5,5,0,0,0,1,1,0])}(u);var x=D,_=o;((D.prototype=Object.create(_.prototype)).constructor=D).className=\"Field\";var I,T=l,N=u,j=p.exports,B=/^required|optional|repeated$/;function D(t,e,r,i,n,s,o){if(j.isObject(i)?(o=n,s=i,i=n=void 0):j.isObject(n)&&(o=s,s=n,n=void 0),_.call(this,t,s),!j.isInteger(e)||e<0)throw TypeError(\"id must be a non-negative integer\");if(!j.isString(r))throw TypeError(\"type must be a string\");if(void 0!==i&&!B.test(i=i.toString().toLowerCase()))throw TypeError(\"rule must be a string rule\");if(void 0!==n&&!j.isString(n))throw TypeError(\"extend must be a string\");this.rule=i&&\"optional\"!==i?i:void 0,this.type=r,this.id=e,this.extend=n||void 0,this.required=\"required\"===i,this.optional=!this.required,this.repeated=\"repeated\"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!j.Long&&void 0!==N.long[r],this.bytes=\"bytes\"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=o}D.fromJSON=function(t,e){return new D(t,e.id,e.type,e.rule,e.extend,e.options,e.comment)},D.prototype.setOption=function(t,e,r){return\"packed\"===t&&(this._packed=null),_.prototype.setOption.call(this,t,e,r)},D.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=N.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof I?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof T&&\"string\"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof T)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=j.Long.fromNumber(this.typeDefault,\"u\"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&\"string\"==typeof this.typeDefault){var t;j.base64.test(this.typeDefault)?j.base64.decode(this.typeDefault,t=j.newBuffer(j.base64.length(this.typeDefault)),0):j.utf8.write(this.typeDefault,t=j.newBuffer(j.utf8.length(this.typeDefault)),0),this.typeDefault=t}return this.map?this.defaultValue=j.emptyObject:this.repeated?this.defaultValue=j.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof I&&(this.parent.ctor.prototype[this.name]=this.defaultValue),_.prototype.resolve.call(this)},D._configure=function(t){I=t};var L=P,R=o;((P.prototype=Object.create(R.prototype)).constructor=P).className=\"Namespace\";var U,J,C,F=x,M=p.exports;function P(t,e){R.call(this,t,e),this.nested=void 0,this._nestedArray=null}P.fromJSON=function(t,e){return new P(t,e.options).addJSON(e.nested)},P.isReservedId=function(t,e){if(t)for(var r=0;r<t.length;++r)if(\"string\"!=typeof t[r]&&t[r][0]<=e&&t[r][1]>=e)return!0;return!1},P.isReservedName=function(t,e){if(t)for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1},Object.defineProperty(P.prototype,\"nestedArray\",{get:function(){return this._nestedArray||(this._nestedArray=M.toArray(this.nested))}}),P.prototype.addJSON=function(t){if(t)for(var e,r=Object.keys(t),i=0;i<r.length;++i)e=t[r[i]],this.add((void 0!==e.fields?U.fromJSON:void 0!==e.values?C.fromJSON:void 0!==e.methods?J.fromJSON:void 0!==e.id?F.fromJSON:P.fromJSON)(r[i],e));return this},P.prototype.get=function(t){return this.nested&&this.nested[t]||null},P.prototype.add=function(t){if(!(t instanceof F&&void 0!==t.extend||t instanceof U||t instanceof C||t instanceof J||t instanceof P))throw TypeError(\"object must be a valid nested object\");if(this.nested){var e=this.get(t.name);if(e){if(!(e instanceof P&&t instanceof P)||e instanceof U||e instanceof J)throw Error(\"duplicate name '\"+t.name+\"' in \"+this);for(var r=e.nestedArray,i=0;i<r.length;++i)t.add(r[i]);this.remove(e),this.nested||(this.nested={}),t.setOptions(e.options,!0)}}else this.nested={};return this.nested[t.name]=t,t.onAdd(this),function(t){return t._nestedArray=null,t}(this)},P.prototype.lookup=function(t,e,r){if(\"boolean\"==typeof e?(r=e,e=void 0):e&&!Array.isArray(e)&&(e=[e]),M.isString(t)&&t.length){if(\".\"===t)return this.root;t=t.split(\".\")}else if(!t.length)return this;if(\"\"===t[0])return this.root.lookup(t.slice(1),e);var i=this.get(t[0]);if(i){if(1===t.length){if(!e||e.indexOf(i.constructor)>-1)return i}else if(i instanceof P&&(i=i.lookup(t.slice(1),e,!0)))return i}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof P&&(i=this._nestedArray[n].lookup(t,e,!0)))return i;return null===this.parent||r?null:this.parent.lookup(t,e)},P.prototype.lookupType=function(t){var e=this.lookup(t,[U]);if(!e)throw Error(\"no such type: \"+t);return e},P.prototype.lookupTypeOrEnum=function(t){var e=this.lookup(t,[U,C]);if(!e)throw Error(\"no such Type or Enum '\"+t+\"' in \"+this);return e},P._configure=function(t,e,r){U=t,J=e,C=r};var z=H,V=o;((H.prototype=Object.create(V.prototype)).constructor=H).className=\"OneOf\";var q=x,G=p.exports;function H(t,e,r,i){if(Array.isArray(e)||(r=e,e=void 0),V.call(this,t,r),void 0!==e&&!Array.isArray(e))throw TypeError(\"fieldNames must be an Array\");this.oneof=e||[],this.fieldsArray=[],this.comment=i}function K(t){if(t.parent)for(var e=0;e<t.fieldsArray.length;++e)t.fieldsArray[e].parent||t.parent.add(t.fieldsArray[e])}H.fromJSON=function(t,e){return new H(t,e.oneof,e.options,e.comment)},H.prototype.toJSON=function(t){var e=!!t&&Boolean(t.keepComments);return G.toObject([\"options\",this.options,\"oneof\",this.oneof,\"comment\",e?this.comment:void 0])},H.prototype.add=function(t){if(!(t instanceof q))throw TypeError(\"field must be a Field\");return t.parent&&t.parent!==this.parent&&t.parent.remove(t),this.oneof.push(t.name),this.fieldsArray.push(t),t.partOf=this,K(this),this},H.prototype.remove=function(t){if(!(t instanceof q))throw TypeError(\"field must be a Field\");var e=this.fieldsArray.indexOf(t);if(e<0)throw Error(t+\" is not a member of \"+this);return this.fieldsArray.splice(e,1),(e=this.oneof.indexOf(t.name))>-1&&this.oneof.splice(e,1),t.partOf=null,this},H.prototype.onAdd=function(t){V.prototype.onAdd.call(this,t);for(var e=0;e<this.oneof.length;++e){var r=t.get(this.oneof[e]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}K(this)},H.prototype.onRemove=function(t){for(var e,r=0;r<this.fieldsArray.length;++r)(e=this.fieldsArray[r]).parent&&e.parent.remove(e);V.prototype.onRemove.call(this,t)},H.d=function(){for(var t=new Array(arguments.length),e=0;e<arguments.length;)t[e]=arguments[e++];return function(e,r){G.decorateType(e.constructor).add(new H(r,t)),Object.defineProperty(e,r,{get:G.oneOfGetter(t),set:G.oneOfSetter(t)})}};var W=tt,$=L;((tt.prototype=Object.create($.prototype)).constructor=tt).className=\"Root\";var Z,X=x,Y=l,Q=z;function tt(t){$.call(this,\"\",t),this.deferred=[],this.files=[]}tt.fromJSON=function(t,e){return e||(e=new tt),t.options&&e.setOptions(t.options),e.addJSON(t.nested)};var et=/^[A-Z]/;function rt(t,e){var r=e.parent.lookup(e.extend);if(r){var i=new X(e.fullName,e.id,e.type,e.rule,void 0,e.options);return i.declaringField=e,e.extensionField=i,r.add(i),!0}return!1}tt.prototype._handleAdd=function(t){if(t instanceof X)void 0===t.extend||t.extensionField||rt(0,t)||this.deferred.push(t);else if(t instanceof Y)et.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof Q)){if(t instanceof Z)for(var e=0;e<this.deferred.length;)rt(0,this.deferred[e])?this.deferred.splice(e,1):++e;for(var r=0;r<t.nestedArray.length;++r)this._handleAdd(t._nestedArray[r]);et.test(t.name)&&(t.parent[t.name]=t)}},tt._configure=function(t,e,r){Z=t};var it=ot,nt=x;((ot.prototype=Object.create(nt.prototype)).constructor=ot).className=\"MapField\";var st=p.exports;function ot(t,e,r,i,n,s){if(nt.call(this,t,e,i,void 0,void 0,n,s),!st.isString(r))throw TypeError(\"keyType must be a string\");this.keyType=r,this.resolvedKeyType=null,this.map=!0}ot.fromJSON=function(t,e){return new ot(t,e.id,e.keyType,e.type,e.options,e.comment)};var at=ft,lt=L;function ft(t,e){lt.call(this,t,e),this.methods={},this._methodsArray=null}((ft.prototype=Object.create(lt.prototype)).constructor=ft).className=\"Service\";var ht=ct,ut=d;ut.LongBits;var pt=ut.utf8;function dt(t,e){return RangeError(\"index out of range: \"+t.pos+\" + \"+(e||1)+\" > \"+t.len)}function ct(t){this.buf=t,this.pos=0,this.len=t.length}var yt,vt=\"undefined\"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new ct(t);throw Error(\"illegal buffer\")}:function(t){if(Array.isArray(t))return new ct(t);throw Error(\"illegal buffer\")};function mt(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}ct.create=ut.Buffer?function(t){return(ct.create=function(t){return ut.Buffer.isBuffer(t)?new(void 0)(t):vt(t)})(t)}:vt,ct.prototype._slice=ut.Array.prototype.subarray||ut.Array.prototype.slice,ct.prototype.uint32=(yt=4294967295,function(){if(yt=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return yt;if(yt=(yt|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return yt;if(yt=(yt|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return yt;if(yt=(yt|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return yt;if(yt=(yt|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return yt;if((this.pos+=5)>this.len)throw this.pos=this.len,dt(this,10);return yt}),ct.prototype.int32=function(){return 0|this.uint32()},ct.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},ct.prototype.bool=function(){return 0!==this.uint32()},ct.prototype.fixed32=function(){if(this.pos+4>this.len)throw dt(this,4);return mt(this.buf,this.pos+=4)},ct.prototype.sfixed32=function(){if(this.pos+4>this.len)throw dt(this,4);return 0|mt(this.buf,this.pos+=4)},ct.prototype.float=function(){if(this.pos+4>this.len)throw dt(this,4);var t=ut.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},ct.prototype.double=function(){if(this.pos+8>this.len)throw dt(this,4);var t=ut.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},ct.prototype.bytes=function(){var t=this.uint32(),e=this.pos,r=this.pos+t;if(r>this.len)throw dt(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,r):e===r?new this.buf.constructor(0):this._slice.call(this.buf,e,r)},ct.prototype.string=function(){var t=this.bytes();return pt.read(t,0,t.length)},ct.prototype.skip=function(t){if(\"number\"==typeof t){if(this.pos+t>this.len)throw dt(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw dt(this)}while(128&this.buf[this.pos++]);return this},ct.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error(\"invalid wire type \"+t+\" at offset \"+this.pos)}return this};var gt=function(t){var e=At.codegen([\"r\",\"l\"],t.name+\"$decode\")(\"if(!(r instanceof Reader))\")(\"r=Reader.create(r)\")(\"var c=l===undefined?r.len:r.pos+l,m=new this.ctor\"+(t.fieldsArray.filter((function(t){return t.map})).length?\",k\":\"\"))(\"while(r.pos<c){\")(\"var t=r.uint32()\");t.group&&e(\"if((t&7)===4)\")(\"break\");e(\"switch(t>>>3){\");for(var r=0;r<t.fieldsArray.length;++r){var i=t._fieldsArray[r].resolve(),n=i.resolvedType instanceof bt?\"int32\":i.type,s=\"m\"+At.safeProp(i.name);e(\"case %i:\",i.id),i.map?(e(\"r.skip().pos++\")(\"if(%s===util.emptyObject)\",s)(\"%s={}\",s)(\"k=r.%s()\",i.keyType)(\"r.pos++\"),void 0!==wt.long[i.keyType]?void 0===wt.basic[n]?e('%s[typeof k===\"object\"?util.longToHash(k):k]=types[%i].decode(r,r.uint32())',s,r):e('%s[typeof k===\"object\"?util.longToHash(k):k]=r.%s()',s,n):void 0===wt.basic[n]?e(\"%s[k]=types[%i].decode(r,r.uint32())\",s,r):e(\"%s[k]=r.%s()\",s,n)):i.repeated?(e(\"if(!(%s&&%s.length))\",s,s)(\"%s=[]\",s),void 0!==wt.packed[n]&&e(\"if((t&7)===2){\")(\"var c2=r.uint32()+r.pos\")(\"while(r.pos<c2)\")(\"%s.push(r.%s())\",s,n)(\"}else\"),void 0===wt.basic[n]?e(i.resolvedType.group?\"%s.push(types[%i].decode(r))\":\"%s.push(types[%i].decode(r,r.uint32()))\",s,r):e(\"%s.push(r.%s())\",s,n)):void 0===wt.basic[n]?e(i.resolvedType.group?\"%s=types[%i].decode(r)\":\"%s=types[%i].decode(r,r.uint32())\",s,r):e(\"%s=r.%s()\",s,n),e(\"break\")}for(e(\"default:\")(\"r.skipType(t&7)\")(\"break\")(\"}\")(\"}\"),r=0;r<t._fieldsArray.length;++r){var o=t._fieldsArray[r];o.required&&e(\"if(!m.hasOwnProperty(%j))\",o.name)(\"throw util.ProtocolError(%j,{instance:m})\",kt(o))}return e(\"return m\")},bt=l,wt=u,At=p.exports;function kt(t){return\"missing required '\"+t.name+\"'\"}var Et=Bt,Ot=L;((Bt.prototype=Object.create(Ot.prototype)).constructor=Bt).className=\"Type\";var St=l,xt=x,_t=it,It=at,Tt=ht,Nt=p.exports,jt=gt;function Bt(t,e){Ot.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Bt.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var t=Object.keys(this.fields),e=0;e<t.length;++e){var r=this.fields[t[e]],i=r.id;if(this._fieldsById[i])throw Error(\"duplicate id \"+i+\" in \"+this);this._fieldsById[i]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=Nt.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=Nt.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Bt.generateConstructor(this)())},set:function(t){t.prototype,t.$type=t.prototype.$type=this,this._ctor=t;for(var e=0;e<this.fieldsArray.length;++e)this._fieldsArray[e].resolve();var r={};for(e=0;e<this.oneofsArray.length;++e)r[this._oneofsArray[e].resolve().name]={get:Nt.oneOfGetter(this._oneofsArray[e].oneof),set:Nt.oneOfSetter(this._oneofsArray[e].oneof)};e&&Object.defineProperties(t.prototype,r)}}}),Bt.generateConstructor=function(t){for(var e,r=Nt.codegen([\"p\"],t.name),i=0;i<t.fieldsArray.length;++i)(e=t._fieldsArray[i]).map?r(\"this%s={}\",Nt.safeProp(e.name)):e.repeated&&r(\"this%s=[]\",Nt.safeProp(e.name));return r(\"if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)\")(\"this[ks[i]]=p[ks[i]]\")},Bt.fromJSON=function(t,e){var r=new Bt(t,e.options);r.extensions=e.extensions,r.reserved=e.reserved;for(var i=Object.keys(e.fields),n=0;n<i.length;++n)r.add((void 0!==e.fields[i[n]].keyType?_t.fromJSON:xt.fromJSON)(i[n],e.fields[i[n]]));if(e.nested)for(i=Object.keys(e.nested),n=0;n<i.length;++n){var s=e.nested[i[n]];r.add((void 0!==s.id?xt.fromJSON:void 0!==s.fields?Bt.fromJSON:void 0!==s.values?St.fromJSON:void 0!==s.methods?It.fromJSON:Ot.fromJSON)(i[n],s))}return e.extensions&&e.extensions.length&&(r.extensions=e.extensions),e.reserved&&e.reserved.length&&(r.reserved=e.reserved),e.group&&(r.group=!0),e.comment&&(r.comment=e.comment),r},Bt.prototype.add=function(t){if(this.get(t.name))throw Error(\"duplicate name '\"+t.name+\"' in \"+this);if(t instanceof xt&&void 0===t.extend){if(this._fieldsById?this._fieldsById[t.id]:this.fieldsById[t.id])throw Error(\"duplicate id \"+t.id+\" in \"+this);if(this.isReservedId(t.id))throw Error(\"id \"+t.id+\" is reserved in \"+this);if(this.isReservedName(t.name))throw Error(\"name '\"+t.name+\"' is reserved in \"+this);return t.parent&&t.parent.remove(t),this.fields[t.name]=t,t.message=this,t.onAdd(this),function(t){return t._fieldsById=t._fieldsArray=t._oneofsArray=null,delete t.encode,delete t.decode,delete t.verify,t}(this)}return Ot.prototype.add.call(this,t)},Bt.prototype.isReservedId=function(t){return Ot.isReservedId(this.reserved,t)},Bt.prototype.isReservedName=function(t){return Ot.isReservedName(this.reserved,t)},Bt.prototype.setup=function(){this.fullName;for(var t=[],e=0;e<this.fieldsArray.length;++e)t.push(this._fieldsArray[e].resolve().resolvedType);return this.decode=jt(this)({Reader:Tt,types:t,util:Nt}),this},Bt.prototype.decode=function(t,e){return this.setup().decode(t,e)};var Dt=i.exports=n;Dt.build=\"light\",Dt.ReflectionObject=o,Dt.Namespace=L,Dt.Root=W,Dt.Enum=l,Dt.Type=Et,Dt.Field=x,Dt.Service=at,Dt.ReflectionObject._configure(Dt.Root),Dt.Namespace._configure(Dt.Type,Dt.Service,Dt.Enum),Dt.Root._configure(Dt.Type),Dt.Field._configure(Dt.Type),(r.exports=i.exports).build=\"full\";var Lt=r.exports,Rt=(new function(){var t=void 0,e=this;function r(r,i){var n,s=r.split(\".\"),o=e;!(s[0]in o)&&o.execScript&&o.execScript(\"var \"+s[0]);for(;s.length&&(n=s.shift());)s.length||i===t?o=o[n]?o[n]:o[n]={}:o[n]=i}var i=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array&&\"undefined\"!=typeof DataView;function n(t){var e,r,n,s,o,a,l,f,h,u,p=t.length,d=0,c=Number.POSITIVE_INFINITY;for(f=0;f<p;++f)t[f]>d&&(d=t[f]),t[f]<c&&(c=t[f]);for(e=1<<d,r=new(i?Uint32Array:Array)(e),n=1,s=0,o=2;n<=d;){for(f=0;f<p;++f)if(t[f]===n){for(a=0,l=s,h=0;h<n;++h)a=a<<1|1&l,l>>=1;for(u=n<<16|f,h=a;h<e;h+=o)r[h]=u;++s}++n,s<<=1,o<<=1}return[r,d,c]}function s(t,e){switch(this.g=[],this.h=32768,this.d=this.f=this.a=this.l=0,this.input=i?new Uint8Array(t):t,this.m=!1,this.i=a,this.r=!1,!e&&(e={})||(e.index&&(this.a=e.index),e.bufferSize&&(this.h=e.bufferSize),e.bufferType&&(this.i=e.bufferType),e.resize&&(this.r=e.resize)),this.i){case o:this.b=32768,this.c=new(i?Uint8Array:Array)(32768+this.h+258);break;case a:this.b=0,this.c=new(i?Uint8Array:Array)(this.h),this.e=this.z,this.n=this.v,this.j=this.w;break;default:throw Error(\"invalid inflate mode\")}}var o=0,a=1,l={t:o,s:a};s.prototype.k=function(){for(;!this.m;){var e=_(this,3);switch(1&e&&(this.m=!0),e>>>=1){case 0:var r=this.input,s=this.a,l=this.c,f=this.b,h=r.length,u=t,d=l.length,c=t;if(this.d=this.f=0,s+1>=h)throw Error(\"invalid uncompressed block header: LEN\");if(u=r[s++]|r[s++]<<8,s+1>=h)throw Error(\"invalid uncompressed block header: NLEN\");if(u===~(r[s++]|r[s++]<<8))throw Error(\"invalid uncompressed block header: length verify\");if(s+u>r.length)throw Error(\"input buffer is broken\");switch(this.i){case o:for(;f+u>l.length;){if(u-=c=d-f,i)l.set(r.subarray(s,s+c),f),f+=c,s+=c;else for(;c--;)l[f++]=r[s++];this.b=f,l=this.e(),f=this.b}break;case a:for(;f+u>l.length;)l=this.e({p:2});break;default:throw Error(\"invalid inflate mode\")}if(i)l.set(r.subarray(s,s+u),f),f+=u,s+=u;else for(;u--;)l[f++]=r[s++];this.a=s,this.b=f,this.c=l;break;case 1:this.j(O,x);break;case 2:var y,v,m,g,b=_(this,5)+257,w=_(this,5)+1,A=_(this,4)+4,k=new(i?Uint8Array:Array)(p.length),E=t,S=t,T=t,N=t,j=t;for(j=0;j<A;++j)k[p[j]]=_(this,3);if(!i)for(j=A,A=k.length;j<A;++j)k[p[j]]=0;for(y=n(k),E=new(i?Uint8Array:Array)(b+w),j=0,g=b+w;j<g;)switch(S=I(this,y)){case 16:for(N=3+_(this,2);N--;)E[j++]=T;break;case 17:for(N=3+_(this,3);N--;)E[j++]=0;T=0;break;case 18:for(N=11+_(this,7);N--;)E[j++]=0;T=0;break;default:T=E[j++]=S}v=n(i?E.subarray(0,b):E.slice(0,b)),m=n(i?E.subarray(b):E.slice(b)),this.j(v,m);break;default:throw Error(\"unknown BTYPE: \"+e)}}return this.n()};var f,h,u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=i?new Uint16Array(u):u,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],c=i?new Uint16Array(d):d,y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],v=i?new Uint8Array(y):y,m=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],g=i?new Uint16Array(m):m,b=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],w=i?new Uint8Array(b):b,A=new(i?Uint8Array:Array)(288);for(f=0,h=A.length;f<h;++f)A[f]=143>=f?8:255>=f?9:279>=f?7:8;var k,E,O=n(A),S=new(i?Uint8Array:Array)(30);for(k=0,E=S.length;k<E;++k)S[k]=5;var x=n(S);function _(t,e){for(var r,i=t.f,n=t.d,s=t.input,o=t.a,a=s.length;n<e;){if(o>=a)throw Error(\"input buffer is broken\");i|=s[o++]<<n,n+=8}return r=i&(1<<e)-1,t.f=i>>>e,t.d=n-e,t.a=o,r}function I(t,e){for(var r,i,n=t.f,s=t.d,o=t.input,a=t.a,l=o.length,f=e[0],h=e[1];s<h&&!(a>=l);)n|=o[a++]<<s,s+=8;if((i=(r=f[n&(1<<h)-1])>>>16)>s)throw Error(\"invalid code length: \"+i);return t.f=n>>i,t.d=s-i,t.a=a,65535&r}function T(t,e){var r,i;switch(this.input=t,this.a=0,!e&&(e={})||(e.index&&(this.a=e.index),e.verify&&(this.A=e.verify)),r=t[this.a++],i=t[this.a++],15&r){case N:this.method=N;break;default:throw Error(\"unsupported compression method\")}if(0!=((r<<8)+i)%31)throw Error(\"invalid fcheck flag:\"+((r<<8)+i)%31);if(32&i)throw Error(\"fdict flag is not supported\");this.q=new s(t,{index:this.a,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}s.prototype.j=function(t,e){var r=this.c,i=this.b;this.o=t;for(var n,s,o,a,l=r.length-258;256!==(n=I(this,t));)if(256>n)i>=l&&(this.b=i,r=this.e(),i=this.b),r[i++]=n;else for(a=c[s=n-257],0<v[s]&&(a+=_(this,v[s])),n=I(this,e),o=g[n],0<w[n]&&(o+=_(this,w[n])),i>=l&&(this.b=i,r=this.e(),i=this.b);a--;)r[i]=r[i++-o];for(;8<=this.d;)this.d-=8,this.a--;this.b=i},s.prototype.w=function(t,e){var r=this.c,i=this.b;this.o=t;for(var n,s,o,a,l=r.length;256!==(n=I(this,t));)if(256>n)i>=l&&(l=(r=this.e()).length),r[i++]=n;else for(a=c[s=n-257],0<v[s]&&(a+=_(this,v[s])),n=I(this,e),o=g[n],0<w[n]&&(o+=_(this,w[n])),i+a>l&&(l=(r=this.e()).length);a--;)r[i]=r[i++-o];for(;8<=this.d;)this.d-=8,this.a--;this.b=i},s.prototype.e=function(){var t,e,r=new(i?Uint8Array:Array)(this.b-32768),n=this.b-32768,s=this.c;if(i)r.set(s.subarray(32768,r.length));else for(t=0,e=r.length;t<e;++t)r[t]=s[t+32768];if(this.g.push(r),this.l+=r.length,i)s.set(s.subarray(n,n+32768));else for(t=0;32768>t;++t)s[t]=s[n+t];return this.b=32768,s},s.prototype.z=function(t){var e,r,n,s=this.input.length/this.a+1|0,o=this.input,a=this.c;return t&&(\"number\"==typeof t.p&&(s=t.p),\"number\"==typeof t.u&&(s+=t.u)),2>s?r=(n=(o.length-this.a)/this.o[2]/2*258|0)<a.length?a.length+n:a.length<<1:r=a.length*s,i?(e=new Uint8Array(r)).set(a):e=a,this.c=e},s.prototype.n=function(){var t,e,r,n,s,o=0,a=this.c,l=this.g,f=new(i?Uint8Array:Array)(this.l+(this.b-32768));if(0===l.length)return i?this.c.subarray(32768,this.b):this.c.slice(32768,this.b);for(e=0,r=l.length;e<r;++e)for(n=0,s=(t=l[e]).length;n<s;++n)f[o++]=t[n];for(e=32768,r=this.b;e<r;++e)f[o++]=a[e];return this.g=[],this.buffer=f},s.prototype.v=function(){var t,e=this.b;return i?this.r?(t=new Uint8Array(e)).set(this.c.subarray(0,e)):t=this.c.subarray(0,e):(this.c.length>e&&(this.c.length=e),t=this.c),this.buffer=t},T.prototype.k=function(){var t,e,r=this.input;if(t=this.q.k(),this.a=this.q.a,this.A){e=(r[this.a++]<<24|r[this.a++]<<16|r[this.a++]<<8|r[this.a++])>>>0;var i=t;if(\"string\"==typeof i){var n,s,o=i.split(\"\");for(n=0,s=o.length;n<s;n++)o[n]=(255&o[n].charCodeAt(0))>>>0;i=o}for(var a,l=1,f=0,h=i.length,u=0;0<h;){h-=a=1024<h?1024:h;do{f+=l+=i[u++]}while(--a);l%=65521,f%=65521}if(e!==(f<<16|l)>>>0)throw Error(\"invalid adler-32 checksum\")}return t};var N=8;r(\"Zlib.Inflate\",T),r(\"Zlib.Inflate.prototype.decompress\",T.prototype.k);var j,B,D,L,R={ADAPTIVE:l.s,BLOCK:l.t};if(Object.keys)j=Object.keys(R);else for(B in j=[],D=0,R)j[D++]=B;for(D=0,L=j.length;D<L;++D)r(\"Zlib.Inflate.BufferType.\"+(B=j[D]),R[B])}).Zlib,Ut=function(t,e){void 0===e&&(e={});var r=this;this.size={width:0,height:0},this.fps=20,this.frames=0,this.images={},this.replaceElements={},this.dynamicElements={},this.sprites=[],this.version=t.version;var i=t.params,n=i.viewBoxWidth,s=i.viewBoxHeight,o=i.fps,a=i.frames;this.size.width=n,this.size.height=s,this.fps=o,this.frames=a,this.sprites=[],t.sprites.forEach((function(t){var e,i={imageKey:t.imageKey,frames:[]};t.frames.forEach((function(t){var r,n,s,o,a,l,f,h,u,p,d,c,y,v,m,g,b,w,A,k,E,O,S={x:null!==(n=null===(r=t.layout)||void 0===r?void 0:r.x)&&void 0!==n?n:0,y:null!==(o=null===(s=t.layout)||void 0===s?void 0:s.y)&&void 0!==o?o:0,width:null!==(l=null===(a=t.layout)||void 0===a?void 0:a.width)&&void 0!==l?l:0,height:null!==(h=null===(f=t.layout)||void 0===f?void 0:f.height)&&void 0!==h?h:0},x={a:null!==(p=null===(u=t.transform)||void 0===u?void 0:u.a)&&void 0!==p?p:1,b:null!==(c=null===(d=t.transform)||void 0===d?void 0:d.b)&&void 0!==c?c:0,c:null!==(v=null===(y=t.transform)||void 0===y?void 0:y.c)&&void 0!==v?v:0,d:null!==(g=null===(m=t.transform)||void 0===m?void 0:m.d)&&void 0!==g?g:1,tx:null!==(w=null===(b=t.transform)||void 0===b?void 0:b.tx)&&void 0!==w?w:0,ty:null!==(k=null===(A=t.transform)||void 0===A?void 0:A.ty)&&void 0!==k?k:0},_=null!==(E=t.clipPath)&&void 0!==E?E:\"\",I=[];t.shapes.forEach((function(t){var e,r,i,n,s,o,a,l,f,h,u,p,d=t.styles;if(null!==d){var c=[];null!==d.lineDashI&&d.lineDashI>0&&c.push(d.lineDashI),null!==d.lineDashII&&d.lineDashII>0&&(c.length<1&&c.push(0),c.push(d.lineDashII)),null!==d.lineDashIII&&d.lineDashIII>0&&(c.length<2&&(c.push(0),c.push(0)),c[2]=d.lineDashIII);var y=null;switch(d.lineCap){case 0:y=\"butt\";break;case 1:y=\"round\";break;case 2:y=\"square\"}var v=null;switch(d.lineJoin){case 2:v=\"bevel\";break;case 1:v=\"round\";break;case 0:v=\"miter\"}var m=null;null!==d.fill&&(m=\"rgba(\".concat(parseInt((255*d.fill.r).toString()),\", \").concat(parseInt((255*d.fill.g).toString()),\", \").concat(parseInt((255*d.fill.b).toString()),\", \").concat(parseInt((1*d.fill.a).toString()),\")\"));var g=null;null!==d.stroke&&(g=\"rgba(\".concat(parseInt((255*d.stroke.r).toString()),\", \").concat(parseInt((255*d.stroke.g).toString()),\", \").concat(parseInt((255*d.stroke.b).toString()),\", \").concat(parseInt((1*d.stroke.a).toString()),\")\"));var b={lineDash:c,fill:m,stroke:g,lineCap:y,lineJoin:v,strokeWidth:d.strokeWidth,miterLimit:d.miterLimit},w={a:null!==(r=null===(e=t.transform)||void 0===e?void 0:e.a)&&void 0!==r?r:1,b:null!==(n=null===(i=t.transform)||void 0===i?void 0:i.b)&&void 0!==n?n:0,c:null!==(o=null===(s=t.transform)||void 0===s?void 0:s.c)&&void 0!==o?o:0,d:null!==(l=null===(a=t.transform)||void 0===a?void 0:a.d)&&void 0!==l?l:1,tx:null!==(h=null===(f=t.transform)||void 0===f?void 0:f.tx)&&void 0!==h?h:0,ty:null!==(p=null===(u=t.transform)||void 0===u?void 0:u.ty)&&void 0!==p?p:0};0===t.type&&null!==t.shape?I.push({type:\"shape\",path:t.shape,styles:b,transform:w}):1===t.type&&null!==t.rect?I.push({type:\"rect\",path:t.rect,styles:b,transform:w}):2===t.type&&null!==t.ellipse&&I.push({type:\"ellipse\",path:t.ellipse,styles:b,transform:w})}})),void 0!==t.shapes[0]&&3===t.shapes[0].type&&void 0!==e?I=e:e=I;var T=x.a*S.x+x.c*S.y+x.tx,N=x.a*(S.x+S.width)+x.c*S.y+x.tx,j=x.a*S.x+x.c*(S.y+S.height)+x.tx,B=x.a*(S.x+S.width)+x.c*(S.y+S.height)+x.tx,D=x.b*S.x+x.d*S.y+x.ty,L=x.b*(S.x+S.width)+x.d*S.y+x.ty,R=x.b*S.x+x.d*(S.y+S.height)+x.ty,U=x.b*(S.x+S.width)+x.d*(S.y+S.height)+x.ty,J=Math.min(Math.min(j,B),Math.min(T,N)),C=Math.min(Math.min(R,U),Math.min(D,L)),F=_.length>0?{d:_,transform:void 0,styles:{fill:\"rgba(0, 0, 0, 0)\",stroke:null,strokeWidth:null,lineCap:null,lineJoin:null,miterLimit:null,lineDash:null}}:null;i.frames.push({alpha:null!==(O=t.alpha)&&void 0!==O?O:0,layout:S,transform:x,clipPath:_,shapes:I,nx:J,ny:C,maskPath:F})})),r.sprites.push(i)})),this.images=e},Jt=function(t){var e=new Uint8Array(t,0,4);return 80===e[0]&&75===e[1]&&3===e[2]&&4===e[3]?1:2};\n/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */var Ct,Ft=Lt.Root.fromJSON({nested:{com:{nested:{opensource:{nested:{svga:{options:{objc_class_prefix:\"SVGAProto\",java_package:\"com.opensource.svgaplayer\"},nested:{MovieParams:{fields:{viewBoxWidth:{type:\"float\",id:1},viewBoxHeight:{type:\"float\",id:2},fps:{type:\"int32\",id:3},frames:{type:\"int32\",id:4}}},SpriteEntity:{fields:{imageKey:{type:\"string\",id:1},frames:{rule:\"repeated\",type:\"FrameEntity\",id:2}}},Layout:{fields:{x:{type:\"float\",id:1},y:{type:\"float\",id:2},width:{type:\"float\",id:3},height:{type:\"float\",id:4}}},Transform:{fields:{a:{type:\"float\",id:1},b:{type:\"float\",id:2},c:{type:\"float\",id:3},d:{type:\"float\",id:4},tx:{type:\"float\",id:5},ty:{type:\"float\",id:6}}},ShapeEntity:{oneofs:{args:{oneof:[\"shape\",\"rect\",\"ellipse\"]}},fields:{type:{type:\"ShapeType\",id:1},shape:{type:\"ShapeArgs\",id:2},rect:{type:\"RectArgs\",id:3},ellipse:{type:\"EllipseArgs\",id:4},styles:{type:\"ShapeStyle\",id:10},transform:{type:\"Transform\",id:11}},nested:{ShapeType:{values:{SHAPE:0,RECT:1,ELLIPSE:2,KEEP:3}},ShapeArgs:{fields:{d:{type:\"string\",id:1}}},RectArgs:{fields:{x:{type:\"float\",id:1},y:{type:\"float\",id:2},width:{type:\"float\",id:3},height:{type:\"float\",id:4},cornerRadius:{type:\"float\",id:5}}},EllipseArgs:{fields:{x:{type:\"float\",id:1},y:{type:\"float\",id:2},radiusX:{type:\"float\",id:3},radiusY:{type:\"float\",id:4}}},ShapeStyle:{fields:{fill:{type:\"RGBAColor\",id:1},stroke:{type:\"RGBAColor\",id:2},strokeWidth:{type:\"float\",id:3},lineCap:{type:\"LineCap\",id:4},lineJoin:{type:\"LineJoin\",id:5},miterLimit:{type:\"float\",id:6},lineDashI:{type:\"float\",id:7},lineDashII:{type:\"float\",id:8},lineDashIII:{type:\"float\",id:9}},nested:{RGBAColor:{fields:{r:{type:\"float\",id:1},g:{type:\"float\",id:2},b:{type:\"float\",id:3},a:{type:\"float\",id:4}}},LineCap:{values:{LineCap_BUTT:0,LineCap_ROUND:1,LineCap_SQUARE:2}},LineJoin:{values:{LineJoin_MITER:0,LineJoin_ROUND:1,LineJoin_BEVEL:2}}}}}},FrameEntity:{fields:{alpha:{type:\"float\",id:1},layout:{type:\"Layout\",id:2},transform:{type:\"Transform\",id:3},clipPath:{type:\"string\",id:4},shapes:{rule:\"repeated\",type:\"ShapeEntity\",id:5}}},MovieEntity:{fields:{version:{type:\"string\",id:1},params:{type:\"MovieParams\",id:2},images:{keyType:\"string\",type:\"bytes\",id:3},sprites:{rule:\"repeated\",type:\"SpriteEntity\",id:4}}}}}}}}}}}).lookupType(\"com.opensource.svga.MovieEntity\");function Mt(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t,e){var i=new XMLHttpRequest;i.open(\"GET\",r,!0),i.responseType=\"arraybuffer\",i.onloadend=function(){void 0===i.response||200!==i.status&&304!==i.status?e(new Error(\"XMLHttpRequest, \".concat(i.statusText))):t(i.response)},i.send()}))];case 1:return[2,t.sent()]}}))}))}function Pt(r){return t(this,void 0,void 0,(function(){var t,i,n,s,o,a,l,f,h,u,p,d,c,y,v,m,g,b,w;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,7,,8]),t=r.data,i=t.url,n=t.options,[4,Mt(i)];case 1:if(s=e.sent(),o=new Uint8Array(s,0,4),2!==Jt(o))throw new Error(\"this parser only support version@2 of SVGA.\");for(p in a=new Rt.Inflate(new Uint8Array(s)).decompress(),l=Ft.decode(a),f={},h=l.images,u=[],h)u.push(p);d=0,e.label=2;case 2:return d<u.length?(p=u[d])in h?(c=p,y=l.images[c],n.isDisableImageBitmapShim||void 0===self.createImageBitmap?[3,4]:(v=f,m=c,[4,self.createImageBitmap(new Blob([y]))])):[3,5]:[3,6];case 3:return v[m]=e.sent(),[3,5];case 4:g=function(t){for(var e=\"\",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}(y),f[c]=btoa(g),e.label=5;case 5:return d++,[3,2];case 6:return Ct.postMessage(new Ut(l,f)),[3,8];case 7:return b=e.sent(),w=b.toString(),b instanceof Error&&(w=b.message),Ct.postMessage(new Error(\"[SVGA Parser Error] \".concat(w))),[3,8];case 8:return[2]}}))}))}void 0!==self.document?Ct=window.SVGAParserMockWorker={onmessageCallback:function(){},postMessage:function(t){this.onmessageCallback(t)},onmessage:Pt}:(Ct=self).onmessage=Pt}();\n",Parser=function(){function Parser(options){void 0===options&&(options={isDisableWebWorker:!1,isDisableImageBitmapShim:!1}),this.isDisableImageBitmapShim=!1;var isDisableWebWorker=options.isDisableWebWorker,isDisableImageBitmapShim=options.isDisableImageBitmapShim;if(!0===isDisableImageBitmapShim&&(this.isDisableImageBitmapShim=isDisableImageBitmapShim),!0===isDisableWebWorker){if(eval(INLINE_WORKER_FLAG),void 0===window.SVGAParserMockWorker)throw new Error("SVGAParserMockWorker undefined");this.worker=window.SVGAParserMockWorker}else this.worker=new Worker(window.URL.createObjectURL(new Blob([INLINE_WORKER_FLAG])))}return Parser.prototype.load=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(void 0===e)throw new Error("url undefined");if(void 0===this.worker)throw new Error("Parser Worker not found");return[4,new Promise((function(r,i){if(0!==e.indexOf("http")){var n=document.createElement("a");n.href=e,e=n.href}var o=t.isDisableImageBitmapShim,a={url:e,options:{isDisableImageBitmapShim:o}};t.worker instanceof Worker?(t.worker.onmessage=function(e){var t=e.data;t instanceof Error?i(t):r(t)},t.worker.postMessage(a)):(t.worker.onmessageCallback=function(e){e instanceof Error?i(e):r(e)},t.worker.onmessage({data:a}))}))];case 1:return[2,r.sent()]}}))}))},Parser.prototype.destroy=function(){this.worker instanceof Worker&&this.worker.terminate()},Parser}(),WORKER="onmessage = function () {setTimeout(function() {postMessage(null)}, 1000 / 60)}",Animator=function(){function e(){this.isRunning=!1,this.startTime=0,this.currentFrication=0,this.worker=null,this.isOpenNoExecutionDelay=!1,this.startValue=0,this.endValue=0,this.duration=0,this.loopStart=0,this.loop=1,this.fillRule=0,this.onStart=function(){},this.onUpdate=function(){},this.onEnd=function(){},this.currentTimeMillsecond=function(){return void 0===window.performance?Date.now():performance.now()}}return e.prototype.start=function(){this.isRunning=!0,this.startTime=this.currentTimeMillsecond(),this.currentFrication=0,this.isOpenNoExecutionDelay&&null===this.worker&&(this.worker=new Worker(window.URL.createObjectURL(new Blob([WORKER])))),this.onStart(),this.doFrame()},e.prototype.stop=function(){this.isRunning=!1,null!==this.worker&&(this.worker.terminate(),this.worker=null)},Object.defineProperty(e.prototype,"animatedValue",{get:function(){return Math.floor((this.endValue-this.startValue)*this.currentFrication+this.startValue)},enumerable:!1,configurable:!0}),e.prototype.doFrame=function(){this.isRunning&&(this.doDeltaTime(this.currentTimeMillsecond()-this.startTime),this.isRunning&&(null!==this.worker?(this.worker.onmessage=this.doFrame.bind(this),this.worker.postMessage(null)):window.requestAnimationFrame(this.doFrame.bind(this))))},e.prototype.doDeltaTime=function(e){e>=this.loopStart+(this.duration-this.loopStart)*this.loop?(this.currentFrication=1===this.fillRule?0:1,this.isRunning=!1):this.currentFrication=e<=this.duration?e/this.duration:((e-this.loopStart)%(this.duration-this.loopStart)+this.loopStart)/this.duration,this.onUpdate(this.animatedValue),this.isRunning||(null!==this.worker&&(this.worker.terminate(),this.worker=null),this.onEnd())},e}(),validMethods="MLHVCSQRZmlhvcsqrz";function render(e,t,r,i,n,o){var a=e.getContext("2d");if(null===a)throw new Error("Render Context cannot be null");if(!("save"in a))throw new Error("Render Context is not context2d");n.sprites.forEach((function(e){var n=t[e.imageKey],s=i[e.imageKey],u=r[e.imageKey];drawSprite(a,e,o,n,s,u)}))}function drawSprite(e,t,r,i,n,o){var a,s,u,l,c,h,d,f,m,v,p,y,b=t.frames[r];b.alpha<.05||(e.save(),e.globalAlpha=b.alpha,e.transform(null!==(s=null===(a=b.transform)||void 0===a?void 0:a.a)&&void 0!==s?s:1,null!==(l=null===(u=b.transform)||void 0===u?void 0:u.b)&&void 0!==l?l:0,null!==(h=null===(c=b.transform)||void 0===c?void 0:c.c)&&void 0!==h?h:0,null!==(f=null===(d=b.transform)||void 0===d?void 0:d.d)&&void 0!==f?f:1,null!==(v=null===(m=b.transform)||void 0===m?void 0:m.tx)&&void 0!==v?v:0,null!==(y=null===(p=b.transform)||void 0===p?void 0:p.ty)&&void 0!==y?y:0),void 0!==i&&(null!==b.maskPath&&(drawBezier(e,b.maskPath.d,b.maskPath.transform,b.maskPath.styles),e.clip()),void 0!==n?e.drawImage(n,0,0,b.layout.width,b.layout.height):e.drawImage(i,0,0,b.layout.width,b.layout.height)),void 0!==o&&e.drawImage(o,(b.layout.width-o.width)/2,(b.layout.height-o.height)/2),b.shapes.forEach((function(t){return drawShape(e,t)})),e.restore())}function drawShape(e,t){var r,i,n,o,a,s,u,l,c;switch(t.type){case"shape":drawBezier(e,t.path.d,t.transform,t.styles);break;case"ellipse":drawEllipse(e,null!==(r=t.path.x)&&void 0!==r?r:0,null!==(i=t.path.y)&&void 0!==i?i:0,null!==(n=t.path.radiusX)&&void 0!==n?n:0,null!==(o=t.path.radiusY)&&void 0!==o?o:0,t.transform,t.styles);break;case"rect":drawRect(e,null!==(a=t.path.x)&&void 0!==a?a:0,null!==(s=t.path.y)&&void 0!==s?s:0,null!==(u=t.path.width)&&void 0!==u?u:0,null!==(l=t.path.height)&&void 0!==l?l:0,null!==(c=t.path.cornerRadius)&&void 0!==c?c:0,t.transform,t.styles)}}function resetShapeStyles(e,t){void 0!==t&&(null!==t.stroke?e.strokeStyle=t.stroke:e.strokeStyle="transparent",null!==t.strokeWidth&&t.strokeWidth>0&&(e.lineWidth=t.strokeWidth),null!==t.miterLimit&&t.miterLimit>0&&(e.miterLimit=t.miterLimit),null!==t.lineCap&&(e.lineCap=t.lineCap),null!==t.lineJoin&&(e.lineJoin=t.lineJoin),null!==t.fill?e.fillStyle=t.fill:e.fillStyle="transparent",null!==t.lineDash&&e.setLineDash(t.lineDash))}function drawBezier(e,t,r,i){e.save(),resetShapeStyles(e,i),void 0!==r&&e.transform(r.a,r.b,r.c,r.d,r.tx,r.ty);var n={x:0,y:0,x1:0,y1:0,x2:0,y2:0};e.beginPath(),(t=t.replace(/([a-zA-Z])/g,"|||$1 ").replace(/,/g," ")).split("|||").forEach((function(t){if(0!==t.length){var r=t.substr(0,1);if(validMethods.includes(r)){var i=t.substr(1).trim().split(" ");drawBezierElement(e,n,r,i)}}})),null!==i.fill&&e.fill(),null!==i.stroke&&e.stroke(),e.restore()}function drawBezierElement(e,t,r,i){switch(r){case"M":t.x=Number(i[0]),t.y=Number(i[1]),e.moveTo(t.x,t.y);break;case"m":t.x+=Number(i[0]),t.y+=Number(i[1]),e.moveTo(t.x,t.y);break;case"L":t.x=Number(i[0]),t.y=Number(i[1]),e.lineTo(t.x,t.y);break;case"l":t.x+=Number(i[0]),t.y+=Number(i[1]),e.lineTo(t.x,t.y);break;case"H":t.x=Number(i[0]),e.lineTo(t.x,t.y);break;case"h":t.x+=Number(i[0]),e.lineTo(t.x,t.y);break;case"V":t.y=Number(i[0]),e.lineTo(t.x,t.y);break;case"v":t.y+=Number(i[0]),e.lineTo(t.x,t.y);break;case"C":t.x1=Number(i[0]),t.y1=Number(i[1]),t.x2=Number(i[2]),t.y2=Number(i[3]),t.x=Number(i[4]),t.y=Number(i[5]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"c":t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x2=t.x+Number(i[2]),t.y2=t.y+Number(i[3]),t.x+=Number(i[4]),t.y+=Number(i[5]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"S":void 0!==t.x1&&void 0!==t.y1&&void 0!==t.x2&&void 0!==t.y2?(t.x1=t.x-t.x2+t.x,t.y1=t.y-t.y2+t.y,t.x2=Number(i[0]),t.y2=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)):(t.x1=Number(i[0]),t.y1=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y));break;case"s":void 0!==t.x1&&void 0!==t.y1&&void 0!==t.x2&&void 0!==t.y2?(t.x1=t.x-t.x2+t.x,t.y1=t.y-t.y2+t.y,t.x2=t.x+Number(i[0]),t.y2=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)):(t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y));break;case"Q":t.x1=Number(i[0]),t.y1=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y);break;case"q":t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y);break;case"A":case"a":break;case"Z":case"z":e.closePath()}}function drawEllipse(e,t,r,i,n,o,a){e.save(),resetShapeStyles(e,a),void 0!==o&&e.transform(o.a,o.b,o.c,o.d,o.tx,o.ty);var s=2*i,u=2*n,l=s/2*.5522848,c=u/2*.5522848,h=(t-=i)+s,d=(r-=n)+u,f=t+s/2,m=r+u/2;e.beginPath(),e.moveTo(t,m),e.bezierCurveTo(t,m-c,f-l,r,f,r),e.bezierCurveTo(f+l,r,h,m-c,h,m),e.bezierCurveTo(h,m+c,f+l,d,f,d),e.bezierCurveTo(f-l,d,t,m+c,t,m),null!==a.fill&&e.fill(),null!==a.stroke&&e.stroke(),e.restore()}function drawRect(e,t,r,i,n,o,a,s){e.save(),resetShapeStyles(e,s),void 0!==a&&e.transform(a.a,a.b,a.c,a.d,a.tx,a.ty);var u=o;i<2*u&&(u=i/2),n<2*u&&(u=n/2),e.beginPath(),e.moveTo(t+u,r),e.arcTo(t+i,r,t+i,r+n,u),e.arcTo(t+i,r+n,t,r+n,u),e.arcTo(t,r+n,t,r,u),e.arcTo(t,r,t+i,r,u),e.closePath(),null!==s.fill&&e.fill(),null!==s.stroke&&e.stroke(),e.restore()}var inBrowser="undefined"!=typeof window,hasIntersectionObserver=inBrowser&&"IntersectionObserver"in window,Player=function(){function e(e){var t,r=this;this.currentFrame=0,this.totalFrames=0,this.videoEntity=void 0,this.config={container:document.createElement("canvas"),loop:0,fillMode:"forwards",playMode:"forwards",startFrame:0,endFrame:0,loopStartFrame:0,isCacheFrames:!1,isUseIntersectionObserver:!1,isOpenNoExecutionDelay:!1},this.isBeIntersection=!0,this.intersectionObserver=null,this.bitmapsCache={},this.cacheFrames={},this.animator=new Animator,this.animator.onEnd=function(){void 0!==r.onEnd&&r.onEnd()},e instanceof HTMLCanvasElement?t=e:void 0!==e.container&&(t=e.container,this.setConfig(e)),this.config.container=null!=t?t:this.config.container,this.ofsCanvas=void 0!==window.OffscreenCanvas?new window.OffscreenCanvas(this.config.container.width,this.config.container.height):document.createElement("canvas")}return e.prototype.setConfig=function(e){var t,r,i,n,o,a,s,u,l,c,h;if(void 0!==e.startFrame&&void 0!==e.endFrame&&e.startFrame>e.endFrame)throw new Error("StartFrame should > EndFrame");this.config.container=null!==(t=e.container)&&void 0!==t?t:this.config.container,this.config.loop=null!==(r=e.loop)&&void 0!==r?r:0,this.config.fillMode=null!==(i=e.fillMode)&&void 0!==i?i:"forwards",this.config.playMode=null!==(n=e.playMode)&&void 0!==n?n:"forwards",this.config.startFrame=null!==(o=e.startFrame)&&void 0!==o?o:0,this.config.endFrame=null!==(a=e.endFrame)&&void 0!==a?a:0,this.config.loopStartFrame=null!==(s=e.loopStartFrame)&&void 0!==s?s:0,this.config.isCacheFrames=null!==(u=e.isCacheFrames)&&void 0!==u&&u,this.config.isUseIntersectionObserver=null!==(l=e.isUseIntersectionObserver)&&void 0!==l&&l,this.config.isOpenNoExecutionDelay=null!==(c=e.isOpenNoExecutionDelay)&&void 0!==c&&c,this.animator.isOpenNoExecutionDelay=null!==(h=e.isOpenNoExecutionDelay)&&void 0!==h&&h,this.setIntersectionObserver()},e.prototype.setIntersectionObserver=function(){var e=this;hasIntersectionObserver&&this.config.isUseIntersectionObserver?(this.intersectionObserver=new IntersectionObserver((function(t){e.isBeIntersection=!(t[0].intersectionRatio<=0)}),{rootMargin:"0px",threshold:[0,.5,1]}),this.intersectionObserver.observe(this.config.container)):(null!==this.intersectionObserver&&this.intersectionObserver.disconnect(),this.config.isUseIntersectionObserver=!1,this.isBeIntersection=!0)},e.prototype.mount=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,i){if(t.currentFrame=0,t.totalFrames=e.frames-1,t.videoEntity=e,t.clearContainer(),t.setSize(),t.bitmapsCache={},void 0!==t.videoEntity)if(0!==Object.keys(t.videoEntity.images).length){var n=0,o=0;for(var a in t.videoEntity.images){var s=t.videoEntity.images[a];if("string"==typeof s){n++;var u=document.createElement("img");u.src="data:image/png;base64,"+s,t.bitmapsCache[a]=u,u.onload=function(){++o===n&&r()}}else t.bitmapsCache[a]=s,n++,++o===n&&r()}}else r();else r()}))];case 1:return[2,r.sent()]}}))}))},e.prototype.clearContainer=function(){var e=this.config.container.width;this.config.container.width=e},e.prototype.start=function(){if(void 0===this.videoEntity)throw new Error("videoEntity undefined");this.clearContainer(),this.startAnimation(),void 0!==this.onStart&&this.onStart()},e.prototype.resume=function(){this.startAnimation(),void 0!==this.onResume&&this.onResume()},e.prototype.pause=function(){this.animator.stop(),void 0!==this.onPause&&this.onPause()},e.prototype.stop=function(){this.animator.stop(),this.currentFrame=0,this.clearContainer(),void 0!==this.onStop&&this.onStop()},e.prototype.clear=function(){this.clearContainer()},e.prototype.destroy=function(){this.animator.stop(),this.clearContainer(),this.animator=null,this.videoEntity=null},e.prototype.startAnimation=function(){var e=this;if(void 0===this.videoEntity)throw new Error("videoEntity undefined");var t=this.config,r=this.totalFrames,i=this.videoEntity,n=t.playMode,o=t.startFrame,a=t.endFrame,s=t.loopStartFrame,u=t.fillMode,l=t.loop;this.currentFrame===r&&(this.currentFrame=o>0?o:0),"forwards"===n?(this.animator.startValue=o>0?o:0,this.animator.endValue=a>0?a:r):(this.animator.startValue=a>0?a:r,this.animator.endValue=o>0?o:0);var c=i.frames;a>0&&a>o?c=a-o:a<=0&&o>0&&(c=i.frames-o),this.animator.duration=c*(1/i.fps)*1e3,this.animator.loopStart=s>o?(s-o)*(1/i.fps)*1e3:0,this.animator.loop=!0===l||l<=0?1/0:!1===l?1:l,this.animator.fillRule="backwards"===u?1:0,this.animator.onUpdate=function(t){e.currentFrame!==t&&(e.currentFrame=t,e.drawFrame(e.currentFrame),void 0!==e.onProcess&&e.onProcess())},this.animator.start()},e.prototype.setSize=function(){if(void 0===this.videoEntity)throw new Error("videoEntity undefined");var e=this.videoEntity.size;this.config.container.width=e.width,this.config.container.height=e.height},e.prototype.drawFrame=function(e){if(void 0===this.videoEntity)throw new Error("Player VideoEntity undefined");if(!this.config.isUseIntersectionObserver||this.isBeIntersection){this.clearContainer();var t=this.config.container.getContext("2d");if(null===t)throw new Error("Canvas Context cannot be null");if(this.config.isCacheFrames&&void 0!==this.cacheFrames[e]){var r=this.cacheFrames[e];t.drawImage(r,0,0,r.width,r.height,0,0,r.width,r.height)}else{var i=this.ofsCanvas;if(void 0!==window.OffscreenCanvas&&window.navigator.userAgent.includes("Firefox")&&(i=new window.OffscreenCanvas(this.config.container.width,this.config.container.height)),i.width=this.config.container.width,i.height=this.config.container.height,render(i,this.bitmapsCache,this.videoEntity.dynamicElements,this.videoEntity.replaceElements,this.videoEntity,this.currentFrame),t.drawImage(i,0,0,i.width,i.height,0,0,i.width,i.height),this.config.isCacheFrames)if("toDataURL"in i){var n=i.toDataURL(),o=new Image;o.src=n,this.cacheFrames[e]=o}else this.cacheFrames[e]=i.transferToImageBitmap()}}},e}(),DB=function(){function e(e){var t=void 0===e?{name:"SVGA.DB",version:1,storeName:"files"}:e,r=t.name,i=t.version,n=t.storeName;this.storeName=n,this.dbPromise=new Promise((function(e,t){if(void 0===window.indexedDB)throw new Error("[SVGA.DB] indexedDB not supported");var o=window.indexedDB.open(r,i);o.onerror=function(e){return t(new Error("[SVGA.DB] indexedDB open fail, ".concat(e.type)))},o.onsuccess=function(){return e(o.result)},o.onupgradeneeded=function(){o.result.createObjectStore(n)}}))}return e.prototype.find=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.dbPromise.then((function(r){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,new Promise((function(i,n){var o=r.transaction([t.storeName],"readonly").objectStore(t.storeName).get(e);o.onsuccess=function(){"string"==typeof o.result?i(JSON.parse(o.result)):i(void 0)},o.onerror=function(){return n(new Error("find error"))}}))];case 1:return[2,i.sent()]}}))}))}))];case 1:return[2,r.sent()]}}))}))},e.prototype.insert=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.dbPromise.then((function(i){return __awaiter(r,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(n,o){var a=i.transaction([r.storeName],"readwrite"),s=a.objectStore(r.storeName).put(JSON.stringify(t),e);a.oncomplete=function(){return n()},s.onerror=function(){return o(new Error("insert error"))}}))];case 1:return[2,n.sent()]}}))}))}))];case 1:return[2,i.sent()]}}))}))},e.prototype.delete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.dbPromise.then((function(r){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,new Promise((function(i,n){var o=r.transaction([t.storeName],"readwrite").objectStore(t.storeName).delete(e);o.onsuccess=function(){return i()},o.onerror=function(){return n(new Error("delete error"))}}))];case 1:return[2,i.sent()]}}))}))}))];case 1:return[2,r.sent()]}}))}))},e}();exports.DB=DB,exports.Parser=Parser,exports.Player=Player,Object.defineProperty(exports,"__esModule",{value:!0})}));