@netless/slide 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Slide.js CHANGED
@@ -32,7 +32,7 @@ object-assign
32
32
  *
33
33
  * MIT License
34
34
  */
35
- function(){"use strict";var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){if(!this.ctx||!this.ctx.listener)return this;for(var e=this._howls.length-1;e>=0;e--)this._howls[e].stereo(t);return this},HowlerGlobal.prototype.pos=function(t,e,n){return this.ctx&&this.ctx.listener?(e="number"!=typeof e?this._pos[1]:e,n="number"!=typeof n?this._pos[2]:n,"number"!=typeof t?this._pos:(this._pos=[t,e,n],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(t,e,n,i,r,o){if(!this.ctx||!this.ctx.listener)return this;var s=this._orientation;return e="number"!=typeof e?s[1]:e,n="number"!=typeof n?s[2]:n,i="number"!=typeof i?s[3]:i,r="number"!=typeof r?s[4]:r,o="number"!=typeof o?s[5]:o,"number"!=typeof t?s:(this._orientation=[t,e,n,i,r,o],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(t,e,n,i,r,o),this)},Howl.prototype.init=(t=Howl.prototype.init,function(e){return this._orientation=e.orientation||[1,0,0],this._stereo=e.stereo||null,this._pos=e.pos||null,this._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},this._onstereo=e.onstereo?[{fn:e.onstereo}]:[],this._onpos=e.onpos?[{fn:e.onpos}]:[],this._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,n){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"stereo",action:function(){i.stereo(t,n)}}),i;var r=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof t)return i._stereo;i._stereo=t,i._pos=[t,0,0]}for(var o=i._getSoundIds(n),s=0;s<o.length;s++){var a=i._soundById(o[s]);if(a){if("number"!=typeof t)return a._stereo;a._stereo=t,a._pos=[t,0,0],a._node&&(a._pannerAttr.panningModel="equalpower",a._panner&&a._panner.pan||e(a,r),"spatial"===r?void 0!==a._panner.positionX?(a._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):a._panner.setPosition(t,0,0):a._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),i._emit("stereo",a._id)}}return i},Howl.prototype.pos=function(t,n,i,r){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"pos",action:function(){o.pos(t,n,i,r)}}),o;if(n="number"!=typeof n?0:n,i="number"!=typeof i?-.5:i,void 0===r){if("number"!=typeof t)return o._pos;o._pos=[t,n,i]}for(var s=o._getSoundIds(r),a=0;a<s.length;a++){var l=o._soundById(s[a]);if(l){if("number"!=typeof t)return l._pos;l._pos=[t,n,i],l._node&&(l._panner&&!l._panner.pan||e(l,"spatial"),void 0!==l._panner.positionX?(l._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),l._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),l._panner.positionZ.setValueAtTime(i,Howler.ctx.currentTime)):l._panner.setPosition(t,n,i)),o._emit("pos",l._id)}}return o},Howl.prototype.orientation=function(t,n,i,r){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"orientation",action:function(){o.orientation(t,n,i,r)}}),o;if(n="number"!=typeof n?o._orientation[1]:n,i="number"!=typeof i?o._orientation[2]:i,void 0===r){if("number"!=typeof t)return o._orientation;o._orientation=[t,n,i]}for(var s=o._getSoundIds(r),a=0;a<s.length;a++){var l=o._soundById(s[a]);if(l){if("number"!=typeof t)return l._orientation;l._orientation=[t,n,i],l._node&&(l._panner||(l._pos||(l._pos=o._pos||[0,0,-.5]),e(l,"spatial")),void 0!==l._panner.orientationX?(l._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),l._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),l._panner.orientationZ.setValueAtTime(i,Howler.ctx.currentTime)):l._panner.setOrientation(t,n,i)),o._emit("orientation",l._id)}}return o},Howl.prototype.pannerAttr=function(){var t,n,i,r=this,o=arguments;if(!r._webAudio)return r;if(0===o.length)return r._pannerAttr;if(1===o.length){if("object"!=typeof o[0])return(i=r._soundById(parseInt(o[0],10)))?i._pannerAttr:r._pannerAttr;t=o[0],void 0===n&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),r._pannerAttr={coneInnerAngle:void 0!==t.pannerAttr.coneInnerAngle?t.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:void 0!==t.pannerAttr.coneOuterAngle?t.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:void 0!==t.pannerAttr.coneOuterGain?t.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:void 0!==t.pannerAttr.distanceModel?t.pannerAttr.distanceModel:r._distanceModel,maxDistance:void 0!==t.pannerAttr.maxDistance?t.pannerAttr.maxDistance:r._maxDistance,refDistance:void 0!==t.pannerAttr.refDistance?t.pannerAttr.refDistance:r._refDistance,rolloffFactor:void 0!==t.pannerAttr.rolloffFactor?t.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:void 0!==t.pannerAttr.panningModel?t.pannerAttr.panningModel:r._panningModel})}else 2===o.length&&(t=o[0],n=parseInt(o[1],10));for(var s=r._getSoundIds(n),a=0;a<s.length;a++)if(i=r._soundById(s[a])){var l=i._pannerAttr;l={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:l.coneInnerAngle,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:l.coneOuterAngle,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:l.coneOuterGain,distanceModel:void 0!==t.distanceModel?t.distanceModel:l.distanceModel,maxDistance:void 0!==t.maxDistance?t.maxDistance:l.maxDistance,refDistance:void 0!==t.refDistance?t.refDistance:l.refDistance,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:l.rolloffFactor,panningModel:void 0!==t.panningModel?t.panningModel:l.panningModel};var u=i._panner;u?(u.coneInnerAngle=l.coneInnerAngle,u.coneOuterAngle=l.coneOuterAngle,u.coneOuterGain=l.coneOuterGain,u.distanceModel=l.distanceModel,u.maxDistance=l.maxDistance,u.refDistance=l.refDistance,u.rolloffFactor=l.rolloffFactor,u.panningModel=l.panningModel):(i._pos||(i._pos=r._pos||[0,0,-.5]),e(i,"spatial"))}return r},Sound.prototype.init=function(t){return function(){var e=this._parent;this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,t.call(this),this._stereo?e.stereo(this._stereo):this._pos&&e.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var e=this._parent;return this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,this._stereo?e.stereo(this._stereo):this._pos?e.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,e._refreshBuffer(this)),t.call(this)}}(Sound.prototype.reset);var e=function(t,e){"spatial"===(e=e||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}}()}).call(this,n(4))},function(t,e){t.exports="varying vec2 vTextureCoord;\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\nuniform sampler2D uSampler;\nvoid main() {\n\tvec4 outputColor;\n\tfloat percent = vPercent;\n\tfloat direction = vDirection;\n\tif (vTransition < 0.0) {\n\t\tpercent = 1.0 - percent;\n\t\tif ((vDirection > 1.5) && (vDirection < 2.5)) {\n\t\t\tdirection = 1.0;\n\t\t}\n\t\telse if ((vDirection > 0.5) && (vDirection < 1.5)) {\n\t\t\tdirection = 2.0;\n\t\t}\n\t\telse if ((vDirection > 2.5) && (vDirection < 3.5)) {\n\t\t\tdirection = 4.0;\n\t\t}\n\t\telse {\n\t\t\tdirection = 3.0;\n\t\t}\n\t}\n\tif ((direction > 1.5) && (direction < 2.5)) {\n\t\tif (vVertexPosition.y >= (1.0 - percent)) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.y >= (1.0 - percent)) && (vVertexPosition.y <= ((1.0 - percent) + 0.2))) {\n\t\t\toutputColor = outputColor * ((vVertexPosition.y - (1.0 - percent)) / 0.2);\n\t\t}\n\t}\n\telse if ((direction > 0.5) && (direction < 1.5)) {\n\t\tif (vVertexPosition.y <= percent) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.y <= percent) && (vVertexPosition.y >= (percent - 0.2))) {\n\t\t\toutputColor = outputColor * (1.0 - ((vVertexPosition.y - (percent - 0.2)) / 0.2));\n\t\t}\n\t}\n\telse if ((direction > 2.5) && (direction < 3.5)) {\n\t\tif (vVertexPosition.x <= percent) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.x <= percent) && (vVertexPosition.x >= (percent - 0.2))) {\n\t\t\toutputColor = outputColor * (1.0 - ((vVertexPosition.x - (percent - 0.2)) / 0.2));\n\t\t}\n\t}\n\telse {\n\t\tif (vVertexPosition.x >= (1.0 - percent)) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.x >= (1.0 - percent)) && (vVertexPosition.x <= ((1.0 - percent) + 0.2))) {\n\t\t\toutputColor = outputColor * ((vVertexPosition.x - (1.0 - percent)) / 0.2);\n\t\t}\n\t}\n\tgl_FragColor = outputColor;\n}\n"},function(t,e){t.exports="attribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nuniform float percent;\nuniform float direction;\nuniform float transition;\nvec4 filterVertexPosition() {\n\tvec2 position = (aVertexPosition * max(outputFrame.zw, vec2(0.))) + outputFrame.xy;\n\treturn vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\nvec2 filterTextureCoord(vec2 aVertexPosition) {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tvTransition = transition;\n\tvDirection = direction;\n\tvPercent = percent;\n\tvVertexPosition = aVertexPosition;\n\tvec2 localVertexPosition = aVertexPosition;\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord(localVertexPosition);\n}\n"},function(t,e){t.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nuniform float transition;\nvoid main() {\n\tfloat alpha = (transition * (percent - 0.5)) + 0.5;\n\tvec4 color1 = texture2D(uSampler, vTextureCoord);\n\tgl_FragColor = color1 * alpha;\n}\n"},function(t,e,n){var i;!function(r,o){"use strict";var s="model",a="name",l="type",u="vendor",h="version",c="mobile",d="tablet",p="smarttv",f=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},m=function(t,e){return"string"==typeof t&&-1!==g(e).indexOf(g(t))},g=function(t){return t.toLowerCase()},v=function(t,e){if("string"==typeof t)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),void 0===e?t:t.substring(0,255)},_=function(t,e){for(var n,i,r,o,s,a,l=0;l<e.length&&!s;){var u=e[l],h=e[l+1];for(n=i=0;n<u.length&&!s;)if(s=u[n++].exec(t))for(r=0;r<h.length;r++)a=s[++i],"object"==typeof(o=h[r])&&o.length>0?2===o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,a):this[o[0]]=o[1]:3===o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=a?a.replace(o[1],o[2]):void 0:this[o[0]]=a?o[1].call(this,a,o[2]):void 0:4===o.length&&(this[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):void 0):this[o]=a||void 0;l+=2}},y=function(t,e){for(var n in e)if("object"==typeof e[n]&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(m(e[n][i],t))return"?"===n?void 0:n}else if(m(e[n],t))return"?"===n?void 0:n;return t},x={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},b={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[a,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[a,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[a,h],[/opios[\/ ]+([\w\.]+)/i],[h,[a,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[h,[a,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[a,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[a,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[h,[a,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[a,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[a,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[a,"IE"]],[/yabrowser\/([\w\.]+)/i],[h,[a,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[a,/(.+)/,"$1 Secure Browser"],h],[/\bfocus\/([\w\.]+)/i],[h,[a,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[h,[a,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[a,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[a,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[a,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[a,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[h,[a,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[a,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[a,/(.+)/,"$1 Browser"],h],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[a,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[a],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[a,"Facebook"],h],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[a,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[a,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[a,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[a,"Chrome WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[a,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[a,h],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[h,[a,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[h,a],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[a,[h,y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[a,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[a,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[a,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[a,h]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",g]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",g]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",g]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[s,[u,"Samsung"],[l,d]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[s,[u,"Samsung"],[l,c]],[/\((ip(?:hone|od)[\w ]*);/i],[s,[u,"Apple"],[l,c]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[s,[u,"Apple"],[l,d]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[s,[u,"Huawei"],[l,d]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[s,[u,"Huawei"],[l,c]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[s,/_/g," "],[u,"Xiaomi"],[l,c]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[s,/_/g," "],[u,"Xiaomi"],[l,d]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[s,[u,"OPPO"],[l,c]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[s,[u,"Vivo"],[l,c]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[s,[u,"Realme"],[l,c]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[s,[u,"Motorola"],[l,c]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[s,[u,"Motorola"],[l,d]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[u,"LG"],[l,d]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[s,[u,"LG"],[l,c]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[s,[u,"Lenovo"],[l,d]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[s,/_/g," "],[u,"Nokia"],[l,c]],[/(pixel c)\b/i],[s,[u,"Google"],[l,d]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[s,[u,"Google"],[l,c]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[s,[u,"Sony"],[l,c]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[s,"Xperia Tablet"],[u,"Sony"],[l,d]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[s,[u,"OnePlus"],[l,c]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[s,[u,"Amazon"],[l,d]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[s,/(.+)/g,"Fire Phone $1"],[u,"Amazon"],[l,c]],[/(playbook);[-\w\),; ]+(rim)/i],[s,u,[l,d]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[s,[u,"BlackBerry"],[l,c]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[s,[u,"ASUS"],[l,d]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[s,[u,"ASUS"],[l,c]],[/(nexus 9)/i],[s,[u,"HTC"],[l,d]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[u,[s,/_/g," "],[l,c]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[s,[u,"Acer"],[l,d]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[s,[u,"Meizu"],[l,c]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[s,[u,"Sharp"],[l,c]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,s,[l,c]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[u,s,[l,d]],[/(surface duo)/i],[s,[u,"Microsoft"],[l,d]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[s,[u,"Fairphone"],[l,c]],[/(u304aa)/i],[s,[u,"AT&T"],[l,c]],[/\bsie-(\w*)/i],[s,[u,"Siemens"],[l,c]],[/\b(rct\w+) b/i],[s,[u,"RCA"],[l,d]],[/\b(venue[\d ]{2,7}) b/i],[s,[u,"Dell"],[l,d]],[/\b(q(?:mv|ta)\w+) b/i],[s,[u,"Verizon"],[l,d]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[s,[u,"Barnes & Noble"],[l,d]],[/\b(tm\d{3}\w+) b/i],[s,[u,"NuVision"],[l,d]],[/\b(k88) b/i],[s,[u,"ZTE"],[l,d]],[/\b(nx\d{3}j) b/i],[s,[u,"ZTE"],[l,c]],[/\b(gen\d{3}) b.+49h/i],[s,[u,"Swiss"],[l,c]],[/\b(zur\d{3}) b/i],[s,[u,"Swiss"],[l,d]],[/\b((zeki)?tb.*\b) b/i],[s,[u,"Zeki"],[l,d]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[u,"Dragon Touch"],s,[l,d]],[/\b(ns-?\w{0,9}) b/i],[s,[u,"Insignia"],[l,d]],[/\b((nxa|next)-?\w{0,9}) b/i],[s,[u,"NextBook"],[l,d]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[u,"Voice"],s,[l,c]],[/\b(lvtel\-)?(v1[12]) b/i],[[u,"LvTel"],s,[l,c]],[/\b(ph-1) /i],[s,[u,"Essential"],[l,c]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[s,[u,"Envizen"],[l,d]],[/\b(trio[-\w\. ]+) b/i],[s,[u,"MachSpeed"],[l,d]],[/\btu_(1491) b/i],[s,[u,"Rotor"],[l,d]],[/(shield[\w ]+) b/i],[s,[u,"Nvidia"],[l,d]],[/(sprint) (\w+)/i],[u,s,[l,c]],[/(kin\.[onetw]{3})/i],[[s,/\./g," "],[u,"Microsoft"],[l,c]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[s,[u,"Zebra"],[l,d]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[s,[u,"Zebra"],[l,c]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[u,s,[l,"console"]],[/droid.+; (shield) bui/i],[s,[u,"Nvidia"],[l,"console"]],[/(playstation [345portablevi]+)/i],[s,[u,"Sony"],[l,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[s,[u,"Microsoft"],[l,"console"]],[/smart-tv.+(samsung)/i],[u,[l,p]],[/hbbtv.+maple;(\d+)/i],[[s,/^/,"SmartTV"],[u,"Samsung"],[l,p]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,"LG"],[l,p]],[/(apple) ?tv/i],[u,[s,"Apple TV"],[l,p]],[/crkey/i],[[s,"Chromecast"],[u,"Google"],[l,p]],[/droid.+aft(\w)( bui|\))/i],[s,[u,"Amazon"],[l,p]],[/\(dtv[\);].+(aquos)/i],[s,[u,"Sharp"],[l,p]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[u,v],[s,v],[l,p]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,p]],[/((pebble))app/i],[u,s,[l,"wearable"]],[/droid.+; (glass) \d/i],[s,[u,"Google"],[l,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[s,[u,"Zebra"],[l,"wearable"]],[/(quest( 2)?)/i],[s,[u,"Facebook"],[l,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[s,[l,c]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[s,[l,d]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,d]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,c]],[/(android[-\w\. ]{0,9});.+buil/i],[s,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[a,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[a,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[a,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,a]],os:[[/microsoft (windows) (vista|xp)/i],[a,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[a,[h,y,x]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[a,"Windows"],[h,y,x]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[a,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[a,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[h,a],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[a,h],[/\(bb(10);/i],[h,[a,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[a,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[a,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[a,"webOS"]],[/crkey\/([\d\.]+)/i],[h,[a,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[a,"Chromium OS"],h],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[a,h],[/(sunos) ?([\w\.\d]*)/i],[[a,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[a,h]]},w=function(t,e){if("object"==typeof t&&(e=t,t=void 0),!(this instanceof w))return new w(t,e).getResult();var n=t||(void 0!==r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=e?function(t,e){var n={};for(var i in t)e[i]&&e[i].length%2==0?n[i]=e[i].concat(t[i]):n[i]=t[i];return n}(b,e):b;return this.getBrowser=function(){var t,e={};return e[a]=void 0,e[h]=void 0,_.call(e,n,i.browser),e.major="string"==typeof(t=e.version)?t.replace(/[^\d\.]/g,"").split(".")[0]:void 0,e},this.getCPU=function(){var t={architecture:void 0};return _.call(t,n,i.cpu),t},this.getDevice=function(){var t={vendor:void 0,model:void 0,type:void 0};return _.call(t,n,i.device),t},this.getEngine=function(){var t={name:void 0,version:void 0};return _.call(t,n,i.engine),t},this.getOS=function(){var t={name:void 0,version:void 0};return _.call(t,n,i.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(t){return n="string"==typeof t&&t.length>255?v(t,255):t,this},this.setUA(n),this};w.VERSION="1.0.2",w.BROWSER=f([a,h,"major"]),w.CPU=f(["architecture"]),w.DEVICE=f([s,u,l,"console",c,p,d,"wearable","embedded"]),w.ENGINE=w.OS=f([a,h]),void 0!==e?(void 0!==t&&t.exports&&(e=t.exports=w),e.UAParser=w):n(64)?void 0===(i=function(){return w}.call(e,n,e,t))||(t.exports=i):void 0!==r&&(r.UAParser=w);var T=void 0!==r&&(r.jQuery||r.Zepto);if(T&&!T.ua){var S=new w;T.ua=S.getResult(),T.ua.get=function(){return S.getUA()},T.ua.set=function(t){S.setUA(t);var e=S.getResult();for(var n in e)T.ua[n]=e[n]}}}("object"==typeof window?window:this)},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(56),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(4))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,o,s,a,l=1,u={},h=!1,c=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){f(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){f(t.data)},i=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(r=c.documentElement,i=function(t){var e=c.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(f,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&f(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(s+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return u[l]=r,i(l),l++},d.clearImmediate=p}function p(t){delete u[t]}function f(t){if(h)setTimeout(f,0,t);else{var e=u[t];if(e){h=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{p(t),h=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(4),n(57))},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var l,u=[],h=!1,c=-1;function d(){h&&l&&(h=!1,l.length?u=l.concat(u):c=-1,u.length&&p())}function p(){if(!h){var t=a(d);h=!0;for(var e=u.length;e;){for(l=u,u=[];++c<e;)l&&l[c].run();c=-1,e=u.length}l=null,h=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||h||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){(function(t,i){var r;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof i&&i;s.global!==s&&s.window!==s&&s.self;var a,l=2147483647,u=/^xn--/,h=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,f=String.fromCharCode;function m(t){throw new RangeError(d[t])}function g(t,e){for(var n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function v(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),i+g((t=t.replace(c,".")).split("."),e).join(".")}function _(t){for(var e,n,i=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(n=t.charCodeAt(r++)))?i.push(((1023&e)<<10)+(1023&n)+65536):(i.push(e),r--):i.push(e);return i}function y(t){return g(t,(function(t){var e="";return t>65535&&(e+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=f(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,n){var i=0;for(t=n?p(t/700):t>>1,t+=p(t/e);t>455;i+=36)t=p(t/35);return p(i+36*t/(t+38))}function w(t){var e,n,i,r,o,s,a,u,h,c,d,f=[],g=t.length,v=0,_=128,x=72;for((n=t.lastIndexOf("-"))<0&&(n=0),i=0;i<n;++i)t.charCodeAt(i)>=128&&m("not-basic"),f.push(t.charCodeAt(i));for(r=n>0?n+1:0;r<g;){for(o=v,s=1,a=36;r>=g&&m("invalid-input"),((u=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>p((l-v)/s))&&m("overflow"),v+=u*s,!(u<(h=a<=x?1:a>=x+26?26:a-x));a+=36)s>p(l/(c=36-h))&&m("overflow"),s*=c;x=b(v-o,e=f.length+1,0==o),p(v/e)>l-_&&m("overflow"),_+=p(v/e),v%=e,f.splice(v++,0,_)}return y(f)}function T(t){var e,n,i,r,o,s,a,u,h,c,d,g,v,y,w,T=[];for(g=(t=_(t)).length,e=128,n=0,o=72,s=0;s<g;++s)(d=t[s])<128&&T.push(f(d));for(i=r=T.length,r&&T.push("-");i<g;){for(a=l,s=0;s<g;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>p((l-n)/(v=i+1))&&m("overflow"),n+=(a-e)*v,e=a,s=0;s<g;++s)if((d=t[s])<e&&++n>l&&m("overflow"),d==e){for(u=n,h=36;!(u<(c=h<=o?1:h>=o+26?26:h-o));h+=36)w=u-c,y=36-c,T.push(f(x(c+w%y,0))),u=p(w/y);T.push(f(x(u,0))),o=b(n,v,i==r),n=0,++i}++n,++e}return T.join("")}a={version:"1.4.1",ucs2:{decode:_,encode:y},decode:w,encode:T,toASCII:function(t){return v(t,(function(t){return h.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return v(t,(function(t){return u.test(t)?w(t.slice(4).toLowerCase()):t}))}},void 0===(r=function(){return a}.call(e,n,e,t))||(t.exports=r)}()}).call(this,n(8)(t),n(4))},function(t,e,n){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,n){"use strict";e.decode=e.parse=n(61),e.encode=e.stringify=n(62)},function(t,e,n){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,o){e=e||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var h=0;h<u;++h){var c,d,p,f,m=t[h].replace(a,"%20"),g=m.indexOf(n);g>=0?(c=m.substr(0,g),d=m.substr(g+1)):(c=m,d=""),p=decodeURIComponent(c),f=decodeURIComponent(d),i(s,p)?r(s[p])?s[p].push(f):s[p]=[s[p],f]:s[p]=f}return s};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,a){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(i(s))+n;return r(t[s])?o(t[s],(function(t){return a+encodeURIComponent(i(t))})).join(e):a+encodeURIComponent(i(t[s]))})).join(e):a?encodeURIComponent(i(a))+n+encodeURIComponent(i(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],i=0;i<t.length;i++)n.push(e(t[i],i));return n}var s=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}},function(t,e){var n=function(){};n.prototype={fit:function(t){var e,n,i,r,o=t.length,s=o>0?t[0].width:0,a=o>0?t[0].height:0;for(this.root={x:0,y:0,width:s,height:a},e=0;e<o;e++)i=t[e],(n=this.findNode(this.root,i.width,i.height))?(r=this.splitNode(n,i.width,i.height),i.x=r.x,i.y=r.y):(r=this.growNode(i.width,i.height),i.x=r.x,i.y=r.y)},findNode:function(t,e,n){return t.used?this.findNode(t.right,e,n)||this.findNode(t.down,e,n):e<=t.width&&n<=t.height?t:null},splitNode:function(t,e,n){return t.used=!0,t.down={x:t.x,y:t.y+n,width:t.width,height:t.height-n},t.right={x:t.x+e,y:t.y,width:t.width-e,height:n},t},growNode:function(t,e){var n=t<=this.root.width,i=e<=this.root.height,r=i&&this.root.height>=this.root.width+t,o=n&&this.root.width>=this.root.height+e;return r?this.growRight(t,e):o?this.growDown(t,e):i?this.growRight(t,e):n?this.growDown(t,e):null},growRight:function(t,e){var n;return this.root={used:!0,x:0,y:0,width:this.root.width+t,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:t,height:this.root.height}},(n=this.findNode(this.root,t,e))?this.splitNode(n,t,e):null},growDown:function(t,e){var n;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+e,down:{x:0,y:this.root.height,width:this.root.width,height:e},right:this.root},(n=this.findNode(this.root,t,e))?this.splitNode(n,t,e):null}},t.exports=n},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";n.r(e),n.d(e,"ErrorType",(function(){return WE})),n.d(e,"delay",(function(){return rI})),n.d(e,"waitUntil",(function(){return oI})),n.d(e,"SLIDE_EVENTS",(function(){return sI})),n.d(e,"Slide",(function(){return uI}));var i={};n.r(i),n.d(i,"ACESFilmicToneMapping",(function(){return ut})),n.d(i,"AddEquation",(function(){return O})),n.d(i,"AddOperation",(function(){return rt})),n.d(i,"AdditiveAnimationBlendMode",(function(){return Qe})),n.d(i,"AdditiveBlending",(function(){return R})),n.d(i,"AlphaFormat",(function(){return jt})),n.d(i,"AlwaysDepth",(function(){return Z})),n.d(i,"AlwaysStencilFunc",(function(){return In})),n.d(i,"AmbientLight",(function(){return kc})),n.d(i,"AmbientLightProbe",(function(){return ad})),n.d(i,"AnimationClip",(function(){return sc})),n.d(i,"AnimationLoader",(function(){return fc})),n.d(i,"AnimationMixer",(function(){return Bd})),n.d(i,"AnimationObjectGroup",(function(){return Dd})),n.d(i,"AnimationUtils",(function(){return qh})),n.d(i,"ArcCurve",(function(){return Ru})),n.d(i,"ArrayCamera",(function(){return Qa})),n.d(i,"ArrowHelper",(function(){return Mp})),n.d(i,"Audio",(function(){return _d})),n.d(i,"AudioAnalyser",(function(){return Sd})),n.d(i,"AudioContext",(function(){return rd})),n.d(i,"AudioListener",(function(){return vd})),n.d(i,"AudioLoader",(function(){return od})),n.d(i,"AxesHelper",(function(){return Ap})),n.d(i,"AxisHelper",(function(){return Af})),n.d(i,"BackSide",(function(){return w})),n.d(i,"BasicDepthPacking",(function(){return dn})),n.d(i,"BasicShadowMap",(function(){return v})),n.d(i,"BinaryTextureLoader",(function(){return Of})),n.d(i,"Bone",(function(){return Ul})),n.d(i,"BooleanKeyframeTrack",(function(){return Qh})),n.d(i,"BoundingBoxHelper",(function(){return Rf})),n.d(i,"Box2",(function(){return qd})),n.d(i,"Box3",(function(){return vi})),n.d(i,"Box3Helper",(function(){return bp})),n.d(i,"BoxBufferGeometry",(function(){return Ro})),n.d(i,"BoxGeometry",(function(){return Ro})),n.d(i,"BoxHelper",(function(){return xp})),n.d(i,"BufferAttribute",(function(){return Gr})),n.d(i,"BufferGeometry",(function(){return ao})),n.d(i,"BufferGeometryLoader",(function(){return qc})),n.d(i,"ByteType",(function(){return Ot})),n.d(i,"Cache",(function(){return lc})),n.d(i,"Camera",(function(){return Lo})),n.d(i,"CameraHelper",(function(){return vp})),n.d(i,"CanvasRenderer",(function(){return Nf})),n.d(i,"CanvasTexture",(function(){return fu})),n.d(i,"CatmullRomCurve3",(function(){return Nu})),n.d(i,"CineonToneMapping",(function(){return lt})),n.d(i,"CircleBufferGeometry",(function(){return gu})),n.d(i,"CircleGeometry",(function(){return gu})),n.d(i,"ClampToEdgeWrapping",(function(){return yt})),n.d(i,"Clock",(function(){return cd})),n.d(i,"Color",(function(){return Fr})),n.d(i,"ColorKeyframeTrack",(function(){return tc})),n.d(i,"CompressedTexture",(function(){return pu})),n.d(i,"CompressedTextureLoader",(function(){return mc})),n.d(i,"ConeBufferGeometry",(function(){return _u})),n.d(i,"ConeGeometry",(function(){return _u})),n.d(i,"CubeCamera",(function(){return Do})),n.d(i,"CubeReflectionMapping",(function(){return dt})),n.d(i,"CubeRefractionMapping",(function(){return pt})),n.d(i,"CubeTexture",(function(){return Fo})),n.d(i,"CubeTextureLoader",(function(){return vc})),n.d(i,"CubeUVReflectionMapping",(function(){return gt})),n.d(i,"CubeUVRefractionMapping",(function(){return vt})),n.d(i,"CubicBezierCurve",(function(){return Uu})),n.d(i,"CubicBezierCurve3",(function(){return ku})),n.d(i,"CubicInterpolant",(function(){return Zh})),n.d(i,"CullFaceBack",(function(){return f})),n.d(i,"CullFaceFront",(function(){return m})),n.d(i,"CullFaceFrontBack",(function(){return g})),n.d(i,"CullFaceNone",(function(){return p})),n.d(i,"Curve",(function(){return Mu})),n.d(i,"CurvePath",(function(){return xc})),n.d(i,"CustomBlending",(function(){return I})),n.d(i,"CustomToneMapping",(function(){return ht})),n.d(i,"CylinderBufferGeometry",(function(){return vu})),n.d(i,"CylinderGeometry",(function(){return vu})),n.d(i,"Cylindrical",(function(){return Wd})),n.d(i,"DataTexture",(function(){return kl})),n.d(i,"DataTexture2DArray",(function(){return cs})),n.d(i,"DataTexture3D",(function(){return ds})),n.d(i,"DataTextureLoader",(function(){return _c})),n.d(i,"DataUtils",(function(){return Pp})),n.d(i,"DecrementStencilOp",(function(){return xn})),n.d(i,"DecrementWrapStencilOp",(function(){return wn})),n.d(i,"DefaultLoadingManager",(function(){return hc})),n.d(i,"DepthFormat",(function(){return Zt})),n.d(i,"DepthStencilFormat",(function(){return Jt})),n.d(i,"DepthTexture",(function(){return mu})),n.d(i,"DirectionalLight",(function(){return Uc})),n.d(i,"DirectionalLightHelper",(function(){return fp})),n.d(i,"DiscreteInterpolant",(function(){return Kh})),n.d(i,"DodecahedronBufferGeometry",(function(){return xu})),n.d(i,"DodecahedronGeometry",(function(){return xu})),n.d(i,"DoubleSide",(function(){return T})),n.d(i,"DstAlphaFactor",(function(){return j})),n.d(i,"DstColorFactor",(function(){return W})),n.d(i,"DynamicBufferAttribute",(function(){return vf})),n.d(i,"DynamicCopyUsage",(function(){return kn})),n.d(i,"DynamicDrawUsage",(function(){return Ln})),n.d(i,"DynamicReadUsage",(function(){return Fn})),n.d(i,"EdgesGeometry",(function(){return Eu})),n.d(i,"EdgesHelper",(function(){return Cf})),n.d(i,"EllipseCurve",(function(){return Au})),n.d(i,"EqualDepth",(function(){return $})),n.d(i,"EqualStencilFunc",(function(){return Mn})),n.d(i,"EquirectangularReflectionMapping",(function(){return ft})),n.d(i,"EquirectangularRefractionMapping",(function(){return mt})),n.d(i,"Euler",(function(){return er})),n.d(i,"EventDispatcher",(function(){return jn})),n.d(i,"ExtrudeBufferGeometry",(function(){return xh})),n.d(i,"ExtrudeGeometry",(function(){return xh})),n.d(i,"FaceColors",(function(){return sf})),n.d(i,"FileLoader",(function(){return pc})),n.d(i,"FlatShading",(function(){return S})),n.d(i,"Float16BufferAttribute",(function(){return Yr})),n.d(i,"Float32Attribute",(function(){return Ef})),n.d(i,"Float32BufferAttribute",(function(){return Zr})),n.d(i,"Float64Attribute",(function(){return Mf})),n.d(i,"Float64BufferAttribute",(function(){return Jr})),n.d(i,"FloatType",(function(){return Bt})),n.d(i,"Fog",(function(){return ll})),n.d(i,"FogExp2",(function(){return al})),n.d(i,"Font",(function(){return td})),n.d(i,"FontLoader",(function(){return nd})),n.d(i,"FrontSide",(function(){return b})),n.d(i,"Frustum",(function(){return Vo})),n.d(i,"GLBufferAttribute",(function(){return Gd})),n.d(i,"GLSL1",(function(){return Hn})),n.d(i,"GLSL3",(function(){return zn})),n.d(i,"GammaEncoding",(function(){return sn})),n.d(i,"GreaterDepth",(function(){return tt})),n.d(i,"GreaterEqualDepth",(function(){return Q})),n.d(i,"GreaterEqualStencilFunc",(function(){return Pn})),n.d(i,"GreaterStencilFunc",(function(){return Rn})),n.d(i,"GridHelper",(function(){return up})),n.d(i,"Group",(function(){return tl})),n.d(i,"HalfFloatType",(function(){return Ut})),n.d(i,"HemisphereLight",(function(){return Sc})),n.d(i,"HemisphereLightHelper",(function(){return lp})),n.d(i,"HemisphereLightProbe",(function(){return sd})),n.d(i,"IcosahedronBufferGeometry",(function(){return wh})),n.d(i,"IcosahedronGeometry",(function(){return wh})),n.d(i,"ImageBitmapLoader",(function(){return $c})),n.d(i,"ImageLoader",(function(){return gc})),n.d(i,"ImageUtils",(function(){return oi})),n.d(i,"ImmediateRenderObject",(function(){return Kd})),n.d(i,"IncrementStencilOp",(function(){return yn})),n.d(i,"IncrementWrapStencilOp",(function(){return bn})),n.d(i,"InstancedBufferAttribute",(function(){return Xc})),n.d(i,"InstancedBufferGeometry",(function(){return Wc})),n.d(i,"InstancedInterleavedBuffer",(function(){return kd})),n.d(i,"InstancedMesh",(function(){return ql})),n.d(i,"Int16Attribute",(function(){return bf})),n.d(i,"Int16BufferAttribute",(function(){return Vr})),n.d(i,"Int32Attribute",(function(){return Tf})),n.d(i,"Int32BufferAttribute",(function(){return Xr})),n.d(i,"Int8Attribute",(function(){return _f})),n.d(i,"Int8BufferAttribute",(function(){return Hr})),n.d(i,"IntType",(function(){return Dt})),n.d(i,"InterleavedBuffer",(function(){return hl})),n.d(i,"InterleavedBufferAttribute",(function(){return dl})),n.d(i,"Interpolant",(function(){return Yh})),n.d(i,"InterpolateDiscrete",(function(){return Xe})),n.d(i,"InterpolateLinear",(function(){return qe})),n.d(i,"InterpolateSmooth",(function(){return Ye})),n.d(i,"InvertStencilOp",(function(){return Tn})),n.d(i,"JSONLoader",(function(){return Df})),n.d(i,"KeepStencilOp",(function(){return vn})),n.d(i,"KeyframeTrack",(function(){return $h})),n.d(i,"LOD",(function(){return Il})),n.d(i,"LatheBufferGeometry",(function(){return Th})),n.d(i,"LatheGeometry",(function(){return Th})),n.d(i,"Layers",(function(){return nr})),n.d(i,"LensFlare",(function(){return Bf})),n.d(i,"LessDepth",(function(){return J})),n.d(i,"LessEqualDepth",(function(){return K})),n.d(i,"LessEqualStencilFunc",(function(){return An})),n.d(i,"LessStencilFunc",(function(){return En})),n.d(i,"Light",(function(){return Tc})),n.d(i,"LightProbe",(function(){return zc})),n.d(i,"Line",(function(){return tu})),n.d(i,"Line3",(function(){return Jd})),n.d(i,"LineBasicMaterial",(function(){return Yl})),n.d(i,"LineCurve",(function(){return Gu})),n.d(i,"LineCurve3",(function(){return Hu})),n.d(i,"LineDashedMaterial",(function(){return Wh})),n.d(i,"LineLoop",(function(){return ru})),n.d(i,"LinePieces",(function(){return rf})),n.d(i,"LineSegments",(function(){return iu})),n.d(i,"LineStrip",(function(){return nf})),n.d(i,"LinearEncoding",(function(){return rn})),n.d(i,"LinearFilter",(function(){return Mt})),n.d(i,"LinearInterpolant",(function(){return Jh})),n.d(i,"LinearMipMapLinearFilter",(function(){return Pt})),n.d(i,"LinearMipMapNearestFilter",(function(){return Rt})),n.d(i,"LinearMipmapLinearFilter",(function(){return Ct})),n.d(i,"LinearMipmapNearestFilter",(function(){return At})),n.d(i,"LinearToneMapping",(function(){return st})),n.d(i,"Loader",(function(){return cc})),n.d(i,"LoaderUtils",(function(){return Vc})),n.d(i,"LoadingManager",(function(){return uc})),n.d(i,"LogLuvEncoding",(function(){return ln})),n.d(i,"LoopOnce",(function(){return je})),n.d(i,"LoopPingPong",(function(){return We})),n.d(i,"LoopRepeat",(function(){return Ve})),n.d(i,"LuminanceAlphaFormat",(function(){return qt})),n.d(i,"LuminanceFormat",(function(){return Xt})),n.d(i,"MOUSE",(function(){return c})),n.d(i,"Material",(function(){return Cr})),n.d(i,"MaterialLoader",(function(){return jc})),n.d(i,"Math",(function(){return ei})),n.d(i,"MathUtils",(function(){return ei})),n.d(i,"Matrix3",(function(){return ii})),n.d(i,"Matrix4",(function(){return Wi})),n.d(i,"MaxEquation",(function(){return F})),n.d(i,"Mesh",(function(){return Mo})),n.d(i,"MeshBasicMaterial",(function(){return Br})),n.d(i,"MeshDepthMaterial",(function(){return qa})),n.d(i,"MeshDistanceMaterial",(function(){return Ya})),n.d(i,"MeshFaceMaterial",(function(){return lf})),n.d(i,"MeshLambertMaterial",(function(){return jh})),n.d(i,"MeshMatcapMaterial",(function(){return Vh})),n.d(i,"MeshNormalMaterial",(function(){return zh})),n.d(i,"MeshPhongMaterial",(function(){return Gh})),n.d(i,"MeshPhysicalMaterial",(function(){return kh})),n.d(i,"MeshStandardMaterial",(function(){return Uh})),n.d(i,"MeshToonMaterial",(function(){return Hh})),n.d(i,"MinEquation",(function(){return D})),n.d(i,"MirroredRepeatWrapping",(function(){return xt})),n.d(i,"MixOperation",(function(){return it})),n.d(i,"MultiMaterial",(function(){return uf})),n.d(i,"MultiplyBlending",(function(){return P})),n.d(i,"MultiplyOperation",(function(){return nt})),n.d(i,"NearestFilter",(function(){return bt})),n.d(i,"NearestMipMapLinearFilter",(function(){return Et})),n.d(i,"NearestMipMapNearestFilter",(function(){return Tt})),n.d(i,"NearestMipmapLinearFilter",(function(){return St})),n.d(i,"NearestMipmapNearestFilter",(function(){return wt})),n.d(i,"NeverDepth",(function(){return Y})),n.d(i,"NeverStencilFunc",(function(){return Sn})),n.d(i,"NoBlending",(function(){return M})),n.d(i,"NoColors",(function(){return of})),n.d(i,"NoToneMapping",(function(){return ot})),n.d(i,"NormalAnimationBlendMode",(function(){return $e})),n.d(i,"NormalBlending",(function(){return A})),n.d(i,"NotEqualDepth",(function(){return et})),n.d(i,"NotEqualStencilFunc",(function(){return Cn})),n.d(i,"NumberKeyframeTrack",(function(){return ec})),n.d(i,"Object3D",(function(){return gr})),n.d(i,"ObjectLoader",(function(){return Yc})),n.d(i,"ObjectSpaceNormalMap",(function(){return mn})),n.d(i,"OctahedronBufferGeometry",(function(){return Sh})),n.d(i,"OctahedronGeometry",(function(){return Sh})),n.d(i,"OneFactor",(function(){return U})),n.d(i,"OneMinusDstAlphaFactor",(function(){return V})),n.d(i,"OneMinusDstColorFactor",(function(){return X})),n.d(i,"OneMinusSrcAlphaFactor",(function(){return z})),n.d(i,"OneMinusSrcColorFactor",(function(){return G})),n.d(i,"OrthographicCamera",(function(){return Fc})),n.d(i,"PCFShadowMap",(function(){return _})),n.d(i,"PCFSoftShadowMap",(function(){return y})),n.d(i,"PMREMGenerator",(function(){return qp})),n.d(i,"ParametricBufferGeometry",(function(){return Eh})),n.d(i,"ParametricGeometry",(function(){return Eh})),n.d(i,"Particle",(function(){return cf})),n.d(i,"ParticleBasicMaterial",(function(){return ff})),n.d(i,"ParticleSystem",(function(){return df})),n.d(i,"ParticleSystemMaterial",(function(){return mf})),n.d(i,"Path",(function(){return bc})),n.d(i,"PerspectiveCamera",(function(){return No})),n.d(i,"Plane",(function(){return Ho})),n.d(i,"PlaneBufferGeometry",(function(){return qo})),n.d(i,"PlaneGeometry",(function(){return qo})),n.d(i,"PlaneHelper",(function(){return wp})),n.d(i,"PointCloud",(function(){return hf})),n.d(i,"PointCloudMaterial",(function(){return pf})),n.d(i,"PointLight",(function(){return Dc})),n.d(i,"PointLightHelper",(function(){return rp})),n.d(i,"Points",(function(){return hu})),n.d(i,"PointsMaterial",(function(){return ou})),n.d(i,"PolarGridHelper",(function(){return hp})),n.d(i,"PolyhedronBufferGeometry",(function(){return yu})),n.d(i,"PolyhedronGeometry",(function(){return yu})),n.d(i,"PositionalAudio",(function(){return Td})),n.d(i,"PropertyBinding",(function(){return Nd})),n.d(i,"PropertyMixer",(function(){return Ed})),n.d(i,"QuadraticBezierCurve",(function(){return zu})),n.d(i,"QuadraticBezierCurve3",(function(){return ju})),n.d(i,"Quaternion",(function(){return pi})),n.d(i,"QuaternionKeyframeTrack",(function(){return ic})),n.d(i,"QuaternionLinearInterpolant",(function(){return nc})),n.d(i,"REVISION",(function(){return h})),n.d(i,"RGBADepthPacking",(function(){return pn})),n.d(i,"RGBAFormat",(function(){return Wt})),n.d(i,"RGBAIntegerFormat",(function(){return ne})),n.d(i,"RGBA_ASTC_10x10_Format",(function(){return Ee})),n.d(i,"RGBA_ASTC_10x5_Format",(function(){return we})),n.d(i,"RGBA_ASTC_10x6_Format",(function(){return Te})),n.d(i,"RGBA_ASTC_10x8_Format",(function(){return Se})),n.d(i,"RGBA_ASTC_12x10_Format",(function(){return Me})),n.d(i,"RGBA_ASTC_12x12_Format",(function(){return Ae})),n.d(i,"RGBA_ASTC_4x4_Format",(function(){return fe})),n.d(i,"RGBA_ASTC_5x4_Format",(function(){return me})),n.d(i,"RGBA_ASTC_5x5_Format",(function(){return ge})),n.d(i,"RGBA_ASTC_6x5_Format",(function(){return ve})),n.d(i,"RGBA_ASTC_6x6_Format",(function(){return _e})),n.d(i,"RGBA_ASTC_8x5_Format",(function(){return ye})),n.d(i,"RGBA_ASTC_8x6_Format",(function(){return xe})),n.d(i,"RGBA_ASTC_8x8_Format",(function(){return be})),n.d(i,"RGBA_BPTC_Format",(function(){return Re})),n.d(i,"RGBA_ETC2_EAC_Format",(function(){return pe})),n.d(i,"RGBA_PVRTC_2BPPV1_Format",(function(){return he})),n.d(i,"RGBA_PVRTC_4BPPV1_Format",(function(){return ue})),n.d(i,"RGBA_S3TC_DXT1_Format",(function(){return re})),n.d(i,"RGBA_S3TC_DXT3_Format",(function(){return oe})),n.d(i,"RGBA_S3TC_DXT5_Format",(function(){return se})),n.d(i,"RGBDEncoding",(function(){return cn})),n.d(i,"RGBEEncoding",(function(){return an})),n.d(i,"RGBEFormat",(function(){return Yt})),n.d(i,"RGBFormat",(function(){return Vt})),n.d(i,"RGBIntegerFormat",(function(){return ee})),n.d(i,"RGBM16Encoding",(function(){return hn})),n.d(i,"RGBM7Encoding",(function(){return un})),n.d(i,"RGB_ETC1_Format",(function(){return ce})),n.d(i,"RGB_ETC2_Format",(function(){return de})),n.d(i,"RGB_PVRTC_2BPPV1_Format",(function(){return le})),n.d(i,"RGB_PVRTC_4BPPV1_Format",(function(){return ae})),n.d(i,"RGB_S3TC_DXT1_Format",(function(){return ie})),n.d(i,"RGFormat",(function(){return Qt})),n.d(i,"RGIntegerFormat",(function(){return te})),n.d(i,"RawShaderMaterial",(function(){return Bh})),n.d(i,"Ray",(function(){return Vi})),n.d(i,"Raycaster",(function(){return Hd})),n.d(i,"RectAreaLight",(function(){return Gc})),n.d(i,"RedFormat",(function(){return Kt})),n.d(i,"RedIntegerFormat",(function(){return $t})),n.d(i,"ReinhardToneMapping",(function(){return at})),n.d(i,"RepeatWrapping",(function(){return _t})),n.d(i,"ReplaceStencilOp",(function(){return _n})),n.d(i,"ReverseSubtractEquation",(function(){return N})),n.d(i,"RingBufferGeometry",(function(){return Mh})),n.d(i,"RingGeometry",(function(){return Mh})),n.d(i,"SRGB8_ALPHA8_ASTC_10x10_Format",(function(){return Ge})),n.d(i,"SRGB8_ALPHA8_ASTC_10x5_Format",(function(){return Be})),n.d(i,"SRGB8_ALPHA8_ASTC_10x6_Format",(function(){return Ue})),n.d(i,"SRGB8_ALPHA8_ASTC_10x8_Format",(function(){return ke})),n.d(i,"SRGB8_ALPHA8_ASTC_12x10_Format",(function(){return He})),n.d(i,"SRGB8_ALPHA8_ASTC_12x12_Format",(function(){return ze})),n.d(i,"SRGB8_ALPHA8_ASTC_4x4_Format",(function(){return Ce})),n.d(i,"SRGB8_ALPHA8_ASTC_5x4_Format",(function(){return Pe})),n.d(i,"SRGB8_ALPHA8_ASTC_5x5_Format",(function(){return Ie})),n.d(i,"SRGB8_ALPHA8_ASTC_6x5_Format",(function(){return Oe})),n.d(i,"SRGB8_ALPHA8_ASTC_6x6_Format",(function(){return Le})),n.d(i,"SRGB8_ALPHA8_ASTC_8x5_Format",(function(){return Ne})),n.d(i,"SRGB8_ALPHA8_ASTC_8x6_Format",(function(){return De})),n.d(i,"SRGB8_ALPHA8_ASTC_8x8_Format",(function(){return Fe})),n.d(i,"Scene",(function(){return ul})),n.d(i,"SceneUtils",(function(){return Ff})),n.d(i,"ShaderChunk",(function(){return Yo})),n.d(i,"ShaderLib",(function(){return Jo})),n.d(i,"ShaderMaterial",(function(){return Oo})),n.d(i,"ShadowMaterial",(function(){return Fh})),n.d(i,"Shape",(function(){return wc})),n.d(i,"ShapeBufferGeometry",(function(){return Ah})),n.d(i,"ShapeGeometry",(function(){return Ah})),n.d(i,"ShapePath",(function(){return Qc})),n.d(i,"ShapeUtils",(function(){return vh})),n.d(i,"ShortType",(function(){return Lt})),n.d(i,"Skeleton",(function(){return zl})),n.d(i,"SkeletonHelper",(function(){return ip})),n.d(i,"SkinnedMesh",(function(){return Bl})),n.d(i,"SmoothShading",(function(){return E})),n.d(i,"Sphere",(function(){return Fi})),n.d(i,"SphereBufferGeometry",(function(){return Rh})),n.d(i,"SphereGeometry",(function(){return Rh})),n.d(i,"Spherical",(function(){return Vd})),n.d(i,"SphericalHarmonics3",(function(){return Hc})),n.d(i,"SplineCurve",(function(){return Vu})),n.d(i,"SpotLight",(function(){return Pc})),n.d(i,"SpotLightHelper",(function(){return Qd})),n.d(i,"Sprite",(function(){return Al})),n.d(i,"SpriteMaterial",(function(){return pl})),n.d(i,"SrcAlphaFactor",(function(){return H})),n.d(i,"SrcAlphaSaturateFactor",(function(){return q})),n.d(i,"SrcColorFactor",(function(){return k})),n.d(i,"StaticCopyUsage",(function(){return Un})),n.d(i,"StaticDrawUsage",(function(){return On})),n.d(i,"StaticReadUsage",(function(){return Dn})),n.d(i,"StereoCamera",(function(){return hd})),n.d(i,"StreamCopyUsage",(function(){return Gn})),n.d(i,"StreamDrawUsage",(function(){return Nn})),n.d(i,"StreamReadUsage",(function(){return Bn})),n.d(i,"StringKeyframeTrack",(function(){return rc})),n.d(i,"SubtractEquation",(function(){return L})),n.d(i,"SubtractiveBlending",(function(){return C})),n.d(i,"TOUCH",(function(){return d})),n.d(i,"TangentSpaceNormalMap",(function(){return fn})),n.d(i,"TetrahedronBufferGeometry",(function(){return Ch})),n.d(i,"TetrahedronGeometry",(function(){return Ch})),n.d(i,"TextBufferGeometry",(function(){return Ph})),n.d(i,"TextGeometry",(function(){return Ph})),n.d(i,"Texture",(function(){return ai})),n.d(i,"TextureLoader",(function(){return yc})),n.d(i,"TorusBufferGeometry",(function(){return Ih})),n.d(i,"TorusGeometry",(function(){return Ih})),n.d(i,"TorusKnotBufferGeometry",(function(){return Oh})),n.d(i,"TorusKnotGeometry",(function(){return Oh})),n.d(i,"Triangle",(function(){return Ar})),n.d(i,"TriangleFanDrawMode",(function(){return nn})),n.d(i,"TriangleStripDrawMode",(function(){return en})),n.d(i,"TrianglesDrawMode",(function(){return tn})),n.d(i,"TubeBufferGeometry",(function(){return Lh})),n.d(i,"TubeGeometry",(function(){return Lh})),n.d(i,"UVMapping",(function(){return ct})),n.d(i,"Uint16Attribute",(function(){return wf})),n.d(i,"Uint16BufferAttribute",(function(){return Wr})),n.d(i,"Uint32Attribute",(function(){return Sf})),n.d(i,"Uint32BufferAttribute",(function(){return qr})),n.d(i,"Uint8Attribute",(function(){return yf})),n.d(i,"Uint8BufferAttribute",(function(){return zr})),n.d(i,"Uint8ClampedAttribute",(function(){return xf})),n.d(i,"Uint8ClampedBufferAttribute",(function(){return jr})),n.d(i,"Uniform",(function(){return Ud})),n.d(i,"UniformsLib",(function(){return Zo})),n.d(i,"UniformsUtils",(function(){return Io})),n.d(i,"UnsignedByteType",(function(){return It})),n.d(i,"UnsignedInt248Type",(function(){return zt})),n.d(i,"UnsignedIntType",(function(){return Ft})),n.d(i,"UnsignedShort4444Type",(function(){return kt})),n.d(i,"UnsignedShort5551Type",(function(){return Gt})),n.d(i,"UnsignedShort565Type",(function(){return Ht})),n.d(i,"UnsignedShortType",(function(){return Nt})),n.d(i,"VSMShadowMap",(function(){return x})),n.d(i,"Vector2",(function(){return ni})),n.d(i,"Vector3",(function(){return fi})),n.d(i,"Vector4",(function(){return ui})),n.d(i,"VectorKeyframeTrack",(function(){return oc})),n.d(i,"Vertex",(function(){return gf})),n.d(i,"VertexColors",(function(){return af})),n.d(i,"VideoTexture",(function(){return du})),n.d(i,"WebGL1Renderer",(function(){return sl})),n.d(i,"WebGLCubeRenderTarget",(function(){return Bo})),n.d(i,"WebGLMultipleRenderTargets",(function(){return ci})),n.d(i,"WebGLMultisampleRenderTarget",(function(){return di})),n.d(i,"WebGLRenderTarget",(function(){return hi})),n.d(i,"WebGLRenderTargetCube",(function(){return Lf})),n.d(i,"WebGLRenderer",(function(){return ol})),n.d(i,"WebGLUtils",(function(){return $a})),n.d(i,"WireframeGeometry",(function(){return Nh})),n.d(i,"WireframeHelper",(function(){return Pf})),n.d(i,"WrapAroundEnding",(function(){return Ke})),n.d(i,"XHRLoader",(function(){return If})),n.d(i,"ZeroCurvatureEnding",(function(){return Ze})),n.d(i,"ZeroFactor",(function(){return B})),n.d(i,"ZeroSlopeEnding",(function(){return Je})),n.d(i,"ZeroStencilOp",(function(){return gn})),n.d(i,"sRGBEncoding",(function(){return on}));var r={};n.r(r),n.d(r,"isMobile",(function(){return Jg})),n.d(r,"EventEmitter",(function(){return _v.a})),n.d(r,"earcut",(function(){return xv.a})),n.d(r,"BaseTextureCache",(function(){return Qv})),n.d(r,"CanvasRenderTarget",(function(){return n_})),n.d(r,"DATA_URI",(function(){return o_})),n.d(r,"ProgramCache",(function(){return Kv})),n.d(r,"TextureCache",(function(){return $v})),n.d(r,"clearTextureCache",(function(){return e_})),n.d(r,"correctBlendMode",(function(){return Nv})),n.d(r,"createIndicesForQuads",(function(){return Uv})),n.d(r,"decomposeDataUri",(function(){return s_})),n.d(r,"deprecation",(function(){return Jv})),n.d(r,"destroyTextureCache",(function(){return t_})),n.d(r,"determineCrossOrigin",(function(){return a_})),n.d(r,"getBufferType",(function(){return kv})),n.d(r,"getResolutionOfUrl",(function(){return l_})),n.d(r,"hex2rgb",(function(){return Cv})),n.d(r,"hex2string",(function(){return Pv})),n.d(r,"interleaveTypedArrays",(function(){return Hv})),n.d(r,"isPow2",(function(){return jv})),n.d(r,"isWebGLSupported",(function(){return Av})),n.d(r,"log2",(function(){return Vv})),n.d(r,"nextPow2",(function(){return zv})),n.d(r,"premultiplyBlendMode",(function(){return Lv})),n.d(r,"premultiplyRgba",(function(){return Dv})),n.d(r,"premultiplyTint",(function(){return Fv})),n.d(r,"premultiplyTintToRgba",(function(){return Bv})),n.d(r,"removeItems",(function(){return Wv})),n.d(r,"rgb2hex",(function(){return Ov})),n.d(r,"sayHello",(function(){return Mv})),n.d(r,"sign",(function(){return Xv})),n.d(r,"skipHello",(function(){return Ev})),n.d(r,"string2hex",(function(){return Iv})),n.d(r,"trimCanvas",(function(){return i_})),n.d(r,"uid",(function(){return Yv})),n.d(r,"url",(function(){return wv}));var o=n(6),s=n(0),a=n.n(s),l=n(2),u=n(1);
35
+ function(){"use strict";var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){if(!this.ctx||!this.ctx.listener)return this;for(var e=this._howls.length-1;e>=0;e--)this._howls[e].stereo(t);return this},HowlerGlobal.prototype.pos=function(t,e,n){return this.ctx&&this.ctx.listener?(e="number"!=typeof e?this._pos[1]:e,n="number"!=typeof n?this._pos[2]:n,"number"!=typeof t?this._pos:(this._pos=[t,e,n],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(t,e,n,i,r,o){if(!this.ctx||!this.ctx.listener)return this;var s=this._orientation;return e="number"!=typeof e?s[1]:e,n="number"!=typeof n?s[2]:n,i="number"!=typeof i?s[3]:i,r="number"!=typeof r?s[4]:r,o="number"!=typeof o?s[5]:o,"number"!=typeof t?s:(this._orientation=[t,e,n,i,r,o],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(t,e,n,i,r,o),this)},Howl.prototype.init=(t=Howl.prototype.init,function(e){return this._orientation=e.orientation||[1,0,0],this._stereo=e.stereo||null,this._pos=e.pos||null,this._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},this._onstereo=e.onstereo?[{fn:e.onstereo}]:[],this._onpos=e.onpos?[{fn:e.onpos}]:[],this._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,n){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"stereo",action:function(){i.stereo(t,n)}}),i;var r=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof t)return i._stereo;i._stereo=t,i._pos=[t,0,0]}for(var o=i._getSoundIds(n),s=0;s<o.length;s++){var a=i._soundById(o[s]);if(a){if("number"!=typeof t)return a._stereo;a._stereo=t,a._pos=[t,0,0],a._node&&(a._pannerAttr.panningModel="equalpower",a._panner&&a._panner.pan||e(a,r),"spatial"===r?void 0!==a._panner.positionX?(a._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):a._panner.setPosition(t,0,0):a._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),i._emit("stereo",a._id)}}return i},Howl.prototype.pos=function(t,n,i,r){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"pos",action:function(){o.pos(t,n,i,r)}}),o;if(n="number"!=typeof n?0:n,i="number"!=typeof i?-.5:i,void 0===r){if("number"!=typeof t)return o._pos;o._pos=[t,n,i]}for(var s=o._getSoundIds(r),a=0;a<s.length;a++){var l=o._soundById(s[a]);if(l){if("number"!=typeof t)return l._pos;l._pos=[t,n,i],l._node&&(l._panner&&!l._panner.pan||e(l,"spatial"),void 0!==l._panner.positionX?(l._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),l._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),l._panner.positionZ.setValueAtTime(i,Howler.ctx.currentTime)):l._panner.setPosition(t,n,i)),o._emit("pos",l._id)}}return o},Howl.prototype.orientation=function(t,n,i,r){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"orientation",action:function(){o.orientation(t,n,i,r)}}),o;if(n="number"!=typeof n?o._orientation[1]:n,i="number"!=typeof i?o._orientation[2]:i,void 0===r){if("number"!=typeof t)return o._orientation;o._orientation=[t,n,i]}for(var s=o._getSoundIds(r),a=0;a<s.length;a++){var l=o._soundById(s[a]);if(l){if("number"!=typeof t)return l._orientation;l._orientation=[t,n,i],l._node&&(l._panner||(l._pos||(l._pos=o._pos||[0,0,-.5]),e(l,"spatial")),void 0!==l._panner.orientationX?(l._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),l._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),l._panner.orientationZ.setValueAtTime(i,Howler.ctx.currentTime)):l._panner.setOrientation(t,n,i)),o._emit("orientation",l._id)}}return o},Howl.prototype.pannerAttr=function(){var t,n,i,r=this,o=arguments;if(!r._webAudio)return r;if(0===o.length)return r._pannerAttr;if(1===o.length){if("object"!=typeof o[0])return(i=r._soundById(parseInt(o[0],10)))?i._pannerAttr:r._pannerAttr;t=o[0],void 0===n&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),r._pannerAttr={coneInnerAngle:void 0!==t.pannerAttr.coneInnerAngle?t.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:void 0!==t.pannerAttr.coneOuterAngle?t.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:void 0!==t.pannerAttr.coneOuterGain?t.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:void 0!==t.pannerAttr.distanceModel?t.pannerAttr.distanceModel:r._distanceModel,maxDistance:void 0!==t.pannerAttr.maxDistance?t.pannerAttr.maxDistance:r._maxDistance,refDistance:void 0!==t.pannerAttr.refDistance?t.pannerAttr.refDistance:r._refDistance,rolloffFactor:void 0!==t.pannerAttr.rolloffFactor?t.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:void 0!==t.pannerAttr.panningModel?t.pannerAttr.panningModel:r._panningModel})}else 2===o.length&&(t=o[0],n=parseInt(o[1],10));for(var s=r._getSoundIds(n),a=0;a<s.length;a++)if(i=r._soundById(s[a])){var l=i._pannerAttr;l={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:l.coneInnerAngle,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:l.coneOuterAngle,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:l.coneOuterGain,distanceModel:void 0!==t.distanceModel?t.distanceModel:l.distanceModel,maxDistance:void 0!==t.maxDistance?t.maxDistance:l.maxDistance,refDistance:void 0!==t.refDistance?t.refDistance:l.refDistance,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:l.rolloffFactor,panningModel:void 0!==t.panningModel?t.panningModel:l.panningModel};var u=i._panner;u?(u.coneInnerAngle=l.coneInnerAngle,u.coneOuterAngle=l.coneOuterAngle,u.coneOuterGain=l.coneOuterGain,u.distanceModel=l.distanceModel,u.maxDistance=l.maxDistance,u.refDistance=l.refDistance,u.rolloffFactor=l.rolloffFactor,u.panningModel=l.panningModel):(i._pos||(i._pos=r._pos||[0,0,-.5]),e(i,"spatial"))}return r},Sound.prototype.init=function(t){return function(){var e=this._parent;this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,t.call(this),this._stereo?e.stereo(this._stereo):this._pos&&e.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var e=this._parent;return this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,this._stereo?e.stereo(this._stereo):this._pos?e.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,e._refreshBuffer(this)),t.call(this)}}(Sound.prototype.reset);var e=function(t,e){"spatial"===(e=e||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}}()}).call(this,n(4))},function(t,e){t.exports="varying vec2 vTextureCoord;\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\nuniform sampler2D uSampler;\nvoid main() {\n\tvec4 outputColor;\n\tfloat percent = vPercent;\n\tfloat direction = vDirection;\n\tif (vTransition < 0.0) {\n\t\tpercent = 1.0 - percent;\n\t\tif ((vDirection > 1.5) && (vDirection < 2.5)) {\n\t\t\tdirection = 1.0;\n\t\t}\n\t\telse if ((vDirection > 0.5) && (vDirection < 1.5)) {\n\t\t\tdirection = 2.0;\n\t\t}\n\t\telse if ((vDirection > 2.5) && (vDirection < 3.5)) {\n\t\t\tdirection = 4.0;\n\t\t}\n\t\telse {\n\t\t\tdirection = 3.0;\n\t\t}\n\t}\n\tif ((direction > 1.5) && (direction < 2.5)) {\n\t\tif (vVertexPosition.y >= (1.0 - percent)) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.y >= (1.0 - percent)) && (vVertexPosition.y <= ((1.0 - percent) + 0.2))) {\n\t\t\toutputColor = outputColor * ((vVertexPosition.y - (1.0 - percent)) / 0.2);\n\t\t}\n\t}\n\telse if ((direction > 0.5) && (direction < 1.5)) {\n\t\tif (vVertexPosition.y <= percent) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.y <= percent) && (vVertexPosition.y >= (percent - 0.2))) {\n\t\t\toutputColor = outputColor * (1.0 - ((vVertexPosition.y - (percent - 0.2)) / 0.2));\n\t\t}\n\t}\n\telse if ((direction > 2.5) && (direction < 3.5)) {\n\t\tif (vVertexPosition.x <= percent) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.x <= percent) && (vVertexPosition.x >= (percent - 0.2))) {\n\t\t\toutputColor = outputColor * (1.0 - ((vVertexPosition.x - (percent - 0.2)) / 0.2));\n\t\t}\n\t}\n\telse {\n\t\tif (vVertexPosition.x >= (1.0 - percent)) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.x >= (1.0 - percent)) && (vVertexPosition.x <= ((1.0 - percent) + 0.2))) {\n\t\t\toutputColor = outputColor * ((vVertexPosition.x - (1.0 - percent)) / 0.2);\n\t\t}\n\t}\n\tgl_FragColor = outputColor;\n}\n"},function(t,e){t.exports="attribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nuniform float percent;\nuniform float direction;\nuniform float transition;\nvec4 filterVertexPosition() {\n\tvec2 position = (aVertexPosition * max(outputFrame.zw, vec2(0.))) + outputFrame.xy;\n\treturn vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\nvec2 filterTextureCoord(vec2 aVertexPosition) {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tvTransition = transition;\n\tvDirection = direction;\n\tvPercent = percent;\n\tvVertexPosition = aVertexPosition;\n\tvec2 localVertexPosition = aVertexPosition;\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord(localVertexPosition);\n}\n"},function(t,e){t.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nuniform float transition;\nvoid main() {\n\tfloat alpha = (transition * (percent - 0.5)) + 0.5;\n\tvec4 color1 = texture2D(uSampler, vTextureCoord);\n\tgl_FragColor = color1 * alpha;\n}\n"},function(t,e,n){var i;!function(r,o){"use strict";var s="model",a="name",l="type",u="vendor",h="version",c="mobile",d="tablet",p="smarttv",f=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},m=function(t,e){return"string"==typeof t&&-1!==g(e).indexOf(g(t))},g=function(t){return t.toLowerCase()},v=function(t,e){if("string"==typeof t)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),void 0===e?t:t.substring(0,255)},_=function(t,e){for(var n,i,r,o,s,a,l=0;l<e.length&&!s;){var u=e[l],h=e[l+1];for(n=i=0;n<u.length&&!s;)if(s=u[n++].exec(t))for(r=0;r<h.length;r++)a=s[++i],"object"==typeof(o=h[r])&&o.length>0?2===o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,a):this[o[0]]=o[1]:3===o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=a?a.replace(o[1],o[2]):void 0:this[o[0]]=a?o[1].call(this,a,o[2]):void 0:4===o.length&&(this[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):void 0):this[o]=a||void 0;l+=2}},y=function(t,e){for(var n in e)if("object"==typeof e[n]&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(m(e[n][i],t))return"?"===n?void 0:n}else if(m(e[n],t))return"?"===n?void 0:n;return t},x={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},b={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[a,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[a,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[a,h],[/opios[\/ ]+([\w\.]+)/i],[h,[a,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[h,[a,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[a,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[a,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[h,[a,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[a,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[a,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[a,"IE"]],[/yabrowser\/([\w\.]+)/i],[h,[a,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[a,/(.+)/,"$1 Secure Browser"],h],[/\bfocus\/([\w\.]+)/i],[h,[a,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[h,[a,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[a,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[a,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[a,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[a,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[h,[a,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[a,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[a,/(.+)/,"$1 Browser"],h],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[a,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[a],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[a,"Facebook"],h],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[a,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[a,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[a,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[a,"Chrome WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[a,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[a,h],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[h,[a,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[h,a],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[a,[h,y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[a,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[a,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[a,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[a,h]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",g]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",g]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",g]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[s,[u,"Samsung"],[l,d]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[s,[u,"Samsung"],[l,c]],[/\((ip(?:hone|od)[\w ]*);/i],[s,[u,"Apple"],[l,c]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[s,[u,"Apple"],[l,d]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[s,[u,"Huawei"],[l,d]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[s,[u,"Huawei"],[l,c]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[s,/_/g," "],[u,"Xiaomi"],[l,c]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[s,/_/g," "],[u,"Xiaomi"],[l,d]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[s,[u,"OPPO"],[l,c]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[s,[u,"Vivo"],[l,c]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[s,[u,"Realme"],[l,c]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[s,[u,"Motorola"],[l,c]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[s,[u,"Motorola"],[l,d]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[u,"LG"],[l,d]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[s,[u,"LG"],[l,c]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[s,[u,"Lenovo"],[l,d]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[s,/_/g," "],[u,"Nokia"],[l,c]],[/(pixel c)\b/i],[s,[u,"Google"],[l,d]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[s,[u,"Google"],[l,c]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[s,[u,"Sony"],[l,c]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[s,"Xperia Tablet"],[u,"Sony"],[l,d]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[s,[u,"OnePlus"],[l,c]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[s,[u,"Amazon"],[l,d]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[s,/(.+)/g,"Fire Phone $1"],[u,"Amazon"],[l,c]],[/(playbook);[-\w\),; ]+(rim)/i],[s,u,[l,d]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[s,[u,"BlackBerry"],[l,c]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[s,[u,"ASUS"],[l,d]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[s,[u,"ASUS"],[l,c]],[/(nexus 9)/i],[s,[u,"HTC"],[l,d]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[u,[s,/_/g," "],[l,c]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[s,[u,"Acer"],[l,d]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[s,[u,"Meizu"],[l,c]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[s,[u,"Sharp"],[l,c]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,s,[l,c]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[u,s,[l,d]],[/(surface duo)/i],[s,[u,"Microsoft"],[l,d]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[s,[u,"Fairphone"],[l,c]],[/(u304aa)/i],[s,[u,"AT&T"],[l,c]],[/\bsie-(\w*)/i],[s,[u,"Siemens"],[l,c]],[/\b(rct\w+) b/i],[s,[u,"RCA"],[l,d]],[/\b(venue[\d ]{2,7}) b/i],[s,[u,"Dell"],[l,d]],[/\b(q(?:mv|ta)\w+) b/i],[s,[u,"Verizon"],[l,d]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[s,[u,"Barnes & Noble"],[l,d]],[/\b(tm\d{3}\w+) b/i],[s,[u,"NuVision"],[l,d]],[/\b(k88) b/i],[s,[u,"ZTE"],[l,d]],[/\b(nx\d{3}j) b/i],[s,[u,"ZTE"],[l,c]],[/\b(gen\d{3}) b.+49h/i],[s,[u,"Swiss"],[l,c]],[/\b(zur\d{3}) b/i],[s,[u,"Swiss"],[l,d]],[/\b((zeki)?tb.*\b) b/i],[s,[u,"Zeki"],[l,d]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[u,"Dragon Touch"],s,[l,d]],[/\b(ns-?\w{0,9}) b/i],[s,[u,"Insignia"],[l,d]],[/\b((nxa|next)-?\w{0,9}) b/i],[s,[u,"NextBook"],[l,d]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[u,"Voice"],s,[l,c]],[/\b(lvtel\-)?(v1[12]) b/i],[[u,"LvTel"],s,[l,c]],[/\b(ph-1) /i],[s,[u,"Essential"],[l,c]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[s,[u,"Envizen"],[l,d]],[/\b(trio[-\w\. ]+) b/i],[s,[u,"MachSpeed"],[l,d]],[/\btu_(1491) b/i],[s,[u,"Rotor"],[l,d]],[/(shield[\w ]+) b/i],[s,[u,"Nvidia"],[l,d]],[/(sprint) (\w+)/i],[u,s,[l,c]],[/(kin\.[onetw]{3})/i],[[s,/\./g," "],[u,"Microsoft"],[l,c]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[s,[u,"Zebra"],[l,d]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[s,[u,"Zebra"],[l,c]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[u,s,[l,"console"]],[/droid.+; (shield) bui/i],[s,[u,"Nvidia"],[l,"console"]],[/(playstation [345portablevi]+)/i],[s,[u,"Sony"],[l,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[s,[u,"Microsoft"],[l,"console"]],[/smart-tv.+(samsung)/i],[u,[l,p]],[/hbbtv.+maple;(\d+)/i],[[s,/^/,"SmartTV"],[u,"Samsung"],[l,p]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,"LG"],[l,p]],[/(apple) ?tv/i],[u,[s,"Apple TV"],[l,p]],[/crkey/i],[[s,"Chromecast"],[u,"Google"],[l,p]],[/droid.+aft(\w)( bui|\))/i],[s,[u,"Amazon"],[l,p]],[/\(dtv[\);].+(aquos)/i],[s,[u,"Sharp"],[l,p]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[u,v],[s,v],[l,p]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,p]],[/((pebble))app/i],[u,s,[l,"wearable"]],[/droid.+; (glass) \d/i],[s,[u,"Google"],[l,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[s,[u,"Zebra"],[l,"wearable"]],[/(quest( 2)?)/i],[s,[u,"Facebook"],[l,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[s,[l,c]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[s,[l,d]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,d]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,c]],[/(android[-\w\. ]{0,9});.+buil/i],[s,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[a,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[a,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[a,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,a]],os:[[/microsoft (windows) (vista|xp)/i],[a,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[a,[h,y,x]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[a,"Windows"],[h,y,x]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[a,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[a,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[h,a],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[a,h],[/\(bb(10);/i],[h,[a,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[a,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[a,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[a,"webOS"]],[/crkey\/([\d\.]+)/i],[h,[a,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[a,"Chromium OS"],h],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[a,h],[/(sunos) ?([\w\.\d]*)/i],[[a,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[a,h]]},w=function(t,e){if("object"==typeof t&&(e=t,t=void 0),!(this instanceof w))return new w(t,e).getResult();var n=t||(void 0!==r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=e?function(t,e){var n={};for(var i in t)e[i]&&e[i].length%2==0?n[i]=e[i].concat(t[i]):n[i]=t[i];return n}(b,e):b;return this.getBrowser=function(){var t,e={};return e[a]=void 0,e[h]=void 0,_.call(e,n,i.browser),e.major="string"==typeof(t=e.version)?t.replace(/[^\d\.]/g,"").split(".")[0]:void 0,e},this.getCPU=function(){var t={architecture:void 0};return _.call(t,n,i.cpu),t},this.getDevice=function(){var t={vendor:void 0,model:void 0,type:void 0};return _.call(t,n,i.device),t},this.getEngine=function(){var t={name:void 0,version:void 0};return _.call(t,n,i.engine),t},this.getOS=function(){var t={name:void 0,version:void 0};return _.call(t,n,i.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(t){return n="string"==typeof t&&t.length>255?v(t,255):t,this},this.setUA(n),this};w.VERSION="1.0.2",w.BROWSER=f([a,h,"major"]),w.CPU=f(["architecture"]),w.DEVICE=f([s,u,l,"console",c,p,d,"wearable","embedded"]),w.ENGINE=w.OS=f([a,h]),void 0!==e?(void 0!==t&&t.exports&&(e=t.exports=w),e.UAParser=w):n(64)?void 0===(i=function(){return w}.call(e,n,e,t))||(t.exports=i):void 0!==r&&(r.UAParser=w);var T=void 0!==r&&(r.jQuery||r.Zepto);if(T&&!T.ua){var S=new w;T.ua=S.getResult(),T.ua.get=function(){return S.getUA()},T.ua.set=function(t){S.setUA(t);var e=S.getResult();for(var n in e)T.ua[n]=e[n]}}}("object"==typeof window?window:this)},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(56),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(4))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,o,s,a,l=1,u={},h=!1,c=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){f(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){f(t.data)},i=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(r=c.documentElement,i=function(t){var e=c.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(f,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&f(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(s+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return u[l]=r,i(l),l++},d.clearImmediate=p}function p(t){delete u[t]}function f(t){if(h)setTimeout(f,0,t);else{var e=u[t];if(e){h=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{p(t),h=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(4),n(57))},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var l,u=[],h=!1,c=-1;function d(){h&&l&&(h=!1,l.length?u=l.concat(u):c=-1,u.length&&p())}function p(){if(!h){var t=a(d);h=!0;for(var e=u.length;e;){for(l=u,u=[];++c<e;)l&&l[c].run();c=-1,e=u.length}l=null,h=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||h||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){(function(t,i){var r;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof i&&i;s.global!==s&&s.window!==s&&s.self;var a,l=2147483647,u=/^xn--/,h=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,f=String.fromCharCode;function m(t){throw new RangeError(d[t])}function g(t,e){for(var n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function v(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),i+g((t=t.replace(c,".")).split("."),e).join(".")}function _(t){for(var e,n,i=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(n=t.charCodeAt(r++)))?i.push(((1023&e)<<10)+(1023&n)+65536):(i.push(e),r--):i.push(e);return i}function y(t){return g(t,(function(t){var e="";return t>65535&&(e+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=f(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,n){var i=0;for(t=n?p(t/700):t>>1,t+=p(t/e);t>455;i+=36)t=p(t/35);return p(i+36*t/(t+38))}function w(t){var e,n,i,r,o,s,a,u,h,c,d,f=[],g=t.length,v=0,_=128,x=72;for((n=t.lastIndexOf("-"))<0&&(n=0),i=0;i<n;++i)t.charCodeAt(i)>=128&&m("not-basic"),f.push(t.charCodeAt(i));for(r=n>0?n+1:0;r<g;){for(o=v,s=1,a=36;r>=g&&m("invalid-input"),((u=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>p((l-v)/s))&&m("overflow"),v+=u*s,!(u<(h=a<=x?1:a>=x+26?26:a-x));a+=36)s>p(l/(c=36-h))&&m("overflow"),s*=c;x=b(v-o,e=f.length+1,0==o),p(v/e)>l-_&&m("overflow"),_+=p(v/e),v%=e,f.splice(v++,0,_)}return y(f)}function T(t){var e,n,i,r,o,s,a,u,h,c,d,g,v,y,w,T=[];for(g=(t=_(t)).length,e=128,n=0,o=72,s=0;s<g;++s)(d=t[s])<128&&T.push(f(d));for(i=r=T.length,r&&T.push("-");i<g;){for(a=l,s=0;s<g;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>p((l-n)/(v=i+1))&&m("overflow"),n+=(a-e)*v,e=a,s=0;s<g;++s)if((d=t[s])<e&&++n>l&&m("overflow"),d==e){for(u=n,h=36;!(u<(c=h<=o?1:h>=o+26?26:h-o));h+=36)w=u-c,y=36-c,T.push(f(x(c+w%y,0))),u=p(w/y);T.push(f(x(u,0))),o=b(n,v,i==r),n=0,++i}++n,++e}return T.join("")}a={version:"1.4.1",ucs2:{decode:_,encode:y},decode:w,encode:T,toASCII:function(t){return v(t,(function(t){return h.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return v(t,(function(t){return u.test(t)?w(t.slice(4).toLowerCase()):t}))}},void 0===(r=function(){return a}.call(e,n,e,t))||(t.exports=r)}()}).call(this,n(8)(t),n(4))},function(t,e,n){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,n){"use strict";e.decode=e.parse=n(61),e.encode=e.stringify=n(62)},function(t,e,n){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,o){e=e||"&",n=n||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var u=t.length;l>0&&u>l&&(u=l);for(var h=0;h<u;++h){var c,d,p,f,m=t[h].replace(a,"%20"),g=m.indexOf(n);g>=0?(c=m.substr(0,g),d=m.substr(g+1)):(c=m,d=""),p=decodeURIComponent(c),f=decodeURIComponent(d),i(s,p)?r(s[p])?s[p].push(f):s[p]=[s[p],f]:s[p]=f}return s};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,a){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(i(s))+n;return r(t[s])?o(t[s],(function(t){return a+encodeURIComponent(i(t))})).join(e):a+encodeURIComponent(i(t[s]))})).join(e):a?encodeURIComponent(i(a))+n+encodeURIComponent(i(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],i=0;i<t.length;i++)n.push(e(t[i],i));return n}var s=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}},function(t,e){var n=function(){};n.prototype={fit:function(t){var e,n,i,r,o=t.length,s=o>0?t[0].width:0,a=o>0?t[0].height:0;for(this.root={x:0,y:0,width:s,height:a},e=0;e<o;e++)i=t[e],(n=this.findNode(this.root,i.width,i.height))?(r=this.splitNode(n,i.width,i.height),i.x=r.x,i.y=r.y):(r=this.growNode(i.width,i.height),i.x=r.x,i.y=r.y)},findNode:function(t,e,n){return t.used?this.findNode(t.right,e,n)||this.findNode(t.down,e,n):e<=t.width&&n<=t.height?t:null},splitNode:function(t,e,n){return t.used=!0,t.down={x:t.x,y:t.y+n,width:t.width,height:t.height-n},t.right={x:t.x+e,y:t.y,width:t.width-e,height:n},t},growNode:function(t,e){var n=t<=this.root.width,i=e<=this.root.height,r=i&&this.root.height>=this.root.width+t,o=n&&this.root.width>=this.root.height+e;return r?this.growRight(t,e):o?this.growDown(t,e):i?this.growRight(t,e):n?this.growDown(t,e):null},growRight:function(t,e){var n;return this.root={used:!0,x:0,y:0,width:this.root.width+t,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:t,height:this.root.height}},(n=this.findNode(this.root,t,e))?this.splitNode(n,t,e):null},growDown:function(t,e){var n;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+e,down:{x:0,y:this.root.height,width:this.root.width,height:e},right:this.root},(n=this.findNode(this.root,t,e))?this.splitNode(n,t,e):null}},t.exports=n},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";n.r(e),n.d(e,"ErrorType",(function(){return WE})),n.d(e,"delay",(function(){return nI})),n.d(e,"waitUntil",(function(){return iI})),n.d(e,"SLIDE_EVENTS",(function(){return rI})),n.d(e,"Slide",(function(){return aI}));var i={};n.r(i),n.d(i,"ACESFilmicToneMapping",(function(){return ut})),n.d(i,"AddEquation",(function(){return O})),n.d(i,"AddOperation",(function(){return rt})),n.d(i,"AdditiveAnimationBlendMode",(function(){return Qe})),n.d(i,"AdditiveBlending",(function(){return R})),n.d(i,"AlphaFormat",(function(){return jt})),n.d(i,"AlwaysDepth",(function(){return Z})),n.d(i,"AlwaysStencilFunc",(function(){return In})),n.d(i,"AmbientLight",(function(){return kc})),n.d(i,"AmbientLightProbe",(function(){return ad})),n.d(i,"AnimationClip",(function(){return sc})),n.d(i,"AnimationLoader",(function(){return fc})),n.d(i,"AnimationMixer",(function(){return Bd})),n.d(i,"AnimationObjectGroup",(function(){return Dd})),n.d(i,"AnimationUtils",(function(){return qh})),n.d(i,"ArcCurve",(function(){return Ru})),n.d(i,"ArrayCamera",(function(){return Qa})),n.d(i,"ArrowHelper",(function(){return Mp})),n.d(i,"Audio",(function(){return _d})),n.d(i,"AudioAnalyser",(function(){return Sd})),n.d(i,"AudioContext",(function(){return rd})),n.d(i,"AudioListener",(function(){return vd})),n.d(i,"AudioLoader",(function(){return od})),n.d(i,"AxesHelper",(function(){return Ap})),n.d(i,"AxisHelper",(function(){return Af})),n.d(i,"BackSide",(function(){return w})),n.d(i,"BasicDepthPacking",(function(){return dn})),n.d(i,"BasicShadowMap",(function(){return v})),n.d(i,"BinaryTextureLoader",(function(){return Of})),n.d(i,"Bone",(function(){return Ul})),n.d(i,"BooleanKeyframeTrack",(function(){return Qh})),n.d(i,"BoundingBoxHelper",(function(){return Rf})),n.d(i,"Box2",(function(){return qd})),n.d(i,"Box3",(function(){return vi})),n.d(i,"Box3Helper",(function(){return bp})),n.d(i,"BoxBufferGeometry",(function(){return Ro})),n.d(i,"BoxGeometry",(function(){return Ro})),n.d(i,"BoxHelper",(function(){return xp})),n.d(i,"BufferAttribute",(function(){return Gr})),n.d(i,"BufferGeometry",(function(){return ao})),n.d(i,"BufferGeometryLoader",(function(){return qc})),n.d(i,"ByteType",(function(){return Ot})),n.d(i,"Cache",(function(){return lc})),n.d(i,"Camera",(function(){return Lo})),n.d(i,"CameraHelper",(function(){return vp})),n.d(i,"CanvasRenderer",(function(){return Nf})),n.d(i,"CanvasTexture",(function(){return fu})),n.d(i,"CatmullRomCurve3",(function(){return Nu})),n.d(i,"CineonToneMapping",(function(){return lt})),n.d(i,"CircleBufferGeometry",(function(){return gu})),n.d(i,"CircleGeometry",(function(){return gu})),n.d(i,"ClampToEdgeWrapping",(function(){return yt})),n.d(i,"Clock",(function(){return cd})),n.d(i,"Color",(function(){return Fr})),n.d(i,"ColorKeyframeTrack",(function(){return tc})),n.d(i,"CompressedTexture",(function(){return pu})),n.d(i,"CompressedTextureLoader",(function(){return mc})),n.d(i,"ConeBufferGeometry",(function(){return _u})),n.d(i,"ConeGeometry",(function(){return _u})),n.d(i,"CubeCamera",(function(){return Do})),n.d(i,"CubeReflectionMapping",(function(){return dt})),n.d(i,"CubeRefractionMapping",(function(){return pt})),n.d(i,"CubeTexture",(function(){return Fo})),n.d(i,"CubeTextureLoader",(function(){return vc})),n.d(i,"CubeUVReflectionMapping",(function(){return gt})),n.d(i,"CubeUVRefractionMapping",(function(){return vt})),n.d(i,"CubicBezierCurve",(function(){return Uu})),n.d(i,"CubicBezierCurve3",(function(){return ku})),n.d(i,"CubicInterpolant",(function(){return Zh})),n.d(i,"CullFaceBack",(function(){return f})),n.d(i,"CullFaceFront",(function(){return m})),n.d(i,"CullFaceFrontBack",(function(){return g})),n.d(i,"CullFaceNone",(function(){return p})),n.d(i,"Curve",(function(){return Mu})),n.d(i,"CurvePath",(function(){return xc})),n.d(i,"CustomBlending",(function(){return I})),n.d(i,"CustomToneMapping",(function(){return ht})),n.d(i,"CylinderBufferGeometry",(function(){return vu})),n.d(i,"CylinderGeometry",(function(){return vu})),n.d(i,"Cylindrical",(function(){return Wd})),n.d(i,"DataTexture",(function(){return kl})),n.d(i,"DataTexture2DArray",(function(){return cs})),n.d(i,"DataTexture3D",(function(){return ds})),n.d(i,"DataTextureLoader",(function(){return _c})),n.d(i,"DataUtils",(function(){return Pp})),n.d(i,"DecrementStencilOp",(function(){return xn})),n.d(i,"DecrementWrapStencilOp",(function(){return wn})),n.d(i,"DefaultLoadingManager",(function(){return hc})),n.d(i,"DepthFormat",(function(){return Zt})),n.d(i,"DepthStencilFormat",(function(){return Jt})),n.d(i,"DepthTexture",(function(){return mu})),n.d(i,"DirectionalLight",(function(){return Uc})),n.d(i,"DirectionalLightHelper",(function(){return fp})),n.d(i,"DiscreteInterpolant",(function(){return Kh})),n.d(i,"DodecahedronBufferGeometry",(function(){return xu})),n.d(i,"DodecahedronGeometry",(function(){return xu})),n.d(i,"DoubleSide",(function(){return T})),n.d(i,"DstAlphaFactor",(function(){return j})),n.d(i,"DstColorFactor",(function(){return W})),n.d(i,"DynamicBufferAttribute",(function(){return vf})),n.d(i,"DynamicCopyUsage",(function(){return kn})),n.d(i,"DynamicDrawUsage",(function(){return Ln})),n.d(i,"DynamicReadUsage",(function(){return Fn})),n.d(i,"EdgesGeometry",(function(){return Eu})),n.d(i,"EdgesHelper",(function(){return Cf})),n.d(i,"EllipseCurve",(function(){return Au})),n.d(i,"EqualDepth",(function(){return $})),n.d(i,"EqualStencilFunc",(function(){return Mn})),n.d(i,"EquirectangularReflectionMapping",(function(){return ft})),n.d(i,"EquirectangularRefractionMapping",(function(){return mt})),n.d(i,"Euler",(function(){return er})),n.d(i,"EventDispatcher",(function(){return jn})),n.d(i,"ExtrudeBufferGeometry",(function(){return xh})),n.d(i,"ExtrudeGeometry",(function(){return xh})),n.d(i,"FaceColors",(function(){return sf})),n.d(i,"FileLoader",(function(){return pc})),n.d(i,"FlatShading",(function(){return S})),n.d(i,"Float16BufferAttribute",(function(){return Yr})),n.d(i,"Float32Attribute",(function(){return Ef})),n.d(i,"Float32BufferAttribute",(function(){return Zr})),n.d(i,"Float64Attribute",(function(){return Mf})),n.d(i,"Float64BufferAttribute",(function(){return Jr})),n.d(i,"FloatType",(function(){return Bt})),n.d(i,"Fog",(function(){return ll})),n.d(i,"FogExp2",(function(){return al})),n.d(i,"Font",(function(){return td})),n.d(i,"FontLoader",(function(){return nd})),n.d(i,"FrontSide",(function(){return b})),n.d(i,"Frustum",(function(){return Vo})),n.d(i,"GLBufferAttribute",(function(){return Gd})),n.d(i,"GLSL1",(function(){return Hn})),n.d(i,"GLSL3",(function(){return zn})),n.d(i,"GammaEncoding",(function(){return sn})),n.d(i,"GreaterDepth",(function(){return tt})),n.d(i,"GreaterEqualDepth",(function(){return Q})),n.d(i,"GreaterEqualStencilFunc",(function(){return Pn})),n.d(i,"GreaterStencilFunc",(function(){return Rn})),n.d(i,"GridHelper",(function(){return up})),n.d(i,"Group",(function(){return tl})),n.d(i,"HalfFloatType",(function(){return Ut})),n.d(i,"HemisphereLight",(function(){return Sc})),n.d(i,"HemisphereLightHelper",(function(){return lp})),n.d(i,"HemisphereLightProbe",(function(){return sd})),n.d(i,"IcosahedronBufferGeometry",(function(){return wh})),n.d(i,"IcosahedronGeometry",(function(){return wh})),n.d(i,"ImageBitmapLoader",(function(){return $c})),n.d(i,"ImageLoader",(function(){return gc})),n.d(i,"ImageUtils",(function(){return oi})),n.d(i,"ImmediateRenderObject",(function(){return Kd})),n.d(i,"IncrementStencilOp",(function(){return yn})),n.d(i,"IncrementWrapStencilOp",(function(){return bn})),n.d(i,"InstancedBufferAttribute",(function(){return Xc})),n.d(i,"InstancedBufferGeometry",(function(){return Wc})),n.d(i,"InstancedInterleavedBuffer",(function(){return kd})),n.d(i,"InstancedMesh",(function(){return ql})),n.d(i,"Int16Attribute",(function(){return bf})),n.d(i,"Int16BufferAttribute",(function(){return Vr})),n.d(i,"Int32Attribute",(function(){return Tf})),n.d(i,"Int32BufferAttribute",(function(){return Xr})),n.d(i,"Int8Attribute",(function(){return _f})),n.d(i,"Int8BufferAttribute",(function(){return Hr})),n.d(i,"IntType",(function(){return Dt})),n.d(i,"InterleavedBuffer",(function(){return hl})),n.d(i,"InterleavedBufferAttribute",(function(){return dl})),n.d(i,"Interpolant",(function(){return Yh})),n.d(i,"InterpolateDiscrete",(function(){return Xe})),n.d(i,"InterpolateLinear",(function(){return qe})),n.d(i,"InterpolateSmooth",(function(){return Ye})),n.d(i,"InvertStencilOp",(function(){return Tn})),n.d(i,"JSONLoader",(function(){return Df})),n.d(i,"KeepStencilOp",(function(){return vn})),n.d(i,"KeyframeTrack",(function(){return $h})),n.d(i,"LOD",(function(){return Il})),n.d(i,"LatheBufferGeometry",(function(){return Th})),n.d(i,"LatheGeometry",(function(){return Th})),n.d(i,"Layers",(function(){return nr})),n.d(i,"LensFlare",(function(){return Bf})),n.d(i,"LessDepth",(function(){return J})),n.d(i,"LessEqualDepth",(function(){return K})),n.d(i,"LessEqualStencilFunc",(function(){return An})),n.d(i,"LessStencilFunc",(function(){return En})),n.d(i,"Light",(function(){return Tc})),n.d(i,"LightProbe",(function(){return zc})),n.d(i,"Line",(function(){return tu})),n.d(i,"Line3",(function(){return Jd})),n.d(i,"LineBasicMaterial",(function(){return Yl})),n.d(i,"LineCurve",(function(){return Gu})),n.d(i,"LineCurve3",(function(){return Hu})),n.d(i,"LineDashedMaterial",(function(){return Wh})),n.d(i,"LineLoop",(function(){return ru})),n.d(i,"LinePieces",(function(){return rf})),n.d(i,"LineSegments",(function(){return iu})),n.d(i,"LineStrip",(function(){return nf})),n.d(i,"LinearEncoding",(function(){return rn})),n.d(i,"LinearFilter",(function(){return Mt})),n.d(i,"LinearInterpolant",(function(){return Jh})),n.d(i,"LinearMipMapLinearFilter",(function(){return Pt})),n.d(i,"LinearMipMapNearestFilter",(function(){return Rt})),n.d(i,"LinearMipmapLinearFilter",(function(){return Ct})),n.d(i,"LinearMipmapNearestFilter",(function(){return At})),n.d(i,"LinearToneMapping",(function(){return st})),n.d(i,"Loader",(function(){return cc})),n.d(i,"LoaderUtils",(function(){return Vc})),n.d(i,"LoadingManager",(function(){return uc})),n.d(i,"LogLuvEncoding",(function(){return ln})),n.d(i,"LoopOnce",(function(){return je})),n.d(i,"LoopPingPong",(function(){return We})),n.d(i,"LoopRepeat",(function(){return Ve})),n.d(i,"LuminanceAlphaFormat",(function(){return qt})),n.d(i,"LuminanceFormat",(function(){return Xt})),n.d(i,"MOUSE",(function(){return c})),n.d(i,"Material",(function(){return Cr})),n.d(i,"MaterialLoader",(function(){return jc})),n.d(i,"Math",(function(){return ei})),n.d(i,"MathUtils",(function(){return ei})),n.d(i,"Matrix3",(function(){return ii})),n.d(i,"Matrix4",(function(){return Wi})),n.d(i,"MaxEquation",(function(){return F})),n.d(i,"Mesh",(function(){return Mo})),n.d(i,"MeshBasicMaterial",(function(){return Br})),n.d(i,"MeshDepthMaterial",(function(){return qa})),n.d(i,"MeshDistanceMaterial",(function(){return Ya})),n.d(i,"MeshFaceMaterial",(function(){return lf})),n.d(i,"MeshLambertMaterial",(function(){return jh})),n.d(i,"MeshMatcapMaterial",(function(){return Vh})),n.d(i,"MeshNormalMaterial",(function(){return zh})),n.d(i,"MeshPhongMaterial",(function(){return Gh})),n.d(i,"MeshPhysicalMaterial",(function(){return kh})),n.d(i,"MeshStandardMaterial",(function(){return Uh})),n.d(i,"MeshToonMaterial",(function(){return Hh})),n.d(i,"MinEquation",(function(){return D})),n.d(i,"MirroredRepeatWrapping",(function(){return xt})),n.d(i,"MixOperation",(function(){return it})),n.d(i,"MultiMaterial",(function(){return uf})),n.d(i,"MultiplyBlending",(function(){return P})),n.d(i,"MultiplyOperation",(function(){return nt})),n.d(i,"NearestFilter",(function(){return bt})),n.d(i,"NearestMipMapLinearFilter",(function(){return Et})),n.d(i,"NearestMipMapNearestFilter",(function(){return Tt})),n.d(i,"NearestMipmapLinearFilter",(function(){return St})),n.d(i,"NearestMipmapNearestFilter",(function(){return wt})),n.d(i,"NeverDepth",(function(){return Y})),n.d(i,"NeverStencilFunc",(function(){return Sn})),n.d(i,"NoBlending",(function(){return M})),n.d(i,"NoColors",(function(){return of})),n.d(i,"NoToneMapping",(function(){return ot})),n.d(i,"NormalAnimationBlendMode",(function(){return $e})),n.d(i,"NormalBlending",(function(){return A})),n.d(i,"NotEqualDepth",(function(){return et})),n.d(i,"NotEqualStencilFunc",(function(){return Cn})),n.d(i,"NumberKeyframeTrack",(function(){return ec})),n.d(i,"Object3D",(function(){return gr})),n.d(i,"ObjectLoader",(function(){return Yc})),n.d(i,"ObjectSpaceNormalMap",(function(){return mn})),n.d(i,"OctahedronBufferGeometry",(function(){return Sh})),n.d(i,"OctahedronGeometry",(function(){return Sh})),n.d(i,"OneFactor",(function(){return U})),n.d(i,"OneMinusDstAlphaFactor",(function(){return V})),n.d(i,"OneMinusDstColorFactor",(function(){return X})),n.d(i,"OneMinusSrcAlphaFactor",(function(){return z})),n.d(i,"OneMinusSrcColorFactor",(function(){return G})),n.d(i,"OrthographicCamera",(function(){return Fc})),n.d(i,"PCFShadowMap",(function(){return _})),n.d(i,"PCFSoftShadowMap",(function(){return y})),n.d(i,"PMREMGenerator",(function(){return qp})),n.d(i,"ParametricBufferGeometry",(function(){return Eh})),n.d(i,"ParametricGeometry",(function(){return Eh})),n.d(i,"Particle",(function(){return cf})),n.d(i,"ParticleBasicMaterial",(function(){return ff})),n.d(i,"ParticleSystem",(function(){return df})),n.d(i,"ParticleSystemMaterial",(function(){return mf})),n.d(i,"Path",(function(){return bc})),n.d(i,"PerspectiveCamera",(function(){return No})),n.d(i,"Plane",(function(){return Ho})),n.d(i,"PlaneBufferGeometry",(function(){return qo})),n.d(i,"PlaneGeometry",(function(){return qo})),n.d(i,"PlaneHelper",(function(){return wp})),n.d(i,"PointCloud",(function(){return hf})),n.d(i,"PointCloudMaterial",(function(){return pf})),n.d(i,"PointLight",(function(){return Dc})),n.d(i,"PointLightHelper",(function(){return rp})),n.d(i,"Points",(function(){return hu})),n.d(i,"PointsMaterial",(function(){return ou})),n.d(i,"PolarGridHelper",(function(){return hp})),n.d(i,"PolyhedronBufferGeometry",(function(){return yu})),n.d(i,"PolyhedronGeometry",(function(){return yu})),n.d(i,"PositionalAudio",(function(){return Td})),n.d(i,"PropertyBinding",(function(){return Nd})),n.d(i,"PropertyMixer",(function(){return Ed})),n.d(i,"QuadraticBezierCurve",(function(){return zu})),n.d(i,"QuadraticBezierCurve3",(function(){return ju})),n.d(i,"Quaternion",(function(){return pi})),n.d(i,"QuaternionKeyframeTrack",(function(){return ic})),n.d(i,"QuaternionLinearInterpolant",(function(){return nc})),n.d(i,"REVISION",(function(){return h})),n.d(i,"RGBADepthPacking",(function(){return pn})),n.d(i,"RGBAFormat",(function(){return Wt})),n.d(i,"RGBAIntegerFormat",(function(){return ne})),n.d(i,"RGBA_ASTC_10x10_Format",(function(){return Ee})),n.d(i,"RGBA_ASTC_10x5_Format",(function(){return we})),n.d(i,"RGBA_ASTC_10x6_Format",(function(){return Te})),n.d(i,"RGBA_ASTC_10x8_Format",(function(){return Se})),n.d(i,"RGBA_ASTC_12x10_Format",(function(){return Me})),n.d(i,"RGBA_ASTC_12x12_Format",(function(){return Ae})),n.d(i,"RGBA_ASTC_4x4_Format",(function(){return fe})),n.d(i,"RGBA_ASTC_5x4_Format",(function(){return me})),n.d(i,"RGBA_ASTC_5x5_Format",(function(){return ge})),n.d(i,"RGBA_ASTC_6x5_Format",(function(){return ve})),n.d(i,"RGBA_ASTC_6x6_Format",(function(){return _e})),n.d(i,"RGBA_ASTC_8x5_Format",(function(){return ye})),n.d(i,"RGBA_ASTC_8x6_Format",(function(){return xe})),n.d(i,"RGBA_ASTC_8x8_Format",(function(){return be})),n.d(i,"RGBA_BPTC_Format",(function(){return Re})),n.d(i,"RGBA_ETC2_EAC_Format",(function(){return pe})),n.d(i,"RGBA_PVRTC_2BPPV1_Format",(function(){return he})),n.d(i,"RGBA_PVRTC_4BPPV1_Format",(function(){return ue})),n.d(i,"RGBA_S3TC_DXT1_Format",(function(){return re})),n.d(i,"RGBA_S3TC_DXT3_Format",(function(){return oe})),n.d(i,"RGBA_S3TC_DXT5_Format",(function(){return se})),n.d(i,"RGBDEncoding",(function(){return cn})),n.d(i,"RGBEEncoding",(function(){return an})),n.d(i,"RGBEFormat",(function(){return Yt})),n.d(i,"RGBFormat",(function(){return Vt})),n.d(i,"RGBIntegerFormat",(function(){return ee})),n.d(i,"RGBM16Encoding",(function(){return hn})),n.d(i,"RGBM7Encoding",(function(){return un})),n.d(i,"RGB_ETC1_Format",(function(){return ce})),n.d(i,"RGB_ETC2_Format",(function(){return de})),n.d(i,"RGB_PVRTC_2BPPV1_Format",(function(){return le})),n.d(i,"RGB_PVRTC_4BPPV1_Format",(function(){return ae})),n.d(i,"RGB_S3TC_DXT1_Format",(function(){return ie})),n.d(i,"RGFormat",(function(){return Qt})),n.d(i,"RGIntegerFormat",(function(){return te})),n.d(i,"RawShaderMaterial",(function(){return Bh})),n.d(i,"Ray",(function(){return Vi})),n.d(i,"Raycaster",(function(){return Hd})),n.d(i,"RectAreaLight",(function(){return Gc})),n.d(i,"RedFormat",(function(){return Kt})),n.d(i,"RedIntegerFormat",(function(){return $t})),n.d(i,"ReinhardToneMapping",(function(){return at})),n.d(i,"RepeatWrapping",(function(){return _t})),n.d(i,"ReplaceStencilOp",(function(){return _n})),n.d(i,"ReverseSubtractEquation",(function(){return N})),n.d(i,"RingBufferGeometry",(function(){return Mh})),n.d(i,"RingGeometry",(function(){return Mh})),n.d(i,"SRGB8_ALPHA8_ASTC_10x10_Format",(function(){return Ge})),n.d(i,"SRGB8_ALPHA8_ASTC_10x5_Format",(function(){return Be})),n.d(i,"SRGB8_ALPHA8_ASTC_10x6_Format",(function(){return Ue})),n.d(i,"SRGB8_ALPHA8_ASTC_10x8_Format",(function(){return ke})),n.d(i,"SRGB8_ALPHA8_ASTC_12x10_Format",(function(){return He})),n.d(i,"SRGB8_ALPHA8_ASTC_12x12_Format",(function(){return ze})),n.d(i,"SRGB8_ALPHA8_ASTC_4x4_Format",(function(){return Ce})),n.d(i,"SRGB8_ALPHA8_ASTC_5x4_Format",(function(){return Pe})),n.d(i,"SRGB8_ALPHA8_ASTC_5x5_Format",(function(){return Ie})),n.d(i,"SRGB8_ALPHA8_ASTC_6x5_Format",(function(){return Oe})),n.d(i,"SRGB8_ALPHA8_ASTC_6x6_Format",(function(){return Le})),n.d(i,"SRGB8_ALPHA8_ASTC_8x5_Format",(function(){return Ne})),n.d(i,"SRGB8_ALPHA8_ASTC_8x6_Format",(function(){return De})),n.d(i,"SRGB8_ALPHA8_ASTC_8x8_Format",(function(){return Fe})),n.d(i,"Scene",(function(){return ul})),n.d(i,"SceneUtils",(function(){return Ff})),n.d(i,"ShaderChunk",(function(){return Yo})),n.d(i,"ShaderLib",(function(){return Jo})),n.d(i,"ShaderMaterial",(function(){return Oo})),n.d(i,"ShadowMaterial",(function(){return Fh})),n.d(i,"Shape",(function(){return wc})),n.d(i,"ShapeBufferGeometry",(function(){return Ah})),n.d(i,"ShapeGeometry",(function(){return Ah})),n.d(i,"ShapePath",(function(){return Qc})),n.d(i,"ShapeUtils",(function(){return vh})),n.d(i,"ShortType",(function(){return Lt})),n.d(i,"Skeleton",(function(){return zl})),n.d(i,"SkeletonHelper",(function(){return ip})),n.d(i,"SkinnedMesh",(function(){return Bl})),n.d(i,"SmoothShading",(function(){return E})),n.d(i,"Sphere",(function(){return Fi})),n.d(i,"SphereBufferGeometry",(function(){return Rh})),n.d(i,"SphereGeometry",(function(){return Rh})),n.d(i,"Spherical",(function(){return Vd})),n.d(i,"SphericalHarmonics3",(function(){return Hc})),n.d(i,"SplineCurve",(function(){return Vu})),n.d(i,"SpotLight",(function(){return Pc})),n.d(i,"SpotLightHelper",(function(){return Qd})),n.d(i,"Sprite",(function(){return Al})),n.d(i,"SpriteMaterial",(function(){return pl})),n.d(i,"SrcAlphaFactor",(function(){return H})),n.d(i,"SrcAlphaSaturateFactor",(function(){return q})),n.d(i,"SrcColorFactor",(function(){return k})),n.d(i,"StaticCopyUsage",(function(){return Un})),n.d(i,"StaticDrawUsage",(function(){return On})),n.d(i,"StaticReadUsage",(function(){return Dn})),n.d(i,"StereoCamera",(function(){return hd})),n.d(i,"StreamCopyUsage",(function(){return Gn})),n.d(i,"StreamDrawUsage",(function(){return Nn})),n.d(i,"StreamReadUsage",(function(){return Bn})),n.d(i,"StringKeyframeTrack",(function(){return rc})),n.d(i,"SubtractEquation",(function(){return L})),n.d(i,"SubtractiveBlending",(function(){return C})),n.d(i,"TOUCH",(function(){return d})),n.d(i,"TangentSpaceNormalMap",(function(){return fn})),n.d(i,"TetrahedronBufferGeometry",(function(){return Ch})),n.d(i,"TetrahedronGeometry",(function(){return Ch})),n.d(i,"TextBufferGeometry",(function(){return Ph})),n.d(i,"TextGeometry",(function(){return Ph})),n.d(i,"Texture",(function(){return ai})),n.d(i,"TextureLoader",(function(){return yc})),n.d(i,"TorusBufferGeometry",(function(){return Ih})),n.d(i,"TorusGeometry",(function(){return Ih})),n.d(i,"TorusKnotBufferGeometry",(function(){return Oh})),n.d(i,"TorusKnotGeometry",(function(){return Oh})),n.d(i,"Triangle",(function(){return Ar})),n.d(i,"TriangleFanDrawMode",(function(){return nn})),n.d(i,"TriangleStripDrawMode",(function(){return en})),n.d(i,"TrianglesDrawMode",(function(){return tn})),n.d(i,"TubeBufferGeometry",(function(){return Lh})),n.d(i,"TubeGeometry",(function(){return Lh})),n.d(i,"UVMapping",(function(){return ct})),n.d(i,"Uint16Attribute",(function(){return wf})),n.d(i,"Uint16BufferAttribute",(function(){return Wr})),n.d(i,"Uint32Attribute",(function(){return Sf})),n.d(i,"Uint32BufferAttribute",(function(){return qr})),n.d(i,"Uint8Attribute",(function(){return yf})),n.d(i,"Uint8BufferAttribute",(function(){return zr})),n.d(i,"Uint8ClampedAttribute",(function(){return xf})),n.d(i,"Uint8ClampedBufferAttribute",(function(){return jr})),n.d(i,"Uniform",(function(){return Ud})),n.d(i,"UniformsLib",(function(){return Zo})),n.d(i,"UniformsUtils",(function(){return Io})),n.d(i,"UnsignedByteType",(function(){return It})),n.d(i,"UnsignedInt248Type",(function(){return zt})),n.d(i,"UnsignedIntType",(function(){return Ft})),n.d(i,"UnsignedShort4444Type",(function(){return kt})),n.d(i,"UnsignedShort5551Type",(function(){return Gt})),n.d(i,"UnsignedShort565Type",(function(){return Ht})),n.d(i,"UnsignedShortType",(function(){return Nt})),n.d(i,"VSMShadowMap",(function(){return x})),n.d(i,"Vector2",(function(){return ni})),n.d(i,"Vector3",(function(){return fi})),n.d(i,"Vector4",(function(){return ui})),n.d(i,"VectorKeyframeTrack",(function(){return oc})),n.d(i,"Vertex",(function(){return gf})),n.d(i,"VertexColors",(function(){return af})),n.d(i,"VideoTexture",(function(){return du})),n.d(i,"WebGL1Renderer",(function(){return sl})),n.d(i,"WebGLCubeRenderTarget",(function(){return Bo})),n.d(i,"WebGLMultipleRenderTargets",(function(){return ci})),n.d(i,"WebGLMultisampleRenderTarget",(function(){return di})),n.d(i,"WebGLRenderTarget",(function(){return hi})),n.d(i,"WebGLRenderTargetCube",(function(){return Lf})),n.d(i,"WebGLRenderer",(function(){return ol})),n.d(i,"WebGLUtils",(function(){return $a})),n.d(i,"WireframeGeometry",(function(){return Nh})),n.d(i,"WireframeHelper",(function(){return Pf})),n.d(i,"WrapAroundEnding",(function(){return Ke})),n.d(i,"XHRLoader",(function(){return If})),n.d(i,"ZeroCurvatureEnding",(function(){return Ze})),n.d(i,"ZeroFactor",(function(){return B})),n.d(i,"ZeroSlopeEnding",(function(){return Je})),n.d(i,"ZeroStencilOp",(function(){return gn})),n.d(i,"sRGBEncoding",(function(){return on}));var r={};n.r(r),n.d(r,"isMobile",(function(){return Jg})),n.d(r,"EventEmitter",(function(){return _v.a})),n.d(r,"earcut",(function(){return xv.a})),n.d(r,"BaseTextureCache",(function(){return Qv})),n.d(r,"CanvasRenderTarget",(function(){return n_})),n.d(r,"DATA_URI",(function(){return o_})),n.d(r,"ProgramCache",(function(){return Kv})),n.d(r,"TextureCache",(function(){return $v})),n.d(r,"clearTextureCache",(function(){return e_})),n.d(r,"correctBlendMode",(function(){return Nv})),n.d(r,"createIndicesForQuads",(function(){return Uv})),n.d(r,"decomposeDataUri",(function(){return s_})),n.d(r,"deprecation",(function(){return Jv})),n.d(r,"destroyTextureCache",(function(){return t_})),n.d(r,"determineCrossOrigin",(function(){return a_})),n.d(r,"getBufferType",(function(){return kv})),n.d(r,"getResolutionOfUrl",(function(){return l_})),n.d(r,"hex2rgb",(function(){return Cv})),n.d(r,"hex2string",(function(){return Pv})),n.d(r,"interleaveTypedArrays",(function(){return Hv})),n.d(r,"isPow2",(function(){return jv})),n.d(r,"isWebGLSupported",(function(){return Av})),n.d(r,"log2",(function(){return Vv})),n.d(r,"nextPow2",(function(){return zv})),n.d(r,"premultiplyBlendMode",(function(){return Lv})),n.d(r,"premultiplyRgba",(function(){return Dv})),n.d(r,"premultiplyTint",(function(){return Fv})),n.d(r,"premultiplyTintToRgba",(function(){return Bv})),n.d(r,"removeItems",(function(){return Wv})),n.d(r,"rgb2hex",(function(){return Ov})),n.d(r,"sayHello",(function(){return Mv})),n.d(r,"sign",(function(){return Xv})),n.d(r,"skipHello",(function(){return Ev})),n.d(r,"string2hex",(function(){return Iv})),n.d(r,"trimCanvas",(function(){return i_})),n.d(r,"uid",(function(){return Yv})),n.d(r,"url",(function(){return wv}));var o=n(6),s=n(0),a=n.n(s),l=n(2),u=n(1);
36
36
  /**
37
37
  * @license
38
38
  * Copyright 2010-2021 Three.js Authors
@@ -247,4 +247,4 @@ var UE=function(t,e){return(UE=Object.setPrototypeOf||{__proto__:[]}instanceof A
247
247
  *
248
248
  * pixi.js is licensed under the MIT License.
249
249
  * http://www.opensource.org/licenses/mit-license
250
- */_b.registerPlugin("accessibility",iy),_b.registerPlugin("extract",Bb),_b.registerPlugin("interaction",fy),_b.registerPlugin("particle",$w),_b.registerPlugin("prepare",rS),_b.registerPlugin("batch",Rb),_b.registerPlugin("tilingSprite",dS),Qb.registerPlugin(DS),Qb.registerPlugin(dw),Qb.registerPlugin(Pw),Qb.registerPlugin(Xw),Qb.registerPlugin(sS),Nb.registerPlugin(sy),Nb.registerPlugin(tw);var WE,XE={AlphaFilter:BS,BlurFilter:lE,BlurFilterPass:aE,ColorMatrixFilter:hE,DisplacementFilter:dE,FXAAFilter:fE,NoiseFilter:DE};class qE extends a.a{constructor(){super(),this.prevTime=-1,this.times=0,this.valueTotal=0,this.destroyed=!1,this.value=0,this.calcFps()}calcFps(){requestAnimationFrame(t=>{const e=t-this.prevTime;this.valueTotal+=e,this.times+=1,this.times>20&&(this.value=Math.floor(1e3*this.times/this.valueTotal),this.valueTotal=0,this.times=0,this.destroyed||this.emit("update",this.value)),this.prevTime=t,this.destroyed||this.calcFps()})}destroy(){this.destroyed=!0}}!function(t){t.ResourceError="RESOURCE_ERROR",t.RuntimeError="RUNTIME_ERROR",t.RuntimeWarn="RUNTIME_WARN",t.CanvasCrash="CANVAS_CRASH"}(WE||(WE={}));class YE extends Error{constructor(t,e){var n,i;super(e),n=this,i=new.target.prototype,Object.setPrototypeOf?Object.setPrototypeOf(n,i):n.__proto__&&(n.__proto__=i),this.errorType=t,this.errorMsg=e}static transform(t){return t instanceof YE?t:new YE(WE.RuntimeError,t.message)}}function ZE(){return function(t,e,n){const i=n.value;n.value=function(...t){try{return i.apply(this,t)}catch(t){throw new YE(WE.RuntimeWarn,t.message)}}}}const JE=new class{constructor(){this.info=[],this.warn=[],this.error=[]}attach(t,e){this[t]&&this[t].push(e)}createLogger(t){return(e,n)=>{this[t].forEach(t=>{t(`[taskId:${n}] ${e}`)})}}},KE={warn:JE.createLogger("warn"),error:JE.createLogger("error"),info:JE.createLogger("info")};var $E=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};function QE(t){return $E(this,void 0,void 0,(function*(){const e=yield fetch(t);if(!e.ok)throw new YE(WE.ResourceError,`"${e.url}" loaded failed with status "${e.status}"`);return e}))}class tM{constructor(t,e){this.useCache=!1,this.taskId="",this.useCache=e,this.localStorage=t}attachTaskId(t){this.taskId=t}fetchJson(t){return $E(this,void 0,void 0,(function*(){let e;return this.useCache&&(KE.info("load resource from cache. "+t,this.taskId||""),e=yield this.localStorage.getItem(t)),e?(KE.info("cache hit. "+t,this.taskId||""),e):(KE.info("load resource from server. "+t,this.taskId||""),e=yield(yield QE(""+t)).json(),KE.info("load end. "+t,this.taskId||""),this.useCache&&this.localStorage.setItem(t,e).catch(()=>{}),e)}))}fetchPng(t){return $E(this,void 0,void 0,(function*(){let e;if(this.useCache&&(KE.info("load resource from cache. "+t,this.taskId||""),e=yield this.localStorage.getItem(t)),e)return KE.info("cache hit. "+t,this.taskId||""),e;{KE.info("load resource from server. "+t,this.taskId||"");const n=yield QE(t),i=yield n.blob();return e=yield function(t){return new Promise((e,n)=>{const i=new FileReader;i.onload=()=>{e(i.result)},i.onerror=()=>{n(new YE(WE.ResourceError,"Failed parse blob data."))},i.readAsDataURL(t)})}(i),KE.info("load end. "+t,this.taskId||""),this.useCache&&this.localStorage.setItem(t,e).catch(()=>{}),e}}))}destroy(){}}var eM=n(7),nM=n.n(eM);function iM(t,e,n=5){return Math.abs(t-e)<=Math.pow(10,-n)}function rM(t){return Math.floor(1e6*t)/1e6}class oM{constructor(){this.point={x:0,y:0},this.slope=Math.PI/4}static fromPointSlope(t,e){const n=new oM;return n.point=t,n.slope=e,n}resolveY(t){return Math.tan(this.slope)*(t-this.point.x)+this.point.y}distanceToLinearEquation(t){return iM(this.slope,t.slope)?this.distanceToPoint(t.point):-1}distanceToPoint(t){let e=0;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;e=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;const n=oM.fromPointSlope(t,e),i=this.crossPoint(n);return i?Math.ceil(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))):0}crossPoint(t){if(iM(t.slope,this.slope))return null;let e=0,n=0;const i=Math.tan(t.slope),r=Math.tan(this.slope),{x:o,y:s}=this.point,{x:a,y:l}=t.point;return iM(this.slope,Math.PI/2)?(e=this.point.x,n=i*(e-a)+l):iM(t.slope,Math.PI/2)?(e=t.point.x,n=r*(e-o)+s):iM(this.slope,Math.PI)||iM(this.slope,0)?(n=this.point.y,e=(n-l)/i+a):iM(t.slope,Math.PI)||iM(t.slope,0)?(n=t.point.y,e=(n-s)/r+o):(e=(i*a-l+s-r*o)/(i-r),n=r*(e-o)+s),{x:e,y:n}}}var sM=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};function aM(){return Date.now().toString(32)+Math.random().toString(32).substring(2)}const lM="__delay_resolve_result__";function uM(t,e){return sM(this,void 0,void 0,(function*(){const n=yield Promise.race([t(),(i=e,new Promise(t=>{setTimeout(()=>{t(lM)},i)}))]);var i;return n===lM?lM:n}))}var hM=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class cM{constructor(t){this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=t=>{const e=t/(gv.TARGET_FPMS||.06);if(!this.isPaused){this.timestamp+=e,this.callbackList=this.callbackList.filter(t=>t&&!t.applied);let{length:t}=this.callbackList;for(let e=0;e<t;e++){const n=this.callbackList[e];if(n&&!n.applied){if(!(n.triggerTime<=this.timestamp))break;n.running=!0,n.fn(),n.applied=!0,t=this.callbackList.length}}}},this.ticker=t,this.ticker.add(this.onTimeUpdate)}setTimeout(t,e){const n=aM(),i=this.timestamp+Math.max(e||16,16);return this.callbackList.push({fn:t,triggerTime:i,id:n,applied:!1,running:!1}),this.callbackList.sort((t,e)=>t.triggerTime-e.triggerTime),n}clearTimeout(t){const e=this.callbackList.findIndex(e=>e.id===t);e>=0&&!this.callbackList[e].running&&this.callbackList.splice(e,1)}delay(t){return new Promise(e=>{this.setTimeout(e,t)})}waitUntil(t,e){return hM(this,void 0,void 0,(function*(){const n=this.timestamp;for(;!t()&&this.timestamp-n<e;)yield this.delay(50)}))}pause(){this.isPaused=!0}resume(){this.isPaused=!1}}var dM=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class pM{constructor(t){this.gifs=Object.create(null),this.textures=Object.create(null),this.frames=Object.create(null),this.spriteSheets=[],this.loader=t}getTexture(t){return this.textures[t]||null}getFrameData(t){return this.frames[t]}getGifFrames(t){return this.gifs[t]?this.gifs[t].filter(t=>!!t):[]}loadSpriteSheetItem(t,e,n){return dM(this,void 0,void 0,(function*(){const i=yield this.loader.fetchJson(`${t}/${e}/jsonOutput/${n}.json`),r=yield this.loader.fetchPng(`${t}/${e}/jsonOutput/${n}.png`),o=document.createElement("img");o.src=r,yield new Promise((t,e)=>{o.onload=()=>t(""),o.onerror=()=>e()});const s=new Sy(o),a=new oS(s,i);yield new Promise(t=>{a.parse(()=>t(""))}),this.spriteSheets.push(a),Object.keys(a.textures).forEach(t=>{const e=t.match(/^(.+)_gif_(\d+)$/);if(e&&e[1]&&e[2]){const n=e[1];this.gifs[n]||(this.gifs[n]=[]);const i=parseInt(e[2],10);this.gifs[n][i]=a.textures[t]}else this.frames[t]=i.frames[t],this.textures[t]=a.textures[t]})}))}destroy(){this.spriteSheets.forEach(t=>t.destroy(!0)),this.spriteSheets=[],this.gifs=Object.create(null),this.textures=Object.create(null),this.frames=Object.create(null)}}var fM=n(3),mM=n.n(fM);function gM(t,e,n){let i,r;const o=Math.round(t)%360;if(o%180==0)i=Math.cos(o*(Math.PI/180))*e,r=0;else if(o%90==0)i=0,r=Math.sin(o*(Math.PI/180))*n;else{const t=function(t){const e=t*Math.PI/180;return Math.tan(e)}(o);i=e*n/Math.sqrt(Math.pow(n,2)+Math.pow(e*t,2)),(o>90&&o<270||o<-90&&o>-270)&&(i=-i),r=t*i}return{x:i,y:r}}function vM(t,e,n,i,r,o){const s=t,a=e;let l,u,h,c,d;if(0===Math.round(i))l=r,u=o,d=0;else if(Math.round(i)>=360)l=r,u=o,h=r+2*t*Math.abs(Math.cos(-n/180*Math.PI)),c=o+2*e*Math.sin(-n/180*Math.PI),d=1;else{const t=-n,e=-(n+i),{x:h,y:c}=gM(t,s,a),p=r-h,f=o+c,{x:m,y:g}=gM(e,s,a);l=m+p,u=f-g,d=i>=-360&&i<-180?1:i>=-180&&i<0||i>0&&i<180?0:1}return{radiusX:s,radiusY:a,xAxisRotation:0,largeArcFlag:d,sweepFlag:i>0?1:0,endX:l,endY:u,middleX:h,middleY:c}}class _M{constructor(){this.pool=[]}getObject(t){const e=this.pool.find(t=>!t.isUsed);if(e)return e.isUsed=!0,e.obj;{const e={obj:this.createObject(),isUsed:!0,group:t};return this.pool.push(e),e.obj}}collectObject(t){const e=this.pool.find(e=>e.obj===t);e&&(e.isUsed=!1,this.resetObject(e.obj))}collectObjectByGroup(t){this.pool.filter(e=>e.group===t).forEach(t=>this.collectObject(t.obj))}}const yM=new class extends _M{createObject(){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("version","1.1"),t}resetObject(t){t.removeAttribute("viewBox"),t.removeAttribute("width"),t.removeAttribute("height"),t.innerHTML=""}};const xM=new class extends _M{createObject(){return document.createElement("img")}resetObject(t){t.removeAttribute("src")}};var bM=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class wM{constructor(){this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null)}render(t,e,n){return bM(this,void 0,void 0,(function*(){const{items:e,width:i,height:r}=t,o=xM.getObject(n),s=new Sy(o,{width:i,height:r,resolution:1}),a=yM.getObject(n);this.imgElements.push(o),this.svgElements.push(a),a.setAttribute("viewBox",`0 0 ${i} ${r}`),a.setAttribute("width",""+i),a.setAttribute("height",""+r);const l={},h={};e.forEach(t=>{const{item:e,x:n,y:i}=t,r=n+2,o=i+2;e.pathsData.forEach(t=>{let e="";t.cmds.forEach(([n,i])=>{e+=n+" ",e+=i.map(e=>(Object(u.isNumber)(e)||(e.x=e.x+t.offset.x+r,e.y=e.y+t.offset.y+o),e)).reduce((t,e)=>(Object(u.isNumber)(e)?t+=e+" ":t+=`${e.x} ${e.y} `,t),""),e+=" "}),t.pathElement.setAttribute("d",e),a.appendChild(t.pathElement)});const c=e.width-4-2*e.padding,d=e.height-4-2*e.padding;this.textures[e.hash]={texture:new Gy(s,new p_(r+2,o+2,c,d)),pivot:e.pivot},l[e.hash]={x:r+2,y:o+2,w:c,h:d,pivot:e.pivot},h[e.hash]=this.hashToIdMap[e.hash]});const c=(d='<?xml version="1.0" encoding="utf-8"?>'+a.outerHTML,"data:image/svg+xml,"+encodeURIComponent(d).replace(/'/g,"%27").replace(/"/g,"%22"));var d;o.src=c,yield new Promise((t,e)=>{o.onload=()=>t(""),o.onerror=()=>e()})}))}getGraphicsData(t){const e=this.idToHashMap[t]||"";return this.textures[e]||null}addGraphics(t,e,n,i,r,o,s,a,l,u,h){var c,d;if(!s&&!l)return t;const p=mM()(n+(null!==(d=null===(c=null==s?void 0:s.width)||void 0===c?void 0:c.toString())&&void 0!==d?d:0)+l+u+h);if(this.hashToIdMap[p]||(this.hashToIdMap[p]=[]),this.hashToIdMap[p].push(t),this.idToHashMap[t]=p,this.graphics.findIndex(t=>t.hash===p)<0){const{graphicsWidth:t,graphicsHeight:n,pathsData:a,pivot:c,padding:d}=function(t,e,n,i,r,o,s,a,l){var u;const h=[],c={x:Math.abs(r.x),y:Math.abs(r.y)};let d=0,p=0,f=0,m=0,g=0,v="none";const _=null!==(u=null==i?void 0:i.width)&&void 0!==u?u:0;return s?(d=e,p=n,g=0):(v=l||"#ff0000",g=_,f=.5*_,m=.5*_,d=e+_,p=n+_,c.x+=.5*_,c.y+=.5*_),d+=Math.abs(r.x),p+=Math.abs(r.y),f+=Math.abs(r.x),m+=Math.abs(r.y),d+=4,p+=4,f+=2,m+=2,d=Math.ceil(d),p=Math.ceil(p),t.forEach(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","path");"none"!==t.fill&&s?e.setAttribute("fill",a||"#ff0000"):e.setAttribute("fill","none"),t.hasStroke&&!s&&(e.setAttribute("stroke-linecap",(null==i?void 0:i.cap)||"butt"),e.setAttribute("stroke-linejoin",(null==i?void 0:i.join)||"miter"),e.setAttribute("stroke-width",g.toString()),e.setAttribute("stroke",v),(null==i?void 0:i.dash)&&e.setAttribute("stroke-dasharray",i.dash));const{scale:n}=t,r=t.path.trim().split(" ");let o={x:0,y:0};const l={offset:{x:f,y:m},cmds:[],pathElement:e};for(let t=0;t<r.length;t+=2){const e=r[t],i=r[t+1];if("M"===e){let[t,e]=i.split(",").map(t=>Number(t));o={x:t,y:e},t=t/9525*n.x,e=e/9525*n.y,l.cmds.push(["M",[{x:t,y:e}]])}else if("A"===e){const[t,e,r,s]=i.split(",").map(t=>Number(t)),a=r/Math.PI*180,u=s/Math.PI*180,h=vM(t,e,a,u,o.x,o.y);Math.round(u)>=360?(o={x:h.endX,y:h.endY},l.cmds.push(["A",[h.radiusX/9525*n.x,h.radiusY/9525*n.y,h.xAxisRotation,h.largeArcFlag,h.sweepFlag,{x:h.middleX/9525*n.x,y:h.middleY/9525*n.y}]]),l.cmds.push(["A",[h.radiusX/9525*n.x,h.radiusY/9525*n.y,h.xAxisRotation,h.largeArcFlag,h.sweepFlag,{x:h.endX/9525*n.x,y:h.endY/9525*n.y}]])):(o={x:h.endX,y:h.endY},l.cmds.push(["A",[h.radiusX/9525*n.x,h.radiusY/9525*n.y,h.xAxisRotation,h.largeArcFlag,h.sweepFlag,{x:h.endX/9525*n.x,y:h.endY/9525*n.y}]]))}else if("L"===e){let[t,e]=i.split(",").map(t=>Number(t));o={x:t,y:e},t=t/9525*n.x,e=e/9525*n.y,l.cmds.push(["L",[{x:t,y:e}]])}else if("QB"===e){let[t,e,r,s]=i.split(",").map(t=>Number(t));o={x:r,y:s},t=t/9525*n.x,e=e/9525*n.y,r=r/9525*n.x,s=s/9525*n.y,l.cmds.push(["Q",[{x:t,y:e},{x:r,y:s}]])}else if("CB"===e){let[t,e,r,s,a,u]=i.split(",").map(t=>Number(t));o={x:a,y:u},t=t/9525*n.x,e=e/9525*n.y,r=r/9525*n.x,s=s/9525*n.y,a=a/9525*n.x,u=u/9525*n.y,l.cmds.push(["C",[{x:t,y:e},{x:r,y:s},{x:a,y:u}]])}else"C"===e&&l.cmds.push(["Z",[]])}h.push(l)}),{graphicsWidth:d,graphicsHeight:p,pivot:c,padding:2,pathsData:h}}(e,r,o,s,i,0,l,u,h);this.graphics.push({hash:p,pathsData:a,pivot:c,width:t,height:n,padding:d})}return t}pack(){this.graphics.forEach(t=>{t.width+=4,t.height+=4});return function t(e){const n=[],i=e.filter(t=>{const e=t.width<2048&&t.height<2048;return e||n.push(t),e}).sort((t,e)=>t.width*t.height-e.width*e.height);let r=i.length+1,o=2050,s=2050;const a=[];let l=null;for(;(o>2048||s>2048)&&i.length>0;)r-=1,l=nM()(i.slice(0,r)),o=l.width,s=l.height;return l&&a.push(l),n.forEach(t=>{const e=nM()([t]);a.push(e)}),r<i.length?a.concat(t(i.slice(r))):a}(this.graphics)}destroy(){Object.keys(this.textures).forEach(t=>{var e;null===(e=this.textures[t])||void 0===e||e.texture.destroy(!0)}),this.textures=Object.create(null),this.imgElements.forEach(t=>xM.collectObject(t)),this.svgElements.forEach(t=>yM.collectObject(t)),this.graphics=[]}}class TM{constructor(){this.runningTimeNodes={}}addRunningTimeNode(t,e,n){const i=`${e}_${t}`;if(this.runningTimeNodes[i])try{this.runningTimeNodes[i].dispose(!0)}catch(t){}this.runningTimeNodes[i]=n}}class SM{constructor(t){this.eventHub=t,this.targets=Object.create(null)}getTargets(){return Object.keys(this.targets).map(t=>this.targets[t])}addTarget(t,e){this.targets[t]=e}getTargetById(t){return this.targets[t]}getTarget(t,e,n={type:"el",index:0,id:""}){var i,r;let o=this.targets[t.id];return"shape"!==t.type?o:("shape"===t.type&&t.txEl&&(o=null!==(i=null==o?void 0:o.getTextElement(t.txEl.type,t.txEl.range))&&void 0!==i?i:null),"shape"===t.type&&t.bg&&0===n.index&&(e=!1,o=null!==(r=null==o?void 0:o.getBgElement())&&void 0!==r?r:null,this.eventHub.emit("IterateTimeNodeEnd",n.id)),e&&o?o.getIterateEntry(n.type,n.index,n.id):(o||this.eventHub.emit("IterateTimeNodeEnd",n.id),o))}clearTargets(){this.targets=Object.create(null)}}class EM{constructor(t){this.target=t}get color(){return this.target.strokeColorFilter.currentColor}set color(t){this.target.strokeColorFilter.color=t}get on(){return this.target.strokeActive?"true":"false"}set on(t){this.target.strokeActive="true"===t}}class MM{constructor(t){this.target=t}applyCommand(t,e){this.target.applyCommand(t,e)}}class AM{constructor(t){this.target=t}get color(){return this.target.fillColorFilter.currentColor}set color(t){this.target.fillActive&&(this.target.fillColorFilter.color=t)}get on(){return this.target.fillActive?"true":"false"}set on(t){this.target.fillActive="true"===t}get designColor(){return this.target.fillColorFilter.designColor}}class RM{constructor(t,e){this.hardHidden=!1,this.target=t,!0===e&&(this.hardHidden=!0)}get opacity(){return this.target.alpha}set opacity(t){this.target.alpha=t}get rotation(){return this.target.rotation/Math.PI*180}set rotation(t){this.target.rotation=t/180*Math.PI}get visibility(){return this.target.visible?"visible":"hidden"}set visibility(t){this.visibility===t||this.hardHidden||(this.target.visible="visible"===t)}}class CM{constructor(t,e){this.actions=[],this.ctx=e,this.object=t,this.object.interactive=!0}reset(t){this.object.interactive=!1,this.object.removeAllListeners(),this.object=t,this.object.interactive=!0}addAction(t,e){this.actions.push([t,e]),"click"===e?(this.object.addListener("click",()=>this.handleAction(t)),this.object.cursor="pointer"):"hover"===e&&this.object.addListener("mouseover",()=>this.handleAction(t))}addProxy(t){this.proxy=t,this.hitArea=this.getOriginHitArea(),this.proxy.interactive=!0,this.actions.forEach(([t,e])=>{var n,i;"click"===e?null===(n=this.proxy)||void 0===n||n.addListener("click",e=>this.handleProxyAction(e,t)):"hover"===e&&(null===(i=this.proxy)||void 0===i||i.addListener("mouseover",e=>this.handleProxyAction(e,t)))})}handleProxyAction(t,e){var n;const i=t.data.global,r=this.object.getGlobalPosition(),o=i.x-r.x+this.object.pivot.x,s=i.y-r.y+this.object.pivot.y;(null===(n=this.hitArea)||void 0===n?void 0:n.contains(o,s))&&this.object.visible&&this.handleAction(e,!0)}getOriginHitArea(){return this.object.hitArea?this.object.hitArea:new v_(0,0,this.object.width,this.object.height)}handleAction(t,e=!1){this.proxy&&!e||(this.ctx.eventHub.emit(KR.hyperlinkTrigger,t),this.execAction(t))}execAction(t){var e;if(this.ctx.eventHub.emit(KR.userInput),"ppaction://hlinksldjump"===t.action){const n=(null!==(e=null==t?void 0:t.target)&&void 0!==e?e:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(KR.requestGotoSlide,Number(n[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===t.action)this.ctx.eventHub.emit(KR.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===t.action)this.ctx.eventHub.emit(KR.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===t.action)this.ctx.eventHub.emit(KR.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===t.action)this.ctx.eventHub.emit(KR.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===t.action){const t=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(KR.requestGotoSlide,t)}else"ppaction://hlinkshowjump?jump=endshow"===t.action&&this.ctx.eventHub.emit(KR.requestGotoSlide,-1)}}class PM{constructor(t,e,n){var i,r,o,s,a,l;this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new p_(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new ey,this.ctx=e,this.style=new RM(this.container,t.hardHidden),this.designGlobalPosition={x:n.x+(null!==(r=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==r?r:0),y:n.y+(null!==(s=null===(o=t.position)||void 0===o?void 0:o.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new CM(this.container,this.ctx),t.hlinkHover&&(null===(a=this.hyperlink)||void 0===a||a.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(l=this.hyperlink)||void 0===l||l.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil(()=>{try{return!!this.container.width}catch(t){return!1}},3e3).then(()=>{try{this.designWidth=this.designWidth||this.container.width}catch(t){}}),this.ctx.clock.waitUntil(()=>{try{return!!this.container.height}catch(t){return!1}},3e3).then(()=>{try{this.designHeight=this.designHeight||this.container.height}catch(t){}})}updateScale(){this.container&&(this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y)}updateTransform(t){var e,n,i,r,o,s,a,l;this.designWidth=t.width,this.designHeight=t.height,this.designX=null!==(n=null===(e=t.position)||void 0===e?void 0:e.x)&&void 0!==n?n:0,this.designY=null!==(r=null===(i=t.position)||void 0===i?void 0:i.y)&&void 0!==r?r:0;const u=this.designWidth/2,h=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=u,this.container.pivot.y=h;const c=null!==(s=null===(o=t.position)||void 0===o?void 0:o.x)&&void 0!==s?s:0,d=null!==(l=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==l?l:0;this.container.x=c+u,this.container.y=d+h,t.scale&&(this.designScale={x:t.scale.x,y:t.scale.y},this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y),t.rotation&&(this.container.rotation=t.rotation);const p=new RT;p.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(p),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=c,this.bound.y=d,this.bound.width=this.designWidth,this.bound.height=this.designHeight}get scale(){return this.scaleOrigin}set scale(t){this.scaleOrigin.x=t.x,this.scaleOrigin.y=t.y,this.updateScale()}get design_ppt_w(){return rM(this.designWidth/this.ctx.stageWidth)}get design_ppt_h(){return rM((this.designHeight||this.container.height)/this.ctx.stageHeight)}get design_ppt_x(){return rM(this.designX/this.ctx.stageWidth)}get design_ppt_y(){return rM(this.designY/this.ctx.stageHeight)}get ppt_w(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth}set ppt_w(t){this.designWidth&&(this.scaleExt.x=t*this.ctx.stageWidth/this.designWidth,this.updateScale())}get ppt_h(){const t=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*t/this.ctx.stageHeight}set ppt_h(t){this.designHeight&&(this.scaleExt.y=t*this.ctx.stageHeight/this.designHeight,this.updateScale())}get ppt_x(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth}set ppt_x(t){this.pptX=t;const e=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=t*this.ctx.stageWidth+this.container.pivot.x*e}get ppt_y(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight}set ppt_y(t){this.pptY=t;const e=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=t*this.ctx.stageHeight+this.container.pivot.y*e}get r(){return this.container.rotation}set r(t){this.container.rotation=t}set xshear(t){this.container.skew.x=t}get xshear(){return this.container.skew.x}set yshear(t){this.container.skew.y=t}get yshear(){return this.container.skew.y}}class IM{constructor(t){if(this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;const e=t.match(/-?[0-9]+/g);e&&(this.h=parseInt(e[0],10),this.s=parseInt(e[1],10)/100,this.l=parseInt(e[2],10)/100)}}isInit(){return this._isInit}by(t,e){e.h=Math.max(Math.min(this.h+t.h,359),0),e.s=Math.max(Math.min(this.s+t.s,1),0),e.l=Math.max(Math.min(this.l+t.l,1),0),e.a=Math.max(Math.min(this.a+t.a,1),0)}fromHexString(t){const[e,n,i,r]=NM(t);let o=0,s=0,a=0;const l=Math.max(e,n,i),u=Math.min(e,n,i),h=l-u;a=(l+u)/2,0===h?o=0:l===e?o=(n-i)/h%6*60:l===n?o=60*((i-e)/h+2):l===i&&(o=60*((e-n)/h+4)),s=0===h?0:h/(1-Math.abs(2*a-1)),this.h=o,this.s=s,this.l=a,this.a=r}interpolationFrom(t,e,n){const i=t.h+(this.h-t.h)*e,r=t.s+(this.s-t.s)*e,o=t.l+(this.l-t.l)*e,s=t.a+(this.a-t.a)*e;n.h=Math.max(Math.min(i,359),0),n.s=Math.max(Math.min(r,1),0),n.l=Math.max(Math.min(o,1),0),n.a=Math.max(Math.min(s,1),0)}toHexString(){let t=[0,0,0,0];const{h:e,s:n,l:i}=this;if(e<360&&e>=0&&n<=1&&n>=0&&i<=1&&i>=0){let r,o,s;const a=(1-Math.abs(2*i-1))*n,l=a*(1-Math.abs(e/60%2-1)),u=i-a/2;[r,o,s]=e>=0&&e<60?[a,l,0]:e>=60&&e<120?[l,a,0]:e>=120&&e<180?[0,a,l]:e>=180&&e<240?[0,l,a]:e>=240&&e<300?[l,0,a]:[a,0,l],t=[r+u,o+u,s+u,this.a]}return DM(t)}}class OM{constructor(t){this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}fromHexString(t){const[e,n,i,r]=NM(t);this.r=e,this.g=n,this.b=i,this.a=r}isInit(){return this._isInit}interpolationFrom(t,e,n){n.r=t.r+(this.r-t.r)*e,n.g=t.g+(this.g-t.g)*e,n.b=t.b+(this.b-t.b)*e,n.a=t.a+(this.a-t.a)*e}by(t,e){e.r=Math.min(Math.max(this.r+t.r,0),255),e.g=Math.min(Math.max(this.g+t.g,0),255),e.b=Math.min(Math.max(this.b+t.b,0),255),e.a=Math.min(Math.max(this.a+t.a,0),1)}toHexString(){return DM([this.r,this.g,this.b,this.a])}}function LM(t){const e=t.substring(1);return[parseInt(e.substring(0,6),16),parseInt(e.substring(6,8),16)/255]}function NM(t){return 0===(t=t.replace(/^#/,"")).substring(6,8).length&&(t+="FF"),[parseInt(t.substring(0,2).padStart(8,"0"),16)/255,parseInt(t.substring(2,4).padStart(8,"0"),16)/255,parseInt(t.substring(4,6).padStart(8,"0"),16)/255,parseInt(t.substring(6,8).padStart(8,"0"),16)/255]}function DM(t){return"#"+Math.round(255*t[0]).toString(16).padStart(2,"0")+Math.round(255*t[1]).toString(16).padStart(2,"0")+Math.round(255*t[2]).toString(16).padStart(2,"0")+Math.round(255*t[3]).toString(16).padStart(2,"0")}function FM(t,e,n){const i=NM(t),r=NM(e),o=Math.round(255*(i[0]+(r[0]-i[0])*n)),s=Math.round(255*(i[1]+(r[1]-i[1])*n)),a=Math.round(255*(i[2]+(r[2]-i[2])*n)),l=Math.round(255*(i[3]+(r[3]-i[3])*n));return"#"+o.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+l.toString(16).padStart(2,"0")}class BM extends Hx{constructor(){super(void 0,"\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n",{color:new Float32Array([0,0,0,0]),active:0}),this.currentColor="#FFFFFFFF",this.designColor="#FFFFFFFF"}set color(t){this.currentColor=t;const e=NM(t);this.uniforms.color=Float32Array.from(e)}get color(){return this.currentColor}}const UM=new XE.ColorMatrixFilter;UM.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];const kM=new XE.ColorMatrixFilter;kM.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];const GM=new XE.ColorMatrixFilter;GM.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];const HM=new XE.ColorMatrixFilter;HM.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];const zM={darken:UM,darkenLess:kM,lightenLess:HM,lighten:GM};class jM extends PM{constructor(t,e,n){super({position:{x:t.x,y:t.y},width:t.width,height:t.height},e,n),this.fillColorFilter=new BM,this.fill=new AM(this),this.json=t,this.ctx=e,this.parentGlobalPos=n,this.global={x:n.x+t.x,y:n.y+t.y},this.updateTransform({position:{x:t.x,y:t.y},width:t.width,height:t.height})}get fillActive(){var t,e;return(null!==(e=null===(t=this.container.filters)||void 0===t?void 0:t.length)&&void 0!==e?e:-1)>0}set fillActive(t){var e,n;t?(null!==(n=null===(e=this.container.filters)||void 0===e?void 0:e.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}get renderContainer(){return this.container}get interactiveContainer(){return this.container}clearOnSlideChange(){}initOnReuse(){}getTextElement(){return null}getBgElement(){return null}get ppt_x(){return this.global.x/this.ctx.stageWidth}set ppt_x(t){const e=t*this.ctx.stageWidth-this.global.x,n=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+e+this.container.pivot.x*n}get ppt_y(){return this.global.y/this.ctx.stageHeight}set ppt_y(t){const e=t*this.ctx.stageHeight-this.global.y,n=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+e+this.container.pivot.y*n}get design_ppt_x(){return rM(this.global.x/this.ctx.stageWidth)}get design_ppt_y(){return rM(this.global.y/this.ctx.stageHeight)}}class VM{constructor(t,e,n,i,r,o,s,a,l,u,h){this.ctx=t,this.type=e,this.lineWidth=n,this.width=i,this.height=r,this.fillColor=o,this.isHorz=s,this.renderContainer=new ey,this.ghcTextureId=`${a}-text-p${l}-l${u}-u${h}-underLine`}createPaths(){if("ww"===this.type)return null;{let t=`M 0,0 L ${9525*this.width},0`,[e,n]=[this.width,this.lineWidth];return this.isHorz||(t="M 0,0 L 0,"+9525*this.height,[e,n]=[this.lineWidth,this.height]),{paths:[{id:aM(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:mM()(t)}],width:e,height:n}}}getLineStyle(){const t={width:this.lineWidth};return"dotted"===this.type&&(t.dash=""+this.lineWidth),t}preRender(){const t=this.createPaths();if(t){const{paths:e,width:n,height:i}=t,r=e.reduce((t,e)=>t+e.hash,"");this.ctx.graphicsTexture.addGraphics(this.ghcTextureId,e,r,{x:0,y:0},n,i,this.getLineStyle(),this.ctx.objectPoolGroup,!1,null,this.fillColor)}}render(){if(this.ghcTextureId){const t=this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);t&&(this.sprite=new LT,this.sprite.texture=t.texture,this.sprite.pivot.x=t.pivot.x)}}destroy(){var t;null===(t=this.sprite)||void 0===t||t.destroy({texture:!0})}}const WM=134217729;function XM(t,e,n,i,r){let o,s,a,l,u=e[0],h=i[0],c=0,d=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=i[++d]);let p=0;if(c<t&&d<n)for(h>u==h>-u?(s=u+o,a=o-(s-u),u=e[++c]):(s=h+o,a=o-(s-h),h=i[++d]),o=s,0!==a&&(r[p++]=a);c<t&&d<n;)h>u==h>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c]):(s=o+h,l=s-o,a=o-(s-l)+(h-l),h=i[++d]),o=s,0!==a&&(r[p++]=a);for(;c<t;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c],o=s,0!==a&&(r[p++]=a);for(;d<n;)s=o+h,l=s-o,a=o-(s-l)+(h-l),h=i[++d],o=s,0!==a&&(r[p++]=a);return 0===o&&0!==p||(r[p++]=o),p}function qM(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}function YM(t){return new Float64Array(t)}const ZM=YM(4),JM=YM(8),KM=YM(12),$M=YM(16),QM=YM(4);function tA(t,e,n,i,r,o){const s=(e-o)*(n-r),a=(t-r)*(i-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=33306690738754716e-32*u?l:-function(t,e,n,i,r,o,s){let a,l,u,h,c,d,p,f,m,g,v,_,y,x,b,w,T,S;const E=t-r,M=n-r,A=e-o,R=i-o;x=E*R,d=WM*E,p=d-(d-E),f=E-p,d=WM*R,m=d-(d-R),g=R-m,b=f*g-(x-p*m-f*m-p*g),w=A*M,d=WM*A,p=d-(d-A),f=A-p,d=WM*M,m=d-(d-M),g=M-m,T=f*g-(w-p*m-f*m-p*g),v=b-T,c=b-v,ZM[0]=b-(v+c)+(c-T),_=x+v,c=_-x,y=x-(_-c)+(v-c),v=y-w,c=y-v,ZM[1]=y-(v+c)+(c-w),S=_+v,c=S-_,ZM[2]=_-(S-c)+(v-c),ZM[3]=S;let C=qM(4,ZM),P=22204460492503146e-32*s;if(C>=P||-C>=P)return C;if(c=t-E,a=t-(E+c)+(c-r),c=n-M,u=n-(M+c)+(c-r),c=e-A,l=e-(A+c)+(c-o),c=i-R,h=i-(R+c)+(c-o),0===a&&0===l&&0===u&&0===h)return C;if(P=11093356479670487e-47*s+33306690738754706e-32*Math.abs(C),C+=E*h+R*a-(A*u+M*l),C>=P||-C>=P)return C;x=a*R,d=WM*a,p=d-(d-a),f=a-p,d=WM*R,m=d-(d-R),g=R-m,b=f*g-(x-p*m-f*m-p*g),w=l*M,d=WM*l,p=d-(d-l),f=l-p,d=WM*M,m=d-(d-M),g=M-m,T=f*g-(w-p*m-f*m-p*g),v=b-T,c=b-v,QM[0]=b-(v+c)+(c-T),_=x+v,c=_-x,y=x-(_-c)+(v-c),v=y-w,c=y-v,QM[1]=y-(v+c)+(c-w),S=_+v,c=S-_,QM[2]=_-(S-c)+(v-c),QM[3]=S;const I=XM(4,ZM,4,QM,JM);x=E*h,d=WM*E,p=d-(d-E),f=E-p,d=WM*h,m=d-(d-h),g=h-m,b=f*g-(x-p*m-f*m-p*g),w=A*u,d=WM*A,p=d-(d-A),f=A-p,d=WM*u,m=d-(d-u),g=u-m,T=f*g-(w-p*m-f*m-p*g),v=b-T,c=b-v,QM[0]=b-(v+c)+(c-T),_=x+v,c=_-x,y=x-(_-c)+(v-c),v=y-w,c=y-v,QM[1]=y-(v+c)+(c-w),S=_+v,c=S-_,QM[2]=_-(S-c)+(v-c),QM[3]=S;const O=XM(I,JM,4,QM,KM);x=a*h,d=WM*a,p=d-(d-a),f=a-p,d=WM*h,m=d-(d-h),g=h-m,b=f*g-(x-p*m-f*m-p*g),w=l*u,d=WM*l,p=d-(d-l),f=l-p,d=WM*u,m=d-(d-u),g=u-m,T=f*g-(w-p*m-f*m-p*g),v=b-T,c=b-v,QM[0]=b-(v+c)+(c-T),_=x+v,c=_-x,y=x-(_-c)+(v-c),v=y-w,c=y-v,QM[1]=y-(v+c)+(c-w),S=_+v,c=S-_,QM[2]=_-(S-c)+(v-c),QM[3]=S;const L=XM(O,KM,4,QM,$M);return $M[L-1]}(t,e,n,i,r,o,u)}YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(8),YM(8),YM(8),YM(4),YM(8),YM(8),YM(8),YM(12);YM(192),YM(192);YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(8),YM(8),YM(8),YM(8),YM(8),YM(8),YM(8),YM(8),YM(8),YM(4),YM(4),YM(4),YM(8),YM(16),YM(16),YM(16),YM(32),YM(32),YM(48),YM(64);YM(1152),YM(1152);YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(4),YM(24),YM(24),YM(24),YM(24),YM(24),YM(24),YM(24),YM(24),YM(24),YM(24),YM(1152),YM(1152),YM(1152),YM(1152),YM(1152),YM(2304),YM(2304),YM(3456),YM(5760),YM(8),YM(8),YM(8),YM(16),YM(24),YM(48),YM(48),YM(96),YM(192),YM(384),YM(384),YM(384),YM(768);YM(96),YM(96),YM(96),YM(1152);const eA=Math.pow(2,-52),nA=new Uint32Array(512);class iA{static from(t,e=uA,n=hA){const i=t.length,r=new Float64Array(2*i);for(let o=0;o<i;o++){const i=t[o];r[2*o]=e(i),r[2*o+1]=n(i)}return new iA(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=t.length>>1;let s=1/0,a=1/0,l=-1/0,u=-1/0;for(let e=0;e<o;e++){const n=t[2*e],i=t[2*e+1];n<s&&(s=n),i<a&&(a=i),n>l&&(l=n),i>u&&(u=i),this._ids[e]=e}const h=(s+l)/2,c=(a+u)/2;let d,p,f,m=1/0;for(let e=0;e<o;e++){const n=rA(h,c,t[2*e],t[2*e+1]);n<m&&(d=e,m=n)}const g=t[2*d],v=t[2*d+1];m=1/0;for(let e=0;e<o;e++){if(e===d)continue;const n=rA(g,v,t[2*e],t[2*e+1]);n<m&&n>0&&(p=e,m=n)}let _=t[2*p],y=t[2*p+1],x=1/0;for(let e=0;e<o;e++){if(e===d||e===p)continue;const n=sA(g,v,_,y,t[2*e],t[2*e+1]);n<x&&(f=e,x=n)}let b=t[2*f],w=t[2*f+1];if(x===1/0){for(let e=0;e<o;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];aA(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,i=-1/0;t<o;t++){const r=this._ids[t];this._dists[r]>i&&(e[n++]=r,i=this._dists[r])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(tA(g,v,_,y,b,w)<0){const t=p,e=_,n=y;p=f,_=b,y=w,f=t,b=e,w=n}const T=function(t,e,n,i,r,o){const s=n-t,a=i-e,l=r-t,u=o-e,h=s*s+a*a,c=l*l+u*u,d=.5/(s*u-a*l);return{x:t+(u*h-a*c)*d,y:e+(s*c-l*h)*d}}(g,v,_,y,b,w);this._cx=T.x,this._cy=T.y;for(let e=0;e<o;e++)this._dists[e]=rA(t[2*e],t[2*e+1],T.x,T.y);aA(this._ids,this._dists,0,o-1),this._hullStart=d;let S=3;n[d]=e[f]=p,n[p]=e[d]=f,n[f]=e[p]=d,i[d]=0,i[p]=1,i[f]=2,r.fill(-1),r[this._hashKey(g,v)]=d,r[this._hashKey(_,y)]=p,r[this._hashKey(b,w)]=f,this.trianglesLen=0,this._addTriangle(d,p,f,-1,-1,-1);for(let o,s,a=0;a<this._ids.length;a++){const l=this._ids[a],u=t[2*l],h=t[2*l+1];if(a>0&&Math.abs(u-o)<=eA&&Math.abs(h-s)<=eA)continue;if(o=u,s=h,l===d||l===p||l===f)continue;let c=0;for(let t=0,e=this._hashKey(u,h);t<this._hashSize&&(c=r[(e+t)%this._hashSize],-1===c||c===n[c]);t++);c=e[c];let m,g=c;for(;m=n[g],tA(u,h,t[2*g],t[2*g+1],t[2*m],t[2*m+1])>=0;)if(g=m,g===c){g=-1;break}if(-1===g)continue;let v=this._addTriangle(g,l,n[g],-1,-1,i[g]);i[l]=this._legalize(v+2),i[g]=v,S++;let _=n[g];for(;m=n[_],tA(u,h,t[2*_],t[2*_+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(_,l,m,i[l],-1,i[_]),i[l]=this._legalize(v+2),n[_]=_,S--,_=m;if(g===c)for(;m=e[g],tA(u,h,t[2*m],t[2*m+1],t[2*g],t[2*g+1])<0;)v=this._addTriangle(m,l,g,-1,i[g],i[m]),this._legalize(v+2),i[m]=v,n[g]=g,S--,g=m;this._hullStart=e[l]=g,n[g]=e[_]=l,n[l]=_,r[this._hashKey(u,h)]=l,r[this._hashKey(t[2*g],t[2*g+1])]=g}this.hull=new Uint32Array(S);for(let t=0,e=this._hullStart;t<S;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const s=n[t],a=t-t%3;if(o=a+(t+2)%3,-1===s){if(0===r)break;t=nA[--r];continue}const l=s-s%3,u=a+(t+1)%3,h=l+(s+2)%3,c=e[o],d=e[t],p=e[u],f=e[h];if(oA(i[2*c],i[2*c+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1],i[2*f],i[2*f+1])){e[t]=f,e[s]=c;const i=n[h];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===h){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(s,n[o]),this._link(o,h);const a=l+(s+1)%3;r<nA.length&&(nA[r++]=a)}else{if(0===r)break;t=nA[--r]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=e,this._triangles[s+2]=n,this._link(s,i),this._link(s+1,r),this._link(s+2,o),this.trianglesLen+=3,s}}function rA(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}function oA(t,e,n,i,r,o,s,a){const l=t-s,u=e-a,h=n-s,c=i-a,d=r-s,p=o-a,f=h*h+c*c,m=d*d+p*p;return l*(c*m-f*p)-u*(h*m-f*d)+(l*l+u*u)*(h*p-c*d)<0}function sA(t,e,n,i,r,o){const s=n-t,a=i-e,l=r-t,u=o-e,h=s*s+a*a,c=l*l+u*u,d=.5/(s*u-a*l),p=(u*h-a*c)*d,f=(s*c-l*h)*d;return p*p+f*f}function aA(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],o=e[i];let s=r-1;for(;s>=n&&e[t[s]]>o;)t[s+1]=t[s--];t[s+1]=i}else{let r=n+1,o=i;lA(t,n+i>>1,r),e[t[n]]>e[t[i]]&&lA(t,n,i),e[t[r]]>e[t[i]]&&lA(t,r,i),e[t[n]]>e[t[r]]&&lA(t,n,r);const s=t[r],a=e[s];for(;;){do{r++}while(e[t[r]]<a);do{o--}while(e[t[o]]>a);if(o<r)break;lA(t,r,o)}t[n+1]=t[o],t[o]=s,i-r+1>=o-n?(aA(t,e,r,i),aA(t,e,n,o-1)):(aA(t,e,n,o-1),aA(t,e,r,i))}}function lA(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function uA(t){return t[0]}function hA(t){return t[1]}function cA(t,e,n){let i=null;const r=new ey;if(t.stopList.sort((t,e)=>t.pos-e.pos),!t.stopList.find(t=>0===t.pos)){const e=t.stopList[0];t.stopList.unshift({pos:0,color:e.color})}if(!t.stopList.find(t=>1===t.pos)){const e=t.stopList[t.stopList.length-1];t.stopList.push({pos:1,color:e.color})}const o=t=>{const e=[];for(let n=0,i=t.length;n<i-1;n++){const i=t[n],r=t[n+1],o=i.pos+.5*(r.pos-i.pos),s=FM(i.color,r.color,.5),a=2*n;e[a]=i,e[a+1]={color:s,pos:o},e[a+2]=r}return e};if(t.stopList=o(t.stopList),t.stopList=o(t.stopList),i=t.line?dA(t,e,n):t.path?function(t,e,n){var i,r,o;const s=[],a={x:0,y:0};if("circle"===(null===(i=t.path)||void 0===i?void 0:i.path)||"rect"===(null===(r=t.path)||void 0===r?void 0:r.path)||"shape"===(null===(o=t.path)||void 0===o?void 0:o.path)){const i=e/2,r=n/2,o=Math.sqrt(i*i+r*r);t.stopList.forEach(t=>{if(0===t.pos)s.push({point:{x:0,y:0},color:t.color});else{const e=o*t.pos,n=new bc;n.absellipse(0,0,e,e,0,2*Math.PI,!1,0),n.getPoints(50).forEach(e=>{s.push({point:{x:e.x,y:e.y},color:t.color})})}a.x=i,a.y=r})}return{points:s,position:a}}(t,e,n):dA(t,e,n),i){const t=[],o=[],{position:s,points:a}=i,l=iA.from(a,t=>t.point.x,t=>t.point.y);for(let e=0;e<l.triangles.length;e+=3)t.push(a[l.triangles[e]].point.x,a[l.triangles[e]].point.y),t.push(a[l.triangles[e+1]].point.x,a[l.triangles[e+1]].point.y),t.push(a[l.triangles[e+2]].point.x,a[l.triangles[e+2]].point.y),o.push(...NM(a[l.triangles[e]].color)),o.push(...NM(a[l.triangles[e+1]].color)),o.push(...NM(a[l.triangles[e+2]].color));const u=new Ky;u.addAttribute("aVertexPosition",t,2),u.addAttribute("aColor",o,4);const h=kx.from("\n precision mediump float;\n attribute vec2 aVertexPosition;\n attribute vec4 aColor;\n uniform mat3 translationMatrix;\n uniform mat3 projectionMatrix;\n varying vec4 vColor;\n void main() {\n vColor = aColor;\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n }","precision mediump float; \n varying vec4 vColor;\n void main() {\n float alpha = vColor.a;\n vec4 color = vColor;\n color.a = 1.0;\n gl_FragColor = color * alpha;\n }\n "),c=new RT;c.drawRect(0,0,e+1,n+1),r.mask=c,r.addChild(c);const d=new _S(u,h);d.position.x=s.x,d.position.y=s.y,r.addChild(d)}return r}function dA(t,e,n){const i=e/2,r=n/2,o=[{x:-i,y:r},{x:-i,y:-r},{x:i,y:r},{x:i,y:-r}],s=[oM.fromPointSlope({x:-i,y:0},Math.PI/2),oM.fromPointSlope({x:0,y:r},0),oM.fromPointSlope({x:i,y:0},Math.PI/2),oM.fromPointSlope({x:0,y:-r},0)],a=[],l=t.stopList.slice(1,t.stopList.length-1).map(o=>{var l,u,h;const c=2*Math.PI;let d=null!==(u=null===(l=t.line)||void 0===l?void 0:l.ang)&&void 0!==u?u:0;for(;d>c;)d-=c;for(;d<0;)d+=c;const p={x:0,y:0};iM(d,Math.PI/2)?(p.x=0,p.y=n/2-o.pos*n):iM(d,0)?(p.x=o.pos*e-e/2,p.y=0):(p.x=o.pos*e-e/2,p.y=n/2-o.pos*n),d>Math.PI/2&&d<=Math.PI&&(p.x*=-1),d>Math.PI&&d<=2*Math.PI&&(p.y*=-1);const f=oM.fromPointSlope(p,Math.PI/2-((null===(h=t.line)||void 0===h?void 0:h.ang)||0)),m=s.map(t=>f.crossPoint(t)).filter(t=>t&&t.x<=i&&t.x>=-i&&t.y<=r&&t.y>=-r).map(t=>({point:t,color:o.color})).sort((t,e)=>e.point.y-t.point.y);a.push(...m);let g=Math.abs(m[1].point.x-m[0].point.x)/10;for(let t=20;t--;){const e=t%2==0?1:-1,n=p.x+e*g,s=f.resolveY(n);n<=i&&n>=-i&&s<=r&&s>=-r&&a.push({point:{x:n,y:s},color:o.color}),g+=g}return f});let u=[],h=[];t:for(let e=0;e<o.length;e++){const n=o[e];for(let e=0;e<l.length-1;e++){const i=l[e],r=l[e+1],o=i.distanceToLinearEquation(r),s=i.distanceToPoint(n),u=r.distanceToPoint(n);if(s<o&&u<o){const i=t.stopList.slice(1,t.stopList.length-1)[e],r=t.stopList.slice(1,t.stopList.length-1)[e+1],l=FM(i.color,r.color,s/o);a.splice(e+1,0,{point:n,color:l});continue t}}const i=l[0],r=l[l.length-1],s=i.distanceToPoint(n),c=r.distanceToPoint(n);s<=c?u.push({point:n,dis:s}):h.push({point:n,dis:c})}u=u.sort((t,e)=>e.dis-t.dis);const c=u.map((e,n)=>{if(0===n)return{point:e.point,color:t.stopList[0].color};{const n=t.stopList[0].color,i=t.stopList[1].color;return{point:e.point,color:FM(n,i,1-(0===u[0].dis?1:e.dis/u[0].dis))}}}).sort((t,e)=>e.point.y-t.point.y);h=h.sort((t,e)=>e.dis-t.dis);const d=h.map((e,n)=>{if(0===n)return{point:e.point,color:t.stopList[t.stopList.length-1].color};{const n=t.stopList[t.stopList.length-2].color,i=t.stopList[t.stopList.length-1].color;return{point:e.point,color:FM(n,i,0===h[0].dis?0:e.dis/h[0].dis)}}}).sort((t,e)=>e.point.y-t.point.y),p=c.concat(...a).concat(d);for(let t=0;t<p.length;t++)p[t].point.x+=i,p[t].point.y=-p[t].point.y+r;return{points:p,position:{x:0,y:0}}}const pA="\nvec3 rgb2hsl(vec3 rgb) {\n float cMax = max(max(rgb.r, rgb.g), rgb.b);\n float cMin = min(min(rgb.r, rgb.g), rgb.b);\n float delta = cMax - cMin;\n \n float h = 0.0;\n if (delta == 0.0) {\n h = 0.0;\n } else if (cMax == rgb.r) {\n h = 60.0 * mod(((rgb.g - rgb.b) / delta), 6.0);\n } else if (cMax == rgb.g ) {\n h = 60.0 * ((rgb.b - rgb.r) / delta + 2.0);\n } else if (cMax == rgb.b) {\n h = 60.0 * ((rgb.r - rgb.g) / delta + 4.0);\n }\n \n float l = (cMax + cMin) / 2.0;\n \n float s = 0.0;\n if (delta == 0.0) {\n s = 0.0;\n } else {\n s = delta / (1.0 - abs(2.0 * l - 1.0));\n }\n \n return vec3(h, s, l);\n}\n",fA=[pA],mA={biLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec3 hsl = rgb2hsl(texColor.rgb);\n mat3 rgb2yuv = mat3(\n 0.2126, 0.7152, 0.0722,\n -0.09991, -0.33609, 0.43600,\n 0.615, -0.5586, -0.05639\n );\n vec3 yuv = texColor.rgb * rgb2yuv;\n if (yuv.x >= 0.49 || texColor.a < 0.9) {\n return vec4(1.0, 1.0, 1.0, 1.0) * texColor.a;\n } else {\n return vec4(0.0, 0.0, 0.0, 1.0) * texColor.a;\n }\n}\n",alphaModFix:"\nvec4 transform(vec4 texColor, float arg) {\n return texColor * arg;\n}\n"};class gA extends Hx{constructor(t,e){var n;super(void 0,(n=mA[t],`\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n${fA.map(t=>t+"\n").join("\n")}\n\n${n}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n`),{arg:e})}}const vA=[pA],_A={clrChange:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n",changeBulletColor:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n if (texColor.a == 0.0) {\n return texColor;\n } else {\n return arg2;\n }\n}\n"};class yA extends Hx{constructor(t,e,n){var i;super(void 0,(i=_A[t],`\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n${vA.map(t=>t+"\n").join("\n")}\n\n${i}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n`),{arg1:Float32Array.from(e),arg2:Float32Array.from(n)})}}const xA=[pA],bA={lum:"\nvec4 transform(vec4 texColor, float arg1, float arg2) {\n if (arg1 > 0.0) {\n texColor.r += (1.0 - texColor.r) * arg1;\n texColor.g += (1.0 - texColor.g) * arg1;\n texColor.b += (1.0 - texColor.b) * arg1;\n } else if (arg1 < 0.0) {\n texColor.r -= texColor.r * arg1;\n texColor.g -= texColor.g * arg1;\n texColor.b -= texColor.b * arg1;\n }\n // todo 对比度\n texColor.rgb *= texColor.a;\n return texColor;\n}\n"};class wA extends Hx{constructor(t,e,n){var i;super(void 0,(i=bA[t],`\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n${xA.map(t=>t+"\n").join("\n")}\n\n${i}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n`),{arg1:e,arg2:n})}}class TA{constructor(t,e,n,i,r){this.ctx=t,this.fillStyle=e,this.width=n,this.height=i,this.config=r,this.clonedObjects=[],this._displayObject=null}get displayObject(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject}set displayObject(t){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=t}get hasFill(){return!!this.fillStyle&&"noFill"!==this.fillStyle.fillType}createDisplayObject(){if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){const t=new LT;return t.texture=this.ctx.bgTexture,t}if("solidFill"===this.fillStyle.fillType||"noFill"===this.fillStyle.fillType)return null;if("gradientFill"===this.fillStyle.fillType)return cA(this.fillStyle,this.width,this.height);if("blipFill"===this.fillStyle.fillType){const{src:t,filters:e}=this.fillStyle,n=this.ctx.spriteTexture.getTexture(t),i=this.ctx.spriteTexture.getFrameData(t);if(n){const t=new LT;return t.texture=n,e.length>0&&this.config.useFilter&&(t.filters=function(t){const e=[];return t.forEach(t=>{if("biLevel"===t.type)e.push(new gA("biLevel",t.args[0]));else if("clrChange"===t.type||"changeBulletColor"===t.type){const n=NM(t.args[0]),i=NM(t.args[1]);e.push(new yA(t.type,n,i))}else"alphaModFix"===t.type?e.push(new gA(t.type,t.args[0])):"lum"===t.type&&e.push(new wA(t.type,t.args[0],t.args[1]))}),e}(e)),t.width=this.width,t.height=this.height,i.rotate&&(t.position.x=this.width/2,t.position.y=this.height/2,t.anchor.x=.5,t.anchor.y=.5,t.rotation=i.rotate/180*Math.PI),t}}else if("gifFill"===this.fillStyle.fillType){const{src:t,delays:e}=this.fillStyle,n=this.ctx.spriteTexture.getGifFrames(t).map((t,n)=>({texture:t,time:e[n]||20})),i=new VE(n,!0);i.width=this.width,i.height=this.height;const r=this.fillStyle.loop;let o=1;return i.onLoop=()=>{o+=1,r>0&&o>r&&i.gotoAndStop(i.totalFrames)},i}return null}isSolidFill(){var t;return"solidFill"===(null===(t=this.fillStyle)||void 0===t?void 0:t.fillType)}getSolidFillColor(){var t;return"solidFill"===(null===(t=this.fillStyle)||void 0===t?void 0:t.fillType)?this.fillStyle.color:"#000000"}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}destroy(){var t;null===(t=this._displayObject)||void 0===t||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(t=>{null==t||t.destroy()}),this.clonedObjects=[]}}var SA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class EA extends jM{constructor(t,e,n){var i;super(t,e,n),this.textureContainer=new ey,this.underline=null,this.cacheSprite=new LT;const{shapeId:r,paragraphIndex:o,lineIndex:s,unitIndex:a,lineHeight:l,width:u,underLine:h,fill:c,height:d,isHorz:p,lineWidth:f}=t,m="solidFill"===(null===(i=null==c?void 0:c.fill)||void 0===i?void 0:i.fillType)?c.fill.color:null;if(h){const t=p?l/16:f/16;this.underline=new VM(e,h.type,t,u,d,m,p,r,o,s,a)}this.textGraphics=this.createTextGraphics(),this.textFill=this.createTextFill(),this.strokeGraphics=this.createStrokeGraphics(),this.strokeFill=this.createStrokeFill()}createStrokeFill(){const{stroke:t,lineWidth:e,lineHeight:n}=this.json;return new TA(this.ctx,null==t?void 0:t.fill,e,n,{useFilter:!1,useSlideBackgroundFill:!1})}createStrokeGraphics(){const{stroke:t}=this.json,e=(null==t?void 0:t.key)?{fillType:"blipFill",src:t.key,filters:[]}:void 0;return new TA(this.ctx,e,(null==t?void 0:t.width)||0,(null==t?void 0:t.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}createTextFill(){const{isHorz:t,fill:e,lineWidth:n,lineHeight:i,fillLineHeight:r}=this.json;return t?new TA(this.ctx,null==e?void 0:e.fill,n,Math.max(r,i),{useFilter:!1,useSlideBackgroundFill:!1}):new TA(this.ctx,null==e?void 0:e.fill,r,i,{useFilter:!1,useSlideBackgroundFill:!1})}createTextGraphics(){var t;const{fill:e,content:n}=this.json;let i="#000000";"solidFill"===(null===(t=null==e?void 0:e.fill)||void 0===t?void 0:t.fillType)&&(i=e.fill.color);const r=(null==e?void 0:e.key)?{fillType:"blipFill",src:e.key,filters:[{type:"changeBulletColor",args:["#000000",i]}]}:void 0;return new TA(this.ctx,r,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0,{useFilter:"◾"===n,useSlideBackgroundFill:!1})}getIterateEntry(){return null}getBgElement(){return null}updateTransform(t){var e,n,i,r;const{isHorz:o}=this.json;t.position={x:o&&null!==(n=null===(e=t.position)||void 0===e?void 0:e.x)&&void 0!==n?n:0,y:o?0:null!==(r=null===(i=t.position)||void 0===i?void 0:i.y)&&void 0!==r?r:0},t.width=o?this.json.width:this.json.lineWidth,t.height=o?this.json.lineHeight:this.json.height,super.updateTransform(t)}preRender(){var t;null===(t=this.underline)||void 0===t||t.preRender()}render(t){t.addSubMTask(()=>SA(this,void 0,void 0,(function*(){this.doRender()})))}doRender(){let t=!1;const{lineWidth:e,lineHeight:n,baseLine:i,isHorz:r,underline:o,height:s,width:a,highlightColor:l,x:u,y:h,content:c,fillLineHeight:d,fill:p}=this.json;let f=!1!==this.json.needFill;if(p&&p.fill&&"solidFill"!==p.fill.fillType&&(f=!0),l){const t=new RT,[i,o]=LM(l);t.beginFill(i,o),t.drawRect(0,0,r?a:e,r?n:s),t.endFill(),this.textureContainer.addChild(t)}if(this.textGraphics.displayObject){const e=this.textGraphics.displayObject;if(e.scale.x=.5,e.scale.y=.5,r&&(e.position.y=h>0?h:0),f){const n=this.textFill.displayObject;if(n)n.mask=e,n.addChild(e),n.position.x=-u,e.position.x+=u,t=!0,this.textureContainer.addChild(n);else if(this.textFill.isSolidFill()){const n=new BM;n.color=this.textFill.getSolidFillColor(),e.filters=[n],t=!0,this.textureContainer.addChild(e)}}else this.textureContainer.addChild(e)}if(this.strokeGraphics.displayObject){const e=this.strokeGraphics.displayObject;if(e.scale.x=.5,e.scale.y=.5,f){const n=this.strokeFill.displayObject;if(n)n.mask=e,n.addChild(e),r?n.position.y=h>0?h:0:n.position.x=u,this.textureContainer.addChild(n);else if(this.strokeFill.isSolidFill()){r?e.position.y=h>0?h:0:e.position.x=u;const n=new BM;n.color=this.strokeFill.getSolidFillColor(),e.filters=[n],t=!0,this.textureContainer.addChild(e)}}else r?e.position.y=h>0?h:0:e.position.x=u,this.textureContainer.addChild(e)}if(this.underline&&(this.underline.render(),this.underline.sprite)){r?(this.underline.sprite.position.y=o?o-n/16:i,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);const t=this.textFill.getClonedDisplayObject();t?(t.mask=this.underline.sprite,t.addChild(this.underline.sprite),this.textureContainer.addChild(t)):this.textureContainer.addChild(this.underline.sprite)}if(t){const t=zy.create({width:r?a:e,height:r?Math.max(d,n):s,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:t}),this.cacheSprite.texture=t,r&&h<0&&(this.cacheSprite.position.y=h),this.container.addChild(this.cacheSprite)}else this.container.addChild(this.textureContainer);this.container.name=c}destroy(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}var MA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class AA extends jM{constructor(){super(...arguments),this.units=[],this.isHorz=!0}getIterateElements(){return this.units}getIterateEntry(t,e,n){return this.units[e]?this.units[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){}createUnits(t,e,n,i){for(let r=0,o=this.json.textUnits.length;r<o;r++)i.addSubMTask(()=>MA(this,void 0,void 0,(function*(){const i=this.json.textUnits[r],{height:o,width:s,fillHeight:a,baseline:l,y:u,underline:h}=this.json,c=new EA(Object.assign(Object.assign({},i),{lineHeight:o,lineWidth:s,baseLine:l-u,underline:h,fillLineHeight:a||o,isHorz:this.isHorz,shapeId:t,paragraphIndex:e,lineIndex:n,unitIndex:r}),this.ctx,this.global);c.preRender(),this.units.push(c)})))}render(t){for(const e of this.units.reverse())e.render(t),t.addSubMTask(()=>MA(this,void 0,void 0,(function*(){this.container.addChild(e.container)})))}destroy(){this.units.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var RA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class CA extends jM{constructor(){super(...arguments),this.iterateElements=[],this.lines=[],this.isHorz=!0}getIterateElements(){if(this.iterateElements.length>0)return this.iterateElements;const t=this.lines.reduce((t,e)=>t=t.concat(e.getIterateElements()),[]);return this.iterateElements=t,t}getIterateEntry(t,e,n){const i=this.getIterateElements();return i[e]?i[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){}createLines(t,e,n){for(let i=0,r=this.json.lines.length;i<r;i++)n.addSubMTask(()=>RA(this,void 0,void 0,(function*(){const r=this.json.lines[i],o=new AA(r,this.ctx,this.global);o.isHorz=this.isHorz,o.container.name="line-"+i,o.createUnits(t,e,i,n),this.lines.push(o)})))}render(t){for(const e of this.lines)e.render(t),t.addSubMTask(()=>RA(this,void 0,void 0,(function*(){this.container.addChild(e.container)})))}destroy(){this.lines.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var PA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class IA{constructor(t,e,n,i){this.iterateElements=[],this.paragraphs=[],this.container=new ey,this.json=t,this.ctx=e,this.parentGlobalPos=i,this.iterateType=n,this.container.name="textBody",this.global={x:this.parentGlobalPos.x+t.position.x,y:this.parentGlobalPos.y+t.position.y},this.container.position.x=t.position.x,this.container.position.y=t.position.y,this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y;const r=new RT;r.drawRect(0,0,t.width,t.height),this.container.addChild(r)}get width(){return this.json.width}get height(){return this.json.height}get x(){return this.json.position.x}get y(){return this.json.position.y}getTextElement(t,e){return"paragraph"===t?this.paragraphs[e[0]]:null}getIterateEntry(t,e){return this.iterateElements[t]?this.iterateElements[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",e),null)}destroy(){this.paragraphs.forEach(t=>{t.destroy()})}createParagraphs(t,e){for(let n=0,i=this.json.paragraphs.length;n<i;n++)e.addSubMTask(()=>PA(this,void 0,void 0,(function*(){var i;const r=this.json.paragraphs[n],o=new CA(r,this.ctx,this.global);o.isHorz=null===(i=this.json.isHorz)||void 0===i||i,o.createLines(t,n,e),e.addSubMTask(()=>PA(this,void 0,void 0,(function*(){this.iterateElements=this.iterateElements.concat(o.getIterateElements()),o.container.name="段落-"+n,this.paragraphs.push(o)})))})))}render(t){for(const e of this.paragraphs)e.render(t),t.addSubMTask(()=>PA(this,void 0,void 0,(function*(){this.container.addChild(e.container)})));t.addSubMTask(()=>PA(this,void 0,void 0,(function*(){const{width:t}=this.container;this.container.scale.x<0&&(this.container.x+=-1*t)})))}}var OA=n(48),LA=n.n(OA),NA=n(49),DA=n.n(NA);const FA={Reflection:class extends Hx{constructor(t){super(LA.a,DA.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uStartAlpha:t.startAlpha,uEndAlpha:t.endAlpha,uBlur:0}),this.json=t}}};class BA{constructor(t){this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}setPivot(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"arrow":case"stealth":case"triangle":default:this.pivot={x:this.width,y:this.height/2}}}generatePaths(){this.hash="arrow-"+mM()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}getUnitPath(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}setScaleFromLineWidth(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}setScaleFromSize(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class UA{constructor(t,e,n,i,r,o,s,a,l,u,h){this.id=t,this.ctx=e,this.paths=n,this.hash=i,this.nept=r,this.width=o,this.height=s,this.lineStyle=a,this.shouldFill=l,this.bgColor=u,this.lnColor=h,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(n),this.isRectangle&&l?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}get displayObject(){return this._displayObject}pointDis(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)}rectangleDetect(t){if(1!==t.length)return!1;const e=t[0].path.trim().split(" ");if(10!==e.length)return!1;const n=[],i=[];for(let t=0;t<e.length;t+=2){const r=e[t],o=e[t+1],[s,a]=o.split(",").map(t=>Number(t)/100);n.push(r),i.push({x:s,y:a})}if("MLLLC"!==n.join(""))return!1;for(let t=0;t<3;t++){const e=i[t],n=i[t+1];if(e.x!==n.x&&e.y!==n.y)return!1}const r=i.slice(0,4).reduce((t,e)=>t+e.x,0)/4,o=i.slice(0,4).reduce((t,e)=>t+e.y,0)/4;if(Number.isNaN(r)||Number.isNaN(o))return!1;const s={x:r,y:o};return iM(this.pointDis(s,i[0]),this.pointDis(s,i[1]))&&iM(this.pointDis(s,i[0]),this.pointDis(s,i[2]))&&iM(this.pointDis(s,i[0]),this.pointDis(s,i[3]))&&this.pointDis(s,i[0])===this.pointDis(s,i[1])}createDisplayObject(){if(this.isPureRect){const t=new RT;return t.beginFill(0,1),t.drawRect(0,0,this.width,this.height),t}if(this.isColoredPureRect&&this.bgColor){const t=new RT,[e,n]=LM(this.bgColor);return t.beginFill(e,n),t.drawRect(0,0,this.width,this.height),t}{const t=new LT,e=this.ctx.graphicsTexture.getGraphicsData(this.id);return e?(t.texture=e.texture,t.pivot.x=e.pivot.x,t.pivot.y=e.pivot.y,t):null}}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}render(){this._displayObject=this.createDisplayObject()}isNeedMask(t,e){let n=!1;return this._displayObject&&(n=!(this.isRectangle&&Math.abs(t-this._displayObject.width)<2&&Math.abs(e-this._displayObject.height)<2&&this.shouldFill)),n}destroy(){var t;null===(t=this._displayObject)||void 0===t||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(t=>{null==t||t.destroy()}),this.clonedObjects=[]}}var kA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};const GA={pivot:{x:0,y:0},width:0,height:0};class HA extends PM{constructor(t,e,n,i){var r;super(t,e,n),this.renderContainer=new ey,this.needCacheAsBitMap=!1,this.backgroundGraphics=null,this.filterAreaJustifies=[],this.strokeGraphics=null,this.arrowList=[],this.fillColorFilter=new BM,this.strokeColorFilter=new BM,this.id="",this.fill=new AM(this),this.stroke=new EM(this),this.updateFilterArea=()=>{const t=this.renderContainer.getBounds(!1),e=this.filterAreaJustifies.map(e=>e(t)),n=e.map(t=>t.width),i=e.map(t=>t.height),r=new p_(t.x,t.y,Math.max(...n),Math.max(...i));this.renderContainer.filterArea=r,(this.renderContainer.filters||[]).forEach(t=>{t.uniforms.uShapeFilterArea=new Float32Array(4),t.uniforms.uShapeFilterArea[0]=r.x,t.uniforms.uShapeFilterArea[1]=r.y,t.uniforms.uShapeFilterArea[2]=r.width,t.uniforms.uShapeFilterArea[3]=r.height})},this.json=t,this.json.fillStyle&&"groupFill"===this.json.fillStyle.fillType&&i&&(this.json.fillStyle=i),this.id=t.id;const{fillStyle:o,lineStyle:s}=this.json;this.container.name=t.id,this.renderContainer.name=t.id+"-render-container",this.generateArrowList(),this.backgroundFill=this.createBackgroundFill(),this.backgroundGraphics=this.createBackgroundGraphics(),this.strokeFill=this.createStrokeFill(),this.strokeGraphics=this.createStrokeGraphics(),this.ctx.timingTargets.addTarget(this.id,this),"solidFill"===(null==o?void 0:o.fillType)&&(this.fillColorFilter.currentColor=o.color,this.fillColorFilter.designColor=o.color),"solidFill"===(null===(r=null==s?void 0:s.fill)||void 0===r?void 0:r.fillType)&&(this.strokeColorFilter.currentColor=s.fill.color,this.strokeColorFilter.designColor=s.fill.color),this.updateTransform(this.json),t.textBody&&(this.text=new IA(t.textBody,this.ctx,t.textBody.iterateType,{x:this.designGlobalPosition.x,y:this.designGlobalPosition.y})),this.container.hitArea=new v_(1,1,this.json.width,this.json.height)}get interactiveContainer(){return this.renderContainer}get strokeActive(){var t,e,n,i,r,o,s;return this.strokeFill.displayObject?(null!==(n=null===(e=null===(t=this.strokeFill.displayObject)||void 0===t?void 0:t.filters)||void 0===e?void 0:e.length)&&void 0!==n?n:-1)>0:(null!==(s=null===(o=null===(r=null===(i=this.strokeGraphics)||void 0===i?void 0:i.displayObject)||void 0===r?void 0:r.filters)||void 0===o?void 0:o.length)&&void 0!==s?s:-1)>0}set strokeActive(t){var e,n,i,r,o,s;const{displayObject:a}=this.strokeFill;t?a&&(null!==(n=null===(e=a.filters)||void 0===e?void 0:e.indexOf(this.strokeColorFilter))&&void 0!==n?n:-1)<0?a.filters=[this.strokeColorFilter]:(null===(i=this.strokeGraphics)||void 0===i?void 0:i.displayObject)&&(null!==(o=null===(r=this.strokeGraphics.displayObject.filters)||void 0===r?void 0:r.indexOf(this.strokeColorFilter))&&void 0!==o?o:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):a?a.filters=[]:(null===(s=this.strokeGraphics)||void 0===s?void 0:s.displayObject)&&(this.strokeGraphics.displayObject.filters=[])}get fillActive(){var t,e,n,i,r,o,s;return this.backgroundFill.displayObject?(null!==(n=null===(e=null===(t=this.backgroundFill.displayObject)||void 0===t?void 0:t.filters)||void 0===e?void 0:e.length)&&void 0!==n?n:-1)>0:(null!==(s=null===(o=null===(r=null===(i=this.backgroundGraphics)||void 0===i?void 0:i.displayObject)||void 0===r?void 0:r.filters)||void 0===o?void 0:o.length)&&void 0!==s?s:-1)>0}set fillActive(t){var e,n,i,r,o,s;t?this.backgroundFill.displayObject&&(null!==(n=null===(e=this.backgroundFill.displayObject.filters)||void 0===e?void 0:e.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:(null===(i=this.backgroundGraphics)||void 0===i?void 0:i.displayObject)&&(null!==(o=null===(r=this.backgroundGraphics.displayObject.filters)||void 0===r?void 0:r.indexOf(this.fillColorFilter))&&void 0!==o?o:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.displayObject)&&(this.backgroundGraphics.displayObject.filters=[])}getTextElement(t,e){var n,i;return null!==(i=null===(n=this.text)||void 0===n?void 0:n.getTextElement(t,e))&&void 0!==i?i:null}getBgElement(){return this}getIterateEntry(t,e,n){return 0===e?this:"el"===t?(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null):this.text?this.text.getIterateEntry(e-1,n)||null:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}createStrokeGraphics(){var t,e,n,i;const{id:r,geometry:o,lineStyle:s}=this.json,{width:a,height:l,pivot:u}=(null==o?void 0:o.lineTransform)||GA,h=a||this.json.width,c=l||this.json.height,d="solidFill"===(null===(t=null==s?void 0:s.fill)||void 0===t?void 0:t.fillType)?s.fill.color:null;return s&&"noFill"!==(null===(e=s.fill)||void 0===e?void 0:e.fillType)?new UA(r+"-path-graphics",this.ctx,null!==(n=null==o?void 0:o.paths)&&void 0!==n?n:[],null!==(i=null==o?void 0:o.hash)&&void 0!==i?i:"",u||{x:0,y:0},h,c,s,!1,null,d):null}createStrokeFill(){const[t,e]=this.calculateFillObjectOffset(),{geometry:n,lineStyle:i,width:r,height:o}=this.json,s=(null==n?void 0:n.lineTransform)||GA,a=Object(u.isNumber)(null==i?void 0:i.width)?i.width:1;return new TA(this.ctx,null==i?void 0:i.fill,(s.width||r)+a+t,Math.max((s.height||o)+a,e),{useFilter:!1,useSlideBackgroundFill:!1})}createBackgroundGraphics(){var t;const{geometry:e,lineStyle:n,fillStyle:i,id:r}=this.json,{width:o,height:s,pivot:a}=(null==e?void 0:e.lineTransform)||GA,l=o||this.json.width,u=s||this.json.height,h="solidFill"===(null==i?void 0:i.fillType)?i.color:null;return i&&"noFill"!==i.fillType||this.json.isPicture?new UA(r+"-bg-graphics",this.ctx,null!==(t=null==e?void 0:e.paths)&&void 0!==t?t:[],(null==e?void 0:e.hash)||"",a||{x:0,y:0},l,u,n,!0,h,null):null}createBackgroundFill(){var t,e;const{fillStyle:n,width:i,height:r,lineStyle:o,geometry:s}=this.json,a=(null==s?void 0:s.fillTransform)||GA;return new TA(this.ctx,n,(a.width||i)+(null!==(t=null==o?void 0:o.width)&&void 0!==t?t:0),(a.height||r)+(null!==(e=null==o?void 0:o.width)&&void 0!==e?e:0),{useFilter:!1,useSlideBackgroundFill:this.json.useBgFill})}createBackground(){var t,e,n,i,r,o,s,a;const{pivot:l,width:u,height:h}=(null===(t=this.json.geometry)||void 0===t?void 0:t.fillTransform)||GA,{displayObject:c}=this.backgroundFill;c?(this.json.useBgFill&&(null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)?(this.needCacheAsBitMap=!0,c.mask=this.backgroundGraphics.displayObject,c.pivot.x=(null===(i=this.json.position)||void 0===i?void 0:i.x)||0,c.pivot.y=(null===(r=this.json.position)||void 0===r?void 0:r.y)||0,this.container.addChild(this.backgroundGraphics.displayObject)):"gifFill"===(null===(o=this.json.fillStyle)||void 0===o?void 0:o.fillType)?(c.height=h||this.designHeight,c.width=u||this.designWidth,c instanceof VE&&c.play(),(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.isNeedMask(c.width,c.height))&&(c.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.container.addChild(this.backgroundGraphics.displayObject))):(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.isNeedMask(c.width,c.height))&&(this.needCacheAsBitMap=!0,c.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.container.addChild(this.backgroundGraphics.displayObject)),c.x=l.x,c.y=l.y,this.container.addChild(c)):this.backgroundFill.hasFill&&(null===(e=this.backgroundGraphics)||void 0===e?void 0:e.displayObject)&&this.container.addChild(this.backgroundGraphics.displayObject)}createPathFill(){var t,e,n;const{displayObject:i}=this.strokeFill,r=null===(t=this.strokeGraphics)||void 0===t?void 0:t.displayObject,[o,s]=this.calculateFillObjectOffset();i?((null===(e=this.strokeGraphics)||void 0===e?void 0:e.isNeedMask(i.width,i.height))&&r&&(this.needCacheAsBitMap=!0,i.pivot.x=r.pivot.x,i.pivot.y=r.pivot.y,r.pivot.x=0,r.pivot.y=0,i.mask=r,i.addChild(r),i.position.x=-o/2,i.position.y=-s/2,r.position.x=o/2,r.position.y=s/2),this.container.addChild(i)):this.strokeFill.hasFill&&(null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)&&this.container.addChild(this.strokeGraphics.displayObject)}createFilledPathMask(){var t,e,n;const i=(null===(e=null===(t=this.json.geometry)||void 0===t?void 0:t.paths)||void 0===e?void 0:e.filter(t=>"none"!==t.fill&&"norm"!==t.fill))||[];for(const t of i){const e=this.ctx.graphicsTexture.getGraphicsData(t.id);if(e){const i=new LT(e.texture);i.pivot.x=e.pivot.x,i.pivot.y=e.pivot.y;const r=this.backgroundFill.getClonedDisplayObject(),o=null===(n=this.backgroundGraphics)||void 0===n?void 0:n.getClonedDisplayObject(),s=r||o;s&&(this.backgroundFill.displayObject&&(s.pivot.x=this.backgroundFill.displayObject.pivot.x,s.pivot.y=this.backgroundFill.displayObject.pivot.y),s.mask=i,s.filters=[zM[t.fill]],this.needCacheAsBitMap=!0,this.container.addChild(s),this.container.addChild(i))}}}createArrow(){if(!this.arrowList.length)return;const t=new ey,e=this.strokeFill.getClonedDisplayObject(),[n,i]=this.calculateFillObjectOffset();this.arrowList.forEach(e=>{const n=this.ctx.graphicsTexture.getGraphicsData(e.graphicsId);if(n){const{texture:i}=n,r=new LT(i);r.pivot.x=e.pivot.x,r.pivot.y=e.pivot.y,r.position.x=e.position.x+e.pivot.x,r.position.y=e.position.y+e.pivot.y,r.rotation=e.rotate/180*Math.PI,t.addChild(r)}}),this.arrowRenderTexture=zy.create({width:t.width,height:t.height,resolution:1}),this.ctx.renderer.render(t,{renderTexture:this.arrowRenderTexture});const r=new LT;r.texture=this.arrowRenderTexture,e&&(e.mask=r,e.position.x=-n/2,e.position.y=-i/2,r.position.x=-n/2,r.position.y=-i/2,this.container.addChild(e),this.container.addChild(r))}generateArrowList(){var t,e;const{lineArrowList:n,lineStyle:i,id:r}=this.json,o="solidFill"===(null===(t=null==i?void 0:i.fill)||void 0===t?void 0:t.fillType)?i.fill.color:null;null===(e=n||[])||void 0===e||e.forEach((t,e)=>{var n,s;const a=new BA(Object.assign(Object.assign({},t),{fillStyle:null==i?void 0:i.fill,lineWidth:null!==(n=null==i?void 0:i.width)&&void 0!==n?n:0}));a.graphicsId=`${r}-arrow-${e}-graphics`,a.textureId=`${r}-arrow-${e}-fill`,this.ctx.graphicsTexture.addGraphics(a.graphicsId,null!==(s=a.paths)&&void 0!==s?s:[],a.hash,{x:0,y:0},a.width,a.height,void 0,this.ctx.objectPoolGroup,!0,o,null),this.arrowList.push(a)})}calculateFillObjectOffset(){let[t,e]=[0,0];return this.arrowList.length&&(t=this.arrowList.reduce((t,e)=>Math.max(t,e.width),0),e=this.arrowList.reduce((t,e)=>Math.max(t,e.height),0)),[t,e]}preRender(t){var e,n,i;const{lineStyle:r,geometry:o}=this.json,{width:s,height:a}=(null==o?void 0:o.lineTransform)||GA,l=s||this.json.width,u=a||this.json.height,h=(null===(e=null==o?void 0:o.paths)||void 0===e?void 0:e.filter(t=>"none"!==t.fill&&"norm"!==t.fill))||[],c="solidFill"===(null===(n=null==r?void 0:r.fill)||void 0===n?void 0:n.fillType)?r.fill.color:null;t.addSubMTask(()=>kA(this,void 0,void 0,(function*(){for(const t of h)this.ctx.graphicsTexture.addGraphics(t.id,[t],t.hash,((null==o?void 0:o.lineTransform)||GA).pivot,l,u,r,this.ctx.objectPoolGroup,!0,null,c)}))),null===(i=this.text)||void 0===i||i.createParagraphs(this.json.id,t)}subClassRender(){}setupEffect(){const{effectList:t}=this.json;if(t&&t.length>0){const e=[];return t.forEach(t=>{"reflection"===t.type&&(this.filterAreaJustifies.push(t=>(t.height*=2,t)),e.push(new FA.Reflection(t)))}),this.ctx.ticker.add(this.updateFilterArea,void 0,-20),this.renderContainer.filters=e,!0}return!1}render(t){t.addSubMTask(()=>kA(this,void 0,void 0,(function*(){var t,e;null===(t=this.strokeGraphics)||void 0===t||t.render(),null===(e=this.backgroundGraphics)||void 0===e||e.render(),this.createBackground(),this.subClassRender(),this.createFilledPathMask(),this.createPathFill(),this.createArrow()}))),this.text&&this.text.render(t),t.addSubMTask(()=>kA(this,void 0,void 0,(function*(){var t,e,n,i,r,o;if("wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(e=this.json.textBody)||void 0===e?void 0:e.iterateType))this.renderContainer.addChild(this.container),this.text&&(this.text.container.position.x=(null!==(i=null===(n=this.json.position)||void 0===n?void 0:n.x)&&void 0!==i?i:0)+this.text.x,this.text.container.position.y=(null!==(o=null===(r=this.json.position)||void 0===r?void 0:r.y)&&void 0!==o?o:0)+this.text.y,this.renderContainer.addChild(this.text.container));else{if(this.text){if(Object(u.isBoolean)(this.json.textRotateWithShape)&&!this.json.textRotateWithShape){const t=this.json.rotation||0;this.text.container.rotation=-t;const{width:e}=this.text;this.text.container.position.x=e}this.container.addChild(this.text.container)}this.renderContainer.addChild(this.container)}if(this.needCacheAsBitMap,"background"===this.json.id&&this.ctx.hasBackgroundFillShape){const t=zy.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)});this.ctx.renderer.render(this.renderContainer,{renderTexture:t}),this.ctx.bgTexture=t}})))}clearOnSlideChange(){}initOnReuse(){}destroy(){var t,e,n,i;null===(t=this.text)||void 0===t||t.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),null===(e=this.backgroundGraphics)||void 0===e||e.destroy(),this.strokeFill.destroy(),null===(n=this.strokeGraphics)||void 0===n||n.destroy(),this.renderContainer.destroy(),null===(i=this.arrowRenderTexture)||void 0===i||i.destroy(!0),this.arrowList=[]}}var zA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};function jA(t,e){for(const n in e)t.style[n]=e[n]}class VA{constructor(t){var e,n;this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.medianIsEnd=!1,this.playCallBackList=[],this.duration=0,this.start=0,this.end=0,this.changeMediaProgress=t=>{t.stopPropagation();const e=t.offsetX/this.progress.clientWidth*this.duration;this.jumpToTime(e),this.medianIsEnd=!1,this.ctx.eventHub.emit(KR.mediaSeek,{id:this.targetId,time:this.media.currentTime-this.start,isPlaying:this.media.isPlaying})},this.jumpToTime=(t=0)=>{const e=Math.floor(t)+this.start;this.media.currentTime!==e&&(this.media.currentTime=e)},this.showController=t=>{t.stopPropagation(),this.show()},this.getMediaDuration=()=>{this.duration&&!Number.isNaN(this.duration)||(this.duration=this.media.duration,this.start&&(this.duration-=this.start,this.jumpToTime()),this.end&&(this.duration-=this.end)),this.totalTime.innerText=VA.formatTime(this.duration)},this.playMedia=()=>zA(this,void 0,void 0,(function*(){this.playButton.style.display="none",this.pauseButton.style.display="block",yield this.media.play(),this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach(t=>{t()})})),this.pauseMedia=()=>zA(this,void 0,void 0,(function*(){this.playButton.style.display="block",this.pauseButton.style.display="none",yield this.media.pause()})),this.onMouseOut=t=>{t.stopPropagation(),this.mediaController.style.display="none"},this.mediaTimeUpdate=()=>zA(this,void 0,void 0,(function*(){const t=this.media.currentTime-this.start;this.duration>0&&(t>this.duration||this.media.ended)&&(yield this.pauseMedia(),this.medianIsEnd=!0),this.currentTime.innerText=VA.formatTime(t),this.currentProgress.style.flex=(t/this.duration).toString()})),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(t=>{t()})},this.playMediaFromCtrl=()=>{this.ctx.eventHub.emit(KR.mediaPlay,{id:this.targetId,time:this.media.currentTime}),this.playMedia()},this.pauseMediaFromCtrl=()=>{this.ctx.eventHub.emit(KR.mediaPause,{id:this.targetId,time:this.media.currentTime}),this.pauseMedia()},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.target=t.target,this.media=t.media,this.info=t.info,this.canvasElement=t.canvasElement,this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=null!==(e=this.info.cut.start)&&void 0!==e?e:0,this.end=null!==(n=this.info.cut.end)&&void 0!==n?n:0)}getMedianContainer(){var t;let e=null===(t=this.canvasElement.parentElement)||void 0===t?void 0:t.querySelector(".median-container");e||(e=document.createElement("div"),e.className="median-container",this.canvasElement.parentElement.appendChild(e)),this.container=e}static formatTime(t){let e="00:00";if(t){const n=Math.floor(t/60),i=String(n<0?0:n).padStart(2,"0"),r=Math.floor(t%60);e=`${i}:${String(r<0?0:r).padStart(2,"0")}`}return e}createButton(){const t={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px"};jA(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=document.createElement("img");jA(e,{height:"20px"}),e.src="https://convertcdn.netless.link/publicFiles/icon/play.png",this.playButton.appendChild(e),jA(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const n=document.createElement("img");jA(n,{height:"20px"}),n.src="https://convertcdn.netless.link/publicFiles/icon/pause.png",this.pauseButton.appendChild(n)}createTimer(){const t=document.createElement("div");jA(t,{width:"100px"}),this.currentTime.innerText="00:00";const e=document.createElement("span");return e.innerText="/",t.append(this.currentTime,e,this.totalTime),t}createProgress(){jA(this.progress,{flex:"1",position:"relative",marginRight:"10px"});const t=document.createElement("div");jA(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),jA(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}bindEvent(){this.mediaController.addEventListener("mouseover",this.showController,!1),this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.progress.addEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this.playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this.pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1)}setControllerPosition(){var t;const{target:e}=this,{stageWidth:n,stageHeight:i}=this.ctx,r=e.getGlobalPosition(),o=Number(null===(t=this.container)||void 0===t?void 0:t.getAttribute("data-scale")),s=n*o,a=1/o*(300>s?s/300:1);r.y=r.y+this.height-50,r.x=Math.max(r.x,0),r.x=Math.min(r.x,n-300*a),r.y=Math.max(r.y,0),r.y=Math.min(r.y,i-50),jA(this.mediaController,{height:"50px",borderRadius:"25px",width:"300px",flexDirection:"row",alignItems:"center",position:"absolute",left:r.x+"px",top:r.y+"px",display:"none",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:`scale(${a})`,transformOrigin:"0 100%"})}createMediaController(){this.setControllerPosition(),this.createButton();const t=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,t,this.progress),this.container.appendChild(this.mediaController),this.bindEvent()}addPlayCallBack(t){this.playCallBackList.push(t)}unbindEvent(){this.mediaController.removeEventListener("mouseover",this.showController,!1),this.progress.removeEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",()=>this.playMedia(),!1),this.pauseButton.removeEventListener("click",()=>this.pauseMedia(),!1),this.media.removeListener("durationchange",this.getMediaDuration,!1),this.media.removeListener("timeupdate",this.mediaTimeUpdate,!1),this.media.removeListener("pause",this.onPauseMedia,!1),this.media.removeListener("play",this.onPlayMedia,!1)}show(){this.setControllerPosition(),this.mediaController.style.display="flex"}hide(){this.mediaController.style.display="none"}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],null===(t=this.container)||void 0===t||t.removeChild(this.mediaController)}}var WA=n(50);class XA extends a.a{constructor(t){super(),this.lastTime=-1,this.howl=null,this.rctClient=null,$R.RtcAudioClazz?(this.rctClient=new $R.RtcAudioClazz(t),this.rctClient.on("load",()=>this.emit("load")),this.rctClient.on("pause",()=>this.emit("pause")),this.rctClient.on("play",()=>this.emit("play"))):(this.howl=new WA.Howl({src:[t]}),this.howl.on("load",()=>this.emit("load")),this.howl.on("pause",()=>this.emit("pause")),this.howl.on("play",()=>this.emit("play")))}startTimeChangeEmit(){this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate")),this.isEnded||requestAnimationFrame(()=>this.startTimeChangeEmit())}play(){var t,e;this.lastTime=-1,null===(t=this.howl)||void 0===t||t.play(),null===(e=this.rctClient)||void 0===e||e.play(),this.startTimeChangeEmit()}pause(){var t,e;null===(t=this.howl)||void 0===t||t.pause(),null===(e=this.rctClient)||void 0===e||e.pause()}stop(){var t;null===(t=this.howl)||void 0===t||t.stop(),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0)}destroy(){var t,e,n,i,r,o,s;null===(t=this.howl)||void 0===t||t.pause(),null===(e=this.howl)||void 0===e||e.unload(),null===(n=this.rctClient)||void 0===n||n.pause(),null===(i=this.rctClient)||void 0===i||i.destroy(),null===(r=this.rctClient)||void 0===r||r.removeAllListeners("load"),null===(o=this.rctClient)||void 0===o||o.removeAllListeners("play"),null===(s=this.rctClient)||void 0===s||s.removeAllListeners("pause")}get currentTime(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek():-1}set currentTime(t){this.rctClient?this.rctClient.currentTime=t:this.howl&&this.howl.seek(t)}get duration(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration():0}get isEnded(){return Math.abs(this.currentTime-this.duration)<.001}get isPaused(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&this.howl.playing()}}var qA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class YA extends a.a{constructor(t){var e,n;super(),this.type="video",this.sprite=new LT,this.isPlaying=!1,this.id=t.id,this.video=t.video,this.start=null===(e=t.video.cut)||void 0===e?void 0:e.start,this.end=null===(n=t.video.cut)||void 0===n?void 0:n.end,this.container=t.container,this.ctx=t.ctx,this.ctx.medias[this.id]=this,this.videoResource=new Oy(this.video.src,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0});const i=this.video.src.replace(/4$/,"3");this.rtcAudio=new XA(i);const{video:r,width:o,height:s,target:a}=t;this.controller=new VA({targetId:t.id,ctx:t.ctx,width:o,height:s,target:a,media:this,info:r,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=o,this.sprite.height=s,this.ctx.clock.setTimeout(()=>{this.sprite.visible=!0},50)});const l=new Sy(null,{height:s,width:o});l.resource=this.videoResource,this.videoResource.bind(l),this.sprite=new LT,this.sprite.visible=!1,this.sprite.texture=new Gy(l),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",t=>{t.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",t=>{t.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(t=>{this.videoResource.source.addEventListener(t,()=>{"timeupdate"!==t||this.isPlaying||this.pause(),this.emit(t)})})}get currentTime(){var t,e;return null!==(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.currentTime)&&void 0!==e?e:0}set currentTime(t){this.videoResource.source&&(this.videoResource.source.currentTime=t)}get paused(){var t,e;return null===(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.paused)||void 0===e||e}get ended(){var t,e;return null===(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.ended)||void 0===e||e}get duration(){var t,e;return null!==(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.duration)&&void 0!==e?e:0}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){var t;return qA(this,void 0,void 0,(function*(){this.isPlaying=!0,yield this.load(),yield this.ctx.clock.waitUntil(()=>{const t=this.videoResource.source;return!!(t&&t.videoWidth>0)},3e3);const e=this.videoResource.source;e&&e.videoWidth<=0||($R.RtcAudioClazz&&(this.rtcAudio.play(),this.videoResource.source.volume=0),yield null===(t=this.videoResource.source)||void 0===t?void 0:t.play())}))}load(){return this.videoResource.load()}pause(){var t;this.isPlaying=!1,$R.RtcAudioClazz&&this.rtcAudio.pause(),null===(t=this.videoResource.source)||void 0===t||t.pause()}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause()}destroy(){var t;this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(t=this.videoResource)||void 0===t||t.destroy(),this.rtcAudio.destroy(),this.controller.destroy()}}var ZA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class JA extends a.a{constructor(t){super(),this.type="audio",this.isPlaying=!1,this.id=t.id,this.audio=t.audio,this.audioPlayer=new XA(this.audio.src),t.audio.cut&&(this.start=t.audio.cut.start,this.end=t.audio.cut.end),this.ctx=t.ctx,this.ctx.medias[this.id]=this;const{width:e,height:n,target:i}=t;this.controller=new VA({targetId:t.id,ctx:t.ctx,height:n,width:e,target:i,media:this,info:this.audio,canvasElement:t.canvasElement}),this.audioPlayer.on("load",()=>this.emit("durationchange")),this.audioPlayer.on("timeupdate",()=>this.emit("timeupdate")),this.audioPlayer.on("pause",()=>this.emit("pause")),this.audioPlayer.on("play",()=>this.emit("play"))}get currentTime(){return this.audioPlayer.currentTime}set currentTime(t){this.audioPlayer.currentTime=t}get paused(){return this.audioPlayer.isPaused}get ended(){return this.audioPlayer.isEnded}get duration(){return this.audioPlayer.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return ZA(this,void 0,void 0,(function*(){this.isPlaying=!0,this.audioPlayer.play()}))}pause(){this.isPlaying=!1,this.audioPlayer.pause()}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause()}destroy(){this.audioPlayer.pause(),this.controller.destroy()}}class KA extends HA{constructor(t,e,n,i){super(Object.assign(Object.assign({},t),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),e,n,i),this.isInteractiveOutside=!1,this.cmd=new MM(this),this.media=null==t?void 0:t.media,this.picFill=new TA(this.ctx,t.picFill,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1})}applyCommand(t,e){var n,i,r,o,s;if("call"===e)if(/playFrom\(([0-9.]+)\)/.test(t)){const e=t.match(/playFrom\(([0-9.]+)\)/),i=Number(e[1]||"0");null===(n=this.mediaPlayer)||void 0===n||n.play().then(()=>{var t;null===(t=this.mediaPlayer)||void 0===t||t.seek(i)})}else"custom-pause"===t?null===(i=this.mediaPlayer)||void 0===i||i.pause():"togglePause"===t?null===(r=this.mediaPlayer)||void 0===r||r.togglePause():"stop"===t&&(null===(o=this.mediaPlayer)||void 0===o||o.pause(),null===(s=this.mediaPlayer)||void 0===s||s.seek(0))}renderPic(){var t,e,n,i,r;const{displayObject:o}=this.picFill;if(o){const s=null===(t=this.backgroundGraphics)||void 0===t?void 0:t.getClonedDisplayObject();(null===(e=this.backgroundGraphics)||void 0===e?void 0:e.isNeedMask(o.width,o.height))&&s&&(o.mask=s,this.container.addChild(s)),o.width=this.designWidth,o.height=this.designHeight,o instanceof VE&&this.ctx.slideScopeEventHub.once("slide-render",t=>{this.ctx.slideIndex===t&&o.play()}),this.container.addChild(o),"video"===(null===(n=this.media)||void 0===n?void 0:n.type)&&this.media.src?(this.mediaPlayer=new YA({id:this.json.id+"-video",ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:o,container:this.container,canvasElement:this.ctx.view}),null===(i=this.mediaPlayer)||void 0===i||i.sprite):"audio"===(null===(r=this.media)||void 0===r?void 0:r.type)&&this.media.src&&(this.mediaPlayer=new JA({id:this.json.id+"-audio",ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:o,canvasElement:this.ctx.view})),this.mediaPlayer&&(this.isInteractiveOutside=this.container.interactive,this.container.interactive=!0,this.container.on("mouseover",()=>{this.mediaPlayer.showController()}),this.container.on("mouseout",()=>{this.mediaPlayer.hideController()},!1))}}preRender(t){super.preRender(t)}subClassRender(){this.renderPic()}clearOnSlideChange(){super.clearOnSlideChange(),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}initOnReuse(){super.initOnReuse(),this.mediaPlayer&&(this.container.interactive=!0)}destroy(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}var $A=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class QA extends PM{constructor(t,e,n,i,r){super(t,e,n),this.children=[],this.cacheSprite=new LT,this.cacheContainer=new ey,this.json=t,this.json.fillStyle&&"groupFill"===this.json.fillStyle.fillType&&i&&(this.json.fillStyle=i),this.container.name=t.id,this.cacheContainer.name=t.id+"-cache-container",this.ctx.timingTargets.addTarget(t.id,this),this.updateTransform(this.json),this.fillObject=new TA(this.ctx,t.fillStyle,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1}),this.createChildren(r)}createChildren(t){var e,n,i,r;const o={x:null!==(n=null===(e=this.json.position)||void 0===e?void 0:e.x)&&void 0!==n?n:0,y:null!==(r=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==r?r:0};for(let e=0,n=this.json.children.length;e<n;e++)t.addSubMTask(()=>$A(this,void 0,void 0,(function*(){const n=this.json.children[e];let i=null;"Shape"===(null==n?void 0:n.type)?i=new HA(n,this.ctx,o,this.json.fillStyle):"Picture"===(null==n?void 0:n.type)?i=new KA(n,this.ctx,o,this.json.fillStyle):"Container"===(null==n?void 0:n.type)&&(i=new QA(n,this.ctx,o,this.json.fillStyle,t)),i&&this.children.push(i)})))}get interactiveContainer(){return this.container}get renderContainer(){return this.container}preRender(t){for(const e of this.children)t.addSubMTask(()=>$A(this,void 0,void 0,(function*(){e.preRender(t)})))}getBgElement(){return null}getIterateEntry(t,e,n){return 0===e?this:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}getTextElement(){return null}render(t){for(const e of this.children)e.render(t),t.addSubMTask(()=>$A(this,void 0,void 0,(function*(){var t;e.renderContainer&&this.cacheContainer.addChild(e.renderContainer),(e.json.hlinkHover||e.json.hlinkClick)&&(null===(t=e.hyperlink)||void 0===t||t.addProxy(this.container))})));t.addSubMTask(()=>$A(this,void 0,void 0,(function*(){this.container.addChild(this.cacheContainer)})))}clearOnSlideChange(){this.children.forEach(t=>t.clearOnSlideChange())}initOnReuse(){this.children.forEach(t=>t.initOnReuse())}destroy(){this.cacheSprite&&this.cacheSprite.destroy({texture:!0}),this.children.forEach(t=>t.destroy()),this.container.destroy({children:!0,texture:!0,baseTexture:!0}),this.cacheContainer.destroy({children:!0,texture:!0,baseTexture:!0})}}class tR extends a.a{constructor(t,e,n,i){super(),this.cond={},this.timeoutIds=[],this.condHandle=t=>{if(t)if(t.delay&&t.delay>0){const e=this.ctx.clock.setTimeout(()=>{t.event&&(this.cond[t.event]=!0,this.detectTrigger())},t.delay);this.timeoutIds.push(e)}else this.cond[t.event]=!0,this.detectTrigger();else this.detectTrigger()},this.id=t,this.ctx=i,this.eventHubs=n,e.forEach(t=>{this.addCond(t)})}setTriggerParams(t){this.triggerParams=t}addCond(t){const e=()=>this.condHandle(t);t.event&&(/^shape/.test(t.event)||/^time/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.global.addListener(t.event,e)):/^runtime/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):/^self/.test(t.event)?t.delay&&t.delay>0&&(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):this.cond[t.event]=!1)}isTrigger(){return Object.keys(this.cond).every(t=>!!this.cond[t])}isTriggerWithoutParent(){return Object.keys(this.cond).filter(t=>"self"!==t).every(t=>!!this.cond[t])}detectTrigger(){if(Object.keys(this.cond).every(t=>!!this.cond[t])){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1});const t=this.triggerParams;this.triggerParams=void 0,this.emit("active",t)}}reset(){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1}),this.timeoutIds.forEach(t=>this.ctx.clock.clearTimeout(t))}}class eR extends a.a{constructor(t){super(),this.isTimeNodeEndSync=!1,this.interactiveListeners=[],this.runtimeNodeEventHub=new a.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=()=>{var t,e,n,i,r,o;this.hasPrev()||!this.isMainSeq?"idle"===this.currentSeqState?(this.decrSeqIndex(),null===(t=this.commonTimeNode.children[this.currentSeqIndex])||void 0===t||t.commonTimeNode.seekToStart(),null===(e=this.commonTimeNode.children[this.currentSeqIndex])||void 0===e||e.commonTimeNode.clearSubList(),this.currentSeqState="idle"):"running"===this.currentSeqState?(null===(n=this.commonTimeNode.children[this.currentSeqIndex])||void 0===n||n.commonTimeNode.seekToStart(),null===(i=this.commonTimeNode.children[this.currentSeqIndex])||void 0===i||i.commonTimeNode.clearSubList(),this.currentSeqState="idle"):"end"===this.currentSeqState&&(this.currentSeqIndex>=this.commonTimeNode.children.length&&(this.currentSeqIndex=this.commonTimeNode.children.length-1),null===(r=this.commonTimeNode.children[this.currentSeqIndex])||void 0===r||r.commonTimeNode.seekToStart(),null===(o=this.commonTimeNode.children[this.currentSeqIndex])||void 0===o||o.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide")},this.handleNext=()=>{var t,e,n,i;this.isTimeNodeEndSync&&(this.isTimeNodeEndSync=!1,this.currentSeqState="idle",this.currentSeqIndex=0),this.hasNext()||!this.isMainSeq?"idle"===this.currentSeqState?null===(t=this.commonTimeNode.children[this.currentSeqIndex])||void 0===t||t.commonTimeNode.startTimeNodeForce():"running"===this.currentSeqState?(null===(e=this.commonTimeNode.children[this.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToEnd(!1,!0),this.currentSeqState="end",this.incrSeqIndex(),null===(n=this.commonTimeNode.children[this.currentSeqIndex])||void 0===n||n.commonTimeNode.startTimeNodeForce()):"end"===this.currentSeqState&&(this.incrSeqIndex(),null===(i=this.commonTimeNode.children[this.currentSeqIndex])||void 0===i||i.commonTimeNode.startTimeNodeForce()):this.globalEventHub.emit("c:next slide")};const{json:e,iterateType:n,isIterate:i,isSub:r,parent:o,ctx:s,eventHub:l,iterateIndex:u,iterateId:h}=t;this.isMainSeq="mainSeq"===e.ctn.nodeType,this.isInteractiveSeq="interactiveSeq"===e.ctn.nodeType,this.id=e.ctn.id,this.isIterate=i,this.json=e,this.ctx=s,this.globalEventHub=l,this.commonTimeNode=new CR({json:e.ctn,isSub:r,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:s,parent:o,isIterate:!1,iterateType:n,iterateIndex:u,iterateId:h}),this.bindShapeEvent(),this.nextConds=new tR("mainSeq",e.nextCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new tR("mainSeq",e.preCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.commonTimeNode.on("timeNodeRestart",()=>{this.currentSeqIndex=0,this.currentSeqState="idle"}),this.commonTimeNode.on("childTimeNodeStart",t=>{const e=this.commonTimeNode.children.findIndex(e=>e.commonTimeNode.uuid===t.id);e>=0&&(this.currentSeqIndex=e),this.currentSeqState="running",this.isMainSeq&&this.ctx.eventHub.emit(KR.mainSeqStepStart,e)}),this.commonTimeNode.on("childTimeNodeEnd",t=>{const e=this.commonTimeNode.children.findIndex(e=>e.commonTimeNode.uuid===t.id);e>=0&&(this.currentSeqIndex=e),this.currentSeqState="end",this.autoPlay&&this.ctx.clock.setTimeout(()=>{this.handleNext()}),this.isMainSeq&&this.ctx.eventHub.emit(KR.mainSeqStepEnd,e)}),this.commonTimeNode.on("timeNodeEndSync",()=>{this.isTimeNodeEndSync=!0,this.commonTimeNode.resetForRepeat()}),this.commonTimeNode.on("timeNodeDestroy",()=>{this.interactiveListeners.forEach(([t,e])=>{t&&e&&t.interactiveContainer.removeListener("pointerdown",e)}),this.interactiveListeners=[]}),this.nextConds.on("active",()=>{this.handleNext()}),this.prevConds.on("active",this.handlePrev)}get currentSeqIndex(){return this._currentSeqIndex}set currentSeqIndex(t){this._currentSeqIndex=t,this.isMainSeq?this.ctx.eventHub.emit(KR.mainSeqStepChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(KR.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:t,state:this._currentSeqState}})}get currentSeqState(){return this._currentSeqState}set currentSeqState(t){this._currentSeqState=t,this.isMainSeq?this.ctx.eventHub.emit(KR.mainSeqStateChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(KR.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:this._currentSeqIndex,state:t}})}get stepLength(){return this.commonTimeNode.children.length}get currentStep(){return this.currentSeqIndex}get currentState(){return this.currentSeqState}startAutoPlay(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}incrSeqIndex(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}decrSeqIndex(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}hasPrev(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}hasNext(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}bindShapeEvent(){"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach(t=>{if(/^shape/.test(t.event)){const e=t.event.split(" ")[1];if(e){const t=this.ctx.timingTargets.getTargetById(e);if(t){t.interactiveContainer.interactive=!0,t.interactiveContainer.cursor="pointer";const n=()=>{this.ctx.eventHub.emit(KR.userInput);const t=`shape ${e} onClick`,{mode:n}=this.ctx;"interactive"!==n&&"sync"!==n||this.ctx.eventHub.emit(KR.interactiveSeqAction,{action:t,seqId:this.json.ctn.id}),"sync"!==n&&"local"!==n||this.globalEventHub.emit(t)};t.interactiveContainer.on("pointerdown",n),this.interactiveListeners.push([t,n])}}}})}setCurrentStep(t,e){this.isInteractiveSeq&&0===this.commonTimeNode.applyCount&&(this.commonTimeNode.applyCount=1);let n=t;this.commonTimeNode.seekToStart();const{length:i}=this.commonTimeNode.children;if(-1===n&&(n=i-1),n>=0&&n<i)for(let t=0;t<=n;t++){const i=this.commonTimeNode.children[t];t!==n?i.commonTimeNode.seekToEnd(!1,!0):"start"===e?i.commonTimeNode.seekToStart():"end"===e&&i.commonTimeNode.seekToEnd(!1,!0)}this.currentSeqIndex=n,this.currentSeqState="start"===e?"idle":"end"}}function nR(t,e,n){const i=e.split(".");i.reduce((r,o,s)=>{if(r)return s!==i.length-1?r[o]:void(r[o]=n);console.warn(`${t} not support ${e}`)},t)}function iR(t,e){if(!e)return null;return e.split(".").reduce((n,i)=>{if(n)return n[i];console.warn(`${t} not support ${e}`)},t)}class rR{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new a.a,this.onTimeLineStart=()=>{if(this.isConflict){const{target:t}=this.json.cBhvr;if("next"===this.activeWhenConflict){let e=t.id;"shape"===t.type&&t.txEl&&(e=`${e}-txEl-${t.txEl.range[0]}`),this.commonTimeNode.isIterate&&(e=`${e}-iterate-${this.commonTimeNode.iterateIndex}`),this.ctx.conflictTimeNodeManager.addRunningTimeNode(e,this.modifyAttrKey,this.commonTimeNode)}else"prev"===this.activeWhenConflict&&this.commonTimeNode.dispose()}};const{isIterate:e,isSub:n,json:i,ctx:r,parent:o,eventHub:s,iterateType:l,iterateIndex:u,iterateId:h}=t;this.json=i,this.id=i.cBhvr.ctn.id,this.ctx=r,this.globalEventHub=s,this.commonTimeNode=new CR({json:i.cBhvr.ctn,isSub:n,eventHubs:{global:s,runtime:this.runtimeNodeEventHub},ctx:r,parent:o,isIterate:e,iterateType:l,iterateIndex:u,iterateId:h}),this.timingTarget=this.ctx.timingTargets.getTarget(i.cBhvr.target,e,{type:l,index:u,id:h}),this.commonTimeNode.on("seekToStart",()=>this.onSeekToStart()),this.commonTimeNode.on("seekToEnd",()=>this.onSeekToEnd()),this.commonTimeNode.on("timelineStart",this.onTimeLineStart)}}class oR extends rR{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=iR(this.timingTarget,this.json.cBhvr.attrList[0]))},this.onSeekToStart=()=>{const t=this.json.cBhvr.attrList[0];null!==this.startVal&&this.timingTarget&&nR(this.timingTarget,t,this.startVal)},this.onSeekToEnd=()=>{const t=this.json.cBhvr.attrList[0],e=this.json.cBhvr.to||this.json.to;e&&this.timingTarget&&nR(this.timingTarget,t,e)},this.commonTimeNode.on("timeNodeStart",this.updateStartValue),this.commonTimeNode.on("timeNodeCreate",this.updateStartValue),this.commonTimeNode.on("timeUpdate",({duration:t,delta:e})=>{if(e/t>=1){const t=this.json.cBhvr.attrList[0];this.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");const e=this.json.cBhvr.to||this.json.to;e&&this.timingTarget&&nR(this.timingTarget,t,e)}})}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}}var sR=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class aR{constructor(t,e){this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:t=>t/Math.PI*180,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:t=>t/180*Math.PI,rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=e,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}parseFmla(t){let e=t.replace(/#ppt_h/g,`(${this.timingTarget.design_ppt_h})`);return e=e.replace(/#ppt_w/g,`(${this.timingTarget.design_ppt_w})`),e=e.replace(/#ppt_x/g,`(${this.timingTarget.design_ppt_x})`),e=e.replace(/#ppt_y/g,`(${this.timingTarget.design_ppt_y})`),e=e.replace(/ppt_w/g,"vars.ppt_w"),e=e.replace(/ppt_h/g,"vars.ppt_h"),e=e.replace(/ppt_x/g,"vars.ppt_x"),e=e.replace(/ppt_y/g,"vars.ppt_y"),e=e.replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach(t=>{const n=new RegExp(`([^a-z])${t}([^a-z])`,"g");e=e.replace(n,(e,n,i)=>`${n}math.${t}${i}`)}),new Function("vars","math","$","return "+e)}}class lR extends aR{constructor(t,e,n){super(t,e),this.value=t.val.value,n&&(this.fmla=this.parseFmla(n))}resolveValue(){return this.value}interpolationFrom(t,e,n){const i=t.resolveValue(n),r=i+(this.resolveValue()-i)*e;return t.fmla?t.fmla(n,this.math,r):r}}sR([ZE()],lR.prototype,"interpolationFrom",null);class uR extends aR{constructor(t,e){var n;super(t,e),this.value=null===(n=t.val)||void 0===n?void 0:n.value}interpolationFrom(t,e,n){let i=t.resolveValue(n);return e>this.time&&(i=this.resolveValue()),i}resolveValue(){return this.value||""}}sR([ZE()],uR.prototype,"interpolationFrom",null);class hR extends aR{constructor(t,e){super(t,e),this.fn=this.parseFmla(this.val)}resolveValue(t){return this.fn(t,this.math,1)}interpolationFrom(t,e,n){const i=t.resolveValue(n),r=i+(this.resolveValue(n)-i)*e;return t.fmla?t.fmla(n,this.math,r):r}}sR([ZE()],hR.prototype,"interpolationFrom",null);class cR extends aR{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return FM(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}sR([ZE()],cR.prototype,"interpolationFrom",null);class dR extends rR{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},this.keyFrames=[],this.isColorAnim=!1,this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal=iR(this.timingTarget,this.json.cBhvr.attrList[0]))},this.updateVars=()=>{var t,e,n,i;(null===(t=this.timingTarget)||void 0===t?void 0:t.ppt_h)&&(this.vars.ppt_h=this.timingTarget.ppt_h),(null===(e=this.timingTarget)||void 0===e?void 0:e.ppt_w)&&(this.vars.ppt_w=this.timingTarget.ppt_w),(null===(n=this.timingTarget)||void 0===n?void 0:n.ppt_x)&&(this.vars.ppt_x=this.timingTarget.ppt_x),(null===(i=this.timingTarget)||void 0===i?void 0:i.ppt_y)&&(this.vars.ppt_y=this.timingTarget.ppt_y),this.isColorAnim},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t,i=this.keyFrames.findIndex(t=>n<=t[0]),{attrList:r}=this.json.cBhvr;if(i<0){const t=this.keyFrames[this.keyFrames.length-1];return void(this.timingTarget&&r&&r[0]&&nR(this.timingTarget,r[0],t[1].resolveValue(this.vars)))}const o=i-1,s=this.keyFrames[i],a=this.keyFrames[o]||s,l=s[0]-a[0]==0?1:(n-a[0])/(s[0]-a[0]),u=s[1].interpolationFrom(a[1],l,this.vars);this.timingTarget&&r&&r[0]&&nR(this.timingTarget,r[0],u)},this.onSeekToStart=()=>{null!==this.startVal&&this.timingTarget&&nR(this.timingTarget,this.json.cBhvr.attrList[0],this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.initKeyFrames(),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timelineStart",this.updateVars),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}initKeyFrames(){var t;const{valueType:e}=this.json;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){const t={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===e&&this.timingTarget){const e=new hR(t,this.timingTarget);this.keyFrames.push([t.time,e])}}const t={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===e&&this.timingTarget){const e=new hR(t,this.timingTarget);this.keyFrames.push([t.time,e])}}else if(this.json.by){const n={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===e&&this.timingTarget){const t=new hR(n,this.timingTarget);this.keyFrames.push([n.time,t])}const i={time:1,val:{type:"string",value:((null===(t=n.val)||void 0===t?void 0:t.value)||"")+"+"+this.json.by},fmla:""};if("num"===e&&this.timingTarget){const t=new hR(i,this.timingTarget);this.keyFrames.push([i.time,t])}}if(this.json.tavLst.length>0)for(const t of this.json.tavLst)if(t.val&&this.timingTarget){let n=null;"string"===t.val.type?"num"===e?n=new hR(t,this.timingTarget):"str"===e&&(n=new uR(t,this.timingTarget)):"number"===t.val.type?n=new lR(t,this.timingTarget):"color"===t.val.type?(this.isColorAnim=!0,n=new cR(t,this.timingTarget)):"boolean"===t.val.type&&console.warn("not implements"),n&&this.keyFrames.push([t.time,n])}}}var pR=n(51),fR=n.n(pR),mR=n(52),gR=n.n(mR);class vR extends Hx{constructor(){super(gR.a,fR.a,{percent:0,direction:1,transition:0})}set transition(t){this.uniforms.transition=t}set percent(t){this.uniforms.percent=t}set direction(t){this.uniforms.direction=t}}var _R=n(53),yR=n.n(_R);class xR extends Hx{constructor(){super(void 0,yR.a,{percent:0,transition:1})}set transition(t){this.uniforms.transition=Math.pow(t,t)}set percent(t){this.uniforms.percent=t}}class bR extends rR{constructor(t){var e;super(t),this.filterType="",this.isConflict=!0,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t;this.filter&&(this.filter.percent=this.commonTimeNode.applyTimeFilter(n)),n>=1&&this.timingTarget&&this.ctx.clock.setTimeout(()=>{this.timingTarget&&(this.timingTarget.container.filters=[])})},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let n=0;"out"===t.json.transition?n=-1:"in"===t.json.transition&&(n=1);const i=null===(e=t.json.filter)||void 0===e?void 0:e.match(/^([a-zA-Z]+)(\((.+)\))?/);if(i){const t=i[1],e=i[3];if("wipe"===t){const n=new vR;"up"===e?n.direction=1:"down"===e?n.direction=2:"left"===e?n.direction=3:"right"===e&&(n.direction=4),this.filter=n,this.filterType=`${t}-${e}`}else if("fade"===t){const e=new xR;this.filter=e,this.filterType=""+t}this.filter&&(this.filter.transition=n)}}get modifyAttrKey(){return this.filterType}}class wR extends rR{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.onTimeUpdate=({duration:t,delta:e})=>{var n;const i=e/t,r=null===(n=this.path)||void 0===n?void 0:n.getPoint(i);this.timingTarget&&r&&(this.timingTarget.ppt_x=r.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=r.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.ppt_x=this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=this.timingTarget.design_ppt_y)},this.onSeekToEnd=()=>{var t,e,n;const i=null!==(e=null===(t=this.commonTimeNode.json)||void 0===t?void 0:t.spd)&&void 0!==e?e:1,r=null===(n=this.path)||void 0===n?void 0:n.getPoint(i>0?1:0);this.timingTarget&&r&&(this.timingTarget.ppt_x=r.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=r.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new bc,n=null===(t=this.json.path)||void 0===t?void 0:t.match(/[MLCmlc][^MLCmlc]+/g);if(n)for(const t of n){const[n,...i]=t.trim().replace(/\s+/g," ").split(" ");if("M"===n){const[t,n]=i.map(t=>Number(t));e.moveTo(t,n)}else if("L"===n){const[t,n]=i.map(t=>Number(t));e.lineTo(t,n)}else if("C"===n){const[t,n,r,o,s,a]=i.map(t=>Number(t));e.bezierCurveTo(t,n,r,o,s,a)}else if("Z"===n)e.closePath();else if("E"===n)console.warn("not implements");else if("c"===n){const[t,n,r,o,s,a]=i.map(t=>Number(t)),l=e.currentPoint;e.bezierCurveTo(t+l.x,n+l.y,r+l.x,o+l.y,s+l.x,a+l.y)}else if("l"===n){const t=e.currentPoint,[n,r]=i.map(t=>Number(t));e.lineTo(n+t.x,r+t.y)}else if("m"===n){const t=e.currentPoint,[n,r]=i.map(t=>Number(t));e.moveTo(n+t.x,r+t.y)}}this.path=e}}class TR extends rR{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=t=>{t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:e})=>{var n,i,r,o,s;const a=e/t,l={x:1,y:1};if(this.to){const t=null!==(n=this.from)&&void 0!==n?n:{x:null!==(r=null===(i=this.startVal)||void 0===i?void 0:i.x)&&void 0!==r?r:1,y:null!==(s=null===(o=this.startVal)||void 0===o?void 0:o.y)&&void 0!==s?s:1};l.x=t.x+(this.to.x-t.x)*a,l.y=t.y+(this.to.y-t.y)*a}else if(this.by){const t={x:this.by.x,y:this.by.y};l.x=1+(t.x-1)*a,l.y=1+(t.y-1)*a}this.timingTarget&&(this.timingTarget.scale=l)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=t.json.from,this.to=t.json.to,this.by=t.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class SR extends rR{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isTimelineStart=!1,this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=t=>{if(this.isTimelineStart)return;this.isTimelineStart=!0,t.isReverse||this.updateCurrentValue(),this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to);const[e]=this.json.cBhvr.attrList[0].split(".");nR(this.timingTarget,e+".on","true")},this.onTimeNodeEnd=()=>{if("remove"===this.json.cBhvr.ctn.fill){const[t]=this.json.cBhvr.attrList[0].split(".");nR(this.timingTarget,t+".on","false")}this.isTimelineStart=!1},this.onSeekToStart=()=>{var t;if(this.timingTarget&&(this.onTimeUpdate({duration:1,delta:0}),(null===(t=this.timingTarget.fill)||void 0===t?void 0:t.designColor.toUpperCase())===this.from.toHexString().toUpperCase())){const[t]=this.json.cBhvr.attrList[0].split(".");nR(this.timingTarget,t+".on","false")}},this.onTimeNodeStart=()=>{if(this.timingTarget){const t=iR(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.startColorString=t)}},this.onTimeUpdate=({delta:t,duration:e})=>{const n=t/e;this.to.interpolationFrom(this.from,n,this.target),this.timingTarget&&nR(this.timingTarget,this.json.cBhvr.attrList[0],this.target.toHexString())},this.onSeekToEnd=()=>{this.isTimelineStart||this.onTimelineStart({isReverse:!1,activeCount:0,id:""}),this.onTimeUpdate({duration:1,delta:1})},"rgb"===this.json.clrSpc?(this.from=new OM(this.json.from),this.to=new OM(this.json.to),this.by=new OM(this.json.by),this.target=new OM):(this.from=new IM(this.json.from),this.to=new IM(this.json.to),this.by=new IM(this.json.by),this.target=new IM),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const t=iR(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.currentColorString=t)}}}class ER extends rR{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=t=>{this.lastVal=null,t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t;let i=0,r=0;if(void 0!==this.from&&void 0!==this.to){i=this.from,r=this.to;const t=i+(r-i)*n;this.timingTarget&&(this.timingTarget.r=t)}else if(void 0!==this.by){this.lastVal||(this.lastVal=0);const t=this.by*n-this.lastVal;this.lastVal=this.by*n,this.timingTarget&&(this.timingTarget.r+=t)}},this.onTimeNodeStart=()=>{var t;Object(u.isNumber)(null===(t=this.timingTarget)||void 0===t?void 0:t.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&null!==this.startVal&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=null===(t=this.timingTarget)||void 0===t?void 0:t.r}}class MR extends rR{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var t,e;const{cmd:n,cmdType:i}=this.json;!this.isApplied&&n&&i&&(this.isApplied=!0,null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand(n,i))},this.onSeekToStart=()=>{var t,e;null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("seekToStart",this.onSeekToStart),this.commonTimeNode.on("seekToEnd",this.onSeekToEnd)}get modifyAttrKey(){var t,e,n,i;return(null!==(e=null===(t=this.json)||void 0===t?void 0:t.cmd)&&void 0!==e?e:"")+(null!==(i=null===(n=this.json)||void 0===n?void 0:n.cmdType)&&void 0!==i?i:"")}}class AR{constructor(t){this.runtimeNodeEventHub=new a.a,this.stopAudio=()=>{this.audio.stop()},this.destroy=()=>{this.stopAudio(),this.audio.destroy()};const{json:e,isIterate:n,isSub:i,eventHub:r,ctx:o,parent:s,iterateType:l,iterateIndex:u,iterateId:h}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new CR({json:e.cMediaNode.ctn,isSub:i,eventHubs:{global:r,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:n,iterateType:l,iterateIndex:u,iterateId:h}),this.audio=new XA(e.cMediaNode.tgtEl),this.commonTimeNode.on("timelineStart",()=>{this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy)}}var RR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class CR extends a.a{constructor(t){var e,n;super(),this.uuid=Date.now().toString(32)+Math.random().toString(32).substring(2),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId="",this.iterateShadows=[],this.isEndEventsEmitted=!1,this.tmFilter=[],this.timeDelta=0,this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.seekToEnd(!1,!0))},this.handleActive=(t=!0)=>{if(this.isActive=!0,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if("never"===this.json.restart)return;"whenNotActive"!==this.json.restart&&"always"!==this.json.restart||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(t))}else this.startTimeLine(t)},this.updateTimeLine=t=>{const e=t/(gv.TARGET_FPMS||.06);this.timeDelta+=e,this.duration-this.timeDelta<=e&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(t=!1)=>{(this.isTimeNodeEnd()||t)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:i,isIterate:r,ctx:o,eventHubs:s,parent:a,json:l,iterateType:u,iterateId:h,iterateIndex:c}=t;this.isSub=i,this.isIterate=r,this.parentTimeNode=a,this.json=l,this.ctx=o,this.iterateIndex=c,this.eventHubs=s,this.iterateType=u,this.iterateId=h,this.tmFilter=null!==(n=null===(e=l.tmFilter)||void 0===e?void 0:e.split(";").map(t=>t.split(",").map(t=>parseFloat(t.trim()))))&&void 0!==n?n:[];const d=Number(this.json.dur),p=this.json.spd||1;this.isNegativeSpeed=p<0,Number.isNaN(d)||(this.duration=d/Math.abs(p)),this.uuid+="--"+this.json.id,this.setPreStyle(),l.childTnLst&&this.createChildren(l.childTnLst),this.startConds=new tR(this.json.id||"",l.stCondLst,s,this.ctx),this.endConds=new tR(this.json.id||"",l.endCondLst,s,this.ctx),l.endSync&&(this.endSync=new tR(this.json.id||"",[l.endSync],s,this.ctx),this.endSync.on("active",()=>{var t;"interactiveSeq"===this.json.nodeType&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),null===(t=this.endSync)||void 0===t||t.reset())})),this.startConds.on("active",t=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(t))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(t=>t.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&"nextClick"===this.json.masterRel&&this.startConds.addCond({event:"shape slide onNext"}),this.json.iterate&&!1===this.isIterate&&this.createIterateShadow()}createIterateShadow(){const t=aM();let e=!0,n=0;const i=n=>{n===t&&(e=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",i))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",i);e;){const e=JSON.parse(JSON.stringify(this.json)),i=new CR({json:e,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:e.iterate.type,iterateIndex:n,iterateId:t});this.iterateShadows[n]=i,n+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(t){this.isReverse=t}createTimeNode(t,e){let n=null;const i={json:t,isSub:e,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId};return"seq"===t.type?n=new eR(i):"par"===t.type?n=new PR(i):"set"===t.type?n=new oR(i):"anim"===t.type?n=new dR(i):"animEffect"===t.type?n=new bR(i):"animMotion"===t.type?n=new wR(i):"animScale"===t.type?n=new TR(i):"animClr"===t.type?n=new SR(i):"animRot"===t.type?n=new ER(i):"cmd"===t.type?n=new MR(i):"audio"===t.type&&(n=new AR(i)),n}createSubList(t){this.subList=[],t.forEach(t=>{const e=this.createTimeNode(t,!0);e&&this.subList.push(e)})}bindCommonTimeNodeEvent(t){t.commonTimeNode.on("timeNodeStart",t=>{this.emit("childTimeNodeStart",t)}),t.commonTimeNode.on("timeNodeEnd",t=>{this.emit("childTimeNodeEnd",t),this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())&&(this.json.iterate||this.allChildrenEndHandle())})}createChildren(t){function e(t){return(e=t,function(t){var e;return!!(null===(e=t)||void 0===e?void 0:e.cBhvr)}(e)?e.cBhvr.ctn:function(t){var e,n;return!!(null===(n=null===(e=t)||void 0===e?void 0:e.cMediaNode)||void 0===n?void 0:n.ctn)}(e)?e.cMediaNode.ctn:e.ctn).presetOrder;var e}if(t&&t[0]&&e(t[0])){[...t].sort((t,n)=>{var i,r;return(null!==(i=e(t))&&void 0!==i?i:0)-(null!==(r=e(n))&&void 0!==r?r:0)}).forEach(e=>{const n=t.findIndex(t=>t===e),i=this.createTimeNode(e,!1);i&&(this.bindCommonTimeNodeEvent(i),this.children[n]=i)})}else t.forEach(t=>{const e=this.createTimeNode(t,!1);e&&(this.bindCommonTimeNodeEvent(e),this.children.push(e))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(t=>t.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.timeDelta=0,this.children.forEach(t=>t.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(t=>t.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.isEndEventsEmitted=!1,this.timeDelta=0;const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(KR.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(KR.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(t=!0){if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce(()=>{this.onTimeLineEnd()})):this.duration>e&&(this.ctx.eventHub.emit(KR.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}startIterate(){return RR(this,void 0,void 0,(function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const t of this.iterateShadows){if(this.isIterateEnd)break;t.children.forEach(t=>{t.commonTimeNode.startTimeNode()}),t.applyCount+=1,yield this.ctx.clock.delay(this.json.iterate.interval)}this.onTimeLineEnd()}}))}applyTimeFilter(t){if(!this.tmFilter.every(t=>Object(u.isNumber)(t[0])&&Object(u.isNumber)(t[1])))return t;for(let e=0;e<this.tmFilter.length;e++){const n=this.tmFilter[e];if(t<n[0]){const i=this.tmFilter[e-1];return(t-i[0])/(n[0]-i[0])*(n[1]-i[1])+i[1]}}return this.tmFilter.length>0?this.tmFilter[this.tmFilter.length-1][1]:t}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}findTargets(){const t=[],e=n=>{n.forEach(n=>{var i,r,o;n.cBhvr&&n.cBhvr.target&&t.findIndex(t=>t.id===n.cBhvr.target.id)<0&&t.push(n.cBhvr.target),(null===(r=null===(i=null==n?void 0:n.cBhvr)||void 0===i?void 0:i.ctn)||void 0===r?void 0:r.childTnLst)&&n.cBhvr.ctn.childTnLst.length>0&&e(n.cBhvr.ctn.childTnLst),(null===(o=null==n?void 0:n.ctn)||void 0===o?void 0:o.childTnLst)&&n.ctn.childTnLst.length>0&&e(n.ctn.childTnLst)})};return e(this.json.childTnLst||[]),t}setPreStyle(){this.json.presetClass&&this.findTargets().forEach(t=>{if(this.json.iterate){let e=0,n=!0;for(;n;){const i=this.ctx.timingTargets.getTarget(t,!0,{type:this.json.iterate.type,index:e,id:""});i&&(this.setPreStyleForTarget(i),e+=1),n=!!i}}else{const e=this.ctx.timingTargets.getTarget(t,!1);e&&this.setPreStyleForTarget(e)}})}setPreStyleForTarget(t){var e,n;if(t&&this.json.presetSubtype&&(t.presetSubType=this.json.presetSubtype),t&&!t.hasPreset)if("entr"===this.json.presetClass){const i=null===(n=null===(e=this.json)||void 0===e?void 0:e.childTnLst)||void 0===n?void 0:n.filter(t=>"set"===t.type&&"visible"===t.to);(null==i?void 0:i.length)&&(t.hasPreset=!0,t.style.visibility="hidden")}else("exit"===this.json.presetClass||"path"===this.json.presetClass)&&(t.hasPreset=!0,t.style.visibility="visible")}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(t=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(t);const e=this.json.stCondLst.filter(t=>/^self/.test(t.event||""))[0];e&&this.startConds.condHandle(e);const n=this.json.endCondLst.filter(t=>/^self/.test(t.event||""))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(t=>t.commonTimeNode.destroy())}seekToStart(t=!0){if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(e=>e.seekToStart(t));if(t)for(let t=this.subList.length-1;t>=0;t--){const e=this.subList[t];null==e||e.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const e=this.children[t];null==e||e.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const e=this.children[t];null==e||e.commonTimeNode.seekToStart()}}dispose(t=!1){this.isConflictDispose=t,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(KR.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch(t){}this.startConds.reset(),this.endConds.reset()}seekToEnd(t,e=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const n=this.json.autoRev||t;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(t=>t.seekToEnd(n,e));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(t=>t.commonTimeNode.seekToEnd(n,e)),e&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(t=>t.commonTimeNode.seekToEnd(!1)),this.clearSubList())}isTimeNodeEnd(){let t=!0;return this.children.length>0&&(t=t&&this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||(!(!this.isIterateEnd||!this.json.iterate)||t)}emitEndEvents(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(t=>t.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(t=>t.commonTimeNode.destroy()),this.clearSubList()}}class PR extends a.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new a.a;const{json:e,iterateType:n,isIterate:i,isSub:r,parent:o,ctx:s,eventHub:l,iterateIndex:u,iterateId:h}=t;this.id=e.ctn.id,this.json=e,this.ctx=s,this.isIterate=i,this.globalEventHub=l,this.commonTimeNode=new CR({json:e.ctn,isSub:r,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:s,parent:o,isIterate:!1,iterateType:n,iterateIndex:u,iterateId:h}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(t=>{t.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),t.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(t=>{t.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}var IR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class OR{constructor(t,e,n){this.json=t,this.ctx=n,this.globalEventHub=e;const i=t.timeNodeList.find(t=>"par"===t.type&&"tmRoot"===t.ctn.nodeType);i&&(this.tmRoot=new PR({json:i,isSub:!1,isIterate:!1,eventHub:e,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(t=>{var e,n,i;return"seq"===(null===(e=t.json)||void 0===e?void 0:e.type)&&"mainSeq"===(null===(i=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.nodeType)}))}findSeq(t){var e;return null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.find(e=>{var n,i,r;return"seq"===(null===(n=e.json)||void 0===n?void 0:n.type)&&(null===(r=null===(i=e.json)||void 0===i?void 0:i.ctn)||void 0===r?void 0:r.id)===t})}start(){var t,e;return IR(this,void 0,void 0,(function*(){this.json.autoPlayMainSeq?(yield this.ctx.clock.delay(16),null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode()):null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.startTimeNode()}))}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var t;null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.collectStartValue()}setMainSeqStep(t,e){var n;-1===t&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(n=this.mainSeq)||void 0===n||n.setCurrentStep(t,e)}destroy(){var t;this.globalEventHub.removeAllListeners(),null===(t=this.tmRoot)||void 0===t||t.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(t){const e=this.findSeq(t);e&&e.commonTimeNode.seekToEnd(!1,!0)}setInteractiveSeqState(t,e,n){const i=this.findSeq(t);i&&i.setCurrentStep(e,n)}resetAllInteractiveSeq(){var t;((null===(t=this.tmRoot)||void 0===t?void 0:t.commonTimeNode.children.filter(t=>{var e,n,i;return"seq"===(null===(e=t.json)||void 0===e?void 0:e.type)&&"interactiveSeq"===(null===(i=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.nodeType)}))||[]).forEach(t=>{t.setCurrentStep(0,"start")})}applyInteractiveAction(t){this.globalEventHub.emit(t)}}var LR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class NR extends QA{constructor(t,e,n,i){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,n,void 0,i),this.isRendered=!1,this.isTimingStartValueCollected=!1,this.globalEventHub=new a.a,this.json=t,e.hasBackgroundFillShape=this.detectUseBackgroundFill(this.json),this.container.visible=!1,this.ctx=e;const r=new RT;r.beginFill(16777215),r.drawRect(0,0,t.width,t.height),r.endFill(),this.container.addChild(r)}detectUseBackgroundFill(t){return!!t&&("Picture"===t.type||"Shape"===t.type?t.useBgFill:!(!t.children||!Object(u.isArray)(t.children))&&t.children.some(t=>this.detectUseBackgroundFill(t)))}initOnReuse(){super.initOnReuse(),this.globalEventHub.on("c:prev slide",()=>{this.ctx.eventHub.emit(KR.requestPrevSlide)}),this.globalEventHub.on("c:next slide",()=>{this.ctx.eventHub.emit(KR.requestNextSlide)})}get interactiveContainer(){return this.container}render(t){this.isRendered||(this.isRendered=!0,super.render(t),t.addSubMTask(()=>LR(this,void 0,void 0,(function*(){this.ctx.eventHub.emit("StageRenderEnd")}))))}createTiming(){this.json.timing&&!this.timing&&(this.timing=new OR(this.json.timing,this.globalEventHub,this.ctx))}startTiming(){var t;return(null===(t=this.timing)||void 0===t?void 0:t.start())||Promise.resolve()}setMainSeqApplied(){var t;null===(t=this.timing)||void 0===t||t.setMainSeqApplied()}setMainSeqStep(t,e){var n;null===(n=this.timing)||void 0===n||n.setMainSeqStep(t,e)}collectMainSeqStartValue(){var t;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,null===(t=this.timing)||void 0===t||t.collectMainSeqStartValue())}hasTiming(){return!!this.timing}clearOnSlideChange(){this.ctx.eventHub.removeAllListeners(),this.globalEventHub.removeAllListeners(),super.clearOnSlideChange()}clearOnTransactionEnd(){var t,e;this.ctx.timingTargets.getTargets().forEach(t=>{t.hasPreset=!1}),null===(t=this.timing)||void 0===t||t.resetAllInteractiveSeq(),null===(e=this.timing)||void 0===e||e.destroy(),this.timing=void 0}destroy(){var t,e;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),null===(t=this.ctx.bgTexture)||void 0===t||t.destroy(!0),this.ctx.spriteTexture.destroy(),this.globalEventHub.removeAllListeners(),null===(e=this.timing)||void 0===e||e.destroy(),this.timing=void 0,super.destroy()}mainSeqStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.currentMainSeqStep())&&void 0!==e?e:0}mainSeqLength(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.currentMainSeqLength())&&void 0!==e?e:0}mainSeqHasNextStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.mainSeqHasNextStep())&&void 0!==e&&e}mainSeqHasPrevStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.mainSeqHasPrevStep())&&void 0!==e&&e}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(){var t;this.hasTiming()&&(null===(t=this.timing)||void 0===t?void 0:t.hasMainSeq())?(this.globalEventHub.emit("shape slide onStopAudio"),this.globalEventHub.emit("shape slide onNext")):this.ctx.eventHub.emit(KR.requestNextSlide)}prevStep(){var t;this.hasTiming()&&(null===(t=this.timing)||void 0===t?void 0:t.hasMainSeq())?(this.globalEventHub.emit("shape slide onStopAudio"),this.globalEventHub.emit("shape slide onPrev")):this.ctx.eventHub.emit(KR.requestPrevSlide)}applyInteractiveAction(t){var e;null===(e=this.timing)||void 0===e||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;null===(e=this.timing)||void 0===e||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,n){var i;null===(i=this.timing)||void 0===i||i.setInteractiveSeqState(t,e,n)}setMediaState(t,e){return LR(this,void 0,void 0,(function*(){const n=this.ctx.medias[t];n&&(e?yield n.play():yield n.pause())}))}setMediaCurrentTime(t,e){const n=this.ctx.medias[t];n&&n.seek(e)}}class DR{constructor(t){this.ticker=t,this.tasks=[],this.couldRunning=!1,this.applyNext=()=>{const t=this.tasks[0];t&&t.applyNext()},t.add(this.applyNext)}addTask(t){this.tasks.push(t),t.once("task-finish",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)}),t.once("task-error",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)})}start(){this.couldRunning=!0}stop(){this.couldRunning=!1}}var FR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};const BR=t=>new Promise(e=>setTimeout(e,t));class UR extends a.a{constructor(t,e){super(),this.slideIndex=t,this.taskId=e,this.uuid=aM(),this.isCancel=!1,this.tasks=[]}addMTask(t){this.tasks.push({fn:t,state:"wait",sub:[]})}addSubMTask(t){let e=this.tasks.findIndex(t=>"running"===t.state);e<0&&(e=0),this.tasks[e].sub.push({fn:t,state:"wait",sub:[]})}cancel(){this.tasks=[],this.isCancel=!0}applyNext(){if(this.tasks.some(t=>"running"===t.state))return;if(this.tasks.some(t=>"error"===t.state))return;if(this.tasks.every(t=>"finish"===t.state))return void(this.isCancel||this.emit("task-finish"));const t=this.tasks.find(t=>"wait"===t.state);t&&(t.state="running",t.fn.apply(null).then(()=>{if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(e=>e===t);this.tasks.splice(e+1,0,...t.sub)}}).catch(e=>{t.state="error",KE.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",YE.transform(e),this.slideIndex)}))}applyAll(){return FR(this,void 0,void 0,(function*(){for(;!this.tasks.every(t=>"finish"===t.state);)if(this.tasks.some(t=>"running"===t.state))yield BR(16);else{if(this.tasks.some(t=>"error"===t.state))return;{const t=this.tasks.find(t=>"wait"===t.state);if(t){t.state="running";try{if((yield uM(()=>t.fn.apply(null),2e4))===lM)throw new YE(WE.RuntimeError,"subtask apply timeout");if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(e=>e===t);this.tasks.splice(e+1,0,...t.sub)}}catch(e){t.state="error",KE.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",YE.transform(e),this.slideIndex);break}}}}this.isCancel||this.emit("task-finish")}))}}var kR=n(54);const GR=new(n.n(kR).a),HR=GR.getDevice(),zR=GR.getBrowser(),jR=GR.getOS(),VR={isDesktop(){let t=!0;return"mobile"===HR.type&&(t=!1),/Samsung/.test(zR.name||"")&&(t=!1),window.__nativeTags&&window.__nativeTags.platform&&(t=!1),t},isIOS(){let t=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(t=!0),jR.name&&/iOS/.test(jR.name)&&(t=!0),t},isAndroid(){let t=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(t=!0),jR.name&&/android/i.test(jR.name)&&(t=!0),t},isLowGpuMemory(){var t,e;const n=null!==(e=null===(t=window.__nativeTags)||void 0===t?void 0:t.platform)&&void 0!==e?e:"";if(n){const t=n.split(" ");if(t[1]){if(/^iPad/.test(t[1])){const e=t[1].match(/^iPad(\d+)/);return!(e&&e[1]&&parseInt(e[1],10)>=6)}if(/^iPhone/.test(t[1])){const e=t[1].match(/^iPhone(\d+)/);return!(e&&e[1]&&parseInt(e[1],10)>=9)}return!1}return!1}return!0}};var WR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class XR{constructor(t,e,n,i,r,o,s,a,l){this.loader=t,this.mode=e,this.renderer=n,this.ticker=i,this.view=r,this.clock=o,this.objPoolGroup=s,this.errorChannel=a,this.localstorage=l,this.currentStageIndex=0,this.cacheCount=VR.isDesktop()?2:1,this.stageStates=Object.create(null),this.stageJsons=Object.create(null),this.stageCtxs=Object.create(null),this.stageImpls=Object.create(null),this.taskId="",this.url="",this.microTaskManager=new DR(i)}setResourceData(t,e){this.taskId=t,this.url=e}createCtx(t){const{task:e}=this.stageStates[t];e.addMTask(()=>WR(this,void 0,void 0,(function*(){const e=new pM(this.loader),n=new a.a,i={mode:this.mode,renderer:this.renderer,graphicsTexture:new wM,stageWidth:0,stageHeight:0,ticker:this.ticker,timingTargets:new SM(n),eventHub:n,view:this.view,medias:Object.create(null),lastViewedIndex:0,conflictTimeNodeManager:new TM,clock:this.clock,spriteTexture:e,slideIndex:t,objectPoolGroup:this.objPoolGroup,hasBackgroundFillShape:!1,slideScopeEventHub:new a.a};this.stageCtxs[t]=i})))}loadStageJson(t){const{task:e}=this.stageStates[t];e.addMTask(()=>WR(this,void 0,void 0,(function*(){const e=yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/slide-${t}.json`);this.stageJsons[t]=e,this.stageCtxs[t].stageWidth=e.width,this.stageCtxs[t].stageHeight=e.height})))}loadSpriteSheets(t){const{task:e}=this.stageStates[t];e.addMTask(()=>{const n=this.stageJsons[t],{spriteTexture:i}=this.stageCtxs[t],{coloredSheets:r,sheets:o}=n,s=r||o;return s&&s.forEach(t=>{e.addSubMTask(()=>i.loadSpriteSheetItem(this.url,this.taskId,t))}),Promise.resolve()})}createStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>{const n=this.stageJsons[t],i=this.stageCtxs[t],r=new NR(n,i,{x:0,y:0},e);return this.stageImpls[t]=r,Promise.resolve()})}preRenderStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>(this.stageImpls[t].preRender(e),Promise.resolve()))}createGraphicsTexture(t){const{task:e}=this.stageStates[t];e.addMTask(()=>WR(this,void 0,void 0,(function*(){const n=this.stageCtxs[t];n.graphicsTexture.pack().forEach((t,i)=>{e.addSubMTask(()=>n.graphicsTexture.render(t,i,this.objPoolGroup))})})))}renderStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>WR(this,void 0,void 0,(function*(){const n=this.stageImpls[t],i=this.stageCtxs[t];yield n.render(e),e.addSubMTask(()=>WR(this,void 0,void 0,(function*(){var e;const r=`snapshot-${t.toString()}-start`;if(!(yield null===(e=this.localstorage)||void 0===e?void 0:e.getItem(r))&&$R.platform.isLowGpuMemory()){n.createTiming(),n.container.visible=!0,n.collectMainSeqStartValue(),n.setMainSeqStep(0,"start");const t=zy.create({width:n.json.width,height:n.json.height,resolution:1});i.renderer.render(n.container,{renderTexture:t});const e=i.renderer.plugins.extract.base64(t,"image/jpeg");this.localstorage.setItem(r,e,!0).catch(()=>{}),n.container.visible=!1,t.destroy(),n.timing&&(n.timing.destroy(),n.timing=void 0)}})))})))}destroyStageByIndex(t){"load"===this.stageStates[t].state&&this.stageStates[t].task.cancel(),delete this.stageStates[t];this.stageImpls[t].destroy(),delete this.stageImpls[t],delete this.stageCtxs[t]}destroyStage(){Object.keys(this.stageImpls).forEach(t=>{const e=parseInt(t,10);Math.abs(this.currentStageIndex-e)>this.cacheCount&&this.destroyStageByIndex(e)})}destroyAllStage(){Object.keys(this.stageImpls).forEach(t=>{const e=parseInt(t,10);this.destroyStageByIndex(e)})}preload(t,e=!1){if(this.stageImpls[t]||this.stageStates[t])return Promise.resolve();const n=new UR(t,this.taskId);return n.on("task-error",(t,e)=>{this.errorChannel.emit("error",t,e)}),this.stageStates[t]={state:"load",task:n},this.createCtx(t),this.loadStageJson(t),this.loadSpriteSheets(t),this.createStage(t),this.preRenderStage(t),this.createGraphicsTexture(t),this.renderStage(t),this.microTaskManager.addTask(n),e?n.applyAll():new Promise(e=>{n.once("task-finish",()=>{this.stageStates[t].state="finish";Object.keys(this.stageStates).length>2*this.cacheCount+1&&this.destroyStage(),e()})})}getStageJson(t){return this.stageJsons[t]||null}getStage(t){return WR(this,void 0,void 0,(function*(){this.currentStageIndex=t;const e=this.stageStates[t];return"finish"===(null==e?void 0:e.state)&&this.stageImpls[t]?this.stageImpls[t]:"load"===(null==e?void 0:e.state)?(yield e.task.applyAll(),this.stageImpls[t]):(yield this.preload(t,!0),this.stageImpls[t])}))}}var qR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};l.config({storeName:"slide_local_cache"});class YR{constructor(){this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,l.ready(()=>{this.isIndexDBReady=!0}).catch(()=>{KE.warn("local storage not ready",this.taskId)})}get couldUseIndexDBCache(){return this.isIndexDBReady&&this.taskId.length>0}attachTaskId(t){this.taskId=t}getItem(t){return qR(this,void 0,void 0,(function*(){let e=null;return this.couldUseIndexDBCache&&(e=yield uM(()=>l.getItem(`${this.taskId}/${t}`),500)),e=e===lM?null:e,e||this.memoryCache.get(t)||null}))}setItem(t,e,n=!1){return qR(this,void 0,void 0,(function*(){if(!this.couldUseIndexDBCache)return n&&this.memoryCache.set(t,e),Promise.resolve();(yield uM(()=>l.setItem(`${this.taskId}/${t}`,e).catch(()=>{n&&this.memoryCache.set(t,e)}),500))===lM&&n&&this.memoryCache.set(t,e)}))}dispose(){this.memoryCache=new Map,this.couldUseIndexDBCache&&l.keys().then(t=>{t.filter(t=>t.indexOf(this.taskId)>=0).forEach(t=>{l.removeItem(t).catch(()=>{})})})}}var ZR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};r.skipHello();const JR={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip"},KR={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",interactiveSeqStateChange:"interactiveSeqStateChange",interactiveSeqAction:"interactiveSeqAction",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",userInput:"userInput"};class $R extends a.a{constructor(t,e,n={}){super(),this.errorChannel=new a.a,this.transactionPlayer=new sg,this.transactionSprite=new LT,this.isForward=!0,this.drawCall=0,this.scale=1,this.prevSlideBase64=null,this.localStorage=new YR,this.fps=new qE,this.designWidth=0,this.designHeight=0,this.currentIndex=0,this.slideCount=0,this.runtime={drawCall:0,fps:0},this.onWebGLLost=()=>{this.errorChannel.emit("error",new YE(WE.CanvasCrash,"webgl context lost."))},this.mode=t;let i=Math.max(window.devicePixelRatio,2);VR.isDesktop()||(i=1),this.config={minFPS:Object(u.isUndefined)(n.minFPS)?30:n.minFPS,maxFPS:Object(u.isUndefined)(n.maxFPS)?40:n.maxFPS,resolution:Object(u.isUndefined)(n.resolution)?i:n.resolution,autoFPS:!Object(u.isUndefined)(n.autoFPS)&&n.autoFPS,autoResolution:!Object(u.isUndefined)(n.autoResolution)&&n.autoResolution,transactionBgColor:Object(u.isUndefined)(n.transactionBgColor)?0:n.transactionBgColor},this.loader=new tM(this.localStorage,e),this.app=new Nb({antialias:!0,autoDensity:!1,backgroundColor:16777215}),this.updateConfig(this.config),this.app.view.style.zIndex="1",this.app.stage.sortableChildren=!0;const r=this.app.renderer,{drawElements:o}=r.gl;r.gl.drawElements=(...t)=>{o.call(r.gl,...t),this.drawCall+=1},this.fps.on("update",t=>{if(t<this.config.minFPS){if(this.config.autoResolution){const t=.7*this.scale,e=this.app.renderer.resolution,n=Math.max(t,e-.1);n>=t&&this.updateResolution(n)}if(this.config.autoFPS){const t=14,{minFPS:e,maxFPS:n}=this.app.ticker,i=Math.max(t,e-2),r=Math.max(t,n-2);i>=t&&r>=t&&(this.app.ticker.minFPS=i,this.app.ticker.maxFPS=r)}}else if(t>this.config.maxFPS){if(this.config.autoResolution){const t=this.scale*this.config.resolution,e=this.app.renderer.resolution,n=Math.min(t,e+.1);n<=this.config.resolution&&this.updateResolution(n)}if(this.config.autoFPS){const t=this.config.minFPS,e=this.config.maxFPS,{minFPS:n,maxFPS:i}=this.app.ticker,r=Math.min(t,n+2),o=Math.min(e,i+2);r<=t&&o<=e&&(this.app.ticker.minFPS=r,this.app.ticker.maxFPS=o)}}}),this.app.ticker.add(()=>{this.runtime.drawCall=this.drawCall,this.runtime.fps=Math.floor(this.app.ticker.minFPS),this.drawCall=0},null,ny.LOW),this.clock=new cM(this.app.ticker),this.objPoolGroup=aM(),this.stagePool=new XR(this.loader,this.mode,this.app.renderer,this.app.ticker,this.app.view,this.clock,this.objPoolGroup,this.errorChannel,this.localStorage),this.app.view.addEventListener("webglcontextlost",this.onWebGLLost)}get view(){return this.app.renderer?this.app.view:null}get nextSlideIndex(){var t;return(null===(t=this.currentStage)||void 0===t?void 0:t.json.nextIndex)?this.currentStage.json.nextIndex:this.currentIndex+1}get prevSlideIndex(){var t;return(null===(t=this.currentStage)||void 0===t?void 0:t.json.prevIndex)?this.currentStage.json.prevIndex:this.currentIndex-1}updateConfig(t){Object(u.isUndefined)(t.minFPS)||(this.config.minFPS=t.minFPS,this.app.ticker.minFPS=t.minFPS),Object(u.isUndefined)(t.maxFPS)||(this.config.maxFPS=t.maxFPS,this.app.ticker.maxFPS=t.maxFPS),Object(u.isUndefined)(t.resolution)||(this.config.resolution=t.resolution,this.updateResolution(this.scale*this.config.resolution)),Object(u.isUndefined)(t.autoFPS)||(this.config.autoFPS=t.autoFPS),Object(u.isUndefined)(t.autoResolution)||(this.config.autoResolution=t.autoResolution),Object(u.isUndefined)(t.transactionBgColor)||(this.config.transactionBgColor=t.transactionBgColor),this.taskId&&KE.info("ppt player update config: "+JSON.stringify(this.config),this.taskId)}preload(t){return ZR(this,void 0,void 0,(function*(){t<1||t>this.slideCount||(KE.info(`preload slide ${t} begin`,this.taskId),yield this.stagePool.preload(t),KE.info(`preload slide ${t} end`,this.taskId))}))}setResourceData(t,e){KE.info("ppt player init config: "+JSON.stringify(this.config),t),KE.info("set resource to "+e,t),this.taskId=t,this.url=e,this.stagePool.setResourceData(t,e),this.localStorage.attachTaskId(t),this.loader.attachTaskId(t)}setInteractive(t){this.app.stage.interactive=t,this.app.stage.interactiveChildren=t}translateEvent(t,e){e.forEach(e=>{t.on(e,(...t)=>{this.emit(e,...t)})})}renderSlide(t,e=!1){var n;return ZR(this,void 0,void 0,(function*(){KE.info("render slide "+t,this.taskId),this.emit(KR.renderStart,t);const i=yield this.stagePool.getStage(t);this.translateEvent(i.ctx.eventHub,[KR.mainSeqStepChange,KR.mainSeqStateChange,KR.hyperlinkTrigger,KR.interactiveSeqAction,KR.mainSeqStepStart,KR.mainSeqStepEnd,KR.animateStart,KR.animateEnd,KR.mediaPlay,KR.mediaPause,KR.mediaSeek,KR.requestGotoSlide,KR.requestNextSlide,KR.requestPrevSlide,KR.interactiveSeqStateChange,KR.userInput]),this.currentIndex=Number(t);const{width:r,height:o,slideCount:s}=i.json;this.slideCount=s,this.designWidth=r,this.designHeight=o,i.json.transition&&i.json.transition.type&&!this.prevSlideBase64&&this.currentStage&&(this.prevSlideBase64=this.getBase64(this.currentStage)),null===(n=this.currentStage)||void 0===n||n.clearOnSlideChange();const a=this.currentStage;this.currentStage=i,i.initOnReuse(),i.createTiming(),i.container.visible=!0,i.collectMainSeqStartValue(),this.isForward?i.setMainSeqStep(0,"start"):i.setMainSeqStep(-1,"end");let l=null;if(i.json.transition&&i.json.transition.type){const n=t.toString()+(this.isForward||e?"-start":"-end"),i=yield this.localStorage.getItem("snapshot-"+n);l=i||this.getBase64(this.currentStage)}i.container.visible=!1,this.app.stage.addChild(i.container);let{transition:u}=i.json;!this.isForward&&(null==a?void 0:a.json.transition)&&(u=a.json.transition),this.prevSlideBase64&&l&&u&&u.type&&a&&i&&(yield this.playTransaction(this.prevSlideBase64,l,u,a,i),this.prevSlideBase64=null),this.isForward?yield i.startTiming():i.setMainSeqApplied(),this.updateResolution(this.config.resolution*this.scale),i.container.visible=!0,a&&(a.setMainSeqStep(0,"start"),a.clearOnTransactionEnd(),this.app.stage.removeChild(a.container)),i.ctx.slideScopeEventHub.emit("slide-render",i.ctx.slideIndex),this.emit(KR.renderEnd,t),this.emit(KR.slideChange,t),this.preload(t+1).catch(e=>{this.errorChannel.emit("error",YE.transform(e),t+1)}),this.preload(t-1).catch(e=>{this.errorChannel.emit("error",YE.transform(e),t-1)})}))}getBase64(t){if(!t.container.transform)return null;const e=zy.create({width:this.designWidth,height:this.designHeight,resolution:1});this.app.renderer.render(t.container,{renderTexture:e});const n=this.app.renderer.plugins.extract.base64(e,"image/jpeg");return e.destroy(!0),n}playTransaction(t,e,n,i,r){return ZR(this,void 0,void 0,(function*(){const o=this.app.view.parentElement;if(t&&e&&o&&JR[n.type]&&this.transactionPlayer){this.transactionSprite.zIndex=999,this.transactionSprite.visible=!1,this.app.stage.addChild(this.transactionSprite);const o=this.transactionPlayer.renderer.domElement,s=Gy.from(o),a=()=>s.update();return this.app.ticker.add(a),this.transactionSprite.texture=s,setTimeout(()=>{this.transactionSprite.visible=!0},100),new Promise(o=>{var s,l,u,h;null===(s=this.transactionPlayer)||void 0===s||s.play({reverse:!this.isForward,prevTextureUrl:t,nextTextureUrl:e,textureWidth:this.designWidth,textureHeight:this.designHeight,presetType:JR[n.type],stageWidth:this.designWidth,stageHeight:this.designHeight,duration:null===(u=null===(l=this.currentStage)||void 0===l?void 0:l.json.transition)||void 0===u?void 0:u.dur,delay:0,clearColor:this.config.transactionBgColor,maxFPS:Math.ceil(null!==(h=this.config.maxFPS)&&void 0!==h?h:60),onTransactionEnd:()=>{var t,e;o(),i.container.visible=!1,r.container.visible=!0,null===(t=this.app.stage)||void 0===t||t.removeChild(this.transactionSprite),null===(e=this.app.ticker)||void 0===e||e.remove(a)}})})}return Promise.resolve()}))}scaleView(t,e=!1){if(this.view&&(this.view.style.width=Math.floor(this.designWidth*t)+"px",this.view.style.height=Math.floor(this.designHeight*t)+"px"),e){this.scale=t;const e=this.scale*this.config.resolution;this.updateResolution(e)}}updateResolution(t){this.app.ticker.addOnce(()=>{let e=VR.isDesktop()?t:1;for(;e*this.designWidth>5120||e*this.designHeight>5120;)e-=.1;this.app.renderer.resolution=e,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.designWidth,this.designHeight)})}nextStep(){var t;KE.info("ppt play trigger next step",this.taskId);try{null===(t=this.currentStage)||void 0===t||t.nextStep()}catch(t){this.errorChannel.emit("error",YE.transform(t),this.currentIndex)}}prevStep(){var t;KE.info("ppt play trigger prev step",this.taskId);try{null===(t=this.currentStage)||void 0===t||t.prevStep()}catch(t){this.errorChannel.emit("error",YE.transform(t),this.currentIndex)}}mainSeqLength(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqLength())&&void 0!==e?e:0}mainSeqStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqStep())&&void 0!==e?e:0}setMainSeqStep(t,e){var n;null===(n=this.currentStage)||void 0===n||n.setMainSeqStep(t,e)}mainSeqState(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqState())&&void 0!==e?e:null}mainSeqHasNextStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqHasNextStep())&&void 0!==e&&e}mainSeqHasPrevStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqHasPrevStep())&&void 0!==e&&e}nextTick(t){this.app.ticker.addOnce(()=>{t()},ny.LOW)}applyInteractiveAction(t){var e;null===(e=this.currentStage)||void 0===e||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;null===(e=this.currentStage)||void 0===e||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,n){var i;null===(i=this.currentStage)||void 0===i||i.setInteractiveSeqState(t,e,n)}setMediaState(t,e){var n;return ZR(this,void 0,void 0,(function*(){yield null===(n=this.currentStage)||void 0===n?void 0:n.setMediaState(t,e)}))}setMediaCurrentTime(t,e){var n;null===(n=this.currentStage)||void 0===n||n.setMediaCurrentTime(t,e)}pause(){this.app.ticker.stop()}resume(){this.app.ticker.start()}getSnapshot(){return this.currentStage&&this.getBase64(this.currentStage)||""}createSnapshotForNextSlide(t){return ZR(this,void 0,void 0,(function*(){const e=this.nextSlideIndex,n=this.stagePool.getStageJson(e);if(n&&n.transition&&n.transition.type&&this.currentStage&&this.transactionPlayer){const e=t?`snapshot-${this.currentStage.json.index}-start`:`snapshot-${this.currentStage.json.index}-end`;if(this.currentStage.timing&&(t?this.currentStage.timing.mainSeqHasPrevStep():this.currentStage.timing.mainSeqHasNextStep()))this.prevSlideBase64=this.getBase64(this.currentStage);else{const t=yield this.localStorage.getItem(e);t?this.prevSlideBase64=t:(this.prevSlideBase64=this.getBase64(this.currentStage),this.localStorage.setItem(e,this.prevSlideBase64,!0).catch(()=>{}))}}}))}clearLocalCache(){this.localStorage.dispose()}static clearLocalCache(){l.clear()}destroy(){var t;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost);try{this.app.renderer.filter.texturePool.clear(!0)}catch(t){}yM.collectObjectByGroup(this.objPoolGroup),xM.collectObjectByGroup(this.objPoolGroup),null===(t=this.transactionPlayer)||void 0===t||t.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage();try{this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext()}catch(t){}this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0})}catch(t){}}}$R.platform=VR,$R.RtcAudioClazz=null;var QR,tC=[],eC="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(QR||(QR={}));var nC,iC=function(t){return Object.freeze(t)},rC=function(t,e){this.inlineSize=t,this.blockSize=e,iC(this)},oC=function(){function t(t,e,n,i){return this.x=t,this.y=e,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,iC(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),sC=function(t){return t instanceof SVGElement&&"getBBox"in t},aC=function(t){if(sC(t)){var e=t.getBBox(),n=e.width,i=e.height;return!n&&!i}var r=t,o=r.offsetWidth,s=r.offsetHeight;return!(o||s||t.getClientRects().length)},lC=function(t){var e,n;if(t instanceof Element)return!0;var i=null===(n=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(i&&t instanceof i.Element)},uC="undefined"!=typeof window?window:{},hC=new WeakMap,cC=/auto|scroll/,dC=/^tb|vertical/,pC=/msie|trident/i.test(uC.navigator&&uC.navigator.userAgent),fC=function(t){return parseFloat(t||"0")},mC=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new rC((n?e:t)||0,(n?t:e)||0)},gC=iC({devicePixelContentBoxSize:mC(),borderBoxSize:mC(),contentBoxSize:mC(),contentRect:new oC(0,0,0,0)}),vC=function(t,e){if(void 0===e&&(e=!1),hC.has(t)&&!e)return hC.get(t);if(aC(t))return hC.set(t,gC),gC;var n=getComputedStyle(t),i=sC(t)&&t.ownerSVGElement&&t.getBBox(),r=!pC&&"border-box"===n.boxSizing,o=dC.test(n.writingMode||""),s=!i&&cC.test(n.overflowY||""),a=!i&&cC.test(n.overflowX||""),l=i?0:fC(n.paddingTop),u=i?0:fC(n.paddingRight),h=i?0:fC(n.paddingBottom),c=i?0:fC(n.paddingLeft),d=i?0:fC(n.borderTopWidth),p=i?0:fC(n.borderRightWidth),f=i?0:fC(n.borderBottomWidth),m=c+u,g=l+h,v=(i?0:fC(n.borderLeftWidth))+p,_=d+f,y=a?t.offsetHeight-_-t.clientHeight:0,x=s?t.offsetWidth-v-t.clientWidth:0,b=r?m+v:0,w=r?g+_:0,T=i?i.width:fC(n.width)-b-x,S=i?i.height:fC(n.height)-w-y,E=T+m+x+v,M=S+g+y+_,A=iC({devicePixelContentBoxSize:mC(Math.round(T*devicePixelRatio),Math.round(S*devicePixelRatio),o),borderBoxSize:mC(E,M,o),contentBoxSize:mC(T,S,o),contentRect:new oC(c,l,T,S)});return hC.set(t,A),A},_C=function(t,e,n){var i=vC(t,n),r=i.borderBoxSize,o=i.contentBoxSize,s=i.devicePixelContentBoxSize;switch(e){case QR.DEVICE_PIXEL_CONTENT_BOX:return s;case QR.BORDER_BOX:return r;default:return o}},yC=function(t){var e=vC(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=iC([e.borderBoxSize]),this.contentBoxSize=iC([e.contentBoxSize]),this.devicePixelContentBoxSize=iC([e.devicePixelContentBoxSize])},xC=function(t){if(aC(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},bC=function(){var t=1/0,e=[];tC.forEach((function(n){if(0!==n.activeTargets.length){var i=[];n.activeTargets.forEach((function(e){var n=new yC(e.target),r=xC(e.target);i.push(n),e.lastReportedSize=_C(e.target,e.observedBox),r<t&&(t=r)})),e.push((function(){n.callback.call(n.observer,i,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,i=e;n<i.length;n++){(0,i[n])()}return t},wC=function(t){tC.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(n){n.isActive()&&(xC(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))}))}))},TC=function(){var t,e=0;for(wC(e);tC.some((function(t){return t.activeTargets.length>0}));)e=bC(),wC(e);return tC.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:eC}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=eC),window.dispatchEvent(t)),e>0},SC=[],EC=function(t){if(!nC){var e=0,n=document.createTextNode("");new MutationObserver((function(){return SC.splice(0).forEach((function(t){return t()}))})).observe(n,{characterData:!0}),nC=function(){n.textContent=""+(e?e--:e++)}}SC.push(t),nC()},MC=0,AC={attributes:!0,characterData:!0,childList:!0,subtree:!0},RC=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],CC=function(t){return void 0===t&&(t=0),Date.now()+t},PC=!1,IC=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!PC){PC=!0;var n,i=CC(t);n=function(){var n=!1;try{n=TC()}finally{if(PC=!1,t=i-CC(),!MC)return;n?e.run(1e3):t>0?e.run(t):e.start()}},EC((function(){requestAnimationFrame(n)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,AC)};document.body?e():uC.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),RC.forEach((function(e){return uC.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),RC.forEach((function(e){return uC.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),OC=function(t){!MC&&t>0&&IC.start(),!(MC+=t)&&IC.stop()},LC=function(){function t(t,e){this.target=t,this.observedBox=e||QR.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=_C(this.target,this.observedBox,!0);return t=this.target,sC(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),NC=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},DC=new WeakMap,FC=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},BC=function(){function t(){}return t.connect=function(t,e){var n=new NC(t,e);DC.set(t,n)},t.observe=function(t,e,n){var i=DC.get(t),r=0===i.observationTargets.length;FC(i.observationTargets,e)<0&&(r&&tC.push(i),i.observationTargets.push(new LC(e,n&&n.box)),OC(1),IC.schedule())},t.unobserve=function(t,e){var n=DC.get(t),i=FC(n.observationTargets,e),r=1===n.observationTargets.length;i>=0&&(r&&tC.splice(tC.indexOf(n),1),n.observationTargets.splice(i,1),OC(-1))},t.disconnect=function(t){var e=this,n=DC.get(t);n.observationTargets.slice().forEach((function(n){return e.unobserve(t,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},t}(),UC=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");BC.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!lC(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");BC.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!lC(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");BC.unobserve(this,t)},t.prototype.disconnect=function(){BC.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}(),kC=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))},GC=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},HC=function(){function t(t,e,n,i,r){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=n,this.index=t,this.slideIndex=e,this.eventHub=i,this.id=r}return t.prototype.apply=function(){return kC(this,void 0,void 0,(function(){var t;return GC(this,(function(e){switch(e.label){case 0:this.eventHub.emit("task-start",this),e.label=1;case 1:return e.trys.push([1,3,,4]),this.state="start",[4,this.fn()];case 2:return e.sent(),this.state="end",this.eventHub.emit("task-end",this),[3,4];case 3:return t=e.sent(),this.eventHub.emit("task-error",{task:this,error:t}),[3,4];case 4:return[2]}}))}))},t}(),zC=function(){function t(){var t=this;this.eventHub=new a.a,this.tasks=[],this.index=0,this.eventHub.on("task-end",(function(e){var n,i=t.tasks.findIndex((function(t){return t.index===e.index})),r=i+1;r>=0&&(null===(n=t.tasks[r])||void 0===n||n.apply()),i>=0&&(t.tasks.splice(i,1),t.replaceIdleTask()),t.eventHub.emit("task-end-"+e.id)})),this.eventHub.on("task-error",(function(e){var n=e.task,i=t.tasks.findIndex((function(t){return t.index===n.index}));i>=0&&(t.tasks.splice(i,1),t.replaceIdleTask())}))}return t.prototype.replaceIdleTask=function(){for(var t,e=this,n=new Set,i=0,r=this.tasks.length;i<r;i++)"idle"===this.tasks[i].state&&"idle"===(null===(t=this.tasks[i+1])||void 0===t?void 0:t.state)&&n.add(i);Array.from(n).forEach((function(t){e.tasks.splice(t,1)}))},t.prototype.addTask=function(t,e,n){var i=new HC(this.index++,e,t,this.eventHub,n);this.tasks.push(i),this.tasks.sort((function(t,e){return t.index-e.index})),this.replaceIdleTask(),1===this.tasks.length&&i.apply()},t.prototype.hasStartTask=function(){return this.tasks.some((function(t){return"start"===t.state}))},t}();function jC(t,e){var n=t.__state.conversionName.toString(),i=Math.round(t.r),r=Math.round(t.g),o=Math.round(t.b),s=t.a,a=Math.round(t.h),l=t.s.toFixed(1),u=t.v.toFixed(1);if(e||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var h=t.hex.toString(16);h.length<6;)h="0"+h;return"#"+h}return"CSS_RGB"===n?"rgb("+i+","+r+","+o+")":"CSS_RGBA"===n?"rgba("+i+","+r+","+o+","+s+")":"HEX"===n?"0x"+t.hex.toString(16):"RGB_ARRAY"===n?"["+i+","+r+","+o+"]":"RGBA_ARRAY"===n?"["+i+","+r+","+o+","+s+"]":"RGB_OBJ"===n?"{r:"+i+",g:"+r+",b:"+o+"}":"RGBA_OBJ"===n?"{r:"+i+",g:"+r+",b:"+o+",a:"+s+"}":"HSV_OBJ"===n?"{h:"+a+",s:"+l+",v:"+u+"}":"HSVA_OBJ"===n?"{h:"+a+",s:"+l+",v:"+u+",a:"+s+"}":"unknown format"}var VC=Array.prototype.forEach,WC=Array.prototype.slice,XC={BREAK:{},extend:function(t){return this.each(WC.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(n){this.isUndefined(e[n])||(t[n]=e[n])}.bind(this))}),this),t},defaults:function(t){return this.each(WC.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(n){this.isUndefined(t[n])&&(t[n]=e[n])}.bind(this))}),this),t},compose:function(){var t=WC.call(arguments);return function(){for(var e=WC.call(arguments),n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},each:function(t,e,n){if(t)if(VC&&t.forEach&&t.forEach===VC)t.forEach(e,n);else if(t.length===t.length+0){var i,r=void 0;for(r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===this.BREAK)return}else for(var o in t)if(e.call(n,t[o],o)===this.BREAK)return},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i=void 0;return function(){var r=this,o=arguments;function s(){i=null,n||t.apply(r,o)}var a=n||!i;clearTimeout(i),i=setTimeout(s,e),a&&t.apply(r,o)}},toArray:function(t){return t.toArray?t.toArray():WC.call(t)},isUndefined:function(t){return void 0===t},isNull:function(t){return null===t},isNaN:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return isNaN(t)})),isArray:Array.isArray||function(t){return t.constructor===Array},isObject:function(t){return t===Object(t)},isNumber:function(t){return t===t+0},isString:function(t){return t===t+""},isBoolean:function(t){return!1===t||!0===t},isFunction:function(t){return t instanceof Function}},qC=[{litmus:XC.isString,conversions:{THREE_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:jC},SIX_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9]{6})$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:jC},CSS_RGB:{read:function(t){var e=t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:jC},CSS_RGBA:{read:function(t){var e=t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:jC}}},{litmus:XC.isNumber,conversions:{HEX:{read:function(t){return{space:"HEX",hex:t,conversionName:"HEX"}},write:function(t){return t.hex}}}},{litmus:XC.isArray,conversions:{RGB_ARRAY:{read:function(t){return 3===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2]}},write:function(t){return[t.r,t.g,t.b]}},RGBA_ARRAY:{read:function(t){return 4===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2],a:t[3]}},write:function(t){return[t.r,t.g,t.b,t.a]}}}},{litmus:XC.isObject,conversions:{RGBA_OBJ:{read:function(t){return!!(XC.isNumber(t.r)&&XC.isNumber(t.g)&&XC.isNumber(t.b)&&XC.isNumber(t.a))&&{space:"RGB",r:t.r,g:t.g,b:t.b,a:t.a}},write:function(t){return{r:t.r,g:t.g,b:t.b,a:t.a}}},RGB_OBJ:{read:function(t){return!!(XC.isNumber(t.r)&&XC.isNumber(t.g)&&XC.isNumber(t.b))&&{space:"RGB",r:t.r,g:t.g,b:t.b}},write:function(t){return{r:t.r,g:t.g,b:t.b}}},HSVA_OBJ:{read:function(t){return!!(XC.isNumber(t.h)&&XC.isNumber(t.s)&&XC.isNumber(t.v)&&XC.isNumber(t.a))&&{space:"HSV",h:t.h,s:t.s,v:t.v,a:t.a}},write:function(t){return{h:t.h,s:t.s,v:t.v,a:t.a}}},HSV_OBJ:{read:function(t){return!!(XC.isNumber(t.h)&&XC.isNumber(t.s)&&XC.isNumber(t.v))&&{space:"HSV",h:t.h,s:t.s,v:t.v}},write:function(t){return{h:t.h,s:t.s,v:t.v}}}}}],YC=void 0,ZC=void 0,JC=function(){ZC=!1;var t=arguments.length>1?XC.toArray(arguments):arguments[0];return XC.each(qC,(function(e){if(e.litmus(t))return XC.each(e.conversions,(function(e,n){if(YC=e.read(t),!1===ZC&&!1!==YC)return ZC=YC,YC.conversionName=n,YC.conversion=e,XC.BREAK})),XC.BREAK})),ZC},KC=void 0,$C={hsv_to_rgb:function(t,e,n){var i=Math.floor(t/60)%6,r=t/60-Math.floor(t/60),o=n*(1-e),s=n*(1-r*e),a=n*(1-(1-r)*e),l=[[n,a,o],[s,n,o],[o,n,a],[o,s,n],[a,o,n],[n,o,s]][i];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(t,e,n){var i=Math.min(t,e,n),r=Math.max(t,e,n),o=r-i,s=void 0;return 0===r?{h:NaN,s:0,v:0}:(s=t===r?(e-n)/o:e===r?2+(n-t)/o:4+(t-e)/o,(s/=6)<0&&(s+=1),{h:360*s,s:o/r,v:r/255})},rgb_to_hex:function(t,e,n){var i=this.hex_with_component(0,2,t);return i=this.hex_with_component(i,1,e),i=this.hex_with_component(i,0,n)},component_from_hex:function(t,e){return t>>8*e&255},hex_with_component:function(t,e,n){return n<<(KC=8*e)|t&~(255<<KC)}},QC="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},tP=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},eP=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),nP=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},iP=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},rP=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},oP=function(){function t(){if(tP(this,t),this.__state=JC.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return eP(t,[{key:"toString",value:function(){return jC(this)}},{key:"toHexString",value:function(){return jC(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),t}();function sP(t,e,n){Object.defineProperty(t,e,{get:function(){return"RGB"===this.__state.space||oP.recalculateRGB(this,e,n),this.__state[e]},set:function(t){"RGB"!==this.__state.space&&(oP.recalculateRGB(this,e,n),this.__state.space="RGB"),this.__state[e]=t}})}function aP(t,e){Object.defineProperty(t,e,{get:function(){return"HSV"===this.__state.space||oP.recalculateHSV(this),this.__state[e]},set:function(t){"HSV"!==this.__state.space&&(oP.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}oP.recalculateRGB=function(t,e,n){if("HEX"===t.__state.space)t.__state[e]=$C.component_from_hex(t.__state.hex,n);else{if("HSV"!==t.__state.space)throw new Error("Corrupted color state");XC.extend(t.__state,$C.hsv_to_rgb(t.__state.h,t.__state.s,t.__state.v))}},oP.recalculateHSV=function(t){var e=$C.rgb_to_hsv(t.r,t.g,t.b);XC.extend(t.__state,{s:e.s,v:e.v}),XC.isNaN(e.h)?XC.isUndefined(t.__state.h)&&(t.__state.h=0):t.__state.h=e.h},oP.COMPONENTS=["r","g","b","h","s","v","hex","a"],sP(oP.prototype,"r",2),sP(oP.prototype,"g",1),sP(oP.prototype,"b",0),aP(oP.prototype,"h"),aP(oP.prototype,"s"),aP(oP.prototype,"v"),Object.defineProperty(oP.prototype,"a",{get:function(){return this.__state.a},set:function(t){this.__state.a=t}}),Object.defineProperty(oP.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=$C.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(t){this.__state.space="HEX",this.__state.hex=t}});var lP=function(){function t(e,n){tP(this,t),this.initialValue=e[n],this.domElement=document.createElement("div"),this.object=e,this.property=n,this.__onChange=void 0,this.__onFinishChange=void 0}return eP(t,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),t}(),uP={};XC.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(t,e){XC.each(t,(function(t){uP[t]=e}))}));var hP=/(\d+(\.\d+)?)px/;function cP(t){if("0"===t||XC.isUndefined(t))return 0;var e=t.match(hP);return XC.isNull(e)?0:parseFloat(e[1])}var dP={makeSelectable:function(t,e){void 0!==t&&void 0!==t.style&&(t.onselectstart=e?function(){return!1}:function(){},t.style.MozUserSelect=e?"auto":"none",t.style.KhtmlUserSelect=e?"auto":"none",t.unselectable=e?"on":"off")},makeFullscreen:function(t,e,n){var i=n,r=e;XC.isUndefined(r)&&(r=!0),XC.isUndefined(i)&&(i=!0),t.style.position="absolute",r&&(t.style.left=0,t.style.right=0),i&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,e,n,i){var r=n||{},o=uP[e];if(!o)throw new Error("Event type "+e+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=r.x||r.clientX||0,l=r.y||r.clientY||0;s.initMouseEvent(e,r.bubbles||!1,r.cancelable||!0,window,r.clickCount||1,0,0,a,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var u=s.initKeyboardEvent||s.initKeyEvent;XC.defaults(r,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),u(e,r.bubbles||!1,r.cancelable,window,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode);break;default:s.initEvent(e,r.bubbles||!1,r.cancelable||!0)}XC.defaults(s,i),t.dispatchEvent(s)},bind:function(t,e,n,i){var r=i||!1;return t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on"+e,n),dP},unbind:function(t,e,n,i){var r=i||!1;return t.removeEventListener?t.removeEventListener(e,n,r):t.detachEvent&&t.detachEvent("on"+e,n),dP},addClass:function(t,e){if(void 0===t.className)t.className=e;else if(t.className!==e){var n=t.className.split(/ +/);-1===n.indexOf(e)&&(n.push(e),t.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return dP},removeClass:function(t,e){if(e)if(t.className===e)t.removeAttribute("class");else{var n=t.className.split(/ +/),i=n.indexOf(e);-1!==i&&(n.splice(i,1),t.className=n.join(" "))}else t.className=void 0;return dP},hasClass:function(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1},getWidth:function(t){var e=getComputedStyle(t);return cP(e["border-left-width"])+cP(e["border-right-width"])+cP(e["padding-left"])+cP(e["padding-right"])+cP(e.width)},getHeight:function(t){var e=getComputedStyle(t);return cP(e["border-top-width"])+cP(e["border-bottom-width"])+cP(e["padding-top"])+cP(e["padding-bottom"])+cP(e.height)},getOffset:function(t){var e=t,n={left:0,top:0};if(e.offsetParent)do{n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent}while(e);return n},isActive:function(t){return t===document.activeElement&&(t.type||t.href)}},pP=function(t){function e(t,n){tP(this,e);var i=rP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),r=i;return i.__prev=i.getValue(),i.__checkbox=document.createElement("input"),i.__checkbox.setAttribute("type","checkbox"),dP.bind(i.__checkbox,"change",(function(){r.setValue(!r.__prev)}),!1),i.domElement.appendChild(i.__checkbox),i.updateDisplay(),i}return iP(e,t),eP(e,[{key:"setValue",value:function(t){var n=nP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),nP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(lP),fP=function(t){function e(t,n,i){tP(this,e);var r=rP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i,s=r;if(r.__select=document.createElement("select"),XC.isArray(o)){var a={};XC.each(o,(function(t){a[t]=t})),o=a}return XC.each(o,(function(t,e){var n=document.createElement("option");n.innerHTML=e,n.setAttribute("value",t),s.__select.appendChild(n)})),r.updateDisplay(),dP.bind(r.__select,"change",(function(){var t=this.options[this.selectedIndex].value;s.setValue(t)})),r.domElement.appendChild(r.__select),r}return iP(e,t),eP(e,[{key:"setValue",value:function(t){var n=nP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return dP.isActive(this.__select)?this:(this.__select.value=this.getValue(),nP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e}(lP),mP=function(t){function e(t,n){tP(this,e);var i=rP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),r=i;function o(){r.setValue(r.__input.value)}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),dP.bind(i.__input,"keyup",o),dP.bind(i.__input,"change",o),dP.bind(i.__input,"blur",(function(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())})),dP.bind(i.__input,"keydown",(function(t){13===t.keyCode&&this.blur()})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return iP(e,t),eP(e,[{key:"updateDisplay",value:function(){return dP.isActive(this.__input)||(this.__input.value=this.getValue()),nP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(lP);function gP(t){var e=t.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var vP=function(t){function e(t,n,i){tP(this,e);var r=rP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i||{};return r.__min=o.min,r.__max=o.max,r.__step=o.step,XC.isUndefined(r.__step)?0===r.initialValue?r.__impliedStep=1:r.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(r.initialValue))/Math.LN10))/10:r.__impliedStep=r.__step,r.__precision=gP(r.__impliedStep),r}return iP(e,t),eP(e,[{key:"setValue",value:function(t){var n=t;return void 0!==this.__min&&n<this.__min?n=this.__min:void 0!==this.__max&&n>this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),nP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(t){return this.__min=t,this}},{key:"max",value:function(t){return this.__max=t,this}},{key:"step",value:function(t){return this.__step=t,this.__impliedStep=t,this.__precision=gP(t),this}}]),e}(lP);var _P=function(t){function e(t,n,i){tP(this,e);var r=rP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));r.__truncationSuspended=!1;var o=r,s=void 0;function a(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function l(t){var e=s-t.clientY;o.setValue(o.getValue()+e*o.__impliedStep),s=t.clientY}function u(){dP.unbind(window,"mousemove",l),dP.unbind(window,"mouseup",u),a()}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),dP.bind(r.__input,"change",(function(){var t=parseFloat(o.__input.value);XC.isNaN(t)||o.setValue(t)})),dP.bind(r.__input,"blur",(function(){a()})),dP.bind(r.__input,"mousedown",(function(t){dP.bind(window,"mousemove",l),dP.bind(window,"mouseup",u),s=t.clientY})),dP.bind(r.__input,"keydown",(function(t){13===t.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,a())})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return iP(e,t),eP(e,[{key:"updateDisplay",value:function(){var t,n,i;return this.__input.value=this.__truncationSuspended?this.getValue():(t=this.getValue(),n=this.__precision,i=Math.pow(10,n),Math.round(t*i)/i),nP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(vP);function yP(t,e,n,i,r){return i+(t-e)/(n-e)*(r-i)}var xP=function(t){function e(t,n,i,r,o){tP(this,e);var s=rP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,{min:i,max:r,step:o})),a=s;function l(t){t.preventDefault();var e=a.__background.getBoundingClientRect();return a.setValue(yP(t.clientX,e.left,e.right,a.__min,a.__max)),!1}function u(){dP.unbind(window,"mousemove",l),dP.unbind(window,"mouseup",u),a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}function h(t){var e=t.touches[0].clientX,n=a.__background.getBoundingClientRect();a.setValue(yP(e,n.left,n.right,a.__min,a.__max))}function c(){dP.unbind(window,"touchmove",h),dP.unbind(window,"touchend",c),a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}return s.__background=document.createElement("div"),s.__foreground=document.createElement("div"),dP.bind(s.__background,"mousedown",(function(t){document.activeElement.blur(),dP.bind(window,"mousemove",l),dP.bind(window,"mouseup",u),l(t)})),dP.bind(s.__background,"touchstart",(function(t){if(1!==t.touches.length)return;dP.bind(window,"touchmove",h),dP.bind(window,"touchend",c),h(t)})),dP.addClass(s.__background,"slider"),dP.addClass(s.__foreground,"slider-fg"),s.updateDisplay(),s.__background.appendChild(s.__foreground),s.domElement.appendChild(s.__background),s}return iP(e,t),eP(e,[{key:"updateDisplay",value:function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",nP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(vP),bP=function(t){function e(t,n,i){tP(this,e);var r=rP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=r;return r.__button=document.createElement("div"),r.__button.innerHTML=void 0===i?"Fire":i,dP.bind(r.__button,"click",(function(t){return t.preventDefault(),o.fire(),!1})),dP.addClass(r.__button,"button"),r.domElement.appendChild(r.__button),r}return iP(e,t),eP(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e}(lP),wP=function(t){function e(t,n){tP(this,e);var i=rP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));i.__color=new oP(i.getValue()),i.__temp=new oP(0);var r=i;i.domElement=document.createElement("div"),dP.makeSelectable(i.domElement,!1),i.__selector=document.createElement("div"),i.__selector.className="selector",i.__saturation_field=document.createElement("div"),i.__saturation_field.className="saturation-field",i.__field_knob=document.createElement("div"),i.__field_knob.className="field-knob",i.__field_knob_border="2px solid ",i.__hue_knob=document.createElement("div"),i.__hue_knob.className="hue-knob",i.__hue_field=document.createElement("div"),i.__hue_field.className="hue-field",i.__input=document.createElement("input"),i.__input.type="text",i.__input_textShadow="0 1px 1px ",dP.bind(i.__input,"keydown",(function(t){13===t.keyCode&&c.call(this)})),dP.bind(i.__input,"blur",c),dP.bind(i.__selector,"mousedown",(function(){dP.addClass(this,"drag").bind(window,"mouseup",(function(){dP.removeClass(r.__selector,"drag")}))})),dP.bind(i.__selector,"touchstart",(function(){dP.addClass(this,"drag").bind(window,"touchend",(function(){dP.removeClass(r.__selector,"drag")}))}));var o,s=document.createElement("div");function a(t){p(t),dP.bind(window,"mousemove",p),dP.bind(window,"touchmove",p),dP.bind(window,"mouseup",u),dP.bind(window,"touchend",u)}function l(t){f(t),dP.bind(window,"mousemove",f),dP.bind(window,"touchmove",f),dP.bind(window,"mouseup",h),dP.bind(window,"touchend",h)}function u(){dP.unbind(window,"mousemove",p),dP.unbind(window,"touchmove",p),dP.unbind(window,"mouseup",u),dP.unbind(window,"touchend",u),d()}function h(){dP.unbind(window,"mousemove",f),dP.unbind(window,"touchmove",f),dP.unbind(window,"mouseup",h),dP.unbind(window,"touchend",h),d()}function c(){var t=JC(this.value);!1!==t?(r.__color.__state=t,r.setValue(r.__color.toOriginal())):this.value=r.__color.toString()}function d(){r.__onFinishChange&&r.__onFinishChange.call(r,r.__color.toOriginal())}function p(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=r.__saturation_field.getBoundingClientRect(),n=t.touches&&t.touches[0]||t,i=n.clientX,o=n.clientY,s=(i-e.left)/(e.right-e.left),a=1-(o-e.top)/(e.bottom-e.top);return a>1?a=1:a<0&&(a=0),s>1?s=1:s<0&&(s=0),r.__color.v=a,r.__color.s=s,r.setValue(r.__color.toOriginal()),!1}function f(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=r.__hue_field.getBoundingClientRect(),n=1-((t.touches&&t.touches[0]||t).clientY-e.top)/(e.bottom-e.top);return n>1?n=1:n<0&&(n=0),r.__color.h=360*n,r.setValue(r.__color.toOriginal()),!1}return XC.extend(i.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),XC.extend(i.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:i.__field_knob_border+(i.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),XC.extend(i.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),XC.extend(i.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),XC.extend(s.style,{width:"100%",height:"100%",background:"none"}),SP(s,"top","rgba(0,0,0,0)","#000"),XC.extend(i.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=i.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",XC.extend(i.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:i.__input_textShadow+"rgba(0,0,0,0.7)"}),dP.bind(i.__saturation_field,"mousedown",a),dP.bind(i.__saturation_field,"touchstart",a),dP.bind(i.__field_knob,"mousedown",a),dP.bind(i.__field_knob,"touchstart",a),dP.bind(i.__hue_field,"mousedown",l),dP.bind(i.__hue_field,"touchstart",l),i.__saturation_field.appendChild(s),i.__selector.appendChild(i.__field_knob),i.__selector.appendChild(i.__saturation_field),i.__selector.appendChild(i.__hue_field),i.__hue_field.appendChild(i.__hue_knob),i.domElement.appendChild(i.__input),i.domElement.appendChild(i.__selector),i.updateDisplay(),i}return iP(e,t),eP(e,[{key:"updateDisplay",value:function(){var t=JC(this.getValue());if(!1!==t){var e=!1;XC.each(oP.COMPONENTS,(function(n){if(!XC.isUndefined(t[n])&&!XC.isUndefined(this.__color.__state[n])&&t[n]!==this.__color.__state[n])return e=!0,{}}),this),e&&XC.extend(this.__color.__state,t)}XC.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,i=255-n;XC.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,SP(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),XC.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+i+","+i+","+i+",.7)"})}}]),e}(lP),TP=["-moz-","-o-","-webkit-","-ms-",""];function SP(t,e,n,i){t.style.background="",XC.each(TP,(function(r){t.style.cssText+="background: "+r+"linear-gradient("+e+", "+n+" 0%, "+i+" 100%); "}))}var EP=function(t,e){var n=e||document,i=document.createElement("style");i.type="text/css",i.innerHTML=t;var r=n.getElementsByTagName("head")[0];try{r.appendChild(i)}catch(t){}},MP='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',AP=function(t,e){var n=t[e];return XC.isArray(arguments[2])||XC.isObject(arguments[2])?new fP(t,e,arguments[2]):XC.isNumber(n)?XC.isNumber(arguments[2])&&XC.isNumber(arguments[3])?XC.isNumber(arguments[4])?new xP(t,e,arguments[2],arguments[3],arguments[4]):new xP(t,e,arguments[2],arguments[3]):XC.isNumber(arguments[4])?new _P(t,e,{min:arguments[2],max:arguments[3],step:arguments[4]}):new _P(t,e,{min:arguments[2],max:arguments[3]}):XC.isString(n)?new mP(t,e):XC.isFunction(n)?new bP(t,e,""):XC.isBoolean(n)?new pP(t,e):null};var RP=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)},CP=function(){function t(){tP(this,t),this.backgroundElement=document.createElement("div"),XC.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),dP.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),XC.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;dP.bind(this.backgroundElement,"click",(function(){e.hide()}))}return eP(t,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),XC.defer((function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",dP.unbind(t.domElement,"webkitTransitionEnd",e),dP.unbind(t.domElement,"transitionend",e),dP.unbind(t.domElement,"oTransitionEnd",e)};dP.bind(this.domElement,"webkitTransitionEnd",e),dP.bind(this.domElement,"transitionend",e),dP.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-dP.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-dP.getHeight(this.domElement)/2+"px"}}]),t}();EP(function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=t,document.head.appendChild(e),t}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var PP=function(){try{return!!window.localStorage}catch(t){return!1}}(),IP=void 0,OP=!0,LP=void 0,NP=!1,DP=[],FP=function t(e){var n=this,i=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),dP.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],i=XC.defaults(i,{closeOnTop:!1,autoPlace:!0,width:t.DEFAULT_WIDTH}),i=XC.defaults(i,{resizable:i.autoPlace,hideable:i.autoPlace}),XC.isUndefined(i.load)?i.load={preset:"Default"}:i.preset&&(i.load.preset=i.preset),XC.isUndefined(i.parent)&&i.hideable&&DP.push(this),i.resizable=XC.isUndefined(i.parent)&&i.resizable,i.autoPlace&&XC.isUndefined(i.scrollable)&&(i.scrollable=!0);var r,o=PP&&"true"===localStorage.getItem(zP(this,"isLocal")),s=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return i.parent}},scrollable:{get:function(){return i.scrollable}},autoPlace:{get:function(){return i.autoPlace}},closeOnTop:{get:function(){return i.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:i.load.preset},set:function(t){n.parent?n.getRoot().preset=t:i.load.preset=t,function(t){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].value===t.preset&&(t.__preset_select.selectedIndex=e)}(this),n.revert()}},width:{get:function(){return i.width},set:function(t){i.width=t,qP(n,t)}},name:{get:function(){return i.name},set:function(t){i.name=t,a&&(a.innerHTML=i.name)}},closed:{get:function(){return i.closed},set:function(e){i.closed=e,i.closed?dP.addClass(n.__ul,t.CLASS_CLOSED):dP.removeClass(n.__ul,t.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=e?t.TEXT_OPEN:t.TEXT_CLOSED)}},load:{get:function(){return i.load}},useLocalStorage:{get:function(){return o},set:function(t){PP&&(o=t,t?dP.bind(window,"unload",s):dP.unbind(window,"unload",s),localStorage.setItem(zP(n,"isLocal"),t))}}}),XC.isUndefined(i.parent)){if(this.closed=i.closed||!1,dP.addClass(this.domElement,t.CLASS_MAIN),dP.makeSelectable(this.domElement,!1),PP&&o){n.useLocalStorage=!0;var l=localStorage.getItem(zP(this,"gui"));l&&(i.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=t.TEXT_CLOSED,dP.addClass(this.__closeButton,t.CLASS_CLOSE_BUTTON),i.closeOnTop?(dP.addClass(this.__closeButton,t.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(dP.addClass(this.__closeButton,t.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),dP.bind(this.__closeButton,"click",(function(){n.closed=!n.closed}))}else{void 0===i.closed&&(i.closed=!0);var u=document.createTextNode(i.name);dP.addClass(u,"controller-name"),a=BP(n,u);dP.addClass(this.__ul,t.CLASS_CLOSED),dP.addClass(a,"title"),dP.bind(a,"click",(function(t){return t.preventDefault(),n.closed=!n.closed,!1})),i.closed||(this.closed=!1)}i.autoPlace&&(XC.isUndefined(i.parent)&&(OP&&(LP=document.createElement("div"),dP.addClass(LP,"dg"),dP.addClass(LP,t.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(LP),OP=!1),LP.appendChild(this.domElement),dP.addClass(this.domElement,t.CLASS_AUTO_PLACE)),this.parent||qP(n,i.width)),this.__resizeHandler=function(){n.onResizeDebounced()},dP.bind(window,"resize",this.__resizeHandler),dP.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),dP.bind(this.__ul,"transitionend",this.__resizeHandler),dP.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),i.resizable&&XP(this),s=function(){PP&&"true"===localStorage.getItem(zP(n,"isLocal"))&&localStorage.setItem(zP(n,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=s,i.parent||((r=n.getRoot()).width+=1,XC.defer((function(){r.width-=1})))};function BP(t,e,n){var i=document.createElement("li");return e&&i.appendChild(e),n?t.__ul.insertBefore(i,n):t.__ul.appendChild(i),t.onResize(),i}function UP(t){dP.unbind(window,"resize",t.__resizeHandler),t.saveToLocalStorageIfPossible&&dP.unbind(window,"unload",t.saveToLocalStorageIfPossible)}function kP(t,e){var n=t.__preset_select[t.__preset_select.selectedIndex];n.innerHTML=e?n.value+"*":n.value}function GP(t,e){var n=t.getRoot(),i=n.__rememberedObjects.indexOf(e.object);if(-1!==i){var r=n.__rememberedObjectIndecesToControllers[i];if(void 0===r&&(r={},n.__rememberedObjectIndecesToControllers[i]=r),r[e.property]=e,n.load&&n.load.remembered){var o=n.load.remembered,s=void 0;if(o[t.preset])s=o[t.preset];else{if(!o.Default)return;s=o.Default}if(s[i]&&void 0!==s[i][e.property]){var a=s[i][e.property];e.initialValue=a,e.setValue(a)}}}}function HP(t,e,n,i){if(void 0===e[n])throw new Error('Object "'+e+'" has no property "'+n+'"');var r=void 0;if(i.color)r=new wP(e,n);else{var o=[e,n].concat(i.factoryArgs);r=AP.apply(t,o)}i.before instanceof lP&&(i.before=i.before.__li),GP(t,r),dP.addClass(r.domElement,"c");var s=document.createElement("span");dP.addClass(s,"property-name"),s.innerHTML=r.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(r.domElement);var l=BP(t,a,i.before);return dP.addClass(l,FP.CLASS_CONTROLLER_ROW),r instanceof wP?dP.addClass(l,"color"):dP.addClass(l,QC(r.getValue())),function(t,e,n){if(n.__li=e,n.__gui=t,XC.extend(n,{options:function(e){if(arguments.length>1){var i=n.__li.nextElementSibling;return n.remove(),HP(t,n.object,n.property,{before:i,factoryArgs:[XC.toArray(arguments)]})}if(XC.isArray(e)||XC.isObject(e)){var r=n.__li.nextElementSibling;return n.remove(),HP(t,n.object,n.property,{before:r,factoryArgs:[e]})}},name:function(t){return n.__li.firstElementChild.firstElementChild.innerHTML=t,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof xP){var i=new _P(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});XC.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(t){var e=n[t],r=i[t];n[t]=i[t]=function(){var t=Array.prototype.slice.call(arguments);return r.apply(i,t),e.apply(n,t)}})),dP.addClass(e,"has-slider"),n.domElement.insertBefore(i.domElement,n.domElement.firstElementChild)}else if(n instanceof _P){var r=function(e){if(XC.isNumber(n.__min)&&XC.isNumber(n.__max)){var i=n.__li.firstElementChild.firstElementChild.innerHTML,r=n.__gui.__listening.indexOf(n)>-1;n.remove();var o=HP(t,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return o.name(i),r&&o.listen(),o}return e};n.min=XC.compose(r,n.min),n.max=XC.compose(r,n.max)}else n instanceof pP?(dP.bind(e,"click",(function(){dP.fakeEvent(n.__checkbox,"click")})),dP.bind(n.__checkbox,"click",(function(t){t.stopPropagation()}))):n instanceof bP?(dP.bind(e,"click",(function(){dP.fakeEvent(n.__button,"click")})),dP.bind(e,"mouseover",(function(){dP.addClass(n.__button,"hover")})),dP.bind(e,"mouseout",(function(){dP.removeClass(n.__button,"hover")}))):n instanceof wP&&(dP.addClass(e,"color"),n.updateDisplay=XC.compose((function(t){return e.style.borderLeftColor=n.__color.toString(),t}),n.updateDisplay),n.updateDisplay());n.setValue=XC.compose((function(e){return t.getRoot().__preset_select&&n.isModified()&&kP(t.getRoot(),!0),e}),n.setValue)}(t,l,r),t.__controllers.push(r),r}function zP(t,e){return document.location.href+"."+e}function jP(t,e,n){var i=document.createElement("option");i.innerHTML=e,i.value=e,t.__preset_select.appendChild(i),n&&(t.__preset_select.selectedIndex=t.__preset_select.length-1)}function VP(t,e){e.style.display=t.useLocalStorage?"block":"none"}function WP(t){var e=t.__save_row=document.createElement("li");dP.addClass(t.domElement,"has-save"),t.__ul.insertBefore(e,t.__ul.firstChild),dP.addClass(e,"save-row");var n=document.createElement("span");n.innerHTML="&nbsp;",dP.addClass(n,"button gears");var i=document.createElement("span");i.innerHTML="Save",dP.addClass(i,"button"),dP.addClass(i,"save");var r=document.createElement("span");r.innerHTML="New",dP.addClass(r,"button"),dP.addClass(r,"save-as");var o=document.createElement("span");o.innerHTML="Revert",dP.addClass(o,"button"),dP.addClass(o,"revert");var s=t.__preset_select=document.createElement("select");if(t.load&&t.load.remembered?XC.each(t.load.remembered,(function(e,n){jP(t,n,n===t.preset)})):jP(t,"Default",!1),dP.bind(s,"change",(function(){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].innerHTML=t.__preset_select[e].value;t.preset=this.value})),e.appendChild(s),e.appendChild(n),e.appendChild(i),e.appendChild(r),e.appendChild(o),PP){var a=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(zP(0,"isLocal"))&&l.setAttribute("checked","checked"),VP(t,a),dP.bind(l,"change",(function(){t.useLocalStorage=!t.useLocalStorage,VP(t,a)}))}var u=document.getElementById("dg-new-constructor");dP.bind(u,"keydown",(function(t){!t.metaKey||67!==t.which&&67!==t.keyCode||IP.hide()})),dP.bind(n,"click",(function(){u.innerHTML=JSON.stringify(t.getSaveObject(),void 0,2),IP.show(),u.focus(),u.select()})),dP.bind(i,"click",(function(){t.save()})),dP.bind(r,"click",(function(){var e=prompt("Enter a new preset name.");e&&t.saveAs(e)})),dP.bind(o,"click",(function(){t.revert()}))}function XP(t){var e=void 0;function n(n){return n.preventDefault(),t.width+=e-n.clientX,t.onResize(),e=n.clientX,!1}function i(){dP.removeClass(t.__closeButton,FP.CLASS_DRAG),dP.unbind(window,"mousemove",n),dP.unbind(window,"mouseup",i)}function r(r){return r.preventDefault(),e=r.clientX,dP.addClass(t.__closeButton,FP.CLASS_DRAG),dP.bind(window,"mousemove",n),dP.bind(window,"mouseup",i),!1}t.__resize_handle=document.createElement("div"),XC.extend(t.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),dP.bind(t.__resize_handle,"mousedown",r),dP.bind(t.__closeButton,"mousedown",r),t.domElement.insertBefore(t.__resize_handle,t.domElement.firstElementChild)}function qP(t,e){t.domElement.style.width=e+"px",t.__save_row&&t.autoPlace&&(t.__save_row.style.width=e+"px"),t.__closeButton&&(t.__closeButton.style.width=e+"px")}function YP(t,e){var n={};return XC.each(t.__rememberedObjects,(function(i,r){var o={},s=t.__rememberedObjectIndecesToControllers[r];XC.each(s,(function(t,n){o[n]=e?t.initialValue:t.getValue()})),n[r]=o})),n}FP.toggleHide=function(){NP=!NP,XC.each(DP,(function(t){t.domElement.style.display=NP?"none":""}))},FP.CLASS_AUTO_PLACE="a",FP.CLASS_AUTO_PLACE_CONTAINER="ac",FP.CLASS_MAIN="main",FP.CLASS_CONTROLLER_ROW="cr",FP.CLASS_TOO_TALL="taller-than-window",FP.CLASS_CLOSED="closed",FP.CLASS_CLOSE_BUTTON="close-button",FP.CLASS_CLOSE_TOP="close-top",FP.CLASS_CLOSE_BOTTOM="close-bottom",FP.CLASS_DRAG="drag",FP.DEFAULT_WIDTH=245,FP.TEXT_CLOSED="Close Controls",FP.TEXT_OPEN="Open Controls",FP._keydownHandler=function(t){"text"===document.activeElement.type||72!==t.which&&72!==t.keyCode||FP.toggleHide()},dP.bind(window,"keydown",FP._keydownHandler,!1),XC.extend(FP.prototype,{add:function(t,e){return HP(this,t,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(t,e){return HP(this,t,e,{color:!0})},remove:function(t){this.__ul.removeChild(t.__li),this.__controllers.splice(this.__controllers.indexOf(t),1);var e=this;XC.defer((function(){e.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&LP.removeChild(this.domElement);var t=this;XC.each(this.__folders,(function(e){t.removeFolder(e)})),dP.unbind(window,"keydown",FP._keydownHandler,!1),UP(this)},addFolder:function(t){if(void 0!==this.__folders[t])throw new Error('You already have a folder in this GUI by the name "'+t+'"');var e={name:t,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[t]&&(e.closed=this.load.folders[t].closed,e.load=this.load.folders[t]);var n=new FP(e);this.__folders[t]=n;var i=BP(this,n.domElement);return dP.addClass(i,"folder"),n},removeFolder:function(t){this.__ul.removeChild(t.domElement.parentElement),delete this.__folders[t.name],this.load&&this.load.folders&&this.load.folders[t.name]&&delete this.load.folders[t.name],UP(t);var e=this;XC.each(t.__folders,(function(e){t.removeFolder(e)})),XC.defer((function(){e.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var t=this.getRoot();if(t.scrollable){var e=dP.getOffset(t.__ul).top,n=0;XC.each(t.__ul.childNodes,(function(e){t.autoPlace&&e===t.__save_row||(n+=dP.getHeight(e))})),window.innerHeight-e-20<n?(dP.addClass(t.domElement,FP.CLASS_TOO_TALL),t.__ul.style.height=window.innerHeight-e-20+"px"):(dP.removeClass(t.domElement,FP.CLASS_TOO_TALL),t.__ul.style.height="auto")}t.__resize_handle&&XC.defer((function(){t.__resize_handle.style.height=t.__ul.offsetHeight+"px"})),t.__closeButton&&(t.__closeButton.style.width=t.width+"px")},onResizeDebounced:XC.debounce((function(){this.onResize()}),50),remember:function(){if(XC.isUndefined(IP)&&((IP=new CP).domElement.innerHTML=MP),this.parent)throw new Error("You can only call remember on a top level GUI.");var t=this;XC.each(Array.prototype.slice.call(arguments),(function(e){0===t.__rememberedObjects.length&&WP(t),-1===t.__rememberedObjects.indexOf(e)&&t.__rememberedObjects.push(e)})),this.autoPlace&&qP(this,this.width)},getRoot:function(){for(var t=this;t.parent;)t=t.parent;return t},getSaveObject:function(){var t=this.load;return t.closed=this.closed,this.__rememberedObjects.length>0&&(t.preset=this.preset,t.remembered||(t.remembered={}),t.remembered[this.preset]=YP(this)),t.folders={},XC.each(this.__folders,(function(e,n){t.folders[n]=e.getSaveObject()})),t},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=YP(this),kP(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(t){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=YP(this,!0)),this.load.remembered[t]=YP(this),this.preset=t,jP(this,t,!0),this.saveToLocalStorageIfPossible()},revert:function(t){XC.each(this.__controllers,(function(e){this.getRoot().load.remembered?GP(t||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())}),this),XC.each(this.__folders,(function(t){t.revert(t)})),t||kP(this.getRoot(),!1)},listen:function(t){var e=0===this.__listening.length;this.__listening.push(t),e&&function t(e){0!==e.length&&RP.call(window,(function(){t(e)}));XC.each(e,(function(t){t.updateDisplay()}))}(this.__listening)},updateDisplay:function(){XC.each(this.__controllers,(function(t){t.updateDisplay()})),XC.each(this.__folders,(function(t){t.updateDisplay()}))}});var ZP=FP,JP=function(){function t(t){this.runTime={fps:0,resolution:""},this.target=t.target,this.data=t.params,this.player=t.player,this.gui=this.createControllerGUI(),this.createStats(),this.addEventListener()}return t.prototype.createStats=function(){var t=this;this.stateId=setInterval((function(){t.player.view&&(t.controller.runTimeFps.setValue(t.player.fps.value),t.controller.drawCall.setValue(t.player.runtime.drawCall),t.controller.runTimeResolution.setValue(t.player.view.width+"*"+t.player.view.height))}),500)},t.prototype.createControllerGUI=function(){var t,e,n,i,r,o=new ZP({autoPlace:!0,closed:!0});o.domElement.style.opacity=".6",o.domElement.style.transformOrigin="100% 0",o.domElement.style.transform="scale(1)",this.target.appendChild(o.domElement),o.domElement.style.position="absolute",o.domElement.style.right="0",o.domElement.style.top="0",o.domElement.style.zIndex="2";var s=o.add({FPS:0},"FPS",0),a=o.add({drawCall:0},"drawCall",0),l=o.add({"分辨率":""},"分辨率",""),u=o.add({"额外计算":0},"额外计算",0,200),h=o.addFolder("renderOptions");return this.controller={runTimeResolution:l,runTimeFps:s,drawCall:a,moreCalculation:u,minFPS:h.add({"最低fps":null!==(t=this.data.minFPS)&&void 0!==t?t:40},"最低fps",0,60),maxFPS:h.add({"最高fps":null!==(e=this.data.maxFPS)&&void 0!==e?e:50},"最高fps",0,60),resolution:h.add({"目标分辨倍率":null!==(n=this.data.resolution)&&void 0!==n?n:window.devicePixelRatio},"目标分辨倍率",.5,6),autoResolution:h.add({"自动分辨率":null!==(i=this.data.autoResolution)&&void 0!==i&&i},"自动分辨率",!0),autoFps:h.add({"自动fps":null===(r=this.data.autoFPS)||void 0===r||r},"自动fps",!0),transactionBgColor:h.addColor({"切页背景色":this.data.transactionBgColor},"切页背景色")},this.controller.runTimeFps.disabled=!0,this.controller.runTimeResolution.disabled=!0,o},t.prototype.addEventListener=function(){var t,e=this;this.controller.autoFps.onChange((function(t){e.data.autoFPS=t,e.player.updateConfig(e.data)})),this.controller.maxFPS.onChange((function(t){e.data.maxFPS=t,e.player.updateConfig(e.data)})),this.controller.minFPS.onChange((function(t){e.data.minFPS=t,e.player.updateConfig(e.data)})),this.controller.autoResolution.onChange((function(t){e.data.autoResolution=t,e.player.updateConfig(e.data)})),this.controller.resolution.onChange((function(t){e.data.resolution=t,e.player.updateConfig(e.data)})),this.controller.transactionBgColor.onChange((function(t){e.data.transactionBgColor=t,e.player.updateConfig(e.data)})),this.controller.moreCalculation.onChange((function(n){t&&e.player.app.ticker.remove(t),n>0&&(t=function(){for(var t="";t.length<8e3*n;)t+=Math.random().toString(32).substr(2);mM()(t)},e.player.app.ticker.add(t))}))},t.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.target.removeChild(this.gui.domElement),this.gui.destroy()}catch(t){}},t}(),KP=function(){function t(t){var e=this;this.tasks=[],this.schedule=function(){var t=e.tasks[0];t?e.fn(t).then((function(){e.tasks.splice(0,1),window.requestAnimationFrame(e.schedule)})):window.requestAnimationFrame(e.schedule)},this.fn=t,this.schedule()}return t.prototype.addTask=function(t){this.tasks.push(t)},t}(),$P=function(){function t(){this.autoUnlock=Object.create(null),this.locks=Object.create(null)}return t.prototype.addLock=function(t,e){var n=this;this.locks[t]=e,this.autoUnlock[t]=window.setTimeout((function(){delete n.locks[t]}),3e3)},t.prototype.unlock=function(t,e){e&&this.locks[t]&&this.locks[t]===e&&(window.clearTimeout(this.autoUnlock[t]),delete this.locks[t])},t.prototype.isLocked=function(t){return!!this.locks[t]},t}(),QP=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),tI=function(){return(tI=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eI=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))},nI=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};window.__slide_local_logger__||(window.__slide_local_logger__=o.createInstance({name:"_slide_local_log_",driver:o.INDEXEDDB,version:1}));var iI=window.ResizeObserver||UC,rI=function(t){return new Promise((function(e){return setTimeout(e,t)}))};function oI(t,e){return eI(this,void 0,void 0,(function(){var n;return nI(this,(function(i){switch(i.label){case 0:n=Date.now(),i.label=1;case 1:return!t()&&Date.now()-n<e?[4,rI(50)]:[3,3];case 2:return i.sent(),[3,1];case 3:return[2]}}))}))}var sI={syncDispatch:"syncDispatch",syncReceive:"syncReceive",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd",stateChange:"stateChange"},aI={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,mediaState:Object.create(null),interactiveSeqState:Object.create(null)},lI="";try{lI="0.3.5"}catch(t){lI="dev"}var uI=function(t){function e(e){var n=t.call(this)||this;return n.iosResetCache=[],n.needClearCacheImage=!1,n.version=lI,n.__slideState=Object(u.cloneDeep)(aI),n.userInputTime=0,n.isSyncingSlideState=!1,n.resize=!1,n.isAnimating=!1,n.renderingTaskManager=new zC,n.isLoading=!1,n.interactive=!0,n.frameWidth=1,n.frameHeight=1,n.frame=document.createElement("div"),n.medianController=document.createElement("div"),n.frameResizeObserver=new iI((function(){return n.frameResizeHandler()})),n.timestamp=function(){return Date.now()},n.mode="local",n.enableGlobalClick=!1,n.lastEmitedState=null,n.playerController=null,n.lock=new $P,n.isInitResized=!1,n.cacheImage=document.createElement("img"),n.isFrowning=!1,n.isReleasing=!1,n.isTouchStart=!1,n.touchStartId=void 0,n.taskId="",n.designWidth=0,n.designHeight=0,n._slideCount=0,n.userInputHandle=function(){n.userInputTime=Date.now()},n.handleViewClick=function(){setTimeout((function(){var t=Date.now();Math.abs(t-n.userInputTime)>500&&n.enableGlobalClick&&n.nextStep()}))},n.handleViewTouchStart=function(){window.clearTimeout(n.touchStartId),n.isTouchStart=!0,n.touchStartId=setTimeout((function(){n.isTouchStart=!1}),350)},n.handleViewTouchEnd=function(){n.isTouchStart&&(n.isTouchStart=!1,n.handleViewClick())},n.handleSlideRef=function(){console.log(n),window.__slide=n},n.receiveSyncHandler=function(t){return eI(n,void 0,void 0,(function(){var e,n,i,r,o=this;return nI(this,(function(s){switch(s.label){case 0:return KE.info("sync receive "+JSON.stringify(t),this.taskId),"nextStep"!==t.type?[3,1]:(this.mainSeqStep!==t.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(t.next,"start"),this.player.nextTick((function(){o.doNextStep()}))):this.doNextStep(),[3,6]);case 1:return"prevStep"!==t.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===t.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep():(this.setMainSeqStep(t.next+1,"start"),null===(e=this.player)||void 0===e||e.nextTick((function(){o.doPrevStep()}))),[3,6]);case 2:return"interactiveAnim"!==t.type?[3,3]:(this.player?this.player.applyInteractiveAction(t.action):this.__slideState.interactiveSeqState[t.seqId].step+=1,[3,6]);case 3:return"renderSlide"!==t.type?[3,5]:[4,this.doRenderSlide(t.index,t.isForward)];case 4:return s.sent(),[3,6];case 5:"mediaPlay"===t.type?(null===(n=this.player)||void 0===n||n.setMediaState(t.id,!0),this.__slideState.mediaState[t.id]=t.state):"mediaPause"===t.type?(null===(i=this.player)||void 0===i||i.setMediaState(t.id,!1),this.__slideState.mediaState[t.id]=t.state):"mediaSeek"===t.type&&(null===(r=this.player)||void 0===r||r.setMediaCurrentTime(t.id,t.time),this.__slideState.mediaState[t.id]=t.state),s.label=6;case 6:return[2]}}))}))},n.handlePrevSlide=function(){return eI(n,void 0,void 0,(function(){var t,e;return nI(this,(function(n){switch(n.label){case 0:return this.player?[4,null===(e=this.player)||void 0===e?void 0:e.createSnapshotForNextSlide(!0)]:[2];case 1:return n.sent(),(t=this.player.prevSlideIndex)>=1&&this.renderSlide(t,!1),[2]}}))}))},n.handleNextSlide=function(){return eI(n,void 0,void 0,(function(){var t,e;return nI(this,(function(n){switch(n.label){case 0:return this.player?[4,null===(e=this.player)||void 0===e?void 0:e.createSnapshotForNextSlide(!1)]:[2];case 1:return n.sent(),(t=this.player.nextSlideIndex)<=this.slideCount&&this.renderSlide(t,!0),[2]}}))}))},n.handleGotoSlide=function(t){if(t<=n.slideCount&&t>=1){var e=n.slideState.currentSlideIndex<=t;n.renderSlide(t,e)}else-1===t&&n.renderSlide(n.slideCount,!0)},e.timestamp&&(n.timestamp=e.timestamp),e.rtcAudio&&($R.RtcAudioClazz=e.rtcAudio),e.logger&&("function"==typeof e.logger.info&&JE.attach("info",e.logger.info),"function"==typeof e.logger.warn&&JE.attach("warn",e.logger.warn),"function"==typeof e.logger.error&&JE.attach("error",e.logger.error)),n.config=e,n.syncQueue=new KP(n.receiveSyncHandler),n.mode=e.mode,n.anchor=e.anchor,n.enableGlobalClick=!Object(u.isUndefined)(e.enableGlobalClick)&&e.enableGlobalClick,n.resize=e.resize||!1,n.interactive=e.interactive,n.cacheImage.style.position="absolute",n.cacheImage.style.zIndex="100",n.frame.style.cssText="width:100%;height:100%;display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;",n.setMedianControllerAttribute(),n.frame.appendChild(n.medianController),n.anchor.appendChild(n.frame),n.frameResizeObserver.observe(n.frame),n.on(sI.syncReceive,(function(t){n.lock.unlock(t.type,t.uuid),n.syncQueue.addTask(t)})),n.renderingTaskManager.eventHub.on("task-error",(function(t){var e=t.error,i=t.task,r=YE.transform(e);r.errorType===WE.RuntimeWarn?KE.warn(r.message,n.taskId):KE.error(r.message,n.taskId),n.emit(sI.renderError,{error:r,index:i.slideIndex})})),window.addEventListener("__slide_ref__",n.handleSlideRef),n.resizeView=Object(u.debounce)(n.resizeView.bind(n),50),n.player=n.initPlayer(e),(null==e?void 0:e.controller)&&n.createController(),n.player.view&&n.frame.appendChild(n.player.view),n.handleViewClick=Object(u.debounce)(n.handleViewClick,300),n.player.errorChannel.on("error",(function(t,e){var i=YE.transform(t);i.errorType===WE.RuntimeWarn?KE.warn(i.message,n.taskId):KE.error(i.message,n.taskId),n.isLoading=!1,n.emit(sI.renderError,{error:t,index:e})})),n}return QP(e,t),e.prototype.initPlayer=function(t){var e,n,i,r=this,o=new $R(this.mode,!!Object(u.isUndefined)(this.config.useLocalCache)||this.config.useLocalCache);return o.setInteractive(this.interactive),o.updateConfig(t.renderOptions||{}),o.on(KR.renderStart,(function(t){r.isLoading=!0,r.emit(sI.renderStart,t)})),o.on(KR.renderEnd,(function(t){r.isLoading=!1,r.player&&(r.designHeight=r.player.designHeight,r.designWidth=r.player.designWidth,r.cacheImage.style.width=r.player.designWidth+"px",r.cacheImage.style.height=r.player.designHeight+"px",r._slideCount=r.player.slideCount),r.emit(sI.renderEnd,t)})),o.on(KR.slideChange,(function(t){r.__slideState.currentSlideIndex=t,r.emit(sI.slideChange,t)})),o.on(KR.mainSeqStateChange,(function(t){r.__slideState.mainSeqState=t,r.emitStateChange()})),o.on(KR.mainSeqStepChange,(function(t){r.__slideState.mainSeqStep=t,r.emitStateChange()})),o.on(KR.interactiveSeqStateChange,(function(t){var e=t.id,n=t.state;r.__slideState.interactiveSeqState[e]=n,r.emitStateChange()})),o.on(KR.animateStart,(function(){!0!==r.isAnimating&&(r.isAnimating=!0,r.emit(sI.animateStart))})),o.on(KR.animateEnd,(function(){!1!==r.isAnimating&&(r.isAnimating=!1,r.emit(sI.animateEnd))})),o.on(KR.interactiveSeqAction,(function(t){var e=t.action,n=t.seqId;r.emitSyncDispatch({slideIndex:r.__slideState.currentSlideIndex,type:"interactiveAnim",action:e,seqId:n}),r.emitStateChange()})),o.on(KR.mainSeqStepStart,(function(t){r.emit(sI.mainSeqStepStart,t)})),o.on(KR.mainSeqStepEnd,(function(t){r.emit(sI.mainSeqStepEnd,t)})),o.on(KR.mediaPlay,(function(t){var e={type:"play",time:r.timestamp()-1e3*t.time};r.__slideState.mediaState[t.id]=e,r.emitSyncDispatch({slideIndex:r.__slideState.currentSlideIndex,type:"mediaPlay",id:t.id,state:e}),r.emitStateChange()})),o.on(KR.mediaPause,(function(t){var e={type:"pause",time:t.time};r.__slideState.mediaState[t.id]=e,r.emitSyncDispatch({slideIndex:r.__slideState.currentSlideIndex,type:"mediaPause",id:t.id,state:e}),r.emitStateChange()})),o.on(KR.mediaSeek,(function(t){var e={type:"pause",time:0};t.isPlaying?(e.type="play",r.__slideState.mediaState[t.id]?e.time=r.__slideState.mediaState[t.id].time-1e3*t.time:e.time=r.timestamp()-1e3*t.time,r.__slideState.mediaState[t.id]=e):(e.type="pause",e.time=t.time,r.__slideState.mediaState[t.id]=e),r.emitSyncDispatch({slideIndex:r.__slideState.currentSlideIndex,type:"mediaSeek",id:t.id,time:t.time,state:e}),r.emitStateChange()})),o.on(KR.requestPrevSlide,this.handlePrevSlide),o.on(KR.requestNextSlide,this.handleNextSlide),o.on(KR.requestGotoSlide,this.handleGotoSlide),null===(e=o.view)||void 0===e||e.addEventListener("touchend",this.handleViewTouchEnd),null===(n=o.view)||void 0===n||n.addEventListener("touchstart",this.handleViewTouchStart),null===(i=o.view)||void 0===i||i.addEventListener("click",this.handleViewClick),o.on(KR.userInput,this.userInputHandle),o},e.prototype.createController=function(){this.player&&(this.playerController=new JP({player:this.player,params:this.player.config||{},target:this.frame}))},e.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2"},e.prototype.frameResizeHandler=function(){var t=this.frame.getBoundingClientRect(),e=t.width,n=t.height;this.frameWidth=e,this.frameHeight=n,this.resizeView()},e.prototype.resizeView=function(){var t,e,n=this,i=this.width,r=this.height;if(i>0&&r>0){var o=this.frameWidth/i,s=o*r;s>this.frameHeight&&(o*=this.frameHeight/s),null===(t=this.player)||void 0===t||t.scaleView(o,this.resize),this.cacheImage.style.transform="scale("+o+")",this.medianController.style.transform="scale("+o+")",this.medianController.style.top=(this.frameHeight-r*o)/2+"px",this.medianController.setAttribute("data-scale",o.toString()),this.isInitResized||(this.isInitResized=!0,null===(e=this.player)||void 0===e||e.clock.setTimeout((function(){n.frame.style.visibility="visible"}),32))}},e.prototype.setSlideState=function(t){var e,n,i;return eI(this,void 0,void 0,(function(){var r,o=this;return nI(this,(function(s){switch(s.label){case 0:return this.isSyncingSlideState=!0,KE.info("stateChange receive "+JSON.stringify(t),this.taskId),t.taskId&&t.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=t.taskId,null===(e=this.player)||void 0===e||e.setResourceData(t.taskId,this.__slideState.url)),t.url&&t.url!==this.__slideState.url&&(this.__slideState.url=t.url,null===(n=this.player)||void 0===n||n.setResourceData(this.__slideState.taskId,t.url)),Number.isInteger(t.currentSlideIndex)&&t.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=t.currentSlideIndex,[4,this.doRenderSlide(t.currentSlideIndex)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[4,null===(i=this.player)||void 0===i?void 0:i.clock.waitUntil((function(){var e,n;return(null===(e=o.player)||void 0===e?void 0:e.currentIndex)===t.currentSlideIndex&&(null===(n=o.player)||void 0===n?void 0:n.currentStage)}),3e3)];case 3:return s.sent(),r=!1,Number.isInteger(t.mainSeqStep)&&t.mainSeqStep!==this.__slideState.mainSeqStep&&(r=!0,this.__slideState.mainSeqStep=t.mainSeqStep),t.mainSeqState&&t.mainSeqState!==this.__slideState.mainSeqState&&(r=!0,this.__slideState.mainSeqState=t.mainSeqState),r&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),t.mediaState&&(this.initMedia(t),this.__slideState.mediaState=t.mediaState),t.interactiveSeqState&&(this.initInteractiveSeq(t),this.__slideState.interactiveSeqState=t.interactiveSeqState),this.isSyncingSlideState=!1,[2]}}))}))},e.prototype.initInteractiveSeq=function(t){var e;for(var n in t.interactiveSeqState){var i=t.interactiveSeqState[n];null===(e=this.player)||void 0===e||e.setInteractiveSeqState(n,i.step,"end"===i.state?"end":"start")}},e.prototype.initMedia=function(t){var e,n,i=this,r=function(r){var s=t.mediaState[r],a=o.__slideState.mediaState[r];if(a&&s.type===a.type&&s.time===a.time)return"continue";"play"===s.type?null===(e=o.player)||void 0===e||e.setMediaState(r,!0).then((function(){var t,e=i.timestamp();null===(t=i.player)||void 0===t||t.setMediaCurrentTime(r,(e-s.time)/1e3)})):null===(n=o.player)||void 0===n||n.setMediaState(r,!1).then((function(){var t;null===(t=i.player)||void 0===t||t.setMediaCurrentTime(r,s.time)}))},o=this;for(var s in t.mediaState)r(s)},Object.defineProperty(e.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),e.prototype.getSlideCountAsync=function(){return eI(this,void 0,void 0,(function(){return nI(this,(function(t){switch(t.label){case 0:if(this._slideCount>0)return[2,this._slideCount];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,t.sent().json()];case 3:return[2,t.sent().slideCount];case 4:return t.sent(),[2,0];case 5:return[2]}}))}))},Object.defineProperty(e.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqLength",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqStep",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqState",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderOptions",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderFps",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runtimeFps",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),e.prototype.updateRenderOption=function(t){this.player&&(this.player.updateConfig(t),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},e.prototype.setResource=function(t,e){var n;this.taskId=t,null===(n=this.player)||void 0===n||n.setResourceData(t,e),this.__slideState.taskId=t,this.__slideState.url=e,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:t,url:e})},e.prototype._renderSlide=function(t){var e;return eI(this,void 0,void 0,(function(){var n=this;return nI(this,(function(i){switch(i.label){case 0:return this.player&&t===this.player.currentIndex?[2]:(($R.platform.isIOS()||$R.platform.isAndroid())&&this.iosResetCache.indexOf(t)<0&&this.iosResetCache.push(t),this.isLoading=!0,[4,null===(e=this.player)||void 0===e?void 0:e.renderSlide(t)]);case 1:return i.sent(),this.__slideState.currentSlideIndex=t,this.isLoading=!1,this.resizeView(),this.emitStateChange(),setTimeout((function(){var t,e;if("hidden"===(null===(e=null===(t=n.player)||void 0===t?void 0:t.view)||void 0===e?void 0:e.style.visibility)&&(n.player.view.style.visibility="visible"),"hidden"===n.frame.style.visibility&&(n.frame.style.visibility="visible"),n.needClearCacheImage)try{n.frame.removeChild(n.cacheImage)}catch(t){}}),100),[2]}}))}))},e.prototype.renderSlide=function(t,e){if(void 0===e&&(e=!0),this.player){var n=Number(t);(n!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(n>this.slideCount&&this.slideCount>0||this.poseRenderSlide(n,e))}},e.prototype.needCreateNewPlayer=function(){var t=$R.platform.isLowGpuMemory()?15:30;return($R.platform.isIOS()||$R.platform.isAndroid())&&this.iosResetCache.length>t},e.prototype.poseRenderSlide=function(t,e){this.isLoading=!0,"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:t,isForward:e}):"sync"===this.mode?(this.doRenderSlide(t,e),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:t,isForward:e})):this.doRenderSlide(t,e)},e.prototype.doRenderSlide=function(t,e){var n,i,r,o=this;if(void 0===e&&(e=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var s=this.player.getSnapshot();this.cacheImage.src=s,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(n=this.playerController)||void 0===n||n.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,(null===(i=this.config)||void 0===i?void 0:i.controller)&&this.createController(),this.needClearCacheImage=!0,(null===(r=null==this?void 0:this.player)||void 0===r?void 0:r.view)&&(this.player.view.style.visibility="hidden",this.frame.appendChild(this.player.view))}var a=Math.random().toString(32).substr(2);return this.player.isForward=e,this.renderingTaskManager.addTask((function(){return o._renderSlide(t)}),t,a),new Promise((function(t){o.renderingTaskManager.eventHub.once("task-end-"+a,t)}))},e.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive&&(this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep():this.handleNextSlide())},e.prototype.doNextStep=function(){if(this.player){this.player.nextStep();var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},e.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive&&(this.player.mainSeqHasPrevStep()?"interactive"===this.mode?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):"sync"===this.mode?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide())},e.prototype.doPrevStep=function(){if(this.player){this.player.prevStep();var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},e.prototype.isSlideStateReady=function(t){return t.taskId.length>0&&t.url.length>0&&t.currentSlideIndex>0},e.prototype.emitStateChange=function(){if("local"!==this.mode&&!this.isSyncingSlideState){var t=this.slideState;!Object(u.isEqual)(this.lastEmitedState,t)&&this.isSlideStateReady(t)&&(this.lastEmitedState=t,this.emit(sI.stateChange,t),KE.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},e.prototype.emitSyncDispatch=function(t){if(!this.lock.isLocked(t.type)){var e=Math.random().toString(32).substr(2);this.lock.addLock(t.type,e),this.emit(sI.syncDispatch,tI(tI({},t),{uuid:e})),KE.info("sync dispatch "+JSON.stringify(t),this.taskId)}},e.prototype.setMainSeqStep=function(t,e){var n;null===(n=this.player)||void 0===n||n.setMainSeqStep(t,e)},e.prototype.setInteractive=function(t){var e;this.interactive=t,null===(e=this.player)||void 0===e||e.setInteractive(t)},e.prototype.pause=function(){var t;null===(t=this.player)||void 0===t||t.pause()},e.prototype.resume=function(){var t;null===(t=this.player)||void 0===t||t.resume()},e.prototype.frozen=function(){var t;return eI(this,void 0,void 0,(function(){var e,n,i,r=this;return nI(this,(function(o){switch(o.label){case 0:return this.isFrowning?[2,oI((function(){return!r.isFrowning}),6e4)]:this.view&&this.player?(this.isFrowning=!0,[4,this.player.clock.waitUntil((function(){return!r.isLoading}),6e4)]):[3,2];case 1:for(n in o.sent(),e=this.player.getSnapshot()||"",this.cacheImage.src=e,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(t=this.playerController)||void 0===t||t.destroy(),this.player=void 0,this.__slideState.mediaState)i=this.__slideState.mediaState[n],this.__slideState.mediaState[n]=tI(tI({},i),{frozenTime:this.timestamp()});this.isFrowning=!1,o.label=2;case 2:return[2]}}))}))},e.prototype.release=function(){var t,e;return eI(this,void 0,void 0,(function(){var n,i,r,o,s=this;return nI(this,(function(a){switch(a.label){case 0:if(this.player)return[2];if(this.isReleasing)return[2,oI((function(){return!s.isReleasing}),6e4)];for(i in this.isReleasing=!0,this.player=this.initPlayer(this.config),(null===(t=this.config)||void 0===t?void 0:t.controller)&&this.createController(),this.player.view&&(this.frame.appendChild(this.player.view),this.player.view.style.visibility="hidden"),n=this.__slideState,this.__slideState=Object(u.cloneDeep)(aI),n.mediaState)"play"===(r=n.mediaState[i]).type&&(o=Math.max(null!==(e=r.frozenTime)&&void 0!==e?e:0,r.time),r.time=this.timestamp()-(o-r.time),r.frozenTime=void 0);return[4,this.setSlideState(n)];case 1:return a.sent(),[4,this.player.clock.delay(333)];case 2:a.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch(t){}return this.isReleasing=!1,[2]}}))}))},e.prototype._doDestroy=function(){var t,e,n,i;this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),null===(t=this.player)||void 0===t||t.removeAllListeners(),null===(e=this.player)||void 0===e||e.destroy(),null===(n=this.player)||void 0===n||n.removeAllListeners(),window.removeEventListener("__slide_ref__",this.handleSlideRef);try{(null===(i=this.player)||void 0===i?void 0:i.view)&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch(t){}},e.prototype.waitLoadEnd=function(){return eI(this,void 0,void 0,(function(){var t;return nI(this,(function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return this.isLoading&&t<10?[4,rI(100)]:[3,3];case 2:return e.sent(),t+=1,[3,1];case 3:return[2]}}))}))},e.prototype.destroy=function(){var t=this;this.isLoading?this.waitLoadEnd().then((function(){t._doDestroy()})):this._doDestroy()},e.prototype.clearSlideCache=function(){var t;null===(t=this.player)||void 0===t||t.clearLocalCache()},e.clearLocalCache=function(){$R.clearLocalCache()},e.disposeLocalCache=function(){},e}(a.a)}]);
250
+ */_b.registerPlugin("accessibility",iy),_b.registerPlugin("extract",Bb),_b.registerPlugin("interaction",fy),_b.registerPlugin("particle",$w),_b.registerPlugin("prepare",rS),_b.registerPlugin("batch",Rb),_b.registerPlugin("tilingSprite",dS),Qb.registerPlugin(DS),Qb.registerPlugin(dw),Qb.registerPlugin(Pw),Qb.registerPlugin(Xw),Qb.registerPlugin(sS),Nb.registerPlugin(sy),Nb.registerPlugin(tw);var WE,XE={AlphaFilter:BS,BlurFilter:lE,BlurFilterPass:aE,ColorMatrixFilter:hE,DisplacementFilter:dE,FXAAFilter:fE,NoiseFilter:DE};class qE extends a.a{constructor(){super(),this.prevTime=-1,this.times=0,this.valueTotal=0,this.destroyed=!1,this.value=0,this.calcFps()}calcFps(){requestAnimationFrame(t=>{const e=t-this.prevTime;this.valueTotal+=e,this.times+=1,this.times>20&&(this.value=Math.floor(1e3*this.times/this.valueTotal),this.valueTotal=0,this.times=0,this.destroyed||this.emit("update",this.value)),this.prevTime=t,this.destroyed||this.calcFps()})}destroy(){this.destroyed=!0}}!function(t){t.ResourceError="RESOURCE_ERROR",t.RuntimeError="RUNTIME_ERROR",t.RuntimeWarn="RUNTIME_WARN",t.CanvasCrash="CANVAS_CRASH"}(WE||(WE={}));class YE extends Error{constructor(t,e){var n,i;super(e),n=this,i=new.target.prototype,Object.setPrototypeOf?Object.setPrototypeOf(n,i):n.__proto__&&(n.__proto__=i),this.errorType=t,this.errorMsg=e}static transform(t){return t instanceof YE?t:new YE(WE.RuntimeError,t.message)}}function ZE(){return function(t,e,n){const i=n.value;n.value=function(...t){try{return i.apply(this,t)}catch(t){throw new YE(WE.RuntimeWarn,t.message)}}}}var JE=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};function KE(t){return JE(this,void 0,void 0,(function*(){const e=yield fetch(t);if(!e.ok)throw new YE(WE.ResourceError,`"${e.url}" loaded failed with status "${e.status}"`);return e}))}class $E{constructor(t,e,n){this.useCache=!1,this.taskId="",this.useCache=e,this.localStorage=t,this.logger=n}attachTaskId(t){this.taskId=t}fetchJson(t){return JE(this,void 0,void 0,(function*(){let e;return this.useCache&&(this.logger.info("load resource from cache. "+t,this.taskId||""),e=yield this.localStorage.getItem(t)),e?(this.logger.info("cache hit. "+t,this.taskId||""),e):(this.logger.info("load resource from server. "+t,this.taskId||""),e=yield(yield KE(""+t)).json(),this.logger.info("load end. "+t,this.taskId||""),this.useCache&&this.localStorage.setItem(t,e).catch(()=>{}),e)}))}fetchPng(t){return JE(this,void 0,void 0,(function*(){let e;if(this.useCache&&(this.logger.info("load resource from cache. "+t,this.taskId||""),e=yield this.localStorage.getItem(t)),e)return this.logger.info("cache hit. "+t,this.taskId||""),e;{this.logger.info("load resource from server. "+t,this.taskId||"");const n=yield KE(t),i=yield n.blob();return e=yield function(t){return new Promise((e,n)=>{const i=new FileReader;i.onload=()=>{e(i.result)},i.onerror=()=>{n(new YE(WE.ResourceError,"Failed parse blob data."))},i.readAsDataURL(t)})}(i),this.logger.info("load end. "+t,this.taskId||""),this.useCache&&this.localStorage.setItem(t,e).catch(()=>{}),e}}))}destroy(){}}var QE=n(7),tM=n.n(QE);function eM(t,e,n=5){return Math.abs(t-e)<=Math.pow(10,-n)}function nM(t){return Math.floor(1e6*t)/1e6}class iM{constructor(){this.point={x:0,y:0},this.slope=Math.PI/4}static fromPointSlope(t,e){const n=new iM;return n.point=t,n.slope=e,n}resolveY(t){return Math.tan(this.slope)*(t-this.point.x)+this.point.y}distanceToLinearEquation(t){return eM(this.slope,t.slope)?this.distanceToPoint(t.point):-1}distanceToPoint(t){let e=0;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;e=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;const n=iM.fromPointSlope(t,e),i=this.crossPoint(n);return i?Math.ceil(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))):0}crossPoint(t){if(eM(t.slope,this.slope))return null;let e=0,n=0;const i=Math.tan(t.slope),r=Math.tan(this.slope),{x:o,y:s}=this.point,{x:a,y:l}=t.point;return eM(this.slope,Math.PI/2)?(e=this.point.x,n=i*(e-a)+l):eM(t.slope,Math.PI/2)?(e=t.point.x,n=r*(e-o)+s):eM(this.slope,Math.PI)||eM(this.slope,0)?(n=this.point.y,e=(n-l)/i+a):eM(t.slope,Math.PI)||eM(t.slope,0)?(n=t.point.y,e=(n-s)/r+o):(e=(i*a-l+s-r*o)/(i-r),n=r*(e-o)+s),{x:e,y:n}}}var rM=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};function oM(){return Date.now().toString(32)+Math.random().toString(32).substring(2)}const sM="__delay_resolve_result__";function aM(t,e){return rM(this,void 0,void 0,(function*(){const n=yield Promise.race([t(),(i=e,new Promise(t=>{setTimeout(()=>{t(sM)},i)}))]);var i;return n===sM?sM:n}))}var lM=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class uM{constructor(t){this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=t=>{const e=t/(gv.TARGET_FPMS||.06);if(!this.isPaused){this.timestamp+=e,this.callbackList=this.callbackList.filter(t=>t&&!t.applied);let{length:t}=this.callbackList;for(let e=0;e<t;e++){const n=this.callbackList[e];if(n&&!n.applied){if(!(n.triggerTime<=this.timestamp))break;n.running=!0,n.fn(),n.applied=!0,t=this.callbackList.length}}}},this.ticker=t,this.ticker.add(this.onTimeUpdate)}setTimeout(t,e){const n=oM(),i=this.timestamp+Math.max(e||16,16);return this.callbackList.push({fn:t,triggerTime:i,id:n,applied:!1,running:!1}),this.callbackList.sort((t,e)=>t.triggerTime-e.triggerTime),n}clearTimeout(t){const e=this.callbackList.findIndex(e=>e.id===t);e>=0&&!this.callbackList[e].running&&this.callbackList.splice(e,1)}delay(t){return new Promise(e=>{this.setTimeout(e,t)})}waitUntil(t,e){return lM(this,void 0,void 0,(function*(){const n=this.timestamp;for(;!t()&&this.timestamp-n<e;)yield this.delay(50)}))}pause(){this.isPaused=!0}resume(){this.isPaused=!1}}var hM=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class cM{constructor(t){this.gifs=Object.create(null),this.textures=Object.create(null),this.frames=Object.create(null),this.spriteSheets=[],this.loader=t}getTexture(t){return this.textures[t]||null}getFrameData(t){return this.frames[t]}getGifFrames(t){return this.gifs[t]?this.gifs[t].filter(t=>!!t):[]}loadSpriteSheetItem(t,e,n){return hM(this,void 0,void 0,(function*(){const i=yield this.loader.fetchJson(`${t}/${e}/jsonOutput/${n}.json`),r=yield this.loader.fetchPng(`${t}/${e}/jsonOutput/${n}.png`),o=document.createElement("img");o.src=r,yield new Promise((t,e)=>{o.onload=()=>t(""),o.onerror=()=>e()});const s=new Sy(o),a=new oS(s,i);yield new Promise(t=>{a.parse(()=>t(""))}),this.spriteSheets.push(a),Object.keys(a.textures).forEach(t=>{const e=t.match(/^(.+)_gif_(\d+)$/);if(e&&e[1]&&e[2]){const n=e[1];this.gifs[n]||(this.gifs[n]=[]);const i=parseInt(e[2],10);this.gifs[n][i]=a.textures[t]}else this.frames[t]=i.frames[t],this.textures[t]=a.textures[t]})}))}destroy(){this.spriteSheets.forEach(t=>t.destroy(!0)),this.spriteSheets=[],this.gifs=Object.create(null),this.textures=Object.create(null),this.frames=Object.create(null)}}var dM=n(3),pM=n.n(dM);function fM(t,e,n){let i,r;const o=Math.round(t)%360;if(o%180==0)i=Math.cos(o*(Math.PI/180))*e,r=0;else if(o%90==0)i=0,r=Math.sin(o*(Math.PI/180))*n;else{const t=function(t){const e=t*Math.PI/180;return Math.tan(e)}(o);i=e*n/Math.sqrt(Math.pow(n,2)+Math.pow(e*t,2)),(o>90&&o<270||o<-90&&o>-270)&&(i=-i),r=t*i}return{x:i,y:r}}function mM(t,e,n,i,r,o){const s=t,a=e;let l,u,h,c,d;if(0===Math.round(i))l=r,u=o,d=0;else if(Math.round(i)>=360)l=r,u=o,h=r+2*t*Math.abs(Math.cos(-n/180*Math.PI)),c=o+2*e*Math.sin(-n/180*Math.PI),d=1;else{const t=-n,e=-(n+i),{x:h,y:c}=fM(t,s,a),p=r-h,f=o+c,{x:m,y:g}=fM(e,s,a);l=m+p,u=f-g,d=i>=-360&&i<-180?1:i>=-180&&i<0||i>0&&i<180?0:1}return{radiusX:s,radiusY:a,xAxisRotation:0,largeArcFlag:d,sweepFlag:i>0?1:0,endX:l,endY:u,middleX:h,middleY:c}}class gM{constructor(){this.pool=[]}getObject(t){const e=this.pool.find(t=>!t.isUsed);if(e)return e.isUsed=!0,e.obj;{const e={obj:this.createObject(),isUsed:!0,group:t};return this.pool.push(e),e.obj}}collectObject(t){const e=this.pool.find(e=>e.obj===t);e&&(e.isUsed=!1,this.resetObject(e.obj))}collectObjectByGroup(t){this.pool.filter(e=>e.group===t).forEach(t=>this.collectObject(t.obj))}}const vM=new class extends gM{createObject(){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("version","1.1"),t}resetObject(t){t.removeAttribute("viewBox"),t.removeAttribute("width"),t.removeAttribute("height"),t.innerHTML=""}};const _M=new class extends gM{createObject(){return document.createElement("img")}resetObject(t){t.removeAttribute("src")}};var yM=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class xM{constructor(){this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null)}render(t,e,n){return yM(this,void 0,void 0,(function*(){const{items:e,width:i,height:r}=t,o=_M.getObject(n),s=new Sy(o,{width:i,height:r,resolution:1}),a=vM.getObject(n);this.imgElements.push(o),this.svgElements.push(a),a.setAttribute("viewBox",`0 0 ${i} ${r}`),a.setAttribute("width",""+i),a.setAttribute("height",""+r);const l={},h={};e.forEach(t=>{const{item:e,x:n,y:i}=t,r=n+2,o=i+2;e.pathsData.forEach(t=>{let e="";t.cmds.forEach(([n,i])=>{e+=n+" ",e+=i.map(e=>(Object(u.isNumber)(e)||(e.x=e.x+t.offset.x+r,e.y=e.y+t.offset.y+o),e)).reduce((t,e)=>(Object(u.isNumber)(e)?t+=e+" ":t+=`${e.x} ${e.y} `,t),""),e+=" "}),t.pathElement.setAttribute("d",e),a.appendChild(t.pathElement)});const c=e.width-4-2*e.padding,d=e.height-4-2*e.padding;this.textures[e.hash]={texture:new Gy(s,new p_(r+2,o+2,c,d)),pivot:e.pivot},l[e.hash]={x:r+2,y:o+2,w:c,h:d,pivot:e.pivot},h[e.hash]=this.hashToIdMap[e.hash]});const c=(d='<?xml version="1.0" encoding="utf-8"?>'+a.outerHTML,"data:image/svg+xml,"+encodeURIComponent(d).replace(/'/g,"%27").replace(/"/g,"%22"));var d;o.src=c,yield new Promise((t,e)=>{o.onload=()=>t(""),o.onerror=()=>e()})}))}getGraphicsData(t){const e=this.idToHashMap[t]||"";return this.textures[e]||null}addGraphics(t,e,n,i,r,o,s,a,l,u,h){var c,d;if(!s&&!l)return t;const p=pM()(n+(null!==(d=null===(c=null==s?void 0:s.width)||void 0===c?void 0:c.toString())&&void 0!==d?d:0)+l+u+h);if(this.hashToIdMap[p]||(this.hashToIdMap[p]=[]),this.hashToIdMap[p].push(t),this.idToHashMap[t]=p,this.graphics.findIndex(t=>t.hash===p)<0){const{graphicsWidth:t,graphicsHeight:n,pathsData:a,pivot:c,padding:d}=function(t,e,n,i,r,o,s,a,l){var u;const h=[],c={x:Math.abs(r.x),y:Math.abs(r.y)};let d=0,p=0,f=0,m=0,g=0,v="none";const _=null!==(u=null==i?void 0:i.width)&&void 0!==u?u:0;return s?(d=e,p=n,g=0):(v=l||"#ff0000",g=_,f=.5*_,m=.5*_,d=e+_,p=n+_,c.x+=.5*_,c.y+=.5*_),d+=Math.abs(r.x),p+=Math.abs(r.y),f+=Math.abs(r.x),m+=Math.abs(r.y),d+=4,p+=4,f+=2,m+=2,d=Math.ceil(d),p=Math.ceil(p),t.forEach(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","path");"none"!==t.fill&&s?e.setAttribute("fill",a||"#ff0000"):e.setAttribute("fill","none"),t.hasStroke&&!s&&(e.setAttribute("stroke-linecap",(null==i?void 0:i.cap)||"butt"),e.setAttribute("stroke-linejoin",(null==i?void 0:i.join)||"miter"),e.setAttribute("stroke-width",g.toString()),e.setAttribute("stroke",v),(null==i?void 0:i.dash)&&e.setAttribute("stroke-dasharray",i.dash));const{scale:n}=t,r=t.path.trim().split(" ");let o={x:0,y:0};const l={offset:{x:f,y:m},cmds:[],pathElement:e};for(let t=0;t<r.length;t+=2){const e=r[t],i=r[t+1];if("M"===e){let[t,e]=i.split(",").map(t=>Number(t));o={x:t,y:e},t=t/9525*n.x,e=e/9525*n.y,l.cmds.push(["M",[{x:t,y:e}]])}else if("A"===e){const[t,e,r,s]=i.split(",").map(t=>Number(t)),a=r/Math.PI*180,u=s/Math.PI*180,h=mM(t,e,a,u,o.x,o.y);Math.round(u)>=360?(o={x:h.endX,y:h.endY},l.cmds.push(["A",[h.radiusX/9525*n.x,h.radiusY/9525*n.y,h.xAxisRotation,h.largeArcFlag,h.sweepFlag,{x:h.middleX/9525*n.x,y:h.middleY/9525*n.y}]]),l.cmds.push(["A",[h.radiusX/9525*n.x,h.radiusY/9525*n.y,h.xAxisRotation,h.largeArcFlag,h.sweepFlag,{x:h.endX/9525*n.x,y:h.endY/9525*n.y}]])):(o={x:h.endX,y:h.endY},l.cmds.push(["A",[h.radiusX/9525*n.x,h.radiusY/9525*n.y,h.xAxisRotation,h.largeArcFlag,h.sweepFlag,{x:h.endX/9525*n.x,y:h.endY/9525*n.y}]]))}else if("L"===e){let[t,e]=i.split(",").map(t=>Number(t));o={x:t,y:e},t=t/9525*n.x,e=e/9525*n.y,l.cmds.push(["L",[{x:t,y:e}]])}else if("QB"===e){let[t,e,r,s]=i.split(",").map(t=>Number(t));o={x:r,y:s},t=t/9525*n.x,e=e/9525*n.y,r=r/9525*n.x,s=s/9525*n.y,l.cmds.push(["Q",[{x:t,y:e},{x:r,y:s}]])}else if("CB"===e){let[t,e,r,s,a,u]=i.split(",").map(t=>Number(t));o={x:a,y:u},t=t/9525*n.x,e=e/9525*n.y,r=r/9525*n.x,s=s/9525*n.y,a=a/9525*n.x,u=u/9525*n.y,l.cmds.push(["C",[{x:t,y:e},{x:r,y:s},{x:a,y:u}]])}else"C"===e&&l.cmds.push(["Z",[]])}h.push(l)}),{graphicsWidth:d,graphicsHeight:p,pivot:c,padding:2,pathsData:h}}(e,r,o,s,i,0,l,u,h);this.graphics.push({hash:p,pathsData:a,pivot:c,width:t,height:n,padding:d})}return t}pack(){this.graphics.forEach(t=>{t.width+=4,t.height+=4});return function t(e){const n=[],i=e.filter(t=>{const e=t.width<2048&&t.height<2048;return e||n.push(t),e}).sort((t,e)=>t.width*t.height-e.width*e.height);let r=i.length+1,o=2050,s=2050;const a=[];let l=null;for(;(o>2048||s>2048)&&i.length>0;)r-=1,l=tM()(i.slice(0,r)),o=l.width,s=l.height;return l&&a.push(l),n.forEach(t=>{const e=tM()([t]);a.push(e)}),r<i.length?a.concat(t(i.slice(r))):a}(this.graphics)}destroy(){Object.keys(this.textures).forEach(t=>{var e;null===(e=this.textures[t])||void 0===e||e.texture.destroy(!0)}),this.textures=Object.create(null),this.imgElements.forEach(t=>_M.collectObject(t)),this.svgElements.forEach(t=>vM.collectObject(t)),this.graphics=[]}}class bM{constructor(){this.runningTimeNodes={}}addRunningTimeNode(t,e,n){const i=`${e}_${t}`;if(this.runningTimeNodes[i])try{this.runningTimeNodes[i].dispose(!0)}catch(t){}this.runningTimeNodes[i]=n}}class wM{constructor(t){this.eventHub=t,this.targets=Object.create(null)}getTargets(){return Object.keys(this.targets).map(t=>this.targets[t])}addTarget(t,e){this.targets[t]=e}getTargetById(t){return this.targets[t]}getTarget(t,e,n={type:"el",index:0,id:""}){var i,r;let o=this.targets[t.id];return"shape"!==t.type?o:("shape"===t.type&&t.txEl&&(o=null!==(i=null==o?void 0:o.getTextElement(t.txEl.type,t.txEl.range))&&void 0!==i?i:null),"shape"===t.type&&t.bg&&0===n.index&&(e=!1,o=null!==(r=null==o?void 0:o.getBgElement())&&void 0!==r?r:null,this.eventHub.emit("IterateTimeNodeEnd",n.id)),e&&o?o.getIterateEntry(n.type,n.index,n.id):(o||this.eventHub.emit("IterateTimeNodeEnd",n.id),o))}clearTargets(){this.targets=Object.create(null)}}class TM{constructor(t){this.target=t}get color(){return this.target.strokeColorFilter.currentColor}set color(t){this.target.strokeColorFilter.color=t}get on(){return this.target.strokeActive?"true":"false"}set on(t){this.target.strokeActive="true"===t}}class SM{constructor(t){this.target=t}applyCommand(t,e){this.target.applyCommand(t,e)}}class EM{constructor(t){this.target=t}get color(){return this.target.fillColorFilter.currentColor}set color(t){this.target.fillActive&&(this.target.fillColorFilter.color=t)}get on(){return this.target.fillActive?"true":"false"}set on(t){this.target.fillActive="true"===t}get designColor(){return this.target.fillColorFilter.designColor}}class MM{constructor(t,e){this.hardHidden=!1,this.target=t,!0===e&&(this.hardHidden=!0)}get opacity(){return this.target.alpha}set opacity(t){this.target.alpha=t}get rotation(){return this.target.rotation/Math.PI*180}set rotation(t){this.target.rotation=t/180*Math.PI}get visibility(){return this.target.visible?"visible":"hidden"}set visibility(t){this.visibility===t||this.hardHidden||(this.target.visible="visible"===t)}}class AM{constructor(t,e){this.actions=[],this.ctx=e,this.object=t,this.object.interactive=!0}reset(t){this.object.interactive=!1,this.object.removeAllListeners(),this.object=t,this.object.interactive=!0}addAction(t,e){this.actions.push([t,e]),"click"===e?(this.object.addListener("click",()=>this.handleAction(t)),this.object.cursor="pointer"):"hover"===e&&this.object.addListener("mouseover",()=>this.handleAction(t))}addProxy(t){this.proxy=t,this.hitArea=this.getOriginHitArea(),this.proxy.interactive=!0,this.actions.forEach(([t,e])=>{var n,i;"click"===e?null===(n=this.proxy)||void 0===n||n.addListener("click",e=>this.handleProxyAction(e,t)):"hover"===e&&(null===(i=this.proxy)||void 0===i||i.addListener("mouseover",e=>this.handleProxyAction(e,t)))})}handleProxyAction(t,e){var n;const i=t.data.global,r=this.object.getGlobalPosition(),o=i.x-r.x+this.object.pivot.x,s=i.y-r.y+this.object.pivot.y;(null===(n=this.hitArea)||void 0===n?void 0:n.contains(o,s))&&this.object.visible&&this.handleAction(e,!0)}getOriginHitArea(){return this.object.hitArea?this.object.hitArea:new v_(0,0,this.object.width,this.object.height)}handleAction(t,e=!1){this.proxy&&!e||(this.ctx.eventHub.emit(ZR.hyperlinkTrigger,t),this.execAction(t))}execAction(t){var e;if(this.ctx.eventHub.emit(ZR.userInput),"ppaction://hlinksldjump"===t.action){const n=(null!==(e=null==t?void 0:t.target)&&void 0!==e?e:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(ZR.requestGotoSlide,Number(n[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===t.action)this.ctx.eventHub.emit(ZR.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===t.action)this.ctx.eventHub.emit(ZR.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===t.action)this.ctx.eventHub.emit(ZR.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===t.action)this.ctx.eventHub.emit(ZR.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===t.action){const t=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(ZR.requestGotoSlide,t)}else"ppaction://hlinkshowjump?jump=endshow"===t.action&&this.ctx.eventHub.emit(ZR.requestGotoSlide,-1)}}class RM{constructor(t,e,n){var i,r,o,s,a,l;this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new p_(0,0,1,1),this.pptX=0,this.pptY=0,this.presetSubType=0,this.designWidth=0,this.designHeight=0,this.designX=0,this.designY=0,this.hasPreset=!1,this.container=new ey,this.ctx=e,this.style=new MM(this.container,t.hardHidden),this.designGlobalPosition={x:n.x+(null!==(r=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==r?r:0),y:n.y+(null!==(s=null===(o=t.position)||void 0===o?void 0:o.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new AM(this.container,this.ctx),t.hlinkHover&&(null===(a=this.hyperlink)||void 0===a||a.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(l=this.hyperlink)||void 0===l||l.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil(()=>{try{return!!this.container.width}catch(t){return!1}},3e3).then(()=>{try{this.designWidth=this.designWidth||this.container.width}catch(t){}}),this.ctx.clock.waitUntil(()=>{try{return!!this.container.height}catch(t){return!1}},3e3).then(()=>{try{this.designHeight=this.designHeight||this.container.height}catch(t){}})}updateScale(){this.container&&(this.container.scale.x=this.designScale.x*this.scaleExt.x*this.scaleOrigin.x,this.container.scale.y=this.designScale.y*this.scaleExt.y*this.scaleOrigin.y)}updateTransform(t){var e,n,i,r,o,s,a,l;this.designWidth=t.width,this.designHeight=t.height,this.designX=null!==(n=null===(e=t.position)||void 0===e?void 0:e.x)&&void 0!==n?n:0,this.designY=null!==(r=null===(i=t.position)||void 0===i?void 0:i.y)&&void 0!==r?r:0;const u=this.designWidth/2,h=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=u,this.container.pivot.y=h;const c=null!==(s=null===(o=t.position)||void 0===o?void 0:o.x)&&void 0!==s?s:0,d=null!==(l=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==l?l:0;this.container.x=c+u,this.container.y=d+h,t.scale&&(this.designScale={x:t.scale.x,y:t.scale.y},this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y),t.rotation&&(this.container.rotation=t.rotation);const p=new RT;p.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(p),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=c,this.bound.y=d,this.bound.width=this.designWidth,this.bound.height=this.designHeight}get scale(){return this.scaleOrigin}set scale(t){this.scaleOrigin.x=t.x,this.scaleOrigin.y=t.y,this.updateScale()}get design_ppt_w(){return nM(this.designWidth/this.ctx.stageWidth)}get design_ppt_h(){return nM((this.designHeight||this.container.height)/this.ctx.stageHeight)}get design_ppt_x(){return nM(this.designX/this.ctx.stageWidth)}get design_ppt_y(){return nM(this.designY/this.ctx.stageHeight)}get ppt_w(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth}set ppt_w(t){this.designWidth&&(this.scaleExt.x=t*this.ctx.stageWidth/this.designWidth,this.updateScale())}get ppt_h(){const t=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*t/this.ctx.stageHeight}set ppt_h(t){this.designHeight&&(this.scaleExt.y=t*this.ctx.stageHeight/this.designHeight,this.updateScale())}get ppt_x(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth}set ppt_x(t){this.pptX=t;const e=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=t*this.ctx.stageWidth+this.container.pivot.x*e}get ppt_y(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight}set ppt_y(t){this.pptY=t;const e=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=t*this.ctx.stageHeight+this.container.pivot.y*e}get r(){return this.container.rotation}set r(t){this.container.rotation=t}set xshear(t){this.container.skew.x=t}get xshear(){return this.container.skew.x}set yshear(t){this.container.skew.y=t}get yshear(){return this.container.skew.y}}class CM{constructor(t){if(this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;const e=t.match(/-?[0-9]+/g);e&&(this.h=parseInt(e[0],10),this.s=parseInt(e[1],10)/100,this.l=parseInt(e[2],10)/100)}}isInit(){return this._isInit}by(t,e){e.h=Math.max(Math.min(this.h+t.h,359),0),e.s=Math.max(Math.min(this.s+t.s,1),0),e.l=Math.max(Math.min(this.l+t.l,1),0),e.a=Math.max(Math.min(this.a+t.a,1),0)}fromHexString(t){const[e,n,i,r]=OM(t);let o=0,s=0,a=0;const l=Math.max(e,n,i),u=Math.min(e,n,i),h=l-u;a=(l+u)/2,0===h?o=0:l===e?o=(n-i)/h%6*60:l===n?o=60*((i-e)/h+2):l===i&&(o=60*((e-n)/h+4)),s=0===h?0:h/(1-Math.abs(2*a-1)),this.h=o,this.s=s,this.l=a,this.a=r}interpolationFrom(t,e,n){const i=t.h+(this.h-t.h)*e,r=t.s+(this.s-t.s)*e,o=t.l+(this.l-t.l)*e,s=t.a+(this.a-t.a)*e;n.h=Math.max(Math.min(i,359),0),n.s=Math.max(Math.min(r,1),0),n.l=Math.max(Math.min(o,1),0),n.a=Math.max(Math.min(s,1),0)}toHexString(){let t=[0,0,0,0];const{h:e,s:n,l:i}=this;if(e<360&&e>=0&&n<=1&&n>=0&&i<=1&&i>=0){let r,o,s;const a=(1-Math.abs(2*i-1))*n,l=a*(1-Math.abs(e/60%2-1)),u=i-a/2;[r,o,s]=e>=0&&e<60?[a,l,0]:e>=60&&e<120?[l,a,0]:e>=120&&e<180?[0,a,l]:e>=180&&e<240?[0,l,a]:e>=240&&e<300?[l,0,a]:[a,0,l],t=[r+u,o+u,s+u,this.a]}return LM(t)}}class PM{constructor(t){this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}fromHexString(t){const[e,n,i,r]=OM(t);this.r=e,this.g=n,this.b=i,this.a=r}isInit(){return this._isInit}interpolationFrom(t,e,n){n.r=t.r+(this.r-t.r)*e,n.g=t.g+(this.g-t.g)*e,n.b=t.b+(this.b-t.b)*e,n.a=t.a+(this.a-t.a)*e}by(t,e){e.r=Math.min(Math.max(this.r+t.r,0),255),e.g=Math.min(Math.max(this.g+t.g,0),255),e.b=Math.min(Math.max(this.b+t.b,0),255),e.a=Math.min(Math.max(this.a+t.a,0),1)}toHexString(){return LM([this.r,this.g,this.b,this.a])}}function IM(t){const e=t.substring(1);return[parseInt(e.substring(0,6),16),parseInt(e.substring(6,8),16)/255]}function OM(t){return 0===(t=t.replace(/^#/,"")).substring(6,8).length&&(t+="FF"),[parseInt(t.substring(0,2).padStart(8,"0"),16)/255,parseInt(t.substring(2,4).padStart(8,"0"),16)/255,parseInt(t.substring(4,6).padStart(8,"0"),16)/255,parseInt(t.substring(6,8).padStart(8,"0"),16)/255]}function LM(t){return"#"+Math.round(255*t[0]).toString(16).padStart(2,"0")+Math.round(255*t[1]).toString(16).padStart(2,"0")+Math.round(255*t[2]).toString(16).padStart(2,"0")+Math.round(255*t[3]).toString(16).padStart(2,"0")}function NM(t,e,n){const i=OM(t),r=OM(e),o=Math.round(255*(i[0]+(r[0]-i[0])*n)),s=Math.round(255*(i[1]+(r[1]-i[1])*n)),a=Math.round(255*(i[2]+(r[2]-i[2])*n)),l=Math.round(255*(i[3]+(r[3]-i[3])*n));return"#"+o.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+l.toString(16).padStart(2,"0")}class DM extends Hx{constructor(){super(void 0,"\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n",{color:new Float32Array([0,0,0,0]),active:0}),this.currentColor="#FFFFFFFF",this.designColor="#FFFFFFFF"}set color(t){this.currentColor=t;const e=OM(t);this.uniforms.color=Float32Array.from(e)}get color(){return this.currentColor}}const FM=new XE.ColorMatrixFilter;FM.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];const BM=new XE.ColorMatrixFilter;BM.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];const UM=new XE.ColorMatrixFilter;UM.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];const kM=new XE.ColorMatrixFilter;kM.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];const GM={darken:FM,darkenLess:BM,lightenLess:kM,lighten:UM};class HM extends RM{constructor(t,e,n){super({position:{x:t.x,y:t.y},width:t.width,height:t.height},e,n),this.fillColorFilter=new DM,this.fill=new EM(this),this.json=t,this.ctx=e,this.parentGlobalPos=n,this.global={x:n.x+t.x,y:n.y+t.y},this.updateTransform({position:{x:t.x,y:t.y},width:t.width,height:t.height})}get fillActive(){var t,e;return(null!==(e=null===(t=this.container.filters)||void 0===t?void 0:t.length)&&void 0!==e?e:-1)>0}set fillActive(t){var e,n;t?(null!==(n=null===(e=this.container.filters)||void 0===e?void 0:e.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}get renderContainer(){return this.container}get interactiveContainer(){return this.container}clearOnSlideChange(){}initOnReuse(){}getTextElement(){return null}getBgElement(){return null}get ppt_x(){return this.global.x/this.ctx.stageWidth}set ppt_x(t){const e=t*this.ctx.stageWidth-this.global.x,n=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+e+this.container.pivot.x*n}get ppt_y(){return this.global.y/this.ctx.stageHeight}set ppt_y(t){const e=t*this.ctx.stageHeight-this.global.y,n=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+e+this.container.pivot.y*n}get design_ppt_x(){return nM(this.global.x/this.ctx.stageWidth)}get design_ppt_y(){return nM(this.global.y/this.ctx.stageHeight)}}class zM{constructor(t,e,n,i,r,o,s,a,l,u,h){this.ctx=t,this.type=e,this.lineWidth=n,this.width=i,this.height=r,this.fillColor=o,this.isHorz=s,this.renderContainer=new ey,this.ghcTextureId=`${a}-text-p${l}-l${u}-u${h}-underLine`}createPaths(){if("ww"===this.type)return null;{let t=`M 0,0 L ${9525*this.width},0`,[e,n]=[this.width,this.lineWidth];return this.isHorz||(t="M 0,0 L 0,"+9525*this.height,[e,n]=[this.lineWidth,this.height]),{paths:[{id:oM(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:pM()(t)}],width:e,height:n}}}getLineStyle(){const t={width:this.lineWidth};return"dotted"===this.type&&(t.dash=""+this.lineWidth),t}preRender(){const t=this.createPaths();if(t){const{paths:e,width:n,height:i}=t,r=e.reduce((t,e)=>t+e.hash,"");this.ctx.graphicsTexture.addGraphics(this.ghcTextureId,e,r,{x:0,y:0},n,i,this.getLineStyle(),this.ctx.objectPoolGroup,!1,null,this.fillColor)}}render(){if(this.ghcTextureId){const t=this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);t&&(this.sprite=new LT,this.sprite.texture=t.texture,this.sprite.pivot.x=t.pivot.x)}}destroy(){var t;null===(t=this.sprite)||void 0===t||t.destroy({texture:!0})}}const jM=134217729;function VM(t,e,n,i,r){let o,s,a,l,u=e[0],h=i[0],c=0,d=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=i[++d]);let p=0;if(c<t&&d<n)for(h>u==h>-u?(s=u+o,a=o-(s-u),u=e[++c]):(s=h+o,a=o-(s-h),h=i[++d]),o=s,0!==a&&(r[p++]=a);c<t&&d<n;)h>u==h>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c]):(s=o+h,l=s-o,a=o-(s-l)+(h-l),h=i[++d]),o=s,0!==a&&(r[p++]=a);for(;c<t;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c],o=s,0!==a&&(r[p++]=a);for(;d<n;)s=o+h,l=s-o,a=o-(s-l)+(h-l),h=i[++d],o=s,0!==a&&(r[p++]=a);return 0===o&&0!==p||(r[p++]=o),p}function WM(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}function XM(t){return new Float64Array(t)}const qM=XM(4),YM=XM(8),ZM=XM(12),JM=XM(16),KM=XM(4);function $M(t,e,n,i,r,o){const s=(e-o)*(n-r),a=(t-r)*(i-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=33306690738754716e-32*u?l:-function(t,e,n,i,r,o,s){let a,l,u,h,c,d,p,f,m,g,v,_,y,x,b,w,T,S;const E=t-r,M=n-r,A=e-o,R=i-o;x=E*R,d=jM*E,p=d-(d-E),f=E-p,d=jM*R,m=d-(d-R),g=R-m,b=f*g-(x-p*m-f*m-p*g),w=A*M,d=jM*A,p=d-(d-A),f=A-p,d=jM*M,m=d-(d-M),g=M-m,T=f*g-(w-p*m-f*m-p*g),v=b-T,c=b-v,qM[0]=b-(v+c)+(c-T),_=x+v,c=_-x,y=x-(_-c)+(v-c),v=y-w,c=y-v,qM[1]=y-(v+c)+(c-w),S=_+v,c=S-_,qM[2]=_-(S-c)+(v-c),qM[3]=S;let C=WM(4,qM),P=22204460492503146e-32*s;if(C>=P||-C>=P)return C;if(c=t-E,a=t-(E+c)+(c-r),c=n-M,u=n-(M+c)+(c-r),c=e-A,l=e-(A+c)+(c-o),c=i-R,h=i-(R+c)+(c-o),0===a&&0===l&&0===u&&0===h)return C;if(P=11093356479670487e-47*s+33306690738754706e-32*Math.abs(C),C+=E*h+R*a-(A*u+M*l),C>=P||-C>=P)return C;x=a*R,d=jM*a,p=d-(d-a),f=a-p,d=jM*R,m=d-(d-R),g=R-m,b=f*g-(x-p*m-f*m-p*g),w=l*M,d=jM*l,p=d-(d-l),f=l-p,d=jM*M,m=d-(d-M),g=M-m,T=f*g-(w-p*m-f*m-p*g),v=b-T,c=b-v,KM[0]=b-(v+c)+(c-T),_=x+v,c=_-x,y=x-(_-c)+(v-c),v=y-w,c=y-v,KM[1]=y-(v+c)+(c-w),S=_+v,c=S-_,KM[2]=_-(S-c)+(v-c),KM[3]=S;const I=VM(4,qM,4,KM,YM);x=E*h,d=jM*E,p=d-(d-E),f=E-p,d=jM*h,m=d-(d-h),g=h-m,b=f*g-(x-p*m-f*m-p*g),w=A*u,d=jM*A,p=d-(d-A),f=A-p,d=jM*u,m=d-(d-u),g=u-m,T=f*g-(w-p*m-f*m-p*g),v=b-T,c=b-v,KM[0]=b-(v+c)+(c-T),_=x+v,c=_-x,y=x-(_-c)+(v-c),v=y-w,c=y-v,KM[1]=y-(v+c)+(c-w),S=_+v,c=S-_,KM[2]=_-(S-c)+(v-c),KM[3]=S;const O=VM(I,YM,4,KM,ZM);x=a*h,d=jM*a,p=d-(d-a),f=a-p,d=jM*h,m=d-(d-h),g=h-m,b=f*g-(x-p*m-f*m-p*g),w=l*u,d=jM*l,p=d-(d-l),f=l-p,d=jM*u,m=d-(d-u),g=u-m,T=f*g-(w-p*m-f*m-p*g),v=b-T,c=b-v,KM[0]=b-(v+c)+(c-T),_=x+v,c=_-x,y=x-(_-c)+(v-c),v=y-w,c=y-v,KM[1]=y-(v+c)+(c-w),S=_+v,c=S-_,KM[2]=_-(S-c)+(v-c),KM[3]=S;const L=VM(O,ZM,4,KM,JM);return JM[L-1]}(t,e,n,i,r,o,u)}XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(8),XM(8),XM(8),XM(4),XM(8),XM(8),XM(8),XM(12);XM(192),XM(192);XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(8),XM(8),XM(8),XM(8),XM(8),XM(8),XM(8),XM(8),XM(8),XM(4),XM(4),XM(4),XM(8),XM(16),XM(16),XM(16),XM(32),XM(32),XM(48),XM(64);XM(1152),XM(1152);XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(4),XM(24),XM(24),XM(24),XM(24),XM(24),XM(24),XM(24),XM(24),XM(24),XM(24),XM(1152),XM(1152),XM(1152),XM(1152),XM(1152),XM(2304),XM(2304),XM(3456),XM(5760),XM(8),XM(8),XM(8),XM(16),XM(24),XM(48),XM(48),XM(96),XM(192),XM(384),XM(384),XM(384),XM(768);XM(96),XM(96),XM(96),XM(1152);const QM=Math.pow(2,-52),tA=new Uint32Array(512);class eA{static from(t,e=aA,n=lA){const i=t.length,r=new Float64Array(2*i);for(let o=0;o<i;o++){const i=t[o];r[2*o]=e(i),r[2*o+1]=n(i)}return new eA(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=t.length>>1;let s=1/0,a=1/0,l=-1/0,u=-1/0;for(let e=0;e<o;e++){const n=t[2*e],i=t[2*e+1];n<s&&(s=n),i<a&&(a=i),n>l&&(l=n),i>u&&(u=i),this._ids[e]=e}const h=(s+l)/2,c=(a+u)/2;let d,p,f,m=1/0;for(let e=0;e<o;e++){const n=nA(h,c,t[2*e],t[2*e+1]);n<m&&(d=e,m=n)}const g=t[2*d],v=t[2*d+1];m=1/0;for(let e=0;e<o;e++){if(e===d)continue;const n=nA(g,v,t[2*e],t[2*e+1]);n<m&&n>0&&(p=e,m=n)}let _=t[2*p],y=t[2*p+1],x=1/0;for(let e=0;e<o;e++){if(e===d||e===p)continue;const n=rA(g,v,_,y,t[2*e],t[2*e+1]);n<x&&(f=e,x=n)}let b=t[2*f],w=t[2*f+1];if(x===1/0){for(let e=0;e<o;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];oA(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,i=-1/0;t<o;t++){const r=this._ids[t];this._dists[r]>i&&(e[n++]=r,i=this._dists[r])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if($M(g,v,_,y,b,w)<0){const t=p,e=_,n=y;p=f,_=b,y=w,f=t,b=e,w=n}const T=function(t,e,n,i,r,o){const s=n-t,a=i-e,l=r-t,u=o-e,h=s*s+a*a,c=l*l+u*u,d=.5/(s*u-a*l);return{x:t+(u*h-a*c)*d,y:e+(s*c-l*h)*d}}(g,v,_,y,b,w);this._cx=T.x,this._cy=T.y;for(let e=0;e<o;e++)this._dists[e]=nA(t[2*e],t[2*e+1],T.x,T.y);oA(this._ids,this._dists,0,o-1),this._hullStart=d;let S=3;n[d]=e[f]=p,n[p]=e[d]=f,n[f]=e[p]=d,i[d]=0,i[p]=1,i[f]=2,r.fill(-1),r[this._hashKey(g,v)]=d,r[this._hashKey(_,y)]=p,r[this._hashKey(b,w)]=f,this.trianglesLen=0,this._addTriangle(d,p,f,-1,-1,-1);for(let o,s,a=0;a<this._ids.length;a++){const l=this._ids[a],u=t[2*l],h=t[2*l+1];if(a>0&&Math.abs(u-o)<=QM&&Math.abs(h-s)<=QM)continue;if(o=u,s=h,l===d||l===p||l===f)continue;let c=0;for(let t=0,e=this._hashKey(u,h);t<this._hashSize&&(c=r[(e+t)%this._hashSize],-1===c||c===n[c]);t++);c=e[c];let m,g=c;for(;m=n[g],$M(u,h,t[2*g],t[2*g+1],t[2*m],t[2*m+1])>=0;)if(g=m,g===c){g=-1;break}if(-1===g)continue;let v=this._addTriangle(g,l,n[g],-1,-1,i[g]);i[l]=this._legalize(v+2),i[g]=v,S++;let _=n[g];for(;m=n[_],$M(u,h,t[2*_],t[2*_+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(_,l,m,i[l],-1,i[_]),i[l]=this._legalize(v+2),n[_]=_,S--,_=m;if(g===c)for(;m=e[g],$M(u,h,t[2*m],t[2*m+1],t[2*g],t[2*g+1])<0;)v=this._addTriangle(m,l,g,-1,i[g],i[m]),this._legalize(v+2),i[m]=v,n[g]=g,S--,g=m;this._hullStart=e[l]=g,n[g]=e[_]=l,n[l]=_,r[this._hashKey(u,h)]=l,r[this._hashKey(t[2*g],t[2*g+1])]=g}this.hull=new Uint32Array(S);for(let t=0,e=this._hullStart;t<S;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const s=n[t],a=t-t%3;if(o=a+(t+2)%3,-1===s){if(0===r)break;t=tA[--r];continue}const l=s-s%3,u=a+(t+1)%3,h=l+(s+2)%3,c=e[o],d=e[t],p=e[u],f=e[h];if(iA(i[2*c],i[2*c+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1],i[2*f],i[2*f+1])){e[t]=f,e[s]=c;const i=n[h];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===h){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(s,n[o]),this._link(o,h);const a=l+(s+1)%3;r<tA.length&&(tA[r++]=a)}else{if(0===r)break;t=tA[--r]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=e,this._triangles[s+2]=n,this._link(s,i),this._link(s+1,r),this._link(s+2,o),this.trianglesLen+=3,s}}function nA(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}function iA(t,e,n,i,r,o,s,a){const l=t-s,u=e-a,h=n-s,c=i-a,d=r-s,p=o-a,f=h*h+c*c,m=d*d+p*p;return l*(c*m-f*p)-u*(h*m-f*d)+(l*l+u*u)*(h*p-c*d)<0}function rA(t,e,n,i,r,o){const s=n-t,a=i-e,l=r-t,u=o-e,h=s*s+a*a,c=l*l+u*u,d=.5/(s*u-a*l),p=(u*h-a*c)*d,f=(s*c-l*h)*d;return p*p+f*f}function oA(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],o=e[i];let s=r-1;for(;s>=n&&e[t[s]]>o;)t[s+1]=t[s--];t[s+1]=i}else{let r=n+1,o=i;sA(t,n+i>>1,r),e[t[n]]>e[t[i]]&&sA(t,n,i),e[t[r]]>e[t[i]]&&sA(t,r,i),e[t[n]]>e[t[r]]&&sA(t,n,r);const s=t[r],a=e[s];for(;;){do{r++}while(e[t[r]]<a);do{o--}while(e[t[o]]>a);if(o<r)break;sA(t,r,o)}t[n+1]=t[o],t[o]=s,i-r+1>=o-n?(oA(t,e,r,i),oA(t,e,n,o-1)):(oA(t,e,n,o-1),oA(t,e,r,i))}}function sA(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function aA(t){return t[0]}function lA(t){return t[1]}function uA(t,e,n){let i=null;const r=new ey;if(t.stopList.sort((t,e)=>t.pos-e.pos),!t.stopList.find(t=>0===t.pos)){const e=t.stopList[0];t.stopList.unshift({pos:0,color:e.color})}if(!t.stopList.find(t=>1===t.pos)){const e=t.stopList[t.stopList.length-1];t.stopList.push({pos:1,color:e.color})}const o=t=>{const e=[];for(let n=0,i=t.length;n<i-1;n++){const i=t[n],r=t[n+1],o=i.pos+.5*(r.pos-i.pos),s=NM(i.color,r.color,.5),a=2*n;e[a]=i,e[a+1]={color:s,pos:o},e[a+2]=r}return e};if(t.stopList=o(t.stopList),t.stopList=o(t.stopList),i=t.line?hA(t,e,n):t.path?function(t,e,n){var i,r,o;const s=[],a={x:0,y:0};if("circle"===(null===(i=t.path)||void 0===i?void 0:i.path)||"rect"===(null===(r=t.path)||void 0===r?void 0:r.path)||"shape"===(null===(o=t.path)||void 0===o?void 0:o.path)){const i=e/2,r=n/2,o=Math.sqrt(i*i+r*r);t.stopList.forEach(t=>{if(0===t.pos)s.push({point:{x:0,y:0},color:t.color});else{const e=o*t.pos,n=new bc;n.absellipse(0,0,e,e,0,2*Math.PI,!1,0),n.getPoints(50).forEach(e=>{s.push({point:{x:e.x,y:e.y},color:t.color})})}a.x=i,a.y=r})}return{points:s,position:a}}(t,e,n):hA(t,e,n),i){const t=[],o=[],{position:s,points:a}=i,l=eA.from(a,t=>t.point.x,t=>t.point.y);for(let e=0;e<l.triangles.length;e+=3)t.push(a[l.triangles[e]].point.x,a[l.triangles[e]].point.y),t.push(a[l.triangles[e+1]].point.x,a[l.triangles[e+1]].point.y),t.push(a[l.triangles[e+2]].point.x,a[l.triangles[e+2]].point.y),o.push(...OM(a[l.triangles[e]].color)),o.push(...OM(a[l.triangles[e+1]].color)),o.push(...OM(a[l.triangles[e+2]].color));const u=new Ky;u.addAttribute("aVertexPosition",t,2),u.addAttribute("aColor",o,4);const h=kx.from("\n precision mediump float;\n attribute vec2 aVertexPosition;\n attribute vec4 aColor;\n uniform mat3 translationMatrix;\n uniform mat3 projectionMatrix;\n varying vec4 vColor;\n void main() {\n vColor = aColor;\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n }","precision mediump float; \n varying vec4 vColor;\n void main() {\n float alpha = vColor.a;\n vec4 color = vColor;\n color.a = 1.0;\n gl_FragColor = color * alpha;\n }\n "),c=new RT;c.drawRect(0,0,e+1,n+1),r.mask=c,r.addChild(c);const d=new _S(u,h);d.position.x=s.x,d.position.y=s.y,r.addChild(d)}return r}function hA(t,e,n){const i=e/2,r=n/2,o=[{x:-i,y:r},{x:-i,y:-r},{x:i,y:r},{x:i,y:-r}],s=[iM.fromPointSlope({x:-i,y:0},Math.PI/2),iM.fromPointSlope({x:0,y:r},0),iM.fromPointSlope({x:i,y:0},Math.PI/2),iM.fromPointSlope({x:0,y:-r},0)],a=[],l=t.stopList.slice(1,t.stopList.length-1).map(o=>{var l,u,h;const c=2*Math.PI;let d=null!==(u=null===(l=t.line)||void 0===l?void 0:l.ang)&&void 0!==u?u:0;for(;d>c;)d-=c;for(;d<0;)d+=c;const p={x:0,y:0};eM(d,Math.PI/2)?(p.x=0,p.y=n/2-o.pos*n):eM(d,0)?(p.x=o.pos*e-e/2,p.y=0):(p.x=o.pos*e-e/2,p.y=n/2-o.pos*n),d>Math.PI/2&&d<=Math.PI&&(p.x*=-1),d>Math.PI&&d<=2*Math.PI&&(p.y*=-1);const f=iM.fromPointSlope(p,Math.PI/2-((null===(h=t.line)||void 0===h?void 0:h.ang)||0)),m=s.map(t=>f.crossPoint(t)).filter(t=>t&&t.x<=i&&t.x>=-i&&t.y<=r&&t.y>=-r).map(t=>({point:t,color:o.color})).sort((t,e)=>e.point.y-t.point.y);a.push(...m);let g=Math.abs(m[1].point.x-m[0].point.x)/10;for(let t=20;t--;){const e=t%2==0?1:-1,n=p.x+e*g,s=f.resolveY(n);n<=i&&n>=-i&&s<=r&&s>=-r&&a.push({point:{x:n,y:s},color:o.color}),g+=g}return f});let u=[],h=[];t:for(let e=0;e<o.length;e++){const n=o[e];for(let e=0;e<l.length-1;e++){const i=l[e],r=l[e+1],o=i.distanceToLinearEquation(r),s=i.distanceToPoint(n),u=r.distanceToPoint(n);if(s<o&&u<o){const i=t.stopList.slice(1,t.stopList.length-1)[e],r=t.stopList.slice(1,t.stopList.length-1)[e+1],l=NM(i.color,r.color,s/o);a.splice(e+1,0,{point:n,color:l});continue t}}const i=l[0],r=l[l.length-1],s=i.distanceToPoint(n),c=r.distanceToPoint(n);s<=c?u.push({point:n,dis:s}):h.push({point:n,dis:c})}u=u.sort((t,e)=>e.dis-t.dis);const c=u.map((e,n)=>{if(0===n)return{point:e.point,color:t.stopList[0].color};{const n=t.stopList[0].color,i=t.stopList[1].color;return{point:e.point,color:NM(n,i,1-(0===u[0].dis?1:e.dis/u[0].dis))}}}).sort((t,e)=>e.point.y-t.point.y);h=h.sort((t,e)=>e.dis-t.dis);const d=h.map((e,n)=>{if(0===n)return{point:e.point,color:t.stopList[t.stopList.length-1].color};{const n=t.stopList[t.stopList.length-2].color,i=t.stopList[t.stopList.length-1].color;return{point:e.point,color:NM(n,i,0===h[0].dis?0:e.dis/h[0].dis)}}}).sort((t,e)=>e.point.y-t.point.y),p=c.concat(...a).concat(d);for(let t=0;t<p.length;t++)p[t].point.x+=i,p[t].point.y=-p[t].point.y+r;return{points:p,position:{x:0,y:0}}}const cA="\nvec3 rgb2hsl(vec3 rgb) {\n float cMax = max(max(rgb.r, rgb.g), rgb.b);\n float cMin = min(min(rgb.r, rgb.g), rgb.b);\n float delta = cMax - cMin;\n \n float h = 0.0;\n if (delta == 0.0) {\n h = 0.0;\n } else if (cMax == rgb.r) {\n h = 60.0 * mod(((rgb.g - rgb.b) / delta), 6.0);\n } else if (cMax == rgb.g ) {\n h = 60.0 * ((rgb.b - rgb.r) / delta + 2.0);\n } else if (cMax == rgb.b) {\n h = 60.0 * ((rgb.r - rgb.g) / delta + 4.0);\n }\n \n float l = (cMax + cMin) / 2.0;\n \n float s = 0.0;\n if (delta == 0.0) {\n s = 0.0;\n } else {\n s = delta / (1.0 - abs(2.0 * l - 1.0));\n }\n \n return vec3(h, s, l);\n}\n",dA=[cA],pA={biLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec3 hsl = rgb2hsl(texColor.rgb);\n mat3 rgb2yuv = mat3(\n 0.2126, 0.7152, 0.0722,\n -0.09991, -0.33609, 0.43600,\n 0.615, -0.5586, -0.05639\n );\n vec3 yuv = texColor.rgb * rgb2yuv;\n if (yuv.x >= 0.49 || texColor.a < 0.9) {\n return vec4(1.0, 1.0, 1.0, 1.0) * texColor.a;\n } else {\n return vec4(0.0, 0.0, 0.0, 1.0) * texColor.a;\n }\n}\n",alphaModFix:"\nvec4 transform(vec4 texColor, float arg) {\n return texColor * arg;\n}\n"};class fA extends Hx{constructor(t,e){var n;super(void 0,(n=pA[t],`\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n${dA.map(t=>t+"\n").join("\n")}\n\n${n}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n`),{arg:e})}}const mA=[cA],gA={clrChange:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n",changeBulletColor:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n if (texColor.a == 0.0) {\n return texColor;\n } else {\n return arg2;\n }\n}\n"};class vA extends Hx{constructor(t,e,n){var i;super(void 0,(i=gA[t],`\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n${mA.map(t=>t+"\n").join("\n")}\n\n${i}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n`),{arg1:Float32Array.from(e),arg2:Float32Array.from(n)})}}const _A=[cA],yA={lum:"\nvec4 transform(vec4 texColor, float arg1, float arg2) {\n if (arg1 > 0.0) {\n texColor.r += (1.0 - texColor.r) * arg1;\n texColor.g += (1.0 - texColor.g) * arg1;\n texColor.b += (1.0 - texColor.b) * arg1;\n } else if (arg1 < 0.0) {\n texColor.r -= texColor.r * arg1;\n texColor.g -= texColor.g * arg1;\n texColor.b -= texColor.b * arg1;\n }\n // todo 对比度\n texColor.rgb *= texColor.a;\n return texColor;\n}\n"};class xA extends Hx{constructor(t,e,n){var i;super(void 0,(i=yA[t],`\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n${_A.map(t=>t+"\n").join("\n")}\n\n${i}\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n`),{arg1:e,arg2:n})}}class bA{constructor(t,e,n,i,r){this.ctx=t,this.fillStyle=e,this.width=n,this.height=i,this.config=r,this.clonedObjects=[],this._displayObject=null}get displayObject(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject}set displayObject(t){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=t}get hasFill(){return!!this.fillStyle&&"noFill"!==this.fillStyle.fillType}createDisplayObject(){if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){const t=new LT;return t.texture=this.ctx.bgTexture,t}if("solidFill"===this.fillStyle.fillType||"noFill"===this.fillStyle.fillType)return null;if("gradientFill"===this.fillStyle.fillType)return uA(this.fillStyle,this.width,this.height);if("blipFill"===this.fillStyle.fillType){const{src:t,filters:e}=this.fillStyle,n=this.ctx.spriteTexture.getTexture(t),i=this.ctx.spriteTexture.getFrameData(t);if(n){const t=new LT;return t.texture=n,e.length>0&&this.config.useFilter&&(t.filters=function(t){const e=[];return t.forEach(t=>{if("biLevel"===t.type)e.push(new fA("biLevel",t.args[0]));else if("clrChange"===t.type||"changeBulletColor"===t.type){const n=OM(t.args[0]),i=OM(t.args[1]);e.push(new vA(t.type,n,i))}else"alphaModFix"===t.type?e.push(new fA(t.type,t.args[0])):"lum"===t.type&&e.push(new xA(t.type,t.args[0],t.args[1]))}),e}(e)),t.width=this.width,t.height=this.height,i.rotate&&(t.position.x=this.width/2,t.position.y=this.height/2,t.anchor.x=.5,t.anchor.y=.5,t.rotation=i.rotate/180*Math.PI),t}}else if("gifFill"===this.fillStyle.fillType){const{src:t,delays:e}=this.fillStyle,n=this.ctx.spriteTexture.getGifFrames(t).map((t,n)=>({texture:t,time:e[n]||20})),i=new VE(n,!0);i.width=this.width,i.height=this.height;const r=this.fillStyle.loop;let o=1;return i.onLoop=()=>{o+=1,r>0&&o>r&&i.gotoAndStop(i.totalFrames)},i}return null}isSolidFill(){var t;return"solidFill"===(null===(t=this.fillStyle)||void 0===t?void 0:t.fillType)}getSolidFillColor(){var t;return"solidFill"===(null===(t=this.fillStyle)||void 0===t?void 0:t.fillType)?this.fillStyle.color:"#000000"}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}destroy(){var t;null===(t=this._displayObject)||void 0===t||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(t=>{null==t||t.destroy()}),this.clonedObjects=[]}}var wA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class TA extends HM{constructor(t,e,n){var i;super(t,e,n),this.textureContainer=new ey,this.underline=null,this.cacheSprite=new LT;const{shapeId:r,paragraphIndex:o,lineIndex:s,unitIndex:a,lineHeight:l,width:u,underLine:h,fill:c,height:d,isHorz:p,lineWidth:f}=t,m="solidFill"===(null===(i=null==c?void 0:c.fill)||void 0===i?void 0:i.fillType)?c.fill.color:null;if(h){const t=p?l/16:f/16;this.underline=new zM(e,h.type,t,u,d,m,p,r,o,s,a)}this.textGraphics=this.createTextGraphics(),this.textFill=this.createTextFill(),this.strokeGraphics=this.createStrokeGraphics(),this.strokeFill=this.createStrokeFill()}createStrokeFill(){const{stroke:t,lineWidth:e,lineHeight:n}=this.json;return new bA(this.ctx,null==t?void 0:t.fill,e,n,{useFilter:!1,useSlideBackgroundFill:!1})}createStrokeGraphics(){const{stroke:t}=this.json,e=(null==t?void 0:t.key)?{fillType:"blipFill",src:t.key,filters:[]}:void 0;return new bA(this.ctx,e,(null==t?void 0:t.width)||0,(null==t?void 0:t.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}createTextFill(){const{isHorz:t,fill:e,lineWidth:n,lineHeight:i,fillLineHeight:r}=this.json;return t?new bA(this.ctx,null==e?void 0:e.fill,n,Math.max(r,i),{useFilter:!1,useSlideBackgroundFill:!1}):new bA(this.ctx,null==e?void 0:e.fill,r,i,{useFilter:!1,useSlideBackgroundFill:!1})}createTextGraphics(){var t;const{fill:e,content:n}=this.json;let i="#000000";"solidFill"===(null===(t=null==e?void 0:e.fill)||void 0===t?void 0:t.fillType)&&(i=e.fill.color);const r=(null==e?void 0:e.key)?{fillType:"blipFill",src:e.key,filters:[{type:"changeBulletColor",args:["#000000",i]}]}:void 0;return new bA(this.ctx,r,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0,{useFilter:"◾"===n,useSlideBackgroundFill:!1})}getIterateEntry(){return null}getBgElement(){return null}updateTransform(t){var e,n,i,r;const{isHorz:o}=this.json;t.position={x:o&&null!==(n=null===(e=t.position)||void 0===e?void 0:e.x)&&void 0!==n?n:0,y:o?0:null!==(r=null===(i=t.position)||void 0===i?void 0:i.y)&&void 0!==r?r:0},t.width=o?this.json.width:this.json.lineWidth,t.height=o?this.json.lineHeight:this.json.height,super.updateTransform(t)}preRender(){var t;null===(t=this.underline)||void 0===t||t.preRender()}render(t){t.addSubMTask(()=>wA(this,void 0,void 0,(function*(){this.doRender()})))}doRender(){let t=!1;const{lineWidth:e,lineHeight:n,baseLine:i,isHorz:r,underline:o,height:s,width:a,highlightColor:l,x:u,y:h,content:c,fillLineHeight:d,fill:p}=this.json;let f=!1!==this.json.needFill;if(p&&p.fill&&"solidFill"!==p.fill.fillType&&(f=!0),l){const t=new RT,[i,o]=IM(l);t.beginFill(i,o),t.drawRect(0,0,r?a:e,r?n:s),t.endFill(),this.textureContainer.addChild(t)}if(this.textGraphics.displayObject){const e=this.textGraphics.displayObject;if(e.scale.x=.5,e.scale.y=.5,r&&(e.position.y=h>0?h:0),f){const n=this.textFill.displayObject;if(n)n.mask=e,n.addChild(e),n.position.x=-u,e.position.x+=u,t=!0,this.textureContainer.addChild(n);else if(this.textFill.isSolidFill()){const n=new DM;n.color=this.textFill.getSolidFillColor(),e.filters=[n],t=!0,this.textureContainer.addChild(e)}}else this.textureContainer.addChild(e)}if(this.strokeGraphics.displayObject){const e=this.strokeGraphics.displayObject;if(e.scale.x=.5,e.scale.y=.5,f){const n=this.strokeFill.displayObject;if(n)n.mask=e,n.addChild(e),r?n.position.y=h>0?h:0:n.position.x=u,this.textureContainer.addChild(n);else if(this.strokeFill.isSolidFill()){r?e.position.y=h>0?h:0:e.position.x=u;const n=new DM;n.color=this.strokeFill.getSolidFillColor(),e.filters=[n],t=!0,this.textureContainer.addChild(e)}}else r?e.position.y=h>0?h:0:e.position.x=u,this.textureContainer.addChild(e)}if(this.underline&&(this.underline.render(),this.underline.sprite)){r?(this.underline.sprite.position.y=o?o-n/16:i,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);const t=this.textFill.getClonedDisplayObject();t?(t.mask=this.underline.sprite,t.addChild(this.underline.sprite),this.textureContainer.addChild(t)):this.textureContainer.addChild(this.underline.sprite)}if(t){const t=zy.create({width:r?a:e,height:r?Math.max(d,n):s,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:t}),this.cacheSprite.texture=t,r&&h<0&&(this.cacheSprite.position.y=h),this.container.addChild(this.cacheSprite)}else this.container.addChild(this.textureContainer);this.container.name=c}destroy(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}var SA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class EA extends HM{constructor(){super(...arguments),this.units=[],this.isHorz=!0}getIterateElements(){return this.units}getIterateEntry(t,e,n){return this.units[e]?this.units[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){}createUnits(t,e,n,i){for(let r=0,o=this.json.textUnits.length;r<o;r++)i.addSubMTask(()=>SA(this,void 0,void 0,(function*(){const i=this.json.textUnits[r],{height:o,width:s,fillHeight:a,baseline:l,y:u,underline:h}=this.json,c=new TA(Object.assign(Object.assign({},i),{lineHeight:o,lineWidth:s,baseLine:l-u,underline:h,fillLineHeight:a||o,isHorz:this.isHorz,shapeId:t,paragraphIndex:e,lineIndex:n,unitIndex:r}),this.ctx,this.global);c.preRender(),this.units.push(c)})))}render(t){for(const e of this.units.reverse())e.render(t),t.addSubMTask(()=>SA(this,void 0,void 0,(function*(){this.container.addChild(e.container)})))}destroy(){this.units.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var MA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class AA extends HM{constructor(){super(...arguments),this.iterateElements=[],this.lines=[],this.isHorz=!0}getIterateElements(){if(this.iterateElements.length>0)return this.iterateElements;const t=this.lines.reduce((t,e)=>t=t.concat(e.getIterateElements()),[]);return this.iterateElements=t,t}getIterateEntry(t,e,n){const i=this.getIterateElements();return i[e]?i[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){}createLines(t,e,n){for(let i=0,r=this.json.lines.length;i<r;i++)n.addSubMTask(()=>MA(this,void 0,void 0,(function*(){const r=this.json.lines[i],o=new EA(r,this.ctx,this.global);o.isHorz=this.isHorz,o.container.name="line-"+i,o.createUnits(t,e,i,n),this.lines.push(o)})))}render(t){for(const e of this.lines)e.render(t),t.addSubMTask(()=>MA(this,void 0,void 0,(function*(){this.container.addChild(e.container)})))}destroy(){this.lines.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}var RA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class CA{constructor(t,e,n,i){this.iterateElements=[],this.paragraphs=[],this.container=new ey,this.json=t,this.ctx=e,this.parentGlobalPos=i,this.iterateType=n,this.container.name="textBody",this.global={x:this.parentGlobalPos.x+t.position.x,y:this.parentGlobalPos.y+t.position.y},this.container.position.x=t.position.x,this.container.position.y=t.position.y,this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y;const r=new RT;r.drawRect(0,0,t.width,t.height),this.container.addChild(r)}get width(){return this.json.width}get height(){return this.json.height}get x(){return this.json.position.x}get y(){return this.json.position.y}getTextElement(t,e){return"paragraph"===t?this.paragraphs[e[0]]:null}getIterateEntry(t,e){return this.iterateElements[t]?this.iterateElements[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",e),null)}destroy(){this.paragraphs.forEach(t=>{t.destroy()})}createParagraphs(t,e){for(let n=0,i=this.json.paragraphs.length;n<i;n++)e.addSubMTask(()=>RA(this,void 0,void 0,(function*(){var i;const r=this.json.paragraphs[n],o=new AA(r,this.ctx,this.global);o.isHorz=null===(i=this.json.isHorz)||void 0===i||i,o.createLines(t,n,e),e.addSubMTask(()=>RA(this,void 0,void 0,(function*(){this.iterateElements=this.iterateElements.concat(o.getIterateElements()),o.container.name="段落-"+n,this.paragraphs.push(o)})))})))}render(t){for(const e of this.paragraphs)e.render(t),t.addSubMTask(()=>RA(this,void 0,void 0,(function*(){this.container.addChild(e.container)})));t.addSubMTask(()=>RA(this,void 0,void 0,(function*(){const{width:t}=this.container;this.container.scale.x<0&&(this.container.x+=-1*t)})))}}var PA=n(48),IA=n.n(PA),OA=n(49),LA=n.n(OA);const NA={Reflection:class extends Hx{constructor(t){super(IA.a,LA.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uStartAlpha:t.startAlpha,uEndAlpha:t.endAlpha,uBlur:0}),this.json=t}}};class DA{constructor(t){this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}setPivot(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"arrow":case"stealth":case"triangle":default:this.pivot={x:this.width,y:this.height/2}}}generatePaths(){this.hash="arrow-"+pM()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}getUnitPath(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}setScaleFromLineWidth(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}setScaleFromSize(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class FA{constructor(t,e,n,i,r,o,s,a,l,u,h){this.id=t,this.ctx=e,this.paths=n,this.hash=i,this.nept=r,this.width=o,this.height=s,this.lineStyle=a,this.shouldFill=l,this.bgColor=u,this.lnColor=h,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(n),this.isRectangle&&l?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}get displayObject(){return this._displayObject}pointDis(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)}rectangleDetect(t){if(1!==t.length)return!1;const e=t[0].path.trim().split(" ");if(10!==e.length)return!1;const n=[],i=[];for(let t=0;t<e.length;t+=2){const r=e[t],o=e[t+1],[s,a]=o.split(",").map(t=>Number(t)/100);n.push(r),i.push({x:s,y:a})}if("MLLLC"!==n.join(""))return!1;for(let t=0;t<3;t++){const e=i[t],n=i[t+1];if(e.x!==n.x&&e.y!==n.y)return!1}const r=i.slice(0,4).reduce((t,e)=>t+e.x,0)/4,o=i.slice(0,4).reduce((t,e)=>t+e.y,0)/4;if(Number.isNaN(r)||Number.isNaN(o))return!1;const s={x:r,y:o};return eM(this.pointDis(s,i[0]),this.pointDis(s,i[1]))&&eM(this.pointDis(s,i[0]),this.pointDis(s,i[2]))&&eM(this.pointDis(s,i[0]),this.pointDis(s,i[3]))&&this.pointDis(s,i[0])===this.pointDis(s,i[1])}createDisplayObject(){if(this.isPureRect){const t=new RT;return t.beginFill(0,1),t.drawRect(0,0,this.width,this.height),t}if(this.isColoredPureRect&&this.bgColor){const t=new RT,[e,n]=IM(this.bgColor);return t.beginFill(e,n),t.drawRect(0,0,this.width,this.height),t}{const t=new LT,e=this.ctx.graphicsTexture.getGraphicsData(this.id);return e?(t.texture=e.texture,t.pivot.x=e.pivot.x,t.pivot.y=e.pivot.y,t):null}}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}render(){this._displayObject=this.createDisplayObject()}isNeedMask(t,e){let n=!1;return this._displayObject&&(n=!(this.isRectangle&&Math.abs(t-this._displayObject.width)<2&&Math.abs(e-this._displayObject.height)<2&&this.shouldFill)),n}destroy(){var t;null===(t=this._displayObject)||void 0===t||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(t=>{null==t||t.destroy()}),this.clonedObjects=[]}}var BA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};const UA={pivot:{x:0,y:0},width:0,height:0};class kA extends RM{constructor(t,e,n,i){var r;super(t,e,n),this.renderContainer=new ey,this.needCacheAsBitMap=!1,this.backgroundGraphics=null,this.filterAreaJustifies=[],this.strokeGraphics=null,this.arrowList=[],this.fillColorFilter=new DM,this.strokeColorFilter=new DM,this.id="",this.fill=new EM(this),this.stroke=new TM(this),this.updateFilterArea=()=>{const t=this.renderContainer.getBounds(!1),e=this.filterAreaJustifies.map(e=>e(t)),n=e.map(t=>t.width),i=e.map(t=>t.height),r=new p_(t.x,t.y,Math.max(...n),Math.max(...i));this.renderContainer.filterArea=r,(this.renderContainer.filters||[]).forEach(t=>{t.uniforms.uShapeFilterArea=new Float32Array(4),t.uniforms.uShapeFilterArea[0]=r.x,t.uniforms.uShapeFilterArea[1]=r.y,t.uniforms.uShapeFilterArea[2]=r.width,t.uniforms.uShapeFilterArea[3]=r.height})},this.json=t,this.json.fillStyle&&"groupFill"===this.json.fillStyle.fillType&&i&&(this.json.fillStyle=i),this.id=t.id;const{fillStyle:o,lineStyle:s}=this.json;this.container.name=t.id,this.renderContainer.name=t.id+"-render-container",this.generateArrowList(),this.backgroundFill=this.createBackgroundFill(),this.backgroundGraphics=this.createBackgroundGraphics(),this.strokeFill=this.createStrokeFill(),this.strokeGraphics=this.createStrokeGraphics(),this.ctx.timingTargets.addTarget(this.id,this),"solidFill"===(null==o?void 0:o.fillType)&&(this.fillColorFilter.currentColor=o.color,this.fillColorFilter.designColor=o.color),"solidFill"===(null===(r=null==s?void 0:s.fill)||void 0===r?void 0:r.fillType)&&(this.strokeColorFilter.currentColor=s.fill.color,this.strokeColorFilter.designColor=s.fill.color),this.updateTransform(this.json),t.textBody&&(this.text=new CA(t.textBody,this.ctx,t.textBody.iterateType,{x:this.designGlobalPosition.x,y:this.designGlobalPosition.y})),this.container.hitArea=new v_(1,1,this.json.width,this.json.height)}get interactiveContainer(){return this.renderContainer}get strokeActive(){var t,e,n,i,r,o,s;return this.strokeFill.displayObject?(null!==(n=null===(e=null===(t=this.strokeFill.displayObject)||void 0===t?void 0:t.filters)||void 0===e?void 0:e.length)&&void 0!==n?n:-1)>0:(null!==(s=null===(o=null===(r=null===(i=this.strokeGraphics)||void 0===i?void 0:i.displayObject)||void 0===r?void 0:r.filters)||void 0===o?void 0:o.length)&&void 0!==s?s:-1)>0}set strokeActive(t){var e,n,i,r,o,s;const{displayObject:a}=this.strokeFill;t?a&&(null!==(n=null===(e=a.filters)||void 0===e?void 0:e.indexOf(this.strokeColorFilter))&&void 0!==n?n:-1)<0?a.filters=[this.strokeColorFilter]:(null===(i=this.strokeGraphics)||void 0===i?void 0:i.displayObject)&&(null!==(o=null===(r=this.strokeGraphics.displayObject.filters)||void 0===r?void 0:r.indexOf(this.strokeColorFilter))&&void 0!==o?o:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):a?a.filters=[]:(null===(s=this.strokeGraphics)||void 0===s?void 0:s.displayObject)&&(this.strokeGraphics.displayObject.filters=[])}get fillActive(){var t,e,n,i,r,o,s;return this.backgroundFill.displayObject?(null!==(n=null===(e=null===(t=this.backgroundFill.displayObject)||void 0===t?void 0:t.filters)||void 0===e?void 0:e.length)&&void 0!==n?n:-1)>0:(null!==(s=null===(o=null===(r=null===(i=this.backgroundGraphics)||void 0===i?void 0:i.displayObject)||void 0===r?void 0:r.filters)||void 0===o?void 0:o.length)&&void 0!==s?s:-1)>0}set fillActive(t){var e,n,i,r,o,s;t?this.backgroundFill.displayObject&&(null!==(n=null===(e=this.backgroundFill.displayObject.filters)||void 0===e?void 0:e.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:(null===(i=this.backgroundGraphics)||void 0===i?void 0:i.displayObject)&&(null!==(o=null===(r=this.backgroundGraphics.displayObject.filters)||void 0===r?void 0:r.indexOf(this.fillColorFilter))&&void 0!==o?o:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.displayObject)&&(this.backgroundGraphics.displayObject.filters=[])}getTextElement(t,e){var n,i;return null!==(i=null===(n=this.text)||void 0===n?void 0:n.getTextElement(t,e))&&void 0!==i?i:null}getBgElement(){return this}getIterateEntry(t,e,n){return 0===e?this:"el"===t?(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null):this.text?this.text.getIterateEntry(e-1,n)||null:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}createStrokeGraphics(){var t,e,n,i;const{id:r,geometry:o,lineStyle:s}=this.json,{width:a,height:l,pivot:u}=(null==o?void 0:o.lineTransform)||UA,h=a||this.json.width,c=l||this.json.height,d="solidFill"===(null===(t=null==s?void 0:s.fill)||void 0===t?void 0:t.fillType)?s.fill.color:null;return s&&"noFill"!==(null===(e=s.fill)||void 0===e?void 0:e.fillType)?new FA(r+"-path-graphics",this.ctx,null!==(n=null==o?void 0:o.paths)&&void 0!==n?n:[],null!==(i=null==o?void 0:o.hash)&&void 0!==i?i:"",u||{x:0,y:0},h,c,s,!1,null,d):null}createStrokeFill(){const[t,e]=this.calculateFillObjectOffset(),{geometry:n,lineStyle:i,width:r,height:o}=this.json,s=(null==n?void 0:n.lineTransform)||UA,a=Object(u.isNumber)(null==i?void 0:i.width)?i.width:1;return new bA(this.ctx,null==i?void 0:i.fill,(s.width||r)+a+t,Math.max((s.height||o)+a,e),{useFilter:!1,useSlideBackgroundFill:!1})}createBackgroundGraphics(){var t;const{geometry:e,lineStyle:n,fillStyle:i,id:r}=this.json,{width:o,height:s,pivot:a}=(null==e?void 0:e.lineTransform)||UA,l=o||this.json.width,u=s||this.json.height,h="solidFill"===(null==i?void 0:i.fillType)?i.color:null;return i&&"noFill"!==i.fillType||this.json.isPicture?new FA(r+"-bg-graphics",this.ctx,null!==(t=null==e?void 0:e.paths)&&void 0!==t?t:[],(null==e?void 0:e.hash)||"",a||{x:0,y:0},l,u,n,!0,h,null):null}createBackgroundFill(){var t,e;const{fillStyle:n,width:i,height:r,lineStyle:o,geometry:s}=this.json,a=(null==s?void 0:s.fillTransform)||UA;return new bA(this.ctx,n,(a.width||i)+(null!==(t=null==o?void 0:o.width)&&void 0!==t?t:0),(a.height||r)+(null!==(e=null==o?void 0:o.width)&&void 0!==e?e:0),{useFilter:!1,useSlideBackgroundFill:this.json.useBgFill})}createBackground(){var t,e,n,i,r,o,s,a;const{pivot:l,width:u,height:h}=(null===(t=this.json.geometry)||void 0===t?void 0:t.fillTransform)||UA,{displayObject:c}=this.backgroundFill;c?(this.json.useBgFill&&(null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)?(this.needCacheAsBitMap=!0,c.mask=this.backgroundGraphics.displayObject,c.pivot.x=(null===(i=this.json.position)||void 0===i?void 0:i.x)||0,c.pivot.y=(null===(r=this.json.position)||void 0===r?void 0:r.y)||0,this.container.addChild(this.backgroundGraphics.displayObject)):"gifFill"===(null===(o=this.json.fillStyle)||void 0===o?void 0:o.fillType)?(c.height=h||this.designHeight,c.width=u||this.designWidth,c instanceof VE&&c.play(),(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.isNeedMask(c.width,c.height))&&(c.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.container.addChild(this.backgroundGraphics.displayObject))):(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.isNeedMask(c.width,c.height))&&(this.needCacheAsBitMap=!0,c.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.container.addChild(this.backgroundGraphics.displayObject)),c.x=l.x,c.y=l.y,this.container.addChild(c)):this.backgroundFill.hasFill&&(null===(e=this.backgroundGraphics)||void 0===e?void 0:e.displayObject)&&this.container.addChild(this.backgroundGraphics.displayObject)}createPathFill(){var t,e,n;const{displayObject:i}=this.strokeFill,r=null===(t=this.strokeGraphics)||void 0===t?void 0:t.displayObject,[o,s]=this.calculateFillObjectOffset();i?((null===(e=this.strokeGraphics)||void 0===e?void 0:e.isNeedMask(i.width,i.height))&&r&&(this.needCacheAsBitMap=!0,i.pivot.x=r.pivot.x,i.pivot.y=r.pivot.y,r.pivot.x=0,r.pivot.y=0,i.mask=r,i.addChild(r),i.position.x=-o/2,i.position.y=-s/2,r.position.x=o/2,r.position.y=s/2),this.container.addChild(i)):this.strokeFill.hasFill&&(null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)&&this.container.addChild(this.strokeGraphics.displayObject)}createFilledPathMask(){var t,e,n;const i=(null===(e=null===(t=this.json.geometry)||void 0===t?void 0:t.paths)||void 0===e?void 0:e.filter(t=>"none"!==t.fill&&"norm"!==t.fill))||[];for(const t of i){const e=this.ctx.graphicsTexture.getGraphicsData(t.id);if(e){const i=new LT(e.texture);i.pivot.x=e.pivot.x,i.pivot.y=e.pivot.y;const r=this.backgroundFill.getClonedDisplayObject(),o=null===(n=this.backgroundGraphics)||void 0===n?void 0:n.getClonedDisplayObject(),s=r||o;s&&(this.backgroundFill.displayObject&&(s.pivot.x=this.backgroundFill.displayObject.pivot.x,s.pivot.y=this.backgroundFill.displayObject.pivot.y),s.mask=i,s.filters=[GM[t.fill]],this.needCacheAsBitMap=!0,this.container.addChild(s),this.container.addChild(i))}}}createArrow(){if(!this.arrowList.length)return;const t=new ey,e=this.strokeFill.getClonedDisplayObject(),[n,i]=this.calculateFillObjectOffset();this.arrowList.forEach(e=>{const n=this.ctx.graphicsTexture.getGraphicsData(e.graphicsId);if(n){const{texture:i}=n,r=new LT(i);r.pivot.x=e.pivot.x,r.pivot.y=e.pivot.y,r.position.x=e.position.x+e.pivot.x,r.position.y=e.position.y+e.pivot.y,r.rotation=e.rotate/180*Math.PI,t.addChild(r)}}),this.arrowRenderTexture=zy.create({width:t.width,height:t.height,resolution:1}),this.ctx.renderer.render(t,{renderTexture:this.arrowRenderTexture});const r=new LT;r.texture=this.arrowRenderTexture,e&&(e.mask=r,e.position.x=-n/2,e.position.y=-i/2,r.position.x=-n/2,r.position.y=-i/2,this.container.addChild(e),this.container.addChild(r))}generateArrowList(){var t,e;const{lineArrowList:n,lineStyle:i,id:r}=this.json,o="solidFill"===(null===(t=null==i?void 0:i.fill)||void 0===t?void 0:t.fillType)?i.fill.color:null;null===(e=n||[])||void 0===e||e.forEach((t,e)=>{var n,s;const a=new DA(Object.assign(Object.assign({},t),{fillStyle:null==i?void 0:i.fill,lineWidth:null!==(n=null==i?void 0:i.width)&&void 0!==n?n:0}));a.graphicsId=`${r}-arrow-${e}-graphics`,a.textureId=`${r}-arrow-${e}-fill`,this.ctx.graphicsTexture.addGraphics(a.graphicsId,null!==(s=a.paths)&&void 0!==s?s:[],a.hash,{x:0,y:0},a.width,a.height,void 0,this.ctx.objectPoolGroup,!0,o,null),this.arrowList.push(a)})}calculateFillObjectOffset(){let[t,e]=[0,0];return this.arrowList.length&&(t=this.arrowList.reduce((t,e)=>Math.max(t,e.width),0),e=this.arrowList.reduce((t,e)=>Math.max(t,e.height),0)),[t,e]}preRender(t){var e,n,i;const{lineStyle:r,geometry:o}=this.json,{width:s,height:a}=(null==o?void 0:o.lineTransform)||UA,l=s||this.json.width,u=a||this.json.height,h=(null===(e=null==o?void 0:o.paths)||void 0===e?void 0:e.filter(t=>"none"!==t.fill&&"norm"!==t.fill))||[],c="solidFill"===(null===(n=null==r?void 0:r.fill)||void 0===n?void 0:n.fillType)?r.fill.color:null;t.addSubMTask(()=>BA(this,void 0,void 0,(function*(){for(const t of h)this.ctx.graphicsTexture.addGraphics(t.id,[t],t.hash,((null==o?void 0:o.lineTransform)||UA).pivot,l,u,r,this.ctx.objectPoolGroup,!0,null,c)}))),null===(i=this.text)||void 0===i||i.createParagraphs(this.json.id,t)}subClassRender(){}setupEffect(){const{effectList:t}=this.json;if(t&&t.length>0){const e=[];return t.forEach(t=>{"reflection"===t.type&&(this.filterAreaJustifies.push(t=>(t.height*=2,t)),e.push(new NA.Reflection(t)))}),this.ctx.ticker.add(this.updateFilterArea,void 0,-20),this.renderContainer.filters=e,!0}return!1}render(t){t.addSubMTask(()=>BA(this,void 0,void 0,(function*(){var t,e;null===(t=this.strokeGraphics)||void 0===t||t.render(),null===(e=this.backgroundGraphics)||void 0===e||e.render(),this.createBackground(),this.subClassRender(),this.createFilledPathMask(),this.createPathFill(),this.createArrow()}))),this.text&&this.text.render(t),t.addSubMTask(()=>BA(this,void 0,void 0,(function*(){var t,e,n,i,r,o;if("wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(e=this.json.textBody)||void 0===e?void 0:e.iterateType))this.renderContainer.addChild(this.container),this.text&&(this.text.container.position.x=(null!==(i=null===(n=this.json.position)||void 0===n?void 0:n.x)&&void 0!==i?i:0)+this.text.x,this.text.container.position.y=(null!==(o=null===(r=this.json.position)||void 0===r?void 0:r.y)&&void 0!==o?o:0)+this.text.y,this.renderContainer.addChild(this.text.container));else{if(this.text){if(Object(u.isBoolean)(this.json.textRotateWithShape)&&!this.json.textRotateWithShape){const t=this.json.rotation||0;this.text.container.rotation=-t;const{width:e}=this.text;this.text.container.position.x=e}this.container.addChild(this.text.container)}this.renderContainer.addChild(this.container)}if(this.needCacheAsBitMap,"background"===this.json.id&&this.ctx.hasBackgroundFillShape){const t=zy.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)});this.ctx.renderer.render(this.renderContainer,{renderTexture:t}),this.ctx.bgTexture=t}})))}clearOnSlideChange(){}initOnReuse(){}destroy(){var t,e,n,i;null===(t=this.text)||void 0===t||t.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),null===(e=this.backgroundGraphics)||void 0===e||e.destroy(),this.strokeFill.destroy(),null===(n=this.strokeGraphics)||void 0===n||n.destroy(),this.renderContainer.destroy(),null===(i=this.arrowRenderTexture)||void 0===i||i.destroy(!0),this.arrowList=[]}}var GA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};function HA(t,e){for(const n in e)t.style[n]=e[n]}class zA{constructor(t){var e,n;this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.medianIsEnd=!1,this.playCallBackList=[],this.duration=0,this.start=0,this.end=0,this.changeMediaProgress=t=>{t.stopPropagation();const e=t.offsetX/this.progress.clientWidth*this.duration;this.jumpToTime(e),this.medianIsEnd=!1,this.ctx.eventHub.emit(ZR.mediaSeek,{id:this.targetId,time:this.media.currentTime-this.start,isPlaying:this.media.isPlaying})},this.jumpToTime=(t=0)=>{const e=Math.floor(t)+this.start;this.media.currentTime!==e&&(this.media.currentTime=e)},this.showController=t=>{t.stopPropagation(),this.show()},this.getMediaDuration=()=>{this.duration&&!Number.isNaN(this.duration)||(this.duration=this.media.duration,this.start&&(this.duration-=this.start,this.jumpToTime()),this.end&&(this.duration-=this.end)),this.totalTime.innerText=zA.formatTime(this.duration)},this.playMedia=()=>GA(this,void 0,void 0,(function*(){this.playButton.style.display="none",this.pauseButton.style.display="block",yield this.media.play(),this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach(t=>{t()})})),this.pauseMedia=()=>GA(this,void 0,void 0,(function*(){this.playButton.style.display="block",this.pauseButton.style.display="none",yield this.media.pause()})),this.onMouseOut=t=>{t.stopPropagation(),this.mediaController.style.display="none"},this.mediaTimeUpdate=()=>GA(this,void 0,void 0,(function*(){const t=this.media.currentTime-this.start;this.duration>0&&(t>this.duration||this.media.ended)&&(yield this.pauseMedia(),this.medianIsEnd=!0),this.currentTime.innerText=zA.formatTime(t),this.currentProgress.style.flex=(t/this.duration).toString()})),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(t=>{t()})},this.playMediaFromCtrl=()=>{this.ctx.eventHub.emit(ZR.mediaPlay,{id:this.targetId,time:this.media.currentTime}),this.playMedia()},this.pauseMediaFromCtrl=()=>{this.ctx.eventHub.emit(ZR.mediaPause,{id:this.targetId,time:this.media.currentTime}),this.pauseMedia()},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.target=t.target,this.media=t.media,this.info=t.info,this.canvasElement=t.canvasElement,this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=null!==(e=this.info.cut.start)&&void 0!==e?e:0,this.end=null!==(n=this.info.cut.end)&&void 0!==n?n:0)}getMedianContainer(){var t;let e=null===(t=this.canvasElement.parentElement)||void 0===t?void 0:t.querySelector(".median-container");e||(e=document.createElement("div"),e.className="median-container",this.canvasElement.parentElement.appendChild(e)),this.container=e}static formatTime(t){let e="00:00";if(t){const n=Math.floor(t/60),i=String(n<0?0:n).padStart(2,"0"),r=Math.floor(t%60);e=`${i}:${String(r<0?0:r).padStart(2,"0")}`}return e}createButton(){const t={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px"};HA(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=document.createElement("img");HA(e,{height:"20px"}),e.src="https://convertcdn.netless.link/publicFiles/icon/play.png",this.playButton.appendChild(e),HA(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const n=document.createElement("img");HA(n,{height:"20px"}),n.src="https://convertcdn.netless.link/publicFiles/icon/pause.png",this.pauseButton.appendChild(n)}createTimer(){const t=document.createElement("div");HA(t,{width:"100px"}),this.currentTime.innerText="00:00";const e=document.createElement("span");return e.innerText="/",t.append(this.currentTime,e,this.totalTime),t}createProgress(){HA(this.progress,{flex:"1",position:"relative",marginRight:"10px"});const t=document.createElement("div");HA(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),HA(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}bindEvent(){this.mediaController.addEventListener("mouseover",this.showController,!1),this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.progress.addEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this.playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this.pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1)}setControllerPosition(){var t;const{target:e}=this,{stageWidth:n,stageHeight:i}=this.ctx,r=e.getGlobalPosition(),o=Number(null===(t=this.container)||void 0===t?void 0:t.getAttribute("data-scale")),s=n*o,a=1/o*(300>s?s/300:1);r.y=r.y+this.height-50,r.x=Math.max(r.x,0),r.x=Math.min(r.x,n-300*a),r.y=Math.max(r.y,0),r.y=Math.min(r.y,i-50),HA(this.mediaController,{height:"50px",borderRadius:"25px",width:"300px",flexDirection:"row",alignItems:"center",position:"absolute",left:r.x+"px",top:r.y+"px",display:"none",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:`scale(${a})`,transformOrigin:"0 100%"})}createMediaController(){this.setControllerPosition(),this.createButton();const t=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,t,this.progress),this.container.appendChild(this.mediaController),this.bindEvent()}addPlayCallBack(t){this.playCallBackList.push(t)}unbindEvent(){this.mediaController.removeEventListener("mouseover",this.showController,!1),this.progress.removeEventListener("mousedown",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",()=>this.playMedia(),!1),this.pauseButton.removeEventListener("click",()=>this.pauseMedia(),!1),this.media.removeListener("durationchange",this.getMediaDuration,!1),this.media.removeListener("timeupdate",this.mediaTimeUpdate,!1),this.media.removeListener("pause",this.onPauseMedia,!1),this.media.removeListener("play",this.onPlayMedia,!1)}show(){this.setControllerPosition(),this.mediaController.style.display="flex"}hide(){this.mediaController.style.display="none"}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],null===(t=this.container)||void 0===t||t.removeChild(this.mediaController)}}var jA=n(50);class VA extends a.a{constructor(t){super(),this.lastTime=-1,this.howl=null,this.rctClient=null,JR.RtcAudioClazz?(this.rctClient=new JR.RtcAudioClazz(t),this.rctClient.on("load",()=>this.emit("load")),this.rctClient.on("pause",()=>this.emit("pause")),this.rctClient.on("play",()=>this.emit("play"))):(this.howl=new jA.Howl({src:[t]}),this.howl.on("load",()=>this.emit("load")),this.howl.on("pause",()=>this.emit("pause")),this.howl.on("play",()=>this.emit("play")))}startTimeChangeEmit(){this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate")),this.isEnded||requestAnimationFrame(()=>this.startTimeChangeEmit())}play(){var t,e;this.lastTime=-1,null===(t=this.howl)||void 0===t||t.play(),null===(e=this.rctClient)||void 0===e||e.play(),this.startTimeChangeEmit()}pause(){var t,e;null===(t=this.howl)||void 0===t||t.pause(),null===(e=this.rctClient)||void 0===e||e.pause()}stop(){var t;null===(t=this.howl)||void 0===t||t.stop(),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0)}destroy(){var t,e,n,i,r,o,s;null===(t=this.howl)||void 0===t||t.pause(),null===(e=this.howl)||void 0===e||e.unload(),null===(n=this.rctClient)||void 0===n||n.pause(),null===(i=this.rctClient)||void 0===i||i.destroy(),null===(r=this.rctClient)||void 0===r||r.removeAllListeners("load"),null===(o=this.rctClient)||void 0===o||o.removeAllListeners("play"),null===(s=this.rctClient)||void 0===s||s.removeAllListeners("pause")}get currentTime(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek():-1}set currentTime(t){this.rctClient?this.rctClient.currentTime=t:this.howl&&this.howl.seek(t)}get duration(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration():0}get isEnded(){return Math.abs(this.currentTime-this.duration)<.001}get isPaused(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&this.howl.playing()}}var WA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class XA extends a.a{constructor(t){var e,n;super(),this.type="video",this.sprite=new LT,this.isPlaying=!1,this.id=t.id,this.video=t.video,this.start=null===(e=t.video.cut)||void 0===e?void 0:e.start,this.end=null===(n=t.video.cut)||void 0===n?void 0:n.end,this.container=t.container,this.ctx=t.ctx,this.ctx.medias[this.id]=this,this.videoResource=new Oy(this.video.src,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0});const i=this.video.src.replace(/4$/,"3");this.rtcAudio=new VA(i);const{video:r,width:o,height:s,target:a}=t;this.controller=new zA({targetId:t.id,ctx:t.ctx,width:o,height:s,target:a,media:this,info:r,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=o,this.sprite.height=s,this.ctx.clock.setTimeout(()=>{this.sprite.visible=!0},50)});const l=new Sy(null,{height:s,width:o});l.resource=this.videoResource,this.videoResource.bind(l),this.sprite=new LT,this.sprite.visible=!1,this.sprite.texture=new Gy(l),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",t=>{t.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",t=>{t.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(t=>{this.videoResource.source.addEventListener(t,()=>{"timeupdate"!==t||this.isPlaying||this.pause(),this.emit(t)})})}get currentTime(){var t,e;return null!==(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.currentTime)&&void 0!==e?e:0}set currentTime(t){this.videoResource.source&&(this.videoResource.source.currentTime=t)}get paused(){var t,e;return null===(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.paused)||void 0===e||e}get ended(){var t,e;return null===(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.ended)||void 0===e||e}get duration(){var t,e;return null!==(e=null===(t=this.videoResource.source)||void 0===t?void 0:t.duration)&&void 0!==e?e:0}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){var t;return WA(this,void 0,void 0,(function*(){this.isPlaying=!0,yield this.load(),yield this.ctx.clock.waitUntil(()=>{const t=this.videoResource.source;return!!(t&&t.videoWidth>0)},3e3);const e=this.videoResource.source;e&&e.videoWidth<=0||(JR.RtcAudioClazz&&(this.rtcAudio.play(),this.videoResource.source.volume=0),yield null===(t=this.videoResource.source)||void 0===t?void 0:t.play())}))}load(){return this.videoResource.load()}pause(){var t;this.isPlaying=!1,JR.RtcAudioClazz&&this.rtcAudio.pause(),null===(t=this.videoResource.source)||void 0===t||t.pause()}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause()}destroy(){var t;this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(t=this.videoResource)||void 0===t||t.destroy(),this.rtcAudio.destroy(),this.controller.destroy()}}var qA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class YA extends a.a{constructor(t){super(),this.type="audio",this.isPlaying=!1,this.id=t.id,this.audio=t.audio,this.audioPlayer=new VA(this.audio.src),t.audio.cut&&(this.start=t.audio.cut.start,this.end=t.audio.cut.end),this.ctx=t.ctx,this.ctx.medias[this.id]=this;const{width:e,height:n,target:i}=t;this.controller=new zA({targetId:t.id,ctx:t.ctx,height:n,width:e,target:i,media:this,info:this.audio,canvasElement:t.canvasElement}),this.audioPlayer.on("load",()=>this.emit("durationchange")),this.audioPlayer.on("timeupdate",()=>this.emit("timeupdate")),this.audioPlayer.on("pause",()=>this.emit("pause")),this.audioPlayer.on("play",()=>this.emit("play"))}get currentTime(){return this.audioPlayer.currentTime}set currentTime(t){this.audioPlayer.currentTime=t}get paused(){return this.audioPlayer.isPaused}get ended(){return this.audioPlayer.isEnded}get duration(){return this.audioPlayer.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return qA(this,void 0,void 0,(function*(){this.isPlaying=!0,this.audioPlayer.play()}))}pause(){this.isPlaying=!1,this.audioPlayer.pause()}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause()}destroy(){this.audioPlayer.pause(),this.controller.destroy()}}class ZA extends kA{constructor(t,e,n,i){super(Object.assign(Object.assign({},t),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),e,n,i),this.isInteractiveOutside=!1,this.cmd=new SM(this),this.media=null==t?void 0:t.media,this.picFill=new bA(this.ctx,t.picFill,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1})}applyCommand(t,e){var n,i,r,o,s;if("call"===e)if(/playFrom\(([0-9.]+)\)/.test(t)){const e=t.match(/playFrom\(([0-9.]+)\)/),i=Number(e[1]||"0");null===(n=this.mediaPlayer)||void 0===n||n.play().then(()=>{var t;null===(t=this.mediaPlayer)||void 0===t||t.seek(i)})}else"custom-pause"===t?null===(i=this.mediaPlayer)||void 0===i||i.pause():"togglePause"===t?null===(r=this.mediaPlayer)||void 0===r||r.togglePause():"stop"===t&&(null===(o=this.mediaPlayer)||void 0===o||o.pause(),null===(s=this.mediaPlayer)||void 0===s||s.seek(0))}renderPic(){var t,e,n,i,r;const{displayObject:o}=this.picFill;if(o){const s=null===(t=this.backgroundGraphics)||void 0===t?void 0:t.getClonedDisplayObject();(null===(e=this.backgroundGraphics)||void 0===e?void 0:e.isNeedMask(o.width,o.height))&&s&&(o.mask=s,this.container.addChild(s)),o.width=this.designWidth,o.height=this.designHeight,o instanceof VE&&this.ctx.slideScopeEventHub.once("slide-render",t=>{this.ctx.slideIndex===t&&o.play()}),this.container.addChild(o),"video"===(null===(n=this.media)||void 0===n?void 0:n.type)&&this.media.src?(this.mediaPlayer=new XA({id:this.json.id+"-video",ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:o,container:this.container,canvasElement:this.ctx.view}),null===(i=this.mediaPlayer)||void 0===i||i.sprite):"audio"===(null===(r=this.media)||void 0===r?void 0:r.type)&&this.media.src&&(this.mediaPlayer=new YA({id:this.json.id+"-audio",ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:o,canvasElement:this.ctx.view})),this.mediaPlayer&&(this.isInteractiveOutside=this.container.interactive,this.container.interactive=!0,this.container.on("mouseover",()=>{this.mediaPlayer.showController()}),this.container.on("mouseout",()=>{this.mediaPlayer.hideController()},!1))}}preRender(t){super.preRender(t)}subClassRender(){this.renderPic()}clearOnSlideChange(){super.clearOnSlideChange(),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}initOnReuse(){super.initOnReuse(),this.mediaPlayer&&(this.container.interactive=!0)}destroy(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}var JA=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class KA extends RM{constructor(t,e,n,i,r){super(t,e,n),this.children=[],this.cacheSprite=new LT,this.cacheContainer=new ey,this.json=t,this.json.fillStyle&&"groupFill"===this.json.fillStyle.fillType&&i&&(this.json.fillStyle=i),this.container.name=t.id,this.cacheContainer.name=t.id+"-cache-container",this.ctx.timingTargets.addTarget(t.id,this),this.updateTransform(this.json),this.fillObject=new bA(this.ctx,t.fillStyle,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1}),this.createChildren(r)}createChildren(t){var e,n,i,r;const o={x:null!==(n=null===(e=this.json.position)||void 0===e?void 0:e.x)&&void 0!==n?n:0,y:null!==(r=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==r?r:0};for(let e=0,n=this.json.children.length;e<n;e++)t.addSubMTask(()=>JA(this,void 0,void 0,(function*(){const n=this.json.children[e];let i=null;"Shape"===(null==n?void 0:n.type)?i=new kA(n,this.ctx,o,this.json.fillStyle):"Picture"===(null==n?void 0:n.type)?i=new ZA(n,this.ctx,o,this.json.fillStyle):"Container"===(null==n?void 0:n.type)&&(i=new KA(n,this.ctx,o,this.json.fillStyle,t)),i&&this.children.push(i)})))}get interactiveContainer(){return this.container}get renderContainer(){return this.container}preRender(t){for(const e of this.children)t.addSubMTask(()=>JA(this,void 0,void 0,(function*(){e.preRender(t)})))}getBgElement(){return null}getIterateEntry(t,e,n){return 0===e?this:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}getTextElement(){return null}render(t){for(const e of this.children)e.render(t),t.addSubMTask(()=>JA(this,void 0,void 0,(function*(){var t;e.renderContainer&&this.cacheContainer.addChild(e.renderContainer),(e.json.hlinkHover||e.json.hlinkClick)&&(null===(t=e.hyperlink)||void 0===t||t.addProxy(this.container))})));t.addSubMTask(()=>JA(this,void 0,void 0,(function*(){this.container.addChild(this.cacheContainer)})))}clearOnSlideChange(){this.children.forEach(t=>t.clearOnSlideChange())}initOnReuse(){this.children.forEach(t=>t.initOnReuse())}destroy(){this.cacheSprite&&this.cacheSprite.destroy({texture:!0}),this.children.forEach(t=>t.destroy()),this.container.destroy({children:!0,texture:!0,baseTexture:!0}),this.cacheContainer.destroy({children:!0,texture:!0,baseTexture:!0})}}class $A extends a.a{constructor(t,e,n,i){super(),this.cond={},this.timeoutIds=[],this.condHandle=t=>{if(t)if(t.delay&&t.delay>0){const e=this.ctx.clock.setTimeout(()=>{t.event&&(this.cond[t.event]=!0,this.detectTrigger())},t.delay);this.timeoutIds.push(e)}else this.cond[t.event]=!0,this.detectTrigger();else this.detectTrigger()},this.id=t,this.ctx=i,this.eventHubs=n,e.forEach(t=>{this.addCond(t)})}setTriggerParams(t){this.triggerParams=t}addCond(t){const e=()=>this.condHandle(t);t.event&&(/^shape/.test(t.event)||/^time/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.global.addListener(t.event,e)):/^runtime/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):/^self/.test(t.event)?t.delay&&t.delay>0&&(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):this.cond[t.event]=!1)}isTrigger(){return Object.keys(this.cond).every(t=>!!this.cond[t])}isTriggerWithoutParent(){return Object.keys(this.cond).filter(t=>"self"!==t).every(t=>!!this.cond[t])}detectTrigger(){if(Object.keys(this.cond).every(t=>!!this.cond[t])){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1});const t=this.triggerParams;this.triggerParams=void 0,this.emit("active",t)}}reset(){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1}),this.timeoutIds.forEach(t=>this.ctx.clock.clearTimeout(t))}}class QA extends a.a{constructor(t){super(),this.isTimeNodeEndSync=!1,this.interactiveListeners=[],this.runtimeNodeEventHub=new a.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=()=>{var t,e,n,i,r,o;this.hasPrev()||!this.isMainSeq?"idle"===this.currentSeqState?(this.decrSeqIndex(),null===(t=this.commonTimeNode.children[this.currentSeqIndex])||void 0===t||t.commonTimeNode.seekToStart(),null===(e=this.commonTimeNode.children[this.currentSeqIndex])||void 0===e||e.commonTimeNode.clearSubList(),this.currentSeqState="idle"):"running"===this.currentSeqState?(null===(n=this.commonTimeNode.children[this.currentSeqIndex])||void 0===n||n.commonTimeNode.seekToStart(),null===(i=this.commonTimeNode.children[this.currentSeqIndex])||void 0===i||i.commonTimeNode.clearSubList(),this.currentSeqState="idle"):"end"===this.currentSeqState&&(this.currentSeqIndex>=this.commonTimeNode.children.length&&(this.currentSeqIndex=this.commonTimeNode.children.length-1),null===(r=this.commonTimeNode.children[this.currentSeqIndex])||void 0===r||r.commonTimeNode.seekToStart(),null===(o=this.commonTimeNode.children[this.currentSeqIndex])||void 0===o||o.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide")},this.handleNext=()=>{var t,e,n,i;this.isTimeNodeEndSync&&(this.isTimeNodeEndSync=!1,this.currentSeqState="idle",this.currentSeqIndex=0),this.hasNext()||!this.isMainSeq?"idle"===this.currentSeqState?null===(t=this.commonTimeNode.children[this.currentSeqIndex])||void 0===t||t.commonTimeNode.startTimeNodeForce():"running"===this.currentSeqState?(null===(e=this.commonTimeNode.children[this.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToEnd(!1,!0),this.currentSeqState="end",this.incrSeqIndex(),null===(n=this.commonTimeNode.children[this.currentSeqIndex])||void 0===n||n.commonTimeNode.startTimeNodeForce()):"end"===this.currentSeqState&&(this.incrSeqIndex(),null===(i=this.commonTimeNode.children[this.currentSeqIndex])||void 0===i||i.commonTimeNode.startTimeNodeForce()):this.globalEventHub.emit("c:next slide")};const{json:e,iterateType:n,isIterate:i,isSub:r,parent:o,ctx:s,eventHub:l,iterateIndex:u,iterateId:h}=t;this.isMainSeq="mainSeq"===e.ctn.nodeType,this.isInteractiveSeq="interactiveSeq"===e.ctn.nodeType,this.id=e.ctn.id,this.isIterate=i,this.json=e,this.ctx=s,this.globalEventHub=l,this.commonTimeNode=new AR({json:e.ctn,isSub:r,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:s,parent:o,isIterate:!1,iterateType:n,iterateIndex:u,iterateId:h}),this.bindShapeEvent(),this.nextConds=new $A("mainSeq",e.nextCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new $A("mainSeq",e.preCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.commonTimeNode.on("timeNodeRestart",()=>{this.currentSeqIndex=0,this.currentSeqState="idle"}),this.commonTimeNode.on("childTimeNodeStart",t=>{const e=this.commonTimeNode.children.findIndex(e=>e.commonTimeNode.uuid===t.id);e>=0&&(this.currentSeqIndex=e),this.currentSeqState="running",this.isMainSeq&&this.ctx.eventHub.emit(ZR.mainSeqStepStart,e)}),this.commonTimeNode.on("childTimeNodeEnd",t=>{const e=this.commonTimeNode.children.findIndex(e=>e.commonTimeNode.uuid===t.id);e>=0&&(this.currentSeqIndex=e),this.currentSeqState="end",this.autoPlay&&this.ctx.clock.setTimeout(()=>{this.handleNext()}),this.isMainSeq&&this.ctx.eventHub.emit(ZR.mainSeqStepEnd,e)}),this.commonTimeNode.on("timeNodeEndSync",()=>{this.isTimeNodeEndSync=!0,this.commonTimeNode.resetForRepeat()}),this.commonTimeNode.on("timeNodeDestroy",()=>{this.interactiveListeners.forEach(([t,e])=>{t&&e&&t.interactiveContainer.removeListener("pointerdown",e)}),this.interactiveListeners=[]}),this.nextConds.on("active",()=>{this.handleNext()}),this.prevConds.on("active",this.handlePrev)}get currentSeqIndex(){return this._currentSeqIndex}set currentSeqIndex(t){this._currentSeqIndex=t,this.isMainSeq?this.ctx.eventHub.emit(ZR.mainSeqStepChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(ZR.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:t,state:this._currentSeqState}})}get currentSeqState(){return this._currentSeqState}set currentSeqState(t){this._currentSeqState=t,this.isMainSeq?this.ctx.eventHub.emit(ZR.mainSeqStateChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(ZR.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:this._currentSeqIndex,state:t}})}get stepLength(){return this.commonTimeNode.children.length}get currentStep(){return this.currentSeqIndex}get currentState(){return this.currentSeqState}startAutoPlay(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}incrSeqIndex(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}decrSeqIndex(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}hasPrev(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}hasNext(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}bindShapeEvent(){"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach(t=>{if(/^shape/.test(t.event)){const e=t.event.split(" ")[1];if(e){const t=this.ctx.timingTargets.getTargetById(e);if(t){t.interactiveContainer.interactive=!0,t.interactiveContainer.cursor="pointer";const n=()=>{this.ctx.eventHub.emit(ZR.userInput);const t=`shape ${e} onClick`,{mode:n}=this.ctx;"interactive"!==n&&"sync"!==n||this.ctx.eventHub.emit(ZR.interactiveSeqAction,{action:t,seqId:this.json.ctn.id}),"sync"!==n&&"local"!==n||this.globalEventHub.emit(t)};t.interactiveContainer.on("pointerdown",n),this.interactiveListeners.push([t,n])}}}})}setCurrentStep(t,e){this.isInteractiveSeq&&0===this.commonTimeNode.applyCount&&(this.commonTimeNode.applyCount=1);let n=t;this.commonTimeNode.seekToStart();const{length:i}=this.commonTimeNode.children;if(-1===n&&(n=i-1),n>=0&&n<i)for(let t=0;t<=n;t++){const i=this.commonTimeNode.children[t];t!==n?i.commonTimeNode.seekToEnd(!1,!0):"start"===e?i.commonTimeNode.seekToStart():"end"===e&&i.commonTimeNode.seekToEnd(!1,!0)}this.currentSeqIndex=n,this.currentSeqState="start"===e?"idle":"end"}}function tR(t,e,n){const i=e.split(".");i.reduce((r,o,s)=>{if(r)return s!==i.length-1?r[o]:void(r[o]=n);console.warn(`${t} not support ${e}`)},t)}function eR(t,e){if(!e)return null;return e.split(".").reduce((n,i)=>{if(n)return n[i];console.warn(`${t} not support ${e}`)},t)}class nR{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new a.a,this.onTimeLineStart=()=>{if(this.isConflict){const{target:t}=this.json.cBhvr;if("next"===this.activeWhenConflict){let e=t.id;"shape"===t.type&&t.txEl&&(e=`${e}-txEl-${t.txEl.range[0]}`),this.commonTimeNode.isIterate&&(e=`${e}-iterate-${this.commonTimeNode.iterateIndex}`),this.ctx.conflictTimeNodeManager.addRunningTimeNode(e,this.modifyAttrKey,this.commonTimeNode)}else"prev"===this.activeWhenConflict&&this.commonTimeNode.dispose()}};const{isIterate:e,isSub:n,json:i,ctx:r,parent:o,eventHub:s,iterateType:l,iterateIndex:u,iterateId:h}=t;this.json=i,this.id=i.cBhvr.ctn.id,this.ctx=r,this.globalEventHub=s,this.commonTimeNode=new AR({json:i.cBhvr.ctn,isSub:n,eventHubs:{global:s,runtime:this.runtimeNodeEventHub},ctx:r,parent:o,isIterate:e,iterateType:l,iterateIndex:u,iterateId:h}),this.timingTarget=this.ctx.timingTargets.getTarget(i.cBhvr.target,e,{type:l,index:u,id:h}),this.commonTimeNode.on("seekToStart",()=>this.onSeekToStart()),this.commonTimeNode.on("seekToEnd",()=>this.onSeekToEnd()),this.commonTimeNode.on("timelineStart",this.onTimeLineStart)}}class iR extends nR{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=eR(this.timingTarget,this.json.cBhvr.attrList[0]))},this.onSeekToStart=()=>{const t=this.json.cBhvr.attrList[0];null!==this.startVal&&this.timingTarget&&tR(this.timingTarget,t,this.startVal)},this.onSeekToEnd=()=>{const t=this.json.cBhvr.attrList[0],e=this.json.cBhvr.to||this.json.to;e&&this.timingTarget&&tR(this.timingTarget,t,e)},this.commonTimeNode.on("timeNodeStart",this.updateStartValue),this.commonTimeNode.on("timeNodeCreate",this.updateStartValue),this.commonTimeNode.on("timeUpdate",({duration:t,delta:e})=>{if(e/t>=1){const t=this.json.cBhvr.attrList[0];this.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");const e=this.json.cBhvr.to||this.json.to;e&&this.timingTarget&&tR(this.timingTarget,t,e)}})}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}}var rR=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class oR{constructor(t,e){this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:t=>t/Math.PI*180,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:t=>t/180*Math.PI,rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=e,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}parseFmla(t){let e=t.replace(/#ppt_h/g,`(${this.timingTarget.design_ppt_h})`);return e=e.replace(/#ppt_w/g,`(${this.timingTarget.design_ppt_w})`),e=e.replace(/#ppt_x/g,`(${this.timingTarget.design_ppt_x})`),e=e.replace(/#ppt_y/g,`(${this.timingTarget.design_ppt_y})`),e=e.replace(/ppt_w/g,"vars.ppt_w"),e=e.replace(/ppt_h/g,"vars.ppt_h"),e=e.replace(/ppt_x/g,"vars.ppt_x"),e=e.replace(/ppt_y/g,"vars.ppt_y"),e=e.replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach(t=>{const n=new RegExp(`([^a-z])${t}([^a-z])`,"g");e=e.replace(n,(e,n,i)=>`${n}math.${t}${i}`)}),new Function("vars","math","$","return "+e)}}class sR extends oR{constructor(t,e,n){super(t,e),this.value=t.val.value,n&&(this.fmla=this.parseFmla(n))}resolveValue(){return this.value}interpolationFrom(t,e,n){const i=t.resolveValue(n),r=i+(this.resolveValue()-i)*e;return t.fmla?t.fmla(n,this.math,r):r}}rR([ZE()],sR.prototype,"interpolationFrom",null);class aR extends oR{constructor(t,e){var n;super(t,e),this.value=null===(n=t.val)||void 0===n?void 0:n.value}interpolationFrom(t,e,n){let i=t.resolveValue(n);return e>this.time&&(i=this.resolveValue()),i}resolveValue(){return this.value||""}}rR([ZE()],aR.prototype,"interpolationFrom",null);class lR extends oR{constructor(t,e){super(t,e),this.fn=this.parseFmla(this.val)}resolveValue(t){return this.fn(t,this.math,1)}interpolationFrom(t,e,n){const i=t.resolveValue(n),r=i+(this.resolveValue(n)-i)*e;return t.fmla?t.fmla(n,this.math,r):r}}rR([ZE()],lR.prototype,"interpolationFrom",null);class uR extends oR{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return NM(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}rR([ZE()],uR.prototype,"interpolationFrom",null);class hR extends nR{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},this.keyFrames=[],this.isColorAnim=!1,this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal=eR(this.timingTarget,this.json.cBhvr.attrList[0]))},this.updateVars=()=>{var t,e,n,i;(null===(t=this.timingTarget)||void 0===t?void 0:t.ppt_h)&&(this.vars.ppt_h=this.timingTarget.ppt_h),(null===(e=this.timingTarget)||void 0===e?void 0:e.ppt_w)&&(this.vars.ppt_w=this.timingTarget.ppt_w),(null===(n=this.timingTarget)||void 0===n?void 0:n.ppt_x)&&(this.vars.ppt_x=this.timingTarget.ppt_x),(null===(i=this.timingTarget)||void 0===i?void 0:i.ppt_y)&&(this.vars.ppt_y=this.timingTarget.ppt_y),this.isColorAnim},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t,i=this.keyFrames.findIndex(t=>n<=t[0]),{attrList:r}=this.json.cBhvr;if(i<0){const t=this.keyFrames[this.keyFrames.length-1];return void(this.timingTarget&&r&&r[0]&&tR(this.timingTarget,r[0],t[1].resolveValue(this.vars)))}const o=i-1,s=this.keyFrames[i],a=this.keyFrames[o]||s,l=s[0]-a[0]==0?1:(n-a[0])/(s[0]-a[0]),u=s[1].interpolationFrom(a[1],l,this.vars);this.timingTarget&&r&&r[0]&&tR(this.timingTarget,r[0],u)},this.onSeekToStart=()=>{null!==this.startVal&&this.timingTarget&&tR(this.timingTarget,this.json.cBhvr.attrList[0],this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.initKeyFrames(),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timelineStart",this.updateVars),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}initKeyFrames(){var t;const{valueType:e}=this.json;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){const t={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===e&&this.timingTarget){const e=new lR(t,this.timingTarget);this.keyFrames.push([t.time,e])}}const t={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===e&&this.timingTarget){const e=new lR(t,this.timingTarget);this.keyFrames.push([t.time,e])}}else if(this.json.by){const n={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===e&&this.timingTarget){const t=new lR(n,this.timingTarget);this.keyFrames.push([n.time,t])}const i={time:1,val:{type:"string",value:((null===(t=n.val)||void 0===t?void 0:t.value)||"")+"+"+this.json.by},fmla:""};if("num"===e&&this.timingTarget){const t=new lR(i,this.timingTarget);this.keyFrames.push([i.time,t])}}if(this.json.tavLst.length>0)for(const t of this.json.tavLst)if(t.val&&this.timingTarget){let n=null;"string"===t.val.type?"num"===e?n=new lR(t,this.timingTarget):"str"===e&&(n=new aR(t,this.timingTarget)):"number"===t.val.type?n=new sR(t,this.timingTarget):"color"===t.val.type?(this.isColorAnim=!0,n=new uR(t,this.timingTarget)):"boolean"===t.val.type&&console.warn("not implements"),n&&this.keyFrames.push([t.time,n])}}}var cR=n(51),dR=n.n(cR),pR=n(52),fR=n.n(pR);class mR extends Hx{constructor(){super(fR.a,dR.a,{percent:0,direction:1,transition:0})}set transition(t){this.uniforms.transition=t}set percent(t){this.uniforms.percent=t}set direction(t){this.uniforms.direction=t}}var gR=n(53),vR=n.n(gR);class _R extends Hx{constructor(){super(void 0,vR.a,{percent:0,transition:1})}set transition(t){this.uniforms.transition=Math.pow(t,t)}set percent(t){this.uniforms.percent=t}}class yR extends nR{constructor(t){var e;super(t),this.filterType="",this.isConflict=!0,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t;this.filter&&(this.filter.percent=this.commonTimeNode.applyTimeFilter(n)),n>=1&&this.timingTarget&&this.ctx.clock.setTimeout(()=>{this.timingTarget&&(this.timingTarget.container.filters=[])})},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[])},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let n=0;"out"===t.json.transition?n=-1:"in"===t.json.transition&&(n=1);const i=null===(e=t.json.filter)||void 0===e?void 0:e.match(/^([a-zA-Z]+)(\((.+)\))?/);if(i){const t=i[1],e=i[3];if("wipe"===t){const n=new mR;"up"===e?n.direction=1:"down"===e?n.direction=2:"left"===e?n.direction=3:"right"===e&&(n.direction=4),this.filter=n,this.filterType=`${t}-${e}`}else if("fade"===t){const e=new _R;this.filter=e,this.filterType=""+t}this.filter&&(this.filter.transition=n)}}get modifyAttrKey(){return this.filterType}}class xR extends nR{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.onTimeUpdate=({duration:t,delta:e})=>{var n;const i=e/t,r=null===(n=this.path)||void 0===n?void 0:n.getPoint(i);this.timingTarget&&r&&(this.timingTarget.ppt_x=r.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=r.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{var t,e,n;e=null===(t=this.commonTimeNode.json)||void 0===t?void 0:t.spd;const i=null===(n=this.path)||void 0===n?void 0:n.getPoint(0);this.timingTarget&&i&&(this.timingTarget.ppt_x=i.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=i.y+this.timingTarget.design_ppt_y)},this.onSeekToEnd=()=>{var t,e,n;const i=null!==(e=null===(t=this.commonTimeNode.json)||void 0===t?void 0:t.spd)&&void 0!==e?e:1,r=null===(n=this.path)||void 0===n?void 0:n.getPoint(i>0?1:0);this.timingTarget&&r&&(this.timingTarget.ppt_x=r.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=r.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new bc,n=null===(t=this.json.path)||void 0===t?void 0:t.match(/[MLCmlc][^MLCmlc]+/g);if(n)for(const t of n){const[n,...i]=t.trim().replace(/\s+/g," ").split(" ");if("M"===n){const[t,n]=i.map(t=>Number(t));e.moveTo(t,n)}else if("L"===n){const[t,n]=i.map(t=>Number(t));e.lineTo(t,n)}else if("C"===n){const[t,n,r,o,s,a]=i.map(t=>Number(t));e.bezierCurveTo(t,n,r,o,s,a)}else if("Z"===n)e.closePath();else if("E"===n)console.warn("not implements");else if("c"===n){const[t,n,r,o,s,a]=i.map(t=>Number(t)),l=e.currentPoint;e.bezierCurveTo(t+l.x,n+l.y,r+l.x,o+l.y,s+l.x,a+l.y)}else if("l"===n){const t=e.currentPoint,[n,r]=i.map(t=>Number(t));e.lineTo(n+t.x,r+t.y)}else if("m"===n){const t=e.currentPoint,[n,r]=i.map(t=>Number(t));e.moveTo(n+t.x,r+t.y)}}this.path=e}}class bR extends nR{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=t=>{t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:e})=>{var n,i,r,o,s;const a=e/t,l={x:1,y:1};if(this.to){const t=null!==(n=this.from)&&void 0!==n?n:{x:null!==(r=null===(i=this.startVal)||void 0===i?void 0:i.x)&&void 0!==r?r:1,y:null!==(s=null===(o=this.startVal)||void 0===o?void 0:o.y)&&void 0!==s?s:1};l.x=t.x+(this.to.x-t.x)*a,l.y=t.y+(this.to.y-t.y)*a}else if(this.by){const t={x:this.by.x,y:this.by.y};l.x=1+(t.x-1)*a,l.y=1+(t.y-1)*a}this.timingTarget&&(this.timingTarget.scale=l)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=t.json.from,this.to=t.json.to,this.by=t.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class wR extends nR{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isTimelineStart=!1,this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=t=>{if(this.isTimelineStart)return;this.isTimelineStart=!0,t.isReverse||this.updateCurrentValue(),this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to);const[e]=this.json.cBhvr.attrList[0].split(".");tR(this.timingTarget,e+".on","true")},this.onTimeNodeEnd=()=>{if("remove"===this.json.cBhvr.ctn.fill){const[t]=this.json.cBhvr.attrList[0].split(".");tR(this.timingTarget,t+".on","false")}this.isTimelineStart=!1},this.onSeekToStart=()=>{var t;if(this.timingTarget&&(this.onTimeUpdate({duration:1,delta:0}),(null===(t=this.timingTarget.fill)||void 0===t?void 0:t.designColor.toUpperCase())===this.from.toHexString().toUpperCase())){const[t]=this.json.cBhvr.attrList[0].split(".");tR(this.timingTarget,t+".on","false")}},this.onTimeNodeStart=()=>{if(this.timingTarget){const t=eR(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.startColorString=t)}},this.onTimeUpdate=({delta:t,duration:e})=>{const n=t/e;this.to.interpolationFrom(this.from,n,this.target),this.timingTarget&&tR(this.timingTarget,this.json.cBhvr.attrList[0],this.target.toHexString())},this.onSeekToEnd=()=>{this.isTimelineStart||this.onTimelineStart({isReverse:!1,activeCount:0,id:""}),this.onTimeUpdate({duration:1,delta:1})},"rgb"===this.json.clrSpc?(this.from=new PM(this.json.from),this.to=new PM(this.json.to),this.by=new PM(this.json.by),this.target=new PM):(this.from=new CM(this.json.from),this.to=new CM(this.json.to),this.by=new CM(this.json.by),this.target=new CM),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const t=eR(this.timingTarget,this.json.cBhvr.attrList[0]);t&&(this.currentColorString=t)}}}class TR extends nR{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=t=>{this.lastVal=null,t.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:t,delta:e})=>{const n=e/t;let i=0,r=0;if(void 0!==this.from&&void 0!==this.to){i=this.from,r=this.to;const t=i+(r-i)*n;this.timingTarget&&(this.timingTarget.r=t)}else if(void 0!==this.by){this.lastVal||(this.lastVal=0);const t=this.by*n-this.lastVal;this.lastVal=this.by*n,this.timingTarget&&(this.timingTarget.r+=t)}},this.onTimeNodeStart=()=>{var t;Object(u.isNumber)(null===(t=this.timingTarget)||void 0===t?void 0:t.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&null!==this.startVal&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=null===(t=this.timingTarget)||void 0===t?void 0:t.r}}class SR extends nR{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var t,e;const{cmd:n,cmdType:i}=this.json;!this.isApplied&&n&&i&&(this.isApplied=!0,null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand(n,i))},this.onSeekToStart=()=>{var t,e;null===(e=null===(t=this.timingTarget)||void 0===t?void 0:t.cmd)||void 0===e||e.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("seekToStart",this.onSeekToStart),this.commonTimeNode.on("seekToEnd",this.onSeekToEnd)}get modifyAttrKey(){var t,e,n,i;return(null!==(e=null===(t=this.json)||void 0===t?void 0:t.cmd)&&void 0!==e?e:"")+(null!==(i=null===(n=this.json)||void 0===n?void 0:n.cmdType)&&void 0!==i?i:"")}}class ER{constructor(t){this.runtimeNodeEventHub=new a.a,this.stopAudio=()=>{this.audio.stop()},this.destroy=()=>{this.stopAudio(),this.audio.destroy()};const{json:e,isIterate:n,isSub:i,eventHub:r,ctx:o,parent:s,iterateType:l,iterateIndex:u,iterateId:h}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new AR({json:e.cMediaNode.ctn,isSub:i,eventHubs:{global:r,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:n,iterateType:l,iterateIndex:u,iterateId:h}),this.audio=new VA(e.cMediaNode.tgtEl),this.commonTimeNode.on("timelineStart",()=>{this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy)}}var MR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class AR extends a.a{constructor(t){var e,n;super(),this.uuid=Date.now().toString(32)+Math.random().toString(32).substring(2),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId="",this.iterateShadows=[],this.isEndEventsEmitted=!1,this.tmFilter=[],this.timeDelta=0,this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.seekToEnd(!1,!0))},this.handleActive=(t=!0)=>{if(this.isActive=!0,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if("never"===this.json.restart)return;"whenNotActive"!==this.json.restart&&"always"!==this.json.restart||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(t))}else this.startTimeLine(t)},this.updateTimeLine=t=>{const e=t/(gv.TARGET_FPMS||.06);this.timeDelta+=e,this.duration-this.timeDelta<=e&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(t=!1)=>{(this.isTimeNodeEnd()||t)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:i,isIterate:r,ctx:o,eventHubs:s,parent:a,json:l,iterateType:u,iterateId:h,iterateIndex:c}=t;this.isSub=i,this.isIterate=r,this.parentTimeNode=a,this.json=l,this.ctx=o,this.iterateIndex=c,this.eventHubs=s,this.iterateType=u,this.iterateId=h,this.tmFilter=null!==(n=null===(e=l.tmFilter)||void 0===e?void 0:e.split(";").map(t=>t.split(",").map(t=>parseFloat(t.trim()))))&&void 0!==n?n:[];const d=Number(this.json.dur),p=this.json.spd||1;this.isNegativeSpeed=p<0,Number.isNaN(d)||(this.duration=d/Math.abs(p)),this.uuid+="--"+this.json.id,this.setPreStyle(),l.childTnLst&&this.createChildren(l.childTnLst),this.startConds=new $A(this.json.id||"",l.stCondLst,s,this.ctx),this.endConds=new $A(this.json.id||"",l.endCondLst,s,this.ctx),l.endSync&&(this.endSync=new $A(this.json.id||"",[l.endSync],s,this.ctx),this.endSync.on("active",()=>{var t;"interactiveSeq"===this.json.nodeType&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),null===(t=this.endSync)||void 0===t||t.reset())})),this.startConds.on("active",t=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(t))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(t=>t.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&"nextClick"===this.json.masterRel&&this.startConds.addCond({event:"shape slide onNext"}),this.json.iterate&&!1===this.isIterate&&this.createIterateShadow()}createIterateShadow(){const t=oM();let e=!0,n=0;const i=n=>{n===t&&(e=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",i))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",i);e;){const e=JSON.parse(JSON.stringify(this.json)),i=new AR({json:e,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:e.iterate.type,iterateIndex:n,iterateId:t});this.iterateShadows[n]=i,n+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(t){this.isReverse=t}createTimeNode(t,e){let n=null;const i={json:t,isSub:e,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId};return"seq"===t.type?n=new QA(i):"par"===t.type?n=new RR(i):"set"===t.type?n=new iR(i):"anim"===t.type?n=new hR(i):"animEffect"===t.type?n=new yR(i):"animMotion"===t.type?n=new xR(i):"animScale"===t.type?n=new bR(i):"animClr"===t.type?n=new wR(i):"animRot"===t.type?n=new TR(i):"cmd"===t.type?n=new SR(i):"audio"===t.type&&(n=new ER(i)),n}createSubList(t){this.subList=[],t.forEach(t=>{const e=this.createTimeNode(t,!0);e&&this.subList.push(e)})}bindCommonTimeNodeEvent(t){t.commonTimeNode.on("timeNodeStart",t=>{this.emit("childTimeNodeStart",t)}),t.commonTimeNode.on("timeNodeEnd",t=>{this.emit("childTimeNodeEnd",t),this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())&&(this.json.iterate||this.allChildrenEndHandle())})}createChildren(t){function e(t){return(e=t,function(t){var e;return!!(null===(e=t)||void 0===e?void 0:e.cBhvr)}(e)?e.cBhvr.ctn:function(t){var e,n;return!!(null===(n=null===(e=t)||void 0===e?void 0:e.cMediaNode)||void 0===n?void 0:n.ctn)}(e)?e.cMediaNode.ctn:e.ctn).presetOrder;var e}if(t&&t[0]&&e(t[0])){[...t].sort((t,n)=>{var i,r;return(null!==(i=e(t))&&void 0!==i?i:0)-(null!==(r=e(n))&&void 0!==r?r:0)}).forEach(e=>{const n=t.findIndex(t=>t===e),i=this.createTimeNode(e,!1);i&&(this.bindCommonTimeNodeEvent(i),this.children[n]=i)})}else t.forEach(t=>{const e=this.createTimeNode(t,!1);e&&(this.bindCommonTimeNodeEvent(e),this.children.push(e))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(t=>t.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.timeDelta=0,this.children.forEach(t=>t.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(t=>t.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.isEndEventsEmitted=!1,this.timeDelta=0;const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(ZR.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(ZR.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(t=!0){if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce(()=>{this.onTimeLineEnd()})):this.duration>e&&(this.ctx.eventHub.emit(ZR.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}startIterate(){return MR(this,void 0,void 0,(function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const t of this.iterateShadows){if(this.isIterateEnd)break;t.children.forEach(t=>{t.commonTimeNode.startTimeNode()}),t.applyCount+=1,yield this.ctx.clock.delay(this.json.iterate.interval)}this.onTimeLineEnd()}}))}applyTimeFilter(t){if(!this.tmFilter.every(t=>Object(u.isNumber)(t[0])&&Object(u.isNumber)(t[1])))return t;for(let e=0;e<this.tmFilter.length;e++){const n=this.tmFilter[e];if(t<n[0]){const i=this.tmFilter[e-1];return(t-i[0])/(n[0]-i[0])*(n[1]-i[1])+i[1]}}return this.tmFilter.length>0?this.tmFilter[this.tmFilter.length-1][1]:t}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}findTargets(){const t=[],e=n=>{n.forEach(n=>{var i,r,o;n.cBhvr&&n.cBhvr.target&&t.findIndex(t=>t.id===n.cBhvr.target.id)<0&&t.push(n.cBhvr.target),(null===(r=null===(i=null==n?void 0:n.cBhvr)||void 0===i?void 0:i.ctn)||void 0===r?void 0:r.childTnLst)&&n.cBhvr.ctn.childTnLst.length>0&&e(n.cBhvr.ctn.childTnLst),(null===(o=null==n?void 0:n.ctn)||void 0===o?void 0:o.childTnLst)&&n.ctn.childTnLst.length>0&&e(n.ctn.childTnLst)})};return e(this.json.childTnLst||[]),t}setPreStyle(){this.json.presetClass&&this.findTargets().forEach(t=>{if(this.json.iterate){let e=0,n=!0;for(;n;){const i=this.ctx.timingTargets.getTarget(t,!0,{type:this.json.iterate.type,index:e,id:""});i&&(this.setPreStyleForTarget(i),e+=1),n=!!i}}else{const e=this.ctx.timingTargets.getTarget(t,!1);e&&this.setPreStyleForTarget(e)}})}setPreStyleForTarget(t){var e,n;if(t&&this.json.presetSubtype&&(t.presetSubType=this.json.presetSubtype),t&&!t.hasPreset)if("entr"===this.json.presetClass){const i=null===(n=null===(e=this.json)||void 0===e?void 0:e.childTnLst)||void 0===n?void 0:n.filter(t=>"set"===t.type&&"visible"===t.to);(null==i?void 0:i.length)&&(t.hasPreset=!0,t.style.visibility="hidden")}else("exit"===this.json.presetClass||"path"===this.json.presetClass)&&(t.hasPreset=!0,t.style.visibility="visible")}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(t=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(t);const e=this.json.stCondLst.filter(t=>/^self/.test(t.event||""))[0];e&&this.startConds.condHandle(e);const n=this.json.endCondLst.filter(t=>/^self/.test(t.event||""))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(t=>t.commonTimeNode.destroy())}seekToStart(t=!0){if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(e=>e.seekToStart(t));if(t)for(let t=this.subList.length-1;t>=0;t--){const e=this.subList[t];null==e||e.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const e=this.children[t];null==e||e.commonTimeNode.seekToStart()}for(let t=this.children.length-1;t>=0;t--){const e=this.children[t];null==e||e.commonTimeNode.seekToStart()}}dispose(t=!1){this.isConflictDispose=t,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(ZR.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch(t){}this.startConds.reset(),this.endConds.reset()}seekToEnd(t,e=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const n=this.json.autoRev||t;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(t=>t.seekToEnd(n,e));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(t=>t.commonTimeNode.seekToEnd(n,e)),e&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(t=>t.commonTimeNode.seekToEnd(!1)),this.clearSubList())}isTimeNodeEnd(){let t=!0;return this.children.length>0&&(t=t&&this.children.every(t=>t.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||(!(!this.isIterateEnd||!this.json.iterate)||t)}emitEndEvents(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(t=>t.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(t=>t.commonTimeNode.destroy()),this.clearSubList()}}class RR extends a.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new a.a;const{json:e,iterateType:n,isIterate:i,isSub:r,parent:o,ctx:s,eventHub:l,iterateIndex:u,iterateId:h}=t;this.id=e.ctn.id,this.json=e,this.ctx=s,this.isIterate=i,this.globalEventHub=l,this.commonTimeNode=new AR({json:e.ctn,isSub:r,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:s,parent:o,isIterate:!1,iterateType:n,iterateIndex:u,iterateId:h}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(t=>{t.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),t.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(t=>{t.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}var CR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class PR{constructor(t,e,n){this.json=t,this.ctx=n,this.globalEventHub=e;const i=t.timeNodeList.find(t=>"par"===t.type&&"tmRoot"===t.ctn.nodeType);i&&(this.tmRoot=new RR({json:i,isSub:!1,isIterate:!1,eventHub:e,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(t=>{var e,n,i;return"seq"===(null===(e=t.json)||void 0===e?void 0:e.type)&&"mainSeq"===(null===(i=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.nodeType)}))}findSeq(t){var e;return null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.find(e=>{var n,i,r;return"seq"===(null===(n=e.json)||void 0===n?void 0:n.type)&&(null===(r=null===(i=e.json)||void 0===i?void 0:i.ctn)||void 0===r?void 0:r.id)===t})}start(){var t,e;return CR(this,void 0,void 0,(function*(){this.json.autoPlayMainSeq?(yield this.ctx.clock.delay(16),null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode()):null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.startTimeNode()}))}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var t;null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.collectStartValue()}setMainSeqStep(t,e){var n;-1===t&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(n=this.mainSeq)||void 0===n||n.setCurrentStep(t,e)}destroy(){var t;this.globalEventHub.removeAllListeners(),null===(t=this.tmRoot)||void 0===t||t.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(t){const e=this.findSeq(t);e&&e.commonTimeNode.seekToEnd(!1,!0)}setInteractiveSeqState(t,e,n){const i=this.findSeq(t);i&&i.setCurrentStep(e,n)}resetAllInteractiveSeq(){var t;((null===(t=this.tmRoot)||void 0===t?void 0:t.commonTimeNode.children.filter(t=>{var e,n,i;return"seq"===(null===(e=t.json)||void 0===e?void 0:e.type)&&"interactiveSeq"===(null===(i=null===(n=t.json)||void 0===n?void 0:n.ctn)||void 0===i?void 0:i.nodeType)}))||[]).forEach(t=>{t.setCurrentStep(0,"start")})}applyInteractiveAction(t){this.globalEventHub.emit(t)}}var IR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class OR extends KA{constructor(t,e,n,i){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,n,void 0,i),this.isRendered=!1,this.isTimingStartValueCollected=!1,this.globalEventHub=new a.a,this.json=t,e.hasBackgroundFillShape=this.detectUseBackgroundFill(this.json),this.container.visible=!1,this.ctx=e;const r=new RT;r.beginFill(16777215),r.drawRect(0,0,t.width,t.height),r.endFill(),this.container.addChild(r)}detectUseBackgroundFill(t){return!!t&&("Picture"===t.type||"Shape"===t.type?t.useBgFill:!(!t.children||!Object(u.isArray)(t.children))&&t.children.some(t=>this.detectUseBackgroundFill(t)))}initOnReuse(){super.initOnReuse(),this.globalEventHub.on("c:prev slide",()=>{this.ctx.eventHub.emit(ZR.requestPrevSlide)}),this.globalEventHub.on("c:next slide",()=>{this.ctx.eventHub.emit(ZR.requestNextSlide)})}get interactiveContainer(){return this.container}render(t){this.isRendered||(this.isRendered=!0,super.render(t),t.addSubMTask(()=>IR(this,void 0,void 0,(function*(){this.ctx.eventHub.emit("StageRenderEnd")}))))}createTiming(){this.json.timing&&!this.timing&&(this.timing=new PR(this.json.timing,this.globalEventHub,this.ctx))}startTiming(){var t;return(null===(t=this.timing)||void 0===t?void 0:t.start())||Promise.resolve()}setMainSeqApplied(){var t;null===(t=this.timing)||void 0===t||t.setMainSeqApplied()}setMainSeqStep(t,e){var n;null===(n=this.timing)||void 0===n||n.setMainSeqStep(t,e)}collectMainSeqStartValue(){var t;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,null===(t=this.timing)||void 0===t||t.collectMainSeqStartValue())}hasTiming(){return!!this.timing}clearOnSlideChange(){this.ctx.eventHub.removeAllListeners(),this.globalEventHub.removeAllListeners(),super.clearOnSlideChange()}clearOnTransactionEnd(){var t,e;this.ctx.timingTargets.getTargets().forEach(t=>{t.hasPreset=!1}),null===(t=this.timing)||void 0===t||t.resetAllInteractiveSeq(),null===(e=this.timing)||void 0===e||e.destroy(),this.timing=void 0}destroy(){var t,e;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),null===(t=this.ctx.bgTexture)||void 0===t||t.destroy(!0),this.ctx.spriteTexture.destroy(),this.globalEventHub.removeAllListeners(),null===(e=this.timing)||void 0===e||e.destroy(),this.timing=void 0,super.destroy()}mainSeqStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.currentMainSeqStep())&&void 0!==e?e:0}mainSeqLength(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.currentMainSeqLength())&&void 0!==e?e:0}mainSeqHasNextStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.mainSeqHasNextStep())&&void 0!==e&&e}mainSeqHasPrevStep(){var t,e;return null!==(e=null===(t=this.timing)||void 0===t?void 0:t.mainSeqHasPrevStep())&&void 0!==e&&e}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(){var t;this.hasTiming()&&(null===(t=this.timing)||void 0===t?void 0:t.hasMainSeq())?(this.globalEventHub.emit("shape slide onStopAudio"),this.globalEventHub.emit("shape slide onNext")):this.ctx.eventHub.emit(ZR.requestNextSlide)}prevStep(){var t;this.hasTiming()&&(null===(t=this.timing)||void 0===t?void 0:t.hasMainSeq())?(this.globalEventHub.emit("shape slide onStopAudio"),this.globalEventHub.emit("shape slide onPrev")):this.ctx.eventHub.emit(ZR.requestPrevSlide)}applyInteractiveAction(t){var e;null===(e=this.timing)||void 0===e||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;null===(e=this.timing)||void 0===e||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,n){var i;null===(i=this.timing)||void 0===i||i.setInteractiveSeqState(t,e,n)}setMediaState(t,e){return IR(this,void 0,void 0,(function*(){const n=this.ctx.medias[t];n&&(e?yield n.play():yield n.pause())}))}setMediaCurrentTime(t,e){const n=this.ctx.medias[t];n&&n.seek(e)}}class LR{constructor(t){this.ticker=t,this.tasks=[],this.couldRunning=!1,this.applyNext=()=>{const t=this.tasks[0];t&&t.applyNext()},t.add(this.applyNext)}addTask(t){this.tasks.push(t),t.once("task-finish",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)}),t.once("task-error",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)})}start(){this.couldRunning=!0}stop(){this.couldRunning=!1}}var NR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};const DR=t=>new Promise(e=>setTimeout(e,t));class FR extends a.a{constructor(t,e,n){super(),this.slideIndex=t,this.taskId=e,this.logger=n,this.uuid=oM(),this.isCancel=!1,this.tasks=[]}addMTask(t){this.tasks.push({fn:t,state:"wait",sub:[]})}addSubMTask(t){let e=this.tasks.findIndex(t=>"running"===t.state);e<0&&(e=0),this.tasks[e].sub.push({fn:t,state:"wait",sub:[]})}cancel(){this.tasks=[],this.isCancel=!0}applyNext(){if(this.tasks.some(t=>"running"===t.state))return;if(this.tasks.some(t=>"error"===t.state))return;if(this.tasks.every(t=>"finish"===t.state))return void(this.isCancel||this.emit("task-finish"));const t=this.tasks.find(t=>"wait"===t.state);t&&(t.state="running",t.fn.apply(null).then(()=>{if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(e=>e===t);this.tasks.splice(e+1,0,...t.sub)}}).catch(e=>{t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",YE.transform(e),this.slideIndex)}))}applyAll(){return NR(this,void 0,void 0,(function*(){for(;!this.tasks.every(t=>"finish"===t.state);)if(this.tasks.some(t=>"running"===t.state))yield DR(16);else{if(this.tasks.some(t=>"error"===t.state))return;{const t=this.tasks.find(t=>"wait"===t.state);if(t){t.state="running";try{if((yield aM(()=>t.fn.apply(null),2e4))===sM)throw new YE(WE.RuntimeError,"subtask apply timeout");if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(e=>e===t);this.tasks.splice(e+1,0,...t.sub)}}catch(e){t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",YE.transform(e),this.slideIndex);break}}}}this.isCancel||this.emit("task-finish")}))}}var BR=n(54);const UR=new(n.n(BR).a),kR=UR.getDevice(),GR=UR.getBrowser(),HR=UR.getOS(),zR={isDesktop(){let t=!0;return"mobile"===kR.type&&(t=!1),/Samsung/.test(GR.name||"")&&(t=!1),window.__nativeTags&&window.__nativeTags.platform&&(t=!1),t},isIOS(){let t=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(t=!0),HR.name&&/iOS/.test(HR.name)&&(t=!0),t},isAndroid(){let t=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(t=!0),HR.name&&/android/i.test(HR.name)&&(t=!0),t},isLowGpuMemory(){var t,e;const n=null!==(e=null===(t=window.__nativeTags)||void 0===t?void 0:t.platform)&&void 0!==e?e:"";if(n){const t=n.split(" ");if(t[1]){if(/^iPad/.test(t[1])){const e=t[1].match(/^iPad(\d+)/);return!(e&&e[1]&&parseInt(e[1],10)>=6)}if(/^iPhone/.test(t[1])){const e=t[1].match(/^iPhone(\d+)/);return!(e&&e[1]&&parseInt(e[1],10)>=9)}return!1}return!1}return!0}};var jR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};class VR{constructor(t,e,n,i,r,o,s,a,l,u){this.loader=t,this.mode=e,this.renderer=n,this.ticker=i,this.view=r,this.clock=o,this.objPoolGroup=s,this.errorChannel=a,this.localstorage=l,this.logger=u,this.currentStageIndex=0,this.cacheCount=zR.isDesktop()?2:1,this.stageStates=Object.create(null),this.stageJsons=Object.create(null),this.stageCtxs=Object.create(null),this.stageImpls=Object.create(null),this.taskId="",this.url="",this.microTaskManager=new LR(i)}setResourceData(t,e){this.taskId=t,this.url=e}createCtx(t){const{task:e}=this.stageStates[t];e.addMTask(()=>jR(this,void 0,void 0,(function*(){const e=new cM(this.loader),n=new a.a,i={mode:this.mode,renderer:this.renderer,graphicsTexture:new xM,stageWidth:0,stageHeight:0,ticker:this.ticker,timingTargets:new wM(n),eventHub:n,view:this.view,medias:Object.create(null),lastViewedIndex:0,conflictTimeNodeManager:new bM,clock:this.clock,spriteTexture:e,slideIndex:t,objectPoolGroup:this.objPoolGroup,hasBackgroundFillShape:!1,slideScopeEventHub:new a.a,logger:this.logger};this.stageCtxs[t]=i})))}loadStageJson(t){const{task:e}=this.stageStates[t];e.addMTask(()=>jR(this,void 0,void 0,(function*(){const e=yield this.loader.fetchJson(`${this.url}/${this.taskId}/jsonOutput/slide-${t}.json`);this.stageJsons[t]=e,this.stageCtxs[t].stageWidth=e.width,this.stageCtxs[t].stageHeight=e.height})))}loadSpriteSheets(t){const{task:e}=this.stageStates[t];e.addMTask(()=>{const n=this.stageJsons[t],{spriteTexture:i}=this.stageCtxs[t],{coloredSheets:r,sheets:o}=n,s=r||o;return s&&s.forEach(t=>{e.addSubMTask(()=>i.loadSpriteSheetItem(this.url,this.taskId,t))}),Promise.resolve()})}createStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>{const n=this.stageJsons[t],i=this.stageCtxs[t],r=new OR(n,i,{x:0,y:0},e);return this.stageImpls[t]=r,Promise.resolve()})}preRenderStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>(this.stageImpls[t].preRender(e),Promise.resolve()))}createGraphicsTexture(t){const{task:e}=this.stageStates[t];e.addMTask(()=>jR(this,void 0,void 0,(function*(){const n=this.stageCtxs[t];n.graphicsTexture.pack().forEach((t,i)=>{e.addSubMTask(()=>n.graphicsTexture.render(t,i,this.objPoolGroup))})})))}renderStage(t){const{task:e}=this.stageStates[t];e.addMTask(()=>jR(this,void 0,void 0,(function*(){const n=this.stageImpls[t],i=this.stageCtxs[t];yield n.render(e),e.addSubMTask(()=>jR(this,void 0,void 0,(function*(){var e;const r=`snapshot-${t.toString()}-start`;if(!(yield null===(e=this.localstorage)||void 0===e?void 0:e.getItem(r))&&JR.platform.isLowGpuMemory()){n.createTiming(),n.container.visible=!0,n.collectMainSeqStartValue(),n.setMainSeqStep(0,"start");const t=zy.create({width:n.json.width,height:n.json.height,resolution:1});i.renderer.render(n.container,{renderTexture:t});const e=i.renderer.plugins.extract.base64(t,"image/jpeg");this.localstorage.setItem(r,e,!0).catch(()=>{}),n.container.visible=!1,t.destroy(),n.timing&&(n.timing.destroy(),n.timing=void 0)}})))})))}destroyStageByIndex(t){"load"===this.stageStates[t].state&&this.stageStates[t].task.cancel(),delete this.stageStates[t];this.stageImpls[t].destroy(),delete this.stageImpls[t],delete this.stageCtxs[t]}destroyStage(){Object.keys(this.stageImpls).forEach(t=>{const e=parseInt(t,10);Math.abs(this.currentStageIndex-e)>this.cacheCount&&this.destroyStageByIndex(e)})}destroyAllStage(){Object.keys(this.stageImpls).forEach(t=>{const e=parseInt(t,10);this.destroyStageByIndex(e)})}preload(t,e=!1){if(this.stageImpls[t]||this.stageStates[t])return Promise.resolve();const n=new FR(t,this.taskId,this.logger);return n.on("task-error",(t,e)=>{this.errorChannel.emit("error",t,e)}),this.stageStates[t]={state:"load",task:n},this.createCtx(t),this.loadStageJson(t),this.loadSpriteSheets(t),this.createStage(t),this.preRenderStage(t),this.createGraphicsTexture(t),this.renderStage(t),this.microTaskManager.addTask(n),e?n.applyAll():new Promise(e=>{n.once("task-finish",()=>{this.stageStates[t].state="finish";Object.keys(this.stageStates).length>2*this.cacheCount+1&&this.destroyStage(),e()})})}getStageJson(t){return this.stageJsons[t]||null}getStage(t){return jR(this,void 0,void 0,(function*(){this.currentStageIndex=t;const e=this.stageStates[t];return"finish"===(null==e?void 0:e.state)&&this.stageImpls[t]?this.stageImpls[t]:"load"===(null==e?void 0:e.state)?(yield e.task.applyAll(),this.stageImpls[t]):(yield this.preload(t,!0),this.stageImpls[t])}))}}var WR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};l.config({storeName:"slide_local_cache"});class XR{constructor(t){this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,l.ready(()=>{this.isIndexDBReady=!0}).catch(()=>{t.warn("local storage not ready",this.taskId)})}get couldUseIndexDBCache(){return this.isIndexDBReady&&this.taskId.length>0}attachTaskId(t){this.taskId=t}getItem(t){return WR(this,void 0,void 0,(function*(){let e=null;return this.couldUseIndexDBCache&&(e=yield aM(()=>l.getItem(`${this.taskId}/${t}`),500)),e=e===sM?null:e,e||this.memoryCache.get(t)||null}))}setItem(t,e,n=!1){return WR(this,void 0,void 0,(function*(){if(!this.couldUseIndexDBCache)return n&&this.memoryCache.set(t,e),Promise.resolve();(yield aM(()=>l.setItem(`${this.taskId}/${t}`,e).catch(()=>{n&&this.memoryCache.set(t,e)}),500))===sM&&n&&this.memoryCache.set(t,e)}))}dispose(){this.memoryCache=new Map,this.couldUseIndexDBCache&&l.keys().then(t=>{t.filter(t=>t.indexOf(this.taskId)>=0).forEach(t=>{l.removeItem(t).catch(()=>{})})})}}var qR=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))};r.skipHello();const YR={randomBar:"RandomLines",circle:"Shape",ripple:"Ripples",wipe:"Erase",dissolve:"Dissolve",morph:"Smooth",fade:"FadeInOut",push:"Push",split:"Separation",reveal:"Display",pull:"Uncover",cover:"Cover",flash:"Flash",checker:"Checkerboard",blinds:"WindowShades",curtains:"Curtain",fallOver:"Fall",drape:"Suspension",wheel:"Clock",comb:"Combing",warp:"Scale",peelOff:"PeelOff",flip:"Flip"},ZR={mainSeqStepChange:"mainSeqStepChange",mainSeqStateChange:"mainSeqStateChange",interactiveSeqStateChange:"interactiveSeqStateChange",interactiveSeqAction:"interactiveSeqAction",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",slideChange:"slideChange",renderStart:"renderStart",renderEnd:"renderEnd",hyperlinkTrigger:"hyperlinkTrigger",animateStart:"animateStart",animateEnd:"animateEnd",mediaSeek:"mediaSeek",mediaPlay:"mediaPlay",mediaPause:"mediaPause",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",userInput:"userInput"};class JR extends a.a{constructor(t,e,n,i={}){super(),this.errorChannel=new a.a,this.transactionPlayer=new sg,this.transactionSprite=new LT,this.isForward=!0,this.drawCall=0,this.scale=1,this.prevSlideBase64=null,this.fps=new qE,this.designWidth=0,this.designHeight=0,this.currentIndex=0,this.slideCount=0,this.runtime={drawCall:0,fps:0},this.onWebGLLost=()=>{this.errorChannel.emit("error",new YE(WE.CanvasCrash,"webgl context lost."))},this.logger=n,this.mode=t,this.localStorage=new XR(this.logger);let r=Math.max(window.devicePixelRatio,2);zR.isDesktop()||(r=1),this.config={minFPS:Object(u.isUndefined)(i.minFPS)?30:i.minFPS,maxFPS:Object(u.isUndefined)(i.maxFPS)?40:i.maxFPS,resolution:Object(u.isUndefined)(i.resolution)?r:i.resolution,autoFPS:!Object(u.isUndefined)(i.autoFPS)&&i.autoFPS,autoResolution:!Object(u.isUndefined)(i.autoResolution)&&i.autoResolution,transactionBgColor:Object(u.isUndefined)(i.transactionBgColor)?0:i.transactionBgColor},this.loader=new $E(this.localStorage,e,this.logger),this.app=new Nb({antialias:!0,autoDensity:!1,backgroundColor:16777215}),this.updateConfig(this.config),this.app.view.style.zIndex="1",this.app.stage.sortableChildren=!0;const o=this.app.renderer,{drawElements:s}=o.gl;o.gl.drawElements=(...t)=>{s.call(o.gl,...t),this.drawCall+=1},this.fps.on("update",t=>{if(t<this.config.minFPS){if(this.config.autoResolution){const t=.7*this.scale,e=this.app.renderer.resolution,n=Math.max(t,e-.1);n>=t&&this.updateResolution(n)}if(this.config.autoFPS){const t=14,{minFPS:e,maxFPS:n}=this.app.ticker,i=Math.max(t,e-2),r=Math.max(t,n-2);i>=t&&r>=t&&(this.app.ticker.minFPS=i,this.app.ticker.maxFPS=r)}}else if(t>this.config.maxFPS){if(this.config.autoResolution){const t=this.scale*this.config.resolution,e=this.app.renderer.resolution,n=Math.min(t,e+.1);n<=this.config.resolution&&this.updateResolution(n)}if(this.config.autoFPS){const t=this.config.minFPS,e=this.config.maxFPS,{minFPS:n,maxFPS:i}=this.app.ticker,r=Math.min(t,n+2),o=Math.min(e,i+2);r<=t&&o<=e&&(this.app.ticker.minFPS=r,this.app.ticker.maxFPS=o)}}}),this.app.ticker.add(()=>{this.runtime.drawCall=this.drawCall,this.runtime.fps=Math.floor(this.app.ticker.minFPS),this.drawCall=0},null,ny.LOW),this.clock=new uM(this.app.ticker),this.objPoolGroup=oM(),this.stagePool=new VR(this.loader,this.mode,this.app.renderer,this.app.ticker,this.app.view,this.clock,this.objPoolGroup,this.errorChannel,this.localStorage,this.logger),this.app.view.addEventListener("webglcontextlost",this.onWebGLLost)}get view(){return this.app.renderer?this.app.view:null}get nextSlideIndex(){var t;return(null===(t=this.currentStage)||void 0===t?void 0:t.json.nextIndex)?this.currentStage.json.nextIndex:this.currentIndex+1}get prevSlideIndex(){var t;return(null===(t=this.currentStage)||void 0===t?void 0:t.json.prevIndex)?this.currentStage.json.prevIndex:this.currentIndex-1}updateConfig(t){Object(u.isUndefined)(t.minFPS)||(this.config.minFPS=t.minFPS,this.app.ticker.minFPS=t.minFPS),Object(u.isUndefined)(t.maxFPS)||(this.config.maxFPS=t.maxFPS,this.app.ticker.maxFPS=t.maxFPS),Object(u.isUndefined)(t.resolution)||(this.config.resolution=t.resolution,this.updateResolution(this.scale*this.config.resolution)),Object(u.isUndefined)(t.autoFPS)||(this.config.autoFPS=t.autoFPS),Object(u.isUndefined)(t.autoResolution)||(this.config.autoResolution=t.autoResolution),Object(u.isUndefined)(t.transactionBgColor)||(this.config.transactionBgColor=t.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId)}preload(t){return qR(this,void 0,void 0,(function*(){t<1||t>this.slideCount||(this.logger.info(`preload slide ${t} begin`,this.taskId),yield this.stagePool.preload(t),this.logger.info(`preload slide ${t} end`,this.taskId))}))}setResourceData(t,e){this.logger.info("ppt player init config: "+JSON.stringify(this.config),t),this.logger.info("set resource to "+e,t),this.taskId=t,this.url=e,this.stagePool.setResourceData(t,e),this.localStorage.attachTaskId(t),this.loader.attachTaskId(t)}setInteractive(t){this.app.stage.interactive=t,this.app.stage.interactiveChildren=t}translateEvent(t,e){e.forEach(e=>{t.on(e,(...t)=>{this.emit(e,...t)})})}renderSlide(t,e=!1){var n;return qR(this,void 0,void 0,(function*(){this.logger.info("render slide "+t,this.taskId),this.emit(ZR.renderStart,t);const i=yield this.stagePool.getStage(t);this.translateEvent(i.ctx.eventHub,[ZR.mainSeqStepChange,ZR.mainSeqStateChange,ZR.hyperlinkTrigger,ZR.interactiveSeqAction,ZR.mainSeqStepStart,ZR.mainSeqStepEnd,ZR.animateStart,ZR.animateEnd,ZR.mediaPlay,ZR.mediaPause,ZR.mediaSeek,ZR.requestGotoSlide,ZR.requestNextSlide,ZR.requestPrevSlide,ZR.interactiveSeqStateChange,ZR.userInput]),this.currentIndex=Number(t);const{width:r,height:o,slideCount:s}=i.json;this.slideCount=s,this.designWidth=r,this.designHeight=o,i.json.transition&&i.json.transition.type&&!this.prevSlideBase64&&this.currentStage&&(this.prevSlideBase64=this.getBase64(this.currentStage)),null===(n=this.currentStage)||void 0===n||n.clearOnSlideChange();const a=this.currentStage;this.currentStage=i,i.initOnReuse(),i.createTiming(),i.container.visible=!0,i.collectMainSeqStartValue(),this.isForward?i.setMainSeqStep(0,"start"):i.setMainSeqStep(-1,"end");let l=null;if(i.json.transition&&i.json.transition.type){const n=t.toString()+(this.isForward||e?"-start":"-end"),i=yield this.localStorage.getItem("snapshot-"+n);l=i||this.getBase64(this.currentStage)}i.container.visible=!1,this.app.stage.addChild(i.container);let{transition:u}=i.json;!this.isForward&&(null==a?void 0:a.json.transition)&&(u=a.json.transition),this.prevSlideBase64&&l&&u&&u.type&&a&&i&&(yield this.playTransaction(this.prevSlideBase64,l,u,a,i),this.prevSlideBase64=null),this.isForward?yield i.startTiming():i.setMainSeqApplied(),this.updateResolution(this.config.resolution*this.scale),i.container.visible=!0,a&&(a.setMainSeqStep(0,"start"),a.clearOnTransactionEnd(),this.app.stage.removeChild(a.container)),i.ctx.slideScopeEventHub.emit("slide-render",i.ctx.slideIndex),this.emit(ZR.renderEnd,t),this.emit(ZR.slideChange,t),this.preload(t+1).catch(e=>{this.errorChannel.emit("error",YE.transform(e),t+1)}),this.preload(t-1).catch(e=>{this.errorChannel.emit("error",YE.transform(e),t-1)})}))}getBase64(t){if(!t.container.transform)return null;const e=zy.create({width:this.designWidth,height:this.designHeight,resolution:1});this.app.renderer.render(t.container,{renderTexture:e});const n=this.app.renderer.plugins.extract.base64(e,"image/jpeg");return e.destroy(!0),n}playTransaction(t,e,n,i,r){return qR(this,void 0,void 0,(function*(){const o=this.app.view.parentElement;if(t&&e&&o&&YR[n.type]&&this.transactionPlayer){this.transactionSprite.zIndex=999,this.transactionSprite.visible=!1,this.app.stage.addChild(this.transactionSprite);const o=this.transactionPlayer.renderer.domElement,s=Gy.from(o),a=()=>s.update();return this.app.ticker.add(a),this.transactionSprite.texture=s,setTimeout(()=>{this.transactionSprite.visible=!0},100),new Promise(o=>{var s,l,u,h;null===(s=this.transactionPlayer)||void 0===s||s.play({reverse:!this.isForward,prevTextureUrl:t,nextTextureUrl:e,textureWidth:this.designWidth,textureHeight:this.designHeight,presetType:YR[n.type],stageWidth:this.designWidth,stageHeight:this.designHeight,duration:null===(u=null===(l=this.currentStage)||void 0===l?void 0:l.json.transition)||void 0===u?void 0:u.dur,delay:0,clearColor:this.config.transactionBgColor,maxFPS:Math.ceil(null!==(h=this.config.maxFPS)&&void 0!==h?h:60),onTransactionEnd:()=>{var t,e;o(),i.container.visible=!1,r.container.visible=!0,null===(t=this.app.stage)||void 0===t||t.removeChild(this.transactionSprite),null===(e=this.app.ticker)||void 0===e||e.remove(a)}})})}return Promise.resolve()}))}scaleView(t,e=!1){if(this.view&&(this.view.style.width=Math.floor(this.designWidth*t)+"px",this.view.style.height=Math.floor(this.designHeight*t)+"px"),e){this.scale=t;const e=this.scale*this.config.resolution;this.updateResolution(e)}}updateResolution(t){this.app.ticker.addOnce(()=>{let e=zR.isDesktop()?t:1;for(;e*this.designWidth>5120||e*this.designHeight>5120;)e-=.1;this.app.renderer.resolution=e,this.app.renderer.plugins.interaction.resolution=this.app.renderer.resolution,this.app.renderer.resize(this.designWidth,this.designHeight)})}nextStep(){var t;this.logger.info("ppt play trigger next step",this.taskId);try{null===(t=this.currentStage)||void 0===t||t.nextStep()}catch(t){this.errorChannel.emit("error",YE.transform(t),this.currentIndex)}}prevStep(){var t;this.logger.info("ppt play trigger prev step",this.taskId);try{null===(t=this.currentStage)||void 0===t||t.prevStep()}catch(t){this.errorChannel.emit("error",YE.transform(t),this.currentIndex)}}mainSeqLength(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqLength())&&void 0!==e?e:0}mainSeqStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqStep())&&void 0!==e?e:0}setMainSeqStep(t,e){var n;null===(n=this.currentStage)||void 0===n||n.setMainSeqStep(t,e)}mainSeqState(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqState())&&void 0!==e?e:null}mainSeqHasNextStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqHasNextStep())&&void 0!==e&&e}mainSeqHasPrevStep(){var t,e;return null!==(e=null===(t=this.currentStage)||void 0===t?void 0:t.mainSeqHasPrevStep())&&void 0!==e&&e}nextTick(t){this.app.ticker.addOnce(()=>{t()},ny.LOW)}applyInteractiveAction(t){var e;null===(e=this.currentStage)||void 0===e||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;null===(e=this.currentStage)||void 0===e||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,n){var i;null===(i=this.currentStage)||void 0===i||i.setInteractiveSeqState(t,e,n)}setMediaState(t,e){var n;return qR(this,void 0,void 0,(function*(){yield null===(n=this.currentStage)||void 0===n?void 0:n.setMediaState(t,e)}))}setMediaCurrentTime(t,e){var n;null===(n=this.currentStage)||void 0===n||n.setMediaCurrentTime(t,e)}pause(){this.app.ticker.stop()}resume(){this.app.ticker.start()}getSnapshot(){return this.currentStage&&this.getBase64(this.currentStage)||""}createSnapshotForNextSlide(t){return qR(this,void 0,void 0,(function*(){const e=this.nextSlideIndex,n=this.stagePool.getStageJson(e);if(n&&n.transition&&n.transition.type&&this.currentStage&&this.transactionPlayer){const e=t?`snapshot-${this.currentStage.json.index}-start`:`snapshot-${this.currentStage.json.index}-end`;if(this.currentStage.timing&&(t?this.currentStage.timing.mainSeqHasPrevStep():this.currentStage.timing.mainSeqHasNextStep()))this.prevSlideBase64=this.getBase64(this.currentStage);else{const t=yield this.localStorage.getItem(e);t?this.prevSlideBase64=t:(this.prevSlideBase64=this.getBase64(this.currentStage),this.localStorage.setItem(e,this.prevSlideBase64,!0).catch(()=>{}))}}}))}clearLocalCache(){this.localStorage.dispose()}static clearLocalCache(){l.clear()}destroy(){var t;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost);try{this.app.renderer.filter.texturePool.clear(!0)}catch(t){}vM.collectObjectByGroup(this.objPoolGroup),_M.collectObjectByGroup(this.objPoolGroup),null===(t=this.transactionPlayer)||void 0===t||t.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage();try{this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext()}catch(t){}this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0})}catch(t){}}}JR.platform=zR,JR.RtcAudioClazz=null;var KR,$R=[],QR="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(KR||(KR={}));var tC,eC=function(t){return Object.freeze(t)},nC=function(t,e){this.inlineSize=t,this.blockSize=e,eC(this)},iC=function(){function t(t,e,n,i){return this.x=t,this.y=e,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,eC(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),rC=function(t){return t instanceof SVGElement&&"getBBox"in t},oC=function(t){if(rC(t)){var e=t.getBBox(),n=e.width,i=e.height;return!n&&!i}var r=t,o=r.offsetWidth,s=r.offsetHeight;return!(o||s||t.getClientRects().length)},sC=function(t){var e,n;if(t instanceof Element)return!0;var i=null===(n=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(i&&t instanceof i.Element)},aC="undefined"!=typeof window?window:{},lC=new WeakMap,uC=/auto|scroll/,hC=/^tb|vertical/,cC=/msie|trident/i.test(aC.navigator&&aC.navigator.userAgent),dC=function(t){return parseFloat(t||"0")},pC=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new nC((n?e:t)||0,(n?t:e)||0)},fC=eC({devicePixelContentBoxSize:pC(),borderBoxSize:pC(),contentBoxSize:pC(),contentRect:new iC(0,0,0,0)}),mC=function(t,e){if(void 0===e&&(e=!1),lC.has(t)&&!e)return lC.get(t);if(oC(t))return lC.set(t,fC),fC;var n=getComputedStyle(t),i=rC(t)&&t.ownerSVGElement&&t.getBBox(),r=!cC&&"border-box"===n.boxSizing,o=hC.test(n.writingMode||""),s=!i&&uC.test(n.overflowY||""),a=!i&&uC.test(n.overflowX||""),l=i?0:dC(n.paddingTop),u=i?0:dC(n.paddingRight),h=i?0:dC(n.paddingBottom),c=i?0:dC(n.paddingLeft),d=i?0:dC(n.borderTopWidth),p=i?0:dC(n.borderRightWidth),f=i?0:dC(n.borderBottomWidth),m=c+u,g=l+h,v=(i?0:dC(n.borderLeftWidth))+p,_=d+f,y=a?t.offsetHeight-_-t.clientHeight:0,x=s?t.offsetWidth-v-t.clientWidth:0,b=r?m+v:0,w=r?g+_:0,T=i?i.width:dC(n.width)-b-x,S=i?i.height:dC(n.height)-w-y,E=T+m+x+v,M=S+g+y+_,A=eC({devicePixelContentBoxSize:pC(Math.round(T*devicePixelRatio),Math.round(S*devicePixelRatio),o),borderBoxSize:pC(E,M,o),contentBoxSize:pC(T,S,o),contentRect:new iC(c,l,T,S)});return lC.set(t,A),A},gC=function(t,e,n){var i=mC(t,n),r=i.borderBoxSize,o=i.contentBoxSize,s=i.devicePixelContentBoxSize;switch(e){case KR.DEVICE_PIXEL_CONTENT_BOX:return s;case KR.BORDER_BOX:return r;default:return o}},vC=function(t){var e=mC(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=eC([e.borderBoxSize]),this.contentBoxSize=eC([e.contentBoxSize]),this.devicePixelContentBoxSize=eC([e.devicePixelContentBoxSize])},_C=function(t){if(oC(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},yC=function(){var t=1/0,e=[];$R.forEach((function(n){if(0!==n.activeTargets.length){var i=[];n.activeTargets.forEach((function(e){var n=new vC(e.target),r=_C(e.target);i.push(n),e.lastReportedSize=gC(e.target,e.observedBox),r<t&&(t=r)})),e.push((function(){n.callback.call(n.observer,i,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,i=e;n<i.length;n++){(0,i[n])()}return t},xC=function(t){$R.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(n){n.isActive()&&(_C(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))}))}))},bC=function(){var t,e=0;for(xC(e);$R.some((function(t){return t.activeTargets.length>0}));)e=yC(),xC(e);return $R.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:QR}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=QR),window.dispatchEvent(t)),e>0},wC=[],TC=function(t){if(!tC){var e=0,n=document.createTextNode("");new MutationObserver((function(){return wC.splice(0).forEach((function(t){return t()}))})).observe(n,{characterData:!0}),tC=function(){n.textContent=""+(e?e--:e++)}}wC.push(t),tC()},SC=0,EC={attributes:!0,characterData:!0,childList:!0,subtree:!0},MC=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],AC=function(t){return void 0===t&&(t=0),Date.now()+t},RC=!1,CC=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!RC){RC=!0;var n,i=AC(t);n=function(){var n=!1;try{n=bC()}finally{if(RC=!1,t=i-AC(),!SC)return;n?e.run(1e3):t>0?e.run(t):e.start()}},TC((function(){requestAnimationFrame(n)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,EC)};document.body?e():aC.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),MC.forEach((function(e){return aC.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),MC.forEach((function(e){return aC.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),PC=function(t){!SC&&t>0&&CC.start(),!(SC+=t)&&CC.stop()},IC=function(){function t(t,e){this.target=t,this.observedBox=e||KR.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=gC(this.target,this.observedBox,!0);return t=this.target,rC(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),OC=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},LC=new WeakMap,NC=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},DC=function(){function t(){}return t.connect=function(t,e){var n=new OC(t,e);LC.set(t,n)},t.observe=function(t,e,n){var i=LC.get(t),r=0===i.observationTargets.length;NC(i.observationTargets,e)<0&&(r&&$R.push(i),i.observationTargets.push(new IC(e,n&&n.box)),PC(1),CC.schedule())},t.unobserve=function(t,e){var n=LC.get(t),i=NC(n.observationTargets,e),r=1===n.observationTargets.length;i>=0&&(r&&$R.splice($R.indexOf(n),1),n.observationTargets.splice(i,1),PC(-1))},t.disconnect=function(t){var e=this,n=LC.get(t);n.observationTargets.slice().forEach((function(n){return e.unobserve(t,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},t}(),FC=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");DC.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!sC(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");DC.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!sC(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");DC.unobserve(this,t)},t.prototype.disconnect=function(){DC.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}(),BC=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))},UC=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},kC=function(){function t(t,e,n,i,r){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=n,this.index=t,this.slideIndex=e,this.eventHub=i,this.id=r}return t.prototype.apply=function(){return BC(this,void 0,void 0,(function(){var t;return UC(this,(function(e){switch(e.label){case 0:this.eventHub.emit("task-start",this),e.label=1;case 1:return e.trys.push([1,3,,4]),this.state="start",[4,this.fn()];case 2:return e.sent(),this.state="end",this.eventHub.emit("task-end",this),[3,4];case 3:return t=e.sent(),this.eventHub.emit("task-error",{task:this,error:t}),[3,4];case 4:return[2]}}))}))},t}(),GC=function(){function t(){var t=this;this.eventHub=new a.a,this.tasks=[],this.index=0,this.eventHub.on("task-end",(function(e){var n,i=t.tasks.findIndex((function(t){return t.index===e.index})),r=i+1;r>=0&&(null===(n=t.tasks[r])||void 0===n||n.apply()),i>=0&&(t.tasks.splice(i,1),t.replaceIdleTask()),t.eventHub.emit("task-end-"+e.id)})),this.eventHub.on("task-error",(function(e){var n=e.task,i=t.tasks.findIndex((function(t){return t.index===n.index}));i>=0&&(t.tasks.splice(i,1),t.replaceIdleTask())}))}return t.prototype.replaceIdleTask=function(){for(var t,e=this,n=new Set,i=0,r=this.tasks.length;i<r;i++)"idle"===this.tasks[i].state&&"idle"===(null===(t=this.tasks[i+1])||void 0===t?void 0:t.state)&&n.add(i);Array.from(n).forEach((function(t){e.tasks.splice(t,1)}))},t.prototype.addTask=function(t,e,n){var i=new kC(this.index++,e,t,this.eventHub,n);this.tasks.push(i),this.tasks.sort((function(t,e){return t.index-e.index})),this.replaceIdleTask(),1===this.tasks.length&&i.apply()},t.prototype.hasStartTask=function(){return this.tasks.some((function(t){return"start"===t.state}))},t}();function HC(t,e){var n=t.__state.conversionName.toString(),i=Math.round(t.r),r=Math.round(t.g),o=Math.round(t.b),s=t.a,a=Math.round(t.h),l=t.s.toFixed(1),u=t.v.toFixed(1);if(e||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var h=t.hex.toString(16);h.length<6;)h="0"+h;return"#"+h}return"CSS_RGB"===n?"rgb("+i+","+r+","+o+")":"CSS_RGBA"===n?"rgba("+i+","+r+","+o+","+s+")":"HEX"===n?"0x"+t.hex.toString(16):"RGB_ARRAY"===n?"["+i+","+r+","+o+"]":"RGBA_ARRAY"===n?"["+i+","+r+","+o+","+s+"]":"RGB_OBJ"===n?"{r:"+i+",g:"+r+",b:"+o+"}":"RGBA_OBJ"===n?"{r:"+i+",g:"+r+",b:"+o+",a:"+s+"}":"HSV_OBJ"===n?"{h:"+a+",s:"+l+",v:"+u+"}":"HSVA_OBJ"===n?"{h:"+a+",s:"+l+",v:"+u+",a:"+s+"}":"unknown format"}var zC=Array.prototype.forEach,jC=Array.prototype.slice,VC={BREAK:{},extend:function(t){return this.each(jC.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(n){this.isUndefined(e[n])||(t[n]=e[n])}.bind(this))}),this),t},defaults:function(t){return this.each(jC.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(n){this.isUndefined(t[n])&&(t[n]=e[n])}.bind(this))}),this),t},compose:function(){var t=jC.call(arguments);return function(){for(var e=jC.call(arguments),n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},each:function(t,e,n){if(t)if(zC&&t.forEach&&t.forEach===zC)t.forEach(e,n);else if(t.length===t.length+0){var i,r=void 0;for(r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===this.BREAK)return}else for(var o in t)if(e.call(n,t[o],o)===this.BREAK)return},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i=void 0;return function(){var r=this,o=arguments;function s(){i=null,n||t.apply(r,o)}var a=n||!i;clearTimeout(i),i=setTimeout(s,e),a&&t.apply(r,o)}},toArray:function(t){return t.toArray?t.toArray():jC.call(t)},isUndefined:function(t){return void 0===t},isNull:function(t){return null===t},isNaN:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return isNaN(t)})),isArray:Array.isArray||function(t){return t.constructor===Array},isObject:function(t){return t===Object(t)},isNumber:function(t){return t===t+0},isString:function(t){return t===t+""},isBoolean:function(t){return!1===t||!0===t},isFunction:function(t){return t instanceof Function}},WC=[{litmus:VC.isString,conversions:{THREE_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:HC},SIX_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9]{6})$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:HC},CSS_RGB:{read:function(t){var e=t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:HC},CSS_RGBA:{read:function(t){var e=t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:HC}}},{litmus:VC.isNumber,conversions:{HEX:{read:function(t){return{space:"HEX",hex:t,conversionName:"HEX"}},write:function(t){return t.hex}}}},{litmus:VC.isArray,conversions:{RGB_ARRAY:{read:function(t){return 3===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2]}},write:function(t){return[t.r,t.g,t.b]}},RGBA_ARRAY:{read:function(t){return 4===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2],a:t[3]}},write:function(t){return[t.r,t.g,t.b,t.a]}}}},{litmus:VC.isObject,conversions:{RGBA_OBJ:{read:function(t){return!!(VC.isNumber(t.r)&&VC.isNumber(t.g)&&VC.isNumber(t.b)&&VC.isNumber(t.a))&&{space:"RGB",r:t.r,g:t.g,b:t.b,a:t.a}},write:function(t){return{r:t.r,g:t.g,b:t.b,a:t.a}}},RGB_OBJ:{read:function(t){return!!(VC.isNumber(t.r)&&VC.isNumber(t.g)&&VC.isNumber(t.b))&&{space:"RGB",r:t.r,g:t.g,b:t.b}},write:function(t){return{r:t.r,g:t.g,b:t.b}}},HSVA_OBJ:{read:function(t){return!!(VC.isNumber(t.h)&&VC.isNumber(t.s)&&VC.isNumber(t.v)&&VC.isNumber(t.a))&&{space:"HSV",h:t.h,s:t.s,v:t.v,a:t.a}},write:function(t){return{h:t.h,s:t.s,v:t.v,a:t.a}}},HSV_OBJ:{read:function(t){return!!(VC.isNumber(t.h)&&VC.isNumber(t.s)&&VC.isNumber(t.v))&&{space:"HSV",h:t.h,s:t.s,v:t.v}},write:function(t){return{h:t.h,s:t.s,v:t.v}}}}}],XC=void 0,qC=void 0,YC=function(){qC=!1;var t=arguments.length>1?VC.toArray(arguments):arguments[0];return VC.each(WC,(function(e){if(e.litmus(t))return VC.each(e.conversions,(function(e,n){if(XC=e.read(t),!1===qC&&!1!==XC)return qC=XC,XC.conversionName=n,XC.conversion=e,VC.BREAK})),VC.BREAK})),qC},ZC=void 0,JC={hsv_to_rgb:function(t,e,n){var i=Math.floor(t/60)%6,r=t/60-Math.floor(t/60),o=n*(1-e),s=n*(1-r*e),a=n*(1-(1-r)*e),l=[[n,a,o],[s,n,o],[o,n,a],[o,s,n],[a,o,n],[n,o,s]][i];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(t,e,n){var i=Math.min(t,e,n),r=Math.max(t,e,n),o=r-i,s=void 0;return 0===r?{h:NaN,s:0,v:0}:(s=t===r?(e-n)/o:e===r?2+(n-t)/o:4+(t-e)/o,(s/=6)<0&&(s+=1),{h:360*s,s:o/r,v:r/255})},rgb_to_hex:function(t,e,n){var i=this.hex_with_component(0,2,t);return i=this.hex_with_component(i,1,e),i=this.hex_with_component(i,0,n)},component_from_hex:function(t,e){return t>>8*e&255},hex_with_component:function(t,e,n){return n<<(ZC=8*e)|t&~(255<<ZC)}},KC="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},$C=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},QC=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),tP=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},eP=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},nP=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},iP=function(){function t(){if($C(this,t),this.__state=YC.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return QC(t,[{key:"toString",value:function(){return HC(this)}},{key:"toHexString",value:function(){return HC(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),t}();function rP(t,e,n){Object.defineProperty(t,e,{get:function(){return"RGB"===this.__state.space||iP.recalculateRGB(this,e,n),this.__state[e]},set:function(t){"RGB"!==this.__state.space&&(iP.recalculateRGB(this,e,n),this.__state.space="RGB"),this.__state[e]=t}})}function oP(t,e){Object.defineProperty(t,e,{get:function(){return"HSV"===this.__state.space||iP.recalculateHSV(this),this.__state[e]},set:function(t){"HSV"!==this.__state.space&&(iP.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}iP.recalculateRGB=function(t,e,n){if("HEX"===t.__state.space)t.__state[e]=JC.component_from_hex(t.__state.hex,n);else{if("HSV"!==t.__state.space)throw new Error("Corrupted color state");VC.extend(t.__state,JC.hsv_to_rgb(t.__state.h,t.__state.s,t.__state.v))}},iP.recalculateHSV=function(t){var e=JC.rgb_to_hsv(t.r,t.g,t.b);VC.extend(t.__state,{s:e.s,v:e.v}),VC.isNaN(e.h)?VC.isUndefined(t.__state.h)&&(t.__state.h=0):t.__state.h=e.h},iP.COMPONENTS=["r","g","b","h","s","v","hex","a"],rP(iP.prototype,"r",2),rP(iP.prototype,"g",1),rP(iP.prototype,"b",0),oP(iP.prototype,"h"),oP(iP.prototype,"s"),oP(iP.prototype,"v"),Object.defineProperty(iP.prototype,"a",{get:function(){return this.__state.a},set:function(t){this.__state.a=t}}),Object.defineProperty(iP.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=JC.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(t){this.__state.space="HEX",this.__state.hex=t}});var sP=function(){function t(e,n){$C(this,t),this.initialValue=e[n],this.domElement=document.createElement("div"),this.object=e,this.property=n,this.__onChange=void 0,this.__onFinishChange=void 0}return QC(t,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),t}(),aP={};VC.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(t,e){VC.each(t,(function(t){aP[t]=e}))}));var lP=/(\d+(\.\d+)?)px/;function uP(t){if("0"===t||VC.isUndefined(t))return 0;var e=t.match(lP);return VC.isNull(e)?0:parseFloat(e[1])}var hP={makeSelectable:function(t,e){void 0!==t&&void 0!==t.style&&(t.onselectstart=e?function(){return!1}:function(){},t.style.MozUserSelect=e?"auto":"none",t.style.KhtmlUserSelect=e?"auto":"none",t.unselectable=e?"on":"off")},makeFullscreen:function(t,e,n){var i=n,r=e;VC.isUndefined(r)&&(r=!0),VC.isUndefined(i)&&(i=!0),t.style.position="absolute",r&&(t.style.left=0,t.style.right=0),i&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,e,n,i){var r=n||{},o=aP[e];if(!o)throw new Error("Event type "+e+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=r.x||r.clientX||0,l=r.y||r.clientY||0;s.initMouseEvent(e,r.bubbles||!1,r.cancelable||!0,window,r.clickCount||1,0,0,a,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var u=s.initKeyboardEvent||s.initKeyEvent;VC.defaults(r,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),u(e,r.bubbles||!1,r.cancelable,window,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode);break;default:s.initEvent(e,r.bubbles||!1,r.cancelable||!0)}VC.defaults(s,i),t.dispatchEvent(s)},bind:function(t,e,n,i){var r=i||!1;return t.addEventListener?t.addEventListener(e,n,r):t.attachEvent&&t.attachEvent("on"+e,n),hP},unbind:function(t,e,n,i){var r=i||!1;return t.removeEventListener?t.removeEventListener(e,n,r):t.detachEvent&&t.detachEvent("on"+e,n),hP},addClass:function(t,e){if(void 0===t.className)t.className=e;else if(t.className!==e){var n=t.className.split(/ +/);-1===n.indexOf(e)&&(n.push(e),t.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return hP},removeClass:function(t,e){if(e)if(t.className===e)t.removeAttribute("class");else{var n=t.className.split(/ +/),i=n.indexOf(e);-1!==i&&(n.splice(i,1),t.className=n.join(" "))}else t.className=void 0;return hP},hasClass:function(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1},getWidth:function(t){var e=getComputedStyle(t);return uP(e["border-left-width"])+uP(e["border-right-width"])+uP(e["padding-left"])+uP(e["padding-right"])+uP(e.width)},getHeight:function(t){var e=getComputedStyle(t);return uP(e["border-top-width"])+uP(e["border-bottom-width"])+uP(e["padding-top"])+uP(e["padding-bottom"])+uP(e.height)},getOffset:function(t){var e=t,n={left:0,top:0};if(e.offsetParent)do{n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent}while(e);return n},isActive:function(t){return t===document.activeElement&&(t.type||t.href)}},cP=function(t){function e(t,n){$C(this,e);var i=nP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),r=i;return i.__prev=i.getValue(),i.__checkbox=document.createElement("input"),i.__checkbox.setAttribute("type","checkbox"),hP.bind(i.__checkbox,"change",(function(){r.setValue(!r.__prev)}),!1),i.domElement.appendChild(i.__checkbox),i.updateDisplay(),i}return eP(e,t),QC(e,[{key:"setValue",value:function(t){var n=tP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),tP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(sP),dP=function(t){function e(t,n,i){$C(this,e);var r=nP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i,s=r;if(r.__select=document.createElement("select"),VC.isArray(o)){var a={};VC.each(o,(function(t){a[t]=t})),o=a}return VC.each(o,(function(t,e){var n=document.createElement("option");n.innerHTML=e,n.setAttribute("value",t),s.__select.appendChild(n)})),r.updateDisplay(),hP.bind(r.__select,"change",(function(){var t=this.options[this.selectedIndex].value;s.setValue(t)})),r.domElement.appendChild(r.__select),r}return eP(e,t),QC(e,[{key:"setValue",value:function(t){var n=tP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return hP.isActive(this.__select)?this:(this.__select.value=this.getValue(),tP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e}(sP),pP=function(t){function e(t,n){$C(this,e);var i=nP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),r=i;function o(){r.setValue(r.__input.value)}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),hP.bind(i.__input,"keyup",o),hP.bind(i.__input,"change",o),hP.bind(i.__input,"blur",(function(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())})),hP.bind(i.__input,"keydown",(function(t){13===t.keyCode&&this.blur()})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return eP(e,t),QC(e,[{key:"updateDisplay",value:function(){return hP.isActive(this.__input)||(this.__input.value=this.getValue()),tP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(sP);function fP(t){var e=t.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var mP=function(t){function e(t,n,i){$C(this,e);var r=nP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=i||{};return r.__min=o.min,r.__max=o.max,r.__step=o.step,VC.isUndefined(r.__step)?0===r.initialValue?r.__impliedStep=1:r.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(r.initialValue))/Math.LN10))/10:r.__impliedStep=r.__step,r.__precision=fP(r.__impliedStep),r}return eP(e,t),QC(e,[{key:"setValue",value:function(t){var n=t;return void 0!==this.__min&&n<this.__min?n=this.__min:void 0!==this.__max&&n>this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),tP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(t){return this.__min=t,this}},{key:"max",value:function(t){return this.__max=t,this}},{key:"step",value:function(t){return this.__step=t,this.__impliedStep=t,this.__precision=fP(t),this}}]),e}(sP);var gP=function(t){function e(t,n,i){$C(this,e);var r=nP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));r.__truncationSuspended=!1;var o=r,s=void 0;function a(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function l(t){var e=s-t.clientY;o.setValue(o.getValue()+e*o.__impliedStep),s=t.clientY}function u(){hP.unbind(window,"mousemove",l),hP.unbind(window,"mouseup",u),a()}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),hP.bind(r.__input,"change",(function(){var t=parseFloat(o.__input.value);VC.isNaN(t)||o.setValue(t)})),hP.bind(r.__input,"blur",(function(){a()})),hP.bind(r.__input,"mousedown",(function(t){hP.bind(window,"mousemove",l),hP.bind(window,"mouseup",u),s=t.clientY})),hP.bind(r.__input,"keydown",(function(t){13===t.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,a())})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return eP(e,t),QC(e,[{key:"updateDisplay",value:function(){var t,n,i;return this.__input.value=this.__truncationSuspended?this.getValue():(t=this.getValue(),n=this.__precision,i=Math.pow(10,n),Math.round(t*i)/i),tP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(mP);function vP(t,e,n,i,r){return i+(t-e)/(n-e)*(r-i)}var _P=function(t){function e(t,n,i,r,o){$C(this,e);var s=nP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,{min:i,max:r,step:o})),a=s;function l(t){t.preventDefault();var e=a.__background.getBoundingClientRect();return a.setValue(vP(t.clientX,e.left,e.right,a.__min,a.__max)),!1}function u(){hP.unbind(window,"mousemove",l),hP.unbind(window,"mouseup",u),a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}function h(t){var e=t.touches[0].clientX,n=a.__background.getBoundingClientRect();a.setValue(vP(e,n.left,n.right,a.__min,a.__max))}function c(){hP.unbind(window,"touchmove",h),hP.unbind(window,"touchend",c),a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())}return s.__background=document.createElement("div"),s.__foreground=document.createElement("div"),hP.bind(s.__background,"mousedown",(function(t){document.activeElement.blur(),hP.bind(window,"mousemove",l),hP.bind(window,"mouseup",u),l(t)})),hP.bind(s.__background,"touchstart",(function(t){if(1!==t.touches.length)return;hP.bind(window,"touchmove",h),hP.bind(window,"touchend",c),h(t)})),hP.addClass(s.__background,"slider"),hP.addClass(s.__foreground,"slider-fg"),s.updateDisplay(),s.__background.appendChild(s.__foreground),s.domElement.appendChild(s.__background),s}return eP(e,t),QC(e,[{key:"updateDisplay",value:function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",tP(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(mP),yP=function(t){function e(t,n,i){$C(this,e);var r=nP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n)),o=r;return r.__button=document.createElement("div"),r.__button.innerHTML=void 0===i?"Fire":i,hP.bind(r.__button,"click",(function(t){return t.preventDefault(),o.fire(),!1})),hP.addClass(r.__button,"button"),r.domElement.appendChild(r.__button),r}return eP(e,t),QC(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e}(sP),xP=function(t){function e(t,n){$C(this,e);var i=nP(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));i.__color=new iP(i.getValue()),i.__temp=new iP(0);var r=i;i.domElement=document.createElement("div"),hP.makeSelectable(i.domElement,!1),i.__selector=document.createElement("div"),i.__selector.className="selector",i.__saturation_field=document.createElement("div"),i.__saturation_field.className="saturation-field",i.__field_knob=document.createElement("div"),i.__field_knob.className="field-knob",i.__field_knob_border="2px solid ",i.__hue_knob=document.createElement("div"),i.__hue_knob.className="hue-knob",i.__hue_field=document.createElement("div"),i.__hue_field.className="hue-field",i.__input=document.createElement("input"),i.__input.type="text",i.__input_textShadow="0 1px 1px ",hP.bind(i.__input,"keydown",(function(t){13===t.keyCode&&c.call(this)})),hP.bind(i.__input,"blur",c),hP.bind(i.__selector,"mousedown",(function(){hP.addClass(this,"drag").bind(window,"mouseup",(function(){hP.removeClass(r.__selector,"drag")}))})),hP.bind(i.__selector,"touchstart",(function(){hP.addClass(this,"drag").bind(window,"touchend",(function(){hP.removeClass(r.__selector,"drag")}))}));var o,s=document.createElement("div");function a(t){p(t),hP.bind(window,"mousemove",p),hP.bind(window,"touchmove",p),hP.bind(window,"mouseup",u),hP.bind(window,"touchend",u)}function l(t){f(t),hP.bind(window,"mousemove",f),hP.bind(window,"touchmove",f),hP.bind(window,"mouseup",h),hP.bind(window,"touchend",h)}function u(){hP.unbind(window,"mousemove",p),hP.unbind(window,"touchmove",p),hP.unbind(window,"mouseup",u),hP.unbind(window,"touchend",u),d()}function h(){hP.unbind(window,"mousemove",f),hP.unbind(window,"touchmove",f),hP.unbind(window,"mouseup",h),hP.unbind(window,"touchend",h),d()}function c(){var t=YC(this.value);!1!==t?(r.__color.__state=t,r.setValue(r.__color.toOriginal())):this.value=r.__color.toString()}function d(){r.__onFinishChange&&r.__onFinishChange.call(r,r.__color.toOriginal())}function p(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=r.__saturation_field.getBoundingClientRect(),n=t.touches&&t.touches[0]||t,i=n.clientX,o=n.clientY,s=(i-e.left)/(e.right-e.left),a=1-(o-e.top)/(e.bottom-e.top);return a>1?a=1:a<0&&(a=0),s>1?s=1:s<0&&(s=0),r.__color.v=a,r.__color.s=s,r.setValue(r.__color.toOriginal()),!1}function f(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=r.__hue_field.getBoundingClientRect(),n=1-((t.touches&&t.touches[0]||t).clientY-e.top)/(e.bottom-e.top);return n>1?n=1:n<0&&(n=0),r.__color.h=360*n,r.setValue(r.__color.toOriginal()),!1}return VC.extend(i.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),VC.extend(i.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:i.__field_knob_border+(i.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),VC.extend(i.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),VC.extend(i.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),VC.extend(s.style,{width:"100%",height:"100%",background:"none"}),wP(s,"top","rgba(0,0,0,0)","#000"),VC.extend(i.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=i.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",VC.extend(i.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:i.__input_textShadow+"rgba(0,0,0,0.7)"}),hP.bind(i.__saturation_field,"mousedown",a),hP.bind(i.__saturation_field,"touchstart",a),hP.bind(i.__field_knob,"mousedown",a),hP.bind(i.__field_knob,"touchstart",a),hP.bind(i.__hue_field,"mousedown",l),hP.bind(i.__hue_field,"touchstart",l),i.__saturation_field.appendChild(s),i.__selector.appendChild(i.__field_knob),i.__selector.appendChild(i.__saturation_field),i.__selector.appendChild(i.__hue_field),i.__hue_field.appendChild(i.__hue_knob),i.domElement.appendChild(i.__input),i.domElement.appendChild(i.__selector),i.updateDisplay(),i}return eP(e,t),QC(e,[{key:"updateDisplay",value:function(){var t=YC(this.getValue());if(!1!==t){var e=!1;VC.each(iP.COMPONENTS,(function(n){if(!VC.isUndefined(t[n])&&!VC.isUndefined(this.__color.__state[n])&&t[n]!==this.__color.__state[n])return e=!0,{}}),this),e&&VC.extend(this.__color.__state,t)}VC.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,i=255-n;VC.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,wP(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),VC.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+i+","+i+","+i+",.7)"})}}]),e}(sP),bP=["-moz-","-o-","-webkit-","-ms-",""];function wP(t,e,n,i){t.style.background="",VC.each(bP,(function(r){t.style.cssText+="background: "+r+"linear-gradient("+e+", "+n+" 0%, "+i+" 100%); "}))}var TP=function(t,e){var n=e||document,i=document.createElement("style");i.type="text/css",i.innerHTML=t;var r=n.getElementsByTagName("head")[0];try{r.appendChild(i)}catch(t){}},SP='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',EP=function(t,e){var n=t[e];return VC.isArray(arguments[2])||VC.isObject(arguments[2])?new dP(t,e,arguments[2]):VC.isNumber(n)?VC.isNumber(arguments[2])&&VC.isNumber(arguments[3])?VC.isNumber(arguments[4])?new _P(t,e,arguments[2],arguments[3],arguments[4]):new _P(t,e,arguments[2],arguments[3]):VC.isNumber(arguments[4])?new gP(t,e,{min:arguments[2],max:arguments[3],step:arguments[4]}):new gP(t,e,{min:arguments[2],max:arguments[3]}):VC.isString(n)?new pP(t,e):VC.isFunction(n)?new yP(t,e,""):VC.isBoolean(n)?new cP(t,e):null};var MP=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)},AP=function(){function t(){$C(this,t),this.backgroundElement=document.createElement("div"),VC.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),hP.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),VC.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;hP.bind(this.backgroundElement,"click",(function(){e.hide()}))}return QC(t,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),VC.defer((function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",hP.unbind(t.domElement,"webkitTransitionEnd",e),hP.unbind(t.domElement,"transitionend",e),hP.unbind(t.domElement,"oTransitionEnd",e)};hP.bind(this.domElement,"webkitTransitionEnd",e),hP.bind(this.domElement,"transitionend",e),hP.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-hP.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-hP.getHeight(this.domElement)/2+"px"}}]),t}();TP(function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=t,document.head.appendChild(e),t}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var RP=function(){try{return!!window.localStorage}catch(t){return!1}}(),CP=void 0,PP=!0,IP=void 0,OP=!1,LP=[],NP=function t(e){var n=this,i=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),hP.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],i=VC.defaults(i,{closeOnTop:!1,autoPlace:!0,width:t.DEFAULT_WIDTH}),i=VC.defaults(i,{resizable:i.autoPlace,hideable:i.autoPlace}),VC.isUndefined(i.load)?i.load={preset:"Default"}:i.preset&&(i.load.preset=i.preset),VC.isUndefined(i.parent)&&i.hideable&&LP.push(this),i.resizable=VC.isUndefined(i.parent)&&i.resizable,i.autoPlace&&VC.isUndefined(i.scrollable)&&(i.scrollable=!0);var r,o=RP&&"true"===localStorage.getItem(GP(this,"isLocal")),s=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return i.parent}},scrollable:{get:function(){return i.scrollable}},autoPlace:{get:function(){return i.autoPlace}},closeOnTop:{get:function(){return i.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:i.load.preset},set:function(t){n.parent?n.getRoot().preset=t:i.load.preset=t,function(t){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].value===t.preset&&(t.__preset_select.selectedIndex=e)}(this),n.revert()}},width:{get:function(){return i.width},set:function(t){i.width=t,WP(n,t)}},name:{get:function(){return i.name},set:function(t){i.name=t,a&&(a.innerHTML=i.name)}},closed:{get:function(){return i.closed},set:function(e){i.closed=e,i.closed?hP.addClass(n.__ul,t.CLASS_CLOSED):hP.removeClass(n.__ul,t.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=e?t.TEXT_OPEN:t.TEXT_CLOSED)}},load:{get:function(){return i.load}},useLocalStorage:{get:function(){return o},set:function(t){RP&&(o=t,t?hP.bind(window,"unload",s):hP.unbind(window,"unload",s),localStorage.setItem(GP(n,"isLocal"),t))}}}),VC.isUndefined(i.parent)){if(this.closed=i.closed||!1,hP.addClass(this.domElement,t.CLASS_MAIN),hP.makeSelectable(this.domElement,!1),RP&&o){n.useLocalStorage=!0;var l=localStorage.getItem(GP(this,"gui"));l&&(i.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=t.TEXT_CLOSED,hP.addClass(this.__closeButton,t.CLASS_CLOSE_BUTTON),i.closeOnTop?(hP.addClass(this.__closeButton,t.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(hP.addClass(this.__closeButton,t.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),hP.bind(this.__closeButton,"click",(function(){n.closed=!n.closed}))}else{void 0===i.closed&&(i.closed=!0);var u=document.createTextNode(i.name);hP.addClass(u,"controller-name"),a=DP(n,u);hP.addClass(this.__ul,t.CLASS_CLOSED),hP.addClass(a,"title"),hP.bind(a,"click",(function(t){return t.preventDefault(),n.closed=!n.closed,!1})),i.closed||(this.closed=!1)}i.autoPlace&&(VC.isUndefined(i.parent)&&(PP&&(IP=document.createElement("div"),hP.addClass(IP,"dg"),hP.addClass(IP,t.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(IP),PP=!1),IP.appendChild(this.domElement),hP.addClass(this.domElement,t.CLASS_AUTO_PLACE)),this.parent||WP(n,i.width)),this.__resizeHandler=function(){n.onResizeDebounced()},hP.bind(window,"resize",this.__resizeHandler),hP.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),hP.bind(this.__ul,"transitionend",this.__resizeHandler),hP.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),i.resizable&&VP(this),s=function(){RP&&"true"===localStorage.getItem(GP(n,"isLocal"))&&localStorage.setItem(GP(n,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=s,i.parent||((r=n.getRoot()).width+=1,VC.defer((function(){r.width-=1})))};function DP(t,e,n){var i=document.createElement("li");return e&&i.appendChild(e),n?t.__ul.insertBefore(i,n):t.__ul.appendChild(i),t.onResize(),i}function FP(t){hP.unbind(window,"resize",t.__resizeHandler),t.saveToLocalStorageIfPossible&&hP.unbind(window,"unload",t.saveToLocalStorageIfPossible)}function BP(t,e){var n=t.__preset_select[t.__preset_select.selectedIndex];n.innerHTML=e?n.value+"*":n.value}function UP(t,e){var n=t.getRoot(),i=n.__rememberedObjects.indexOf(e.object);if(-1!==i){var r=n.__rememberedObjectIndecesToControllers[i];if(void 0===r&&(r={},n.__rememberedObjectIndecesToControllers[i]=r),r[e.property]=e,n.load&&n.load.remembered){var o=n.load.remembered,s=void 0;if(o[t.preset])s=o[t.preset];else{if(!o.Default)return;s=o.Default}if(s[i]&&void 0!==s[i][e.property]){var a=s[i][e.property];e.initialValue=a,e.setValue(a)}}}}function kP(t,e,n,i){if(void 0===e[n])throw new Error('Object "'+e+'" has no property "'+n+'"');var r=void 0;if(i.color)r=new xP(e,n);else{var o=[e,n].concat(i.factoryArgs);r=EP.apply(t,o)}i.before instanceof sP&&(i.before=i.before.__li),UP(t,r),hP.addClass(r.domElement,"c");var s=document.createElement("span");hP.addClass(s,"property-name"),s.innerHTML=r.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(r.domElement);var l=DP(t,a,i.before);return hP.addClass(l,NP.CLASS_CONTROLLER_ROW),r instanceof xP?hP.addClass(l,"color"):hP.addClass(l,KC(r.getValue())),function(t,e,n){if(n.__li=e,n.__gui=t,VC.extend(n,{options:function(e){if(arguments.length>1){var i=n.__li.nextElementSibling;return n.remove(),kP(t,n.object,n.property,{before:i,factoryArgs:[VC.toArray(arguments)]})}if(VC.isArray(e)||VC.isObject(e)){var r=n.__li.nextElementSibling;return n.remove(),kP(t,n.object,n.property,{before:r,factoryArgs:[e]})}},name:function(t){return n.__li.firstElementChild.firstElementChild.innerHTML=t,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof _P){var i=new gP(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});VC.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(t){var e=n[t],r=i[t];n[t]=i[t]=function(){var t=Array.prototype.slice.call(arguments);return r.apply(i,t),e.apply(n,t)}})),hP.addClass(e,"has-slider"),n.domElement.insertBefore(i.domElement,n.domElement.firstElementChild)}else if(n instanceof gP){var r=function(e){if(VC.isNumber(n.__min)&&VC.isNumber(n.__max)){var i=n.__li.firstElementChild.firstElementChild.innerHTML,r=n.__gui.__listening.indexOf(n)>-1;n.remove();var o=kP(t,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return o.name(i),r&&o.listen(),o}return e};n.min=VC.compose(r,n.min),n.max=VC.compose(r,n.max)}else n instanceof cP?(hP.bind(e,"click",(function(){hP.fakeEvent(n.__checkbox,"click")})),hP.bind(n.__checkbox,"click",(function(t){t.stopPropagation()}))):n instanceof yP?(hP.bind(e,"click",(function(){hP.fakeEvent(n.__button,"click")})),hP.bind(e,"mouseover",(function(){hP.addClass(n.__button,"hover")})),hP.bind(e,"mouseout",(function(){hP.removeClass(n.__button,"hover")}))):n instanceof xP&&(hP.addClass(e,"color"),n.updateDisplay=VC.compose((function(t){return e.style.borderLeftColor=n.__color.toString(),t}),n.updateDisplay),n.updateDisplay());n.setValue=VC.compose((function(e){return t.getRoot().__preset_select&&n.isModified()&&BP(t.getRoot(),!0),e}),n.setValue)}(t,l,r),t.__controllers.push(r),r}function GP(t,e){return document.location.href+"."+e}function HP(t,e,n){var i=document.createElement("option");i.innerHTML=e,i.value=e,t.__preset_select.appendChild(i),n&&(t.__preset_select.selectedIndex=t.__preset_select.length-1)}function zP(t,e){e.style.display=t.useLocalStorage?"block":"none"}function jP(t){var e=t.__save_row=document.createElement("li");hP.addClass(t.domElement,"has-save"),t.__ul.insertBefore(e,t.__ul.firstChild),hP.addClass(e,"save-row");var n=document.createElement("span");n.innerHTML="&nbsp;",hP.addClass(n,"button gears");var i=document.createElement("span");i.innerHTML="Save",hP.addClass(i,"button"),hP.addClass(i,"save");var r=document.createElement("span");r.innerHTML="New",hP.addClass(r,"button"),hP.addClass(r,"save-as");var o=document.createElement("span");o.innerHTML="Revert",hP.addClass(o,"button"),hP.addClass(o,"revert");var s=t.__preset_select=document.createElement("select");if(t.load&&t.load.remembered?VC.each(t.load.remembered,(function(e,n){HP(t,n,n===t.preset)})):HP(t,"Default",!1),hP.bind(s,"change",(function(){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].innerHTML=t.__preset_select[e].value;t.preset=this.value})),e.appendChild(s),e.appendChild(n),e.appendChild(i),e.appendChild(r),e.appendChild(o),RP){var a=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(GP(0,"isLocal"))&&l.setAttribute("checked","checked"),zP(t,a),hP.bind(l,"change",(function(){t.useLocalStorage=!t.useLocalStorage,zP(t,a)}))}var u=document.getElementById("dg-new-constructor");hP.bind(u,"keydown",(function(t){!t.metaKey||67!==t.which&&67!==t.keyCode||CP.hide()})),hP.bind(n,"click",(function(){u.innerHTML=JSON.stringify(t.getSaveObject(),void 0,2),CP.show(),u.focus(),u.select()})),hP.bind(i,"click",(function(){t.save()})),hP.bind(r,"click",(function(){var e=prompt("Enter a new preset name.");e&&t.saveAs(e)})),hP.bind(o,"click",(function(){t.revert()}))}function VP(t){var e=void 0;function n(n){return n.preventDefault(),t.width+=e-n.clientX,t.onResize(),e=n.clientX,!1}function i(){hP.removeClass(t.__closeButton,NP.CLASS_DRAG),hP.unbind(window,"mousemove",n),hP.unbind(window,"mouseup",i)}function r(r){return r.preventDefault(),e=r.clientX,hP.addClass(t.__closeButton,NP.CLASS_DRAG),hP.bind(window,"mousemove",n),hP.bind(window,"mouseup",i),!1}t.__resize_handle=document.createElement("div"),VC.extend(t.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),hP.bind(t.__resize_handle,"mousedown",r),hP.bind(t.__closeButton,"mousedown",r),t.domElement.insertBefore(t.__resize_handle,t.domElement.firstElementChild)}function WP(t,e){t.domElement.style.width=e+"px",t.__save_row&&t.autoPlace&&(t.__save_row.style.width=e+"px"),t.__closeButton&&(t.__closeButton.style.width=e+"px")}function XP(t,e){var n={};return VC.each(t.__rememberedObjects,(function(i,r){var o={},s=t.__rememberedObjectIndecesToControllers[r];VC.each(s,(function(t,n){o[n]=e?t.initialValue:t.getValue()})),n[r]=o})),n}NP.toggleHide=function(){OP=!OP,VC.each(LP,(function(t){t.domElement.style.display=OP?"none":""}))},NP.CLASS_AUTO_PLACE="a",NP.CLASS_AUTO_PLACE_CONTAINER="ac",NP.CLASS_MAIN="main",NP.CLASS_CONTROLLER_ROW="cr",NP.CLASS_TOO_TALL="taller-than-window",NP.CLASS_CLOSED="closed",NP.CLASS_CLOSE_BUTTON="close-button",NP.CLASS_CLOSE_TOP="close-top",NP.CLASS_CLOSE_BOTTOM="close-bottom",NP.CLASS_DRAG="drag",NP.DEFAULT_WIDTH=245,NP.TEXT_CLOSED="Close Controls",NP.TEXT_OPEN="Open Controls",NP._keydownHandler=function(t){"text"===document.activeElement.type||72!==t.which&&72!==t.keyCode||NP.toggleHide()},hP.bind(window,"keydown",NP._keydownHandler,!1),VC.extend(NP.prototype,{add:function(t,e){return kP(this,t,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(t,e){return kP(this,t,e,{color:!0})},remove:function(t){this.__ul.removeChild(t.__li),this.__controllers.splice(this.__controllers.indexOf(t),1);var e=this;VC.defer((function(){e.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&IP.removeChild(this.domElement);var t=this;VC.each(this.__folders,(function(e){t.removeFolder(e)})),hP.unbind(window,"keydown",NP._keydownHandler,!1),FP(this)},addFolder:function(t){if(void 0!==this.__folders[t])throw new Error('You already have a folder in this GUI by the name "'+t+'"');var e={name:t,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[t]&&(e.closed=this.load.folders[t].closed,e.load=this.load.folders[t]);var n=new NP(e);this.__folders[t]=n;var i=DP(this,n.domElement);return hP.addClass(i,"folder"),n},removeFolder:function(t){this.__ul.removeChild(t.domElement.parentElement),delete this.__folders[t.name],this.load&&this.load.folders&&this.load.folders[t.name]&&delete this.load.folders[t.name],FP(t);var e=this;VC.each(t.__folders,(function(e){t.removeFolder(e)})),VC.defer((function(){e.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var t=this.getRoot();if(t.scrollable){var e=hP.getOffset(t.__ul).top,n=0;VC.each(t.__ul.childNodes,(function(e){t.autoPlace&&e===t.__save_row||(n+=hP.getHeight(e))})),window.innerHeight-e-20<n?(hP.addClass(t.domElement,NP.CLASS_TOO_TALL),t.__ul.style.height=window.innerHeight-e-20+"px"):(hP.removeClass(t.domElement,NP.CLASS_TOO_TALL),t.__ul.style.height="auto")}t.__resize_handle&&VC.defer((function(){t.__resize_handle.style.height=t.__ul.offsetHeight+"px"})),t.__closeButton&&(t.__closeButton.style.width=t.width+"px")},onResizeDebounced:VC.debounce((function(){this.onResize()}),50),remember:function(){if(VC.isUndefined(CP)&&((CP=new AP).domElement.innerHTML=SP),this.parent)throw new Error("You can only call remember on a top level GUI.");var t=this;VC.each(Array.prototype.slice.call(arguments),(function(e){0===t.__rememberedObjects.length&&jP(t),-1===t.__rememberedObjects.indexOf(e)&&t.__rememberedObjects.push(e)})),this.autoPlace&&WP(this,this.width)},getRoot:function(){for(var t=this;t.parent;)t=t.parent;return t},getSaveObject:function(){var t=this.load;return t.closed=this.closed,this.__rememberedObjects.length>0&&(t.preset=this.preset,t.remembered||(t.remembered={}),t.remembered[this.preset]=XP(this)),t.folders={},VC.each(this.__folders,(function(e,n){t.folders[n]=e.getSaveObject()})),t},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=XP(this),BP(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(t){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=XP(this,!0)),this.load.remembered[t]=XP(this),this.preset=t,HP(this,t,!0),this.saveToLocalStorageIfPossible()},revert:function(t){VC.each(this.__controllers,(function(e){this.getRoot().load.remembered?UP(t||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())}),this),VC.each(this.__folders,(function(t){t.revert(t)})),t||BP(this.getRoot(),!1)},listen:function(t){var e=0===this.__listening.length;this.__listening.push(t),e&&function t(e){0!==e.length&&MP.call(window,(function(){t(e)}));VC.each(e,(function(t){t.updateDisplay()}))}(this.__listening)},updateDisplay:function(){VC.each(this.__controllers,(function(t){t.updateDisplay()})),VC.each(this.__folders,(function(t){t.updateDisplay()}))}});var qP=NP,YP=function(){function t(t){this.runTime={fps:0,resolution:""},this.target=t.target,this.data=t.params,this.player=t.player,this.gui=this.createControllerGUI(),this.createStats(),this.addEventListener()}return t.prototype.createStats=function(){var t=this;this.stateId=setInterval((function(){t.player.view&&(t.controller.runTimeFps.setValue(t.player.fps.value),t.controller.drawCall.setValue(t.player.runtime.drawCall),t.controller.runTimeResolution.setValue(t.player.view.width+"*"+t.player.view.height))}),500)},t.prototype.createControllerGUI=function(){var t,e,n,i,r,o=new qP({autoPlace:!0,closed:!0});o.domElement.style.opacity=".6",o.domElement.style.transformOrigin="100% 0",o.domElement.style.transform="scale(1)",this.target.appendChild(o.domElement),o.domElement.style.position="absolute",o.domElement.style.right="0",o.domElement.style.top="0",o.domElement.style.zIndex="2";var s=o.add({FPS:0},"FPS",0),a=o.add({drawCall:0},"drawCall",0),l=o.add({"分辨率":""},"分辨率",""),u=o.add({"额外计算":0},"额外计算",0,200),h=o.addFolder("renderOptions");return this.controller={runTimeResolution:l,runTimeFps:s,drawCall:a,moreCalculation:u,minFPS:h.add({"最低fps":null!==(t=this.data.minFPS)&&void 0!==t?t:40},"最低fps",0,60),maxFPS:h.add({"最高fps":null!==(e=this.data.maxFPS)&&void 0!==e?e:50},"最高fps",0,60),resolution:h.add({"目标分辨倍率":null!==(n=this.data.resolution)&&void 0!==n?n:window.devicePixelRatio},"目标分辨倍率",.5,6),autoResolution:h.add({"自动分辨率":null!==(i=this.data.autoResolution)&&void 0!==i&&i},"自动分辨率",!0),autoFps:h.add({"自动fps":null===(r=this.data.autoFPS)||void 0===r||r},"自动fps",!0),transactionBgColor:h.addColor({"切页背景色":this.data.transactionBgColor},"切页背景色")},this.controller.runTimeFps.disabled=!0,this.controller.runTimeResolution.disabled=!0,o},t.prototype.addEventListener=function(){var t,e=this;this.controller.autoFps.onChange((function(t){e.data.autoFPS=t,e.player.updateConfig(e.data)})),this.controller.maxFPS.onChange((function(t){e.data.maxFPS=t,e.player.updateConfig(e.data)})),this.controller.minFPS.onChange((function(t){e.data.minFPS=t,e.player.updateConfig(e.data)})),this.controller.autoResolution.onChange((function(t){e.data.autoResolution=t,e.player.updateConfig(e.data)})),this.controller.resolution.onChange((function(t){e.data.resolution=t,e.player.updateConfig(e.data)})),this.controller.transactionBgColor.onChange((function(t){e.data.transactionBgColor=t,e.player.updateConfig(e.data)})),this.controller.moreCalculation.onChange((function(n){t&&e.player.app.ticker.remove(t),n>0&&(t=function(){for(var t="";t.length<8e3*n;)t+=Math.random().toString(32).substr(2);pM()(t)},e.player.app.ticker.add(t))}))},t.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.target.removeChild(this.gui.domElement),this.gui.destroy()}catch(t){}},t}(),ZP=function(){function t(t){var e=this;this.tasks=[],this.schedule=function(){var t=e.tasks[0];t?e.fn(t).then((function(){e.tasks.splice(0,1),window.requestAnimationFrame(e.schedule)})):window.requestAnimationFrame(e.schedule)},this.fn=t,this.schedule()}return t.prototype.addTask=function(t){this.tasks.push(t)},t}(),JP=function(){function t(t){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=t}return t.prototype.addLock=function(t,e){var n=this;this.available&&(this.locks[t]=e,this.autoUnlock[t]=window.setTimeout((function(){delete n.locks[t]}),3e3))},t.prototype.unlock=function(t,e){this.available&&e&&this.locks[t]&&this.locks[t]===e&&(window.clearTimeout(this.autoUnlock[t]),delete this.locks[t])},t.prototype.isLocked=function(t){return!!this.available&&!!this.locks[t]},t}(),KP=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),$P=function(){return($P=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},QP=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))},tI=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};window.__slide_local_logger__||(window.__slide_local_logger__=o.createInstance({name:"_slide_local_log_",driver:o.INDEXEDDB,version:1}));var eI=window.ResizeObserver||FC,nI=function(t){return new Promise((function(e){return setTimeout(e,t)}))};function iI(t,e){return QP(this,void 0,void 0,(function(){var n;return tI(this,(function(i){switch(i.label){case 0:n=Date.now(),i.label=1;case 1:return!t()&&Date.now()-n<e?[4,nI(50)]:[3,3];case 2:return i.sent(),[3,1];case 3:return[2]}}))}))}var rI={syncDispatch:"syncDispatch",syncReceive:"syncReceive",syncEventLag:"syncEventLag",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd",stateChange:"stateChange"},oI={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,mediaState:Object.create(null),interactiveSeqState:Object.create(null)},sI="";try{sI="0.3.6"}catch(t){sI="dev"}var aI=function(t){function e(e){var n=t.call(this)||this;return n.iosResetCache=[],n.needClearCacheImage=!1,n.version=sI,n.__slideState=Object(u.cloneDeep)(oI),n.userInputTime=0,n.isSyncingSlideState=!1,n.resize=!1,n.isAnimating=!1,n.renderingTaskManager=new GC,n.isLoading=!1,n.interactive=!0,n.frameWidth=1,n.frameHeight=1,n.frame=document.createElement("div"),n.medianController=document.createElement("div"),n.frameResizeObserver=new eI((function(){return n.frameResizeHandler()})),n.timestamp=function(){return Date.now()},n.mode="local",n.enableGlobalClick=!1,n.lastEmitedState=null,n.playerController=null,n.isInitResized=!1,n.cacheImage=document.createElement("img"),n.isFrowning=!1,n.isReleasing=!1,n.isTouchStart=!1,n.touchStartId=void 0,n.taskId="",n.designWidth=0,n.designHeight=0,n._slideCount=0,n._dispatchIncrId=0,n._receiveIncrId=0,n.userInputHandle=function(){n.userInputTime=Date.now()},n.handleViewClick=function(){setTimeout((function(){var t=Date.now();Math.abs(t-n.userInputTime)>500&&n.enableGlobalClick&&n.nextStep()}))},n.handleViewTouchStart=function(){window.clearTimeout(n.touchStartId),n.isTouchStart=!0,n.touchStartId=setTimeout((function(){n.isTouchStart=!1}),350)},n.handleViewTouchEnd=function(){n.isTouchStart&&(n.isTouchStart=!1,n.handleViewClick())},n.handleSlideRef=function(){console.log(n),window.__slide=n},n.receiveSyncHandler=function(t){return QP(n,void 0,void 0,(function(){var e,n,i,r,o=this;return tI(this,(function(s){switch(s.label){case 0:return Object(u.isNumber)(t.incrId)&&(t.incrId-this._receiveIncrId!=1&&this.emit(rI.syncEventLag),this._receiveIncrId=t.incrId),this.logger.info("sync receive "+JSON.stringify(t),this.taskId),"nextStep"!==t.type?[3,1]:(this.mainSeqStep!==t.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(t.next,"start"),this.player.nextTick((function(){o.doNextStep()}))):this.doNextStep(),[3,6]);case 1:return"prevStep"!==t.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===t.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep():(this.setMainSeqStep(t.next+1,"start"),null===(e=this.player)||void 0===e||e.nextTick((function(){o.doPrevStep()}))),[3,6]);case 2:return"interactiveAnim"!==t.type?[3,3]:(this.player?this.player.applyInteractiveAction(t.action):this.__slideState.interactiveSeqState[t.seqId].step+=1,[3,6]);case 3:return"renderSlide"!==t.type?[3,5]:[4,this.doRenderSlide(t.index,t.isForward)];case 4:return s.sent(),[3,6];case 5:"mediaPlay"===t.type?(null===(n=this.player)||void 0===n||n.setMediaState(t.id,!0),this.__slideState.mediaState[t.id]=t.state):"mediaPause"===t.type?(null===(i=this.player)||void 0===i||i.setMediaState(t.id,!1),this.__slideState.mediaState[t.id]=t.state):"mediaSeek"===t.type&&(null===(r=this.player)||void 0===r||r.setMediaCurrentTime(t.id,t.time),this.__slideState.mediaState[t.id]=t.state),s.label=6;case 6:return[2]}}))}))},n.handlePrevSlide=function(){return QP(n,void 0,void 0,(function(){var t,e;return tI(this,(function(n){switch(n.label){case 0:return this.player?[4,null===(e=this.player)||void 0===e?void 0:e.createSnapshotForNextSlide(!0)]:[2];case 1:return n.sent(),(t=this.player.prevSlideIndex)>=1&&this.renderSlide(t,!1),[2]}}))}))},n.handleNextSlide=function(){return QP(n,void 0,void 0,(function(){var t,e;return tI(this,(function(n){switch(n.label){case 0:return this.player?[4,null===(e=this.player)||void 0===e?void 0:e.createSnapshotForNextSlide(!1)]:[2];case 1:return n.sent(),(t=this.player.nextSlideIndex)<=this.slideCount&&this.renderSlide(t,!0),[2]}}))}))},n.handleGotoSlide=function(t){if(t<=n.slideCount&&t>=1){var e=n.slideState.currentSlideIndex<=t;n.renderSlide(t,e)}else-1===t&&n.renderSlide(n.slideCount,!0)},e.timestamp&&(n.timestamp=e.timestamp),e.rtcAudio&&(JR.RtcAudioClazz=e.rtcAudio),n.logger={info:function(t,n){var i,r;(null===(i=e.logger)||void 0===i?void 0:i.info)&&(null===(r=e.logger)||void 0===r||r.info("["+n+"] "+t))},warn:function(t,n){var i,r;(null===(i=e.logger)||void 0===i?void 0:i.warn)&&(null===(r=e.logger)||void 0===r||r.warn("["+n+"] "+t))},error:function(t,n){var i,r;(null===(i=e.logger)||void 0===i?void 0:i.error)&&(null===(r=e.logger)||void 0===r||r.error("["+n+"] "+t))}},n.config=e,n.syncQueue=new ZP(n.receiveSyncHandler),n.mode=e.mode,n.lock=new JP("interactive"===n.mode),n.anchor=e.anchor,n.enableGlobalClick=!Object(u.isUndefined)(e.enableGlobalClick)&&e.enableGlobalClick,n.resize=e.resize||!1,n.interactive=e.interactive,n.cacheImage.style.position="absolute",n.cacheImage.style.zIndex="100",n.frame.style.cssText="width:100%;height:100%;display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;",n.setMedianControllerAttribute(),n.frame.appendChild(n.medianController),n.anchor.appendChild(n.frame),n.frameResizeObserver.observe(n.frame),n.on(rI.syncReceive,(function(t){n.lock.unlock(t.type,t.uuid),n.syncQueue.addTask(t)})),n.renderingTaskManager.eventHub.on("task-error",(function(t){var e=t.error,i=t.task,r=YE.transform(e);r.errorType===WE.RuntimeWarn?n.logger.warn(r.message,n.taskId):n.logger.error(r.message,n.taskId),n.emit(rI.renderError,{error:r,index:i.slideIndex})})),window.addEventListener("__slide_ref__",n.handleSlideRef),n.resizeView=Object(u.debounce)(n.resizeView.bind(n),50),n.player=n.initPlayer(e),(null==e?void 0:e.controller)&&n.createController(),n.player.view&&n.frame.appendChild(n.player.view),n.handleViewClick=Object(u.debounce)(n.handleViewClick,300),n.player.errorChannel.on("error",(function(t,e){var i=YE.transform(t);i.errorType===WE.RuntimeWarn?n.logger.warn(i.message,n.taskId):n.logger.error(i.message,n.taskId),n.isLoading=!1,n.emit(rI.renderError,{error:t,index:e})})),n}return KP(e,t),Object.defineProperty(e.prototype,"dispatchIncrId",{get:function(){return this._dispatchIncrId++},enumerable:!1,configurable:!0}),e.prototype.initPlayer=function(t){var e,n,i,r=this,o=new JR(this.mode,!!Object(u.isUndefined)(this.config.useLocalCache)||this.config.useLocalCache,this.logger);return o.setInteractive(this.interactive),o.updateConfig(t.renderOptions||{}),o.on(ZR.renderStart,(function(t){r.isLoading=!0,r.emit(rI.renderStart,t)})),o.on(ZR.renderEnd,(function(t){r.isLoading=!1,r.player&&(r.designHeight=r.player.designHeight,r.designWidth=r.player.designWidth,r.cacheImage.style.width=r.player.designWidth+"px",r.cacheImage.style.height=r.player.designHeight+"px",r._slideCount=r.player.slideCount),r.emit(rI.renderEnd,t)})),o.on(ZR.slideChange,(function(t){r.__slideState.currentSlideIndex=t,r.emit(rI.slideChange,t)})),o.on(ZR.mainSeqStateChange,(function(t){r.__slideState.mainSeqState=t,r.emitStateChange()})),o.on(ZR.mainSeqStepChange,(function(t){r.__slideState.mainSeqStep=t,r.emitStateChange()})),o.on(ZR.interactiveSeqStateChange,(function(t){var e=t.id,n=t.state;r.__slideState.interactiveSeqState[e]=n,r.emitStateChange()})),o.on(ZR.animateStart,(function(){!0!==r.isAnimating&&(r.isAnimating=!0,r.emit(rI.animateStart))})),o.on(ZR.animateEnd,(function(){!1!==r.isAnimating&&(r.isAnimating=!1,r.emit(rI.animateEnd))})),o.on(ZR.interactiveSeqAction,(function(t){var e=t.action,n=t.seqId;r.emitSyncDispatch({slideIndex:r.__slideState.currentSlideIndex,type:"interactiveAnim",action:e,seqId:n}),r.emitStateChange()})),o.on(ZR.mainSeqStepStart,(function(t){r.emit(rI.mainSeqStepStart,t)})),o.on(ZR.mainSeqStepEnd,(function(t){r.emit(rI.mainSeqStepEnd,t)})),o.on(ZR.mediaPlay,(function(t){var e={type:"play",time:r.timestamp()-1e3*t.time};r.__slideState.mediaState[t.id]=e,r.emitSyncDispatch({slideIndex:r.__slideState.currentSlideIndex,type:"mediaPlay",id:t.id,state:e}),r.emitStateChange()})),o.on(ZR.mediaPause,(function(t){var e={type:"pause",time:t.time};r.__slideState.mediaState[t.id]=e,r.emitSyncDispatch({slideIndex:r.__slideState.currentSlideIndex,type:"mediaPause",id:t.id,state:e}),r.emitStateChange()})),o.on(ZR.mediaSeek,(function(t){var e={type:"pause",time:0};t.isPlaying?(e.type="play",r.__slideState.mediaState[t.id]?e.time=r.__slideState.mediaState[t.id].time-1e3*t.time:e.time=r.timestamp()-1e3*t.time,r.__slideState.mediaState[t.id]=e):(e.type="pause",e.time=t.time,r.__slideState.mediaState[t.id]=e),r.emitSyncDispatch({slideIndex:r.__slideState.currentSlideIndex,type:"mediaSeek",id:t.id,time:t.time,state:e}),r.emitStateChange()})),o.on(ZR.requestPrevSlide,this.handlePrevSlide),o.on(ZR.requestNextSlide,this.handleNextSlide),o.on(ZR.requestGotoSlide,this.handleGotoSlide),null===(e=o.view)||void 0===e||e.addEventListener("touchend",this.handleViewTouchEnd),null===(n=o.view)||void 0===n||n.addEventListener("touchstart",this.handleViewTouchStart),null===(i=o.view)||void 0===i||i.addEventListener("click",this.handleViewClick),o.on(ZR.userInput,this.userInputHandle),o},e.prototype.createController=function(){this.player&&(this.playerController=new YP({player:this.player,params:this.player.config||{},target:this.frame}))},e.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2"},e.prototype.frameResizeHandler=function(){var t=this.frame.getBoundingClientRect(),e=t.width,n=t.height;this.frameWidth=e,this.frameHeight=n,this.resizeView()},e.prototype.resizeView=function(){var t,e,n=this,i=this.width,r=this.height;if(i>0&&r>0){var o=this.frameWidth/i,s=o*r;s>this.frameHeight&&(o*=this.frameHeight/s),null===(t=this.player)||void 0===t||t.scaleView(o,this.resize),this.cacheImage.style.transform="scale("+o+")",this.medianController.style.transform="scale("+o+")",this.medianController.style.top=(this.frameHeight-r*o)/2+"px",this.medianController.setAttribute("data-scale",o.toString()),this.isInitResized||(this.isInitResized=!0,null===(e=this.player)||void 0===e||e.clock.setTimeout((function(){n.frame.style.visibility="visible"}),32))}},e.prototype.setSlideState=function(t){var e,n,i;return QP(this,void 0,void 0,(function(){var r,o=this;return tI(this,(function(s){switch(s.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(t),this.taskId),t.taskId&&t.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=t.taskId,null===(e=this.player)||void 0===e||e.setResourceData(t.taskId,this.__slideState.url)),t.url&&t.url!==this.__slideState.url&&(this.__slideState.url=t.url,null===(n=this.player)||void 0===n||n.setResourceData(this.__slideState.taskId,t.url)),Number.isInteger(t.currentSlideIndex)&&t.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=t.currentSlideIndex,[4,this.doRenderSlide(t.currentSlideIndex)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[4,null===(i=this.player)||void 0===i?void 0:i.clock.waitUntil((function(){var e,n;return(null===(e=o.player)||void 0===e?void 0:e.currentIndex)===t.currentSlideIndex&&(null===(n=o.player)||void 0===n?void 0:n.currentStage)}),3e3)];case 3:return s.sent(),r=!1,Number.isInteger(t.mainSeqStep)&&t.mainSeqStep!==this.__slideState.mainSeqStep&&(r=!0,this.__slideState.mainSeqStep=t.mainSeqStep),t.mainSeqState&&t.mainSeqState!==this.__slideState.mainSeqState&&(r=!0,this.__slideState.mainSeqState=t.mainSeqState),r&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),t.mediaState&&(this.initMedia(t),this.__slideState.mediaState=t.mediaState),t.interactiveSeqState&&(this.initInteractiveSeq(t),this.__slideState.interactiveSeqState=t.interactiveSeqState),this.isSyncingSlideState=!1,[2]}}))}))},e.prototype.initInteractiveSeq=function(t){var e;for(var n in t.interactiveSeqState){var i=t.interactiveSeqState[n];null===(e=this.player)||void 0===e||e.setInteractiveSeqState(n,i.step,"end"===i.state?"end":"start")}},e.prototype.initMedia=function(t){var e,n,i=this,r=function(r){var s=t.mediaState[r],a=o.__slideState.mediaState[r];if(a&&s.type===a.type&&s.time===a.time)return"continue";"play"===s.type?null===(e=o.player)||void 0===e||e.setMediaState(r,!0).then((function(){var t,e=i.timestamp();null===(t=i.player)||void 0===t||t.setMediaCurrentTime(r,(e-s.time)/1e3)})):null===(n=o.player)||void 0===n||n.setMediaState(r,!1).then((function(){var t;null===(t=i.player)||void 0===t||t.setMediaCurrentTime(r,s.time)}))},o=this;for(var s in t.mediaState)r(s)},Object.defineProperty(e.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),e.prototype.getSlideCountAsync=function(){return QP(this,void 0,void 0,(function(){return tI(this,(function(t){switch(t.label){case 0:if(this._slideCount>0)return[2,this._slideCount];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,t.sent().json()];case 3:return[2,t.sent().slideCount];case 4:return t.sent(),[2,0];case 5:return[2]}}))}))},Object.defineProperty(e.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqLength",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqStep",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mainSeqState",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderOptions",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderFps",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runtimeFps",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){var t;return(null===(t=this.player)||void 0===t?void 0:t.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),e.prototype.updateRenderOption=function(t){this.player&&(this.player.updateConfig(t),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},e.prototype.setResource=function(t,e){var n;this.taskId=t,null===(n=this.player)||void 0===n||n.setResourceData(t,e),this.__slideState.taskId=t,this.__slideState.url=e,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:t,url:e})},e.prototype._renderSlide=function(t){var e;return QP(this,void 0,void 0,(function(){var n=this;return tI(this,(function(i){switch(i.label){case 0:return this.player&&t===this.player.currentIndex?[2]:((JR.platform.isIOS()||JR.platform.isAndroid())&&this.iosResetCache.indexOf(t)<0&&this.iosResetCache.push(t),this.isLoading=!0,[4,null===(e=this.player)||void 0===e?void 0:e.renderSlide(t)]);case 1:return i.sent(),this.__slideState.currentSlideIndex=t,this.isLoading=!1,this.resizeView(),this.__slideState.interactiveSeqState={},this.emitStateChange(),setTimeout((function(){var t,e;if("hidden"===(null===(e=null===(t=n.player)||void 0===t?void 0:t.view)||void 0===e?void 0:e.style.visibility)&&(n.player.view.style.visibility="visible"),"hidden"===n.frame.style.visibility&&(n.frame.style.visibility="visible"),n.needClearCacheImage)try{n.frame.removeChild(n.cacheImage)}catch(t){}}),100),[2]}}))}))},e.prototype.renderSlide=function(t,e){if(void 0===e&&(e=!0),this.player){var n=Number(t);(n!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(n>this.slideCount&&this.slideCount>0||this.poseRenderSlide(n,e))}},e.prototype.needCreateNewPlayer=function(){var t=JR.platform.isLowGpuMemory()?15:30;return(JR.platform.isIOS()||JR.platform.isAndroid())&&this.iosResetCache.length>t},e.prototype.poseRenderSlide=function(t,e){this.isLoading=!0,"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:t,isForward:e}):"sync"===this.mode?(this.doRenderSlide(t,e),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:t,isForward:e})):this.doRenderSlide(t,e)},e.prototype.doRenderSlide=function(t,e){var n,i,r,o=this;if(void 0===e&&(e=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var s=this.player.getSnapshot();this.cacheImage.src=s,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(n=this.playerController)||void 0===n||n.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,(null===(i=this.config)||void 0===i?void 0:i.controller)&&this.createController(),this.needClearCacheImage=!0,(null===(r=null==this?void 0:this.player)||void 0===r?void 0:r.view)&&(this.player.view.style.visibility="hidden",this.frame.appendChild(this.player.view))}var a=Math.random().toString(32).substr(2);return this.player.isForward=e,this.renderingTaskManager.addTask((function(){return o._renderSlide(t)}),t,a),new Promise((function(t){o.renderingTaskManager.eventHub.once("task-end-"+a,t)}))},e.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive&&(this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep():this.handleNextSlide())},e.prototype.doNextStep=function(){if(this.player){this.player.nextStep();var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},e.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive&&(this.player.mainSeqHasPrevStep()?"interactive"===this.mode?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):"sync"===this.mode?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide())},e.prototype.doPrevStep=function(){if(this.player){this.player.prevStep();var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},e.prototype.isSlideStateReady=function(t){return t.taskId.length>0&&t.url.length>0&&t.currentSlideIndex>0},e.prototype.emitStateChange=function(){if("local"!==this.mode&&!this.isSyncingSlideState){var t=this.slideState;!Object(u.isEqual)(this.lastEmitedState,t)&&this.isSlideStateReady(t)&&(this.lastEmitedState=t,this.emit(rI.stateChange,t),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},e.prototype.emitSyncDispatch=function(t){if(!this.lock.isLocked(t.type)){var e=Math.random().toString(32).substr(2);this.lock.addLock(t.type,e);var n=$P($P({},t),{uuid:e});"sync"===this.config.mode&&(n.incrId=this.dispatchIncrId),this.emit(rI.syncDispatch,n),this.logger.info("sync dispatch "+JSON.stringify(n),this.taskId)}},e.prototype.setMainSeqStep=function(t,e){var n;null===(n=this.player)||void 0===n||n.setMainSeqStep(t,e)},e.prototype.setInteractive=function(t){var e;this.interactive=t,null===(e=this.player)||void 0===e||e.setInteractive(t)},e.prototype.pause=function(){var t;null===(t=this.player)||void 0===t||t.pause()},e.prototype.resume=function(){var t;null===(t=this.player)||void 0===t||t.resume()},e.prototype.frozen=function(){var t;return QP(this,void 0,void 0,(function(){var e,n,i,r=this;return tI(this,(function(o){switch(o.label){case 0:return this.isFrowning?[2,iI((function(){return!r.isFrowning}),6e4)]:this.view&&this.player?(this.isFrowning=!0,[4,this.player.clock.waitUntil((function(){return!r.isLoading}),6e4)]):[3,2];case 1:for(n in o.sent(),e=this.player.getSnapshot()||"",this.cacheImage.src=e,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(t=this.playerController)||void 0===t||t.destroy(),this.player=void 0,this.__slideState.mediaState)i=this.__slideState.mediaState[n],this.__slideState.mediaState[n]=$P($P({},i),{frozenTime:this.timestamp()});this.isFrowning=!1,o.label=2;case 2:return[2]}}))}))},e.prototype.release=function(){var t,e;return QP(this,void 0,void 0,(function(){var n,i,r,o,s=this;return tI(this,(function(a){switch(a.label){case 0:if(this.player)return[2];if(this.isReleasing)return[2,iI((function(){return!s.isReleasing}),6e4)];for(i in this.isReleasing=!0,this.player=this.initPlayer(this.config),(null===(t=this.config)||void 0===t?void 0:t.controller)&&this.createController(),this.player.view&&(this.frame.appendChild(this.player.view),this.player.view.style.visibility="hidden"),n=this.__slideState,this.__slideState=Object(u.cloneDeep)(oI),n.mediaState)"play"===(r=n.mediaState[i]).type&&(o=Math.max(null!==(e=r.frozenTime)&&void 0!==e?e:0,r.time),r.time=this.timestamp()-(o-r.time),r.frozenTime=void 0);return[4,this.setSlideState(n)];case 1:return a.sent(),[4,this.player.clock.delay(333)];case 2:a.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch(t){}return this.isReleasing=!1,[2]}}))}))},e.prototype._doDestroy=function(){var t,e,n,i;this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),null===(t=this.player)||void 0===t||t.removeAllListeners(),null===(e=this.player)||void 0===e||e.destroy(),null===(n=this.player)||void 0===n||n.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},window.removeEventListener("__slide_ref__",this.handleSlideRef),this.removeAllListeners();try{(null===(i=this.player)||void 0===i?void 0:i.view)&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch(t){}},e.prototype.waitLoadEnd=function(){return QP(this,void 0,void 0,(function(){var t;return tI(this,(function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return this.isLoading&&t<10?[4,nI(100)]:[3,3];case 2:return e.sent(),t+=1,[3,1];case 3:return[2]}}))}))},e.prototype.destroy=function(){var t=this;this.isLoading?this.waitLoadEnd().then((function(){t._doDestroy()})):this._doDestroy()},e.prototype.clearSlideCache=function(){var t;null===(t=this.player)||void 0===t||t.clearLocalCache()},e.clearLocalCache=function(){JR.clearLocalCache()},e.disposeLocalCache=function(){},e}(a.a)}]);