diff --git a/carrot.yml b/carrot.yml index 5174186c..5062c522 100644 --- a/carrot.yml +++ b/carrot.yml @@ -1,4 +1,4 @@ - name: whiteboard-bridge repoPath: ../whiteboard-bridge repoURL: 'https://github.com/netless-io/whiteboard-bridge.git' - commit: 55b0a29 + commit: a737ce1 diff --git a/sdk/src/main/assets/whiteboard/55b0a29 b/sdk/src/main/assets/whiteboard/a737ce1 similarity index 100% rename from sdk/src/main/assets/whiteboard/55b0a29 rename to sdk/src/main/assets/whiteboard/a737ce1 diff --git a/sdk/src/main/assets/whiteboard/index.html b/sdk/src/main/assets/whiteboard/index.html index aa4bc89f..9feea8d0 100644 --- a/sdk/src/main/assets/whiteboard/index.html +++ b/sdk/src/main/assets/whiteboard/index.html @@ -1 +1 @@ -white-sdk-bridge Application
\ No newline at end of file +white-sdk-bridge Application
\ No newline at end of file diff --git a/sdk/src/main/assets/whiteboard/netless.1d95ce3a.js b/sdk/src/main/assets/whiteboard/netless.9d50552a.js similarity index 94% rename from sdk/src/main/assets/whiteboard/netless.1d95ce3a.js rename to sdk/src/main/assets/whiteboard/netless.9d50552a.js index 40eefe54..79358ae2 100644 --- a/sdk/src/main/assets/whiteboard/netless.1d95ce3a.js +++ b/sdk/src/main/assets/whiteboard/netless.9d50552a.js @@ -35,14 +35,14 @@ var r,i,o=2*Math.PI,a=180/Math.PI,s=Math.PI/180;(i=r||(r={}))[i.POLY=0]="POLY",i See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. - ***************************************************************************** */var h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function d(e,t){function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=function(){return(f=Object.assign||function(e){for(var t,n=arguments,r=1,i=arguments.length;r0&&f>0,a.textureCacheIds=[],a.destroyed=!1,a.resource=null,a._batchEnabled=0,a._batchLocation=0,a.parentTextureArray=null,a.setResource(t),a}return d(t,e),Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var n;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,n){return n=n||this.resolution,this.setRealSize(e*n,t*n,n)},t.prototype.setRealSize=function(e,t,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Object(o.isPow2)(this.realWidth)&&Object(o.isPow2)(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT()),this},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete o.BaseTextureCache[this.cacheId],delete o.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,n,i){void 0===i&&(i=r.b.STRICT_TEXTURE_CACHE);var a="string"==typeof e,s=null;if(a)s=e;else{if(!e._pixiId){var u=n&&n.pixiIdPrefix||"pixiid";e._pixiId=u+"_"+Object(o.uid)()}s=e._pixiId}var l=o.BaseTextureCache[s];if(a&&i&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||((l=new t(e,n)).cacheId=s,t.addToCache(l,s)),l},t.fromBuffer=function(e,n,r,o){e=e||new Float32Array(n*r*4);var a=new v(e,{width:n,height:r}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(m,o||{width:n,height:r,type:s}))},t.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),o.BaseTextureCache[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),o.BaseTextureCache[t]=e)},t.removeFromCache=function(e){if("string"==typeof e){var t=o.BaseTextureCache[e];if(t){var n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete o.BaseTextureCache[e],t}}else if(e&&e.textureCacheIds){for(var r=0;r0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,t)}else e.target=i.q.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,n,r){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(x),S=function(e){function t(n,r){var i=this;if(r=r||{},!(n instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof n&&(n=[n]);var a=n[0].src||n[0];x.crossOrigin(o,a,r.crossorigin);for(var s=0;s0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,n){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(n)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(x),E=function(e){function t(t){return e.call(this,t)||this}return d(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},t}(x);l.push(T,E,_,S,M,v,w,b);var A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.upload=function(e,t,n){var r=e.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===i.a.UNPACK);var o=t.realWidth,a=t.realHeight;return n.width===o&&n.height===a?r.texSubImage2D(t.target,0,0,0,o,a,t.format,n.type,this.data):(n.width=o,n.height=a,r.texImage2D(t.target,0,n.internalFormat,o,a,0,t.format,n.type,this.data)),!0},t}(v),I=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new a.a("disposeFramebuffer"),this.multisample=i.l.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new g(null,{scaleMode:i.p.NEAREST,resolution:1,mipmap:i.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new g(new A(null,{width:this.width,height:this.height}),{scaleMode:i.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.k.OFF,format:i.h.DEPTH_COMPONENT,type:i.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&t.textureCacheIds.splice(n,1),delete o.TextureCache[e],t}}else if(e&&e.textureCacheIds){for(var r=0;rthis.baseTexture.width,a=n+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+r+" = "+(t+r)+" > "+this.baseTexture.width,l="Y: "+n+" + "+i+" = "+(n+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=r&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new g),D(t._EMPTY),D(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=document.createElement("canvas"),n=e.getContext("2d");e.width=16,e.height=16,n.fillStyle="white",n.fillRect(0,0,16,16),t._WHITE=new t(new g(new _(e))),D(t._WHITE),D(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(o.EventEmitter),O=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return d(t,e),Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,n){void 0===n&&(n=!0);var r=this.baseTexture.resolution,i=Math.round(e*r)/r,o=Math.round(t*r)/r;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(i,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var n=arguments,r=[],i=1;i1?-r:-1:(a=((65535&(e=Object(o.nextPow2)(e)))<<16|65535&(t=Object(o.nextPow2)(t)))>>>0,r>1&&(a+=4294967296*r)),this.texturePool[a]||(this.texturePool[a]=[]);var s=this.texturePool[a].pop();return s||(s=this.createTexture(e,t,r)),s.filterPoolKey=a,s.setResolution(n),s},e.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||i.l.NONE);return r.filterFrame=e.filterFrame,r},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r0&&e.height>0,this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var r=0;r1){for(var l=0;l1&&((h=this.getOptimalFilterTexture(c.width,c.height,t.resolution)).filterFrame=c.filterFrame),n[d].apply(this,c,h,i.e.CLEAR,t);var f=c;c=h,h=f}n[d].apply(this,c,l.renderTexture,i.e.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=i.e.CLEAR);var n=this.renderer,r=n.renderTexture,o=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,r.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(t===i.e.CLEAR||t===i.e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,n,r){var o=this.renderer;o.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.f.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,i=n.destinationFrame,o=t._texture.orig,a=e.set(i.width,0,0,i.height,r.x,r.y),s=t.worldTransform.copyTo(u.d.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,n,r){return void 0===n&&(n=1),void 0===r&&(r=i.l.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},e.prototype.getFilterTexture=function(e,t,n){if("number"==typeof e){var r=e;e=t,t=r}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||i.l.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var n=Z[0],r=Z[1],i=Z[2],o=Z[3];n.set(t.left,t.top),r.set(t.left,t.bottom),i.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(i,i),e.apply(o,o);var a=Math.min(n.x,r.x,i.x,o.x),s=Math.min(n.y,r.y,i.y,o.y),u=Math.max(n.x,r.x,i.x,o.x),l=Math.max(n.y,r.y,i.y,o.y);t.x=a,t.y=s,t.width=u-a,t.height=l-s},e.prototype.roundFrame=function(e,t,n,r,i){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?q.copyFrom(i):q.identity()).translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),K=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),$=function(){function e(e){this.renderer=e,this.emptyRenderer=new K(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},e.prototype.boundArray=function(e,t,n,r){for(var i=e.elements,o=e.ids,a=e.count,s=0,u=0;u=0&&c=i.g.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var r=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),ne=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},re=new u.j,ie=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new I(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new u.j,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;r.b.PREFER_ENV===i.g.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,n){void 0===n&&(n=0);var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=n),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>n,u=t.height>>n,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,u)}else s=e.width>>n,u=e.height>>n,this.setViewport(0,0,s,u)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,n,r){var i=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),i.width===n&&i.height===r&&i.x===e&&i.y===t||(i.x=e,i.y=t,i.width=n,i.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,n,r,o){void 0===o&&(o=i.c.COLOR|i.c.DEPTH);var a=this.gl;a.clearColor(e,t,n,r),a.clear(o)},e.prototype.initFramebuffer=function(e){var t=this.gl,n=new ne(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},e.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,i=r.length;t.drawBuffers||(i=Math.min(i,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var a=[],s=0;s1&&n.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var c=e.depthTexture;this.renderer.texture.bind(c,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null):(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil))},e.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,n=i.l.NONE;if(e<=1||null===t)return n;for(var r=0;r=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n0&&(t+="\nelse "),n=i.g.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),pe=t}return pe}();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);de=t.precision?i.m.HIGH:i.m.MEDIUM}}return de}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,n,r){var i=t+n,a=o.ProgramCache[i];return a||(o.ProgramCache[i]=a=new e(t,n,r)),a},e}(),Ne=function(){function e(e,t){this.uniformBindCount=0,this.program=e,this.uniformGroup=t?t instanceof X?t:new X(t):new X({})}return e.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var n in t.uniforms){var r=t.uniforms[n];if(r.group&&this.checkUniformExists(e,r))return!0}return!1},e.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),e.from=function(t,n,r){return new e(Ce.from(t,n),r)},e}(),ke=function(){function e(){this.data=0,this.blendMode=i.b.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(e){!!(1&this.data)!==e&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(e){!!(2&this.data)!==e&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(e){!!(4&this.data)!==e&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(e){!!(8&this.data)!==e&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(e){!!(32&this.data)!==e&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(e){!!(16&this.data)!==e&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==i.b.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),De=function(e){function t(n,i,o){var a=this,s=Ce.from(n||t.defaultVertexSrc,i||t.defaultFragmentSrc);return(a=e.call(this,s,o)||this).padding=0,a.resolution=r.b.FILTER_RESOLUTION,a.multisample=r.b.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new ke,a}return d(t,e),t.prototype.apply=function(e,t,n,r,i){e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),t}(Ne),Pe=new u.d,Oe=function(){function e(e,t){this._texture=e,this.mapCoord=new u.d,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var n=this.mapCoord,r=0;r1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var n=e.maskObject;if(!n.isFastRect||!n.isFastRect())return!1;if(t.isMatrixRotated(n.worldTransform))return!1;if(t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var r=e._scissorRectLocal;return r.width>0&&r.height>0},t.prototype.roundFrameToPixels=function(e,n,r,i,o){t.isMatrixRotated(o)||((o=o?Be.copyFrom(o):Be.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,e),e.fit(i),e.x=Math.round(e.x*n),e.y=Math.round(e.y*n),e.width=Math.round(e.width*n),e.height=Math.round(e.height*n))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},t}(je),Fe=function(e){function t(t){var n=e.call(this,t)||this;return n.glConst=WebGLRenderingContext.STENCIL_TEST,n}return d(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,n=this.renderer.gl,r=e._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++,n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.EQUAL,r,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(je),ze=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new u.d,this.transform=null}return e.prototype.update=function(e,t,n,r){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,r),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,n,r){var i=this.projectionMatrix,o=r?-1:1;i.identity(),i.a=1/t.width*2,i.d=o*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-o-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),Ge=new u.j,He=new u.j,Ve=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new u.j,this.destinationFrame=new u.j,this.viewportFrame=new u.j}return e.prototype.bind=function(e,t,n){void 0===e&&(e=null);var r,i,o,a=this.renderer;this.current=e,e?(o=(r=e.baseTexture).resolution,t||(Ge.width=e.frame.width,Ge.height=e.frame.height,t=Ge),n||(He.x=e.frame.x,He.y=e.frame.y,He.width=t.width,He.height=t.height,n=He),i=r.framebuffer):(o=a.resolution,t||(Ge.width=a.screen.width,Ge.height=a.screen.height,t=Ge),n||((n=Ge).width=t.width,n.height=t.height));var s=this.viewportFrame;s.x=n.x*o,s.y=n.y*o,s.width=n.width*o,s.height=n.height*o,e||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(i,s),this.renderer.projection.update(n,t,o,!i),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var n=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,i=n.width!==r.width||n.height!==r.height;if(i){var o=this.viewportFrame,a=o.x,s=o.y,u=o.width,l=o.height;a=Math.round(a),s=Math.round(s),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,s,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function We(e,t,n,r,i){n.buffer.update(i)}var Ye={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},Xe={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};var Qe=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();var Ze=0,qe={textureCount:0,uboCount:0},Je=function(){function e(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Ze++}return e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof _e)return _e;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");_e=!0===e({a:"b"},"a","b")}catch(e){_e=!1}return _e}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e,this.reset()},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var n=e.program,r=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(r.program)),t||(qe.textureCount=0,qe.uboCount=0,this.syncUniformGroup(e.uniformGroup,qe)),r},e.prototype.setUniforms=function(e){var t=this.shader.program,n=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(n.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e,t){var n=this.getGlProgram();e.static&&e.dirtyId===n.uniformDirtyGroups[e.id]||(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,t))},e.prototype.syncUniforms=function(e,t,n){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,n)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=function(e,t){var n,r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var i in e.uniforms){var o=t[i];if(o){for(var a=e.uniforms[i],s=!1,u=0;u1&&(n=Math.max(n,16)*a.data.size),a.dataLen=n,r%n!=0&&r<16){var s=r%n%16;r+=s,i+=s}r+n>16?(i=16*Math.ceil(i/16),a.offset=i,i+=n,r=n):(a.offset=i,r+=n,i+=n)}return{uboElements:t,size:i=16*Math.ceil(i/16)}}(function(e,t){var n=[];for(var r in e)t[r]&&n.push(t[r]);return n.sort((function(e,t){return e.index-t.index})),n}(e.uniforms,t)),r=n.uboElements,i=n.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a1){var f=ge(s.data.type),p=Math.max(Xe[s.data.type]/16,1),v=f/p,m=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+s.data.size*p+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+m+";\n }\n\n ")}else{var g=Ye[s.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n "+g+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(e,this.shader.program.uniformData)),e.autoManage){var s=new Float32Array(a.size/4);e.buffer.update(s)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},e.prototype.getSignature=function(e,t,n){var r=e.uniforms,i=[n+"-"];for(var o in r)i.push(o),t[o]&&i.push(t[o].type);return i.join("-")},e.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateProgram=function(e){var t=this.gl,n=e.program,r=function(e,t){var n,r,i,o,a=ue(e,e.VERTEX_SHADER,t.vertexSrc),s=ue(e,e.FRAGMENT_SHADER,t.fragmentSrc),u=e.createProgram();if(e.attachShader(u,a),e.attachShader(u,s),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS)||(r=u,i=a,o=s,(n=e).getProgramParameter(r,n.LINK_STATUS)||(n.getShaderParameter(i,n.COMPILE_STATUS)||le(n,i),n.getShaderParameter(o,n.COMPILE_STATUS)||le(n,o),console.error("PixiJS Error: Could not initialize shader."),""!==n.getProgramInfoLog(r)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",n.getProgramInfoLog(r)))),t.attributeData=function(e,t){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1}));for(var c=0;c>=1,n++;this.stateId=e.data}for(n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;rthis.maxIdle&&(e.destroyTexture(i,!0),t[r]=null,n=!0)}if(n){var o=0;for(r=0;r=0;r--)this.unload(e.children[r])},e.prototype.destroy=function(){this.renderer=null},e}(),et=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.r.UNSIGNED_BYTE,this.internalFormat=i.h.RGBA,this.samplerType=0},tt=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new g,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e,t,n,r,o,a,s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,S=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=S,"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[i.r.UNSIGNED_BYTE]=((n={})[i.h.RGBA]=e.RGBA8,n[i.h.RGB]=e.RGB8,n[i.h.RG]=e.RG8,n[i.h.RED]=e.R8,n[i.h.RGBA_INTEGER]=e.RGBA8UI,n[i.h.RGB_INTEGER]=e.RGB8UI,n[i.h.RG_INTEGER]=e.RG8UI,n[i.h.RED_INTEGER]=e.R8UI,n[i.h.ALPHA]=e.ALPHA,n[i.h.LUMINANCE]=e.LUMINANCE,n[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,n),t[i.r.BYTE]=((r={})[i.h.RGBA]=e.RGBA8_SNORM,r[i.h.RGB]=e.RGB8_SNORM,r[i.h.RG]=e.RG8_SNORM,r[i.h.RED]=e.R8_SNORM,r[i.h.RGBA_INTEGER]=e.RGBA8I,r[i.h.RGB_INTEGER]=e.RGB8I,r[i.h.RG_INTEGER]=e.RG8I,r[i.h.RED_INTEGER]=e.R8I,r),t[i.r.UNSIGNED_SHORT]=((o={})[i.h.RGBA_INTEGER]=e.RGBA16UI,o[i.h.RGB_INTEGER]=e.RGB16UI,o[i.h.RG_INTEGER]=e.RG16UI,o[i.h.RED_INTEGER]=e.R16UI,o[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),t[i.r.SHORT]=((a={})[i.h.RGBA_INTEGER]=e.RGBA16I,a[i.h.RGB_INTEGER]=e.RGB16I,a[i.h.RG_INTEGER]=e.RG16I,a[i.h.RED_INTEGER]=e.R16I,a),t[i.r.UNSIGNED_INT]=((s={})[i.h.RGBA_INTEGER]=e.RGBA32UI,s[i.h.RGB_INTEGER]=e.RGB32UI,s[i.h.RG_INTEGER]=e.RG32UI,s[i.h.RED_INTEGER]=e.R32UI,s[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,s),t[i.r.INT]=((u={})[i.h.RGBA_INTEGER]=e.RGBA32I,u[i.h.RGB_INTEGER]=e.RGB32I,u[i.h.RG_INTEGER]=e.RG32I,u[i.h.RED_INTEGER]=e.R32I,u),t[i.r.FLOAT]=((l={})[i.h.RGBA]=e.RGBA32F,l[i.h.RGB]=e.RGB32F,l[i.h.RG]=e.RG32F,l[i.h.RED]=e.R32F,l[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[i.r.HALF_FLOAT]=((c={})[i.h.RGBA]=e.RGBA16F,c[i.h.RGB]=e.RGB16F,c[i.h.RG]=e.RG16F,c[i.h.RED]=e.R16F,c),t[i.r.UNSIGNED_SHORT_5_6_5]=((h={})[i.h.RGB]=e.RGB565,h),t[i.r.UNSIGNED_SHORT_4_4_4_4]=((d={})[i.h.RGBA]=e.RGBA4,d),t[i.r.UNSIGNED_SHORT_5_5_5_1]=((f={})[i.h.RGBA]=e.RGB5_A1,f),t[i.r.UNSIGNED_INT_2_10_10_10_REV]=((p={})[i.h.RGBA]=e.RGB10_A2,p[i.h.RGBA_INTEGER]=e.RGB10_A2UI,p),t[i.r.UNSIGNED_INT_10F_11F_11F_REV]=((v={})[i.h.RGB]=e.R11F_G11F_B10F,v),t[i.r.UNSIGNED_INT_5_9_9_9_REV]=((m={})[i.h.RGB]=e.RGB9_E5,m),t[i.r.UNSIGNED_INT_24_8]=((g={})[i.h.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,g),t[i.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[i.h.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),M=t):((b={})[i.r.UNSIGNED_BYTE]=((x={})[i.h.RGBA]=e.RGBA,x[i.h.RGB]=e.RGB,x[i.h.ALPHA]=e.ALPHA,x[i.h.LUMINANCE]=e.LUMINANCE,x[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,x),b[i.r.UNSIGNED_SHORT_5_6_5]=((_={})[i.h.RGB]=e.RGB,_),b[i.r.UNSIGNED_SHORT_4_4_4_4]=((w={})[i.h.RGBA]=e.RGBA,w),b[i.r.UNSIGNED_SHORT_5_5_5_1]=((T={})[i.h.RGBA]=e.RGBA,T),M=b),M);var E=S.getParameter(S.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=E;for(var A=0;A=0;--o){var a=t[o];a&&a._glTextures[r].samplerType!==i.o.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(e){var t=new et(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=null!==(r=null===(n=this.internalFormats[e.type])||void 0===n?void 0:n[e.format])&&void 0!==r?r:e.format,2===this.webGLVersion&&e.type===i.r.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==i.o.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,o=e.realHeight,a=n.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var n=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);-1!==r&&Object(o.removeItems)(this.managedTextures,r,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&(e.mipmap!==i.k.POW2&&2===this.webGLVersion||e.isPowerOfTwo?t.mipmap=e.mipmap>=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=i.s.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==i.k.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===i.p.LINEAR){var o=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR:n.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),nt=new u.d,rt=function(e){function t(t,n){void 0===t&&(t=i.n.UNKNOWN);var a=e.call(this)||this;return n=Object.assign({},r.b.RENDER_OPTIONS,n),a.options=n,a.type=t,a.screen=new u.j(0,0,n.width,n.height),a.view=n.view||document.createElement("canvas"),a.resolution=n.resolution||r.b.RESOLUTION,a.useContextAlpha=n.useContextAlpha,a.autoDensity=!!n.autoDensity,a.preserveDrawingBuffer=n.preserveDrawingBuffer,a.clearBeforeRender=n.clearBeforeRender,a._backgroundColor=0,a._backgroundColorRgba=[0,0,0,1],a._backgroundColorString="#000000",a.backgroundColor=n.backgroundColor||a._backgroundColor,a.backgroundAlpha=n.backgroundAlpha,void 0!==n.transparent&&(Object(o.deprecation)("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),a.useContextAlpha=n.transparent,a.backgroundAlpha=n.transparent?0:1),a._lastObjectRendered=null,a.plugins={},a}return d(t,e),t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var n=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=n,this.screen.height=r,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=r+"px"),this.emit("resize",n,r)},t.prototype.generateTexture=function(e,t,n,r){void 0===t&&(t={}),"number"==typeof t&&(Object(o.deprecation)("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),t={scaleMode:t,resolution:n,region:r});var i=t.region,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var i=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;r.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,i)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n=i.l.HIGH?this.multisample=i.l.HIGH:e>=i.l.MEDIUM?this.multisample=i.l.MEDIUM:e>=i.l.LOW?this.multisample=i.l.LOW:this.multisample=i.l.NONE},t.prototype.addSystem=function(e,t){var n=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var r in this[t]=n,this.runners)this.runners[r].add(n);return this},t.prototype.render=function(e,t){var n,r,i,a;if(t&&(t instanceof O?(Object(o.deprecation)("6.0.0","Renderer#render arguments changed, use options instead."),n=t,r=arguments[2],i=arguments[3],a=arguments[4]):(n=t.renderTexture,r=t.clear,i=t.transform,a=t.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(n||(this._lastObjectRendered=e),!a){var s=e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(t,n,r,i){void 0===n&&(n={});var o=e.prototype.generateTexture.call(this,t,n,r,i);return this.framebuffer.blit(),o},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return Object(o.deprecation)("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,n){t.__plugins=t.__plugins||{},t.__plugins[e]=n},t}(rt);function st(e){return at.create(e)}var ut="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",lt="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",ct=function(){this.texArray=null,this.blend=0,this.type=i.f.TRIANGLES,this.start=0,this.size=0,this.data=null},ht=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,n=this.MAX_TEXTURES,r=t._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++g._globalBatch,u=0,l=r[0],c=0;i.copyBoundTextures(o,n);for(var h=0;h=n&&(i.boundArray(l,o,s,n),this.buildDrawCalls(l,c,h),c=h,l=r[++u],++s),d._batchEnabled=s,d.touched=a,l.elements[l.count++]=d)}for(l.count>0&&(i.boundArray(l,o,s,n),this.buildDrawCalls(l,c,this._bufferSize),++u,++s),h=0;h0&&(t+="\nelse "),n-1){var n=["\n %c %c %c PixiJS 6.4.2 - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");d=!0}}function v(){return void 0===h&&(h=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:r.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!n||!n.getContextAttributes().stencil);if(n){var o=n.getExtension("WEBGL_lose_context");o&&o.loseContext()}return n=null,i}catch(e){return!1}}()),h}var m={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function g(e,t){return void 0===t&&(t=[]),t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t}function y(e){var t=e.toString(16);return"#"+("000000".substring(0,6-t.length)+t)}function b(e){return"string"==typeof e&&"#"===(e=m[e.toLowerCase()]||e)[0]&&(e=e.slice(1)),parseInt(e,16)}function x(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)}var _=function(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[l.b.NORMAL_NPM]=l.b.NORMAL,e[l.b.ADD_NPM]=l.b.ADD,e[l.b.SCREEN_NPM]=l.b.SCREEN,t[l.b.NORMAL]=l.b.NORMAL_NPM,t[l.b.ADD]=l.b.ADD_NPM,t[l.b.SCREEN]=l.b.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}();function w(e,t){return _[t?1:0][e]}function T(e,t,n,r){return n=n||new Float32Array(4),r||void 0===r?(n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t):(n[0]=e[0],n[1]=e[1],n[2]=e[2]),n[3]=t,n}function M(e,t){if(1===t)return(255*t<<24)+e;if(0===t)return 0;var n=e>>16&255,r=e>>8&255,i=255&e;return(255*t<<24)+((n=n*t+.5|0)<<16)+((r=r*t+.5|0)<<8)+(i*t+.5|0)}function S(e,t,n,r){return(n=n||new Float32Array(4))[0]=(e>>16&255)/255,n[1]=(e>>8&255)/255,n[2]=(255&e)/255,(r||void 0===r)&&(n[0]*=t,n[1]*=t,n[2]*=t),n[3]=t,n}function E(e,t){void 0===t&&(t=null);var n=6*e;if((t=t||new Uint16Array(n)).length!==n)throw new Error("Out buffer length is incorrect, got "+t.length+" and expected "+n);for(var r=0,i=0;r>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)}function k(e){return!(e&e-1||!e)}function D(e){var t=(e>65535?1:0)<<4,n=((e>>>=t)>255?1:0)<<3;return t|=n,t|=n=((e>>>=n)>15?1:0)<<2,(t|=n=((e>>>=n)>3?1:0)<<1)|(e>>>=n)>>1}function P(e,t,n){var r,i=e.length;if(!(t>=i||0===n)){var o=i-(n=t+n>i?i-t:n);for(r=t;r1&&"undefined"==typeof MSStream},U=function(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"==typeof navigator?"string"==typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=t.userAgent,r=n.split("[FBAN");void 0!==r[1]&&(n=r[0]),void 0!==(r=n.split("Twitter"))[1]&&(n=r[0]);var i,o=(i=n,function(e){return e.test(i)}),a={apple:{phone:o(T)&&!o(k),ipod:o(M),tablet:!o(T)&&(o(S)||B(t))&&!o(k),universal:o(E),device:(o(T)||o(M)||o(S)||o(E)||B(t))&&!o(k)},amazon:{phone:o(C),tablet:!o(C)&&o(N),device:o(C)||o(N)},android:{phone:!o(k)&&o(C)||!o(k)&&o(A),tablet:!o(k)&&!o(C)&&!o(A)&&(o(N)||o(I)),device:!o(k)&&(o(C)||o(N)||o(A)||o(I))||o(/\bokhttp\b/i)},windows:{phone:o(k),tablet:o(D),device:o(k)||o(D)},other:{blackberry:o(P),blackberry10:o(O),opera:o(R),firefox:o(j),chrome:o(L),device:o(P)||o(O)||o(R)||o(j)||o(L)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}(globalThis.navigator); + ***************************************************************************** */var h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function d(e,t){function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=function(){return(f=Object.assign||function(e){for(var t,n=arguments,r=1,i=arguments.length;r0&&f>0,a.textureCacheIds=[],a.destroyed=!1,a.resource=null,a._batchEnabled=0,a._batchLocation=0,a.parentTextureArray=null,a.setResource(t),a}return d(t,e),Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var n;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,n){return n=n||this.resolution,this.setRealSize(e*n,t*n,n)},t.prototype.setRealSize=function(e,t,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Object(o.isPow2)(this.realWidth)&&Object(o.isPow2)(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT()),this},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete o.BaseTextureCache[this.cacheId],delete o.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,n,i){void 0===i&&(i=r.b.STRICT_TEXTURE_CACHE);var a="string"==typeof e,s=null;if(a)s=e;else{if(!e._pixiId){var u=n&&n.pixiIdPrefix||"pixiid";e._pixiId=u+"_"+Object(o.uid)()}s=e._pixiId}var l=o.BaseTextureCache[s];if(a&&i&&!l)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return l||((l=new t(e,n)).cacheId=s,t.addToCache(l,s)),l},t.fromBuffer=function(e,n,r,o){e=e||new Float32Array(n*r*4);var a=new v(e,{width:n,height:r}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(m,o||{width:n,height:r,type:s}))},t.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),o.BaseTextureCache[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),o.BaseTextureCache[t]=e)},t.removeFromCache=function(e){if("string"==typeof e){var t=o.BaseTextureCache[e];if(t){var n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete o.BaseTextureCache[e],t}}else if(e&&e.textureCacheIds){for(var r=0;r0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,t)}else e.target=i.q.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,n,r){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(x),S=function(e){function t(n,r){var i=this;if(r=r||{},!(n instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof n&&(n=[n]);var a=n[0].src||n[0];x.crossOrigin(o,a,r.crossorigin);for(var s=0;s0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,n){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(n)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(x),E=function(e){function t(t){return e.call(this,t)||this}return d(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},t}(x);l.push(T,E,_,S,M,v,w,b);var A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.upload=function(e,t,n){var r=e.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===i.a.UNPACK);var o=t.realWidth,a=t.realHeight;return n.width===o&&n.height===a?r.texSubImage2D(t.target,0,0,0,o,a,t.format,n.type,this.data):(n.width=o,n.height=a,r.texImage2D(t.target,0,n.internalFormat,o,a,0,t.format,n.type,this.data)),!0},t}(v),I=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new a.a("disposeFramebuffer"),this.multisample=i.l.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new g(null,{scaleMode:i.p.NEAREST,resolution:1,mipmap:i.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new g(new A(null,{width:this.width,height:this.height}),{scaleMode:i.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.k.OFF,format:i.h.DEPTH_COMPONENT,type:i.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&t.textureCacheIds.splice(n,1),delete o.TextureCache[e],t}}else if(e&&e.textureCacheIds){for(var r=0;rthis.baseTexture.width,a=n+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+r+" = "+(t+r)+" > "+this.baseTexture.width,l="Y: "+n+" + "+i+" = "+(n+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=r&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new g),D(t._EMPTY),D(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=document.createElement("canvas"),n=e.getContext("2d");e.width=16,e.height=16,n.fillStyle="white",n.fillRect(0,0,16,16),t._WHITE=new t(new g(new _(e))),D(t._WHITE),D(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(o.EventEmitter),O=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return d(t,e),Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,n){void 0===n&&(n=!0);var r=this.baseTexture.resolution,i=Math.round(e*r)/r,o=Math.round(t*r)/r;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(i,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var n=arguments,r=[],i=1;i1?-r:-1:(a=((65535&(e=Object(o.nextPow2)(e)))<<16|65535&(t=Object(o.nextPow2)(t)))>>>0,r>1&&(a+=4294967296*r)),this.texturePool[a]||(this.texturePool[a]=[]);var s=this.texturePool[a].pop();return s||(s=this.createTexture(e,t,r)),s.filterPoolKey=a,s.setResolution(n),s},e.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||i.l.NONE);return r.filterFrame=e.filterFrame,r},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r0&&e.height>0,this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var r=0;r1){for(var l=0;l1&&((h=this.getOptimalFilterTexture(c.width,c.height,t.resolution)).filterFrame=c.filterFrame),n[d].apply(this,c,h,i.e.CLEAR,t);var f=c;c=h,h=f}n[d].apply(this,c,l.renderTexture,i.e.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=i.e.CLEAR);var n=this.renderer,r=n.renderTexture,o=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,r.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(t===i.e.CLEAR||t===i.e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,n,r){var o=this.renderer;o.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.f.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,i=n.destinationFrame,o=t._texture.orig,a=e.set(i.width,0,0,i.height,r.x,r.y),s=t.worldTransform.copyTo(u.d.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,n,r){return void 0===n&&(n=1),void 0===r&&(r=i.l.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},e.prototype.getFilterTexture=function(e,t,n){if("number"==typeof e){var r=e;e=t,t=r}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||i.l.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var n=Z[0],r=Z[1],i=Z[2],o=Z[3];n.set(t.left,t.top),r.set(t.left,t.bottom),i.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(i,i),e.apply(o,o);var a=Math.min(n.x,r.x,i.x,o.x),s=Math.min(n.y,r.y,i.y,o.y),u=Math.max(n.x,r.x,i.x,o.x),l=Math.max(n.y,r.y,i.y,o.y);t.x=a,t.y=s,t.width=u-a,t.height=l-s},e.prototype.roundFrame=function(e,t,n,r,i){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?q.copyFrom(i):q.identity()).translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),K=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),$=function(){function e(e){this.renderer=e,this.emptyRenderer=new K(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},e.prototype.boundArray=function(e,t,n,r){for(var i=e.elements,o=e.ids,a=e.count,s=0,u=0;u=0&&c=i.g.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var r=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),ne=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},re=new u.j,ie=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new I(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new u.j,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;r.b.PREFER_ENV===i.g.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,n){void 0===n&&(n=0);var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=n),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>n,u=t.height>>n,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,u)}else s=e.width>>n,u=e.height>>n,this.setViewport(0,0,s,u)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,n,r){var i=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),i.width===n&&i.height===r&&i.x===e&&i.y===t||(i.x=e,i.y=t,i.width=n,i.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,n,r,o){void 0===o&&(o=i.c.COLOR|i.c.DEPTH);var a=this.gl;a.clearColor(e,t,n,r),a.clear(o)},e.prototype.initFramebuffer=function(e){var t=this.gl,n=new ne(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},e.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,i=r.length;t.drawBuffers||(i=Math.min(i,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var a=[],s=0;s1&&n.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var c=e.depthTexture;this.renderer.texture.bind(c,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null):(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil))},e.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,n=i.l.NONE;if(e<=1||null===t)return n;for(var r=0;r=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n0&&(t+="\nelse "),n=i.g.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),pe=t}return pe}();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);de=t.precision?i.m.HIGH:i.m.MEDIUM}}return de}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,n,r){var i=t+n,a=o.ProgramCache[i];return a||(o.ProgramCache[i]=a=new e(t,n,r)),a},e}(),Ne=function(){function e(e,t){this.uniformBindCount=0,this.program=e,this.uniformGroup=t?t instanceof X?t:new X(t):new X({})}return e.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var n in t.uniforms){var r=t.uniforms[n];if(r.group&&this.checkUniformExists(e,r))return!0}return!1},e.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),e.from=function(t,n,r){return new e(Ce.from(t,n),r)},e}(),ke=function(){function e(){this.data=0,this.blendMode=i.b.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(e){!!(1&this.data)!==e&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(e){!!(2&this.data)!==e&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(e){!!(4&this.data)!==e&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(e){!!(8&this.data)!==e&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(e){!!(32&this.data)!==e&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(e){!!(16&this.data)!==e&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==i.b.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),De=function(e){function t(n,i,o){var a=this,s=Ce.from(n||t.defaultVertexSrc,i||t.defaultFragmentSrc);return(a=e.call(this,s,o)||this).padding=0,a.resolution=r.b.FILTER_RESOLUTION,a.multisample=r.b.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new ke,a}return d(t,e),t.prototype.apply=function(e,t,n,r,i){e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),t}(Ne),Pe=new u.d,Oe=function(){function e(e,t){this._texture=e,this.mapCoord=new u.d,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var n=this.mapCoord,r=0;r1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var n=e.maskObject;if(!n.isFastRect||!n.isFastRect())return!1;if(t.isMatrixRotated(n.worldTransform))return!1;if(t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var r=e._scissorRectLocal;return r.width>0&&r.height>0},t.prototype.roundFrameToPixels=function(e,n,r,i,o){t.isMatrixRotated(o)||((o=o?Be.copyFrom(o):Be.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,e),e.fit(i),e.x=Math.round(e.x*n),e.y=Math.round(e.y*n),e.width=Math.round(e.width*n),e.height=Math.round(e.height*n))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},t}(je),ze=function(e){function t(t){var n=e.call(this,t)||this;return n.glConst=WebGLRenderingContext.STENCIL_TEST,n}return d(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,n=this.renderer.gl,r=e._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++,n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.EQUAL,r,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(je),Fe=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new u.d,this.transform=null}return e.prototype.update=function(e,t,n,r){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,r),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,n,r){var i=this.projectionMatrix,o=r?-1:1;i.identity(),i.a=1/t.width*2,i.d=o*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-o-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),Ge=new u.j,He=new u.j,Ve=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new u.j,this.destinationFrame=new u.j,this.viewportFrame=new u.j}return e.prototype.bind=function(e,t,n){void 0===e&&(e=null);var r,i,o,a=this.renderer;this.current=e,e?(o=(r=e.baseTexture).resolution,t||(Ge.width=e.frame.width,Ge.height=e.frame.height,t=Ge),n||(He.x=e.frame.x,He.y=e.frame.y,He.width=t.width,He.height=t.height,n=He),i=r.framebuffer):(o=a.resolution,t||(Ge.width=a.screen.width,Ge.height=a.screen.height,t=Ge),n||((n=Ge).width=t.width,n.height=t.height));var s=this.viewportFrame;s.x=n.x*o,s.y=n.y*o,s.width=n.width*o,s.height=n.height*o,e||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(i,s),this.renderer.projection.update(n,t,o,!i),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var n=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,i=n.width!==r.width||n.height!==r.height;if(i){var o=this.viewportFrame,a=o.x,s=o.y,u=o.width,l=o.height;a=Math.round(a),s=Math.round(s),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,s,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function We(e,t,n,r,i){n.buffer.update(i)}var Ye={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},Xe={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};var Qe=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();var Ze=0,qe={textureCount:0,uboCount:0},Je=function(){function e(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Ze++}return e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof _e)return _e;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");_e=!0===e({a:"b"},"a","b")}catch(e){_e=!1}return _e}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e,this.reset()},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var n=e.program,r=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(r.program)),t||(qe.textureCount=0,qe.uboCount=0,this.syncUniformGroup(e.uniformGroup,qe)),r},e.prototype.setUniforms=function(e){var t=this.shader.program,n=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(n.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e,t){var n=this.getGlProgram();e.static&&e.dirtyId===n.uniformDirtyGroups[e.id]||(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,t))},e.prototype.syncUniforms=function(e,t,n){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,n)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=function(e,t){var n,r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var i in e.uniforms){var o=t[i];if(o){for(var a=e.uniforms[i],s=!1,u=0;u1&&(n=Math.max(n,16)*a.data.size),a.dataLen=n,r%n!=0&&r<16){var s=r%n%16;r+=s,i+=s}r+n>16?(i=16*Math.ceil(i/16),a.offset=i,i+=n,r=n):(a.offset=i,r+=n,i+=n)}return{uboElements:t,size:i=16*Math.ceil(i/16)}}(function(e,t){var n=[];for(var r in e)t[r]&&n.push(t[r]);return n.sort((function(e,t){return e.index-t.index})),n}(e.uniforms,t)),r=n.uboElements,i=n.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a1){var f=ge(s.data.type),p=Math.max(Xe[s.data.type]/16,1),v=f/p,m=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+s.data.size*p+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+m+";\n }\n\n ")}else{var g=Ye[s.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n "+g+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(e,this.shader.program.uniformData)),e.autoManage){var s=new Float32Array(a.size/4);e.buffer.update(s)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},e.prototype.getSignature=function(e,t,n){var r=e.uniforms,i=[n+"-"];for(var o in r)i.push(o),t[o]&&i.push(t[o].type);return i.join("-")},e.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateProgram=function(e){var t=this.gl,n=e.program,r=function(e,t){var n,r,i,o,a=ue(e,e.VERTEX_SHADER,t.vertexSrc),s=ue(e,e.FRAGMENT_SHADER,t.fragmentSrc),u=e.createProgram();if(e.attachShader(u,a),e.attachShader(u,s),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS)||(r=u,i=a,o=s,(n=e).getProgramParameter(r,n.LINK_STATUS)||(n.getShaderParameter(i,n.COMPILE_STATUS)||le(n,i),n.getShaderParameter(o,n.COMPILE_STATUS)||le(n,o),console.error("PixiJS Error: Could not initialize shader."),""!==n.getProgramInfoLog(r)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",n.getProgramInfoLog(r)))),t.attributeData=function(e,t){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1}));for(var c=0;c>=1,n++;this.stateId=e.data}for(n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;rthis.maxIdle&&(e.destroyTexture(i,!0),t[r]=null,n=!0)}if(n){var o=0;for(r=0;r=0;r--)this.unload(e.children[r])},e.prototype.destroy=function(){this.renderer=null},e}(),et=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.r.UNSIGNED_BYTE,this.internalFormat=i.h.RGBA,this.samplerType=0},tt=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new g,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e,t,n,r,o,a,s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,S=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=S,"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[i.r.UNSIGNED_BYTE]=((n={})[i.h.RGBA]=e.RGBA8,n[i.h.RGB]=e.RGB8,n[i.h.RG]=e.RG8,n[i.h.RED]=e.R8,n[i.h.RGBA_INTEGER]=e.RGBA8UI,n[i.h.RGB_INTEGER]=e.RGB8UI,n[i.h.RG_INTEGER]=e.RG8UI,n[i.h.RED_INTEGER]=e.R8UI,n[i.h.ALPHA]=e.ALPHA,n[i.h.LUMINANCE]=e.LUMINANCE,n[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,n),t[i.r.BYTE]=((r={})[i.h.RGBA]=e.RGBA8_SNORM,r[i.h.RGB]=e.RGB8_SNORM,r[i.h.RG]=e.RG8_SNORM,r[i.h.RED]=e.R8_SNORM,r[i.h.RGBA_INTEGER]=e.RGBA8I,r[i.h.RGB_INTEGER]=e.RGB8I,r[i.h.RG_INTEGER]=e.RG8I,r[i.h.RED_INTEGER]=e.R8I,r),t[i.r.UNSIGNED_SHORT]=((o={})[i.h.RGBA_INTEGER]=e.RGBA16UI,o[i.h.RGB_INTEGER]=e.RGB16UI,o[i.h.RG_INTEGER]=e.RG16UI,o[i.h.RED_INTEGER]=e.R16UI,o[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),t[i.r.SHORT]=((a={})[i.h.RGBA_INTEGER]=e.RGBA16I,a[i.h.RGB_INTEGER]=e.RGB16I,a[i.h.RG_INTEGER]=e.RG16I,a[i.h.RED_INTEGER]=e.R16I,a),t[i.r.UNSIGNED_INT]=((s={})[i.h.RGBA_INTEGER]=e.RGBA32UI,s[i.h.RGB_INTEGER]=e.RGB32UI,s[i.h.RG_INTEGER]=e.RG32UI,s[i.h.RED_INTEGER]=e.R32UI,s[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,s),t[i.r.INT]=((u={})[i.h.RGBA_INTEGER]=e.RGBA32I,u[i.h.RGB_INTEGER]=e.RGB32I,u[i.h.RG_INTEGER]=e.RG32I,u[i.h.RED_INTEGER]=e.R32I,u),t[i.r.FLOAT]=((l={})[i.h.RGBA]=e.RGBA32F,l[i.h.RGB]=e.RGB32F,l[i.h.RG]=e.RG32F,l[i.h.RED]=e.R32F,l[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[i.r.HALF_FLOAT]=((c={})[i.h.RGBA]=e.RGBA16F,c[i.h.RGB]=e.RGB16F,c[i.h.RG]=e.RG16F,c[i.h.RED]=e.R16F,c),t[i.r.UNSIGNED_SHORT_5_6_5]=((h={})[i.h.RGB]=e.RGB565,h),t[i.r.UNSIGNED_SHORT_4_4_4_4]=((d={})[i.h.RGBA]=e.RGBA4,d),t[i.r.UNSIGNED_SHORT_5_5_5_1]=((f={})[i.h.RGBA]=e.RGB5_A1,f),t[i.r.UNSIGNED_INT_2_10_10_10_REV]=((p={})[i.h.RGBA]=e.RGB10_A2,p[i.h.RGBA_INTEGER]=e.RGB10_A2UI,p),t[i.r.UNSIGNED_INT_10F_11F_11F_REV]=((v={})[i.h.RGB]=e.R11F_G11F_B10F,v),t[i.r.UNSIGNED_INT_5_9_9_9_REV]=((m={})[i.h.RGB]=e.RGB9_E5,m),t[i.r.UNSIGNED_INT_24_8]=((g={})[i.h.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,g),t[i.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[i.h.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),M=t):((b={})[i.r.UNSIGNED_BYTE]=((x={})[i.h.RGBA]=e.RGBA,x[i.h.RGB]=e.RGB,x[i.h.ALPHA]=e.ALPHA,x[i.h.LUMINANCE]=e.LUMINANCE,x[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,x),b[i.r.UNSIGNED_SHORT_5_6_5]=((_={})[i.h.RGB]=e.RGB,_),b[i.r.UNSIGNED_SHORT_4_4_4_4]=((w={})[i.h.RGBA]=e.RGBA,w),b[i.r.UNSIGNED_SHORT_5_5_5_1]=((T={})[i.h.RGBA]=e.RGBA,T),M=b),M);var E=S.getParameter(S.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=E;for(var A=0;A=0;--o){var a=t[o];a&&a._glTextures[r].samplerType!==i.o.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(e){var t=new et(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=null!==(r=null===(n=this.internalFormats[e.type])||void 0===n?void 0:n[e.format])&&void 0!==r?r:e.format,2===this.webGLVersion&&e.type===i.r.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==i.o.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,o=e.realHeight,a=n.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var n=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);-1!==r&&Object(o.removeItems)(this.managedTextures,r,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&(e.mipmap!==i.k.POW2&&2===this.webGLVersion||e.isPowerOfTwo?t.mipmap=e.mipmap>=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=i.s.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==i.k.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===i.p.LINEAR){var o=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR:n.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),nt=new u.d,rt=function(e){function t(t,n){void 0===t&&(t=i.n.UNKNOWN);var a=e.call(this)||this;return n=Object.assign({},r.b.RENDER_OPTIONS,n),a.options=n,a.type=t,a.screen=new u.j(0,0,n.width,n.height),a.view=n.view||document.createElement("canvas"),a.resolution=n.resolution||r.b.RESOLUTION,a.useContextAlpha=n.useContextAlpha,a.autoDensity=!!n.autoDensity,a.preserveDrawingBuffer=n.preserveDrawingBuffer,a.clearBeforeRender=n.clearBeforeRender,a._backgroundColor=0,a._backgroundColorRgba=[0,0,0,1],a._backgroundColorString="#000000",a.backgroundColor=n.backgroundColor||a._backgroundColor,a.backgroundAlpha=n.backgroundAlpha,void 0!==n.transparent&&(Object(o.deprecation)("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),a.useContextAlpha=n.transparent,a.backgroundAlpha=n.transparent?0:1),a._lastObjectRendered=null,a.plugins={},a}return d(t,e),t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var n=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=n,this.screen.height=r,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=r+"px"),this.emit("resize",n,r)},t.prototype.generateTexture=function(e,t,n,r){void 0===t&&(t={}),"number"==typeof t&&(Object(o.deprecation)("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),t={scaleMode:t,resolution:n,region:r});var i=t.region,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var i=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;r.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,i)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n=i.l.HIGH?this.multisample=i.l.HIGH:e>=i.l.MEDIUM?this.multisample=i.l.MEDIUM:e>=i.l.LOW?this.multisample=i.l.LOW:this.multisample=i.l.NONE},t.prototype.addSystem=function(e,t){var n=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var r in this[t]=n,this.runners)this.runners[r].add(n);return this},t.prototype.render=function(e,t){var n,r,i,a;if(t&&(t instanceof O?(Object(o.deprecation)("6.0.0","Renderer#render arguments changed, use options instead."),n=t,r=arguments[2],i=arguments[3],a=arguments[4]):(n=t.renderTexture,r=t.clear,i=t.transform,a=t.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(n||(this._lastObjectRendered=e),!a){var s=e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(t,n,r,i){void 0===n&&(n={});var o=e.prototype.generateTexture.call(this,t,n,r,i);return this.framebuffer.blit(),o},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return Object(o.deprecation)("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,n){t.__plugins=t.__plugins||{},t.__plugins[e]=n},t}(rt);function st(e){return at.create(e)}var ut="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",lt="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",ct=function(){this.texArray=null,this.blend=0,this.type=i.f.TRIANGLES,this.start=0,this.size=0,this.data=null},ht=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,n=this.MAX_TEXTURES,r=t._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++g._globalBatch,u=0,l=r[0],c=0;i.copyBoundTextures(o,n);for(var h=0;h=n&&(i.boundArray(l,o,s,n),this.buildDrawCalls(l,c,h),c=h,l=r[++u],++s),d._batchEnabled=s,d.touched=a,l.elements[l.count++]=d)}for(l.count>0&&(i.boundArray(l,o,s,n),this.buildDrawCalls(l,c,this._bufferSize),++u,++s),h=0;h0&&(t+="\nelse "),n-1){var n=["\n %c %c %c PixiJS 6.4.2 - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");d=!0}}function v(){return void 0===h&&(h=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:r.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!n||!n.getContextAttributes().stencil);if(n){var o=n.getExtension("WEBGL_lose_context");o&&o.loseContext()}return n=null,i}catch(e){return!1}}()),h}var m={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function g(e,t){return void 0===t&&(t=[]),t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t}function y(e){var t=e.toString(16);return"#"+("000000".substring(0,6-t.length)+t)}function b(e){return"string"==typeof e&&"#"===(e=m[e.toLowerCase()]||e)[0]&&(e=e.slice(1)),parseInt(e,16)}function x(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)}var _=function(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[l.b.NORMAL_NPM]=l.b.NORMAL,e[l.b.ADD_NPM]=l.b.ADD,e[l.b.SCREEN_NPM]=l.b.SCREEN,t[l.b.NORMAL]=l.b.NORMAL_NPM,t[l.b.ADD]=l.b.ADD_NPM,t[l.b.SCREEN]=l.b.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}();function w(e,t){return _[t?1:0][e]}function T(e,t,n,r){return n=n||new Float32Array(4),r||void 0===r?(n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t):(n[0]=e[0],n[1]=e[1],n[2]=e[2]),n[3]=t,n}function M(e,t){if(1===t)return(255*t<<24)+e;if(0===t)return 0;var n=e>>16&255,r=e>>8&255,i=255&e;return(255*t<<24)+((n=n*t+.5|0)<<16)+((r=r*t+.5|0)<<8)+(i*t+.5|0)}function S(e,t,n,r){return(n=n||new Float32Array(4))[0]=(e>>16&255)/255,n[1]=(e>>8&255)/255,n[2]=(255&e)/255,(r||void 0===r)&&(n[0]*=t,n[1]*=t,n[2]*=t),n[3]=t,n}function E(e,t){void 0===t&&(t=null);var n=6*e;if((t=t||new Uint16Array(n)).length!==n)throw new Error("Out buffer length is incorrect, got "+t.length+" and expected "+n);for(var r=0,i=0;r>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)}function k(e){return!(e&e-1||!e)}function D(e){var t=(e>65535?1:0)<<4,n=((e>>>=t)>255?1:0)<<3;return t|=n,t|=n=((e>>>=n)>15?1:0)<<2,(t|=n=((e>>>=n)>3?1:0)<<1)|(e>>>=n)>>1}function P(e,t,n){var r,i=e.length;if(!(t>=i||0===n)){var o=i-(n=t+n>i?i-t:n);for(r=t;r1&&"undefined"==typeof MSStream},U=function(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"==typeof navigator?"string"==typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=t.userAgent,r=n.split("[FBAN");void 0!==r[1]&&(n=r[0]),void 0!==(r=n.split("Twitter"))[1]&&(n=r[0]);var i,o=(i=n,function(e){return e.test(i)}),a={apple:{phone:o(T)&&!o(k),ipod:o(M),tablet:!o(T)&&(o(S)||B(t))&&!o(k),universal:o(E),device:(o(T)||o(M)||o(S)||o(E)||B(t))&&!o(k)},amazon:{phone:o(C),tablet:!o(C)&&o(N),device:o(C)||o(N)},android:{phone:!o(k)&&o(C)||!o(k)&&o(A),tablet:!o(k)&&!o(C)&&!o(A)&&(o(N)||o(I)),device:!o(k)&&(o(C)||o(N)||o(A)||o(I))||o(/\bokhttp\b/i)},windows:{phone:o(k),tablet:o(D),device:o(k)||o(D)},other:{blackberry:o(P),blackberry10:o(O),opera:o(R),firefox:o(j),chrome:o(L),device:o(P)||o(O)||o(R)||o(j)||o(L)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}(globalThis.navigator); /*! * @pixi/settings - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC * * @pixi/settings is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license - */(w=r||(r={}))[w.WEBGL_LEGACY=0]="WEBGL_LEGACY",w[w.WEBGL=1]="WEBGL",w[w.WEBGL2=2]="WEBGL2",function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(i||(i={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(o||(o={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR"}(a||(a={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(s||(s={})),function(e){e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(u||(u={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(l||(l={})),function(e){e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT"}(c||(c={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(h||(h={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(d||(d={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(p||(p={})),function(e){e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(v||(v={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT"}(m||(m={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(g||(g={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(y||(y={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(b||(b={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(x||(x={})),function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(_||(_={}));var F={MIPMAP_TEXTURES:p.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:x.NONE,SPRITE_MAX_TEXTURES:function(e){var t,n=!0;(U.tablet||U.phone)&&(U.apple.device&&(t=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(t[1],10)<11&&(n=!1),U.android.device&&(t=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(t[1],10)<7&&(n=!1));return n?32:4}(),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:g.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:f.CLAMP,SCALE_MODE:d.LINEAR,PRECISION_VERTEX:y.HIGH,PRECISION_FRAGMENT:U.apple.device?y.HIGH:y.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!U.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1}},function(e,t,n){n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return D})),n.d(t,"c",(function(){return C})),n.d(t,"d",(function(){return N}));var r=n(4),i=n(1),o=n(3); + */(w=r||(r={}))[w.WEBGL_LEGACY=0]="WEBGL_LEGACY",w[w.WEBGL=1]="WEBGL",w[w.WEBGL2=2]="WEBGL2",function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(i||(i={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(o||(o={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR"}(a||(a={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(s||(s={})),function(e){e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(u||(u={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(l||(l={})),function(e){e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT"}(c||(c={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(h||(h={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(d||(d={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(p||(p={})),function(e){e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(v||(v={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT"}(m||(m={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(g||(g={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(y||(y={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(b||(b={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(x||(x={})),function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(_||(_={}));var z={MIPMAP_TEXTURES:p.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:x.NONE,SPRITE_MAX_TEXTURES:function(e){var t,n=!0;(U.tablet||U.phone)&&(U.apple.device&&(t=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(t[1],10)<11&&(n=!1),U.android.device&&(t=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(t[1],10)<7&&(n=!1));return n?32:4}(),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:g.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:f.CLAMP,SCALE_MODE:d.LINEAR,PRECISION_VERTEX:y.HIGH,PRECISION_FRAGMENT:U.apple.device?y.HIGH:y.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!U.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1}},function(e,t,n){n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return D})),n.d(t,"c",(function(){return C})),n.d(t,"d",(function(){return N}));var r=n(4),i=n(1),o=n(3); /*! * @pixi/display - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -78,7 +78,7 @@ var r,i,o=2*Math.PI,a=180/Math.PI,s=Math.PI/180;(i=r||(r={}))[i.POLY=0]="POLY",i * @pixi/runner is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -var r=function(){function e(e){this.items=[],this._name=e,this._aliasCount=0}return e.prototype.emit=function(e,t,n,r,i,o,a,s){if(arguments.length>8)throw new Error("max arguments reached");var u=this,l=u.name,c=u.items;this._aliasCount++;for(var h=0,d=c.length;h0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},e.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},e.prototype.remove=function(e){var t=this.items.indexOf(e);return-1!==t&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},e.prototype.contains=function(e){return-1!==this.items.indexOf(e)},e.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},e.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),e}();Object.defineProperties(r.prototype,{dispatch:{value:r.prototype.emit},run:{value:r.prototype.emit}})},function(e,t,n){var r=n(20),i=n(15);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==r(e)}},function(e,t,n){var r=n(51),i="object"==("undefined"==typeof self?"undefined":M(self))&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t){e.exports=function(e){return null!=e&&"object"==M(e)}},function(e,t,n){n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return c}));var r=n(8),i=n(0),o=n(2),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function s(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(e){function t(t,n,r,i){void 0===t&&(t=100),void 0===n&&(n=100),void 0===r&&(r=10),void 0===i&&(i=10);var o=e.call(this)||this;return o.segWidth=r,o.segHeight=i,o.width=t,o.height=n,o.build(),o}return s(t,e),t.prototype.build=function(){for(var e=this.segWidth*this.segHeight,t=[],n=[],r=[],i=this.segWidth-1,o=this.segHeight-1,a=this.width/i,s=this.height/o,u=0;u0){var d=s.x-e[c].x,f=s.y-e[c].y,p=Math.sqrt(d*d+f*f);s=e[c],a+=p/u}else a=c/(l-1);i[h]=a,i[h+1]=0,i[h+2]=a,i[h+3]=1}var v=0;for(c=0;c0?this.textureScale*this._width/2:this._width/2;r/=c,i/=c,r*=h,i*=h,o[l]=u.x+r,o[l+1]=u.y+i,o[l+2]=u.x-r,o[l+3]=u.y-i,n=u}this.buffers[0].update()}},t.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},t}(r.b),c=function(e){function t(t,n,o){void 0===o&&(o=0);var a=this,s=new l(t.height,n,o),u=new r.c(t);return o>0&&(t.baseTexture.wrapMode=i.s.REPEAT),(a=e.call(this,s,u)||this).autoUpdate=!0,a}return s(t,e),t.prototype._render=function(t){var n=this.geometry;(this.autoUpdate||n._width!==this.shader.texture.height)&&(n._width=this.shader.texture.height,n.update()),e.prototype._render.call(this,t)},t}(r.a),h=function(e){function t(t,n,i){var a=this,s=new u(t.width,t.height,n,i),l=new r.c(o.t.WHITE);return(a=e.call(this,s,l)||this).texture=t,a.autoResize=!0,a}return s(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var e=this.geometry,t=this.shader.texture,n=t.width,r=t.height;!this.autoResize||e.width===n&&e.height===r||(e.width=this.shader.texture.width,e.height=this.shader.texture.height,e.build())},Object.defineProperty(t.prototype,"texture",{get:function(){return this.shader.texture},set:function(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),e.prototype._render.call(this,t)},t.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),e.prototype.destroy.call(this,t)},t}(r.a),d=function(e){function t(t,n,i,a,s){void 0===t&&(t=o.t.EMPTY);var u=this,l=new r.b(n,i,a);l.getBuffer("aVertexPosition").static=!1;var c=new r.c(t);return(u=e.call(this,l,c,null,s)||this).autoUpdate=!0,u}return s(t,e),Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),e.prototype._render.call(this,t)},t}(r.a),f=function(e){function t(t,n,r,i,a){void 0===n&&(n=10),void 0===r&&(r=10),void 0===i&&(i=10),void 0===a&&(a=10);var s=e.call(this,o.t.WHITE,4,4)||this;return s._origWidth=t.orig.width,s._origHeight=t.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=n,s._rightWidth=i,s._topHeight=r,s._bottomHeight=a,s.texture=t,s}return s(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype.updateHorizontalVertices=function(){var e=this.vertices,t=this._getMinScale();e[9]=e[11]=e[13]=e[15]=this._topHeight*t,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*t,e[25]=e[27]=e[29]=e[31]=this._height},t.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._getMinScale();e[2]=e[10]=e[18]=e[26]=this._leftWidth*t,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*t,e[6]=e[14]=e[22]=e[30]=this._width},t.prototype._getMinScale=function(){var e=this._leftWidth+this._rightWidth,t=this._width>e?1:this._width/e,n=this._topHeight+this._bottomHeight,r=this._height>n?1:this._height/n;return Math.min(t,r)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topHeight",{get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()},enumerable:!1,configurable:!0}),t.prototype._refresh=function(){var e=this.texture,t=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var n=1/this._origWidth,r=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=n*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-n*this._rightWidth,t[9]=t[11]=t[13]=t[15]=r*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},t}(h)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==("undefined"==typeof window?"undefined":M(window))&&(n=window)}e.exports=n},function(e,t,n){var r;!function(i){function o(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,r,i,a){return o((s=o(o(t,e),o(r,a)))<<(u=i)|s>>>32-u,n);var s,u}function s(e,t,n,r,i,o,s){return a(t&n|~t&r,e,t,i,o,s)}function u(e,t,n,r,i,o,s){return a(t&r|n&~r,e,t,i,o,s)}function l(e,t,n,r,i,o,s){return a(t^n^r,e,t,i,o,s)}function c(e,t,n,r,i,o,s){return a(n^(t|~r),e,t,i,o,s)}function h(e,t){var n,r,i,a,h;e[t>>5]|=128<>>9<<4)]=t;var d=1732584193,f=-271733879,p=-1732584194,v=271733878;for(n=0;n>5]>>>t%32&255);return n}function f(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+"0123456789abcdef".charAt(15&t);return r}function v(e){return unescape(encodeURIComponent(e))}function m(e){return d(h(f(t=v(e)),8*t.length));var t}function g(e,t){return function(e,t){var n,r,i=f(e),o=[],a=[];for(o[15]=a[15]=void 0,i.length>16&&(i=h(i,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^i[n],a[n]=1549556828^i[n];return r=h(o.concat(f(t)),512+8*t.length),d(h(a.concat(r),640))}(v(e),v(t))}function y(e,t,n){return t?n?g(t,e):p(g(t,e)):n?m(e):p(m(e))}void 0===(r=function(){return y}.call(t,n,t,e))||(e.exports=r)}()},function(e,t){e.exports="precision mediump float;\nattribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\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() {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tfilterCoord = aVertexPosition * outputFrame.zw;\n}\n"},function(e,t,n){var r=n(24),i=n(137),o=n(138),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t){e.exports=function(e){var t=M(e);return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(162),i=n(165);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){(function(t){e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,(function(e){return i(t[a][1][e]||e)}),l,l.exports,e,t,n,r)}return n[a].exports}for(var o=!1,a=0;ae.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function _(e){return o([function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),b(e)})).then((function(){return function(e){p(e);for(var t=d[e.name],n=t.forages,r=0;r=43)}})).catch((function(){return!1}))).then((function(e){return h=e}));var t}(s.db).then((function(e){return e?t:(n=t,new a((function(e,t){var r=new FileReader;r.onerror=t,r.onloadend=function(t){var r=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)})));var n})):t})).then((function(t){S(r._dbInfo,"readwrite",(function(o,a){if(o)return i(o);try{var s=a.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,n),i},removeItem:function(e,t){var n=this;e=l(e);var r=new a((function(t,r){n.ready().then((function(){S(n._dbInfo,"readwrite",(function(i,o){if(i)return r(i);try{var a=o.objectStore(n._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){r(a.error)},o.onabort=function(){var e=a.error?a.error:a.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){S(t._dbInfo,"readwrite",(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){S(t._dbInfo,"readonly",(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new a((function(t,r){e<0?t(null):n.ready().then((function(){S(n._dbInfo,"readonly",(function(i,o){if(i)return r(i);try{var a=o.objectStore(n._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var n=u.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},u.onerror=function(){r(u.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){S(t._dbInfo,"readonly",(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];o.onsuccess=function(){var t=o.result;t?(a.push(t.key),t.continue()):e(a)},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=c.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,o=this;if(e.name){var u=e.name===n.name&&o._dbInfo.db,l=u?a.resolve(o._dbInfo.db):y(e).then((function(t){var n=d[e.name],r=n.forages;n.db=t;for(var i=0;i>4,c[u++]=(15&r)<<4|i>>2,c[u++]=(3&i)<<6|63&o;return l}function P(e){var t,n=new Uint8Array(e),r="";for(t=0;t>2],r+=A[(3&n[t])<<4|n[t+1]>>4],r+=A[(15&n[t+1])<<2|n[t+2]>>6],r+=A[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var O={serialize:function(e,t){var n="";if(e&&(n=k.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===k.call(e.buffer))){var r,i="__lfsc__:";e instanceof ArrayBuffer?(r=e,i+="arbf"):(r=e.buffer,"[object Int8Array]"===n?i+="si08":"[object Uint8Array]"===n?i+="ui08":"[object Uint8ClampedArray]"===n?i+="uic8":"[object Int16Array]"===n?i+="si16":"[object Uint16Array]"===n?i+="ur16":"[object Int32Array]"===n?i+="si32":"[object Uint32Array]"===n?i+="ui32":"[object Float32Array]"===n?i+="fl32":"[object Float64Array]"===n?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+P(r))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var n="~~local_forage_type~"+e.type+"~"+P(this.result);t("__lfsc__:blob"+n)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if("__lfsc__:"!==e.substring(0,C))return JSON.parse(e);var t,n=e.substring(N),r=e.substring(C,N);if("blob"===r&&I.test(n)){var i=n.match(I);t=i[1],n=n.substring(i[0].length)}var a=D(n);switch(r){case"arbf":return a;case"blob":return o([a],{type:t});case"si08":return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+r)}},stringToBuffer:D,bufferToString:P};function R(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function L(e,t,n,r,i,o){e.executeSql(n,r,i,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?o(e,a):R(e,t,(function(){e.executeSql(n,r,i,o)}),o)}),o):o(e,a)}),o)}function j(e,t,n,r){var i=this;e=l(e);var o=new a((function(o,a){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,l){l?a(l):u.db.transaction((function(n){L(n,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void o(j.apply(i,[e,s,n,r-1]));a(t)}}))}))})).catch(a)}));return s(o,n),o}function B(e){return new a((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],o=0;o0?(this._dbInfo=t,t.serializer=O,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,o=localStorage.length,a=1,s=0;s=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return s(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return s(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):a.reject("Invalid arguments"),t),r}},G=function(e,t){for(var n,r,i=e.length,o=0;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,v=String.fromCharCode;function m(e){throw RangeError(f[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=36)e=p(e/35);return p(r+36*e/(e+38))}function T(e){var t,n,r,i,o,a,s,u,c,h,d,f=[],v=e.length,g=0,y=128,b=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&m("not-basic"),f.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=v&&m("invalid-input"),((u=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>p((l-g)/a))&&m("overflow"),g+=u*a,!(u<(c=s<=b?1:s>=b+26?26:s-b));s+=36)a>p(l/(h=36-c))&&m("overflow"),a*=h;b=w(g-o,t=f.length+1,0==o),p(g/t)>l-y&&m("overflow"),y+=p(g/t),g%=t,f.splice(g++,0,y)}return x(f)}function S(e){var t,n,r,i,o,a,s,u,c,h,d,f,g,y,x,T=[];for(f=(e=b(e)).length,t=128,n=0,o=72,a=0;a=t&&dp((l-n)/(g=r+1))&&m("overflow"),n+=(s-t)*g,t=s,a=0;al&&m("overflow"),d==t){for(u=n,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)x=u-h,y=36-h,T.push(v(_(h+x%y,0))),u=p(x/y);T.push(v(_(u,0))),o=w(n,g,r==i),n=0,++r}++n,++t}return T.join("")}if(a={version:"1.3.2",ucs2:{decode:b,encode:x},decode:T,encode:S,toASCII:function(e){return y(e,(function(e){return h.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return y(e,(function(e){return c.test(e)?T(e.slice(4).toLowerCase()):e}))}},r&&i)if(e.exports==r)i.exports=a;else for(s in a)a.hasOwnProperty(s)&&(r[s]=a[s]);else n.punycode=a}(u)})),d=function(e){return"string"==typeof e},f=function(e){return"object"==M(e)&&null!==e},p=function(e){return null===e};function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var m=function(e,t,n,r){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u=0?(l=f.substr(0,p),c=f.substr(p+1)):(l=f,c=""),h=decodeURIComponent(l),d=decodeURIComponent(c),v(i,h)?Array.isArray(i[h])?i[h].push(d):i[h]=[i[h],d]:i[h]=d}return i},g=function(e){switch(M(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},y=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==M(e)?Object.keys(e).map((function(r){var i=encodeURIComponent(g(r))+n;return Array.isArray(e[r])?e[r].map((function(e){return i+encodeURIComponent(g(e))})).join(t):i+encodeURIComponent(g(e[r]))})).join(t):r?encodeURIComponent(g(r))+n+encodeURIComponent(g(e)):""},b=l((function(e,t){t.decode=t.parse=m,t.encode=t.stringify=y})),x=R;function _(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var w=/^([a-z0-9.+-]+:)/i,T=/:[0-9]*$/,S=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,E=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),A=["'"].concat(E),I=["%","/","?",";","#"].concat(A),C=["/","?","#"],N=/^[+a-z0-9A-Z_-]{0,63}$/,k=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,D={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function R(e,t,n){if(e&&f(e)&&e instanceof _)return e;var r=new _;return r.parse(e,t,n),r}_.prototype.parse=function(e,t,n){if(!d(e))throw new TypeError("Parameter 'url' must be a string, not "+M(e));var r=e.indexOf("?"),i=-1!==r&&r127?E+="x":E+=T[R];if(!E.match(N)){var j=x.slice(0,m),B=x.slice(m+1),U=T.match(k);U&&(j.push(U[1]),B.unshift(U[2])),B.length&&(a="/"+B.join(".")+a),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=h.toASCII(this.hostname));var F=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+F,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!D[l])for(m=0,_=A.length;m<_;m++){var G=A[m];if(-1!==a.indexOf(G)){var H=encodeURIComponent(G);H===G&&(H=escape(G)),a=a.split(G).join(H)}}var V=a.indexOf("#");-1!==V&&(this.hash=a.substr(V),a=a.slice(0,V));var W=a.indexOf("?");if(-1!==W?(this.search=a.substr(W),this.query=a.substr(W+1),t&&(this.query=b.parse(this.query)),a=a.slice(0,W)):t&&(this.search="",this.query={}),a&&(this.pathname=a),O[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var Y=this.search||"";this.path=F+Y}return this.href=this.format(),this},_.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&f(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||O[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+i+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},_.prototype.resolve=function(e){return this.resolveObject(R(e,!1,!0)).format()},_.prototype.resolveObject=function(e){if(d(e)){var t=new _;t.parse(e,!1,!0),e=t}for(var n=new _,r=Object.keys(this),i=0;i0)&&n.host.split("@"))&&(n.auth=I.shift(),n.host=n.hostname=I.shift())),n.search=e.search,n.query=e.query,p(n.pathname)&&p(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var M=w.slice(-1)[0],S=(n.host||e.host||w.length>1)&&("."===M||".."===M)||""===M,E=0,A=w.length;A>=0;A--)"."===(M=w[A])?w.splice(A,1):".."===M?(w.splice(A,1),E++):E&&(w.splice(A,1),E--);if(!b&&!x)for(;E--;E)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("");var I,C=""===w[0]||w[0]&&"/"===w[0].charAt(0);return T&&(n.hostname=n.host=C?"":w.length?w.shift():"",(I=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=I.shift(),n.host=n.hostname=I.shift())),(b=b||n.host&&w.length)&&!C&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),p(n.pathname)&&p(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},_.prototype.parseHost=function(){var e=this.host,t=T.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}; +var r=function(){function e(e){this.items=[],this._name=e,this._aliasCount=0}return e.prototype.emit=function(e,t,n,r,i,o,a,s){if(arguments.length>8)throw new Error("max arguments reached");var u=this,l=u.name,c=u.items;this._aliasCount++;for(var h=0,d=c.length;h0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},e.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},e.prototype.remove=function(e){var t=this.items.indexOf(e);return-1!==t&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},e.prototype.contains=function(e){return-1!==this.items.indexOf(e)},e.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},e.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),e}();Object.defineProperties(r.prototype,{dispatch:{value:r.prototype.emit},run:{value:r.prototype.emit}})},function(e,t,n){var r=n(20),i=n(15);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==r(e)}},function(e,t,n){var r=n(51),i="object"==("undefined"==typeof self?"undefined":M(self))&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t){e.exports=function(e){return null!=e&&"object"==M(e)}},function(e,t,n){n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return c}));var r=n(8),i=n(0),o=n(2),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function s(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(e){function t(t,n,r,i){void 0===t&&(t=100),void 0===n&&(n=100),void 0===r&&(r=10),void 0===i&&(i=10);var o=e.call(this)||this;return o.segWidth=r,o.segHeight=i,o.width=t,o.height=n,o.build(),o}return s(t,e),t.prototype.build=function(){for(var e=this.segWidth*this.segHeight,t=[],n=[],r=[],i=this.segWidth-1,o=this.segHeight-1,a=this.width/i,s=this.height/o,u=0;u0){var d=s.x-e[c].x,f=s.y-e[c].y,p=Math.sqrt(d*d+f*f);s=e[c],a+=p/u}else a=c/(l-1);i[h]=a,i[h+1]=0,i[h+2]=a,i[h+3]=1}var v=0;for(c=0;c0?this.textureScale*this._width/2:this._width/2;r/=c,i/=c,r*=h,i*=h,o[l]=u.x+r,o[l+1]=u.y+i,o[l+2]=u.x-r,o[l+3]=u.y-i,n=u}this.buffers[0].update()}},t.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},t}(r.b),c=function(e){function t(t,n,o){void 0===o&&(o=0);var a=this,s=new l(t.height,n,o),u=new r.c(t);return o>0&&(t.baseTexture.wrapMode=i.s.REPEAT),(a=e.call(this,s,u)||this).autoUpdate=!0,a}return s(t,e),t.prototype._render=function(t){var n=this.geometry;(this.autoUpdate||n._width!==this.shader.texture.height)&&(n._width=this.shader.texture.height,n.update()),e.prototype._render.call(this,t)},t}(r.a),h=function(e){function t(t,n,i){var a=this,s=new u(t.width,t.height,n,i),l=new r.c(o.t.WHITE);return(a=e.call(this,s,l)||this).texture=t,a.autoResize=!0,a}return s(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var e=this.geometry,t=this.shader.texture,n=t.width,r=t.height;!this.autoResize||e.width===n&&e.height===r||(e.width=this.shader.texture.width,e.height=this.shader.texture.height,e.build())},Object.defineProperty(t.prototype,"texture",{get:function(){return this.shader.texture},set:function(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),e.prototype._render.call(this,t)},t.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),e.prototype.destroy.call(this,t)},t}(r.a),d=function(e){function t(t,n,i,a,s){void 0===t&&(t=o.t.EMPTY);var u=this,l=new r.b(n,i,a);l.getBuffer("aVertexPosition").static=!1;var c=new r.c(t);return(u=e.call(this,l,c,null,s)||this).autoUpdate=!0,u}return s(t,e),Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),e.prototype._render.call(this,t)},t}(r.a),f=function(e){function t(t,n,r,i,a){void 0===n&&(n=10),void 0===r&&(r=10),void 0===i&&(i=10),void 0===a&&(a=10);var s=e.call(this,o.t.WHITE,4,4)||this;return s._origWidth=t.orig.width,s._origHeight=t.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=n,s._rightWidth=i,s._topHeight=r,s._bottomHeight=a,s.texture=t,s}return s(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype.updateHorizontalVertices=function(){var e=this.vertices,t=this._getMinScale();e[9]=e[11]=e[13]=e[15]=this._topHeight*t,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*t,e[25]=e[27]=e[29]=e[31]=this._height},t.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._getMinScale();e[2]=e[10]=e[18]=e[26]=this._leftWidth*t,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*t,e[6]=e[14]=e[22]=e[30]=this._width},t.prototype._getMinScale=function(){var e=this._leftWidth+this._rightWidth,t=this._width>e?1:this._width/e,n=this._topHeight+this._bottomHeight,r=this._height>n?1:this._height/n;return Math.min(t,r)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topHeight",{get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()},enumerable:!1,configurable:!0}),t.prototype._refresh=function(){var e=this.texture,t=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var n=1/this._origWidth,r=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=n*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-n*this._rightWidth,t[9]=t[11]=t[13]=t[15]=r*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},t}(h)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==("undefined"==typeof window?"undefined":M(window))&&(n=window)}e.exports=n},function(e,t,n){var r;!function(i){function o(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,r,i,a){return o((s=o(o(t,e),o(r,a)))<<(u=i)|s>>>32-u,n);var s,u}function s(e,t,n,r,i,o,s){return a(t&n|~t&r,e,t,i,o,s)}function u(e,t,n,r,i,o,s){return a(t&r|n&~r,e,t,i,o,s)}function l(e,t,n,r,i,o,s){return a(t^n^r,e,t,i,o,s)}function c(e,t,n,r,i,o,s){return a(n^(t|~r),e,t,i,o,s)}function h(e,t){var n,r,i,a,h;e[t>>5]|=128<>>9<<4)]=t;var d=1732584193,f=-271733879,p=-1732584194,v=271733878;for(n=0;n>5]>>>t%32&255);return n}function f(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+"0123456789abcdef".charAt(15&t);return r}function v(e){return unescape(encodeURIComponent(e))}function m(e){return d(h(f(t=v(e)),8*t.length));var t}function g(e,t){return function(e,t){var n,r,i=f(e),o=[],a=[];for(o[15]=a[15]=void 0,i.length>16&&(i=h(i,8*e.length)),n=0;n<16;n+=1)o[n]=909522486^i[n],a[n]=1549556828^i[n];return r=h(o.concat(f(t)),512+8*t.length),d(h(a.concat(r),640))}(v(e),v(t))}function y(e,t,n){return t?n?g(t,e):p(g(t,e)):n?m(e):p(m(e))}void 0===(r=function(){return y}.call(t,n,t,e))||(e.exports=r)}()},function(e,t){e.exports="precision mediump float;\nattribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 filterCoord;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\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() {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tfilterCoord = aVertexPosition * outputFrame.zw;\n}\n"},function(e,t,n){var r=n(24),i=n(137),o=n(138),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t){e.exports=function(e){var t=M(e);return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(162),i=n(165);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){(function(t){e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,(function(e){return i(t[a][1][e]||e)}),l,l.exports,e,t,n,r)}return n[a].exports}for(var o=!1,a=0;ae.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function _(e){return o([function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),b(e)})).then((function(){return function(e){p(e);for(var t=d[e.name],n=t.forages,r=0;r=43)}})).catch((function(){return!1}))).then((function(e){return h=e}));var t}(s.db).then((function(e){return e?t:(n=t,new a((function(e,t){var r=new FileReader;r.onerror=t,r.onloadend=function(t){var r=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)})));var n})):t})).then((function(t){S(r._dbInfo,"readwrite",(function(o,a){if(o)return i(o);try{var s=a.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,n),i},removeItem:function(e,t){var n=this;e=l(e);var r=new a((function(t,r){n.ready().then((function(){S(n._dbInfo,"readwrite",(function(i,o){if(i)return r(i);try{var a=o.objectStore(n._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){r(a.error)},o.onabort=function(){var e=a.error?a.error:a.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){S(t._dbInfo,"readwrite",(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){S(t._dbInfo,"readonly",(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new a((function(t,r){e<0?t(null):n.ready().then((function(){S(n._dbInfo,"readonly",(function(i,o){if(i)return r(i);try{var a=o.objectStore(n._dbInfo.storeName),s=!1,u=a.openKeyCursor();u.onsuccess=function(){var n=u.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},u.onerror=function(){r(u.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){S(t._dbInfo,"readonly",(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];o.onsuccess=function(){var t=o.result;t?(a.push(t.key),t.continue()):e(a)},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=c.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,o=this;if(e.name){var u=e.name===n.name&&o._dbInfo.db,l=u?a.resolve(o._dbInfo.db):y(e).then((function(t){var n=d[e.name],r=n.forages;n.db=t;for(var i=0;i>4,c[u++]=(15&r)<<4|i>>2,c[u++]=(3&i)<<6|63&o;return l}function P(e){var t,n=new Uint8Array(e),r="";for(t=0;t>2],r+=A[(3&n[t])<<4|n[t+1]>>4],r+=A[(15&n[t+1])<<2|n[t+2]>>6],r+=A[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var O={serialize:function(e,t){var n="";if(e&&(n=k.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===k.call(e.buffer))){var r,i="__lfsc__:";e instanceof ArrayBuffer?(r=e,i+="arbf"):(r=e.buffer,"[object Int8Array]"===n?i+="si08":"[object Uint8Array]"===n?i+="ui08":"[object Uint8ClampedArray]"===n?i+="uic8":"[object Int16Array]"===n?i+="si16":"[object Uint16Array]"===n?i+="ur16":"[object Int32Array]"===n?i+="si32":"[object Uint32Array]"===n?i+="ui32":"[object Float32Array]"===n?i+="fl32":"[object Float64Array]"===n?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+P(r))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var n="~~local_forage_type~"+e.type+"~"+P(this.result);t("__lfsc__:blob"+n)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if("__lfsc__:"!==e.substring(0,C))return JSON.parse(e);var t,n=e.substring(N),r=e.substring(C,N);if("blob"===r&&I.test(n)){var i=n.match(I);t=i[1],n=n.substring(i[0].length)}var a=D(n);switch(r){case"arbf":return a;case"blob":return o([a],{type:t});case"si08":return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+r)}},stringToBuffer:D,bufferToString:P};function R(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function L(e,t,n,r,i,o){e.executeSql(n,r,i,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?o(e,a):R(e,t,(function(){e.executeSql(n,r,i,o)}),o)}),o):o(e,a)}),o)}function j(e,t,n,r){var i=this;e=l(e);var o=new a((function(o,a){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,l){l?a(l):u.db.transaction((function(n){L(n,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void o(j.apply(i,[e,s,n,r-1]));a(t)}}))}))})).catch(a)}));return s(o,n),o}function B(e){return new a((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],o=0;o0?(this._dbInfo=t,t.serializer=O,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,o=localStorage.length,a=1,s=0;s=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return s(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return s(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):a.reject("Invalid arguments"),t),r}},G=function(e,t){for(var n,r,i=e.length,o=0;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,v=String.fromCharCode;function m(e){throw RangeError(f[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=36)e=p(e/35);return p(r+36*e/(e+38))}function T(e){var t,n,r,i,o,a,s,u,c,h,d,f=[],v=e.length,g=0,y=128,b=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&m("not-basic"),f.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=v&&m("invalid-input"),((u=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>p((l-g)/a))&&m("overflow"),g+=u*a,!(u<(c=s<=b?1:s>=b+26?26:s-b));s+=36)a>p(l/(h=36-c))&&m("overflow"),a*=h;b=w(g-o,t=f.length+1,0==o),p(g/t)>l-y&&m("overflow"),y+=p(g/t),g%=t,f.splice(g++,0,y)}return x(f)}function S(e){var t,n,r,i,o,a,s,u,c,h,d,f,g,y,x,T=[];for(f=(e=b(e)).length,t=128,n=0,o=72,a=0;a=t&&dp((l-n)/(g=r+1))&&m("overflow"),n+=(s-t)*g,t=s,a=0;al&&m("overflow"),d==t){for(u=n,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)x=u-h,y=36-h,T.push(v(_(h+x%y,0))),u=p(x/y);T.push(v(_(u,0))),o=w(n,g,r==i),n=0,++r}++n,++t}return T.join("")}if(a={version:"1.3.2",ucs2:{decode:b,encode:x},decode:T,encode:S,toASCII:function(e){return y(e,(function(e){return h.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return y(e,(function(e){return c.test(e)?T(e.slice(4).toLowerCase()):e}))}},r&&i)if(e.exports==r)i.exports=a;else for(s in a)a.hasOwnProperty(s)&&(r[s]=a[s]);else n.punycode=a}(u)})),d=function(e){return"string"==typeof e},f=function(e){return"object"==M(e)&&null!==e},p=function(e){return null===e};function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var m=function(e,t,n,r){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u=0?(l=f.substr(0,p),c=f.substr(p+1)):(l=f,c=""),h=decodeURIComponent(l),d=decodeURIComponent(c),v(i,h)?Array.isArray(i[h])?i[h].push(d):i[h]=[i[h],d]:i[h]=d}return i},g=function(e){switch(M(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},y=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==M(e)?Object.keys(e).map((function(r){var i=encodeURIComponent(g(r))+n;return Array.isArray(e[r])?e[r].map((function(e){return i+encodeURIComponent(g(e))})).join(t):i+encodeURIComponent(g(e[r]))})).join(t):r?encodeURIComponent(g(r))+n+encodeURIComponent(g(e)):""},b=l((function(e,t){t.decode=t.parse=m,t.encode=t.stringify=y})),x=R;function _(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var w=/^([a-z0-9.+-]+:)/i,T=/:[0-9]*$/,S=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,E=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),A=["'"].concat(E),I=["%","/","?",";","#"].concat(A),C=["/","?","#"],N=/^[+a-z0-9A-Z_-]{0,63}$/,k=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,D={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function R(e,t,n){if(e&&f(e)&&e instanceof _)return e;var r=new _;return r.parse(e,t,n),r}_.prototype.parse=function(e,t,n){if(!d(e))throw new TypeError("Parameter 'url' must be a string, not "+M(e));var r=e.indexOf("?"),i=-1!==r&&r127?E+="x":E+=T[R];if(!E.match(N)){var j=x.slice(0,m),B=x.slice(m+1),U=T.match(k);U&&(j.push(U[1]),B.unshift(U[2])),B.length&&(a="/"+B.join(".")+a),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=h.toASCII(this.hostname));var z=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+z,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!D[l])for(m=0,_=A.length;m<_;m++){var G=A[m];if(-1!==a.indexOf(G)){var H=encodeURIComponent(G);H===G&&(H=escape(G)),a=a.split(G).join(H)}}var V=a.indexOf("#");-1!==V&&(this.hash=a.substr(V),a=a.slice(0,V));var W=a.indexOf("?");if(-1!==W?(this.search=a.substr(W),this.query=a.substr(W+1),t&&(this.query=b.parse(this.query)),a=a.slice(0,W)):t&&(this.search="",this.query={}),a&&(this.pathname=a),O[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var Y=this.search||"";this.path=z+Y}return this.href=this.format(),this},_.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&f(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||O[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+i+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},_.prototype.resolve=function(e){return this.resolveObject(R(e,!1,!0)).format()},_.prototype.resolveObject=function(e){if(d(e)){var t=new _;t.parse(e,!1,!0),e=t}for(var n=new _,r=Object.keys(this),i=0;i0)&&n.host.split("@"))&&(n.auth=I.shift(),n.host=n.hostname=I.shift())),n.search=e.search,n.query=e.query,p(n.pathname)&&p(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var M=w.slice(-1)[0],S=(n.host||e.host||w.length>1)&&("."===M||".."===M)||""===M,E=0,A=w.length;A>=0;A--)"."===(M=w[A])?w.splice(A,1):".."===M?(w.splice(A,1),E++):E&&(w.splice(A,1),E--);if(!b&&!x)for(;E--;E)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("");var I,C=""===w[0]||w[0]&&"/"===w[0].charAt(0);return T&&(n.hostname=n.host=C?"":w.length?w.shift():"",(I=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=I.shift(),n.host=n.hostname=I.shift())),(b=b||n.host&&w.length)&&!C&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),p(n.pathname)&&p(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},_.prototype.parseHost=function(){var e=this.host,t=T.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}; /*! * @pixi/utils - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -86,7 +86,7 @@ var r=function(){function e(e){this.items=[],this._name=e,this._aliasCount=0}ret * @pixi/utils is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -var L={parse:x,format:function(e){return d(e)&&(e=R(e)),e instanceof _?e.format():_.prototype.format.call(e)},resolve:function(e,t){return R(e,!1,!0).resolve(t)}};r.b.RETINA_PREFIX=/@([0-9\.]+)x/,r.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var j,B=!1,U=function(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[i.b.NORMAL_NPM]=i.b.NORMAL,e[i.b.ADD_NPM]=i.b.ADD,e[i.b.SCREEN_NPM]=i.b.SCREEN,t[i.b.NORMAL]=i.b.NORMAL_NPM,t[i.b.ADD]=i.b.ADD_NPM,t[i.b.SCREEN]=i.b.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}();function F(e){if(4===e.BYTES_PER_ELEMENT)return e instanceof Float32Array?"Float32Array":e instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===e.BYTES_PER_ELEMENT){if(e instanceof Uint16Array)return"Uint16Array"}else if(1===e.BYTES_PER_ELEMENT&&e instanceof Uint8Array)return"Uint8Array";return null}function z(e){return e+=0===e?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)}function G(e){return!(e&e-1||!e)}function H(e){var t=(e>65535?1:0)<<4,n=((e>>>=t)>255?1:0)<<3;return t|=n,t|=n=((e>>>=n)>15?1:0)<<2,(t|=n=((e>>>=n)>3?1:0)<<1)|(e>>>=n)>>1}var V=0;function W(){return++V}var Y={};function X(e,t,n){if(void 0===n&&(n=3),!Y[t]){var r=(new Error).stack;void 0===r?console.warn("PixiJS Deprecation Warning: ",t+"\nDeprecated since v"+e):(r=r.split("\n").splice(n).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t+"\nDeprecated since v"+e),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",t+"\nDeprecated since v"+e),console.warn(r))),Y[t]=!0}}var Q,Z={},q=Object.create(null),J=Object.create(null);function K(e,t){var n=r.b.RETINA_PREFIX.exec(e);return n?parseFloat(n[1]):void 0!==t?t:1} +var L={parse:x,format:function(e){return d(e)&&(e=R(e)),e instanceof _?e.format():_.prototype.format.call(e)},resolve:function(e,t){return R(e,!1,!0).resolve(t)}};r.b.RETINA_PREFIX=/@([0-9\.]+)x/,r.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var j,B=!1,U=function(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[i.b.NORMAL_NPM]=i.b.NORMAL,e[i.b.ADD_NPM]=i.b.ADD,e[i.b.SCREEN_NPM]=i.b.SCREEN,t[i.b.NORMAL]=i.b.NORMAL_NPM,t[i.b.ADD]=i.b.ADD_NPM,t[i.b.SCREEN]=i.b.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}();function z(e){if(4===e.BYTES_PER_ELEMENT)return e instanceof Float32Array?"Float32Array":e instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===e.BYTES_PER_ELEMENT){if(e instanceof Uint16Array)return"Uint16Array"}else if(1===e.BYTES_PER_ELEMENT&&e instanceof Uint8Array)return"Uint8Array";return null}function F(e){return e+=0===e?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)}function G(e){return!(e&e-1||!e)}function H(e){var t=(e>65535?1:0)<<4,n=((e>>>=t)>255?1:0)<<3;return t|=n,t|=n=((e>>>=n)>15?1:0)<<2,(t|=n=((e>>>=n)>3?1:0)<<1)|(e>>>=n)>>1}var V=0;function W(){return++V}var Y={};function X(e,t,n){if(void 0===n&&(n=3),!Y[t]){var r=(new Error).stack;void 0===r?console.warn("PixiJS Deprecation Warning: ",t+"\nDeprecated since v"+e):(r=r.split("\n").splice(n).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t+"\nDeprecated since v"+e),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",t+"\nDeprecated since v"+e),console.warn(r))),Y[t]=!0}}var Q,Z={},q=Object.create(null),J=Object.create(null);function K(e,t){var n=r.b.RETINA_PREFIX.exec(e);return n?parseFloat(n[1]):void 0!==t?t:1} /*! * @pixi/runner - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -107,7 +107,7 @@ var L={parse:x,format:function(e){return d(e)&&(e=R(e)),e instanceof _?e.format( See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. - ***************************************************************************** */var _e=function(e,t){return(_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function we(e,t){function n(){this.constructor=e}_e(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Te=function(){return(Te=Object.assign||function(e){for(var t,n=arguments,r=1,i=arguments.length;r0&&h>0,o.textureCacheIds=[],o.destroyed=!1,o.resource=null,o._batchEnabled=0,o._batchLocation=0,o.parentTextureArray=null,o.setResource(t),o}return we(t,e),Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var n;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,n){return n=n||this.resolution,this.setRealSize(e*n,t*n,n)},t.prototype.setRealSize=function(e,t,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=G(this.realWidth)&&G(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT()),this},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete J[this.cacheId],delete q[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,n,i){void 0===i&&(i=r.b.STRICT_TEXTURE_CACHE);var o="string"==typeof e,a=null;if(o)a=e;else{if(!e._pixiId){var s=n&&n.pixiIdPrefix||"pixiid";e._pixiId=s+"_"+W()}a=e._pixiId}var u=J[a];if(o&&i&&!u)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return u||((u=new t(e,n)).cacheId=a,t.addToCache(u,a)),u},t.fromBuffer=function(e,n,r,o){e=e||new Float32Array(n*r*4);var a=new Se(e,{width:n,height:r}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(Ee,o||{width:n,height:r,type:s}))},t.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),J[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),J[t]=e)},t.removeFromCache=function(e){if("string"==typeof e){var t=J[e];if(t){var n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete J[e],t}}else if(e&&e.textureCacheIds){for(var r=0;r0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,t)}else e.target=i.q.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,n,r){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(Ne),Re=function(e){function t(n,r){var i=this;if(r=r||{},!(n instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof n&&(n=[n]);var a=n[0].src||n[0];Ne.crossOrigin(o,a,r.crossorigin);for(var s=0;s0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(ie.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(ie.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,n){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(n)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(Ne),Le=function(e){function t(t){return e.call(this,t)||this}return we(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},t}(Ne);be.push(Pe,Le,ke,Re,Oe,Se,De,Ce);var je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return we(t,e),t.prototype.upload=function(e,t,n){var r=e.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===i.a.UNPACK);var o=t.realWidth,a=t.realHeight;return n.width===o&&n.height===a?r.texSubImage2D(t.target,0,0,0,o,a,t.format,n.type,this.data):(n.width=o,n.height=a,r.texImage2D(t.target,0,n.internalFormat,o,a,0,t.format,n.type,this.data)),!0},t}(Se),Be=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new te("disposeFramebuffer"),this.multisample=i.l.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new Ae(null,{scaleMode:i.p.NEAREST,resolution:1,mipmap:i.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Ae(new je(null,{width:this.width,height:this.height}),{scaleMode:i.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.k.OFF,format:i.h.DEPTH_COMPONENT,type:i.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&t.textureCacheIds.splice(n,1),delete q[e],t}}else if(e&&e.textureCacheIds){for(var r=0;rthis.baseTexture.width,a=n+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+r+" = "+(t+r)+" > "+this.baseTexture.width,l="Y: "+n+" + "+i+" = "+(n+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=r&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new Ae),Ge(t._EMPTY),Ge(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=document.createElement("canvas"),n=e.getContext("2d");e.width=16,e.height=16,n.fillStyle="white",n.fillRect(0,0,16,16),t._WHITE=new t(new Ae(new ke(e))),Ge(t._WHITE),Ge(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(c),Ve=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return we(t,e),Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,n){void 0===n&&(n=!0);var r=this.baseTexture.resolution,i=Math.round(e*r)/r,o=Math.round(t*r)/r;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(i,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var n=arguments,r=[],i=1;i1?-r:-1:(o=((65535&(e=z(e)))<<16|65535&(t=z(t)))>>>0,r>1&&(o+=4294967296*r)),this.texturePool[o]||(this.texturePool[o]=[]);var a=this.texturePool[o].pop();return a||(a=this.createTexture(e,t,r)),a.filterPoolKey=o,a.setResolution(n),a},e.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||i.l.NONE);return r.filterFrame=e.filterFrame,r},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r0&&e.height>0,this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var r=0;r1){for(var l=0;l1&&((h=this.getOptimalFilterTexture(c.width,c.height,t.resolution)).filterFrame=c.filterFrame),n[d].apply(this,c,h,i.e.CLEAR,t);var f=c;c=h,h=f}n[d].apply(this,c,l.renderTexture,i.e.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=i.e.CLEAR);var n=this.renderer,r=n.renderTexture,o=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,r.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(t===i.e.CLEAR||t===i.e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,n,r){var o=this.renderer;o.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.f.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,i=n.destinationFrame,o=t._texture.orig,a=e.set(i.width,0,0,i.height,r.x,r.y),s=t.worldTransform.copyTo(ce.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,n,r){return void 0===n&&(n=1),void 0===r&&(r=i.l.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},e.prototype.getFilterTexture=function(e,t,n){if("number"==typeof e){var r=e;e=t,t=r}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||i.l.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var n=ot[0],r=ot[1],i=ot[2],o=ot[3];n.set(t.left,t.top),r.set(t.left,t.bottom),i.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(i,i),e.apply(o,o);var a=Math.min(n.x,r.x,i.x,o.x),s=Math.min(n.y,r.y,i.y,o.y),u=Math.max(n.x,r.x,i.x,o.x),l=Math.max(n.y,r.y,i.y,o.y);t.x=a,t.y=s,t.width=u-a,t.height=l-s},e.prototype.roundFrame=function(e,t,n,r,i){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?at.copyFrom(i):at.identity()).translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),ut=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),lt=function(){function e(e){this.renderer=e,this.emptyRenderer=new ut(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},e.prototype.boundArray=function(e,t,n,r){for(var i=e.elements,o=e.ids,a=e.count,s=0,u=0;u=0&&c=i.g.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var r=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),dt=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},ft=new ue,pt=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Be(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ue,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;r.b.PREFER_ENV===i.g.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,n){void 0===n&&(n=0);var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=n),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>n,u=t.height>>n,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,u)}else s=e.width>>n,u=e.height>>n,this.setViewport(0,0,s,u)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,n,r){var i=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),i.width===n&&i.height===r&&i.x===e&&i.y===t||(i.x=e,i.y=t,i.width=n,i.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,n,r,o){void 0===o&&(o=i.c.COLOR|i.c.DEPTH);var a=this.gl;a.clearColor(e,t,n,r),a.clear(o)},e.prototype.initFramebuffer=function(e){var t=this.gl,n=new dt(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},e.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,i=r.length;t.drawBuffers||(i=Math.min(i,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var a=[],s=0;s1&&n.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var c=e.depthTexture;this.renderer.texture.bind(c,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null):(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil))},e.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,n=i.l.NONE;if(e<=1||null===t)return n;for(var r=0;r=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n0&&(t+="\nelse "),n=i.g.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),Mt=t}return Mt}();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);wt=t.precision?i.m.HIGH:i.m.MEDIUM}}return wt}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,n,r){var i=t+n,o=Z[i];return o||(Z[i]=o=new e(t,n,r)),o},e}(),Ft=function(){function e(e,t){this.uniformBindCount=0,this.program=e,this.uniformGroup=t?t instanceof rt?t:new rt(t):new rt({})}return e.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var n in t.uniforms){var r=t.uniforms[n];if(r.group&&this.checkUniformExists(e,r))return!0}return!1},e.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),e.from=function(t,n,r){return new e(Ut.from(t,n),r)},e}(),zt=function(){function e(){this.data=0,this.blendMode=i.b.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(e){!!(1&this.data)!==e&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(e){!!(2&this.data)!==e&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(e){!!(4&this.data)!==e&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(e){!!(8&this.data)!==e&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(e){!!(32&this.data)!==e&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(e){!!(16&this.data)!==e&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==i.b.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),Gt=function(e){function t(n,i,o){var a=this,s=Ut.from(n||t.defaultVertexSrc,i||t.defaultFragmentSrc);return(a=e.call(this,s,o)||this).padding=0,a.resolution=r.b.FILTER_RESOLUTION,a.multisample=r.b.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new zt,a}return we(t,e),t.prototype.apply=function(e,t,n,r,i){e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),t}(Ft),Ht=new ce,Vt=function(){function e(e,t){this._texture=e,this.mapCoord=new ce,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var n=this.mapCoord,r=0;r1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var n=e.maskObject;if(!n.isFastRect||!n.isFastRect())return!1;if(t.isMatrixRotated(n.worldTransform))return!1;if(t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var r=e._scissorRectLocal;return r.width>0&&r.height>0},t.prototype.roundFrameToPixels=function(e,n,r,i,o){t.isMatrixRotated(o)||((o=o?Qt.copyFrom(o):Qt.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,e),e.fit(i),e.x=Math.round(e.x*n),e.y=Math.round(e.y*n),e.width=Math.round(e.width*n),e.height=Math.round(e.height*n))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},t}(Xt),qt=function(e){function t(t){var n=e.call(this,t)||this;return n.glConst=WebGLRenderingContext.STENCIL_TEST,n}return we(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,n=this.renderer.gl,r=e._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++,n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.EQUAL,r,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(Xt),Jt=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ce,this.transform=null}return e.prototype.update=function(e,t,n,r){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,r),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,n,r){var i=this.projectionMatrix,o=r?-1:1;i.identity(),i.a=1/t.width*2,i.d=o*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-o-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),Kt=new ue,$t=new ue,en=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ue,this.destinationFrame=new ue,this.viewportFrame=new ue}return e.prototype.bind=function(e,t,n){void 0===e&&(e=null);var r,i,o,a=this.renderer;this.current=e,e?(o=(r=e.baseTexture).resolution,t||(Kt.width=e.frame.width,Kt.height=e.frame.height,t=Kt),n||($t.x=e.frame.x,$t.y=e.frame.y,$t.width=t.width,$t.height=t.height,n=$t),i=r.framebuffer):(o=a.resolution,t||(Kt.width=a.screen.width,Kt.height=a.screen.height,t=Kt),n||((n=Kt).width=t.width,n.height=t.height));var s=this.viewportFrame;s.x=n.x*o,s.y=n.y*o,s.width=n.width*o,s.height=n.height*o,e||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(i,s),this.renderer.projection.update(n,t,o,!i),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var n=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,i=n.width!==r.width||n.height!==r.height;if(i){var o=this.viewportFrame,a=o.x,s=o.y,u=o.width,l=o.height;a=Math.round(a),s=Math.round(s),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,s,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function tn(e,t,n,r,i){n.buffer.update(i)}var nn={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},rn={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};var on=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();var an=0,sn={textureCount:0,uboCount:0},un=function(){function e(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=an++}return e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof kt)return kt;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");kt=!0===e({a:"b"},"a","b")}catch(e){kt=!1}return kt}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e,this.reset()},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var n=e.program,r=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(r.program)),t||(sn.textureCount=0,sn.uboCount=0,this.syncUniformGroup(e.uniformGroup,sn)),r},e.prototype.setUniforms=function(e){var t=this.shader.program,n=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(n.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e,t){var n=this.getGlProgram();e.static&&e.dirtyId===n.uniformDirtyGroups[e.id]||(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,t))},e.prototype.syncUniforms=function(e,t,n){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,n)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=function(e,t){var n,r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var i in e.uniforms){var o=t[i];if(o){for(var a=e.uniforms[i],s=!1,u=0;u1&&(n=Math.max(n,16)*a.data.size),a.dataLen=n,r%n!=0&&r<16){var s=r%n%16;r+=s,i+=s}r+n>16?(i=16*Math.ceil(i/16),a.offset=i,i+=n,r=n):(a.offset=i,r+=n,i+=n)}return{uboElements:t,size:i=16*Math.ceil(i/16)}}(function(e,t){var n=[];for(var r in e)t[r]&&n.push(t[r]);return n.sort((function(e,t){return e.index-t.index})),n}(e.uniforms,t)),r=n.uboElements,i=n.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a1){var f=At(s.data.type),p=Math.max(rn[s.data.type]/16,1),v=f/p,m=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+s.data.size*p+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+m+";\n }\n\n ")}else{var g=nn[s.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n "+g+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(e,this.shader.program.uniformData)),e.autoManage){var s=new Float32Array(a.size/4);e.buffer.update(s)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},e.prototype.getSignature=function(e,t,n){var r=e.uniforms,i=[n+"-"];for(var o in r)i.push(o),t[o]&&i.push(t[o].type);return i.join("-")},e.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateProgram=function(e){var t=this.gl,n=e.program,r=function(e,t){var n,r,i,o,a=yt(e,e.VERTEX_SHADER,t.vertexSrc),s=yt(e,e.FRAGMENT_SHADER,t.fragmentSrc),u=e.createProgram();if(e.attachShader(u,a),e.attachShader(u,s),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS)||(r=u,i=a,o=s,(n=e).getProgramParameter(r,n.LINK_STATUS)||(n.getShaderParameter(i,n.COMPILE_STATUS)||bt(n,i),n.getShaderParameter(o,n.COMPILE_STATUS)||bt(n,o),console.error("PixiJS Error: Could not initialize shader."),""!==n.getProgramInfoLog(r)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",n.getProgramInfoLog(r)))),t.attributeData=function(e,t){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1}));for(var c=0;c>=1,n++;this.stateId=e.data}for(n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;rthis.maxIdle&&(e.destroyTexture(i,!0),t[r]=null,n=!0)}if(n){var o=0;for(r=0;r=0;r--)this.unload(e.children[r])},e.prototype.destroy=function(){this.renderer=null},e}(),hn=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.r.UNSIGNED_BYTE,this.internalFormat=i.h.RGBA,this.samplerType=0},dn=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ae,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e,t,n,r,o,a,s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,S=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=S,"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[i.r.UNSIGNED_BYTE]=((n={})[i.h.RGBA]=e.RGBA8,n[i.h.RGB]=e.RGB8,n[i.h.RG]=e.RG8,n[i.h.RED]=e.R8,n[i.h.RGBA_INTEGER]=e.RGBA8UI,n[i.h.RGB_INTEGER]=e.RGB8UI,n[i.h.RG_INTEGER]=e.RG8UI,n[i.h.RED_INTEGER]=e.R8UI,n[i.h.ALPHA]=e.ALPHA,n[i.h.LUMINANCE]=e.LUMINANCE,n[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,n),t[i.r.BYTE]=((r={})[i.h.RGBA]=e.RGBA8_SNORM,r[i.h.RGB]=e.RGB8_SNORM,r[i.h.RG]=e.RG8_SNORM,r[i.h.RED]=e.R8_SNORM,r[i.h.RGBA_INTEGER]=e.RGBA8I,r[i.h.RGB_INTEGER]=e.RGB8I,r[i.h.RG_INTEGER]=e.RG8I,r[i.h.RED_INTEGER]=e.R8I,r),t[i.r.UNSIGNED_SHORT]=((o={})[i.h.RGBA_INTEGER]=e.RGBA16UI,o[i.h.RGB_INTEGER]=e.RGB16UI,o[i.h.RG_INTEGER]=e.RG16UI,o[i.h.RED_INTEGER]=e.R16UI,o[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),t[i.r.SHORT]=((a={})[i.h.RGBA_INTEGER]=e.RGBA16I,a[i.h.RGB_INTEGER]=e.RGB16I,a[i.h.RG_INTEGER]=e.RG16I,a[i.h.RED_INTEGER]=e.R16I,a),t[i.r.UNSIGNED_INT]=((s={})[i.h.RGBA_INTEGER]=e.RGBA32UI,s[i.h.RGB_INTEGER]=e.RGB32UI,s[i.h.RG_INTEGER]=e.RG32UI,s[i.h.RED_INTEGER]=e.R32UI,s[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,s),t[i.r.INT]=((u={})[i.h.RGBA_INTEGER]=e.RGBA32I,u[i.h.RGB_INTEGER]=e.RGB32I,u[i.h.RG_INTEGER]=e.RG32I,u[i.h.RED_INTEGER]=e.R32I,u),t[i.r.FLOAT]=((l={})[i.h.RGBA]=e.RGBA32F,l[i.h.RGB]=e.RGB32F,l[i.h.RG]=e.RG32F,l[i.h.RED]=e.R32F,l[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[i.r.HALF_FLOAT]=((c={})[i.h.RGBA]=e.RGBA16F,c[i.h.RGB]=e.RGB16F,c[i.h.RG]=e.RG16F,c[i.h.RED]=e.R16F,c),t[i.r.UNSIGNED_SHORT_5_6_5]=((h={})[i.h.RGB]=e.RGB565,h),t[i.r.UNSIGNED_SHORT_4_4_4_4]=((d={})[i.h.RGBA]=e.RGBA4,d),t[i.r.UNSIGNED_SHORT_5_5_5_1]=((f={})[i.h.RGBA]=e.RGB5_A1,f),t[i.r.UNSIGNED_INT_2_10_10_10_REV]=((p={})[i.h.RGBA]=e.RGB10_A2,p[i.h.RGBA_INTEGER]=e.RGB10_A2UI,p),t[i.r.UNSIGNED_INT_10F_11F_11F_REV]=((v={})[i.h.RGB]=e.R11F_G11F_B10F,v),t[i.r.UNSIGNED_INT_5_9_9_9_REV]=((m={})[i.h.RGB]=e.RGB9_E5,m),t[i.r.UNSIGNED_INT_24_8]=((g={})[i.h.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,g),t[i.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[i.h.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),M=t):((b={})[i.r.UNSIGNED_BYTE]=((x={})[i.h.RGBA]=e.RGBA,x[i.h.RGB]=e.RGB,x[i.h.ALPHA]=e.ALPHA,x[i.h.LUMINANCE]=e.LUMINANCE,x[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,x),b[i.r.UNSIGNED_SHORT_5_6_5]=((_={})[i.h.RGB]=e.RGB,_),b[i.r.UNSIGNED_SHORT_4_4_4_4]=((w={})[i.h.RGBA]=e.RGBA,w),b[i.r.UNSIGNED_SHORT_5_5_5_1]=((T={})[i.h.RGBA]=e.RGBA,T),M=b),M);var E=S.getParameter(S.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=E;for(var A=0;A=0;--o){var a=t[o];a&&a._glTextures[r].samplerType!==i.o.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(e){var t=new hn(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=null!==(r=null===(n=this.internalFormats[e.type])||void 0===n?void 0:n[e.format])&&void 0!==r?r:e.format,2===this.webGLVersion&&e.type===i.r.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==i.o.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,o=e.realHeight,a=n.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var n=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);-1!==r&&function(e,t,n){var r,i=e.length;if(!(t>=i||0===n)){var o=i-(n=t+n>i?i-t:n);for(r=t;r=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=i.s.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==i.k.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===i.p.LINEAR){var o=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR:n.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),fn=new ce,pn=function(e){function t(t,n){void 0===t&&(t=i.n.UNKNOWN);var o=e.call(this)||this;return n=Object.assign({},r.b.RENDER_OPTIONS,n),o.options=n,o.type=t,o.screen=new ue(0,0,n.width,n.height),o.view=n.view||document.createElement("canvas"),o.resolution=n.resolution||r.b.RESOLUTION,o.useContextAlpha=n.useContextAlpha,o.autoDensity=!!n.autoDensity,o.preserveDrawingBuffer=n.preserveDrawingBuffer,o.clearBeforeRender=n.clearBeforeRender,o._backgroundColor=0,o._backgroundColorRgba=[0,0,0,1],o._backgroundColorString="#000000",o.backgroundColor=n.backgroundColor||o._backgroundColor,o.backgroundAlpha=n.backgroundAlpha,void 0!==n.transparent&&(X("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),o.useContextAlpha=n.transparent,o.backgroundAlpha=n.transparent?0:1),o._lastObjectRendered=null,o.plugins={},o}return we(t,e),t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var n=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=n,this.screen.height=r,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=r+"px"),this.emit("resize",n,r)},t.prototype.generateTexture=function(e,t,n,r){void 0===t&&(t={}),"number"==typeof t&&(X("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),t={scaleMode:t,resolution:n,region:r});var i=t.region,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i>16&255)/255,r[1]=(n>>8&255)/255,r[2]=(255&n)/255},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(c),vn=function(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},mn=function(){function e(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return e.prototype.destroy=function(){this.renderer=null},e.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},e.prototype.bind=function(e){var t=this.gl,n=this.CONTEXT_UID,r=e._glBuffers[n]||this.createGLBuffer(e);t.bindBuffer(e.type,r.buffer)},e.prototype.bindBufferBase=function(e,t){var n=this.gl,r=this.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var i=e._glBuffers[r]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,i.buffer)}},e.prototype.bindBufferRange=function(e,t,n){var r=this.gl,i=this.CONTEXT_UID;n=n||0;var o=e._glBuffers[i]||this.createGLBuffer(e);r.bindBufferRange(r.UNIFORM_BUFFER,t||0,o.buffer,256*n,256)},e.prototype.update=function(e){var t=this.gl,n=this.CONTEXT_UID,r=e._glBuffers[n];if(e._updateID!==r.updateID)if(r.updateID=e._updateID,t.bindBuffer(e.type,r.buffer),r.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var i=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;r.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,i)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n-1){var n=["\n %c %c %c PixiJS 6.4.2 - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");B=!0}}(2===r.context.webGLVersion?"WebGL 2":"WebGL 1"),r.resize(r.options.width,r.options.height),r}we(t,e),t.create=function(e){if(void 0===j&&(j=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:r.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!n||!n.getContextAttributes().stencil);if(n){var o=n.getExtension("WEBGL_lose_context");o&&o.loseContext()}return n=null,i}catch(e){return!1}}()),j)return new t(e);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},t.prototype.contextChange=function(){var e,t=this.gl;if(1===this.context.webGLVersion){var n=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,n)}else n=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,n);e>=i.l.HIGH?this.multisample=i.l.HIGH:e>=i.l.MEDIUM?this.multisample=i.l.MEDIUM:e>=i.l.LOW?this.multisample=i.l.LOW:this.multisample=i.l.NONE},t.prototype.addSystem=function(e,t){var n=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var r in this[t]=n,this.runners)this.runners[r].add(n);return this},t.prototype.render=function(e,t){var n,r,i,o;if(t&&(t instanceof Ve?(X("6.0.0","Renderer#render arguments changed, use options instead."),n=t,r=arguments[2],i=arguments[3],o=arguments[4]):(n=t.renderTexture,r=t.clear,i=t.transform,o=t.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(n||(this._lastObjectRendered=e),!o){var a=e.enableTempParent();e.updateTransform(),e.disableTempParent(a)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(t,n,r,i){void 0===n&&(n={});var o=e.prototype.generateTexture.call(this,t,n,r,i);return this.framebuffer.blit(),o},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return X("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,n){t.__plugins=t.__plugins||{},t.__plugins[e]=n}}(pn);var gn=function(){this.texArray=null,this.blend=0,this.type=i.f.TRIANGLES,this.start=0,this.size=0,this.data=null},yn=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,n=this.MAX_TEXTURES,r=t._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++Ae._globalBatch,u=0,l=r[0],c=0;i.copyBoundTextures(o,n);for(var h=0;h=n&&(i.boundArray(l,o,s,n),this.buildDrawCalls(l,c,h),c=h,l=r[++u],++s),d._batchEnabled=s,d.touched=a,l.elements[l.count++]=d)}for(l.count>0&&(i.boundArray(l,o,s,n),this.buildDrawCalls(l,c,this._bufferSize),++u,++s),h=0;h>16&255,r=e>>8&255,i=255&e;return(255*t<<24)+((n=n*t+.5|0)<<16)+((r=r*t+.5|0)<<8)+(i*t+.5|0)}(e._tintRGB,d):e._tintRGB+(255*d<<24),p=0;p0&&(t+="\nelse "),n0){var A=e.worldTransform,I=A.a,C=A.b,N=A.c,k=A.d,D=(x+_+w)/3,P=(T+M+S)/3,O=x-D,R=T-P,L=I*O+N*R,j=C*O+k*R,B=Math.sqrt(L*L+j*j),U=1+E/B;x=D+O*U,T=P+R*U,L=I*(O=_-D)+N*(R=M-P),j=C*O+k*R,_=D+O*(U=1+E/(B=Math.sqrt(L*L+j*j))),M=P+R*U,L=I*(O=w-D)+N*(R=S-P),j=C*O+k*R,w=D+O*(U=1+E/(B=Math.sqrt(L*L+j*j))),S=P+R*U}i.save(),i.beginPath(),i.moveTo(x,T),i.lineTo(_,M),i.lineTo(w,S),i.closePath(),i.clip();var F=p*y+g*m+v*b-y*m-g*v-p*b,z=x*y+g*w+_*b-y*w-g*_-x*b,G=p*_+x*m+v*w-_*m-x*v-p*w,H=p*y*w+g*_*m+x*v*b-x*y*m-g*v*w-p*_*b,V=T*y+g*S+M*b-y*S-g*M-T*b,W=p*M+T*m+v*S-M*m-T*v-p*S,Y=p*y*S+g*M*m+T*v*b-T*y*m-g*v*S-p*M*b;i.transform(z/F,V/F,G/F,W/F,H/F,Y/F),i.drawImage(f,0,0,h*c.resolution,d*c.resolution,0,0,h,d),i.restore(),this.renderer.invalidateBlendMode()}},e.prototype.renderMeshFlat=function(e){var t=this.renderer.context,n=e.geometry.getBuffer("aVertexPosition").data,r=n.length/2;t.beginPath();for(var i=1;i",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),h=["%","/","?",";","#"].concat(c),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(145);function b(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+M(e));var o=e.indexOf("?"),s=-1!==o&&o127?O+="x":O+=P[R];if(!O.match(f)){var j=k.slice(0,I),B=k.slice(I+1),U=P.match(p);U&&(j.push(U[1]),B.unshift(U[2])),B.length&&(b="/"+B.join(".")+b),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+F,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[w])for(I=0,D=c.length;I0)&&n.host.split("@"))&&(n.auth=C.shift(),n.host=n.hostname=C.shift())),n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!T.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=T.slice(-1)[0],E=(n.host||e.host||T.length>1)&&("."===S||".."===S)||""===S,A=0,I=T.length;I>=0;I--)"."===(S=T[I])?T.splice(I,1):".."===S?(T.splice(I,1),A++):A&&(T.splice(I,1),A--);if(!_&&!w)for(;A--;A)T.unshift("..");!_||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),E&&"/"!==T.join("/").substr(-1)&&T.push("");var C,N=""===T[0]||T[0]&&"/"===T[0].charAt(0);return M&&(n.hostname=n.host=N?"":T.length?T.shift():"",(C=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=C.shift(),n.host=n.hostname=C.shift())),(_=_||n.host&&T.length)&&!N&&T.unshift(""),T.length?n.pathname=T.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(22)(n(14),"Map");e.exports=r},function(e,t,n){var r=n(187),i=n(62),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},function(e,t,n){var r=n(63),i=n(194),o=n(67);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){(function(e){var r=n(14),i=n(191),o=t&&!t.nodeType&&t,a=o&&"object"==M(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u}).call(this,n(25)(e))},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(51),i=t&&!t.nodeType&&t,o=i&&"object"==M(e)&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,n(25)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(63),i=n(210),o=n(67);e.exports=function(e){return o(e)?r(e,!0):i(e)}},function(e,t,n){var r=n(58);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){e.exports="#define PI 3.14159265\nuniform float galleryHeight;\nvarying vec2 vUv;\nvarying float vPixelY;\nvoid main() {\n\tvUv = uv;\n\tfloat pixelHeight = (galleryHeight * 1.2) + 8.0;\n\tfloat pixelY = (pixelHeight * 0.5) - position.y;\n\tvPixelY = pixelY;\n\tvec4 newPosition = vec4(position, 1.0);\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D galleryTexture;\nuniform float galleryHeight;\nvarying vec2 vUv;\nvarying float vPixelY;\nvoid main() {\n\tvec4 color;\n\tif ((vPixelY >= 0.0) && (vPixelY <= galleryHeight)) {\n\t\tcolor = texture2D(galleryTexture, vec2(vUv.x, 1.0 - (vPixelY / galleryHeight)));\n\t}\n\telse if ((vPixelY > galleryHeight) && (vPixelY < (galleryHeight + 8.0))) {\n\t\tcolor = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\telse {\n\t\tfloat alpha = 1.0 - ((vPixelY - (galleryHeight + 8.0)) / (galleryHeight * 0.2));\n\t\tcolor = texture2D(galleryTexture, vec2(vUv.x, ((vPixelY - galleryHeight) + 8.0) / galleryHeight));\n\t\tcolor.a = alpha;\n\t\tvec4 shadow = vec4(0.0, 0.0, 0.0, 1.0);\n\t\tcolor = blendSrcOver(color, shadow);\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t,n){var r=n(148);e.exports=function(e,t){t=t||{};var n=new r,i=t.inPlace||!1,o=e.map((function(e){return i?e:{width:e.width,height:e.height,item:e}}));o=o.sort((function(e,t){return t.width*t.height-e.width*e.height})),n.fit(o);var a={width:o.reduce((function(e,t){return Math.max(e,t.x+t.width)}),0),height:o.reduce((function(e,t){return Math.max(e,t.y+t.height)}),0)};return i||(a.items=o),a}},function(e,t,n){var r=n(21),i=n(200),o=n(201),a=Math.max,s=Math.min;e.exports=function(e,t,n){var u,l,c,h,d,f,p=0,v=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=l;return u=l=void 0,p=t,h=e.apply(r,n)}function b(e){return p=e,d=setTimeout(_,t),v?y(e):h}function x(e){var n=e-f;return void 0===f||n>=t||n<0||m&&e-p>=c}function _(){var e,n,r=i();if(x(r))return w(r);d=setTimeout(_,(n=t-((e=r)-f),m?s(n,c-(e-p)):n))}function w(e){return d=void 0,g&&u?y(e):(u=l=void 0,h)}function T(){var e=i(),n=x(e);if(u=arguments,l=this,f=e,n){if(void 0===d)return b(f);if(m)return clearTimeout(d),d=setTimeout(_,t),y(f)}return void 0===d&&(d=setTimeout(_,t)),h}return t=o(t)||0,r(n)&&(v=!!n.leading,c=(m="maxWait"in n)?a(o(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),T.cancel=function(){void 0!==d&&clearTimeout(d),p=0,u=f=l=d=void 0},T.flush=function(){return void 0===d?h:w(i())},T}},function(e,t,n){var r=n(205);e.exports=function(e){return r(e,5)}},function(e,t,n){(function(t){var n="object"==M(t)&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(17))},function(e,t,n){var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),l.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},l.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r80*n){r=s=e[0],o=u=e[1];for(var b=n;bs&&(s=l),c>u&&(u=c);f=0!==(f=Math.max(s-r,u-o))?32767/f:0}return a(g,y,n,r,o,f,0),y}function i(e,t,n,r,i){var o,a;if(i===I(e,t,n,r)>0)for(o=t;o=t;o-=r)a=S(o,e[o],e[o+1],a);return a&&b(a,a.next)&&(E(a),a=a.next),a}function o(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!b(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(E(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,i,h,d){if(e){!d&&h&&function(e,t,n,r){var i=e;do{0===i.z&&(i.z=p(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,u,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,h);for(var f,v,m=e;e.prev!==e.next;)if(f=e.prev,v=e.next,h?u(e,r,i,h):s(e))t.push(f.i/n|0),t.push(e.i/n|0),t.push(v.i/n|0),E(e),e=v.next,m=v.next;else if((e=v)===m){d?1===d?a(e=l(o(e),t,n),t,n,r,i,h,2):2===d&&c(e,t,n,r,i,h):a(o(e),t,n,r,i,h,1);break}}}function s(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var i=t.x,o=n.x,a=r.x,s=t.y,u=n.y,l=r.y,c=io?i>a?i:a:o>a?o:a,f=s>u?s>l?s:l:u>l?u:l,p=r.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&m(i,s,o,u,a,l,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function u(e,t,n,r){var i=e.prev,o=e,a=e.next;if(y(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,c=i.y,h=o.y,d=a.y,f=su?s>l?s:l:u>l?u:l,b=c>h?c>d?c:d:h>d?h:d,x=p(f,v,t,n,r),_=p(g,b,t,n,r),w=e.prevZ,T=e.nextZ;w&&w.z>=x&&T&&T.z<=_;){if(w.x>=f&&w.x<=g&&w.y>=v&&w.y<=b&&w!==i&&w!==a&&m(s,c,u,h,l,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,T.x>=f&&T.x<=g&&T.y>=v&&T.y<=b&&T!==i&&T!==a&&m(s,c,u,h,l,d,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;w&&w.z>=x;){if(w.x>=f&&w.x<=g&&w.y>=v&&w.y<=b&&w!==i&&w!==a&&m(s,c,u,h,l,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=_;){if(T.x>=f&&T.x<=g&&T.y>=v&&T.y<=b&&T!==i&&T!==a&&m(s,c,u,h,l,d,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function l(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!b(i,a)&&x(i,r,r.next,a)&&T(i,a)&&T(a,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(a.i/n|0),E(r),E(r.next),r=e=a),r=r.next}while(r!==e);return o(r)}function c(e,t,n,r,i,s){var u=e;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var c=M(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,t,n,r,i,s,0),void a(c,t,n,r,i,s,0)}l=l.next}u=u.next}while(u!==e)}function h(e,t){return e.x-t.x}function d(e,t){var n=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a&&(a=s,n=r.x=r.x&&r.x>=c&&i!==r.x&&m(on.x||r.x===n.x&&f(n,r)))&&(n=r,d=u)),r=r.next}while(r!==l);return n}(e,t);if(!n)return t;var r=M(n,e);return o(r,r.next),o(n,n.next)}function f(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function p(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{(t.x=(e-a)*(o-s)&&(e-a)*(r-s)>=(n-a)*(t-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&x(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(T(e,t)&&T(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||b(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function b(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,n,r){var i=w(y(e,t,n)),o=w(y(e,t,r)),a=w(y(n,r,e)),s=w(y(n,r,t));return i!==o&&a!==s||!(0!==i||!_(e,n,t))||!(0!==o||!_(e,r,t))||!(0!==a||!_(n,e,r))||!(0!==s||!_(n,t,r))}function _(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function w(e){return e>0?1:e<0?-1:0}function T(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function M(e,t){var n=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function S(e,t,n,r){var i=new A(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function E(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var i=0,o=t,a=n-r;o0&&(r+=e[i-1].length,n.holes.push(r))}return n}},function(e,t,n){var r=n(26),i=n(157),o=n(158),a=n(159),s=n(160),u=n(161);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(166),i=n(173),o=n(175),a=n(176),s=n(177);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tc))return!1;var d=u.get(e),f=u.get(t);if(d&&f)return d==t&&f==e;var p=-1,v=!0,m=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++p-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(33),i=n(65);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){var r=n(69),i=n(36),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(207);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(61),i=n(71),o=n(38),a=n(62),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},function(e,t,n){var r=n(66)(Object.getPrototypeOf,Object);e.exports=r},function(e,t){e.exports="varying vec2 vUv;\nvoid main() {\n\tvUv = uv;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform float lines[26];\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float direction;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat middleAlpha = 0.0;\n\tfloat endAlpha = 0.0;\n\tfloat headLength = 0.0;\n\tif (timePercent < 0.5) {\n\t\tmiddleAlpha = 1.0;\n\t\tendAlpha = 1.0 - (timePercent / 0.5);\n\t}\n\telse {\n\t\tmiddleAlpha = 1.0 - ((timePercent - 0.5) / 0.5);\n\t\tendAlpha = 0.0;\n\t}\n\tfor (int i = 0; i < 26; i++) {\n\t\tfloat halfDis = lines[i] / 2.0;\n\t\tfloat middle = headLength + halfDis;\n\t\theadLength += lines[i];\n\t\tif ((direction > 0.9) && (direction < 1.1)) {\n\t\t\tif (abs(vUv.y - middle) <= halfDis) {\n\t\t\t\tsrcColor.a = endAlpha + (((halfDis - abs(vUv.y - middle)) / halfDis) * (middleAlpha - endAlpha));\n\t\t\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (abs(vUv.x - middle) <= halfDis) {\n\t\t\t\tsrcColor.a = endAlpha + (((halfDis - abs(vUv.x - middle)) / halfDis) * (middleAlpha - endAlpha));\n\t\t\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nvarying vec2 vUv;\nvec2 transform(vec2 uv) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(0.5, (0.5 * height) / width);\n}\nvoid main() {\n\tfloat maxR;\n\tfloat ringR;\n\tfloat radiusMin;\n\tfloat radiusMax;\n\tfloat dist;\n\tvec2 uv = vec2(vUv.x, vUv.y);\n\tmaxR = length(transform(vec2(1.0, 1.0)));\n\tringR = 1.0 / 6.0;\n\tradiusMin = timePercent * maxR;\n\tradiusMax = radiusMin + ringR;\n\tdist = length(transform(uv));\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tif (dist < radiusMin) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if ((dist >= radiusMin) && (dist <= radiusMax)) {\n\t\tsrcColor.a = (dist - radiusMin) / ringR;\n\t}\n\telse {\n\t\tsrcColor.a = 1.0;\n\t}\n\tif (timePercent >= 1.0) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if (timePercent == 0.0) {\n\t\tsrcColor.a = 1.0;\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvec2 transformTo(vec2 uv, vec2 origin) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(origin.x, (origin.y * height) / width);\n}\nvec2 offset(float progress[4], float band, float amp, float radius, vec2 centerPosition) {\n\tvec2 tc = vUv.xy;\n\tvec2 uv = vec2(0.0, 0.0);\n\tvec2 p;\n\tfloat len;\n\tvec2 uv_offset;\n\tfloat wave_width = band * radius;\n\tfor (int i = 0; i < 4; i += 1) {\n\t\tif (progress[i] == -1.0) {\n\t\t\tcontinue;\n\t\t}\n\t\tp = tc - centerPosition;\n\t\tp.x = (p.x * width) / height;\n\t\tlen = length(p);\n\t\tfloat current_progress = progress[i];\n\t\tfloat current_radius = radius * current_progress;\n\t\tfloat damp_factor = 1.0;\n\t\tif (current_progress > .5) {\n\t\t\tdamp_factor = (1.0 - current_progress) * 2.0;\n\t\t}\n\t\tfloat cut_factor = clamp((wave_width * damp_factor) - abs(current_radius - len), 0.0, 1.0);\n\t\tfloat waves_factor = (4.0 * len) / radius;\n\t\tuv_offset = (((p / len) * cos((waves_factor - (current_progress * 10.0)) * 3.14)) * amp) * cut_factor;\n\t\tuv += uv_offset;\n\t}\n\treturn uv;\n}\nvoid main() {\n\tfloat maxR;\n\tfloat ringR;\n\tfloat radiusMin;\n\tfloat radiusMax;\n\tfloat dist;\n\tfloat progress[4];\n\tvec2 uv = vUv.xy;\n\tvec2 uvOffset = vec2(0.0, 0.0);\n\tvec2 startPosition = vec2(0.5, 0.5);\n\tfloat redius = 2.0;\n\tif (option == 1) {\n\t\tstartPosition = vec2(0.0, 0.0);\n\t}\n\telse if (option == 2) {\n\t\tstartPosition = vec2(1.0, 0.0);\n\t}\n\telse if (option == 3) {\n\t\tstartPosition = vec2(1.0, 1.0);\n\t}\n\telse if (option == 4) {\n\t\tstartPosition = vec2(0.0, 1.0);\n\t}\n\tmaxR = length(transformTo(vec2(1.0, 1.0), vec2(0.0, 0.0)));\n\tif (option == 0) {\n\t\tmaxR = maxR / 2.0;\n\t\tredius = redius / 2.0;\n\t}\n\tdist = length(transformTo(uv, startPosition));\n\tringR = 1.0 / 6.0;\n\tradiusMin = timePercent * maxR;\n\tradiusMax = radiusMin + ringR;\n\tfor (int i = 0; i < 4; i++) {\n\t\tprogress[i] = timePercent + (0.1 * float(i));\n\t\tif (progress[i] < 0.0) {\n\t\t\tprogress[i] = 0.0;\n\t\t}\n\t}\n\tuvOffset = offset(progress, 0.2, 0.3, redius, startPosition);\n\tvec4 srcColor = texture2D(texturePrev, fract(vUv + uvOffset));\n\tvec4 distColor = texture2D(textureNext, fract(vUv + uvOffset));\n\tif (dist < radiusMin) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if ((dist >= radiusMin) && (dist <= radiusMax)) {\n\t\tsrcColor.a = (dist - radiusMin) / ringR;\n\t}\n\telse {\n\t\tsrcColor.a = 1.0;\n\t}\n\tif (timePercent >= 1.0) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if (timePercent == 0.0) {\n\t\tsrcColor.a = 1.0;\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alphaStart;\n\tfloat alphaEnd;\n\tfloat rectStart;\n\tfloat rectEnd;\n\tbool isRevert = option > 1 ? true : false;\n\tif (timePercent <= 0.33) {\n\t\talphaStart = isRevert ? 1.0 - (timePercent / 0.33) : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 1.0 - (timePercent / 0.33);\n\t\trectStart = isRevert ? 0.0 : 0.5;\n\t\trectEnd = isRevert ? 0.5 : 1.0;\n\t}\n\telse if ((timePercent > 0.33) && (timePercent <= 0.66)) {\n\t\talphaStart = isRevert ? 0.0 : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 0.0;\n\t\trectEnd = isRevert ? (((timePercent - 0.33) / 0.33) * 0.5) + 0.5 : 1.0 - (((timePercent - 0.33) / 0.33) * 0.5);\n\t\trectStart = rectEnd - 0.5;\n\t}\n\telse {\n\t\talphaStart = isRevert ? 0.0 : (1.0 - timePercent) / (1.0 - 0.66);\n\t\talphaEnd = isRevert ? (1.0 - timePercent) / (1.0 - 0.66) : 0.0;\n\t\trectStart = isRevert ? 0.5 : 0.0;\n\t\trectEnd = isRevert ? 1.0 : 0.5;\n\t}\n\tfloat changAxis = (option % 2) == 0 ? vUv.x : vUv.y;\n\tif (changAxis >= rectEnd) {\n\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t}\n\telse if (changAxis <= rectStart) {\n\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t}\n\telse {\n\t\tsrcColor.a = alphaStart + (((changAxis - rectStart) / 0.5) * (alphaEnd - alphaStart));\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform sampler2D dissolveTexture;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 dissolveColor = texture2D(dissolveTexture, vUv);\n\tif (dissolveColor.r == 0.0) {\n\t\tresult = srcColor;\n\t}\n\telse {\n\t\tresult = distColor;\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tif (timePercent < 0.5) {\n\t\tfloat stagePercent = timePercent / 0.5;\n\t\tresult = srcColor + (stagePercent * (1.0 - srcColor));\n\t}\n\telse {\n\t\tfloat stagePercent = (timePercent - 0.5) / 0.5;\n\t\tresult = 1.0 - (stagePercent * (1.0 - distColor));\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tif (option == 1) {\n\t\tif (timePercent < 0.5) {\n\t\t\tsrcColor.rgb *= (1.0 - (timePercent * 2.0));\n\t\t\tgl_FragColor = srcColor;\n\t\t}\n\t\telse {\n\t\t\tdistColor.rgb *= ((timePercent - 0.5) * 2.0);\n\t\t\tgl_FragColor = distColor;\n\t\t}\n\t}\n\telse {\n\t\tsrcColor.a = 1.0 - timePercent;\n\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t}\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat changeAxis = (option % 2) == 1 ? vUv.x : vUv.y;\n\tbool changeAxisX = (option % 2) == 1;\n\tbool isRevert = option > 1;\n\tfloat line;\n\tif (isRevert) {\n\t\tline = interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 3);\n\t}\n\telse {\n\t\tline = interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 3);\n\t}\n\tvec2 uv = vUv.xy;\n\tif (changeAxis > line) {\n\t\tif (changeAxisX) {\n\t\t\tuv.x -= line;\n\t\t}\n\t\telse {\n\t\t\tuv.y -= line;\n\t\t}\n\t}\n\telse {\n\t\tif (changeAxisX) {\n\t\t\tuv.x += (1.0 - line);\n\t\t}\n\t\telse {\n\t\t\tuv.y += (1.0 - line);\n\t\t}\n\t}\n\tif (isRevert) {\n\t\tresult = changeAxis > line ? texture2D(textureNext, uv) : texture2D(texturePrev, uv);\n\t}\n\telse {\n\t\tresult = changeAxis > line ? texture2D(texturePrev, uv) : texture2D(textureNext, uv);\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform bool direction;\nuniform bool orient;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec2 rectLeft = direction ? vec2(0.25, 0.0) : vec2(0.25, 0.5);\n\tvec2 rectRight = direction ? vec2(1, 0.75) : vec2(0.5, 0.75);\n\tvec2 alphaLeft = vec2(1.0, 1.0);\n\tvec2 alphaRight = vec2(1.0, 1.0);\n\tif (timePercent <= 0.333) {\n\t\talphaLeft.y = 1.0 - (timePercent / 0.333);\n\t\talphaRight.x = 1.0 - (timePercent / 0.333);\n\t}\n\telse if ((timePercent <= 0.666) && (timePercent > 0.333)) {\n\t\trectLeft.x = direction ? (((timePercent - 0.333) / 0.333) * 0.25) + rectLeft.x : rectLeft.x - (((timePercent - 0.333) / 0.333) * 0.25);\n\t\trectLeft.y = direction ? rectLeft.x - 0.25 : rectLeft.x + 0.25;\n\t\trectRight.y = direction ? rectRight.y - (((timePercent - 0.333) / 0.333) * 0.25) : rectRight.y + (((timePercent - 0.333) / 0.333) * 0.25);\n\t\trectRight.x = direction ? rectRight.y + 0.25 : rectRight.y - 0.25;\n\t\talphaLeft.y = 0.0;\n\t\talphaRight.x = 0.0;\n\t}\n\telse {\n\t\trectLeft = direction ? vec2(0.5, 0.25) : vec2(0.0, 0.25);\n\t\trectRight = direction ? vec2(0.75, 0.5) : vec2(0.75, 1.0);\n\t\talphaLeft.y = 0.0;\n\t\talphaRight.x = 0.0;\n\t\talphaLeft.x = 1.0 - ((timePercent - 0.666) / (1.0 - 0.666));\n\t\talphaRight.y = 1.0 - ((timePercent - 0.666) / (1.0 - 0.666));\n\t}\n\tfloat axis = orient ? vUv.x : vUv.y;\n\tif (direction) {\n\t\tif ((axis < rectLeft.y) || (axis > rectRight.x)) {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t\telse if ((axis > rectLeft.x) && (axis < rectRight.y)) {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t\telse {\n\t\t\tif ((axis < rectLeft.x) && (axis > rectLeft.y)) {\n\t\t\t\tsrcColor.a = alphaLeft.y - (((axis - rectLeft.y) / (rectLeft.x - rectLeft.y)) * (alphaLeft.y - alphaLeft.x));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsrcColor.a = alphaRight.x - (((rectRight.x - axis) / (rectLeft.x - rectLeft.y)) * (alphaRight.x - alphaRight.y));\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tif ((axis < rectLeft.x) || (axis > rectRight.y)) {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t\telse if ((axis > rectLeft.y) && (axis < rectRight.x)) {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t\telse {\n\t\t\tif ((axis >= rectLeft.x) && (axis <= rectLeft.y)) {\n\t\t\t\tsrcColor.a = alphaLeft.x - (((axis - rectLeft.x) / (rectLeft.y - rectLeft.x)) * (alphaLeft.x - alphaLeft.y));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsrcColor.a = alphaRight.y - (((rectRight.y - axis) / (rectLeft.y - rectLeft.x)) * (alphaRight.y - alphaRight.x));\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform bool direction;\nuniform bool thruBlk;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 uv4 = vec4(vUv.xy, 1.0, 1.0);\n\tfloat scale;\n\tfloat transform;\n\tif (timePercent < 0.5) {\n\t\tscale = 1.0 - ((timePercent / 0.5) * 0.05);\n\t\ttransform = (1.0 - scale) * 0.5;\n\t}\n\telse {\n\t\tscale = 0.95 + (((timePercent - 0.5) / 0.5) * 0.05);\n\t\ttransform = (1.0 - scale) * 0.5;\n\t}\n\tmat4 matrix = mat4(scale, 0.0, 0.0, 0.0, 0.0, scale, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, transform, transform, 0.0, 1.0);\n\tvec4 uv = matrix * uv4;\n\tvec4 srcColor = texture2D(texturePrev, uv.xy);\n\tvec4 distColor = texture2D(textureNext, uv.xy);\n\tvec4 result = timePercent < 0.5 ? srcColor : distColor;\n\tvec3 start;\n\tvec3 end;\n\tvec3 middleColor = thruBlk ? vec3(0.0, 0.0, 0.0) : vec3(1.0, 1.0, 1.0);\n\tif ((timePercent < 0.25) || (timePercent > 0.75)) {\n\t\tresult *= 1.0;\n\t}\n\telse if ((timePercent >= 0.25) && (timePercent <= 0.5)) {\n\t\tif (timePercent <= 0.375) {\n\t\t\tstart = result.rgb;\n\t\t\tend = start + (((timePercent - 0.25) / 0.125) * (middleColor - result.rgb));\n\t\t}\n\t\telse {\n\t\t\tstart = result.rgb + (((timePercent - 0.375) / 0.125) * (middleColor - result.rgb));\n\t\t\tend = middleColor;\n\t\t}\n\t\tresult = direction ? vec4(end - (vUv.x * (end - start)), result.a) : vec4(start - (vUv.x * (start - end)), result.a);\n\t}\n\telse if ((timePercent > 0.5) && (timePercent <= 0.75)) {\n\t\tif (timePercent < 0.625) {\n\t\t\tstart = middleColor - (((timePercent - 0.5) / 0.125) * (middleColor - result.rgb));\n\t\t\tend = middleColor;\n\t\t}\n\t\telse {\n\t\t\tstart = result.rgb;\n\t\t\tend = middleColor - (((timePercent - 0.625) / 0.125) * (middleColor - result.rgb));\n\t\t}\n\t\tresult = direction ? vec4(end - (vUv.x * (end - start)), result.a) : vec4(start - (vUv.x * (start - end)), result.a);\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int optionX;\nuniform int optionY;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat lineX = optionX > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tfloat lineY = optionY > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tvec2 uv = vUv.xy;\n\tif ((optionX < 0) && (vUv.x <= lineX)) {\n\t\tuv.x += (1.0 - lineX);\n\t}\n\tif ((optionX > 0) && (vUv.x >= lineX)) {\n\t\tuv.x -= lineX;\n\t}\n\tif ((optionY < 0) && (vUv.y <= lineY)) {\n\t\tuv.y += (1.0 - lineY);\n\t}\n\tif ((optionY > 0) && (vUv.y >= lineY)) {\n\t\tuv.y -= lineY;\n\t}\n\tif ((optionX != 0) && (optionY == 0)) {\n\t\tif (optionX > 0) {\n\t\t\tresult = vUv.x > lineX ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.x > lineX ? texture2D(textureNext, vUv) : texture2D(texturePrev, uv);\n\t\t}\n\t}\n\tif ((optionX == 0) && (optionY != 0)) {\n\t\tif (optionY > 0) {\n\t\t\tresult = vUv.y > lineY ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.y > lineY ? texture2D(textureNext, vUv) : texture2D(texturePrev, uv);\n\t\t}\n\t}\n\tif ((optionX != 0) && (optionY != 0)) {\n\t\tif ((optionX > 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y > lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse if ((optionX > 0) && (optionY < 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y < lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse if ((optionX < 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y > lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y < lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int optionX;\nuniform int optionY;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat lineX = optionX > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tfloat lineY = optionY > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tvec2 uv = vUv.xy;\n\tif ((optionX < 0) && (vUv.x > lineX)) {\n\t\tuv.x -= lineX;\n\t}\n\tif ((optionX > 0) && (vUv.x < lineX)) {\n\t\tuv.x += (1.0 - lineX);\n\t}\n\tif ((optionY < 0) && (vUv.y > lineY)) {\n\t\tuv.y -= lineY;\n\t}\n\tif ((optionY > 0) && (vUv.y < lineY)) {\n\t\tuv.y += (1.0 - lineY);\n\t}\n\tif ((optionX != 0) && (optionY == 0)) {\n\t\tif (optionX > 0) {\n\t\t\tresult = vUv.x > lineX ? texture2D(texturePrev, vUv) : texture2D(textureNext, uv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.x > lineX ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tif ((optionX == 0) && (optionY != 0)) {\n\t\tif (optionY > 0) {\n\t\t\tresult = vUv.y > lineY ? texture2D(texturePrev, vUv) : texture2D(textureNext, uv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.y > lineY ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tif ((optionX != 0) && (optionY != 0)) {\n\t\tif ((optionX > 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y < lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse if ((optionX > 0) && (optionY < 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y > lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse if ((optionX < 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y < lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y > lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nmat3 yuv2rgb = mat3(1.0, 0.0, 1.13983, 1.0, -0.39465, -0.58060, 1.0, 2.03211, 0.0);\nmat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec3 result;\n\tfloat resultAlpha;\n\tif (timePercent < 0.5) {\n\t\tresult = srcColor.rgb * rgb2yuv;\n\t\tresult.r += interpolationFloat(0.0, 1.0, 0.0, 0.5, timePercent, 0);\n\t\tresultAlpha = srcColor.a;\n\t}\n\telse {\n\t\tresult = distColor.rgb * rgb2yuv;\n\t\tresult.r += interpolationFloat(1.0, 0.0, 0.5, 1.0, timePercent, 0);\n\t\tresultAlpha = distColor.a;\n\t}\n\tresult *= yuv2rgb;\n\tgl_FragColor = vec4(result.rgb, resultAlpha);\n}\n"},function(e,t){e.exports="uniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nattribute vec2 segment;\nattribute float times;\nattribute int option;\nvarying vec2 vUv;\nvarying float fakePercent;\nvoid main() {\n\tvUv = uv;\n\tfloat width = segmentWidth * horizontalSegments;\n\tfloat height = segmentHeight * verticalSegments;\n\tvec4 newPosition = vec4(position, 1.0);\n\tvec2 segmentOrigin = vec2(((segment.x + 0.5) * segmentWidth) - (width * 0.5), (height * 0.5) - ((1.0 * (segment.y + 0.5)) * segmentHeight));\n\tif (timePercent > times) {\n\t\tfloat percent = (timePercent - times) / 0.7;\n\t\tif (percent > 1.0) {\n\t\t\tpercent = 1.0;\n\t\t}\n\t\tif (percent > 0.5) {\n\t\t\tpercent += 1.0;\n\t\t}\n\t\tmat4 matrix = mat4(cos((-1.0 * percent) * 3.14), 0.0, sin((-1.0 * percent) * 3.14), 0.0, 0.0, 1.0, 0.0, 0.0, -sin((-1.0 * percent) * 3.14), 0.0, cos((-1.0 * percent) * 3.14), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t\tif (option == 1) {\n\t\t\tmatrix = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(percent * 3.14), -sin(percent * 3.14), 0.0, 0.0, sin(percent * 3.13), cos(percent * 3.14), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t\t}\n\t\tnewPosition.x -= segmentOrigin.x;\n\t\tnewPosition.y -= segmentOrigin.y;\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += segmentOrigin.x;\n\t\tnewPosition.y += segmentOrigin.y;\n\t\tif (segment.x < (horizontalSegments / 2.0)) {\n\t\t\tfakePercent = percent - (abs((horizontalSegments / 2.0) - segment.x) * (0.25 / horizontalSegments));\n\t\t}\n\t\telse {\n\t\t\tfakePercent = percent + (abs((horizontalSegments / 2.0) - segment.x) * (0.25 / horizontalSegments));\n\t\t}\n\t}\n\tif ((timePercent < 0.0001) || (timePercent > 0.9999)) {\n\t\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n\t\treturn ;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float fakePercent;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = srcColor;\n\tif (fakePercent > 0.5) {\n\t\tcolor = distColor;\n\t}\n\tif ((fakePercent < 0.5) && (fakePercent > 0.35)) {\n\t\tcolor.a = 0.5;\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform float duration;\nattribute vec2 segment;\nattribute float times;\nvarying vec2 vUv;\nmat4 rotateY(float angle) {\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tvUv = uv;\n\tfloat width = segmentWidth * horizontalSegments;\n\tfloat height = segmentHeight * verticalSegments;\n\tmat4 matrix;\n\tfloat stagePercent;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat selfTimePercent = (timePercent - times) / (4.0 / 5.0);\n\tif (selfTimePercent < 0.0) {\n\t\tselfTimePercent = 0.0;\n\t}\n\telse if (selfTimePercent > 1.0) {\n\t\tselfTimePercent = 1.0;\n\t}\n\tif (selfTimePercent < (2.0 / 5.0)) {\n\t\tstagePercent = selfTimePercent / (2.0 / 5.0);\n\t\tnewPosition.x -= (0.5 * width);\n\t\tmatrix = rotateY(((-1.0 * stagePercent) * PI) * 0.5);\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t}\n\telse if ((selfTimePercent >= (2.0 / 5.0)) && (selfTimePercent < (3.0 / 5.0))) {\n\t\tstagePercent = (selfTimePercent - (2.0 / 5.0)) / (1.0 / 5.0);\n\t\tnewPosition.x -= (0.5 * width);\n\t\tnewPosition = rotateY((-1.0 * PI) * 0.5) * newPosition;\n\t\tmatrix = rotateY(((-1.0 * stagePercent) * PI) * 2.0);\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t\tnewPosition.x -= (width * stagePercent);\n\t}\n\telse {\n\t\tfloat offset = (((newPosition.x + (0.5 * width)) / width) * 2.0) / 5.0;\n\t\tstagePercent = (selfTimePercent - (1.0 / 5.0)) / ((2.0 / 5.0) + offset);\n\t\tif (stagePercent > 1.0) {\n\t\t\tstagePercent = 1.0;\n\t\t}\n\t\tvec4 vvUvv = vec4(vUv.x - 0.5, vUv.y - 0.5, 0.0, 1.0);\n\t\tvvUvv = rotateY(-1.0 * PI) * vvUvv;\n\t\tvUv = vvUvv.xy + 0.5;\n\t\tnewPosition.x -= (0.5 * width);\n\t\tmatrix = rotateY((((-1.0 * stagePercent) * PI) * 0.5) - (PI * 2.5));\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t\tnewPosition.x -= width;\n\t}\n\tif ((timePercent < 0.0001) || (timePercent > 0.9999)) {\n\t\tvUv = uv;\n\t\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n\t\treturn ;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = srcColor;\n\tif (timePercent > 0.5) {\n\t\tcolor = distColor;\n\t}\n\tif (timePercent < 0.0001) {\n\t\tcolor = srcColor;\n\t}\n\telse if (timePercent > 0.9999) {\n\t\tcolor = distColor;\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nattribute float index;\nattribute float type;\nattribute float delay;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segments;\nvarying vec2 vUv;\nvarying float vType;\nvarying float rotatePercent;\nmat4 rotateY(float angle) {\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tvUv = uv;\n\tvType = type;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat selfPercent = (timePercent - delay) / 0.7;\n\trotatePercent = selfPercent;\n\tif (selfPercent < 0.0) {\n\t\tselfPercent = 0.0;\n\t}\n\telse if (selfPercent > 1.0) {\n\t\tselfPercent = 1.0;\n\t}\n\tfloat offsetX = ((segments * segmentWidth) * 0.5) - ((index + 0.5) * segmentWidth);\n\tfloat offsetZ = segmentWidth * 0.5;\n\tnewPosition.x += offsetX;\n\tnewPosition.z += offsetZ;\n\tnewPosition.x *= (0.9 + ((abs(timePercent - 0.5) / 0.5) * 0.1));\n\tnewPosition.z *= (0.9 + ((abs(timePercent - 0.5) / 0.5) * 0.1));\n\tnewPosition = rotateY((PI * 0.5) * selfPercent) * newPosition;\n\tnewPosition.x -= offsetX;\n\tnewPosition.z -= offsetZ;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float vType;\nvarying float rotatePercent;\nmat3 yuv2rgb = mat3(1.0, 0.0, 1.13983, 1.0, -0.39465, -0.58060, 1.0, 2.03211, 0.0);\nmat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec3 srcYuv;\n\tvec3 distYuv;\n\tif (rotatePercent < 0.5) {\n\t\tdistYuv = distColor.rgb * rgb2yuv;\n\t\tdistYuv.r *= (1.0 - (abs(rotatePercent - 0.5) / 0.5));\n\t\tdistColor = vec4(distYuv * yuv2rgb, distColor.a);\n\t}\n\telse {\n\t\tsrcYuv = distColor.rgb * rgb2yuv;\n\t\tsrcYuv.r *= (abs(rotatePercent - 0.5) / 0.5);\n\t\tsrcColor = vec4(srcYuv * yuv2rgb, srcColor.a);\n\t}\n\tvec4 color = vType < 0.5 ? srcColor : distColor;\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="float easeInFloat(float t, float b, float c, float d) {\n\tt = t / d;\n\treturn ((c * t) * t) + b;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.141592653\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nattribute float isLeft;\nvarying vec2 vUv;\nvarying vec4 shadow;\nvoid main() {\n\tvUv = uv;\n\tfloat scaleX;\n\tfloat transform;\n\tfloat displacement;\n\tvec4 newPosition = vec4(position, 1.0);\n\tvec4 glPosition = (projectionMatrix * modelViewMatrix) * newPosition;\n\tfloat crestCount = 24.0;\n\tfloat width = horizontalSegments * segmentWidth;\n\tfloat height = verticalSegments * segmentHeight;\n\tfloat heightFactor = (newPosition.y + (height * 0.5)) / height;\n\tfloat scaleY = interpolationFloat(1.0, 1.05, 0.0, 0.11, timePercent, 0);\n\tnewPosition.y += (height * 0.5);\n\tnewPosition.y *= scaleY;\n\tnewPosition.y -= (height * 0.5);\n\tnewPosition.y += 10.0;\n\tif ((timePercent > 0.0) && (timePercent < 0.333)) {\n\t\tfloat delay = (1.0 - heightFactor) * 0.1;\n\t\tscaleX = interpolationFloat(1.0, 0.5, 0.0 + delay, 0.333, timePercent, 1);\n\t}\n\telse if ((timePercent >= 0.333) && (timePercent < 0.5)) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.5, 0.25, 0.333, 0.5, timePercent, 2);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop - incr;\n\t}\n\telse if ((timePercent >= 0.5) && (timePercent < 0.583)) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.25, 0.5, 0.5, 0.583, timePercent, 1);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop - incr;\n\t}\n\telse if (timePercent >= 0.583) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.5, 0.75, 0.583, 0.666, timePercent, 2);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop + incr;\n\t}\n\tif (timePercent > 0.583) {\n\t\tdisplacement = (isLeft < 0.5 ? 1.0 : -1.0) * interpolationFloat(0.0, width / 2.0, 0.583, 1.0, timePercent, 0);\n\t}\n\tfloat ampTop = interpolationFloat(0.0, 1.0, 0.0, 0.11, timePercent, 0);\n\tfloat ampBottom = interpolationFloat(0.0, 1.0, 0.11, 0.22, timePercent, 0);\n\tfloat amp = ampBottom + (heightFactor * abs(ampBottom - ampTop));\n\tfloat foo = newPosition.x * ((crestCount * PI) / width);\n\tnewPosition.z = (amp * cos(foo + (PI / 2.0))) * 20.0;\n\ttransform = (isLeft < 0.5 ? -1.0 : 1.0) * (width * 0.5);\n\tnewPosition.x += transform;\n\tnewPosition.x *= scaleX;\n\tnewPosition.x -= transform;\n\tnewPosition.x += displacement;\n\tshadow = vec4(0.0, 0.0, 0.0, 0.0);\n\tif (newPosition.z < 15.0) {\n\t\tfloat alpha = 0.3 * (1.0 - ((newPosition.z + 20.0) / 35.0));\n\t\tshadow.a = alpha * amp;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying vec4 shadow;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = blendSrcOver(shadow, srcColor);\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265\nuniform float timePercent;\nuniform float aCoefficient;\nuniform float zCurveLimit;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat curve;\n\tfloat progress = option == 1 ? halfWidth - newPosition.x : newPosition.x + halfWidth;\n\tfloat aStart = interpolationFloat(0.00000009, aCoefficient, 0.0, 0.5, timePercent, 0);\n\tfloat aEnd = 0.0000009;\n\tfloat zStart = interpolationFloat(0.0, zCurveLimit, 0.0, 0.5, timePercent, 0);\n\tfloat zEnd = 0.0;\n\tfloat a = interpolationFloat(aStart, aEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tfloat z = interpolationFloat(zStart, zEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tnewPosition.z -= (((-a * newPosition.y) * newPosition.y) + z);\n\tfloat scaleYStart = interpolationFloat(1.0, 0.8, 0.0, 0.5, timePercent, 0);\n\tfloat scaleYEnd = 1.0;\n\tfloat scaleY = interpolationFloat(scaleYStart, scaleYEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tnewPosition.y += halfHeight;\n\tnewPosition.y *= scaleY;\n\tfloat angle = interpolationFloat(0.0, -((2.0 * PI) / 3.0), 0.111, 1.0, timePercent, 1);\n\tmat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), sin(angle), 0.0, 0.0, -sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\tnewPosition = rotateX * newPosition;\n\tnewPosition.y -= halfHeight;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nvec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alpha = interpolationFloat(0.0, 0.6, 0.5, 1.0, timePercent, 0);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, alpha);\n\tgl_FragColor = blendSrcOver(shadow, srcColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nvarying float shadowAlpha;\nmat2 rotateOrigin(float angle) {\n\treturn mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec2 shadowPosition = vec2(position.xy);\n\tfloat presetAngle = option == 1 ? 0.77 : 0.27;\n\tfloat rotateAngle = PI * presetAngle;\n\tfloat min_r = halfWidth * 0.05;\n\tshadowPosition = rotateOrigin(rotateAngle) * shadowPosition;\n\tvec4 newPosition = vec4(shadowPosition.xy, position.z, 1.0);\n\tfloat line = interpolationFloat(0.0, halfWidth * 2.8, 0.0, 1.0, timePercent, 1);\n\tfloat dis2BaseLine = halfWidth - newPosition.x;\n\tfloat dis2Line = line - dis2BaseLine;\n\tfloat L = line <= (halfWidth * 2.0) ? line : halfWidth * 2.0;\n\tfloat r = L / PI;\n\tr = r < min_r ? min_r : r;\n\tfloat angle = dis2Line / r;\n\tif (((dis2Line > 0.0) && (dis2Line < (line * 0.5))) && (r > min_r)) {\n\t\tshadowAlpha = interpolationFloat(0.0, 0.3, 0.0, line * 0.5, dis2Line, 0);\n\t}\n\telse {\n\t\tshadowAlpha = 0.0;\n\t}\n\tif (dis2BaseLine < line) {\n\t\tnewPosition.x = ((sin(angle) * r) + halfWidth) - line;\n\t\tnewPosition.z = (r - (cos(angle) * r)) * 0.5;\n\t}\n\tvec2 finalPosition = vec2(newPosition.xy);\n\tfinalPosition = rotateOrigin(-rotateAngle) * finalPosition;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(finalPosition.xy, newPosition.z, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float shadowAlpha;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, shadowAlpha);\n\tgl_FragColor = blendSrcOver(shadow, srcColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nmat4 rotateX(float angle) {\n\treturn mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), sin(angle), 0.0, 0.0, -sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat progress = option == 0 ? halfWidth - newPosition.x : halfWidth + newPosition.x;\n\tfloat delay = interpolationFloat(0.0, 0.08, 0.0, halfWidth * 2.0, progress, 0);\n\tfloat arc = halfHeight - newPosition.y;\n\tfloat L;\n\tif (timePercent < 0.8) {\n\t\tL = interpolationFloat(halfHeight * 4.0, halfHeight * 22.0, 0.3 + delay, 0.8, timePercent, 0);\n\t}\n\telse {\n\t\tL = interpolationFloat(halfHeight * 22.0, halfHeight * 300.0, 0.8, 1.0, timePercent, 0);\n\t}\n\tfloat r = L / (2.0 * PI);\n\tfloat angle = PI - (arc / r);\n\tfloat y = sin(angle) * r;\n\tfloat z = cos(angle) * r;\n\tnewPosition.y = halfHeight - y;\n\tnewPosition.z = (z + r) * 0.45;\n\tfloat rotateAngle = interpolationFloat(-PI * 0.5, 0.0, 0.0 + delay, 0.4, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(rotateAngle) * newPosition;\n\tnewPosition.y += halfHeight;\n\tfloat backRotate1 = interpolationFloat(0.0, PI * 0.03, 0.75, 0.9, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(backRotate1) * newPosition;\n\tnewPosition.y += halfHeight;\n\tfloat backRotate2 = interpolationFloat(0.0, -PI * 0.03, 0.8, 1.0, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(backRotate2) * newPosition;\n\tnewPosition.y += halfHeight;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nvec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alpha = interpolationFloat(0.0, 0.6, 0.5, 1.0, timePercent, 0);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, 0.0);\n\tgl_FragColor = blendSrcOver(shadow, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nvarying vec2 vUv;\nvec2 transform(vec2 uv) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(0.5, (0.5 * height) / width);\n}\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat shadowAngle = PI / 6.0;\n\tfloat clockAngle;\n\tvec2 a;\n\tvec2 b = transform(vUv);\n\tfloat angle;\n\tif (timePercent < 0.5) {\n\t\ta = vec2(0.0, 0.5);\n\t\tclockAngle = interpolationFloat(0.0, PI, 0.0, 0.5, timePercent, 0);\n\t\tif (b.x > 0.0) {\n\t\t\tangle = acos(((a.x * b.x) + (a.y * b.y)) / (sqrt((a.x * a.x) + (a.y * a.y)) * sqrt((b.x * b.x) + (b.y * b.y))));\n\t\t\tif (angle < clockAngle) {\n\t\t\t\tif (angle > (clockAngle - shadowAngle)) {\n\t\t\t\t\tfloat shadowAlpha = interpolationFloat(1.0, 0.0, 0.0, 1.0, abs(clockAngle - angle) / shadowAngle, 0);\n\t\t\t\t\tsrcColor.a = shadowAlpha;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsrcColor.a = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t}\n\telse {\n\t\ta = vec2(0.0, -0.5);\n\t\tclockAngle = interpolationFloat(0.0, PI + shadowAngle, 0.5, 1.0, timePercent, 0);\n\t\tif (b.x <= 0.0) {\n\t\t\tangle = acos(((a.x * b.x) + (a.y * b.y)) / (sqrt((a.x * a.x) + (a.y * a.y)) * sqrt((b.x * b.x) + (b.y * b.y))));\n\t\t\tif (angle < clockAngle) {\n\t\t\t\tif (angle > (clockAngle - shadowAngle)) {\n\t\t\t\t\tfloat shadowAlpha = interpolationFloat(1.0, 0.0, 0.0, 1.0, abs(clockAngle - angle) / shadowAngle, 0);\n\t\t\t\t\tsrcColor.a = shadowAlpha;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsrcColor.a = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec2 uv = vUv;\n\tbool useSrc = false;\n\tvec2 row;\n\tfloat delay = 0.02;\n\tbool isVert = bool(option);\n\tint segmentCount = isVert ? 10 : 7;\n\tfloat axis = isVert ? uv.y : uv.x;\n\tfloat compareAxis = isVert ? uv.x : uv.y;\n\tfor (int i = 0; i < segmentCount; i++) {\n\t\tfloat fi = float(i);\n\t\trow.r = (fi * 1.0) / float(segmentCount);\n\t\trow.g = (float(i + 1) * 1.0) / float(segmentCount);\n\t\tif ((compareAxis <= row.g) && (compareAxis > row.r)) {\n\t\t\tif ((i % 2) == 0) {\n\t\t\t\tfloat line = interpolationFloat(0.0, 1.0, delay * fi, (delay * fi) + 0.86, timePercent, 1);\n\t\t\t\tif (axis < line) {\n\t\t\t\t\tuseSrc = false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\taxis -= line;\n\t\t\t\t\tuseSrc = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfloat line = interpolationFloat(1.0, 0.0, delay * fi, (delay * fi) + 0.86, timePercent, 1);\n\t\t\t\tif (axis < line) {\n\t\t\t\t\taxis = (1.0 - line) + axis;\n\t\t\t\t\tuseSrc = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tuseSrc = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (isVert) {\n\t\tuv.y = axis;\n\t}\n\telse {\n\t\tuv.x = axis;\n\t}\n\tvec4 srcColor = texture2D(texturePrev, uv);\n\tvec4 distColor = texture2D(textureNext, uv);\n\tgl_FragColor = useSrc ? srcColor : distColor;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec2 uvSrc = vUv;\n\tvec2 uvDist = vUv;\n\tfloat scaleSrc = option == 1 ? interpolationFloat(1.0, 2.0, 0.0, 1.0, timePercent, 0) : interpolationFloat(1.0, 0.1, 0.0, 1.0, timePercent, 0);\n\tfloat scaleDist = option == 1 ? interpolationFloat(0.1, 1.0, 0.0, 1.0, timePercent, 0) : interpolationFloat(2.0, 1.0, 0.0, 1.0, timePercent, 0);\n\tuvSrc -= 0.5;\n\tuvSrc *= scaleSrc;\n\tuvSrc += 0.5;\n\tuvDist -= 0.5;\n\tuvDist *= scaleDist;\n\tuvDist += 0.5;\n\tvec4 srcColor = texture2D(texturePrev, uvSrc);\n\tsrcColor.a = interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 0);\n\tvec4 distColor;\n\tif ((((uvDist.x > 1.0) || (uvDist.x < 0.0)) || (uvDist.y > 1.0)) || (uvDist.y < 0.0)) {\n\t\tdistColor = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\telse {\n\t\tdistColor = texture2D(textureNext, uvDist);\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nmat4 rotateY(float angle) {\n\tif (option == 1) {\n\t\tangle *= -1.0;\n\t}\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat stageOneAngle = PI / 14.0;\n\tfloat stageTwoAngle = (PI * 12.0) / 14.0;\n\tfloat stage_1 = 0.1;\n\tfloat stage_2 = 0.8;\n\tif (timePercent < 0.5) {\n\t\tnewPosition.z = interpolationFloat(0.0, -100.0, 0.0, 0.5, timePercent, 0);\n\t}\n\telse {\n\t\tnewPosition.z = interpolationFloat(-100.0, 0.0, 0.5, 1.0, timePercent, 0);\n\t}\n\tif (timePercent < stage_1) {\n\t\tfloat angle = interpolationFloat(0.0, stageOneAngle, 0.0, stage_1, timePercent, 0);\n\t\tnewPosition.x += halfWidth;\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x -= halfWidth;\n\t}\n\telse if ((timePercent >= stage_1) && (timePercent < stage_2)) {\n\t\tif (timePercent > 0.5) {\n\t\t\tnewPosition *= rotateY(PI);\n\t\t}\n\t\tfloat offset = halfWidth - (sin((PI * 0.5) - stageOneAngle) * halfWidth);\n\t\tfloat angle = interpolationFloat(0.0, stageTwoAngle, stage_1, stage_2, timePercent, 0);\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x += halfWidth;\n\t\tnewPosition *= rotateY(stageOneAngle);\n\t\tnewPosition.x -= halfWidth;\n\t\tnewPosition.x += interpolationFloat(0.0, 2.0 * offset, stage_1, stage_2, timePercent, 0);\n\t}\n\telse {\n\t\tfloat angle = interpolationFloat(-stageOneAngle, 0.0, stage_2, 1.0, timePercent, 0);\n\t\tnewPosition.x -= halfWidth;\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x += halfWidth;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tgl_FragColor = timePercent < 0.5 ? srcColor : distColor;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nmat2 rotateOrigin(float angle) {\n\treturn mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n}\nvoid main() {\n\tfloat alphaStart;\n\tfloat alphaEnd;\n\tfloat rectStart;\n\tfloat rectEnd;\n\tbool isRevert = (option == 3) || (option == 2);\n\tbool rotateParam = (option == 3) || (option == 1);\n\tif (timePercent <= 0.33) {\n\t\talphaStart = isRevert ? 1.0 - (timePercent / 0.33) : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 1.0 - (timePercent / 0.33);\n\t\trectStart = isRevert ? 0.0 : 1.5;\n\t\trectEnd = isRevert ? 0.5 : 2.0;\n\t}\n\telse if ((timePercent > 0.33) && (timePercent <= 0.66)) {\n\t\talphaStart = isRevert ? 0.0 : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 0.0;\n\t\trectEnd = isRevert ? (((timePercent - 0.33) / 0.33) * 1.5) + 0.5 : 2.0 - (((timePercent - 0.33) / 0.33) * 1.5);\n\t\trectStart = rectEnd - 0.5;\n\t}\n\telse {\n\t\talphaStart = isRevert ? 0.0 : (1.0 - timePercent) / (1.0 - 0.66);\n\t\talphaEnd = isRevert ? (1.0 - timePercent) / (1.0 - 0.66) : 0.0;\n\t\trectStart = isRevert ? 1.5 : 0.0;\n\t\trectEnd = isRevert ? 2.0 : 0.5;\n\t}\n\tif (!rotateParam) {\n\t\trectStart -= 1.0;\n\t\trectEnd -= 1.0;\n\t}\n\tfloat rotate = rotateParam ? PI * 0.25 : PI * 0.75;\n\tvec2 rotateUv = vUv * rotateOrigin(rotate);\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec2 startPoint = vec2(rectStart, 0.0) * rotateOrigin(rotate);\n\tvec2 endPoint = vec2(rectEnd, 0.0) * rotateOrigin(rotate);\n\tif (rotateParam) {\n\t\tif (rotateUv.x >= endPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t\t}\n\t\telse if (rotateUv.x <= startPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = alphaStart + (((rotateUv.x - startPoint.x) / (0.5 / sqrt(2.0))) * (alphaEnd - alphaStart));\n\t\t}\n\t}\n\telse {\n\t\tif (rotateUv.x <= endPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t\t}\n\t\telse if (rotateUv.x >= startPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = alphaStart + (((startPoint.x - rotateUv.x) / (0.5 / sqrt(2.0))) * (alphaEnd - alphaStart));\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nattribute float left;\nuniform float timePercent;\nuniform float offset;\nvarying vec2 vUv;\nuniform float option;\nvoid main() {\n\tvUv = uv;\n\tfloat angle;\n\tif (left > 0.0) {\n\t\tangle = (PI / 6.0) * timePercent;\n\t}\n\telse {\n\t\tangle = (-PI / 6.0) * timePercent;\n\t}\n\tif (option > 0.5) {\n\t\tif (left > 0.0) {\n\t\t\tangle = (-PI / 6.0) * timePercent;\n\t\t}\n\t\telse {\n\t\t\tangle = (PI / 6.0) * timePercent;\n\t\t}\n\t}\n\tvec4 newPosition = vec4(position, 1.0);\n\tmat4 transform;\n\tmat4 rotateY = mat4(cos(angle), 0.0, -sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, sin(angle), 0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\tif (option > 0.5) {\n\t\trotateY = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), -sin(angle), 0.0, 0.0, sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t}\n\tif (option > 0.5) {\n\t\tif (left > 0.0) {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, offset * timePercent, 0.0, 1.0);\n\t\t}\n\t\telse {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -offset * timePercent, 0.0, 1.0);\n\t\t}\n\t}\n\telse {\n\t\tif (left > 0.0) {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -offset * timePercent, 0.0, 0.0, 1.0);\n\t\t}\n\t\telse {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, offset * timePercent, 0.0, 0.0, 1.0);\n\t\t}\n\t}\n\tnewPosition = transform * newPosition;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D prevTexture;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 color = texture2D(prevTexture, vUv);\n\tcolor.a = 1.0 - timePercent;\n\tgl_FragColor = color;\n}\n"},function(e,t,n){(function(e){var r=n(109),i=n(110),o=setTimeout;function a(e){return Boolean(e&&void 0!==e.length)}function s(){}function u(e){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function l(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,u._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void h(t.promise,e)}c(t.promise,r)}else(1===e._state?c:h)(t.promise,e._value)}))):e._deferreds.push(t)}function c(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==M(t)||"function"==typeof t)){var n=t.then;if(t instanceof u)return e._state=3,e._value=t,void d(e);if("function"==typeof n)return void p((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,d(e)}catch(t){h(e,t)}var r,i}function h(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&u._immediateFn((function(){e._handled||u._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t0&&h>0,o.textureCacheIds=[],o.destroyed=!1,o.resource=null,o._batchEnabled=0,o._batchLocation=0,o.parentTextureArray=null,o.setResource(t),o}return we(t,e),Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var n;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,n){return n=n||this.resolution,this.setRealSize(e*n,t*n,n)},t.prototype.setRealSize=function(e,t,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=G(this.realWidth)&&G(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT()),this},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete J[this.cacheId],delete q[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,n,i){void 0===i&&(i=r.b.STRICT_TEXTURE_CACHE);var o="string"==typeof e,a=null;if(o)a=e;else{if(!e._pixiId){var s=n&&n.pixiIdPrefix||"pixiid";e._pixiId=s+"_"+W()}a=e._pixiId}var u=J[a];if(o&&i&&!u)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return u||((u=new t(e,n)).cacheId=a,t.addToCache(u,a)),u},t.fromBuffer=function(e,n,r,o){e=e||new Float32Array(n*r*4);var a=new Se(e,{width:n,height:r}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(Ee,o||{width:n,height:r,type:s}))},t.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),J[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),J[t]=e)},t.removeFromCache=function(e){if("string"==typeof e){var t=J[e];if(t){var n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete J[e],t}}else if(e&&e.textureCacheIds){for(var r=0;r0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,t)}else e.target=i.q.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,n,r){for(var i=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(Ne),Re=function(e){function t(n,r){var i=this;if(r=r||{},!(n instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof n&&(n=[n]);var a=n[0].src||n[0];Ne.crossOrigin(o,a,r.crossorigin);for(var s=0;s0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(ie.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(ie.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(ie.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,n){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(n)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(Ne),Le=function(e){function t(t){return e.call(this,t)||this}return we(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&e instanceof ImageBitmap},t}(Ne);be.push(Pe,Le,ke,Re,Oe,Se,De,Ce);var je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return we(t,e),t.prototype.upload=function(e,t,n){var r=e.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===i.a.UNPACK);var o=t.realWidth,a=t.realHeight;return n.width===o&&n.height===a?r.texSubImage2D(t.target,0,0,0,o,a,t.format,n.type,this.data):(n.width=o,n.height=a,r.texImage2D(t.target,0,n.internalFormat,o,a,0,t.format,n.type,this.data)),!0},t}(Se),Be=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new te("disposeFramebuffer"),this.multisample=i.l.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new Ae(null,{scaleMode:i.p.NEAREST,resolution:1,mipmap:i.k.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Ae(new je(null,{width:this.width,height:this.height}),{scaleMode:i.p.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.k.OFF,format:i.h.DEPTH_COMPONENT,type:i.r.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&t.textureCacheIds.splice(n,1),delete q[e],t}}else if(e&&e.textureCacheIds){for(var r=0;rthis.baseTexture.width,a=n+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+r+" = "+(t+r)+" > "+this.baseTexture.width,l="Y: "+n+" + "+i+" = "+(n+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=r&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new Ae),Ge(t._EMPTY),Ge(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=document.createElement("canvas"),n=e.getContext("2d");e.width=16,e.height=16,n.fillStyle="white",n.fillRect(0,0,16,16),t._WHITE=new t(new Ae(new ke(e))),Ge(t._WHITE),Ge(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(c),Ve=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return we(t,e),Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,n){void 0===n&&(n=!0);var r=this.baseTexture.resolution,i=Math.round(e*r)/r,o=Math.round(t*r)/r;this.valid=i>0&&o>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(i,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var n=arguments,r=[],i=1;i1?-r:-1:(o=((65535&(e=F(e)))<<16|65535&(t=F(t)))>>>0,r>1&&(o+=4294967296*r)),this.texturePool[o]||(this.texturePool[o]=[]);var a=this.texturePool[o].pop();return a||(a=this.createTexture(e,t,r)),a.filterPoolKey=o,a.setResolution(n),a},e.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||i.l.NONE);return r.filterFrame=e.filterFrame,r},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r0&&e.height>0,this.texturePool)if(Number(t)<0){var n=this.texturePool[t];if(n)for(var r=0;r1){for(var l=0;l1&&((h=this.getOptimalFilterTexture(c.width,c.height,t.resolution)).filterFrame=c.filterFrame),n[d].apply(this,c,h,i.e.CLEAR,t);var f=c;c=h,h=f}n[d].apply(this,c,l.renderTexture,i.e.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=i.e.CLEAR);var n=this.renderer,r=n.renderTexture,o=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,r.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&o.stateId||this.forceClear;(t===i.e.CLEAR||t===i.e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,n,r){var o=this.renderer;o.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(i.f.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(i.f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,i=n.destinationFrame,o=t._texture.orig,a=e.set(i.width,0,0,i.height,r.x,r.y),s=t.worldTransform.copyTo(ce.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,n,r){return void 0===n&&(n=1),void 0===r&&(r=i.l.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},e.prototype.getFilterTexture=function(e,t,n){if("number"==typeof e){var r=e;e=t,t=r}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||i.l.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var n=ot[0],r=ot[1],i=ot[2],o=ot[3];n.set(t.left,t.top),r.set(t.left,t.bottom),i.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(i,i),e.apply(o,o);var a=Math.min(n.x,r.x,i.x,o.x),s=Math.min(n.y,r.y,i.y,o.y),u=Math.max(n.x,r.x,i.x,o.x),l=Math.max(n.y,r.y,i.y,o.y);t.x=a,t.y=s,t.width=u-a,t.height=l-s},e.prototype.roundFrame=function(e,t,n,r,i){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(i){var o=i.a,a=i.b,s=i.c,u=i.d;if((Math.abs(a)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(i=i?at.copyFrom(i):at.identity()).translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),ut=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),lt=function(){function e(e){this.renderer=e,this.emptyRenderer=new ut(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},e.prototype.boundArray=function(e,t,n,r){for(var i=e.elements,o=e.ids,a=e.count,s=0,u=0;u=0&&c=i.g.WEBGL2&&(n=e.getContext("webgl2",t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var r=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),dt=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.l.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},ft=new ue,pt=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Be(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ue,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;r.b.PREFER_ENV===i.g.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,n){void 0===n&&(n=0);var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=n),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>n,u=t.height>>n,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,u)}else s=e.width>>n,u=e.height>>n,this.setViewport(0,0,s,u)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,n,r){var i=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),i.width===n&&i.height===r&&i.x===e&&i.y===t||(i.x=e,i.y=t,i.width=n,i.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,n,r,o){void 0===o&&(o=i.c.COLOR|i.c.DEPTH);var a=this.gl;a.clearColor(e,t,n,r),a.clear(o)},e.prototype.initFramebuffer=function(e){var t=this.gl,n=new dt(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},e.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,i=r.length;t.drawBuffers||(i=Math.min(i,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var a=[],s=0;s1&&n.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){var c=e.depthTexture;this.renderer.texture.bind(c,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null):(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil))},e.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,n=i.l.NONE;if(e<=1||null===t)return n;for(var r=0;r=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n0&&(t+="\nelse "),n=i.g.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),Mt=t}return Mt}();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);wt=t.precision?i.m.HIGH:i.m.MEDIUM}}return wt}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,n,r){var i=t+n,o=Z[i];return o||(Z[i]=o=new e(t,n,r)),o},e}(),zt=function(){function e(e,t){this.uniformBindCount=0,this.program=e,this.uniformGroup=t?t instanceof rt?t:new rt(t):new rt({})}return e.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var n in t.uniforms){var r=t.uniforms[n];if(r.group&&this.checkUniformExists(e,r))return!0}return!1},e.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),e.from=function(t,n,r){return new e(Ut.from(t,n),r)},e}(),Ft=function(){function e(){this.data=0,this.blendMode=i.b.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(e){!!(1&this.data)!==e&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(e){!!(2&this.data)!==e&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(e){!!(4&this.data)!==e&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(e){!!(8&this.data)!==e&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(e){!!(32&this.data)!==e&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(e){!!(16&this.data)!==e&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==i.b.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),Gt=function(e){function t(n,i,o){var a=this,s=Ut.from(n||t.defaultVertexSrc,i||t.defaultFragmentSrc);return(a=e.call(this,s,o)||this).padding=0,a.resolution=r.b.FILTER_RESOLUTION,a.multisample=r.b.FILTER_MULTISAMPLE,a.enabled=!0,a.autoFit=!0,a.state=new Ft,a}return we(t,e),t.prototype.apply=function(e,t,n,r,i){e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),t}(zt),Ht=new ce,Vt=function(){function e(e,t){this._texture=e,this.mapCoord=new ce,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var n=this.mapCoord,r=0;r1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var n=e.maskObject;if(!n.isFastRect||!n.isFastRect())return!1;if(t.isMatrixRotated(n.worldTransform))return!1;if(t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var r=e._scissorRectLocal;return r.width>0&&r.height>0},t.prototype.roundFrameToPixels=function(e,n,r,i,o){t.isMatrixRotated(o)||((o=o?Qt.copyFrom(o):Qt.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(o,e),e.fit(i),e.x=Math.round(e.x*n),e.y=Math.round(e.y*n),e.width=Math.round(e.width*n),e.height=Math.round(e.height*n))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(){var e=this.renderer.gl;this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},t}(Xt),qt=function(e){function t(t){var n=e.call(this,t)||this;return n.glConst=WebGLRenderingContext.STENCIL_TEST,n}return we(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,n=this.renderer.gl,r=e._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++,n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.EQUAL,r,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(Xt),Jt=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ce,this.transform=null}return e.prototype.update=function(e,t,n,r){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,r),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,n,r){var i=this.projectionMatrix,o=r?-1:1;i.identity(),i.a=1/t.width*2,i.d=o*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-o-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),Kt=new ue,$t=new ue,en=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ue,this.destinationFrame=new ue,this.viewportFrame=new ue}return e.prototype.bind=function(e,t,n){void 0===e&&(e=null);var r,i,o,a=this.renderer;this.current=e,e?(o=(r=e.baseTexture).resolution,t||(Kt.width=e.frame.width,Kt.height=e.frame.height,t=Kt),n||($t.x=e.frame.x,$t.y=e.frame.y,$t.width=t.width,$t.height=t.height,n=$t),i=r.framebuffer):(o=a.resolution,t||(Kt.width=a.screen.width,Kt.height=a.screen.height,t=Kt),n||((n=Kt).width=t.width,n.height=t.height));var s=this.viewportFrame;s.x=n.x*o,s.y=n.y*o,s.width=n.width*o,s.height=n.height*o,e||(s.y=a.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(i,s),this.renderer.projection.update(n,t,o,!i),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var n=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,i=n.width!==r.width||n.height!==r.height;if(i){var o=this.viewportFrame,a=o.x,s=o.y,u=o.width,l=o.height;a=Math.round(a),s=Math.round(s),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,s,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function tn(e,t,n,r,i){n.buffer.update(i)}var nn={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},rn={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};var on=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();var an=0,sn={textureCount:0,uboCount:0},un=function(){function e(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=an++}return e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof kt)return kt;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");kt=!0===e({a:"b"},"a","b")}catch(e){kt=!1}return kt}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e,this.reset()},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var n=e.program,r=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(r.program)),t||(sn.textureCount=0,sn.uboCount=0,this.syncUniformGroup(e.uniformGroup,sn)),r},e.prototype.setUniforms=function(e){var t=this.shader.program,n=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(n.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e,t){var n=this.getGlProgram();e.static&&e.dirtyId===n.uniformDirtyGroups[e.id]||(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,t))},e.prototype.syncUniforms=function(e,t,n){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,n)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=function(e,t){var n,r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var i in e.uniforms){var o=t[i];if(o){for(var a=e.uniforms[i],s=!1,u=0;u1&&(n=Math.max(n,16)*a.data.size),a.dataLen=n,r%n!=0&&r<16){var s=r%n%16;r+=s,i+=s}r+n>16?(i=16*Math.ceil(i/16),a.offset=i,i+=n,r=n):(a.offset=i,r+=n,i+=n)}return{uboElements:t,size:i=16*Math.ceil(i/16)}}(function(e,t){var n=[];for(var r in e)t[r]&&n.push(t[r]);return n.sort((function(e,t){return e.index-t.index})),n}(e.uniforms,t)),r=n.uboElements,i=n.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],a=0;a1){var f=At(s.data.type),p=Math.max(rn[s.data.type]/16,1),v=f/p,m=(4-v%4)%4;o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+s.data.size*p+"; i++)\n {\n for(var j = 0; j < "+v+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+m+";\n }\n\n ")}else{var g=nn[s.data.type];o.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+s.offset/4+";\n "+g+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(e,this.shader.program.uniformData)),e.autoManage){var s=new Float32Array(a.size/4);e.buffer.update(s)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},e.prototype.getSignature=function(e,t,n){var r=e.uniforms,i=[n+"-"];for(var o in r)i.push(o),t[o]&&i.push(t[o].type);return i.join("-")},e.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateProgram=function(e){var t=this.gl,n=e.program,r=function(e,t){var n,r,i,o,a=yt(e,e.VERTEX_SHADER,t.vertexSrc),s=yt(e,e.FRAGMENT_SHADER,t.fragmentSrc),u=e.createProgram();if(e.attachShader(u,a),e.attachShader(u,s),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS)||(r=u,i=a,o=s,(n=e).getProgramParameter(r,n.LINK_STATUS)||(n.getShaderParameter(i,n.COMPILE_STATUS)||bt(n,i),n.getShaderParameter(o,n.COMPILE_STATUS)||bt(n,o),console.error("PixiJS Error: Could not initialize shader."),""!==n.getProgramInfoLog(r)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",n.getProgramInfoLog(r)))),t.attributeData=function(e,t){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1}));for(var c=0;c>=1,n++;this.stateId=e.data}for(n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;rthis.maxIdle&&(e.destroyTexture(i,!0),t[r]=null,n=!0)}if(n){var o=0;for(r=0;r=0;r--)this.unload(e.children[r])},e.prototype.destroy=function(){this.renderer=null},e}(),hn=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.r.UNSIGNED_BYTE,this.internalFormat=i.h.RGBA,this.samplerType=0},dn=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ae,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e,t,n,r,o,a,s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,S=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=S,"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[i.r.UNSIGNED_BYTE]=((n={})[i.h.RGBA]=e.RGBA8,n[i.h.RGB]=e.RGB8,n[i.h.RG]=e.RG8,n[i.h.RED]=e.R8,n[i.h.RGBA_INTEGER]=e.RGBA8UI,n[i.h.RGB_INTEGER]=e.RGB8UI,n[i.h.RG_INTEGER]=e.RG8UI,n[i.h.RED_INTEGER]=e.R8UI,n[i.h.ALPHA]=e.ALPHA,n[i.h.LUMINANCE]=e.LUMINANCE,n[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,n),t[i.r.BYTE]=((r={})[i.h.RGBA]=e.RGBA8_SNORM,r[i.h.RGB]=e.RGB8_SNORM,r[i.h.RG]=e.RG8_SNORM,r[i.h.RED]=e.R8_SNORM,r[i.h.RGBA_INTEGER]=e.RGBA8I,r[i.h.RGB_INTEGER]=e.RGB8I,r[i.h.RG_INTEGER]=e.RG8I,r[i.h.RED_INTEGER]=e.R8I,r),t[i.r.UNSIGNED_SHORT]=((o={})[i.h.RGBA_INTEGER]=e.RGBA16UI,o[i.h.RGB_INTEGER]=e.RGB16UI,o[i.h.RG_INTEGER]=e.RG16UI,o[i.h.RED_INTEGER]=e.R16UI,o[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),t[i.r.SHORT]=((a={})[i.h.RGBA_INTEGER]=e.RGBA16I,a[i.h.RGB_INTEGER]=e.RGB16I,a[i.h.RG_INTEGER]=e.RG16I,a[i.h.RED_INTEGER]=e.R16I,a),t[i.r.UNSIGNED_INT]=((s={})[i.h.RGBA_INTEGER]=e.RGBA32UI,s[i.h.RGB_INTEGER]=e.RGB32UI,s[i.h.RG_INTEGER]=e.RG32UI,s[i.h.RED_INTEGER]=e.R32UI,s[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,s),t[i.r.INT]=((u={})[i.h.RGBA_INTEGER]=e.RGBA32I,u[i.h.RGB_INTEGER]=e.RGB32I,u[i.h.RG_INTEGER]=e.RG32I,u[i.h.RED_INTEGER]=e.R32I,u),t[i.r.FLOAT]=((l={})[i.h.RGBA]=e.RGBA32F,l[i.h.RGB]=e.RGB32F,l[i.h.RG]=e.RG32F,l[i.h.RED]=e.R32F,l[i.h.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[i.r.HALF_FLOAT]=((c={})[i.h.RGBA]=e.RGBA16F,c[i.h.RGB]=e.RGB16F,c[i.h.RG]=e.RG16F,c[i.h.RED]=e.R16F,c),t[i.r.UNSIGNED_SHORT_5_6_5]=((h={})[i.h.RGB]=e.RGB565,h),t[i.r.UNSIGNED_SHORT_4_4_4_4]=((d={})[i.h.RGBA]=e.RGBA4,d),t[i.r.UNSIGNED_SHORT_5_5_5_1]=((f={})[i.h.RGBA]=e.RGB5_A1,f),t[i.r.UNSIGNED_INT_2_10_10_10_REV]=((p={})[i.h.RGBA]=e.RGB10_A2,p[i.h.RGBA_INTEGER]=e.RGB10_A2UI,p),t[i.r.UNSIGNED_INT_10F_11F_11F_REV]=((v={})[i.h.RGB]=e.R11F_G11F_B10F,v),t[i.r.UNSIGNED_INT_5_9_9_9_REV]=((m={})[i.h.RGB]=e.RGB9_E5,m),t[i.r.UNSIGNED_INT_24_8]=((g={})[i.h.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,g),t[i.r.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[i.h.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),M=t):((b={})[i.r.UNSIGNED_BYTE]=((x={})[i.h.RGBA]=e.RGBA,x[i.h.RGB]=e.RGB,x[i.h.ALPHA]=e.ALPHA,x[i.h.LUMINANCE]=e.LUMINANCE,x[i.h.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,x),b[i.r.UNSIGNED_SHORT_5_6_5]=((_={})[i.h.RGB]=e.RGB,_),b[i.r.UNSIGNED_SHORT_4_4_4_4]=((w={})[i.h.RGBA]=e.RGBA,w),b[i.r.UNSIGNED_SHORT_5_5_5_1]=((T={})[i.h.RGBA]=e.RGBA,T),M=b),M);var E=S.getParameter(S.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=E;for(var A=0;A=0;--o){var a=t[o];a&&a._glTextures[r].samplerType!==i.o.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(e){var t=new hn(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=null!==(r=null===(n=this.internalFormats[e.type])||void 0===n?void 0:n[e.format])&&void 0!==r?r:e.format,2===this.webGLVersion&&e.type===i.r.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==i.o.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,o=e.realHeight,a=n.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var n=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);-1!==r&&function(e,t,n){var r,i=e.length;if(!(t>=i||0===n)){var o=i-(n=t+n>i?i-t:n);for(r=t;r=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=i.s.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==i.k.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===i.p.LINEAR){var o=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===i.p.LINEAR?n.LINEAR:n.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),fn=new ce,pn=function(e){function t(t,n){void 0===t&&(t=i.n.UNKNOWN);var o=e.call(this)||this;return n=Object.assign({},r.b.RENDER_OPTIONS,n),o.options=n,o.type=t,o.screen=new ue(0,0,n.width,n.height),o.view=n.view||document.createElement("canvas"),o.resolution=n.resolution||r.b.RESOLUTION,o.useContextAlpha=n.useContextAlpha,o.autoDensity=!!n.autoDensity,o.preserveDrawingBuffer=n.preserveDrawingBuffer,o.clearBeforeRender=n.clearBeforeRender,o._backgroundColor=0,o._backgroundColorRgba=[0,0,0,1],o._backgroundColorString="#000000",o.backgroundColor=n.backgroundColor||o._backgroundColor,o.backgroundAlpha=n.backgroundAlpha,void 0!==n.transparent&&(X("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),o.useContextAlpha=n.transparent,o.backgroundAlpha=n.transparent?0:1),o._lastObjectRendered=null,o.plugins={},o}return we(t,e),t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var n=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=n,this.screen.height=r,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=r+"px"),this.emit("resize",n,r)},t.prototype.generateTexture=function(e,t,n,r){void 0===t&&(t={}),"number"==typeof t&&(X("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),t={scaleMode:t,resolution:n,region:r});var i=t.region,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i>16&255)/255,r[1]=(n>>8&255)/255,r[2]=(255&n)/255},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(c),vn=function(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},mn=function(){function e(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return e.prototype.destroy=function(){this.renderer=null},e.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},e.prototype.bind=function(e){var t=this.gl,n=this.CONTEXT_UID,r=e._glBuffers[n]||this.createGLBuffer(e);t.bindBuffer(e.type,r.buffer)},e.prototype.bindBufferBase=function(e,t){var n=this.gl,r=this.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var i=e._glBuffers[r]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,i.buffer)}},e.prototype.bindBufferRange=function(e,t,n){var r=this.gl,i=this.CONTEXT_UID;n=n||0;var o=e._glBuffers[i]||this.createGLBuffer(e);r.bindBufferRange(r.UNIFORM_BUFFER,t||0,o.buffer,256*n,256)},e.prototype.update=function(e){var t=this.gl,n=this.CONTEXT_UID,r=e._glBuffers[n];if(e._updateID!==r.updateID)if(r.updateID=e._updateID,t.bindBuffer(e.type,r.buffer),r.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var i=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;r.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,i)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n-1){var n=["\n %c %c %c PixiJS 6.4.2 - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");B=!0}}(2===r.context.webGLVersion?"WebGL 2":"WebGL 1"),r.resize(r.options.width,r.options.height),r}we(t,e),t.create=function(e){if(void 0===j&&(j=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:r.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!n||!n.getContextAttributes().stencil);if(n){var o=n.getExtension("WEBGL_lose_context");o&&o.loseContext()}return n=null,i}catch(e){return!1}}()),j)return new t(e);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},t.prototype.contextChange=function(){var e,t=this.gl;if(1===this.context.webGLVersion){var n=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,n)}else n=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,n);e>=i.l.HIGH?this.multisample=i.l.HIGH:e>=i.l.MEDIUM?this.multisample=i.l.MEDIUM:e>=i.l.LOW?this.multisample=i.l.LOW:this.multisample=i.l.NONE},t.prototype.addSystem=function(e,t){var n=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var r in this[t]=n,this.runners)this.runners[r].add(n);return this},t.prototype.render=function(e,t){var n,r,i,o;if(t&&(t instanceof Ve?(X("6.0.0","Renderer#render arguments changed, use options instead."),n=t,r=arguments[2],i=arguments[3],o=arguments[4]):(n=t.renderTexture,r=t.clear,i=t.transform,o=t.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(n||(this._lastObjectRendered=e),!o){var a=e.enableTempParent();e.updateTransform(),e.disableTempParent(a)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(t,n,r,i){void 0===n&&(n={});var o=e.prototype.generateTexture.call(this,t,n,r,i);return this.framebuffer.blit(),o},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return X("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,n){t.__plugins=t.__plugins||{},t.__plugins[e]=n}}(pn);var gn=function(){this.texArray=null,this.blend=0,this.type=i.f.TRIANGLES,this.start=0,this.size=0,this.data=null},yn=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,n=this.MAX_TEXTURES,r=t._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++Ae._globalBatch,u=0,l=r[0],c=0;i.copyBoundTextures(o,n);for(var h=0;h=n&&(i.boundArray(l,o,s,n),this.buildDrawCalls(l,c,h),c=h,l=r[++u],++s),d._batchEnabled=s,d.touched=a,l.elements[l.count++]=d)}for(l.count>0&&(i.boundArray(l,o,s,n),this.buildDrawCalls(l,c,this._bufferSize),++u,++s),h=0;h>16&255,r=e>>8&255,i=255&e;return(255*t<<24)+((n=n*t+.5|0)<<16)+((r=r*t+.5|0)<<8)+(i*t+.5|0)}(e._tintRGB,d):e._tintRGB+(255*d<<24),p=0;p0&&(t+="\nelse "),n0){var A=e.worldTransform,I=A.a,C=A.b,N=A.c,k=A.d,D=(x+_+w)/3,P=(T+M+S)/3,O=x-D,R=T-P,L=I*O+N*R,j=C*O+k*R,B=Math.sqrt(L*L+j*j),U=1+E/B;x=D+O*U,T=P+R*U,L=I*(O=_-D)+N*(R=M-P),j=C*O+k*R,_=D+O*(U=1+E/(B=Math.sqrt(L*L+j*j))),M=P+R*U,L=I*(O=w-D)+N*(R=S-P),j=C*O+k*R,w=D+O*(U=1+E/(B=Math.sqrt(L*L+j*j))),S=P+R*U}i.save(),i.beginPath(),i.moveTo(x,T),i.lineTo(_,M),i.lineTo(w,S),i.closePath(),i.clip();var z=p*y+g*m+v*b-y*m-g*v-p*b,F=x*y+g*w+_*b-y*w-g*_-x*b,G=p*_+x*m+v*w-_*m-x*v-p*w,H=p*y*w+g*_*m+x*v*b-x*y*m-g*v*w-p*_*b,V=T*y+g*S+M*b-y*S-g*M-T*b,W=p*M+T*m+v*S-M*m-T*v-p*S,Y=p*y*S+g*M*m+T*v*b-T*y*m-g*v*S-p*M*b;i.transform(F/z,V/z,G/z,W/z,H/z,Y/z),i.drawImage(f,0,0,h*c.resolution,d*c.resolution,0,0,h,d),i.restore(),this.renderer.invalidateBlendMode()}},e.prototype.renderMeshFlat=function(e){var t=this.renderer.context,n=e.geometry.getBuffer("aVertexPosition").data,r=n.length/2;t.beginPath();for(var i=1;i",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),h=["%","/","?",";","#"].concat(c),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(145);function b(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+M(e));var o=e.indexOf("?"),s=-1!==o&&o127?O+="x":O+=P[R];if(!O.match(f)){var j=k.slice(0,I),B=k.slice(I+1),U=P.match(p);U&&(j.push(U[1]),B.unshift(U[2])),B.length&&(b="/"+B.join(".")+b),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var z=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+z,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[w])for(I=0,D=c.length;I0)&&n.host.split("@"))&&(n.auth=C.shift(),n.host=n.hostname=C.shift())),n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!T.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=T.slice(-1)[0],E=(n.host||e.host||T.length>1)&&("."===S||".."===S)||""===S,A=0,I=T.length;I>=0;I--)"."===(S=T[I])?T.splice(I,1):".."===S?(T.splice(I,1),A++):A&&(T.splice(I,1),A--);if(!_&&!w)for(;A--;A)T.unshift("..");!_||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),E&&"/"!==T.join("/").substr(-1)&&T.push("");var C,N=""===T[0]||T[0]&&"/"===T[0].charAt(0);return M&&(n.hostname=n.host=N?"":T.length?T.shift():"",(C=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=C.shift(),n.host=n.hostname=C.shift())),(_=_||n.host&&T.length)&&!N&&T.unshift(""),T.length?n.pathname=T.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(22)(n(14),"Map");e.exports=r},function(e,t,n){var r=n(187),i=n(62),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},function(e,t,n){var r=n(63),i=n(194),o=n(67);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){(function(e){var r=n(14),i=n(191),o=t&&!t.nodeType&&t,a=o&&"object"==M(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u}).call(this,n(25)(e))},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(51),i=t&&!t.nodeType&&t,o=i&&"object"==M(e)&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,n(25)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(63),i=n(210),o=n(67);e.exports=function(e){return o(e)?r(e,!0):i(e)}},function(e,t,n){var r=n(58);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){e.exports="#define PI 3.14159265\nuniform float galleryHeight;\nvarying vec2 vUv;\nvarying float vPixelY;\nvoid main() {\n\tvUv = uv;\n\tfloat pixelHeight = (galleryHeight * 1.2) + 8.0;\n\tfloat pixelY = (pixelHeight * 0.5) - position.y;\n\tvPixelY = pixelY;\n\tvec4 newPosition = vec4(position, 1.0);\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D galleryTexture;\nuniform float galleryHeight;\nvarying vec2 vUv;\nvarying float vPixelY;\nvoid main() {\n\tvec4 color;\n\tif ((vPixelY >= 0.0) && (vPixelY <= galleryHeight)) {\n\t\tcolor = texture2D(galleryTexture, vec2(vUv.x, 1.0 - (vPixelY / galleryHeight)));\n\t}\n\telse if ((vPixelY > galleryHeight) && (vPixelY < (galleryHeight + 8.0))) {\n\t\tcolor = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\telse {\n\t\tfloat alpha = 1.0 - ((vPixelY - (galleryHeight + 8.0)) / (galleryHeight * 0.2));\n\t\tcolor = texture2D(galleryTexture, vec2(vUv.x, ((vPixelY - galleryHeight) + 8.0) / galleryHeight));\n\t\tcolor.a = alpha;\n\t\tvec4 shadow = vec4(0.0, 0.0, 0.0, 1.0);\n\t\tcolor = blendSrcOver(color, shadow);\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t,n){var r=n(148);e.exports=function(e,t){t=t||{};var n=new r,i=t.inPlace||!1,o=e.map((function(e){return i?e:{width:e.width,height:e.height,item:e}}));o=o.sort((function(e,t){return t.width*t.height-e.width*e.height})),n.fit(o);var a={width:o.reduce((function(e,t){return Math.max(e,t.x+t.width)}),0),height:o.reduce((function(e,t){return Math.max(e,t.y+t.height)}),0)};return i||(a.items=o),a}},function(e,t,n){var r=n(21),i=n(200),o=n(201),a=Math.max,s=Math.min;e.exports=function(e,t,n){var u,l,c,h,d,f,p=0,v=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=l;return u=l=void 0,p=t,h=e.apply(r,n)}function b(e){return p=e,d=setTimeout(_,t),v?y(e):h}function x(e){var n=e-f;return void 0===f||n>=t||n<0||m&&e-p>=c}function _(){var e,n,r=i();if(x(r))return w(r);d=setTimeout(_,(n=t-((e=r)-f),m?s(n,c-(e-p)):n))}function w(e){return d=void 0,g&&u?y(e):(u=l=void 0,h)}function T(){var e=i(),n=x(e);if(u=arguments,l=this,f=e,n){if(void 0===d)return b(f);if(m)return clearTimeout(d),d=setTimeout(_,t),y(f)}return void 0===d&&(d=setTimeout(_,t)),h}return t=o(t)||0,r(n)&&(v=!!n.leading,c=(m="maxWait"in n)?a(o(n.maxWait)||0,t):c,g="trailing"in n?!!n.trailing:g),T.cancel=function(){void 0!==d&&clearTimeout(d),p=0,u=f=l=d=void 0},T.flush=function(){return void 0===d?h:w(i())},T}},function(e,t,n){var r=n(205);e.exports=function(e){return r(e,5)}},function(e,t,n){(function(t){var n="object"==M(t)&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(17))},function(e,t,n){var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),l.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},l.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r80*n){r=s=e[0],o=u=e[1];for(var b=n;bs&&(s=l),c>u&&(u=c);f=0!==(f=Math.max(s-r,u-o))?32767/f:0}return a(g,y,n,r,o,f,0),y}function i(e,t,n,r,i){var o,a;if(i===I(e,t,n,r)>0)for(o=t;o=t;o-=r)a=S(o,e[o],e[o+1],a);return a&&b(a,a.next)&&(E(a),a=a.next),a}function o(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!b(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(E(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,i,h,d){if(e){!d&&h&&function(e,t,n,r){var i=e;do{0===i.z&&(i.z=p(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,u,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,h);for(var f,v,m=e;e.prev!==e.next;)if(f=e.prev,v=e.next,h?u(e,r,i,h):s(e))t.push(f.i/n|0),t.push(e.i/n|0),t.push(v.i/n|0),E(e),e=v.next,m=v.next;else if((e=v)===m){d?1===d?a(e=l(o(e),t,n),t,n,r,i,h,2):2===d&&c(e,t,n,r,i,h):a(o(e),t,n,r,i,h,1);break}}}function s(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var i=t.x,o=n.x,a=r.x,s=t.y,u=n.y,l=r.y,c=io?i>a?i:a:o>a?o:a,f=s>u?s>l?s:l:u>l?u:l,p=r.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&m(i,s,o,u,a,l,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function u(e,t,n,r){var i=e.prev,o=e,a=e.next;if(y(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,c=i.y,h=o.y,d=a.y,f=su?s>l?s:l:u>l?u:l,b=c>h?c>d?c:d:h>d?h:d,x=p(f,v,t,n,r),_=p(g,b,t,n,r),w=e.prevZ,T=e.nextZ;w&&w.z>=x&&T&&T.z<=_;){if(w.x>=f&&w.x<=g&&w.y>=v&&w.y<=b&&w!==i&&w!==a&&m(s,c,u,h,l,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,T.x>=f&&T.x<=g&&T.y>=v&&T.y<=b&&T!==i&&T!==a&&m(s,c,u,h,l,d,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;w&&w.z>=x;){if(w.x>=f&&w.x<=g&&w.y>=v&&w.y<=b&&w!==i&&w!==a&&m(s,c,u,h,l,d,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=_;){if(T.x>=f&&T.x<=g&&T.y>=v&&T.y<=b&&T!==i&&T!==a&&m(s,c,u,h,l,d,T.x,T.y)&&y(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function l(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!b(i,a)&&x(i,r,r.next,a)&&T(i,a)&&T(a,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(a.i/n|0),E(r),E(r.next),r=e=a),r=r.next}while(r!==e);return o(r)}function c(e,t,n,r,i,s){var u=e;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var c=M(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,t,n,r,i,s,0),void a(c,t,n,r,i,s,0)}l=l.next}u=u.next}while(u!==e)}function h(e,t){return e.x-t.x}function d(e,t){var n=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a&&(a=s,n=r.x=r.x&&r.x>=c&&i!==r.x&&m(on.x||r.x===n.x&&f(n,r)))&&(n=r,d=u)),r=r.next}while(r!==l);return n}(e,t);if(!n)return t;var r=M(n,e);return o(r,r.next),o(n,n.next)}function f(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function p(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function v(e){var t=e,n=e;do{(t.x=(e-a)*(o-s)&&(e-a)*(r-s)>=(n-a)*(t-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&x(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(T(e,t)&&T(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||b(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function b(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,n,r){var i=w(y(e,t,n)),o=w(y(e,t,r)),a=w(y(n,r,e)),s=w(y(n,r,t));return i!==o&&a!==s||!(0!==i||!_(e,n,t))||!(0!==o||!_(e,r,t))||!(0!==a||!_(n,e,r))||!(0!==s||!_(n,t,r))}function _(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function w(e){return e>0?1:e<0?-1:0}function T(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function M(e,t){var n=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function S(e,t,n,r){var i=new A(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function E(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var i=0,o=t,a=n-r;o0&&(r+=e[i-1].length,n.holes.push(r))}return n}},function(e,t,n){var r=n(26),i=n(157),o=n(158),a=n(159),s=n(160),u=n(161);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(166),i=n(173),o=n(175),a=n(176),s=n(177);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tc))return!1;var d=u.get(e),f=u.get(t);if(d&&f)return d==t&&f==e;var p=-1,v=!0,m=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++p-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(33),i=n(65);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){var r=n(69),i=n(36),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(207);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(61),i=n(71),o=n(38),a=n(62),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},function(e,t,n){var r=n(66)(Object.getPrototypeOf,Object);e.exports=r},function(e,t){e.exports="varying vec2 vUv;\nvoid main() {\n\tvUv = uv;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform float lines[26];\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float direction;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat middleAlpha = 0.0;\n\tfloat endAlpha = 0.0;\n\tfloat headLength = 0.0;\n\tif (timePercent < 0.5) {\n\t\tmiddleAlpha = 1.0;\n\t\tendAlpha = 1.0 - (timePercent / 0.5);\n\t}\n\telse {\n\t\tmiddleAlpha = 1.0 - ((timePercent - 0.5) / 0.5);\n\t\tendAlpha = 0.0;\n\t}\n\tfor (int i = 0; i < 26; i++) {\n\t\tfloat halfDis = lines[i] / 2.0;\n\t\tfloat middle = headLength + halfDis;\n\t\theadLength += lines[i];\n\t\tif ((direction > 0.9) && (direction < 1.1)) {\n\t\t\tif (abs(vUv.y - middle) <= halfDis) {\n\t\t\t\tsrcColor.a = endAlpha + (((halfDis - abs(vUv.y - middle)) / halfDis) * (middleAlpha - endAlpha));\n\t\t\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (abs(vUv.x - middle) <= halfDis) {\n\t\t\t\tsrcColor.a = endAlpha + (((halfDis - abs(vUv.x - middle)) / halfDis) * (middleAlpha - endAlpha));\n\t\t\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nvarying vec2 vUv;\nvec2 transform(vec2 uv) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(0.5, (0.5 * height) / width);\n}\nvoid main() {\n\tfloat maxR;\n\tfloat ringR;\n\tfloat radiusMin;\n\tfloat radiusMax;\n\tfloat dist;\n\tvec2 uv = vec2(vUv.x, vUv.y);\n\tmaxR = length(transform(vec2(1.0, 1.0)));\n\tringR = 1.0 / 6.0;\n\tradiusMin = timePercent * maxR;\n\tradiusMax = radiusMin + ringR;\n\tdist = length(transform(uv));\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tif (dist < radiusMin) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if ((dist >= radiusMin) && (dist <= radiusMax)) {\n\t\tsrcColor.a = (dist - radiusMin) / ringR;\n\t}\n\telse {\n\t\tsrcColor.a = 1.0;\n\t}\n\tif (timePercent >= 1.0) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if (timePercent == 0.0) {\n\t\tsrcColor.a = 1.0;\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvec2 transformTo(vec2 uv, vec2 origin) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(origin.x, (origin.y * height) / width);\n}\nvec2 offset(float progress[4], float band, float amp, float radius, vec2 centerPosition) {\n\tvec2 tc = vUv.xy;\n\tvec2 uv = vec2(0.0, 0.0);\n\tvec2 p;\n\tfloat len;\n\tvec2 uv_offset;\n\tfloat wave_width = band * radius;\n\tfor (int i = 0; i < 4; i += 1) {\n\t\tif (progress[i] == -1.0) {\n\t\t\tcontinue;\n\t\t}\n\t\tp = tc - centerPosition;\n\t\tp.x = (p.x * width) / height;\n\t\tlen = length(p);\n\t\tfloat current_progress = progress[i];\n\t\tfloat current_radius = radius * current_progress;\n\t\tfloat damp_factor = 1.0;\n\t\tif (current_progress > .5) {\n\t\t\tdamp_factor = (1.0 - current_progress) * 2.0;\n\t\t}\n\t\tfloat cut_factor = clamp((wave_width * damp_factor) - abs(current_radius - len), 0.0, 1.0);\n\t\tfloat waves_factor = (4.0 * len) / radius;\n\t\tuv_offset = (((p / len) * cos((waves_factor - (current_progress * 10.0)) * 3.14)) * amp) * cut_factor;\n\t\tuv += uv_offset;\n\t}\n\treturn uv;\n}\nvoid main() {\n\tfloat maxR;\n\tfloat ringR;\n\tfloat radiusMin;\n\tfloat radiusMax;\n\tfloat dist;\n\tfloat progress[4];\n\tvec2 uv = vUv.xy;\n\tvec2 uvOffset = vec2(0.0, 0.0);\n\tvec2 startPosition = vec2(0.5, 0.5);\n\tfloat redius = 2.0;\n\tif (option == 1) {\n\t\tstartPosition = vec2(0.0, 0.0);\n\t}\n\telse if (option == 2) {\n\t\tstartPosition = vec2(1.0, 0.0);\n\t}\n\telse if (option == 3) {\n\t\tstartPosition = vec2(1.0, 1.0);\n\t}\n\telse if (option == 4) {\n\t\tstartPosition = vec2(0.0, 1.0);\n\t}\n\tmaxR = length(transformTo(vec2(1.0, 1.0), vec2(0.0, 0.0)));\n\tif (option == 0) {\n\t\tmaxR = maxR / 2.0;\n\t\tredius = redius / 2.0;\n\t}\n\tdist = length(transformTo(uv, startPosition));\n\tringR = 1.0 / 6.0;\n\tradiusMin = timePercent * maxR;\n\tradiusMax = radiusMin + ringR;\n\tfor (int i = 0; i < 4; i++) {\n\t\tprogress[i] = timePercent + (0.1 * float(i));\n\t\tif (progress[i] < 0.0) {\n\t\t\tprogress[i] = 0.0;\n\t\t}\n\t}\n\tuvOffset = offset(progress, 0.2, 0.3, redius, startPosition);\n\tvec4 srcColor = texture2D(texturePrev, fract(vUv + uvOffset));\n\tvec4 distColor = texture2D(textureNext, fract(vUv + uvOffset));\n\tif (dist < radiusMin) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if ((dist >= radiusMin) && (dist <= radiusMax)) {\n\t\tsrcColor.a = (dist - radiusMin) / ringR;\n\t}\n\telse {\n\t\tsrcColor.a = 1.0;\n\t}\n\tif (timePercent >= 1.0) {\n\t\tsrcColor.a = 0.0;\n\t}\n\telse if (timePercent == 0.0) {\n\t\tsrcColor.a = 1.0;\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alphaStart;\n\tfloat alphaEnd;\n\tfloat rectStart;\n\tfloat rectEnd;\n\tbool isRevert = option > 1 ? true : false;\n\tif (timePercent <= 0.33) {\n\t\talphaStart = isRevert ? 1.0 - (timePercent / 0.33) : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 1.0 - (timePercent / 0.33);\n\t\trectStart = isRevert ? 0.0 : 0.5;\n\t\trectEnd = isRevert ? 0.5 : 1.0;\n\t}\n\telse if ((timePercent > 0.33) && (timePercent <= 0.66)) {\n\t\talphaStart = isRevert ? 0.0 : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 0.0;\n\t\trectEnd = isRevert ? (((timePercent - 0.33) / 0.33) * 0.5) + 0.5 : 1.0 - (((timePercent - 0.33) / 0.33) * 0.5);\n\t\trectStart = rectEnd - 0.5;\n\t}\n\telse {\n\t\talphaStart = isRevert ? 0.0 : (1.0 - timePercent) / (1.0 - 0.66);\n\t\talphaEnd = isRevert ? (1.0 - timePercent) / (1.0 - 0.66) : 0.0;\n\t\trectStart = isRevert ? 0.5 : 0.0;\n\t\trectEnd = isRevert ? 1.0 : 0.5;\n\t}\n\tfloat changAxis = (option % 2) == 0 ? vUv.x : vUv.y;\n\tif (changAxis >= rectEnd) {\n\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t}\n\telse if (changAxis <= rectStart) {\n\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t}\n\telse {\n\t\tsrcColor.a = alphaStart + (((changAxis - rectStart) / 0.5) * (alphaEnd - alphaStart));\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform sampler2D dissolveTexture;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 dissolveColor = texture2D(dissolveTexture, vUv);\n\tif (dissolveColor.r == 0.0) {\n\t\tresult = srcColor;\n\t}\n\telse {\n\t\tresult = distColor;\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tif (timePercent < 0.5) {\n\t\tfloat stagePercent = timePercent / 0.5;\n\t\tresult = srcColor + (stagePercent * (1.0 - srcColor));\n\t}\n\telse {\n\t\tfloat stagePercent = (timePercent - 0.5) / 0.5;\n\t\tresult = 1.0 - (stagePercent * (1.0 - distColor));\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tif (option == 1) {\n\t\tif (timePercent < 0.5) {\n\t\t\tsrcColor.rgb *= (1.0 - (timePercent * 2.0));\n\t\t\tgl_FragColor = srcColor;\n\t\t}\n\t\telse {\n\t\t\tdistColor.rgb *= ((timePercent - 0.5) * 2.0);\n\t\t\tgl_FragColor = distColor;\n\t\t}\n\t}\n\telse {\n\t\tsrcColor.a = 1.0 - timePercent;\n\t\tgl_FragColor = blendSrcOver(srcColor, distColor);\n\t}\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat changeAxis = (option % 2) == 1 ? vUv.x : vUv.y;\n\tbool changeAxisX = (option % 2) == 1;\n\tbool isRevert = option > 1;\n\tfloat line;\n\tif (isRevert) {\n\t\tline = interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 3);\n\t}\n\telse {\n\t\tline = interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 3);\n\t}\n\tvec2 uv = vUv.xy;\n\tif (changeAxis > line) {\n\t\tif (changeAxisX) {\n\t\t\tuv.x -= line;\n\t\t}\n\t\telse {\n\t\t\tuv.y -= line;\n\t\t}\n\t}\n\telse {\n\t\tif (changeAxisX) {\n\t\t\tuv.x += (1.0 - line);\n\t\t}\n\t\telse {\n\t\t\tuv.y += (1.0 - line);\n\t\t}\n\t}\n\tif (isRevert) {\n\t\tresult = changeAxis > line ? texture2D(textureNext, uv) : texture2D(texturePrev, uv);\n\t}\n\telse {\n\t\tresult = changeAxis > line ? texture2D(texturePrev, uv) : texture2D(textureNext, uv);\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform bool direction;\nuniform bool orient;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec2 rectLeft = direction ? vec2(0.25, 0.0) : vec2(0.25, 0.5);\n\tvec2 rectRight = direction ? vec2(1, 0.75) : vec2(0.5, 0.75);\n\tvec2 alphaLeft = vec2(1.0, 1.0);\n\tvec2 alphaRight = vec2(1.0, 1.0);\n\tif (timePercent <= 0.333) {\n\t\talphaLeft.y = 1.0 - (timePercent / 0.333);\n\t\talphaRight.x = 1.0 - (timePercent / 0.333);\n\t}\n\telse if ((timePercent <= 0.666) && (timePercent > 0.333)) {\n\t\trectLeft.x = direction ? (((timePercent - 0.333) / 0.333) * 0.25) + rectLeft.x : rectLeft.x - (((timePercent - 0.333) / 0.333) * 0.25);\n\t\trectLeft.y = direction ? rectLeft.x - 0.25 : rectLeft.x + 0.25;\n\t\trectRight.y = direction ? rectRight.y - (((timePercent - 0.333) / 0.333) * 0.25) : rectRight.y + (((timePercent - 0.333) / 0.333) * 0.25);\n\t\trectRight.x = direction ? rectRight.y + 0.25 : rectRight.y - 0.25;\n\t\talphaLeft.y = 0.0;\n\t\talphaRight.x = 0.0;\n\t}\n\telse {\n\t\trectLeft = direction ? vec2(0.5, 0.25) : vec2(0.0, 0.25);\n\t\trectRight = direction ? vec2(0.75, 0.5) : vec2(0.75, 1.0);\n\t\talphaLeft.y = 0.0;\n\t\talphaRight.x = 0.0;\n\t\talphaLeft.x = 1.0 - ((timePercent - 0.666) / (1.0 - 0.666));\n\t\talphaRight.y = 1.0 - ((timePercent - 0.666) / (1.0 - 0.666));\n\t}\n\tfloat axis = orient ? vUv.x : vUv.y;\n\tif (direction) {\n\t\tif ((axis < rectLeft.y) || (axis > rectRight.x)) {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t\telse if ((axis > rectLeft.x) && (axis < rectRight.y)) {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t\telse {\n\t\t\tif ((axis < rectLeft.x) && (axis > rectLeft.y)) {\n\t\t\t\tsrcColor.a = alphaLeft.y - (((axis - rectLeft.y) / (rectLeft.x - rectLeft.y)) * (alphaLeft.y - alphaLeft.x));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsrcColor.a = alphaRight.x - (((rectRight.x - axis) / (rectLeft.x - rectLeft.y)) * (alphaRight.x - alphaRight.y));\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tif ((axis < rectLeft.x) || (axis > rectRight.y)) {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t\telse if ((axis > rectLeft.y) && (axis < rectRight.x)) {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t\telse {\n\t\t\tif ((axis >= rectLeft.x) && (axis <= rectLeft.y)) {\n\t\t\t\tsrcColor.a = alphaLeft.x - (((axis - rectLeft.x) / (rectLeft.y - rectLeft.x)) * (alphaLeft.x - alphaLeft.y));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsrcColor.a = alphaRight.y - (((rectRight.y - axis) / (rectLeft.y - rectLeft.x)) * (alphaRight.y - alphaRight.x));\n\t\t\t}\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform bool direction;\nuniform bool thruBlk;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 uv4 = vec4(vUv.xy, 1.0, 1.0);\n\tfloat scale;\n\tfloat transform;\n\tif (timePercent < 0.5) {\n\t\tscale = 1.0 - ((timePercent / 0.5) * 0.05);\n\t\ttransform = (1.0 - scale) * 0.5;\n\t}\n\telse {\n\t\tscale = 0.95 + (((timePercent - 0.5) / 0.5) * 0.05);\n\t\ttransform = (1.0 - scale) * 0.5;\n\t}\n\tmat4 matrix = mat4(scale, 0.0, 0.0, 0.0, 0.0, scale, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, transform, transform, 0.0, 1.0);\n\tvec4 uv = matrix * uv4;\n\tvec4 srcColor = texture2D(texturePrev, uv.xy);\n\tvec4 distColor = texture2D(textureNext, uv.xy);\n\tvec4 result = timePercent < 0.5 ? srcColor : distColor;\n\tvec3 start;\n\tvec3 end;\n\tvec3 middleColor = thruBlk ? vec3(0.0, 0.0, 0.0) : vec3(1.0, 1.0, 1.0);\n\tif ((timePercent < 0.25) || (timePercent > 0.75)) {\n\t\tresult *= 1.0;\n\t}\n\telse if ((timePercent >= 0.25) && (timePercent <= 0.5)) {\n\t\tif (timePercent <= 0.375) {\n\t\t\tstart = result.rgb;\n\t\t\tend = start + (((timePercent - 0.25) / 0.125) * (middleColor - result.rgb));\n\t\t}\n\t\telse {\n\t\t\tstart = result.rgb + (((timePercent - 0.375) / 0.125) * (middleColor - result.rgb));\n\t\t\tend = middleColor;\n\t\t}\n\t\tresult = direction ? vec4(end - (vUv.x * (end - start)), result.a) : vec4(start - (vUv.x * (start - end)), result.a);\n\t}\n\telse if ((timePercent > 0.5) && (timePercent <= 0.75)) {\n\t\tif (timePercent < 0.625) {\n\t\t\tstart = middleColor - (((timePercent - 0.5) / 0.125) * (middleColor - result.rgb));\n\t\t\tend = middleColor;\n\t\t}\n\t\telse {\n\t\t\tstart = result.rgb;\n\t\t\tend = middleColor - (((timePercent - 0.625) / 0.125) * (middleColor - result.rgb));\n\t\t}\n\t\tresult = direction ? vec4(end - (vUv.x * (end - start)), result.a) : vec4(start - (vUv.x * (start - end)), result.a);\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int optionX;\nuniform int optionY;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat lineX = optionX > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tfloat lineY = optionY > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tvec2 uv = vUv.xy;\n\tif ((optionX < 0) && (vUv.x <= lineX)) {\n\t\tuv.x += (1.0 - lineX);\n\t}\n\tif ((optionX > 0) && (vUv.x >= lineX)) {\n\t\tuv.x -= lineX;\n\t}\n\tif ((optionY < 0) && (vUv.y <= lineY)) {\n\t\tuv.y += (1.0 - lineY);\n\t}\n\tif ((optionY > 0) && (vUv.y >= lineY)) {\n\t\tuv.y -= lineY;\n\t}\n\tif ((optionX != 0) && (optionY == 0)) {\n\t\tif (optionX > 0) {\n\t\t\tresult = vUv.x > lineX ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.x > lineX ? texture2D(textureNext, vUv) : texture2D(texturePrev, uv);\n\t\t}\n\t}\n\tif ((optionX == 0) && (optionY != 0)) {\n\t\tif (optionY > 0) {\n\t\t\tresult = vUv.y > lineY ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.y > lineY ? texture2D(textureNext, vUv) : texture2D(texturePrev, uv);\n\t\t}\n\t}\n\tif ((optionX != 0) && (optionY != 0)) {\n\t\tif ((optionX > 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y > lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse if ((optionX > 0) && (optionY < 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y < lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse if ((optionX < 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y > lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y < lineY) ? texture2D(texturePrev, uv) : texture2D(textureNext, vUv);\n\t\t}\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int optionX;\nuniform int optionY;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat lineX = optionX > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tfloat lineY = optionY > 0 ? interpolationFloat(0.0, 1.0, 0.0, 1.0, timePercent, 1) : interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 1);\n\tvec2 uv = vUv.xy;\n\tif ((optionX < 0) && (vUv.x > lineX)) {\n\t\tuv.x -= lineX;\n\t}\n\tif ((optionX > 0) && (vUv.x < lineX)) {\n\t\tuv.x += (1.0 - lineX);\n\t}\n\tif ((optionY < 0) && (vUv.y > lineY)) {\n\t\tuv.y -= lineY;\n\t}\n\tif ((optionY > 0) && (vUv.y < lineY)) {\n\t\tuv.y += (1.0 - lineY);\n\t}\n\tif ((optionX != 0) && (optionY == 0)) {\n\t\tif (optionX > 0) {\n\t\t\tresult = vUv.x > lineX ? texture2D(texturePrev, vUv) : texture2D(textureNext, uv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.x > lineX ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tif ((optionX == 0) && (optionY != 0)) {\n\t\tif (optionY > 0) {\n\t\t\tresult = vUv.y > lineY ? texture2D(texturePrev, vUv) : texture2D(textureNext, uv);\n\t\t}\n\t\telse {\n\t\t\tresult = vUv.y > lineY ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tif ((optionX != 0) && (optionY != 0)) {\n\t\tif ((optionX > 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y < lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse if ((optionX > 0) && (optionY < 0)) {\n\t\t\tresult = (vUv.x < lineX) && (vUv.y > lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse if ((optionX < 0) && (optionY > 0)) {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y < lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t\telse {\n\t\t\tresult = (vUv.x > lineX) && (vUv.y > lineY) ? texture2D(textureNext, uv) : texture2D(texturePrev, vUv);\n\t\t}\n\t}\n\tgl_FragColor = result;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nmat3 yuv2rgb = mat3(1.0, 0.0, 1.13983, 1.0, -0.39465, -0.58060, 1.0, 2.03211, 0.0);\nmat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec3 result;\n\tfloat resultAlpha;\n\tif (timePercent < 0.5) {\n\t\tresult = srcColor.rgb * rgb2yuv;\n\t\tresult.r += interpolationFloat(0.0, 1.0, 0.0, 0.5, timePercent, 0);\n\t\tresultAlpha = srcColor.a;\n\t}\n\telse {\n\t\tresult = distColor.rgb * rgb2yuv;\n\t\tresult.r += interpolationFloat(1.0, 0.0, 0.5, 1.0, timePercent, 0);\n\t\tresultAlpha = distColor.a;\n\t}\n\tresult *= yuv2rgb;\n\tgl_FragColor = vec4(result.rgb, resultAlpha);\n}\n"},function(e,t){e.exports="uniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nattribute vec2 segment;\nattribute float times;\nattribute int option;\nvarying vec2 vUv;\nvarying float fakePercent;\nvoid main() {\n\tvUv = uv;\n\tfloat width = segmentWidth * horizontalSegments;\n\tfloat height = segmentHeight * verticalSegments;\n\tvec4 newPosition = vec4(position, 1.0);\n\tvec2 segmentOrigin = vec2(((segment.x + 0.5) * segmentWidth) - (width * 0.5), (height * 0.5) - ((1.0 * (segment.y + 0.5)) * segmentHeight));\n\tif (timePercent > times) {\n\t\tfloat percent = (timePercent - times) / 0.7;\n\t\tif (percent > 1.0) {\n\t\t\tpercent = 1.0;\n\t\t}\n\t\tif (percent > 0.5) {\n\t\t\tpercent += 1.0;\n\t\t}\n\t\tmat4 matrix = mat4(cos((-1.0 * percent) * 3.14), 0.0, sin((-1.0 * percent) * 3.14), 0.0, 0.0, 1.0, 0.0, 0.0, -sin((-1.0 * percent) * 3.14), 0.0, cos((-1.0 * percent) * 3.14), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t\tif (option == 1) {\n\t\t\tmatrix = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(percent * 3.14), -sin(percent * 3.14), 0.0, 0.0, sin(percent * 3.13), cos(percent * 3.14), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t\t}\n\t\tnewPosition.x -= segmentOrigin.x;\n\t\tnewPosition.y -= segmentOrigin.y;\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += segmentOrigin.x;\n\t\tnewPosition.y += segmentOrigin.y;\n\t\tif (segment.x < (horizontalSegments / 2.0)) {\n\t\t\tfakePercent = percent - (abs((horizontalSegments / 2.0) - segment.x) * (0.25 / horizontalSegments));\n\t\t}\n\t\telse {\n\t\t\tfakePercent = percent + (abs((horizontalSegments / 2.0) - segment.x) * (0.25 / horizontalSegments));\n\t\t}\n\t}\n\tif ((timePercent < 0.0001) || (timePercent > 0.9999)) {\n\t\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n\t\treturn ;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float fakePercent;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = srcColor;\n\tif (fakePercent > 0.5) {\n\t\tcolor = distColor;\n\t}\n\tif ((fakePercent < 0.5) && (fakePercent > 0.35)) {\n\t\tcolor.a = 0.5;\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform float duration;\nattribute vec2 segment;\nattribute float times;\nvarying vec2 vUv;\nmat4 rotateY(float angle) {\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tvUv = uv;\n\tfloat width = segmentWidth * horizontalSegments;\n\tfloat height = segmentHeight * verticalSegments;\n\tmat4 matrix;\n\tfloat stagePercent;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat selfTimePercent = (timePercent - times) / (4.0 / 5.0);\n\tif (selfTimePercent < 0.0) {\n\t\tselfTimePercent = 0.0;\n\t}\n\telse if (selfTimePercent > 1.0) {\n\t\tselfTimePercent = 1.0;\n\t}\n\tif (selfTimePercent < (2.0 / 5.0)) {\n\t\tstagePercent = selfTimePercent / (2.0 / 5.0);\n\t\tnewPosition.x -= (0.5 * width);\n\t\tmatrix = rotateY(((-1.0 * stagePercent) * PI) * 0.5);\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t}\n\telse if ((selfTimePercent >= (2.0 / 5.0)) && (selfTimePercent < (3.0 / 5.0))) {\n\t\tstagePercent = (selfTimePercent - (2.0 / 5.0)) / (1.0 / 5.0);\n\t\tnewPosition.x -= (0.5 * width);\n\t\tnewPosition = rotateY((-1.0 * PI) * 0.5) * newPosition;\n\t\tmatrix = rotateY(((-1.0 * stagePercent) * PI) * 2.0);\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t\tnewPosition.x -= (width * stagePercent);\n\t}\n\telse {\n\t\tfloat offset = (((newPosition.x + (0.5 * width)) / width) * 2.0) / 5.0;\n\t\tstagePercent = (selfTimePercent - (1.0 / 5.0)) / ((2.0 / 5.0) + offset);\n\t\tif (stagePercent > 1.0) {\n\t\t\tstagePercent = 1.0;\n\t\t}\n\t\tvec4 vvUvv = vec4(vUv.x - 0.5, vUv.y - 0.5, 0.0, 1.0);\n\t\tvvUvv = rotateY(-1.0 * PI) * vvUvv;\n\t\tvUv = vvUvv.xy + 0.5;\n\t\tnewPosition.x -= (0.5 * width);\n\t\tmatrix = rotateY((((-1.0 * stagePercent) * PI) * 0.5) - (PI * 2.5));\n\t\tnewPosition = matrix * newPosition;\n\t\tnewPosition.x += (0.5 * width);\n\t\tnewPosition.x -= width;\n\t}\n\tif ((timePercent < 0.0001) || (timePercent > 0.9999)) {\n\t\tvUv = uv;\n\t\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(position, 1.0);\n\t\treturn ;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = srcColor;\n\tif (timePercent > 0.5) {\n\t\tcolor = distColor;\n\t}\n\tif (timePercent < 0.0001) {\n\t\tcolor = srcColor;\n\t}\n\telse if (timePercent > 0.9999) {\n\t\tcolor = distColor;\n\t}\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nattribute float index;\nattribute float type;\nattribute float delay;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segments;\nvarying vec2 vUv;\nvarying float vType;\nvarying float rotatePercent;\nmat4 rotateY(float angle) {\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tvUv = uv;\n\tvType = type;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat selfPercent = (timePercent - delay) / 0.7;\n\trotatePercent = selfPercent;\n\tif (selfPercent < 0.0) {\n\t\tselfPercent = 0.0;\n\t}\n\telse if (selfPercent > 1.0) {\n\t\tselfPercent = 1.0;\n\t}\n\tfloat offsetX = ((segments * segmentWidth) * 0.5) - ((index + 0.5) * segmentWidth);\n\tfloat offsetZ = segmentWidth * 0.5;\n\tnewPosition.x += offsetX;\n\tnewPosition.z += offsetZ;\n\tnewPosition.x *= (0.9 + ((abs(timePercent - 0.5) / 0.5) * 0.1));\n\tnewPosition.z *= (0.9 + ((abs(timePercent - 0.5) / 0.5) * 0.1));\n\tnewPosition = rotateY((PI * 0.5) * selfPercent) * newPosition;\n\tnewPosition.x -= offsetX;\n\tnewPosition.z -= offsetZ;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float vType;\nvarying float rotatePercent;\nmat3 yuv2rgb = mat3(1.0, 0.0, 1.13983, 1.0, -0.39465, -0.58060, 1.0, 2.03211, 0.0);\nmat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec3 srcYuv;\n\tvec3 distYuv;\n\tif (rotatePercent < 0.5) {\n\t\tdistYuv = distColor.rgb * rgb2yuv;\n\t\tdistYuv.r *= (1.0 - (abs(rotatePercent - 0.5) / 0.5));\n\t\tdistColor = vec4(distYuv * yuv2rgb, distColor.a);\n\t}\n\telse {\n\t\tsrcYuv = distColor.rgb * rgb2yuv;\n\t\tsrcYuv.r *= (abs(rotatePercent - 0.5) / 0.5);\n\t\tsrcColor = vec4(srcYuv * yuv2rgb, srcColor.a);\n\t}\n\tvec4 color = vType < 0.5 ? srcColor : distColor;\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="float easeInFloat(float t, float b, float c, float d) {\n\tt = t / d;\n\treturn ((c * t) * t) + b;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.141592653\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float timePercent;\nuniform float segmentWidth;\nuniform float segmentHeight;\nattribute float isLeft;\nvarying vec2 vUv;\nvarying vec4 shadow;\nvoid main() {\n\tvUv = uv;\n\tfloat scaleX;\n\tfloat transform;\n\tfloat displacement;\n\tvec4 newPosition = vec4(position, 1.0);\n\tvec4 glPosition = (projectionMatrix * modelViewMatrix) * newPosition;\n\tfloat crestCount = 24.0;\n\tfloat width = horizontalSegments * segmentWidth;\n\tfloat height = verticalSegments * segmentHeight;\n\tfloat heightFactor = (newPosition.y + (height * 0.5)) / height;\n\tfloat scaleY = interpolationFloat(1.0, 1.05, 0.0, 0.11, timePercent, 0);\n\tnewPosition.y += (height * 0.5);\n\tnewPosition.y *= scaleY;\n\tnewPosition.y -= (height * 0.5);\n\tnewPosition.y += 10.0;\n\tif ((timePercent > 0.0) && (timePercent < 0.333)) {\n\t\tfloat delay = (1.0 - heightFactor) * 0.1;\n\t\tscaleX = interpolationFloat(1.0, 0.5, 0.0 + delay, 0.333, timePercent, 1);\n\t}\n\telse if ((timePercent >= 0.333) && (timePercent < 0.5)) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.5, 0.25, 0.333, 0.5, timePercent, 2);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop - incr;\n\t}\n\telse if ((timePercent >= 0.5) && (timePercent < 0.583)) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.25, 0.5, 0.5, 0.583, timePercent, 1);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop - incr;\n\t}\n\telse if (timePercent >= 0.583) {\n\t\tfloat scaleTop = 0.5;\n\t\tfloat scaleBottom = interpolationFloat(0.5, 0.75, 0.583, 0.666, timePercent, 2);\n\t\tfloat incr = easeInFloat(1.0 - heightFactor, 0.0, abs(scaleBottom - scaleTop), 1.0);\n\t\tscaleX = scaleTop + incr;\n\t}\n\tif (timePercent > 0.583) {\n\t\tdisplacement = (isLeft < 0.5 ? 1.0 : -1.0) * interpolationFloat(0.0, width / 2.0, 0.583, 1.0, timePercent, 0);\n\t}\n\tfloat ampTop = interpolationFloat(0.0, 1.0, 0.0, 0.11, timePercent, 0);\n\tfloat ampBottom = interpolationFloat(0.0, 1.0, 0.11, 0.22, timePercent, 0);\n\tfloat amp = ampBottom + (heightFactor * abs(ampBottom - ampTop));\n\tfloat foo = newPosition.x * ((crestCount * PI) / width);\n\tnewPosition.z = (amp * cos(foo + (PI / 2.0))) * 20.0;\n\ttransform = (isLeft < 0.5 ? -1.0 : 1.0) * (width * 0.5);\n\tnewPosition.x += transform;\n\tnewPosition.x *= scaleX;\n\tnewPosition.x -= transform;\n\tnewPosition.x += displacement;\n\tshadow = vec4(0.0, 0.0, 0.0, 0.0);\n\tif (newPosition.z < 15.0) {\n\t\tfloat alpha = 0.3 * (1.0 - ((newPosition.z + 20.0) / 35.0));\n\t\tshadow.a = alpha * amp;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying vec4 shadow;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 color = blendSrcOver(shadow, srcColor);\n\tgl_FragColor = color;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265\nuniform float timePercent;\nuniform float aCoefficient;\nuniform float zCurveLimit;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat curve;\n\tfloat progress = option == 1 ? halfWidth - newPosition.x : newPosition.x + halfWidth;\n\tfloat aStart = interpolationFloat(0.00000009, aCoefficient, 0.0, 0.5, timePercent, 0);\n\tfloat aEnd = 0.0000009;\n\tfloat zStart = interpolationFloat(0.0, zCurveLimit, 0.0, 0.5, timePercent, 0);\n\tfloat zEnd = 0.0;\n\tfloat a = interpolationFloat(aStart, aEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tfloat z = interpolationFloat(zStart, zEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tnewPosition.z -= (((-a * newPosition.y) * newPosition.y) + z);\n\tfloat scaleYStart = interpolationFloat(1.0, 0.8, 0.0, 0.5, timePercent, 0);\n\tfloat scaleYEnd = 1.0;\n\tfloat scaleY = interpolationFloat(scaleYStart, scaleYEnd, 0.0, halfWidth * 2.0, progress, 0);\n\tnewPosition.y += halfHeight;\n\tnewPosition.y *= scaleY;\n\tfloat angle = interpolationFloat(0.0, -((2.0 * PI) / 3.0), 0.111, 1.0, timePercent, 1);\n\tmat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), sin(angle), 0.0, 0.0, -sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\tnewPosition = rotateX * newPosition;\n\tnewPosition.y -= halfHeight;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nvec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alpha = interpolationFloat(0.0, 0.6, 0.5, 1.0, timePercent, 0);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, alpha);\n\tgl_FragColor = blendSrcOver(shadow, srcColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nvarying float shadowAlpha;\nmat2 rotateOrigin(float angle) {\n\treturn mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec2 shadowPosition = vec2(position.xy);\n\tfloat presetAngle = option == 1 ? 0.77 : 0.27;\n\tfloat rotateAngle = PI * presetAngle;\n\tfloat min_r = halfWidth * 0.05;\n\tshadowPosition = rotateOrigin(rotateAngle) * shadowPosition;\n\tvec4 newPosition = vec4(shadowPosition.xy, position.z, 1.0);\n\tfloat line = interpolationFloat(0.0, halfWidth * 2.8, 0.0, 1.0, timePercent, 1);\n\tfloat dis2BaseLine = halfWidth - newPosition.x;\n\tfloat dis2Line = line - dis2BaseLine;\n\tfloat L = line <= (halfWidth * 2.0) ? line : halfWidth * 2.0;\n\tfloat r = L / PI;\n\tr = r < min_r ? min_r : r;\n\tfloat angle = dis2Line / r;\n\tif (((dis2Line > 0.0) && (dis2Line < (line * 0.5))) && (r > min_r)) {\n\t\tshadowAlpha = interpolationFloat(0.0, 0.3, 0.0, line * 0.5, dis2Line, 0);\n\t}\n\telse {\n\t\tshadowAlpha = 0.0;\n\t}\n\tif (dis2BaseLine < line) {\n\t\tnewPosition.x = ((sin(angle) * r) + halfWidth) - line;\n\t\tnewPosition.z = (r - (cos(angle) * r)) * 0.5;\n\t}\n\tvec2 finalPosition = vec2(newPosition.xy);\n\tfinalPosition = rotateOrigin(-rotateAngle) * finalPosition;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * vec4(finalPosition.xy, newPosition.z, 1.0);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvarying float shadowAlpha;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, shadowAlpha);\n\tgl_FragColor = blendSrcOver(shadow, srcColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nmat4 rotateX(float angle) {\n\treturn mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), sin(angle), 0.0, 0.0, -sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat progress = option == 0 ? halfWidth - newPosition.x : halfWidth + newPosition.x;\n\tfloat delay = interpolationFloat(0.0, 0.08, 0.0, halfWidth * 2.0, progress, 0);\n\tfloat arc = halfHeight - newPosition.y;\n\tfloat L;\n\tif (timePercent < 0.8) {\n\t\tL = interpolationFloat(halfHeight * 4.0, halfHeight * 22.0, 0.3 + delay, 0.8, timePercent, 0);\n\t}\n\telse {\n\t\tL = interpolationFloat(halfHeight * 22.0, halfHeight * 300.0, 0.8, 1.0, timePercent, 0);\n\t}\n\tfloat r = L / (2.0 * PI);\n\tfloat angle = PI - (arc / r);\n\tfloat y = sin(angle) * r;\n\tfloat z = cos(angle) * r;\n\tnewPosition.y = halfHeight - y;\n\tnewPosition.z = (z + r) * 0.45;\n\tfloat rotateAngle = interpolationFloat(-PI * 0.5, 0.0, 0.0 + delay, 0.4, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(rotateAngle) * newPosition;\n\tnewPosition.y += halfHeight;\n\tfloat backRotate1 = interpolationFloat(0.0, PI * 0.03, 0.75, 0.9, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(backRotate1) * newPosition;\n\tnewPosition.y += halfHeight;\n\tfloat backRotate2 = interpolationFloat(0.0, -PI * 0.03, 0.8, 1.0, timePercent, 0);\n\tnewPosition.y -= halfHeight;\n\tnewPosition = rotateX(backRotate2) * newPosition;\n\tnewPosition.y += halfHeight;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\nvec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat alpha = interpolationFloat(0.0, 0.6, 0.5, 1.0, timePercent, 0);\n\tvec4 shadow = vec4(0.0, 0.0, 0.0, 0.0);\n\tgl_FragColor = blendSrcOver(shadow, distColor);\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nvarying vec2 vUv;\nvec2 transform(vec2 uv) {\n\tuv.y = (uv.y * height) / width;\n\treturn uv - vec2(0.5, (0.5 * height) / width);\n}\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tfloat shadowAngle = PI / 6.0;\n\tfloat clockAngle;\n\tvec2 a;\n\tvec2 b = transform(vUv);\n\tfloat angle;\n\tif (timePercent < 0.5) {\n\t\ta = vec2(0.0, 0.5);\n\t\tclockAngle = interpolationFloat(0.0, PI, 0.0, 0.5, timePercent, 0);\n\t\tif (b.x > 0.0) {\n\t\t\tangle = acos(((a.x * b.x) + (a.y * b.y)) / (sqrt((a.x * a.x) + (a.y * a.y)) * sqrt((b.x * b.x) + (b.y * b.y))));\n\t\t\tif (angle < clockAngle) {\n\t\t\t\tif (angle > (clockAngle - shadowAngle)) {\n\t\t\t\t\tfloat shadowAlpha = interpolationFloat(1.0, 0.0, 0.0, 1.0, abs(clockAngle - angle) / shadowAngle, 0);\n\t\t\t\t\tsrcColor.a = shadowAlpha;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsrcColor.a = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = 1.0;\n\t\t}\n\t}\n\telse {\n\t\ta = vec2(0.0, -0.5);\n\t\tclockAngle = interpolationFloat(0.0, PI + shadowAngle, 0.5, 1.0, timePercent, 0);\n\t\tif (b.x <= 0.0) {\n\t\t\tangle = acos(((a.x * b.x) + (a.y * b.y)) / (sqrt((a.x * a.x) + (a.y * a.y)) * sqrt((b.x * b.x) + (b.y * b.y))));\n\t\t\tif (angle < clockAngle) {\n\t\t\t\tif (angle > (clockAngle - shadowAngle)) {\n\t\t\t\t\tfloat shadowAlpha = interpolationFloat(1.0, 0.0, 0.0, 1.0, abs(clockAngle - angle) / shadowAngle, 0);\n\t\t\t\t\tsrcColor.a = shadowAlpha;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsrcColor.a = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = 0.0;\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec2 uv = vUv;\n\tbool useSrc = false;\n\tvec2 row;\n\tfloat delay = 0.02;\n\tbool isVert = bool(option);\n\tint segmentCount = isVert ? 10 : 7;\n\tfloat axis = isVert ? uv.y : uv.x;\n\tfloat compareAxis = isVert ? uv.x : uv.y;\n\tfor (int i = 0; i < segmentCount; i++) {\n\t\tfloat fi = float(i);\n\t\trow.r = (fi * 1.0) / float(segmentCount);\n\t\trow.g = (float(i + 1) * 1.0) / float(segmentCount);\n\t\tif ((compareAxis <= row.g) && (compareAxis > row.r)) {\n\t\t\tif ((i % 2) == 0) {\n\t\t\t\tfloat line = interpolationFloat(0.0, 1.0, delay * fi, (delay * fi) + 0.86, timePercent, 1);\n\t\t\t\tif (axis < line) {\n\t\t\t\t\tuseSrc = false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\taxis -= line;\n\t\t\t\t\tuseSrc = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfloat line = interpolationFloat(1.0, 0.0, delay * fi, (delay * fi) + 0.86, timePercent, 1);\n\t\t\t\tif (axis < line) {\n\t\t\t\t\taxis = (1.0 - line) + axis;\n\t\t\t\t\tuseSrc = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tuseSrc = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (isVert) {\n\t\tuv.y = axis;\n\t}\n\telse {\n\t\tuv.x = axis;\n\t}\n\tvec4 srcColor = texture2D(texturePrev, uv);\n\tvec4 distColor = texture2D(textureNext, uv);\n\tgl_FragColor = useSrc ? srcColor : distColor;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\nfloat interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform float width;\nuniform float height;\nuniform int option;\nvarying vec2 vUv;\nvoid main() {\n\tvec2 uvSrc = vUv;\n\tvec2 uvDist = vUv;\n\tfloat scaleSrc = option == 1 ? interpolationFloat(1.0, 2.0, 0.0, 1.0, timePercent, 0) : interpolationFloat(1.0, 0.1, 0.0, 1.0, timePercent, 0);\n\tfloat scaleDist = option == 1 ? interpolationFloat(0.1, 1.0, 0.0, 1.0, timePercent, 0) : interpolationFloat(2.0, 1.0, 0.0, 1.0, timePercent, 0);\n\tuvSrc -= 0.5;\n\tuvSrc *= scaleSrc;\n\tuvSrc += 0.5;\n\tuvDist -= 0.5;\n\tuvDist *= scaleDist;\n\tuvDist += 0.5;\n\tvec4 srcColor = texture2D(texturePrev, uvSrc);\n\tsrcColor.a = interpolationFloat(1.0, 0.0, 0.0, 1.0, timePercent, 0);\n\tvec4 distColor;\n\tif ((((uvDist.x > 1.0) || (uvDist.x < 0.0)) || (uvDist.y > 1.0)) || (uvDist.y < 0.0)) {\n\t\tdistColor = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\telse {\n\t\tdistColor = texture2D(textureNext, uvDist);\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="float interpolationFloat(float from, float to, float start, float end, float timePercent, int timing) {\n\tfloat pi = 3.14159265358;\n\tfloat current;\n\tfloat duration = 1.0;\n\tif (timePercent < start) {\n\t\tcurrent = 0.0;\n\t}\n\telse if (timePercent > end) {\n\t\tcurrent = 1.0;\n\t}\n\telse {\n\t\tcurrent = (timePercent - start) / (end - start);\n\t}\n\tif (timing == 0) {\n\t\treturn ((current / duration) * (to - from)) + from;\n\t}\n\telse if (timing == 1) {\n\t\tcurrent = current / duration;\n\t\treturn (((to - from) * current) * current) + from;\n\t}\n\telse if (timing == 2) {\n\t\tcurrent = current / duration;\n\t\treturn (((-1.0 * (to - from)) * current) * (current - 2.0)) + from;\n\t}\n\telse {\n\t\tcurrent /= (duration / 2.0);\n\t\tif (current < 1.0) {\n\t\t\treturn ((((to - from) / 2.0) * current) * current) + from;\n\t\t}\n\t\tcurrent--;\n\t\treturn ((-(to - from) / 2.0) * ((current * (current - 2.0)) - 1.0)) + from;\n\t}\n}\n#define PI 3.14159265358\nuniform float timePercent;\nuniform float horizontalSegments;\nuniform float verticalSegments;\nuniform float segmentWidth;\nuniform float segmentHeight;\nuniform int option;\nvarying vec2 vUv;\nmat4 rotateY(float angle) {\n\tif (option == 1) {\n\t\tangle *= -1.0;\n\t}\n\treturn mat4(cos(angle), 0.0, sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angle), 0.0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvoid main() {\n\tfloat halfWidth = (segmentWidth * horizontalSegments) * 0.5;\n\tfloat halfHeight = (segmentHeight * verticalSegments) * 0.5;\n\tvUv = uv;\n\tvec4 newPosition = vec4(position, 1.0);\n\tfloat stageOneAngle = PI / 14.0;\n\tfloat stageTwoAngle = (PI * 12.0) / 14.0;\n\tfloat stage_1 = 0.1;\n\tfloat stage_2 = 0.8;\n\tif (timePercent < 0.5) {\n\t\tnewPosition.z = interpolationFloat(0.0, -100.0, 0.0, 0.5, timePercent, 0);\n\t}\n\telse {\n\t\tnewPosition.z = interpolationFloat(-100.0, 0.0, 0.5, 1.0, timePercent, 0);\n\t}\n\tif (timePercent < stage_1) {\n\t\tfloat angle = interpolationFloat(0.0, stageOneAngle, 0.0, stage_1, timePercent, 0);\n\t\tnewPosition.x += halfWidth;\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x -= halfWidth;\n\t}\n\telse if ((timePercent >= stage_1) && (timePercent < stage_2)) {\n\t\tif (timePercent > 0.5) {\n\t\t\tnewPosition *= rotateY(PI);\n\t\t}\n\t\tfloat offset = halfWidth - (sin((PI * 0.5) - stageOneAngle) * halfWidth);\n\t\tfloat angle = interpolationFloat(0.0, stageTwoAngle, stage_1, stage_2, timePercent, 0);\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x += halfWidth;\n\t\tnewPosition *= rotateY(stageOneAngle);\n\t\tnewPosition.x -= halfWidth;\n\t\tnewPosition.x += interpolationFloat(0.0, 2.0 * offset, stage_1, stage_2, timePercent, 0);\n\t}\n\telse {\n\t\tfloat angle = interpolationFloat(-stageOneAngle, 0.0, stage_2, 1.0, timePercent, 0);\n\t\tnewPosition.x -= halfWidth;\n\t\tnewPosition *= rotateY(angle);\n\t\tnewPosition.x += halfWidth;\n\t}\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tgl_FragColor = timePercent < 0.5 ? srcColor : distColor;\n}\n"},function(e,t){e.exports="vec4 blendSrcOver(vec4 src, vec4 dist) {\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tsrc.r *= src.a;\n\tsrc.g *= src.a;\n\tsrc.b *= src.a;\n\tresult.a = src.a + (dist.a * (1.0 - src.a));\n\tresult.r = (src.r + (dist.r * (1.0 - src.a))) / result.a;\n\tresult.g = (src.g + (dist.g * (1.0 - src.a))) / result.a;\n\tresult.b = (src.b + (dist.b * (1.0 - src.a))) / result.a;\n\treturn result;\n}\n#define PI 3.14159265358\nuniform sampler2D texturePrev;\nuniform sampler2D textureNext;\nuniform float timePercent;\nuniform int option;\nvarying vec2 vUv;\nmat2 rotateOrigin(float angle) {\n\treturn mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n}\nvoid main() {\n\tfloat alphaStart;\n\tfloat alphaEnd;\n\tfloat rectStart;\n\tfloat rectEnd;\n\tbool isRevert = (option == 3) || (option == 2);\n\tbool rotateParam = (option == 3) || (option == 1);\n\tif (timePercent <= 0.33) {\n\t\talphaStart = isRevert ? 1.0 - (timePercent / 0.33) : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 1.0 - (timePercent / 0.33);\n\t\trectStart = isRevert ? 0.0 : 1.5;\n\t\trectEnd = isRevert ? 0.5 : 2.0;\n\t}\n\telse if ((timePercent > 0.33) && (timePercent <= 0.66)) {\n\t\talphaStart = isRevert ? 0.0 : 1.0;\n\t\talphaEnd = isRevert ? 1.0 : 0.0;\n\t\trectEnd = isRevert ? (((timePercent - 0.33) / 0.33) * 1.5) + 0.5 : 2.0 - (((timePercent - 0.33) / 0.33) * 1.5);\n\t\trectStart = rectEnd - 0.5;\n\t}\n\telse {\n\t\talphaStart = isRevert ? 0.0 : (1.0 - timePercent) / (1.0 - 0.66);\n\t\talphaEnd = isRevert ? (1.0 - timePercent) / (1.0 - 0.66) : 0.0;\n\t\trectStart = isRevert ? 1.5 : 0.0;\n\t\trectEnd = isRevert ? 2.0 : 0.5;\n\t}\n\tif (!rotateParam) {\n\t\trectStart -= 1.0;\n\t\trectEnd -= 1.0;\n\t}\n\tfloat rotate = rotateParam ? PI * 0.25 : PI * 0.75;\n\tvec2 rotateUv = vUv * rotateOrigin(rotate);\n\tvec4 srcColor = texture2D(texturePrev, vUv);\n\tvec4 distColor = texture2D(textureNext, vUv);\n\tvec2 startPoint = vec2(rectStart, 0.0) * rotateOrigin(rotate);\n\tvec2 endPoint = vec2(rectEnd, 0.0) * rotateOrigin(rotate);\n\tif (rotateParam) {\n\t\tif (rotateUv.x >= endPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t\t}\n\t\telse if (rotateUv.x <= startPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = alphaStart + (((rotateUv.x - startPoint.x) / (0.5 / sqrt(2.0))) * (alphaEnd - alphaStart));\n\t\t}\n\t}\n\telse {\n\t\tif (rotateUv.x <= endPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 1.0 : 0.0;\n\t\t}\n\t\telse if (rotateUv.x >= startPoint.x) {\n\t\t\tsrcColor.a = isRevert ? 0.0 : 1.0;\n\t\t}\n\t\telse {\n\t\t\tsrcColor.a = alphaStart + (((startPoint.x - rotateUv.x) / (0.5 / sqrt(2.0))) * (alphaEnd - alphaStart));\n\t\t}\n\t}\n\tgl_FragColor = blendSrcOver(srcColor, distColor);\n}\n"},function(e,t){e.exports="#define PI 3.14159265\nattribute float left;\nuniform float timePercent;\nuniform float offset;\nvarying vec2 vUv;\nuniform float option;\nvoid main() {\n\tvUv = uv;\n\tfloat angle;\n\tif (left > 0.0) {\n\t\tangle = (PI / 6.0) * timePercent;\n\t}\n\telse {\n\t\tangle = (-PI / 6.0) * timePercent;\n\t}\n\tif (option > 0.5) {\n\t\tif (left > 0.0) {\n\t\t\tangle = (-PI / 6.0) * timePercent;\n\t\t}\n\t\telse {\n\t\t\tangle = (PI / 6.0) * timePercent;\n\t\t}\n\t}\n\tvec4 newPosition = vec4(position, 1.0);\n\tmat4 transform;\n\tmat4 rotateY = mat4(cos(angle), 0.0, -sin(angle), 0.0, 0.0, 1.0, 0.0, 0.0, sin(angle), 0, cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\tif (option > 0.5) {\n\t\trotateY = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), -sin(angle), 0.0, 0.0, sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0);\n\t}\n\tif (option > 0.5) {\n\t\tif (left > 0.0) {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, offset * timePercent, 0.0, 1.0);\n\t\t}\n\t\telse {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -offset * timePercent, 0.0, 1.0);\n\t\t}\n\t}\n\telse {\n\t\tif (left > 0.0) {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -offset * timePercent, 0.0, 0.0, 1.0);\n\t\t}\n\t\telse {\n\t\t\ttransform = rotateY * mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, offset * timePercent, 0.0, 0.0, 1.0);\n\t\t}\n\t}\n\tnewPosition = transform * newPosition;\n\tgl_Position = (projectionMatrix * modelViewMatrix) * newPosition;\n}\n"},function(e,t){e.exports="uniform sampler2D prevTexture;\nuniform float timePercent;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 color = texture2D(prevTexture, vUv);\n\tcolor.a = 1.0 - timePercent;\n\tgl_FragColor = color;\n}\n"},function(e,t,n){(function(e){var r=n(109),i=n(110),o=setTimeout;function a(e){return Boolean(e&&void 0!==e.length)}function s(){}function u(e){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function l(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,u._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void h(t.promise,e)}c(t.promise,r)}else(1===e._state?c:h)(t.promise,e._value)}))):e._deferreds.push(t)}function c(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==M(t)||"function"==typeof t)){var n=t.then;if(t instanceof u)return e._state=3,e._value=t,void d(e);if("function"==typeof n)return void p((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,d(e)}catch(t){h(e,t)}var r,i}function h(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&u._immediateFn((function(){e._handled||u._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t0?1:-1}),Number.isInteger||(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array)}).call(this,n(17))},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(141),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(17))},function(e,t,n){(function(e,t){!function(e,n){if(!e.setImmediate){var r,i,o,a,s,u=1,l={},c=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function v(e){throw new RangeError(d[e])}function m(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function g(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+m((e=e.replace(h,".")).split("."),t).join(".")}function y(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+p(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,n){var r=0;for(e=n?f(e/700):e>>1,e+=f(e/t);e>455;r+=36)e=f(e/35);return f(r+36*e/(e+38))}function w(e){var t,n,r,i,o,a,s,l,c,h,d,p=[],m=e.length,g=0,y=128,x=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&v("not-basic"),p.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=m&&v("invalid-input"),((l=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||l>f((u-g)/a))&&v("overflow"),g+=l*a,!(l<(c=s<=x?1:s>=x+26?26:s-x));s+=36)a>f(u/(h=36-c))&&v("overflow"),a*=h;x=_(g-o,t=p.length+1,0==o),f(g/t)>u-y&&v("overflow"),y+=f(g/t),g%=t,p.splice(g++,0,y)}return b(p)}function T(e){var t,n,r,i,o,a,s,l,c,h,d,m,g,b,w,T=[];for(m=(e=y(e)).length,t=128,n=0,o=72,a=0;a=t&&df((u-n)/(g=r+1))&&v("overflow"),n+=(s-t)*g,t=s,a=0;au&&v("overflow"),d==t){for(l=n,c=36;!(l<(h=c<=o?1:c>=o+26?26:c-o));c+=36)w=l-h,b=36-h,T.push(p(x(h+w%b,0))),l=f(w/b);T.push(p(x(l,0))),o=_(n,g,r==i),n=0,++r}++n,++t}return T.join("")}s={version:"1.4.1",ucs2:{decode:y,encode:b},decode:w,encode:T,toASCII:function(e){return g(e,(function(e){return c.test(e)?"xn--"+T(e):e}))},toUnicode:function(e){return g(e,(function(e){return l.test(e)?w(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(25)(e),n(17))},function(e,t,n){e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==M(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){t.decode=t.parse=n(146),t.encode=t.stringify=n(147)},function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c=0?(h=v.substr(0,m),d=v.substr(m+1)):(h=v,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),r(a,f)?i(a[f])?a[f].push(p):a[f]=[a[f],p]:a[f]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){var r=function(e){switch(M(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==M(e)?o(a(e),(function(a){var s=encodeURIComponent(r(a))+n;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[a]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r0?e[0].width:0,s=o>0?e[0].height:0;for(this.root={x:0,y:0,width:a,height:s},t=0;t=this.root.width+e,o=n&&this.root.width>=this.root.height+t;return i?this.growRight(e,t):o?this.growDown(e,t):r?this.growRight(e,t):n?this.growDown(e,t):null},growRight:function(e,t){var n;return this.root={used:!0,x:0,y:0,width:this.root.width+e,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:e,height:this.root.height}},(n=this.findNode(this.root,e,t))?this.splitNode(n,e,t):null},growDown:function(e,t){var n;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+t,down:{x:0,y:this.root.height,width:this.root.width,height:t},right:this.root},(n=this.findNode(this.root,e,t))?this.splitNode(n,e,t):null}},e.exports=n},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){var r=n(151),i=n(15);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},function(e,t,n){var r=n(54),i=n(57),o=n(183),a=n(186),s=n(31),u=n(30),l=n(40),c=n(64),h="[object Object]",d=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,f,p,v){var m=u(e),g=u(t),y=m?"[object Array]":s(e),b=g?"[object Array]":s(t),x=(y="[object Arguments]"==y?h:y)==h,_=(b="[object Arguments]"==b?h:b)==h,w=y==b;if(w&&l(e)){if(!l(t))return!1;m=!0,x=!1}if(w&&!x)return v||(v=new r),m||c(e)?i(e,t,n,f,p,v):o(e,t,y,n,f,p,v);if(!(1&n)){var T=x&&d.call(e,"__wrapped__"),M=_&&d.call(t,"__wrapped__");if(T||M){var S=T?e.value():e,E=M?t.value():t;return v||(v=new r),p(S,E,n,f,v)}}return!!w&&(v||(v=new r),a(e,t,n,f,p,v))}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(27),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(27);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(27);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(27);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(26);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(26),i=n(37),o=n(56);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(33),i=n(163),o=n(21),a=n(55),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,h=l.hasOwnProperty,d=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:s).test(a(e))}},function(e,t,n){var r,i=n(164),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(14)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(167),i=n(26),o=n(37);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(168),i=n(169),o=n(170),a=n(171),s=n(172);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&r]+i[r>>8&255]+i[r>>16&255]+i[r>>24&255]).toUpperCase()}for(var b=n(23),w=function(){function e(){_(this,e)}return T(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r0?1:-1}),Number.isInteger||(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array)}).call(this,n(17))},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(141),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(17))},function(e,t,n){(function(e,t){!function(e,n){if(!e.setImmediate){var r,i,o,a,s,u=1,l={},c=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function v(e){throw new RangeError(d[e])}function m(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function g(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+m((e=e.replace(h,".")).split("."),t).join(".")}function y(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+p(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,n){var r=0;for(e=n?f(e/700):e>>1,e+=f(e/t);e>455;r+=36)e=f(e/35);return f(r+36*e/(e+38))}function w(e){var t,n,r,i,o,a,s,l,c,h,d,p=[],m=e.length,g=0,y=128,x=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&v("not-basic"),p.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=m&&v("invalid-input"),((l=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||l>f((u-g)/a))&&v("overflow"),g+=l*a,!(l<(c=s<=x?1:s>=x+26?26:s-x));s+=36)a>f(u/(h=36-c))&&v("overflow"),a*=h;x=_(g-o,t=p.length+1,0==o),f(g/t)>u-y&&v("overflow"),y+=f(g/t),g%=t,p.splice(g++,0,y)}return b(p)}function T(e){var t,n,r,i,o,a,s,l,c,h,d,m,g,b,w,T=[];for(m=(e=y(e)).length,t=128,n=0,o=72,a=0;a=t&&df((u-n)/(g=r+1))&&v("overflow"),n+=(s-t)*g,t=s,a=0;au&&v("overflow"),d==t){for(l=n,c=36;!(l<(h=c<=o?1:c>=o+26?26:c-o));c+=36)w=l-h,b=36-h,T.push(p(x(h+w%b,0))),l=f(w/b);T.push(p(x(l,0))),o=_(n,g,r==i),n=0,++r}++n,++t}return T.join("")}s={version:"1.4.1",ucs2:{decode:y,encode:b},decode:w,encode:T,toASCII:function(e){return g(e,(function(e){return c.test(e)?"xn--"+T(e):e}))},toUnicode:function(e){return g(e,(function(e){return l.test(e)?w(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(25)(e),n(17))},function(e,t,n){e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==M(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){t.decode=t.parse=n(146),t.encode=t.stringify=n(147)},function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c=0?(h=v.substr(0,m),d=v.substr(m+1)):(h=v,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),r(a,f)?i(a[f])?a[f].push(p):a[f]=[a[f],p]:a[f]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){var r=function(e){switch(M(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==M(e)?o(a(e),(function(a){var s=encodeURIComponent(r(a))+n;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[a]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r0?e[0].width:0,s=o>0?e[0].height:0;for(this.root={x:0,y:0,width:a,height:s},t=0;t=this.root.width+e,o=n&&this.root.width>=this.root.height+t;return i?this.growRight(e,t):o?this.growDown(e,t):r?this.growRight(e,t):n?this.growDown(e,t):null},growRight:function(e,t){var n;return this.root={used:!0,x:0,y:0,width:this.root.width+e,height:this.root.height,down:this.root,right:{x:this.root.width,y:0,width:e,height:this.root.height}},(n=this.findNode(this.root,e,t))?this.splitNode(n,e,t):null},growDown:function(e,t){var n;return this.root={used:!0,x:0,y:0,width:this.root.width,height:this.root.height+t,down:{x:0,y:this.root.height,width:this.root.width,height:t},right:this.root},(n=this.findNode(this.root,e,t))?this.splitNode(n,e,t):null}},e.exports=n},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){var r=n(151),i=n(15);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},function(e,t,n){var r=n(54),i=n(57),o=n(183),a=n(186),s=n(31),u=n(30),l=n(40),c=n(64),h="[object Object]",d=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,f,p,v){var m=u(e),g=u(t),y=m?"[object Array]":s(e),b=g?"[object Array]":s(t),x=(y="[object Arguments]"==y?h:y)==h,_=(b="[object Arguments]"==b?h:b)==h,w=y==b;if(w&&l(e)){if(!l(t))return!1;m=!0,x=!1}if(w&&!x)return v||(v=new r),m||c(e)?i(e,t,n,f,p,v):o(e,t,y,n,f,p,v);if(!(1&n)){var T=x&&d.call(e,"__wrapped__"),M=_&&d.call(t,"__wrapped__");if(T||M){var S=T?e.value():e,E=M?t.value():t;return v||(v=new r),p(S,E,n,f,v)}}return!!w&&(v||(v=new r),a(e,t,n,f,p,v))}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(27),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},function(e,t,n){var r=n(27);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(27);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(27);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(26);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(26),i=n(37),o=n(56);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(33),i=n(163),o=n(21),a=n(55),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,h=l.hasOwnProperty,d=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:s).test(a(e))}},function(e,t,n){var r,i=n(164),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(14)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(167),i=n(26),o=n(37);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(168),i=n(169),o=n(170),a=n(171),s=n(172);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&r]+i[r>>8&255]+i[r>>16&255]+i[r>>24&255]).toUpperCase()}for(var b=n(23),w=function(){function e(){_(this,e)}return T(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r>8&255]+A[e>>16&255]+A[e>>24&255]+"-"+A[255&t]+A[t>>8&255]+"-"+A[t>>16&15|64]+A[t>>24&255]+"-"+A[63&n|128]+A[n>>8&255]+"-"+A[n>>16&255]+A[n>>24&255]+A[255&r]+A[r>>8&255]+A[r>>16&255]+A[r>>24&255]).toUpperCase()}function D(e,t,n){return Math.max(t,Math.min(n,e))}function P(e,t,n){return(1-n)*e+n*t}function O(e){return 0==(e&e-1)&&0!==e}function L(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_(this,e),this.x=t,this.y=n}return T(e,[{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}}]),e}();j.prototype.isVector2=!0;var B,U=function(){function e(){_(this,e),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}return T(e,[{key:"set",value:function(e,t,n,r,i,o,a,s,u){var l=this.elements;return l[0]=e,l[1]=r,l[2]=a,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=o,l[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],u=n[1],l=n[4],c=n[7],h=n[2],d=n[5],f=n[8],p=r[0],v=r[3],m=r[6],g=r[1],y=r[4],b=r[7],x=r[2],_=r[5],w=r[8];return i[0]=o*p+a*g+s*x,i[3]=o*v+a*y+s*_,i[6]=o*m+a*b+s*w,i[1]=u*p+l*g+c*x,i[4]=u*v+l*y+c*_,i[7]=u*m+l*b+c*w,i[2]=h*p+d*g+f*x,i[5]=h*v+d*y+f*_,i[8]=h*m+d*b+f*w,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8];return t*o*l-t*a*u-n*i*l+n*a*s+r*i*u-r*o*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=l*o-a*u,h=a*s-l*i,d=u*i-o*s,f=t*c+n*h+r*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);var p=1/f;return e[0]=c*p,e[1]=(r*u-l*n)*p,e[2]=(a*n-r*o)*p,e[3]=h*p,e[4]=(l*t-r*s)*p,e[5]=(r*i-a*t)*p,e[6]=d*p,e[7]=(n*s-u*t)*p,e[8]=(o*t-n*i)*p,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,n,r,i,o,a){var s=Math.cos(i),u=Math.sin(i);return this.set(n*s,n*u,-n*(s*o+u*a)+o+e,-r*u,r*s,-r*(-u*o+s*a)+a+t,0,0,1),this}},{key:"scale",value:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],u=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*u,r[6]=t*a+n*l,r[1]=-n*i+t*s,r[4]=-n*o+t*u,r[7]=-n*a+t*l,this}},{key:"translate",value:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}]),e}();U.prototype.isMatrix3=!0;var F=function(){function e(){_(this,e)}return T(e,null,[{key:"getDataURL",value:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===B&&(B=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),B.width=e.width,B.height=e.height;var n=B.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=B}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}]),e}(),z=0,G=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.DEFAULT_IMAGE,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:3e3;return _(this,n),e=t.call(this),Object.defineProperty(y(e),"id",{value:z++}),e.uuid=k(),e.name="",e.image=r,e.mipmaps=[],e.mapping=i,e.wrapS=o,e.wrapT=a,e.magFilter=s,e.minFilter=u,e.anisotropy=h,e.format=l,e.internalFormat=null,e.type=c,e.offset=new j(0,0),e.repeat=new j(1,1),e.center=new j(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new U,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.encoding=d,e.version=0,e.onUpdate=null,e}return T(n,[{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=k()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),n}(w);function H(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?F.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}G.DEFAULT_IMAGE=void 0,G.DEFAULT_MAPPING=300,G.prototype.isTexture=!0;var V=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;_(this,e),this.x=t,this.y=n,this.z=r,this.w=i}return T(e,[{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,o=e.elements,a=o[0],s=o[4],u=o[8],l=o[1],c=o[5],h=o[9],d=o[2],f=o[6],p=o[10];if(Math.abs(s-l)<.01&&Math.abs(u-d)<.01&&Math.abs(h-f)<.01){if(Math.abs(s+l)<.1&&Math.abs(u+d)<.1&&Math.abs(h+f)<.1&&Math.abs(a+c+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var v=(a+1)/2,m=(c+1)/2,g=(p+1)/2,y=(s+l)/4,b=(u+d)/4,x=(h+f)/4;return v>m&&v>g?v<.01?(n=0,r=.707106781,i=.707106781):(r=y/(n=Math.sqrt(v)),i=b/n):m>g?m<.01?(n=.707106781,r=0,i=.707106781):(n=y/(r=Math.sqrt(m)),i=x/r):g<.01?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(g)),r=x/i),this.set(n,r,i,t),this}var _=Math.sqrt((f-h)*(f-h)+(u-d)*(u-d)+(l-s)*(l-s));return Math.abs(_)<.001&&(_=1),this.x=(f-h)/_,this.y=(u-d)/_,this.z=(l-s)/_,this.w=Math.acos((a+c+p-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}}]),e}();V.prototype.isVector4=!0;var W=function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return _(this,n),(i=t.call(this)).width=e,i.height=r,i.depth=1,i.scissor=new V(0,0,e,r),i.scissorTest=!1,i.viewport=new V(0,0,e,r),i.texture=new G(void 0,o.mapping,o.wrapS,o.wrapT,o.magFilter,o.minFilter,o.format,o.type,o.anisotropy,o.encoding),i.texture.image={width:e,height:r,depth:1},i.texture.generateMipmaps=void 0!==o.generateMipmaps&&o.generateMipmaps,i.texture.minFilter=void 0!==o.minFilter?o.minFilter:1006,i.depthBuffer=void 0===o.depthBuffer||o.depthBuffer,i.stencilBuffer=void 0!==o.stencilBuffer&&o.stencilBuffer,i.depthTexture=void 0!==o.depthTexture?o.depthTexture:null,i}return T(n,[{key:"setTexture",value:function(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}},{key:"setSize",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=R({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),n}(w);W.prototype.isWebGLRenderTarget=!0,function(e){p(n,e);var t=m(n);function n(e,r,i){var o;_(this,n);var a=(o=t.call(this,e,r)).texture;o.texture=[];for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(var r=0,i=this.texture.length;r0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;_(this,e),this._x=t,this._y=n,this._z=r,this._w=i}return T(e,[{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,u=a(n/2),l=a(r/2),c=a(i/2),h=s(n/2),d=s(r/2),f=s(i/2);switch(o){case"XYZ":this._x=h*l*c+u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c-h*d*f;break;case"YXZ":this._x=h*l*c+u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c+h*d*f;break;case"ZXY":this._x=h*l*c-u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c-h*d*f;break;case"ZYX":this._x=h*l*c-u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c+h*d*f;break;case"YZX":this._x=h*l*c+u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c-h*d*f;break;case"XZY":this._x=h*l*c-u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],u=t[2],l=t[6],c=t[10],h=n+a+c;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(l-s)*d,this._y=(i-u)*d,this._z=(o-r)*d}else if(n>a&&n>c){var f=2*Math.sqrt(1+n-a-c);this._w=(l-s)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(i+u)/f}else if(a>c){var p=2*Math.sqrt(1+a-n-c);this._w=(i-u)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(s+l)/p}else{var v=2*Math.sqrt(1+c-n-a);this._w=(o-r)/v,this._x=(i+u)/v,this._y=(s+l)/v,this._z=.25*v}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(D(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,u=t._z,l=t._w;return this._x=n*l+o*a+r*u-i*s,this._y=r*l+o*s+i*a-n*u,this._z=i*l+o*u+n*s-r*a,this._w=o*l-n*a-r*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-t;return this._w=u*o+t*this._w,this._x=u*n+t*this._x,this._y=u*r+t*this._y,this._z=u*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),c=Math.atan2(l,a),h=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,n){this.copy(e).slerp(t,n)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}],[{key:"slerp",value:function(e,t,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,r)}},{key:"slerpFlat",value:function(e,t,n,r,i,o,a){var s=n[r+0],u=n[r+1],l=n[r+2],c=n[r+3],h=i[o+0],d=i[o+1],f=i[o+2],p=i[o+3];if(0===a)return e[t+0]=s,e[t+1]=u,e[t+2]=l,void(e[t+3]=c);if(1===a)return e[t+0]=h,e[t+1]=d,e[t+2]=f,void(e[t+3]=p);if(c!==p||s!==h||u!==d||l!==f){var v=1-a,m=s*h+u*d+l*f+c*p,g=m>=0?1:-1,y=1-m*m;if(y>Number.EPSILON){var b=Math.sqrt(y),x=Math.atan2(b,m*g);v=Math.sin(v*x)/b,a=Math.sin(a*x)/b}var _=a*g;if(s=s*v+h*_,u=u*v+d*_,l=l*v+f*_,c=c*v+p*_,v===1-a){var w=1/Math.sqrt(s*s+u*u+l*l+c*c);s*=w,u*=w,l*=w,c*=w}}e[t]=s,e[t+1]=u,e[t+2]=l,e[t+3]=c}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,o){var a=n[r],s=n[r+1],u=n[r+2],l=n[r+3],c=i[o],h=i[o+1],d=i[o+2],f=i[o+3];return e[t]=a*f+l*c+s*d-u*h,e[t+1]=s*f+l*h+u*c-a*d,e[t+2]=u*f+l*d+a*h-s*c,e[t+3]=l*f-a*c-s*h-u*d,e}}]),e}();X.prototype.isQuaternion=!0;var Q=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;_(this,e),this.x=t,this.y=n,this.z=r}return T(e,[{key:"set",value:function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(q.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(q.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this}},{key:"applyQuaternion",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,u=s*t+o*r-a*n,l=s*n+a*t-i*r,c=s*r+i*n-o*t,h=-i*t-o*n-a*r;return this.x=u*s+h*-i+l*-a-c*-o,this.y=l*s+h*-o+c*-i-u*-a,this.z=c*s+h*-a+u*-o-l*-i,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}},{key:"cross",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(e){return Z.copy(this).projectOnVector(e),this.sub(Z)}},{key:"reflect",value:function(e){return this.sub(Z.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(D(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}]),e}();Q.prototype.isVector3=!0;var Z=new Q,q=new X,J=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q(1/0,1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q(-1/0,-1/0,-1/0);_(this,e),this.min=t,this.max=n}return T(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.length;si&&(i=l),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.count;si&&(i=l),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,$),$.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(se),ue.subVectors(this.max,se),te.subVectors(e.a,se),ne.subVectors(e.b,se),re.subVectors(e.c,se),ie.subVectors(ne,te),oe.subVectors(re,ne),ae.subVectors(te,re);var t=[0,-ie.z,ie.y,0,-oe.z,oe.y,0,-ae.z,ae.y,ie.z,0,-ie.x,oe.z,0,-oe.x,ae.z,0,-ae.x,-ie.y,ie.x,0,-oe.y,oe.x,0,-ae.y,ae.x,0];return!!he(t,te,ne,re,ue)&&(!!he(t=[1,0,0,0,1,0,0,0,1],te,ne,re,ue)&&(le.crossVectors(ie,oe),he(t=[le.x,le.y,le.z],te,ne,re,ue)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return $.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"getBoundingSphere",value:function(e){return this.getCenter(e.center),e.radius=.5*this.getSize($).length(),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(K[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),K[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),K[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),K[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),K[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),K[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),K[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),K[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(K)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}();J.prototype.isBox3=!0;var K=[new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q],$=new Q,ee=new J,te=new Q,ne=new Q,re=new Q,ie=new Q,oe=new Q,ae=new Q,se=new Q,ue=new Q,le=new Q,ce=new Q;function he(e,t,n,r,i){for(var o=0,a=e.length-3;o<=a;o+=3){ce.fromArray(e,o);var s=i.x*Math.abs(ce.x)+i.y*Math.abs(ce.y)+i.z*Math.abs(ce.z),u=t.dot(ce),l=n.dot(ce),c=r.dot(ce);if(Math.max(-Math.max(u,l,c),Math.min(u,l,c))>s)return!1}return!0}var de=new J,fe=new Q,pe=new Q,ve=new Q,me=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;_(this,e),this.center=t,this.radius=n}return T(e,[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var n=this.center;void 0!==t?n.copy(t):de.setFromPoints(e).getCenter(n);for(var r=0,i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){ve.subVectors(e,this.center);var t=ve.lengthSq();if(t>this.radius*this.radius){var n=Math.sqrt(t),r=.5*(n-this.radius);this.center.add(ve.multiplyScalar(r/n)),this.radius+=r}return this}},{key:"union",value:function(e){return pe.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(fe.copy(e.center).add(pe)),this.expandByPoint(fe.copy(e.center).sub(pe)),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),ge=new Q,ye=new Q,be=new Q,xe=new Q,_e=new Q,we=new Q,Te=new Q,Me=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q(0,0,-1);_(this,e),this.origin=t,this.direction=n}return T(e,[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,ge)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=ge.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ge.copy(this.direction).multiplyScalar(t).add(this.origin),ge.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,n,r){ye.copy(e).add(t).multiplyScalar(.5),be.copy(t).sub(e).normalize(),xe.copy(this.origin).sub(ye);var i,o,a,s,u=.5*e.distanceTo(t),l=-this.direction.dot(be),c=xe.dot(this.direction),h=-xe.dot(be),d=xe.lengthSq(),f=Math.abs(1-l*l);if(f>0)if(o=l*c-h,s=u*f,(i=l*h-c)>=0)if(o>=-s)if(o<=s){var p=1/f;a=(i*=p)*(i+l*(o*=p)+2*c)+o*(l*i+o+2*h)+d}else o=u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;else o=-u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;else o<=-s?a=-(i=Math.max(0,-(-l*u+c)))*i+(o=i>0?-u:Math.min(Math.max(-u,-h),u))*(o+2*h)+d:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-h),u))*(o+2*h)+d):a=-(i=Math.max(0,-(l*u+c)))*i+(o=i>0?u:Math.min(Math.max(-u,-h),u))*(o+2*h)+d;else o=l>0?-u:u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(be).multiplyScalar(o).add(ye),a}},{key:"intersectSphere",value:function(e,t){ge.subVectors(e.center,this.origin);var n=ge.dot(this.direction),r=ge.dot(ge)-n*n,i=e.radius*e.radius;if(r>i)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}},{key:"intersectPlane",value:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var n,r,i,o,a,s,u=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,h=this.origin;return u>=0?(n=(e.min.x-h.x)*u,r=(e.max.x-h.x)*u):(n=(e.max.x-h.x)*u,r=(e.min.x-h.x)*u),l>=0?(i=(e.min.y-h.y)*l,o=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,o=(e.min.y-h.y)*l),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(a=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(a=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s=0?n:r,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,ge)}},{key:"intersectTriangle",value:function(e,t,n,r,i){_e.subVectors(t,e),we.subVectors(n,e),Te.crossVectors(_e,we);var o,a=this.direction.dot(Te);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}xe.subVectors(this.origin,e);var s=o*this.direction.dot(we.crossVectors(xe,we));if(s<0)return null;var u=o*this.direction.dot(_e.cross(xe));if(u<0)return null;if(s+u>a)return null;var l=-o*xe.dot(Te);return l<0?null:this.at(l/a,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),Se=function(){function e(){_(this,e),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}return T(e,[{key:"set",value:function(e,t,n,r,i,o,a,s,u,l,c,h,d,f,p,v){var m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=o,m[9]=a,m[13]=s,m[2]=u,m[6]=l,m[10]=c,m[14]=h,m[3]=d,m[7]=f,m[11]=p,m[15]=v,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"setFromMatrix3",value:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,n=e.elements,r=1/Ee.setFromMatrixColumn(e,0).length(),i=1/Ee.setFromMatrixColumn(e,1).length(),o=1/Ee.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),u=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var h=o*l,d=o*c,f=a*l,p=a*c;t[0]=s*l,t[4]=-s*c,t[8]=u,t[1]=d+f*u,t[5]=h-p*u,t[9]=-a*s,t[2]=p-h*u,t[6]=f+d*u,t[10]=o*s}else if("YXZ"===e.order){var v=s*l,m=s*c,g=u*l,y=u*c;t[0]=v+y*a,t[4]=g*a-m,t[8]=o*u,t[1]=o*c,t[5]=o*l,t[9]=-a,t[2]=m*a-g,t[6]=y+v*a,t[10]=o*s}else if("ZXY"===e.order){var b=s*l,x=s*c,_=u*l,w=u*c;t[0]=b-w*a,t[4]=-o*c,t[8]=_+x*a,t[1]=x+_*a,t[5]=o*l,t[9]=w-b*a,t[2]=-o*u,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){var T=o*l,M=o*c,S=a*l,E=a*c;t[0]=s*l,t[4]=S*u-M,t[8]=T*u+E,t[1]=s*c,t[5]=E*u+T,t[9]=M*u-S,t[2]=-u,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var A=o*s,I=o*u,C=a*s,N=a*u;t[0]=s*l,t[4]=N-A*c,t[8]=C*c+I,t[1]=c,t[5]=o*l,t[9]=-a*l,t[2]=-u*l,t[6]=I*c+C,t[10]=A-N*c}else if("XZY"===e.order){var k=o*s,D=o*u,P=a*s,O=a*u;t[0]=s*l,t[4]=-c,t[8]=u*l,t[1]=k*c+O,t[5]=o*l,t[9]=D*c-P,t[2]=P*c-D,t[6]=a*l,t[10]=O*c+k}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Ie,e,Ce)}},{key:"lookAt",value:function(e,t,n){var r=this.elements;return De.subVectors(e,t),0===De.lengthSq()&&(De.z=1),De.normalize(),Ne.crossVectors(n,De),0===Ne.lengthSq()&&(1===Math.abs(n.z)?De.x+=1e-4:De.z+=1e-4,De.normalize(),Ne.crossVectors(n,De)),Ne.normalize(),ke.crossVectors(De,Ne),r[0]=Ne.x,r[4]=ke.x,r[8]=De.x,r[1]=Ne.y,r[5]=ke.y,r[9]=De.y,r[2]=Ne.z,r[6]=ke.z,r[10]=De.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],u=n[12],l=n[1],c=n[5],h=n[9],d=n[13],f=n[2],p=n[6],v=n[10],m=n[14],g=n[3],y=n[7],b=n[11],x=n[15],_=r[0],w=r[4],T=r[8],M=r[12],S=r[1],E=r[5],A=r[9],I=r[13],C=r[2],N=r[6],k=r[10],D=r[14],P=r[3],O=r[7],R=r[11],L=r[15];return i[0]=o*_+a*S+s*C+u*P,i[4]=o*w+a*E+s*N+u*O,i[8]=o*T+a*A+s*k+u*R,i[12]=o*M+a*I+s*D+u*L,i[1]=l*_+c*S+h*C+d*P,i[5]=l*w+c*E+h*N+d*O,i[9]=l*T+c*A+h*k+d*R,i[13]=l*M+c*I+h*D+d*L,i[2]=f*_+p*S+v*C+m*P,i[6]=f*w+p*E+v*N+m*O,i[10]=f*T+p*A+v*k+m*R,i[14]=f*M+p*I+v*D+m*L,i[3]=g*_+y*S+b*C+x*P,i[7]=g*w+y*E+b*N+x*O,i[11]=g*T+y*A+b*k+x*R,i[15]=g*M+y*I+b*D+x*L,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],u=e[13],l=e[2],c=e[6],h=e[10],d=e[14];return e[3]*(+i*s*c-r*u*c-i*a*h+n*u*h+r*a*d-n*s*d)+e[7]*(+t*s*d-t*u*h+i*o*h-r*o*d+r*u*l-i*s*l)+e[11]*(+t*u*c-t*a*d-i*o*c+n*o*d+i*a*l-n*u*l)+e[15]*(-r*a*l-t*s*c+t*a*h+r*o*c-n*o*h+n*s*l)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],d=e[11],f=e[12],p=e[13],v=e[14],m=e[15],g=c*v*u-p*h*u+p*s*d-a*v*d-c*s*m+a*h*m,y=f*h*u-l*v*u-f*s*d+o*v*d+l*s*m-o*h*m,b=l*p*u-f*c*u+f*a*d-o*p*d-l*a*m+o*c*m,x=f*c*s-l*p*s-f*a*h+o*p*h+l*a*v-o*c*v,_=t*g+n*y+r*b+i*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var w=1/_;return e[0]=g*w,e[1]=(p*h*i-c*v*i-p*r*d+n*v*d+c*r*m-n*h*m)*w,e[2]=(a*v*i-p*s*i+p*r*u-n*v*u-a*r*m+n*s*m)*w,e[3]=(c*s*i-a*h*i-c*r*u+n*h*u+a*r*d-n*s*d)*w,e[4]=y*w,e[5]=(l*v*i-f*h*i+f*r*d-t*v*d-l*r*m+t*h*m)*w,e[6]=(f*s*i-o*v*i-f*r*u+t*v*u+o*r*m-t*s*m)*w,e[7]=(o*h*i-l*s*i+l*r*u-t*h*u-o*r*d+t*s*d)*w,e[8]=b*w,e[9]=(f*c*i-l*p*i-f*n*d+t*p*d+l*n*m-t*c*m)*w,e[10]=(o*p*i-f*a*i+f*n*u-t*p*u-o*n*m+t*a*m)*w,e[11]=(l*a*i-o*c*i-l*n*u+t*c*u+o*n*d-t*a*d)*w,e[12]=x*w,e[13]=(l*p*r-f*c*r+f*n*h-t*p*h-l*n*v+t*c*v)*w,e[14]=(f*a*r-o*p*r-f*n*s+t*p*s+o*n*v-t*a*v)*w,e[15]=(o*c*r-l*a*r+l*n*s-t*c*s-o*n*h+t*a*h)*w,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}},{key:"makeTranslation",value:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,u=i*o,l=i*a;return this.set(u*o+n,u*a-r*s,u*s+r*a,0,u*a+r*s,l*a+n,l*s-r*o,0,u*s-r*a,l*s+r*o,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n,r,i,o){return this.set(1,n,i,0,e,1,o,0,t,r,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,u=i+i,l=o+o,c=a+a,h=i*u,d=i*l,f=i*c,p=o*l,v=o*c,m=a*c,g=s*u,y=s*l,b=s*c,x=n.x,_=n.y,w=n.z;return r[0]=(1-(p+m))*x,r[1]=(d+b)*x,r[2]=(f-y)*x,r[3]=0,r[4]=(d-b)*_,r[5]=(1-(h+m))*_,r[6]=(v+g)*_,r[7]=0,r[8]=(f+y)*w,r[9]=(v-g)*w,r[10]=(1-(h+p))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(e,t,n){var r=this.elements,i=Ee.set(r[0],r[1],r[2]).length(),o=Ee.set(r[4],r[5],r[6]).length(),a=Ee.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Ae.copy(this);var s=1/i,u=1/o,l=1/a;return Ae.elements[0]*=s,Ae.elements[1]*=s,Ae.elements[2]*=s,Ae.elements[4]*=u,Ae.elements[5]*=u,Ae.elements[6]*=u,Ae.elements[8]*=l,Ae.elements[9]*=l,Ae.elements[10]*=l,t.setFromRotationMatrix(Ae),n.x=i,n.y=o,n.z=a,this}},{key:"makePerspective",value:function(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),u=2*i/(n-r),l=(t+e)/(t-e),c=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=u,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,o){var a=this.elements,s=1/(t-e),u=1/(n-r),l=1/(o-i),c=(t+e)*s,h=(n+r)*u,d=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}]),e}();Se.prototype.isMatrix4=!0;var Ee=new Q,Ae=new Se,Ie=new Q(0,0,0),Ce=new Q(1,1,1),Ne=new Q,ke=new Q,De=new Q,Pe=new Se,Oe=new X,Re=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;_(this,e),this._x=t,this._y=n,this._z=r,this._order=i}return T(e,[{key:"set",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.elements,i=r[0],o=r[4],a=r[8],s=r[1],u=r[5],l=r[9],c=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(D(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-D(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(s,u)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(D(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-D(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(D(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-D(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,n){return Pe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Pe,t,n)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(e){return Oe.setFromEuler(this),this.setFromQuaternion(Oe,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"toVector3",value:function(e){return e?e.set(this._x,this._y,this._z):new Q(this._x,this._y,this._z)}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}]),e}();Re.prototype.isEuler=!0,Re.DefaultOrder="XYZ",Re.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Le=function(){function e(){_(this,e),this.mask=1}return T(e,[{key:"set",value:function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){r.children=[];for(var f=0;f0){r.animations=[];for(var p=0;p0&&(n.geometries=m),g.length>0&&(n.materials=g),y.length>0&&(n.textures=y),b.length>0&&(n.images=b),x.length>0&&(n.shapes=x),_.length>0&&(n.skeletons=_),w.length>0&&(n.animations=w)}return n.object=r,n;function T(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:new Q,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Q;_(this,e),this.a=t,this.b=n,this.c=r}return T(e,[{key:"set",value:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return Je.subVectors(this.c,this.b),Ke.subVectors(this.a,this.b),.5*Je.cross(Ke).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}},{key:"getUV",value:function(t,n,r,i,o){return e.getUV(t,this.a,this.b,this.c,n,r,i,o)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var n,r,i=this.a,o=this.b,a=this.c;tt.subVectors(o,i),nt.subVectors(a,i),it.subVectors(e,i);var s=tt.dot(it),u=nt.dot(it);if(s<=0&&u<=0)return t.copy(i);ot.subVectors(e,o);var l=tt.dot(ot),c=nt.dot(ot);if(l>=0&&c<=l)return t.copy(o);var h=s*c-l*u;if(h<=0&&s>=0&&l<=0)return n=s/(s-l),t.copy(i).addScaledVector(tt,n);at.subVectors(e,a);var d=tt.dot(at),f=nt.dot(at);if(f>=0&&d<=f)return t.copy(a);var p=d*u-s*f;if(p<=0&&u>=0&&f<=0)return r=u/(u-f),t.copy(i).addScaledVector(nt,r);var v=l*f-d*c;if(v<=0&&c-l>=0&&d-f>=0)return rt.subVectors(a,o),r=(c-l)/(c-l+(d-f)),t.copy(o).addScaledVector(rt,r);var m=1/(v+p+h);return n=p*m,r=h*m,t.copy(i).addScaledVector(tt,n).addScaledVector(nt,r)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,n,r){r.subVectors(n,t),Je.subVectors(e,t),r.cross(Je);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,n,r,i){Je.subVectors(r,t),Ke.subVectors(n,t),$e.subVectors(e,t);var o=Je.dot(Je),a=Je.dot(Ke),s=Je.dot($e),u=Ke.dot(Ke),l=Ke.dot($e),c=o*u-a*a;if(0===c)return i.set(-2,-1,-1);var h=1/c,d=(u*s-a*l)*h,f=(o*l-a*s)*h;return i.set(1-d-f,f,d)}},{key:"containsPoint",value:function(e,t,n,r){return this.getBarycoord(e,t,n,r,et),et.x>=0&&et.y>=0&&et.x+et.y<=1}},{key:"getUV",value:function(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,et),s.set(0,0),s.addScaledVector(i,et.x),s.addScaledVector(o,et.y),s.addScaledVector(a,et.z),s}},{key:"isFrontFacing",value:function(e,t,n,r){return Je.subVectors(n,t),Ke.subVectors(e,t),Je.cross(Ke).dot(r)<0}}]),e}(),ut=0,lt=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),e=t.call(this),Object.defineProperty(y(e),"id",{value:ut++}),e.uuid=k(),e.name="",e.type="Material",e.fog=!0,e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=100,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=7680,e.stencilZFail=7680,e.stencilZPass=7680,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaTest=0,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e}return T(n,[{key:"onBuild",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),o=r(e.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),n}(w);lt.prototype.isMaterial=!0;var ct={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ht={h:0,s:0,l:0},dt={h:0,s:0,l:0};function ft(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function pt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function vt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var mt=function(){function e(t,n,r){return _(this,e),void 0===n&&void 0===r?this.set(t):this.setRGB(t,n,r)}return T(e,[{key:"set",value:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,n){return this.r=e,this.g=t,this.b=n,this}},{key:"setHSL",value:function(e,t,n){if(e=function(e,t){return(e%t+t)%t}(e,1),t=D(t,0,1),n=D(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=ft(i,r,e+1/3),this.g=ft(i,r,e),this.b=ft(i,r,e-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(a,s,u)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){var l=n[1],c=l.length;if(3===c)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}},{key:"setColorName",value:function(e){var t=ct[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(e){return this.r=pt(e.r),this.g=pt(e.g),this.b=pt(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=vt(e.r),this.g=vt(e.g),this.b=vt(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),u=(s+a)/2;if(s===a)t=0,n=0;else{var l=a-s;switch(n=u<=.5?l/(a+s):l/(2-a-s),a){case r:t=(i-o)/l+(i1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),e}();mt.NAMES=ct,mt.prototype.isColor=!0,mt.prototype.r=1,mt.prototype.g=1,mt.prototype.b=1;var gt=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).type="MeshBasicMaterial",r.color=new mt(16777215),r.map=null,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=null,r.aoMapIntensity=1,r.specularMap=null,r.alphaMap=null,r.envMap=null,r.combine=0,r.reflectivity=1,r.refractionRatio=.98,r.wireframe=!1,r.wireframeLinewidth=1,r.wireframeLinecap="round",r.wireframeLinejoin="round",r.morphTargets=!1,r.setValues(e),r}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this}}]),n}(lt);gt.prototype.isMeshBasicMaterial=!0;var yt=new Q,bt=new j,xt=function(){function e(t,n,r){if(_(this,e),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=n,this.count=void 0!==t?t.length/n:0,this.normalized=!0===r,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}return T(e,[{key:"onUploadCallback",value:function(){}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"getX",value:function(e){return this.array[e*this.itemSize]}},{key:"setX",value:function(e,t){return this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){return this.array[e*this.itemSize+1]}},{key:"setY",value:function(e,t){return this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){return this.array[e*this.itemSize+2]}},{key:"setZ",value:function(e,t){return this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){return this.array[e*this.itemSize+3]}},{key:"setW",value:function(e,t){return this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}},{key:"setXYZ",value:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}},{key:"setXYZW",value:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();xt.prototype.isBufferAttribute=!0;var _t=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Uint16Array(e),r,i)}return n}(xt),wt=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Int32Array(e),r,i)}return n}(xt),Tt=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Uint32Array(e),r,i)}return n}(xt);(function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Uint16Array(e),r,i)}return n})(xt).prototype.isFloat16BufferAttribute=!0;var Mt=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Float32Array(e),r,i)}return n}(xt);function St(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;nt&&(t=e[n]);return t}var Et=0,At=new Se,It=new qe,Ct=new Q,Nt=new J,kt=new J,Dt=new Q,Pt=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),e=t.call(this),Object.defineProperty(y(e),"id",{value:Et++}),e.uuid=k(),e.name="",e.type="BufferGeometry",e.index=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return T(n,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(St(e)>65535?Tt:_t)(e,1):this.index=e,this}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new U).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return At.makeRotationFromQuaternion(e),this.applyMatrix4(At),this}},{key:"rotateX",value:function(e){return At.makeRotationX(e),this.applyMatrix4(At),this}},{key:"rotateY",value:function(e){return At.makeRotationY(e),this.applyMatrix4(At),this}},{key:"rotateZ",value:function(e){return At.makeRotationZ(e),this.applyMatrix4(At),this}},{key:"translate",value:function(e,t,n){return At.makeTranslation(e,t,n),this.applyMatrix4(At),this}},{key:"scale",value:function(e,t,n){return At.makeScale(e,t,n),this.applyMatrix4(At),this}},{key:"lookAt",value:function(e){return It.lookAt(e),It.updateMatrix(),this.applyMatrix4(It.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ct).negate(),this.translate(Ct.x,Ct.y,Ct.z),this}},{key:"setFromPoints",value:function(e){for(var t=[],n=0,r=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var o in i){var a=i[o];e.data.attributes[o]=a.toJSON(e.data)}var s={},u=!1;for(var l in this.morphAttributes){for(var c=this.morphAttributes[l],h=[],d=0,f=c.length;d0&&(s[l]=h,u=!0)}u&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var v=this.groups;v.length>0&&(e.data.groups=JSON.parse(JSON.stringify(v)));var m=this.boundingSphere;return null!==m&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e}},{key:"clone",value:function(){return(new n).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone(t));var r=e.attributes;for(var i in r){var o=r[i];this.setAttribute(i,o.clone(t))}var a=e.morphAttributes;for(var s in a){for(var u=[],l=a[s],c=0,h=l.length;c0&&void 0!==arguments[0]?arguments[0]:new Pt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt;return _(this,n),(e=t.call(this)).type="Mesh",e.geometry=r,e.material=i,e.updateMorphTargets(),e}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"raycast",value:function(e,t){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),Lt.copy(r.boundingSphere),Lt.applyMatrix4(o),!1!==e.ray.intersectsSphere(Lt)&&(Ot.copy(o).invert(),Rt.copy(e.ray).applyMatrix4(Ot),null===r.boundingBox||!1!==Rt.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a=r.index,s=r.attributes.position,u=r.morphAttributes.position,l=r.morphTargetsRelative,c=r.attributes.uv,h=r.attributes.uv2,d=r.groups,f=r.drawRange;if(null!==a)if(Array.isArray(i))for(var p=0,v=d.length;pn.far?null:{distance:u,point:qt.clone(),object:e}}(e,t,n,r,jt,Bt,Ut,Zt);if(g){s&&(Yt.fromBufferAttribute(s,l),Xt.fromBufferAttribute(s,c),Qt.fromBufferAttribute(s,h),g.uv=st.getUV(Zt,jt,Bt,Ut,Yt,Xt,Qt,new j)),u&&(Yt.fromBufferAttribute(u,l),Xt.fromBufferAttribute(u,c),Qt.fromBufferAttribute(u,h),g.uv2=st.getUV(Zt,jt,Bt,Ut,Yt,Xt,Qt,new j));var y={a:l,b:c,c:h,normal:new Q,materialIndex:0};st.getNormal(jt,Bt,Ut,y.normal),g.face=y}return g}Jt.prototype.isMesh=!0;var $t=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;_(this,n),(e=t.call(this)).type="BoxGeometry",e.parameters={width:r,height:i,depth:o,widthSegments:a,heightSegments:s,depthSegments:u};var l=y(e);a=Math.floor(a),s=Math.floor(s),u=Math.floor(u);var c=[],h=[],d=[],f=[],p=0,v=0;function m(e,t,n,r,i,o,a,s,u,m,g){for(var y=o/u,b=a/m,x=o/2,_=a/2,w=s/2,T=u+1,M=m+1,S=0,E=0,A=new Q,I=0;I0?1:-1,d.push(A.x,A.y,A.z),f.push(N/u),f.push(1-I/m),S+=1}for(var D=0;D0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var o={};for(var a in this.extensions)!0===this.extensions[a]&&(o[a]=!0);return Object.keys(o).length>0&&(t.extensions=o),t}}]),n}(lt);rn.prototype.isShaderMaterial=!0;var on=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="Camera",e.matrixWorldInverse=new Se,e.projectionMatrix=new Se,e.projectionMatrixInverse=new Se,e}return T(n,[{key:"copy",value:function(e,t){return f(x(n.prototype),"copy",this).call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(e){f(x(n.prototype),"updateMatrixWorld",this).call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,t){f(x(n.prototype),"updateWorldMatrix",this).call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),n}(qe);on.prototype.isCamera=!0;var an=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;return _(this,n),(e=t.call(this)).type="PerspectiveCamera",e.fov=r,e.zoom=1,e.near=o,e.far=a,e.focus=10,e.aspect=i,e.view=null,e.filmGauge=35,e.filmOffset=0,e.updateProjectionMatrix(),e}return T(n,[{key:"copy",value:function(e,t){return f(x(n.prototype),"copy",this).call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}},{key:"setFocalLength",value:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*N*Math.atan(t),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*C*this.fov);return.5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*N*Math.atan(Math.tan(.5*C*this.fov)/this.zoom)}},{key:"getFilmWidth",value:function(){return this.filmGauge*Math.min(this.aspect,1)}},{key:"getFilmHeight",value:function(){return this.filmGauge/Math.max(this.aspect,1)}},{key:"setViewOffset",value:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=this.near,t=e*Math.tan(.5*C*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,t-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var u=this.filmOffset;0!==u&&(i+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}]),n}(on);an.prototype.isPerspectiveCamera=!0;var sn=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;if(_(this,n),(o=t.call(this)).type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return g(o,void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."));o.renderTarget=i;var a=new an(90,1,e,r);a.layers=o.layers,a.up.set(0,-1,0),a.lookAt(new Q(1,0,0)),o.add(a);var s=new an(90,1,e,r);s.layers=o.layers,s.up.set(0,-1,0),s.lookAt(new Q(-1,0,0)),o.add(s);var u=new an(90,1,e,r);u.layers=o.layers,u.up.set(0,0,1),u.lookAt(new Q(0,1,0)),o.add(u);var l=new an(90,1,e,r);l.layers=o.layers,l.up.set(0,0,-1),l.lookAt(new Q(0,-1,0)),o.add(l);var c=new an(90,1,e,r);c.layers=o.layers,c.up.set(0,-1,0),c.lookAt(new Q(0,0,1)),o.add(c);var h=new an(90,1,e,r);return h.layers=o.layers,h.up.set(0,-1,0),h.lookAt(new Q(0,0,-1)),o.add(h),g(o)}return T(n,[{key:"update",value:function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,r=c(this.children,6),i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],l=r[5],h=e.xr.enabled,d=e.getRenderTarget();e.xr.enabled=!1;var f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,o),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,s),e.setRenderTarget(n,4),e.render(t,u),n.texture.generateMipmaps=f,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(d),e.xr.enabled=h}}]),n}(qe),un=function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c,h){var d;return _(this,n),(d=t.call(this,e=void 0!==e?e:[],r=void 0!==r?r:301,i,o,a,s,u=void 0!==u?u:1022,l,c,h))._needsFlipEnvMap=!0,d.flipY=!1,d}return T(n,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}]),n}(G);un.prototype.isCubeTexture=!0;var ln=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),Number.isInteger(r)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),r=i),o=t.call(this,e,e,r),r=r||{},o.texture=new un(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),o.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,o.texture.minFilter=void 0!==r.minFilter?r.minFilter:1006,o.texture._needsFlipEnvMap=!1,o}return T(n,[{key:"fromEquirectangularTexture",value:function(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new $t(5,5,5),a=new rn({name:"CubemapFromEquirect",uniforms:en(n),vertexShader:r,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=t;var s=new Jt(o,a),u=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new sn(1,10,this).update(e,s),t.minFilter=u,s.geometry.dispose(),s.material.dispose(),this}},{key:"clear",value:function(e,t,n,r){for(var i=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(i)}}]),n}(W);ln.prototype.isWebGLCubeRenderTarget=!0;var cn=new Q,hn=new Q,dn=new U,fn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q(1,0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_(this,e),this.normal=t,this.constant=n}return T(e,[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,n){var r=cn.subVectors(n,t).cross(hn.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}},{key:"intersectLine",value:function(e,t){var n=e.delta(cn),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(n).multiplyScalar(i).add(e.start)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var n=t||dn.getNormalMatrix(e),r=this.coplanarPoint(cn).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}();fn.prototype.isPlane=!0;var pn=new me,vn=new Q,mn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fn,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fn,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new fn,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fn,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new fn,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new fn;_(this,e),this.planes=[t,n,r,i,o,a]}return T(e,[{key:"set",value:function(e,t,n,r,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=n[7],h=n[8],d=n[9],f=n[10],p=n[11],v=n[12],m=n[13],g=n[14],y=n[15];return t[0].setComponents(a-r,c-s,p-h,y-v).normalize(),t[1].setComponents(a+r,c+s,p+h,y+v).normalize(),t[2].setComponents(a+i,c+u,p+d,y+m).normalize(),t[3].setComponents(a-i,c-u,p-d,y-m).normalize(),t[4].setComponents(a-o,c-l,p-f,y-g).normalize(),t[5].setComponents(a+o,c+l,p+f,y+g).normalize(),this}},{key:"intersectsObject",value:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),pn.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(pn)}},{key:"intersectsSprite",value:function(e){return pn.center.set(0,0,0),pn.radius=.7071067811865476,pn.applyMatrix4(e.matrixWorld),this.intersectsSphere(pn)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(n)0?e.max.x:e.min.x,vn.y=r.normal.y>0?e.max.y:e.min.y,vn.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(vn)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}();function gn(){var e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function yn(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var o=r.get(t);(!o||o.version0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;_(this,n),(e=t.call(this)).type="PlaneGeometry",e.parameters={width:r,height:i,widthSegments:o,heightSegments:a};for(var s=r/2,u=i/2,l=Math.floor(o),c=Math.floor(a),h=l+1,d=c+1,f=r/l,p=i/c,v=[],m=[],g=[],y=[],b=0;b 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSNMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition.xyz / vWorldPosition.w;\n\tvec3 v = normalize( cameraPosition - pos );\n\tfloat ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity );\n\tvec3 transmission = transmissionFactor * getIBLVolumeRefraction(\n\t\tnormal, v, roughnessFactor, material.diffuseColor, totalSpecular,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec4 vWorldPosition;\n\tvec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) {\n\t\tvec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length(vec3(modelMatrix[0].xyz));\n\t\tmodelScale.y = length(vec3(modelMatrix[1].xyz));\n\t\tmodelScale.z = length(vec3(modelMatrix[2].xyz));\n\t\treturn normalize(refractionVector) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness(float roughness, float ior) {\n\t\treturn roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0);\n\t}\n\tvec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) {\n\t\tfloat framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior);\n\t\treturn texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb;\n\t}\n\tvec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) {\n\t\tif (attenuationDistance == 0.0) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance;\n\t\t\tvec3 transmittance = exp(-attenuationCoefficient * transmissionDistance);\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix);\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0);\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior);\n\t\tvec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance);\n\t\treturn (1.0 - specularColor) * attenuatedColor * baseColor;\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform vec3 attenuationColor;\n\tuniform float attenuationDistance;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#ifdef USE_TRANSMISSION\n\tvarying vec4 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition;\n#endif\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},_n={common:{diffuse:{value:new mt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new U},uv2Transform:{value:new U},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new j(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new mt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new mt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new U}},sprite:{diffuse:{value:new mt(16777215)},opacity:{value:1},center:{value:new j(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new U}}},wn={basic:{uniforms:tn([_n.common,_n.specularmap,_n.envmap,_n.aomap,_n.lightmap,_n.fog]),vertexShader:xn.meshbasic_vert,fragmentShader:xn.meshbasic_frag},lambert:{uniforms:tn([_n.common,_n.specularmap,_n.envmap,_n.aomap,_n.lightmap,_n.emissivemap,_n.fog,_n.lights,{emissive:{value:new mt(0)}}]),vertexShader:xn.meshlambert_vert,fragmentShader:xn.meshlambert_frag},phong:{uniforms:tn([_n.common,_n.specularmap,_n.envmap,_n.aomap,_n.lightmap,_n.emissivemap,_n.bumpmap,_n.normalmap,_n.displacementmap,_n.fog,_n.lights,{emissive:{value:new mt(0)},specular:{value:new mt(1118481)},shininess:{value:30}}]),vertexShader:xn.meshphong_vert,fragmentShader:xn.meshphong_frag},standard:{uniforms:tn([_n.common,_n.envmap,_n.aomap,_n.lightmap,_n.emissivemap,_n.bumpmap,_n.normalmap,_n.displacementmap,_n.roughnessmap,_n.metalnessmap,_n.fog,_n.lights,{emissive:{value:new mt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:xn.meshphysical_vert,fragmentShader:xn.meshphysical_frag},toon:{uniforms:tn([_n.common,_n.aomap,_n.lightmap,_n.emissivemap,_n.bumpmap,_n.normalmap,_n.displacementmap,_n.gradientmap,_n.fog,_n.lights,{emissive:{value:new mt(0)}}]),vertexShader:xn.meshtoon_vert,fragmentShader:xn.meshtoon_frag},matcap:{uniforms:tn([_n.common,_n.bumpmap,_n.normalmap,_n.displacementmap,_n.fog,{matcap:{value:null}}]),vertexShader:xn.meshmatcap_vert,fragmentShader:xn.meshmatcap_frag},points:{uniforms:tn([_n.points,_n.fog]),vertexShader:xn.points_vert,fragmentShader:xn.points_frag},dashed:{uniforms:tn([_n.common,_n.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:xn.linedashed_vert,fragmentShader:xn.linedashed_frag},depth:{uniforms:tn([_n.common,_n.displacementmap]),vertexShader:xn.depth_vert,fragmentShader:xn.depth_frag},normal:{uniforms:tn([_n.common,_n.bumpmap,_n.normalmap,_n.displacementmap,{opacity:{value:1}}]),vertexShader:xn.normal_vert,fragmentShader:xn.normal_frag},sprite:{uniforms:tn([_n.sprite,_n.fog]),vertexShader:xn.sprite_vert,fragmentShader:xn.sprite_frag},background:{uniforms:{uvTransform:{value:new U},t2D:{value:null}},vertexShader:xn.background_vert,fragmentShader:xn.background_frag},cube:{uniforms:tn([_n.envmap,{opacity:{value:1}}]),vertexShader:xn.cube_vert,fragmentShader:xn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:xn.equirect_vert,fragmentShader:xn.equirect_frag},distanceRGBA:{uniforms:tn([_n.common,_n.displacementmap,{referencePosition:{value:new Q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:xn.distanceRGBA_vert,fragmentShader:xn.distanceRGBA_frag},shadow:{uniforms:tn([_n.lights,_n.fog,{color:{value:new mt(0)},opacity:{value:1}}]),vertexShader:xn.shadow_vert,fragmentShader:xn.shadow_frag}};function Tn(e,t,n,r,i){var o,a,s=new mt(0),u=0,l=null,c=0,h=null;function d(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;s.set(e),d(s,u=t)},getClearAlpha:function(){return u},setClearAlpha:function(e){d(s,u=e)},render:function(n,i){var f=!1,p=!0===i.isScene?i.background:null;p&&p.isTexture&&(p=t.get(p));var v=e.xr,m=v.getSession&&v.getSession();m&&"additive"===m.environmentBlendMode&&(p=null),null===p?d(s,u):p&&p.isColor&&(d(p,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),p&&(p.isCubeTexture||306===p.mapping)?(void 0===a&&((a=new Jt(new $t(1,1,1),new rn({name:"BackgroundCubeMaterial",uniforms:en(wn.cube.uniforms),vertexShader:wn.cube.vertexShader,fragmentShader:wn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(a)),a.material.uniforms.envMap.value=p,a.material.uniforms.flipEnvMap.value=p.isCubeTexture&&p._needsFlipEnvMap?-1:1,l===p&&c===p.version&&h===e.toneMapping||(a.material.needsUpdate=!0,l=p,c=p.version,h=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):p&&p.isTexture&&(void 0===o&&((o=new Jt(new bn(2,2),new rn({name:"BackgroundMaterial",uniforms:en(wn.background.uniforms),vertexShader:wn.background.vertexShader,fragmentShader:wn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=p,!0===p.matrixAutoUpdate&&p.updateMatrix(),o.material.uniforms.uvTransform.value.copy(p.matrix),l===p&&c===p.version&&h===e.toneMapping||(o.material.needsUpdate=!0,l=p,c=p.version,h=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function Mn(e,t,n,r){var i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},u=d(null),l=u;function c(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function h(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function d(e){for(var t=[],n=[],r=[],o=0;o=0){var y=u[h];if(void 0!==y){var b=y.normalized,x=y.itemSize,_=n.get(y);if(void 0===_)continue;var w=_.buffer,T=_.type,M=_.bytesPerElement;if(y.isInterleavedBufferAttribute){var S=y.data,E=S.stride,A=y.offset;S&&S.isInstancedInterleavedBuffer?(v(d,S.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=S.meshPerAttribute*S.count)):p(d),e.bindBuffer(34962,w),g(d,x,T,b,E*M,A*M)}else y.isInstancedBufferAttribute?(v(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):p(d),e.bindBuffer(34962,w),g(d,x,T,b,0,0)}else if("instanceMatrix"===h){var I=n.get(i.instanceMatrix);if(void 0===I)continue;var C=I.buffer,N=I.type;v(d+0,1),v(d+1,1),v(d+2,1),v(d+3,1),e.bindBuffer(34962,C),e.vertexAttribPointer(d+0,4,N,!1,64,0),e.vertexAttribPointer(d+1,4,N,!1,64,16),e.vertexAttribPointer(d+2,4,N,!1,64,32),e.vertexAttribPointer(d+3,4,N,!1,64,48)}else if("instanceColor"===h){var k=n.get(i.instanceColor);if(void 0===k)continue;var D=k.buffer,P=k.type;v(d,1),e.bindBuffer(34962,D),e.vertexAttribPointer(d,3,P,!1,12,0)}else if(void 0!==c){var O=c[h];if(void 0!==O)switch(O.length){case 2:e.vertexAttrib2fv(d,O);break;case 3:e.vertexAttrib3fv(d,O);break;case 4:e.vertexAttrib4fv(d,O);break;default:e.vertexAttrib1fv(d,O)}}}}m()}}(i,u,h,y),null!==b&&e.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){for(var e in y(),s){var t=s[e];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var n=s[t];if(void 0!==n[e.id]){var r=n[e.id];for(var i in r)h(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:m}}function Sn(e,t,n,r){var i,o=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function(r,a,s){if(0!==s){var u,l;if(o)u=e,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[l](i,r,a,s),n.update(a,i,s)}}}function En(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=o||t.has("WEBGL_draw_buffers"),l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),h=e.getParameter(35660),d=e.getParameter(3379),f=e.getParameter(34076),p=e.getParameter(34921),v=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),y=h>0,b=o||t.has("OES_texture_float");return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){var n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:v,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:y,floatFragmentTextures:b,floatVertexTextures:y&&b,maxSamples:o?e.getParameter(36183):0}}function An(e){var t=this,n=null,r=0,i=!1,o=!1,a=new fn,s=new U,u={value:null,needsUpdate:!1};function l(){u.value!==n&&(u.value=n,u.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function c(e,n,r,i){var o=null!==e?e.length:0,l=null;if(0!==o){if(l=u.value,!0!==i||null===l){var c=r+4*o,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===l||l.length0){var s=e.getRenderTarget(),u=new ln(a.height/2);return u.fromEquirectangularTexture(e,i),t.set(i,u),e.setRenderTarget(s),i.addEventListener("dispose",r),n(u.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function Cn(e){var t={};function n(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(e){var t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Nn(e,t,n,r){var i={},o=new WeakMap;function a(e){var s=e.target;for(var u in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[u]);s.removeEventListener("dispose",a),delete i[s.id];var l=o.get(s);l&&(t.remove(l),o.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){var n=[],r=e.index,i=e.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var u=0,l=s.length;u65535?Tt:_t)(n,1);b.version=a;var x=o.get(e);x&&t.remove(x),o.set(e,b)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(e){var n=e.attributes;for(var r in n)t.update(n[r],34962);var i=e.morphAttributes;for(var o in i)for(var a=i[o],s=0,u=a.length;s0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return _(this,n),(e=t.call(this,null)).image={data:r,width:i,height:o,depth:a},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return n}(G);jn.prototype.isDataTexture2DArray=!0;var Bn=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return _(this,n),(e=t.call(this,null)).image={data:r,width:i,height:o,depth:a},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return n}(G);Bn.prototype.isDataTexture3D=!0;var Un=new G,Fn=new jn,zn=new Bn,Gn=new un,Hn=[],Vn=[],Wn=new Float32Array(16),Yn=new Float32Array(9),Xn=new Float32Array(4);function Qn(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,o=Hn[i];if(void 0===o&&(o=new Float32Array(i),Hn[i]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}function Zn(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n/gm;function Kr(e){return e.replace(Jr,$r)}function $r(e,t){var n=xn[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Kr(n)}var ei=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ti=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ni(e){return e.replace(ti,ii).replace(ei,ri)}function ri(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ii(e,t,n,r)}function ii(e,t,n,r){for(var i="",o=parseInt(t);o0?e.gammaFactor:1,v=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission>0)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Qr).join("\n")}(n),m=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),g=a.createProgram(),y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=[m].filter(Qr).join("\n")).length>0&&(i+="\n"),(o=[v,m].filter(Qr).join("\n")).length>0&&(o+="\n")):(i=[oi(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Qr).join("\n"),o=[v,oi(n),"#define SHADER_NAME "+n.shaderName,m,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?xn.tonemapping_pars_fragment:"",0!==n.toneMapping?Xr("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",xn.encodings_pars_fragment,n.map?Wr("mapTexelToLinear",n.mapEncoding):"",n.matcap?Wr("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Wr("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Wr("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Wr("lightMapTexelToLinear",n.lightMapEncoding):"",Yr("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Qr).join("\n")),u=qr(u=Zr(u=Kr(u),n),n),l=qr(l=Zr(l=Kr(l),n),n),u=ni(u),l=ni(l),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,o=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var b,x,_=y+o+l,w=zr(a,35633,y+i+u),T=zr(a,35632,_);if(a.attachShader(g,w),a.attachShader(g,T),void 0!==n.index0AttributeName?a.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(g,0,"position"),a.linkProgram(g),e.debug.checkShaderErrors){var M=a.getProgramInfoLog(g).trim(),S=a.getShaderInfoLog(w).trim(),E=a.getShaderInfoLog(T).trim(),A=!0,I=!0;if(!1===a.getProgramParameter(g,35714)){A=!1;var C=Vr(a,w,"vertex"),N=Vr(a,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(g,35715),"gl.getProgramInfoLog",M,C,N)}else""!==M?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",M):""!==S&&""!==E||(I=!1);I&&(this.diagnostics={runnable:A,programLog:M,vertexShader:{log:S,prefix:i},fragmentShader:{log:E,prefix:o}})}return a.deleteShader(w),a.deleteShader(T),this.getUniforms=function(){return void 0===b&&(b=new Fr(a,g)),b},this.getAttributes=function(){return void 0===x&&(x=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i0,maxBones:M,useVertexTexture:l,morphTargets:i.morphTargets,morphNormals:i.morphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(!1===t.isRawShaderMaterial){for(var i=0;i0?i.push(c):!0===n.transparent?o.push(c):r.push(c)},unshift:function(e,t,n,a,u,l){var c=s(e,t,n,a,u,l);n.transmission>0?i.unshift(c):!0===n.transparent?o.unshift(c):r.unshift(c)},finish:function(){for(var e=n,r=t.length;e1&&r.sort(e||li),i.length>1&&i.sort(t||ci),o.length>1&&o.sort(t||ci)}}}function di(e){var t=new WeakMap;return{get:function(n,r){var i;return!1===t.has(n)?(i=new hi(e),t.set(n,[i])):r>=t.get(n).length?(i=new hi(e),t.get(n).push(i)):i=t.get(n)[r],i},dispose:function(){t=new WeakMap}}}function fi(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Q,color:new mt};break;case"SpotLight":n={position:new Q,direction:new Q,color:new mt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Q,color:new mt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Q,skyColor:new mt,groundColor:new mt};break;case"RectAreaLight":n={color:new mt,position:new Q,halfWidth:new Q,halfHeight:new Q}}return e[t.id]=n,n}}}var pi=0;function vi(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function mi(e,t){for(var n=new fi,r=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)i.probe.push(new Q);var a=new Q,s=new Se,u=new Se;return{setup:function(o){for(var a=0,s=0,u=0,l=0;l<9;l++)i.probe[l].set(0,0,0);var c=0,h=0,d=0,f=0,p=0,v=0,m=0,g=0;o.sort(vi);for(var y=0,b=o.length;y0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=_n.LTC_FLOAT_1,i.rectAreaLTC2=_n.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=_n.LTC_HALF_1,i.rectAreaLTC2=_n.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=u;var j=i.hash;j.directionalLength===c&&j.pointLength===h&&j.spotLength===d&&j.rectAreaLength===f&&j.hemiLength===p&&j.numDirectionalShadows===v&&j.numPointShadows===m&&j.numSpotShadows===g||(i.directional.length=c,i.spot.length=d,i.rectArea.length=f,i.point.length=h,i.hemi.length=p,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,j.directionalLength=c,j.pointLength=h,j.spotLength=d,j.rectAreaLength=f,j.hemiLength=p,j.numDirectionalShadows=v,j.numPointShadows=m,j.numSpotShadows=g,i.version=pi++)},setupView:function(e,t){for(var n=0,r=0,o=0,l=0,c=0,h=t.matrixWorldInverse,d=0,f=e.length;d1&&void 0!==arguments[1]?arguments[1]:0;return!1===n.has(r)?(i=new gi(e,t),n.set(r,[i])):o>=n.get(r).length?(i=new gi(e,t),n.get(r).push(i)):i=n.get(r)[o],i},dispose:function(){n=new WeakMap}}}var bi=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).type="MeshDepthMaterial",r.depthPacking=3200,r.morphTargets=!1,r.map=null,r.alphaMap=null,r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.wireframe=!1,r.wireframeLinewidth=1,r.fog=!1,r.setValues(e),r}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.depthPacking=e.depthPacking,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}]),n}(lt);bi.prototype.isMeshDepthMaterial=!0;var xi=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).type="MeshDistanceMaterial",r.referencePosition=new Q,r.nearDistance=1,r.farDistance=1e3,r.morphTargets=!1,r.map=null,r.alphaMap=null,r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.fog=!1,r.setValues(e),r}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}]),n}(lt);function _i(e,t,n){var r=new mn,i=new j,o=new j,a=new V,s=[],u=[],l={},c=n.maxTextureSize,h={0:1,1:0,2:2},d=new rn({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new j},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;var p=new Pt;p.setAttribute("position",new xt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var v=new Jt(p,d),m=this;function g(n,r){var i=t.update(v);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,d,v,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,f,v,null)}function y(e){var t=e<<0,n=s[t];return void 0===n&&(n=new bi({depthPacking:3201,morphTargets:e}),s[t]=n),n}function b(e){var t=e<<0,n=u[t];return void 0===n&&(n=new xi({morphTargets:e}),u[t]=n),n}function x(t,n,r,i,o,a,s){var u=null,c=y,d=t.customDepthMaterial;if(!0===i.isPointLight&&(c=b,d=t.customDistanceMaterial),void 0===d){var f=!1;!0===r.morphTargets&&(f=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0),u=c(f)}else u=d;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var p=u.uuid,v=r.uuid,m=l[p];void 0===m&&(m={},l[p]=m);var g=m[v];void 0===g&&(g=u.clone(),m[v]=g),u=g}return u.visible=r.visible,u.wireframe=r.wireframe,u.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:h[r.side],u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function _(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var u=t.update(n),l=n.material;if(Array.isArray(l))for(var c=u.groups,h=0,d=c.length;hc||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/b.x),i.x=o.x*b.x,y.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/b.y),i.y=o.y*b.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var x={minFilter:1006,magFilter:1006,format:1023};y.map=new W(i.x,i.y,x),y.map.texture.name=v.name+".shadowMap",y.mapPass=new W(i.x,i.y,x),y.camera.updateProjectionMatrix()}if(null===y.map){y.map=new W(i.x,i.y,{minFilter:1003,magFilter:1003,format:1023}),y.map.texture.name=v.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var w=y.getViewportCount(),T=0;T=1):-1!==I.indexOf("OpenGL ES")&&(A=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),E=A>=2);var C=null,N={},k=e.getParameter(3088),D=e.getParameter(2978),P=(new V).fromArray(k),O=(new V).fromArray(D);function R(t,n,r){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var a=0;ar||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var o=t?L:Math.floor,a=o(i*e.width),u=o(i*e.height);void 0===s&&(s=v(a,u));var l=n?v(a,u):s;return l.width=a,l.height=u,l.getContext("2d").drawImage(e,0,0,a,u),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+u+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function g(e){return O(e.width)&&O(e.height)}function y(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function b(t,n,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log2(Math.max(i,o,a))}function x(n,r,i){if(!1===u)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function _(e){return 1003===e||1004===e||1005===e?9728:9729}function w(t){var n,i,o=t.target;o.removeEventListener("dispose",w),n=o,void 0!==(i=r.get(n)).__webglInit&&(e.deleteTexture(i.__webglTexture),r.remove(n)),o.isVideoTexture&&f.delete(o),a.memory.textures--}function T(t){var n=t.target;n.removeEventListener("dispose",T),function(t){var n=t.texture,i=r.get(t),o=r.get(n);if(t){if(void 0!==o.__webglTexture&&(e.deleteTexture(o.__webglTexture),a.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var s=0;s<6;s++)e.deleteFramebuffer(i.__webglFramebuffer[s]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[s]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(var u=0,l=n.length;u0&&s.__version!==e.version){var u=e.image;if(void 0===u)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==u.complete)return void k(s,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,s.__webglTexture)}function E(t,i){var a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6===r.image.length){N(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);for(var a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),s=r.image[0]&&r.image[0].isDataTexture,l=[],h=0;h<6;h++)l[h]=a||s?s?r.image[h].image:r.image[h]:m(r.image[h],!1,!0,c);var d,f=l[0],p=g(f)||u,v=o.convert(r.format),_=o.convert(r.type),w=x(r.internalFormat,v,_);if(C(34067,r,p),a){for(var T=0;T<6;T++){d=l[T].mipmaps;for(var M=0;M1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function N(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),a.memory.textures++)}function k(t,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),N(t,r),n.activeTexture(33984+i),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);var s,l=function(e){return!u&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(r)&&!1===g(r.image),c=m(r.image,l,!1,h),d=g(c)||u,f=o.convert(r.format),p=o.convert(r.type),v=x(r.internalFormat,f,p);C(a,r,d);var _=r.mipmaps;if(r.isDepthTexture)v=6402,u?v=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===v&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,p=o.convert(r.type)),1027===r.format&&6402===v&&(v=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,p=o.convert(r.type))),n.texImage2D(3553,0,v,c.width,c.height,0,f,p,null);else if(r.isDataTexture)if(_.length>0&&d){for(var w=0,T=_.length;w0&&d){for(var E=0,A=_.length;E=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),M+=1,e},this.resetTextureUnits=function(){M=0},this.setTexture2D=S,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(t){var s=t.texture,l=r.get(t),c=r.get(s);t.addEventListener("dispose",T),!0!==t.isWebGLMultipleRenderTargets&&(c.__webglTexture=e.createTexture(),c.__version=s.version,a.memory.textures++);var h=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,f=!0===t.isWebGLMultisampleRenderTarget,p=s.isDataTexture3D||s.isDataTexture2DArray,v=g(t)||u;if(!u||1022!==s.format||1015!==s.type&&1016!==s.type||(s.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),h){l.__webglFramebuffer=[];for(var m=0;m<6;m++)l.__webglFramebuffer[m]=e.createFramebuffer()}else if(l.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers)for(var _=t.texture,w=0,M=_.length;w0&&void 0!==arguments[0]?arguments[0]:[];return _(this,n),(e=t.call(this)).cameras=r,e}return n}(an);Si.prototype.isArrayCamera=!0;var Ei=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="Group",e}return n}(qe);Ei.prototype.isGroup=!0;var Ai={type:"move"},Ii=function(){function e(){_(this,e),this._targetRay=null,this._grip=null,this._hand=null}return T(e,[{key:"getHandSpace",value:function(){return null===this._hand&&(this._hand=new Ei,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}},{key:"getTargetRaySpace",value:function(){return null===this._targetRay&&(this._targetRay=new Ei,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Q),this._targetRay}},{key:"getGripSpace",value:function(){return null===this._grip&&(this._grip=new Ei,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Q),this._grip}},{key:"dispatchEvent",value:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}},{key:"disconnect",value:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}},{key:"update",value:function(e,t,n){var r=null,i=null,o=null,a=this._targetRay,s=this._grip,u=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==a&&(null!==(r=t.getPose(e.targetRaySpace,n))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Ai))),u&&e.hand){o=!0;var l,c=S(e.hand.values());try{for(c.s();!(l=c.n()).done;){var h=l.value,d=t.getJointPose(h,n);if(void 0===u.joints[h.jointName]){var f=new Ei;f.matrixAutoUpdate=!1,f.visible=!1,u.joints[h.jointName]=f,u.add(f)}var p=u.joints[h.jointName];null!==d&&(p.matrix.fromArray(d.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=d.radius),p.visible=null!==d}}catch(e){c.e(e)}finally{c.f()}var v=u.joints["index-finger-tip"],m=u.joints["thumb-tip"],g=v.position.distanceTo(m.position);u.inputState.pinching&&g>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&g<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==u&&(u.visible=null!==o),this}}]),e}(),Ci=function(e){p(n,e);var t=m(n);function n(e,r){var i;_(this,n);var o=y(i=t.call(this)),a=e.state,s=null,u=1,c=null,h="local-floor",d=null,f=null,p=null,v=null,m=[],g=new Map,b=new an;b.layers.enable(1),b.viewport=new V;var x=new an;x.layers.enable(2),x.viewport=new V;var w=[b,x],T=new Si;T.layers.enable(1),T.layers.enable(2);var M=null,S=null;function E(e){var t=g.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function A(){g.forEach((function(e,t){e.disconnect(t)})),g.clear(),M=null,S=null,a.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),P.stop(),o.isPresenting=!1,o.dispatchEvent({type:"sessionend"})}function I(e){for(var t=s.inputSources,n=0;n0&&(e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)}(e,r,a):n(e,r)):r.isMeshMatcapMaterial?(t(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDepthMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDistanceMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?(t(e,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){var i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,o):r.isSpriteMaterial?function(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ki(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=void 0!==e.canvas?e.canvas:function(){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,u=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,d=null,f=[],p=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;var v=this,m=!1,g=0,y=0,b=null,x=-1,_=null,w=new V,T=new V,M=null,S=t.width,E=t.height,A=1,I=null,C=null,N=new V(0,0,S,E),k=new V(0,0,S,E),D=!1,P=[],O=new mn,R=!1,L=!1,j=null,B=new Se,U=new Q,F={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function z(){return null===b?A:1}var G,H,X,Z,q,J,K,$,ee,te,ne,re,ie,oe,ae,se,ue,le,ce,he,de,fe,pe=n;function ve(e,n){for(var r=0;r0&&Ie(r,e,t),i.length>0&&function(e,t,n,r){if(null===j){var i=!0===a&&!0===H.isWebGL2;j=new(i?Y:W)(1024,1024,{generateMipmaps:!0,type:null!==de.convert(1016)?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001})}var o=v.getRenderTarget();v.setRenderTarget(j),v.clear();var s=v.toneMapping;v.toneMapping=0,Ie(e,n,r),v.toneMapping=s,J.updateMultisampleRenderTarget(j),J.updateRenderTargetMipmap(j),v.setRenderTarget(o),Ie(t,n,r)}(r,i,e,t),o.length>0&&Ie(o,e,t),null!==b&&(J.updateMultisampleRenderTarget(b),J.updateRenderTargetMipmap(b)),!0===e.isScene&&e.onAfterRender(v,e,t),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),fe.resetDefaultState(),x=-1,_=null,p.pop(),d=p.length>0?p[p.length-1]:null,f.pop(),h=f.length>0?f[f.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return b},this.setRenderTarget=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;b=e,g=t,y=n,e&&void 0===q.get(e).__webglFramebuffer&&J.setupRenderTarget(e);var r=null,i=!1,o=!1;if(e){var a=e.texture;(a.isDataTexture3D||a.isDataTexture2DArray)&&(o=!0);var s=q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=s[t],i=!0):r=e.isWebGLMultisampleRenderTarget?q.get(e).__webglMultisampledFramebuffer:s,w.copy(e.viewport),T.copy(e.scissor),M=e.scissorTest}else w.copy(N).multiplyScalar(A).floor(),T.copy(k).multiplyScalar(A).floor(),M=D;if(X.bindFramebuffer(36160,r)&&H.drawBuffers){var u=!1;if(e)if(e.isWebGLMultipleRenderTargets){var l=e.texture;if(P.length!==l.length||36064!==P[0]){for(var c=0,h=l.length;c=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&pe.readPixels(t,n,r,i,de.convert(l),de.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{var d=null!==b?q.get(b).__webglFramebuffer:null;X.bindFramebuffer(36160,d)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r),a=de.convert(t.format);H.isWebGL2&&(6407===a&&(a=32849),6408===a&&(a=32856)),J.setTexture2D(t,0),pe.copyTexImage2D(3553,n,a,e.x,e.y,i,o,0),X.unbindTexture()},this.copyTextureToTexture=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.image.width,o=t.image.height,a=de.convert(n.format),s=de.convert(n.type);J.setTexture2D(n,0),pe.pixelStorei(37440,n.flipY),pe.pixelStorei(37441,n.premultiplyAlpha),pe.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?pe.texSubImage2D(3553,r,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?pe.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):pe.texSubImage2D(3553,r,e.x,e.y,a,s,t.image),0===r&&n.generateMipmaps&&pe.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(v.isWebGL1Renderer)console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");else{var o,a=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,u=e.max.z-e.min.z+1,l=de.convert(r.format),c=de.convert(r.type);if(r.isDataTexture3D)J.setTexture3D(r,0),o=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");J.setTexture2DArray(r,0),o=35866}pe.pixelStorei(37440,r.flipY),pe.pixelStorei(37441,r.premultiplyAlpha),pe.pixelStorei(3317,r.unpackAlignment);var h=pe.getParameter(3314),d=pe.getParameter(32878),f=pe.getParameter(3316),p=pe.getParameter(3315),m=pe.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;pe.pixelStorei(3314,g.width),pe.pixelStorei(32878,g.height),pe.pixelStorei(3316,e.min.x),pe.pixelStorei(3315,e.min.y),pe.pixelStorei(32877,e.min.z),n.isDataTexture||n.isDataTexture3D?pe.texSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,c,g.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),pe.compressedTexSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,g.data)):pe.texSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,c,g),pe.pixelStorei(3314,h),pe.pixelStorei(32878,d),pe.pixelStorei(3316,f),pe.pixelStorei(3315,p),pe.pixelStorei(32877,m),0===i&&r.generateMipmaps&&pe.generateMipmap(o),X.unbindTexture()}},this.initTexture=function(e){J.setTexture2D(e,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,b=null,X.reset(),fe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n})(ki).prototype.isWebGL1Renderer=!0;var Di=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:y(e)})),e}return T(n,[{key:"copy",value:function(e,t){return f(x(n.prototype),"copy",this).call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}]),n}(qe);Di.prototype.isScene=!0;var Pi=function(){function e(t,n){_(this,e),this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=k()}return T(e,[{key:"onUploadCallback",value:function(){}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"clone",value:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=k()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"toJSON",value:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=k()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();Pi.prototype.isInterleavedBuffer=!0;var Oi=new Q,Ri=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_(this,e),this.name="",this.data=t,this.itemSize=n,this.offset=r,this.normalized=!0===i}return T(e,[{key:"applyMatrix4",value:function(e){for(var t=0,n=this.data.count;te.far||t.push({distance:s,point:Bi.clone(),uv:st.getUV(Bi,Vi,Wi,Yi,Xi,Qi,Zi,new j),face:null,object:this})}}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}]),n}(qe);function Ji(e,t,n,r,i,o){zi.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(Gi.x=o*zi.x-i*zi.y,Gi.y=i*zi.x+o*zi.y):Gi.copy(zi),e.copy(t),e.x+=Gi.x,e.y+=Gi.y,e.applyMatrix4(Hi)}qi.prototype.isSprite=!0;var Ki=new Q,$i=new V,eo=new V,to=new Q,no=new Se,ro=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).type="SkinnedMesh",i.bindMode="attached",i.bindMatrix=new Se,i.bindMatrixInverse=new Se,i}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}},{key:"bind",value:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}},{key:"pose",value:function(){this.skeleton.pose()}},{key:"normalizeSkinWeights",value:function(){for(var e=new V,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1003,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1003,f=arguments.length>10?arguments[10]:void 0,p=arguments.length>11?arguments[11]:void 0;return _(this,n),(e=t.call(this,null,u,l,c,h,d,a,s,f,p)).image={data:r,width:i,height:o},e.magFilter=h,e.minFilter=d,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return n}(G);io.prototype.isDataTexture=!0;var oo=new Se,ao=new Se,so=[],uo=new Jt,lo=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,e,r)).instanceMatrix=new xt(new Float32Array(16*i),16),o.instanceColor=null,o.count=i,o.frustumCulled=!1,o}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}},{key:"getColorAt",value:function(e,t){t.fromArray(this.instanceColor.array,3*e)}},{key:"getMatrixAt",value:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)}},{key:"raycast",value:function(e,t){var n=this.matrixWorld,r=this.count;if(uo.geometry=this.geometry,uo.material=this.material,void 0!==uo.material)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new Pt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new co;return _(this,n),(e=t.call(this)).type="Line",e.geometry=r,e.material=i,e.updateMorphTargets(),e}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;rs)){h.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(h);be.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(var x=Math.max(0,o.start),_=Math.min(p.count,o.start+o.count)-1;x<_;x+=d)if(u.fromBufferAttribute(p,x),l.fromBufferAttribute(p,x+1),!(vo.distanceSqToSegment(u,l,h,c)>s)){h.applyMatrix4(this.matrixWorld);var w=e.ray.origin.distanceTo(h);we.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),n}(qe);go.prototype.isLine=!0;var yo=new Q,bo=new Q,xo=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).type="LineSegments",i}return T(n,[{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r0&&void 0!==arguments[0]?arguments[0]:new Pt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wo;return _(this,n),(e=t.call(this)).type="Points",e.geometry=r,e.material=i,e.updateMorphTargets(),e}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"raycast",value:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),So.copy(n.boundingSphere),So.applyMatrix4(r),So.radius+=i,!1!==e.ray.intersectsSphere(So)){To.copy(r).invert(),Mo.copy(e.ray).applyMatrix4(To);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a;if(n.isBufferGeometry){var u=n.index,l=n.attributes.position;if(null!==u)for(var c=Math.max(0,o.start),h=Math.min(u.count,o.start+o.count);c0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),n}(qe);function Io(e,t,n,r,i,o,a){var s=Mo.distanceSqToPoint(e);if(si.far)return;o.push({distance:l,distanceToRay:Math.sqrt(s),point:u,index:t,face:null,object:a})}}Ao.prototype.isPoints=!0,function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c){var h;_(this,n),(h=t.call(this,e,r,i,o,a,s,u,l,c)).format=void 0!==u?u:1022,h.minFilter=void 0!==s?s:1006,h.magFilter=void 0!==a?a:1006,h.generateMipmaps=!1;var d=y(h);return"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){d.needsUpdate=!0,e.requestVideoFrameCallback(t)})),h}return T(n,[{key:"clone",value:function(){return new this.constructor(this.image).copy(this)}},{key:"update",value:function(){var e=this.image;"requestVideoFrameCallback"in e==!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}]),n}(G).prototype.isVideoTexture=!0;var Co=function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c,h,d,f){var p;return _(this,n),(p=t.call(this,null,s,u,l,c,h,o,a,d,f)).image={width:r,height:i},p.mipmaps=e,p.flipY=!1,p.generateMipmaps=!1,p}return n}(G);Co.prototype.isCompressedTexture=!0,function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c){var h;return _(this,n),(h=t.call(this,e,r,i,o,a,s,u,l,c)).needsUpdate=!0,h}return n}(G).prototype.isCanvasTexture=!0,function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c,h){var d;if(_(this,n),1026!==(h=void 0!==h?h:1026)&&1027!==h)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),(d=t.call(this,null,o,a,s,u,l,h,i,c)).image={width:e,height:r},d.magFilter=void 0!==u?u:1003,d.minFilter=void 0!==l?l:1003,d.flipY=!1,d.generateMipmaps=!1,d}return n}(G).prototype.isDepthTexture=!0,new Q,new Q,new Q,new st;var No=function(){function e(){_(this,e),this.type="Curve",this.arcLengthDivisions=200}return T(e,[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=e;o++)i+=(t=this.getPoint(o/e)).distanceTo(r),n.push(i),r=t;return this.cacheArcLengths=n,n}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=r[i=Math.floor(s+(u-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(r[i=u]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)}},{key:"getTangent",value:function(e,t){var n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),o=this.getPoint(r),a=t||(i.isVector2?new j:new Q);return a.copy(o).sub(i).normalize(),a}},{key:"getTangentAt",value:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)}},{key:"computeFrenetFrames",value:function(e,t){for(var n=new Q,r=[],i=[],o=[],a=new Q,s=new Se,u=0;u<=e;u++){var l=u/e;r[u]=this.getTangentAt(l,new Q),r[u].normalize()}i[0]=new Q,o[0]=new Q;var c=Number.MAX_VALUE,h=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);h<=c&&(c=h,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),f<=c&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(var p=1;p<=e;p++){if(i[p]=i[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();var v=Math.acos(D(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(a,v))}o[p].crossVectors(r[p],i[p])}if(!0===t){var m=Math.acos(D(i[0].dot(i[e]),-1,1));m/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(m=-m);for(var g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],m*g)),o[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:o}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}]),e}(),ko=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return _(this,n),(e=t.call(this)).type="EllipseCurve",e.aX=r,e.aY=i,e.xRadius=o,e.yRadius=a,e.aStartAngle=s,e.aEndAngle=u,e.aClockwise=l,e.aRotation=c,e}return T(n,[{key:"getPoint",value:function(e,t){for(var n=t||new j,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)r;)i-=r;i0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return _(this,n),(e=t.call(this)).type="CatmullRomCurve3",e.points=r,e.closed=i,e.curveType=o,e.tension=a,e}return T(n,[{key:"getPoint",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,i=r,o=this.points,a=o.length,s=(a-(this.closed?0:1))*e,u=Math.floor(s),l=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/a)+1)*a:0===l&&u===a-1&&(u=a-2,l=1),this.closed||u>0?t=o[(u-1)%a]:(Oo.subVectors(o[0],o[1]).add(o[0]),t=Oo);var c=o[u%a],h=o[(u+1)%a];if(this.closed||u+20&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new j,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new j;return _(this,n),(e=t.call(this)).type="CubicBezierCurve",e.v0=r,e.v1=i,e.v2=o,e.v3=a,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,n=t,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(zo(e,r.x,i.x,o.x,a.x),zo(e,r.y,i.y,o.y,a.y)),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),n}(No);Go.prototype.isCubicBezierCurve=!0;var Ho=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Q,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Q;return _(this,n),(e=t.call(this)).type="CubicBezierCurve3",e.v0=r,e.v1=i,e.v2=o,e.v3=a,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,n=t,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(zo(e,r.x,i.x,o.x,a.x),zo(e,r.y,i.y,o.y,a.y),zo(e,r.z,i.z,o.z,a.z)),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),n}(No);Ho.prototype.isCubicBezierCurve3=!0;var Vo=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j;return _(this,n),(e=t.call(this)).type="LineCurve",e.v1=r,e.v2=i,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e,t){var n=t||new j;return n.copy(this.v2).sub(this.v1).normalize(),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),n}(No);Vo.prototype.isLineCurve=!0;var Wo=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new j;return _(this,n),(e=t.call(this)).type="QuadraticBezierCurve",e.v0=r,e.v1=i,e.v2=o,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,n=t,r=this.v0,i=this.v1,o=this.v2;return n.set(Fo(e,r.x,i.x,o.x),Fo(e,r.y,i.y,o.y)),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),n}(No);Wo.prototype.isQuadraticBezierCurve=!0;var Yo=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Q;return _(this,n),(e=t.call(this)).type="QuadraticBezierCurve3",e.v0=r,e.v1=i,e.v2=o,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,n=t,r=this.v0,i=this.v1,o=this.v2;return n.set(Fo(e,r.x,i.x,o.x),Fo(e,r.y,i.y,o.y),Fo(e,r.z,i.z,o.z)),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),n}(No);Yo.prototype.isQuadraticBezierCurve3=!0;var Xo=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return _(this,n),(e=t.call(this)).type="SplineCurve",e.points=r,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,n=t,r=this.points,i=(r.length-1)*e,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],u=r[o],l=r[o>r.length-2?r.length-1:o+1],c=r[o>r.length-3?r.length-1:o+2];return n.set(Uo(a,s.x,u.x,l.x,c.x),Uo(a,s.y,u.y,l.y,c.y)),n}},{key:"copy",value:function(e){f(x(n.prototype),"copy",this).call(this,e),this.points=[];for(var t=0,r=e.points.length;t0&&void 0!==arguments[0]?arguments[0]:new Q,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q;return _(this,n),(e=t.call(this)).type="LineCurve3",e.isLineCurve3=!0,e.v1=r,e.v2=i,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),n}(No),QuadraticBezierCurve:Wo,QuadraticBezierCurve3:Yo,SplineCurve:Xo});function Zo(e,t,n,r,i){var o,a;if(i===function(e,t,n,r){for(var i=0,o=t,a=n-r;o0)for(o=t;o=t;o-=r)a=ma(o,e[o],e[o+1],a);return a&&ca(a,a.next)&&(ga(a),a=a.next),a}function qo(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!ca(r,r.next)&&0!==la(r.prev,r,r.next))r=r.next;else{if(ga(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Jo(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=oa(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,u,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,o);for(var s,u,l=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?$o(e,r,i,o):Ko(e))t.push(s.i/n),t.push(e.i/n),t.push(u.i/n),ga(e),e=u.next,l=u.next;else if((e=u)===l){a?1===a?Jo(e=ea(qo(e),t,n),t,n,r,i,o,2):2===a&&ta(e,t,n,r,i,o):Jo(qo(e),t,n,r,i,o,1);break}}}function Ko(e){var t=e.prev,n=e,r=e.next;if(la(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(sa(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&la(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function $o(e,t,n,r){var i=e.prev,o=e,a=e.next;if(la(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=oa(s,u,t,n,r),d=oa(l,c,t,n,r),f=e.prevZ,p=e.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&la(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&la(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&la(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&la(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ea(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!ca(i,o)&&ha(i,r,r.next,o)&&pa(i,o)&&pa(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),ga(r),ga(r.next),r=e=o),r=r.next}while(r!==e);return qo(r)}function ta(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ua(a,s)){var u=va(a,s);return a=qo(a,a.next),u=qo(u,u.next),Jo(a,t,n,r,i,o),void Jo(u,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function na(e,t){return e.x-t.x}function ra(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=c&&i!==r.x&&sa(on.x||r.x===n.x&&ia(n,r)))&&(n=r,d=u)),r=r.next}while(r!==l);return n}(e,t)){var n=va(t,e);qo(t,t.next),qo(n,n.next)}}function ia(e,t){return la(e.prev,e,t.prev)<0&&la(t.next,e,e.next)<0}function oa(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function aa(e){var t=e,n=e;do{(t.x=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function ua(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ha(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(pa(e,t)&&pa(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(la(e.prev,e,t.prev)||la(e,t.prev,t))||ca(e,t)&&la(e.prev,e,e.next)>0&&la(t.prev,t,t.next)>0)}function la(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ca(e,t){return e.x===t.x&&e.y===t.y}function ha(e,t,n,r){var i=fa(la(e,t,n)),o=fa(la(e,t,r)),a=fa(la(n,r,e)),s=fa(la(n,r,t));return i!==o&&a!==s||!(0!==i||!da(e,n,t))||!(0!==o||!da(e,r,t))||!(0!==a||!da(n,e,r))||!(0!==s||!da(n,t,r))}function da(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function fa(e){return e>0?1:e<0?-1:0}function pa(e,t){return la(e.prev,e,e.next)<0?la(e,t,e.next)>=0&&la(e,e.prev,t)>=0:la(e,t,e.prev)<0||la(e,e.next,t)<0}function va(e,t){var n=new ya(e.i,e.x,e.y),r=new ya(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function ma(e,t,n,r){var i=new ya(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ga(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ya(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var ba=function(){function e(){_(this,e)}return T(e,null,[{key:"area",value:function(e){for(var t=e.length,n=0,r=t-1,i=0;i2&&void 0!==arguments[2]?arguments[2]:2,c=t&&t.length,h=c?t[0]*l:e.length,d=Zo(e,0,h,l,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(e,t,n,r){var i,o,a,s=[];for(i=0,o=t.length;i80*l){n=i=e[0],r=o=e[1];for(var p=l;pi&&(i=a),s>o&&(o=s);u=0!==(u=Math.max(i-n,o-r))?1/u:0}return Jo(d,f,l,n,r,u),f}(n,r),u=0;u2&&e[t-1].equals(e[0])&&e.pop()}function _a(e,t){for(var n=0;nNumber.EPSILON){var d=Math.sqrt(c),f=Math.sqrt(u*u+l*l),p=t.x-s/d,v=t.y+a/d,m=((n.x-l/f-p)*l-(n.y+u/f-v)*u)/(a*l-s*u),g=(r=p+a*m-e.x)*r+(i=v+s*m-e.y)*i;if(g<=2)return new j(r,i);o=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?u>Number.EPSILON&&(y=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(r=-s,i=a,o=Math.sqrt(c)):(r=a,i=s,o=Math.sqrt(c/2))}return new j(r/o,i/o)}for(var B=[],U=0,F=C.length,z=F-1,G=U+1;U=0;be--){for(var xe=be/f,_e=c*Math.cos(xe*Math.PI/2),we=h*Math.sin(xe*Math.PI/2)+d,Te=0,Me=C.length;Te=0;){var r=n,o=n-1;o<0&&(o=e.length-1);for(var a=0,s=i+2*f;a1&&void 0!==arguments[1]?arguments[1]:12;_(this,n),(r=t.call(this)).type="ShapeGeometry",r.parameters={shapes:e,curveSegments:i};var o=[],a=[],s=[],u=[],l=0,c=0;if(!1===Array.isArray(e))d(e);else for(var h=0;h4&&void 0!==arguments[4]?arguments[4]:30,o=e.clone();o.name=t;for(var a=[],s=0;s=r)){c.push(u.times[d]);for(var p=0;po.tracks[m].times[0]&&(v=o.tracks[m].times[0]);for(var g=0;g1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);for(var i=n.tracks.length,o=t/r,a=function(t){var r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)return"continue";var a=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===a)return"continue";var s=0,u=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=u/3);var l=0,c=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=c/3);var h=r.times.length-1,d=void 0;if(o<=r.times[0]){var f=s,p=u-s;d=Ra.arraySlice(r.values,f,p)}else if(o>=r.times[h]){var v=h*u+s,m=v+u-s;d=Ra.arraySlice(r.values,v,m)}else{var g=r.createInterpolant(),y=s,b=u-s;g.evaluate(o),d=Ra.arraySlice(g.resultBuffer,y,b)}"quaternion"===i&&(new X).fromArray(d).normalize().conjugate().toArray(d);for(var x=a.times.length,_=0;_=i)break e;var s=t[1];e=(i=t[--n-1]))break t}o=n,n=0}for(;n>>1;et;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Ra.arraySlice(n,i,o),this.values=Ra.arraySlice(this.values,i*a,o*a)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&Ra.isTypedArray(r))for(var u=0,l=r.length;u!==l;++u){var c=r[u];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,c),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=Ra.arraySlice(this.times),t=Ra.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=e.length-1,o=1,a=1;a0){e[o]=e[i];for(var g=i*n,y=o*n,b=0;b!==n;++b)t[y+b]=t[g+b];++o}return o!==e.length?(this.times=Ra.arraySlice(e,0,o),this.values=Ra.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=Ra.arraySlice(this.times,0),t=Ra.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}],[{key:"toJSON",value:function(e){var t,n=e.constructor;if(n.toJSON!==this.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Ra.convertArray(e.times,Array),values:Ra.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}]),e}();Fa.prototype.TimeBufferType=Float32Array,Fa.prototype.ValueBufferType=Float32Array,Fa.prototype.DefaultInterpolation=2301;var za=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(Fa);za.prototype.ValueTypeName="bool",za.prototype.ValueBufferType=Array,za.prototype.DefaultInterpolation=2300,za.prototype.InterpolantFactoryMethodLinear=void 0,za.prototype.InterpolantFactoryMethodSmooth=void 0;var Ga=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(Fa);Ga.prototype.ValueTypeName="color";var Ha=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(Fa);Ha.prototype.ValueTypeName="number";var Va=function(e){p(n,e);var t=m(n);function n(e,r,i,o){return _(this,n),t.call(this,e,r,i,o)}return T(n,[{key:"interpolate_",value:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-t)/(r-t),u=e*a,l=u+a;u!==l;u+=4)X.slerpFlat(i,0,o,u-a,o,u,s);return i}}]),n}(La),Wa=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return T(n,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new Va(this.times,this.values,this.getValueSize(),e)}}]),n}(Fa);Wa.prototype.ValueTypeName="quaternion",Wa.prototype.DefaultInterpolation=2301,Wa.prototype.InterpolantFactoryMethodSmooth=void 0;var Ya=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(Fa);Ya.prototype.ValueTypeName="string",Ya.prototype.ValueBufferType=Array,Ya.prototype.DefaultInterpolation=2300,Ya.prototype.InterpolantFactoryMethodLinear=void 0,Ya.prototype.InterpolantFactoryMethodSmooth=void 0;var Xa=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(Fa);Xa.prototype.ValueTypeName="vector";var Qa=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500;_(this,e),this.name=t,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=k(),this.duration<0&&this.resetDuration()}return T(e,[{key:"resetDuration",value:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}},{key:"trim",value:function(){for(var e=0;e1){var l=u[1],c=r[l];c||(r[l]=c=[]),c.push(s)}}var h=[];for(var d in r)h.push(this.CreateFromMorphTargetSequence(d,r[d],t,n));return h}},{key:"parseAnimation",value:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var o=[],a=[];Ra.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode,s=e.length||-1,u=e.hierarchy||[],l=0;l0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}]),n}(Ka),is=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return T(n,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Vo(t,e))}},{key:"getPoint",value:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r=t){var i=n[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n0&&void 0!==arguments[0]?arguments[0]:40,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}},{key:"getPoints",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[],r=0,i=this.curves;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}},{key:"copy",value:function(e){f(x(n.prototype),"copy",this).call(this,e),this.curves=[];for(var t=0,r=e.curves.length;t0){var l=u.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(u);var c=u.getPoint(1);return this.currentPoint.copy(c),this}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}]),n}(is),as=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).uuid=k(),r.type="Shape",r.holes=[],r}return T(n,[{key:"getPointsHoles",value:function(e){for(var t=[],n=0,r=this.holes.length;n1&&void 0!==arguments[1]?arguments[1]:1;return _(this,n),(r=t.call(this)).type="Light",r.color=new mt(e),r.intensity=i,r}return T(n,[{key:"dispose",value:function(){}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}]),n}(qe);ss.prototype.isLight=!0;var us=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,e,i)).type="HemisphereLight",o.position.copy(qe.DefaultUp),o.updateMatrix(),o.groundColor=new mt(r),o}return T(n,[{key:"copy",value:function(e){return ss.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}]),n}(ss);us.prototype.isHemisphereLight=!0;var ls=new Se,cs=new Q,hs=new Q,ds=function(){function e(t){_(this,e),this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new j(512,512),this.map=null,this.mapPass=null,this.matrix=new Se,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new mn,this._frameExtents=new j(1,1),this._viewportCount=1,this._viewports=[new V(0,0,1,1)]}return T(e,[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(e){var t=this.camera,n=this.matrix;cs.setFromMatrixPosition(e.matrixWorld),t.position.copy(cs),hs.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(hs),t.updateMatrixWorld(),ls.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ls),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}},{key:"getViewport",value:function(e){return this._viewports[e]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"dispose",value:function(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}},{key:"copy",value:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}]),e}(),fs=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this,new an(50,1,.5,500))).focus=1,e}return T(n,[{key:"updateMatrices",value:function(e){var t=this.camera,r=2*N*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;r===t.fov&&i===t.aspect&&o===t.far||(t.fov=r,t.aspect=i,t.far=o,t.updateProjectionMatrix()),f(x(n.prototype),"updateMatrices",this).call(this,e)}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.focus=e.focus,this}}]),n}(ds);fs.prototype.isSpotLightShadow=!0;var ps=function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;return _(this,n),(i=t.call(this,e,r)).type="SpotLight",i.position.copy(qe.DefaultUp),i.updateMatrix(),i.target=new qe,i.distance=o,i.angle=a,i.penumbra=s,i.decay=u,i.shadow=new fs,i}return T(n,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},{key:"power",get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}]),n}(ss);ps.prototype.isSpotLight=!0;var vs=new Se,ms=new Q,gs=new Q,ys=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this,new an(90,1,.5,500)))._frameExtents=new j(4,2),e._viewportCount=6,e._viewports=[new V(2,1,1,1),new V(0,1,1,1),new V(3,1,1,1),new V(1,1,1,1),new V(3,0,1,1),new V(1,0,1,1)],e._cubeDirections=[new Q(1,0,0),new Q(-1,0,0),new Q(0,0,1),new Q(0,0,-1),new Q(0,1,0),new Q(0,-1,0)],e._cubeUps=[new Q(0,1,0),new Q(0,1,0),new Q(0,1,0),new Q(0,1,0),new Q(0,0,1),new Q(0,0,-1)],e}return T(n,[{key:"updateMatrices",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),ms.setFromMatrixPosition(e.matrixWorld),n.position.copy(ms),gs.copy(n.position),gs.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(gs),n.updateMatrixWorld(),r.makeTranslation(-ms.x,-ms.y,-ms.z),vs.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vs)}}]),n}(ds);ys.prototype.isPointLightShadow=!0;var bs=function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return _(this,n),(i=t.call(this,e,r)).type="PointLight",i.distance=o,i.decay=a,i.shadow=new ys,i}return T(n,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},{key:"power",get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}]),n}(ss);bs.prototype.isPointLight=!0;var xs=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return _(this,n),(e=t.call(this)).type="OrthographicCamera",e.zoom=1,e.view=null,e.left=r,e.right=i,e.top=o,e.bottom=a,e.near=s,e.far=u,e.updateProjectionMatrix(),e}return T(n,[{key:"copy",value:function(e,t){return f(x(n.prototype),"copy",this).call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}},{key:"setViewOffset",value:function(e,t,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,o=n+e,a=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var u=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=u*this.view.offsetX)+u*this.view.width,s=(a-=l*this.view.offsetY)-l*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}]),n}(on);xs.prototype.isOrthographicCamera=!0;var _s=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.call(this,new xs(-5,5,5,-5,.5,500))}return n}(ds);_s.prototype.isDirectionalLightShadow=!0;var ws=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).type="DirectionalLight",i.position.copy(qe.DefaultUp),i.updateMatrix(),i.target=new qe,i.shadow=new _s,i}return T(n,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}]),n}(ss);ws.prototype.isDirectionalLight=!0;var Ts=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).type="AmbientLight",i}return n}(ss);Ts.prototype.isAmbientLight=!0;var Ms=function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return _(this,n),(i=t.call(this,e,r)).type="RectAreaLight",i.width=o,i.height=a,i}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.width=e.width,this.height=e.height,this}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}]),n}(ss);Ms.prototype.isRectAreaLight=!0;var Ss=function(){function e(){_(this,e),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new Q)}return T(e,[{key:"set",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],n*r*1.092548),t.addScaledVector(o[5],r*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7],n*i*1.092548),t.addScaledVector(o[8],.546274*(n*n-r*r)),t}},{key:"getIrradianceAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*r),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*n),t.addScaledVector(o[4],.858086*n*r),t.addScaledVector(o[5],.858086*r*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*n*i),t.addScaledVector(o[8],.429043*(n*n-r*r)),t}},{key:"add",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}},{key:"addScaledSH",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}},{key:"scale",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}},{key:"lerp",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}},{key:"equals",value:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}],[{key:"getBasisAt",value:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}]),e}();Ss.prototype.isSphericalHarmonics3=!0;var Es=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ss,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return _(this,n),(e=t.call(this,void 0,i)).sh=r,e}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.sh.copy(e.sh),this}},{key:"fromJSON",value:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.sh=this.sh.toArray(),t}}]),n}(ss);Es.prototype.isLightProbe=!0;var As=function(){function e(){_(this,e)}return T(e,null,[{key:"decodeText",value:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n3&&void 0!==arguments[3]?arguments[3]:1;return _(this,n),"number"==typeof i&&(a=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),(o=t.call(this,e,r,i)).meshPerAttribute=a,o}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}]),n}(xt);Ns.prototype.isInstancedBufferAttribute=!0,function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),r=t.call(this,e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),r.options={premultiplyAlpha:"none"},r}return T(n,[{key:"setOptions",value:function(e){return this.options=e,this}},{key:"load",value:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=qa.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;var a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){qa.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}]),n}(Ka).prototype.isImageBitmapLoader=!0;var ks=function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,e)}return T(n,[{key:"load",value:function(e,t,n,r){var i=this,o=new es(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{var o=n.slice(0);(void 0===Cs&&(Cs=new(window.AudioContext||window.webkitAudioContext)),Cs).decodeAudioData(o,(function(e){t(e)}))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}}]),n}(Ka);(function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;_(this,n),i=t.call(this,void 0,o);var a=(new mt).set(e),s=(new mt).set(r),u=new Q(a.r,a.g,a.b),l=new Q(s.r,s.g,s.b),c=Math.sqrt(Math.PI),h=c*Math.sqrt(.75);return i.sh.coefficients[0].copy(u).add(l).multiplyScalar(c),i.sh.coefficients[1].copy(u).sub(l).multiplyScalar(h),i}return n})(Es).prototype.isHemisphereLightProbe=!0,function(e){p(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;_(this,n),r=t.call(this,void 0,i);var o=(new mt).set(e);return r.sh.coefficients[0].set(o.r,o.g,o.b).multiplyScalar(2*Math.sqrt(Math.PI)),r}return n}(Es).prototype.isAmbientLightProbe=!0;var Ds=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).type="Audio",r.listener=e,r.context=e.context,r.gain=r.context.createGain(),r.gain.connect(e.getInput()),r.autoplay=!1,r.buffer=null,r.detune=0,r.loop=!1,r.loopStart=0,r.loopEnd=0,r.offset=0,r.duration=void 0,r.playbackRate=1,r.isPlaying=!1,r.hasPlaybackControl=!0,r.source=null,r.sourceType="empty",r._startedAt=0,r._progress=0,r._connected=!1,r.filters=[],r}return T(n,[{key:"getOutput",value:function(){return this.gain}},{key:"setNodeSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}},{key:"setMediaElementSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}},{key:"setMediaStreamSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}},{key:"setBuffer",value:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")}},{key:"pause",value:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"stop",value:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"connect",value:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var u=t,l=t+t;u!==l;++u)if(n[u]!==n[u+t]){a.setValue(n,r);break}}},{key:"saveOriginalState",value:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,o=r;i!==o;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}},{key:"restoreOriginalState",value:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)}},{key:"_setAdditiveIdentityNumeric",value:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n=.5)for(var o=0;o!==i;++o)e[t+o]=e[n+o]}},{key:"_slerp",value:function(e,t,n,r){X.slerpFlat(e,t,e,t,e,n,r)}},{key:"_slerpAdditive",value:function(e,t,n,r,i){var o=this._workIndex*i;X.multiplyQuaternionsFlat(e,o,e,t,e,n),X.slerpFlat(e,t,e,t,e,o,r)}},{key:"_lerp",value:function(e,t,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[n+a]*r}}},{key:"_lerpAdditive",value:function(e,t,n,r,i){for(var o=0;o!==i;++o){var a=t+o;e[a]=e[a]+e[n+o]*r}}}]),e}(),Os=new RegExp("[\\[\\]\\.:\\/]","g"),Rs="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Ls=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),js=/(WCOD+)?/.source.replace("WCOD",Rs),Bs=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Us=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Fs=new RegExp("^"+Ls+js+Bs+Us+"$"),zs=["material","materials","bones"],Gs=function(){function e(t,n,r){_(this,e),this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return T(e,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(e,t){e[t]=this.node[this.propertyName]}},{key:"_getValue_array",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]}},{key:"_getValue_arrayElement",value:function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(e,t){this.resolvedProperty.toArray(e,t)}},{key:"_setValue_direct",value:function(e,t){this.targetObject[this.propertyName]=e[t]}},{key:"_setValue_direct_setNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]}},{key:"_setValue_array_setNeedsUpdate",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(e,t){this.resolvedProperty.fromArray(e,t)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(e,t){this.bind(),this.getValue(e,t)}},{key:"_setValue_unbound",value:function(e,t){this.bind(),this.setValue(e,t)}},{key:"bind",value:function(){var t=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,o=n.propertyIndex;if(t||(t=e.findNode(this.rootNode,n.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(r){var a=n.objectIndex;switch(r){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.blendMode;_(this,e),this._mixer=t,this._clip=n,this._localRoot=r,this.blendMode=i;for(var o=n.tracks,a=o.length,s=new Array(a),u={endingStart:2400,endingEnd:2400},l=0;l!==a;++l){var c=o[l].createInterpolant(null);s[l]=c,c.settings=u}this._interpolantSettings=u,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}return T(e,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,t){return this.loop=e,this.repetitions=t,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,o=i/r,a=r/i;e.warp(1,o,t),this.warp(a,1,t)}return this}},{key:"crossFadeTo",value:function(e,t,n){return e.crossFadeFrom(this,t,n)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,t,n){var r=this._mixer,i=r.time,o=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,u=a.sampleValues;return s[0]=i,s[1]=i+n,u[0]=e/o,u[1]=t/o,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(e-i)*n;if(o<0||0===n)return;this._startTime=null,t=n*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0){var u=this._interpolants,l=this._propertyBindings;if(2501===this.blendMode)for(var c=0,h=u.length;c!==h;++c)u[c].evaluate(a),l[c].accumulateAdditive(s);else for(var d=0,f=u.length;d!==f;++d)u[d].evaluate(a),l[d].accumulate(r,s)}}else this._updateWeight(e)}},{key:"_updateWeight",value:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}},{key:"_updateTimeScale",value:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}},{key:"_updateTime",value:function(e){var t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,o=2202===n;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=t||r<0){var a=Math.floor(r/t);r-=t*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&1==(1&i))return t-r}return r}},{key:"_setEndings",value:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}},{key:"_scheduleFading",value:function(e,t,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this}}]),e}();(function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this))._root=e,r._initMemoryManager(),r._accuIndex=0,r.time=0,r.timeScale=1,r}return T(n,[{key:"_bindAction",value:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,u=this._bindingsByRootAndName,l=u[s];void 0===l&&(l={},u[s]=l);for(var c=0;c!==i;++c){var h=r[c],d=h.name,f=l[d];if(void 0!==f)o[c]=f;else{if(void 0!==(f=o[c])){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=t&&t._propertyBindings[c].binding.parsedPath;++(f=new Ps(Gs.create(n,d,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(f,s,d),o[c]=f}a[c].resultBuffer=f.buffer}}},{key:"_activateAction",value:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}},{key:"_deactivateAction",value:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}},{key:"_initMemoryManager",value:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}},{key:"_isActiveAction",value:function(e){var t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}},{key:"update",value:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==n;++a)t[a]._update(r,e,i,o);for(var s=this._bindings,u=this._nActiveBindings,l=0;l!==u;++l)s[l].apply(o);return this}},{key:"setTime",value:function(e){this.time=0;for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:1;return _(this,n),(i=t.call(this,e,r)).meshPerAttribute=o,i}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"clone",value:function(e){var t=f(x(n.prototype),"clone",this).call(this,e);return t.meshPerAttribute=this.meshPerAttribute,t}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}]),n}(Pi).prototype.isInstancedInterleavedBuffer=!0,new j,new Q,new Q,function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).material=e,r.render=function(){},r.hasPositions=!1,r.hasNormals=!1,r.hasColors=!1,r.hasUvs=!1,r.positionArray=null,r.normalArray=null,r.colorArray=null,r.uvArray=null,r.count=0,r}return n}(qe).prototype.isImmediateRenderObject=!0;var Vs=new Q,Ws=new Se,Ys=new Se,Xs=new Float32Array(1);new Int32Array(Xs.buffer);var Qs=[.125,.215,.35,.446,.526,.582],Zs=5+Qs.length,qs=new gt({side:1,depthWrite:!1,depthTest:!1});new Jt(new $t,qs),function(){for(var e=[],t=[],n=[],r=8,i=0;i4?a=Qs[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),u=-s/2,l=1+s/2,c=[u,u,l,u,l,l,u,u,l,l,u,l],h=new Float32Array(108),d=new Float32Array(72),f=new Float32Array(36),p=0;p<6;p++){var v=p%3*2/3-1,m=p>2?0:-1,g=[v,m,0,v+2/3,m,0,v+2/3,m+1,0,v,m,0,v+2/3,m+1,0,v,m+1,0];h.set(g,18*p),d.set(c,12*p);var y=[p,p,p,p,p,p];f.set(y,6*p)}var b=new Pt;b.setAttribute("position",new xt(h,3)),b.setAttribute("uv",new xt(d,2)),b.setAttribute("faceIndex",new xt(f,1)),e.push(b),r>4&&r--}}(),No.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(No.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},os.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;_(this,n),o=new mt(o),a=new mt(a);for(var s=i/2,u=r/i,l=r/2,c=[],h=[],d=0,f=0,p=-l;d<=i;d++,p+=u){c.push(-l,0,p,l,0,p),c.push(p,0,-l,p,0,l);var v=d===s?o:a;v.toArray(h,f),f+=3,v.toArray(h,f),f+=3,v.toArray(h,f),f+=3,v.toArray(h,f),f+=3}var m=new Pt;return m.setAttribute("position",new Mt(c,3)),m.setAttribute("color",new Mt(h,3)),(e=t.call(this,m,new co({vertexColors:!0,toneMapped:!1}))).type="GridHelper",e}return n}(xo).prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n);for(var i=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r=.3&&e<.7){var n=(e-.3)/.4;this.isRight?(this.group.position.z=-1*(.25*this.height+.55*this.height*n),this.group.position.x=-1*(this.width+this.gap)*n):(this.group.position.z=-1*(.25*this.height+.55*this.height*n),this.group.position.x=(this.width+this.gap)*n)}else{var r=(e-.7)/.3;this.isRight?(this.group.position.x=-1*(this.width+this.gap),this.group.position.z=.8*this.height*-1*(1-r),this.group.rotation.y=Math.PI/12*-1*(1-r)):(this.group.position.x=this.width+this.gap,this.group.position.z=.8*this.height*-1*(1-r),this.group.rotation.y=Math.PI/12*(1-r))}}},{key:"isRight",get:function(){var e=this.options.find((function(e){return"dir"===e.name}));return!e||"r"===e.value}}]),e}(),Switch:function(){function e(){_(this,e),this.camera=new Ru,this.duration=6e3,this.options=[],this.prevMesh=new Jt,this.nextMesh=new Jt,this.width=100,this.height=100,this.depth=1,this.prevDepth=1}return T(e,[{key:"addObjects",value:function(e){e.add(this.prevMesh),e.add(this.nextMesh)}},{key:"dispose",value:function(){Array.isArray(this.prevMesh.material)?this.prevMesh.material.forEach((function(e){return e.dispose()})):this.prevMesh.material.dispose(),this.prevMesh.geometry.dispose(),Array.isArray(this.nextMesh.material)?this.nextMesh.material.forEach((function(e){return e.dispose()})):this.nextMesh.material.dispose(),this.nextMesh.geometry.dispose()}},{key:"setNextTexture",value:function(e){var t=new gt({map:e});this.nextMesh.material=t}},{key:"setPrevTexture",value:function(e){var t=new gt({map:e});this.prevMesh.material=t}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.camera.focus(this.prevMesh,t),this.width=e,this.height=t,this.depth=t/2;var n=new bn(e,t,1,1);this.prevMesh.geometry=n;var r=new bn(e,t,1,1);this.nextMesh.geometry=r,this.prevDepth=this.prevMesh.position.z}},{key:"updateAnimation",value:function(e){var t=this.options.find((function(e){return"dir"===e.name}));if(e<.5){var n=e/.5;this.prevMesh.position.x=this.width/2*n,this.prevMesh.rotation.y=-Math.PI/10*n,this.nextMesh.position.x=-this.width/2*n,this.nextMesh.rotation.y=Math.PI/10*n,this.nextMesh.position.z=this.prevDepth-this.depth*(1-n)}else{var r=(e-.5)/.5;this.prevMesh.position.x=this.width/2*(1-r),this.prevMesh.rotation.y=-Math.PI/10*(1-r),this.prevMesh.position.z=this.prevDepth-this.depth*r,this.nextMesh.position.x=-this.width/2*(1-r),this.nextMesh.rotation.y=Math.PI/10*(1-r)}if(t&&"l"===t.value)if(e<.5){var i=e/.5;this.prevMesh.position.x=-this.width/2*i,this.prevMesh.rotation.y=Math.PI/10*i,this.nextMesh.position.x=this.width/2*i,this.nextMesh.rotation.y=-Math.PI/10*i}else{var o=(e-.5)/.5;this.prevMesh.position.x=-this.width/2*(1-o),this.prevMesh.rotation.y=Math.PI/10*(1-o),this.nextMesh.position.x=this.width/2*(1-o),this.nextMesh.rotation.y=-Math.PI/10*(1-o)}}}]),e}(),Prism:function(){function e(){_(this,e),this.camera=new Ru,this.duration=6e3,this.preset=null,this.presetZ=0,this.mesh=new Jt,this.width=100,this.height=100}return T(e,[{key:"addObjects",value:function(e){this.mesh.geometry=this.box,e.add(this.mesh)}},{key:"dispose",value:function(){Array.isArray(this.mesh.material)?this.mesh.material.forEach((function(e){return e.dispose()})):this.mesh.material.dispose(),this.mesh.geometry.dispose()}},{key:"setNextTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new gt({map:e})),t.push(new gt({map:e})),t.push(new gt({map:e})),this.mesh.material=t}},{key:"setPrevTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new gt({map:e})),t.push(new gt({map:e})),t.push(new gt({map:e})),this.mesh.material=t}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.camera.focus(this.mesh,t),this.mesh.position.z-=e/2,this.width=e,this.height=t,this.box=new $t(e,t,e,1,1,1),this.mesh.geometry=this.box}},{key:"updateAnimation",value:function(e){null===this.preset&&(this.preset=e>0?0:Math.PI/2,this.presetZ=this.mesh.position.z);var t=Math.PI/2*e,n=(Math.sqrt(2)-1)*(this.width/2);this.mesh.rotation.y=this.preset+t,this.mesh.position.z=e<=.5?this.presetZ-e/.5*n:this.presetZ-(1-(e-.5)/.5)*n}}]),e}(),Doors:function(){function e(){_(this,e),this.camera=new Ru,this.duration=1600,this.options=[],this.width=100,this.preMaterial=new rn({fragmentShader:kl.a,vertexShader:Cl.a,uniforms:{prevTexture:{value:ou},timePercent:{value:0},offset:{value:0}}}),this.prevGeometry=new Pt,this.prevMesh=new Jt,this.nextMesh=new Jt}return T(e,[{key:"addObjects",value:function(e){this.prevMesh.material=this.preMaterial,this.prevMesh.geometry=this.prevGeometry,this.prevMesh.material.transparent=!0,e.add(this.prevMesh),e.add(this.nextMesh)}},{key:"setNextTexture",value:function(e){this.nextMesh.material=new gt({map:e})}},{key:"setPrevTexture",value:function(e){this.preMaterial.uniforms.prevTexture.value=e}},{key:"setSize",value:function(e,t){this.width=e,this.camera.updateAspect(e,t),this.camera.focus(this.prevMesh,t);var n=e/2,r=t/2;this.preMaterial.uniforms.offset.value=e/2,this.prevGeometry.setIndex([0,1,2,3,4,5,6,7,8,9,10,11]);var i=this.options.find((function(e){return"dir"===e.name})),o=i&&"vert"===i.value?0:1;this.preMaterial.uniforms.option={value:o},1===o?(this.prevGeometry.setAttribute("position",new Mt([-n,r,0,-n,0,0,n,r,0,-n,0,0,n,0,0,n,r,0,-n,0,0,-n,-r,0,n,0,0,-n,-r,0,n,-r,0,n,0,0],3)),this.prevGeometry.setAttribute("uv",new Mt([0,1,0,.5,1,1,0,.5,1,.5,1,1,0,.5,0,0,1,.5,0,0,1,0,1,.5],2))):(this.prevGeometry.setAttribute("position",new Mt([-n,r,0,-n,-r,0,0,r,0,-n,-r,0,0,-r,0,0,r,0,0,r,0,0,-r,0,n,r,0,0,-r,0,n,-r,0,n,r,0],3)),this.prevGeometry.setAttribute("uv",new Mt([0,1,0,0,.5,1,0,0,.5,0,.5,1,.5,1,.5,0,1,1,.5,0,1,0,1,1],2))),this.prevGeometry.setAttribute("left",new Mt([1,1,1,1,1,1,0,0,0,0,0,0],1)),this.nextMesh.geometry=new bn(e,t,1,1),this.nextMesh.position.z=this.prevMesh.position.z-e/4}},{key:"updateAnimation",value:function(e){this.preMaterial.uniforms.timePercent.value=e,this.nextMesh.position.z=this.prevMesh.position.z-(1-e)*(this.width/4)}},{key:"dispose",value:function(){}}]),e}()},Pl=function(){function e(){var t=this;_(this,e),this.startTime=0,this.lastTime=0,this.lastFPSTime=0,this.renderingDuration=16,this.reverse=!1,this.scene=new Di,this.delay=0,this.easeFn=iu.linear,this.preset=null,this.onTransactionEnd=function(){},this.isTransactionStartApplied=!1,this.prevTexture=null,this.nextTexture=null,this.animationId=null,this.config=null,this.renderer=new ki({alpha:!0,premultipliedAlpha:!0}),this.isPlaying=!1,this.animate=function(){var e,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.fps(i)){t.renderer.clear(),i>t.delay&&0===t.lastTime&&(t.lastTime=i,t.startTime=i);var o=0;t.lastTime>0&&o<1&&(o=t.easeFn(i-t.startTime,0,1,null!==(n=null===(e=t.preset)||void 0===e?void 0:e.duration)&&void 0!==n?n:0)),o>1&&(o=1),null===(r=t.preset)||void 0===r||r.updateAnimation(t.reverse?1-o:o),t.rerender(),t.isTransactionStartApplied||(t.isTransactionStartApplied=!0),o<1?t.animationId=window.requestAnimationFrame(t.animate):t.onTransactionEnd()}else t.animationId=window.requestAnimationFrame(t.animate)}}return T(e,[{key:"initPlayer",value:function(e){this.config=e,this.reverse=e.reverse,e.delay&&Number.isInteger(e.delay)&&(this.delay=e.delay),e.easeFn&&(this.easeFn=iu[e.easeFn]),e.maxFPS&&Number.isInteger(e.maxFPS)&&e.maxFPS>0&&(this.renderingDuration=Math.ceil(1e3/e.maxFPS)),this.startTime=0,this.lastTime=0,this.scene.clear(),this.renderer.shadowMap.enabled=!0,this.renderer.autoClear=!1,this.renderer.setClearColor(e.clearColor||0),this.isTransactionStartApplied=!1,this.renderer.setSize(e.stageWidth,e.stageHeight),this.preset=new Dl[e.presetType],e.options&&(this.preset.options=e.options),e.duration&&Number.isInteger(e.duration)&&(this.preset.duration=e.duration),this.preset.setSize(e.stageWidth,e.stageHeight)}},{key:"setPrevTexture",value:function(e){var t,n,r,i;e.needsUpdate=!0,this.reverse?(this.nextTexture=e,null===(t=this.preset)||void 0===t||t.setNextTexture(e)):(this.prevTexture=e,null===(n=this.preset)||void 0===n||n.setPrevTexture(e)),null===(r=this.preset)||void 0===r||r.addObjects(this.scene),null===(i=this.preset)||void 0===i||i.updateAnimation(this.reverse?1:0),this.rerender()}},{key:"setNextTexture",value:function(e){var t,n;e.needsUpdate=!0,this.reverse?(this.prevTexture=e,null===(t=this.preset)||void 0===t||t.setPrevTexture(e)):(this.nextTexture=e,null===(n=this.preset)||void 0===n||n.setNextTexture(e))}},{key:"play",value:function(){var e=this;return new Promise((function(t){e.onTransactionEnd=t,e.animate(),e.isPlaying=!0}))}},{key:"rerender",value:function(){var e;this.renderer.clear(),(null===(e=this.preset)||void 0===e?void 0:e.camera.camera)&&this.renderer.render(this.scene,this.preset.camera.camera)}},{key:"fps",value:function(e){return e<=0||(this.lastFPSTime<0||e-this.lastFPSTime>=this.renderingDuration)&&(this.lastFPSTime=e,!0)}},{key:"skip",value:function(){var e;null===(e=this.preset)||void 0===e||e.updateAnimation(this.reverse?0:1),this.rerender(),this.dispose(),this.onTransactionEnd()}},{key:"dispose",value:function(){var e,t,n;window.cancelAnimationFrame(this.animationId),this.renderer.clear(),this.isPlaying=!1,null===(e=this.preset)||void 0===e||e.dispose(),null===(t=this.prevTexture)||void 0===t||t.dispose(),null===(n=this.nextTexture)||void 0===n||n.dispose();for(var r=this.scene.children.length-1;r>=0;r--){var i=this.scene.children[r];this.scene.remove(i)}this.scene.background=null}},{key:"destroy",value:function(){this.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose()}}]),e}();n(139);var Ol=n(3),Rl=n(5);Rl.c.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var Ll=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Ol.isMobile.tablet||Ol.isMobile.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex=2..toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",(function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()})),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var n=0;n title : "+e.title+"
tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,n=t.width,r=t.height;e.x+e.width>n&&(e.width=n-e.x),e.y+e.height>r&&(e.height=r-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2..toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,n=e.target.displayObject,r=t.eventData;t.dispatchEvent(n,"click",r),t.dispatchEvent(n,"pointertap",r),t.dispatchEvent(n,"tap",r)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,n=e.target.displayObject,r=t.eventData;t.dispatchEvent(n,"mouseover",r)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,n=e.target.displayObject,r=t.eventData;t.dispatchEvent(n,"mouseout",r)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}(),jl=n(1),Bl=n(7),Ul=function(){function e(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new jl.g,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(e.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),e.prototype.getLocalPosition=function(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)},e.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},e.prototype.reset=function(){this.isPrimary=!1},e}(),Fl=function(e,t){return(Fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},zl=function(){function e(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return e.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},e.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},e}(),Gl=function(){function e(t){this._pointerId=t,this._flags=e.FLAGS.NONE}return e.prototype._doSet=function(e,t){this._flags=t?this._flags|e:this._flags&~e},Object.defineProperty(e.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"none",{get:function(){return this._flags===e.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"over",{get:function(){return 0!=(this._flags&e.FLAGS.OVER)},set:function(t){this._doSet(e.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightDown",{get:function(){return 0!=(this._flags&e.FLAGS.RIGHT_DOWN)},set:function(t){this._doSet(e.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftDown",{get:function(){return 0!=(this._flags&e.FLAGS.LEFT_DOWN)},set:function(t){this._doSet(e.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),e.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),e}(),Hl=function(){function e(){this._tempPoint=new jl.g}return e.prototype.recursiveFindHit=function(e,t,n,r,i){if(!t||!t.visible)return!1;var o=e.data.global,a=!1,s=i=t.interactive||i,u=!0;if(t.hitArea?(r&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(r=!1,u=!1)),s=!1):t._mask&&r&&(t._mask.containsPoint&&t._mask.containsPoint(o)||(r=!1)),u&&t.interactiveChildren&&t.children)for(var l=t.children,c=l.length-1;c>=0;c--){var h=l[c],d=this.recursiveFindHit(e,h,n,r,s);if(d){if(!h.parent)continue;s=!1,d&&(e.target&&(r=!1),a=!0)}}return i&&(r&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(a=!0),t.interactive&&(a&&!e.target&&(e.target=t),n&&n(e,t,!!a))),a},e.prototype.findHit=function(e,t,n,r){this.recursiveFindHit(e,t,n,r,!1)},e}(),Vl={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(e){e?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Rl.c.mixin(Vl);var Wl={target:null,data:{global:null}},Yl=function(e){function t(t,n){var r=e.call(this)||this;return n=n||{},r.renderer=t,r.autoPreventDefault=void 0===n.autoPreventDefault||n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new Ul,r.mouse.identifier=1,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[1]=r.mouse,r.interactionDataPool=[],r.eventData=new zl,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!("PointerEvent"in globalThis),r.supportsTouchEvents="ontouchstart"in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:"inherit",pointer:"pointer"},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new Hl,r._tempDisplayObject=new Rl.d,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=void 0===n.useSystemTicker||n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return function(e,t){function n(){this.constructor=e}Fl(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return Wl.target=null,Wl.data.global=e,t||(t=this.lastObjectRendered),this.processInteractive(Wl,t,null,!0),Wl.target},t.prototype.setTargetElement=function(e,t){void 0===t&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(Bl.a.system.add(this.tickerUpdate,this,Bl.c.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(Bl.a.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,this._deltaTime>8&255]+A[e>>16&255]+A[e>>24&255]+"-"+A[255&t]+A[t>>8&255]+"-"+A[t>>16&15|64]+A[t>>24&255]+"-"+A[63&n|128]+A[n>>8&255]+"-"+A[n>>16&255]+A[n>>24&255]+A[255&r]+A[r>>8&255]+A[r>>16&255]+A[r>>24&255]).toUpperCase()}function D(e,t,n){return Math.max(t,Math.min(n,e))}function P(e,t,n){return(1-n)*e+n*t}function O(e){return 0==(e&e-1)&&0!==e}function L(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_(this,e),this.x=t,this.y=n}return T(e,[{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}}]),e}();j.prototype.isVector2=!0;var B,U=function(){function e(){_(this,e),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}return T(e,[{key:"set",value:function(e,t,n,r,i,o,a,s,u){var l=this.elements;return l[0]=e,l[1]=r,l[2]=a,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=o,l[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],u=n[1],l=n[4],c=n[7],h=n[2],d=n[5],f=n[8],p=r[0],v=r[3],m=r[6],g=r[1],y=r[4],b=r[7],x=r[2],_=r[5],w=r[8];return i[0]=o*p+a*g+s*x,i[3]=o*v+a*y+s*_,i[6]=o*m+a*b+s*w,i[1]=u*p+l*g+c*x,i[4]=u*v+l*y+c*_,i[7]=u*m+l*b+c*w,i[2]=h*p+d*g+f*x,i[5]=h*v+d*y+f*_,i[8]=h*m+d*b+f*w,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8];return t*o*l-t*a*u-n*i*l+n*a*s+r*i*u-r*o*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=l*o-a*u,h=a*s-l*i,d=u*i-o*s,f=t*c+n*h+r*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);var p=1/f;return e[0]=c*p,e[1]=(r*u-l*n)*p,e[2]=(a*n-r*o)*p,e[3]=h*p,e[4]=(l*t-r*s)*p,e[5]=(r*i-a*t)*p,e[6]=d*p,e[7]=(n*s-u*t)*p,e[8]=(o*t-n*i)*p,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,n,r,i,o,a){var s=Math.cos(i),u=Math.sin(i);return this.set(n*s,n*u,-n*(s*o+u*a)+o+e,-r*u,r*s,-r*(-u*o+s*a)+a+t,0,0,1),this}},{key:"scale",value:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],u=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*u,r[6]=t*a+n*l,r[1]=-n*i+t*s,r[4]=-n*o+t*u,r[7]=-n*a+t*l,this}},{key:"translate",value:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}]),e}();U.prototype.isMatrix3=!0;var z=function(){function e(){_(this,e)}return T(e,null,[{key:"getDataURL",value:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===B&&(B=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),B.width=e.width,B.height=e.height;var n=B.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=B}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}}]),e}(),F=0,G=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.DEFAULT_IMAGE,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:3e3;return _(this,n),e=t.call(this),Object.defineProperty(y(e),"id",{value:F++}),e.uuid=k(),e.name="",e.image=r,e.mipmaps=[],e.mapping=i,e.wrapS=o,e.wrapT=a,e.magFilter=s,e.minFilter=u,e.anisotropy=h,e.format=l,e.internalFormat=null,e.type=c,e.offset=new j(0,0),e.repeat=new j(1,1),e.center=new j(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new U,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.encoding=d,e.version=0,e.onUpdate=null,e}return T(n,[{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=k()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),n}(w);function H(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?z.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}G.DEFAULT_IMAGE=void 0,G.DEFAULT_MAPPING=300,G.prototype.isTexture=!0;var V=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;_(this,e),this.x=t,this.y=n,this.z=r,this.w=i}return T(e,[{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,o=e.elements,a=o[0],s=o[4],u=o[8],l=o[1],c=o[5],h=o[9],d=o[2],f=o[6],p=o[10];if(Math.abs(s-l)<.01&&Math.abs(u-d)<.01&&Math.abs(h-f)<.01){if(Math.abs(s+l)<.1&&Math.abs(u+d)<.1&&Math.abs(h+f)<.1&&Math.abs(a+c+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var v=(a+1)/2,m=(c+1)/2,g=(p+1)/2,y=(s+l)/4,b=(u+d)/4,x=(h+f)/4;return v>m&&v>g?v<.01?(n=0,r=.707106781,i=.707106781):(r=y/(n=Math.sqrt(v)),i=b/n):m>g?m<.01?(n=.707106781,r=0,i=.707106781):(n=y/(r=Math.sqrt(m)),i=x/r):g<.01?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(g)),r=x/i),this.set(n,r,i,t),this}var _=Math.sqrt((f-h)*(f-h)+(u-d)*(u-d)+(l-s)*(l-s));return Math.abs(_)<.001&&(_=1),this.x=(f-h)/_,this.y=(u-d)/_,this.z=(l-s)/_,this.w=Math.acos((a+c+p-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}}]),e}();V.prototype.isVector4=!0;var W=function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return _(this,n),(i=t.call(this)).width=e,i.height=r,i.depth=1,i.scissor=new V(0,0,e,r),i.scissorTest=!1,i.viewport=new V(0,0,e,r),i.texture=new G(void 0,o.mapping,o.wrapS,o.wrapT,o.magFilter,o.minFilter,o.format,o.type,o.anisotropy,o.encoding),i.texture.image={width:e,height:r,depth:1},i.texture.generateMipmaps=void 0!==o.generateMipmaps&&o.generateMipmaps,i.texture.minFilter=void 0!==o.minFilter?o.minFilter:1006,i.depthBuffer=void 0===o.depthBuffer||o.depthBuffer,i.stencilBuffer=void 0!==o.stencilBuffer&&o.stencilBuffer,i.depthTexture=void 0!==o.depthTexture?o.depthTexture:null,i}return T(n,[{key:"setTexture",value:function(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}},{key:"setSize",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=R({},this.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),n}(w);W.prototype.isWebGLRenderTarget=!0,function(e){p(n,e);var t=m(n);function n(e,r,i){var o;_(this,n);var a=(o=t.call(this,e,r)).texture;o.texture=[];for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(var r=0,i=this.texture.length;r0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;_(this,e),this._x=t,this._y=n,this._z=r,this._w=i}return T(e,[{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,u=a(n/2),l=a(r/2),c=a(i/2),h=s(n/2),d=s(r/2),f=s(i/2);switch(o){case"XYZ":this._x=h*l*c+u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c-h*d*f;break;case"YXZ":this._x=h*l*c+u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c+h*d*f;break;case"ZXY":this._x=h*l*c-u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c-h*d*f;break;case"ZYX":this._x=h*l*c-u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c+h*d*f;break;case"YZX":this._x=h*l*c+u*d*f,this._y=u*d*c+h*l*f,this._z=u*l*f-h*d*c,this._w=u*l*c-h*d*f;break;case"XZY":this._x=h*l*c-u*d*f,this._y=u*d*c-h*l*f,this._z=u*l*f+h*d*c,this._w=u*l*c+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],u=t[2],l=t[6],c=t[10],h=n+a+c;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(l-s)*d,this._y=(i-u)*d,this._z=(o-r)*d}else if(n>a&&n>c){var f=2*Math.sqrt(1+n-a-c);this._w=(l-s)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(i+u)/f}else if(a>c){var p=2*Math.sqrt(1+a-n-c);this._w=(i-u)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(s+l)/p}else{var v=2*Math.sqrt(1+c-n-a);this._w=(o-r)/v,this._x=(i+u)/v,this._y=(s+l)/v,this._z=.25*v}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(D(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,u=t._z,l=t._w;return this._x=n*l+o*a+r*u-i*s,this._y=r*l+o*s+i*a-n*u,this._z=i*l+o*u+n*s-r*a,this._w=o*l-n*a-r*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-t;return this._w=u*o+t*this._w,this._x=u*n+t*this._x,this._y=u*r+t*this._y,this._z=u*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),c=Math.atan2(l,a),h=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,n){this.copy(e).slerp(t,n)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}],[{key:"slerp",value:function(e,t,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,r)}},{key:"slerpFlat",value:function(e,t,n,r,i,o,a){var s=n[r+0],u=n[r+1],l=n[r+2],c=n[r+3],h=i[o+0],d=i[o+1],f=i[o+2],p=i[o+3];if(0===a)return e[t+0]=s,e[t+1]=u,e[t+2]=l,void(e[t+3]=c);if(1===a)return e[t+0]=h,e[t+1]=d,e[t+2]=f,void(e[t+3]=p);if(c!==p||s!==h||u!==d||l!==f){var v=1-a,m=s*h+u*d+l*f+c*p,g=m>=0?1:-1,y=1-m*m;if(y>Number.EPSILON){var b=Math.sqrt(y),x=Math.atan2(b,m*g);v=Math.sin(v*x)/b,a=Math.sin(a*x)/b}var _=a*g;if(s=s*v+h*_,u=u*v+d*_,l=l*v+f*_,c=c*v+p*_,v===1-a){var w=1/Math.sqrt(s*s+u*u+l*l+c*c);s*=w,u*=w,l*=w,c*=w}}e[t]=s,e[t+1]=u,e[t+2]=l,e[t+3]=c}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,o){var a=n[r],s=n[r+1],u=n[r+2],l=n[r+3],c=i[o],h=i[o+1],d=i[o+2],f=i[o+3];return e[t]=a*f+l*c+s*d-u*h,e[t+1]=s*f+l*h+u*c-a*d,e[t+2]=u*f+l*d+a*h-s*c,e[t+3]=l*f-a*c-s*h-u*d,e}}]),e}();X.prototype.isQuaternion=!0;var Q=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;_(this,e),this.x=t,this.y=n,this.z=r}return T(e,[{key:"set",value:function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(q.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(q.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this}},{key:"applyQuaternion",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,u=s*t+o*r-a*n,l=s*n+a*t-i*r,c=s*r+i*n-o*t,h=-i*t-o*n-a*r;return this.x=u*s+h*-i+l*-a-c*-o,this.y=l*s+h*-o+c*-i-u*-a,this.z=c*s+h*-a+u*-o-l*-i,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}},{key:"cross",value:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(e){return Z.copy(this).projectOnVector(e),this.sub(Z)}},{key:"reflect",value:function(e){return this.sub(Z.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(D(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}},{key:"fromBufferAttribute",value:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}]),e}();Q.prototype.isVector3=!0;var Z=new Q,q=new X,J=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q(1/0,1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q(-1/0,-1/0,-1/0);_(this,e),this.min=t,this.max=n}return T(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.length;si&&(i=l),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=e.count;si&&(i=l),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,$),$.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(se),ue.subVectors(this.max,se),te.subVectors(e.a,se),ne.subVectors(e.b,se),re.subVectors(e.c,se),ie.subVectors(ne,te),oe.subVectors(re,ne),ae.subVectors(te,re);var t=[0,-ie.z,ie.y,0,-oe.z,oe.y,0,-ae.z,ae.y,ie.z,0,-ie.x,oe.z,0,-oe.x,ae.z,0,-ae.x,-ie.y,ie.x,0,-oe.y,oe.x,0,-ae.y,ae.x,0];return!!he(t,te,ne,re,ue)&&(!!he(t=[1,0,0,0,1,0,0,0,1],te,ne,re,ue)&&(le.crossVectors(ie,oe),he(t=[le.x,le.y,le.z],te,ne,re,ue)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return $.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"getBoundingSphere",value:function(e){return this.getCenter(e.center),e.radius=.5*this.getSize($).length(),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(K[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),K[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),K[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),K[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),K[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),K[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),K[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),K[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(K)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}]),e}();J.prototype.isBox3=!0;var K=[new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q],$=new Q,ee=new J,te=new Q,ne=new Q,re=new Q,ie=new Q,oe=new Q,ae=new Q,se=new Q,ue=new Q,le=new Q,ce=new Q;function he(e,t,n,r,i){for(var o=0,a=e.length-3;o<=a;o+=3){ce.fromArray(e,o);var s=i.x*Math.abs(ce.x)+i.y*Math.abs(ce.y)+i.z*Math.abs(ce.z),u=t.dot(ce),l=n.dot(ce),c=r.dot(ce);if(Math.max(-Math.max(u,l,c),Math.min(u,l,c))>s)return!1}return!0}var de=new J,fe=new Q,pe=new Q,ve=new Q,me=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;_(this,e),this.center=t,this.radius=n}return T(e,[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var n=this.center;void 0!==t?n.copy(t):de.setFromPoints(e).getCenter(n);for(var r=0,i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){ve.subVectors(e,this.center);var t=ve.lengthSq();if(t>this.radius*this.radius){var n=Math.sqrt(t),r=.5*(n-this.radius);this.center.add(ve.multiplyScalar(r/n)),this.radius+=r}return this}},{key:"union",value:function(e){return pe.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(fe.copy(e.center).add(pe)),this.expandByPoint(fe.copy(e.center).sub(pe)),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),ge=new Q,ye=new Q,be=new Q,xe=new Q,_e=new Q,we=new Q,Te=new Q,Me=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q(0,0,-1);_(this,e),this.origin=t,this.direction=n}return T(e,[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,ge)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=ge.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ge.copy(this.direction).multiplyScalar(t).add(this.origin),ge.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,n,r){ye.copy(e).add(t).multiplyScalar(.5),be.copy(t).sub(e).normalize(),xe.copy(this.origin).sub(ye);var i,o,a,s,u=.5*e.distanceTo(t),l=-this.direction.dot(be),c=xe.dot(this.direction),h=-xe.dot(be),d=xe.lengthSq(),f=Math.abs(1-l*l);if(f>0)if(o=l*c-h,s=u*f,(i=l*h-c)>=0)if(o>=-s)if(o<=s){var p=1/f;a=(i*=p)*(i+l*(o*=p)+2*c)+o*(l*i+o+2*h)+d}else o=u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;else o=-u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;else o<=-s?a=-(i=Math.max(0,-(-l*u+c)))*i+(o=i>0?-u:Math.min(Math.max(-u,-h),u))*(o+2*h)+d:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-h),u))*(o+2*h)+d):a=-(i=Math.max(0,-(l*u+c)))*i+(o=i>0?u:Math.min(Math.max(-u,-h),u))*(o+2*h)+d;else o=l>0?-u:u,a=-(i=Math.max(0,-(l*o+c)))*i+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(be).multiplyScalar(o).add(ye),a}},{key:"intersectSphere",value:function(e,t){ge.subVectors(e.center,this.origin);var n=ge.dot(this.direction),r=ge.dot(ge)-n*n,i=e.radius*e.radius;if(r>i)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}},{key:"intersectPlane",value:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var n,r,i,o,a,s,u=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,h=this.origin;return u>=0?(n=(e.min.x-h.x)*u,r=(e.max.x-h.x)*u):(n=(e.max.x-h.x)*u,r=(e.min.x-h.x)*u),l>=0?(i=(e.min.y-h.y)*l,o=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,o=(e.min.y-h.y)*l),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(a=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(a=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s=0?n:r,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,ge)}},{key:"intersectTriangle",value:function(e,t,n,r,i){_e.subVectors(t,e),we.subVectors(n,e),Te.crossVectors(_e,we);var o,a=this.direction.dot(Te);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}xe.subVectors(this.origin,e);var s=o*this.direction.dot(we.crossVectors(xe,we));if(s<0)return null;var u=o*this.direction.dot(_e.cross(xe));if(u<0)return null;if(s+u>a)return null;var l=-o*xe.dot(Te);return l<0?null:this.at(l/a,i)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),Se=function(){function e(){_(this,e),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}return T(e,[{key:"set",value:function(e,t,n,r,i,o,a,s,u,l,c,h,d,f,p,v){var m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=o,m[9]=a,m[13]=s,m[2]=u,m[6]=l,m[10]=c,m[14]=h,m[3]=d,m[7]=f,m[11]=p,m[15]=v,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"setFromMatrix3",value:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,n=e.elements,r=1/Ee.setFromMatrixColumn(e,0).length(),i=1/Ee.setFromMatrixColumn(e,1).length(),o=1/Ee.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),u=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var h=o*l,d=o*c,f=a*l,p=a*c;t[0]=s*l,t[4]=-s*c,t[8]=u,t[1]=d+f*u,t[5]=h-p*u,t[9]=-a*s,t[2]=p-h*u,t[6]=f+d*u,t[10]=o*s}else if("YXZ"===e.order){var v=s*l,m=s*c,g=u*l,y=u*c;t[0]=v+y*a,t[4]=g*a-m,t[8]=o*u,t[1]=o*c,t[5]=o*l,t[9]=-a,t[2]=m*a-g,t[6]=y+v*a,t[10]=o*s}else if("ZXY"===e.order){var b=s*l,x=s*c,_=u*l,w=u*c;t[0]=b-w*a,t[4]=-o*c,t[8]=_+x*a,t[1]=x+_*a,t[5]=o*l,t[9]=w-b*a,t[2]=-o*u,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){var T=o*l,M=o*c,S=a*l,E=a*c;t[0]=s*l,t[4]=S*u-M,t[8]=T*u+E,t[1]=s*c,t[5]=E*u+T,t[9]=M*u-S,t[2]=-u,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var A=o*s,I=o*u,C=a*s,N=a*u;t[0]=s*l,t[4]=N-A*c,t[8]=C*c+I,t[1]=c,t[5]=o*l,t[9]=-a*l,t[2]=-u*l,t[6]=I*c+C,t[10]=A-N*c}else if("XZY"===e.order){var k=o*s,D=o*u,P=a*s,O=a*u;t[0]=s*l,t[4]=-c,t[8]=u*l,t[1]=k*c+O,t[5]=o*l,t[9]=D*c-P,t[2]=P*c-D,t[6]=a*l,t[10]=O*c+k}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(Ie,e,Ce)}},{key:"lookAt",value:function(e,t,n){var r=this.elements;return De.subVectors(e,t),0===De.lengthSq()&&(De.z=1),De.normalize(),Ne.crossVectors(n,De),0===Ne.lengthSq()&&(1===Math.abs(n.z)?De.x+=1e-4:De.z+=1e-4,De.normalize(),Ne.crossVectors(n,De)),Ne.normalize(),ke.crossVectors(De,Ne),r[0]=Ne.x,r[4]=ke.x,r[8]=De.x,r[1]=Ne.y,r[5]=ke.y,r[9]=De.y,r[2]=Ne.z,r[6]=ke.z,r[10]=De.z,this}},{key:"multiply",value:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],u=n[12],l=n[1],c=n[5],h=n[9],d=n[13],f=n[2],p=n[6],v=n[10],m=n[14],g=n[3],y=n[7],b=n[11],x=n[15],_=r[0],w=r[4],T=r[8],M=r[12],S=r[1],E=r[5],A=r[9],I=r[13],C=r[2],N=r[6],k=r[10],D=r[14],P=r[3],O=r[7],R=r[11],L=r[15];return i[0]=o*_+a*S+s*C+u*P,i[4]=o*w+a*E+s*N+u*O,i[8]=o*T+a*A+s*k+u*R,i[12]=o*M+a*I+s*D+u*L,i[1]=l*_+c*S+h*C+d*P,i[5]=l*w+c*E+h*N+d*O,i[9]=l*T+c*A+h*k+d*R,i[13]=l*M+c*I+h*D+d*L,i[2]=f*_+p*S+v*C+m*P,i[6]=f*w+p*E+v*N+m*O,i[10]=f*T+p*A+v*k+m*R,i[14]=f*M+p*I+v*D+m*L,i[3]=g*_+y*S+b*C+x*P,i[7]=g*w+y*E+b*N+x*O,i[11]=g*T+y*A+b*k+x*R,i[15]=g*M+y*I+b*D+x*L,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],u=e[13],l=e[2],c=e[6],h=e[10],d=e[14];return e[3]*(+i*s*c-r*u*c-i*a*h+n*u*h+r*a*d-n*s*d)+e[7]*(+t*s*d-t*u*h+i*o*h-r*o*d+r*u*l-i*s*l)+e[11]*(+t*u*c-t*a*d-i*o*c+n*o*d+i*a*l-n*u*l)+e[15]*(-r*a*l-t*s*c+t*a*h+r*o*c-n*o*h+n*s*l)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],d=e[11],f=e[12],p=e[13],v=e[14],m=e[15],g=c*v*u-p*h*u+p*s*d-a*v*d-c*s*m+a*h*m,y=f*h*u-l*v*u-f*s*d+o*v*d+l*s*m-o*h*m,b=l*p*u-f*c*u+f*a*d-o*p*d-l*a*m+o*c*m,x=f*c*s-l*p*s-f*a*h+o*p*h+l*a*v-o*c*v,_=t*g+n*y+r*b+i*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var w=1/_;return e[0]=g*w,e[1]=(p*h*i-c*v*i-p*r*d+n*v*d+c*r*m-n*h*m)*w,e[2]=(a*v*i-p*s*i+p*r*u-n*v*u-a*r*m+n*s*m)*w,e[3]=(c*s*i-a*h*i-c*r*u+n*h*u+a*r*d-n*s*d)*w,e[4]=y*w,e[5]=(l*v*i-f*h*i+f*r*d-t*v*d-l*r*m+t*h*m)*w,e[6]=(f*s*i-o*v*i-f*r*u+t*v*u+o*r*m-t*s*m)*w,e[7]=(o*h*i-l*s*i+l*r*u-t*h*u-o*r*d+t*s*d)*w,e[8]=b*w,e[9]=(f*c*i-l*p*i-f*n*d+t*p*d+l*n*m-t*c*m)*w,e[10]=(o*p*i-f*a*i+f*n*u-t*p*u-o*n*m+t*a*m)*w,e[11]=(l*a*i-o*c*i-l*n*u+t*c*u+o*n*d-t*a*d)*w,e[12]=x*w,e[13]=(l*p*r-f*c*r+f*n*h-t*p*h-l*n*v+t*c*v)*w,e[14]=(f*a*r-o*p*r-f*n*s+t*p*s+o*n*v-t*a*v)*w,e[15]=(o*c*r-l*a*r+l*n*s-t*c*s-o*n*h+t*a*h)*w,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}},{key:"makeTranslation",value:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,u=i*o,l=i*a;return this.set(u*o+n,u*a-r*s,u*s+r*a,0,u*a+r*s,l*a+n,l*s-r*o,0,u*s-r*a,l*s+r*o,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n,r,i,o){return this.set(1,n,i,0,e,1,o,0,t,r,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,u=i+i,l=o+o,c=a+a,h=i*u,d=i*l,f=i*c,p=o*l,v=o*c,m=a*c,g=s*u,y=s*l,b=s*c,x=n.x,_=n.y,w=n.z;return r[0]=(1-(p+m))*x,r[1]=(d+b)*x,r[2]=(f-y)*x,r[3]=0,r[4]=(d-b)*_,r[5]=(1-(h+m))*_,r[6]=(v+g)*_,r[7]=0,r[8]=(f+y)*w,r[9]=(v-g)*w,r[10]=(1-(h+p))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(e,t,n){var r=this.elements,i=Ee.set(r[0],r[1],r[2]).length(),o=Ee.set(r[4],r[5],r[6]).length(),a=Ee.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Ae.copy(this);var s=1/i,u=1/o,l=1/a;return Ae.elements[0]*=s,Ae.elements[1]*=s,Ae.elements[2]*=s,Ae.elements[4]*=u,Ae.elements[5]*=u,Ae.elements[6]*=u,Ae.elements[8]*=l,Ae.elements[9]*=l,Ae.elements[10]*=l,t.setFromRotationMatrix(Ae),n.x=i,n.y=o,n.z=a,this}},{key:"makePerspective",value:function(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),u=2*i/(n-r),l=(t+e)/(t-e),c=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=u,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,o){var a=this.elements,s=1/(t-e),u=1/(n-r),l=1/(o-i),c=(t+e)*s,h=(n+r)*u,d=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}]),e}();Se.prototype.isMatrix4=!0;var Ee=new Q,Ae=new Se,Ie=new Q(0,0,0),Ce=new Q(1,1,1),Ne=new Q,ke=new Q,De=new Q,Pe=new Se,Oe=new X,Re=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;_(this,e),this._x=t,this._y=n,this._z=r,this._order=i}return T(e,[{key:"set",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.elements,i=r[0],o=r[4],a=r[8],s=r[1],u=r[5],l=r[9],c=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(D(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(h,u),this._z=0);break;case"YXZ":this._x=Math.asin(-D(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(s,u)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(D(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-D(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(D(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-D(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,u),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,n){return Pe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Pe,t,n)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(e){return Oe.setFromEuler(this),this.setFromQuaternion(Oe,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}},{key:"toVector3",value:function(e){return e?e.set(this._x,this._y,this._z):new Q(this._x,this._y,this._z)}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}]),e}();Re.prototype.isEuler=!0,Re.DefaultOrder="XYZ",Re.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Le=function(){function e(){_(this,e),this.mask=1}return T(e,[{key:"set",value:function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){r.children=[];for(var f=0;f0){r.animations=[];for(var p=0;p0&&(n.geometries=m),g.length>0&&(n.materials=g),y.length>0&&(n.textures=y),b.length>0&&(n.images=b),x.length>0&&(n.shapes=x),_.length>0&&(n.skeletons=_),w.length>0&&(n.animations=w)}return n.object=r,n;function T(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:new Q,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Q;_(this,e),this.a=t,this.b=n,this.c=r}return T(e,[{key:"set",value:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return Je.subVectors(this.c,this.b),Ke.subVectors(this.a,this.b),.5*Je.cross(Ke).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}},{key:"getUV",value:function(t,n,r,i,o){return e.getUV(t,this.a,this.b,this.c,n,r,i,o)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var n,r,i=this.a,o=this.b,a=this.c;tt.subVectors(o,i),nt.subVectors(a,i),it.subVectors(e,i);var s=tt.dot(it),u=nt.dot(it);if(s<=0&&u<=0)return t.copy(i);ot.subVectors(e,o);var l=tt.dot(ot),c=nt.dot(ot);if(l>=0&&c<=l)return t.copy(o);var h=s*c-l*u;if(h<=0&&s>=0&&l<=0)return n=s/(s-l),t.copy(i).addScaledVector(tt,n);at.subVectors(e,a);var d=tt.dot(at),f=nt.dot(at);if(f>=0&&d<=f)return t.copy(a);var p=d*u-s*f;if(p<=0&&u>=0&&f<=0)return r=u/(u-f),t.copy(i).addScaledVector(nt,r);var v=l*f-d*c;if(v<=0&&c-l>=0&&d-f>=0)return rt.subVectors(a,o),r=(c-l)/(c-l+(d-f)),t.copy(o).addScaledVector(rt,r);var m=1/(v+p+h);return n=p*m,r=h*m,t.copy(i).addScaledVector(tt,n).addScaledVector(nt,r)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,n,r){r.subVectors(n,t),Je.subVectors(e,t),r.cross(Je);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,n,r,i){Je.subVectors(r,t),Ke.subVectors(n,t),$e.subVectors(e,t);var o=Je.dot(Je),a=Je.dot(Ke),s=Je.dot($e),u=Ke.dot(Ke),l=Ke.dot($e),c=o*u-a*a;if(0===c)return i.set(-2,-1,-1);var h=1/c,d=(u*s-a*l)*h,f=(o*l-a*s)*h;return i.set(1-d-f,f,d)}},{key:"containsPoint",value:function(e,t,n,r){return this.getBarycoord(e,t,n,r,et),et.x>=0&&et.y>=0&&et.x+et.y<=1}},{key:"getUV",value:function(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,et),s.set(0,0),s.addScaledVector(i,et.x),s.addScaledVector(o,et.y),s.addScaledVector(a,et.z),s}},{key:"isFrontFacing",value:function(e,t,n,r){return Je.subVectors(n,t),Ke.subVectors(e,t),Je.cross(Ke).dot(r)<0}}]),e}(),ut=0,lt=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),e=t.call(this),Object.defineProperty(y(e),"id",{value:ut++}),e.uuid=k(),e.name="",e.type="Material",e.fog=!0,e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=100,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=7680,e.stencilZFail=7680,e.stencilZPass=7680,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaTest=0,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e}return T(n,[{key:"onBuild",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),o=r(e.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),n}(w);lt.prototype.isMaterial=!0;var ct={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ht={h:0,s:0,l:0},dt={h:0,s:0,l:0};function ft(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function pt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function vt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var mt=function(){function e(t,n,r){return _(this,e),void 0===n&&void 0===r?this.set(t):this.setRGB(t,n,r)}return T(e,[{key:"set",value:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,n){return this.r=e,this.g=t,this.b=n,this}},{key:"setHSL",value:function(e,t,n){if(e=function(e,t){return(e%t+t)%t}(e,1),t=D(t,0,1),n=D(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=ft(i,r,e+1/3),this.g=ft(i,r,e),this.b=ft(i,r,e-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(a,s,u)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){var l=n[1],c=l.length;if(3===c)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}},{key:"setColorName",value:function(e){var t=ct[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(e){return this.r=pt(e.r),this.g=pt(e.g),this.b=pt(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=vt(e.r),this.g=vt(e.g),this.b=vt(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),u=(s+a)/2;if(s===a)t=0,n=0;else{var l=a-s;switch(n=u<=.5?l/(a+s):l/(2-a-s),a){case r:t=(i-o)/l+(i1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),e}();mt.NAMES=ct,mt.prototype.isColor=!0,mt.prototype.r=1,mt.prototype.g=1,mt.prototype.b=1;var gt=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).type="MeshBasicMaterial",r.color=new mt(16777215),r.map=null,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=null,r.aoMapIntensity=1,r.specularMap=null,r.alphaMap=null,r.envMap=null,r.combine=0,r.reflectivity=1,r.refractionRatio=.98,r.wireframe=!1,r.wireframeLinewidth=1,r.wireframeLinecap="round",r.wireframeLinejoin="round",r.morphTargets=!1,r.setValues(e),r}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this}}]),n}(lt);gt.prototype.isMeshBasicMaterial=!0;var yt=new Q,bt=new j,xt=function(){function e(t,n,r){if(_(this,e),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=n,this.count=void 0!==t?t.length/n:0,this.normalized=!0===r,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}return T(e,[{key:"onUploadCallback",value:function(){}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"getX",value:function(e){return this.array[e*this.itemSize]}},{key:"setX",value:function(e,t){return this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){return this.array[e*this.itemSize+1]}},{key:"setY",value:function(e,t){return this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){return this.array[e*this.itemSize+2]}},{key:"setZ",value:function(e,t){return this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){return this.array[e*this.itemSize+3]}},{key:"setW",value:function(e,t){return this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}},{key:"setXYZ",value:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}},{key:"setXYZW",value:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();xt.prototype.isBufferAttribute=!0;var _t=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Uint16Array(e),r,i)}return n}(xt),wt=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Int32Array(e),r,i)}return n}(xt),Tt=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Uint32Array(e),r,i)}return n}(xt);(function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Uint16Array(e),r,i)}return n})(xt).prototype.isFloat16BufferAttribute=!0;var Mt=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Float32Array(e),r,i)}return n}(xt);function St(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;nt&&(t=e[n]);return t}var Et=0,At=new Se,It=new qe,Ct=new Q,Nt=new J,kt=new J,Dt=new Q,Pt=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),e=t.call(this),Object.defineProperty(y(e),"id",{value:Et++}),e.uuid=k(),e.name="",e.type="BufferGeometry",e.index=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return T(n,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(St(e)>65535?Tt:_t)(e,1):this.index=e,this}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new U).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return At.makeRotationFromQuaternion(e),this.applyMatrix4(At),this}},{key:"rotateX",value:function(e){return At.makeRotationX(e),this.applyMatrix4(At),this}},{key:"rotateY",value:function(e){return At.makeRotationY(e),this.applyMatrix4(At),this}},{key:"rotateZ",value:function(e){return At.makeRotationZ(e),this.applyMatrix4(At),this}},{key:"translate",value:function(e,t,n){return At.makeTranslation(e,t,n),this.applyMatrix4(At),this}},{key:"scale",value:function(e,t,n){return At.makeScale(e,t,n),this.applyMatrix4(At),this}},{key:"lookAt",value:function(e){return It.lookAt(e),It.updateMatrix(),this.applyMatrix4(It.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ct).negate(),this.translate(Ct.x,Ct.y,Ct.z),this}},{key:"setFromPoints",value:function(e){for(var t=[],n=0,r=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var o in i){var a=i[o];e.data.attributes[o]=a.toJSON(e.data)}var s={},u=!1;for(var l in this.morphAttributes){for(var c=this.morphAttributes[l],h=[],d=0,f=c.length;d0&&(s[l]=h,u=!0)}u&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);var v=this.groups;v.length>0&&(e.data.groups=JSON.parse(JSON.stringify(v)));var m=this.boundingSphere;return null!==m&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e}},{key:"clone",value:function(){return(new n).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone(t));var r=e.attributes;for(var i in r){var o=r[i];this.setAttribute(i,o.clone(t))}var a=e.morphAttributes;for(var s in a){for(var u=[],l=a[s],c=0,h=l.length;c0&&void 0!==arguments[0]?arguments[0]:new Pt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt;return _(this,n),(e=t.call(this)).type="Mesh",e.geometry=r,e.material=i,e.updateMorphTargets(),e}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"raycast",value:function(e,t){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),Lt.copy(r.boundingSphere),Lt.applyMatrix4(o),!1!==e.ray.intersectsSphere(Lt)&&(Ot.copy(o).invert(),Rt.copy(e.ray).applyMatrix4(Ot),null===r.boundingBox||!1!==Rt.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a=r.index,s=r.attributes.position,u=r.morphAttributes.position,l=r.morphTargetsRelative,c=r.attributes.uv,h=r.attributes.uv2,d=r.groups,f=r.drawRange;if(null!==a)if(Array.isArray(i))for(var p=0,v=d.length;pn.far?null:{distance:u,point:qt.clone(),object:e}}(e,t,n,r,jt,Bt,Ut,Zt);if(g){s&&(Yt.fromBufferAttribute(s,l),Xt.fromBufferAttribute(s,c),Qt.fromBufferAttribute(s,h),g.uv=st.getUV(Zt,jt,Bt,Ut,Yt,Xt,Qt,new j)),u&&(Yt.fromBufferAttribute(u,l),Xt.fromBufferAttribute(u,c),Qt.fromBufferAttribute(u,h),g.uv2=st.getUV(Zt,jt,Bt,Ut,Yt,Xt,Qt,new j));var y={a:l,b:c,c:h,normal:new Q,materialIndex:0};st.getNormal(jt,Bt,Ut,y.normal),g.face=y}return g}Jt.prototype.isMesh=!0;var $t=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;_(this,n),(e=t.call(this)).type="BoxGeometry",e.parameters={width:r,height:i,depth:o,widthSegments:a,heightSegments:s,depthSegments:u};var l=y(e);a=Math.floor(a),s=Math.floor(s),u=Math.floor(u);var c=[],h=[],d=[],f=[],p=0,v=0;function m(e,t,n,r,i,o,a,s,u,m,g){for(var y=o/u,b=a/m,x=o/2,_=a/2,w=s/2,T=u+1,M=m+1,S=0,E=0,A=new Q,I=0;I0?1:-1,d.push(A.x,A.y,A.z),f.push(N/u),f.push(1-I/m),S+=1}for(var D=0;D0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var o={};for(var a in this.extensions)!0===this.extensions[a]&&(o[a]=!0);return Object.keys(o).length>0&&(t.extensions=o),t}}]),n}(lt);rn.prototype.isShaderMaterial=!0;var on=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="Camera",e.matrixWorldInverse=new Se,e.projectionMatrix=new Se,e.projectionMatrixInverse=new Se,e}return T(n,[{key:"copy",value:function(e,t){return f(x(n.prototype),"copy",this).call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(e){f(x(n.prototype),"updateMatrixWorld",this).call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,t){f(x(n.prototype),"updateWorldMatrix",this).call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),n}(qe);on.prototype.isCamera=!0;var an=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;return _(this,n),(e=t.call(this)).type="PerspectiveCamera",e.fov=r,e.zoom=1,e.near=o,e.far=a,e.focus=10,e.aspect=i,e.view=null,e.filmGauge=35,e.filmOffset=0,e.updateProjectionMatrix(),e}return T(n,[{key:"copy",value:function(e,t){return f(x(n.prototype),"copy",this).call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}},{key:"setFocalLength",value:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*N*Math.atan(t),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*C*this.fov);return.5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*N*Math.atan(Math.tan(.5*C*this.fov)/this.zoom)}},{key:"getFilmWidth",value:function(){return this.filmGauge*Math.min(this.aspect,1)}},{key:"getFilmHeight",value:function(){return this.filmGauge/Math.max(this.aspect,1)}},{key:"setViewOffset",value:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=this.near,t=e*Math.tan(.5*C*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,t-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var u=this.filmOffset;0!==u&&(i+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}]),n}(on);an.prototype.isPerspectiveCamera=!0;var sn=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;if(_(this,n),(o=t.call(this)).type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return g(o,void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."));o.renderTarget=i;var a=new an(90,1,e,r);a.layers=o.layers,a.up.set(0,-1,0),a.lookAt(new Q(1,0,0)),o.add(a);var s=new an(90,1,e,r);s.layers=o.layers,s.up.set(0,-1,0),s.lookAt(new Q(-1,0,0)),o.add(s);var u=new an(90,1,e,r);u.layers=o.layers,u.up.set(0,0,1),u.lookAt(new Q(0,1,0)),o.add(u);var l=new an(90,1,e,r);l.layers=o.layers,l.up.set(0,0,-1),l.lookAt(new Q(0,-1,0)),o.add(l);var c=new an(90,1,e,r);c.layers=o.layers,c.up.set(0,-1,0),c.lookAt(new Q(0,0,1)),o.add(c);var h=new an(90,1,e,r);return h.layers=o.layers,h.up.set(0,-1,0),h.lookAt(new Q(0,0,-1)),o.add(h),g(o)}return T(n,[{key:"update",value:function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,r=c(this.children,6),i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],l=r[5],h=e.xr.enabled,d=e.getRenderTarget();e.xr.enabled=!1;var f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,o),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,s),e.setRenderTarget(n,4),e.render(t,u),n.texture.generateMipmaps=f,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(d),e.xr.enabled=h}}]),n}(qe),un=function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c,h){var d;return _(this,n),(d=t.call(this,e=void 0!==e?e:[],r=void 0!==r?r:301,i,o,a,s,u=void 0!==u?u:1022,l,c,h))._needsFlipEnvMap=!0,d.flipY=!1,d}return T(n,[{key:"images",get:function(){return this.image},set:function(e){this.image=e}}]),n}(G);un.prototype.isCubeTexture=!0;var ln=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),Number.isInteger(r)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),r=i),o=t.call(this,e,e,r),r=r||{},o.texture=new un(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),o.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,o.texture.minFilter=void 0!==r.minFilter?r.minFilter:1006,o.texture._needsFlipEnvMap=!1,o}return T(n,[{key:"fromEquirectangularTexture",value:function(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new $t(5,5,5),a=new rn({name:"CubemapFromEquirect",uniforms:en(n),vertexShader:r,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=t;var s=new Jt(o,a),u=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new sn(1,10,this).update(e,s),t.minFilter=u,s.geometry.dispose(),s.material.dispose(),this}},{key:"clear",value:function(e,t,n,r){for(var i=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(i)}}]),n}(W);ln.prototype.isWebGLCubeRenderTarget=!0;var cn=new Q,hn=new Q,dn=new U,fn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q(1,0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_(this,e),this.normal=t,this.constant=n}return T(e,[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,n){var r=cn.subVectors(n,t).cross(hn.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}},{key:"intersectLine",value:function(e,t){var n=e.delta(cn),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(n).multiplyScalar(i).add(e.start)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var n=t||dn.getNormalMatrix(e),r=this.coplanarPoint(cn).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}();fn.prototype.isPlane=!0;var pn=new me,vn=new Q,mn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fn,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fn,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new fn,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new fn,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new fn,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new fn;_(this,e),this.planes=[t,n,r,i,o,a]}return T(e,[{key:"set",value:function(e,t,n,r,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=n[7],h=n[8],d=n[9],f=n[10],p=n[11],v=n[12],m=n[13],g=n[14],y=n[15];return t[0].setComponents(a-r,c-s,p-h,y-v).normalize(),t[1].setComponents(a+r,c+s,p+h,y+v).normalize(),t[2].setComponents(a+i,c+u,p+d,y+m).normalize(),t[3].setComponents(a-i,c-u,p-d,y-m).normalize(),t[4].setComponents(a-o,c-l,p-f,y-g).normalize(),t[5].setComponents(a+o,c+l,p+f,y+g).normalize(),this}},{key:"intersectsObject",value:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),pn.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(pn)}},{key:"intersectsSprite",value:function(e){return pn.center.set(0,0,0),pn.radius=.7071067811865476,pn.applyMatrix4(e.matrixWorld),this.intersectsSphere(pn)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(n)0?e.max.x:e.min.x,vn.y=r.normal.y>0?e.max.y:e.min.y,vn.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(vn)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}();function gn(){var e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function yn(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var o=r.get(t);(!o||o.version0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;_(this,n),(e=t.call(this)).type="PlaneGeometry",e.parameters={width:r,height:i,widthSegments:o,heightSegments:a};for(var s=r/2,u=i/2,l=Math.floor(o),c=Math.floor(a),h=l+1,d=c+1,f=r/l,p=i/c,v=[],m=[],g=[],y=[],b=0;b 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotVH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSNMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition.xyz / vWorldPosition.w;\n\tvec3 v = normalize( cameraPosition - pos );\n\tfloat ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity );\n\tvec3 transmission = transmissionFactor * getIBLVolumeRefraction(\n\t\tnormal, v, roughnessFactor, material.diffuseColor, totalSpecular,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec4 vWorldPosition;\n\tvec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix) {\n\t\tvec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length(vec3(modelMatrix[0].xyz));\n\t\tmodelScale.y = length(vec3(modelMatrix[1].xyz));\n\t\tmodelScale.z = length(vec3(modelMatrix[2].xyz));\n\t\treturn normalize(refractionVector) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness(float roughness, float ior) {\n\t\treturn roughness * clamp(ior * 2.0 - 2.0, 0.0, 1.0);\n\t}\n\tvec3 getTransmissionSample(vec2 fragCoord, float roughness, float ior) {\n\t\tfloat framebufferLod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness, ior);\n\t\treturn texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod).rgb;\n\t}\n\tvec3 applyVolumeAttenuation(vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance) {\n\t\tif (attenuationDistance == 0.0) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log(attenuationColor) / attenuationDistance;\n\t\t\tvec3 transmittance = exp(-attenuationCoefficient * transmissionDistance);\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec3 getIBLVolumeRefraction(vec3 n, vec3 v, float perceptualRoughness, vec3 baseColor, vec3 specularColor,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay(n, v, thickness, ior, modelMatrix);\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4(refractedRayExit, 1.0);\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec3 transmittedLight = getTransmissionSample(refractionCoords, perceptualRoughness, ior);\n\t\tvec3 attenuatedColor = applyVolumeAttenuation(transmittedLight, length(transmissionRay), attenuationColor, attenuationDistance);\n\t\treturn (1.0 - specularColor) * attenuatedColor * baseColor;\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform vec3 attenuationColor;\n\tuniform float attenuationDistance;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#ifdef USE_TRANSMISSION\n\tvarying vec4 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition;\n#endif\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},_n={common:{diffuse:{value:new mt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new U},uv2Transform:{value:new U},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new j(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new mt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new mt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new U}},sprite:{diffuse:{value:new mt(16777215)},opacity:{value:1},center:{value:new j(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new U}}},wn={basic:{uniforms:tn([_n.common,_n.specularmap,_n.envmap,_n.aomap,_n.lightmap,_n.fog]),vertexShader:xn.meshbasic_vert,fragmentShader:xn.meshbasic_frag},lambert:{uniforms:tn([_n.common,_n.specularmap,_n.envmap,_n.aomap,_n.lightmap,_n.emissivemap,_n.fog,_n.lights,{emissive:{value:new mt(0)}}]),vertexShader:xn.meshlambert_vert,fragmentShader:xn.meshlambert_frag},phong:{uniforms:tn([_n.common,_n.specularmap,_n.envmap,_n.aomap,_n.lightmap,_n.emissivemap,_n.bumpmap,_n.normalmap,_n.displacementmap,_n.fog,_n.lights,{emissive:{value:new mt(0)},specular:{value:new mt(1118481)},shininess:{value:30}}]),vertexShader:xn.meshphong_vert,fragmentShader:xn.meshphong_frag},standard:{uniforms:tn([_n.common,_n.envmap,_n.aomap,_n.lightmap,_n.emissivemap,_n.bumpmap,_n.normalmap,_n.displacementmap,_n.roughnessmap,_n.metalnessmap,_n.fog,_n.lights,{emissive:{value:new mt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:xn.meshphysical_vert,fragmentShader:xn.meshphysical_frag},toon:{uniforms:tn([_n.common,_n.aomap,_n.lightmap,_n.emissivemap,_n.bumpmap,_n.normalmap,_n.displacementmap,_n.gradientmap,_n.fog,_n.lights,{emissive:{value:new mt(0)}}]),vertexShader:xn.meshtoon_vert,fragmentShader:xn.meshtoon_frag},matcap:{uniforms:tn([_n.common,_n.bumpmap,_n.normalmap,_n.displacementmap,_n.fog,{matcap:{value:null}}]),vertexShader:xn.meshmatcap_vert,fragmentShader:xn.meshmatcap_frag},points:{uniforms:tn([_n.points,_n.fog]),vertexShader:xn.points_vert,fragmentShader:xn.points_frag},dashed:{uniforms:tn([_n.common,_n.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:xn.linedashed_vert,fragmentShader:xn.linedashed_frag},depth:{uniforms:tn([_n.common,_n.displacementmap]),vertexShader:xn.depth_vert,fragmentShader:xn.depth_frag},normal:{uniforms:tn([_n.common,_n.bumpmap,_n.normalmap,_n.displacementmap,{opacity:{value:1}}]),vertexShader:xn.normal_vert,fragmentShader:xn.normal_frag},sprite:{uniforms:tn([_n.sprite,_n.fog]),vertexShader:xn.sprite_vert,fragmentShader:xn.sprite_frag},background:{uniforms:{uvTransform:{value:new U},t2D:{value:null}},vertexShader:xn.background_vert,fragmentShader:xn.background_frag},cube:{uniforms:tn([_n.envmap,{opacity:{value:1}}]),vertexShader:xn.cube_vert,fragmentShader:xn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:xn.equirect_vert,fragmentShader:xn.equirect_frag},distanceRGBA:{uniforms:tn([_n.common,_n.displacementmap,{referencePosition:{value:new Q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:xn.distanceRGBA_vert,fragmentShader:xn.distanceRGBA_frag},shadow:{uniforms:tn([_n.lights,_n.fog,{color:{value:new mt(0)},opacity:{value:1}}]),vertexShader:xn.shadow_vert,fragmentShader:xn.shadow_frag}};function Tn(e,t,n,r,i){var o,a,s=new mt(0),u=0,l=null,c=0,h=null;function d(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;s.set(e),d(s,u=t)},getClearAlpha:function(){return u},setClearAlpha:function(e){d(s,u=e)},render:function(n,i){var f=!1,p=!0===i.isScene?i.background:null;p&&p.isTexture&&(p=t.get(p));var v=e.xr,m=v.getSession&&v.getSession();m&&"additive"===m.environmentBlendMode&&(p=null),null===p?d(s,u):p&&p.isColor&&(d(p,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),p&&(p.isCubeTexture||306===p.mapping)?(void 0===a&&((a=new Jt(new $t(1,1,1),new rn({name:"BackgroundCubeMaterial",uniforms:en(wn.cube.uniforms),vertexShader:wn.cube.vertexShader,fragmentShader:wn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(a)),a.material.uniforms.envMap.value=p,a.material.uniforms.flipEnvMap.value=p.isCubeTexture&&p._needsFlipEnvMap?-1:1,l===p&&c===p.version&&h===e.toneMapping||(a.material.needsUpdate=!0,l=p,c=p.version,h=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):p&&p.isTexture&&(void 0===o&&((o=new Jt(new bn(2,2),new rn({name:"BackgroundMaterial",uniforms:en(wn.background.uniforms),vertexShader:wn.background.vertexShader,fragmentShader:wn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=p,!0===p.matrixAutoUpdate&&p.updateMatrix(),o.material.uniforms.uvTransform.value.copy(p.matrix),l===p&&c===p.version&&h===e.toneMapping||(o.material.needsUpdate=!0,l=p,c=p.version,h=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function Mn(e,t,n,r){var i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},u=d(null),l=u;function c(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function h(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function d(e){for(var t=[],n=[],r=[],o=0;o=0){var y=u[h];if(void 0!==y){var b=y.normalized,x=y.itemSize,_=n.get(y);if(void 0===_)continue;var w=_.buffer,T=_.type,M=_.bytesPerElement;if(y.isInterleavedBufferAttribute){var S=y.data,E=S.stride,A=y.offset;S&&S.isInstancedInterleavedBuffer?(v(d,S.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=S.meshPerAttribute*S.count)):p(d),e.bindBuffer(34962,w),g(d,x,T,b,E*M,A*M)}else y.isInstancedBufferAttribute?(v(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):p(d),e.bindBuffer(34962,w),g(d,x,T,b,0,0)}else if("instanceMatrix"===h){var I=n.get(i.instanceMatrix);if(void 0===I)continue;var C=I.buffer,N=I.type;v(d+0,1),v(d+1,1),v(d+2,1),v(d+3,1),e.bindBuffer(34962,C),e.vertexAttribPointer(d+0,4,N,!1,64,0),e.vertexAttribPointer(d+1,4,N,!1,64,16),e.vertexAttribPointer(d+2,4,N,!1,64,32),e.vertexAttribPointer(d+3,4,N,!1,64,48)}else if("instanceColor"===h){var k=n.get(i.instanceColor);if(void 0===k)continue;var D=k.buffer,P=k.type;v(d,1),e.bindBuffer(34962,D),e.vertexAttribPointer(d,3,P,!1,12,0)}else if(void 0!==c){var O=c[h];if(void 0!==O)switch(O.length){case 2:e.vertexAttrib2fv(d,O);break;case 3:e.vertexAttrib3fv(d,O);break;case 4:e.vertexAttrib4fv(d,O);break;default:e.vertexAttrib1fv(d,O)}}}}m()}}(i,u,h,y),null!==b&&e.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){for(var e in y(),s){var t=s[e];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var n=s[t];if(void 0!==n[e.id]){var r=n[e.id];for(var i in r)h(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:m}}function Sn(e,t,n,r){var i,o=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function(r,a,s){if(0!==s){var u,l;if(o)u=e,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(u=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[l](i,r,a,s),n.update(a,i,s)}}}function En(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=o||t.has("WEBGL_draw_buffers"),l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),h=e.getParameter(35660),d=e.getParameter(3379),f=e.getParameter(34076),p=e.getParameter(34921),v=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),y=h>0,b=o||t.has("OES_texture_float");return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){var n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:d,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:v,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:y,floatFragmentTextures:b,floatVertexTextures:y&&b,maxSamples:o?e.getParameter(36183):0}}function An(e){var t=this,n=null,r=0,i=!1,o=!1,a=new fn,s=new U,u={value:null,needsUpdate:!1};function l(){u.value!==n&&(u.value=n,u.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function c(e,n,r,i){var o=null!==e?e.length:0,l=null;if(0!==o){if(l=u.value,!0!==i||null===l){var c=r+4*o,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===l||l.length0){var s=e.getRenderTarget(),u=new ln(a.height/2);return u.fromEquirectangularTexture(e,i),t.set(i,u),e.setRenderTarget(s),i.addEventListener("dispose",r),n(u.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function Cn(e){var t={};function n(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(e){var t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Nn(e,t,n,r){var i={},o=new WeakMap;function a(e){var s=e.target;for(var u in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[u]);s.removeEventListener("dispose",a),delete i[s.id];var l=o.get(s);l&&(t.remove(l),o.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){var n=[],r=e.index,i=e.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var u=0,l=s.length;u65535?Tt:_t)(n,1);b.version=a;var x=o.get(e);x&&t.remove(x),o.set(e,b)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(e){var n=e.attributes;for(var r in n)t.update(n[r],34962);var i=e.morphAttributes;for(var o in i)for(var a=i[o],s=0,u=a.length;s0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return _(this,n),(e=t.call(this,null)).image={data:r,width:i,height:o,depth:a},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return n}(G);jn.prototype.isDataTexture2DArray=!0;var Bn=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return _(this,n),(e=t.call(this,null)).image={data:r,width:i,height:o,depth:a},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return n}(G);Bn.prototype.isDataTexture3D=!0;var Un=new G,zn=new jn,Fn=new Bn,Gn=new un,Hn=[],Vn=[],Wn=new Float32Array(16),Yn=new Float32Array(9),Xn=new Float32Array(4);function Qn(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,o=Hn[i];if(void 0===o&&(o=new Float32Array(i),Hn[i]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}function Zn(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n/gm;function Kr(e){return e.replace(Jr,$r)}function $r(e,t){var n=xn[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Kr(n)}var ei=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ti=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ni(e){return e.replace(ti,ii).replace(ei,ri)}function ri(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ii(e,t,n,r)}function ii(e,t,n,r){for(var i="",o=parseInt(t);o0?e.gammaFactor:1,v=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission>0)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Qr).join("\n")}(n),m=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),g=a.createProgram(),y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=[m].filter(Qr).join("\n")).length>0&&(i+="\n"),(o=[v,m].filter(Qr).join("\n")).length>0&&(o+="\n")):(i=[oi(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Qr).join("\n"),o=[v,oi(n),"#define SHADER_NAME "+n.shaderName,m,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?xn.tonemapping_pars_fragment:"",0!==n.toneMapping?Xr("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",xn.encodings_pars_fragment,n.map?Wr("mapTexelToLinear",n.mapEncoding):"",n.matcap?Wr("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Wr("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Wr("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Wr("lightMapTexelToLinear",n.lightMapEncoding):"",Yr("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Qr).join("\n")),u=qr(u=Zr(u=Kr(u),n),n),l=qr(l=Zr(l=Kr(l),n),n),u=ni(u),l=ni(l),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,o=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var b,x,_=y+o+l,w=Fr(a,35633,y+i+u),T=Fr(a,35632,_);if(a.attachShader(g,w),a.attachShader(g,T),void 0!==n.index0AttributeName?a.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(g,0,"position"),a.linkProgram(g),e.debug.checkShaderErrors){var M=a.getProgramInfoLog(g).trim(),S=a.getShaderInfoLog(w).trim(),E=a.getShaderInfoLog(T).trim(),A=!0,I=!0;if(!1===a.getProgramParameter(g,35714)){A=!1;var C=Vr(a,w,"vertex"),N=Vr(a,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(g,35715),"gl.getProgramInfoLog",M,C,N)}else""!==M?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",M):""!==S&&""!==E||(I=!1);I&&(this.diagnostics={runnable:A,programLog:M,vertexShader:{log:S,prefix:i},fragmentShader:{log:E,prefix:o}})}return a.deleteShader(w),a.deleteShader(T),this.getUniforms=function(){return void 0===b&&(b=new zr(a,g)),b},this.getAttributes=function(){return void 0===x&&(x=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i0,maxBones:M,useVertexTexture:l,morphTargets:i.morphTargets,morphNormals:i.morphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(!1===t.isRawShaderMaterial){for(var i=0;i0?i.push(c):!0===n.transparent?o.push(c):r.push(c)},unshift:function(e,t,n,a,u,l){var c=s(e,t,n,a,u,l);n.transmission>0?i.unshift(c):!0===n.transparent?o.unshift(c):r.unshift(c)},finish:function(){for(var e=n,r=t.length;e1&&r.sort(e||li),i.length>1&&i.sort(t||ci),o.length>1&&o.sort(t||ci)}}}function di(e){var t=new WeakMap;return{get:function(n,r){var i;return!1===t.has(n)?(i=new hi(e),t.set(n,[i])):r>=t.get(n).length?(i=new hi(e),t.get(n).push(i)):i=t.get(n)[r],i},dispose:function(){t=new WeakMap}}}function fi(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Q,color:new mt};break;case"SpotLight":n={position:new Q,direction:new Q,color:new mt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Q,color:new mt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Q,skyColor:new mt,groundColor:new mt};break;case"RectAreaLight":n={color:new mt,position:new Q,halfWidth:new Q,halfHeight:new Q}}return e[t.id]=n,n}}}var pi=0;function vi(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function mi(e,t){for(var n=new fi,r=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)i.probe.push(new Q);var a=new Q,s=new Se,u=new Se;return{setup:function(o){for(var a=0,s=0,u=0,l=0;l<9;l++)i.probe[l].set(0,0,0);var c=0,h=0,d=0,f=0,p=0,v=0,m=0,g=0;o.sort(vi);for(var y=0,b=o.length;y0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=_n.LTC_FLOAT_1,i.rectAreaLTC2=_n.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=_n.LTC_HALF_1,i.rectAreaLTC2=_n.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=u;var j=i.hash;j.directionalLength===c&&j.pointLength===h&&j.spotLength===d&&j.rectAreaLength===f&&j.hemiLength===p&&j.numDirectionalShadows===v&&j.numPointShadows===m&&j.numSpotShadows===g||(i.directional.length=c,i.spot.length=d,i.rectArea.length=f,i.point.length=h,i.hemi.length=p,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,j.directionalLength=c,j.pointLength=h,j.spotLength=d,j.rectAreaLength=f,j.hemiLength=p,j.numDirectionalShadows=v,j.numPointShadows=m,j.numSpotShadows=g,i.version=pi++)},setupView:function(e,t){for(var n=0,r=0,o=0,l=0,c=0,h=t.matrixWorldInverse,d=0,f=e.length;d1&&void 0!==arguments[1]?arguments[1]:0;return!1===n.has(r)?(i=new gi(e,t),n.set(r,[i])):o>=n.get(r).length?(i=new gi(e,t),n.get(r).push(i)):i=n.get(r)[o],i},dispose:function(){n=new WeakMap}}}var bi=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).type="MeshDepthMaterial",r.depthPacking=3200,r.morphTargets=!1,r.map=null,r.alphaMap=null,r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.wireframe=!1,r.wireframeLinewidth=1,r.fog=!1,r.setValues(e),r}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.depthPacking=e.depthPacking,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}]),n}(lt);bi.prototype.isMeshDepthMaterial=!0;var xi=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).type="MeshDistanceMaterial",r.referencePosition=new Q,r.nearDistance=1,r.farDistance=1e3,r.morphTargets=!1,r.map=null,r.alphaMap=null,r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.fog=!1,r.setValues(e),r}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}]),n}(lt);function _i(e,t,n){var r=new mn,i=new j,o=new j,a=new V,s=[],u=[],l={},c=n.maxTextureSize,h={0:1,1:0,2:2},d=new rn({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new j},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;var p=new Pt;p.setAttribute("position",new xt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var v=new Jt(p,d),m=this;function g(n,r){var i=t.update(v);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,d,v,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,f,v,null)}function y(e){var t=e<<0,n=s[t];return void 0===n&&(n=new bi({depthPacking:3201,morphTargets:e}),s[t]=n),n}function b(e){var t=e<<0,n=u[t];return void 0===n&&(n=new xi({morphTargets:e}),u[t]=n),n}function x(t,n,r,i,o,a,s){var u=null,c=y,d=t.customDepthMaterial;if(!0===i.isPointLight&&(c=b,d=t.customDistanceMaterial),void 0===d){var f=!1;!0===r.morphTargets&&(f=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0),u=c(f)}else u=d;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var p=u.uuid,v=r.uuid,m=l[p];void 0===m&&(m={},l[p]=m);var g=m[v];void 0===g&&(g=u.clone(),m[v]=g),u=g}return u.visible=r.visible,u.wireframe=r.wireframe,u.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:h[r.side],u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function _(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var u=t.update(n),l=n.material;if(Array.isArray(l))for(var c=u.groups,h=0,d=c.length;hc||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/b.x),i.x=o.x*b.x,y.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/b.y),i.y=o.y*b.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var x={minFilter:1006,magFilter:1006,format:1023};y.map=new W(i.x,i.y,x),y.map.texture.name=v.name+".shadowMap",y.mapPass=new W(i.x,i.y,x),y.camera.updateProjectionMatrix()}if(null===y.map){y.map=new W(i.x,i.y,{minFilter:1003,magFilter:1003,format:1023}),y.map.texture.name=v.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var w=y.getViewportCount(),T=0;T=1):-1!==I.indexOf("OpenGL ES")&&(A=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),E=A>=2);var C=null,N={},k=e.getParameter(3088),D=e.getParameter(2978),P=(new V).fromArray(k),O=(new V).fromArray(D);function R(t,n,r){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var a=0;ar||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var o=t?L:Math.floor,a=o(i*e.width),u=o(i*e.height);void 0===s&&(s=v(a,u));var l=n?v(a,u):s;return l.width=a,l.height=u,l.getContext("2d").drawImage(e,0,0,a,u),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+u+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function g(e){return O(e.width)&&O(e.height)}function y(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function b(t,n,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log2(Math.max(i,o,a))}function x(n,r,i){if(!1===u)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function _(e){return 1003===e||1004===e||1005===e?9728:9729}function w(t){var n,i,o=t.target;o.removeEventListener("dispose",w),n=o,void 0!==(i=r.get(n)).__webglInit&&(e.deleteTexture(i.__webglTexture),r.remove(n)),o.isVideoTexture&&f.delete(o),a.memory.textures--}function T(t){var n=t.target;n.removeEventListener("dispose",T),function(t){var n=t.texture,i=r.get(t),o=r.get(n);if(t){if(void 0!==o.__webglTexture&&(e.deleteTexture(o.__webglTexture),a.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var s=0;s<6;s++)e.deleteFramebuffer(i.__webglFramebuffer[s]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[s]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(var u=0,l=n.length;u0&&s.__version!==e.version){var u=e.image;if(void 0===u)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==u.complete)return void k(s,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,s.__webglTexture)}function E(t,i){var a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6===r.image.length){N(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);for(var a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),s=r.image[0]&&r.image[0].isDataTexture,l=[],h=0;h<6;h++)l[h]=a||s?s?r.image[h].image:r.image[h]:m(r.image[h],!1,!0,c);var d,f=l[0],p=g(f)||u,v=o.convert(r.format),_=o.convert(r.type),w=x(r.internalFormat,v,_);if(C(34067,r,p),a){for(var T=0;T<6;T++){d=l[T].mipmaps;for(var M=0;M1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function N(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),a.memory.textures++)}function k(t,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),N(t,r),n.activeTexture(33984+i),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);var s,l=function(e){return!u&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(r)&&!1===g(r.image),c=m(r.image,l,!1,h),d=g(c)||u,f=o.convert(r.format),p=o.convert(r.type),v=x(r.internalFormat,f,p);C(a,r,d);var _=r.mipmaps;if(r.isDepthTexture)v=6402,u?v=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===v&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,p=o.convert(r.type)),1027===r.format&&6402===v&&(v=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,p=o.convert(r.type))),n.texImage2D(3553,0,v,c.width,c.height,0,f,p,null);else if(r.isDataTexture)if(_.length>0&&d){for(var w=0,T=_.length;w0&&d){for(var E=0,A=_.length;E=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),M+=1,e},this.resetTextureUnits=function(){M=0},this.setTexture2D=S,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(t){var s=t.texture,l=r.get(t),c=r.get(s);t.addEventListener("dispose",T),!0!==t.isWebGLMultipleRenderTargets&&(c.__webglTexture=e.createTexture(),c.__version=s.version,a.memory.textures++);var h=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,f=!0===t.isWebGLMultisampleRenderTarget,p=s.isDataTexture3D||s.isDataTexture2DArray,v=g(t)||u;if(!u||1022!==s.format||1015!==s.type&&1016!==s.type||(s.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),h){l.__webglFramebuffer=[];for(var m=0;m<6;m++)l.__webglFramebuffer[m]=e.createFramebuffer()}else if(l.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers)for(var _=t.texture,w=0,M=_.length;w0&&void 0!==arguments[0]?arguments[0]:[];return _(this,n),(e=t.call(this)).cameras=r,e}return n}(an);Si.prototype.isArrayCamera=!0;var Ei=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="Group",e}return n}(qe);Ei.prototype.isGroup=!0;var Ai={type:"move"},Ii=function(){function e(){_(this,e),this._targetRay=null,this._grip=null,this._hand=null}return T(e,[{key:"getHandSpace",value:function(){return null===this._hand&&(this._hand=new Ei,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}},{key:"getTargetRaySpace",value:function(){return null===this._targetRay&&(this._targetRay=new Ei,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Q),this._targetRay}},{key:"getGripSpace",value:function(){return null===this._grip&&(this._grip=new Ei,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Q),this._grip}},{key:"dispatchEvent",value:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}},{key:"disconnect",value:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}},{key:"update",value:function(e,t,n){var r=null,i=null,o=null,a=this._targetRay,s=this._grip,u=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==a&&(null!==(r=t.getPose(e.targetRaySpace,n))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Ai))),u&&e.hand){o=!0;var l,c=S(e.hand.values());try{for(c.s();!(l=c.n()).done;){var h=l.value,d=t.getJointPose(h,n);if(void 0===u.joints[h.jointName]){var f=new Ei;f.matrixAutoUpdate=!1,f.visible=!1,u.joints[h.jointName]=f,u.add(f)}var p=u.joints[h.jointName];null!==d&&(p.matrix.fromArray(d.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=d.radius),p.visible=null!==d}}catch(e){c.e(e)}finally{c.f()}var v=u.joints["index-finger-tip"],m=u.joints["thumb-tip"],g=v.position.distanceTo(m.position);u.inputState.pinching&&g>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&g<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==u&&(u.visible=null!==o),this}}]),e}(),Ci=function(e){p(n,e);var t=m(n);function n(e,r){var i;_(this,n);var o=y(i=t.call(this)),a=e.state,s=null,u=1,c=null,h="local-floor",d=null,f=null,p=null,v=null,m=[],g=new Map,b=new an;b.layers.enable(1),b.viewport=new V;var x=new an;x.layers.enable(2),x.viewport=new V;var w=[b,x],T=new Si;T.layers.enable(1),T.layers.enable(2);var M=null,S=null;function E(e){var t=g.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function A(){g.forEach((function(e,t){e.disconnect(t)})),g.clear(),M=null,S=null,a.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),P.stop(),o.isPresenting=!1,o.dispatchEvent({type:"sessionend"})}function I(e){for(var t=s.inputSources,n=0;n0&&(e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)}(e,r,a):n(e,r)):r.isMeshMatcapMaterial?(t(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDepthMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDistanceMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?(t(e,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){var i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,o):r.isSpriteMaterial?function(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ki(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=void 0!==e.canvas?e.canvas:function(){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,u=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,d=null,f=[],p=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;var v=this,m=!1,g=0,y=0,b=null,x=-1,_=null,w=new V,T=new V,M=null,S=t.width,E=t.height,A=1,I=null,C=null,N=new V(0,0,S,E),k=new V(0,0,S,E),D=!1,P=[],O=new mn,R=!1,L=!1,j=null,B=new Se,U=new Q,z={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function F(){return null===b?A:1}var G,H,X,Z,q,J,K,$,ee,te,ne,re,ie,oe,ae,se,ue,le,ce,he,de,fe,pe=n;function ve(e,n){for(var r=0;r0&&Ie(r,e,t),i.length>0&&function(e,t,n,r){if(null===j){var i=!0===a&&!0===H.isWebGL2;j=new(i?Y:W)(1024,1024,{generateMipmaps:!0,type:null!==de.convert(1016)?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001})}var o=v.getRenderTarget();v.setRenderTarget(j),v.clear();var s=v.toneMapping;v.toneMapping=0,Ie(e,n,r),v.toneMapping=s,J.updateMultisampleRenderTarget(j),J.updateRenderTargetMipmap(j),v.setRenderTarget(o),Ie(t,n,r)}(r,i,e,t),o.length>0&&Ie(o,e,t),null!==b&&(J.updateMultisampleRenderTarget(b),J.updateRenderTargetMipmap(b)),!0===e.isScene&&e.onAfterRender(v,e,t),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),fe.resetDefaultState(),x=-1,_=null,p.pop(),d=p.length>0?p[p.length-1]:null,f.pop(),h=f.length>0?f[f.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return b},this.setRenderTarget=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;b=e,g=t,y=n,e&&void 0===q.get(e).__webglFramebuffer&&J.setupRenderTarget(e);var r=null,i=!1,o=!1;if(e){var a=e.texture;(a.isDataTexture3D||a.isDataTexture2DArray)&&(o=!0);var s=q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=s[t],i=!0):r=e.isWebGLMultisampleRenderTarget?q.get(e).__webglMultisampledFramebuffer:s,w.copy(e.viewport),T.copy(e.scissor),M=e.scissorTest}else w.copy(N).multiplyScalar(A).floor(),T.copy(k).multiplyScalar(A).floor(),M=D;if(X.bindFramebuffer(36160,r)&&H.drawBuffers){var u=!1;if(e)if(e.isWebGLMultipleRenderTargets){var l=e.texture;if(P.length!==l.length||36064!==P[0]){for(var c=0,h=l.length;c=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&pe.readPixels(t,n,r,i,de.convert(l),de.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{var d=null!==b?q.get(b).__webglFramebuffer:null;X.bindFramebuffer(36160,d)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r),a=de.convert(t.format);H.isWebGL2&&(6407===a&&(a=32849),6408===a&&(a=32856)),J.setTexture2D(t,0),pe.copyTexImage2D(3553,n,a,e.x,e.y,i,o,0),X.unbindTexture()},this.copyTextureToTexture=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.image.width,o=t.image.height,a=de.convert(n.format),s=de.convert(n.type);J.setTexture2D(n,0),pe.pixelStorei(37440,n.flipY),pe.pixelStorei(37441,n.premultiplyAlpha),pe.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?pe.texSubImage2D(3553,r,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?pe.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):pe.texSubImage2D(3553,r,e.x,e.y,a,s,t.image),0===r&&n.generateMipmaps&&pe.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(v.isWebGL1Renderer)console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");else{var o,a=e.max.x-e.min.x+1,s=e.max.y-e.min.y+1,u=e.max.z-e.min.z+1,l=de.convert(r.format),c=de.convert(r.type);if(r.isDataTexture3D)J.setTexture3D(r,0),o=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");J.setTexture2DArray(r,0),o=35866}pe.pixelStorei(37440,r.flipY),pe.pixelStorei(37441,r.premultiplyAlpha),pe.pixelStorei(3317,r.unpackAlignment);var h=pe.getParameter(3314),d=pe.getParameter(32878),f=pe.getParameter(3316),p=pe.getParameter(3315),m=pe.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;pe.pixelStorei(3314,g.width),pe.pixelStorei(32878,g.height),pe.pixelStorei(3316,e.min.x),pe.pixelStorei(3315,e.min.y),pe.pixelStorei(32877,e.min.z),n.isDataTexture||n.isDataTexture3D?pe.texSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,c,g.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),pe.compressedTexSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,g.data)):pe.texSubImage3D(o,i,t.x,t.y,t.z,a,s,u,l,c,g),pe.pixelStorei(3314,h),pe.pixelStorei(32878,d),pe.pixelStorei(3316,f),pe.pixelStorei(3315,p),pe.pixelStorei(32877,m),0===i&&r.generateMipmaps&&pe.generateMipmap(o),X.unbindTexture()}},this.initTexture=function(e){J.setTexture2D(e,0),X.unbindTexture()},this.resetState=function(){g=0,y=0,b=null,X.reset(),fe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}(function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n})(ki).prototype.isWebGL1Renderer=!0;var Di=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:y(e)})),e}return T(n,[{key:"copy",value:function(e,t){return f(x(n.prototype),"copy",this).call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}]),n}(qe);Di.prototype.isScene=!0;var Pi=function(){function e(t,n){_(this,e),this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=k()}return T(e,[{key:"onUploadCallback",value:function(){}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"copy",value:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}},{key:"copyAt",value:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"clone",value:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=k()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"toJSON",value:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=k()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();Pi.prototype.isInterleavedBuffer=!0;var Oi=new Q,Ri=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_(this,e),this.name="",this.data=t,this.itemSize=n,this.offset=r,this.normalized=!0===i}return T(e,[{key:"applyMatrix4",value:function(e){for(var t=0,n=this.data.count;te.far||t.push({distance:s,point:Bi.clone(),uv:st.getUV(Bi,Vi,Wi,Yi,Xi,Qi,Zi,new j),face:null,object:this})}}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}]),n}(qe);function Ji(e,t,n,r,i,o){Fi.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(Gi.x=o*Fi.x-i*Fi.y,Gi.y=i*Fi.x+o*Fi.y):Gi.copy(Fi),e.copy(t),e.x+=Gi.x,e.y+=Gi.y,e.applyMatrix4(Hi)}qi.prototype.isSprite=!0;var Ki=new Q,$i=new V,eo=new V,to=new Q,no=new Se,ro=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).type="SkinnedMesh",i.bindMode="attached",i.bindMatrix=new Se,i.bindMatrixInverse=new Se,i}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}},{key:"bind",value:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}},{key:"pose",value:function(){this.skeleton.pose()}},{key:"normalizeSkinWeights",value:function(){for(var e=new V,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1003,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1003,f=arguments.length>10?arguments[10]:void 0,p=arguments.length>11?arguments[11]:void 0;return _(this,n),(e=t.call(this,null,u,l,c,h,d,a,s,f,p)).image={data:r,width:i,height:o},e.magFilter=h,e.minFilter=d,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return n}(G);io.prototype.isDataTexture=!0;var oo=new Se,ao=new Se,so=[],uo=new Jt,lo=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,e,r)).instanceMatrix=new xt(new Float32Array(16*i),16),o.instanceColor=null,o.count=i,o.frustumCulled=!1,o}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}},{key:"getColorAt",value:function(e,t){t.fromArray(this.instanceColor.array,3*e)}},{key:"getMatrixAt",value:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)}},{key:"raycast",value:function(e,t){var n=this.matrixWorld,r=this.count;if(uo.geometry=this.geometry,uo.material=this.material,void 0!==uo.material)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new Pt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new co;return _(this,n),(e=t.call(this)).type="Line",e.geometry=r,e.material=i,e.updateMorphTargets(),e}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;rs)){h.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(h);be.far||t.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(var x=Math.max(0,o.start),_=Math.min(p.count,o.start+o.count)-1;x<_;x+=d)if(u.fromBufferAttribute(p,x),l.fromBufferAttribute(p,x+1),!(vo.distanceSqToSegment(u,l,h,c)>s)){h.applyMatrix4(this.matrixWorld);var w=e.ray.origin.distanceTo(h);we.far||t.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}},{key:"updateMorphTargets",value:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),n}(qe);go.prototype.isLine=!0;var yo=new Q,bo=new Q,xo=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).type="LineSegments",i}return T(n,[{key:"computeLineDistances",value:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r0&&void 0!==arguments[0]?arguments[0]:new Pt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wo;return _(this,n),(e=t.call(this)).type="Points",e.geometry=r,e.material=i,e.updateMorphTargets(),e}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.material=e.material,this.geometry=e.geometry,this}},{key:"raycast",value:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),So.copy(n.boundingSphere),So.applyMatrix4(r),So.radius+=i,!1!==e.ray.intersectsSphere(So)){To.copy(r).invert(),Mo.copy(e.ray).applyMatrix4(To);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a;if(n.isBufferGeometry){var u=n.index,l=n.attributes.position;if(null!==u)for(var c=Math.max(0,o.start),h=Math.min(u.count,o.start+o.count);c0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}]),n}(qe);function Io(e,t,n,r,i,o,a){var s=Mo.distanceSqToPoint(e);if(si.far)return;o.push({distance:l,distanceToRay:Math.sqrt(s),point:u,index:t,face:null,object:a})}}Ao.prototype.isPoints=!0,function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c){var h;_(this,n),(h=t.call(this,e,r,i,o,a,s,u,l,c)).format=void 0!==u?u:1022,h.minFilter=void 0!==s?s:1006,h.magFilter=void 0!==a?a:1006,h.generateMipmaps=!1;var d=y(h);return"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){d.needsUpdate=!0,e.requestVideoFrameCallback(t)})),h}return T(n,[{key:"clone",value:function(){return new this.constructor(this.image).copy(this)}},{key:"update",value:function(){var e=this.image;"requestVideoFrameCallback"in e==!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}]),n}(G).prototype.isVideoTexture=!0;var Co=function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c,h,d,f){var p;return _(this,n),(p=t.call(this,null,s,u,l,c,h,o,a,d,f)).image={width:r,height:i},p.mipmaps=e,p.flipY=!1,p.generateMipmaps=!1,p}return n}(G);Co.prototype.isCompressedTexture=!0,function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c){var h;return _(this,n),(h=t.call(this,e,r,i,o,a,s,u,l,c)).needsUpdate=!0,h}return n}(G).prototype.isCanvasTexture=!0,function(e){p(n,e);var t=m(n);function n(e,r,i,o,a,s,u,l,c,h){var d;if(_(this,n),1026!==(h=void 0!==h?h:1026)&&1027!==h)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),(d=t.call(this,null,o,a,s,u,l,h,i,c)).image={width:e,height:r},d.magFilter=void 0!==u?u:1003,d.minFilter=void 0!==l?l:1003,d.flipY=!1,d.generateMipmaps=!1,d}return n}(G).prototype.isDepthTexture=!0,new Q,new Q,new Q,new st;var No=function(){function e(){_(this,e),this.type="Curve",this.arcLengthDivisions=200}return T(e,[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=e;o++)i+=(t=this.getPoint(o/e)).distanceTo(r),n.push(i),r=t;return this.cacheArcLengths=n,n}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=r[i=Math.floor(s+(u-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(r[i=u]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)}},{key:"getTangent",value:function(e,t){var n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),o=this.getPoint(r),a=t||(i.isVector2?new j:new Q);return a.copy(o).sub(i).normalize(),a}},{key:"getTangentAt",value:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)}},{key:"computeFrenetFrames",value:function(e,t){for(var n=new Q,r=[],i=[],o=[],a=new Q,s=new Se,u=0;u<=e;u++){var l=u/e;r[u]=this.getTangentAt(l,new Q),r[u].normalize()}i[0]=new Q,o[0]=new Q;var c=Number.MAX_VALUE,h=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);h<=c&&(c=h,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),f<=c&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(var p=1;p<=e;p++){if(i[p]=i[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();var v=Math.acos(D(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(a,v))}o[p].crossVectors(r[p],i[p])}if(!0===t){var m=Math.acos(D(i[0].dot(i[e]),-1,1));m/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(m=-m);for(var g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],m*g)),o[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:o}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}]),e}(),ko=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return _(this,n),(e=t.call(this)).type="EllipseCurve",e.aX=r,e.aY=i,e.xRadius=o,e.yRadius=a,e.aStartAngle=s,e.aEndAngle=u,e.aClockwise=l,e.aRotation=c,e}return T(n,[{key:"getPoint",value:function(e,t){for(var n=t||new j,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)r;)i-=r;i0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return _(this,n),(e=t.call(this)).type="CatmullRomCurve3",e.points=r,e.closed=i,e.curveType=o,e.tension=a,e}return T(n,[{key:"getPoint",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,i=r,o=this.points,a=o.length,s=(a-(this.closed?0:1))*e,u=Math.floor(s),l=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/a)+1)*a:0===l&&u===a-1&&(u=a-2,l=1),this.closed||u>0?t=o[(u-1)%a]:(Oo.subVectors(o[0],o[1]).add(o[0]),t=Oo);var c=o[u%a],h=o[(u+1)%a];if(this.closed||u+20&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new j,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new j;return _(this,n),(e=t.call(this)).type="CubicBezierCurve",e.v0=r,e.v1=i,e.v2=o,e.v3=a,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,n=t,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Fo(e,r.x,i.x,o.x,a.x),Fo(e,r.y,i.y,o.y,a.y)),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),n}(No);Go.prototype.isCubicBezierCurve=!0;var Ho=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Q,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Q;return _(this,n),(e=t.call(this)).type="CubicBezierCurve3",e.v0=r,e.v1=i,e.v2=o,e.v3=a,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,n=t,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Fo(e,r.x,i.x,o.x,a.x),Fo(e,r.y,i.y,o.y,a.y),Fo(e,r.z,i.z,o.z,a.z)),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}]),n}(No);Ho.prototype.isCubicBezierCurve3=!0;var Vo=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j;return _(this,n),(e=t.call(this)).type="LineCurve",e.v1=r,e.v2=i,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e,t){var n=t||new j;return n.copy(this.v2).sub(this.v1).normalize(),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),n}(No);Vo.prototype.isLineCurve=!0;var Wo=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new j,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new j;return _(this,n),(e=t.call(this)).type="QuadraticBezierCurve",e.v0=r,e.v1=i,e.v2=o,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,n=t,r=this.v0,i=this.v1,o=this.v2;return n.set(zo(e,r.x,i.x,o.x),zo(e,r.y,i.y,o.y)),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),n}(No);Wo.prototype.isQuadraticBezierCurve=!0;var Yo=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Q,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Q;return _(this,n),(e=t.call(this)).type="QuadraticBezierCurve3",e.v0=r,e.v1=i,e.v2=o,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,n=t,r=this.v0,i=this.v1,o=this.v2;return n.set(zo(e,r.x,i.x,o.x),zo(e,r.y,i.y,o.y),zo(e,r.z,i.z,o.z)),n}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),n}(No);Yo.prototype.isQuadraticBezierCurve3=!0;var Xo=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return _(this,n),(e=t.call(this)).type="SplineCurve",e.points=r,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new j,n=t,r=this.points,i=(r.length-1)*e,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],u=r[o],l=r[o>r.length-2?r.length-1:o+1],c=r[o>r.length-3?r.length-1:o+2];return n.set(Uo(a,s.x,u.x,l.x,c.x),Uo(a,s.y,u.y,l.y,c.y)),n}},{key:"copy",value:function(e){f(x(n.prototype),"copy",this).call(this,e),this.points=[];for(var t=0,r=e.points.length;t0&&void 0!==arguments[0]?arguments[0]:new Q,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q;return _(this,n),(e=t.call(this)).type="LineCurve3",e.isLineCurve3=!0,e.v1=r,e.v2=i,e}return T(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Q,n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}]),n}(No),QuadraticBezierCurve:Wo,QuadraticBezierCurve3:Yo,SplineCurve:Xo});function Zo(e,t,n,r,i){var o,a;if(i===function(e,t,n,r){for(var i=0,o=t,a=n-r;o0)for(o=t;o=t;o-=r)a=ma(o,e[o],e[o+1],a);return a&&ca(a,a.next)&&(ga(a),a=a.next),a}function qo(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!ca(r,r.next)&&0!==la(r.prev,r,r.next))r=r.next;else{if(ga(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Jo(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=oa(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,u,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,o);for(var s,u,l=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?$o(e,r,i,o):Ko(e))t.push(s.i/n),t.push(e.i/n),t.push(u.i/n),ga(e),e=u.next,l=u.next;else if((e=u)===l){a?1===a?Jo(e=ea(qo(e),t,n),t,n,r,i,o,2):2===a&&ta(e,t,n,r,i,o):Jo(qo(e),t,n,r,i,o,1);break}}}function Ko(e){var t=e.prev,n=e,r=e.next;if(la(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(sa(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&la(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function $o(e,t,n,r){var i=e.prev,o=e,a=e.next;if(la(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=oa(s,u,t,n,r),d=oa(l,c,t,n,r),f=e.prevZ,p=e.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&la(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&la(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&la(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&sa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&la(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function ea(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!ca(i,o)&&ha(i,r,r.next,o)&&pa(i,o)&&pa(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),ga(r),ga(r.next),r=e=o),r=r.next}while(r!==e);return qo(r)}function ta(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ua(a,s)){var u=va(a,s);return a=qo(a,a.next),u=qo(u,u.next),Jo(a,t,n,r,i,o),void Jo(u,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function na(e,t){return e.x-t.x}function ra(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=c&&i!==r.x&&sa(on.x||r.x===n.x&&ia(n,r)))&&(n=r,d=u)),r=r.next}while(r!==l);return n}(e,t)){var n=va(t,e);qo(t,t.next),qo(n,n.next)}}function ia(e,t){return la(e.prev,e,t.prev)<0&&la(t.next,e,e.next)<0}function oa(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function aa(e){var t=e,n=e;do{(t.x=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function ua(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ha(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(pa(e,t)&&pa(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(la(e.prev,e,t.prev)||la(e,t.prev,t))||ca(e,t)&&la(e.prev,e,e.next)>0&&la(t.prev,t,t.next)>0)}function la(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ca(e,t){return e.x===t.x&&e.y===t.y}function ha(e,t,n,r){var i=fa(la(e,t,n)),o=fa(la(e,t,r)),a=fa(la(n,r,e)),s=fa(la(n,r,t));return i!==o&&a!==s||!(0!==i||!da(e,n,t))||!(0!==o||!da(e,r,t))||!(0!==a||!da(n,e,r))||!(0!==s||!da(n,t,r))}function da(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function fa(e){return e>0?1:e<0?-1:0}function pa(e,t){return la(e.prev,e,e.next)<0?la(e,t,e.next)>=0&&la(e,e.prev,t)>=0:la(e,t,e.prev)<0||la(e,e.next,t)<0}function va(e,t){var n=new ya(e.i,e.x,e.y),r=new ya(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function ma(e,t,n,r){var i=new ya(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ga(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ya(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var ba=function(){function e(){_(this,e)}return T(e,null,[{key:"area",value:function(e){for(var t=e.length,n=0,r=t-1,i=0;i2&&void 0!==arguments[2]?arguments[2]:2,c=t&&t.length,h=c?t[0]*l:e.length,d=Zo(e,0,h,l,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(e,t,n,r){var i,o,a,s=[];for(i=0,o=t.length;i80*l){n=i=e[0],r=o=e[1];for(var p=l;pi&&(i=a),s>o&&(o=s);u=0!==(u=Math.max(i-n,o-r))?1/u:0}return Jo(d,f,l,n,r,u),f}(n,r),u=0;u2&&e[t-1].equals(e[0])&&e.pop()}function _a(e,t){for(var n=0;nNumber.EPSILON){var d=Math.sqrt(c),f=Math.sqrt(u*u+l*l),p=t.x-s/d,v=t.y+a/d,m=((n.x-l/f-p)*l-(n.y+u/f-v)*u)/(a*l-s*u),g=(r=p+a*m-e.x)*r+(i=v+s*m-e.y)*i;if(g<=2)return new j(r,i);o=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?u>Number.EPSILON&&(y=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(r=-s,i=a,o=Math.sqrt(c)):(r=a,i=s,o=Math.sqrt(c/2))}return new j(r/o,i/o)}for(var B=[],U=0,z=C.length,F=z-1,G=U+1;U=0;be--){for(var xe=be/f,_e=c*Math.cos(xe*Math.PI/2),we=h*Math.sin(xe*Math.PI/2)+d,Te=0,Me=C.length;Te=0;){var r=n,o=n-1;o<0&&(o=e.length-1);for(var a=0,s=i+2*f;a1&&void 0!==arguments[1]?arguments[1]:12;_(this,n),(r=t.call(this)).type="ShapeGeometry",r.parameters={shapes:e,curveSegments:i};var o=[],a=[],s=[],u=[],l=0,c=0;if(!1===Array.isArray(e))d(e);else for(var h=0;h4&&void 0!==arguments[4]?arguments[4]:30,o=e.clone();o.name=t;for(var a=[],s=0;s=r)){c.push(u.times[d]);for(var p=0;po.tracks[m].times[0]&&(v=o.tracks[m].times[0]);for(var g=0;g1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);for(var i=n.tracks.length,o=t/r,a=function(t){var r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)return"continue";var a=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===a)return"continue";var s=0,u=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=u/3);var l=0,c=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=c/3);var h=r.times.length-1,d=void 0;if(o<=r.times[0]){var f=s,p=u-s;d=Ra.arraySlice(r.values,f,p)}else if(o>=r.times[h]){var v=h*u+s,m=v+u-s;d=Ra.arraySlice(r.values,v,m)}else{var g=r.createInterpolant(),y=s,b=u-s;g.evaluate(o),d=Ra.arraySlice(g.resultBuffer,y,b)}"quaternion"===i&&(new X).fromArray(d).normalize().conjugate().toArray(d);for(var x=a.times.length,_=0;_=i)break e;var s=t[1];e=(i=t[--n-1]))break t}o=n,n=0}for(;n>>1;et;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Ra.arraySlice(n,i,o),this.values=Ra.arraySlice(this.values,i*a,o*a)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&Ra.isTypedArray(r))for(var u=0,l=r.length;u!==l;++u){var c=r[u];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,c),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=Ra.arraySlice(this.times),t=Ra.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=e.length-1,o=1,a=1;a0){e[o]=e[i];for(var g=i*n,y=o*n,b=0;b!==n;++b)t[y+b]=t[g+b];++o}return o!==e.length?(this.times=Ra.arraySlice(e,0,o),this.values=Ra.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=Ra.arraySlice(this.times,0),t=Ra.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}],[{key:"toJSON",value:function(e){var t,n=e.constructor;if(n.toJSON!==this.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Ra.convertArray(e.times,Array),values:Ra.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}]),e}();za.prototype.TimeBufferType=Float32Array,za.prototype.ValueBufferType=Float32Array,za.prototype.DefaultInterpolation=2301;var Fa=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(za);Fa.prototype.ValueTypeName="bool",Fa.prototype.ValueBufferType=Array,Fa.prototype.DefaultInterpolation=2300,Fa.prototype.InterpolantFactoryMethodLinear=void 0,Fa.prototype.InterpolantFactoryMethodSmooth=void 0;var Ga=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(za);Ga.prototype.ValueTypeName="color";var Ha=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(za);Ha.prototype.ValueTypeName="number";var Va=function(e){p(n,e);var t=m(n);function n(e,r,i,o){return _(this,n),t.call(this,e,r,i,o)}return T(n,[{key:"interpolate_",value:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-t)/(r-t),u=e*a,l=u+a;u!==l;u+=4)X.slerpFlat(i,0,o,u-a,o,u,s);return i}}]),n}(La),Wa=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return T(n,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new Va(this.times,this.values,this.getValueSize(),e)}}]),n}(za);Wa.prototype.ValueTypeName="quaternion",Wa.prototype.DefaultInterpolation=2301,Wa.prototype.InterpolantFactoryMethodSmooth=void 0;var Ya=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(za);Ya.prototype.ValueTypeName="string",Ya.prototype.ValueBufferType=Array,Ya.prototype.DefaultInterpolation=2300,Ya.prototype.InterpolantFactoryMethodLinear=void 0,Ya.prototype.InterpolantFactoryMethodSmooth=void 0;var Xa=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(za);Xa.prototype.ValueTypeName="vector";var Qa=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2500;_(this,e),this.name=t,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=k(),this.duration<0&&this.resetDuration()}return T(e,[{key:"resetDuration",value:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this}},{key:"trim",value:function(){for(var e=0;e1){var l=u[1],c=r[l];c||(r[l]=c=[]),c.push(s)}}var h=[];for(var d in r)h.push(this.CreateFromMorphTargetSequence(d,r[d],t,n));return h}},{key:"parseAnimation",value:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var o=[],a=[];Ra.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode,s=e.length||-1,u=e.hierarchy||[],l=0;l0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}]),n}(Ka),is=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return T(n,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Vo(t,e))}},{key:"getPoint",value:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r=t){var i=n[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n0&&void 0!==arguments[0]?arguments[0]:40,t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}},{key:"getPoints",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[],r=0,i=this.curves;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}},{key:"copy",value:function(e){f(x(n.prototype),"copy",this).call(this,e),this.curves=[];for(var t=0,r=e.curves.length;t0){var l=u.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(u);var c=u.getPoint(1);return this.currentPoint.copy(c),this}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return f(x(n.prototype),"fromJSON",this).call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}]),n}(is),as=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).uuid=k(),r.type="Shape",r.holes=[],r}return T(n,[{key:"getPointsHoles",value:function(e){for(var t=[],n=0,r=this.holes.length;n1&&void 0!==arguments[1]?arguments[1]:1;return _(this,n),(r=t.call(this)).type="Light",r.color=new mt(e),r.intensity=i,r}return T(n,[{key:"dispose",value:function(){}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}]),n}(qe);ss.prototype.isLight=!0;var us=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,e,i)).type="HemisphereLight",o.position.copy(qe.DefaultUp),o.updateMatrix(),o.groundColor=new mt(r),o}return T(n,[{key:"copy",value:function(e){return ss.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}]),n}(ss);us.prototype.isHemisphereLight=!0;var ls=new Se,cs=new Q,hs=new Q,ds=function(){function e(t){_(this,e),this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new j(512,512),this.map=null,this.mapPass=null,this.matrix=new Se,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new mn,this._frameExtents=new j(1,1),this._viewportCount=1,this._viewports=[new V(0,0,1,1)]}return T(e,[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(e){var t=this.camera,n=this.matrix;cs.setFromMatrixPosition(e.matrixWorld),t.position.copy(cs),hs.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(hs),t.updateMatrixWorld(),ls.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ls),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}},{key:"getViewport",value:function(e){return this._viewports[e]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"dispose",value:function(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}},{key:"copy",value:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}]),e}(),fs=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this,new an(50,1,.5,500))).focus=1,e}return T(n,[{key:"updateMatrices",value:function(e){var t=this.camera,r=2*N*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;r===t.fov&&i===t.aspect&&o===t.far||(t.fov=r,t.aspect=i,t.far=o,t.updateProjectionMatrix()),f(x(n.prototype),"updateMatrices",this).call(this,e)}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.focus=e.focus,this}}]),n}(ds);fs.prototype.isSpotLightShadow=!0;var ps=function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;return _(this,n),(i=t.call(this,e,r)).type="SpotLight",i.position.copy(qe.DefaultUp),i.updateMatrix(),i.target=new qe,i.distance=o,i.angle=a,i.penumbra=s,i.decay=u,i.shadow=new fs,i}return T(n,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},{key:"power",get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}]),n}(ss);ps.prototype.isSpotLight=!0;var vs=new Se,ms=new Q,gs=new Q,ys=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this,new an(90,1,.5,500)))._frameExtents=new j(4,2),e._viewportCount=6,e._viewports=[new V(2,1,1,1),new V(0,1,1,1),new V(3,1,1,1),new V(1,1,1,1),new V(3,0,1,1),new V(1,0,1,1)],e._cubeDirections=[new Q(1,0,0),new Q(-1,0,0),new Q(0,0,1),new Q(0,0,-1),new Q(0,1,0),new Q(0,-1,0)],e._cubeUps=[new Q(0,1,0),new Q(0,1,0),new Q(0,1,0),new Q(0,1,0),new Q(0,0,1),new Q(0,0,-1)],e}return T(n,[{key:"updateMatrices",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),ms.setFromMatrixPosition(e.matrixWorld),n.position.copy(ms),gs.copy(n.position),gs.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(gs),n.updateMatrixWorld(),r.makeTranslation(-ms.x,-ms.y,-ms.z),vs.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vs)}}]),n}(ds);ys.prototype.isPointLightShadow=!0;var bs=function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return _(this,n),(i=t.call(this,e,r)).type="PointLight",i.distance=o,i.decay=a,i.shadow=new ys,i}return T(n,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},{key:"power",get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}]),n}(ss);bs.prototype.isPointLight=!0;var xs=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return _(this,n),(e=t.call(this)).type="OrthographicCamera",e.zoom=1,e.view=null,e.left=r,e.right=i,e.top=o,e.bottom=a,e.near=s,e.far=u,e.updateProjectionMatrix(),e}return T(n,[{key:"copy",value:function(e,t){return f(x(n.prototype),"copy",this).call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}},{key:"setViewOffset",value:function(e,t,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,o=n+e,a=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var u=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=u*this.view.offsetX)+u*this.view.width,s=(a-=l*this.view.offsetY)-l*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}]),n}(on);xs.prototype.isOrthographicCamera=!0;var _s=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.call(this,new xs(-5,5,5,-5,.5,500))}return n}(ds);_s.prototype.isDirectionalLightShadow=!0;var ws=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).type="DirectionalLight",i.position.copy(qe.DefaultUp),i.updateMatrix(),i.target=new qe,i.shadow=new _s,i}return T(n,[{key:"dispose",value:function(){this.shadow.dispose()}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}]),n}(ss);ws.prototype.isDirectionalLight=!0;var Ts=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).type="AmbientLight",i}return n}(ss);Ts.prototype.isAmbientLight=!0;var Ms=function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return _(this,n),(i=t.call(this,e,r)).type="RectAreaLight",i.width=o,i.height=a,i}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.width=e.width,this.height=e.height,this}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}]),n}(ss);Ms.prototype.isRectAreaLight=!0;var Ss=function(){function e(){_(this,e),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new Q)}return T(e,[{key:"set",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}},{key:"zero",value:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}},{key:"getAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],n*r*1.092548),t.addScaledVector(o[5],r*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7],n*i*1.092548),t.addScaledVector(o[8],.546274*(n*n-r*r)),t}},{key:"getIrradianceAt",value:function(e,t){var n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*r),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*n),t.addScaledVector(o[4],.858086*n*r),t.addScaledVector(o[5],.858086*r*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*n*i),t.addScaledVector(o[8],.429043*(n*n-r*r)),t}},{key:"add",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}},{key:"addScaledSH",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}},{key:"scale",value:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}},{key:"lerp",value:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}},{key:"equals",value:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}},{key:"copy",value:function(e){return this.set(e.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}},{key:"toArray",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}],[{key:"getBasisAt",value:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}]),e}();Ss.prototype.isSphericalHarmonics3=!0;var Es=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ss,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return _(this,n),(e=t.call(this,void 0,i)).sh=r,e}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.sh.copy(e.sh),this}},{key:"fromJSON",value:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.object.sh=this.sh.toArray(),t}}]),n}(ss);Es.prototype.isLightProbe=!0;var As=function(){function e(){_(this,e)}return T(e,null,[{key:"decodeText",value:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n3&&void 0!==arguments[3]?arguments[3]:1;return _(this,n),"number"==typeof i&&(a=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),(o=t.call(this,e,r,i)).meshPerAttribute=a,o}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"toJSON",value:function(){var e=f(x(n.prototype),"toJSON",this).call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}]),n}(xt);Ns.prototype.isInstancedBufferAttribute=!0,function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),r=t.call(this,e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),r.options={premultiplyAlpha:"none"},r}return T(n,[{key:"setOptions",value:function(e){return this.options=e,this}},{key:"load",value:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=qa.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;var a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){qa.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}]),n}(Ka).prototype.isImageBitmapLoader=!0;var ks=function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,e)}return T(n,[{key:"load",value:function(e,t,n,r){var i=this,o=new es(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{var o=n.slice(0);(void 0===Cs&&(Cs=new(window.AudioContext||window.webkitAudioContext)),Cs).decodeAudioData(o,(function(e){t(e)}))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}}]),n}(Ka);(function(e){p(n,e);var t=m(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;_(this,n),i=t.call(this,void 0,o);var a=(new mt).set(e),s=(new mt).set(r),u=new Q(a.r,a.g,a.b),l=new Q(s.r,s.g,s.b),c=Math.sqrt(Math.PI),h=c*Math.sqrt(.75);return i.sh.coefficients[0].copy(u).add(l).multiplyScalar(c),i.sh.coefficients[1].copy(u).sub(l).multiplyScalar(h),i}return n})(Es).prototype.isHemisphereLightProbe=!0,function(e){p(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;_(this,n),r=t.call(this,void 0,i);var o=(new mt).set(e);return r.sh.coefficients[0].set(o.r,o.g,o.b).multiplyScalar(2*Math.sqrt(Math.PI)),r}return n}(Es).prototype.isAmbientLightProbe=!0;var Ds=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).type="Audio",r.listener=e,r.context=e.context,r.gain=r.context.createGain(),r.gain.connect(e.getInput()),r.autoplay=!1,r.buffer=null,r.detune=0,r.loop=!1,r.loopStart=0,r.loopEnd=0,r.offset=0,r.duration=void 0,r.playbackRate=1,r.isPlaying=!1,r.hasPlaybackControl=!0,r.source=null,r.sourceType="empty",r._startedAt=0,r._progress=0,r._connected=!1,r.filters=[],r}return T(n,[{key:"getOutput",value:function(){return this.gain}},{key:"setNodeSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}},{key:"setMediaElementSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}},{key:"setMediaStreamSource",value:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}},{key:"setBuffer",value:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")}},{key:"pause",value:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"stop",value:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"connect",value:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var u=t,l=t+t;u!==l;++u)if(n[u]!==n[u+t]){a.setValue(n,r);break}}},{key:"saveOriginalState",value:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,o=r;i!==o;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}},{key:"restoreOriginalState",value:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)}},{key:"_setAdditiveIdentityNumeric",value:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n=.5)for(var o=0;o!==i;++o)e[t+o]=e[n+o]}},{key:"_slerp",value:function(e,t,n,r){X.slerpFlat(e,t,e,t,e,n,r)}},{key:"_slerpAdditive",value:function(e,t,n,r,i){var o=this._workIndex*i;X.multiplyQuaternionsFlat(e,o,e,t,e,n),X.slerpFlat(e,t,e,t,e,o,r)}},{key:"_lerp",value:function(e,t,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[n+a]*r}}},{key:"_lerpAdditive",value:function(e,t,n,r,i){for(var o=0;o!==i;++o){var a=t+o;e[a]=e[a]+e[n+o]*r}}}]),e}(),Os=new RegExp("[\\[\\]\\.:\\/]","g"),Rs="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Ls=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),js=/(WCOD+)?/.source.replace("WCOD",Rs),Bs=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Us=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),zs=new RegExp("^"+Ls+js+Bs+Us+"$"),Fs=["material","materials","bones"],Gs=function(){function e(t,n,r){_(this,e),this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}return T(e,[{key:"_getValue_unavailable",value:function(){}},{key:"_setValue_unavailable",value:function(){}},{key:"_getValue_direct",value:function(e,t){e[t]=this.node[this.propertyName]}},{key:"_getValue_array",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]}},{key:"_getValue_arrayElement",value:function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}},{key:"_getValue_toArray",value:function(e,t){this.resolvedProperty.toArray(e,t)}},{key:"_setValue_direct",value:function(e,t){this.targetObject[this.propertyName]=e[t]}},{key:"_setValue_direct_setNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_direct_setMatrixWorldNeedsUpdate",value:function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_array",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]}},{key:"_setValue_array_setNeedsUpdate",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}},{key:"_setValue_array_setMatrixWorldNeedsUpdate",value:function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_arrayElement",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}},{key:"_setValue_arrayElement_setNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}},{key:"_setValue_arrayElement_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_setValue_fromArray",value:function(e,t){this.resolvedProperty.fromArray(e,t)}},{key:"_setValue_fromArray_setNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}},{key:"_setValue_fromArray_setMatrixWorldNeedsUpdate",value:function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}},{key:"_getValue_unbound",value:function(e,t){this.bind(),this.getValue(e,t)}},{key:"_setValue_unbound",value:function(e,t){this.bind(),this.setValue(e,t)}},{key:"bind",value:function(){var t=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,o=n.propertyIndex;if(t||(t=e.findNode(this.rootNode,n.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(r){var a=n.objectIndex;switch(r){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.blendMode;_(this,e),this._mixer=t,this._clip=n,this._localRoot=r,this.blendMode=i;for(var o=n.tracks,a=o.length,s=new Array(a),u={endingStart:2400,endingEnd:2400},l=0;l!==a;++l){var c=o[l].createInterpolant(null);s[l]=c,c.settings=u}this._interpolantSettings=u,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}return T(e,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(e){return this._startTime=e,this}},{key:"setLoop",value:function(e,t){return this.loop=e,this.repetitions=t,this}},{key:"setEffectiveWeight",value:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(e){return this._scheduleFading(e,0,1)}},{key:"fadeOut",value:function(e){return this._scheduleFading(e,1,0)}},{key:"crossFadeFrom",value:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,o=i/r,a=r/i;e.warp(1,o,t),this.warp(a,1,t)}return this}},{key:"crossFadeTo",value:function(e,t,n){return e.crossFadeFrom(this,t,n)}},{key:"stopFading",value:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"setEffectiveTimeScale",value:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}},{key:"syncWith",value:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}},{key:"halt",value:function(e){return this.warp(this._effectiveTimeScale,0,e)}},{key:"warp",value:function(e,t,n){var r=this._mixer,i=r.time,o=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,u=a.sampleValues;return s[0]=i,s[1]=i+n,u[0]=e/o,u[1]=t/o,this}},{key:"stopWarping",value:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(e-i)*n;if(o<0||0===n)return;this._startTime=null,t=n*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0){var u=this._interpolants,l=this._propertyBindings;if(2501===this.blendMode)for(var c=0,h=u.length;c!==h;++c)u[c].evaluate(a),l[c].accumulateAdditive(s);else for(var d=0,f=u.length;d!==f;++d)u[d].evaluate(a),l[d].accumulate(r,s)}}else this._updateWeight(e)}},{key:"_updateWeight",value:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}},{key:"_updateTimeScale",value:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}},{key:"_updateTime",value:function(e){var t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,o=2202===n;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=t||r<0){var a=Math.floor(r/t);r-=t*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&1==(1&i))return t-r}return r}},{key:"_setEndings",value:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}},{key:"_scheduleFading",value:function(e,t,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this}}]),e}();(function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this))._root=e,r._initMemoryManager(),r._accuIndex=0,r.time=0,r.timeScale=1,r}return T(n,[{key:"_bindAction",value:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,u=this._bindingsByRootAndName,l=u[s];void 0===l&&(l={},u[s]=l);for(var c=0;c!==i;++c){var h=r[c],d=h.name,f=l[d];if(void 0!==f)o[c]=f;else{if(void 0!==(f=o[c])){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=t&&t._propertyBindings[c].binding.parsedPath;++(f=new Ps(Gs.create(n,d,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(f,s,d),o[c]=f}a[c].resultBuffer=f.buffer}}},{key:"_activateAction",value:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}},{key:"_deactivateAction",value:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}},{key:"_initMemoryManager",value:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}},{key:"_isActiveAction",value:function(e){var t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}},{key:"update",value:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==n;++a)t[a]._update(r,e,i,o);for(var s=this._bindings,u=this._nActiveBindings,l=0;l!==u;++l)s[l].apply(o);return this}},{key:"setTime",value:function(e){this.time=0;for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:1;return _(this,n),(i=t.call(this,e,r)).meshPerAttribute=o,i}return T(n,[{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}},{key:"clone",value:function(e){var t=f(x(n.prototype),"clone",this).call(this,e);return t.meshPerAttribute=this.meshPerAttribute,t}},{key:"toJSON",value:function(e){var t=f(x(n.prototype),"toJSON",this).call(this,e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}]),n}(Pi).prototype.isInstancedInterleavedBuffer=!0,new j,new Q,new Q,function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this)).material=e,r.render=function(){},r.hasPositions=!1,r.hasNormals=!1,r.hasColors=!1,r.hasUvs=!1,r.positionArray=null,r.normalArray=null,r.colorArray=null,r.uvArray=null,r.count=0,r}return n}(qe).prototype.isImmediateRenderObject=!0;var Vs=new Q,Ws=new Se,Ys=new Se,Xs=new Float32Array(1);new Int32Array(Xs.buffer);var Qs=[.125,.215,.35,.446,.526,.582],Zs=5+Qs.length,qs=new gt({side:1,depthWrite:!1,depthTest:!1});new Jt(new $t,qs),function(){for(var e=[],t=[],n=[],r=8,i=0;i4?a=Qs[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),u=-s/2,l=1+s/2,c=[u,u,l,u,l,l,u,u,l,l,u,l],h=new Float32Array(108),d=new Float32Array(72),f=new Float32Array(36),p=0;p<6;p++){var v=p%3*2/3-1,m=p>2?0:-1,g=[v,m,0,v+2/3,m,0,v+2/3,m+1,0,v,m,0,v+2/3,m+1,0,v,m+1,0];h.set(g,18*p),d.set(c,12*p);var y=[p,p,p,p,p,p];f.set(y,6*p)}var b=new Pt;b.setAttribute("position",new xt(h,3)),b.setAttribute("uv",new xt(d,2)),b.setAttribute("faceIndex",new xt(f,1)),e.push(b),r>4&&r--}}(),No.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(No.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},os.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;_(this,n),o=new mt(o),a=new mt(a);for(var s=i/2,u=r/i,l=r/2,c=[],h=[],d=0,f=0,p=-l;d<=i;d++,p+=u){c.push(-l,0,p,l,0,p),c.push(p,0,-l,p,0,l);var v=d===s?o:a;v.toArray(h,f),f+=3,v.toArray(h,f),f+=3,v.toArray(h,f),f+=3,v.toArray(h,f),f+=3}var m=new Pt;return m.setAttribute("position",new Mt(c,3)),m.setAttribute("color",new Mt(h,3)),(e=t.call(this,m,new co({vertexColors:!0,toneMapped:!1}))).type="GridHelper",e}return n}(xo).prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n);for(var i=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r=.3&&e<.7){var n=(e-.3)/.4;this.isRight?(this.group.position.z=-1*(.25*this.height+.55*this.height*n),this.group.position.x=-1*(this.width+this.gap)*n):(this.group.position.z=-1*(.25*this.height+.55*this.height*n),this.group.position.x=(this.width+this.gap)*n)}else{var r=(e-.7)/.3;this.isRight?(this.group.position.x=-1*(this.width+this.gap),this.group.position.z=.8*this.height*-1*(1-r),this.group.rotation.y=Math.PI/12*-1*(1-r)):(this.group.position.x=this.width+this.gap,this.group.position.z=.8*this.height*-1*(1-r),this.group.rotation.y=Math.PI/12*(1-r))}}},{key:"isRight",get:function(){var e=this.options.find((function(e){return"dir"===e.name}));return!e||"r"===e.value}}]),e}(),Switch:function(){function e(){_(this,e),this.camera=new Ru,this.duration=6e3,this.options=[],this.prevMesh=new Jt,this.nextMesh=new Jt,this.width=100,this.height=100,this.depth=1,this.prevDepth=1}return T(e,[{key:"addObjects",value:function(e){e.add(this.prevMesh),e.add(this.nextMesh)}},{key:"dispose",value:function(){Array.isArray(this.prevMesh.material)?this.prevMesh.material.forEach((function(e){return e.dispose()})):this.prevMesh.material.dispose(),this.prevMesh.geometry.dispose(),Array.isArray(this.nextMesh.material)?this.nextMesh.material.forEach((function(e){return e.dispose()})):this.nextMesh.material.dispose(),this.nextMesh.geometry.dispose()}},{key:"setNextTexture",value:function(e){var t=new gt({map:e});this.nextMesh.material=t}},{key:"setPrevTexture",value:function(e){var t=new gt({map:e});this.prevMesh.material=t}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.camera.focus(this.prevMesh,t),this.width=e,this.height=t,this.depth=t/2;var n=new bn(e,t,1,1);this.prevMesh.geometry=n;var r=new bn(e,t,1,1);this.nextMesh.geometry=r,this.prevDepth=this.prevMesh.position.z}},{key:"updateAnimation",value:function(e){var t=this.options.find((function(e){return"dir"===e.name}));if(e<.5){var n=e/.5;this.prevMesh.position.x=this.width/2*n,this.prevMesh.rotation.y=-Math.PI/10*n,this.nextMesh.position.x=-this.width/2*n,this.nextMesh.rotation.y=Math.PI/10*n,this.nextMesh.position.z=this.prevDepth-this.depth*(1-n)}else{var r=(e-.5)/.5;this.prevMesh.position.x=this.width/2*(1-r),this.prevMesh.rotation.y=-Math.PI/10*(1-r),this.prevMesh.position.z=this.prevDepth-this.depth*r,this.nextMesh.position.x=-this.width/2*(1-r),this.nextMesh.rotation.y=Math.PI/10*(1-r)}if(t&&"l"===t.value)if(e<.5){var i=e/.5;this.prevMesh.position.x=-this.width/2*i,this.prevMesh.rotation.y=Math.PI/10*i,this.nextMesh.position.x=this.width/2*i,this.nextMesh.rotation.y=-Math.PI/10*i}else{var o=(e-.5)/.5;this.prevMesh.position.x=-this.width/2*(1-o),this.prevMesh.rotation.y=Math.PI/10*(1-o),this.nextMesh.position.x=this.width/2*(1-o),this.nextMesh.rotation.y=-Math.PI/10*(1-o)}}}]),e}(),Prism:function(){function e(){_(this,e),this.camera=new Ru,this.duration=6e3,this.preset=null,this.presetZ=0,this.mesh=new Jt,this.width=100,this.height=100}return T(e,[{key:"addObjects",value:function(e){this.mesh.geometry=this.box,e.add(this.mesh)}},{key:"dispose",value:function(){Array.isArray(this.mesh.material)?this.mesh.material.forEach((function(e){return e.dispose()})):this.mesh.material.dispose(),this.mesh.geometry.dispose()}},{key:"setNextTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new gt({map:e})),t.push(new gt({map:e})),t.push(new gt({map:e})),this.mesh.material=t}},{key:"setPrevTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new gt({map:e})),t.push(new gt({map:e})),t.push(new gt({map:e})),this.mesh.material=t}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.camera.focus(this.mesh,t),this.mesh.position.z-=e/2,this.width=e,this.height=t,this.box=new $t(e,t,e,1,1,1),this.mesh.geometry=this.box}},{key:"updateAnimation",value:function(e){null===this.preset&&(this.preset=e>0?0:Math.PI/2,this.presetZ=this.mesh.position.z);var t=Math.PI/2*e,n=(Math.sqrt(2)-1)*(this.width/2);this.mesh.rotation.y=this.preset+t,this.mesh.position.z=e<=.5?this.presetZ-e/.5*n:this.presetZ-(1-(e-.5)/.5)*n}}]),e}(),Doors:function(){function e(){_(this,e),this.camera=new Ru,this.duration=1600,this.options=[],this.width=100,this.preMaterial=new rn({fragmentShader:kl.a,vertexShader:Cl.a,uniforms:{prevTexture:{value:ou},timePercent:{value:0},offset:{value:0}}}),this.prevGeometry=new Pt,this.prevMesh=new Jt,this.nextMesh=new Jt}return T(e,[{key:"addObjects",value:function(e){this.prevMesh.material=this.preMaterial,this.prevMesh.geometry=this.prevGeometry,this.prevMesh.material.transparent=!0,e.add(this.prevMesh),e.add(this.nextMesh)}},{key:"setNextTexture",value:function(e){this.nextMesh.material=new gt({map:e})}},{key:"setPrevTexture",value:function(e){this.preMaterial.uniforms.prevTexture.value=e}},{key:"setSize",value:function(e,t){this.width=e,this.camera.updateAspect(e,t),this.camera.focus(this.prevMesh,t);var n=e/2,r=t/2;this.preMaterial.uniforms.offset.value=e/2,this.prevGeometry.setIndex([0,1,2,3,4,5,6,7,8,9,10,11]);var i=this.options.find((function(e){return"dir"===e.name})),o=i&&"vert"===i.value?0:1;this.preMaterial.uniforms.option={value:o},1===o?(this.prevGeometry.setAttribute("position",new Mt([-n,r,0,-n,0,0,n,r,0,-n,0,0,n,0,0,n,r,0,-n,0,0,-n,-r,0,n,0,0,-n,-r,0,n,-r,0,n,0,0],3)),this.prevGeometry.setAttribute("uv",new Mt([0,1,0,.5,1,1,0,.5,1,.5,1,1,0,.5,0,0,1,.5,0,0,1,0,1,.5],2))):(this.prevGeometry.setAttribute("position",new Mt([-n,r,0,-n,-r,0,0,r,0,-n,-r,0,0,-r,0,0,r,0,0,r,0,0,-r,0,n,r,0,0,-r,0,n,-r,0,n,r,0],3)),this.prevGeometry.setAttribute("uv",new Mt([0,1,0,0,.5,1,0,0,.5,0,.5,1,.5,1,.5,0,1,1,.5,0,1,0,1,1],2))),this.prevGeometry.setAttribute("left",new Mt([1,1,1,1,1,1,0,0,0,0,0,0],1)),this.nextMesh.geometry=new bn(e,t,1,1),this.nextMesh.position.z=this.prevMesh.position.z-e/4}},{key:"updateAnimation",value:function(e){this.preMaterial.uniforms.timePercent.value=e,this.nextMesh.position.z=this.prevMesh.position.z-(1-e)*(this.width/4)}},{key:"dispose",value:function(){}}]),e}()},Pl=function(){function e(){var t=this;_(this,e),this.startTime=0,this.lastTime=0,this.lastFPSTime=0,this.renderingDuration=16,this.reverse=!1,this.scene=new Di,this.delay=0,this.easeFn=iu.linear,this.preset=null,this.onTransactionEnd=function(){},this.isTransactionStartApplied=!1,this.prevTexture=null,this.nextTexture=null,this.animationId=null,this.config=null,this.renderer=new ki({alpha:!0,premultipliedAlpha:!0}),this.isPlaying=!1,this.animate=function(){var e,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.fps(i)){t.renderer.clear(),i>t.delay&&0===t.lastTime&&(t.lastTime=i,t.startTime=i);var o=0;t.lastTime>0&&o<1&&(o=t.easeFn(i-t.startTime,0,1,null!==(n=null===(e=t.preset)||void 0===e?void 0:e.duration)&&void 0!==n?n:0)),o>1&&(o=1),null===(r=t.preset)||void 0===r||r.updateAnimation(t.reverse?1-o:o),t.rerender(),t.isTransactionStartApplied||(t.isTransactionStartApplied=!0),o<1?t.animationId=window.requestAnimationFrame(t.animate):t.onTransactionEnd()}else t.animationId=window.requestAnimationFrame(t.animate)}}return T(e,[{key:"initPlayer",value:function(e){this.config=e,this.reverse=e.reverse,e.delay&&Number.isInteger(e.delay)&&(this.delay=e.delay),e.easeFn&&(this.easeFn=iu[e.easeFn]),e.maxFPS&&Number.isInteger(e.maxFPS)&&e.maxFPS>0&&(this.renderingDuration=Math.ceil(1e3/e.maxFPS)),this.startTime=0,this.lastTime=0,this.scene.clear(),this.renderer.shadowMap.enabled=!0,this.renderer.autoClear=!1,this.renderer.setClearColor(e.clearColor||0),this.isTransactionStartApplied=!1,this.renderer.setSize(e.stageWidth,e.stageHeight),this.preset=new Dl[e.presetType],e.options&&(this.preset.options=e.options),e.duration&&Number.isInteger(e.duration)&&(this.preset.duration=e.duration),this.preset.setSize(e.stageWidth,e.stageHeight)}},{key:"setPrevTexture",value:function(e){var t,n,r,i;e.needsUpdate=!0,this.reverse?(this.nextTexture=e,null===(t=this.preset)||void 0===t||t.setNextTexture(e)):(this.prevTexture=e,null===(n=this.preset)||void 0===n||n.setPrevTexture(e)),null===(r=this.preset)||void 0===r||r.addObjects(this.scene),null===(i=this.preset)||void 0===i||i.updateAnimation(this.reverse?1:0),this.rerender()}},{key:"setNextTexture",value:function(e){var t,n;e.needsUpdate=!0,this.reverse?(this.prevTexture=e,null===(t=this.preset)||void 0===t||t.setPrevTexture(e)):(this.nextTexture=e,null===(n=this.preset)||void 0===n||n.setNextTexture(e))}},{key:"play",value:function(){var e=this;return new Promise((function(t){e.onTransactionEnd=t,e.animate(),e.isPlaying=!0}))}},{key:"rerender",value:function(){var e;this.renderer.clear(),(null===(e=this.preset)||void 0===e?void 0:e.camera.camera)&&this.renderer.render(this.scene,this.preset.camera.camera)}},{key:"fps",value:function(e){return e<=0||(this.lastFPSTime<0||e-this.lastFPSTime>=this.renderingDuration)&&(this.lastFPSTime=e,!0)}},{key:"skip",value:function(){var e;null===(e=this.preset)||void 0===e||e.updateAnimation(this.reverse?0:1),this.rerender(),this.dispose(),this.onTransactionEnd()}},{key:"dispose",value:function(){var e,t,n;window.cancelAnimationFrame(this.animationId),this.renderer.clear(),this.isPlaying=!1,null===(e=this.preset)||void 0===e||e.dispose(),null===(t=this.prevTexture)||void 0===t||t.dispose(),null===(n=this.nextTexture)||void 0===n||n.dispose();for(var r=this.scene.children.length-1;r>=0;r--){var i=this.scene.children[r];this.scene.remove(i)}this.scene.background=null}},{key:"destroy",value:function(){this.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose()}}]),e}();n(139);var Ol=n(3),Rl=n(5);Rl.c.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var Ll=function(){function e(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Ol.isMobile.tablet||Ol.isMobile.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex=2..toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),e.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",(function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()})),document.body.appendChild(t),this._hookDiv=t},e.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},e.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(e=this.renderer.view.parentNode)||void 0===e||e.appendChild(this.div))},e.prototype.deactivate=function(){var e;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(e=this.div.parentNode)||void 0===e||e.removeChild(this.div))},e.prototype.updateAccessibleObjects=function(e){if(e.visible&&e.accessibleChildren){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var n=0;n title : "+e.title+"
tabIndex: "+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,n=t.width,r=t.height;e.x+e.width>n&&(e.width=n-e.x),e.y+e.height>r&&(e.height=r-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2..toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,n=e.target.displayObject,r=t.eventData;t.dispatchEvent(n,"click",r),t.dispatchEvent(n,"pointertap",r),t.dispatchEvent(n,"tap",r)},e.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,n=e.target.displayObject,r=t.eventData;t.dispatchEvent(n,"mouseover",r)},e.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,n=e.target.displayObject,r=t.eventData;t.dispatchEvent(n,"mouseout",r)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}(),jl=n(1),Bl=n(7),Ul=function(){function e(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new jl.g,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(e.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),e.prototype.getLocalPosition=function(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)},e.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},e.prototype.reset=function(){this.isPrimary=!1},e}(),zl=function(e,t){return(zl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},Fl=function(){function e(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return e.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},e.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},e}(),Gl=function(){function e(t){this._pointerId=t,this._flags=e.FLAGS.NONE}return e.prototype._doSet=function(e,t){this._flags=t?this._flags|e:this._flags&~e},Object.defineProperty(e.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"none",{get:function(){return this._flags===e.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"over",{get:function(){return 0!=(this._flags&e.FLAGS.OVER)},set:function(t){this._doSet(e.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightDown",{get:function(){return 0!=(this._flags&e.FLAGS.RIGHT_DOWN)},set:function(t){this._doSet(e.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftDown",{get:function(){return 0!=(this._flags&e.FLAGS.LEFT_DOWN)},set:function(t){this._doSet(e.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),e.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),e}(),Hl=function(){function e(){this._tempPoint=new jl.g}return e.prototype.recursiveFindHit=function(e,t,n,r,i){if(!t||!t.visible)return!1;var o=e.data.global,a=!1,s=i=t.interactive||i,u=!0;if(t.hitArea?(r&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(r=!1,u=!1)),s=!1):t._mask&&r&&(t._mask.containsPoint&&t._mask.containsPoint(o)||(r=!1)),u&&t.interactiveChildren&&t.children)for(var l=t.children,c=l.length-1;c>=0;c--){var h=l[c],d=this.recursiveFindHit(e,h,n,r,s);if(d){if(!h.parent)continue;s=!1,d&&(e.target&&(r=!1),a=!0)}}return i&&(r&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(a=!0),t.interactive&&(a&&!e.target&&(e.target=t),n&&n(e,t,!!a))),a},e.prototype.findHit=function(e,t,n,r){this.recursiveFindHit(e,t,n,r,!1)},e}(),Vl={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(e){e?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Rl.c.mixin(Vl);var Wl={target:null,data:{global:null}},Yl=function(e){function t(t,n){var r=e.call(this)||this;return n=n||{},r.renderer=t,r.autoPreventDefault=void 0===n.autoPreventDefault||n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new Ul,r.mouse.identifier=1,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[1]=r.mouse,r.interactionDataPool=[],r.eventData=new Fl,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!("PointerEvent"in globalThis),r.supportsTouchEvents="ontouchstart"in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:"inherit",pointer:"pointer"},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new Hl,r._tempDisplayObject=new Rl.d,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=void 0===n.useSystemTicker||n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return function(e,t){function n(){this.constructor=e}zl(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return Wl.target=null,Wl.data.global=e,t||(t=this.lastObjectRendered),this.processInteractive(Wl,t,null,!0),Wl.target},t.prototype.setTargetElement=function(e,t){void 0===t&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(Bl.a.system.add(this.tickerUpdate,this,Bl.c.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(Bl.a.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,this._deltaTimethis.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?jl.j.EMPTY:((e=e||new jl.j(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addPointMatrix=function(e,t){var n=e.a,r=e.b,i=e.c,o=e.d,a=e.tx,s=e.ty,u=n*t.x+i*t.y+a,l=r*t.x+o*t.y+s;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},e.prototype.addQuad=function(e){var t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,o=e[0],a=e[1];t=or?o:r,i=a>i?a:i,t=(o=e[2])r?o:r,i=a>i?a:i,t=(o=e[4])r?o:r,i=a>i?a:i,t=(o=e[6])r?o:r,i=a>i?a:i,this.minX=t,this.minY=n,this.maxX=r,this.maxY=i},e.prototype.addFrame=function(e,t,n,r,i){this.addFrameMatrix(e.worldTransform,t,n,r,i)},e.prototype.addFrameMatrix=function(e,t,n,r,i){var o=e.a,a=e.b,s=e.c,u=e.d,l=e.tx,c=e.ty,h=this.minX,d=this.minY,f=this.maxX,p=this.maxY,v=o*t+s*n+l,m=a*t+u*n+c;h=vf?v:f,p=m>p?m:p,h=(v=o*r+s*n+l)f?v:f,p=m>p?m:p,h=(v=o*t+s*i+l)f?v:f,p=m>p?m:p,h=(v=o*r+s*i+l)f?v:f,p=m>p?m:p,this.minX=h,this.minY=d,this.maxX=f,this.maxY=p},e.prototype.addVertexData=function(e,t,n){for(var r=this.minX,i=this.minY,o=this.maxX,a=this.maxY,s=t;so?u:o,a=l>a?l:a}this.minX=r,this.minY=i,this.maxX=o,this.maxY=a},e.prototype.addVertices=function(e,t,n,r){this.addVerticesMatrix(e.worldTransform,t,n,r)},e.prototype.addVerticesMatrix=function(e,t,n,r,i,o){void 0===i&&(i=0),void 0===o&&(o=i);for(var a=e.a,s=e.b,u=e.c,l=e.d,c=e.tx,h=e.ty,d=this.minX,f=this.minY,p=this.maxX,v=this.maxY,m=n;mr?e.maxX:r,this.maxY=e.maxY>i?e.maxY:i},e.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,r=e.minY>t.minY?e.minY:t.minY,i=e.maxXu?i:u,this.maxY=o>l?o:l}},e.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},e.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,r=e.minY>t.y?e.minY:t.y,i=e.maxXu?i:u,this.maxY=o>l?o:l}},e.prototype.pad=function(e,t){void 0===e&&(e=0),void 0===t&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},e.prototype.addFramePad=function(e,t,n,r,i,o){e-=i,t-=o,n+=i,r+=o,this.minX=this.minXn?this.maxX:n,this.minY=this.minYr?this.maxY:r},e}(),Oc=function(e,t){return(Oc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Rc(e,t){function n(){this.constructor=e}Oc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Lc,jc,Bc,Uc,Fc,zc,Gc,Hc,Vc,Wc,Yc,Xc,Qc,Zc,qc,Jc,Kc,$c,eh,th=function(e){function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new jl.m,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new Pc,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return Rc(t,e),t.mixin=function(e){for(var n=Object.keys(e),r=0;r1)for(var r=0;rthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e},t.prototype.swapChildren=function(e,t){if(e!==t){var n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e,this.onChildrenChange(n=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);Object(Ol.removeItems)(this.children,n,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,t=[],n=0;n1)for(var r=0;r0&&i<=t){n=this.children.splice(r,i);for(var o=0;o1&&this.children.sort(rh),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e0&&n.height>0){var r,i;if(this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==t.prototype._render&&(r=this.getBounds(!0)),r&&n.intersects(r,i))this._render(e);else if(this.cullArea)return;for(var o=0,a=this.children.length;o0||t.responseType===e.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2==(r/100|0)){if(this.xhrType===e.XHR_RESPONSE_TYPE.TEXT)this.data=n,this.type=e.TYPE.TEXT;else if(this.xhrType===e.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(n),this.type=e.TYPE.JSON}catch(e){return void this.abort("Error trying to parse loaded json: "+e)}else if(this.xhrType===e.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var i=new DOMParser;this.data=i.parseFromString(n,"text/xml")}else{var o=document.createElement("div");o.innerHTML=n,this.data=o}this.type=e.TYPE.XML}catch(e){return void this.abort("Error trying to parse loaded xml: "+e)}else this.data=t.response||n;this.complete()}else this.abort("["+t.status+"] "+t.statusText+": "+t.responseURL)},e.prototype._determineCrossOrigin=function(e,t){if(0===e.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";t=t||globalThis.location,dh||(dh=document.createElement("a")),dh.href=e;var n=hh(dh.href,{strictMode:!0}),r=!n.port&&""===t.port||n.port===t.port,i=n.protocol?n.protocol+":":"";return n.host===t.hostname&&r&&i===t.protocol?"":"anonymous"},e.prototype._determineXhrType=function(){return e._xhrTypeMap[this.extension]||e.XHR_RESPONSE_TYPE.TEXT},e.prototype._determineLoadType=function(){return e._loadTypeMap[this.extension]||e.LOAD_TYPE.XHR},e.prototype._getExtension=function(e){void 0===e&&(e=this.url);var t="";if(this.isDataUrl){var n=e.indexOf("/");t=e.substring(n+1,e.indexOf(";",n))}else{var r=e.indexOf("?"),i=e.indexOf("#"),o=Math.min(r>-1?r:e.length,i>-1?i:e.length);t=(e=e.substring(0,o)).substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},e.prototype._getMimeFromXhrType=function(t){switch(t){case e.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case e.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case e.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case e.XHR_RESPONSE_TYPE.JSON:return"application/json";case e.XHR_RESPONSE_TYPE.DEFAULT:case e.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},e}();function gh(){}function yh(e){return function(){for(var t=arguments,n=[],r=0;r>2,i[1]=(3&r[0])<<4|r[1]>>4,i[2]=(15&r[1])<<2|r[2]>>6,i[3]=63&r[2],n-(e.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;othis.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?jl.j.EMPTY:((e=e||new jl.j(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addPointMatrix=function(e,t){var n=e.a,r=e.b,i=e.c,o=e.d,a=e.tx,s=e.ty,u=n*t.x+i*t.y+a,l=r*t.x+o*t.y+s;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},e.prototype.addQuad=function(e){var t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,o=e[0],a=e[1];t=or?o:r,i=a>i?a:i,t=(o=e[2])r?o:r,i=a>i?a:i,t=(o=e[4])r?o:r,i=a>i?a:i,t=(o=e[6])r?o:r,i=a>i?a:i,this.minX=t,this.minY=n,this.maxX=r,this.maxY=i},e.prototype.addFrame=function(e,t,n,r,i){this.addFrameMatrix(e.worldTransform,t,n,r,i)},e.prototype.addFrameMatrix=function(e,t,n,r,i){var o=e.a,a=e.b,s=e.c,u=e.d,l=e.tx,c=e.ty,h=this.minX,d=this.minY,f=this.maxX,p=this.maxY,v=o*t+s*n+l,m=a*t+u*n+c;h=vf?v:f,p=m>p?m:p,h=(v=o*r+s*n+l)f?v:f,p=m>p?m:p,h=(v=o*t+s*i+l)f?v:f,p=m>p?m:p,h=(v=o*r+s*i+l)f?v:f,p=m>p?m:p,this.minX=h,this.minY=d,this.maxX=f,this.maxY=p},e.prototype.addVertexData=function(e,t,n){for(var r=this.minX,i=this.minY,o=this.maxX,a=this.maxY,s=t;so?u:o,a=l>a?l:a}this.minX=r,this.minY=i,this.maxX=o,this.maxY=a},e.prototype.addVertices=function(e,t,n,r){this.addVerticesMatrix(e.worldTransform,t,n,r)},e.prototype.addVerticesMatrix=function(e,t,n,r,i,o){void 0===i&&(i=0),void 0===o&&(o=i);for(var a=e.a,s=e.b,u=e.c,l=e.d,c=e.tx,h=e.ty,d=this.minX,f=this.minY,p=this.maxX,v=this.maxY,m=n;mr?e.maxX:r,this.maxY=e.maxY>i?e.maxY:i},e.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,r=e.minY>t.minY?e.minY:t.minY,i=e.maxXu?i:u,this.maxY=o>l?o:l}},e.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},e.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,r=e.minY>t.y?e.minY:t.y,i=e.maxXu?i:u,this.maxY=o>l?o:l}},e.prototype.pad=function(e,t){void 0===e&&(e=0),void 0===t&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},e.prototype.addFramePad=function(e,t,n,r,i,o){e-=i,t-=o,n+=i,r+=o,this.minX=this.minXn?this.maxX:n,this.minY=this.minYr?this.maxY:r},e}(),Oc=function(e,t){return(Oc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Rc(e,t){function n(){this.constructor=e}Oc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Lc,jc,Bc,Uc,zc,Fc,Gc,Hc,Vc,Wc,Yc,Xc,Qc,Zc,qc,Jc,Kc,$c,eh,th=function(e){function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new jl.m,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new Pc,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return Rc(t,e),t.mixin=function(e){for(var n=Object.keys(e),r=0;r1)for(var r=0;rthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e},t.prototype.swapChildren=function(e,t){if(e!==t){var n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e,this.onChildrenChange(n=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);Object(Ol.removeItems)(this.children,n,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,t=[],n=0;n1)for(var r=0;r0&&i<=t){n=this.children.splice(r,i);for(var o=0;o1&&this.children.sort(rh),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e0&&n.height>0){var r,i;if(this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==t.prototype._render&&(r=this.getBounds(!0)),r&&n.intersects(r,i))this._render(e);else if(this.cullArea)return;for(var o=0,a=this.children.length;o0||t.responseType===e.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2==(r/100|0)){if(this.xhrType===e.XHR_RESPONSE_TYPE.TEXT)this.data=n,this.type=e.TYPE.TEXT;else if(this.xhrType===e.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(n),this.type=e.TYPE.JSON}catch(e){return void this.abort("Error trying to parse loaded json: "+e)}else if(this.xhrType===e.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var i=new DOMParser;this.data=i.parseFromString(n,"text/xml")}else{var o=document.createElement("div");o.innerHTML=n,this.data=o}this.type=e.TYPE.XML}catch(e){return void this.abort("Error trying to parse loaded xml: "+e)}else this.data=t.response||n;this.complete()}else this.abort("["+t.status+"] "+t.statusText+": "+t.responseURL)},e.prototype._determineCrossOrigin=function(e,t){if(0===e.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";t=t||globalThis.location,dh||(dh=document.createElement("a")),dh.href=e;var n=hh(dh.href,{strictMode:!0}),r=!n.port&&""===t.port||n.port===t.port,i=n.protocol?n.protocol+":":"";return n.host===t.hostname&&r&&i===t.protocol?"":"anonymous"},e.prototype._determineXhrType=function(){return e._xhrTypeMap[this.extension]||e.XHR_RESPONSE_TYPE.TEXT},e.prototype._determineLoadType=function(){return e._loadTypeMap[this.extension]||e.LOAD_TYPE.XHR},e.prototype._getExtension=function(e){void 0===e&&(e=this.url);var t="";if(this.isDataUrl){var n=e.indexOf("/");t=e.substring(n+1,e.indexOf(";",n))}else{var r=e.indexOf("?"),i=e.indexOf("#"),o=Math.min(r>-1?r:e.length,i>-1?i:e.length);t=(e=e.substring(0,o)).substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},e.prototype._getMimeFromXhrType=function(t){switch(t){case e.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case e.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case e.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case e.XHR_RESPONSE_TYPE.JSON:return"application/json";case e.XHR_RESPONSE_TYPE.DEFAULT:case e.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},e}();function gh(){}function yh(e){return function(){for(var t=arguments,n=[],r=0;r>2,i[1]=(3&r[0])<<4|r[1]>>4,i[2]=(15&r[1])<<2|r[2]>>6,i[3]=63&r[2],n-(e.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;o=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},t._createLevelBuffers=function(e,t,n,r,i,o,a){for(var s=new Array(n),u=e.byteOffset,l=o,c=a,h=l+r-1&~(r-1),d=c+i-1&~(i-1),f=h*d*Ih[t],p=0;p1?l:h,levelHeight:n>1?c:d,levelBuffer:new Uint8Array(e.buffer,u,f)},u+=f,f=(h=(l=l>>1||1)+r-1&~(r-1))*(d=(c=c>>1||1)+i-1&~(i-1))*Ih[t];return s},t}(function(e){function t(t,n){void 0===n&&(n={width:1,height:1,autoLoad:!0});var r,i,o=this;return"string"==typeof t?(r=t,i=new Uint8Array):(r=null,i=t),(o=e.call(this,i,n)||this).origin=r,o.buffer=i?new Xl.x(i):null,o.origin&&!1!==n.autoLoad&&o.load(),i&&i.length&&(o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),o}return Nh(t,e),t.prototype.onBlobLoaded=function(e){},t.prototype.load=function(){return e=this,void 0,n=function(){var e;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>=1,_>>>=1;var T=148;for(w=0;w1||0!==o?w:M,levelHeight:f>1||0!==o?T:S,levelBuffer:new Uint8Array(n,C,_)},C+=_}E=(E+=I+4)%4!=0?E+4-E%4:E,_=(M=(w=w>>1||1)+4-1&-4)*(S=(T=T>>1||1)+4-1&-4)*v}return 0!==o?{uncompressed:y.map((function(t){var n=t[0].levelBuffer,r=!1;return o===Ah.r.FLOAT?n=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===Ah.r.UNSIGNED_INT?(r=!0,n=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===Ah.r.INT&&(r=!0,n=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new Xl.i(n,{width:t[0].levelWidth,height:t[0].levelHeight}),type:o,format:r?e.convertFormatToInteger(a):a}})),kvData:x}:{compressed:y.map((function(e){return new Ph(null,{format:s,width:u,height:l,levels:f,levelBuffers:e})})),kvData:x}},e.validate=function(e,t){for(var n=0;nt-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u16384&&(r=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=t,o._batchSize=r,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=Ah.b.NORMAL,o.autoResize=i,o.roundPixels=!0,o.baseTexture=null,o.setProperties(n),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}return qh(t,e),t.prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},t.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,Object(Ol.hex2rgb)(e,this.tintRgb)},enumerable:!1,configurable:!0}),t.prototype.render=function(e){var t=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return t.onChildrenChange(0)}))),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},t.prototype.onChildrenChange=function(e){for(var t=Math.floor(e/this._batchSize);this._bufferUpdateIDs.lengthn&&!e.autoResize&&(o=n);var a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));var s=t[0]._texture.baseTexture;this.state.blendMode=Object(Ol.correctBlendMode)(e.blendMode,s.alphaMode),i.state.set(this.state);var u=i.gl,l=e.worldTransform.copyTo(this.tempMatrix);l.prepend(i.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=l.toArray(!0),this.shader.uniforms.uColor=Object(Ol.premultiplyRgba)(e.tintRgb,e.worldAlpha,this.shader.uniforms.uColor,s.alphaMode),this.shader.uniforms.uSampler=s,this.renderer.shader.bind(this.shader);for(var c=!1,h=0,d=0;hr&&(f=r),d>=a.length&&a.push(this._generateOneMoreBuffer(e));var p=a[d];p.uploadDynamic(t,h,f);var v=e._bufferUpdateIDs[d]||0;(c=c||p._updateID0,l=s.alpha,c=l<1&&u?Object(Ol.premultiplyTint)(s._tintRGB,l):s._tintRGB+(255*l<<24);r[o]=c,r[o+i]=c,r[o+2*i]=c,r[o+3*i]=c,o+=4*i}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},t}(Xl.m),nd=n(4);!function(e){e.MITER="miter",e.BEVEL="bevel",e.ROUND="round"}(Jh||(Jh={})),function(e){e.BUTT="butt",e.ROUND="round",e.SQUARE="square"}(Kh||(Kh={}));var rd={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(e,t){if(void 0===t&&(t=20),!this.adaptive||!e||isNaN(e))return t;var n=Math.ceil(e/this.maxLength);return nthis.maxSegments&&(n=this.maxSegments),n}},id=function(){function e(){this.color=16777215,this.alpha=1,this.texture=Xl.t.WHITE,this.matrix=null,this.visible=!1,this.reset()}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},e.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=Xl.t.WHITE,this.matrix=null,this.visible=!1},e.prototype.destroy=function(){this.texture=null,this.matrix=null},e}(),od=function(e,t){return(od=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function ad(e,t){function n(){this.constructor=e}od(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function sd(e,t){var n,r;void 0===t&&(t=!1);var i=e.length;if(!(i<6)){for(var o=0,a=0,s=e[i-2],u=e[i-1];a0||t&&o<=0){var h=i/2;for(a=h+h%2;a=6){sd(n,!1);for(var a=[],s=0;s=0&&a>=0&&r>=0&&i>=0){var f=Math.ceil(2.3*Math.sqrt(o+a)),p=8*f+(r?4:0)+(i?4:0);if(s.length=p,0!==p){if(0===f)return s.length=8,s[0]=s[6]=t+r,s[1]=s[3]=n+i,s[2]=s[4]=t-r,void(s[5]=s[7]=n-i);var v,m,g=0,y=4*f+(r?2:0)+2,b=y,x=p,_=t+(v=r+o),w=t-v,T=n+(m=i);if(s[g++]=_,s[g++]=T,s[--y]=T,s[--y]=w,i){var M=n-m;s[b++]=w,s[b++]=M,s[--x]=M,s[--x]=_}for(var S=1;Sh&&(h+=2*Math.PI);var d=c,f=h-c,p=Math.abs(f),v=Math.sqrt(u*u+l*l),m=1+(15*p*Math.sqrt(v)/Math.PI>>0),g=f/m;if(d+=g,s){a.push(e,t),a.push(n,r);for(var y=1,b=d;yy?(U?(d.push(W,Y),d.push(_+S*D,w+E*D),d.push(W,Y),d.push(_+A*D,w+I*D)):(d.push(_-S*k,w-E*k),d.push(X,Q),d.push(_-A*k,w-I*k),d.push(X,Q)),p+=2):o.join===Jh.ROUND?U?(d.push(W,Y),d.push(_+S*D,w+E*D),p+=pd(_,w,_+S*D,w+E*D,_+A*D,w+I*D,d,!0)+4,d.push(W,Y),d.push(_+A*D,w+I*D)):(d.push(_-S*k,w-E*k),d.push(X,Q),p+=pd(_,w,_-S*k,w-E*k,_-A*k,w-I*k,d,!1)+4,d.push(_-A*k,w-I*k),d.push(X,Q)):(d.push(W,Y),d.push(X,Q)):(d.push(_-S*k,w-E*k),d.push(_+S*D,w+E*D),o.join===Jh.ROUND?p+=U?pd(_,w,_+S*D,w+E*D,_+A*D,w+I*D,d,!0)+2:pd(_,w,_-S*k,w-E*k,_-A*k,w-I*k,d,!1)+2:o.join===Jh.MITER&&V/g<=y&&(U?(d.push(X,Q),d.push(X,Q)):(d.push(W,Y),d.push(W,Y)),p+=2),d.push(_-A*k,w-I*k),d.push(_+A*D,w+I*D),p+=2)}}b=r[2*(f-2)],x=r[2*(f-2)+1],_=r[2*(f-1)],S=-(x-(w=r[2*(f-1)+1])),E=b-_,S/=C=Math.sqrt(S*S+E*E),E/=C,S*=m,E*=m,d.push(_-S*k,w-E*k),d.push(_+S*D,w+E*D),u||(o.cap===Kh.ROUND?p+=pd(_-S*(k-D)*.5,w-E*(k-D)*.5,_-S*k,w-E*k,_+S*D,w+E*D,d,!1)+2:o.cap===Kh.SQUARE&&(p+=fd(_,w,S,E,k,D,!1,d)));var q=t.indices,J=rd.epsilon*rd.epsilon;for(P=v;Pc*s}},e.arc=function(e,t,n,r,i,o,a,s,u){for(var l=a-o,c=rd._segmentsCount(Math.abs(l)*i,40*Math.ceil(Math.abs(l)/jl.f)),h=l/(2*c),d=2*h,f=Math.cos(h),p=Math.sin(h),v=c-1,m=v%1/v,g=0;g<=v;++g){var y=h+o+d*(g+m*g),b=Math.cos(y),x=-Math.sin(y);u.push((f*b+p*x)*i+n,(f*-x+p*b)*i+r)}},e}(),bd=function(){function e(){}return e.curveLength=function(e,t,n,r,i,o,a,s){for(var u=0,l=0,c=0,h=0,d=0,f=0,p=0,v=0,m=0,g=0,y=0,b=e,x=t,_=1;_<=10;++_)g=b-(v=(p=(f=(d=1-(l=_/10))*d)*d)*e+3*f*l*n+3*d*(c=l*l)*i+(h=c*l)*a),y=x-(m=p*t+3*f*l*r+3*d*c*o+h*s),b=v,x=m,u+=Math.sqrt(g*g+y*y);return u},e.curveTo=function(t,n,r,i,o,a,s){var u=s[s.length-2],l=s[s.length-1];s.length-=2;var c=rd._segmentsCount(e.curveLength(u,l,t,n,r,i,o,a)),h=0,d=0,f=0,p=0,v=0;s.push(u,l);for(var m=1,g=0;m<=c;++m)f=(d=(h=1-(g=m/c))*h)*h,v=(p=g*g)*g,s.push(f*u+3*d*g*t+3*h*p*r+v*o,f*l+3*d*g*n+3*h*p*i+v*a)},e}(),xd=function(){function e(){}return e.curveLength=function(e,t,n,r,i,o){var a=e-2*n+i,s=t-2*r+o,u=2*n-2*e,l=2*r-2*t,c=4*(a*a+s*s),h=4*(a*u+s*l),d=u*u+l*l,f=2*Math.sqrt(c+h+d),p=Math.sqrt(c),v=2*c*p,m=2*Math.sqrt(d),g=h/p;return(v*f+p*h*(f-m)+(4*d*c-h*h)*Math.log((2*p+g+f)/(g+m)))/(4*v)},e.curveTo=function(t,n,r,i,o){for(var a=o[o.length-2],s=o[o.length-1],u=rd._segmentsCount(e.curveLength(a,s,t,n,r,i)),l=0,c=0,h=1;h<=u;++h){var d=h/u;l=a+(t-a)*d,c=s+(n-s)*d,o.push(l+(t+(r-t)*d-l)*d,c+(n+(i-n)*d-c)*d)}},e}(),_d=function(){function e(){this.reset()}return e.prototype.begin=function(e,t,n){this.reset(),this.style=e,this.start=t,this.attribStart=n},e.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},e.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},e}(),wd=((md={})[jl.l.POLY]=ud,md[jl.l.CIRC]=ld,md[jl.l.ELIP]=ld,md[jl.l.RECT]={build:function(e){var t=e.shape,n=t.x,r=t.y,i=t.width,o=t.height,a=e.points;a.length=0,a.push(n,r,n+i,r,n+i,r+o,n,r+o)},triangulate:function(e,t){var n=e.points,r=t.points,i=r.length/2;r.push(n[0],n[1],n[2],n[3],n[6],n[7],n[4],n[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},md[jl.l.RREC]=dd,md),Td=[],Md=[],Sd=function(){function e(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=t,this.matrix=r,this.type=e.type}return e.prototype.clone=function(){return new e(this.shape,this.fillStyle,this.lineStyle,this.matrix)},e.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},e}(),Ed=new jl.g,Ad=new Rl.a,Id=function(e){function t(){var t=e.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new Rl.a,t.boundsDirty=-1,t}return ad(t,e),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),t.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var e=0;e0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},t.prototype.drawShape=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null);var i=new Sd(e,t,n,r);return this.graphicsData.push(i),this.dirty++,this},t.prototype.drawHole=function(e,t){if(void 0===t&&(t=null),!this.graphicsData.length)return null;var n=new Sd(e,null,null,t),r=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=r.lineStyle,r.holes.push(n),this.dirty++,this},t.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t0&&(i=(r=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o65535&&e;this.indicesUint16=g?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},t.prototype._compareStyles=function(e,t){return!(!e||!t)&&e.texture.baseTexture===t.texture.baseTexture&&e.color+e.alpha===t.color+t.alpha&&!!e.native==!!t.native},t.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var e=0,t=this.graphicsData.length;e131070)return!1;for(var e=this.batches,n=0;n0&&((i=Md.pop())||((i=new Xl.d).texArray=new Xl.g),this.drawCalls.push(i)),i.start=c,i.size=0,i.texArray.count=0,i.type=l),f.touched=1,f._batchEnabled=e,f._batchLocation=o,f.wrapMode=Ah.s.REPEAT,i.texArray.elements[i.texArray.count++]=f,o++)),i.size+=h.size,c+=h.size,s=f._batchLocation,this.addColors(n,d.color,d.alpha,h.attribSize,h.attribStart),this.addTextureIds(r,s,h.attribSize,h.attribStart)}Xl.c._globalBatch=e,this.packAttributes()},t.prototype.packAttributes=function(){for(var e=this.points,t=this.uvs,n=this.colors,r=this.textureIds,i=new ArrayBuffer(3*e.length*4),o=new Float32Array(i),a=new Uint32Array(i),s=0,u=0;u>16)+(65280&t)+((255&t)<<16),a=Object(Ol.premultiplyTint)(o,n);e.length=Math.max(e.length,i+r);for(var s=0;s0&&e.alpha>0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:t},e)):this._lineStyle.reset(),this},t.prototype.startPoly=function(){if(this.currentPath){var e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new jl.h,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new jl.h,this.currentPath.closeStroke=!1},t.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},t.prototype.moveTo=function(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this},t.prototype.lineTo=function(e,t){this.currentPath||this.moveTo(0,0);var n=this.currentPath.points,r=n[n.length-2],i=n[n.length-1];return r===e&&i===t||n.push(e,t),this},t.prototype._initCurve=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[e,t]):this.moveTo(e,t)},t.prototype.quadraticCurveTo=function(e,t,n,r){this._initCurve();var i=this.currentPath.points;return 0===i.length&&this.moveTo(0,0),xd.curveTo(e,t,n,r,i),this},t.prototype.bezierCurveTo=function(e,t,n,r,i,o){return this._initCurve(),bd.curveTo(e,t,n,r,i,o,this.currentPath.points),this},t.prototype.arcTo=function(e,t,n,r,i){this._initCurve(e,t);var o=this.currentPath.points,a=yd.curveTo(e,t,n,r,i,o);if(a){var s=a.cx,u=a.cy,l=a.radius,c=a.startAngle,h=a.endAngle,d=a.anticlockwise;this.arc(s,u,l,c,h,d)}return this},t.prototype.arc=function(e,t,n,r,i,o){if(void 0===o&&(o=!1),r===i)return this;if(!o&&i<=r?i+=jl.f:o&&r<=i&&(r+=jl.f),i-r==0)return this;var a=e+Math.cos(r)*n,s=t+Math.sin(r)*n,u=this._geometry.closePointEps,l=this.currentPath?this.currentPath.points:null;if(l){var c=Math.abs(l[l.length-2]-a),h=Math.abs(l[l.length-1]-s);c0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:t},e)):this._fillStyle.reset(),this},t.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},t.prototype.drawRect=function(e,t,n,r){return this.drawShape(new jl.j(e,t,n,r))},t.prototype.drawRoundedRect=function(e,t,n,r,i){return this.drawShape(new jl.k(e,t,n,r,i))},t.prototype.drawCircle=function(e,t,n){return this.drawShape(new jl.a(e,t,n))},t.prototype.drawEllipse=function(e,t,n,r){return this.drawShape(new jl.c(e,t,n,r))},t.prototype.drawPolygon=function(){for(var e,t=arguments,n=[],r=0;r>16&255)/255*i,o.tint[1]=(r>>8&255)/255*i,o.tint[2]=(255&r)/255*i,o.tint[3]=i,e.shader.bind(t),e.geometry.bind(n,t),e.state.set(this.state);for(var s=0,u=a.length;s>16)+(65280&i)+((255&i)<<16)}}},t.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var t=this.transform.worldTransform,n=t.a,r=t.b,i=t.c,o=t.d,a=t.tx,s=t.ty,u=this._geometry.points,l=this.vertexData,c=0,h=0;h=r&&Od.x=i&&Od.y>16)+(65280&e)+((255&e)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||Xl.t.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),t}(Rl.b),jd=function(e,t){return(jd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};!function(e){e[e.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",e[e.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(gd||(gd={}));var Bd={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:gd.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Ud=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Fd=function(){function e(e){this.styleID=0,this.reset(),Hd(this,e,e)}return e.prototype.clone=function(){var t={};return Hd(t,this,Bd),new e(t)},e.prototype.reset=function(){Hd(this,Bd,Bd)},Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=Gd(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=Gd(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){(function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var n=0;n=0;n--){var r=t[n].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&Ud.indexOf(r)<0&&(r='"'+r+'"'),t[n]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},e}();function zd(e){return"number"==typeof e?Object(Ol.hex2string)(e):("string"==typeof e&&0===e.indexOf("0x")&&(e=e.replace("0x","#")),e)}function Gd(e){if(Array.isArray(e)){for(var t=0;tp)if(""!==a&&(s+=e.addLine(a),a="",o=0),e.canBreakWords(g,n.breakWords))for(var _=e.wordWrapSplit(g),w=0;w<_.length;w++){for(var T=_[w],M=1;_[w+M];){var S=_[w+M],E=T[T.length-1];if(e.canBreakChars(E,S,g,w,n.breakWords))break;T+=S,M++}w+=T.length-1;var A=e.getFromCache(T,l,u,i);A+o>p&&(s+=e.addLine(a),f=!1,a="",o=0),a+=T,o+=A}else{a.length>0&&(s+=e.addLine(a),a="",o=0);var I=m===v.length-1;s+=e.addLine(g,!I),f=!1,a="",o=0}else x+o>p&&(f=!1,s+=e.addLine(a),a="",o=0),(a.length>0||!e.isBreakingSpace(g)||f)&&(a+=g,o+=x)}return s+e.addLine(a,!1)},e.addLine=function(t,n){return void 0===n&&(n=!0),t=e.trimRight(t),n?t+"\n":t},e.getFromCache=function(e,t,n,r){var i=n[e];if("number"!=typeof i){var o=e.length*t;i=r.measureText(e).width+o,n[e]=i}return i},e.collapseSpaces=function(e){return"normal"===e||"pre-line"===e},e.collapseNewlines=function(e){return"normal"===e},e.trimRight=function(t){if("string"!=typeof t)return"";for(var n=t.length-1;n>=0;n--){var r=t[n];if(!e.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},e.isNewline=function(t){return"string"==typeof t&&e._newlines.indexOf(t.charCodeAt(0))>=0},e.isBreakingSpace=function(t,n){return"string"==typeof t&&e._breakingSpaces.indexOf(t.charCodeAt(0))>=0},e.tokenize=function(t){var n=[],r="";if("string"!=typeof t)return n;for(var i=0;is;--d){for(v=0;v0&&p>v&&(m=(v+p)/2);var g=v+f,y=n.lineHeight*(d+1),b=g;d+1=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},t._createLevelBuffers=function(e,t,n,r,i,o,a){for(var s=new Array(n),u=e.byteOffset,l=o,c=a,h=l+r-1&~(r-1),d=c+i-1&~(i-1),f=h*d*Ih[t],p=0;p1?l:h,levelHeight:n>1?c:d,levelBuffer:new Uint8Array(e.buffer,u,f)},u+=f,f=(h=(l=l>>1||1)+r-1&~(r-1))*(d=(c=c>>1||1)+i-1&~(i-1))*Ih[t];return s},t}(function(e){function t(t,n){void 0===n&&(n={width:1,height:1,autoLoad:!0});var r,i,o=this;return"string"==typeof t?(r=t,i=new Uint8Array):(r=null,i=t),(o=e.call(this,i,n)||this).origin=r,o.buffer=i?new Xl.x(i):null,o.origin&&!1!==n.autoLoad&&o.load(),i&&i.length&&(o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),o}return Nh(t,e),t.prototype.onBlobLoaded=function(e){},t.prototype.load=function(){return e=this,void 0,n=function(){var e;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>=1,_>>>=1;var T=148;for(w=0;w1||0!==o?w:M,levelHeight:f>1||0!==o?T:S,levelBuffer:new Uint8Array(n,C,_)},C+=_}E=(E+=I+4)%4!=0?E+4-E%4:E,_=(M=(w=w>>1||1)+4-1&-4)*(S=(T=T>>1||1)+4-1&-4)*v}return 0!==o?{uncompressed:y.map((function(t){var n=t[0].levelBuffer,r=!1;return o===Ah.r.FLOAT?n=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===Ah.r.UNSIGNED_INT?(r=!0,n=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===Ah.r.INT&&(r=!0,n=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new Xl.i(n,{width:t[0].levelWidth,height:t[0].levelHeight}),type:o,format:r?e.convertFormatToInteger(a):a}})),kvData:x}:{compressed:y.map((function(e){return new Ph(null,{format:s,width:u,height:l,levels:f,levelBuffers:e})})),kvData:x}},e.validate=function(e,t){for(var n=0;nt-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u16384&&(r=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=t,o._batchSize=r,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=Ah.b.NORMAL,o.autoResize=i,o.roundPixels=!0,o.baseTexture=null,o.setProperties(n),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}return qh(t,e),t.prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},t.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,Object(Ol.hex2rgb)(e,this.tintRgb)},enumerable:!1,configurable:!0}),t.prototype.render=function(e){var t=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return t.onChildrenChange(0)}))),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},t.prototype.onChildrenChange=function(e){for(var t=Math.floor(e/this._batchSize);this._bufferUpdateIDs.lengthn&&!e.autoResize&&(o=n);var a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));var s=t[0]._texture.baseTexture;this.state.blendMode=Object(Ol.correctBlendMode)(e.blendMode,s.alphaMode),i.state.set(this.state);var u=i.gl,l=e.worldTransform.copyTo(this.tempMatrix);l.prepend(i.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=l.toArray(!0),this.shader.uniforms.uColor=Object(Ol.premultiplyRgba)(e.tintRgb,e.worldAlpha,this.shader.uniforms.uColor,s.alphaMode),this.shader.uniforms.uSampler=s,this.renderer.shader.bind(this.shader);for(var c=!1,h=0,d=0;hr&&(f=r),d>=a.length&&a.push(this._generateOneMoreBuffer(e));var p=a[d];p.uploadDynamic(t,h,f);var v=e._bufferUpdateIDs[d]||0;(c=c||p._updateID0,l=s.alpha,c=l<1&&u?Object(Ol.premultiplyTint)(s._tintRGB,l):s._tintRGB+(255*l<<24);r[o]=c,r[o+i]=c,r[o+2*i]=c,r[o+3*i]=c,o+=4*i}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},t}(Xl.m),nd=n(4);!function(e){e.MITER="miter",e.BEVEL="bevel",e.ROUND="round"}(Jh||(Jh={})),function(e){e.BUTT="butt",e.ROUND="round",e.SQUARE="square"}(Kh||(Kh={}));var rd={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(e,t){if(void 0===t&&(t=20),!this.adaptive||!e||isNaN(e))return t;var n=Math.ceil(e/this.maxLength);return nthis.maxSegments&&(n=this.maxSegments),n}},id=function(){function e(){this.color=16777215,this.alpha=1,this.texture=Xl.t.WHITE,this.matrix=null,this.visible=!1,this.reset()}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},e.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=Xl.t.WHITE,this.matrix=null,this.visible=!1},e.prototype.destroy=function(){this.texture=null,this.matrix=null},e}(),od=function(e,t){return(od=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function ad(e,t){function n(){this.constructor=e}od(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function sd(e,t){var n,r;void 0===t&&(t=!1);var i=e.length;if(!(i<6)){for(var o=0,a=0,s=e[i-2],u=e[i-1];a0||t&&o<=0){var h=i/2;for(a=h+h%2;a=6){sd(n,!1);for(var a=[],s=0;s=0&&a>=0&&r>=0&&i>=0){var f=Math.ceil(2.3*Math.sqrt(o+a)),p=8*f+(r?4:0)+(i?4:0);if(s.length=p,0!==p){if(0===f)return s.length=8,s[0]=s[6]=t+r,s[1]=s[3]=n+i,s[2]=s[4]=t-r,void(s[5]=s[7]=n-i);var v,m,g=0,y=4*f+(r?2:0)+2,b=y,x=p,_=t+(v=r+o),w=t-v,T=n+(m=i);if(s[g++]=_,s[g++]=T,s[--y]=T,s[--y]=w,i){var M=n-m;s[b++]=w,s[b++]=M,s[--x]=M,s[--x]=_}for(var S=1;Sh&&(h+=2*Math.PI);var d=c,f=h-c,p=Math.abs(f),v=Math.sqrt(u*u+l*l),m=1+(15*p*Math.sqrt(v)/Math.PI>>0),g=f/m;if(d+=g,s){a.push(e,t),a.push(n,r);for(var y=1,b=d;yy?(U?(d.push(W,Y),d.push(_+S*D,w+E*D),d.push(W,Y),d.push(_+A*D,w+I*D)):(d.push(_-S*k,w-E*k),d.push(X,Q),d.push(_-A*k,w-I*k),d.push(X,Q)),p+=2):o.join===Jh.ROUND?U?(d.push(W,Y),d.push(_+S*D,w+E*D),p+=pd(_,w,_+S*D,w+E*D,_+A*D,w+I*D,d,!0)+4,d.push(W,Y),d.push(_+A*D,w+I*D)):(d.push(_-S*k,w-E*k),d.push(X,Q),p+=pd(_,w,_-S*k,w-E*k,_-A*k,w-I*k,d,!1)+4,d.push(_-A*k,w-I*k),d.push(X,Q)):(d.push(W,Y),d.push(X,Q)):(d.push(_-S*k,w-E*k),d.push(_+S*D,w+E*D),o.join===Jh.ROUND?p+=U?pd(_,w,_+S*D,w+E*D,_+A*D,w+I*D,d,!0)+2:pd(_,w,_-S*k,w-E*k,_-A*k,w-I*k,d,!1)+2:o.join===Jh.MITER&&V/g<=y&&(U?(d.push(X,Q),d.push(X,Q)):(d.push(W,Y),d.push(W,Y)),p+=2),d.push(_-A*k,w-I*k),d.push(_+A*D,w+I*D),p+=2)}}b=r[2*(f-2)],x=r[2*(f-2)+1],_=r[2*(f-1)],S=-(x-(w=r[2*(f-1)+1])),E=b-_,S/=C=Math.sqrt(S*S+E*E),E/=C,S*=m,E*=m,d.push(_-S*k,w-E*k),d.push(_+S*D,w+E*D),u||(o.cap===Kh.ROUND?p+=pd(_-S*(k-D)*.5,w-E*(k-D)*.5,_-S*k,w-E*k,_+S*D,w+E*D,d,!1)+2:o.cap===Kh.SQUARE&&(p+=fd(_,w,S,E,k,D,!1,d)));var q=t.indices,J=rd.epsilon*rd.epsilon;for(P=v;Pc*s}},e.arc=function(e,t,n,r,i,o,a,s,u){for(var l=a-o,c=rd._segmentsCount(Math.abs(l)*i,40*Math.ceil(Math.abs(l)/jl.f)),h=l/(2*c),d=2*h,f=Math.cos(h),p=Math.sin(h),v=c-1,m=v%1/v,g=0;g<=v;++g){var y=h+o+d*(g+m*g),b=Math.cos(y),x=-Math.sin(y);u.push((f*b+p*x)*i+n,(f*-x+p*b)*i+r)}},e}(),bd=function(){function e(){}return e.curveLength=function(e,t,n,r,i,o,a,s){for(var u=0,l=0,c=0,h=0,d=0,f=0,p=0,v=0,m=0,g=0,y=0,b=e,x=t,_=1;_<=10;++_)g=b-(v=(p=(f=(d=1-(l=_/10))*d)*d)*e+3*f*l*n+3*d*(c=l*l)*i+(h=c*l)*a),y=x-(m=p*t+3*f*l*r+3*d*c*o+h*s),b=v,x=m,u+=Math.sqrt(g*g+y*y);return u},e.curveTo=function(t,n,r,i,o,a,s){var u=s[s.length-2],l=s[s.length-1];s.length-=2;var c=rd._segmentsCount(e.curveLength(u,l,t,n,r,i,o,a)),h=0,d=0,f=0,p=0,v=0;s.push(u,l);for(var m=1,g=0;m<=c;++m)f=(d=(h=1-(g=m/c))*h)*h,v=(p=g*g)*g,s.push(f*u+3*d*g*t+3*h*p*r+v*o,f*l+3*d*g*n+3*h*p*i+v*a)},e}(),xd=function(){function e(){}return e.curveLength=function(e,t,n,r,i,o){var a=e-2*n+i,s=t-2*r+o,u=2*n-2*e,l=2*r-2*t,c=4*(a*a+s*s),h=4*(a*u+s*l),d=u*u+l*l,f=2*Math.sqrt(c+h+d),p=Math.sqrt(c),v=2*c*p,m=2*Math.sqrt(d),g=h/p;return(v*f+p*h*(f-m)+(4*d*c-h*h)*Math.log((2*p+g+f)/(g+m)))/(4*v)},e.curveTo=function(t,n,r,i,o){for(var a=o[o.length-2],s=o[o.length-1],u=rd._segmentsCount(e.curveLength(a,s,t,n,r,i)),l=0,c=0,h=1;h<=u;++h){var d=h/u;l=a+(t-a)*d,c=s+(n-s)*d,o.push(l+(t+(r-t)*d-l)*d,c+(n+(i-n)*d-c)*d)}},e}(),_d=function(){function e(){this.reset()}return e.prototype.begin=function(e,t,n){this.reset(),this.style=e,this.start=t,this.attribStart=n},e.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},e.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},e}(),wd=((md={})[jl.l.POLY]=ud,md[jl.l.CIRC]=ld,md[jl.l.ELIP]=ld,md[jl.l.RECT]={build:function(e){var t=e.shape,n=t.x,r=t.y,i=t.width,o=t.height,a=e.points;a.length=0,a.push(n,r,n+i,r,n+i,r+o,n,r+o)},triangulate:function(e,t){var n=e.points,r=t.points,i=r.length/2;r.push(n[0],n[1],n[2],n[3],n[6],n[7],n[4],n[5]),t.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},md[jl.l.RREC]=dd,md),Td=[],Md=[],Sd=function(){function e(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=t,this.matrix=r,this.type=e.type}return e.prototype.clone=function(){return new e(this.shape,this.fillStyle,this.lineStyle,this.matrix)},e.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},e}(),Ed=new jl.g,Ad=new Rl.a,Id=function(e){function t(){var t=e.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new Rl.a,t.boundsDirty=-1,t}return ad(t,e),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),t.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var e=0;e0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},t.prototype.drawShape=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null);var i=new Sd(e,t,n,r);return this.graphicsData.push(i),this.dirty++,this},t.prototype.drawHole=function(e,t){if(void 0===t&&(t=null),!this.graphicsData.length)return null;var n=new Sd(e,null,null,t),r=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=r.lineStyle,r.holes.push(n),this.dirty++,this},t.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t0&&(i=(r=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o65535&&e;this.indicesUint16=g?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},t.prototype._compareStyles=function(e,t){return!(!e||!t)&&e.texture.baseTexture===t.texture.baseTexture&&e.color+e.alpha===t.color+t.alpha&&!!e.native==!!t.native},t.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var e=0,t=this.graphicsData.length;e131070)return!1;for(var e=this.batches,n=0;n0&&((i=Md.pop())||((i=new Xl.d).texArray=new Xl.g),this.drawCalls.push(i)),i.start=c,i.size=0,i.texArray.count=0,i.type=l),f.touched=1,f._batchEnabled=e,f._batchLocation=o,f.wrapMode=Ah.s.REPEAT,i.texArray.elements[i.texArray.count++]=f,o++)),i.size+=h.size,c+=h.size,s=f._batchLocation,this.addColors(n,d.color,d.alpha,h.attribSize,h.attribStart),this.addTextureIds(r,s,h.attribSize,h.attribStart)}Xl.c._globalBatch=e,this.packAttributes()},t.prototype.packAttributes=function(){for(var e=this.points,t=this.uvs,n=this.colors,r=this.textureIds,i=new ArrayBuffer(3*e.length*4),o=new Float32Array(i),a=new Uint32Array(i),s=0,u=0;u>16)+(65280&t)+((255&t)<<16),a=Object(Ol.premultiplyTint)(o,n);e.length=Math.max(e.length,i+r);for(var s=0;s0&&e.alpha>0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:t},e)):this._lineStyle.reset(),this},t.prototype.startPoly=function(){if(this.currentPath){var e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new jl.h,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new jl.h,this.currentPath.closeStroke=!1},t.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},t.prototype.moveTo=function(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this},t.prototype.lineTo=function(e,t){this.currentPath||this.moveTo(0,0);var n=this.currentPath.points,r=n[n.length-2],i=n[n.length-1];return r===e&&i===t||n.push(e,t),this},t.prototype._initCurve=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[e,t]):this.moveTo(e,t)},t.prototype.quadraticCurveTo=function(e,t,n,r){this._initCurve();var i=this.currentPath.points;return 0===i.length&&this.moveTo(0,0),xd.curveTo(e,t,n,r,i),this},t.prototype.bezierCurveTo=function(e,t,n,r,i,o){return this._initCurve(),bd.curveTo(e,t,n,r,i,o,this.currentPath.points),this},t.prototype.arcTo=function(e,t,n,r,i){this._initCurve(e,t);var o=this.currentPath.points,a=yd.curveTo(e,t,n,r,i,o);if(a){var s=a.cx,u=a.cy,l=a.radius,c=a.startAngle,h=a.endAngle,d=a.anticlockwise;this.arc(s,u,l,c,h,d)}return this},t.prototype.arc=function(e,t,n,r,i,o){if(void 0===o&&(o=!1),r===i)return this;if(!o&&i<=r?i+=jl.f:o&&r<=i&&(r+=jl.f),i-r==0)return this;var a=e+Math.cos(r)*n,s=t+Math.sin(r)*n,u=this._geometry.closePointEps,l=this.currentPath?this.currentPath.points:null;if(l){var c=Math.abs(l[l.length-2]-a),h=Math.abs(l[l.length-1]-s);c0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:t},e)):this._fillStyle.reset(),this},t.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},t.prototype.drawRect=function(e,t,n,r){return this.drawShape(new jl.j(e,t,n,r))},t.prototype.drawRoundedRect=function(e,t,n,r,i){return this.drawShape(new jl.k(e,t,n,r,i))},t.prototype.drawCircle=function(e,t,n){return this.drawShape(new jl.a(e,t,n))},t.prototype.drawEllipse=function(e,t,n,r){return this.drawShape(new jl.c(e,t,n,r))},t.prototype.drawPolygon=function(){for(var e,t=arguments,n=[],r=0;r>16&255)/255*i,o.tint[1]=(r>>8&255)/255*i,o.tint[2]=(255&r)/255*i,o.tint[3]=i,e.shader.bind(t),e.geometry.bind(n,t),e.state.set(this.state);for(var s=0,u=a.length;s>16)+(65280&i)+((255&i)<<16)}}},t.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var t=this.transform.worldTransform,n=t.a,r=t.b,i=t.c,o=t.d,a=t.tx,s=t.ty,u=this._geometry.points,l=this.vertexData,c=0,h=0;h=r&&Od.x=i&&Od.y>16)+(65280&e)+((255&e)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||Xl.t.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),t}(Rl.b),jd=function(e,t){return(jd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};!function(e){e[e.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",e[e.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(gd||(gd={}));var Bd={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:gd.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Ud=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],zd=function(){function e(e){this.styleID=0,this.reset(),Hd(this,e,e)}return e.prototype.clone=function(){var t={};return Hd(t,this,Bd),new e(t)},e.prototype.reset=function(){Hd(this,Bd,Bd)},Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=Gd(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=Gd(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){(function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var n=0;n=0;n--){var r=t[n].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&Ud.indexOf(r)<0&&(r='"'+r+'"'),t[n]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},e}();function Fd(e){return"number"==typeof e?Object(Ol.hex2string)(e):("string"==typeof e&&0===e.indexOf("0x")&&(e=e.replace("0x","#")),e)}function Gd(e){if(Array.isArray(e)){for(var t=0;tp)if(""!==a&&(s+=e.addLine(a),a="",o=0),e.canBreakWords(g,n.breakWords))for(var _=e.wordWrapSplit(g),w=0;w<_.length;w++){for(var T=_[w],M=1;_[w+M];){var S=_[w+M],E=T[T.length-1];if(e.canBreakChars(E,S,g,w,n.breakWords))break;T+=S,M++}w+=T.length-1;var A=e.getFromCache(T,l,u,i);A+o>p&&(s+=e.addLine(a),f=!1,a="",o=0),a+=T,o+=A}else{a.length>0&&(s+=e.addLine(a),a="",o=0);var I=m===v.length-1;s+=e.addLine(g,!I),f=!1,a="",o=0}else x+o>p&&(f=!1,s+=e.addLine(a),a="",o=0),(a.length>0||!e.isBreakingSpace(g)||f)&&(a+=g,o+=x)}return s+e.addLine(a,!1)},e.addLine=function(t,n){return void 0===n&&(n=!0),t=e.trimRight(t),n?t+"\n":t},e.getFromCache=function(e,t,n,r){var i=n[e];if("number"!=typeof i){var o=e.length*t;i=r.measureText(e).width+o,n[e]=i}return i},e.collapseSpaces=function(e){return"normal"===e||"pre-line"===e},e.collapseNewlines=function(e){return"normal"===e},e.trimRight=function(t){if("string"!=typeof t)return"";for(var n=t.length-1;n>=0;n--){var r=t[n];if(!e.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},e.isNewline=function(t){return"string"==typeof t&&e._newlines.indexOf(t.charCodeAt(0))>=0},e.isBreakingSpace=function(t,n){return"string"==typeof t&&e._breakingSpaces.indexOf(t.charCodeAt(0))>=0},e.tokenize=function(t){var n=[],r="";if("string"!=typeof t)return n;for(var i=0;is;--d){for(v=0;v0&&p>v&&(m=(v+p)/2);var g=v+f,y=n.lineHeight*(d+1),b=g;d+10},e}();function Zd(e,t){var n=!1;if(e&&e._textures&&e._textures.length)for(var r=0;r=0;t--)this.add(e.children[t]);return this},e.prototype.destroy=function(){this.ticking&&Bl.a.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},e}();function rf(e,t){return t instanceof Xl.c&&(t._glTextures[e.CONTEXT_UID]||e.texture.bind(t),!0)}function of(e,t){if(!(t instanceof Dd))return!1;var n=t.geometry;t.finishPoly(),n.updateBatches();for(var r=n.batches,i=0;i=r&&df.x=i&&df.y1?Xl.r.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",t):Xl.r.from(pf,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",t)},t.prototype.render=function(e){var t=this.renderer,n=this.quad,r=n.vertices;r[0]=r[6]=e._width*-e.anchor.x,r[1]=r[3]=e._height*-e.anchor.y,r[2]=r[4]=e._width*(1-e.anchor.x),r[5]=r[7]=e._height*(1-e.anchor.y);var i=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;(r=n.uvs)[0]=r[6]=-i,r[1]=r[3]=-o,r[2]=r[4]=1-i,r[5]=r[7]=1-o,n.invalidate();var a=e._texture,s=a.baseTexture,u=e.tileTransform.localTransform,l=e.uvMatrix,c=s.isPowerOfTwo&&a.frame.width===s.width&&a.frame.height===s.height;c&&(s._glTextures[t.CONTEXT_UID]?c=s.wrapMode!==Ah.s.CLAMP:s.wrapMode===Ah.s.CLAMP&&(s.wrapMode=Ah.s.REPEAT));var h=c?this.simpleShader:this.shader,d=a.width,f=a.height,p=e._width,v=e._height;vf.set(u.a*d/p,u.b*d/v,u.c*f/p,u.d*f/v,u.tx/p,u.ty/v),vf.invert(),c?vf.prepend(l.mapCoord):(h.uniforms.uMapCoord=l.mapCoord.toArray(!0),h.uniforms.uClampFrame=l.uClampFrame,h.uniforms.uClampOffset=l.uClampOffset),h.uniforms.uTransform=vf.toArray(!0),h.uniforms.uColor=Object(Ol.premultiplyTintToRgba)(e.tint,e.worldAlpha,h.uniforms.uColor,s.alphaMode),h.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),h.uniforms.uSampler=a,t.shader.bind(h),t.geometry.bind(n),this.state.blendMode=Object(Ol.correctBlendMode)(e.blendMode,s.alphaMode),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},t}(Xl.m),gf=n(8),yf=function(e,t){return(yf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},bf=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},xf=function(){function e(){}return e.test=function(e){return"string"==typeof e&&0===e.indexOf("info face=")},e.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var r in t){var i=t[r].match(/^[a-z]+/gm)[0],o=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var s in o){var u=o[s].split("="),l=u[0],c=u[1].replace(/"/gm,""),h=parseFloat(c),d=isNaN(h)?c:h;a[l]=d}n[i].push(a)}var f=new bf;return n.info.forEach((function(e){return f.info.push({face:e.face,size:parseInt(e.size,10)})})),n.common.forEach((function(e){return f.common.push({lineHeight:parseInt(e.lineHeight,10)})})),n.page.forEach((function(e){return f.page.push({id:parseInt(e.id,10),file:e.file})})),n.char.forEach((function(e){return f.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})})),n.kerning.forEach((function(e){return f.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})})),n.distanceField.forEach((function(e){return f.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})})),f},e}(),_f=function(){function e(){}return e.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},e.parse=function(e){for(var t=new bf,n=e.getElementsByTagName("info"),r=e.getElementsByTagName("common"),i=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),s=e.getElementsByTagName("distanceField"),u=0;u")>-1){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return _f.test(t)}return!1},e.parse=function(e){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return _f.parse(t)},e}(),Tf=[xf,_f,wf];function Mf(e){for(var t=0;t=l-M*s){if(0===y)throw new Error("[BitmapFont] textureHeight "+l+"px is too small for "+h.fontSize+"px fonts");--_,p=null,v=null,m=null,y=0,g=0,b=0}else if(b=Math.max(M+w.fontProperties.descent,b),S*s+g>=d)--_,y+=b*s,y=Math.ceil(y),g=0,b=0;else{Sf(p,v,w,g,y,s,h);var E=Af(w.text);f.char.push({id:E,page:x.length-1,x:g/s,y:y/s,width:S,height:M,xoffset:0,yoffset:0,xadvance:Math.ceil(T-(h.dropShadow?h.dropShadowDistance:0)-(h.stroke?h.strokeThickness:0))}),g+=(S+2*a)*s,g=Math.ceil(g)}}_=0;for(var A=c.length;_0&&r.x>u&&(++m,Object(Ol.removeItems)(i,1+p-m,1+b-p),b=p,p=-1,o.push(v),a.push(i.length>0?i[i.length-1].prevSpaces:0),d=Math.max(d,v),f++,r.x=0,r.y+=t.lineHeight,c=null,y=0)}}else o.push(h),a.push(-1),d=Math.max(d,h),++f,++m,r.x=0,r.y+=t.lineHeight,c=null,y=0}var T=s[s.length-1];"\r"!==T&&"\n"!==T&&(/(?:\s)/.test(T)&&(h=v),o.push(h),d=Math.max(d,h),a.push(-1));var M=[];for(b=0;b<=f;b++){var S=0;"right"===this._align?S=d-o[b]:"center"===this._align?S=(d-o[b])/2:"justify"===this._align&&(S=a[b]<0?0:(d-o[b])/a[b]),M.push(S)}var E=i.length,A={},I=[],C=this._activePagesMeshData;for(b=0;b6*L)||Z.vertices.length<2*gf.a.BATCHABLE_SIZE)Z.vertices=new Float32Array(8*L),Z.uvs=new Float32Array(8*L),Z.indices=new Uint16Array(6*L);else for(var j=Z.total,B=Z.vertices,U=4*j*2;U=r&&(t=e-a-1),o+=s=s.replace("%value%",n[t].toString()),o+="\n"}return(i=i.replace("%blur%",o)).replace("%size%",e.toString())}(o);return(a=e.call(this,s,u)||this).horizontal=t,a.resolution=i,a._quality=0,a.quality=r,a.blur=n,a}return Lf(t,e),t.prototype.apply=function(e,t,n,r){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/t.width):this.uniforms.strength=1/n.height*(n.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)e.applyFilter(this,t,n,r);else{var i=e.getFilterTexture(),o=e.renderer,a=t,s=i;this.state.blend=!1,e.applyFilter(this,a,s,qf.CLEAR);for(var u=1;u 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",n)||this).alpha=1,t}return function(e,t){function n(){this.constructor=e}ap(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype._loadMatrix=function(e,t){void 0===t&&(t=!1);var n=e;t&&(this._multiply(n,this.uniforms.m,e),n=this._colorMatrix(n)),this.uniforms.m=n},t.prototype._multiply=function(e,t,n){return e[0]=t[0]*n[0]+t[1]*n[5]+t[2]*n[10]+t[3]*n[15],e[1]=t[0]*n[1]+t[1]*n[6]+t[2]*n[11]+t[3]*n[16],e[2]=t[0]*n[2]+t[1]*n[7]+t[2]*n[12]+t[3]*n[17],e[3]=t[0]*n[3]+t[1]*n[8]+t[2]*n[13]+t[3]*n[18],e[4]=t[0]*n[4]+t[1]*n[9]+t[2]*n[14]+t[3]*n[19]+t[4],e[5]=t[5]*n[0]+t[6]*n[5]+t[7]*n[10]+t[8]*n[15],e[6]=t[5]*n[1]+t[6]*n[6]+t[7]*n[11]+t[8]*n[16],e[7]=t[5]*n[2]+t[6]*n[7]+t[7]*n[12]+t[8]*n[17],e[8]=t[5]*n[3]+t[6]*n[8]+t[7]*n[13]+t[8]*n[18],e[9]=t[5]*n[4]+t[6]*n[9]+t[7]*n[14]+t[8]*n[19]+t[9],e[10]=t[10]*n[0]+t[11]*n[5]+t[12]*n[10]+t[13]*n[15],e[11]=t[10]*n[1]+t[11]*n[6]+t[12]*n[11]+t[13]*n[16],e[12]=t[10]*n[2]+t[11]*n[7]+t[12]*n[12]+t[13]*n[17],e[13]=t[10]*n[3]+t[11]*n[8]+t[12]*n[13]+t[13]*n[18],e[14]=t[10]*n[4]+t[11]*n[9]+t[12]*n[14]+t[13]*n[19]+t[14],e[15]=t[15]*n[0]+t[16]*n[5]+t[17]*n[10]+t[18]*n[15],e[16]=t[15]*n[1]+t[16]*n[6]+t[17]*n[11]+t[18]*n[16],e[17]=t[15]*n[2]+t[16]*n[7]+t[17]*n[12]+t[18]*n[17],e[18]=t[15]*n[3]+t[16]*n[8]+t[17]*n[13]+t[18]*n[18],e[19]=t[15]*n[4]+t[16]*n[9]+t[17]*n[14]+t[18]*n[19]+t[19],e},t.prototype._colorMatrix=function(e){var t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t},t.prototype.brightness=function(e,t){var n=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.tint=function(e,t){var n=[(e>>16&255)/255,0,0,0,0,0,(e>>8&255)/255,0,0,0,0,0,(255&e)/255,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.greyscale=function(e,t){var n=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.blackAndWhite=function(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)},t.prototype.hue=function(e,t){e=(e||0)/180*Math.PI;var n=Math.cos(e),r=Math.sin(e),i=1/3,o=(0,Math.sqrt)(i),a=[n+(1-n)*i,i*(1-n)-o*r,i*(1-n)+o*r,0,0,i*(1-n)+o*r,n+i*(1-n),i*(1-n)-o*r,0,0,i*(1-n)-o*r,i*(1-n)+o*r,n+i*(1-n),0,0,0,0,0,1,0];this._loadMatrix(a,t)},t.prototype.contrast=function(e,t){var n=(e||0)+1,r=-.5*(n-1),i=[n,0,0,0,r,0,n,0,0,r,0,0,n,0,r,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.saturate=function(e,t){void 0===e&&(e=0);var n=2*e/3+1,r=-.5*(n-1),i=[n,r,r,0,0,r,n,r,0,0,r,r,n,0,0,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.desaturate=function(){this.saturate(-1)},t.prototype.negative=function(e){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e)},t.prototype.sepia=function(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)},t.prototype.technicolor=function(e){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],e)},t.prototype.polaroid=function(e){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],e)},t.prototype.toBGR=function(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)},t.prototype.kodachrome=function(e){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],e)},t.prototype.browni=function(e){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],e)},t.prototype.vintage=function(e){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],e)},t.prototype.colorTone=function(e,t,n,r,i){var o=((n=n||16770432)>>16&255)/255,a=(n>>8&255)/255,s=(255&n)/255,u=((r=r||3375104)>>16&255)/255,l=(r>>8&255)/255,c=(255&r)/255,h=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,l,c,t=t||.15,0,o-u,a-l,s-c,0,0];this._loadMatrix(h,i)},t.prototype.night=function(e,t){var n=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.predator=function(e,t){var n=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},t.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(t.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(Xl.k);sp.prototype.grayscale=sp.prototype.greyscale; +var Xd=function(e,t){return(Xd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},Qd=function(){function e(e){this.maxItemsPerFrame=e,this.itemsLeft=0}return e.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},e.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},e}();function Zd(e,t){var n=!1;if(e&&e._textures&&e._textures.length)for(var r=0;r=0;t--)this.add(e.children[t]);return this},e.prototype.destroy=function(){this.ticking&&Bl.a.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},e}();function rf(e,t){return t instanceof Xl.c&&(t._glTextures[e.CONTEXT_UID]||e.texture.bind(t),!0)}function of(e,t){if(!(t instanceof Dd))return!1;var n=t.geometry;t.finishPoly(),n.updateBatches();for(var r=n.batches,i=0;i=r&&df.x=i&&df.y1?Xl.r.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",t):Xl.r.from(pf,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",t)},t.prototype.render=function(e){var t=this.renderer,n=this.quad,r=n.vertices;r[0]=r[6]=e._width*-e.anchor.x,r[1]=r[3]=e._height*-e.anchor.y,r[2]=r[4]=e._width*(1-e.anchor.x),r[5]=r[7]=e._height*(1-e.anchor.y);var i=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;(r=n.uvs)[0]=r[6]=-i,r[1]=r[3]=-o,r[2]=r[4]=1-i,r[5]=r[7]=1-o,n.invalidate();var a=e._texture,s=a.baseTexture,u=e.tileTransform.localTransform,l=e.uvMatrix,c=s.isPowerOfTwo&&a.frame.width===s.width&&a.frame.height===s.height;c&&(s._glTextures[t.CONTEXT_UID]?c=s.wrapMode!==Ah.s.CLAMP:s.wrapMode===Ah.s.CLAMP&&(s.wrapMode=Ah.s.REPEAT));var h=c?this.simpleShader:this.shader,d=a.width,f=a.height,p=e._width,v=e._height;vf.set(u.a*d/p,u.b*d/v,u.c*f/p,u.d*f/v,u.tx/p,u.ty/v),vf.invert(),c?vf.prepend(l.mapCoord):(h.uniforms.uMapCoord=l.mapCoord.toArray(!0),h.uniforms.uClampFrame=l.uClampFrame,h.uniforms.uClampOffset=l.uClampOffset),h.uniforms.uTransform=vf.toArray(!0),h.uniforms.uColor=Object(Ol.premultiplyTintToRgba)(e.tint,e.worldAlpha,h.uniforms.uColor,s.alphaMode),h.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),h.uniforms.uSampler=a,t.shader.bind(h),t.geometry.bind(n),this.state.blendMode=Object(Ol.correctBlendMode)(e.blendMode,s.alphaMode),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},t}(Xl.m),gf=n(8),yf=function(e,t){return(yf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},bf=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},xf=function(){function e(){}return e.test=function(e){return"string"==typeof e&&0===e.indexOf("info face=")},e.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var r in t){var i=t[r].match(/^[a-z]+/gm)[0],o=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var s in o){var u=o[s].split("="),l=u[0],c=u[1].replace(/"/gm,""),h=parseFloat(c),d=isNaN(h)?c:h;a[l]=d}n[i].push(a)}var f=new bf;return n.info.forEach((function(e){return f.info.push({face:e.face,size:parseInt(e.size,10)})})),n.common.forEach((function(e){return f.common.push({lineHeight:parseInt(e.lineHeight,10)})})),n.page.forEach((function(e){return f.page.push({id:parseInt(e.id,10),file:e.file})})),n.char.forEach((function(e){return f.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})})),n.kerning.forEach((function(e){return f.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})})),n.distanceField.forEach((function(e){return f.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})})),f},e}(),_f=function(){function e(){}return e.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},e.parse=function(e){for(var t=new bf,n=e.getElementsByTagName("info"),r=e.getElementsByTagName("common"),i=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),s=e.getElementsByTagName("distanceField"),u=0;u")>-1){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return _f.test(t)}return!1},e.parse=function(e){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return _f.parse(t)},e}(),Tf=[xf,_f,wf];function Mf(e){for(var t=0;t=l-M*s){if(0===y)throw new Error("[BitmapFont] textureHeight "+l+"px is too small for "+h.fontSize+"px fonts");--_,p=null,v=null,m=null,y=0,g=0,b=0}else if(b=Math.max(M+w.fontProperties.descent,b),S*s+g>=d)--_,y+=b*s,y=Math.ceil(y),g=0,b=0;else{Sf(p,v,w,g,y,s,h);var E=Af(w.text);f.char.push({id:E,page:x.length-1,x:g/s,y:y/s,width:S,height:M,xoffset:0,yoffset:0,xadvance:Math.ceil(T-(h.dropShadow?h.dropShadowDistance:0)-(h.stroke?h.strokeThickness:0))}),g+=(S+2*a)*s,g=Math.ceil(g)}}_=0;for(var A=c.length;_0&&r.x>u&&(++m,Object(Ol.removeItems)(i,1+p-m,1+b-p),b=p,p=-1,o.push(v),a.push(i.length>0?i[i.length-1].prevSpaces:0),d=Math.max(d,v),f++,r.x=0,r.y+=t.lineHeight,c=null,y=0)}}else o.push(h),a.push(-1),d=Math.max(d,h),++f,++m,r.x=0,r.y+=t.lineHeight,c=null,y=0}var T=s[s.length-1];"\r"!==T&&"\n"!==T&&(/(?:\s)/.test(T)&&(h=v),o.push(h),d=Math.max(d,h),a.push(-1));var M=[];for(b=0;b<=f;b++){var S=0;"right"===this._align?S=d-o[b]:"center"===this._align?S=(d-o[b])/2:"justify"===this._align&&(S=a[b]<0?0:(d-o[b])/a[b]),M.push(S)}var E=i.length,A={},I=[],C=this._activePagesMeshData;for(b=0;b6*L)||Z.vertices.length<2*gf.a.BATCHABLE_SIZE)Z.vertices=new Float32Array(8*L),Z.uvs=new Float32Array(8*L),Z.indices=new Uint16Array(6*L);else for(var j=Z.total,B=Z.vertices,U=4*j*2;U=r&&(t=e-a-1),o+=s=s.replace("%value%",n[t].toString()),o+="\n"}return(i=i.replace("%blur%",o)).replace("%size%",e.toString())}(o);return(a=e.call(this,s,u)||this).horizontal=t,a.resolution=i,a._quality=0,a.quality=r,a.blur=n,a}return Lf(t,e),t.prototype.apply=function(e,t,n,r){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/t.width):this.uniforms.strength=1/n.height*(n.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)e.applyFilter(this,t,n,r);else{var i=e.getFilterTexture(),o=e.renderer,a=t,s=i;this.state.blend=!1,e.applyFilter(this,a,s,qf.CLEAR);for(var u=1;u 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",n)||this).alpha=1,t}return function(e,t){function n(){this.constructor=e}ap(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype._loadMatrix=function(e,t){void 0===t&&(t=!1);var n=e;t&&(this._multiply(n,this.uniforms.m,e),n=this._colorMatrix(n)),this.uniforms.m=n},t.prototype._multiply=function(e,t,n){return e[0]=t[0]*n[0]+t[1]*n[5]+t[2]*n[10]+t[3]*n[15],e[1]=t[0]*n[1]+t[1]*n[6]+t[2]*n[11]+t[3]*n[16],e[2]=t[0]*n[2]+t[1]*n[7]+t[2]*n[12]+t[3]*n[17],e[3]=t[0]*n[3]+t[1]*n[8]+t[2]*n[13]+t[3]*n[18],e[4]=t[0]*n[4]+t[1]*n[9]+t[2]*n[14]+t[3]*n[19]+t[4],e[5]=t[5]*n[0]+t[6]*n[5]+t[7]*n[10]+t[8]*n[15],e[6]=t[5]*n[1]+t[6]*n[6]+t[7]*n[11]+t[8]*n[16],e[7]=t[5]*n[2]+t[6]*n[7]+t[7]*n[12]+t[8]*n[17],e[8]=t[5]*n[3]+t[6]*n[8]+t[7]*n[13]+t[8]*n[18],e[9]=t[5]*n[4]+t[6]*n[9]+t[7]*n[14]+t[8]*n[19]+t[9],e[10]=t[10]*n[0]+t[11]*n[5]+t[12]*n[10]+t[13]*n[15],e[11]=t[10]*n[1]+t[11]*n[6]+t[12]*n[11]+t[13]*n[16],e[12]=t[10]*n[2]+t[11]*n[7]+t[12]*n[12]+t[13]*n[17],e[13]=t[10]*n[3]+t[11]*n[8]+t[12]*n[13]+t[13]*n[18],e[14]=t[10]*n[4]+t[11]*n[9]+t[12]*n[14]+t[13]*n[19]+t[14],e[15]=t[15]*n[0]+t[16]*n[5]+t[17]*n[10]+t[18]*n[15],e[16]=t[15]*n[1]+t[16]*n[6]+t[17]*n[11]+t[18]*n[16],e[17]=t[15]*n[2]+t[16]*n[7]+t[17]*n[12]+t[18]*n[17],e[18]=t[15]*n[3]+t[16]*n[8]+t[17]*n[13]+t[18]*n[18],e[19]=t[15]*n[4]+t[16]*n[9]+t[17]*n[14]+t[18]*n[19]+t[19],e},t.prototype._colorMatrix=function(e){var t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t},t.prototype.brightness=function(e,t){var n=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.tint=function(e,t){var n=[(e>>16&255)/255,0,0,0,0,0,(e>>8&255)/255,0,0,0,0,0,(255&e)/255,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.greyscale=function(e,t){var n=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.blackAndWhite=function(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)},t.prototype.hue=function(e,t){e=(e||0)/180*Math.PI;var n=Math.cos(e),r=Math.sin(e),i=1/3,o=(0,Math.sqrt)(i),a=[n+(1-n)*i,i*(1-n)-o*r,i*(1-n)+o*r,0,0,i*(1-n)+o*r,n+i*(1-n),i*(1-n)-o*r,0,0,i*(1-n)-o*r,i*(1-n)+o*r,n+i*(1-n),0,0,0,0,0,1,0];this._loadMatrix(a,t)},t.prototype.contrast=function(e,t){var n=(e||0)+1,r=-.5*(n-1),i=[n,0,0,0,r,0,n,0,0,r,0,0,n,0,r,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.saturate=function(e,t){void 0===e&&(e=0);var n=2*e/3+1,r=-.5*(n-1),i=[n,r,r,0,0,r,n,r,0,0,r,r,n,0,0,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.desaturate=function(){this.saturate(-1)},t.prototype.negative=function(e){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e)},t.prototype.sepia=function(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)},t.prototype.technicolor=function(e){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],e)},t.prototype.polaroid=function(e){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],e)},t.prototype.toBGR=function(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)},t.prototype.kodachrome=function(e){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],e)},t.prototype.browni=function(e){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],e)},t.prototype.vintage=function(e){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],e)},t.prototype.colorTone=function(e,t,n,r,i){var o=((n=n||16770432)>>16&255)/255,a=(n>>8&255)/255,s=(255&n)/255,u=((r=r||3375104)>>16&255)/255,l=(r>>8&255)/255,c=(255&r)/255,h=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,l,c,t=t||.15,0,o-u,a-l,s-c,0,0];this._loadMatrix(h,i)},t.prototype.night=function(e,t){var n=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.predator=function(e,t){var n=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},t.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(t.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(Xl.k);sp.prototype.grayscale=sp.prototype.greyscale; /*! * @pixi/filter-displacement - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -222,7 +222,7 @@ var up,lp,cp,hp,dp,fp,pp,vp,mp,gp,yp,bp,xp,_p,wp,Tp,Mp,Sp,Ep,Ap=function(e,t){re * pixi.js is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -Xl.q.registerPlugin("accessibility",Ll),Xl.q.registerPlugin("extract",ah),Xl.q.registerPlugin("interaction",Yl),Xl.q.registerPlugin("particle",td),Xl.q.registerPlugin("prepare",sf),Xl.q.registerPlugin("batch",Xl.f),Xl.q.registerPlugin("tilingSprite",mf),wh.registerPlugin(Df),wh.registerPlugin(Oh),wh.registerPlugin(Hh),wh.registerPlugin(Qh),wh.registerPlugin(lf),Ql.registerPlugin(Bl.b),Ql.registerPlugin(Th);var Bp,Up={AlphaFilter:Of,BlurFilter:op,BlurFilterPass:ip,ColorMatrixFilter:sp,DisplacementFilter:Ip,FXAAFilter:Np,NoiseFilter:Dp},Fp=n(10),zp=n(34),Gp=function(){function e(){}return e.offsetPolygon=function(t,n){var r=[],i=t.length;n=e.isPolygonClockwise(t)?n:-1*n;for(var o=0;o0},e}(),Hp=function(){function e(e){this._svgMatrix=null,this._tempMatrix=new jl.d,this.renderer=e}return e.prototype._calcCanvasStyle=function(e,t){var n;return e.texture&&e.texture.baseTexture!==Xl.t.WHITE.baseTexture?e.texture.valid?(n=Fp.b.getTintedPattern(e.texture,t),this.setPatternTransform(n,e.matrix||jl.d.IDENTITY)):n="#808080":n="#"+("00000"+(0|t).toString(16)).slice(-6),n},e.prototype.render=function(e){var t=this.renderer,n=t.context,r=e.worldAlpha,i=e.transform.worldTransform;t.setContextTransform(i),t.setBlendMode(e.blendMode);for(var o,a,s=e.geometry.graphicsData,u=(e.tint>>16&255)/255,l=(e.tint>>8&255)/255,c=(255&e.tint)/255,h=0;h>16&255)/255*u*255<<16)+((m>>8&255)/255*l*255<<8)+(255&m)/255*c*255;o=this._calcCanvasStyle(p,y)}if(v.visible){var b=((g>>16&255)/255*u*255<<16)+((g>>8&255)/255*l*255<<8)+(255&g)/255*c*255;a=this._calcCanvasStyle(v,b)}if(n.lineWidth=v.width,n.lineCap=v.cap,n.lineJoin=v.join,n.miterLimit=v.miterLimit,d.type===jl.l.POLY){n.beginPath();var x=(C=f).points,_=d.holes,w=void 0,T=void 0,M=void 0,S=void 0,E=void 0;n.moveTo(x[0],x[1]);for(var A=2;A0){for(E=[],w=0,M=x[0],S=x[1],A=2;A+2=0;A-=2)n.lineTo(x[A],x[A+1]);_[I].shape.closeStroke&&n.closePath(),E[I]=T*w<0}}p.visible&&(n.globalAlpha=p.alpha*r,n.fillStyle=o,n.fill()),v.visible&&this.paintPolygonStroke(C,v,a,_,E,r,n)}else if(d.type===jl.l.RECT){var C=f;if(p.visible&&(n.globalAlpha=p.alpha*r,n.fillStyle=o,n.fillRect(C.x,C.y,C.width,C.height)),v.visible){var N=v.width*(.5-(1-v.alignment)),k=C.width+2*N,D=C.height+2*N;n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.strokeRect(C.x-N,C.y-N,k,D)}}else if(d.type===jl.l.CIRC)C=f,n.beginPath(),n.arc(C.x,C.y,C.radius,0,2*Math.PI),n.closePath(),p.visible&&(n.globalAlpha=p.alpha*r,n.fillStyle=o,n.fill()),v.visible&&(.5!==v.alignment&&(N=v.width*(.5-(1-v.alignment)),n.beginPath(),n.arc(C.x,C.y,C.radius+N,0,2*Math.PI),n.closePath()),n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.stroke());else if(d.type===jl.l.ELIP){if(C=f,(H=1===v.alignment)||this.paintEllipse(C,p,v,o,r,n),v.visible){if(.5!==v.alignment){N=v.width*(.5-(1-v.alignment));var P=2*(C.width+N),O=2*(C.height+N),R=C.x-P/2,L=C.y-O/2,j=P/2*.5522848,B=O/2*.5522848,U=R+P,F=L+O,z=R+P/2,G=L+O/2;n.beginPath(),n.moveTo(R,G),n.bezierCurveTo(R,G-B,z-j,L,z,L),n.bezierCurveTo(z+j,L,U,G-B,U,G),n.bezierCurveTo(U,G+B,z+j,F,z,F),n.bezierCurveTo(z-j,F,R,G+B,R,G),n.closePath()}n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.stroke()}H&&this.paintEllipse(C,p,v,o,r,n)}else if(d.type===jl.l.RREC){var H;if(C=f,(H=1===v.alignment)||this.paintRoundedRectangle(C,p,v,o,r,n),v.visible){if(.5!==v.alignment){k=C.width,D=C.height,N=v.width*(.5-(1-v.alignment));var V=C.x-N,W=C.y-N,Y=C.width+2*N,X=C.height+2*N,Q=N*(v.alignment>=1?Math.min(Y/k,X/D):Math.min(k/Y,D/X)),Z=C.radius+Q,q=Math.min(Y,X)/2;Z=Z>q?q:Z,n.beginPath(),n.moveTo(V,W+Z),n.lineTo(V,W+X-Z),n.quadraticCurveTo(V,W+X,V+Z,W+X),n.lineTo(V+Y-Z,W+X),n.quadraticCurveTo(V+Y,W+X,V+Y,W+X-Z),n.lineTo(V+Y,W+Z),n.quadraticCurveTo(V+Y,W,V+Y-Z,W),n.lineTo(V+Z,W),n.quadraticCurveTo(V,W,V,W+Z),n.closePath()}n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.stroke()}H&&this.paintRoundedRectangle(C,p,v,o,r,n)}}},e.prototype.paintPolygonStroke=function(e,t,n,r,i,o,a){if(.5!==t.alignment){var s=t.width*(.5-(1-t.alignment)),u=Gp.offsetPolygon(e.points,s),l=void 0;a.beginPath(),a.moveTo(u[0],u[1]);for(var c=2;c=0;c-=2)a.lineTo(u[c],u[c+1]);r[h].shape.closeStroke&&a.closePath()}}a.globalAlpha=t.alpha*o,a.strokeStyle=n,a.stroke()},e.prototype.paintEllipse=function(e,t,n,r,i,o){var a=2*e.width,s=2*e.height,u=e.x-a/2,l=e.y-s/2,c=a/2*.5522848,h=s/2*.5522848,d=u+a,f=l+s,p=u+a/2,v=l+s/2;0===n.alignment&&o.save(),o.beginPath(),o.moveTo(u,v),o.bezierCurveTo(u,v-h,p-c,l,p,l),o.bezierCurveTo(p+c,l,d,v-h,d,v),o.bezierCurveTo(d,v+h,p+c,f,p,f),o.bezierCurveTo(p-c,f,u,v+h,u,v),o.closePath(),0===n.alignment&&o.clip(),t.visible&&(o.globalAlpha=t.alpha*i,o.fillStyle=r,o.fill()),0===n.alignment&&o.restore()},e.prototype.paintRoundedRectangle=function(e,t,n,r,i,o){var a=e.x,s=e.y,u=e.width,l=e.height,c=e.radius,h=Math.min(u,l)/2;c=c>h?h:c,0===n.alignment&&o.save(),o.beginPath(),o.moveTo(a,s+c),o.lineTo(a,s+l-c),o.quadraticCurveTo(a,s+l,a+c,s+l),o.lineTo(a+u-c,s+l),o.quadraticCurveTo(a+u,s+l,a+u,s+l-c),o.lineTo(a+u,s+c),o.quadraticCurveTo(a+u,s,a+u-c,s),o.lineTo(a+c,s),o.quadraticCurveTo(a,s,a,s+c),o.closePath(),0===n.alignment&&o.clip(),t.visible&&(o.globalAlpha=t.alpha*i,o.fillStyle=r,o.fill()),0===n.alignment&&o.restore()},e.prototype.setPatternTransform=function(e,t){if(!1!==this._svgMatrix){if(!this._svgMatrix){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");if(n&&n.createSVGMatrix&&(this._svgMatrix=n.createSVGMatrix()),!this._svgMatrix||!e.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=t.a,this._svgMatrix.b=t.b,this._svgMatrix.c=t.c,this._svgMatrix.d=t.d,this._svgMatrix.e=t.tx,this._svgMatrix.f=t.ty,e.setTransform(this._svgMatrix.inverse())}},e.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},e}(),Vp=new jl.d;Dd.prototype.generateCanvasTexture=function(e,t){void 0===t&&(t=1);var n=this.getLocalBounds(),r=Xl.p.create({width:n.width,height:n.height,scaleMode:e,resolution:t});Bp||(Bp=new Fp.a),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(Vp),Vp.invert(),Vp.tx-=n.x,Vp.ty-=n.y,Bp.render(this,{renderTexture:r,clear:!0,transform:Vp});var i=Xl.t.from(r.baseTexture._canvasRenderTarget.canvas,{scaleMode:e});return i.baseTexture.setResolution(t),i},Dd.prototype.cachedGraphicsData=[],Dd.prototype._renderCanvas=function(e){!0!==this.isMask&&(this.finishPoly(),e.plugins.graphics.render(this))}; +Xl.q.registerPlugin("accessibility",Ll),Xl.q.registerPlugin("extract",ah),Xl.q.registerPlugin("interaction",Yl),Xl.q.registerPlugin("particle",td),Xl.q.registerPlugin("prepare",sf),Xl.q.registerPlugin("batch",Xl.f),Xl.q.registerPlugin("tilingSprite",mf),wh.registerPlugin(Df),wh.registerPlugin(Oh),wh.registerPlugin(Hh),wh.registerPlugin(Qh),wh.registerPlugin(lf),Ql.registerPlugin(Bl.b),Ql.registerPlugin(Th);var Bp,Up={AlphaFilter:Of,BlurFilter:op,BlurFilterPass:ip,ColorMatrixFilter:sp,DisplacementFilter:Ip,FXAAFilter:Np,NoiseFilter:Dp},zp=n(10),Fp=n(34),Gp=function(){function e(){}return e.offsetPolygon=function(t,n){var r=[],i=t.length;n=e.isPolygonClockwise(t)?n:-1*n;for(var o=0;o0},e}(),Hp=function(){function e(e){this._svgMatrix=null,this._tempMatrix=new jl.d,this.renderer=e}return e.prototype._calcCanvasStyle=function(e,t){var n;return e.texture&&e.texture.baseTexture!==Xl.t.WHITE.baseTexture?e.texture.valid?(n=zp.b.getTintedPattern(e.texture,t),this.setPatternTransform(n,e.matrix||jl.d.IDENTITY)):n="#808080":n="#"+("00000"+(0|t).toString(16)).slice(-6),n},e.prototype.render=function(e){var t=this.renderer,n=t.context,r=e.worldAlpha,i=e.transform.worldTransform;t.setContextTransform(i),t.setBlendMode(e.blendMode);for(var o,a,s=e.geometry.graphicsData,u=(e.tint>>16&255)/255,l=(e.tint>>8&255)/255,c=(255&e.tint)/255,h=0;h>16&255)/255*u*255<<16)+((m>>8&255)/255*l*255<<8)+(255&m)/255*c*255;o=this._calcCanvasStyle(p,y)}if(v.visible){var b=((g>>16&255)/255*u*255<<16)+((g>>8&255)/255*l*255<<8)+(255&g)/255*c*255;a=this._calcCanvasStyle(v,b)}if(n.lineWidth=v.width,n.lineCap=v.cap,n.lineJoin=v.join,n.miterLimit=v.miterLimit,d.type===jl.l.POLY){n.beginPath();var x=(C=f).points,_=d.holes,w=void 0,T=void 0,M=void 0,S=void 0,E=void 0;n.moveTo(x[0],x[1]);for(var A=2;A0){for(E=[],w=0,M=x[0],S=x[1],A=2;A+2=0;A-=2)n.lineTo(x[A],x[A+1]);_[I].shape.closeStroke&&n.closePath(),E[I]=T*w<0}}p.visible&&(n.globalAlpha=p.alpha*r,n.fillStyle=o,n.fill()),v.visible&&this.paintPolygonStroke(C,v,a,_,E,r,n)}else if(d.type===jl.l.RECT){var C=f;if(p.visible&&(n.globalAlpha=p.alpha*r,n.fillStyle=o,n.fillRect(C.x,C.y,C.width,C.height)),v.visible){var N=v.width*(.5-(1-v.alignment)),k=C.width+2*N,D=C.height+2*N;n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.strokeRect(C.x-N,C.y-N,k,D)}}else if(d.type===jl.l.CIRC)C=f,n.beginPath(),n.arc(C.x,C.y,C.radius,0,2*Math.PI),n.closePath(),p.visible&&(n.globalAlpha=p.alpha*r,n.fillStyle=o,n.fill()),v.visible&&(.5!==v.alignment&&(N=v.width*(.5-(1-v.alignment)),n.beginPath(),n.arc(C.x,C.y,C.radius+N,0,2*Math.PI),n.closePath()),n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.stroke());else if(d.type===jl.l.ELIP){if(C=f,(H=1===v.alignment)||this.paintEllipse(C,p,v,o,r,n),v.visible){if(.5!==v.alignment){N=v.width*(.5-(1-v.alignment));var P=2*(C.width+N),O=2*(C.height+N),R=C.x-P/2,L=C.y-O/2,j=P/2*.5522848,B=O/2*.5522848,U=R+P,z=L+O,F=R+P/2,G=L+O/2;n.beginPath(),n.moveTo(R,G),n.bezierCurveTo(R,G-B,F-j,L,F,L),n.bezierCurveTo(F+j,L,U,G-B,U,G),n.bezierCurveTo(U,G+B,F+j,z,F,z),n.bezierCurveTo(F-j,z,R,G+B,R,G),n.closePath()}n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.stroke()}H&&this.paintEllipse(C,p,v,o,r,n)}else if(d.type===jl.l.RREC){var H;if(C=f,(H=1===v.alignment)||this.paintRoundedRectangle(C,p,v,o,r,n),v.visible){if(.5!==v.alignment){k=C.width,D=C.height,N=v.width*(.5-(1-v.alignment));var V=C.x-N,W=C.y-N,Y=C.width+2*N,X=C.height+2*N,Q=N*(v.alignment>=1?Math.min(Y/k,X/D):Math.min(k/Y,D/X)),Z=C.radius+Q,q=Math.min(Y,X)/2;Z=Z>q?q:Z,n.beginPath(),n.moveTo(V,W+Z),n.lineTo(V,W+X-Z),n.quadraticCurveTo(V,W+X,V+Z,W+X),n.lineTo(V+Y-Z,W+X),n.quadraticCurveTo(V+Y,W+X,V+Y,W+X-Z),n.lineTo(V+Y,W+Z),n.quadraticCurveTo(V+Y,W,V+Y-Z,W),n.lineTo(V+Z,W),n.quadraticCurveTo(V,W,V,W+Z),n.closePath()}n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.stroke()}H&&this.paintRoundedRectangle(C,p,v,o,r,n)}}},e.prototype.paintPolygonStroke=function(e,t,n,r,i,o,a){if(.5!==t.alignment){var s=t.width*(.5-(1-t.alignment)),u=Gp.offsetPolygon(e.points,s),l=void 0;a.beginPath(),a.moveTo(u[0],u[1]);for(var c=2;c=0;c-=2)a.lineTo(u[c],u[c+1]);r[h].shape.closeStroke&&a.closePath()}}a.globalAlpha=t.alpha*o,a.strokeStyle=n,a.stroke()},e.prototype.paintEllipse=function(e,t,n,r,i,o){var a=2*e.width,s=2*e.height,u=e.x-a/2,l=e.y-s/2,c=a/2*.5522848,h=s/2*.5522848,d=u+a,f=l+s,p=u+a/2,v=l+s/2;0===n.alignment&&o.save(),o.beginPath(),o.moveTo(u,v),o.bezierCurveTo(u,v-h,p-c,l,p,l),o.bezierCurveTo(p+c,l,d,v-h,d,v),o.bezierCurveTo(d,v+h,p+c,f,p,f),o.bezierCurveTo(p-c,f,u,v+h,u,v),o.closePath(),0===n.alignment&&o.clip(),t.visible&&(o.globalAlpha=t.alpha*i,o.fillStyle=r,o.fill()),0===n.alignment&&o.restore()},e.prototype.paintRoundedRectangle=function(e,t,n,r,i,o){var a=e.x,s=e.y,u=e.width,l=e.height,c=e.radius,h=Math.min(u,l)/2;c=c>h?h:c,0===n.alignment&&o.save(),o.beginPath(),o.moveTo(a,s+c),o.lineTo(a,s+l-c),o.quadraticCurveTo(a,s+l,a+c,s+l),o.lineTo(a+u-c,s+l),o.quadraticCurveTo(a+u,s+l,a+u,s+l-c),o.lineTo(a+u,s+c),o.quadraticCurveTo(a+u,s,a+u-c,s),o.lineTo(a+c,s),o.quadraticCurveTo(a,s,a,s+c),o.closePath(),0===n.alignment&&o.clip(),t.visible&&(o.globalAlpha=t.alpha*i,o.fillStyle=r,o.fill()),0===n.alignment&&o.restore()},e.prototype.setPatternTransform=function(e,t){if(!1!==this._svgMatrix){if(!this._svgMatrix){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");if(n&&n.createSVGMatrix&&(this._svgMatrix=n.createSVGMatrix()),!this._svgMatrix||!e.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=t.a,this._svgMatrix.b=t.b,this._svgMatrix.c=t.c,this._svgMatrix.d=t.d,this._svgMatrix.e=t.tx,this._svgMatrix.f=t.ty,e.setTransform(this._svgMatrix.inverse())}},e.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},e}(),Vp=new jl.d;Dd.prototype.generateCanvasTexture=function(e,t){void 0===t&&(t=1);var n=this.getLocalBounds(),r=Xl.p.create({width:n.width,height:n.height,scaleMode:e,resolution:t});Bp||(Bp=new zp.a),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(Vp),Vp.invert(),Vp.tx-=n.x,Vp.ty-=n.y,Bp.render(this,{renderTexture:r,clear:!0,transform:Vp});var i=Xl.t.from(r.baseTexture._canvasRenderTarget.canvas,{scaleMode:e});return i.baseTexture.setResolution(t),i},Dd.prototype.cachedGraphicsData=[],Dd.prototype._renderCanvas=function(e){!0!==this.isMask&&(this.finishPoly(),e.plugins.graphics.render(this))}; /*! * @pixi/canvas-sprite - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -230,7 +230,7 @@ Xl.q.registerPlugin("accessibility",Ll),Xl.q.registerPlugin("extract",ah),Xl.q.r * @pixi/canvas-sprite is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -var Wp=new jl.d,Yp=function(){function e(e){this.renderer=e}return e.prototype.render=function(e){var t=e._texture,n=this.renderer,r=n.context;if(t.valid){var i=t._frame.width,o=t._frame.height,a=e.transform.worldTransform,s=0,u=0,l=t.baseTexture.getDrawableSource();if(!(t.orig.width<=0||t.orig.height<=0)&&t.valid&&l){n.setBlendMode(e.blendMode,!0),n.context.globalAlpha=e.worldAlpha;var c=t.baseTexture.scaleMode===Ah.p.LINEAR;n.smoothProperty&&n.context[n.smoothProperty]!==c&&(r[n.smoothProperty]=c),t.trim?(s=t.trim.width/2+t.trim.x-e.anchor.x*t.orig.width,u=t.trim.height/2+t.trim.y-e.anchor.y*t.orig.height):(s=(.5-e.anchor.x)*t.orig.width,u=(.5-e.anchor.y)*t.orig.height),t.rotate&&(a.copyTo(Wp),a=Wp,jl.n.matrixAppendRotationInv(a,t.rotate,s,u),s=0,u=0),s-=i/2,u-=o/2,n.setContextTransform(a,e.roundPixels,1),e.roundPixels&&(s|=0,u|=0);var h=t.baseTexture.resolution,d=n._outerBlend;d&&(r.save(),r.beginPath(),r.rect(s*n.resolution,u*n.resolution,i*n.resolution,o*n.resolution),r.clip()),16777215!==e.tint?(e._cachedTint===e.tint&&e._tintedCanvas.tintId===e._texture._updateID||(e._cachedTint=e.tint,e._tintedCanvas=Fp.b.getTintedCanvas(e,e.tint)),r.drawImage(e._tintedCanvas,0,0,Math.floor(i*h),Math.floor(o*h),Math.floor(s*n.resolution),Math.floor(u*n.resolution),Math.floor(i*n.resolution),Math.floor(o*n.resolution))):r.drawImage(l,t._frame.x*h,t._frame.y*h,Math.floor(i*h),Math.floor(o*h),Math.floor(s*n.resolution),Math.floor(u*n.resolution),Math.floor(i*n.resolution),Math.floor(o*n.resolution)),d&&r.restore(),n.setBlendMode(Ah.b.NORMAL)}}},e.prototype.destroy=function(){this.renderer=null},e}();Ld.prototype._tintedCanvas=null,Ld.prototype._renderCanvas=function(e){e.plugins.sprite.render(this)}; +var Wp=new jl.d,Yp=function(){function e(e){this.renderer=e}return e.prototype.render=function(e){var t=e._texture,n=this.renderer,r=n.context;if(t.valid){var i=t._frame.width,o=t._frame.height,a=e.transform.worldTransform,s=0,u=0,l=t.baseTexture.getDrawableSource();if(!(t.orig.width<=0||t.orig.height<=0)&&t.valid&&l){n.setBlendMode(e.blendMode,!0),n.context.globalAlpha=e.worldAlpha;var c=t.baseTexture.scaleMode===Ah.p.LINEAR;n.smoothProperty&&n.context[n.smoothProperty]!==c&&(r[n.smoothProperty]=c),t.trim?(s=t.trim.width/2+t.trim.x-e.anchor.x*t.orig.width,u=t.trim.height/2+t.trim.y-e.anchor.y*t.orig.height):(s=(.5-e.anchor.x)*t.orig.width,u=(.5-e.anchor.y)*t.orig.height),t.rotate&&(a.copyTo(Wp),a=Wp,jl.n.matrixAppendRotationInv(a,t.rotate,s,u),s=0,u=0),s-=i/2,u-=o/2,n.setContextTransform(a,e.roundPixels,1),e.roundPixels&&(s|=0,u|=0);var h=t.baseTexture.resolution,d=n._outerBlend;d&&(r.save(),r.beginPath(),r.rect(s*n.resolution,u*n.resolution,i*n.resolution,o*n.resolution),r.clip()),16777215!==e.tint?(e._cachedTint===e.tint&&e._tintedCanvas.tintId===e._texture._updateID||(e._cachedTint=e.tint,e._tintedCanvas=zp.b.getTintedCanvas(e,e.tint)),r.drawImage(e._tintedCanvas,0,0,Math.floor(i*h),Math.floor(o*h),Math.floor(s*n.resolution),Math.floor(u*n.resolution),Math.floor(i*n.resolution),Math.floor(o*n.resolution))):r.drawImage(l,t._frame.x*h,t._frame.y*h,Math.floor(i*h),Math.floor(o*h),Math.floor(s*n.resolution),Math.floor(u*n.resolution),Math.floor(i*n.resolution),Math.floor(o*n.resolution)),d&&r.restore(),n.setBlendMode(Ah.b.NORMAL)}}},e.prototype.destroy=function(){this.renderer=null},e}();Ld.prototype._tintedCanvas=null,Ld.prototype._renderCanvas=function(e){e.plugins.sprite.render(this)}; /*! * @pixi/canvas-extract - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -245,7 +245,7 @@ var Xp=new jl.j,Qp=function(){function e(e){this.renderer=e}return e.prototype.i * * @pixi/canvas-sprite-tiling is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license - */ff.prototype._renderCanvas=function(e){var t=this._texture;if(t.baseTexture.valid){var n=e.context,r=this.worldTransform,i=t.baseTexture,o=i.getDrawableSource(),a=i.resolution;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var s=new Ol.CanvasRenderTarget(t._frame.width,t._frame.height,a);16777215!==this.tint?(this._tintedCanvas=Fp.b.getTintedCanvas(this,this.tint),s.context.drawImage(this._tintedCanvas,0,0)):s.context.drawImage(o,-t._frame.x*a,-t._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=s.context.createPattern(s.canvas,"repeat")}n.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),this.tileTransform.updateLocalTransform();var u=this.tileTransform.localTransform,l=this._width,c=this._height;$p.identity(),ev.copyFrom(u),this.uvRespectAnchor||ev.translate(-this.anchor.x*l,-this.anchor.y*c),ev.scale(this.tileScale.x/a,this.tileScale.y/a),$p.prepend(ev),$p.prepend(r),e.setContextTransform($p),n.fillStyle=this._canvasPattern;var h=this.anchor.x*-l,d=this.anchor.y*-c;tv[0].set(h,d),tv[1].set(h+l,d),tv[2].set(h+l,d+c),tv[3].set(h,d+c);for(var f=0;f<4;f++)ev.applyInverse(tv[f],tv[f]);for(n.beginPath(),n.moveTo(tv[0].x,tv[0].y),f=1;f<4;f++)n.lineTo(tv[f].x,tv[f].y);n.closePath(),n.fill()}},$h.prototype.renderCanvas=function(e){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var t=e.context,n=this.worldTransform,r=!0,i=0,o=0,a=0,s=0;e.setBlendMode(this.blendMode),t.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var u=0;u20&&(e.value=Math.floor(1e3*e.times/e.valueTotal),e.valueTotal=0,e.times=0,e.destroyed||e.emit("update",e.value)),e.prevTime=t,e.destroyed||e.calcFps()}))}},{key:"destroy",value:function(){this.destroyed=!0}}]),n}(Ks.a);!function(e){e.ResourceError="RESOURCE_ERROR",e.RuntimeError="RUNTIME_ERROR",e.RuntimeWarn="RUNTIME_WARN",e.CanvasCrash="CANVAS_CRASH"}(Jp||(Jp={}));var rv=function(e){p(n,e);var t=m(n);function n(e,r){var i,o,a;return _(this,n),o=y(i=t.call(this,r)),a=(this instanceof n?this.constructor:void 0).prototype,Object.setPrototypeOf?Object.setPrototypeOf(o,a):o.__proto__&&(o.__proto__=a),i.errorType=e,i.errorMsg=r,i}return T(n,null,[{key:"transform",value:function(e){return e instanceof n?e:new n(Jp.RuntimeError,e.message)}}]),n}(r(Error));function iv(){return function(e,t,n){var r=n.value;n.value=function(){try{for(var e=arguments.length,t=new Array(e),n=0;n2048||x>2048)&&(_=(y*=2048/b)*x)>2048&&(y*=x/_),w=document.createElement("canvas"),T=Math.ceil(g.width*y),M=Math.ceil(g.height*y),w.width=T,w.height=M,w.getContext("2d").drawImage(g,0,0,T,M),S=w.toDataURL("image/png"),E=new Xl.c(S,{resolution:1}),n.abrupt("return",(this.logger.info("load end. "+o,this.taskId||""),this.useCache&&this.localStorage.setItem(u,{scale:y,scaledBase64:S}).catch((function(){})),{baseTexture:E,scale:y}));case 70:case"end":return n.stop()}}),n,this,[[22,34],[39,52]])})))}},{key:"destroy",value:function(){}}]),e}(),mv=function(){function e(t){var n=this;_(this,e),this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=function(e){var t=e/(nd.b.TARGET_FPMS||.06);if(!n.isPaused){n.timestamp+=t,n.callbackList=n.callbackList.filter((function(e){return e&&!e.applied}));for(var r=n.callbackList.length,i=0;i=0&&!this.callbackList[t].running&&this.callbackList.splice(t,1)}},{key:"delay",value:function(e){var t=this;return new Promise((function(n){t.setTimeout(n,e)}))}},{key:"waitUntil",value:function(e,t){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=this.timestamp;case 1:if(e()||!(this.timestamp-r90&&a<270||a<-90&&a>-270)&&(r=-r),i=s*r}return{x:r,y:i}}function Sv(e,t,n,r,i,o){var a,s,u,l,c,h=e,d=t;if(0===Math.round(r))a=i,s=o,c=0;else if(Math.round(r)>=360)a=i,s=o,u=i+2*e*Math.abs(Math.cos(-n/180*Math.PI)),l=o+2*t*Math.sin(-n/180*Math.PI),c=1;else{var f=-(n+r),p=Mv(-n,h,d),v=i-p.x,m=o+p.y,g=Mv(f,h,d);a=g.x+v,s=m-g.y,c=r>=-360&&r<-180?1:r>=-180&&r<0||r>0&&r<180?0:1}return{radiusX:h,radiusY:d,xAxisRotation:0,largeArcFlag:c,sweepFlag:r>0?1:0,endX:a,endY:s,middleX:u,middleY:l}}var Ev=function(){function e(){_(this,e),this.pool=[]}return T(e,[{key:"getObject",value:function(e){var t=this.pool.find((function(e){return!e.isUsed}));if(t)return t.isUsed=!0,t.obj;var n={obj:this.createObject(),isUsed:!0,group:e};return this.pool.push(n),n.obj}},{key:"collectObject",value:function(e){var t=this.pool.find((function(t){return t.obj===e}));t&&(t.isUsed=!1,this.resetObject(t.obj))}},{key:"collectObjectByGroup",value:function(e){var t=this;this.pool.filter((function(t){return t.group===e})).forEach((function(e){return t.collectObject(e.obj)}))}}]),e}(),Av=new(function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return T(n,[{key:"createObject",value:function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("version","1.1"),e}},{key:"resetObject",value:function(e){e.removeAttribute("viewBox"),e.removeAttribute("width"),e.removeAttribute("height"),e.innerHTML=""}}]),n}(Ev)),Iv=new(function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return T(n,[{key:"createObject",value:function(){return document.createElement("img")}},{key:"resetObject",value:function(e){e.removeAttribute("src")}}]),n}(Ev)),Cv=function(){function e(t){_(this,e),this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null),this.maxResolution=t}return T(e,[{key:"render",value:function(e,t,n,r){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,l,h,d,f,p,v,m=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.items,o=e.width,a=e.height,s=Iv.getObject(n),u=new Xl.c(s,{width:o*r,height:a*r,resolution:1}),l=Av.getObject(n),this.imgElements.push(s),this.svgElements.push(l),l.setAttribute("viewBox","0 0 ".concat(o," ").concat(a)),l.setAttribute("width",""+o),l.setAttribute("height",""+a),h={},i.forEach((function(e){var t=e.item,n=e.x,i=e.y,o=n+2,a=i+2;t.pathsData.forEach((function(e){var t="";e.cmds.forEach((function(n){var r=c(n,2),i=r[0],s=r[1];t+=i+" ",t+=s.map((function(t){return Tv()(t)||(t.x=t.x+e.offset.x+o,t.y=t.y+e.offset.y+a),t})).reduce((function(e,t){return Tv()(t)?e+=t+" ":e+="".concat(t.x," ").concat(t.y," "),e}),""),t+=" "})),e.pathElement.setAttribute("d",t),l.appendChild(e.pathElement)}));var s=t.width-4-2*t.padding,d=t.height-4-2*t.padding;m.textures[t.hash]={texture:new Xl.t(u,new jl.j((o+2)*r,(a+2)*r,s*r,d*r)),pivot:t.pivot,scale:1/r},h[t.hash]=m.hashToIdMap[t.hash]})),f=''+l.outerHTML,d="data:image/svg+xml,"+encodeURIComponent(f).replace(/'/g,"%27").replace(/"/g,"%22"),(p=document.createElement("img")).src=d,t.next=9,new Promise((function(e,t){p.onload=function(){return e("")},p.onerror=function(){return t()}}));case 9:return(v=document.createElement("canvas")).width=p.width*r,v.height=p.height*r,v.getContext("2d").drawImage(p,0,0,v.width,v.height),s.src=v.toDataURL("image/png"),t.next=15,new Promise((function(e,t){s.onload=function(){return e("")},s.onerror=function(){return t()}}));case 15:case"end":return t.stop()}}),t,this)})))}},{key:"getGraphicsData",value:function(e){var t=this.idToHashMap[e]||"";return this.textures[t]||null}},{key:"addGraphics",value:function(e,t,n,r,i,o,a,s,u,l,h){var d,f;if(!a&&!u)return e;var p,v,m,g,y,b,x,_,w,T,M,S,E,A,I,C,N,k,D=_v()(n+(null!==(f=null===(d=null==a?void 0:a.width)||void 0===d?void 0:d.toString())&&void 0!==f?f:0)+u+l+h);if(this.hashToIdMap[D]||(this.hashToIdMap[D]=[]),this.hashToIdMap[D].push(e),this.idToHashMap[e]=D,this.graphics.findIndex((function(e){return e.hash===D}))<0){var P=(p=t,v=i,m=o,g=a,y=r,b=u,x=l,_=h,T=[],M={x:Math.abs(y.x),y:Math.abs(y.y)},S=0,E=0,A=0,I=0,C=0,N="none",k=null!==(w=null==g?void 0:g.width)&&void 0!==w?w:0,b?(S=v,E=m,C=0):(N=_||"#ff0000",C=k,A=.5*k,I=.5*k,S=v+k,E=m+k,M.x+=.5*k,M.y+=.5*k),S+=Math.abs(y.x),E+=Math.abs(y.y),A+=Math.abs(y.x),I+=Math.abs(y.y),S+=4,E+=4,A+=2,I+=2,S=Math.ceil(S),E=Math.ceil(E),p.forEach((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","path");"none"!==e.fill&&b?t.setAttribute("fill",x||"#ff0000"):t.setAttribute("fill","none"),e.hasStroke&&!b&&(t.setAttribute("stroke-linecap",(null==g?void 0:g.cap)||"butt"),t.setAttribute("stroke-linejoin",(null==g?void 0:g.join)||"miter"),t.setAttribute("stroke-width",C.toString()),t.setAttribute("stroke",N),(null==g?void 0:g.dash)&&t.setAttribute("stroke-dasharray",g.dash));for(var n=e.scale,r=e.path.trim().split(" "),i={x:0,y:0},o={offset:{x:A,y:I},cmds:[],pathElement:t},a=0;a=360?(i={x:M.endX,y:M.endY},o.cmds.push(["A",[M.radiusX/9525*n.x,M.radiusY/9525*n.y,M.xAxisRotation,M.largeArcFlag,M.sweepFlag,{x:M.middleX/9525*n.x,y:M.middleY/9525*n.y}]]),o.cmds.push(["A",[M.radiusX/9525*n.x,M.radiusY/9525*n.y,M.xAxisRotation,M.largeArcFlag,M.sweepFlag,{x:M.endX/9525*n.x,y:M.endY/9525*n.y}]])):(i={x:M.endX,y:M.endY},o.cmds.push(["A",[M.radiusX/9525*n.x,M.radiusY/9525*n.y,M.xAxisRotation,M.largeArcFlag,M.sweepFlag,{x:M.endX/9525*n.x,y:M.endY/9525*n.y}]]))}else if("L"===s){var S=c(u.split(",").map((function(e){return Number(e)})),2),E=S[0],k=S[1];i={x:E,y:k},E=E/9525*n.x,k=k/9525*n.y,o.cmds.push(["L",[{x:E,y:k}]])}else if("QB"===s){var D=c(u.split(",").map((function(e){return Number(e)})),4),P=D[0],O=D[1],R=D[2],L=D[3];i={x:R,y:L},P=P/9525*n.x,O=O/9525*n.y,R=R/9525*n.x,L=L/9525*n.y,o.cmds.push(["Q",[{x:P,y:O},{x:R,y:L}]])}else if("CB"===s){var j=c(u.split(",").map((function(e){return Number(e)})),6),B=j[0],U=j[1],F=j[2],z=j[3],G=j[4],H=j[5];i={x:G,y:H},B=B/9525*n.x,U=U/9525*n.y,F=F/9525*n.x,z=z/9525*n.y,G=G/9525*n.x,H=H/9525*n.y,o.cmds.push(["C",[{x:B,y:U},{x:F,y:z},{x:G,y:H}]])}else"C"===s&&o.cmds.push(["Z",[]])}T.push(o)})),{graphicsWidth:S,graphicsHeight:E,pivot:M,padding:2,pathsData:T}),O=P.graphicsWidth,R=P.graphicsHeight,L=P.pathsData,j=P.pivot,B=P.padding;this.graphics.push({hash:D,pathsData:L,pivot:j,width:O,height:R,padding:B})}return e}},{key:"pack",value:function(){return this.graphics.forEach((function(e){e.width+=4,e.height+=4})),function e(t){for(var n=[],r=t.filter((function(e){var t=e.width<2048&&e.height<2048;return t||n.push(e),t})).sort((function(e,t){return e.width*e.height-t.width*t.height})),i=r.length+1,o=2050,a=2050,s=[],u=null;(o>2048||a>2048)&&r.length>0;)i-=1,o=(u=av()(r.slice(0,i))).width,a=u.height;return u&&s.push(u),n.forEach((function(e){var t=av()([e]);s.push(t)})),i2&&void 0!==arguments[2]?arguments[2]:{type:"el",index:0,id:""},o=this.targets[e.id];return"shape"!==e.type?o:("shape"===e.type&&e.txEl&&(o=null!==(n=null==o?void 0:o.getTextElement(e.txEl.type,e.txEl.range))&&void 0!==n?n:null),"shape"===e.type&&e.bg&&0===i.index&&(t=!1,o=null!==(r=null==o?void 0:o.getBgElement())&&void 0!==r?r:null,this.eventHub.emit("IterateTimeNodeEnd",i.id)),t&&o?o.getIterateEntry(i.type,i.index,i.id):(o||this.eventHub.emit("IterateTimeNodeEnd",i.id),o))}},{key:"clearTargets",value:function(){this.targets=Object.create(null)}}]),e}(),Dv=function(){function e(t){_(this,e),this.target=t}return T(e,[{key:"color",get:function(){return this.target.strokeColorFilter.currentColor},set:function(e){this.target.strokeColorFilter.color=e}},{key:"on",get:function(){return this.target.strokeActive?"true":"false"},set:function(e){this.target.strokeActive="true"===e}}]),e}(),Pv=function e(t){var n=this;_(this,e),this.applyCommand=function(e,t){n.target.applyCommand(e,t)},this.target=t},Ov=function(){function e(t){_(this,e),this.target=t}return T(e,[{key:"toString",value:function(){return this.color}},{key:"color",get:function(){return this.target.pptColorFilter.currentColor},set:function(e){this.target.pptColorActive&&(this.target.pptColorFilter.color=e)}},{key:"on",get:function(){return this.target.pptColorActive?"true":"false"},set:function(e){this.target.pptColorActive="true"===e}},{key:"designColor",get:function(){return this.target.pptColorFilter.designColor}}]),e}(),Rv=function(){function e(t){_(this,e),this.target=t}return T(e,[{key:"color",get:function(){return this.target.fillColorFilter.currentColor},set:function(e){this.target.fillActive&&(this.target.fillColorFilter.color=e)}},{key:"on",get:function(){return this.target.fillActive?"true":"false"},set:function(e){this.target.fillActive="true"===e}},{key:"designColor",get:function(){return this.target.fillColorFilter.designColor}}]),e}(),Lv=function(){function e(t,n,r){_(this,e),this.hardHidden=!1,this.designRotation=0,this.target=t,!0===n&&(this.hardHidden=!0),this.designRotation=r}return T(e,[{key:"opacity",get:function(){return this.target.alpha},set:function(e){this.target.alpha=e}},{key:"rotation",get:function(){return this.target.rotation/Math.PI*180},set:function(e){this.target.rotation=e/180*Math.PI+this.designRotation}},{key:"visibility",get:function(){return this.target.visible?"visible":"hidden"},set:function(e){this.visibility===e||this.hardHidden||(this.target.visible="visible"===e)}}]),e}(),jv=function(){function e(t,n){_(this,e),this.actions=[],this.ctx=n,this.object=t,this.object.interactive=!0}return T(e,[{key:"reset",value:function(e){this.object.interactive=!1,this.object.removeAllListeners(),this.object=e,this.object.interactive=!0}},{key:"addAction",value:function(e,t){var n=this;this.actions.push([e,t]),"click"===t?(this.object.addListener("pointertap",(function(){return n.handleAction(e)})),this.object.cursor="pointer"):"hover"===t&&this.object.addListener("mouseover",(function(){return n.handleAction(e)}))}},{key:"getOriginHitArea",value:function(){return this.object.hitArea?this.object.hitArea:new jl.k(0,0,this.object.width,this.object.height)}},{key:"handleAction",value:function(e){this.ctx.eventHub.emit(bb.hyperlinkTrigger,e),this.execAction(e)}},{key:"execAction",value:function(e){var t,n;if(this.ctx.eventHub.emit(bb.userInput),"ppaction://hlinksldjump"===e.action){var r=(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"").match(/slide(\d+)\.xml/);r&&r[1]&&this.ctx.eventHub.emit(bb.requestGotoSlide,Number(r[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===e.action)this.ctx.eventHub.emit(bb.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===e.action)this.ctx.eventHub.emit(bb.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===e.action)this.ctx.eventHub.emit(bb.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===e.action)this.ctx.eventHub.emit(bb.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===e.action){var i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(bb.requestGotoSlide,i)}else"ppaction://hlinkshowjump?jump=endshow"===e.action?this.ctx.eventHub.emit(bb.requestGotoSlide,-1):""===e.action&&(null===(n=e.target)||void 0===n?void 0:n.startsWith("http"))&&this.ctx.eventHub.emit(bb.requestOpenUrl,e.target)}}]),e}();function Bv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return Math.abs(e-t)<=Math.pow(10,-n)}function Uv(e){return Math.floor(1e6*e)/1e6}var Fv=function(){function e(){_(this,e),this.point={x:0,y:0},this.slope=Math.PI/4}return T(e,[{key:"resolveY",value:function(e){return Math.tan(this.slope)*(e-this.point.x)+this.point.y}},{key:"distanceToLinearEquation",value:function(e){return Bv(this.slope,e.slope)?this.distanceToPoint(e.point):-1}},{key:"distanceToPoint",value:function(t){var n;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;n=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;var r=e.fromPointSlope(t,n),i=this.crossPoint(r);return i?Math.ceil(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))):0}},{key:"crossPoint",value:function(e){if(Bv(e.slope,this.slope))return null;var t=0,n=0,r=Math.tan(e.slope),i=Math.tan(this.slope),o=this.point,a=o.x,s=o.y,u=e.point,l=u.x,c=u.y;return Bv(this.slope,Math.PI/2)?n=r*((t=this.point.x)-l)+c:Bv(e.slope,Math.PI/2)?n=i*((t=e.point.x)-a)+s:Bv(this.slope,Math.PI)||Bv(this.slope,0)?t=((n=this.point.y)-c)/r+l:Bv(e.slope,Math.PI)||Bv(e.slope,0)?t=((n=e.point.y)-s)/i+a:n=i*((t=(r*l-c+s-i*a)/(r-i))-a)+s,{x:t,y:n}}}],[{key:"fromPointSlope",value:function(t,n){var r=new e;return r.point=t,r.slope=n,r}}]),e}(),zv=function(){function e(t,n,r){var i,o,a,s,u,l,c=this;_(this,e),this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new jl.j(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 Rl.b,this.ctx=n,this.style=new Lv(this.container,!!t.hardHidden,t.rotation||0),this.designGlobalPosition={x:r.parentGlobalPos.x+(null!==(o=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0),y:r.parentGlobalPos.y+(null!==(s=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new jv(this.container,this.ctx),t.hlinkHover&&(null===(u=this.hyperlink)||void 0===u||u.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(l=this.hyperlink)||void 0===l||l.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil((function(){try{return!!c.container.width}catch(e){return!1}}),3e3).then((function(){try{c.designWidth=c.designWidth||c.container.width}catch(e){}})),this.ctx.clock.waitUntil((function(){try{return!!c.container.height}catch(e){return!1}}),3e3).then((function(){try{c.designHeight=c.designHeight||c.container.height}catch(e){}}))}return T(e,[{key:"updateScale",value:function(){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)}},{key:"updateTransform",value:function(e){var t,n,r,i,o,a,s,u;this.designWidth=e.width,this.designHeight=e.height,this.designX=null!==(n=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,this.designY=null!==(i=null===(r=e.position)||void 0===r?void 0:r.y)&&void 0!==i?i:0;var l=this.designWidth/2,c=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=l,this.container.pivot.y=c;var h=null!==(a=null===(o=e.position)||void 0===o?void 0:o.x)&&void 0!==a?a:0,d=null!==(u=null===(s=e.position)||void 0===s?void 0:s.y)&&void 0!==u?u:0;this.container.x=h+l,this.container.y=d+c,e.scale&&(this.designScale={x:e.scale.x,y:e.scale.y},this.container.scale.x=e.scale.x,this.container.scale.y=e.scale.y),e.rotation&&(this.container.rotation=e.rotation);var f=new Dd;f.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(f),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=h,this.bound.y=d,this.bound.width=this.designWidth,this.bound.height=this.designHeight}},{key:"scale",get:function(){return this.scaleOrigin},set:function(e){this.scaleOrigin.x=e.x,this.scaleOrigin.y=e.y,this.updateScale()}},{key:"design_ppt_w",get:function(){return Uv(this.designWidth/this.ctx.stageWidth)}},{key:"design_ppt_h",get:function(){return Uv((this.designHeight||this.container.height)/this.ctx.stageHeight)}},{key:"design_ppt_x",get:function(){return Uv(this.designX/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Uv(this.designY/this.ctx.stageHeight)}},{key:"ppt_w",get:function(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth},set:function(e){this.designWidth&&(this.scaleExt.x=e*this.ctx.stageWidth/this.designWidth,this.updateScale())}},{key:"ppt_h",get:function(){var e=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*e/this.ctx.stageHeight},set:function(e){this.designHeight&&(this.scaleExt.y=e*this.ctx.stageHeight/this.designHeight,this.updateScale())}},{key:"ppt_x",get:function(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth},set:function(e){this.pptX=e;var t=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=e*this.ctx.stageWidth+this.container.pivot.x*t}},{key:"ppt_y",get:function(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight},set:function(e){this.pptY=e;var t=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=e*this.ctx.stageHeight+this.container.pivot.y*t}},{key:"r",get:function(){return this.container.rotation},set:function(e){this.container.rotation=e}},{key:"xshear",set:function(e){this.container.skew.x=e},get:function(){return this.container.skew.x}},{key:"yshear",set:function(e){this.container.skew.y=e},get:function(){return this.container.skew.y}}]),e}(),Gv=n(112),Hv=n.n(Gv),Vv=function(){function e(t){if(_(this,e),this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;var n=t.match(/-?[0-9]+/g);n&&(this.h=parseInt(n[0],10),this.s=parseInt(n[1],10)/100,this.l=parseInt(n[2],10)/100)}}return T(e,[{key:"isInit",value:function(){return this._isInit}},{key:"by",value:function(e,t){t.h=Math.max(Math.min(this.h+e.h,359),0),t.s=Math.max(Math.min(this.s+e.s,1),0),t.l=Math.max(Math.min(this.l+e.l,1),0),t.a=Math.max(Math.min(this.a+e.a,1),0)}},{key:"fromHexString",value:function(e){var t,n,r=c(Xv(e),4),i=r[0],o=r[1],a=r[2],s=r[3],u=0,l=Math.max(i,o,a),h=Math.min(i,o,a),d=l-h;n=(l+h)/2,0===d?u=0:l===i?u=(o-a)/d%6*60:l===o?u=60*((a-i)/d+2):l===a&&(u=60*((i-o)/d+4)),t=0===d?0:d/(1-Math.abs(2*n-1)),this.h=u,this.s=t,this.l=n,this.a=s}},{key:"interpolationFrom",value:function(e,t,n){var r=e.h+(this.h-e.h)*t,i=e.s+(this.s-e.s)*t,o=e.l+(this.l-e.l)*t,a=e.a+(this.a-e.a)*t;n.h=Math.max(Math.min(r,359),0),n.s=Math.max(Math.min(i,1),0),n.l=Math.max(Math.min(o,1),0),n.a=Math.max(Math.min(a,1),0)}},{key:"toHexString",value:function(){var e=[0,0,0,0],t=this.h,n=this.s,r=this.l;if(t<360&&t>=0&&n<=1&&n>=0&&r<=1&&r>=0){var i,o=(1-Math.abs(2*r-1))*n,a=o*(1-Math.abs(t/60%2-1)),s=r-o/2;e=[(i=c(t>=0&&t<60?[o,a,0]:t>=60&&t<120?[a,o,0]:t>=120&&t<180?[0,o,a]:t>=180&&t<240?[0,a,o]:t>=240&&t<300?[a,0,o]:[o,0,a],3))[0]+s,i[1]+s,i[2]+s,this.a]}return Qv(e)}}]),e}(),Wv=function(){function e(t){_(this,e),this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}return T(e,[{key:"fromHexString",value:function(e){var t=c(Xv(e),4),n=t[0],r=t[1],i=t[2],o=t[3];this.r=n,this.g=r,this.b=i,this.a=o}},{key:"isInit",value:function(){return this._isInit}},{key:"interpolationFrom",value:function(e,t,n){n.r=e.r+(this.r-e.r)*t,n.g=e.g+(this.g-e.g)*t,n.b=e.b+(this.b-e.b)*t,n.a=e.a+(this.a-e.a)*t}},{key:"by",value:function(e,t){t.r=Math.min(Math.max(this.r+e.r,0),255),t.g=Math.min(Math.max(this.g+e.g,0),255),t.b=Math.min(Math.max(this.b+e.b,0),255),t.a=Math.min(Math.max(this.a+e.a,0),1)}},{key:"toHexString",value:function(){return Qv([this.r,this.g,this.b,this.a])}}]),e}();function Yv(e){var t=e.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function Xv(e){return 0===(e=e.replace(/^#/,"")).substring(6,8).length&&(e+="FF"),[parseInt(e.substring(0,2).padStart(8,"0"),16)/255,parseInt(e.substring(2,4).padStart(8,"0"),16)/255,parseInt(e.substring(4,6).padStart(8,"0"),16)/255,parseInt(e.substring(6,8).padStart(8,"0"),16)/255]}function Qv(e){return"#"+Math.round(255*e[0]).toString(16).padStart(2,"0")+Math.round(255*e[1]).toString(16).padStart(2,"0")+Math.round(255*e[2]).toString(16).padStart(2,"0")+Math.round(255*e[3]).toString(16).padStart(2,"0")}function Zv(e,t,n){var r=Xv(e),i=Xv(t),o=Math.round(255*(r[0]+(i[0]-r[0])*n)),a=Math.round(255*(r[1]+(i[1]-r[1])*n)),s=Math.round(255*(r[2]+(i[2]-r[2])*n)),u=Math.round(255*(r[3]+(i[3]-r[3])*n));return"#"+o.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+u.toString(16).padStart(2,"0")}var qv=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this,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})).currentColor="#FFFFFFFF",e.designColor="#FFFFFFFF",e}return T(n,[{key:"color",set:function(e){this.currentColor=e;var t=Xv(e);this.uniforms.color=Float32Array.from(t)},get:function(){return this.currentColor}}]),n}(Xl.k),Jv=new Up.ColorMatrixFilter;Jv.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];var Kv=new Up.ColorMatrixFilter;Kv.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];var $v=new Up.ColorMatrixFilter;$v.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];var em=new Up.ColorMatrixFilter;em.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];var tm={darken:Jv,darkenLess:Kv,lightenLess:em,lighten:$v},nm=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,{position:{x:e.x,y:e.y},width:e.width,height:e.height},r,i)).fillColorFilter=new qv,o.fill=new Rv(y(o)),o.json=e,o.ctx=r,o.parentGlobalPos=i.parentGlobalPos,o.global={x:i.parentGlobalPos.x+e.x,y:i.parentGlobalPos.y+e.y},o.updateTransform({position:{x:e.x,y:e.y},width:e.width,height:e.height}),o}return T(n,[{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"getTextElement",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"fillActive",get:function(){var e,t;return(null!==(t=null===(e=this.container.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){var t,n;e?(null!==(n=null===(t=this.container.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}},{key:"renderContainer",get:function(){return this.container}},{key:"interactiveContainer",get:function(){return this.container}},{key:"ppt_x",get:function(){return this.global.x/this.ctx.stageWidth},set:function(e){var t=e*this.ctx.stageWidth-this.global.x,n=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+t+this.container.pivot.x*n}},{key:"ppt_y",get:function(){return this.global.y/this.ctx.stageHeight},set:function(e){var t=e*this.ctx.stageHeight-this.global.y,n=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+t+this.container.pivot.y*n}},{key:"design_ppt_x",get:function(){return Uv(this.global.x/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Uv(this.global.y/this.ctx.stageHeight)}}]),n}(zv),rm=function(){function e(t,n,r,i,o,a,s,u,l,c,h){_(this,e),this.ctx=t,this.type=n,this.lineWidth=r,this.width=i,this.height=o,this.fillColor=a,this.isHorz=s,this.renderContainer=new Rl.b,this.ghcTextureId="".concat(u,"-text-p").concat(l,"-l").concat(c,"-u").concat(h,"-underLine")}return T(e,[{key:"createPaths",value:function(){if("ww"===this.type)return null;var e,t="M 0,0 L ".concat(9525*this.width,",0"),n=[this.width,this.lineWidth],r=n[0],i=n[1];return this.isHorz||(t="M 0,0 L 0,"+9525*this.height,r=(e=[this.lineWidth,this.height])[0],i=e[1]),{paths:[{id:uv(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:_v()(t)}],width:r,height:i}}},{key:"getLineStyle",value:function(){var e={width:this.lineWidth};return"dotted"===this.type&&(e.dash=""+this.lineWidth),e}},{key:"preRender",value:function(){var e=this.createPaths();if(e){var t=e.paths,n=e.width,r=e.height,i=t.reduce((function(e,t){return e+t.hash}),"");this.ctx.graphicsTexture.addGraphics(this.ghcTextureId,t,i,{x:0,y:0},n,r,this.getLineStyle(),this.ctx.objectPoolGroup,!1,null,this.fillColor)}}},{key:"render",value:function(){if(this.ghcTextureId){var e=this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);e&&(this.sprite=new Ld,this.sprite.texture=e.texture,this.sprite.pivot.x=e.pivot.x,this.sprite.scale.x=e.scale,this.sprite.scale.y=e.scale)}}},{key:"destroy",value:function(){var e;null===(e=this.sprite)||void 0===e||e.destroy({texture:!0})}}]),e}(),im=134217729;function om(e,t,n,r,i){var o,a,s,u,l=t[0],c=r[0],h=0,d=0;c>l==c>-l?(o=l,l=t[++h]):(o=c,c=r[++d]);var f=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=t[++h]):(s=o-((a=c+o)-c),c=r[++d]),o=a,0!==s&&(i[f++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=t[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=r[++d]),o=a,0!==s&&(i[f++]=s);for(;h0!=s>0)return u;var l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,n,r,i,o,a){var s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,S=e-i,E=n-i,A=t-o,I=r-o;h=(_=(p=S-(f=(d=im*S)-(d-S)))*(m=I-(v=(d=im*I)-(d-I)))-((x=S*I)-f*v-p*v-f*m))-(g=_-(T=(p=A-(f=(d=im*A)-(d-A)))*(m=E-(v=(d=im*E)-(d-E)))-((w=A*E)-f*v-p*v-f*m))),sm[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),sm[1]=b-(g+h)+(h-w),h=(M=y+g)-y,sm[2]=y-(M-h)+(g-h),sm[3]=M;var C=function(e,t){for(var n=t[0],r=1;r=N||-C>=N)return C;if(s=e-(S+(h=e-S))+(h-i),l=n-(E+(h=n-E))+(h-i),u=t-(A+(h=t-A))+(h-o),c=r-(I+(h=r-I))+(h-o),0===s&&0===u&&0===l&&0===c)return C;if(N=11093356479670487e-47*a+33306690738754706e-32*Math.abs(C),(C+=S*c+I*s-(A*l+E*u))>=N||-C>=N)return C;h=(_=(p=s-(f=(d=im*s)-(d-s)))*(m=I-(v=(d=im*I)-(d-I)))-((x=s*I)-f*v-p*v-f*m))-(g=_-(T=(p=u-(f=(d=im*u)-(d-u)))*(m=E-(v=(d=im*E)-(d-E)))-((w=u*E)-f*v-p*v-f*m))),hm[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),hm[1]=b-(g+h)+(h-w),h=(M=y+g)-y,hm[2]=y-(M-h)+(g-h),hm[3]=M;var k=om(4,sm,4,hm,um);h=(_=(p=S-(f=(d=im*S)-(d-S)))*(m=c-(v=(d=im*c)-(d-c)))-((x=S*c)-f*v-p*v-f*m))-(g=_-(T=(p=A-(f=(d=im*A)-(d-A)))*(m=l-(v=(d=im*l)-(d-l)))-((w=A*l)-f*v-p*v-f*m))),hm[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),hm[1]=b-(g+h)+(h-w),h=(M=y+g)-y,hm[2]=y-(M-h)+(g-h),hm[3]=M;var D=om(k,um,4,hm,lm);h=(_=(p=s-(f=(d=im*s)-(d-s)))*(m=c-(v=(d=im*c)-(d-c)))-((x=s*c)-f*v-p*v-f*m))-(g=_-(T=(p=u-(f=(d=im*u)-(d-u)))*(m=l-(v=(d=im*l)-(d-l)))-((w=u*l)-f*v-p*v-f*m))),hm[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),hm[1]=b-(g+h)+(h-w),h=(M=y+g)-y,hm[2]=y-(M-h)+(g-h),hm[3]=M;var P=om(D,lm,4,hm,cm);return cm[P-1]}(e,t,n,r,i,o,l)}var fm=Math.pow(2,-52),pm=new Uint32Array(512),vm=function(){function e(t){_(this,e);var n=t.length>>1;if(n>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;var r=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*r),this._halfedges=new Int32Array(3*r),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}return T(e,null,[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_m,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wm,i=t.length,o=new Float64Array(2*i),a=0;a>1,a=1/0,s=1/0,u=-1/0,l=-1/0,c=0;cu&&(u=h),d>l&&(l=d),this._ids[c]=c}for(var f,p,v,m=(a+u)/2,g=(s+l)/2,y=1/0,b=0;b0&&(p=T,y=M)}for(var S=e[2*p],E=e[2*p+1],A=1/0,I=0;IL&&(P[O++]=j,L=this._dists[j])}return this.hull=P.subarray(0,O),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(dm(_,w,S,E,N,k)<0){var B=p,U=S,F=E;p=v,S=N,E=k,v=B,N=U,k=F}var z=function(e,t,n,r,i,o){var a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,h=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*h)*d,y:t+(a*h-u*c)*d}}(_,w,S,E,N,k);this._cx=z.x,this._cy=z.y;for(var G=0;G0&&Math.abs(Q-V)<=fm&&Math.abs(Z-W)<=fm)&&(V=Q,W=Z,X!==f&&X!==p&&X!==v)){for(var q=0,J=0,K=this._hashKey(Q,Z);J=0;)if((ee=$)===q){ee=-1;break}if(-1!==ee){var te=this._addTriangle(ee,X,n[ee],-1,-1,r[ee]);r[X]=this._legalize(te+2),r[ee]=te,H++;for(var ne=n[ee];$=n[ne],dm(Q,Z,e[2*ne],e[2*ne+1],e[2*$],e[2*$+1])<0;)te=this._addTriangle(ne,X,$,r[X],-1,r[ne]),r[X]=this._legalize(te+2),n[ne]=ne,H--,ne=$;if(ee===q)for(;dm(Q,Z,e[2*($=t[ee])],e[2*$+1],e[2*ee],e[2*ee+1])<0;)te=this._addTriangle($,X,ee,-1,r[ee],r[$]),this._legalize(te+2),r[$]=te,n[ee]=ee,H--,ee=$;this._hullStart=t[X]=ee,n[ee]=t[ne]=X,n[X]=ne,i[this._hashKey(Q,Z)]=X,i[this._hashKey(e[2*ee],e[2*ee+1])]=ee}}}this.hull=new Uint32Array(H);for(var re=0,ie=this._hullStart;re0?3-i:1+i)/4*this._hashSize))%this._hashSize;var n,r,i}},{key:"_legalize",value:function(e){for(var t=this._triangles,n=this._halfedges,r=this.coords,i=0,o=0;;){var a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1!==a){var u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,h=t[o],d=t[e],f=t[l],p=t[c];if(gm(r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=h;var v=n[c];if(-1===v){var m=this._hullStart;do{if(this._hullTri[m]===c){this._hullTri[m]=e;break}m=this._hullPrev[m]}while(m!==this._hullStart)}this._link(e,v),this._link(a,n[o]),this._link(o,c);var g=u+(a+1)%3;i=n&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{var u=n+1,l=r;xm(e,n+r>>1,u),t[e[n]]>t[e[r]]&&xm(e,n,r),t[e[u]]>t[e[r]]&&xm(e,u,r),t[e[n]]>t[e[u]]&&xm(e,n,u);for(var c=e[u],h=t[c];;){do{u++}while(t[e[u]]h);if(l=l-n?(bm(e,t,u,r),bm(e,t,n,l-1)):(bm(e,t,n,l-1),bm(e,t,u,r))}}function xm(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _m(e){return e[0]}function wm(e){return e[1]}function Tm(e,t,n){var r=t/2,i=n/2,o=[{x:-r,y:i},{x:-r,y:-i},{x:r,y:i},{x:r,y:-i}],s=[Fv.fromPointSlope({x:-r,y:0},Math.PI/2),Fv.fromPointSlope({x:0,y:i},0),Fv.fromPointSlope({x:r,y:0},Math.PI/2),Fv.fromPointSlope({x:0,y:-i},0)],u=[],l=e.stopList.slice(1,e.stopList.length-1).map((function(o){for(var l,c,h,d=2*Math.PI,f=null!==(c=null===(l=e.line)||void 0===l?void 0:l.ang)&&void 0!==c?c:0;f>d;)f-=d;for(;f<0;)f+=d;var p={x:0,y:0};Bv(f,Math.PI/2)?(p.x=0,p.y=n/2-o.pos*n):Bv(f,0)?(p.x=o.pos*t-t/2,p.y=0):(p.x=o.pos*t-t/2,p.y=n/2-o.pos*n),f>Math.PI/2&&f<=Math.PI&&(p.x*=-1),f>Math.PI&&f<=2*Math.PI&&(p.y*=-1);var v=Fv.fromPointSlope(p,Math.PI/2-((null===(h=e.line)||void 0===h?void 0:h.ang)||0)),m=s.map((function(e){return v.crossPoint(e)})).filter((function(e){return e&&e.x<=r&&e.x>=-r&&e.y<=i&&e.y>=-i})).map((function(e){return{point:e,color:o.color}})).sort((function(e,t){return t.point.y-e.point.y}));u.push.apply(u,a(m));for(var g=Math.abs(m[1].point.x-m[0].point.x)/10,y=20;y--;){var b=y%2==0?1:-1,x=p.x+b*g,_=v.resolveY(x);x<=r&&x>=-r&&_<=i&&_>=-i&&u.push({point:{x:x,y:_},color:o.color}),g+=g}return v})),c=[],h=[];e:for(var d=0;d= 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",alphaBiLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < arg) {\n result.a = 0.0;\n } else {\n result.a = 1.0;\n }\n return result;\n}\n",alphaCeiling:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a > 0.0) {\n result.a = 1.0;\n }\n return result;\n}\n",alphaFloor:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < 1.0) {\n result.a = 0.0;\n }\n return result;\n}\n",grayscl:"\nvec4 transform(vec4 texColor, float arg) {\n float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n return vec4(avg, avg, avg, texColor.a);\n}\n"},Am=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),t.call(this,void 0,(i=Em[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n".concat(Sm.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n")),{arg:r})}return n}(Xl.k),Im=[Mm],Cm={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",duotone:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n\n vec3 hsl = rgb2hsl(vec3(avg, avg, avg));\n\n vec3 result = arg2.rgb * hsl.z + arg1.rgb * (1.0 - hsl.z);\n\n return vec4(result * texColor.a, texColor.a);\n}\n"},Nm=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),t.call(this,void 0,(o=Cm[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n".concat(Im.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:Float32Array.from(r),arg2:Float32Array.from(i)})}return n}(Xl.k),km=[Mm],Dm={lum:"\nvec4 transform(vec4 texColor, float arg1, float arg2) {\n vec3 rgb = texColor.rgb / texColor.a;\n\n // 对比度\n highp float C = arg2 * 255.0;\n highp float F = (259.0 * (255.0 + C)) / (255.0 * (259.0 - C));\n rgb.rgb = F * (rgb.rgb - 0.5) + 0.5;\n\n // 亮度\n rgb.rgb += arg1;\n\n rgb.rgb *= texColor.a;\n return vec4(rgb, texColor.a);\n}\n"},Pm=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),t.call(this,void 0,(o=Dm[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n".concat(km.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:r,arg2:i})}return n}(Xl.k),Om=[Mm],Rm={alphaInv:"\nvec4 transform(vec4 texColor, vec4 arg1) {\n float alpha = 1.0 - texColor.a;\n arg1.rgb = arg1.rgb * alpha;\n arg1.a = alpha;\n return arg1;\n}\n"},Lm=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),t.call(this,void 0,(i=Rm[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform sampler2D uSampler;\n\n".concat(Om.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1);\n}\n")),{arg1:Float32Array.from(r)})}return n}(Xl.k);function jm(e,t){var n=[];return e.forEach((function(e){var r=((null==t?void 0:t.filter)||[]).indexOf(e.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(e.type)>=0&&r)n.push(new Am(e.type,e.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(e.type)>=0&&r){var i=Xv(e.args[0]),o=Xv(e.args[1]);n.push(new Nm(e.type,i,o))}else if("lum"===e.type&&r)n.push(new Pm(e.type,e.args[0],e.args[1]));else if("alphaInv"===e.type&&r){var a=Xv(e.args[0]);n.push(new Lm(e.type,a))}})),n}var Bm=function(){function e(t,n,r,i,o){_(this,e),this.ctx=t,this.fillStyle=n,this.width=r,this.height=i,this.config=o,this.clonedObjects=[],this._displayObject=null,this.gradientHash=_v()("".concat(JSON.stringify(n)).concat(Math.ceil(r)).concat(Math.ceil(i)))}return T(e,[{key:"createDisplayObject",value:function(){var e;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){var t=new Ld;return t.texture=this.ctx.bgTexture,t}if("solidFill"===this.fillStyle.fillType||"noFill"===this.fillStyle.fillType)return null;if("gradientFill"===this.fillStyle.fillType){var n=new Ld,r=function(e,t,n){var r,i=new Rl.b;if(e.stopList.sort((function(e,t){return e.pos-t.pos})),!e.stopList.find((function(e){return 0===e.pos}))){var o=e.stopList[0];e.stopList.unshift({pos:0,color:o.color})}if(!e.stopList.find((function(e){return 1===e.pos}))){var s=e.stopList[e.stopList.length-1];e.stopList.push({pos:1,color:s.color})}var u=function(e){for(var t=[],n=0,r=e.length;n0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(h.filters=jm(u,this.ctx.featureList)),this.config.fillFloat){var d=this.config.fillFloat.fillRect,f=d.l,p=d.t,v=d.r,m=d.b,g=this.width*(1-f-v),y=this.height*(1-p-m),b=null!==(e=this.config.shapeRotation)&&void 0!==e?e:0,x=new Dd;x.drawRect(0,0,g,y),x.pivot.x=g/2,x.pivot.y=y/2,x.rotation=b;var _=x.getBounds(),w=_.width,T=_.height;h.width=w,h.height=T,h.anchor.x=.5,h.anchor.y=.5,h.rotation=-1*b,h.name="math-texture",0===b?(h.position.x=w/2+f*this.width,h.position.y=T/2+p*this.height):(h.position.x=this.width/2,h.position.y=this.height/2)}else h.width=this.width,h.height=this.height,c.rotate&&(h.position.x=this.width/2,h.position.y=this.height/2,h.anchor.x=.5,h.anchor.y=.5,h.rotation=c.rotate/180*Math.PI);return h}}else if("gifFill"===this.fillStyle.fillType){var M=this.fillStyle,S=M.src,E=M.delays,A=M.filters,I=this.ctx.spriteTexture.getGifFrames(S).map((function(e,t){return{texture:e,time:E[t]||20}})),C=new jp(I,!0);C.name=uv(),C.width=this.width,C.height=this.height,A.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(C.filters=jm(A,this.ctx.featureList));var N=this.fillStyle.loop,k=1;return C.onLoop=function(){k+=1,N>0&&k>N&&C.gotoAndStop(C.totalFrames)},C}return null}},{key:"isSolidFill",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)}},{key:"getSolidFillColor",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)?this.fillStyle.color:"#000000"}},{key:"getClonedDisplayObject",value:function(){var e=this.createDisplayObject();return this.clonedObjects.push(e),e}},{key:"destroy",value:function(){var e;null===(e=this._displayObject)||void 0===e||e.destroy(),this._displayObject=null,this.clonedObjects.forEach((function(e){null==e||e.destroy()})),this.clonedObjects=[]}},{key:"displayObject",get:function(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject},set:function(e){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=e}},{key:"hasFill",get:function(){return!!this.fillStyle&&"noFill"!==this.fillStyle.fillType}}]),e}(),Um=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(Xl.k),Fm=n(113),zm=n.n(Fm),Gm=n(114),Hm=n.n(Gm),Vm=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,zm.a,Hm.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:Xv(e.color),uSdfSampler:Xl.t.WHITE,uSdfReady:0,uSdfMaxDis:0,uRad:e.rad/2,uSdfPosition:new Float32Array([0,0])})).priority=3,r.json=e,r}return T(n,[{key:"filterAreaJustify",value:function(e){var t=Math.ceil(this.json.rad),n=Math.ceil(e.width+2*t),r=Math.ceil(e.height+2*t);return new jl.j(e.x-t,e.y-t,n,r)}},{key:"sdfBox",value:function(e,t){var n=Math.ceil(this.json.rad),r=Math.ceil(e+2*n),i=Math.ceil(t+2*n);return new jl.j(n,n,r,i)}}]),n}(Um),Wm=n(19),Ym=n.n(Wm),Xm=n(115),Qm=n.n(Xm),Zm=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Ym.a,Qm.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:e.rad,uSdfSampler:Xl.t.WHITE,uSdfReady:0,uSdfMaxDis:1})).priority=2,r.json=e,r}return T(n,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(e,t){return new jl.j(0,0,e,t)}}]),n}(Um),qm=function e(){_(this,e)},Jm=n(116),Km=n.n(Jm),$m=function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,Ym.a,Km.a,{uColor:Xv(e)})}return n}(Xl.k),eg=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this)).order=1,o.outputTexture=Xl.t.WHITE,o.frameTextures=[],o.json=e,o.effectContainer=r,o.outputSprite=new Ld,o.targetScale=i,o.outputSprite.scale.x=o.json.sx,o.outputSprite.scale.y=o.json.sy,o.outputSprite.skew.x=(o.targetScale.x>0?1:-1)*o.json.kx,o.outputSprite.skew.y=(o.targetScale.y>0?1:-1)*o.json.ky,o.outputSprite.filters=[new Up.BlurFilter(o.json.blurRad/2,4),new $m(o.json.color)],o}return T(n,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];if(t){var n=this.effectContainer.getBounds(),r=(this.effectContainer.width-t.width)/2,i=(this.effectContainer.height-t.height)/2,o=new jl.g(n.x,n.y),a=new jl.g(n.x,n.y);switch(this.json.align){case"tl":a.x=n.x,a.y=n.y;break;case"t":a.x=n.x+n.width/2,a.y=n.y,o.x+=n.width/2;break;case"tr":a.x=n.x+n.width,a.y=n.y,o.x+=n.width;break;case"l":a.x=n.x,a.y=n.y+n.height/2,o.y+=n.height/2;break;case"ctr":a.x=n.x+n.width/2,a.y=n.y+n.height/2,o.x+=n.width/2,o.y+=n.height/2;break;case"r":a.x=n.x+n.width,a.y=n.y+n.height/2,o.x+=n.width,o.y+=n.height/2;break;case"bl":a.x=n.x,a.y=n.y+n.height,o.y+=n.height;break;case"b":a.x=n.x+n.width/2,a.y=n.y+n.height,o.x+=n.width/2,o.y+=n.height;break;case"br":a.x=n.x+n.width,a.y=n.y+n.height,o.x+=n.width,o.y+=n.height}var s=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=s.x,this.outputSprite.pivot.y=s.y;var u=new jl.g(this.json.dist,0),l=new jl.d;l.rotate(this.json.dir),l.translate(o.x+r,o.y+i),l.apply({x:u.x,y:u.y},u);var c=this.effectContainer.toLocal(u);this.outputSprite.position.x=c.x,this.outputSprite.position.y=c.y,this.outputSprite.texture=t}}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){}}]),n}(qm),tg=n(117),ng=n.n(tg),rg=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),i=t.call(this,Ym.a,ng.a,{uStartAlpha:e.startAlpha,uEndAlpha:e.endAlpha,uStartPos:e.startPos,uEndPos:e.endPos,uHeight:r}),console.log(y(i)),i}return n}(Xl.k),ig=function(e){p(n,e);var t=m(n);function n(e,r,i,o,a){var s;_(this,n),(s=t.call(this)).order=2,s.outputSprite=new Ld,s.outputTexture=Xl.t.WHITE,s.frameTextures=[],s.json=e,s.shapeScaleX=o,s.effectContainer=r,s.rotation=i,s.ctx=a,s.outputSprite.anchor.x=.5,s.outputSprite.anchor.y=.5;var u=s.effectContainer.getBounds();return s.outputSprite.filters=[new Up.BlurFilter(s.json.blurRad/2,4),new rg(s.json,u.height)],s.outputSprite.alpha=.5,s.outputSprite.rotation=-1===s.shapeScaleX?Math.PI+2*s.rotation:Math.PI-2*s.rotation,s.outputSprite.scale.x=-1,s}return T(n,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];t&&(this.outputSprite.texture=t)}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){var n=this.effectContainer.getBounds(),r=new jl.g(n.x+n.width/2,n.y+n.height/2),i=new jl.g(r.x,r.y+n.height+this.json.dist),o=this.effectContainer.toLocal(i);this.outputSprite.position.x=o.x+e,this.outputSprite.position.y=o.y+t}}]),n}(qm),og=n(118),ag=n.n(og),sg=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Ym.a,ag.a,{})).priority=1,r.json=e,r}return T(n,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(){return null}}]),n}(Um),ug=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},lg=function(e){p(n,e);var t=m(n);function n(e,r,i,o,s,u){var l;_(this,n),(l=t.call(this)).effects=[],l.attachs=[],l.frames=new Map,l._targetContainer=new Rl.b,l.frameCount=1,l.ctx=o,l.originWidth=e.width,l.originHeight=e.height,l.cacheKey=i,l.sourceSprite=new Ld;var c,h=S(r);try{for(h.s();!(c=h.n()).done;){var d=c.value;switch(d.type){case"innerShadow":l.effects.push(new sg(d));break;case"softEdge":l.effects.push(new Zm(d));break;case"glow":l.effects.push(new Vm(d));break;case"reflection":l.attachs.push(new ig(d,e,s,u.x,l.ctx));break;case"outerShadow":l.attachs.push(new eg(d,e,u))}}}catch(e){h.e(e)}finally{h.f()}l.effects=l.effects.sort((function(e,t){return e.priority-t.priority})),l.attachs=l.attachs.sort((function(e,t){return e.order-t.order}));var f,p=S(l.attachs);try{for(p.s();!(f=p.n()).done;){var v=f.value;l._targetContainer.addChild(v.outputSprite)}}catch(e){p.e(e)}finally{p.f()}l.sourceSprite.name="effect-sprite";var m=new jl.j(0,0,l.originWidth,l.originHeight),g=l.effects.map((function(e){return e.filterAreaJustify(m)})),y=g.map((function(e){return e.x})),b=g.map((function(e){return e.y})),x=g.map((function(e){return e.width})),w=g.map((function(e){return e.height}));return l.filterArea=new jl.j(Math.min.apply(Math,a(y).concat([0])),Math.min.apply(Math,a(b).concat([0])),Math.max.apply(Math,a(x).concat([l.originWidth])),Math.max.apply(Math,a(w).concat([l.originHeight]))),l.sourceSprite.filters=l.effects,l.sourceSprite.filterArea=new jl.j(0,0,l.filterArea.width,l.filterArea.height),l._targetSprite=new Ld,l._targetSprite.name="effect-sprite",l._targetContainer.sortableChildren=!0,l._targetSprite.zIndex=999,l._targetContainer.addChild(l._targetSprite),l}return T(n,[{key:"getSdfTexture",value:function(e,t){return ug(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r="".concat(this.cacheKey,"_").concat(e),i=this.effects.map((function(e){return{sdfRect:e.sdfBox(t.width,t.height)}})).reduce((function(e,t){return t.sdfRect?(e.width5&&(t.dist=5),x[e]})),o.ctx.slideScopeEventHub.once("slide-render",(function(e){if(o.ctx.slideIndex===e&&o.effectObject){var t=o.getEffectTexture();if(t){var n=t.texture,r=t.offsetX,i=t.offsetY;o.effectObject.setFrameOffset(r,i),o.effectObject.createFrame(1,n)}}}))}return o}return T(n,[{key:"getEffectTexture",value:function(){var e,t=this.json,n=t.lineHeight,r=t.fillLineHeight,i=t.isHorz,o=t.lineWidth,a=this.effectContainer.getLocalBounds(),s=0,u=0,l=S(this.effectContainer.children);try{for(l.s();!(e=l.n()).done;){var c=e.value;c.pivot.x>s&&(s=c.pivot.x),c.pivot.y>u&&(u=c.pivot.y)}}catch(e){l.e(e)}finally{l.f()}var h=new jl.d;h.translate(s,u);var d=Xl.p.create({width:i?a.width:o,height:i?Math.max(r,n):a.height,resolution:2});return this.ctx.renderer.render(this.effectContainer,{renderTexture:d,transform:h}),{texture:d,offsetX:s,offsetY:u}}},{key:"createStrokeFill",value:function(){var e=this.json,t=e.stroke,n=e.lineWidth,r=e.lineHeight;return new Bm(this.ctx,null==t?void 0:t.fill,n,r,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createStrokeGraphics",value:function(){var e=this.json.stroke,t=(null==e?void 0:e.key)?{fillType:"blipFill",src:e.key,filters:[]}:void 0;return new Bm(this.ctx,t,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createTextFill",value:function(){var e=this.json,t=e.isHorz,n=e.fill,r=e.lineWidth,i=e.lineHeight,o=e.fillLineHeight;return t?new Bm(this.ctx,null==n?void 0:n.fill,r,Math.max(o,i),{useFilter:!1,useSlideBackgroundFill:!1}):new Bm(this.ctx,null==n?void 0:n.fill,o,i,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createTextGraphics",value:function(){var e,t=this.json,n=t.fill,r=t.content,i="#000000";"solidFill"===(null===(e=null==n?void 0:n.fill)||void 0===e?void 0:e.fillType)&&(i=n.fill.color);var o=(null==n?void 0:n.key)?{fillType:"blipFill",src:n.key,filters:[{type:"changeBulletColor",args:["#000000",i]}]}:void 0;return new Bm(this.ctx,o,(null==n?void 0:n.width)||0,(null==n?void 0:n.height)||0,{useFilter:"◾"===r,useSlideBackgroundFill:!1})}},{key:"getIterateEntry",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"updateTransform",value:function(e){var t,r,i,o,a=this.json.isHorz;e.position={x:a&&null!==(r=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==r?r:0,y:a?0:null!==(o=null===(i=e.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},e.width=a?this.json.width:this.json.lineWidth,e.height=a?this.json.lineHeight:this.json.height,f(x(n.prototype),"updateTransform",this).call(this,e)}},{key:"preRender",value:function(){var e;null===(e=this.underline)||void 0===e||e.preRender()}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return cg(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.doRender();case 1:case"end":return e.stop()}}),e,this)})))}),"@TextUnitImpl[doRender]"),e.addSubMTask((function(){return cg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.effectList&&this.effectList.length>0&&(n="".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(null===(t=this.json.fill)||void 0===t?void 0:t.key,"_").concat(this.json.effectIndexList),this.effectObject=new lg(this.effectContainer,this.effectList,n,this.ctx,0,new jl.g(1,1)),this.effectObject.on("ready",(function(){var e;r.effectContainer.visible=!1,r.effectObject.container.zIndex=10,r.container.addChild(r.effectObject.container),null===(e=r.effectObject)||void 0===e||e.updateFrame(1)})));case 1:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"doRender",value:function(){var e=!1,t=this.json,n=t.lineWidth,r=t.lineHeight,i=t.baseLine,o=t.isHorz,a=t.underline,s=t.height,u=t.width,l=t.highlightColor,h=t.x,d=t.y,f=t.content,p=t.fillLineHeight,v=t.fill,m=!1!==this.json.needFill;if(v&&v.fill&&"solidFill"!==v.fill.fillType&&(m=!0),l){var g=new Dd,y=c(Yv(l),2),b=y[0],x=y[1];g.beginFill(b,x),g.drawRect(0,0,o?u:n,o?r:s),g.endFill(),this.textureContainer.addChild(g)}if(this.textGraphics.displayObject){var _=this.textGraphics.displayObject;if(o&&(_.position.y=d>0?d:0),m){var w=this.textFill.displayObject;if(w)w.mask=_,w.addChild(_),w.position.x=-h,_.position.x+=h,e=!0,this.textureContainer.addChild(w);else if(this.textFill.isSolidFill()){var T=new qv;T.color=this.textFill.getSolidFillColor(),_.filters=[T],e=!0,this.textureContainer.addChild(_)}}else this.textureContainer.addChild(_)}if(this.strokeGraphics.displayObject){var M=this.strokeGraphics.displayObject;if(m){var S=this.strokeFill.displayObject;if(S)S.mask=M,S.addChild(M),o?S.position.y=d>0?d:0:S.position.x=h,this.textureContainer.addChild(S);else if(this.strokeFill.isSolidFill()){o?M.position.y=d>0?d:0:M.position.x=h;var E=new qv;E.color=this.strokeFill.getSolidFillColor(),M.filters=[E],e=!0,this.textureContainer.addChild(M)}}else o?M.position.y=d>0?d:0:M.position.x=h,this.textureContainer.addChild(M)}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=a?a-r/16:i,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);var A=this.textFill.getClonedDisplayObject();A?(A.mask=this.underline.sprite,A.addChild(this.underline.sprite),this.textureContainer.addChild(A)):this.textureContainer.addChild(this.underline.sprite)}if(e){var I=Xl.p.create({width:o?u:n,height:o?Math.max(p,r):s,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:I}),this.cacheSprite.texture=I,o&&d<0&&(this.cacheSprite.position.y=d),this.effectContainer.addChild(this.cacheSprite)}else this.effectContainer.addChild(this.textureContainer);this.container.name=f}},{key:"destroy",value:function(){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()}}]),n}(nm),dg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},fg=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,e,r,i)).units=[],o.isHorz=!0,o.hyperLinkMap=new Map,o.hyperLinkContainerMap=new Map,o.effectList=[],i.effectList&&(o.effectList=i.effectList),o}return T(n,[{key:"getIterateElements",value:function(){return this.units}},{key:"getIterateEntry",value:function(e,t,n){return this.units[t]?this.units[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}},{key:"preRender",value:function(){}},{key:"createUnits",value:function(e,t,n,r){for(var i=this,o=function(o,a){r.addSubMTask((function(){return dg(i,void 0,void 0,regeneratorRuntime.mark((function r(){var i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=this.json.textUnits[o],a=this.json,s=a.height,u=a.width,l=a.fillHeight,c=a.baseline,h=a.y,d=a.underline,(f=new hg(Object.assign(Object.assign({},i),{lineHeight:s,lineWidth:u,baseLine:c-h,underline:d,fillLineHeight:l||s,isHorz:this.isHorz,shapeId:e,paragraphIndex:t,lineIndex:n,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).preRender(),this.units.push(f),(i.hyperlink||i.hlinkHover)&&(p=new jv(f.container,this.ctx),i.hyperlink&&p.addAction(i.hyperlink,"click"),i.hlinkHover&&p.addAction(i.hlinkHover,"hover"),this.container.sortableChildren=!0);case 2:case"end":return r.stop()}}),r,this)})))}),"@TextLineImpl[createUnits]")},a=0,s=this.json.textUnits.length;a0)return this.iterateElements;var e=this.lines.reduce((function(e,t){return e.concat(t.getIterateElements())}),[]);return this.iterateElements=e,e}},{key:"getIterateEntry",value:function(e,t,n){var r=this.getIterateElements();return r[t]?r[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}},{key:"preRender",value:function(){}},{key:"createLines",value:function(e,t,n){for(var r=this,i=function(i,o){n.addSubMTask((function(){return pg(r,void 0,void 0,regeneratorRuntime.mark((function r(){var o,a;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=this.json.lines[i],(a=new fg(o,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).isHorz=this.isHorz,a.container.name="line-"+i,a.createUnits(e,t,i,n),this.lines.push(a);case 2:case"end":return r.stop()}}),r,this)})))}),"@TextParagraphImpl[createLines]")},o=0,a=this.json.lines.length;o90&&o<270||o<-90&&o>-270)&&(r=-r),i=-a*r}return{x:r,y:i}}((i=-i)/Math.PI*180,n,r),s=e.x-a.x,u=e.y-a.y;return{centerX:s/9525*t.x,centerY:u/9525*t.y,rx:n/9525*t.x,ry:r/9525*t.y,st:-i,end:-i+o,aClockWise:o<0}}function gg(e){for(var t=new os,n=e.scale,r={x:0,y:0},i=e.path.trim().split(" "),o=0;o=0&&(d=xg(s.paths[0].path,this.json.width,this.json.height,i,o),s.paths.unshift(Object.assign(Object.assign({},s.paths[0]),{path:d}))),f=function(e,t,n,r){if(!bg[n])return null;var i=bg[n].top(gg(t)),o=bg[n].bottom(gg(e));if(i.length!==o.length)return null;for(var a=Math.min(i.length,o.length),s=1/(a-1),u=[],l=[],c=new Array(2*a).fill("").map((function(e,t){return t})),h=0;h0&&(this.textColorFilter.color=e)},get:function(){return this.textColorFilter.color}},{key:"on",get:function(){var e;return(null!==(e=this.container.filters)&&void 0!==e?e:[]).length>0?"true":"false"},set:function(e){var t;"true"===e?(null!==(t=this.container.filters)&&void 0!==t?t:[]).indexOf(this.textColorFilter)<0&&(this.container.filters=[this.textColorFilter]):this.container.filters=[]}}]),e}(),Tg=function(){function e(t){_(this,e),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()}return T(e,[{key:"setPivot",value:function(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;default:this.pivot={x:this.width,y:this.height/2}}}},{key:"generatePaths",value:function(){this.hash="arrow-"+_v()(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}}]}},{key:"getUnitPath",value:function(){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""}}},{key:"setScaleFromLineWidth",value:function(){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!")}}},{key:"setScaleFromSize",value:function(){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}}]),e}(),Mg=function(){function e(t,n,r,i,o,a,s,u,l,c,h){_(this,e),this.id=t,this.ctx=n,this.paths=r,this.hash=i,this.nept=o,this.width=a,this.height=s,this.lineStyle=u,this.shouldFill=l,this.bgColor=c,this.lnColor=h,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(r),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)}return T(e,[{key:"pointDis",value:function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}},{key:"isPoint",value:function(e){return Number.isNaN(Number(e.x))||Number.isNaN(Number(e.y))}},{key:"isSquare",value:function(e,t){var n=this;if("MLLLC"!==e.join("")&&"MLLLCC"!==e.join(""))return!1;var r=t.filter((function(e){return!n.isPoint(e)}));if(4!==r.length)return!1;var i,o=Math.min.apply(Math,a(r.map((function(e){return e.x})))),s=Math.min.apply(Math,a(r.map((function(e){return e.y})))),u=Math.max.apply(Math,a(r.map((function(e){return e.x})))),l=Math.max.apply(Math,a(r.map((function(e){return e.y})))),c=S(r);try{for(c.s();!(i=c.n()).done;){var h=i.value;if(h.x!==o&&h.x!==u||h.y!==s&&h.y!==l)return!1}}catch(e){c.e(e)}finally{c.f()}return!0}},{key:"rectangleDetect",value:function(e){if(1!==e.length)return!1;var t=e[0].path.trim().split(" ");if(10!==t.length)return!1;for(var n=[],r=[],i=0;in&&(n=o.pivot.x),o.pivot.y>r&&(r=o.pivot.y)}}catch(e){i.e(e)}finally{i.f()}var a=new jl.d;if(a.translate(n,r),0===this.effectContainer.children.length)return null;var s=Xl.p.create({width:t.width,height:t.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(this.effectContainer,{renderTexture:s,transform:a}),{texture:s,offsetX:n,offsetY:r}}},{key:"createStrokeGraphics",value:function(){var e,t,n,r,i=this.json,o=i.id,a=i.geometry,s=i.lineStyle,u=(null==a?void 0:a.lineTransform)||Eg,l=u.width,c=u.height,h=u.pivot,d=l||this.json.width,f=c||this.json.height,p="solidFill"===(null===(e=null==s?void 0:s.fill)||void 0===e?void 0:e.fillType)?s.fill.color:null;return s&&"noFill"!==(null===(t=s.fill)||void 0===t?void 0:t.fillType)?new Mg(o+"-path-graphics",this.ctx,null!==(n=null==a?void 0:a.paths)&&void 0!==n?n:[],null!==(r=null==a?void 0:a.hash)&&void 0!==r?r:"",h||{x:0,y:0},d,f,s,!1,null,p):null}},{key:"createStrokeFill",value:function(){var e=c(this.calculateFillObjectOffset(),2),t=e[0],n=e[1],r=this.json,i=r.geometry,o=r.lineStyle,a=r.width,s=r.height,u=(null==i?void 0:i.lineTransform)||Eg,l=Tv()(null==o?void 0:o.width)?o.width:1;return new Bm(this.ctx,null==o?void 0:o.fill,(u.width||a)+l+t,Math.max((u.height||s)+l,n),{useFilter:!0,useSlideBackgroundFill:!1})}},{key:"createBackgroundGraphics",value:function(){var e,t=this.json,n=t.geometry,r=t.lineStyle,i=t.fillStyle,o=t.id,a=(null==n?void 0:n.lineTransform)||Eg,s=a.width,u=a.height,l=a.pivot,c=s||this.json.width,h=u||this.json.height,d="solidFill"===(null==i?void 0:i.fillType)?i.color:null;return i&&"noFill"!==i.fillType||this.json.isPicture?new Mg(o+"-bg-graphics",this.ctx,null!==(e=null==n?void 0:n.paths)&&void 0!==e?e:[],(null==n?void 0:n.hash)||"",l||{x:0,y:0},c,h,r,!0,d,null):null}},{key:"createBackgroundFill",value:function(){var e,t,n,r,i=this.json,o=i.fillStyle,a=i.width,s=i.height,u=i.lineStyle,l=i.geometry,c=(null==l?void 0:l.fillTransform)||Eg,h={useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation},d=this.useGroupFill&&(null===(e=this.option.groupSize)||void 0===e?void 0:e.w)?this.option.groupSize.w:c.width||a,f=this.useGroupFill&&(null===(t=this.option.groupSize)||void 0===t?void 0:t.h)?this.option.groupSize.h:c.height||s;return new Bm(this.ctx,o,d+(null!==(n=null==u?void 0:u.width)&&void 0!==n?n:0),f+(null!==(r=null==u?void 0:u.width)&&void 0!==r?r:0),h)}},{key:"createBackground",value:function(){var e,t,n,r,i,o,a,s,u,l,c,h,d=(null===(e=this.json.geometry)||void 0===e?void 0:e.fillTransform)||Eg,f=d.pivot,p=d.width,v=d.height,m=this.backgroundFill.displayObject;m?(this.json.useBgFill&&(null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)?(this.needCacheAsBitMap=!0,m.mask=this.backgroundGraphics.displayObject,m.pivot.x=(null===(r=this.json.position)||void 0===r?void 0:r.x)||0,m.pivot.y=(null===(i=this.json.position)||void 0===i?void 0:i.y)||0,this.effectContainer.addChild(this.backgroundGraphics.displayObject)):"gifFill"===(null===(o=this.json.fillStyle)||void 0===o?void 0:o.fillType)?(m.height=v||this.designHeight,m.width=p||this.designWidth,m instanceof jp&&m.play(),(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.isNeedMask(m.width,m.height))&&(m.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.isNeedMask(m.width,m.height))&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,m.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(m.x=f.x,m.y=f.y),this.useGroupFill&&(m.x-=null!==(l=null===(u=this.json.position)||void 0===u?void 0:u.x)&&void 0!==l?l:0,m.y-=null!==(h=null===(c=this.json.position)||void 0===c?void 0:c.y)&&void 0!==h?h:0),this.effectContainer.addChild(m)):this.backgroundFill.hasFill&&(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.displayObject)&&this.effectContainer.addChild(this.backgroundGraphics.displayObject)}},{key:"createPathFill",value:function(){var e,t,n,r=this.strokeFill.displayObject,i=null===(e=this.strokeGraphics)||void 0===e?void 0:e.displayObject,o=c(this.calculateFillObjectOffset(),2),a=o[0],s=o[1];r?((null===(t=this.strokeGraphics)||void 0===t?void 0:t.isNeedMask(r.width,r.height))&&i&&(this.needCacheAsBitMap=!0,r.pivot.x=i.pivot.x,r.pivot.y=i.pivot.y,i.pivot.x=0,i.pivot.y=0,r.mask=i,r.addChild(i),r.position.x=-a/2,r.position.y=-s/2,i.position.x=a/2,i.position.y=s/2),this.effectContainer.addChild(r)):this.strokeFill.hasFill&&(null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)&&this.effectContainer.addChild(this.strokeGraphics.displayObject)}},{key:"createFilledPathMask",value:function(){var e,t,n,r,i=(null===(t=null===(e=this.json.geometry)||void 0===e?void 0:e.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],o=S(i);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=this.ctx.graphicsTexture.getGraphicsData(a.id);if(s){var u=new Ld(s.texture);u.pivot.x=s.pivot.x,u.pivot.y=s.pivot.y,u.scale.x=s.scale,u.scale.y=s.scale;var l=this.backgroundFill.getClonedDisplayObject(),c=null===(n=this.backgroundGraphics)||void 0===n?void 0:n.getClonedDisplayObject(),h=l||c;h&&(this.backgroundFill.displayObject&&(h.pivot.x=this.backgroundFill.displayObject.pivot.x,h.pivot.y=this.backgroundFill.displayObject.pivot.y),h.mask=u,h.filters=[tm[a.fill]],this.needCacheAsBitMap=!0,this.effectContainer.addChild(h),this.effectContainer.addChild(u))}}}catch(e){o.e(e)}finally{o.f()}}},{key:"createArrow",value:function(){var e=this;this.arrowList.length&&this.arrowList.forEach((function(t){var n,r=e.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(r){var i=r.texture,o=new Ld(i);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,o.scale.x=r.scale,o.scale.y=r.scale,null===(n=e.backgroundGraphics)||void 0===n||n.addArrows(o)}}))}},{key:"generateArrowList",value:function(){var e,t,n=this,r=this.json,i=r.lineArrowList,o=r.lineStyle,a=r.id,s="solidFill"===(null===(e=null==o?void 0:o.fill)||void 0===e?void 0:e.fillType)?o.fill.color:null;null===(t=i||[])||void 0===t||t.forEach((function(e,t){var r,i,u=new Tg(Object.assign(Object.assign({},e),{fillStyle:null==o?void 0:o.fill,lineWidth:null!==(r=null==o?void 0:o.width)&&void 0!==r?r:0}));u.graphicsId="".concat(a,"-arrow-").concat(t,"-graphics"),u.textureId="".concat(a,"-arrow-").concat(t,"-fill"),n.ctx.graphicsTexture.addGraphics(u.graphicsId,null!==(i=u.paths)&&void 0!==i?i:[],u.hash,{x:0,y:0},u.width,u.height,void 0,n.ctx.objectPoolGroup,!0,s,null),n.arrowList.push(u)}))}},{key:"calculateFillObjectOffset",value:function(){var e=0,t=0;return this.arrowList.length&&(e=this.arrowList.reduce((function(e,t){return Math.max(e,t.width)}),0),t=this.arrowList.reduce((function(e,t){return Math.max(e,t.height)}),0)),[e,t]}},{key:"preRender",value:function(e){var t,n,r,i=this,o=this.json,a=o.lineStyle,s=o.geometry,u=(null==s?void 0:s.lineTransform)||Eg,l=u.width,c=u.height,h=l||this.json.width,d=c||this.json.height,f=(null===(t=null==s?void 0:s.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],p="solidFill"===(null===(n=null==a?void 0:a.fill)||void 0===n?void 0:n.fillType)?a.fill.color:null;e.addSubMTask((function(){return Sg(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=S(f);try{for(t.s();!(n=t.n()).done;)r=n.value,this.ctx.graphicsTexture.addGraphics(r.id,[r],r.hash,((null==s?void 0:s.lineTransform)||Eg).pivot,h,d,a,this.ctx.objectPoolGroup,!0,null,p)}catch(e){t.e(e)}finally{t.f()}case 2:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[addGraphics]"),null===(r=this.text)||void 0===r||r.createParagraphs(this.json.id,e)}},{key:"subClassRender",value:function(){return Sg(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return Sg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null===(t=this.strokeGraphics)||void 0===t||t.render(),null===(n=this.backgroundGraphics)||void 0===n||n.render(),this.createBackground(),e.next=5,this.subClassRender();case 5:this.createFilledPathMask(),this.createPathFill(),this.createArrow();case 8:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[render]"),this.text&&this.text.render(e),e.addSubMTask((function(){return Sg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,S,E,A,I,C=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(n=this.json.textBody)||void 0===n?void 0:n.iterateType)?(this.renderContainer.addChild(this.container),this.text&&(p=null!==(r=this.json.scale)&&void 0!==r?r:{x:1,y:1},v=p.x,m=p.y,this.text.container.scale.x=m<0?-Math.abs(v):Math.abs(v),this.text.container.scale.y=m,this.text.container.position.x=(null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0)+this.text.x,this.text.container.position.y=(null!==(s=null===(a=this.json.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)+this.text.y,this.text.container.scale.y<0&&(this.text.container.position.y+=this.text.height),this.text.container.scale.x<0&&(this.text.container.position.x+=this.json.width),this.json.textRotation&&(this.text.container.rotation=this.json.textRotation),this.renderContainer.addChild(this.text.container))):(this.text&&(this.json.textRotation&&(this.text.container.rotation=this.json.textRotation,g=this.text,y=g.width,b=g.height,x=this.text.container.position,_=x.x,w=x.y,this.text.container.pivot.x=y/2,this.text.container.pivot.y=b/2,this.text.container.x=_+y/2,this.text.container.y=w+b/2),Hv()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape&&(T=this.json.rotation||0,this.text.container.rotation=-T,M=this.text.width,this.text.container.position.x=M),this.text.container.zIndex=100,S=null===(u=this.json.effectList)||void 0===u?void 0:u.find((function(e){return"outerShadow"===e.type})),E=null===(l=this.json.effectList)||void 0===l?void 0:l.find((function(e){return"softEdge"===e.type})),A=null===(c=this.json.effectList)||void 0===c?void 0:c.find((function(e){return"glow"===e.type})),S&&1!==S.sx||E||A?this.container.addChild(this.text.container):this.effectContainer.addChild(this.text.container)),this.renderContainer.addChild(this.container)),this.needCacheAsBitMap,"background"===this.json.id&&this.ctx.hasBackgroundFillShape&&(I=Xl.p.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)}),this.ctx.renderer.render(this.renderContainer,{renderTexture:I}),this.ctx.bgTexture=I),this.json.effectList&&this.json.effectList.length>0&&(null===(h=this.ctx.featureList)||void 0===h?void 0:h.effect)&&!this.ctx.forceCanvas&&!this.json.media&&(this.effectObject=new lg(this.effectContainer,this.json.effectList,"".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(this.json.id),this.ctx,this.json.rotation||0,new jl.g((null===(d=this.json.scale)||void 0===d?void 0:d.x)||1,(null===(f=this.json.scale)||void 0===f?void 0:f.y)||1)),function(e){var t,n,r;return"gifFill"===(null===(t=e.fillStyle)||void 0===t?void 0:t.fillType)||"gifFill"===(null===(r=null===(n=e.lineStyle)||void 0===n?void 0:n.fill)||void 0===r?void 0:r.fillType)||!!e.picFill&&"gifFill"===e.picFill.fillType}(this.json)&&this.effectObject.setFrameCount(-1),this.effectObject.on("ready",(function(){var e;C.effectContainer.visible=!1,C.effectObject.container.zIndex=10,C.container.addChild(C.effectObject.container),null===(e=C.effectObject)||void 0===e||e.updateFrame(1)})));case 3:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"destroy",value:function(){var e,t,n,r;null===(e=this.text)||void 0===e||e.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),null===(t=this.backgroundGraphics)||void 0===t||t.destroy(),this.strokeFill.destroy(),null===(n=this.strokeGraphics)||void 0===n||n.destroy(),this.renderContainer.destroy(),null===(r=this.arrowRenderTexture)||void 0===r||r.destroy(!0),this.arrowList=[],this.effectDisposer()}},{key:"interactiveContainer",get:function(){return this.renderContainer}},{key:"strokeActive",get:function(){var e,t,n,r,i,o,a;return this.strokeFill.displayObject?(null!==(n=null===(t=null===(e=this.strokeFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==n?n:-1)>0:(null!==(a=null===(o=null===(i=null===(r=this.strokeGraphics)||void 0===r?void 0:r.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,n,r,i,o,a,s=this.strokeFill.displayObject;e?s&&(null!==(n=null===(t=s.filters)||void 0===t?void 0:t.indexOf(this.strokeColorFilter))&&void 0!==n?n:-1)<0?s.filters=[this.strokeColorFilter]:(null===(r=this.strokeGraphics)||void 0===r?void 0:r.displayObject)&&(null!==(o=null===(i=this.strokeGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.strokeColorFilter))&&void 0!==o?o:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):s?s.filters=[]:(null===(a=this.strokeGraphics)||void 0===a?void 0:a.displayObject)&&(this.strokeGraphics.displayObject.filters=[])}},{key:"pptColorActive",get:function(){var e,t;return(null!==(t=null===(e=this.renderContainer.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){this.renderContainer.filters=e?[this.pptColorFilter]:[]}},{key:"fillActive",get:function(){var e,t,n,r,i,o,a;return this.backgroundFill.displayObject?(null!==(n=null===(t=null===(e=this.backgroundFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==n?n:-1)>0:(null!==(a=null===(o=null===(i=null===(r=this.backgroundGraphics)||void 0===r?void 0:r.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,n,r,i,o,a;e?this.backgroundFill.displayObject&&(null!==(n=null===(t=this.backgroundFill.displayObject.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:(null===(r=this.backgroundGraphics)||void 0===r?void 0:r.displayObject)&&(null!==(o=null===(i=this.backgroundGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.fillColorFilter))&&void 0!==o?o:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.displayObject)&&(this.backgroundGraphics.displayObject.filters=[])}}]),n}(zv),Ig=n(119),Cg=new(n.n(Ig).a),Ng=Cg.getDevice(),kg=Cg.getBrowser(),Dg=Cg.getOS(),Pg={isDesktop:function(){var e=!0;return"mobile"===Ng.type&&(e=!1),/Samsung/.test(kg.name||"")&&(e=!1),window.__nativeTags&&window.__nativeTags.platform&&(e=!1),e},isIOS:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(e=!0),Dg.name&&/iOS/.test(Dg.name)&&(e=!0),e},isAndroid:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(e=!0),Dg.name&&/android/i.test(Dg.name)&&(e=!0),e},isLowGpuMemory:function(){var e,t,n=null!==(t=null===(e=window.__nativeTags)||void 0===e?void 0:e.platform)&&void 0!==t?t:"";if(n){var r=n.split(" ");if(r[1]){if(/^iPad/.test(r[1])){var i=r[1].match(/^iPad(\d+)/);return!(i&&i[1]&&parseInt(i[1],10)>=6)}if(/^iPhone/.test(r[1])){var o=r[1].match(/^iPhone(\d+)/);return!(o&&o[1]&&parseInt(o[1],10)>=9)}return!1}return!1}return!0}},Og=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Rg(e,t){for(var n in t)e.style[n]=t[n]}var Lg="median-container",jg=1500,Bg=300,Ug=50,Fg="0",zg="1",Gg=.4,Hg=function(){function e(t){var n,r,i=this;_(this,e),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.fullScreenButton=document.createElement("div"),this.exitFullScreenButton=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.isVideo=!1,this.start=0,this.end=0,this.fullscreenStatus=!1,this.fadeState={in:!1,out:!1},this.changeMediaProgress=function(e){if(i.ctx.isPlayerPaused())i.ctx.logger.info("Media controller prevent seek event with paused state",i.ctx.taskId);else{e.stopPropagation();var t=e.offsetX/i.progress.clientWidth*i.duration;i.medianIsEnd=!1,"interactive"!==i.ctx.mode&&i.jumpToTime(t),"local"!==i.ctx.mode&&i.ctx.eventHub.emit(bb.mediaSeek,{id:i.targetId,time:t,isPlaying:i.media.isPlaying}),i.delayHide()}},this.jumpToTime=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Og(i,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,dv((function(){return!!r.duration}),3e3);case 2:n=Math.floor(e)+this.start,this.media.currentTime!==n&&(this.media.currentTime=n,this.changeBookmarkIndex(n,n>this.media.currentTime));case 4:case"end":return t.stop()}}),t,this)})))},this.showController=function(e){e.stopPropagation(),i.show()},this.getMediaDuration=function(){i.duration&&!Number.isNaN(i.duration)||(i.duration=i.media.duration,i.start&&(i.duration-=i.start,i.jumpToTime()),i.end&&(i.duration-=i.end)),i.totalTime.innerText=e.formatTime(i.duration)},this.playMedia=function(){return Og(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="none",this.pauseButton.style.display="block",e.next=4,this.media.play();case 4:this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach((function(e){e()})),this.delayHide();case 7:case"end":return e.stop()}}),e,this)})))},this.pauseMedia=function(){return Og(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="block",this.pauseButton.style.display="none",e.next=4,this.media.pause();case 4:case"end":return e.stop()}}),e,this)})))},this.onMouseOut=function(e){e.stopPropagation(),i.hide()},this.mediaTimeUpdate=function(){return Og(i,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.media.currentTime-this.start,t.t0=this.duration>0&&(Math.abs(n-this.duration)<.3||n>this.duration),!t.t0){t.next=9;break}return t.next=5,this.pauseMedia();case 5:this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(bb.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle();case 9:if(this.currentTime.innerText=e.formatTime(n),this.currentProgress.style.flex=(n/this.duration).toString(),!(this.bookmarkList&&this.bookmarkList.length>0)){t.next=14;break}(r=this.bookmarkList[this.pickBookmarkIndex])&&r.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit("shape ".concat(this.shapeId," onMediaBookmark ").concat(r.name)),this.pickBookmarkIndex+=1);case 14:this.fadeHit(n);case 15:case"end":return t.stop()}}),t,this)})))},this.onPauseMedia=function(){i.playButton.style.display="block",i.pauseButton.style.display="none"},this.onPlayMedia=function(){i.fadeState={in:!1,out:!1},i.fadeHit(0),i.playButton.style.display="none",i.pauseButton.style.display="block",i.playCallBackList.forEach((function(e){e()})),i.media.currentTime0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"viewBox","0 0 512 512"),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width",t.toString());var r=document.createElementNS("http://www.w3.org/2000/svg","polyline");return r.setAttributeNS(null,"points","35 0, 477 256, 35 512"),r.setAttributeNS(null,"fill","#000000"),n.appendChild(r),n}},{key:"generatePauseButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=document.createElementNS("http://www.w3.org/2000/svg","svg");Rg(n,{height:e+"px"}),n.setAttributeNS(null,"viewBox","0 0 512 512"),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width",t.toString());var r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttributeNS(null,"x","35"),r.setAttributeNS(null,"y","0"),r.setAttributeNS(null,"width","148"),r.setAttributeNS(null,"height","512");var i=r.cloneNode(!0);return i.setAttributeNS(null,"x","330"),n.append(r,i),n}},{key:"generateFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=document.createElementNS("http://www.w3.org/2000/svg","svg");Rg(n,{height:e+"px",width:t+"px"}),n.setAttributeNS(null,"width",t.toString()),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"viewBox","0 0 1024 1024");var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M918.116352 107.409408c10.186752 10.175488 10.186752 26.691584 0 36.87936L653.734912 407.038976c-10.187776 10.187776-26.703872 10.187776-36.891648 0-10.175488-10.187776-10.175488-26.703872 0.013312-36.891648l264.38144-262.73792c10.174464-10.187776 26.69056-10.200064 36.87936-0.013312L918.117376 107.409408zM878.281728 148.096l-161.155072-0.44544c-11.283456 0.279552-20.85888-8.226816-21.90336-19.458048l0-13.421568c0.318464-10.671104 8.889344-19.241984 19.560448-19.560448l187.030528 0.827392c0.1792-0.037888 0.357376-0.0768 0.523264-0.089088l9.549824-0.229376c5.005312-0.152576 9.843712 1.770496 13.372416 5.336064 3.32288 3.629056 4.9664 8.49408 4.545536 13.40928l-1.032192 9.537536c0 0.191488 0.70144 0.318464 0.70144 0.49664l-0.534528 188.279808c-0.54784 9.984-9.092096 17.637376-19.076096 17.089536-0.165888-0.012288-0.319488-0.0256-0.484352-0.037888L896.009216 329.8304c-10.379264-0.0512-18.733056-8.506368-18.681856-18.885632 0.013312-0.191488 0.013312-0.381952 0.013312-0.585728L878.281728 148.096zM105.884672 916.661248c-10.187776-10.175488-10.200064-26.691584-0.013312-36.87936 0 0 0-0.013312 0.013312-0.013312l265.19552-262.73792c10.35264-10.008576 26.86976-9.729024 36.866048 0.636928 9.766912 10.110976 9.766912 26.131456 0 36.242432L143.579136 916.661248C133.072896 926.848 116.3776 926.848 105.884672 916.661248L105.884672 916.661248zM146.533376 875.973632l161.154048 0.433152c11.283456-0.292864 20.85888 8.213504 21.891072 19.458048l0 13.38368c-0.292864 10.672128-8.876032 19.255296-19.560448 19.561472l-187.858944-0.828416c-0.165888 0.037888-0.344064 0.075776-0.509952 0.089088l-9.550848 0.229376c-5.004288 0.152576-9.831424-1.782784-13.35808-5.336064-3.323904-3.629056-4.979712-8.493056-4.54656-13.395968l1.031168-9.537536c0-0.191488-0.712704-0.330752-0.700416-0.509952l0.534528-188.278784c0.534528-9.984 9.066496-17.625088 19.050496-17.089536 0.165888 0.013312 0.330752 0.0256 0.508928 0.037888l14.212096 0c10.365952 0.0512 18.719744 8.507392 18.656256 18.873344 0 0.191488 0 0.395264-0.013312 0.598016L146.533376 875.973632zM918.116352 916.661248c10.186752-10.175488 10.200064-26.691584 0.012288-36.87936 0 0 0-0.013312-0.012288-0.013312l-264.38144-262.73792c-10.365952-10.008576-26.86976-9.729024-36.87936 0.636928-9.766912 10.110976-9.766912 26.131456 0 36.242432L881.22368 916.661248c10.186752 10.186752 26.703872 10.186752 36.891648 0.013312L918.115328 916.661248 918.116352 916.661248zM878.281728 875.973632l-161.168384 0.433152c-11.270144-0.292864-20.845568 8.213504-21.890048 19.458048l0 13.38368c0.306176 10.672128 8.889344 19.241984 19.560448 19.561472l187.030528-0.828416c0.1792 0.037888 0.357376 0.075776 0.523264 0.089088l9.549824 0.229376c5.005312 0.152576 9.843712-1.782784 13.372416-5.336064 3.32288-3.629056 4.978688-8.493056 4.545536-13.395968l-1.032192-9.537536c0-0.191488 0.70144-0.330752 0.70144-0.509952l-0.534528-188.278784c-0.54784-9.984-9.092096-17.637376-19.076096-17.089536-0.165888 0.013312-0.319488 0.0256-0.484352 0.037888L896.009216 694.19008c-10.379264 0.0512-18.733056 8.507392-18.681856 18.885632 0 0.191488 0.013312 0.381952 0.013312 0.584704L878.281728 875.973632zM105.884672 107.409408c-10.187776 10.175488-10.187776 26.691584 0 36.87936l265.19552 262.750208c10.187776 10.187776 26.691584 10.187776 36.87936 0s10.175488-26.703872-0.012288-36.891648l-264.368128-262.73792C133.072896 97.222656 116.3776 97.222656 105.884672 107.409408L105.884672 107.409408zM146.533376 148.096l161.154048-0.44544c11.283456 0.292864 20.85888-8.213504 21.891072-19.458048l0-13.421568c-0.306176-10.671104-8.889344-19.241984-19.560448-19.560448l-187.858944 0.827392c-0.165888-0.0512-0.344064-0.0768-0.509952-0.089088l-9.550848-0.229376c-5.004288-0.152576-9.831424 1.782784-13.35808 5.336064-3.323904 3.629056-4.979712 8.49408-4.54656 13.40928l1.031168 9.537536c0 0.191488-0.712704 0.318464-0.700416 0.49664l0.534528 188.279808c0.534528 9.970688 9.066496 17.624064 19.050496 17.089536 0.165888-0.012288 0.330752-0.0256 0.508928-0.037888l14.212096 0c10.365952-0.0512 18.719744-8.506368 18.656256-18.87232 0-0.191488 0-0.395264-0.013312-0.598016L146.533376 148.096z"),n.appendChild(r),document.body.appendChild(n),n}},{key:"generateExitFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=document.createElementNS("http://www.w3.org/2000/svg","svg");Rg(n,{height:e+"px",width:t+"px"}),n.setAttributeNS(null,"width",t.toString()),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"viewBox","0 0 1024 1024");var r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M716.8 998.4a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 0 1 25.6-25.6h256a25.6 25.6 0 1 1 0 51.2h-230.4v230.4a25.6 25.6 0 0 1-25.6 25.6zM307.2 998.4a25.6 25.6 0 0 1-25.6-25.6v-230.4H51.2a25.6 25.6 0 1 1 0-51.2h256a25.6 25.6 0 0 1 25.6 25.6v256a25.6 25.6 0 0 1-25.6 25.6zM972.8 332.8h-256a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 1 1 51.2 0v230.4h230.4a25.6 25.6 0 1 1 0 51.2zM307.2 332.8h-256a25.6 25.6 0 1 1 0-51.2h230.4V51.2a25.6 25.6 0 1 1 51.2 0v256a25.6 25.6 0 0 1-25.6 25.6z"),i.setAttributeNS(null,"d","M307.2 332.8a25.6 25.6 0 0 1-18.112-7.488L56.896 93.12a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192A25.6 25.6 0 0 1 307.2 332.8zM716.8 332.8a25.6 25.6 0 0 1-18.112-43.712L930.88 56.896a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488zM948.992 974.592a25.6 25.6 0 0 1-18.112-7.488l-232.192-232.192a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192a25.6 25.6 0 0 1-18.112 43.712zM75.008 974.592a25.6 25.6 0 0 1-18.112-43.712l232.192-232.192a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488z"),n.appendChild(r),n.appendChild(i),document.body.appendChild(n),n}},{key:"createButton",value:function(){var e={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px",display:"flex",justifyContent:"center",alignItems:"center"};Rg(this.playButton,Object.assign(Object.assign({},e),{display:"block"}));var t=this.generatePlayButton();Rg(t,{height:"20px"}),this.playButton.appendChild(t),Rg(this.pauseButton,Object.assign(Object.assign({},e),{display:"none"}));var n=this.generatePauseButton();if(Rg(n,{height:"20px"}),this.pauseButton.appendChild(n),this.isVideo){var r=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(r),Rg(this.fullScreenButton,Object.assign(Object.assign({},e),{display:"block"}));var i=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(i),Rg(this.exitFullScreenButton,Object.assign(Object.assign({},e),{display:"none"}))}}},{key:"createTimer",value:function(){var e=document.createElement("div");Rg(e,{width:"100px"}),this.currentTime.innerText="00:00";var t=document.createElement("span");return t.innerText="/",e.append(this.currentTime,t,this.totalTime),e}},{key:"createProgress",value:function(){var e={flex:"1",position:"relative"};this.isVideo||(e.marginRight="10px"),Rg(this.progress,e);var t=document.createElement("div");Rg(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Rg(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}},{key:"fadeHit",value:function(e){if(this.info.fade){var t=this.info.fade,n=t.start,r=t.end;n&&!this.fadeState.in&&e>=0&&(this.fadeState.in=!0,this.media.fadeIn(0,n)),r&&!this.fadeState.out&&e>=this.duration-r/1e3&&(this.fadeState.out=!0,this.media.fadeOut(0,r))}}},{key:"changeBookmarkIndex",value:function(e,t){if(this.bookmarkList&&0!==this.bookmarkList.length){if(this.pickBookmarkIndex>0)for(var n=0;ne){this.pickBookmarkIndex=n;break}if(t){for(var r=this.pickBookmarkIndex-1,i=0;il?l/n:1);s.y=s.y+this.height-r,s.x=Math.max(s.x,0),s.x=Math.min(s.x,o-n*c),s.y=Math.max(s.y,0),s.y=Math.min(s.y,a-r),Rg(this.mediaController,{height:r+"px",borderRadius:r/2+"px",width:n+"px",flexDirection:"row",alignItems:"center",position:"absolute",left:s.x+"px",top:s.y+"px",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:"scale(".concat(c,")"),transformOrigin:"0 100%"}),this.fullscreenStatus&&Rg(this.mediaController,{left:"0",top:a-r+"px"})}},{key:"createMediaController",value:function(){this.setControllerPosition(),Rg(this.mediaController,{display:"none",transition:"opacity ".concat(Gg,"s")}),this.createButton();var e=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,e,this.progress),this.isVideo&&this.mediaController.append(this.fullScreenButton,this.exitFullScreenButton),this.container.appendChild(this.mediaController),this.bindEvent()}},{key:"addPlayCallBack",value:function(e){this.playCallBackList.push(e)}},{key:"fullscreenPlay",value:function(){this.fullscreenStatus=!0,"interactive"!==this.ctx.mode&&this.media.requestFullscreen(),"local"!==this.ctx.mode&&this.ctx.eventHub.emit(bb.fullscreenChange,{targetId:this.targetId,state:!0}),this.delayHide()}},{key:"changeFullScreenState",value:function(e,t,n){n===this.ctx.slideIndex&&(e&&this.targetId===t?this.fullscreenStatus=e:this.fullscreenStatus=!1,this.fullscreenStatus?(this.fullScreenButton.style.display="none",this.exitFullScreenButton.style.display="block"):(this.fullScreenButton.style.display="block",this.exitFullScreenButton.style.display="none"),this.setControllerPosition())}},{key:"bindEvent",value:function(){Pg.isDesktop()&&(this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.mediaController.addEventListener("mouseover",this.showController,!1)),this.progress.addEventListener("click",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),this.containerObserver=new MutationObserver(this.onContainerSizeChange),this.container&&this.containerObserver.observe(this.container,{attributes:!0,attributeFilter:["data-scale","style"]}),this.isVideo&&(this.ctx.globalEventHub.on("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.on("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.addEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.addEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"unbindEvent",value:function(){var e;Pg.isDesktop()&&(this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.mediaController.removeEventListener("mouseover",this.showController,!1)),this.progress.removeEventListener("click",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this._pauseMediaFromCtrl,!1),this.media.removeAllListeners(),null===(e=this.containerObserver)||void 0===e||e.disconnect(),this.isVideo&&(this.ctx.globalEventHub.removeListener("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.removeListener("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.removeEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.removeEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"show",value:function(){this.setControllerPosition(),this.mediaController.style.opacity=zg,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}},{key:"hide",value:function(){this.fullscreenStatus?this.mediaController.style.opacity=Fg:this.mediaController.style.display="none"}},{key:"delayHide",value:function(){var e=this;clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout((function(){e.hide()}),jg)}},{key:"destroy",value:function(){var e;this.unbindEvent(),this.playCallBackList=[],null===(e=this.container)||void 0===e||e.removeChild(this.mediaController)}},{key:"clippedDuration",get:function(){return this.duration}}],[{key:"formatTime",value:function(e){var t="00:00";if(e){var n=Math.floor(e/60),r=String(n<0?0:n).padStart(2,"0"),i=Math.floor(e%60);t="".concat(r,":").concat(String(i<0?0:i).padStart(2,"0"))}return t}}]),e}(),Vg=n(120),Wg=function(e){p(n,e);var t=m(n);function n(e,r,i){var o,a,s,u;return _(this,n),(a=t.call(this)).isGlobalPause=!1,a.lastTime=-1,a.howl=null,a.rctClient=null,a.isHowlEnd=!1,a.isHowlLoadEmit=!1,a.staticEventId=1001,a._catParams=void 0,a.url=e,a.runningAudio=r,i&&(a._catParams=i),xb.RtcAudioClazz?(a.rctClient=new xb.RtcAudioClazz(e,null===(s=a._catParams)||void 0===s?void 0:s.start,null===(u=a._catParams)||void 0===u?void 0:u.end),a.rctClient.on("load",(function(){return a.emit("load")})),a.rctClient.on("pause",(function(){return a.emit("pause")})),a.rctClient.on("play",(function(){a.startTimeChangeEmit(),a.emit("play")})),a.rctClient.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){a.emit("resumeAllAudioInterruptByAudioSessionChanged")}))):(a.howl=new Vg.Howl({src:[e]}),o=c(a.howl._getSoundIds(),1),a.staticEventId=o[0],a.howl.load(),a.howl.on("load",(function(){a.isHowlLoadEmit=!0,a.emit("load")})),a.howl.on("pause",(function(){return a.emit("pause")})),a.howl.on("play",(function(){a.isHowlLoadEmit||a.emit("load"),a.isHowlEnd=!1,a.startTimeChangeEmit(),a.emit("play")})),a.howl.on("end",(function(){a.isHowlEnd=!0}))),a}return T(n,[{key:"startTimeChangeEmit",value:function(){var e=this;this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate",this.lastTime)),this.isPaused||setTimeout((function(){e.isPaused||e.startTimeChangeEmit()}),300)}},{key:"play",value:function(){var e,t,n;this.runningAudio.has(this.url)&&(null===(e=this.runningAudio.get(this.url))||void 0===e||e.stop(),this.runningAudio.delete(this.url)),this.isHowlEnd=!1,this.lastTime=-1,null===(t=this.howl)||void 0===t||t.play(this.staticEventId),null===(n=this.rctClient)||void 0===n||n.play(),this.runningAudio.set(this.url,this)}},{key:"fade",value:function(e,t,n){this.howl&&this.howl.fade(e,t,n)}},{key:"pause",value:function(){var e,t;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),null===(t=this.rctClient)||void 0===t||t.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"globalPause",value:function(){this.isPaused||(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"stop",value:function(){var e;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"destroy",value:function(){var e,t,n,r,i,o,a,s;null===(e=this.howl)||void 0===e||e.stop(this.staticEventId),null===(t=this.howl)||void 0===t||t.unload(),null===(n=this.rctClient)||void 0===n||n.pause(),null===(r=this.rctClient)||void 0===r||r.destroy(),null===(i=this.rctClient)||void 0===i||i.removeAllListeners("load"),null===(o=this.rctClient)||void 0===o||o.removeAllListeners("play"),null===(a=this.rctClient)||void 0===a||a.removeAllListeners("pause"),null===(s=this.rctClient)||void 0===s||s.removeAllListeners("resumeAllAudioInterruptByAudioSessionChanged"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"volume",value:function(e){this.rctClient?this.rctClient.volume(e):this.howl&&this.howl.volume(e)}},{key:"currentTime",get:function(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek(this.staticEventId):-1},set:function(e){this.rctClient?this.rctClient.currentTime=e:this.howl&&this.howl.seek(e,this.staticEventId)}},{key:"duration",get:function(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration(this.staticEventId):0}},{key:"isPaused",get:function(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&!this.howl.playing(this.staticEventId)}}]),n}(Ks.a),Yg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Xg=function(e){p(n,e);var t=m(n);function n(e){var r,i,o,a,s,u,l,c;_(this,n),(r=t.call(this)).type="video",r.sprite=new Ld,r.isPlaying=!1,r.isGlobalPause=!1,r.fullscreen=!1,r.url="",r.isLoaded=!1,r.onVideoResourceLoaded=function(){r.isLoaded=!0},r.onVideoStalled=function(){r.ctx.logger.warn(r.url+", Failed to fetch data, but trying.",r.ctx.taskId)},r.updateVolume=function(e){r.rtcAudio.volume(e)},r.syncFullscreenVideoState=function(e){var t=e.targetId,n=e.state;e.slideIndex===r.ctx.slideIndex&&t===r.id&&(n?(r.requestFullscreen(),r.ctx.latestChangeFullscreenTargetId=t):r.requestCancelFullscreen())},r.id=e.id,r.start=null===(i=e.video.cut)||void 0===i?void 0:i.start,r.end=null===(o=e.video.cut)||void 0===o?void 0:o.end,r.fullscreen=null!==(a=e.video.fullscreen)&&void 0!==a&&a,r.container=e.container,r.ctx=e.ctx,r.ctx.medias[r.id]=y(r);var h=e.video.src;r.videoResource=new Xl.w(h,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0}),null===(s=r.videoElement)||void 0===s||s.addEventListener("stalled",r.onVideoStalled),null===(u=r.videoElement)||void 0===u||u.addEventListener("loadedmetadata",r.onVideoResourceLoaded),r.url=e.video.src;var d=e.video.src.replace(/4$/,"3");r.ctx.loaderDelegate&&(d=r.ctx.loaderDelegate.redirectMedia(d),r.ctx.logger.info("redirect media url from ".concat(e.video.src.replace(/4$/,"3")," to ").concat(d," by delegate."),e.ctx.taskId)),r.rtcAudio=new Wg(d,e.ctx.runningAudio,{start:null===(l=e.video.cut)||void 0===l?void 0:l.start,end:null===(c=e.video.cut)||void 0===c?void 0:c.end}),r.rtcAudio.on("timeupdate",(function(e){if(r.videoElement){var t=r.videoElement.currentTime;Math.abs(t-e)>.5&&(r.videoElement.currentTime=e)}})),r.rtcAudio.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){var e;null===(e=r.videoElement)||void 0===e||e.pause(),setTimeout((function(){var e;r.rtcAudio.isPaused||null===(e=r.videoElement)||void 0===e||e.play()}),200)}));var f=e.video,p=e.width,v=e.height,m=e.target;r.controller=new Hg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,width:p,height:v,target:m,media:y(r),info:f,canvasElement:e.canvasElement}),r.controller.addPlayCallBack((function(){r.sprite.width=p,r.sprite.height=v,r.ctx.clock.setTimeout((function(){r.sprite.visible=!0}),50)}));var g=new Xl.c(null,{height:v,width:p});return g.resource=r.videoResource,r.videoResource.bind(g),r.sprite=new Ld,r.sprite.visible=!1,r.sprite.texture=new Xl.t(g),r.sprite.interactive=!0,r.container.addChild(r.sprite),r.sprite.on("mouseover",(function(e){e.stopPropagation(),r.controller.show()})),r.sprite.on("mouseout",(function(e){e.stopPropagation(),r.controller.hide()})),["durationchange","timeupdate","pause","play"].forEach((function(e){var t;null===(t=r.videoElement)||void 0===t||t.addEventListener(e,(function(){"timeupdate"===e&&r.isPlaying,r.emit(e)}))})),r.ctx.activeMedia.add(y(r)),r.ctx.volumeAdjuster.on("update",r.updateVolume),r.ctx.globalEventHub.on("syncFullscreenVideoState",r.syncFullscreenVideoState),r}return T(n,[{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return Yg(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isPlaying=!0,this.updateVolume(this.ctx.volumeAdjuster.volume),e.next=4,this.load();case 4:return e.next=6,this.ctx.clock.waitUntil((function(){var e=n.videoElement;return!!(e&&e.videoWidth>0)}),3e3);case 6:(t=this.videoElement)&&t.videoWidth<=0||(this.videoElement&&(this.videoElement.volume=0,this.videoElement.muted=!0),this.rtcAudio.on("play",(function(){var e;null===(e=n.videoElement)||void 0===e||e.play(),n.fullscreen&&n.controller.fullscreenPlay()})),this.rtcAudio.play());case 8:case"end":return e.stop()}}),e,this)})))}},{key:"load",value:function(){return this.videoResource.load()}},{key:"pause",value:function(){var e=this;this.isPlaying=!1,this.ctx.logger.warn(this.url+", pause video manual.",this.ctx.taskId),this.ctx.logger.warn(this.url+", pause rtc audio manual.",this.ctx.taskId),this.rtcAudio.on("pause",(function(){var t;null===(t=e.videoElement)||void 0===t||t.pause()})),this.rtcAudio.pause()}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.rtcAudio.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(bb.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){return Yg(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dv((function(){return n.isLoaded}),5e3);case 2:t=new Xl.t(this.sprite.texture.baseTexture),this.ctx.globalEventHub.emit("requestFullscreen",{texture:t,index:this.ctx.slideIndex,targetId:this.id});case 4:case"end":return e.stop()}}),e,this)})))}},{key:"requestCancelFullscreen",value:function(){this.ctx.globalEventHub.emit("requestCancelFullscreen",{targetId:this.id,index:this.ctx.slideIndex})}},{key:"destroy",value:function(){var e,t,n;this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.ctx.globalEventHub.removeListener("syncFullscreenVideoState",this.syncFullscreenVideoState),null===(e=this.videoElement)||void 0===e||e.removeEventListener("stalled",this.onVideoStalled),null===(t=this.videoElement)||void 0===t||t.removeEventListener("loadedmetadata",this.onVideoResourceLoaded),this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(n=this.videoResource)||void 0===n||n.destroy(),this.rtcAudio.destroy(),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}},{key:"fadeIn",value:function(e,t){this.rtcAudio.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.rtcAudio.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"videoElement",get:function(){return this.videoResource.source}},{key:"currentTime",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.currentTime)&&void 0!==t?t:0},set:function(e){this.rtcAudio.currentTime=e,this.videoElement&&(this.videoElement.currentTime=e)}},{key:"paused",get:function(){var e,t;return null===(t=null===(e=this.videoElement)||void 0===e?void 0:e.paused)||void 0===t||t}},{key:"duration",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.duration)&&void 0!==t?t:0}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}}]),n}(Ks.a),Qg=function(e){p(n,e);var t=m(n);function n(e){var r,i,o;_(this,n),(r=t.call(this)).type="audio",r.isPlaying=!1,r.isGlobalPause=!1,r.updateVolume=function(e){r.audioPlayer.volume(e)},r.id=e.id;var a=e.audio.src;r.audioPlayer=new Wg(a,e.ctx.runningAudio,{start:null===(i=e.audio.cut)||void 0===i?void 0:i.start,end:null===(o=e.audio.cut)||void 0===o?void 0:o.end}),e.audio.cut&&(r.start=e.audio.cut.start,r.end=e.audio.cut.end),r.ctx=e.ctx,r.ctx.medias[r.id]=y(r);var s=e.width,u=e.height,l=e.target;return r.controller=new Hg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,height:u,width:s,target:l,media:y(r),info:e.audio,canvasElement:e.canvasElement}),r.audioPlayer.on("load",(function(){return r.emit("durationchange")})),r.audioPlayer.on("timeupdate",(function(){return r.emit("timeupdate")})),r.audioPlayer.on("pause",(function(){return r.emit("pause")})),r.audioPlayer.on("play",(function(){return r.emit("play")})),r.ctx.activeMedia.add(y(r)),r.ctx.volumeAdjuster.on("update",r.updateVolume),r}return T(n,[{key:"load",value:function(){return Promise.resolve()}},{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.updateVolume(this.ctx.volumeAdjuster.volume),this.isPlaying=!0,this.audioPlayer.play());case 1:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.audioPlayer.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(bb.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){}},{key:"requestCancelFullscreen",value:function(){}},{key:"destroy",value:function(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this),this.audioPlayer.destroy()}},{key:"fadeIn",value:function(e,t){this.audioPlayer.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.audioPlayer.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"currentTime",get:function(){return this.audioPlayer.currentTime},set:function(e){this.audioPlayer.currentTime=e}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}},{key:"paused",get:function(){return this.audioPlayer.isPaused}},{key:"isPaused",get:function(){return this.audioPlayer.isPaused}},{key:"duration",get:function(){return this.audioPlayer.duration}}]),n}(Ks.a),Zg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},qg=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,Object.assign(Object.assign({},e),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),r,i)).isInteractiveOutside=!1,o.cmd=new Pv(y(o)),o.media=null==e?void 0:e.media,o.container.name=e.id+"_container_[Picture]",o.renderContainer.name=e.id+"_render_container_[Picture]",o.picFill=new Bm(o.ctx,e.picFill,e.width,e.height,{useFilter:!0,useSlideBackgroundFill:!1}),o}return T(n,[{key:"applyCommand",value:function(e,t){var n,r,i,o;if("call"===t)if(/playFrom\(([0-9.]+)\)/.test(e)){var a=e.match(/playFrom\(([0-9.]+)\)/),s=Number(a[1]||"0");null===(n=this.mediaPlayer)||void 0===n||n.controller.playMediaFromCtrl(!0),Math.abs(s)>.1&&(null===(r=this.mediaPlayer)||void 0===r||r.controller.jumpToTime(s))}else"custom-pause"===e?null===(i=this.mediaPlayer)||void 0===i||i.controller.pauseMediaFromCtrl(!0):"togglePause"===e?this.mediaPlayer&&(this.mediaPlayer.isPlaying?this.mediaPlayer.controller.pauseMediaFromCtrl(!0):this.mediaPlayer.controller.playMediaFromCtrl(!0)):"stop"===e&&(null===(o=this.mediaPlayer)||void 0===o||o.stop())}},{key:"renderPic",value:function(){var e,t,n,r,i,o;return Zg(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,l,c,h,d=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(s=this.picFill.displayObject)){a.next=15;break}if(s.name=this.json.id+"_pic_fill_[Picture]",u=null===(e=this.backgroundGraphics)||void 0===e?void 0:e.getClonedDisplayObject(),(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.isNeedMask(s.width,s.height))&&u&&(s.mask=u,this.effectContainer.addChild(u)),s.width=this.designWidth,s.height=this.designHeight,s instanceof jp&&this.ctx.slideScopeEventHub.once("slide-render",(function(e){var t;d.ctx.slideIndex===e&&(null===(t=d.effectObject)||void 0===t||t.setFrameCount(s.totalFrames),s.play(),s.onFrameChange=function(e){if(d.effectObject)if(d.effectObject.hasFrame(e))d.effectObject.updateFrame(e);else{var t=d.getEffectTexture();t&&(d.effectObject.createFrame(e,t.texture),d.effectObject.setFrameOffset(t.offsetX,t.offsetY))}})})),this.effectContainer.addChild(s),!this.media){a.next=13;break}if(l=this.media.src,"audio"===this.media.type&&/mp4$/.test(l)&&(l=l.replace(/mp4$/,"mp3")),!this.ctx.urlInterrupter){a.next=12;break}return c=Date.now(),a.next=10,this.ctx.urlInterrupter(l);case 10:l=a.sent,this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-c),this.ctx.taskId);case 12:this.ctx.loaderDelegate&&(l=this.ctx.loaderDelegate.redirectMedia(l),this.ctx.logger.info("redirect media url to ".concat(l," by delegate."),this.ctx.taskId)),this.media.src=l;case 13:"video"===(null===(n=this.media)||void 0===n?void 0:n.type)&&this.media.src?(this.mediaPlayer=new Xg({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:s,container:this.effectContainer,canvasElement:this.ctx.view}),(null===(r=this.mediaPlayer)||void 0===r?void 0:r.sprite)&&u&&(h=null===(i=this.backgroundGraphics)||void 0===i?void 0:i.getClonedDisplayObject())&&(this.mediaPlayer.sprite.mask=h,this.container.addChild(h))):"audio"===(null===(o=this.media)||void 0===o?void 0:o.type)&&this.media.src&&(this.mediaPlayer=new Qg({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:s,canvasElement:this.ctx.view,fade:this.media.fade})),this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,Pg.isDesktop()?(this.container.on("mouseover",(function(){d.mediaPlayer.showController()})),this.container.on("mouseout",(function(){d.mediaPlayer.hideController()}),!1)):this.container.on("pointerdown",(function(){d.mediaPlayer.showController()})));case 15:case"end":return a.stop()}}),a,this)})))}},{key:"preRender",value:function(e){f(x(n.prototype),"preRender",this).call(this,e)}},{key:"subClassRender",value:function(){return Zg(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.renderPic();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"clearOnSlideChange",value:function(){f(x(n.prototype),"clearOnSlideChange",this).call(this),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}},{key:"initOnReuse",value:function(){f(x(n.prototype),"initOnReuse",this).call(this),this.mediaPlayer&&(this.container.interactive=!0)}},{key:"destroy",value:function(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}]),n}(Ag),Jg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Kg=function(e){p(n,e);var t=m(n);function n(e,r,i,o){var a;return _(this,n),(a=t.call(this,e,r,i)).children=[],a.cacheSprite=new Ld,a.cacheContainer=new Rl.b,a.json=e,a.json.fillStyle&&"groupFill"===a.json.fillStyle.fillType&&i.groupFillStyle&&(a.json.fillStyle=i.groupFillStyle),a.container.name=e.id+"_container_[Container]",a.cacheContainer.name=e.id+"_cache_container_[Container]",a.ctx.timingTargets.addTarget(e.id,y(a)),a.updateTransform(a.json),a.fillObject=new Bm(a.ctx,e.fillStyle,e.width,e.height,{useFilter:!1,useSlideBackgroundFill:!1}),a.createChildren(o),a}return T(n,[{key:"createChildren",value:function(e){for(var t,r,i,o,a=this,s={x:null!==(r=null===(t=this.json.position)||void 0===t?void 0:t.x)&&void 0!==r?r:0,y:null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},u=function(t,r){e.addSubMTask((function(){return Jg(a,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,u,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=this.json.children[t],o=null,this.ctx.featureList&&this.ctx.featureList.smartArt&&("Shape"===(null==i?void 0:i.type)||"Picture"===(null==i?void 0:i.type))&&this.ctx.smartArtShapeList&&(a=i.id,(u=this.ctx.smartArtShapeList.find((function(e){return e.id===a})))&&(i=u)),l={parentGlobalPos:s,groupFillStyle:this.json.fillStyle,groupSize:{w:this.json.width,h:this.json.height}},"Shape"===(null==i?void 0:i.type)?o=new Ag(i,this.ctx,l):"Picture"===(null==i?void 0:i.type)?o=new qg(i,this.ctx,l):"Container"===(null==i?void 0:i.type)&&(o=new n(i,this.ctx,l,e)),o&&this.children.push(o);case 4:case"end":return r.stop()}}),r,this)})))}),"@ContainerImpl[child.init]")},l=0,c=this.json.children.length;l1&&void 0!==arguments[1]?arguments[1]:{};if(e)if(e.delay&&e.delay>0){var n=a.ctx.clock.setTimeout((function(){e.event&&(a.cond[e.event]=!0,a.detectTrigger(t))}),e.delay);a.timeoutIds.push(n)}else a.cond[e.event]=!0,a.detectTrigger(t);else a.detectTrigger(t)},a.id=e,a.ctx=o,a.eventHubs=i,r.forEach((function(e){a.addCond(e)})),a}return T(n,[{key:"setTriggerParams",value:function(e){this.triggerParams=e}},{key:"addCond",value:function(e){var t=this,n=function(){for(var n=arguments.length,r=new Array(n),i=0;i0&&(this.cond[e.event]=!1,this.eventHubs.runtime.addListener(e.event,n)):this.cond[e.event]=!1)}},{key:"isTrigger",value:function(){var e=this;return Object.keys(this.cond).every((function(t){return!!e.cond[t]}))}},{key:"isTriggerWithoutParent",value:function(){var e=this;return Object.keys(this.cond).filter((function(e){return"self"!==e})).every((function(t){return!!e.cond[t]}))}},{key:"detectTrigger",value:function(e){var t=this;if(Object.keys(this.cond).every((function(e){return!!t.cond[e]}))){Object.keys(this.cond).forEach((function(e){t.cond[e]=!1}));var n=this.triggerParams;this.triggerParams=void 0,this.emit("active",n,e)}}},{key:"reset",value:function(){var e=this;Object.keys(this.cond).forEach((function(t){e.cond[t]=!1})),this.timeoutIds.forEach((function(t){return e.ctx.clock.clearTimeout(t)}))}}]),n}(Ks.a),ey=function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n),(r=t.call(this)).isTimeNodeEndSync=!1,r.interactiveListeners=[],r.runtimeNodeEventHub=new Ks.a,r._currentSeqIndex=0,r._currentSeqState="idle",r.isForward=!0,r.autoPlay=!1,r.handlePrev=function(){var e,t,n,i,o,a,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r.hasPrev()||!r.isMainSeq?"idle"===r.currentSeqState?(r.decrSeqIndex(),null===(e=r.commonTimeNode.children[r.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToStart(),null===(t=r.commonTimeNode.children[r.currentSeqIndex])||void 0===t||t.commonTimeNode.clearSubList(),r.currentSeqState="idle"):"running"===r.currentSeqState?(null===(n=r.commonTimeNode.children[r.currentSeqIndex])||void 0===n||n.commonTimeNode.seekToStart(),null===(i=r.commonTimeNode.children[r.currentSeqIndex])||void 0===i||i.commonTimeNode.clearSubList(),r.currentSeqState="idle"):"end"===r.currentSeqState&&(r.currentSeqIndex>=r.commonTimeNode.children.length&&(r.currentSeqIndex=r.commonTimeNode.children.length-1),null===(o=r.commonTimeNode.children[r.currentSeqIndex])||void 0===o||o.commonTimeNode.seekToStart(),null===(a=r.commonTimeNode.children[r.currentSeqIndex])||void 0===a||a.commonTimeNode.clearSubList(),r.currentSeqState="idle"):r.globalEventHub.emit("c:prev slide",s)},r.handleNext=function(e,t){var n,i,o,a;if(r.isTimeNodeEndSync&&(r.isTimeNodeEndSync=!1,r.currentSeqState="idle",r.currentSeqIndex=0),!r.hasNext()&&r.isMainSeq&&t)r.globalEventHub.emit("c:next slide",e);else{if(r.isInteractiveSeq){r.globalEventHub.emit("shape slide onNext"+(r.json.ctn.id||""));var s={result:null};r.findChildInfiniteRepeat(r.commonTimeNode,s),1===r.commonTimeNode.children.length&&s.result&&(s.result.json.subTnLst||[]).length>0&&0===r.currentSeqIndex&&"running"===r.currentSeqState&&r.commonTimeNode.allChildrenEndHandle()}"idle"===r.currentSeqState?null===(n=r.commonTimeNode.children[r.currentSeqIndex])||void 0===n||n.commonTimeNode.startTimeNodeForce():"running"===r.currentSeqState?(null===(i=r.commonTimeNode.children[r.currentSeqIndex])||void 0===i||i.commonTimeNode.seekToEnd(!1,!0),r.currentSeqState="end",r.incrSeqIndex(),null===(o=r.commonTimeNode.children[r.currentSeqIndex])||void 0===o||o.commonTimeNode.startTimeNodeForce()):"end"===r.currentSeqState&&(r.incrSeqIndex(),null===(a=r.commonTimeNode.children[r.currentSeqIndex])||void 0===a||a.commonTimeNode.startTimeNodeForce())}};var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,h=e.eventHub,d=e.iterateIndex,f=e.iterateId,p=e.isInInteractiveSeq;return r.isMainSeq="mainSeq"===i.ctn.nodeType,r.isInteractiveSeq="interactiveSeq"===i.ctn.nodeType,r.id=i.ctn.id,r.isIterate=a,r.json=i,r.ctx=l,r.globalEventHub=h,r.commonTimeNode=new tb({json:i.ctn,isSub:s,eventHubs:{global:h,runtime:r.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:d,iterateId:f,isInInteractiveSeq:p||r.isInteractiveSeq,fromSeqId:r.isInteractiveSeq?r.json.ctn.id:""}),r.bindShapeEvent(),r.nextConds=new $g("mainSeq",i.nextCondLst,{global:h,runtime:r.runtimeNodeEventHub},r.ctx),r.prevConds=new $g("mainSeq",i.preCondLst,{global:h,runtime:r.runtimeNodeEventHub},r.ctx),r.commonTimeNode.on("timeNodeRestart",(function(){r.currentSeqIndex=0,r.currentSeqState="idle"})),r.commonTimeNode.on("childTimeNodeStart",(function(e){var t=r.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(r.currentSeqIndex=t),r.currentSeqState="running",r.isMainSeq&&r.ctx.eventHub.emit(bb.mainSeqStepStart,t)})),r.commonTimeNode.on("childTimeNodeEnd",(function(e){var t=r.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(r.currentSeqIndex=t),r.currentSeqState="end",r.autoPlay&&r.ctx.clock.setTimeout((function(){r.handleNext(!1,!0)})),r.isMainSeq&&r.ctx.eventHub.emit(bb.mainSeqStepEnd,t)})),r.commonTimeNode.on("timeNodeEndSync",(function(){r.isTimeNodeEndSync=!0,r.commonTimeNode.resetForRepeat()})),r.commonTimeNode.on("timeNodeDestroy",(function(){r.interactiveListeners.forEach((function(e){var t=c(e,2),n=t[0],r=t[1];n&&r&&n.interactiveContainer.removeListener("pointerdown",r)})),r.interactiveListeners=[]})),r.nextConds.on("active",(function(e,t){Array.isArray(t)?r.handleNext(t[0],t[1]):r.handleNext(t,!0)})),r.prevConds.on("active",(function(e,t){Array.isArray(t)?r.handlePrev(t[0]):r.handlePrev(t)})),r}return T(n,[{key:"startAutoPlay",value:function(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}},{key:"incrSeqIndex",value:function(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}},{key:"decrSeqIndex",value:function(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}},{key:"hasPrev",value:function(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}},{key:"hasNext",value:function(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}},{key:"findChildInfiniteRepeat",value:function(e,t){var n=this;e.isInfiniteRepeat()?t.result=e:e.children.map((function(e){return e.commonTimeNode})).forEach((function(e){return n.findChildInfiniteRepeat(e,t)}))}},{key:"bindShapeEvent",value:function(){var e=this;"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach((function(t){if(/^shape/.test(t.event)){var n=t.event.split(" ")[1];if(n){var r=e.ctx.timingTargets.getTargetById(n);if(r){r.interactiveContainer.interactive=!0,r.interactiveContainer.cursor="pointer";var i=function(){e.ctx.eventHub.emit(bb.userInput);var t="shape ".concat(n," onClick"),r=e.ctx.mode;"interactive"!==r&&"sync"!==r||e.ctx.eventHub.emit(bb.interactiveSeqAction,{action:t,seqId:e.json.ctn.id}),"sync"!==r&&"local"!==r||e.globalEventHub.emit(t)};r.interactiveContainer.on("pointerdown",i),e.interactiveListeners.push([r,i])}}}}))}},{key:"setCurrentStep",value:function(e,t){var n=this.commonTimeNode.children.length;if(!(e>n)){this.isInteractiveSeq&&0===this.commonTimeNode.applyCount&&(this.commonTimeNode.applyCount=1);var r=e;if(this.commonTimeNode.seekToStart(),-1===r&&(r=n-1),0!==r||"start"!==t){if(r>=0&&r=1){var n=r.json.cBhvr.attrList[0];r.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");var i=r.json.cBhvr.to||r.json.to;i&&r.timingTarget&&ty(r.timingTarget,n,i)}})),r}return T(n,[{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(ry),oy=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==("undefined"==typeof Reflect?"undefined":M(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},ay=function(){function e(t,n){_(this,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:function(e){return e/Math.PI*180},exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:function(e){return e/180*Math.PI},rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=n,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}return T(e,[{key:"parseFmla",value:function(e){var t=e.replace(/#ppt_h/g,"(".concat(this.timingTarget.design_ppt_h,")"));return t=(t=(t=(t=(t=(t=(t=(t=t.replace(/#ppt_w/g,"(".concat(this.timingTarget.design_ppt_w,")"))).replace(/#ppt_x/g,"(".concat(this.timingTarget.design_ppt_x,")"))).replace(/#ppt_y/g,"(".concat(this.timingTarget.design_ppt_y,")"))).replace(/ppt_w/g,"vars.ppt_w")).replace(/ppt_h/g,"vars.ppt_h")).replace(/ppt_x/g,"vars.ppt_x")).replace(/ppt_y/g,"vars.ppt_y")).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((function(e){var n=new RegExp("([^a-z])".concat(e,"([^a-z])"),"g");t=t.replace(n,(function(t,n,r){return"".concat(n,"math.").concat(e).concat(r)}))})),new Function("vars","math","$","return "+t)}}]),e}(),sy=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,e,r)).value=e.val.value,i&&(o.fmla=o.parseFmla(i)),o}return T(n,[{key:"resolveValue",value:function(){return this.value}},{key:"interpolationFrom",value:function(e,t,n){var r=e.resolveValue(n),i=r+(this.resolveValue()-r)*t;return e.fmla?e.fmla(n,this.math,i):i}}]),n}(ay);oy([iv()],sy.prototype,"interpolationFrom",null);var uy=function(e){p(n,e);var t=m(n);function n(e,r){var i,o;return _(this,n),(i=t.call(this,e,r)).value=null===(o=e.val)||void 0===o?void 0:o.value,i}return T(n,[{key:"interpolationFrom",value:function(e,t,n){var r=e.resolveValue(n);return t>this.time&&["hidden","visible"].indexOf(r)<0&&(r=this.resolveValue()),r}},{key:"resolveValue",value:function(){return this.value||""}}]),n}(ay);oy([iv()],uy.prototype,"interpolationFrom",null);var ly=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).fn=i.parseFmla(i.val),i}return T(n,[{key:"resolveValue",value:function(e){return this.fn(e,this.math,1)}},{key:"interpolationFrom",value:function(e,t,n){var r=e.resolveValue(n),i=r+(this.resolveValue(n)-r)*t;return e.fmla?e.fmla(n,this.math,i):i}}]),n}(ay);oy([iv()],ly.prototype,"interpolationFrom",null);var cy=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).value=e.val.value,i}return T(n,[{key:"interpolationFrom",value:function(e,t){return Zv(e.resolveValue(),this.value,t)}},{key:"resolveValue",value:function(){return this.value}}]),n}(ay);oy([iv()],cy.prototype,"interpolationFrom",null);var hy=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!0,r.activeWhenConflict="next",r.startVal=null,r.createVal=null,r.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},r.keyFrames=[],r.isColorAnim=!1,r.onTimeNodeStart=function(){r.timingTarget&&(r.startVal=ny(r.timingTarget,r.json.cBhvr.attrList[0]))},r.updateVars=function(){var e,t,n,i;(null===(e=r.timingTarget)||void 0===e?void 0:e.ppt_h)&&(r.vars.ppt_h=r.timingTarget.ppt_h),(null===(t=r.timingTarget)||void 0===t?void 0:t.ppt_w)&&(r.vars.ppt_w=r.timingTarget.ppt_w),(null===(n=r.timingTarget)||void 0===n?void 0:n.ppt_x)&&(r.vars.ppt_x=r.timingTarget.ppt_x),(null===(i=r.timingTarget)||void 0===i?void 0:i.ppt_y)&&(r.vars.ppt_y=r.timingTarget.ppt_y),r.isColorAnim},r.onTimeUpdate=function(e){var t=e.duration,n=e.delta/t,i=r.keyFrames.findIndex((function(e){return n<=e[0]})),o=r.json.cBhvr.attrList;if(i<0){var a=r.keyFrames[r.keyFrames.length-1];r.timingTarget&&o&&o[0]&&ty(r.timingTarget,o[0],a[1].resolveValue(r.vars))}else{var s=i-1,u=r.keyFrames[i],l=r.keyFrames[s]||u,c=u[0]-l[0]==0?1:(n-l[0])/(u[0]-l[0]),h=u[1].interpolationFrom(l[1],c,r.vars);r.timingTarget&&o&&o[0]&&ty(r.timingTarget,o[0],h)}},r.onSeekToStart=function(){null!==r.startVal&&r.timingTarget&&ty(r.timingTarget,r.json.cBhvr.attrList[0],r.startVal)},r.onSeekToEnd=function(){r.onTimeUpdate({duration:1,delta:1,isReverse:!1})},r.onDestroy=function(){null!==r.createVal&&r.timingTarget&&ty(r.timingTarget,r.json.cBhvr.attrList[0],r.createVal)},r.initKeyFrames(),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timelineStart",r.updateVars),r.commonTimeNode.on("timeNodeStart",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeDestroy",r.onDestroy),r.createVal=ny(r.timingTarget,r.json.cBhvr.attrList[0]),r}return T(n,[{key:"initKeyFrames",value:function(){var e,t=this.json.valueType;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){var n={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===t&&this.timingTarget){var r=new ly(n,this.timingTarget);this.keyFrames.push([n.time,r])}}var i={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===t&&this.timingTarget){var o=new ly(i,this.timingTarget);this.keyFrames.push([i.time,o])}}else if(this.json.by){var a={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===t&&this.timingTarget){var s=new ly(a,this.timingTarget);this.keyFrames.push([a.time,s])}var u={time:1,val:{type:"string",value:((null===(e=a.val)||void 0===e?void 0:e.value)||"")+"+"+this.json.by},fmla:""};if("num"===t&&this.timingTarget){var l=new ly(u,this.timingTarget);this.keyFrames.push([u.time,l])}}if(this.json.tavLst.length>0){var c,h=S(this.json.tavLst);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(d.val&&this.timingTarget){var f=null;"string"===d.val.type?"num"===t?f=new ly(d,this.timingTarget):"str"===t&&(f=new uy(d,this.timingTarget)):"number"===d.val.type?f=new sy(d,this.timingTarget):"color"===d.val.type?(this.isColorAnim=!0,f=new cy(d,this.timingTarget)):"boolean"===d.val.type&&console.warn("not implements"),f&&this.keyFrames.push([d.time,f])}}}catch(e){h.e(e)}finally{h.f()}}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(ry),dy=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,e,r,i)}return T(n,[{key:"percent",set:function(e){this.uniforms.percent=e}},{key:"transition",set:function(e){this.uniforms.transition=e}}]),n}(Xl.k),fy=n(121),py=n.n(fy),vy=n(122),my=n.n(vy),gy=n(123),yy=n.n(gy),by=n(124),xy=n.n(by),_y=n(9),wy=n.n(_y),Ty=n(125),My=n.n(Ty),Sy=n(126),Ey=n.n(Sy),Ay="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAr5QTFRFAAAATwAAOQAAZgAAKwAAPAAAPQAA7AAA/wAA/QAAugAA5QAAsQAAwQAAsAAAfwAAawAASQAAZAAAOAAAJwAALAAALQAAqQAAiwAAmgAA5AAA7QAAtQAAhQAALwAAfAAAXwAAYQAAigAAuQAAfgAAswAAcgAArQAAqgAAZwAAaQAAMgAAGAAAiAAAjwAA1gAA6QAA+wAA7wAA2AAAbQAA2gAA3QAAuwAA3wAA2QAAxQAA0QAAzwAA0gAAXQAAYAAADAAADwAAGQAALgAAjgAAcAAAzQAAwgAA+gAA3AAAGwAAoAAAowAAcQAAVwAA1QAAIQAAWQAA5wAAsgAAuAAASwAAbwAARwAAMAAAnAAAUQAAaAAA9wAA4gAAPwAAbAAAOwAAlwAA0wAAjQAAvAAAwwAAkwAAQQAAvgAAnwAAvQAA0AAA2wAAwAAAWwAATQAACwAABwAAQgAAtgAAgwAAvwAAgQAAlgAAEAAAxgAAtwAAmAAARgAAjAAAdwAAqwAArwAAywAAYgAACAAAmwAAHwAApQAA8QAAdAAAbgAAFgAAgAAAogAAewAAXgAA6AAA9gAA/AAAzgAA3gAAkgAAngAAdQAARAAAmQAATgAAUgAAJQAAIgAAqAAARQAAPgAAxwAACQAAAgAAMQAAiQAAhwAA4AAAUAAABQAAeQAAygAA9AAAFQAAVQAAyAAANQAA4wAAKAAAWAAAZQAApwAA4QAAyQAAXAAAkQAArAAAdgAApgAAHgAA8gAA/gAA6gAA8wAAFwAAHQAAhgAArgAAnQAANAAASAAA7gAAlQAAJgAA+AAA8AAANwAAJAAAHAAANgAAkAAAKQAAoQAAzAAABgAAFAAATAAAeAAAAQAADgAAggAA6wAAEQAAfQAAVAAA9QAAIAAADQAAEgAAVgAA5gAAQAAABAAA1wAA+QAAUHExBAAAJDlJREFUeJwlevk/lPv7/2XtOrKNsWcbzGCMJSmSpSxJZtQkjPEOg5mxRWns+xpZyr5ECGmcLIOsdVK2oyJbcVI0J8fp/Bff2+d7/+BhPO6Z1+u+ruf1XF4GAEAGZOXkFRQBTiD+dgKVTiqrqKqpq5M0ZMmaWtoAOrp6+qcMDMFIzdiEYmpmbqJBpVlYWtFJitYMG1sbFTskLvvTDmcQHM+ec3ImXp13uYCubvB/l7sHkC9eAk8jcy9Eb5/LvldQzQ+v+jsw1ZAlfwYDAK5dZ98IvIlBwXRNXVYIJ9TpLJUb9j9LvBVOj4jkRVGj/Y1i8AwiH09eEwhjMU4uXtsiAWLlqInMcLh+28okKRnuhNy945lic0+Uqu7NdErDdB/5DBo7MwuE4J+dw8jIzcsvwEIUFFGEisWQm1ACpcZlxF7vl1c8YMCJyqrqGio+fFRbVw8NjU2uec0isNWhVuq2XMPzmjcRBVHhSWCtXaPR2mZoybHzL0TUfmxPabeR6yg/+6QTY83VQNOkSwkbumsgkgzwtKe8tDdHYM7ts3sW1Q/Pn3PEWaGmYjoje+B3ewx9bM4V0LNfDB5XL3/o5v1hSBi5fzvQkQESOkQOwiiwI++5YBdkDjFIrKEx3cZK4Ti8eAlZpjcnYMSHKG0ygKKVeFSLRpOZNL9p19Ku1Q9enKlp45lZiQGr7hlWS17RKWp03mv8481cQnwBUNTAXwIUeAvsJwCCTnV4FyJC9CrKYDnOT91DpRZSG8Bsn7pAw2Ihd7Hn7R0hynXezjQcvQTyMGgUjV12kiW75XaR7Z9OK9kD0/j6ckfyk/fcPHCkvkz48NG/r3p4FeRpoQa9JA74sJAOcLubirEPqXqTpZ1hNzUN5exoNVbk5RmSOQqcJix5yWvvRZZ9nyay+tqAsb6U76oAwo3wgXvJkK6sCpOYQBTIdT6cg92rSxWh16pdV2c8NnDzfQhveqvND4k6aAB0ssWnHuL2yZQ7AHLzJTgUrreyZeWewhawpw1RMDWYHLP1OcNQgKzwlKVP5JV5crB7cZ+NRJ6AB3wx/x3RsEufEkozLu+g7+zkekfLbFQo8byEubp5ld7Ot2CQKxJ7qguZxF4SB3ozQF2pCEIbcaFxg6eAr0/MbeHb1DCK+vQCA3j4YTcwjNiWyEgcq1dRlfnXsq31K3hhhvNX/CYM0JC+asxk91d+7ahTr6AAaTAn3U2lTBfjIc1pr5VEX94yw8uIZhWQVAHQj66iLErxDLqNmN0wuO9hYf6FN+boQb1FjENYJAiWKrru2ejWzoZX6M9A91p2Sw1TTRT/rdDQsyiOT1f6br4fKm6Fpeb9qocNfvYOLPAuczuA5BTbeVT2O/ghlkYEScGHX0Df3StfyMT4iYHCTEQTLj04iWePVx6aomPYGLc08OXB+drJLqoq42/wXqB5eagtaqR+ZAPsymG8utBxt1rO8zFTPHITA50gCMQ4Gw7tQBZFo0DBsWb5ExlyKoBbvRAO7jdv6U8jMYne4Y+iWXmg53gvbNYsGg+gU3elEnaeXB/ufFUKJiyZdNZemo10NviBxr65KE1k/Rijg8KTan5647eoiJQAYPIL+9fuHPb/VSMucg/bcJHzKt557SPRYF8voq1+2SIWmSgQCZo2ZjhlymMigEZdZQ3MzX6wmmMTECwNWieLpWDlKihSZ2sVVwNX9AmecOXtMHP7C/WwPzvKbZqiJIYFZ7PuZngFJmNi9YatOLLQU77vGbS6PzGdsQVn/Ad7nQyALeZVbm01GA72t5bvR/aWTWVIIEVDwDJanzjqAc8QuFl4Yr9/2WTdPVPmHCtY7ZEZ4mJoDqURsbWcaHwtmIqJWrIXshpck5ilsHlYM34YFFXTG3dGzKrDMBxB8gsDn7G3bW/TDpe51ALDmy5KQW8lUgg4guspE7TN7wCTbFWnf7gBB16vuHtYoXsWo14j1cD9/Z+oyj5GF95jqI9KG0s6YtJ0N0jtISrVAZQcIO251QuKrBIaH7k2hLK/Mw8pyNmCnott3tGm6XjT9DsZUps7H8DCHwjc731hFRtTaF2UQ572Ca4Qp/On0RVdmFD0A219YL4DcFBN/lnfBvNr12E0W2MSZatepyNLVIbbFIg7jaYfoR/4W1VUKqL6zsF4NpNiq4orZEhCEjExd7AQ2j+B6GMOPmekeA7+DsM0IAsIqj31xrtAzvWqBsjmIWC6+uBONItM9R+HA8rGHxptX9JAF/G0L6QEiy3McdFEhp4+YNA0FHNwnW0/RFFEtwHRb/hwQsbzX/heYihsB6nNVJssfHnqQe/acYKMv8LqcRe7aEF7Y6ugtWxKLILeNmlzVF277PqxIg8dSxpo5gsaMBFxfgwvdWBhOvzOHHHzx4JUHLNpyc8LUzkLcfiIv3A2jQxpeQ1iL4IKUJ1dTmigtKLpgi6QjX2d8ISbHl1B8bH0UEbnI2DMVm5h4+6Ko+kTd3VVSVPGkpp4/p+BW7/faCjBhlD7MoDqRpcOJxz6lBe8gWYtBP80qaKf86k0FP9L1ziS+Y1m8MPaWpcD8BXkG2flILIvKvoC/hr8upkS1N2pwbQD5NtZmC6iNb2JUVJTRDoZxTXibAjQDp3w/y5Bhld8zynk7OU1S3S3LPnJLvjhzcfUaKeYeJwtkmPDDbYpWt0gTaf8e/gL32vUwV1i7lHVD65CN0n+CySLiHLZfbSx/XYollUUj09xeL/Cjqg2DUp2eM7igsEZPyXlnve63tfjYjZSbBwtUf7mlAhvX0N/CzxFIKE25lol9uEzuf4B95AK6EAVtXBSn3XGA6bVuISAxQuuFKTClSg4xz/VEivy43BYA1UY4x7aSd/i1RMdwdgzi68x0JEYIfLBbEMag6Kcur0R3WGGtXvT2744+WPE4QaWz1rrbq5fEmwQTMwOLPRNs2jAJiPTPpAjXA48lyGNDo/aEnNyEv39YQtTIKcLY2gVw/SWl2eGCgmvgRKcowIU96xWM6PvyJhk/4dRHbP4A2JaG+uq0xb1J15Gaa++VgngHKhh3L3grVzTsa95kyjw3wgZLYViuASK6smRQA8Ds39GAisCnrN+wiGik1BsIZfpFhk9aVvJNr+pUWJbSmxoOAqRzseBsHsCPJ+9EvFA6HLDuymPuB3VbLuUAeRzs5AnmhdV52drj6JdA/9JE6GEWqDZIrYYlrYCDM7hLcefRsAoFiZc4P3tYx5qFsH9ttFzAL0L/lgSwvjbS4Hlik7xGLuSVfejKzFhvtnHF3039B8VGq1UCpg4+cLt0KMDi46N3M5F9YWHiD/InKc21mDdj2pCGZNgqLihu2j14oFnH9dxycOd1FsVBZ+cMEBkuu0U7wwPJEfc9SWATH9MuG0EvfyJPxuf9enmuy3ipIOtB/Tq8fRSfpzQFs03/H+7yBgpxgsOgaPD69B90NfAH5SMhqmB4xns1ARtQlmao4VcBTRTDeuo6wPwzlIp/AQcGagk6KNOsPIQxV8P+wi/EIUDDVLWFGWvjTzIZnkLRH1UoJhWpXMTjPAjt3UAX17p6WGAJwxrWKi26AC0+gNR2jzhlwfEJrgvQCombOyaY8/bLwB9fMvueMLQvWNkBKGC0lq0Ht3KzP5jCcE4StVpESb3tdp2iHeZtLDMQ26rGa6n0GpULC4tIz4jBBxadsL3wHdFQPwahEAq1xR5rwJkcKwXQrx0f6F7awZw4fPbGa1gUiXJVpYOUgng1Il6/kdwHeGfQlS+PdZEZ/WbBBOmQjvC0LG6wpXRfApSSh5UP+GjCtGd2HwGkHtuvHkJDGvpqBlcXLXap5CKR9eJRzlgZ8W4zK891g7/yQl4SpDRz5B6E6FEUxFv8K/4i/p8Hn1DOZxLx2FQHi3X/cwgM0LCK+TZnTMszAMO3JUIXyO6zOQNiThG4OXOrwJNCE8XwV95JJ175KWLydZwJE882VhaOGyWMiSKcP771g4kaYKUFB2Dmz0JUdUk75Pplh8T7VBZwUY90zTpUDwWxIJNQ4p3+oSPgHVcJUQVskdpHklpVCunu2AMvq7HI2HuekbnizilxbZeVzVwQLUBT133fJUvswkKMu+OHgCDmIJX9+b8TDTiXIyTQUrXPXFm5NsIOF7X6snH0GkbLAqxPlJ9ecWoX5Ywy8Vl/GgAlgE21JAfp4T0F8NwItrDq/BXLuXDsET46eLTOOKK5svMyhZ3Ah1ePwHOvYdijiwWbAEJnbIP5V95SOcbXM43qIJm+5G32UABbhvaNNvRffVynh4jmDDQ3V+XtC1dHWnr5PFwd9Ds2UdVaIEHmECBo9V1OAz0w9Q7ZONc7xXtF+8+ETCmmX+G7+2+flmEDTEww2Dr5eQAbJggPltoLQ9vmismCRLQYIvSsXqDWOIS85DgRSlAhWjGdOxACJXNVdyGoSxA1lu2eETiYQrdn23iL9SxSRCa5LgEX0CruBRSxHIQWrdV/mq5qOUyNgs9QUYv+xsmlhwRichkxSqZko2RwH46USV7CUofNLnT23rewuaB+3Y+8g82zzjibgmdChhbQRFk34o/zPECaRHy7wKj5wlFDE8H30Jva81PwVlVT/UNLeH5C/T9cIDrBy3capubs5y2F7ATbAwpRvThn7BsaBvwbu0BBMDxHEtAsSE3DVOdF+kWWcXsfX3AFYeWSbrZP/TS/H80MGryotBYxj1U8rWXomZeevT+aQ0crFNLeulQLpiCr0J3rB5jTS3MR+wbSYRJirC2/5eEGCMHpzOUFWEplMsWaW0SVaCL8y8rZVI4hiy4qyEC7CW0YwNHTGLxvJ2vW6GNMctZQNF8YFxN+y/di6ENOZNtphmlCkIZsU3uvDqzlidm8vQCrkUfzYk6D4AYr6tk+mccy/i8xBKFQzibM/wWTIysZ6cDt/XhySBb1niUMBJRN+ILdWbj7Z6dnUgLZELPYXWeyXNhzV48NvUbAWzWEC0lD8PwVIGTt6rveS3h3gX3XiVRg1O5poRFvgPCL17nEx324dKJT5AC5OU7RFWXuEp0U1v+MRgY7mxikdoB4lle086YyXrr61aA8eVem+VOaY1TKn/sOxOeRhIcR4AZLNrygau7faIG/T/vTPO010Kbci6K9mAYPE3+D/Q/02VDHhOfPxxTud5MF+8KsrdY8Bw4TELjh26cdDiBfCo2ptEyDRsJrRk1KZcvgta3ckuK5CRPn7AxcptUHMpozoAU68b9ElVYL1uhaVz7RTJwRJ15W+0X8HZs7gUMi9wPAEik099Y6ilYhW7j1KNLmlFXlRwAb+NvU+PbN1AfHY1t+/sN4J1JVfn7FDYLloP1Scsg9GA3s2b6XMPgHYNbve6n3ghsmK0WGyzvNrCU7t0veADh7RGOKA7vXwYQc0uuPZMJMUQMLbBdz+2kFzkStJJNFEvH/f/cT1wnXJfsflkfnn+qJe89nGfU5c6Fpsd3vp8y31fD+eHg8uZSYXdwqcoBT9DS0aTRKoaZrdSqk0KtkFZb4+BBqXAnpKdyVLXBuP5clrK5wxSYyIWrghPCaNnLhJkp/A3x8fsMgMczROQeBhpGULvpU+ZNQqKLZQMr2c5uvEvEMHOemnBn5rN1M88Y+/TkhOxUIBP/2P2jr1+oIelfW2KEQFOnrjfGzrGWUsS6YsjIBTxTDwc64bw+fGhfW5AnvnpxLYAJDBm2lJ6rvaNZZMrsfTANYByHtYSbJahyNwhmaepqjdIPb+zS9jVAgfRHPZEjU1Gd3rhA/5cI2/I7HkyV/yE2rhd7VLRC+6h3nRnBwqHqGw2HNB46i9yPFIYrAbBjbP8Xiw3DuyzbyCf9d4TVDRcSKQussrgoejwBiAjYwZi0qcQK8KuYyotDvMBHuWgDgNhVUXyHsaOlkxmK4H0+NoRd5BhMX9v+E0DX3JzZF4fOt9EZhbDdj5dngkuAUBvofWKvSxgvWN/JXhGtuib/SxfY8KRQCXuP9M9m4RKN/YNl9WjkI76xL/vI3tkUW8UwNyBJ97wf3vZkr8zgZWjt09M51pPhhhhIa5n7iOjQUKxcVfAILZl0T4jc7FxaD1109JL9Ca0sSBbrEuNCQcFBiIv+SZSJPYe/1EYItPw54SrCk2fKxMmvjDJ19ORWT937dR9t2yrEWeJCbBTuaVFvARwhlXYkVrmPmMoeHL//5uHAvRj2Y8axOXO33AUsW/qXsBWn9CxkKIYN1C7xCb9tfTfE+3+m+utf4yM6L/i+ic02U8cQ2F98GKWj7KuD2pLDXkPCLCOzaCvJfwOemmSw+9kphfUY4yI+yj5/MmQxX+dJTNMaPNhkZY4Wbc3tEQKBn08wseAkoa6qqIQUIOD3kPmDGdgoM1ToC4KklkiDUBk4Uk/Fidp8zCJcFBMgHj+etTxbRFeHvwhf80CiSt3z3DIFYl6k1lWLVvRBn0lpMVKj6PITC0tar9jbVAPhHP8k4rhblOqCcOdqrAPy67Z1WL4TfMfVx0GLrHQJyH8iQUus8lkFKuv5kcYrNvW13YfKuZ89ORAmC15BmyKxBFilYKq8dxQRWdqGLLb8Rij6WrIs7/mxVyFptbrarK6uDO1v3yxzOWQjtaz2W/01pTvN/Omyfx8D2VGPK80olW8HfnliYW8J7UjIcIlewB+DJW6whrBEqHlPOAQ8W/xs1Hn5GmuasOM+K9M5T9RYI+PMwnvMsCTG6r+dbVXfMESA2YjneGLq0D1CQv4w2JrzNXBsshiH+QHHQa2Mr/AZ4I3FCYwSF30Bqgti3TOnZKmjAfxUANcv/0JqQQ2HHnOhMOwJodHns6/25Jg743Q1lQ+KbmEPuPq51Bt83snYTH17IxKtNv2roT2epeJDTPX4a0X9SZHNHJqSie0RtRDgKb5JGNRAJr4h2aypQVI68DWseD13hXjPfFQtgcpsWw3+bHWbYNMQ5bN4cjo9d8aBirB8/oJdnePZQoxNeCAZZbotwjOCA0wROeUdcuZjnmA4UdjXjcB5b5xb9AZYmwdFSH2DdhvscW5z5QnIMnYTFRngKajbkSdjvvVyWw6LwIJWxlYhshBPGlg4xDUFZOFLf2UlA4MUe8DA8TIea+IX2smNzuP0vmleE8ArQR+UsNqTqekrljgz0+vhX5+FaB5qs3t9J5cPuwScX+MPS/UkluQXNh5WrJFM9p4CGban0P71P43YKxglb2X+cyKQ94h/diX4v9RaCpnBsnLBEiBNo/0idpiYrznuGrJbXrCBGfcS8UOZNOTvW4hnUTwJkuVcBHodNx3R8t5LtTDmf9/EmsNByWOE4XyHplSzut+ilAlOYAW6FAoMlRP17j9CYvp40MImU7d5GfS2Drx+GW3yciuygcSeJPwW0wzd8Jx7iITtZPchNXC6aPAtKQrB2xa8z53r/+NXr2nhyLPFySAhSY0IYOQBgKT6h3kSWUhtwoeuSh11H23xn6OOue1lRwSZFtnWn9cdSaaEGqWp9dYsa7+ChyZcubQzxJjXzXLk9h89vBXfZGDIlvpsP4QIbmPMjqxhqsBfefv19nkI6ATGqFQsHNSKV1bi5RDhNzYOR3Ckunra8gfjADKT/ll0bAtT+Gyj2d7NLfv1oX/s3Dxbwcs6upK916xmn4Cn9qoUPECeybc02KdxfxGRB0zT8l0Zikliu1neuQQ0TmnzytBG1jCdcA7AUAfwLbEnAjIqNRI/tr3AS3HHzaJJ1AVHLTuHM72nkWqYVDDf+j66wmI+h8Lmvxl4OGEXnX3JOrwBz08R7ELtwHigs810rOj0viiWN/+sC7Ni5oBKQ6bZk8eHN3PYLZzQgVjEb5jNex3lMrEC0EzpQ3faNx4xd523exujDDnuf5ZP5S7v7/UuKqkqW2X94NfxXy7549ho3WWi6n1Vt7ABUIeJc5cdqWkRZrf4aNACabeODzxEINKtnW6CGh5734US98i9pjARiQfrdT+ax6iuaQ68hRSbykUQcJUr4DoFBkm4wgd2hq4tBIt5iGqkmIYjIK97X2Ac+y7Al6Eas2r5VF3EkYVixIGsqzlkm0RXA05xqwaznFZjzk8V80Y+iIDhMyNdfSpEMp3IheR2cbKGSnSfWK1HK5rU73te+Y+mp46Jt6oD3xe3/MKUzoD2UBzNmu3iQW2uCJHd2ne9t/x3h7lnn4kBxCEAK//UgVlyjyz9W5JHgDWu3g3OlGHBZO/680MjgZCrLsuOfLU+5jPl2Pxck02uqzyqmPlhPA0isbdnhRis6Qh/S179zV226tq30IMf1KqJ+bHgSCHhjM64dbIL8GGt21vGOEXP+/AJcER6NjIb286TKSzTCCidNp6Zf3rpsWZnG5dNhuEqU94Fd2sYHaDOgM3A3LO9nxQazFRTOJsT7cD4eScDOsG8UfQGqlmCqM7L0/3ZpnWylRSPqBu/B+eHEfYNZO+0QTaWrYVbLURYIK4TWR8iESRGfHHQWgthnGCFSR6XhpDR2Xtq0uhr2QQvOUVv8Giw6ImYIgOdd8OPo1dxm1hQCQV84zTzso6krY75wTfRjcwV5Geb/tJ4owfFd8kC7FDPX9B9mBYVZ0zuK21vYoVpvazdgKlwKfwFKZSgPgFfDQtTRYNOvy6JNZ7OeYCWEFJq/hygT5KPD9mIbenEBsAvHdzCG/K5iPb4S4aP/YhnMDJHIP/icNM6ztIK9gkRRdA71nyoMef+2jb3neklwx0pHH2SIdKb2jwOWG3JCmYK4Iva+7eEG0a3If9Da4KaFAGMYlTTCfFBFSoyK7YMSwyuICgV8M49c7bf4VqtKi5LOaLKCJlVZ5zBpLrIr9LvsMNctO/oiM3ab/MknNJPPbnirNLPbGflQrRr2aJJYXg/QIsh8k1PXzz+z9w5gIxiXea4P0RlO2OUDqhJdvv8EBpRLy6Z9p8GR+FFKgDHcGsMkkbMnJz0q7hAhDVdF3sCfBM6hj2P4SlE5njIsBmSky6FhkNYd2UfgLt37a35+BEvupCA+Jh5kmC5dWaGeQNmz35EEQvhwZG3qxKo/RZr66hM7IJ5Won7gh78anK172Zt3buKAMKyMDjzdR9ufcCZ0zU4DOA5RKIgkAMTbytB3LQFlT5MH/An6qfRJPjj2dg5WFP3mdlZkwFePrA+3eN2Wu0A+WAFKZrztzJRibcqCweEddxU/PSGWxOnjHtOUDzfDk9lEvDDj39cFH1E9dVeQLGVI3Qgeo0M34dZ6K/3cb9BBZcZf8uS+BivagqBuLW31L60FMADuX1jiTur3n1ZrBrIgpkFO//0OmyT9qWthHcnwzLRswTdDbgUflRNCAvfaODDSX8vQLo7QBDltK42Y/OdFbS1zUYFLv6qSiV43zDiUrcAtbEqoMVBPa37+RMTuT1gmrJVH1qqYsi12cyakNWPLrTGqg9NO1KY2vPwISkCnxobu6FodJWlXUwABhb1LwveepTps6Tt0E8j+tabfLiI+MdLLWSxLqA1cJON1hz8aZkisUWXUMhNOQpLrIR062CCV3Bg0ZwlU9OhbKefT1NjDog/g2q+TAW89zQllayE0d/y9qAdSAucb3iKOXZYzSSmdealQNS1IL3qMUpowYU6uuO7LEqyPD05MgXvXy6frzzrkpBXlAx+J30gur7J4OT/ziwA3fvIcKvLAHet4sqms0BCkZk6CKbyRPu8Xqwsv5KGfYcI4thniGI9nFwFwt1bfZm9racBom20+/R8n0upa1EAueM5b9A7lN3BE9empZqOTj5NkKNeCf630MV2jeKeEP8cImJ5W9l3gYGDg1wPxxZcmBvsZ4qZXUMim6a/M2jKAsHtYvPN1A0FsH3AAbpFvCxA200RpdN9ME2nSQL2g5pg9OIw6KkYT3gKe7QmWrItoXK1c/XBbJQ6pVOca2BzfQfoOCTygsFljpEPDG+tBLrte+jUDP2DcYKLisBjhgtTZnAmgmg8/Aus/awVIZGqScBZ1xa/82qG7rzT0BDLldEs0sP5HS8oNhU3lhDue5NS0TUt0T7YTZvSGH0HEYEs97dJ7xpNO1TKokYmLWenco4PvNEsv2hQ85pcgDjlA29jwVT9IoAcXQGCnhPG8fgYyhJ64NNzBiWf5p1XdoBx+xtXoPiVbK44FcHipEqTaar9/ruKsdneZuJmevOHPOjhmtvwVVX8Nmx+/eftj7gZmxlF3ocI/n5T0byPxzPfMi24AxSQeAGjdI3Q4hc5ffAT7v7F89ZNEgj6fheuHl2hjRQlG4EMMwpiAnsm1HT499a+zKPMejH0uAfnT4JyItDTiDQ4l5DoO/sQZ0HkzGpiM8KQNwaHk0Un9WaO+yuA1ZTV9z8Jm13bqwTlfNHncIi8M/kHQMFhMF7Imo2mUw/Sox7Bh3W6UplqvEiy+g2NvVzFPCtGkHSTLuFSL2CtGzpPY+E5O0PK3HSbUnBzNBZodkNnUAlch2Zk9/9F8JuAYBirgoVpE7QyheJ33WDOysDFYMSXBdm20XfXCWcGzsGyvXE8FJN7EadsGjIDzZ+GtIUEBWuQ6o87kaDvo4eplYs4dz6P06lSSCA0yAvpXKD1djjC8dnWdYtWsLpl4Fplhje74Y6i/M7VMSQnRvD54/CC4LPzx4vghhIOzVo6bLzl7QIHPvVyM/drqBBZ3tW1lYqvXfauRfH5WHe+RcHI+xxeqDECqJ9tdXLyy9L7RqxyUaZKwmlAux+zEzdzITSRlr36YuSm0LBhTpkivodWytR6BNULFxftqF42QqKLmoog9WlYNRb4GtNm93bHuxBvV5VcOUeY6N/9xDutwbqYhaN3rIzpg1M6XfrYctTdA5Msr2v4Aydmb+Nl2/Eqw+jSXYvctmuDHYUAei0pUc6E5N1bULPEjHAr+HI3gwDjpDg0nE2fMkXneCumq9ifZR5IKUOqn0aDIfN64olrhaHfV4msozkdG/3j5HHqsf5Els8kwvDrCaK4/BXb+YzYC00mJEOu8njPsKgB9dG+FjqqeToCsJKLTvHS+iQTnqFquCJ+yCckuDaHLnP4GzroGg7BelrYZWStEFay3j+vkEuXHy3B2zG5xBqSx+/pxoEOv+OfiCfq5QMCCNq26xXC+1DZ+eQdH2jJ9FXSh9yrISZTk56jTzMIzG9+Ye+pumQffxmh2lcvPXjmNWL3PoOgRpkx4o/TZzE2y3IMtEZNxpNUlBqFlnBVXuPS0TIBkF+ZfvW3y2bGWD14zb8Cju5+wiSW1pIIRRtD0DeaxOLIvup5BZ2R2QfQVx6ryHH4H/rls/fRJy6KIdsJ/qVsWrBZaKgKOhP0GOUjA16wS+vlpcmot72SIWJWQDwyiD04TLSU6LyObtnOC2W5QA0OCGXHtlTi9Cyh95AIL8UU6AaQOaDSDfuf3DbxO4065WUdqPZ6Zj9S26jGlhDs/3mX1c4h+to5J2UwvgO3dkFtmKMBF3OuQvskMsOO8R5FnXblT4zMUpkjhs3m1ygag6zQWKfFOQCFM8jmAFtaCpCqDX77xqhE3B99uGU3UT+41SufAp9fQENvgk5lwqneywazIE9IpGT8v23sBPibAHG34mLWiivxnjk8p2S5ofshihnLQd4CU5ABpVcMX/5Hg39Jm55k+hgxugBCGIR5KmY+qz6US5/wKYimBbjTOSBlyD9OiYpWxtoLH6PcoaUdK0dW4vKR121dfMwumvgSBf8g0fsVN0w8jbplh7Df1FVC9wZuTbZStSswGJu6IngHRvBgOFag8F3hwPVNuUYjxNngNURuMvnnOvway+3l+1sK7aILbzdSzAxUCtG9/CaaHsBFIVzMWEH7upNL6Hr6P+oI4i+VqT6NyQrYUMkRXYd2P1ZjEMDaJ1rrurxTBgTfMw9cZe8SHIAz0JA7jpgDmr+InVbg0HrkFNZVhQ2uBKn75tLEZwfMp2azBhkglsAXDPx2BccwTDGmnsjRDh2jHh9ynTQY4vLqcuv/NWRlP8sFHWyxSmm38ikF1UoTywoZL0oFE4I4ujqIcvCuo+0ABPohIMdyq8EqgTcogXcYNCGdgvytDCA/fwt2eG78+OAANOgmKkOI8WdjE3FaFdqW6rx/oOBunJoqMLOwnPtv67Cw7PY8c4jFvek2G/hk1Thivu5Pf2iV8YDA8DyziBPz6MKlF9XQlRt7ZRV09nZrygwo00ME7IpFuOiEsUrd14UcCvNC/DPkbFmqB1uQIg477mFiq2niVADUYnvdjiQPNpFfMTo4yg4X+tDW3rmH2WE9E2rY0ES40wM6QRwaQL5/fepJULkj3Zc6L1ItuWmO6zXbvou399GBCPcQwB2+rRpubsw03qWL2iRyHH9Afl/YHuFYa8v7zEXDEigXJo9RAtTM4BTzElQhSgePv55AmHTo4W9v4SmkPDlLIhOpcXBK4GO2AnyzeN0MaKP7umX9bZAfc5LA84bxj3frYCxezbP9KG7QeJzevIhiAU4p/j+y2OyMV2mxNgAAAABJRU5ErkJggg==",Iy=n(127),Cy=n.n(Iy),Ny=n(128),ky=n.n(Ny),Dy=n(129),Py=n.n(Dy),Oy=n(130),Ry=n.n(Oy),Ly=n(131),jy=n.n(Ly),By=n(132),Uy=n.n(By),Fy=n(133),zy=n.n(Fy),Gy=n(134),Hy=n.n(Gy),Vy=n(135),Wy=n.n(Vy),Yy={wipe:function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n);var i=1;return"up"===e?i=1:"down"===e?i=2:"left"===e?i=3:"right"===e&&(i=4),(r=t.call(this,my.a,py.a,{percent:0,direction:1,transition:0})).uniforms.direction=i,r}return n}(dy),fade:function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n);var i=1;return"out"===e?i=-1:"in"===e&&(i=1),(r=t.call(this,void 0,yy.a,{percent:0,transition:1})).uniforms.transition=Math.pow(i,i),r}return n}(dy),blinds:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,xy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,r}return n}(dy),checkerboard:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,My.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="down"===e?1:0,r}return n}(dy),dissolve:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Ey.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).setTextTure(),r}return T(n,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=Xl.t.from(Ay)}}]),n}(dy),randombar:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Cy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,r.setTextTure(),r}return T(n,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=Xl.t.from(Ay)}}]),n}(dy),circle:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,ky.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(dy),box:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Py.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(dy),diamond:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Ry.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(dy),plus:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,jy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(dy),barn:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Uy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="inHorizontal"===e?1:"outHorizontal"===e?2:"outVertical"===e?3:0,r}return n}(dy),strips:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,zy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="upLeft"===e?1:"downRight"===e?2:"upRight"===e?3:0,r}return n}(dy),wedge:function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,wy.a,Hy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}return n}(dy),wheel:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Wy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option=Number(e)||1,r}return n}(dy)},Xy=function(e){p(n,e);var t=m(n);function n(e){var r,i;_(this,n),(r=t.call(this,e)).filterType="",r.isConflict=!1,r.activeWhenConflict="prev",r.onTimeUpdate=function(e){var t,n=e.duration,i=e.delta/n;if(r.filter){r.filter.percent=r.commonTimeNode.applyTimeFilter(i);var o=null===(t=r.timingTarget)||void 0===t?void 0:t.container.getBounds();o&&(r.filter.uniforms.uBoundRect=new Float32Array([o.x,o.y,o.width,o.height]))}i>=1&&r.timingTarget&&r.ctx.clock.setTimeout((function(){r.removeFilter()}),34)},r.onSeekToStart=function(){r.timingTarget&&r.removeFilter()},r.onSeekToEnd=function(){r.timingTarget&&r.removeFilter()},r.onDestroy=function(){r.removeFilter()},r.commonTimeNode.on("timelineStart",(function(){r.filter&&r.timingTarget&&(r.timingTarget.container.filters&&0!==r.timingTarget.container.filters.length?r.timingTarget.container.filters.push(r.filter):r.timingTarget.container.filters=[r.filter])})),r.commonTimeNode.on("timeNodeDestroy",r.onDestroy),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate);var o=1;"out"===e.json.transition&&(o=-1);var a=null===(i=e.json.filter)||void 0===i?void 0:i.match(/^([a-zA-Z]+)(\((.+)\))?/);if(a){var s=a[1],u=a[3];Yy[s]&&(r.filter=new Yy[s](u),r.filterType="".concat(s,"-").concat(u),r.filter&&(r.filter.transition=o))}return r}return T(n,[{key:"removeFilter",value:function(){var e,t=this;if((null===(e=this.timingTarget)||void 0===e?void 0:e.container.filters)&&this.filter){var n=this.timingTarget.container.filters.findIndex((function(e){return e===t.filter}));n>=0&&this.timingTarget.container.filters.splice(n,1)}}},{key:"modifyAttrKey",get:function(){return this.filterType}}]),n}(ry),Qy=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!0,r.activeWhenConflict="next",r.startPos=null,r.onTimeNodeStart=function(){var e,t;r.startPos={x:(null===(e=r.timingTarget)||void 0===e?void 0:e.ppt_x)||0,y:(null===(t=r.timingTarget)||void 0===t?void 0:t.ppt_y)||0}},r.onTimeUpdate=function(e){var t,n=e.duration,i=e.delta/n,o=null===(t=r.path)||void 0===t?void 0:t.getPoint(i);r.timingTarget&&o&&(r.timingTarget.ppt_x=o.x+r.timingTarget.design_ppt_x,r.timingTarget.ppt_y=o.y+ +r.timingTarget.design_ppt_y)},r.onSeekToStart=function(){r.timingTarget&&r.startPos&&(r.timingTarget.ppt_x=r.startPos.x,r.timingTarget.ppt_y=r.startPos.y)},r.onSeekToEnd=function(){var e,t,n,i=null!==(t=null===(e=r.commonTimeNode.json)||void 0===e?void 0:e.spd)&&void 0!==t?t:1,o=null===(n=r.path)||void 0===n?void 0:n.getPoint(i>0?1:0);r.timingTarget&&o&&(r.timingTarget.ppt_x=o.x+r.timingTarget.design_ppt_x,r.timingTarget.ppt_y=o.y+r.timingTarget.design_ppt_y)},r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeDestroy",r.onSeekToStart),r.createPath(),r}return T(n,[{key:"createPath",value:function(){var e,t,n=new os,r=null===(e=this.json.path)||void 0===e?void 0:e.match(/[MLCmlc][^MLCmlc]+/g);if(r){var i,o=S(r);try{for(o.s();!(i=o.n()).done;){var a=i.value.trim().replace(/\s+/g," ").split(" "),u=d(t=a)||s(t)||E(t)||h(),l=u[0],f=u.slice(1);if("M"===l){var p=c(f.map((function(e){return Number(e)})),2),v=p[0],m=p[1];n.moveTo(v,m)}else if("L"===l){var g=c(f.map((function(e){return Number(e)})),2),y=g[0],b=g[1];n.lineTo(y,b)}else if("C"===l){var x=c(f.map((function(e){return Number(e)})),6),_=x[0],w=x[1],T=x[2],M=x[3],A=x[4],I=x[5];n.bezierCurveTo(_,w,T,M,A,I)}else if("Z"===l)n.closePath();else if("E"===l)console.warn("not implements");else if("c"===l){var C=c(f.map((function(e){return Number(e)})),6),N=C[0],k=C[1],D=C[2],P=C[3],O=C[4],R=C[5],L=n.currentPoint;n.bezierCurveTo(N+L.x,k+L.y,D+L.x,P+L.y,O+L.x,R+L.y)}else if("l"===l){var j=n.currentPoint,B=c(f.map((function(e){return Number(e)})),2),U=B[0],F=B[1];n.lineTo(U+j.x,F+j.y)}else if("m"===l){var z=n.currentPoint,G=c(f.map((function(e){return Number(e)})),2),H=G[0],V=G[1];n.moveTo(H+z.x,V+z.y)}}}catch(e){o.e(e)}finally{o.f()}}this.path=n}},{key:"modifyAttrKey",get:function(){return"motion"}}]),n}(ry),Zy=function(e){p(n,e);var t=m(n);function n(e){var r,i;return _(this,n),(r=t.call(this,e)).isConflict=!0,r.activeWhenConflict="next",r.startVal=null,r.createVal=null,r.onTimelineStart=function(e){e.isReverse||r.updateCurrentValue()},r.onTimeUpdate=function(e){var t,n,i,o,a,s=e.duration,u=e.delta/s,l={x:1,y:1};if(r.to){var c=null!==(t=r.from)&&void 0!==t?t:{x:null!==(i=null===(n=r.startVal)||void 0===n?void 0:n.x)&&void 0!==i?i:1,y:null!==(a=null===(o=r.startVal)||void 0===o?void 0:o.y)&&void 0!==a?a:1};l.x=c.x+(r.to.x-c.x)*u,l.y=c.y+(r.to.y-c.y)*u}else if(r.by){var h={x:r.by.x,y:r.by.y};l.x=1+(h.x-1)*u,l.y=1+(h.y-1)*u}r.timingTarget&&(r.timingTarget.scale=l)},r.onTimeNodeStart=function(){r.timingTarget&&(r.startVal={x:r.timingTarget.scale.x,y:r.timingTarget.scale.y})},r.onSeekToStart=function(){r.timingTarget&&r.startVal&&(r.timingTarget.scale=r.startVal)},r.onSeekToEnd=function(){r.onTimeUpdate({duration:1,delta:1,isReverse:!1})},r.onDestroy=function(){null!==r.createVal&&r.timingTarget&&(r.timingTarget.scale=r.createVal)},r.from=e.json.from,r.to=e.json.to,r.by=e.json.by,r.commonTimeNode.on("timelineStart",r.onTimelineStart),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timeNodeStart",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeDestroy",r.onSeekToStart),(null===(i=r.timingTarget)||void 0===i?void 0:i.scale.x)&&(r.createVal={x:r.timingTarget.scale.x,y:r.timingTarget.scale.y}),r}return T(n,[{key:"updateCurrentValue",value:function(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}},{key:"modifyAttrKey",get:function(){return"scale"}}]),n}(ry),qy=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!1,r.activeWhenConflict="next",r.isTimelineStart=!1,r.startColorString=null,r.currentColorString="#FFFFFFFF",r.onTimelineStart=function(e){if(!r.isTimelineStart){r.isTimelineStart=!0,e.isReverse||r.updateCurrentValue(),r.from.isInit()||r.from.fromHexString(r.currentColorString),r.to.isInit()||r.from.by(r.by,r.to);var t=c(r.json.cBhvr.attrList[0].split("."),1)[0];ty(r.timingTarget,t+".on","true")}},r.onTimeNodeEnd=function(){var e=r.json.cBhvr.attrList[0];if("remove"===r.json.cBhvr.ctn.fill){var t=c(e.split("."),1)[0];ty(r.timingTarget,t+".on","false")}r.isTimelineStart=!1},r.onSeekToStart=function(){var e,t=r.json.cBhvr.attrList[0];if(r.timingTarget){r.onTimeUpdate({duration:1,delta:0});var n="ppt_c.color"===t||"text.color"===t;if((null===(e=r.timingTarget.fill)||void 0===e?void 0:e.designColor.toUpperCase())===r.from.toHexString().toUpperCase()||n){var i=c(t.split("."),1)[0];ty(r.timingTarget,i+".on","false")}}},r.onTimeNodeStart=function(){if(r.timingTarget){var e=r.json.cBhvr.attrList[0],t=ny(r.timingTarget,e);t&&(r.startColorString=t)}},r.onTimeUpdate=function(e){var t=e.delta/e.duration;if(r.to.interpolationFrom(r.from,t,r.target),r.timingTarget){var n=r.json.cBhvr.attrList[0];ty(r.timingTarget,n,r.target.toHexString())}},r.onSeekToEnd=function(){r.isTimelineStart||r.onTimelineStart({isReverse:!1,activeCount:0,id:""}),r.onTimeUpdate({duration:1,delta:1})},r.replaceAttrToRelation(),"rgb"===r.json.clrSpc?(r.from=new Wv(r.json.from),r.to=new Wv(r.json.to),r.by=new Wv(r.json.by),r.target=new Wv):(r.from=new Vv(r.json.from),r.to=new Vv(r.json.to),r.by=new Vv(r.json.by),r.target=new Vv),r.commonTimeNode.on("timeNodeStart",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timelineStart",r.onTimelineStart),r.commonTimeNode.on("timeNodeEnd",r.onTimeNodeEnd),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timeNodeDestroy",r.onSeekToStart),r}return T(n,[{key:"replaceAttrToRelation",value:function(){var e=this.json.cBhvr.attrList[0];"ppt_c"!==e?"style.color"===e&&(this.json.cBhvr.attrList[0]="text.color"):this.json.cBhvr.attrList[0]="ppt_c.color"}},{key:"updateCurrentValue",value:function(){if(this.timingTarget){var e=this.json.cBhvr.attrList[0],t=ny(this.timingTarget,e);t&&(this.currentColorString=t)}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(ry),Jy=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!1,r.activeWhenConflict="next",r.startVal=null,r.createVal=null,r.lastVal=null,r.onTimelineStart=function(e){r.lastVal=null,e.isReverse||r.updateCurrentValue()},r.onTimeUpdate=function(e){var t=e.duration,n=e.delta/t,i=0;if(void 0!==r.from&&void 0!==r.to){var o=(i=r.from)+(r.to-i)*n;r.timingTarget&&(r.timingTarget.r=o)}else if(void 0!==r.by){r.lastVal||(r.lastVal=0);var a=r.by*n-r.lastVal;r.lastVal=r.by*n,r.timingTarget&&(r.timingTarget.r+=a)}},r.onTimeNodeCreate=function(){var e;Tv()(null===(e=r.timingTarget)||void 0===e?void 0:e.r)&&(r.createVal=r.timingTarget.r)},r.onTimeNodeStart=function(){var e;Tv()(null===(e=r.timingTarget)||void 0===e?void 0:e.r)&&(r.startVal=r.timingTarget.r)},r.onSeekToStart=function(){r.timingTarget&&null!==r.startVal&&(r.timingTarget.r=r.startVal)},r.onSeekToEnd=function(){r.onTimeUpdate({duration:1,delta:1,isReverse:!1})},r.onDestroy=function(){r.timingTarget&&null!==r.createVal&&(r.timingTarget.r=r.createVal),r.startVal=null},r.from=r.json.from,r.to=r.json.to,r.by=r.json.by,r.by?r.isConflict=!1:r.isConflict=!0,r.onTimeNodeCreate(),r.commonTimeNode.on("timeNodeStart",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timelineStart",r.onTimelineStart),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timeNodeDestroy",r.onDestroy),r}return T(n,[{key:"updateCurrentValue",value:function(){var e;this.currentVal=null===(e=this.timingTarget)||void 0===e?void 0:e.r}},{key:"modifyAttrKey",get:function(){return"rotate"}}]),n}(ry),Ky=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!1,r.activeWhenConflict="next",r.isApplied=!1,r.onTimeUpdate=function(){var e,t,n=r.json,i=n.cmd,o=n.cmdType;!r.isApplied&&i&&o&&(r.isApplied=!0,null===(t=null===(e=r.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand(i,o))},r.onSeekToStart=function(){var e,t;r.commonTimeNode.isInInteractiveSeq||null===(t=null===(e=r.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand("custom-pause","call")},r.onSeekToEnd=function(){},r.commonTimeNode.on("timeNodeStart",(function(){r.isApplied=!1})),r.commonTimeNode.on("timeNodeEnd",(function(){r.isApplied=!1})),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("seekToStart",r.onSeekToStart),r.commonTimeNode.on("seekToEnd",r.onSeekToEnd),r}return T(n,[{key:"modifyAttrKey",get:function(){var e,t,n,r;return(null!==(t=null===(e=this.json)||void 0===e?void 0:e.cmd)&&void 0!==t?t:"")+(null!==(r=null===(n=this.json)||void 0===n?void 0:n.cmdType)&&void 0!==r?r:"")}}]),n}(ry),$y=function e(t){var n=this;_(this,e),this.runtimeNodeEventHub=new Ks.a,this.onVolumeUpdate=function(e){n.audio.volume(e)},this.stopAudio=function(){n.audio.stop()},this.destroy=function(){n.stopAudio(),n.audio.destroy(),n.ctx.activeMedia.delete(n.audio),n.ctx.volumeAdjuster.off("update",n.onVolumeUpdate)};var r=t.json,i=t.isIterate,o=t.isSub,a=t.eventHub,s=t.ctx,u=t.parent,l=t.iterateType,c=t.iterateIndex,h=t.iterateId,d=t.isInInteractiveSeq,f=t.fromSeqId;this.json=r,this.id=r.cMediaNode.ctn.id,this.commonTimeNode=new tb({json:r.cMediaNode.ctn,isSub:o,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:s,parent:u,isIterate:i,iterateType:l,iterateIndex:c,iterateId:h,isInInteractiveSeq:d,fromSeqId:f});var p=r.cMediaNode.tgtEl;s.loaderDelegate&&(p=s.loaderDelegate.redirectMedia(p),s.logger.info("redirect media url from ".concat(r.cMediaNode.tgtEl," to ").concat(p," by delegate."),s.taskId)),this.audio=new Wg(p,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",(function(){n.audio.volume(s.volumeAdjuster.volume),n.audio.play()})),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s,this.ctx.volumeAdjuster.on("update",this.onVolumeUpdate)};function eb(e){return(null===(t=e)||void 0===t?void 0:t.cBhvr)?e.cBhvr.ctn:function(e){var t,n;return!!(null===(n=null===(t=e)||void 0===t?void 0:t.cMediaNode)||void 0===n?void 0:n.ctn)}(e)?e.cMediaNode.ctn:e.ctn;var t}var tb=function(e){p(n,e);var t=m(n);function n(e){var r,i,o;_(this,n),(r=t.call(this)).uuid=uv(),r.isSub=!1,r.isShadow=!1,r.startCount=0,r.applyCount=0,r.isReverse=!1,r.isConflictDispose=!1,r.isIterateEnd=!1,r.parentTimeNode=null,r.isActive=!1,r.isDestroy=!1,r.shouldSeekOnStart=!1,r.repeatTimeoutId="",r.iterateShadows=[],r.isEndEventsEmitted=!1,r.tmFilter=[],r.timeDelta=0,r.isIterate=!1,r.iterateType="el",r.iterateIndex=0,r.children=[],r.subList=[],r.duration=0,r.isNegativeSpeed=!1,r.handleEndCond=function(){r.isActive&&(r.isActive=!1,r.isInfiniteRepeat()?r.repeatTimeNodeEnd():r.seekToEnd(!1,!0))},r.handleActive=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(r.isActive=!0,r.isConflictDispose=!1,r.applyCount+=1,r.json.iterate||r.emit("timeNodeStart",{id:r.uuid,activeCount:r.applyCount,isReverse:r.isReverse}),r.startCount>0&&r.json.restart){if("never"===r.json.restart)return;"whenNotActive"!==r.json.restart&&"always"!==r.json.restart||(r.seekToStart(),r.emit("timeNodeRestart",{id:r.uuid,activeCount:r.applyCount,isReverse:r.isReverse}),r.startTimeLine(e))}else r.startTimeLine(e)},r.updateTimeLine=function(e){var t=e/(nd.b.TARGET_FPMS||.06);r.timeDelta+=t,r.duration-r.timeDelta<=t&&(r.timeDelta=r.duration),r.timeDelta0&&void 0!==arguments[0]&&arguments[0];(r.isTimeNodeEnd()||e)&&(r.isActive=!1,r.isSub&&r.destroy(),r.emitEndEvents())};var a=e.isSub,s=e.isIterate,u=e.ctx,l=e.eventHubs,c=e.parent,h=e.json,d=e.iterateType,f=e.iterateId,p=e.iterateIndex,v=e.isInInteractiveSeq,m=e.fromSeqId;r.isSub=a,r.fromSeqId=m,r.isInInteractiveSeq=v,r.isIterate=s,r.parentTimeNode=c,r.json=h,r.ctx=u,r.iterateIndex=p,r.eventHubs=l,r.iterateType=d,r.iterateId=f,r.tmFilter=null!==(o=null===(i=h.tmFilter)||void 0===i?void 0:i.split(";").map((function(e){return e.split(",").map((function(e){return parseFloat(e.trim())}))})))&&void 0!==o?o:[];var g=Number(r.json.dur),y=r.json.spd||1;if(r.isNegativeSpeed=y<0,Number.isNaN(g)||(r.duration=g/Math.abs(y)),r.uuid+="--"+r.json.id,r.setPreStyle(),h.childTnLst&&r.createChildren(h.childTnLst),r.startConds=new $g(r.json.id||"",h.stCondLst,l,r.ctx),r.endConds=new $g(r.json.id||"",h.endCondLst,l,r.ctx),h.endSync&&(r.endSync=new $g(r.json.id||"",[h.endSync],l,r.ctx),r.endSync.on("active",(function(){var e;"interactiveSeq"===r.json.nodeType&&(r.isActive=!1,r.shouldSeekOnStart=!0,r.emit("timeNodeEndSync"),null===(e=r.endSync)||void 0===e||e.reset())}))),r.startConds.on("active",(function(e){r.isActive||(r.shouldSeekOnStart&&(r.shouldSeekOnStart=!1,r.seekToStart()),r.handleActive(e))})),r.endConds.on("active",(function(){r.handleEndCond(),r.children.forEach((function(e){return e.commonTimeNode.handleEndCond()}))})),r.parentTimeNode&&r.parentTimeNode.on("timeNodeStart",(function(){r.applyCount=0})),r.isSub&&"nextClick"===r.json.masterRel){var b="shape slide onNext"+r.fromSeqId;r.startConds.addCond({event:b})}return r.json.iterate&&!1===r.isIterate&&r.createIterateShadow(),r}return T(n,[{key:"createIterateShadow",value:function(){var e=this,t=uv(),r=!0,i=0;for(this.ctx.eventHub.on("IterateTimeNodeEnd",(function n(i){i===t&&(r=!1,e.ctx.eventHub.removeListener("IterateTimeNodeEnd",n))}));r;){var o=JSON.parse(JSON.stringify(this.json)),a=new n({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:i,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId});this.iterateShadows[i]=a,i+=1}}},{key:"isInfiniteRepeat",value:function(){return this.json.repeatCount>999999998}},{key:"getReverse",value:function(){return this.isReverse}},{key:"setReverse",value:function(e){this.isReverse=e}},{key:"createTimeNode",value:function(e,t){var n=null,r={json:e,isSub:t,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId};return"seq"===e.type?n=new ey(r):"par"===e.type?n=new nb(r):"set"===e.type?n=new iy(r):"anim"===e.type?n=new hy(r):"animEffect"===e.type?n=new Xy(r):"animMotion"===e.type?n=new Qy(r):"animScale"===e.type?n=new Zy(r):"animClr"===e.type?n=new qy(r):"animRot"===e.type?n=new Jy(r):"cmd"===e.type?n=new Ky(r):"audio"===e.type&&(n=new $y(r)),n}},{key:"createSubList",value:function(e){var t=this;this.subList&&this.subList.forEach((function(e){return e.commonTimeNode.destroy()})),this.subList=[],e.forEach((function(e){var n=t.createTimeNode(e,!0);n&&t.subList.push(n)}))}},{key:"bindCommonTimeNodeEvent",value:function(e){var t=this;e.commonTimeNode.on("timeNodeStart",(function(e){t.emit("childTimeNodeStart",e)})),e.commonTimeNode.on("timeNodeEnd",(function(e){t.emit("childTimeNodeEnd",e),t.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))&&(t.json.iterate||t.allChildrenEndHandle())}))}},{key:"createChildren",value:function(e){var t=this;function n(e){return eb(e).presetOrder}function r(e){return/^slide/.test(e)?"slide":/^layout/.test(e)?"layout":/^master/.test(e)?"master":"unknow"}var i=["master","layout","slide","unknow"];e&&e[0]&&n(e[0])?a(e).sort((function(e,t){var o,a,s,u,l=eb(e).id,c=eb(t).id;if(l&&c){var h=r(l),d=r(c);return h===d?(null!==(o=n(e))&&void 0!==o?o:0)-(null!==(a=n(t))&&void 0!==a?a:0):i.indexOf(h)-i.indexOf(d)}return(null!==(s=n(e))&&void 0!==s?s:0)-(null!==(u=n(t))&&void 0!==u?u:0)})).forEach((function(e){var n=t.createTimeNode(e,!1);n&&(t.bindCommonTimeNodeEvent(n),t.children.push(n))})):e.forEach((function(e){var n=t.createTimeNode(e,!1);n&&(t.bindCommonTimeNodeEvent(n),t.children.push(n))}))}},{key:"playReverse",value:function(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach((function(e){return e.commonTimeNode.playReverse()}))}},{key:"allChildrenEndHandle",value:function(){var e=this;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((function(){e.seekToStart(!1),e.resetForRepeat(),e.startTimeNodeRepeat()})):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}},{key:"resetForRepeat",value:function(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach((function(e){return e.commonTimeNode.resetForRepeat()}))}},{key:"startSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.startTimeNode()}))}},{key:"startReverseTimeLine",value:function(){this.isEndEventsEmitted=!1,this.timeDelta=0;var e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(bb.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(bb.animateStart),this.ctx.ticker.add(this.updateTimeLine))}},{key:"startTimeLine",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit("time ".concat(this.json.id," begin")),this.eventHubs.global.emit("time ".concat(this.json.id," onBegin")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," begin"))),this.json.iterate)this.startIterate();else{this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});var n=1e3/this.ctx.ticker.maxFPS;this.duration<=n&&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((function(){e.onTimeLineEnd()}))):this.duration>n&&(this.ctx.eventHub.emit(bb.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}}},{key:"startIterate",value:function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.json.iterate){e.next=24;break}this.isIterateEnd=!1,t=S(this.iterateShadows),e.prev=3,t.s();case 5:if((n=t.n()).done){e.next=15;break}if(r=n.value,!this.isIterateEnd){e.next=9;break}return e.abrupt("break",15);case 9:return r.children.forEach((function(e){e.commonTimeNode.startTimeNode()})),r.applyCount+=1,e.next=13,this.ctx.clock.delay(this.json.iterate.interval);case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),t.e(e.t0);case 20:return e.prev=20,t.f(),e.finish(20);case 23:this.onTimeLineEnd();case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])})))}},{key:"applyTimeFilter",value:function(e){if(!this.tmFilter.every((function(e){return Tv()(e[0])&&Tv()(e[1])})))return e;for(var t=0;t0?this.tmFilter[this.tmFilter.length-1][1]:e}},{key:"isNatureTimeEnd",value:function(){return this.duration>=0&&this.timeDelta>=this.duration}},{key:"findTargets",value:function(){var e=[];return function t(n){n.forEach((function(n){var r,i,o;n.cBhvr&&n.cBhvr.target&&e.findIndex((function(e){return e.id===n.cBhvr.target.id}))<0&&e.push(n.cBhvr.target),(null===(i=null===(r=null==n?void 0:n.cBhvr)||void 0===r?void 0:r.ctn)||void 0===i?void 0:i.childTnLst)&&n.cBhvr.ctn.childTnLst.length>0&&t(n.cBhvr.ctn.childTnLst),(null===(o=null==n?void 0:n.ctn)||void 0===o?void 0:o.childTnLst)&&n.ctn.childTnLst.length>0&&t(n.ctn.childTnLst)}))}(this.json.childTnLst||[]),e}},{key:"setPreStyle",value:function(){var e=this;this.json.presetClass&&this.findTargets().forEach((function(t){if(e.json.iterate)for(var n=0,r=!0;r;){var i=e.ctx.timingTargets.getTarget(t,!0,{type:e.json.iterate.type,index:n,id:""});i&&(e.setPreStyleForTarget(i),n+=1),r=!!i}else{var o=e.ctx.timingTargets.getTarget(t,!1);o&&e.setPreStyleForTarget(o)}}))}},{key:"setPreStyleForTarget",value:function(e){var t,n;if(e&&this.json.presetSubtype&&(e.presetSubType=this.json.presetSubtype),e&&!e.hasPreset)if("entr"===this.json.presetClass){var r=null===(n=null===(t=this.json)||void 0===t?void 0:t.childTnLst)||void 0===n?void 0:n.filter((function(e){return"set"===e.type&&"visible"===e.to}));(null==r?void 0:r.length)&&(e.hasPreset=!0,e.style.visibility="hidden")}else("exit"===this.json.presetClass||"path"===this.json.presetClass||"emph"===this.json.presetClass)&&(e.hasPreset=!0,e.style.visibility="visible")}},{key:"startTimeNodeRepeat",value:function(){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})}},{key:"startTimeNodeForce",value:function(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}},{key:"startTimeNode",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.isDestroy){this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(e);var t=this.json.stCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];t&&this.startConds.condHandle(t);var n=this.json.endCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}}},{key:"onTimeLineEnd",value:function(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}},{key:"clearSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.destroy()}))}},{key:"seekToStart",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[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((function(t){return t.seekToStart(e)}));if(e)for(var t=this.subList.length-1;t>=0;t--){var n=this.subList[t];null==n||n.commonTimeNode.seekToStart()}for(var r=this.children.length-1;r>=0;r--){var i=this.children[r];null==i||i.commonTimeNode.seekToStart()}if(this.children.length>1)for(var o=this.children.length-1;o>=0;o--){var a=this.children[o];null==a||a.commonTimeNode.seekToStart()}}},{key:"repeatTimeNodeEnd",value:function(){this.dispose(),this.children.forEach((function(e){e.commonTimeNode.isActive=!1,e.commonTimeNode.dispose()}))}},{key:"dispose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isConflictDispose=e,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(bb.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch(e){}this.startConds.reset(),this.endConds.reset()}},{key:"seekToEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isInfiniteRepeat()){!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();var n=this.json.autoRev||e;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(e){return e.seekToEnd(n,t)}));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach((function(e){return e.commonTimeNode.seekToEnd(n,t)})),t&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach((function(e){return e.commonTimeNode.seekToEnd(!1)})),this.clearSubList())}}},{key:"isTimeNodeEndWhenDetectEndSync",value:function(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"isTimeNodeEnd",value:function(){var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEnd()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"emitEndEvents",value:function(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit("time ".concat(this.json.id," end")),this.eventHubs.global.emit("time ".concat(this.json.id," onEnd")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," end")),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}},{key:"collectStartValue",value:function(){this.emit("timeNodeCreate"),this.children.forEach((function(e){return e.commonTimeNode.collectStartValue()}))}},{key:"destroy",value:function(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach((function(e){return e.commonTimeNode.destroy()})),this.clearSubList()}}]),n}(Ks.a),nb=function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n),(r=t.call(this)).isRunning=!1,r.runtimeNodeEventHub=new Ks.a;var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,c=e.eventHub,h=e.iterateIndex,d=e.iterateId,f=e.isInInteractiveSeq,p=e.fromSeqId;return r.id=i.ctn.id,r.json=i,r.ctx=l,r.isIterate=a,r.globalEventHub=c,r.commonTimeNode=new tb({json:i.ctn,isSub:s,eventHubs:{global:c,runtime:r.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:h,iterateId:d,isInInteractiveSeq:f,fromSeqId:p}),r.commonTimeNode.on("timeNodeStart",(function(){r.commonTimeNode.children.forEach((function(e){e.commonTimeNode.setReverse(r.commonTimeNode.getReverse()),e.commonTimeNode.startTimeNode()})),r.isRunning||(r.isRunning=!0,r.globalEventHub.emit("runtime ".concat(r.id," begin")),r.emit("begin"))})),r.commonTimeNode.on("timeNodeRepeat",(function(){r.commonTimeNode.children.forEach((function(e){e.commonTimeNode.startTimeNode(!1)}))})),r.commonTimeNode.on("timeNodeEnd",(function(){r.commonTimeNode.isTimeNodeEnd()&&r.isRunning&&(r.isRunning=!1,r.globalEventHub.emit("runtime ".concat(r.id," end")),r.emit("end")),"exit"===r.commonTimeNode.json.presetClass&&r.commonTimeNode.children.length>=1&&r.commonTimeNode.children[r.commonTimeNode.children.length-1]instanceof iy&&r.commonTimeNode.children.forEach((function(e){e instanceof iy||"function"!=typeof e.onSeekToStart||e.onSeekToStart()}))})),r}return n}(Ks.a),rb=function(){function e(t,n,r){_(this,e),this.json=t,this.ctx=r,this.globalEventHub=n;var i=t.timeNodeList.find((function(e){return"par"===e.type&&"tmRoot"===e.ctn.nodeType}));i&&(this.tmRoot=new nb({json:i,isSub:!1,isIterate:!1,eventHub:n,ctx:r,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1,fromSeqId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find((function(e){var t,n,r;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"mainSeq"===(null===(r=null===(n=e.json)||void 0===n?void 0:n.ctn)||void 0===r?void 0:r.nodeType)})))}return T(e,[{key:"findSeq",value:function(e){var t;return null===(t=this.tmRoot)||void 0===t?void 0:t.commonTimeNode.children.find((function(t){var n,r,i;return"seq"===(null===(n=t.json)||void 0===n?void 0:n.type)&&(null===(i=null===(r=t.json)||void 0===r?void 0:r.ctn)||void 0===i?void 0:i.id)===e}))}},{key:"start",value:function(){var e,t;return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.json.autoPlayMainSeq){n.next=6;break}return n.next=3,this.ctx.clock.delay(16);case 3:null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.startTimeNode(),n.next=7;break;case 6:null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode();case 7:case"end":return n.stop()}}),n,this)})))}},{key:"setMainSeqApplied",value:function(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}},{key:"collectMainSeqStartValue",value:function(){var e;null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.collectStartValue()}},{key:"setMainSeqStep",value:function(e,t){var n;-1===e&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(n=this.mainSeq)||void 0===n||n.setCurrentStep(e,t)}},{key:"destroy",value:function(){var e;this.globalEventHub.removeAllListeners(),null===(e=this.tmRoot)||void 0===e||e.commonTimeNode.destroy()}},{key:"hasMainSeq",value:function(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}},{key:"currentMainSeqState",value:function(){return this.mainSeq?this.mainSeq.currentState:null}},{key:"currentMainSeqStep",value:function(){return this.mainSeq?this.mainSeq.currentStep:0}},{key:"currentMainSeqLength",value:function(){return this.mainSeq?this.mainSeq.stepLength:0}},{key:"mainSeqHasNextStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasNext()}},{key:"mainSeqHasPrevStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasPrev()}},{key:"seekInteractiveSeqToEnd",value:function(e){var t=this.findSeq(e);t&&t.commonTimeNode.seekToEnd(!1,!0)}},{key:"setInteractiveSeqState",value:function(e,t,n){var r=this.findSeq(e);r&&r.setCurrentStep(t,n)}},{key:"resetAllInteractiveSeq",value:function(){var e;((null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.filter((function(e){var t,n,r;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"interactiveSeq"===(null===(r=null===(n=e.json)||void 0===n?void 0:n.ctn)||void 0===r?void 0:r.nodeType)})))||[]).forEach((function(e){e.setCurrentStep(0,"start")}))}},{key:"applyInteractiveAction",value:function(e){this.globalEventHub.emit(e)}}]),e}(),ib=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ob=function(e){p(n,e);var t=m(n);function n(e,r,i,o){var a;_(this,n),(a=t.call(this,{id:"stage",width:e.width,height:e.height,type:"Container",children:e.children},r,{parentGlobalPos:i},o)).isRendered=!1,a.isTimingStartValueCollected=!1,a.json=e,a.json.smartArtShapeList&&(r.smartArtShapeList=a.json.smartArtShapeList),r.hasBackgroundFillShape=a.detectUseBackgroundFill(a.json),a.container.visible=!1,a.ctx=r;var s=new Dd;return s.beginFill(16777215),s.drawRect(0,0,e.width,e.height),s.endFill(),a.container.addChild(s),a}return T(n,[{key:"detectUseBackgroundFill",value:function(e){var t=this;return!!e&&("Picture"===e.type||"Shape"===e.type?e.useBgFill:!(!e.children||!Array.isArray(e.children))&&e.children.some((function(e){return t.detectUseBackgroundFill(e)})))}},{key:"initOnReuse",value:function(){var e=this;f(x(n.prototype),"initOnReuse",this).call(this),this.ctx.timingEventHub.on("c:prev slide",(function(t){e.ctx.eventHub.emit(bb.requestPrevSlide,t)})),this.ctx.timingEventHub.on("c:next slide",(function(t,n){e.ctx.eventHub.emit(bb.requestNextSlide,t,n)}))}},{key:"render",value:function(e){var t=this;this.isRendered||(this.collectAnimatedIds().forEach((function(e){return t.ctx.animatedIds.add(e)})),this.isRendered=!0,f(x(n.prototype),"render",this).call(this,e),e.addSubMTask((function(){return ib(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.eventHub.emit("StageRenderEnd");case 1:case"end":return e.stop()}}),e,this)})))}),"@StageImpl[emit.StageRenderEnd]"))}},{key:"isListTimeNode",value:function(e){return["excel","seq","par"].indexOf(e.type)>=0}},{key:"isAnimatedTimeNode",value:function(e){return!!e.cBhvr}},{key:"collectAnimatedIdsForTimeNode",value:function(e,t){var n,r=this;this.isListTimeNode(e)?null===(n=e.ctn.childTnLst)||void 0===n||n.forEach((function(e){r.collectAnimatedIdsForTimeNode(e,t)})):this.isAnimatedTimeNode(e)&&t.push(e.cBhvr.target.id)}},{key:"collectAnimatedIds",value:function(){var e=this,t=[];return this.json.timing&&this.json.timing.timeNodeList.forEach((function(n){e.collectAnimatedIdsForTimeNode(n,t)})),t}},{key:"createTiming",value:function(){this.json.timing&&!this.timing&&(this.timing=new rb(this.json.timing,this.ctx.timingEventHub,this.ctx))}},{key:"startTiming",value:function(){var e;return(null===(e=this.timing)||void 0===e?void 0:e.start())||Promise.resolve()}},{key:"setMainSeqApplied",value:function(){var e;null===(e=this.timing)||void 0===e||e.setMainSeqApplied()}},{key:"setMainSeqStep",value:function(e,t){var n;null===(n=this.timing)||void 0===n||n.setMainSeqStep(e,t)}},{key:"collectMainSeqStartValue",value:function(){var e;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,null===(e=this.timing)||void 0===e||e.collectMainSeqStartValue())}},{key:"hasTiming",value:function(){return!!this.timing}},{key:"clearOnSlideChange",value:function(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),f(x(n.prototype),"clearOnSlideChange",this).call(this)}},{key:"clearOnTransactionEnd",value:function(){var e,t;this.ctx.timingTargets.getTargets().forEach((function(e){e.hasPreset=!1})),null===(e=this.timing)||void 0===e||e.resetAllInteractiveSeq(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0}},{key:"destroy",value:function(){var e,t;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),null===(e=this.ctx.bgTexture)||void 0===e||e.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0,f(x(n.prototype),"destroy",this).call(this)}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqStep())&&void 0!==t?t:0}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"mainSeqState",value:function(){return this.timing?this.timing.currentMainSeqState():null}},{key:"nextStep",value:function(e,t){var n;this.hasTiming()&&(null===(n=this.timing)||void 0===n?void 0:n.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",e,t)):this.ctx.eventHub.emit(bb.requestNextSlide,e,t)}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.hasTiming()&&(null===(e=this.timing)||void 0===e?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(bb.requestPrevSlide,t)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.timing)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.timing)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,n){var r;null===(r=this.timing)||void 0===r||r.setInteractiveSeqState(e,t,n)}},{key:"setMediaState",value:function(e,t,n){return ib(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=this.ctx.medias[e],r.t0=i,!r.t0){r.next=21;break}if(!t){r.next=18;break}if(!n){r.next=14;break}return r.next=7,dv((function(){return i.clippedDuration>0}),5e3);case 7:if(r.t1=n=0&&t.tasks.splice(n,1)})),e.once("task-error",(function(){var n=t.tasks.indexOf(e);n>=0&&t.tasks.splice(n,1)}))}},{key:"start",value:function(){this.couldRunning=!0}},{key:"stop",value:function(){this.couldRunning=!1}}]),e}(),sb=function(e){return new Promise((function(t){return setTimeout(t,e)}))},ub=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this)).slideIndex=e,o.taskId=r,o.logger=i,o.uuid=uv(),o.isCancel=!1,o.tasks=[],o}return T(n,[{key:"addMTask",value:function(e,t){this.tasks.push({fn:e,state:"wait",sub:[],name:t})}},{key:"addSubMTask",value:function(e,t){var n=this.tasks.findIndex((function(e){return"running"===e.state}));n<0&&(n=0),this.tasks[n].sub.push({fn:e,state:"wait",sub:[],name:t})}},{key:"cancel",value:function(){this.tasks=[],this.isCancel=!0}},{key:"applyNext",value:function(){var e=this;if(!this.tasks.some((function(e){return"running"===e.state}))&&!this.tasks.some((function(e){return"error"===e.state})))if(this.tasks.every((function(e){return"finish"===e.state})))this.isCancel||this.emit("task-finish");else{var t=this.tasks.find((function(e){return"wait"===e.state}));t&&(t.state="running",t.fn.apply(null).then((function(){if(t.state="finish",t.sub.length>0){var n,r=e.tasks.findIndex((function(e){return e===t}));(n=e.tasks).splice.apply(n,[r+1,0].concat(a(t.sub)))}})).catch((function(n){t.state="error",e.logger.error("".concat(n," ").concat(n.stack),e.taskId),e.emit("task-error",rv.transform(n),e.slideIndex)})))}}},{key:"applyAll",value:function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.tasks.every((function(e){return"finish"===e.state}))){e.next=14;break}if(!this.tasks.some((function(e){return"running"===e.state}))){e.next=6;break}return e.next=4,sb(16);case 4:e.next=12;break;case 6:if(!this.tasks.some((function(e){return"error"===e.state}))){e.next=8;break}return e.abrupt("return");case 8:return e.delegateYield(regeneratorRuntime.mark((function e(){var n,r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.tasks.find((function(e){return"wait"===e.state})))){e.next=17;break}return n.state="running",e.prev=3,e.next=6,hv((function(){return n.fn.apply(null)}),6e4);case 6:if(e.t0=e.sent,e.t1=lv,e.t0!==e.t1){e.next=10;break}throw new rv(Jp.RuntimeError,"subtask ".concat(n.name," apply timeout"));case 10:n.state="finish",n.sub.length>0&&(i=t.tasks.findIndex((function(e){return e===n})),(r=t.tasks).splice.apply(r,[i+1,0].concat(a(n.sub)))),e.next=17;break;case 13:return e.prev=13,e.t2=e.catch(3),o=(null==e.t2?void 0:e.t2.errorType)?e.t2:new rv(Jp.RuntimeError,"subtask ".concat(n.name," error. ").concat(e.t2)),n.state="error",t.logger.error("".concat(e.t2," ").concat(e.t2.stack),t.taskId),t.emit("task-error",rv.transform(o),t.slideIndex),e.abrupt("return","break");case 17:case"end":return e.stop()}}),e,null,[[3,13]])}))(),"t0",9);case 9:if("break"!==e.t0){e.next=12;break}return e.abrupt("break",14);case 12:e.next=0;break;case 14:!this.isCancel&&this.tasks.every((function(e){return"finish"===e.state}))&&this.emit("task-finish");case 15:case"end":return e.stop()}}),e,this)})))}}]),n}(Ks.a),lb=function(){function e(t,n){var r=this;if(_(this,e),this.renderer=t,this.localStorage=n,this.outputData=new Map,this.loadingSdfKeys=new Set,!e.worker){var i=new Blob(['\nself.onmessage = function(e) {\n var data = e.data.data;\n var key = e.data.key;\n var height = Math.ceil(e.data.height);\n var width = Math.ceil(e.data.width);\n if (!data || !key) {\n return;\n }\n var maxDis = 0;\n var d = [];\n var p = [];\n var maxInt = Number.MAX_SAFE_INTEGER || 255 * 255 * 255;\n var setD = function(x, y, v) { d[y * width + x] = v; };\n var getD = function(x, y) { return d[y * width + x]; };\n var setP = function(x, y, v) { p[y * width + x] = v; };\n var getP = function(x, y) { return p[y * width + x]; };\n var isContains = function(x, y) { return x >= 0 && x < width && y >= 0 && y < height; };\n var isInterior = function(x, y) { return data[(y * width + x) * 4 + 3] > 10; };\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var c = isInterior(x, y);\n var t = isContains(x, y - 1) ? isInterior(x, y - 1) : false;\n var b = isContains(x, y + 1) ? isInterior(x, y + 1) : false;\n var l = isContains(x - 1, y) ? isInterior(x - 1, y) : false;\n var r = isContains(x + 1, y) ? isInterior(x + 1, y) : false;\n if (c !== t || c !== b || c !== l || c !== r) {\n setD(x, y, 0);\n setP(x, y, [x, y]);\n } else {\n setD(x, y, maxInt);\n setP(x, y, [-1, -1]);\n }\n }\n }\n \n var f = function (x, y, dir) {\n var d1 = 1;\n var d2 = Math.sqrt(2);\n var dx;\n var dy;\n var od;\n switch (dir) {\n case "TL": dx = -1; dy = -1; od = d2; break;\n case "T": dx = 0; dy = -1; od = d1; break;\n case "TR": dx = 1; dy = -1; od = d2; break;\n case "L": dx = -1; dy = 0; od = d1; break;\n case "R": dx = 1; dy = 0; od = d1; break;\n case "BL": dx = -1; dy = 1; od = d2; break;\n case "B": dx = 0; dy = 1; od = d1; break;\n case "BR": dx = 1; dy = 1; od = d2; break;\n }\n var b = isContains(x + dx, y + dy);\n var cb = b ? getD(x + dx, y + dy) : maxInt;\n if (cb + od < getD(x, y)) {\n var p = b ? getP(x + dx, y + dy) : [-1, -1];\n var dis = Math.sqrt(Math.pow(x - p[0], 2) + Math.pow(y - p[1], 2));\n setP(x, y, p);\n setD(x, y, dis);\n if (dis > maxDis) {\n maxDis = dis;\n }\n }\n };\n \n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var dirs = ["TL", "T", "TR", "L"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n for (var y = height - 1; y >= 0; -- y) {\n for (var x = width - 1; x >= 0; -- x) {\n var dirs = ["R", "BL", "B", "BR"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n var outputData = [];\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n outputData.push(isInterior(x, y) ? 255: 0);\n outputData.push(0);\n outputData.push(0);\n outputData.push(Math.ceil(getD(x, y) / maxDis * 255));\n }\n }\n self.postMessage({\n key, outputData, maxDis\n });\n};\n'],{type:"text/javascript"});e.worker=new Worker(URL.createObjectURL(i)),e.worker.onmessage=function(e){r.outputData.set(e.data.key,{data:e.data.outputData,maxDis:e.data.maxDis})},this.outputData.set("111","222")}}return T(e,[{key:"createSdfByWorker",value:function(t,n,r,i,o,a,s,u){var l=document.createElement("canvas");l.width=o,l.height=a;var c=l.getContext("2d");if(c&&e.worker){c.drawImage(s,t,n,r,i);var h=c.getImageData(0,0,o,a).data;e.worker.postMessage({data:h,key:u,width:o,height:a})}}},{key:"createSdf",value:function(e,t,n){var r=document.createElement("canvas");r.width=e,r.height=t;var i=r.getContext("2d");if(!i)return{src:"",maxDis:1};i.drawImage(n,0,0);for(var o=0,a=i.getImageData(0,0,e,t).data,s=[],u=[],l=function(t,n,r){s[n*e+t]=r},c=function(t,n){return s[n*e+t]},h=function(t,n,r){u[n*e+t]=r},d=function(n,r){return n>=0&&n=0&&r10},p=0;po&&(o=m)}},w=0;w=0;--E)for(var A=e-1;A>=0;--A)for(var I=0,C=["R","BL","B","BR"];It.maxResolution.x||s>t.maxResolution.y){var r=(n=t.maxResolution.x/a)*s;r>t.maxResolution.y&&(n*=t.maxResolution.y/r)}return o.loadSpriteSheetItem(t.url,t.taskId,e,n)}),"@StagePool[spriteTexture.loadSpriteSheetItem]")})),Promise.resolve()}),"@StagePool[loadSpriteSheets]")}},{key:"createStage",value:function(e){var t=this,n=this.stageStates[e].task;n.addMTask((function(){var r=t.stageJsons[e],i=t.stageCtxs[e],o=new ob(r,i,{x:0,y:0},n);return t.stageImpls[e]=o,Promise.resolve()}),"@StagePool[createStage]")}},{key:"preRenderStage",value:function(e){var t=this,n=this.stageStates[e].task;n.addMTask((function(){return t.stageImpls[e].preRender(n),Promise.resolve()}),"@StagePool[preRenderStage]")}},{key:"createGraphicsTexture",value:function(e){var t=this,n=this.stageStates[e].task;n.addMTask((function(){return cb(t,void 0,void 0,regeneratorRuntime.mark((function t(){var r,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(r=this.stageCtxs[e]).graphicsTexture.pack().forEach((function(t,o){n.addSubMTask((function(){var n=i.stageCtxs[e],a=n.stageWidth,s=n.stageHeight,u=1;if(a>i.maxResolution.x||s>i.maxResolution.y){var l=(u=i.maxResolution.x/a)*s;l>i.maxResolution.y&&(u*=i.maxResolution.y/l)}return r.graphicsTexture.render(t,o,i.objPoolGroup,u)}),"@StagePool[graphicsTexture.render]")}));case 2:case"end":return t.stop()}}),t,this)})))}),"@StagePool[createGraphicsTexture]")}},{key:"renderStage",value:function(e){var t=this,n=this.stageStates[e].task;n.addMTask((function(){return cb(t,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.stageImpls[e],t.next=3,r.render(n);case 3:case"end":return t.stop()}}),t,this)})))}),"@StagePool[renderStage]")}},{key:"destroyStageByIndex",value:function(e){"load"===this.stageStates[e].state&&this.stageStates[e].task.cancel(),delete this.stageStates[e],this.stageImpls[e].destroy(),delete this.stageImpls[e],delete this.stageCtxs[e]}},{key:"destroyStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var n=parseInt(t,10);Math.abs(e.currentStageIndex-n)>e.cacheCount&&e.destroyStageByIndex(n)}))}},{key:"destroyAllStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var n=parseInt(t,10);e.destroyStageByIndex(n)}))}},{key:"preload",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stageImpls[e]||this.stageStates[e])return Promise.resolve();var r=new ub(e,this.taskId,this.logger);return r.on("task-error",(function(e,n){delete t.stageStates[n],delete t.stageImpls[n],delete t.stageCtxs[n],t.errorChannel.emit("error",e,n)})),this.stageStates[e]={state:"load",task:r},this.createCtx(e),this.loadStageJson(e),this.loadSpriteSheets(e),this.createStage(e),this.preRenderStage(e),this.createGraphicsTexture(e),this.renderStage(e),this.microTaskManager.addTask(r),n?r.applyAll():new Promise((function(n){r.once("task-finish",(function(){t.stageStates[e].state="finish",Object.keys(t.stageStates).length>2*t.cacheCount+1&&t.destroyStage(),n()}))}))}},{key:"getStageJson",value:function(e){return this.stageJsons[e]||null}},{key:"getStage",value:function(e){return cb(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.currentStageIndex=e,"finish"!==(null==(n=this.stageStates[e])?void 0:n.state)||!this.stageImpls[e]){t.next=6;break}t.t0=this.stageImpls[e],t.next=16;break;case 6:if("load"!==(null==n?void 0:n.state)){t.next=12;break}return t.next=9,n.task.applyAll();case 9:t.t1=this.stageImpls[e],t.next=15;break;case 12:return t.next=14,this.preload(e,!0);case 14:t.t1=this.stageImpls[e];case 15:t.t0=t.t1;case 16:return t.abrupt("return",t.t0);case 17:case"end":return t.stop()}}),t,this)})))}},{key:"destroy",value:function(){this.runningAudio.clear()}}]),e}(),db=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},fb=function(){function e(t){var n,r=this;_(this,e),this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,null===(n=e.localCache)||void 0===n||n.ready((function(e){e||(r.isIndexDBReady=!0)})).catch((function(){t.warn("local storage not ready",r.taskId)}))}return T(e,[{key:"attachTaskId",value:function(e){this.taskId=e}},{key:"getItem",value:function(t){return db(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=null,!this.couldUseIndexDBCache||!e.localCache){n.next=10;break}return n.prev=2,n.next=5,hv((function(){return e.localCache.getItem("".concat(i.taskId,"/").concat(t))}),500);case 5:r=n.sent,n.next=10;break;case 8:n.prev=8,n.t0=n.catch(2);case 10:return n.abrupt("return",(r=r===lv?null:r)||this.memoryCache.get(t)||null);case 11:case"end":return n.stop()}}),n,this,[[2,8]])})))}},{key:"setItem",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return db(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(this.couldUseIndexDBCache){i.next=2;break}return i.abrupt("return",(r&&this.memoryCache.set(t,n),Promise.resolve()));case 2:if(!e.localCache){i.next=13;break}return o=null,i.prev=4,i.next=7,hv((function(){return e.localCache.setItem("".concat(a.taskId,"/").concat(t),n).catch((function(){r&&a.memoryCache.set(t,n)}))}),500);case 7:o=i.sent,i.next=12;break;case 10:i.prev=10,i.t0=i.catch(4);case 12:o!==lv&&null!==o||!r||this.memoryCache.set(t,n);case 13:case"end":return i.stop()}}),i,this,[[4,10]])})))}},{key:"dispose",value:function(){var t,n=this;this.memoryCache=new Map,this.couldUseIndexDBCache&&(null===(t=e.localCache)||void 0===t||t.keys().then((function(t){t.filter((function(e){return e.indexOf(n.taskId)>=0})).forEach((function(t){var n;null===(n=e.localCache)||void 0===n||n.removeItem(t).catch((function(){}))}))})).catch((function(){})))}},{key:"couldUseIndexDBCache",get:function(){return this.isIndexDBReady&&this.taskId.length>0}}]),e}();fb.localCache=null;try{fb.localCache=b.createInstance({name:"slide_local_cache",driver:b.INDEXEDDB,version:1})}catch(u){}var pb=new jl.j,vb=function(){function e(t){_(this,e),this.localStorage=t}return T(e,[{key:"canvas",value:function(t,n,r,i){var o,a,s,u=!1,l=!1;t&&(t instanceof Xl.p?s=t:(s=n.generateTexture(t),l=!0)),s?(o=s.baseTexture.resolution,a=s.frame,u=!1,n.renderTexture.bind(s)):(o=n.resolution,u=!0,(a=pb).width=n.width,a.height=n.height,n.renderTexture.bind(null));var c=Math.floor(a.width*o+1e-4),h=Math.floor(a.height*o+1e-4),d=document.createElement("canvas");d.width=c,d.height=h;var f=d.getContext("2d");if(!f)throw new Error("ctx");if(r)f.putImageData(r,0,0);else{var p=f.getImageData(0,0,c,h),v=new Uint8Array(4*c*h),m=n.gl;m.readPixels(a.x*o,a.y*o,c,h,m.RGBA,m.UNSIGNED_BYTE,v),e.arrayPostDivide(v,p.data),f.putImageData(p,0,0),i&&this.localStorage.setItem(i,p).catch((function(){}))}if(u){var g=document.createElement("canvas");g.width=c,g.height=h;var y=g.getContext("2d");y.scale(1,-1),y.drawImage(d,0,-h),d=g}return l&&(null==s||s.destroy(!0)),d}}],[{key:"arrayPostDivide",value:function(e,t){for(var n=0;n1&&(e=1),this._volume=e,this.emit("update",this._volume)}}]),n}(Ks.a),gb=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Ol.skipHello();var yb={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",gallery:"Gallery",switch:"Switch",prism:"Prism",doors:"Doors"},bb={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",mediaStop:"mediaStop",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",requestOpenUrl:"requestOpenUrl",userInput:"userInput",fullscreenChange:"fullscreenChange",changeLocalFullscreenState:"changeLocalFullscreenState"},xb=function(e){p(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_(this,n),(r=t.call(this)).errorChannel=new Ks.a,r.transactionPlayer=null,r.isForward=!0,r.drawCall=0,r.scale=1,r._isPaused=!1,r.maxResolution=new jl.g(0,0),r.isNVIDIA=!1,r.fps=new nv,r.designWidth=0,r.designHeight=0,r.currentIndex=0,r.slideCount=0,r.runtime={drawCall:0,fps:0},r.globalEventHub=new Ks.a,r.globalVideoBackground=new Dd,r.globalVideoSprite=new Ld,r.onMousemoveTimeout=null,r.cacheFunctionMap=new Map,r.isPlayerPaused=function(){return r._isPaused},r.onWebGLLost=function(){r.errorChannel.emit("error",new rv(Jp.CanvasCrash,"webgl context lost."))},r.fullscreenOnMousemove=function(e){var t=e.index,n=e.targetId;r.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:n,status:!0}),r.onMousemoveTimeout&&clearTimeout(r.onMousemoveTimeout),r.onMousemoveTimeout=setTimeout((function(){r.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:n,status:!1})}),jg)},r.fullscreenOnMouseleave=function(e){var t=e.index,n=e.targetId;r.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:n,status:!1})},r.calculateFullscreenVideoPosition=function(e){var t=e.width,n=e.height,i=y(r),o=i.designWidth,a=i.designHeight,s=Math.min(o/t,a/n);return{x:(o-t*s)/2,y:(a-n*s)/2,width:t*s,height:n*s}},r.onRequestFullscreenVideo=function(e){var t=e.texture,n=e.index,i=e.targetId;if(n===r.currentIndex){r.onRequestCancelFullscreenVideo(),r.globalVideoBackground.width=r.designWidth,r.globalVideoBackground.height=r.designHeight,r.globalVideoBackground.beginFill(0,1),r.globalVideoBackground.drawRect(0,0,r.designWidth,r.designHeight),r.globalVideoBackground.endFill(),r.globalVideoBackground.interactive=!0,r.app.stage.addChild(r.globalVideoBackground);var o=r.calculateFullscreenVideoPosition(t),a=o.x,s=o.y,u=o.width,l=o.height;r.globalVideoSprite.texture=t,r.globalVideoSprite.width=u,r.globalVideoSprite.height=l,r.globalVideoSprite.position.x=a,r.globalVideoSprite.position.y=s,r.globalVideoBackground.addChild(r.globalVideoSprite),r.globalEventHub.emit("onFullscreenChange",{status:!0,targetId:i,slideIndex:r.currentIndex}),r.clearFullscreenEventListenersWithAppView();var c={handleEvent:function(){var e;null===(e=r.currentStage)||void 0===e||e.ctx.eventHub.emit(bb.userInput)}};if(r.app.view.addEventListener("pointerdown",c,!1),r.cacheFunctionMap.set("pointerdown",c),Pg.isDesktop()){var h={handleEvent:function(){r.fullscreenOnMouseleave({index:n,targetId:i})}};r.app.view.addEventListener("mouseout",h,!1);var d={handleEvent:function(){r.globalEventHub.emit("controllerShowStatusChange",{slideIndex:n,targetId:i,status:!0})}};r.app.view.addEventListener("mouseover",d,!1);var f={handleEvent:function(){r.fullscreenOnMousemove({index:n,targetId:i})}};r.app.view.addEventListener("mousemove",f,!1),r.cacheFunctionMap.set("mouseover",d),r.cacheFunctionMap.set("mousemove",f),r.cacheFunctionMap.set("mouseout",h)}else{var p={handleEvent:function(){r.fullscreenOnMousemove({index:n,targetId:i})}};r.app.view.addEventListener("touchstart",p,!1),r.cacheFunctionMap.set("touchstart",p)}}else t.destroy(!1)},r.onRequestCancelFullscreenVideo=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r.globalVideoSprite.texture.destroy(!1),r.globalVideoBackground.removeChild(r.globalVideoSprite),r.app.stage.removeChild(r.globalVideoBackground),r.globalEventHub.emit("onFullscreenChange",{status:!1,slideIndex:r.currentIndex,targetId:null===(e=r.currentStage)||void 0===e?void 0:e.ctx.latestChangeFullscreenTargetId}),r.clearFullscreenEventListenersWithAppView(),n&&r.emit(bb.changeLocalFullscreenState,{status:!1,slideIndex:r.currentIndex,targetId:null===(t=r.currentStage)||void 0===t?void 0:t.ctx.latestChangeFullscreenTargetId})},r.logger=e.logger,r.tracker=e.tracker,r.mode=e.mode,r.volumeAdjuster=e.volumeAdjuster,r.localStorage=new fb(r.logger),r.cachedExtract=new vb(r.localStorage),r.config={minFPS:nu()(i.minFPS)?30:i.minFPS,maxFPS:nu()(i.maxFPS)?40:i.maxFPS,resolution:nu()(i.resolution)?1:i.resolution,autoFPS:!nu()(i.autoFPS)&&i.autoFPS,autoResolution:!nu()(i.autoResolution)&&i.autoResolution,transactionBgColor:nu()(i.transactionBgColor)?0:i.transactionBgColor,maxResolutionLevel:r.getMaxResolution(i.maxResolutionLevel),forceCanvas:!nu()(i.forceCanvas)&&i.forceCanvas,enableNvidiaDetect:!nu()(i.enableNvidiaDetect)&&i.enableNvidiaDetect},r.updateMaxResolutionLevel(r.config.maxResolutionLevel),r.loader=new vv(r.localStorage,e.useLocalCache,r.logger,r.tracker,e.resourceTimeout,e.loadDelegate,e.urlInterrupter);var o=Ol.isWebGLSupported();r.app=new Ql({antialias:!0,autoDensity:!1,backgroundColor:16777215,forceCanvas:r.config.forceCanvas||!o}),r.tracker({name:"slidePlayerCreate",result:"",reason:"",payload:{webgl:o,resolution:r.config.resolution,minFPS:r.config.minFPS,maxFPS:r.config.maxFPS,maxResolutionLevel:r.config.maxResolutionLevel,forceCanvas:r.config.forceCanvas}}),r.updateConfig(r.config),r.app.ticker.maxFPS=60,r.app.ticker.minFPS=r.config.minFPS,r.app.ticker.maxFPS=r.config.maxFPS,r.app.view.style.zIndex="1",r.app.stage.sortableChildren=!0;var a=r.app.renderer;if(a.gl){var s=a.gl.drawElements,u=a.gl.getExtension("WEBGL_debug_renderer_info"),l=a.gl.getParameter(u.UNMASKED_RENDERER_WEBGL);/nvidia/i.test(l)&&r.config.enableNvidiaDetect&&(r.isNVIDIA=!0),a.gl.drawElements=function(){for(var e=arguments.length,t=new Array(e),n=0;n=t&&r.updateResolution(i)}}else if(e>r.config.maxFPS&&r.config.autoResolution){var o=r.scale*r.config.resolution,a=r.app.renderer.resolution,s=Math.min(o,a+.1);s<=r.config.resolution&&r.updateResolution(s)}})),r.app.ticker.add((function(){r.runtime.drawCall=r.drawCall,r.runtime.fps=Math.floor(r.app.ticker.minFPS),r.drawCall=0}),null,Bl.c.LOW),r.clock=new mv(r.app.ticker),r.objPoolGroup=uv(),r.stagePool=new hb(r.loader,r.mode,r.app.renderer,r.app.ticker,r.app.view,r.clock,r.objPoolGroup,r.errorChannel,r.localStorage,r.logger,e.loadDelegate,e.urlInterrupter,r.isPlayerPaused,r.maxResolution,r.volumeAdjuster,r.config.forceCanvas,r.globalEventHub),r.app.view.addEventListener("webglcontextlost",r.onWebGLLost);try{r.config.forceCanvas||(r.transactionPlayer=new Pl)}catch(s){/Error creating WebGL context/.test(s.message)?r.errorChannel.emit("error",new rv(Jp.CanvasCrash,"webgl context lost.")):r.errorChannel.emit("error",new rv(Jp.RuntimeWarn,s.message))}return r.globalEventHub.on("requestFullscreen",r.onRequestFullscreenVideo),r.globalEventHub.on("requestCancelFullscreen",r.onRequestCancelFullscreenVideo),r}return T(n,[{key:"getMaxResolution",value:function(e){return!nu()(e)&&Number.isInteger(e)?(e<1&&(e=1),e>4&&(e=4),e):n.platform.isAndroid()||n.platform.isIOS()?2:4}},{key:"updateMaxResolutionLevel",value:function(e){e<0&&(e=0),e>4&&(e=4);var t=[640,960,1280,1920,3200][e],n=[360,540,720,1080,1800][e];this.maxResolution.set(t,n)}},{key:"updateConfig",value:function(e){nu()(e.maxFPS)||nu()(e.minFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS,this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),nu()(e.resolution)||(this.config.resolution=e.resolution,this.updateResolution(this.scale*this.config.resolution)),nu()(e.autoFPS)||(this.config.autoFPS=e.autoFPS),nu()(e.autoResolution)||(this.config.autoResolution=e.autoResolution),nu()(e.transactionBgColor)||(this.config.transactionBgColor=e.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),nu()(e.maxResolutionLevel)||(this.config.maxResolutionLevel=e.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}},{key:"preload",value:function(e){return gb(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e<1||e>this.slideCount,t.t0){t.next=6;break}return this.logger.info("preload slide ".concat(e," begin"),this.taskId),t.next=5,this.stagePool.preload(e);case 5:this.logger.info("preload slide ".concat(e," end"),this.taskId);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"setResourceData",value:function(e,t){this.logger.info("ppt player init config: "+JSON.stringify(this.config),e),this.logger.info("set resource to "+t,e),this.taskId=e,this.url=t,this.stagePool.setResourceData(e,t),this.localStorage.attachTaskId(e),this.loader.attachTaskId(e)}},{key:"setInteractive",value:function(e){this.app.stage.interactive=e,this.app.stage.interactiveChildren=e}},{key:"translateEvent",value:function(e,t){var n=this;t.forEach((function(t){e.on(t,(function(){for(var e,r,i,o,a=arguments.length,s=new Array(a),u=0;u0&&this.view&&p&&(m=s.json.transition,!this.isForward&&(null==p?void 0:p.json.transition)&&(m=p.json.transition),g=this.getTransactionTexture(p,this.view,null,null),this.initTransactionPlayer(m),null===(n=this.transactionPlayer)||void 0===n||n.setPrevTexture(g),v=!0),this.app.stage.addChild(s.container),this.updateResolution(this.config.resolution*this.scale),p&&(p.clearOnTransactionEnd(),this.app.stage.removeChild(p.container)),!(s.json.transition&&s.json.transition.type&&this.app.stage.children.length>0&&this.view&&this.transactionPlayer&&v)){i.next=30;break}return i.next=23,this.getTransactionTexture(s,this.view,u,l);case 23:return y=i.sent,this.transactionPlayer.setNextTexture(y),i.next=27,this.transactionPlayer.play();case 27:if(b=this.transactionPlayer.renderer.domElement,this.view.parentElement&&b)try{this.view.parentElement.removeChild(b)}catch(e){}null===(r=this.transactionPlayer)||void 0===r||r.dispose();case 30:if(!this.isForward){i.next=35;break}return i.next=33,s.startTiming();case 33:i.next=36;break;case 35:s.setMainSeqApplied();case 36:s.ctx.slideScopeEventHub.emit("slide-render",s.ctx.slideIndex),this.emit(bb.renderEnd,e),this.emit(bb.slideChange,e),s.ctx.isRendering=!1,this.preload(e+1).catch((function(t){x.errorChannel.emit("error",rv.transform(t),e+1)})),this.preload(e-1).catch((function(t){x.errorChannel.emit("error",rv.transform(t),e-1)})),this.logger.info("render slide ".concat(e," done, time: ").concat(Date.now()-a,"ms"),this.taskId),this.tracker({name:"slidePageChange",reason:"",result:"",payload:{duration:Date.now()-a,from:o,to:e}});case 44:case"end":return i.stop()}}),i,this)})))}},{key:"getTransactionTexture",value:function(e,t,n,r){var i=Xl.p.create({width:e.json.width,height:e.json.height,resolution:1});this.app.renderer.render(e.container,{renderTexture:i});var o=this.cachedExtract.canvas(i,this.app.renderer,r,n);return new G(o)}},{key:"renderToBase64",value:function(e,t,n){return gb(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.stagePool.getStage(e);case 2:if(!(i=r.sent)){r.next=10;break}return o=i.json,a=o.width,s=o.height,this.designWidth=a,this.designHeight=s,u=Xl.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),i.container.visible=!0,this.app.renderer.render(i.container,{renderTexture:u}),l=this.app.renderer.plugins.extract.base64(u,n),r.abrupt("return",(this.stagePool.destroyStageByIndex(e),l));case 10:return r.abrupt("return","__null__");case 11:case"end":return r.stop()}}),r,this)})))}},{key:"renderMainSeqToBase64",value:function(e,t,n){return gb(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,l,c,h,d,f;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=[],r.next=3,this.stagePool.getStage(e);case 3:if((o=r.sent).createTiming(),o)for(a=o.json,s=a.width,u=a.height,this.designWidth=s,this.designHeight=u,l=Xl.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),o.container.visible=!0,c=o.mainSeqLength(),o.setMainSeqStep(0,"start"),this.app.renderer.render(o.container,{renderTexture:l}),h=this.app.renderer.plugins.extract.base64(l,n),i.push(h),d=0;dn.maxResolution.x||r*n.designHeight>n.maxResolution.y;)r-=.1;n.app.renderer.resolution=r,n.app.renderer.plugins.interaction.resolution=n.app.renderer.resolution,n.app.renderer.resize(n.designWidth,n.designHeight),eu()(t)&&t()}))}},{key:"nextStep",value:function(e,t){var n;if(this._isPaused)this.logger.info("ppt play prevent next step with paused state",this.taskId);else{this.logger.info("ppt play trigger next step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(n=this.currentStage)||void 0===n||n.nextStep(e,t)}catch(e){this.errorChannel.emit("error",rv.transform(e),this.currentIndex)}}}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._isPaused)this.logger.info("ppt play prevent prev step with paused state",this.taskId);else{this.logger.info("ppt play trigger prev step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(e=this.currentStage)||void 0===e||e.prevStep(t)}catch(e){this.errorChannel.emit("error",rv.transform(e),this.currentIndex)}}}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqStep())&&void 0!==t?t:0}},{key:"setMainSeqStep",value:function(e,t){var n;null===(n=this.currentStage)||void 0===n||n.setMainSeqStep(e,t)}},{key:"mainSeqState",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqState())&&void 0!==t?t:null}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"nextTick",value:function(e){this.app.ticker.addOnce((function(){e()}),Bl.c.LOW)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,n){var r;null===(r=this.currentStage)||void 0===r||r.setInteractiveSeqState(e,t,n)}},{key:"setMediaState",value:function(e,t,n){var r;return gb(this,void 0,void 0,regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=this.currentStage)||void 0===r?void 0:r.setMediaState(e,t,n);case 2:case"end":return i.stop()}}),i,this)})))}},{key:"setMediaCurrentTime",value:function(e,t){var n;null===(n=this.currentStage)||void 0===n||n.setMediaCurrentTime(e,t)}},{key:"pause",value:function(){var e;this.app.ticker.stop(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalPause()})),this._isPaused=!0}},{key:"resume",value:function(){var e;this._isPaused=!1,this.app.ticker.start(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalResume()}))}},{key:"getSnapshot",value:function(){return this.currentStage&&this.getBase64(this.currentStage)||""}},{key:"clearLocalCache",value:function(){this.localStorage.dispose()}},{key:"clearFullscreenEventListenersWithAppView",value:function(){var e=this;["mousemove","mouseout","mouseover","touchstart","pointerdown"].forEach((function(t){e.cacheFunctionMap.has(t)&&(e.app.view.removeEventListener(t,e.cacheFunctionMap.get(t),!1),e.cacheFunctionMap.delete(t))}))}},{key:"syncFullscreenVideoState",value:function(e){this.globalEventHub.emit("syncFullscreenVideoState",e)}},{key:"destroy",value:function(){var e,t;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost),this.app.renderer.filter.texturePool.clear(!0),Av.collectObjectByGroup(this.objPoolGroup),Iv.collectObjectByGroup(this.objPoolGroup),null===(e=this.transactionPlayer)||void 0===e||e.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy(),this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext(),this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0}),null===(t=lb.worker)||void 0===t||t.terminate(),this.tracker({name:"slidePlayerDestroy",result:"",reason:"",payload:{}})}catch(e){}}},{key:"view",get:function(){return this.app.renderer?this.app.view:null}},{key:"nextSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.nextIndex)?this.currentStage.json.nextIndex:this.currentIndex+1}},{key:"prevSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.prevIndex)?this.currentStage.json.prevIndex:this.currentIndex-1}}],[{key:"clearLocalCache",value:function(){var e;null===(e=fb.localCache)||void 0===e||e.clear().catch((function(){}))}}]),n}(Ks.a);xb.platform=Pg,xb.RtcAudioClazz=null;var _b,wb=new Map,Tb=n(136),Mb=n.n(Tb),Sb=n(49),Eb=n.n(Sb),Ab=n(50),Ib=n.n(Ab),Cb=[],Nb="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(_b||(_b={}));var kb,Db=function(e){return Object.freeze(e)},Pb=function(e,t){this.inlineSize=e,this.blockSize=t,Db(this)},Ob=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Db(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Rb=function(e){return e instanceof SVGElement&&"getBBox"in e},Lb=function(e){if(Rb(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},jb=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Bb="undefined"!=typeof window?window:{},Ub=new WeakMap,Fb=/auto|scroll/,zb=/^tb|vertical/,Gb=/msie|trident/i.test(Bb.navigator&&Bb.navigator.userAgent),Hb=function(e){return parseFloat(e||"0")},Vb=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Pb((n?t:e)||0,(n?e:t)||0)},Wb=Db({devicePixelContentBoxSize:Vb(),borderBoxSize:Vb(),contentBoxSize:Vb(),contentRect:new Ob(0,0,0,0)}),Yb=function(e,t){if(void 0===t&&(t=!1),Ub.has(e)&&!t)return Ub.get(e);if(Lb(e))return Ub.set(e,Wb),Wb;var n=getComputedStyle(e),r=Rb(e)&&e.ownerSVGElement&&e.getBBox(),i=!Gb&&"border-box"===n.boxSizing,o=zb.test(n.writingMode||""),a=!r&&Fb.test(n.overflowY||""),s=!r&&Fb.test(n.overflowX||""),u=r?0:Hb(n.paddingTop),l=r?0:Hb(n.paddingRight),c=r?0:Hb(n.paddingBottom),h=r?0:Hb(n.paddingLeft),d=r?0:Hb(n.borderTopWidth),f=r?0:Hb(n.borderRightWidth),p=r?0:Hb(n.borderBottomWidth),v=h+l,m=u+c,g=(r?0:Hb(n.borderLeftWidth))+f,y=d+p,b=s?e.offsetHeight-y-e.clientHeight:0,x=a?e.offsetWidth-g-e.clientWidth:0,_=i?v+g:0,w=i?m+y:0,T=r?r.width:Hb(n.width)-_-x,M=r?r.height:Hb(n.height)-w-b,S=T+v+x+g,E=M+m+b+y,A=Db({devicePixelContentBoxSize:Vb(Math.round(T*devicePixelRatio),Math.round(M*devicePixelRatio),o),borderBoxSize:Vb(S,E,o),contentBoxSize:Vb(T,M,o),contentRect:new Ob(h,u,T,M)});return Ub.set(e,A),A},Xb=function(e,t,n){var r=Yb(e,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case _b.DEVICE_PIXEL_CONTENT_BOX:return a;case _b.BORDER_BOX:return i;default:return o}},Qb=function(e){var t=Yb(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Db([t.borderBoxSize]),this.contentBoxSize=Db([t.contentBoxSize]),this.devicePixelContentBoxSize=Db([t.devicePixelContentBoxSize])},Zb=function(e){if(Lb(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},qb=function(){var e=1/0,t=[];Cb.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Qb(t.target),i=Zb(t.target);r.push(n),t.lastReportedSize=Xb(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Kb=[],$b=0,ex={attributes:!0,characterData:!0,childList:!0,subtree:!0},tx=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],nx=function(e){return void 0===e&&(e=0),Date.now()+e},rx=!1,ix=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!rx){rx=!0;var n,r=nx(e);n=function(){var n=!1;try{n=function(){var e,t=0;for(Jb(t);Cb.some((function(e){return e.activeTargets.length>0}));)t=qb(),Jb(t);return Cb.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Nb}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Nb),window.dispatchEvent(e)),t>0}()}finally{if(rx=!1,e=r-nx(),!$b)return;n?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!kb){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Kb.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),kb=function(){n.textContent="".concat(t?t--:t++)}}Kb.push(e),kb()}((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,ex)};document.body?t():Bb.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),tx.forEach((function(t){return Bb.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),tx.forEach((function(t){return Bb.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ox=function(e){!$b&&e>0&&ix.start(),!($b+=e)&&ix.stop()},ax=function(){function e(e,t){this.target=e,this.observedBox=t||_b.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=Xb(this.target,this.observedBox,!0);return e=this.target,Rb(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),sx=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ux=new WeakMap,lx=function(e,t){for(var n=0;n=0&&(i&&Cb.splice(Cb.indexOf(n),1),n.observationTargets.splice(r,1),ox(-1))},e.disconnect=function(e){var t=this,n=ux.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),hx=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");cx.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!jb(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");cx.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!jb(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");cx.unobserve(this,e)},e.prototype.disconnect=function(){cx.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),dx=function(){function e(e,t,n,r,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=n,this.index=e,this.slideIndex=t,this.eventHub=r,this.id=i}return e.prototype.apply=function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var e;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(null===(n=e.tasks[i])||void 0===n||n.apply()),r>=0&&(e.tasks.splice(r,1),e.replaceIdleTask()),e.eventHub.emit("task-end-"+t.id)})),this.eventHub.on("task-error",(function(t){var n=t.task,r=e.tasks.findIndex((function(e){return e.index===n.index}));r>=0&&(e.tasks.splice(r,1),e.replaceIdleTask())}))}return e.prototype.replaceIdleTask=function(){for(var e,t=this,n=new Set,r=0,i=this.tasks.length;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(vx&&e.forEach&&e.forEach===vx)e.forEach(t,n);else if(e.length===e.length+0){var r,i=void 0;for(i=0,r=e.length;i1?gx.toArray(arguments):arguments[0];return gx.each(yx,(function(t){if(t.litmus(e))return gx.each(t.conversions,(function(t,n){if(bx=t.read(e),!1===xx&&!1!==bx)return xx=bx,bx.conversionName=n,bx.conversion=t,gx.BREAK})),gx.BREAK})),xx},wx=void 0,Tx={hsv_to_rgb:function(e,t,n){var r=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),o=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),u=[[n,s,o],[a,n,o],[o,n,s],[o,a,n],[s,o,n],[n,o,a]][r];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(e,t,n){var r=Math.min(e,t,n),i=Math.max(e,t,n),o=i-r,a=void 0;return 0===i?{h:NaN,s:0,v:0}:(a=e===i?(t-n)/o:t===i?2+(n-e)/o:4+(e-t)/o,(a/=6)<0&&(a+=1),{h:360*a,s:o/i,v:i/255})},rgb_to_hex:function(e,t,n){var r=this.hex_with_component(0,2,e);return r=this.hex_with_component(r,1,t),this.hex_with_component(r,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(wx=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var Gx=function(e){function t(e,n,r){Sx(this,t);var i=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),o=r||{};return i.__min=o.min,i.__max=o.max,i.__step=o.step,gx.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=zx(i.__impliedStep),i}return Ix(t,e),Ex(t,[{key:"setValue",value:function(e){var n=e;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),Ax(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=zx(e),this}}]),t}(Px),Hx=function(e){function t(e,n,r){Sx(this,t);var i=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));i.__truncationSuspended=!1;var o=i,a=void 0;function s(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=a-e.clientY;o.setValue(o.getValue()+t*o.__impliedStep),a=e.clientY}function l(){jx.unbind(window,"mousemove",u),jx.unbind(window,"mouseup",l),s()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),jx.bind(i.__input,"change",(function(){var e=parseFloat(o.__input.value);gx.isNaN(e)||o.setValue(e)})),jx.bind(i.__input,"blur",(function(){s()})),jx.bind(i.__input,"mousedown",(function(e){jx.bind(window,"mousemove",u),jx.bind(window,"mouseup",l),a=e.clientY})),jx.bind(i.__input,"keydown",(function(e){13===e.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,s())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return Ix(t,e),Ex(t,[{key:"updateDisplay",value:function(){var e,n,r;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),n=this.__precision,r=Math.pow(10,n),Math.round(e*r)/r),Ax(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Gx);function Vx(e,t,n,r,i){return r+(e-t)/(n-t)*(i-r)}var Wx=function(e){function t(e,n,r,i,o){Sx(this,t);var a=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,{min:r,max:i,step:o})),s=a;function u(e){e.preventDefault();var t=s.__background.getBoundingClientRect();return s.setValue(Vx(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function l(){jx.unbind(window,"mousemove",u),jx.unbind(window,"mouseup",l),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function c(e){var t=e.touches[0].clientX,n=s.__background.getBoundingClientRect();s.setValue(Vx(t,n.left,n.right,s.__min,s.__max))}function h(){jx.unbind(window,"touchmove",c),jx.unbind(window,"touchend",h),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),jx.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),jx.bind(window,"mousemove",u),jx.bind(window,"mouseup",l),u(e)})),jx.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(jx.bind(window,"touchmove",c),jx.bind(window,"touchend",h),c(e))})),jx.addClass(a.__background,"slider"),jx.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return Ix(t,e),Ex(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Ax(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Gx),Yx=function(e){function t(e,n,r){Sx(this,t);var i=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),o=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===r?"Fire":r,jx.bind(i.__button,"click",(function(e){return e.preventDefault(),o.fire(),!1})),jx.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return Ix(t,e),Ex(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(Px),Xx=function(e){function t(e,n){Sx(this,t);var r=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));r.__color=new Nx(r.getValue()),r.__temp=new Nx(0);var i=r;r.domElement=document.createElement("div"),jx.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",jx.bind(r.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),jx.bind(r.__input,"blur",h),jx.bind(r.__selector,"mousedown",(function(){jx.addClass(this,"drag").bind(window,"mouseup",(function(){jx.removeClass(i.__selector,"drag")}))})),jx.bind(r.__selector,"touchstart",(function(){jx.addClass(this,"drag").bind(window,"touchend",(function(){jx.removeClass(i.__selector,"drag")}))}));var o,a=document.createElement("div");function s(e){f(e),jx.bind(window,"mousemove",f),jx.bind(window,"touchmove",f),jx.bind(window,"mouseup",l),jx.bind(window,"touchend",l)}function u(e){p(e),jx.bind(window,"mousemove",p),jx.bind(window,"touchmove",p),jx.bind(window,"mouseup",c),jx.bind(window,"touchend",c)}function l(){jx.unbind(window,"mousemove",f),jx.unbind(window,"touchmove",f),jx.unbind(window,"mouseup",l),jx.unbind(window,"touchend",l),d()}function c(){jx.unbind(window,"mousemove",p),jx.unbind(window,"touchmove",p),jx.unbind(window,"mouseup",c),jx.unbind(window,"touchend",c),d()}function h(){var e=_x(this.value);!1!==e?(i.__color.__state=e,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function d(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function f(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__saturation_field.getBoundingClientRect(),n=e.touches&&e.touches[0]||e,r=n.clientX,o=n.clientY,a=(r-t.left)/(t.right-t.left),s=1-(o-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),i.__color.v=s,i.__color.s=a,i.setValue(i.__color.toOriginal()),!1}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__hue_field.getBoundingClientRect(),n=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),i.__color.h=360*n,i.setValue(i.__color.toOriginal()),!1}return gx.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),gx.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),gx.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),gx.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),gx.extend(a.style,{width:"100%",height:"100%",background:"none"}),Zx(a,"top","rgba(0,0,0,0)","#000"),gx.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=r.__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%);",gx.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),jx.bind(r.__saturation_field,"mousedown",s),jx.bind(r.__saturation_field,"touchstart",s),jx.bind(r.__field_knob,"mousedown",s),jx.bind(r.__field_knob,"touchstart",s),jx.bind(r.__hue_field,"mousedown",u),jx.bind(r.__hue_field,"touchstart",u),r.__saturation_field.appendChild(a),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return Ix(t,e),Ex(t,[{key:"updateDisplay",value:function(){var e=_x(this.getValue());if(!1!==e){var t=!1;gx.each(Nx.COMPONENTS,(function(n){if(!gx.isUndefined(e[n])&&!gx.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&gx.extend(this.__color.__state,e)}gx.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,r=255-n;gx.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,Zx(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),gx.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),t}(Px),Qx=["-moz-","-o-","-webkit-","-ms-",""];function Zx(e,t,n,r){e.style.background="",gx.each(Qx,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+r+" 100%); "}))}var qx='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',Jx=function(e,t){var n=e[t];return gx.isArray(arguments[2])||gx.isObject(arguments[2])?new Ux(e,t,arguments[2]):gx.isNumber(n)?gx.isNumber(arguments[2])&&gx.isNumber(arguments[3])?gx.isNumber(arguments[4])?new Wx(e,t,arguments[2],arguments[3],arguments[4]):new Wx(e,t,arguments[2],arguments[3]):gx.isNumber(arguments[4])?new Hx(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Hx(e,t,{min:arguments[2],max:arguments[3]}):gx.isString(n)?new Fx(e,t):gx.isFunction(n)?new Yx(e,t,""):gx.isBoolean(n)?new Bx(e,t):null},Kx=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},$x=function(){function e(){Sx(this,e),this.backgroundElement=document.createElement("div"),gx.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"}),jx.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),gx.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 t=this;jx.bind(this.backgroundElement,"click",(function(){t.hide()}))}return Ex(e,[{key:"show",value:function(){var e=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(),gx.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",jx.unbind(e.domElement,"webkitTransitionEnd",t),jx.unbind(e.domElement,"transitionend",t),jx.unbind(e.domElement,"oTransitionEnd",t)};jx.bind(this.domElement,"webkitTransitionEnd",t),jx.bind(this.domElement,"transitionend",t),jx.bind(this.domElement,"oTransitionEnd",t),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-jx.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-jx.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var n=t||document,r=document.createElement("style");r.type="text/css",r.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(r)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".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 .cr.function .property-name{width:100%}.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 e_=function(){try{return!!window.localStorage}catch(e){return!1}}(),t_=void 0,n_=!0,r_=void 0,i_=!1,o_=[],a_=function e(t){var n=this,r=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),jx.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=gx.defaults(r,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),r=gx.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),gx.isUndefined(r.load)?r.load={preset:"Default"}:r.preset&&(r.load.preset=r.preset),gx.isUndefined(r.parent)&&r.hideable&&o_.push(this),r.resizable=gx.isUndefined(r.parent)&&r.resizable,r.autoPlace&&gx.isUndefined(r.scrollable)&&(r.scrollable=!0);var i,o=e_&&"true"===localStorage.getItem(d_(this,"isLocal")),a=void 0,s=void 0;if(Object.defineProperties(this,{parent:{get:function(){return r.parent}},scrollable:{get:function(){return r.scrollable}},autoPlace:{get:function(){return r.autoPlace}},closeOnTop:{get:function(){return r.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:r.load.preset},set:function(e){n.parent?n.getRoot().preset=e:r.load.preset=e,function(e){for(var t=0;t1){var r=n.__li.nextElementSibling;return n.remove(),h_(e,n.object,n.property,{before:r,factoryArgs:[gx.toArray(arguments)]})}if(gx.isArray(t)||gx.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),h_(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof Wx){var r=new Hx(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});gx.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=n[e],i=r[e];n[e]=r[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(r,e),t.apply(n,e)}})),jx.addClass(t,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof Hx){var i=function(t){if(gx.isNumber(n.__min)&&gx.isNumber(n.__max)){var r=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var o=h_(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return o.name(r),i&&o.listen(),o}return t};n.min=gx.compose(i,n.min),n.max=gx.compose(i,n.max)}else n instanceof Bx?(jx.bind(t,"click",(function(){jx.fakeEvent(n.__checkbox,"click")})),jx.bind(n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof Yx?(jx.bind(t,"click",(function(){jx.fakeEvent(n.__button,"click")})),jx.bind(t,"mouseover",(function(){jx.addClass(n.__button,"hover")})),jx.bind(t,"mouseout",(function(){jx.removeClass(n.__button,"hover")}))):n instanceof Xx&&(jx.addClass(t,"color"),n.updateDisplay=gx.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=gx.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&l_(e.getRoot(),!0),t}),n.setValue)}(e,u,i),e.__controllers.push(i),i}function d_(e,t){return document.location.href+"."+t}function f_(e,t,n){var r=document.createElement("option");r.innerHTML=t,r.value=t,e.__preset_select.appendChild(r),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function p_(e,t){t.style.display=e.useLocalStorage?"block":"none"}function v_(e){var t=e.__save_row=document.createElement("li");jx.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),jx.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",jx.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",jx.addClass(r,"button"),jx.addClass(r,"save");var i=document.createElement("span");i.innerHTML="New",jx.addClass(i,"button"),jx.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",jx.addClass(o,"button"),jx.addClass(o,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?gx.each(e.load.remembered,(function(t,n){f_(e,n,n===e.preset)})):f_(e,"Default",!1),jx.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=g_(this)),e.folders={},gx.each(this.__folders,(function(t,n){e.folders[n]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=g_(this),l_(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=g_(this,!0)),this.load.remembered[e]=g_(this),this.preset=e,f_(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){gx.each(this.__controllers,(function(t){this.getRoot().load.remembered?c_(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),gx.each(this.__folders,(function(e){e.revert(e)})),e||l_(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&Kx.call(window,(function(){e(t)})),gx.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){gx.each(this.__controllers,(function(e){e.updateDisplay()})),gx.each(this.__folders,(function(e){e.updateDisplay()}))}});var y_=a_,b_=function(){function e(e){this.player=e}return Object.defineProperty(e.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(e){this.player.updateConfig({resolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var e,t;return(null===(e=this.player.view)||void 0===e?void 0:e.width)+"*"+(null===(t=this.player.view)||void 0===t?void 0:t.height)},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(e){this.player.updateConfig({minFPS:e,maxFPS:this.player.config.maxFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(e){this.player.updateConfig({maxFPS:e,minFPS:this.player.config.minFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(e){this.player.updateConfig({autoResolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(e){this.player.updateConfig({autoFPS:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(e){this.player.updateConfig({transactionBgColor:e})},enumerable:!1,configurable:!0}),e}(),x_=function(){function e(e,t){var n;this.config=new b_(e),this.anchor=t,n=this.createControllerGUI(),this.gui=n[0],this.controller=n[1],this.createStats()}return e.prototype.createStats=function(){var e=this;this.stateId=setInterval((function(){e.controller.frameRate.updateDisplay(),e.controller.size.updateDisplay(),e.controller.minFPS.updateDisplay(),e.controller.drawFrames.updateDisplay(),e.controller.maxFPS.updateDisplay(),e.controller.resolution.updateDisplay(),e.controller.autoFps.updateDisplay(),e.controller.autoResolution.updateDisplay(),e.controller.drawCall.updateDisplay()}),16)},e.prototype.createControllerGUI=function(){var e=new y_({autoPlace:!0,closed:!0});e.domElement.style.opacity=".6",e.domElement.style.transformOrigin="100% 0",e.domElement.style.transform="scale(1)",this.anchor.appendChild(e.domElement),e.domElement.style.position="absolute",e.domElement.style.right="0",e.domElement.style.top="0",e.domElement.style.zIndex="2";var t={frameRate:e.add(this.config,"frameRate"),drawFrames:e.add(this.config,"drawFrames"),drawCall:e.add(this.config,"drawCall"),size:e.add(this.config,"size"),minFPS:e.add(this.config,"minFPS",0,60),maxFPS:e.add(this.config,"maxFPS",0,60),resolution:e.add(this.config,"resolution",.5,8,.5),autoResolution:e.add(this.config,"autoResolution"),autoFps:e.add(this.config,"autoFPS"),transactionBgColor:e.addColor(this.config,"backgroundColor")};return[e,t]},e.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch(e){}},e}(),__=function(){function e(e){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&t.fn(e).then((function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))},this.fn=e}return e.prototype.destroy=function(){this.isDestroy=!0},e.prototype.addTask=function(e){this.tasks.push(e),this.isScheduling||this.schedule()},e}(),w_=function(){function e(e){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=e}return e.prototype.addLock=function(e,t){var n=this;this.available&&(this.locks[e]=t,this.autoUnlock[e]=window.setTimeout((function(){delete n.locks[e]}),3e3))},e.prototype.unlock=function(e,t){this.available&&t&&this.locks[e]&&this.locks[e]===t&&(window.clearTimeout(this.autoUnlock[e]),delete this.locks[e])},e.prototype.isLocked=function(e){return!!this.available&&!!this.locks[e]},e}(),T_=function(){function e(){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var t=e.tasks.shift();t&&!e.isDestroy&&(t.status="running",t.fn.apply(null).then((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})).catch((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})))}}return e.prototype.getRunningTask=function(){return this.tasks[0]&&"running"===this.tasks[0].status?this.tasks[0]:null},e.prototype.addTask=function(e,t){var n={type:e,status:"wait",fn:t},r=this.getRunningTask();r&&e===r.type||(this.tasks=this.tasks.filter((function(t){return t.type!==e})),this.tasks.push(n),this.isScheduling||this.schedule())},e.prototype.destroy=function(){this.isDestroy=!0},e}(),M_=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},S_=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.config.buffer||e))return[2];t=this.logList.splice(0),n=function(){i.logList=t.concat(i.logList),i.retryTimes>3&&i.pause(),i.retryTimes+=1},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch("https://netless-ppt-plugin-dev.cn-hangzhou.log.aliyuncs.com/logstores/netless-ppt-plugin-dev/track",{method:"POST",headers:{"x-log-apiversion":"0.6.0","Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({__topic__:"netless-ppt-plugin-dev",__source__:"netless-ppt-plugin-dev",__logs__:t})})];case 2:return o.sent().ok?this.retryTimes=0:n(),[3,4];case 3:return r=o.sent(),console.warn(r),n(),[3,4];case 4:return[2]}}))}))},e.prototype.setEnable=function(e){this.enable!==e&&(e?this.start():this.pause())},e}();function A_(e,t,n){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var r,i,o,a;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]500&&r.enableGlobalClick&&r.nextStep()}))},r.handleViewTouchStart=function(){window.clearTimeout(r.touchStartId),r.isTouchStart=!0,r.touchStartId=setTimeout((function(){r.isTouchStart=!1}),350)},r.handleViewTouchEnd=function(){r.isTouchStart&&(r.isTouchStart=!1,r.handleViewClick())},r.handleSlideRef=function(){console.log(r),window.__slide=r},r.receiveSyncHandler=function(e){return k_(r,void 0,void 0,(function(){var t,n,r,i,o,a=this;return D_(this,(function(s){switch(s.label){case 0:return Tv()(e.incrId)&&(e.incrId&&e.incrId-this._receiveIncrId!=1&&this.emit(L_.syncEventLag),this._receiveIncrId=e.incrId||0),this.logger.info("sync receive "+JSON.stringify(e),this.taskId),"nextStep"!==e.type?[3,1]:(this.mainSeqStep!==e.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(e.next,"start"),this.player.nextTick((function(){a.doNextStep(!0,e.clientId||"")}))):this.doNextStep(!0,e.clientId||""),[3,6]);case 1:return"prevStep"!==e.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===e.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(e.next+1,"start"),null===(t=this.player)||void 0===t||t.nextTick((function(){a.doPrevStep(!0)}))),[3,6]);case 2:return"interactiveAnim"!==e.type?[3,3]:(this.player?this.player.applyInteractiveAction(e.action):this.__slideState.interactiveSeqState[e.seqId]?this.__slideState.interactiveSeqState[e.seqId].step+=1:this.__slideState.interactiveSeqState[e.seqId]={step:0,state:"end"},[3,6]);case 3:return"renderSlide"!==e.type?[3,5]:[4,this.doRenderSlide(e.index,e.isForward)];case 4:return s.sent(),[3,6];case 5:"mediaPlay"===e.type?(null===(n=this.player)||void 0===n||n.setMediaState(e.id,!0),this.__slideState.mediaState[e.id]=e.state):"mediaPause"===e.type?(null===(r=this.player)||void 0===r||r.setMediaState(e.id,!1),this.__slideState.mediaState[e.id]=e.state):"mediaSeek"===e.type?(null===(i=this.player)||void 0===i||i.setMediaCurrentTime(e.id,e.time),this.__slideState.mediaState[e.id]=e.state):"mediaFullscreen"===e.type&&(e.targetId&&this.__slideState.mediaState[e.targetId]?this.__slideState.mediaState[e.targetId].fullscreen=e.state:this.__slideState.mediaState[e.targetId]={fullscreen:e.state,type:"pause",time:0},null===(o=this.player)||void 0===o||o.syncFullscreenVideoState({targetId:e.targetId,state:e.state,slideIndex:e.slideIndex})),s.label=6;case 6:return[2]}}))}))},r.handlePrevSlide=function(e){return void 0===e&&(e=!1),k_(r,void 0,void 0,(function(){var t,n;return D_(this,(function(r){return this.player?((t=this.player.prevSlideIndex)>=1&&((null===(n=this.config.navigatorDelegate)||void 0===n?void 0:n.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!1):this.renderSlide(t,!1)),[2]):[2]}))}))},r.handleNextSlide=function(e){return void 0===e&&(e=!1),k_(r,void 0,void 0,(function(){var t,n;return D_(this,(function(r){return this.player?((t=this.player.nextSlideIndex)<=this.slideCount&&((null===(n=this.config.navigatorDelegate)||void 0===n?void 0:n.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!0):this.renderSlide(t,!0)),[2]):[2]}))}))},r.handleGotoSlide=function(e){if(e<=r.slideCount&&e>=1){var t=r.slideState.currentSlideIndex<=e;r.renderSlide(e,t)}else-1===e&&r.renderSlide(r.slideCount,!0)},t.instances.push(r),r.config=r.initSlideConfig(n),r.tracker=function(e){n.whiteTracker&&n.whiteTracker.commit({name:e.name,reason:e.reason,result:e.result,payload:N_(N_({},e.payload),{slideId:r.randomId,taskId:r.taskId})},{slideVersion:r.version||""})},t.trackLogger.setEnable(!!r.config.enableTracking),r.logger={info:function(e,n){var i;t.appendLogString("INFO - "+(new Date).toISOString()+" - {"+r.randomId+"}["+n+"] "+e+"\n"),t.trackLogger.addLog(e,"info",n,r.randomId);var o=null===(i=r.config.logger)||void 0===i?void 0:i.info;o&&o("["+n+"] "+e)},warn:function(e,n){var i;t.appendLogString("WARN - "+(new Date).toISOString()+" - {"+r.randomId+"}["+n+"] "+e+"\n"),t.trackLogger.addLog(e,"warn",n,r.randomId);var o=null===(i=r.config.logger)||void 0===i?void 0:i.warn;o&&o("["+n+"] "+e)},error:function(e,n){var i;t.appendLogString("ERROR - "+(new Date).toISOString()+" - {"+r.randomId+"}["+n+"] "+e+"\n"),t.trackLogger.addLog(e,"error",n,r.randomId);var o=null===(i=r.config.logger)||void 0===i?void 0:i.error;o&&o("["+n+"] "+e)}},r.logger.info("new slide with clientId: "+r.config.clientId+", version: "+r.version,r.taskId),r.tracker({name:"initSlide",result:"",reason:"",payload:{taskId:r.taskId}}),r.anchor=r.config.anchor,r.syncQueue=new __(r.receiveSyncHandler),r.lock=new w_("interactive"===r.mode),r.cacheImage.style.position="absolute",r.cacheImage.style.zIndex="100",r.setMedianControllerAttribute(),r.canvasContainer.style.position="relative",r.canvasContainer.style.fontSize="0",r.canvasContainer.appendChild(r.medianController),r.frame.appendChild(r.canvasContainer),r.frameResizeObserver.observe(r.frame),r.on(L_.syncReceive,(function(e){r.lock.unlock(e.type,e.uuid),r.syncQueue.addTask(e)})),r.renderingTaskManager.eventHub.on("task-error",(function(e){var t=e.error,n=e.task,i=rv.transform(t);i.errorType===Jp.RuntimeWarn?r.logger.warn(i.message,r.taskId):r.logger.error(i.message,r.taskId),r.isLoading=!1,r.reportError(i,n.slideIndex)})),window.addEventListener("__slide_ref__",r.handleSlideRef),r.resizeView=Eb()(r.resizeView.bind(r),50),r.player=r.initPlayer(r.config),r.config.controller&&r.createController(),r.player.view&&r.canvasContainer.appendChild(r.player.view),r.handleViewClick=Eb()(r.handleViewClick,300),r.player.errorChannel.on("error",(function(e,t){var n=rv.transform(e);n.errorType===Jp.RuntimeWarn?r.logger.warn(n.message,r.taskId):r.logger.error(n.message,r.taskId),r.isLoading=!1,r.reportError(e,t),r.tracker({name:"slideError",reason:n.errorMsg,result:"",payload:{code:n.errorType}})})),window.addEventListener("message",r.recoverHandler),t.volumeAdjuster.on("update",r._updateVolumeByStaticAdjuster),r.volumeAdjuster.volume=t.volumeAdjuster.volume,r}var n,r;return C_(t,e),t.flushLog=function(e){return void 0===e&&(e=!1),k_(this,void 0,void 0,(function(){return D_(this,(function(n){switch(n.label){case 0:if(!(t._tempLog.length>131072||e&&t._tempLog.length>0))return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null==U_?void 0:U_.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)];case 2:case 3:return n.sent(),[3,4];case 4:t._tempLog="",t._tempLogIndex+=1,n.label=5;case 5:return[2]}}))}))},t.stopRemoteLog=function(){t.remoteLogAddress=null},t.startRemoteLog=function(e){return k_(this,void 0,void 0,(function(){var n,r,i,o,a;return D_(this,(function(s){switch(s.label){case 0:return t.remoteLogAddress=e,[4,t.flushLog(!0)];case 1:if(s.sent(),!U_)return[3,13];n=[],s.label=2;case 2:return s.trys.push([2,4,,5]),[4,U_.keys()];case 3:return n=(s.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return s.sent(),[3,5];case 5:r=0,i=n,s.label=6;case 6:if(!(r0&&o>0){var a=this.frameWidth/i,s=a*o;s>this.frameHeight&&(a*=this.frameHeight/s),null===(t=this.player)||void 0===t||t.scaleView(a,this.resize,e),this.cacheImage.style.transform="scale("+a+")",this.medianController.style.transform="scale("+a+")",this.medianController.setAttribute("data-scale",a.toString()),this.isInitResized||(this.isInitResized=!0,null===(n=this.player)||void 0===n||n.clock.setTimeout((function(){r.frame.style.visibility="visible"}),32))}},t.prototype.setSlideState=function(e){var t,n,r;return k_(this,void 0,void 0,(function(){var i,o=this;return D_(this,(function(a){switch(a.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(e),this.taskId),e.taskId&&e.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=e.taskId,null===(t=this.player)||void 0===t||t.setResourceData(e.taskId,this.__slideState.url)),e.url&&e.url!==this.__slideState.url&&(this.__slideState.url=e.url,null===(n=this.player)||void 0===n||n.setResourceData(this.__slideState.taskId,e.url)),Number.isInteger(e.currentSlideIndex)&&e.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=e.currentSlideIndex,[4,this.doRenderSlide(e.currentSlideIndex)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,null===(r=this.player)||void 0===r?void 0:r.clock.waitUntil((function(){var t,n;return(null===(t=o.player)||void 0===t?void 0:t.currentIndex)===e.currentSlideIndex&&(null===(n=o.player)||void 0===n?void 0:n.currentStage)}),3e3)];case 3:return a.sent(),i=!1,Number.isInteger(e.mainSeqStep)&&e.mainSeqStep!==this.__slideState.mainSeqStep&&(i=!0,this.__slideState.mainSeqStep=e.mainSeqStep),e.mainSeqState&&e.mainSeqState!==this.__slideState.mainSeqState&&(i=!0,this.__slideState.mainSeqState=e.mainSeqState),i&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),e.interactiveSeqState&&(this.initInteractiveSeq(e),this.__slideState.interactiveSeqState=e.interactiveSeqState),[4,O_(1500)];case 4:return a.sent(),e.mediaState&&(this.initMedia(e),this.__slideState.mediaState=e.mediaState),this.isSyncingSlideState=!1,[2]}}))}))},t.prototype.initInteractiveSeq=function(e){var t;for(var n in e.interactiveSeqState){var r=e.interactiveSeqState[n];null===(t=this.player)||void 0===t||t.setInteractiveSeqState(n,r.step,"idle"===r.state?"start":"end")}},t.prototype.initMedia=function(e){var t,n,r;for(var i in e.mediaState){var o=e.mediaState[i],a=this.__slideState.mediaState[i];if(null===(t=this.player)||void 0===t||t.syncFullscreenVideoState({targetId:i,state:!!o.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!a||o.type!==a.type||o.time!==a.time)if("play"===o.type){var s=(this.timestamp()-o.time)/1e3;null===(n=this.player)||void 0===n||n.setMediaState(i,!0,s)}else null===(r=this.player)||void 0===r||r.setMediaState(i,!1,o.time)}},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return k_(this,void 0,void 0,(function(){var e;return D_(this,(function(t){switch(t.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];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,[(e=t.sent()).width,e.height]];case 4:return t.sent(),[2,[0,0]];case 5:return[2]}}))}))},t.prototype.getSlideCountAsync=function(){return k_(this,void 0,void 0,(function(){return D_(this,(function(e){switch(e.label){case 0:if(this._slideCount>0)return[2,this._slideCount];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,e.sent().json()];case 3:return[2,e.sent().slideCount];case 4:return e.sent(),[2,0];case 5:return[2]}}))}))},Object.defineProperty(t.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(t.prototype,"mainSeqLength",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(e){this.player&&(this.player.updateConfig(e),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(e,t){var n;this.taskId=e,null===(n=this.player)||void 0===n||n.setResourceData(e,t),this.__slideState.taskId=e,this.__slideState.url=t,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:e,url:t})},t.prototype._renderSlide=function(e){var t;return k_(this,void 0,void 0,(function(){var n=this;return D_(this,(function(r){switch(r.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((xb.platform.isIOS()||xb.platform.isAndroid())&&this.iosResetCache.indexOf(e)<0&&this.iosResetCache.push(e),[4,null===(t=this.player)||void 0===t?void 0:t.renderSlide(e)]);case 1:return r.sent(),this.__slideState.currentSlideIndex=e,this.resizeView(),this.__slideState.interactiveSeqState={},this.__slideState.mediaState={},this.emitStateChange(),setTimeout((function(){var e,t;if("hidden"===(null===(t=null===(e=n.player)||void 0===e?void 0:e.view)||void 0===t?void 0:t.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(e){}}),100),[2]}}))}))},t.prototype.renderSlide=function(e,t){if(void 0===t&&(t=!0),this.player){var n=Number(e);(n!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(n>this.slideCount&&this.slideCount>0||this.poseRenderSlide(n,t))}},t.prototype.needCreateNewPlayer=function(){var e=xb.platform.isLowGpuMemory()?15:30;return(xb.platform.isIOS()||xb.platform.isAndroid())&&this.iosResetCache.length>e},t.prototype.poseRenderSlide=function(e,t){"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t}):"sync"===this.mode?(this.doRenderSlide(e,t),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t})):this.doRenderSlide(e,t)},t.prototype.doRenderSlide=function(e,t){var n,r,i,o=this;if(void 0===t&&(t=!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 a=this.player.getSnapshot();this.cacheImage.src=a,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===(r=this.config)||void 0===r?void 0:r.controller)&&this.createController(),this.needClearCacheImage=!0,(null===(i=null==this?void 0:this.player)||void 0===i?void 0:i.view)&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var s=Math.random().toString(32).substr(2);return this.player.isForward=t,this.renderingTaskManager.addTask((function(){return o._renderSlide(e)}),e,s),new Promise((function(e){o.renderingTaskManager.eventHub.once("task-end-"+s,e)}))},t.prototype.getSnapshot=function(){var e,t;return null!==(t=null===(e=this.player)||void 0===e?void 0:e.getSnapshot())&&void 0!==t?t:null},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasNextStep()||this.emit(L_.slideStepEnd),this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(!1,""),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep(!1,""):this.handleNextSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+!!this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doNextStep=function(e,t){if(this.player){var n=!this.config.clientId||t===this.config.clientId;this.player.nextStep(e,n);var r=this.player.mainSeqStep();this.__slideState.mainSeqStep=r,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasPrevStep()||this.emit(L_.slideStepStart),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()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(e){if(void 0===e&&(e=!1),this.player){this.player.prevStep(e);var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},t.prototype.isSlideStateReady=function(e){return e.taskId.length>0&&e.url.length>0&&e.currentSlideIndex>0},t.prototype.emitStateChange=function(){if("local"!==this.mode&&!this.isSyncingSlideState){var e=this.slideState;!Mb()(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(L_.stateChange,e),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(e){if(!this.lock.isLocked(e.type)){var t=Math.random().toString(32).substr(2);this.lock.addLock(e.type,t);var n=N_(N_({},e),{uuid:t,clientId:this.config.clientId});"sync"===this.config.mode&&(n.incrId=this.dispatchIncrId),this.emit(L_.syncDispatch,n),this.logger.info("sync dispatch "+JSON.stringify(n),this.taskId)}},t.prototype.setMainSeqStep=function(e,t){var n;null===(n=this.player)||void 0===n||n.setMainSeqStep(e,t)},t.prototype.setInteractive=function(e){var t;this.interactive=e,null===(t=this.player)||void 0===t||t.setInteractive(e)},t.prototype.pause=function(){var e;null===(e=this.player)||void 0===e||e.pause()},t.prototype.resume=function(){var e;null===(e=this.player)||void 0===e||e.resume()},t.prototype._doFrozen=function(){var e;return k_(this,void 0,void 0,(function(){var t,n,r,i=this;return D_(this,(function(o){switch(o.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.tracker({name:"frozenSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.view&&this.player?[4,this.player.clock.waitUntil((function(){return!i.isLoading}),6e4)]:[3,2];case 1:for(n in o.sent(),t=this.player.getSnapshot()||"",this.cacheImage.src=t,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(e=this.playerController)||void 0===e||e.destroy(),this.player=void 0,this.__slideState.mediaState)r=this.__slideState.mediaState[n],this.__slideState.mediaState[n]=N_(N_({},r),{frozenTime:this.timestamp()});o.label=2;case 2:return[2]}}))}))},t.prototype.frozen=function(){var e=this;this.frozenTaskManager.addTask("frozen",(function(){return e._doFrozen()}))},t.prototype._doRelease=function(){var e,t;return k_(this,void 0,void 0,(function(){var n,r,i,o;return D_(this,(function(a){switch(a.label){case 0:if(this.logger.info("do release slide",this.taskId),this.tracker({name:"releaseSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.player)return[2];for(r in this.player=this.initPlayer(this.config),(null===(e=this.config)||void 0===e?void 0:e.controller)&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),n=this.__slideState,this.__slideState=Ib()(j_),n.mediaState)"play"===(i=n.mediaState[r]).type&&(o=Math.max(null!==(t=i.frozenTime)&&void 0!==t?t:0,i.time),i.time=this.timestamp()-(o-i.time),i.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(e){}return[2]}}))}))},t.prototype.release=function(){var e=this;this.frozenTaskManager.addTask("release",(function(){return e._doRelease()}))},t.prototype._doDestroy=function(){var e,n,r,i,o=this;this.logger.info("do destroy slide",this.taskId),this.tracker({name:"destroySlide",reason:"",result:"",payload:{taskId:this.taskId}});var a=t.instances.findIndex((function(e){return e.randomId===o.randomId}));a>=0&&t.instances.splice(a,1),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),null===(e=this.player)||void 0===e||e.removeAllListeners(),null===(n=this.player)||void 0===n||n.destroy(),null===(r=this.player)||void 0===r||r.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),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(e){}t.volumeAdjuster.off("update",this._updateVolumeByStaticAdjuster)},t.prototype.waitLoadEnd=function(){return k_(this,void 0,void 0,(function(){var e;return D_(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return this.isLoading&&e<10?[4,O_(100)]:[3,3];case 2:return t.sent(),e+=1,[3,1];case 3:return[2]}}))}))},t.prototype.preload=function(e){return this.player?this.player.preload(e):Promise.resolve()},t.prototype.destroy=function(){var e=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then((function(){e._doDestroy()})):this._doDestroy()},t.prototype.clearSlideCache=function(){var e;null===(e=this.player)||void 0===e||e.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===this.slideCount,t=0===this.mainSeqLength||this.mainSeqStep>=this.mainSeqLength-1,n="end"===this.mainSeqState||"running"===this.mainSeqState||null==this.mainSeqState;return!(e&&t&&n)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var e=1===this.player.currentIndex,t=0===this.mainSeqLength||0===this.mainSeqStep,n="idle"===this.mainSeqState||null===this.mainSeqState;return!(e&&t&&n)},t.prototype.snapshot=function(){return k_(this,void 0,void 0,(function(){return D_(this,(function(e){return this.player?[2,this.player.getSnapshot()]:[2,null]}))}))},t.prototype.snapshotWithTimingEnd=function(e){return k_(this,void 0,void 0,(function(){return D_(this,(function(t){return this.player?[2,this.player.snapshotWithTimingEnd(e)]:[2,null]}))}))},t.prototype.updateGlobalVolume=function(e){this.volumeAdjuster.volume=e},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){xb.clearLocalCache()},t.disposeLocalCache=function(){},n=t,t.preloadResource=A_,t.instances=[],t._tempFrozenIds=[],t._tempLog="",t._tempLogIndex=1,t.remoteLogAddress=null,t.usePlugin=function(e){var n,r;e.context({logger:{info:function(e){t.appendLogString("INFO - "+(new Date).toISOString()+" - "+e+"\n")},warn:function(e){t.appendLogString("WARN - "+(new Date).toISOString()+" - "+e+"\n")},error:function(e){t.appendLogString("ERROR - "+(new Date).toISOString()+" - "+e+"\n")}}}),n=e,(r=wb.get(n.hookPoint)||[]).push(n),wb.set(n.hookPoint,r)},t.volumeAdjuster=new mb,t.trackLogger=new E_,t.handleFrozenAllSlide=function(){t.instances.forEach((function(e){e.player&&(t._tempFrozenIds.push(e.randomId),e.frozen())}))},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach((function(e){var n=t.instances.find((function(t){return t.randomId===e}));n&&n.release()})),t._tempFrozenIds=[]},t.handleLogReport=function(e){return k_(void 0,void 0,void 0,(function(){var r,i,o,a,s,u;return D_(n,(function(n){switch(n.label){case 0:return[4,t.flushLog(!0)];case 1:if(n.sent(),!U_)return[3,12];r=[],n.label=2;case 2:return n.trys.push([2,4,,5]),[4,U_.keys()];case 3:return r=(n.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return n.sent(),[3,5];case 5:if(0===r.length)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:e},"*"),[2];i=0,o=r,n.label=6;case 6:if(!(i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([(r="Slide.initConfig",function(e,t,n){var i=n.value;n.value=function(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?z(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),n=e();return n?this.addDisposer(n,t):t}},{key:"addEventListener",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,n,r),this.addDisposer((function(){return e.removeEventListener(t,n,r)}),i),i}},{key:"setTimeout",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){n.remove(r),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),r)}},{key:"setInterval",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),r=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(r)}),n)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(U),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=B()}while(this.disposers.has(e));return e}}]),e}();function z(e){return function(){return e.forEach(U)}}function G(e,t,n){return Math.min(Math.max(e,t),n)}var H={exports:{}},V={exports:{}},W=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},Y=Array.prototype.concat,X=Array.prototype.slice,Q=V.exports=function(e){for(var t=[],n=0,r=e.length;n=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},ee.to.keyword=function(e){return K[e.slice(0,3)]};var re=H.exports,ie=function(){function e(t){var n=this;_(this,e),this.enable=t,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=function(e){var t,r;e instanceof CustomEvent?t=e.detail:"object"===M(r=e.data)&&null!==r&&(t=e.data),t&&("boolean"==typeof t.slide?n.enable=t.slide:"__instance"===t.slide?console.log(n):"__debug"===t.slide&&Object.values(n.apps).forEach((function(e){var t,n;null==(n=null==(t=e.controller)?void 0:t.slide)||n.createController()})))},this.initialize()}return T(e,[{key:"setAppContext",value:function(e,t){var n;((n=this.apps)[e]||(n[e]={})).context=t,this.log("[Slide] new ".concat(e))}},{key:"setAppController",value:function(e,t){var n;((n=this.apps)[e]||(n[e]={})).controller=t}},{key:"deleteApp",value:function(e){delete this.apps[e],this.log("[Slide] delete ".concat(e))}},{key:"initialize",value:function(){window.addEventListener("message",this._onMessage)}},{key:"dispose",value:function(){window.removeEventListener("message",this._onMessage)}},{key:"log",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).info.apply(e,arguments);else if(this.enable){var t;(t=console).log.apply(t,arguments)}}},{key:"verbose",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).debug.apply(e,arguments);else if(this.enable&&"verbose"===this.level){var t;(t=console).log.apply(t,arguments)}}},{key:"warn",value:function(){var e,t;this.roomLogger?(e=this.roomLogger).warn.apply(e,arguments):(t=console).warn.apply(t,arguments)}}]),e}(),oe=new ie(!1),ae=oe.log.bind(oe),se=oe.verbose.bind(oe);function ue(e){try{var t=window.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"!==t&&"transparent"!==t)return t;if(e.parentElement)return ue(e.parentElement)}catch(e){}return"#ffffff"}var le="";function ce(e){return le||(le=function(e){var t=re.get(e);if(t&&"rgb"===t.model){var n=t.value,r=(((255&Math.round(n[0]))<<16)+((255&Math.round(n[1]))<<8)+(255&Math.round(n[2]))).toString(16);return"#"+"000000".substring(r.length)+r}return e}(ue(e)),ae("[Slide] guess bg color",le)),le}var he=function(e){return e.tracker};function de(e){for(var t=e.width,n=e.height,r=e.slideCount,i=e.slideState,o=i.taskId,a=i.url,s=[],u=1;u<=r;++u)s.push({width:t,height:n,thumbnail:"".concat(a,"/").concat(o,"/preview/").concat(u,".png"),src:"ppt"});return s}function fe(e,t,n,r){var i,o=n.slideState.currentSlideIndex;if(o>0&&t.getIsWritable()){var a=[r,o].join("/");if("page"!==e.scenePathType(a)){e.removeScenes(r);for(var s=n.slideCount,u=[],l=1;l<=s;++l)u.push({name:"".concat(l)});e.putScenes(r,u)}(t.getBox().focus?e.state.sceneState.scenePath:(null==(i=t.getView())?void 0:i.focusScenePath)||"")!==a&&t.setScenePath(a)}}var pe="https://convertcdn.netless.link/dynamicConvert";t.DefaultUrl=pe;var ve={taskId:"",url:"",state:null},me=function(){function e(t){var n,r=this,i=t.context,o=t.anchor,a=t.onRenderStart,s=t.onPageChanged,u=t.onTransitionStart,c=t.onTransitionEnd,h=t.onError,d=t.onRenderError,f=t.showRenderError;_(this,e),this.sideEffect=new F,this.ready=!1,this.readyPromise=new Promise((function(e){r.resolveReady=function(){r.ready?ae("[Slide] render end"):setTimeout((function(){r.ready=!0,e()}),1e3)}})),this.onSyncDispatch=function(e){if(r.context.getIsWritable()&&r.room){var t={type:L.SLIDE_EVENTS.syncDispatch,payload:e};se("[Slide] dispatch",JSON.stringify(e)),r.context.dispatchMagixEvent(L.SLIDE_EVENTS.syncDispatch,t)}},this.magixEventListener=function(e){var t=e.payload,n=t.type,i=t.payload;n===L.SLIDE_EVENTS.syncDispatch&&(r.syncStateOnce(),se("[Slide] receive",JSON.stringify(i)),r.slide.emit(L.SLIDE_EVENTS.syncReceive,i))},this.onStateChange=function(e){r.context.getIsWritable()&&(se("[Slide] state change",JSON.stringify(e,null,2)),r.context.storage.setState({state:e}))},this.pollCount=0,this.pollReadyState=function(){r.ready?1===r._toFreeze?r.freeze():-1===r._toFreeze&&r.unfreeze():r.pollCount<40?(r.pollCount++,setTimeout(r.pollReadyState,500)):(r.pollCount=0,ae("[Slide] renderSlide 1 (retry after timeout)"),r.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=function(){return r.room&&r.room.calibrationTimestamp?r.room.calibrationTimestamp:r.player?r.player.beginTimestamp+r.player.progressTime:Date.now()},this.isFrozen=!1,this._toFreeze=0,this.freeze=function(){r.isFrozen=!0,r.ready?(ae("[Slide] freeze",r.context.appId),r.slide.frozen()):r._toFreeze=1},this.unfreeze=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.visible){e.next=2;break}return e.abrupt("return");case 2:r.isFrozen=!1,r.ready?(ae("[Slide] unfreeze",r.context.appId),r.slide.release()):r._toFreeze=-1;case 4:case"end":return e.stop()}}),e)}))),this.onVisibilityChange=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(r.visible="visible"===document.visibilityState)?(ae("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:r.savedIsFrozen}),r.savedIsFrozen||r.unfreeze()):(r.savedIsFrozen=r.isFrozen,ae("[Slide] freeze because tab becomes invisible"),r.freeze());case 1:case"end":return e.stop()}}),e)}))),this.onRenderStart=a,this.onPageChanged=s,this.onTransitionStart=u,this.onTransitionEnd=c,this.onError=h,this.onRenderError=d,this.showRenderError=null==f||f,this.context=i,this.room=i.getRoom(),this.player=this.room?void 0:i.getDisplayer(),n=this.room||this.player,oe.roomLogger=n.logger,this.slide=this.createSlide(o,{whiteTracker:he(i.getDisplayer())}),this.syncStateOnceFlag=!this.context.isAddApp,this.visible="visible"===document.visibilityState,this.savedIsFrozen=!1,this.initialize()}return T(e,[{key:"jumpToPage",value:function(e){this.ready&&(e=G(e,1,this.pageCount),this.slide.renderSlide(e))}},{key:"initialize",value:function(){this.registerEventListeners(),this.kickStart()}},{key:"kickStart",value:function(){var e=this.context,t=this.slide;e.getIsWritable()&&e.storage.ensureState(ve);var n=e.storage.state,r=n.taskId,i=n.url,o=n.state;t.setResource(r,i||pe),o?(ae("[Slide] init with state",JSON.stringify(o)),this.syncStateOnceFlag=!1,t.setSlideState(o)):e.isAddApp&&(ae("[Slide] init by renderSlide",1),t.renderSlide(1)),this.pollReadyState()}},{key:"registerEventListeners",value:function(){var e=this,t=this.context,n=this.slide,r=this.sideEffect.addDisposer(t.storage.addStateChangedListener((function(){t.storage.state.state&&(e.syncStateOnce(),e.sideEffect.flush(r))})));this.sideEffect.add((function(){return t.addMagixEventListener(L.SLIDE_EVENTS.syncDispatch,e.magixEventListener,{fireSelfEventAfterCommit:!0})})),n.on(L.SLIDE_EVENTS.renderStart,this.onRenderStart),n.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),n.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),n.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),n.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),n.on(L.SLIDE_EVENTS.renderError,this.onError),n.on(L.SLIDE_EVENTS.stateChange,this.onStateChange),n.on(L.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),n.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add((function(){return document.addEventListener("visibilitychange",e.onVisibilityChange),function(){return document.removeEventListener("visibilitychange",e.onVisibilityChange)}}))}},{key:"syncStateOnce",value:function(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(ve);var e=this.context.storage.state.state;e&&(ae("[Slide] sync with state (once)",JSON.stringify(e)),this.slide.setSlideState(e),this.syncStateOnceFlag=!1)}}},{key:"createSlide",value:function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.context.getAppOptions()||{},a=new L.Slide({anchor:e,interactive:!0,mode:"interactive",controller:oe.enable,enableGlobalClick:null==(t=o.enableGlobalClick)||t,renderOptions:{minFPS:o.minFPS||25,maxFPS:o.maxFPS||30,autoFPS:null==(n=o.autoFPS)||n,autoResolution:null==(r=o.autoResolution)||r,resolution:o.resolution,transactionBgColor:o.bgColor||ce(e),maxResolutionLevel:o.maxResolutionLevel,forceCanvas:o.forceCanvas,enableNvidiaDetect:o.enableNvidiaDetect},fixedFrameSize:o.fixedFrameSize,loaderDelegate:o.loaderDelegate,navigatorDelegate:o.navigatorDelegate,urlInterrupter:o.urlInterrupter,resourceTimeout:o.resourceTimeout,rtcAudio:o.rtcAudio,useLocalCache:o.useLocalCache,logger:o.logger,whiteTracker:i.whiteTracker,timestamp:this.timestamp});return a}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.destroyed||(ae("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}},{key:"pageCount",get:function(){return this._pageCount>0||(this._pageCount=this.slide.slideCount),this._pageCount}},{key:"page",get:function(){return this.slide.slideState.currentSlideIndex}}]),e}();var ge="undefined"!=typeof window,ye=ge&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),be=ge&&"IntersectionObserver"in window,xe=ge&&"classList"in document.createElement("p"),_e=ge&&window.devicePixelRatio>1,we={elements_selector:".lazy",container:ye||ge?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Te=function(e){return Object.assign({},we,e)},Me=function(e,t){var n,r="LazyLoad::Initialized",i=new e(t);try{n=new CustomEvent(r,{detail:{instance:i}})}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent(r,!1,!1,{instance:i})}window.dispatchEvent(n)},Se="src",Ee="srcset",Ae="sizes",Ie="poster",Ce="llOriginalAttrs",Ne="data",ke="loading",De="loaded",Pe="applied",Oe="error",Re="native",Le="data-",je="ll-status",Be=function(e,t){return e.getAttribute(Le+t)},Ue=function(e){return Be(e,je)},Fe=function(e,t){return function(e,t,n){var r=Le+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)}(e,je,t)},ze=function(e){return Fe(e,null)},Ge=function(e){return null===Ue(e)},He=function(e){return Ue(e)===Re},Ve=[ke,De,Pe,Oe],We=function(e,t,n,r){e&&(void 0===r?void 0===n?e(t):e(t,n):e(t,n,r))},Ye=function(e,t){xe?e.classList.add(t):e.className+=(e.className?" ":"")+t},Xe=function(e,t){xe?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Qe=function(e){return e.llTempImage},Ze=function(e,t){if(t){var n=t._observer;n&&n.unobserve(e)}},qe=function(e,t){e&&(e.loadingCount+=t)},Je=function(e,t){e&&(e.toLoadCount=t)},Ke=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},$e=function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&Ke(n).forEach(t)},et=function(e,t){Ke(e).forEach(t)},tt=[Se],nt=[Se,Ie],rt=[Se,Ee,Ae],it=[Ne],ot=function(e){return!!e[Ce]},at=function(e){return e[Ce]},st=function(e){return delete e[Ce]},ut=function(e,t){if(!ot(e)){var n={};t.forEach((function(t){n[t]=e.getAttribute(t)})),e[Ce]=n}},lt=function(e,t){if(ot(e)){var n=at(e);t.forEach((function(t){!function(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}(e,t,n[t])}))}},ct=function(e,t,n){Ye(e,t.class_applied),Fe(e,Pe),n&&(t.unobserve_completed&&Ze(e,t),We(t.callback_applied,e,n))},ht=function(e,t,n){Ye(e,t.class_loading),Fe(e,ke),n&&(qe(n,1),We(t.callback_loading,e,n))},dt=function(e,t,n){n&&e.setAttribute(t,n)},ft=function(e,t){dt(e,Ae,Be(e,t.data_sizes)),dt(e,Ee,Be(e,t.data_srcset)),dt(e,Se,Be(e,t.data_src))},pt={IMG:function(e,t){$e(e,(function(e){ut(e,rt),ft(e,t)})),ut(e,rt),ft(e,t)},IFRAME:function(e,t){ut(e,tt),dt(e,Se,Be(e,t.data_src))},VIDEO:function(e,t){et(e,(function(e){ut(e,tt),dt(e,Se,Be(e,t.data_src))})),ut(e,nt),dt(e,Ie,Be(e,t.data_poster)),dt(e,Se,Be(e,t.data_src)),e.load()},OBJECT:function(e,t){ut(e,it),dt(e,Ne,Be(e,t.data_src))}},vt=["IMG","IFRAME","VIDEO","OBJECT"],mt=function(e,t){!t||function(e){return e.loadingCount>0}(t)||function(e){return e.toLoadCount>0}(t)||We(e.callback_finish,t)},gt=function(e,t,n){e.addEventListener(t,n),e.llEvLisnrs[t]=n},yt=function(e,t,n){e.removeEventListener(t,n)},bt=function(e){return!!e.llEvLisnrs},xt=function(e){if(bt(e)){var t=e.llEvLisnrs;for(var n in t){var r=t[n];yt(e,n,r)}delete e.llEvLisnrs}},_t=function(e,t,n){!function(e){delete e.llTempImage}(e),qe(n,-1),function(e){e&&(e.toLoadCount-=1)}(n),Xe(e,t.class_loading),t.unobserve_completed&&Ze(e,n)},wt=function(e,t,n){var r=Qe(e)||e;if(!bt(r)){!function(e,t,n){bt(e)||(e.llEvLisnrs={});var r="VIDEO"===e.tagName?"loadeddata":"load";gt(e,r,t),gt(e,"error",n)}(r,(function(i){!function(e,t,n,r){var i=He(t);_t(t,n,r),Ye(t,n.class_loaded),Fe(t,De),We(n.callback_loaded,t,r),i||mt(n,r)}(0,e,t,n),xt(r)}),(function(i){!function(e,t,n,r){var i=He(t);_t(t,n,r),Ye(t,n.class_error),Fe(t,Oe),We(n.callback_error,t,r),n.restore_on_error&<(t,rt),i||mt(n,r)}(0,e,t,n),xt(r)}))}},Tt=function(e,t,n){!function(e){e.llTempImage=document.createElement("IMG")}(e),wt(e,t,n),function(e){ot(e)||(e[Ce]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,n){var r=Be(e,t.data_bg),i=Be(e,t.data_bg_hidpi),o=_e&&i?i:r;o&&(e.style.backgroundImage='url("'.concat(o,'")'),Qe(e).setAttribute(Se,o),ht(e,t,n))}(e,t,n),function(e,t,n){var r=Be(e,t.data_bg_multi),i=Be(e,t.data_bg_multi_hidpi),o=_e&&i?i:r;o&&(e.style.backgroundImage=o,ct(e,t,n))}(e,t,n),function(e,t,n){var r=Be(e,t.data_bg_set);if(r){var i=r.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),ct(e,t,n)}}(e,t,n)},Mt=function(e,t,n){wt(e,t,n),function(e,t,n){var r=pt[e.tagName];r&&(r(e,t),ht(e,t,n))}(e,t,n)},St=function(e,t,n){!function(e){return vt.indexOf(e.tagName)>-1}(e)?Tt(e,t,n):Mt(e,t,n)},Et=function(e,t,n){e.setAttribute("loading","lazy"),wt(e,t,n),function(e,t){var n=pt[e.tagName];n&&n(e,t)}(e,t),Fe(e,Re)},At=function(e){e.removeAttribute(Se),e.removeAttribute(Ee),e.removeAttribute(Ae)},It=function(e){$e(e,(function(e){lt(e,rt)})),lt(e,rt)},Ct={IMG:It,IFRAME:function(e){lt(e,tt)},VIDEO:function(e){et(e,(function(e){lt(e,tt)})),lt(e,nt),e.load()},OBJECT:function(e){lt(e,it)}},Nt=function(e){var t=Ct[e.tagName];t?t(e):function(e){if(ot(e)){var t=at(e);e.style.backgroundImage=t.backgroundImage}}(e)},kt=function(e,t){Nt(e),function(e,t){Ge(e)||He(e)||(Xe(e,t.class_entered),Xe(e,t.class_exited),Xe(e,t.class_applied),Xe(e,t.class_loading),Xe(e,t.class_loaded),Xe(e,t.class_error))}(e,t),ze(e),st(e)},Dt=function(e,t,n,r){n.cancel_on_exit&&function(e){return Ue(e)===ke}(e)&&"IMG"===e.tagName&&(xt(e),function(e){$e(e,(function(e){At(e)})),At(e)}(e),It(e),Xe(e,n.class_loading),qe(r,-1),ze(e),We(n.callback_cancel,e,t,r))},Pt=function(e,t,n,r){var i=function(e){return Ve.indexOf(Ue(e))>=0}(e);Fe(e,"entered"),Ye(e,n.class_entered),Xe(e,n.class_exited),function(e,t,n){t.unobserve_entered&&Ze(e,n)}(e,n,r),We(n.callback_enter,e,t,r),i||St(e,n,r)},Ot=["IMG","IFRAME","VIDEO"],Rt=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},Lt=function(e,t,n){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Pt(e.target,e,t,n):function(e,t,n,r){Ge(e)||(Ye(e,n.class_exited),Dt(e,t,n,r),We(n.callback_exit,e,t,r))}(e.target,e,t,n)}))},jt=function(e,t){be&&!Rt(e)&&(t._observer=new IntersectionObserver((function(n){Lt(n,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},Bt=function(e){return Array.prototype.slice.call(e)},Ut=function(e){return e.container.querySelectorAll(e.elements_selector)},Ft=function(e){return function(e){return Ue(e)===Oe}(e)},zt=function(e,t){return function(e){return Bt(e).filter(Ge)}(e||Ut(t))},Gt=function(e,t){var n;(n=Ut(e),Bt(n).filter(Ft)).forEach((function(t){Xe(t,e.class_error),ze(t)})),t.update()},Ht=function(e,t){var n=Te(e);this._settings=n,this.loadingCount=0,jt(n,this),function(e,t){ge&&(t._onlineHandler=function(){Gt(e,t)},window.addEventListener("online",t._onlineHandler))}(n,this),this.update(t)};Ht.prototype={update:function(e){var t,n,r=this._settings,i=zt(e,r);(Je(this,i.length),!ye&&be)?Rt(r)?function(e,t,n){e.forEach((function(e){-1!==Ot.indexOf(e.tagName)&&Et(e,t,n)})),Je(n,0)}(i,r,this):(t=this._observer,n=i,function(e){e.disconnect()}(t),function(e,t){t.forEach((function(t){e.observe(t)}))}(t,n)):this.loadAll(i)},destroy:function(){var e;this._observer&&this._observer.disconnect(),e=this,ge&&window.removeEventListener("online",e._onlineHandler),Ut(this._settings).forEach((function(e){st(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,n=this._settings;zt(e,n).forEach((function(e){Ze(e,t),St(e,n,t)}))},restoreAll:function(){var e=this._settings;Ut(e).forEach((function(t){kt(t,e)}))}},Ht.load=function(e,t){var n=Te(t);St(e,n)},Ht.resetStatus=function(e){ze(e)},ge&&function(e,t){if(t)if(t.length)for(var n,r=0;n=t[r];r+=1)Me(e,n);else Me(e,t)}(Ht,window.lazyLoadOptions);var Vt=function(){function e(t){var n=this,r=t.readonly,i=t.onNewPageIndex,o=t.onPlay,a=t.onPagesReady,s=t.urlInterrupter;_(this,e),this._pages=[],this.pageIndex=0,this.setPaused=function(){n.$btnPlay.classList.toggle(n.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=function(){n.$btnPlay.classList.toggle(n.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new F,this.readonly=r,this.onNewPageIndex=i,this.onPlay=o,this.onPagesReady=a,this.urlInterrupter=s||function(e){return e},this.render()}var t;return T(e,[{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e}},{key:"destroy",value:function(){var e;null==(e=this.previewLazyLoad)||e.destroy(),this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1))}},{key:"refreshTotalPage",value:function(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t,this.refreshPreview(),this.sideEffect.addEventListener(t,"click",(function(t){var n;if(!e.readonly){var r=null==(n=t.target.dataset)?void 0:n.pageIndex;r&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(r)),e.togglePreview(!1))}}))}return this.$preview}},{key:"refreshPreview",value:(t=l(regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,l,c,h,d,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=this.$preview,i=this.wrapClassName("preview-page"),o=this.wrapClassName("preview-page-name");r.firstChild;)r.firstChild.remove();for(a=[],s=0,u=this.pages.length;s0?"":"none"}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer"));var n=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-sidebar")),n.setAttribute("viewBox","0 0 64 64");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(n,"click",(function(){e.readonly||e.togglePreview()})),this.$btnSidebar=n,this.$btnSidebar.style.display="none",this.$footer.appendChild(n);var r=document.createElement("div");r.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),n.appendChild(r),n}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1)})),r.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-play")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),n.appendChild(r),n}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-pause")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),n.appendChild(r),n}(this.namespace));this.$btnPlay=o,this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(e.setPlaying(),e.onPlay&&e.onPlay())})),r.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1)})),r.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1)}));var l=document.createElement("span");this.$totalPage=l,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(r),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,n){var r=document.createElement("button");return r.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),r.appendChild(t),n&&r.appendChild(n),r}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&(this.previewLazyLoad||(this.previewLazyLoad=new Ht({container:this.$preview,elements_selector:".".concat(this.wrapClassName("preview-page>img"))})),this.$preview.scrollTo({top:t.offsetTop-16}))}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"pages",set:function(e){this._pages=e,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage(),this.onPagesReady&&this.onPagesReady(e)},get:function(){return this._pages}}]),e}(),Wt=new Set(["clicker"]),Yt=function(){function e(t){var r=this,i=t.box,o=t.view,a=t.mountSlideController,s=t.mountWhiteboard,u=t.baseScenePath,c=t.appId,h=t.urlInterrupter,d=t.onPagesReady;_(this,e),this.slideController=null,this.isViewMounted=!1,this.onError=function(e){var t,n,i=e.error,o=e.index;r.viewer.setPaused(),(null==(t=r.slideController)?void 0:t.showRenderError)&&(r.$overlay.textContent="Error on slide[page=".concat(r.slideController.page,"]: ").concat(i.message),r.$overlay.style.opacity="1"),(null==(n=r.slideController)?void 0:n.onRenderError)&&r.slideController.onRenderError(i,o),oe.warn("[Slide] render error",i)},this.onRenderStart=function(){r.$whiteboardView.classList.add(r.wrapClassName("wb-view-hidden")),r.viewer.setPlaying()},this.onRenderEnd=function(){},this.onPageChanged=function(){clearTimeout(r._onPageChangedTimer),r._onPageChangedTimer=setTimeout(r._onPageChanged,200)},this._onPageChangedTimer=0,this._onPageChanged=function(){r.$overlay.style.opacity="",r.$whiteboardView.classList.remove(r.wrapClassName("wb-view-hidden"))},this.refreshPages=function(){r.slideController&&(r.viewer.pages=de(r.slideController.slide),r.viewer.setPageIndex(r.getPageIndex(r.slideController.page)),r.scaleDocsToFit())},this.scaleDocsToFit=function(){if(r.slideController){var e=r.slideController.slide,t=e.width,n=e.height;t&&n&&(r.whiteboardView.moveCameraToContain({originX:-t/2,originY:-n/2,width:t,height:n,animationMode:"immediately"}),r.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return r.whiteboardView.camera.scale},minContentMode:function(){return r.whiteboardView.camera.scale},centerX:0,centerY:0,width:t,height:n}),r.isViewMounted||(r.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),r.mountWhiteboard(r.$whiteboardView)))}},this.onPlay=function(){r.slideController&&r.slideController.slide.nextStep()},this.onNewPageIndex=function(e){r.slideController&&r.slideController.jumpToPage(e+1)},this.sideEffect=new F,this.namespace="netless-app-slide",this.toPdf=l(regeneratorRuntime.mark((function e(){var t,i,o,a,s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.slideController){e.next=3;break}return r.reportProgress(100,null),e.abrupt("return");case 3:if(t=r.slideController.slide,i=1920,o=document.createElement("canvas"),a=o.getContext("2d"),s=t.slideCount,u=t.width,l=t.height,c=Math.floor(u),h=Math.floor(l),c>i&&(c=i,h=Math.floor(l*c/u)),h>i&&(h=i,c=Math.floor(u*h/l)),o.width=c,o.height=h,(d=document.createElement("canvas")).width=c,d.height=h,(f=d.getContext("2d"))&&r.getWhiteSnapshot&&a){e.next=21;break}return r.reportProgress(100,null),e.abrupt("return",null);case 21:return p=c>h?"l":"p",e.next=24,Promise.resolve().then(n.bind(n,88877));case 24:v=e.sent,m=v.jsPDF,g=new m({format:[c,h],orientation:p,compress:!0}),y=1;case 28:if(!(y<=s)){e.next=57;break}return b=null,e.prev=30,e.next=33,r.slideController.slide.snapshotWithTimingEnd(y);case 33:b=e.sent,e.next=38;break;case 36:e.prev=36,e.t0=e.catch(30);case 38:if(!b){e.next=40;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=document.createElement("img")).src=b,e.next=4,new Promise((function(e){return t.onload=e}));case 4:a.drawImage(t,0,0,c,h);case 5:case"end":return e.stop()}}),e)}))(),"t1",40);case 40:return f.clearRect(0,0,c,h),r.getWhiteSnapshot(y,d,f,u,l),e.prev=42,e.delegateYield(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.toDataURL("image/png"),(n=document.createElement("img")).src=t,e.next=5,new Promise((function(e){return n.onload=e}));case 5:a.drawImage(n,0,0,c,h);case 6:case"end":return e.stop()}}),e)}))(),"t2",44);case 44:e.next=48;break;case 46:e.prev=46,e.t3=e.catch(42);case 48:x=o.toDataURL("image/jpeg",.6),y>1&&g.addPage(),g.addImage(x,"JPEG",0,0,c,h,"","FAST"),a.clearRect(0,0,c,h),Math.ceil(y/s*100)<100&&r.reportProgress(Math.ceil(y/s*100),null);case 54:y++,e.next=28;break;case 57:_=g.output("arraybuffer"),w=r.box.title,r.reportProgress(100,{pdf:_,title:w});case 60:case"end":return e.stop()}}),e,null,[[30,36],[42,46]])}))),this.box=i,this.whiteboardView=o,this.mountSlideController=a,this.mountWhiteboard=s,this.baseScenePath=u,this.appId=c,this.viewer=new Vt({readonly:i.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:h,onPagesReady:d}),this.sideEffect.add((function(){var e=function(e){r.setReadonly(e)};return i.events.on("readonly",e),function(){return i.events.off("readonly",e)}})),this.sideEffect.add((function(){var e=function(e){"@netless/_request_save_pdf_"===e.data.type&&e.data.appId===r.appId&&r.toPdf().catch((function(){return r.reportProgress(100,null)}))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}})),this.render()}return T(e,[{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",(function(t){if(e.box.focus&&e.slideController&&!function(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.slideController.slide.prevStep();break;case"ArrowRight":case"ArrowDown":e.slideController.slide.nextStep()}}))}},{key:"renderOverlay",value:function(){if(!this.$overlay){var e=document.createElement("div");e.className=this.wrapClassName("overlay"),this.$overlay=e}return this.$overlay}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"renderWhiteboardView",value:function(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}},{key:"mount",value:function(){var e=this;return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderStart:this.onRenderStart,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){return e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"unmount",value:function(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.viewer.setReadonly(e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"toggleClickThrough",value:function(e){this.$whiteboardView.style.pointerEvents=!e||Wt.has(e)?"none":"auto"}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"getWhiteSnapshot",value:function(e,t,n,r,i){this.whiteboardView.screenshotToCanvas(n,"".concat(this.baseScenePath,"/").concat(e),t.width,t.height,{centerX:0,centerY:0,scale:Math.min(t.width/r,t.height/i)})}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),Xt=!1,Qt=2;t.FreezerLength=Qt;var Zt=function(e){return"["+e+"]"},qt={map:new Map,boxes:new Map,queue:[],validateQueue:function(){var e=this;for(this.queue.sort((function(t,n){var r,i,o,a;return-((null!=(i=null==(r=e.boxes.get(t))?void 0:r.zIndex)?i:0)-(null!=(a=null==(o=e.boxes.get(n))?void 0:o.zIndex)?a:0))})),ae("[Slide] freezer: validate",Zt(this.queue));this.queue.length>Qt;){var t=this.queue.pop(),n=this.map.get(t);n&&(ae("[Slide] freezer: validate-freeze",t,Zt(this.queue)),n.freeze())}},set:function(e,t,n){ae("[Slide] freezer: add",e,Zt(this.queue)),this.map.set(e,t),this.boxes.set(e,n),this.queue.includes(e)||this.queue.unshift(e),this.validateQueue()},delete:function(e){this.map.delete(e),this.boxes.delete(e),this.queue=this.queue.filter((function(t){return t!==e})),ae("[Slide] freezer: delete",e,Zt(this.queue))},focus:function(e){var t=this.map.get(e),n=this.queue.indexOf(e);n>-1&&this.queue.splice(n,1),this.queue.unshift(e),this.validateQueue(),ae("[Slide] freezer: focus",e,Zt(this.queue)),t&&t.unfreeze()}};t.apps=qt;var Jt=new Set;var Kt=new Set;t.addHooks=function(e){Xt=!0,e.on("focus",(function(e){var t=e.appId;qt.focus(t)})),e.on("created",(function(e){var t=e.appId;Jt.forEach((function(e){return e(t)}))})),e.on("destroy",(function(e){var t=e.appId;Kt.forEach((function(e){return e(t)}))}))};var $t=function(){return".netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden;transition:opacity .2s}.netless-app-slide-wb-view-hidden{opacity:0}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}\n"}();var en=function(){function e(t){var n=this;_(this,e),this.slide=null,this.debug=!1,this.sideEffect=new F,this.ready=!1,this.readyPromise=new Promise((function(e){n.resolveReady=function(){n.ready=!0,e()}})),this.hotkeyListener=function(e){if(n.slide)switch(e.key){case"ArrowUp":case"ArrowLeft":n.slide.prevStep();break;case"ArrowRight":case"ArrowDown":n.slide.nextStep()}},this.onPageChanged=function(e){n.viewer.setPageIndex(e-1)},this.onTransitionStart=function(){n.viewer.setPlaying()},this.onTransitionEnd=function(){n.viewer.setPaused()},this.onError=function(e){var t=e.error;n.viewer.setPaused(),console.warn("[Slide] render error",t)},this.destroyed=!1,this.refreshPages=function(){n.slide&&(n.viewer.pages=de(n.slide),n.viewer.setPageIndex(n.getPageIndex(n.slide.slideState.currentSlideIndex)))},this.onPlay=function(){n.slide&&n.slide.nextStep()},this.onNewPageIndex=function(e){n.slide&&n.slide.slideCount>0&&n.slide.renderSlide(G(e+1,1,n.slide.slideCount))},this.namespace="netless-app-slide",this.target=t.target,this.bgColor=ce(this.target),this.viewer=new Vt({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}return T(e,[{key:"render",value:function(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}},{key:"registerHotKeys",value:function(e){this.sideEffect.addEventListener(e,"keydown",this.hotkeyListener,void 0,"hotkey")}},{key:"mount",value:function(e,t){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new L.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(e,t),this.slide.renderSlide(1)}},{key:"renderStyle",value:function(){var e=document.createElement("style");return e.appendChild(document.createTextNode($t)),e}},{key:"registerEventListeners",value:function(){if(this.slide){var e=this.slide;e.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),e.on(L.SLIDE_EVENTS.renderStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.renderError,this.onError),e.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();t.SlidePreviewer=en;var tn=L.Slide.usePlugin.bind(L.Slide);t.usePlugin=tn;var nn="0.2.51";t.version=nn;var rn={kind:"Slide",setup:function(e){var t;if(console.log("[Slide] setup @ 0.2.51"),e.getIsWritable()&&e.storage.ensureState(ve),!e.storage.state.taskId)throw new Error("[Slide] no taskId");var n=e.getView();if(!n)throw new Error("[Slide] no view, please set scenePath on addApp()");n.disableCameraTransform=!0;var r=e.getBox();r.mountStyles($t);try{r.$content.dataset.appSlideVersion=nn}catch(e){}var i=e.getInitScenePath(),o=null,a=function(t){var n=e.getRoom();if(o&&o.slideController){var r=!1;n&&e.getIsWritable()&&(fe(n,e,o.slideController.slide,i),r=!0),ae("[Slide] page to",t,r?"(synced)":""),o.viewer.setPageIndex(t-1),o.viewer.setPaused(),o.onPageChanged();var a=o.viewer.pages.length;a>0&&e.dispatchAppEvent("pageStateChange",{index:t-1,length:a})}};o=new Yt({box:r,view:n,mountSlideController:function(t){var n,o,s=e.getAppOptions()||{},u=new me((n=R({context:e},t),o={onPageChanged:a,onRenderError:s.onRenderError,showRenderError:s.showRenderError},C(n,N(o))));return Xt&&qt.set(e.appId,u,r),oe.setAppController(e.appId,u),u.readyPromise.then(t.onReady).then((function(){var n=e.getRoom(),r=!1;n&&e.getIsWritable()&&(fe(n,e,u.slide,i),r=!0);var o=u.slide.slideState.currentSlideIndex;ae("[Slide] page to",o,r?"(synced)":"","(on ready)"),u.slide.on("renderEnd",t.onRenderEnd)})),u},mountWhiteboard:e.mountView.bind(e),baseScenePath:i,appId:e.appId,urlInterrupter:null==(t=e.getAppOptions())?void 0:t.urlInterrupter,onPagesReady:function(t){var n=t.length,r=(null==o?void 0:o.viewer.pageIndex)||0;e.dispatchAppEvent("pageStateChange",{index:r,length:n})}});var s=e.getRoom(),u=new F;return u.add((function(){var t;return oe.setAppContext(e.appId,e),oe.enable=(null==(t=e.getAppOptions())?void 0:t.debug)||!1,oe.level="debug",function(){return oe.deleteApp(e.appId)}})),s&&(o.toggleClickThrough(s.state.memberState.currentApplianceName),u.add((function(){var e=function(e){e.memberState&&o&&o.toggleClickThrough(e.memberState.currentApplianceName)};return s.callbacks.on("onRoomStateChanged",e),function(){return s.callbacks.off("onRoomStateChanged",e)}}))),e.emitter.on("destroy",(function(){ae("[Slide] destroy",e.appId),Xt&&qt.delete(e.appId),u.flushAll(),o&&(o.destroy(),o=null)})),o.mount(),{viewer:function(){return o},controller:function(){return null==o?void 0:o.slideController},slide:function(){var e;return null==(e=null==o?void 0:o.slideController)?void 0:e.slide},nextStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.nextStep(),!0)},prevStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.prevStep(),!0)},position:function(){var e=null==o?void 0:o.slideController;if(e)return[e.page,e.pageCount]},nextPage:function(){var e=null==o?void 0:o.slideController;if(e){var t=e.page,n=e.pageCount;if(n>0&&t0&&t>1)return e.jumpToPage(t-1),!0}return!1},jumpToPage:function(e){var t=null==o?void 0:o.slideController;if(t){var n=t.page,r=t.pageCount;if(r>0&&n>0&&n<=r)return t.jumpToPage(e),!0}return!1}}}};t.default=rn;var on=L.Slide;t.Slide=on},18808:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t,n,r,i,o,a,s,u;void 0===CanvasRenderingContext2D.prototype.ellipse&&(CanvasRenderingContext2D.prototype.ellipse=function(e,t,n,r,i,o,a,s){this.save(),this.translate(e,t),this.rotate(i),this.scale(n,r),this.arc(0,0,1,o,a,s),this.restore()}),void 0===CanvasRenderingContext2D.prototype.resetTransform&&(CanvasRenderingContext2D.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)}),void 0===CanvasRenderingContext2D.prototype.getTransform&&(CanvasRenderingContext2D.prototype.getTransform=function(){return this._t2stack&&this._t2stack[this._t2stack.length-1]||{a:1,b:0,c:0,d:1,e:0,f:0}},CanvasRenderingContext2D.prototype.save=(t=CanvasRenderingContext2D.prototype.save,function(){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var e=this._t2stack[this._t2stack.length-1];this._t2stack.push(e&&{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}),t.call(this)}),CanvasRenderingContext2D.prototype.restore=(n=CanvasRenderingContext2D.prototype.restore,function(){this._t2stack&&this._t2stack.pop(),n.call(this)}),CanvasRenderingContext2D.prototype.transform=(r=CanvasRenderingContext2D.prototype.transform,function(e,t,n,i,o,a){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var s=this._t2stack[this._t2stack.length-1],u=s.a*e+s.c*t,l=s.b*e+s.d*t,c=s.a*n+s.c*i,h=s.b*n+s.d*i,d=s.e+s.a*o+s.c*a,f=s.f+s.b*o+s.d*a;s.a=u,s.b=l,s.c=c,s.d=h,s.e=d,s.f=f,r.call(this,e,t,n,i,o,a)}),CanvasRenderingContext2D.prototype.setTransform=(i=CanvasRenderingContext2D.prototype.setTransform,function(t,n,r,o,a,s){if(this._t2stack||(this._t2stack=[{}]),"object"===e(t)||void 0===t){var u=t.a,l=t.b,c=t.c,h=t.d,d=t.e,f=t.f;this._t2stack[this._t2stack.length-1]={a:u,b:l,c:c,d:h,e:d,f:f},i.call(this,u,l,c,h,d,f)}else this._t2stack[this._t2stack.length-1]={a:t,b:n,c:r,d:o,e:a,f:s},i.call(this,t,n,r,o,a,s)}),CanvasRenderingContext2D.prototype.resetTransform=(o=CanvasRenderingContext2D.prototype.resetTransform,function(){this._t2stack||(this._t2stack=[{}]),this._t2stack[this._t2stack.length-1]={a:1,b:0,c:0,d:1,e:0,f:0},o&&o.call(this)}),CanvasRenderingContext2D.prototype.scale=(a=CanvasRenderingContext2D.prototype.scale,function(e,t){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var n=this._t2stack[this._t2stack.length-1];e=e||1,t=t||e,n.a*=e,n.c*=t,n.b*=e,n.d*=t,a.call(this,e,t)}),CanvasRenderingContext2D.prototype.rotate=(s=CanvasRenderingContext2D.prototype.rotate,function(e){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var t=this._t2stack[this._t2stack.length-1],n=Math.cos(-e),r=Math.sin(-e),i=t.a*n-t.c*r,o=t.b*n-t.d*r,a=t.c*n+t.a*r,u=t.d*n+t.b*r;return t.a=i,t.b=o,t.c=a,t.d=u,s.call(this,e)}),CanvasRenderingContext2D.prototype.translate=(u=CanvasRenderingContext2D.prototype.translate,function(e,t){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var n=this._t2stack[this._t2stack.length-1];return n.e+=e*n.a+t*n.c,n.f+=e*n.b+t*n.d,u.call(this,e,t)}))},92710:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==r(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}({"./src/CombinePlayerImplement.ts":function(e,t,n){n.d(t,"a",(function(){return y}));var r=n("@babel/runtime/regenerator"),i=n.n(r),o=n("@babel/runtime/helpers/asyncToGenerator"),a=n.n(o),s=n("@babel/runtime/helpers/classCallCheck"),u=n.n(s),l=n("@babel/runtime/helpers/createClass"),c=n.n(l),h=function(e,t,n){"string"==typeof n?console.log("[Combine-Player][".concat(e,"]: ").concat(t," -"),n):console.log("[Combine-Player][".concat(e,"]: ").concat(t," -"),JSON.stringify(n,null,2))},d=n("./src/StatusContant.ts"),f=n("./src/EventEmitter.ts"),p=n("./src/ErrorConstant.ts");function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(this.statusIgnoreCrashByDisabled[0]);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.video;if(t===o.whiteboard&&a===e){r=!0;break}}}catch(e){i.e(e)}finally{i.f()}return!r}},{key:"unlockCombineStatus",value:function(){this.statusLockInfo.isLocked=!1,this.statusLockInfo.allowStatusList=[],this.statusLockInfo.unLockStatusList=[]}},{key:"setPreviousStatus",value:function(e,t){this.whiteboardStatus.previous=e,this.videoStatus.previous=t}},{key:"dispatchEvent",value:function(e){var t=this,n=e.videoStatus,r=e.whiteboardStatus,i=e.combineStatus,o={whiteboard:this.getStatus(d.a.Whiteboard).previous,video:this.getStatus(d.a.Video).previous},a={whiteboard:r,video:n};this.debug("CombinedStatus",i,{previous:{whiteboard:d.b[o.whiteboard],video:d.b[o.video]},current:{whiteboard:d.b[a.whiteboard],video:d.b[a.video]}}),this.events.emit(i,o,a,(function(){t.setPreviousStatus(r,n)}))}},{key:"initTables",value:function(){var e=function(e){return function(t,n){return Object.freeze({combineStatus:e,whiteboardStatus:t,videoStatus:n})}},t=e(d.c.PauseSeeking),n=e(d.c.PlayingSeeking),r=e(d.c.PauseBuffering),i=e(d.c.PlayingBuffering),o=e(d.c.ToPlay),a=e(d.c.ToPause),s=e(d.c.Pause),u=e(d.c.Playing),l=e(d.c.Disabled),c=e(d.c.Ended);return Object.freeze([Object.freeze([t(d.b.PauseSeeking,d.b.PauseSeeking),t(d.b.PauseSeeking,d.b.Pause),l(d.b.PauseSeeking,d.b.PauseBuffering),l(d.b.PauseSeeking,d.b.PlayingBuffering),l(d.b.PauseSeeking,d.b.Playing),l(d.b.PauseSeeking,d.b.PlayingSeeking),t(d.b.PauseSeeking,d.b.Ended)]),Object.freeze([t(d.b.Pause,d.b.PauseSeeking),s(d.b.Pause,d.b.Pause),r(d.b.Pause,d.b.PauseBuffering),i(d.b.Pause,d.b.PlayingBuffering),o(d.b.Pause,d.b.Playing),n(d.b.Pause,d.b.PlayingSeeking),c(d.b.Pause,d.b.Ended)]),Object.freeze([l(d.b.PauseBuffering,d.b.PauseSeeking),r(d.b.PauseBuffering,d.b.Pause),r(d.b.PauseBuffering,d.b.PauseBuffering),l(d.b.PauseBuffering,d.b.PlayingBuffering),l(d.b.PauseBuffering,d.b.Playing),l(d.b.PauseBuffering,d.b.PlayingSeeking),l(d.b.PauseBuffering,d.b.Ended)]),[l(d.b.PlayingBuffering,d.b.PauseSeeking),i(d.b.PlayingBuffering,d.b.Pause),l(d.b.PlayingBuffering,d.b.PauseBuffering),i(d.b.PlayingBuffering,d.b.PlayingBuffering),a(d.b.PlayingBuffering,d.b.Playing),l(d.b.PlayingBuffering,d.b.PlayingSeeking),l(d.b.PlayingBuffering,d.b.Ended)],Object.freeze([l(d.b.Playing,d.b.PauseSeeking),o(d.b.Playing,d.b.Pause),l(d.b.Playing,d.b.PauseBuffering),a(d.b.Playing,d.b.PlayingBuffering),u(d.b.Playing,d.b.Playing),a(d.b.Playing,d.b.PlayingSeeking),a(d.b.Playing,d.b.Ended)]),Object.freeze([l(d.b.PlayingSeeking,d.b.PauseSeeking),n(d.b.PlayingSeeking,d.b.Pause),l(d.b.PlayingSeeking,d.b.PauseBuffering),l(d.b.PlayingSeeking,d.b.PlayingBuffering),a(d.b.PlayingSeeking,d.b.Playing),n(d.b.PlayingSeeking,d.b.PlayingSeeking),n(d.b.PlayingSeeking,d.b.Ended)]),Object.freeze([t(d.b.Ended,d.b.PauseSeeking),c(d.b.Ended,d.b.Pause),l(d.b.Ended,d.b.PauseBuffering),l(d.b.Ended,d.b.PlayingBuffering),a(d.b.Ended,d.b.Playing),n(d.b.Ended,d.b.PlayingSeeking),c(d.b.Ended,d.b.Ended)])])}}]),e}(),g=function(){function e(){u()(this,e),this.queue=[],this.isHanding=!1}var t;return c()(e,[{key:"append",value:function(e){var t=this;return new Promise((function(n,r){var i={handler:e,resolve:n,reject:r};t.queue.push(i),t.isHanding||t.startHandingTasksLoop()}))}},{key:"destroy",value:function(){this.queue=[]}},{key:"startHandingTasksLoop",value:(t=a()(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.isHanding=!0;case 2:if(!(this.queue.length>0)){e.next=20;break}return t=this.queue[0],e.prev=4,e.t0=t,e.next=8,t.handler();case 8:e.t1=e.sent,e.t0.resolve.call(e.t0,e.t1),e.next=15;break;case 12:e.prev=12,e.t2=e.catch(4),t.reject(e.t2);case 15:return e.prev=15,this.queue.shift(),e.finish(15);case 18:e.next=2;break;case 20:e.next=25;break;case 22:throw e.prev=22,e.t3=e.catch(0),new Error(e.t3);case 25:return e.prev=25,this.isHanding=!1,e.finish(25);case 28:case"end":return e.stop()}}),e,this,[[0,22,25,28],[4,12,15,18]])}))),function(){return t.apply(this,arguments)})}]),e}(),y=function(){function e(t){u()(this,e),this.video=void 0,this.whiteboard=void 0,this.videoOptions=void 0,this.stateMachine=void 0,this._playbackRate=1,this.seekTime=NaN,this.triggerSource=d.e.None,this.currentCombineStatus=d.d.PauseBuffering,this.whiteboardEmitter=void 0,this.taskQueue=new g,this.onStatusChangeHandleList=[];var n=t.videoConfig,r=t.whiteboard,i=t.whiteboardEmitter,o=t.debug;this.videoOptions=n.videoOptions,this.video=n.video,this.whiteboard=r,this.whiteboardEmitter=i,this.stateMachine=new m(o),this.initOnCrashByDisabledStatusCallback(),this.initVideo(n.isCanplay),this.initWhiteboard()}var t,n,r,o,s,l,h,f,v,y,b,x,_,w,T,M,S,E;return c()(e,[{key:"setOnStatusChange",value:function(e){this.onStatusChangeHandleList.push(e)}},{key:"removeStatusChange",value:function(e){this.onStatusChangeHandleList=this.onStatusChangeHandleList.filter((function(t){return t!==e}))}},{key:"removeAllStatusChange",value:function(){this.onStatusChangeHandleList=[]}},{key:"getStatus",value:function(){return this.combinedStatus}},{key:"playbackSpeed",value:function(e){this.playbackRate=e}},{key:"stop",value:function(){if(this.currentCombineStatus===d.d.Stopped)throw new Error(p.d);if(this.currentCombineStatus===d.d.Disabled)throw new Error(p.c);this.releaseEvents(),this.onStatusUpdate(d.d.Stopped)}},{key:"play",value:(E=a()(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.taskQueue.append(a()(i.a.mark((function e(){var n,r,o;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.triggerSource=d.e.Plugin,n=t.stateMachine.getCombinationStatus().current,e.t0=n,e.next=e.t0===d.c.Pause?5:e.t0===d.c.PauseBuffering?8:e.t0===d.c.Ended?24:27;break;case 5:return e.next=7,t.playWhenPause();case 7:return e.abrupt("break",27);case 8:if(r=t.stateMachine.getStatus(d.a.Video).current,o=t.stateMachine.getStatus(d.a.Whiteboard).current,r!==d.b.Pause||o!==d.b.PauseBuffering){e.next=15;break}return e.next=13,t.playWhenVideoIsPauseAndWhiteboardIsPauseBuffering();case 13:e.next=23;break;case 15:if(r!==d.b.PauseBuffering||o!==d.b.Pause){e.next=21;break}return t.onStatusUpdate(d.d.PlayingBuffering),e.next=19,t.playWhenPause();case 19:e.next=23;break;case 21:return e.next=23,t.playWhenAllPlayerIsPauseBuffering();case 23:return e.abrupt("break",27);case 24:return e.next=26,t.playWhenEnded();case 26:return e.abrupt("break",27);case 27:if(isNaN(t.seekTime)){e.next=31;break}return e.next=30,t.seekWhenPlaying(t.seekTime);case 30:t.seekTime=NaN;case 31:t.triggerSource=d.e.None;case 32:case"end":return e.stop()}}),e)}))));case 4:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"pause",value:(S=a()(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.taskQueue.append(a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.triggerSource=d.e.Plugin,t.stateMachine.getCombinationStatus().current!==d.c.Playing){e.next=5;break}return e.next=5,t.pauseWhenPlaying();case 5:t.triggerSource=d.e.None;case 6:case"end":return e.stop()}}),e)})))));case 3:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"seek",value:(M=a()(i.a.mark((function e(t){var n=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.taskQueue.append(a()(i.a.mark((function e(){var r,o,a,s,u,l,c,h,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.whiteboard.progressTime,o=n.video.currentTime(),0!==r||0!==o){e.next=5;break}return 0!==t&&(n.seekTime=t),e.abrupt("return");case 5:n.triggerSource=d.e.Plugin,a=n.stateMachine.getCombinationStatus().current,e.t0=a,e.next=e.t0===d.c.Playing?10:e.t0===d.c.Pause||e.t0===d.c.PauseBuffering?13:e.t0===d.c.Ended?23:30;break;case 10:return e.next=12,n.seekWhenPlaying(t);case 12:return e.abrupt("break",30);case 13:if(s=n.getPlayerDuration(),u=s.video,l=s.whiteboard,!(t>u||t>l)){e.next=20;break}return e.next=18,n.seekWhenPauseFinallyIsEnded(t,s);case 18:e.next=22;break;case 20:return e.next=22,n.seekWhenPause(t);case 22:return e.abrupt("break",30);case 23:if(c=n.getPlayerDuration(),h=c.video,f=c.whiteboard,!(t<=h&&t<=f)){e.next=29;break}return e.next=27,n.seekWhenPause(t);case 27:return e.next=29,n.playWhenPause();case 29:return e.abrupt("break",30);case 30:n.triggerSource=d.e.None;case 31:case"end":return e.stop()}}),e)})))));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"initVideo",value:function(e){this.stateMachine.setStatus(d.a.Video,e?d.b.Pause:d.b.PauseBuffering),e||(this.currentCombineStatus=d.d.PauseBuffering),this.initVideoJSEvents()}},{key:"initVideoJSEvents",value:function(){var e=this,t=!1,n=function(t){return a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.triggerSource!==d.e.None&&e.triggerSource!==d.e.Video){n.next=4;break}return e.triggerSource=d.e.Video,n.next=4,t();case 4:case"end":return n.stop()}}),n)})))};this.video.on("canplay",(function(){var t=e.stateMachine.getStatus(d.a.Whiteboard).current;e.stateMachine.getStatus(d.a.Video).current===d.b.PauseBuffering&&(e.stateMachine.setStatus(d.a.Video,d.b.Pause),t===d.b.Pause&&e.onStatusUpdate(d.d.Pause))})),this.video.on("seeking",n(a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.taskQueue.append((function(){t=!0}));case 2:case"end":return n.stop()}}),n)}))))),this.video.on("waiting",n(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.onStatusUpdate(d.d.PlayingBuffering),t.next=3,e.taskQueue.append((function(){return e.pauseWhiteboardWhenVideoWaiting()}));case 3:e.triggerSource=d.e.None;case 4:case"end":return t.stop()}}),t)}))))),this.video.on("playing",n(a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.taskQueue.append(a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=2;break}return n.abrupt("return",e.playingWhiteboardWhenVideoPlayingDropFrame());case 2:return n.abrupt("return",e.playingWhiteboardWhenVideoPlaying());case 3:case"end":return n.stop()}}),n)}))));case 2:t=!1,e.triggerSource=d.e.None;case 4:case"end":return n.stop()}}),n)}))))),this.video.on("ended",n(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseWhiteboardWhenVideoEnded()}));case 2:e.triggerSource=d.e.None;case 3:case"end":return t.stop()}}),t)}))))),this.video.on("fullscreenchange",n(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){var t=e.stateMachine.getStatus(d.a.Video).current;t!==d.b.Playing&&t!==d.b.PlayingBuffering||!e.video.isFullscreen()&&e.video.paused()&&(e.whiteboardEmitter.one("pause",(function(){e.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause),e.stateMachine.setStatus(d.a.Video,d.b.Pause),e.onStatusUpdate(d.d.Pause)})),e.whiteboard.pause()),e.triggerSource=d.e.None}));case 2:case"end":return t.stop()}}),t)})))))}},{key:"initWhiteboard",value:function(){this.initWhiteboardIsPlayable(),this.initWhiteboardEvents(),this.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseBuffering),this.currentCombineStatus=d.d.PauseBuffering,this.whiteboard.seekToProgressTime(0)}},{key:"initWhiteboardIsPlayable",value:function(){var e=this;this.whiteboardEmitter.addListener("playableChange",(function(t){var n=e.stateMachine.getStatus(d.a.Whiteboard).current,r=e.stateMachine.getStatus(d.a.Video).current;t&&n===d.b.PauseBuffering&&(e.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause),r===d.b.Pause&&e.onStatusUpdate(d.d.Pause))}))}},{key:"initWhiteboardEvents",value:function(){var e=this,t=function(t){return a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.triggerSource!==d.e.None&&e.triggerSource!==d.e.Whiteboard){n.next=5;break}return e.triggerSource=d.e.Whiteboard,n.next=4,t();case 4:e.triggerSource=d.e.None;case 5:case"end":return n.stop()}}),n)})))};this.whiteboardEmitter.addListener("buffering",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseVideoWhenWhiteboardBuffering()}));case 2:case"end":return t.stop()}}),t)}))))),this.whiteboardEmitter.addListener("playing",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.playingVideoWhenWhiteboardPlaying()}));case 2:case"end":return t.stop()}}),t)}))))),this.whiteboardEmitter.addListener("ended",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseVideoWhenWhiteboardEnded()}));case 2:case"end":return t.stop()}}),t)})))))}},{key:"playWhenPause",value:(T=a()(i.a.mark((function e(){var t,n,r,o,s=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){s.stateMachine.setStatus(d.a.Video,d.b.Playing)},n=function(){s.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},this.whiteboardEmitter.one("playing",n),r=this.stateMachine.one(d.c.ToPlay,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),o=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.onStatusUpdate(d.d.Playing);case 1:case"end":return e.stop()}}),e)})))),this.video.one("playing",t),this.video.play(),e.next=10,Promise.all([r,o]);case 10:case"end":return e.stop()}}),e,this)}))),function(){return T.apply(this,arguments)})},{key:"playWhenVideoIsPauseAndWhiteboardIsPauseBuffering",value:(w=a()(i.a.mark((function e(){var t,n,r,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.Pause,d.c.PauseBuffering,d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){f.stateMachine.setStatus(d.a.Video,d.b.Playing)},n=function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)},r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingBuffering)},o=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},s=function(){f.whiteboardEmitter.removeListener("playing",o),f.whiteboardEmitter.removeListener("buffering",r),f.video.off("playing",t),f.video.off("pause",n)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.Playing,whiteboard:d.b.PauseBuffering}],a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.video.pause();case 1:case"end":return e.stop()}}),e)})))).catch((function(e){throw Error(e)})),u=this.stateMachine.one(d.c.PauseBuffering,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),l=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),c=this.stateMachine.one(d.c.ToPlay,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.video.play();case 1:case"end":return e.stop()}}),e)})))),h=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.onStatusUpdate(d.d.Playing),f.stateMachine.off([d.c.PauseBuffering,d.c.Pause,d.c.ToPlay]),s();case 3:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",r),this.whiteboardEmitter.one("playing",o),this.video.on("playing",t),this.video.one("pause",n),this.video.play(),e.next=18,Promise.all([Promise.race([u,l]),c,h]);case 18:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"playWhenAllPlayerIsPauseBuffering",value:(_=a()(i.a.mark((function e(){var t,n,r,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.ToPause,d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingBuffering)},n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},o=function(){f.stateMachine.setStatus(d.a.Video,d.b.Playing)},s=function(){f.stateMachine.setStatus(d.a.Video,d.b.PlayingBuffering)},u=function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.PlayingBuffering,whiteboard:d.b.PauseBuffering},{video:d.b.PauseBuffering,whiteboard:d.b.PlayingBuffering}],a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.stateMachine.oneButNotCrashByDisabled([{video:d.b.Playing,whiteboard:d.b.PauseBuffering},{video:d.b.PauseBuffering,whiteboard:d.b.Playing}],function(){var e=a()(i.a.mark((function e(t){var n;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=t.current).video===d.b.Playing?f.video.pause():n.whiteboard===d.b.Playing&&f.whiteboard.pause();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){throw Error(e)}));case 1:case"end":return e.stop()}}),e)})))).catch((function(e){throw Error(e)})),l=this.stateMachine.one(d.c.ToPause,function(){var e=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.current.video===d.b.Playing?f.video.pause():f.whiteboard.pause();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c=this.stateMachine.one(d.c.ToPlay,function(){var e=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.current.video===d.b.Playing?f.whiteboard.play():f.video.play();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),h=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.onStatusUpdate(d.d.Playing),f.stateMachine.cancelOneButNotCrashByDisabled(),f.stateMachine.off([d.c.ToPause,d.c.ToPlay]),f.video.off("playing",o),f.whiteboardEmitter.removeListener("playing",n),f.whiteboardEmitter.removeListener("pause",r);case 6:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",t),this.whiteboardEmitter.addListener("playing",n),this.whiteboardEmitter.one("pause",r),this.video.on("playing",o),this.video.one("play",s),this.video.one("pause",u),this.video.play(),this.whiteboard.play(),e.next=21,Promise.all([Promise.race([l,c]),h]);case 21:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"playWhenEnded",value:(x=a()(i.a.mark((function e(){var t,n,r,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PlayingBuffering),t=NaN,this.stateMachine.lockCombineStatus([d.c.Pause],[d.c.Pause]),n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseSeeking)},r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},o=function(){f.whiteboard.pause()},s=function(){f.video.off("pause",u),f.video.off("play",l),f.video.one("play",(function(){f.video.one("pause",(function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)})),f.video.pause()})),f.video.play()},u=function(){f.video.play()},l=function(){f.video.pause()},c=function(){f.stateMachine.setStatus(d.a.Video,d.b.PauseSeeking),t=window.setInterval((function(){f.video.readyState()>=d.f.HAVE_CURRENT_DATA&&(clearInterval(t),f.video.play())}),500)},h=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f.whiteboardEmitter.removeListener("buffering",n),f.whiteboardEmitter.removeListener("playing",o),clearInterval(t),e.next=5,f.playWhenPause();case 5:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",n),this.whiteboardEmitter.one("pause",r),this.whiteboardEmitter.one("playing",o),this.video.one("seeking",c),this.video.one("seeked",s),this.video.on("play",l),this.video.on("pause",u),this.whiteboard.seekToProgressTime(0),this.video.currentTime(0),e.next=22,h;case 22:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"pauseWhenPlaying",value:(b=a()(i.a.mark((function e(){var t,n,r,o=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Pause],[d.c.Pause]),t=function(){o.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},n=function(){o.stateMachine.setStatus(d.a.Video,d.b.Pause)},r=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o.onStatusUpdate(d.d.Pause);case 1:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("pause",t),this.video.one("pause",n),this.whiteboard.pause(),this.video.pause(),e.next=10,r;case 10:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"seekWhenPlaying",value:(y=a()(i.a.mark((function e(t){var n,r,o,s,u,l,c,h,f,p,v,m=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PlayingSeeking),n=NaN,r=this.getPlayerDuration(),this.stateMachine.lockCombineStatus([d.c.Pause,d.c.Ended,d.c.PlayingSeeking],[d.c.Pause,d.c.Ended]),o=function(){m.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingSeeking)},s=function(){t=d.f.HAVE_CURRENT_DATA&&(clearInterval(n),t=d.f.HAVE_CURRENT_DATA&&(clearInterval(n),h.stateMachine.setStatus(d.a.Video,d.b.Pause))}),500)},o=function(){h.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseSeeking)},s=function(){h.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},u=function(){h.whiteboard.pause()},l=function(){clearInterval(n),h.video.off("seeking",r),h.whiteboardEmitter.removeListener("buffering",o),h.whiteboardEmitter.removeListener("pause",s)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.PauseSeeking,whiteboard:d.b.PauseSeeking}]).catch((function(e){throw Error(e)})),c=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.onStatusUpdate(d.d.Pause),h.stateMachine.cancelOneButNotCrashByDisabled(),h.stateMachine.off(d.c.Ended),h.whiteboardEmitter.removeListener("playing",u),l();case 5:case"end":return e.stop()}}),e)})))),this.video.one("seeking",r),this.whiteboardEmitter.one("buffering",o),this.whiteboardEmitter.one("playing",u),this.whiteboardEmitter.one("pause",s),this.whiteboard.seekToProgressTime(t),this.video.currentTime(t/1e3),e.next=18,c;case 18:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"seekWhenPauseFinallyIsEnded",value:(f=a()(i.a.mark((function e(t,n){var r,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PauseSeeking),r=NaN,this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.Ended],[d.c.Ended]),o=function(){f.stateMachine.setStatus(d.a.Video,d.b.PauseSeeking),r=window.setInterval((function(){f.video.readyState()>=d.f.HAVE_CURRENT_DATA&&(clearInterval(r),f.stateMachine.setStatus(d.a.Video,d.b.Pause),t>=n.video&&f.stateMachine.setStatus(d.a.Video,d.b.Ended))}),500)},s=function(){t1?t-1:0),r=1;r2&&void 0!==arguments[2]&&arguments[2];a()(this,e),this.videoOptions=void 0,this.whiteboard=void 0,this.debug=void 0,Object(l.a)(n);var i=e.videoDefaultOptions(n);this.videoOptions=y(y(y({},i),n),{},{videoJsOptions:y(y({},i.videoJsOptions),n.videoJsOptions)}),this.whiteboard=t,this.debug=r}return u()(e,[{key:"create",value:function(){var e=new c.a;this.handleWhiteboardCallback(e);var t=this.getVideoDOM(),n=f()(t,this.videoOptions.videoJsOptions);return n.src(this.videoOptions.url),new h.a({videoConfig:{videoOptions:this.videoOptions,video:n,isCanplay:n.readyState()>p.f.HAVE_CURRENT_DATA},whiteboard:this.whiteboard,whiteboardEmitter:e,debug:this.debug})}},{key:"getVideoDOM",value:function(){return void 0!==this.videoOptions.videoElementID?document.getElementById(this.videoOptions.videoElementID):this.videoOptions.videoDOM}},{key:"handleWhiteboardCallback",value:function(e){this.whiteboard.callbacks.on("onPhaseChanged",(function(t){e.emit(t)})),this.whiteboard.callbacks.on("onIsPlayableChanged",(function(t){e.emit("playableChange",t)}))}}],[{key:"videoDefaultOptions",value:function(e){var t={videoJsOptions:{preload:"auto"}};return e.videoDOM||e.videoElementID||(t.videoDOM=document.createElement("video")),t}}]),e}()},0:function(e,t,n){e.exports=n("./src/index.ts")},"@babel/runtime/helpers/asyncToGenerator":function(e,t){e.exports=n(34397)},"@babel/runtime/helpers/classCallCheck":function(e,t){e.exports=n(57750)},"@babel/runtime/helpers/createClass":function(e,t){e.exports=n(67338)},"@babel/runtime/helpers/defineProperty":function(e,t){e.exports=n(91566)},"@babel/runtime/regenerator":function(e,t){e.exports=n(64910)},"video.js":function(e,t){e.exports=n(30825)}})},20597:function(e,t,n){var r,i,o,a;function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}e=n.nmd(e),window,a=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==s(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"},function(e,t){e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="},function(e,t,n){n.r(t),n.d(t,"CursorTool",(function(){return y}));var r,i=n(0),o=n(1),a=n(2),s=n.n(a),u=n(3),l=n.n(u),c=n(4),h=n.n(c),d=n(5),f=n.n(d),p=n(6),v=n.n(p),m=(n(8),r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),g=function(e){function t(t){var n=e.call(this,t)||this;return n.renderAvatar=function(e){var t,r="rgb("+e.memberState.strokeColor[0]+", "+e.memberState.strokeColor[1]+", "+e.memberState.strokeColor[2]+")";if(n.detectAvatar(e)){var o=n.detectCursorName(e);return i.createElement("img",{className:"cursor-selector-avatar",style:{width:o?19:28,height:o?19:28,position:o?"initial":"absolute",borderColor:o?"white":r,marginRight:o?4:0},src:null===(t=e.payload)||void 0===t?void 0:t.avatar,alt:"avatar"})}return null},n.getOpacity=function(e){var t=n.getCursorName(e),r=n.detectAvatar(e);return void 0===t&&void 0===r?0:1},n.getCursorName=function(e){return e.payload&&e.payload.cursorName?e.payload.cursorName:void 0},n.getThemeClass=function(e){return e.payload&&e.payload.theme?"cursor-inner-mellow":"cursor-inner"},n.getCursorBackgroundColor=function(e){var t=n.detectCursorName(e);return e.payload&&e.payload.cursorBackgroundColor?e.payload.cursorBackgroundColor:t?"rgb("+e.memberState.strokeColor[0]+", "+e.memberState.strokeColor[1]+", "+e.memberState.strokeColor[2]+")":void 0},n.getCursorTextColor=function(e){return e.payload&&e.payload.cursorTextColor?e.payload.cursorTextColor:"#FFFFFF"},n.getCursorTagBackgroundColor=function(e){return e.payload&&e.payload.cursorTagBackgroundColor?e.payload.cursorTagBackgroundColor:n.getCursorBackgroundColor(e)},n.detectCursorName=function(e){return!(!e.payload||!e.payload.cursorName)},n.detectAvatar=function(e){return!(!e.payload||!e.payload.avatar)},n.renderTag=function(e){return e.payload&&e.payload.cursorTagName?i.createElement("span",{className:"cursor-tag-name",style:{backgroundColor:n.getCursorTagBackgroundColor(e)}},e.payload.cursorTagName):void 0},n}return m(t,e),t.prototype.render=function(){var e=this.props.roomMember,t=this.getCursorName(e);switch(e.memberState.currentApplianceName){case o.ApplianceNames.pencil:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-pencil-offset"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{className:"cursor-pencil-image",src:s.a,alt:"pencilCursor"}))));case o.ApplianceNames.selector:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-selector-offset"},i.createElement("div",null,i.createElement("img",{className:"cursor-selector-image",src:l.a,alt:"selectorCursor"})),i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e)))));case o.ApplianceNames.eraser:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-pencil-offset"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{className:"cursor-pencil-image",src:h.a,alt:"selectorCursor"}))));case o.ApplianceNames.text:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-text-offset cursor-mid"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{src:v.a,alt:"selectorCursor"}))));default:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-shape-offset cursor-mid"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{src:f.a,alt:"shapeCursor"}))))}},t}(i.Component),y=function(){function e(){this.cursors={},this.roomMembers=[],this.isFirstFrameReady=!1,this.isCursorDisappear=function(e){return!(!e.payload||!e.payload.disappearCursor)}}return e.prototype.createCursor=function(){return{x:64,y:64,width:128,height:128}},e.prototype.onAddedCursor=function(e){for(var t=0,n=this.roomMembers;t0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]this.totalPage)return;this.displayer.setSceneIndex(e-1),this.dispatchMagixEvent(h.NextPage,{})}},t.prototype.handlePrevPage=function(){if(this.canOperation){var e=this.currentPage-1;if(e<0)return;this.displayer.setSceneIndex(e-1),this.dispatchMagixEvent(h.PrevPage,{})}},t.prototype.handlePageTo=function(e){if(this.canOperation){var t=e.payload;if(!Number.isSafeInteger(t)||t<=0)return;var n=t-1;this.displayer.setSceneIndex(n),this.dispatchMagixEvent(h.PageTo,n)}},t.prototype.handleRemoveAllMagixEvent=function(){var e=this;this.magixEventMap.forEach((function(t,n){e.displayer.removeMagixEventListener(n,t)})),this.magixEventMap.clear()},t.prototype.handleGetAttributes=function(){this.postMessage({kind:h.GetAttributes,payload:this.attributes})},t.prototype.postMessage=function(e){var t;this.iframe&&(null===(t=this.iframe.contentWindow)||void 0===t||t.postMessage(JSON.parse(JSON.stringify(e)),"*"))},t.prototype.dispatchMagixEvent=function(t,n){this.canOperation&&(e.prototype.setAttributes.call(this,{lastEvent:{name:t,payload:n}}),this.displayer.dispatchMagixEvent(t,n))},Object.defineProperty(t.prototype,"currentIndex",{get:function(){return this.displayer.state.sceneState.index},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPage",{get:function(){return this.currentIndex+1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalPage",{get:function(){return this.displayer.state.sceneState.scenes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return!this.displayer.isWritable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReplay",{get:function(){return(0,o.isPlayer)(this.displayer)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisplaySceneDir",{get:function(){return this.displayer.state.sceneState.scenePath.startsWith(this.attributes.displaySceneDir)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canOperation",{get:function(){return!this.isReplay&&(!this.readonly&&this.displayer.phase===o.RoomPhase.Connected)},enumerable:!1,configurable:!0}),t.prototype.isClicker=function(){if(this.readonly)return!1;var e=this.displayer.state.memberState.currentApplianceName;return this.allowAppliances.includes(e)},Object.defineProperty(t.prototype,"isDisableInput",{get:function(){return!("disableDeviceInputs"in this.displayer)||this.displayer.disableDeviceInputs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iframeOrigin",{get:function(){return this.iframe?new URL(this.iframe.src).origin:void 0},enumerable:!1,configurable:!0}),t.prototype._destory=function(){var e=this;window.removeEventListener("message",this.messageListener),this.magixEventMap.forEach((function(t,n){e.displayer.removeMagixEventListener(n,t)})),this.displayer.callbacks.off(this.callbackName,this.stateChangeListener),this.displayer.callbacks.off("onPhaseChanged",this.onPhaseChangedListener),this.magixEventMap.clear(),this.iframe&&(t.emitter.emit(h.Destory),this.iframe=null,t.alreadyCreate=!1),this.bridgeDisposer(),t.emitter.removeAllListeners()},t.kind="IframeBridge",t.emitter=new a.EventEmitter2,t.alreadyCreate=!1,t}(o.InvisiblePlugin);t.IframeBridge=g},24182:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.times=void 0;t.times=function(e,t){return new Array(e).fill(0).map((function(e,n){return t(n)}))}},82372:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.EffectPlugin=void 0;var r,i=n(26913),o=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(n,r,i){var o,a,s,u,l,c,h,d=e.call(this)||this;return d._volume=50,d._currentTime=0,d._isPaused=!0,d._duration=0,d.timer=null,d._startPos=0,d.onDurationBack=function(e,t){d.url===e&&(d._duration=t/1e3),d.emit("load")},d.onEffectStop=function(e){e===d.soundIndex&&(window.clearInterval(d.timer),d._isPaused=!0,d._duration=0,d._currentTime=0,d.emit("pause"))},d.onEffectPause=function(e){e===d.soundIndex&&(d._isPaused=!0,d.emit("pause"))},d.onEffectPlay=function(e){e===d.soundIndex&&(d.timer&&clearInterval(d.timer),d.timer=window.setInterval((function(){var e;null===(e=t.audioEffector)||void 0===e||e.getEffectCurrentPosition(d.soundIndex).then((function(e){var n;d._currentTime=e,null===(n=t.ctx)||void 0===n||n.logger.info("rtc callback position, "+e+", endPos: "+d._endPos)})).catch((function(){}))}),300),d._isPaused=!1,d.emit("play"))},null===(o=t.ctx)||void 0===o||o.logger.info("url: "+n+", start: "+r+", end: "+i),d.url=n,r&&(d._startPos=r),i&&(d._endPos=i),d.soundIndex=t.nextSoundIndex(),window.addEventListener("message",(function(e){e.data&&"resumeAllAudioInterruptByAudioSessionChanged"===e.data.name&&d.emit("resumeAllAudioInterruptByAudioSessionChanged")})),null===(a=t.audioEffector)||void 0===a||a.on("play",d.onEffectPlay),null===(s=t.audioEffector)||void 0===s||s.on("pause",d.onEffectPause),null===(u=t.audioEffector)||void 0===u||u.on("effectFinished",d.onEffectPause),null===(l=t.audioEffector)||void 0===l||l.on("error",d.onEffectStop),null===(c=t.audioEffector)||void 0===c||c.on("duration",d.onDurationBack),null===(h=t.audioEffector)||void 0===h||h.getEffectDuration(d.url),d.onEffectPause(d.soundIndex),d}return o(t,e),t.nextSoundIndex=function(){return t.soundIndex+=1,t.soundIndex},t.prototype.play=function(){var e,n,r;clearInterval(this.timer),null===(e=t.ctx)||void 0===e||e.logger.info("effect play call, "+this.url),null===(n=t.ctx)||void 0===n||n.logger.info("play "+this.url+" from "+this._startPos+" by slide, current is "+this.currentTime),null===(r=t.audioEffector)||void 0===r||r.playEffect(this.soundIndex,this.url,0,1,0,this._volume,!1,Math.max(this._currentTime,this._startPos))},t.prototype.pause=function(){var e,n;null===(e=t.ctx)||void 0===e||e.logger.info(this.url+" pause by slide"),null===(n=t.audioEffector)||void 0===n||n.pauseEffect(this.soundIndex)},t.prototype.destroy=function(){var e,n,r,i,o,a,s,u;this._startPos=0,window.clearInterval(this.timer),null===(e=t.ctx)||void 0===e||e.logger.info(this.url+" destroy by slide"),null===(n=t.audioEffector)||void 0===n||n.stopEffect(this.soundIndex),null===(r=t.audioEffector)||void 0===r||r.unloadEffect(this.soundIndex),null===(i=t.audioEffector)||void 0===i||i.removeListener("play",this.onEffectPlay),null===(o=t.audioEffector)||void 0===o||o.removeListener("pause",this.onEffectPause),null===(a=t.audioEffector)||void 0===a||a.removeListener("effectFinished",this.onEffectPause),null===(s=t.audioEffector)||void 0===s||s.removeListener("error",this.onEffectStop),null===(u=t.audioEffector)||void 0===u||u.removeListener("duration",this.onDurationBack)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._currentTime/1e3},set:function(e){var n;this._currentTime=1e3*e,null===(n=t.audioEffector)||void 0===n||n.setEffectPosition(this.soundIndex,1e3*e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this._isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),t.prototype.volume=function(e){var n;null===(n=t.audioEffector)||void 0===n||n.setEffectsVolume(100*e)},t.audioEffector=null,t.ctx=null,t.soundIndex=0,t}(i.EventEmitter),s=function(){function e(e){this.hookPoint="Slide.initConfig",this.rtc=e}return e.prototype.after=function(e){return e},e.prototype.before=function(e){var t=e[0];return a.audioEffector=this.rtc,t.rtcAudio=a,[t]},e.prototype.context=function(e){a.ctx=e},e}();t.EffectPlugin=s},29181:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.MixingPlugin=void 0;var r,i=n(26913),o=n(5495),a=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});var s=function(e){function t(n){var r=e.call(this)||this;return r.isStartPlaying=!1,r.isAudioPlaying=!1,r._volume=50,r.commandCaches=[],r.onError=function(e){var n;null===(n=t.ctx)||void 0===n||n.logger.error("audio error: "+e)},r.onAudioStalled=function(){var e;null===(e=t.ctx)||void 0===e||e.logger.warn(r.url+" Failed to fetch data, but trying.")},r.onMetaLoaded=function(){var e;null===(e=t.ctx)||void 0===e||e.logger.info(r.url+" load"),r.emit("load")},r.onAudioPlay=function(){var e,n,i,o;null===(e=t.ctx)||void 0===e||e.logger.info(r.url+" audio play"),null===(n=t.audioMixer)||void 0===n||n.startAudioMixing(r.url,!1,!1,1,(i=function(e,n){var i,o,a;r.isAudioPlaying=!0,r.isStartPlaying=!1,r.emit("play");var s=r.audio.seek();null===(i=t.audioMixer)||void 0===i||i.setAudioMixingPosition(Math.round(1e3*s)),(null===(o=t.audioMixer)||void 0===o?void 0:o.adjustAudioMixingVolume)&&(null===(a=t.audioMixer)||void 0===a||a.adjustAudioMixingVolume(r._volume)),r.commandCaches.forEach((function(e){return e()})),r.commandCaches=[]},o=0,function(){for(var e=[],t=0;t0&&void 0!==arguments[0]?arguments[0]:O.kind;return e=function(e){s(n,e);var t=l(n);function n(){return b(this,n),t.apply(this,arguments)}return n}(O),e.kind=t,e},t.SyncedStorePlugin=t.SyncedStore=t.Storage=t.STORAGE_NS=t.MAIN_STORAGE=void 0;var r=n(71895),i=n(73549),o=n(63266),a=n(5094);function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}function c(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){p(o,r,i,a,s,"next",e)}function s(e){p(o,r,i,a,s,"throw",e)}a(void 0)}))}}function m(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:(0,i.genUID)();return w(t={},A,1),w(t,"k",n),w(t,"v",e),t}(e,this.genKey()),this.refMap.set(e,t)),this.refKeys.add(t.k),t}},{key:"deleteRefKey",value:function(e){var t=this.state[e],n=this.refMap.get(t);return n&&this.refKeys.delete(n.k),t}}]),e}(),C="_WM-StOrAgE_";t.STORAGE_NS=C;var N="_WM-MaIn-StOrAgE_";t.MAIN_STORAGE=N;var k=function(){function e(t){var n=this,a=t.plugin$,s=t.isWritable$,u=t.namespace,l=void 0===u?N:u,c=t.defaultState,h=void 0===c?{}:c;if(b(this,e),this._sideEffect=new i.SideEffectManager,this._events=new o.Remitter,this._disconnected=!1,h&&!M(h))throw new Error("Default state for Storage ".concat(l," is not an object."));this.on=this._events.on.bind(this._events),this.off=this._events.off.bind(this._events);var d=function(){var e,t;return null==(t=null==(e=a.value)?void 0:e.attributes[C])?void 0:t[l]};this.namespace=l,this.defaultState=h,this._plugin$=a,this._isWritable$=s,this._refine=new I((0,r.toJS)(d()),h);var f=function(e){e&&n._events.emit("stateChanged",e)},p=function(){var e,t=(0,r.reaction)(d,(function(){var t=d();t&&(f(n._refine.replaceState((0,r.toJS)(t))),null==e||e(),e=function(e){var t=function(e){if(!(e.length<=0)){for(var t={},i=!1,o=0;o0&&n._sideEffect.addDisposer(t,"plugin-init")})))}return _(e,[{key:"setState",value:function(e){var t=this._requireAccess("setState");if(!this.isWritable)throw new Error('Cannot setState on Storage "'.concat(this.namespace,'" without writable access'));for(var n=E(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?function(){return e.forEach(h)}:e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),n=e();return n?this.addDisposer(n,t):t}},{key:"addEventListener",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,n,r),this.addDisposer((function(){return e.removeEventListener(t,n,r)}),i),i}},{key:"setTimeout",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){n.remove(r),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),r)}},{key:"setInterval",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),r=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(r)}),n)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach(h),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=c()}while(this.disposers.has(e));return e}}]),e}();t.SideEffectManager=d;var f=function(){function e(){i(this,e),this.finished=Promise.resolve(),this.disposers=new Map,this._nextTask=new Map,this._isRunning=new Set}var t,n;return a(e,[{key:"add",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this._isRunning.has(n)?this._nextTask.set(n,(function(){return t._add(e,n)})):this._add(e,n),n}},{key:"_add",value:(n=r(regeneratorRuntime.mark((function e(t,n){var i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._startTask(n),!(i=this.remove(n))){e.next=11;break}return e.prev=3,e.next=6,i();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0);case 11:return e.prev=11,e.next=14,t();case 14:(o=e.sent)&&this.disposers.set(n,Array.isArray(o)?r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(o.map(h)));case 1:case"end":return e.stop()}}),e)}))):o),e.next=21;break;case 18:e.prev=18,e.t1=e.catch(11),console.error(e.t1);case 21:this._endTask(n),(a=this._nextTask.get(n))&&(this._nextTask.delete(n),a());case 24:case"end":return e.stop()}}),e,this,[[3,8],[11,18]])}))),function(e,t){return n.apply(this,arguments)})},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.add((function(){return e}),t)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this;this._isRunning.has(e)?this._nextTask.set(e,(function(){return t._flush(e)})):this._flush(e)}},{key:"_flush",value:(t=r(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.remove(t))){e.next=12;break}return this._startTask(t),e.prev=3,e.next=6,n();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0);case 11:this._endTask(t);case 12:(r=this._nextTask.get(t))&&(this._nextTask.delete(t),r());case 14:case"end":return e.stop()}}),e,this,[[3,8]])}))),function(e){return t.apply(this,arguments)})},{key:"flushAll",value:function(){var e=this;this.disposers.forEach((function(t,n){return e.flush(n)}))}},{key:"genUID",value:function(){var e;do{e=c()}while(this.disposers.has(e));return e}},{key:"_startTask",value:function(e){var t=this;this._isRunning.add(e),this._resolveFinished||(this.finished=new Promise((function(e){t._resolveFinished=e})))}},{key:"_endTask",value:function(e){this._isRunning.delete(e),this._resolveFinished&&this._isRunning.size<=0&&this._nextTask.size<=0&&(this._resolveFinished(),this._resolveFinished=void 0)}}]),e}();t.AsyncSideEffectManager=f},59849:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.videoJsPlugin=t.Version=t.PluginId=void 0;var r,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==w(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(17328)),o=(r=n(30825))&&r.__esModule?r:{default:r},a=n(71895);function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,s,"next",e)}function s(e){u(o,r,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n=t||n<0||h&&e-l>=o}function m(){var e=ne();if(v(e))return g(e);s=setTimeout(m,function(e){var n=t-(e-u);return h?ie(n,o-(e-l)):n}(e))}function g(e){return s=void 0,d&&r?f(e):(r=i=void 0,a)}function y(){var e=ne(),n=v(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(m,t),f(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=te(t)||0,q(n)&&(c=!!n.leading,o=(h="maxWait"in n)?re(te(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},y.flush=function(){return void 0===s?a:g(ne())},y};function ae(e){var t=document.createElement("style"),n=document.createTextNode(e);t.appendChild(n),document.head.appendChild(t)}ae(".vjs-p .player-controller{position:absolute;z-index:100;bottom:0px;left:0;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;height:64px;background-image:linear-gradient(0deg,#000,transparent);transition:opacity .2s}.vjs-p .player-menu-box{display:flex;align-items:center;justify-content:center;flex-direction:column;margin-bottom:40px}.vjs-p .player-menu-cell{width:100%;text-align:center;font-size:12px;color:#7a7b7c}.vjs-p .player-multiple-play{width:64px;height:120px}.vjs-p .player-controller-actions-left{display:flex;justify-content:center;align-items:center;flex-shrink:0}.vjs-p .player-right-box{font-size:14px;color:#7a7b7c;cursor:pointer;margin-right:12px}.vjs-p .player-controller-actions{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-left:8px;padding-right:8px;margin-top:2px}.vjs-p .player-mid-box-time{font-size:9px;display:flex;justify-content:center;align-items:center;color:#fff;flex-shrink:0;margin-right:8px;font-family:monospace}.vjs-p .player-controller-play{display:flex;align-items:center;justify-content:center;cursor:pointer;padding-right:4px}.vjs-p .player-controller-progress{width:calc(100% - 28px);margin-left:14px;display:flex;align-items:center;justify-content:center;margin-top:8px}.vjs-p .player-volume{display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:16px;margin-left:16px}.vjs-p .player-volume-slider{width:60px;margin-right:12px;display:flex;align-items:center}.vjs-p .player-volume-box{display:flex;flex-direction:row}\n");ae(".vjs-p .seek-slider{position:relative;width:100%}.vjs-p .seek-slider:focus{outline:none}.vjs-p .seek-slider .track{padding:10px 0;cursor:pointer;outline:none}.vjs-p .seek-slider .track:focus{border:0;outline:none}.vjs-p .seek-slider .track .main{width:100%;height:3px;background-color:#ffffff4d;border-radius:30px;position:absolute;left:0;top:8.5px;transition:transform .4s;outline:none}.vjs-p .seek-slider .track .main:focus{border:0;outline:none}.vjs-p .seek-slider .track .main .buffered{position:absolute;background-color:#ffffff4d;width:100%;height:100%;transform:scaleX(.8);z-index:2;transform-origin:0 0}.vjs-p .seek-slider .track .main .seek-hover{position:absolute;background-color:#ffffff80;width:100%;height:100%;z-index:1;transform:scaleX(.6);transform-origin:0 0;opacity:0;transition:opacity .4s}.vjs-p .seek-slider .track .main .connect{position:absolute;background-color:#fff;width:100%;height:100%;z-index:3;left:0;transform:scaleX(.13);transform-origin:0 0}.vjs-p .seek-slider .track.active .main{transform:scaleY(2)}.vjs-p .seek-slider .thumb{pointer-events:none;position:absolute;width:12px;height:12px;left:-6px;top:4px;z-index:4;transform:translate(100px)}.vjs-p .seek-slider .thumb .handler{border-radius:100%;width:100%;height:100%;background-color:#fff;opacity:0;transform:scale(.4);cursor:pointer;transition:transform .2s;pointer-events:none}.vjs-p .seek-slider .thumb.active .handler{opacity:1;transform:scale(1)}.vjs-p .seek-slider .hover-time{position:absolute;background-color:#0000004d;line-height:18px;font-size:16px;color:#ddd;top:-25px;left:0;padding:5px 10px;border-radius:5px;box-shadow:0 0 5px #0000004d;opacity:0;transform:translate(150px);pointer-events:none}.vjs-p .seek-slider .hover-time.active{opacity:1}.vjs-p .seek-slider:hover .track .main .seek-hover{opacity:1}\n");var se=function(e){f(n,e);var t=v(n);function n(e){var r;return c(this,n),r=t.call(this,e),M(g(r),"seeking",!1),M(g(r),"mobileSeeking",!1),M(g(r),"track",null),M(g(r),"hoverTime",null),M(g(r),"offset",0),M(g(r),"secondsPrefix","00:00:"),M(g(r),"minutesPrefix","00:"),M(g(r),"seekPause",!1),M(g(r),"handleTouchSeeking",(function(e){for(var t=0,n=0;nthis.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:"translateX(".concat(e,"px)")}}},{key:"secondsToTime",value:function(e){e=Math.round(e+this.offset);var t=Math.floor(e/3600),n=e%3600,r=Math.floor(n/60),i=Math.ceil(n%60);return{hh:t.toString(),mm:r<10?"0"+r:r.toString(),ss:i<10?"0"+i:i.toString()}}},{key:"getHoverTime",value:function(){var e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),n=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+n.ss:this.props.total+this.offset<3600?this.minutesPrefix+n.mm+":"+n.ss:n.hh+":"+n.mm+":"+n.ss}},{key:"isThumbActive",value:function(){return this.state.seekHoverPosition>0||this.seeking}},{key:"drawHoverTime",value:function(){var e=this;return this.props.hideHoverTime?null:i.default.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:function(t){return e.hoverTime=t}},this.getHoverTime())}},{key:"render",value:function(){var e=this;return i.default.createElement("div",{className:"seek-slider"},i.default.createElement("div",{className:"track",ref:function(t){return e.track=t},onMouseMove:function(t){return e.handleTrackHover(!1,t)},onMouseLeave:function(t){return e.handleTrackHover(!0,t)},onMouseDown:this.onMouseDown,onTouchStart:function(t){e.setMobileSeeking(!0),e.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},i.default.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}]),n}(i.Component),ue=function(e){f(n,e);var t=v(n);function n(e){var r;return c(this,n),r=t.call(this,e),M(g(r),"stageVolume",0),M(g(r),"updateVolumeTimer",0),M(g(r),"onVolumeSeeking",!1),M(g(r),"onClickOperationButton",(function(){r.props.paused?r.props.play():r.props.pause()})),M(g(r),"operationButton",(function(){return r.props.paused?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjxwYXRoIGQ9Im03LjUxNCA1LjkwOSA3LjA1NyA0LjIzNGExIDEgMCAwIDEgMCAxLjcxNGwtNy4wNTcgNC4yMzRBMSAxIDAgMCAxIDYgMTUuMjM0VjYuNzY2YTEgMSAwIDAgMSAxLjUxNC0uODU3eiIvPjwvZz48L3N2Zz4="}):i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjxyZWN0IHg9IjciIHk9IjYiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIvPjxyZWN0IHg9IjEzIiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSIxMCIgcng9IjEiLz48L2c+PC9zdmc+"})})),M(g(r),"operationVolumeButton",(function(){return r.props.volume>.9?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXptNS43NDUgNC40MTNhLjU3Ni41NzYgMCAwIDAgMCAuODk4LjgwNS44MDUgMCAwIDAgMS4wNzggMCAyLjk0MyAyLjk0MyAwIDAgMC0uMDA0LTQuNTVoLjAwNGEuODA1LjgwNSAwIDAgMC0xLjA3OCAwIC41NzYuNTc2IDAgMCAwIDAgLjg5NiAxLjc5NCAxLjc5NCAwIDAgMSAwIDIuNzU2eiIvPjxwYXRoIGQ9Ik0xNC45MDYgNy40MTJhLjU3Ni41NzYgMCAwIDAgMCAuODk4IDQuMDcyIDQuMDcyIDAgMCAxIDAgNi40MTIuNTc2LjU3NiAwIDAgMCAwIC44OTYuODAzLjgwMyAwIDAgMCAxLjA3NiAwIDUuMjIzIDUuMjIzIDAgMCAwLS4wMDMtOC4yMDhoLjAwM2EuODA0LjgwNCAwIDAgMC0xLjA3Ni4wMDJ6Ii8+PHBhdGggZmlsbC1vcGFjaXR5PSIuMDEiIGQ9Ik0wIDBoMjJ2MjJIMHoiLz48L2c+PC9zdmc+"}):0===r.props.volume?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXoiLz48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjwvZz48L3N2Zz4="}):i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXptNS43NDUgNC40MTNhLjU3Ni41NzYgMCAwIDAgMCAuODk4LjgwNS44MDUgMCAwIDAgMS4wNzggMCAyLjk0MyAyLjk0MyAwIDAgMC0uMDA0LTQuNTVoLjAwNGEuODA1LjgwNSAwIDAgMC0xLjA3OCAwIC41NzYuNTc2IDAgMCAwIDAgLjg5NiAxLjc5NCAxLjc5NCAwIDAgMSAwIDIuNzU2eiIvPjxwYXRoIGZpbGwtb3BhY2l0eT0iLjAxIiBkPSJNMCAwaDIydjIySDB6Ii8+PC9nPjwvc3ZnPg=="})})),M(g(r),"handleClickVolume",(function(){0===r.props.volume?0!==r.stageVolume?r.props.setVolume(r.stageVolume):r.props.setVolume(1):(r.stageVolume=r.props.volume,r.props.setVolume(0))})),M(g(r),"onChange",(function(e){r.setState({currentTime:e}),e&&r.changeTime(e)})),M(g(r),"changeTime",oe((function(e){r.props.setCurrentTime(e)}),50)),M(g(r),"onVolumeChange",(function(e){r.changeVolume(e),r.setState({seekVolume:e/100})})),M(g(r),"changeVolume",oe((function(e){r.props.setVolume(e/100)}),50)),M(g(r),"onVolumeSeekStart",(function(){r.onVolumeSeeking=!0})),M(g(r),"onVolumeSeekEnd",oe((function(){r.onVolumeSeeking=!1}),500)),M(g(r),"onProgressSeekStart",(function(){return r.setState({isPlayerSeeking:!0})})),M(g(r),"onProgressSeekEnd",oe((function(){r.setState({isPlayerSeeking:!1})}),500)),r.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},r.stageVolume=e.volume,r}return d(n,[{key:"componentDidMount",value:function(){var e=this;this.updateVolumeTimer=setInterval((function(){e.onVolumeSeeking||e.setState({seekVolume:e.props.volume}),e.state.isPlayerSeeking||e.setState({currentTime:e.props.currentTime})}),100)}},{key:"componentWillUnmount",value:function(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}},{key:"render",value:function(){var e=this,t=this.props,n=t.duration,r=t.currentTime;return i.default.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},i.default.createElement("div",{className:"player-controller-progress"},i.default.createElement(se,{total:n,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),i.default.createElement("div",{className:"player-controller-actions"},i.default.createElement("div",{className:"player-controller-actions-left"},i.default.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),i.default.createElement("div",{className:"player-volume-box",onMouseEnter:function(){return e.setState({isVolumeHover:!0})},onMouseLeave:function(){return e.setState({isVolumeHover:!1})}},i.default.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),i.default.createElement("div",{className:"player-volume-slider"},i.default.createElement(se,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),i.default.createElement("div",{className:"player-mid-box-time"},le(Math.floor(r/1e3))," /"," ",le(Math.floor(n/1e3)))))}}]),n}(i.Component);function le(e){var t=e%60,n=(e-t)/60;if(n>=60){var r=n%60;return"".concat(ce((n-r)/60),":").concat(ce(r),":").concat(ce(t))}return"".concat(ce(n),":").concat(ce(t))}function ce(e){return e<=9?"0".concat(e):"".concat(e)}function he(e){var t=e.scale,n=void 0===t?1:t,r=e.size,o=e.children;return i.default.createElement("div",{style:{width:r.width/n,height:r.height/n,transform:"scale(".concat(n,")"),transformOrigin:"top left",display:"flex",overflow:"hidden"}},o)}ae('.vjs-p{display:flex;flex-grow:1;position:relative}.vjs-p *{pointer-events:auto}.vjs-p.disabled *{pointer-events:none}.vjs-p .videojs-plugin-close-icon,.vjs-p .player-controller,.vjs-p .videojs-plugin-muted-alert{pointer-events:auto}.vjs-p.disabled .videojs-plugin-close-icon,.vjs-p.disabled .player-controller{pointer-events:none}.vjs-p .video-js-plugin-header{position:absolute;z-index:100;top:-.5px;height:30px;width:100%;display:flex;background:linear-gradient(rgba(0,0,0,.85),rgba(0,0,0,.45) 40%,rgba(0,0,0,0));transition:opacity .2s;user-select:none}.vjs-p .video-js-plugin-title{padding:10px;font-size:14px;color:#fff}.vjs-p .video-js-plugin-player{position:absolute;top:0;left:0;right:0;bottom:0}.video-js,[data-vjs-player]{width:100%;height:100%}.vjs-p .videojs-plugin-close-icon.disabled{display:none}.vjs-p .videojs-plugin-close-icon{pointer-events:auto;z-index:42;color:#fff;position:absolute;top:0;right:0;width:32px;height:32px;font-size:20px;display:flex;align-items:center;justify-content:center}.vjs-p .videojs-plugin-muted-alert{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43}.vjs-p .videojs-plugin-muted-alert:before{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43;content:"";background:rgba(0,0,0,.3);font-family:VideoJS;font-size:2em;display:flex;align-items:center;justify-content:center;color:#fff}.vjs-p .videojs-plugin-recovery-mode{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:44}.vjs-p .videojs-plugin-recovery-mode button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n');var de=function(e){f(n,e);var t=v(n);function n(){return c(this,n),t.apply(this,arguments)}return d(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.cnode,r=t.size,o=t.scale;return i.default.createElement(a.CNode,{context:n},i.default.createElement(he,{size:r,scale:o},i.default.createElement(a.RoomConsumer,null,(function(t){return t&&i.default.createElement(fe,x({room:t},e.props))})),i.default.createElement(a.PlayerConsumer,null,(function(t){return t&&i.default.createElement(fe,x({player:t},e.props))}))))}}]),n}(i.Component),fe=function(e){f(n,e);var t=v(n);function n(e){var r;return c(this,n),r=t.call(this,e),M(g(r),"closeIcon",null),M(g(r),"alertMask",null),M(g(r),"container",i.default.createRef()),M(g(r),"player"),M(g(r),"controllerHiddenTimer",0),M(g(r),"syncPlayerTimer",0),M(g(r),"retryCount",0),M(g(r),"decreaseRetryTimer",0),M(g(r),"disposer"),M(g(r),"showController",(function(){r.setState({controllerVisible:!0}),r.debounceHidingController()})),M(g(r),"play",(function(){var e,t=null==(e=r.props.room)?void 0:e.calibrationTimestamp;r.debug(">>> play",{paused:!1,hostTime:t}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!1,hostTime:t})})),M(g(r),"pause",(function(){var e=r.getAttributes();if(e){var t=C(e,r.props);r.debug(">>> pause",{paused:!0,currentTime:t}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!0,currentTime:t})}})),M(g(r),"setVolume",(function(e){r.debug(">>> volume",{volume:e}),r.isEnabled()&&r.props.plugin.putAttributes({volume:e}),r.isEnabled()&&r.props.plugin.putAttributes({volume:e,muted:0===e})})),M(g(r),"setCurrentTime",(function(e){var t,n=null==(t=r.props.room)?void 0:t.calibrationTimestamp;r.debug(">>> seek",{currentTime:e/1e3,hostTime:n}),r.isEnabled()&&r.props.plugin.putAttributes({currentTime:e/1e3,hostTime:n})})),M(g(r),"resetPlayer",(function(){var e;null==(e=r.player)||e.autoplay(!1),r.debug(">>> ended",{paused:!0,currentTime:0}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!0,currentTime:0})})),M(g(r),"syncPlayerWithAttributes",(function(){var e;r.props.plugin.context;var t=r.getAttributes();if(t){var n=r.player;if(n){n.paused()!==t.paused&&(r.debug("<<< paused -> %o",t.paused),t.paused?n.pause():null==(e=n.play())||e.catch(r.catchPlayFail)),n.muted()!==t.muted&&(r.debug("<<< muted -> %o",t.muted),n.muted(t.muted)),n.volume()!==t.volume&&(r.debug("<<< volume -> %o",t.volume),n.volume(t.volume));var i=C(t,r.props);i>n.duration()?r.resetPlayer():Math.abs(n.currentTime()-i)>I.currentTimeMaxError&&(r.debug("<<< currentTime -> %o",i),n.currentTime(i))}}})),M(g(r),"debounceHidingController",(function(){r.controllerHiddenTimer&&(clearTimeout(r.controllerHiddenTimer),r.controllerHiddenTimer=0),r.controllerHiddenTimer=setTimeout((function(){r.setState({controllerVisible:!1}),r.controllerHiddenTimer=0}),3e3)})),M(g(r),"decreaseRetryCount",(function(){r.player&&r.retryCount>0&&(r.retryCount=r.retryCount-1)})),M(g(r),"catchPlayFail",(function(e){var t,n,i=String(e);if(N&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=r.player)||t.autoplay("any"),r.setState({NoSound:!0});else{var o=null==(n=r.player)?void 0:n.error();o&&(r.retryCount<=3?(r.initPlayer(),r.retryCount=r.retryCount+1):(r.debug("catch videojs media error",o),r.setState({MediaError:!0}))),r.debug("catch error",e)}})),M(g(r),"fixPlayFail",(function(){r.debug("try to fix play state"),r.setState({NoSound:!1});var e=r.getAttributes(),t=e.muted,n=e.volume;r.player&&(r.player.muted(t),r.player.volume(n))})),M(g(r),"initPlayer",l(regeneratorRuntime.mark((function e(){var t,n,i,a,s,u,l,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=r.player)||t.dispose(),r.player=void 0,r.debug("creating elements ..."),n=r.getAttributes(),i=n.type,a=n.src,s=n.poster,(u=document.createElement("div")).setAttribute("data-vjs-player",""),(l=document.createElement("video")).className="video-js",s&&(l.poster=s),l.setAttribute("playsInline",""),l.setAttribute("webkit-playsinline",""),c=document.createElement("source"),new URL(a).pathname.endsWith(".m3u8")?c.type="application/x-mpegURL":l.src=a,c.src=a,i&&(c.type=i),l.appendChild(c),u.appendChild(l),r.container.current.appendChild(u),e.next=20,new Promise((function(e){return(window.requestAnimationFrame||window.setTimeout)(e)}));case 20:r.debug("initializing videojs() ..."),h=(0,o.default)(l),r.player=h,h.one("loadedmetadata",r.gracefullyUpdate),h.on("ready",(function(){var e,t;null==(t=(e=I).onPlayer)||t.call(e,h),h.on("timeupdate",r.gracefullyUpdate),h.on("volumechange",r.gracefullyUpdate),h.on("seeked",r.gracefullyUpdate),h.on("play",r.gracefullyUpdate),h.on("pause",r.gracefullyUpdate),h.on("ended",r.resetPlayer)})),h.on("error",r.catchPlayFail),r.setState({MediaError:!1});case 27:case"end":return e.stop()}}),e)})))),M(g(r),"gracefullyUpdate",(function(){return r.setState({updater:!r.state.updater})})),M(g(r),"setupClose",(function(e){e&&(e.addEventListener("touchstart",r.removeSelf),e.addEventListener("click",r.removeSelf)),r.closeIcon=e})),M(g(r),"setupAlert",(function(e){e&&(e.addEventListener("touchstart",r.fixPlayFail),e.addEventListener("click",r.fixPlayFail)),r.alertMask=e})),M(g(r),"setupReload",(function(e){e&&(e.addEventListener("touchstart",r.initPlayer),e.addEventListener("click",r.initPlayer))})),M(g(r),"removeSelf",(function(){return r.props.plugin.remove()})),r.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/video-js-plugin@".concat(S," requires white-web-sdk@^2.13.8 to work properly."))}(e.room),r}return d(n,[{key:"getAttributes",value:function(){var e,t=this.props.plugin.attributes;if(t){var n=[a.PlayerPhase.Pause,a.PlayerPhase.Ended,a.PlayerPhase.Stopped];if(!t.paused&&n.includes(null==(e=this.props.player)?void 0:e.phase)){var r=C(t,this.props);t=x(x({},t),{},{currentTime:r,paused:!0})}return t}}},{key:"render",value:function(){var e,t,n,r;if(!this.props.room&&!this.props.player)return null;var o=this.getAttributes();if(!o)return null;var a=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),s=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return i.default.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},i.default.createElement("div",{className:"video-js-plugin-player",ref:this.container}),i.default.createElement("div",{className:"video-js-plugin-header"},o.title&&i.default.createElement("div",{className:"video-js-plugin-title"},o.title),(null==(n=o.close)||n)&&i.default.createElement("div",{className:"videojs-plugin-close-icon",ref:this.setupClose},"×")),i.default.createElement(ue,{duration:a,volume:o.volume,setVolume:this.setVolume,paused:o.paused,play:this.play,pause:this.pause,currentTime:1e3*C(o,this.props),setCurrentTime:this.setCurrentTime,buffered:a*s,scale:this.props.scale,visible:!0}),!(null==(r=this.props.plugin.context)?void 0:r.hideMuteAlert)&&this.state.NoSound&&i.default.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&i.default.createElement("div",{className:"videojs-plugin-recovery-mode"},i.default.createElement("button",{ref:this.setupReload},"Reload Player")))}},{key:"debug",value:function(e){var t;if(null==(t=this.props.plugin.context)?void 0:t.verbose){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i20&&(e.value=Math.floor(1e3*e.times/e.valueTotal),e.valueTotal=0,e.times=0,e.destroyed||e.emit("update",e.value)),e.prevTime=t,e.destroyed||e.calcFps()}))}},{key:"destroy",value:function(){this.destroyed=!0}}]),n}(Ks.a);!function(e){e.ResourceError="RESOURCE_ERROR",e.RuntimeError="RUNTIME_ERROR",e.RuntimeWarn="RUNTIME_WARN",e.CanvasCrash="CANVAS_CRASH"}(Jp||(Jp={}));var rv=function(e){p(n,e);var t=m(n);function n(e,r){var i,o,a;return _(this,n),o=y(i=t.call(this,r)),a=(this instanceof n?this.constructor:void 0).prototype,Object.setPrototypeOf?Object.setPrototypeOf(o,a):o.__proto__&&(o.__proto__=a),i.errorType=e,i.errorMsg=r,i}return T(n,null,[{key:"transform",value:function(e){return e instanceof n?e:new n(Jp.RuntimeError,e.message)}}]),n}(r(Error));function iv(){return function(e,t,n){var r=n.value;n.value=function(){try{for(var e=arguments.length,t=new Array(e),n=0;n2048||x>2048)&&(_=(y*=2048/b)*x)>2048&&(y*=x/_),w=document.createElement("canvas"),T=Math.ceil(g.width*y),M=Math.ceil(g.height*y),w.width=T,w.height=M,w.getContext("2d").drawImage(g,0,0,T,M),S=w.toDataURL("image/png"),E=new Xl.c(S,{resolution:1}),n.abrupt("return",(this.logger.info("load end. "+o,this.taskId||""),this.useCache&&this.localStorage.setItem(u,{scale:y,scaledBase64:S}).catch((function(){})),{baseTexture:E,scale:y}));case 70:case"end":return n.stop()}}),n,this,[[22,34],[39,52]])})))}},{key:"destroy",value:function(){}}]),e}(),mv=function(){function e(t){var n=this;_(this,e),this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=function(e){var t=e/(nd.b.TARGET_FPMS||.06);if(!n.isPaused){n.timestamp+=t,n.callbackList=n.callbackList.filter((function(e){return e&&!e.applied}));for(var r=n.callbackList.length,i=0;i=0&&!this.callbackList[t].running&&this.callbackList.splice(t,1)}},{key:"delay",value:function(e){var t=this;return new Promise((function(n){t.setTimeout(n,e)}))}},{key:"waitUntil",value:function(e,t){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=this.timestamp;case 1:if(e()||!(this.timestamp-r90&&a<270||a<-90&&a>-270)&&(r=-r),i=s*r}return{x:r,y:i}}function Sv(e,t,n,r,i,o){var a,s,u,l,c,h=e,d=t;if(0===Math.round(r))a=i,s=o,c=0;else if(Math.round(r)>=360)a=i,s=o,u=i+2*e*Math.abs(Math.cos(-n/180*Math.PI)),l=o+2*t*Math.sin(-n/180*Math.PI),c=1;else{var f=-(n+r),p=Mv(-n,h,d),v=i-p.x,m=o+p.y,g=Mv(f,h,d);a=g.x+v,s=m-g.y,c=r>=-360&&r<-180?1:r>=-180&&r<0||r>0&&r<180?0:1}return{radiusX:h,radiusY:d,xAxisRotation:0,largeArcFlag:c,sweepFlag:r>0?1:0,endX:a,endY:s,middleX:u,middleY:l}}var Ev=function(){function e(){_(this,e),this.pool=[]}return T(e,[{key:"getObject",value:function(e){var t=this.pool.find((function(e){return!e.isUsed}));if(t)return t.isUsed=!0,t.obj;var n={obj:this.createObject(),isUsed:!0,group:e};return this.pool.push(n),n.obj}},{key:"collectObject",value:function(e){var t=this.pool.find((function(t){return t.obj===e}));t&&(t.isUsed=!1,this.resetObject(t.obj))}},{key:"collectObjectByGroup",value:function(e){var t=this;this.pool.filter((function(t){return t.group===e})).forEach((function(e){return t.collectObject(e.obj)}))}}]),e}(),Av=new(function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return T(n,[{key:"createObject",value:function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("version","1.1"),e}},{key:"resetObject",value:function(e){e.removeAttribute("viewBox"),e.removeAttribute("width"),e.removeAttribute("height"),e.innerHTML=""}}]),n}(Ev)),Iv=new(function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return T(n,[{key:"createObject",value:function(){return document.createElement("img")}},{key:"resetObject",value:function(e){e.removeAttribute("src")}}]),n}(Ev)),Cv=function(){function e(t){_(this,e),this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null),this.maxResolution=t}return T(e,[{key:"render",value:function(e,t,n,r){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,l,h,d,f,p,v,m=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.items,o=e.width,a=e.height,s=Iv.getObject(n),u=new Xl.c(s,{width:o*r,height:a*r,resolution:1}),l=Av.getObject(n),this.imgElements.push(s),this.svgElements.push(l),l.setAttribute("viewBox","0 0 ".concat(o," ").concat(a)),l.setAttribute("width",""+o),l.setAttribute("height",""+a),h={},i.forEach((function(e){var t=e.item,n=e.x,i=e.y,o=n+2,a=i+2;t.pathsData.forEach((function(e){var t="";e.cmds.forEach((function(n){var r=c(n,2),i=r[0],s=r[1];t+=i+" ",t+=s.map((function(t){return Tv()(t)||(t.x=t.x+e.offset.x+o,t.y=t.y+e.offset.y+a),t})).reduce((function(e,t){return Tv()(t)?e+=t+" ":e+="".concat(t.x," ").concat(t.y," "),e}),""),t+=" "})),e.pathElement.setAttribute("d",t),l.appendChild(e.pathElement)}));var s=t.width-4-2*t.padding,d=t.height-4-2*t.padding;m.textures[t.hash]={texture:new Xl.t(u,new jl.j((o+2)*r,(a+2)*r,s*r,d*r)),pivot:t.pivot,scale:1/r},h[t.hash]=m.hashToIdMap[t.hash]})),f=''+l.outerHTML,d="data:image/svg+xml,"+encodeURIComponent(f).replace(/'/g,"%27").replace(/"/g,"%22"),(p=document.createElement("img")).src=d,t.next=9,new Promise((function(e,t){p.onload=function(){return e("")},p.onerror=function(){return t()}}));case 9:return(v=document.createElement("canvas")).width=p.width*r,v.height=p.height*r,v.getContext("2d").drawImage(p,0,0,v.width,v.height),s.src=v.toDataURL("image/png"),t.next=15,new Promise((function(e,t){s.onload=function(){return e("")},s.onerror=function(){return t()}}));case 15:case"end":return t.stop()}}),t,this)})))}},{key:"getGraphicsData",value:function(e){var t=this.idToHashMap[e]||"";return this.textures[t]||null}},{key:"addGraphics",value:function(e,t,n,r,i,o,a,s,u,l,h){var d,f;if(!a&&!u)return e;var p,v,m,g,y,b,x,_,w,T,M,S,E,A,I,C,N,k,D=_v()(n+(null!==(f=null===(d=null==a?void 0:a.width)||void 0===d?void 0:d.toString())&&void 0!==f?f:0)+u+l+h);if(this.hashToIdMap[D]||(this.hashToIdMap[D]=[]),this.hashToIdMap[D].push(e),this.idToHashMap[e]=D,this.graphics.findIndex((function(e){return e.hash===D}))<0){var P=(p=t,v=i,m=o,g=a,y=r,b=u,x=l,_=h,T=[],M={x:Math.abs(y.x),y:Math.abs(y.y)},S=0,E=0,A=0,I=0,C=0,N="none",k=null!==(w=null==g?void 0:g.width)&&void 0!==w?w:0,b?(S=v,E=m,C=0):(N=_||"#ff0000",C=k,A=.5*k,I=.5*k,S=v+k,E=m+k,M.x+=.5*k,M.y+=.5*k),S+=Math.abs(y.x),E+=Math.abs(y.y),A+=Math.abs(y.x),I+=Math.abs(y.y),S+=4,E+=4,A+=2,I+=2,S=Math.ceil(S),E=Math.ceil(E),p.forEach((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","path");"none"!==e.fill&&b?t.setAttribute("fill",x||"#ff0000"):t.setAttribute("fill","none"),e.hasStroke&&!b&&(t.setAttribute("stroke-linecap",(null==g?void 0:g.cap)||"butt"),t.setAttribute("stroke-linejoin",(null==g?void 0:g.join)||"miter"),t.setAttribute("stroke-width",C.toString()),t.setAttribute("stroke",N),(null==g?void 0:g.dash)&&t.setAttribute("stroke-dasharray",g.dash));for(var n=e.scale,r=e.path.trim().split(" "),i={x:0,y:0},o={offset:{x:A,y:I},cmds:[],pathElement:t},a=0;a=360?(i={x:M.endX,y:M.endY},o.cmds.push(["A",[M.radiusX/9525*n.x,M.radiusY/9525*n.y,M.xAxisRotation,M.largeArcFlag,M.sweepFlag,{x:M.middleX/9525*n.x,y:M.middleY/9525*n.y}]]),o.cmds.push(["A",[M.radiusX/9525*n.x,M.radiusY/9525*n.y,M.xAxisRotation,M.largeArcFlag,M.sweepFlag,{x:M.endX/9525*n.x,y:M.endY/9525*n.y}]])):(i={x:M.endX,y:M.endY},o.cmds.push(["A",[M.radiusX/9525*n.x,M.radiusY/9525*n.y,M.xAxisRotation,M.largeArcFlag,M.sweepFlag,{x:M.endX/9525*n.x,y:M.endY/9525*n.y}]]))}else if("L"===s){var S=c(u.split(",").map((function(e){return Number(e)})),2),E=S[0],k=S[1];i={x:E,y:k},E=E/9525*n.x,k=k/9525*n.y,o.cmds.push(["L",[{x:E,y:k}]])}else if("QB"===s){var D=c(u.split(",").map((function(e){return Number(e)})),4),P=D[0],O=D[1],R=D[2],L=D[3];i={x:R,y:L},P=P/9525*n.x,O=O/9525*n.y,R=R/9525*n.x,L=L/9525*n.y,o.cmds.push(["Q",[{x:P,y:O},{x:R,y:L}]])}else if("CB"===s){var j=c(u.split(",").map((function(e){return Number(e)})),6),B=j[0],U=j[1],z=j[2],F=j[3],G=j[4],H=j[5];i={x:G,y:H},B=B/9525*n.x,U=U/9525*n.y,z=z/9525*n.x,F=F/9525*n.y,G=G/9525*n.x,H=H/9525*n.y,o.cmds.push(["C",[{x:B,y:U},{x:z,y:F},{x:G,y:H}]])}else"C"===s&&o.cmds.push(["Z",[]])}T.push(o)})),{graphicsWidth:S,graphicsHeight:E,pivot:M,padding:2,pathsData:T}),O=P.graphicsWidth,R=P.graphicsHeight,L=P.pathsData,j=P.pivot,B=P.padding;this.graphics.push({hash:D,pathsData:L,pivot:j,width:O,height:R,padding:B})}return e}},{key:"pack",value:function(){return this.graphics.forEach((function(e){e.width+=4,e.height+=4})),function e(t){for(var n=[],r=t.filter((function(e){var t=e.width<2048&&e.height<2048;return t||n.push(e),t})).sort((function(e,t){return e.width*e.height-t.width*t.height})),i=r.length+1,o=2050,a=2050,s=[],u=null;(o>2048||a>2048)&&r.length>0;)i-=1,o=(u=av()(r.slice(0,i))).width,a=u.height;return u&&s.push(u),n.forEach((function(e){var t=av()([e]);s.push(t)})),i2&&void 0!==arguments[2]?arguments[2]:{type:"el",index:0,id:""},o=this.targets[e.id];return"shape"!==e.type?o:("shape"===e.type&&e.txEl&&(o=null!==(n=null==o?void 0:o.getTextElement(e.txEl.type,e.txEl.range))&&void 0!==n?n:null),"shape"===e.type&&e.bg&&0===i.index&&(t=!1,o=null!==(r=null==o?void 0:o.getBgElement())&&void 0!==r?r:null,this.eventHub.emit("IterateTimeNodeEnd",i.id)),t&&o?o.getIterateEntry(i.type,i.index,i.id):(o||this.eventHub.emit("IterateTimeNodeEnd",i.id),o))}},{key:"clearTargets",value:function(){this.targets=Object.create(null)}}]),e}(),Dv=function(){function e(t){_(this,e),this.target=t}return T(e,[{key:"color",get:function(){return this.target.strokeColorFilter.currentColor},set:function(e){this.target.strokeColorFilter.color=e}},{key:"on",get:function(){return this.target.strokeActive?"true":"false"},set:function(e){this.target.strokeActive="true"===e}}]),e}(),Pv=function e(t){var n=this;_(this,e),this.applyCommand=function(e,t){n.target.applyCommand(e,t)},this.target=t},Ov=function(){function e(t){_(this,e),this.target=t}return T(e,[{key:"toString",value:function(){return this.color}},{key:"color",get:function(){return this.target.pptColorFilter.currentColor},set:function(e){this.target.pptColorActive&&(this.target.pptColorFilter.color=e)}},{key:"on",get:function(){return this.target.pptColorActive?"true":"false"},set:function(e){this.target.pptColorActive="true"===e}},{key:"designColor",get:function(){return this.target.pptColorFilter.designColor}}]),e}(),Rv=function(){function e(t){_(this,e),this.target=t}return T(e,[{key:"color",get:function(){return this.target.fillColorFilter.currentColor},set:function(e){this.target.fillActive&&(this.target.fillColorFilter.color=e)}},{key:"on",get:function(){return this.target.fillActive?"true":"false"},set:function(e){this.target.fillActive="true"===e}},{key:"designColor",get:function(){return this.target.fillColorFilter.designColor}}]),e}(),Lv=function(){function e(t,n,r){_(this,e),this.hardHidden=!1,this.designRotation=0,this.target=t,!0===n&&(this.hardHidden=!0),this.designRotation=r}return T(e,[{key:"opacity",get:function(){return this.target.alpha},set:function(e){this.target.alpha=e}},{key:"rotation",get:function(){return this.target.rotation/Math.PI*180},set:function(e){this.target.rotation=e/180*Math.PI+this.designRotation}},{key:"visibility",get:function(){return this.target.visible?"visible":"hidden"},set:function(e){this.visibility===e||this.hardHidden||(this.target.visible="visible"===e)}}]),e}(),jv=function(){function e(t,n){_(this,e),this.actions=[],this.ctx=n,this.object=t,this.object.interactive=!0}return T(e,[{key:"reset",value:function(e){this.object.interactive=!1,this.object.removeAllListeners(),this.object=e,this.object.interactive=!0}},{key:"addAction",value:function(e,t){var n=this;this.actions.push([e,t]),"click"===t?(this.object.addListener("pointertap",(function(){return n.handleAction(e)})),this.object.cursor="pointer"):"hover"===t&&this.object.addListener("mouseover",(function(){return n.handleAction(e)}))}},{key:"getOriginHitArea",value:function(){return this.object.hitArea?this.object.hitArea:new jl.k(0,0,this.object.width,this.object.height)}},{key:"handleAction",value:function(e){this.ctx.eventHub.emit(bb.hyperlinkTrigger,e),this.execAction(e)}},{key:"execAction",value:function(e){var t,n;if(this.ctx.eventHub.emit(bb.userInput),"ppaction://hlinksldjump"===e.action){var r=(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"").match(/slide(\d+)\.xml/);r&&r[1]&&this.ctx.eventHub.emit(bb.requestGotoSlide,Number(r[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===e.action)this.ctx.eventHub.emit(bb.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===e.action)this.ctx.eventHub.emit(bb.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===e.action)this.ctx.eventHub.emit(bb.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===e.action)this.ctx.eventHub.emit(bb.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===e.action){var i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(bb.requestGotoSlide,i)}else"ppaction://hlinkshowjump?jump=endshow"===e.action?this.ctx.eventHub.emit(bb.requestGotoSlide,-1):""===e.action&&(null===(n=e.target)||void 0===n?void 0:n.startsWith("http"))&&this.ctx.eventHub.emit(bb.requestOpenUrl,e.target)}}]),e}();function Bv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return Math.abs(e-t)<=Math.pow(10,-n)}function Uv(e){return Math.floor(1e6*e)/1e6}var zv=function(){function e(){_(this,e),this.point={x:0,y:0},this.slope=Math.PI/4}return T(e,[{key:"resolveY",value:function(e){return Math.tan(this.slope)*(e-this.point.x)+this.point.y}},{key:"distanceToLinearEquation",value:function(e){return Bv(this.slope,e.slope)?this.distanceToPoint(e.point):-1}},{key:"distanceToPoint",value:function(t){var n;if(Math.tan(this.slope)*(t.x-this.point.x)+this.point.y===t.y)return 0;n=this.slope>=Math.PI/2?this.slope-Math.PI/2:Math.PI/2+this.slope;var r=e.fromPointSlope(t,n),i=this.crossPoint(r);return i?Math.ceil(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))):0}},{key:"crossPoint",value:function(e){if(Bv(e.slope,this.slope))return null;var t=0,n=0,r=Math.tan(e.slope),i=Math.tan(this.slope),o=this.point,a=o.x,s=o.y,u=e.point,l=u.x,c=u.y;return Bv(this.slope,Math.PI/2)?n=r*((t=this.point.x)-l)+c:Bv(e.slope,Math.PI/2)?n=i*((t=e.point.x)-a)+s:Bv(this.slope,Math.PI)||Bv(this.slope,0)?t=((n=this.point.y)-c)/r+l:Bv(e.slope,Math.PI)||Bv(e.slope,0)?t=((n=e.point.y)-s)/i+a:n=i*((t=(r*l-c+s-i*a)/(r-i))-a)+s,{x:t,y:n}}}],[{key:"fromPointSlope",value:function(t,n){var r=new e;return r.point=t,r.slope=n,r}}]),e}(),Fv=function(){function e(t,n,r){var i,o,a,s,u,l,c=this;_(this,e),this.scaleExt={x:1,y:1},this.scaleOrigin={x:1,y:1},this.designScale={x:1,y:1},this.bound=new jl.j(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 Rl.b,this.ctx=n,this.style=new Lv(this.container,!!t.hardHidden,t.rotation||0),this.designGlobalPosition={x:r.parentGlobalPos.x+(null!==(o=null===(i=t.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0),y:r.parentGlobalPos.y+(null!==(s=null===(a=t.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)},(t.hlinkClick||t.hlinkHover)&&(this.hyperlink=new jv(this.container,this.ctx),t.hlinkHover&&(null===(u=this.hyperlink)||void 0===u||u.addAction(t.hlinkHover,"hover")),t.hlinkClick&&(null===(l=this.hyperlink)||void 0===l||l.addAction(t.hlinkClick,"click"))),this.ctx.clock.waitUntil((function(){try{return!!c.container.width}catch(e){return!1}}),3e3).then((function(){try{c.designWidth=c.designWidth||c.container.width}catch(e){}})),this.ctx.clock.waitUntil((function(){try{return!!c.container.height}catch(e){return!1}}),3e3).then((function(){try{c.designHeight=c.designHeight||c.container.height}catch(e){}}))}return T(e,[{key:"updateScale",value:function(){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)}},{key:"updateTransform",value:function(e){var t,n,r,i,o,a,s,u;this.designWidth=e.width,this.designHeight=e.height,this.designX=null!==(n=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==n?n:0,this.designY=null!==(i=null===(r=e.position)||void 0===r?void 0:r.y)&&void 0!==i?i:0;var l=this.designWidth/2,c=this.designHeight/2;this.container.width=this.designWidth,this.container.height=this.designHeight,this.container.pivot.x=l,this.container.pivot.y=c;var h=null!==(a=null===(o=e.position)||void 0===o?void 0:o.x)&&void 0!==a?a:0,d=null!==(u=null===(s=e.position)||void 0===s?void 0:s.y)&&void 0!==u?u:0;this.container.x=h+l,this.container.y=d+c,e.scale&&(this.designScale={x:e.scale.x,y:e.scale.y},this.container.scale.x=e.scale.x,this.container.scale.y=e.scale.y),e.rotation&&(this.container.rotation=e.rotation);var f=new Dd;f.drawRect(0,0,this.designWidth,this.designHeight),this.container.addChild(f),this.json.hardHidden&&(this.container.visible=!1),this.bound.x=h,this.bound.y=d,this.bound.width=this.designWidth,this.bound.height=this.designHeight}},{key:"scale",get:function(){return this.scaleOrigin},set:function(e){this.scaleOrigin.x=e.x,this.scaleOrigin.y=e.y,this.updateScale()}},{key:"design_ppt_w",get:function(){return Uv(this.designWidth/this.ctx.stageWidth)}},{key:"design_ppt_h",get:function(){return Uv((this.designHeight||this.container.height)/this.ctx.stageHeight)}},{key:"design_ppt_x",get:function(){return Uv(this.designX/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Uv(this.designY/this.ctx.stageHeight)}},{key:"ppt_w",get:function(){return this.scaleExt.x*this.scaleOrigin.x*this.designWidth/this.ctx.stageWidth},set:function(e){this.designWidth&&(this.scaleExt.x=e*this.ctx.stageWidth/this.designWidth,this.updateScale())}},{key:"ppt_h",get:function(){var e=this.designHeight||this.container.height;return this.scaleExt.y*this.scaleOrigin.y*e/this.ctx.stageHeight},set:function(e){this.designHeight&&(this.scaleExt.y=e*this.ctx.stageHeight/this.designHeight,this.updateScale())}},{key:"ppt_x",get:function(){return(this.container.position.x-this.container.pivot.x)/this.ctx.stageWidth},set:function(e){this.pptX=e;var t=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=e*this.ctx.stageWidth+this.container.pivot.x*t}},{key:"ppt_y",get:function(){return(this.container.position.y-this.container.pivot.y)/this.ctx.stageHeight},set:function(e){this.pptY=e;var t=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=e*this.ctx.stageHeight+this.container.pivot.y*t}},{key:"r",get:function(){return this.container.rotation},set:function(e){this.container.rotation=e}},{key:"xshear",set:function(e){this.container.skew.x=e},get:function(){return this.container.skew.x}},{key:"yshear",set:function(e){this.container.skew.y=e},get:function(){return this.container.skew.y}}]),e}(),Gv=n(112),Hv=n.n(Gv),Vv=function(){function e(t){if(_(this,e),this._isInit=!1,this.h=0,this.s=0,this.l=0,this.a=1,t){this._isInit=!0;var n=t.match(/-?[0-9]+/g);n&&(this.h=parseInt(n[0],10),this.s=parseInt(n[1],10)/100,this.l=parseInt(n[2],10)/100)}}return T(e,[{key:"isInit",value:function(){return this._isInit}},{key:"by",value:function(e,t){t.h=Math.max(Math.min(this.h+e.h,359),0),t.s=Math.max(Math.min(this.s+e.s,1),0),t.l=Math.max(Math.min(this.l+e.l,1),0),t.a=Math.max(Math.min(this.a+e.a,1),0)}},{key:"fromHexString",value:function(e){var t,n,r=c(Xv(e),4),i=r[0],o=r[1],a=r[2],s=r[3],u=0,l=Math.max(i,o,a),h=Math.min(i,o,a),d=l-h;n=(l+h)/2,0===d?u=0:l===i?u=(o-a)/d%6*60:l===o?u=60*((a-i)/d+2):l===a&&(u=60*((i-o)/d+4)),t=0===d?0:d/(1-Math.abs(2*n-1)),this.h=u,this.s=t,this.l=n,this.a=s}},{key:"interpolationFrom",value:function(e,t,n){var r=e.h+(this.h-e.h)*t,i=e.s+(this.s-e.s)*t,o=e.l+(this.l-e.l)*t,a=e.a+(this.a-e.a)*t;n.h=Math.max(Math.min(r,359),0),n.s=Math.max(Math.min(i,1),0),n.l=Math.max(Math.min(o,1),0),n.a=Math.max(Math.min(a,1),0)}},{key:"toHexString",value:function(){var e=[0,0,0,0],t=this.h,n=this.s,r=this.l;if(t<360&&t>=0&&n<=1&&n>=0&&r<=1&&r>=0){var i,o=(1-Math.abs(2*r-1))*n,a=o*(1-Math.abs(t/60%2-1)),s=r-o/2;e=[(i=c(t>=0&&t<60?[o,a,0]:t>=60&&t<120?[a,o,0]:t>=120&&t<180?[0,o,a]:t>=180&&t<240?[0,a,o]:t>=240&&t<300?[a,0,o]:[o,0,a],3))[0]+s,i[1]+s,i[2]+s,this.a]}return Qv(e)}}]),e}(),Wv=function(){function e(t){_(this,e),this._isInit=!1,this.r=0,this.g=0,this.b=0,this.a=0,t&&(this._isInit=!0,this.fromHexString(t))}return T(e,[{key:"fromHexString",value:function(e){var t=c(Xv(e),4),n=t[0],r=t[1],i=t[2],o=t[3];this.r=n,this.g=r,this.b=i,this.a=o}},{key:"isInit",value:function(){return this._isInit}},{key:"interpolationFrom",value:function(e,t,n){n.r=e.r+(this.r-e.r)*t,n.g=e.g+(this.g-e.g)*t,n.b=e.b+(this.b-e.b)*t,n.a=e.a+(this.a-e.a)*t}},{key:"by",value:function(e,t){t.r=Math.min(Math.max(this.r+e.r,0),255),t.g=Math.min(Math.max(this.g+e.g,0),255),t.b=Math.min(Math.max(this.b+e.b,0),255),t.a=Math.min(Math.max(this.a+e.a,0),1)}},{key:"toHexString",value:function(){return Qv([this.r,this.g,this.b,this.a])}}]),e}();function Yv(e){var t=e.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function Xv(e){return 0===(e=e.replace(/^#/,"")).substring(6,8).length&&(e+="FF"),[parseInt(e.substring(0,2).padStart(8,"0"),16)/255,parseInt(e.substring(2,4).padStart(8,"0"),16)/255,parseInt(e.substring(4,6).padStart(8,"0"),16)/255,parseInt(e.substring(6,8).padStart(8,"0"),16)/255]}function Qv(e){return"#"+Math.round(255*e[0]).toString(16).padStart(2,"0")+Math.round(255*e[1]).toString(16).padStart(2,"0")+Math.round(255*e[2]).toString(16).padStart(2,"0")+Math.round(255*e[3]).toString(16).padStart(2,"0")}function Zv(e,t,n){var r=Xv(e),i=Xv(t),o=Math.round(255*(r[0]+(i[0]-r[0])*n)),a=Math.round(255*(r[1]+(i[1]-r[1])*n)),s=Math.round(255*(r[2]+(i[2]-r[2])*n)),u=Math.round(255*(r[3]+(i[3]-r[3])*n));return"#"+o.toString(16).padStart(2,"0")+a.toString(16).padStart(2,"0")+s.toString(16).padStart(2,"0")+u.toString(16).padStart(2,"0")}var qv=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this,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})).currentColor="#FFFFFFFF",e.designColor="#FFFFFFFF",e}return T(n,[{key:"color",set:function(e){this.currentColor=e;var t=Xv(e);this.uniforms.color=Float32Array.from(t)},get:function(){return this.currentColor}}]),n}(Xl.k),Jv=new Up.ColorMatrixFilter;Jv.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];var Kv=new Up.ColorMatrixFilter;Kv.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];var $v=new Up.ColorMatrixFilter;$v.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];var em=new Up.ColorMatrixFilter;em.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];var tm={darken:Jv,darkenLess:Kv,lightenLess:em,lighten:$v},nm=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,{position:{x:e.x,y:e.y},width:e.width,height:e.height},r,i)).fillColorFilter=new qv,o.fill=new Rv(y(o)),o.json=e,o.ctx=r,o.parentGlobalPos=i.parentGlobalPos,o.global={x:i.parentGlobalPos.x+e.x,y:i.parentGlobalPos.y+e.y},o.updateTransform({position:{x:e.x,y:e.y},width:e.width,height:e.height}),o}return T(n,[{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"getTextElement",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"fillActive",get:function(){var e,t;return(null!==(t=null===(e=this.container.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){var t,n;e?(null!==(n=null===(t=this.container.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0&&(this.container.filters=[this.fillColorFilter]):this.container.filters=[]}},{key:"renderContainer",get:function(){return this.container}},{key:"interactiveContainer",get:function(){return this.container}},{key:"ppt_x",get:function(){return this.global.x/this.ctx.stageWidth},set:function(e){var t=e*this.ctx.stageWidth-this.global.x,n=544===this.presetSubType?this.scaleExt.x:1;this.container.position.x=this.designX+t+this.container.pivot.x*n}},{key:"ppt_y",get:function(){return this.global.y/this.ctx.stageHeight},set:function(e){var t=e*this.ctx.stageHeight-this.global.y,n=544===this.presetSubType?this.scaleExt.y:1;this.container.position.y=this.designY+t+this.container.pivot.y*n}},{key:"design_ppt_x",get:function(){return Uv(this.global.x/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return Uv(this.global.y/this.ctx.stageHeight)}}]),n}(Fv),rm=function(){function e(t,n,r,i,o,a,s,u,l,c,h){_(this,e),this.ctx=t,this.type=n,this.lineWidth=r,this.width=i,this.height=o,this.fillColor=a,this.isHorz=s,this.renderContainer=new Rl.b,this.ghcTextureId="".concat(u,"-text-p").concat(l,"-l").concat(c,"-u").concat(h,"-underLine")}return T(e,[{key:"createPaths",value:function(){if("ww"===this.type)return null;var e,t="M 0,0 L ".concat(9525*this.width,",0"),n=[this.width,this.lineWidth],r=n[0],i=n[1];return this.isHorz||(t="M 0,0 L 0,"+9525*this.height,r=(e=[this.lineWidth,this.height])[0],i=e[1]),{paths:[{id:uv(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:_v()(t)}],width:r,height:i}}},{key:"getLineStyle",value:function(){var e={width:this.lineWidth};return"dotted"===this.type&&(e.dash=""+this.lineWidth),e}},{key:"preRender",value:function(){var e=this.createPaths();if(e){var t=e.paths,n=e.width,r=e.height,i=t.reduce((function(e,t){return e+t.hash}),"");this.ctx.graphicsTexture.addGraphics(this.ghcTextureId,t,i,{x:0,y:0},n,r,this.getLineStyle(),this.ctx.objectPoolGroup,!1,null,this.fillColor)}}},{key:"render",value:function(){if(this.ghcTextureId){var e=this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);e&&(this.sprite=new Ld,this.sprite.texture=e.texture,this.sprite.pivot.x=e.pivot.x,this.sprite.scale.x=e.scale,this.sprite.scale.y=e.scale)}}},{key:"destroy",value:function(){var e;null===(e=this.sprite)||void 0===e||e.destroy({texture:!0})}}]),e}(),im=134217729;function om(e,t,n,r,i){var o,a,s,u,l=t[0],c=r[0],h=0,d=0;c>l==c>-l?(o=l,l=t[++h]):(o=c,c=r[++d]);var f=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=t[++h]):(s=o-((a=c+o)-c),c=r[++d]),o=a,0!==s&&(i[f++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=t[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=r[++d]),o=a,0!==s&&(i[f++]=s);for(;h0!=s>0)return u;var l=Math.abs(a+s);return Math.abs(u)>=33306690738754716e-32*l?u:-function(e,t,n,r,i,o,a){var s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,S=e-i,E=n-i,A=t-o,I=r-o;h=(_=(p=S-(f=(d=im*S)-(d-S)))*(m=I-(v=(d=im*I)-(d-I)))-((x=S*I)-f*v-p*v-f*m))-(g=_-(T=(p=A-(f=(d=im*A)-(d-A)))*(m=E-(v=(d=im*E)-(d-E)))-((w=A*E)-f*v-p*v-f*m))),sm[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),sm[1]=b-(g+h)+(h-w),h=(M=y+g)-y,sm[2]=y-(M-h)+(g-h),sm[3]=M;var C=function(e,t){for(var n=t[0],r=1;r=N||-C>=N)return C;if(s=e-(S+(h=e-S))+(h-i),l=n-(E+(h=n-E))+(h-i),u=t-(A+(h=t-A))+(h-o),c=r-(I+(h=r-I))+(h-o),0===s&&0===u&&0===l&&0===c)return C;if(N=11093356479670487e-47*a+33306690738754706e-32*Math.abs(C),(C+=S*c+I*s-(A*l+E*u))>=N||-C>=N)return C;h=(_=(p=s-(f=(d=im*s)-(d-s)))*(m=I-(v=(d=im*I)-(d-I)))-((x=s*I)-f*v-p*v-f*m))-(g=_-(T=(p=u-(f=(d=im*u)-(d-u)))*(m=E-(v=(d=im*E)-(d-E)))-((w=u*E)-f*v-p*v-f*m))),hm[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),hm[1]=b-(g+h)+(h-w),h=(M=y+g)-y,hm[2]=y-(M-h)+(g-h),hm[3]=M;var k=om(4,sm,4,hm,um);h=(_=(p=S-(f=(d=im*S)-(d-S)))*(m=c-(v=(d=im*c)-(d-c)))-((x=S*c)-f*v-p*v-f*m))-(g=_-(T=(p=A-(f=(d=im*A)-(d-A)))*(m=l-(v=(d=im*l)-(d-l)))-((w=A*l)-f*v-p*v-f*m))),hm[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),hm[1]=b-(g+h)+(h-w),h=(M=y+g)-y,hm[2]=y-(M-h)+(g-h),hm[3]=M;var D=om(k,um,4,hm,lm);h=(_=(p=s-(f=(d=im*s)-(d-s)))*(m=c-(v=(d=im*c)-(d-c)))-((x=s*c)-f*v-p*v-f*m))-(g=_-(T=(p=u-(f=(d=im*u)-(d-u)))*(m=l-(v=(d=im*l)-(d-l)))-((w=u*l)-f*v-p*v-f*m))),hm[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),hm[1]=b-(g+h)+(h-w),h=(M=y+g)-y,hm[2]=y-(M-h)+(g-h),hm[3]=M;var P=om(D,lm,4,hm,cm);return cm[P-1]}(e,t,n,r,i,o,l)}var fm=Math.pow(2,-52),pm=new Uint32Array(512),vm=function(){function e(t){_(this,e);var n=t.length>>1;if(n>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;var r=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*r),this._halfedges=new Int32Array(3*r),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}return T(e,null,[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_m,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wm,i=t.length,o=new Float64Array(2*i),a=0;a>1,a=1/0,s=1/0,u=-1/0,l=-1/0,c=0;cu&&(u=h),d>l&&(l=d),this._ids[c]=c}for(var f,p,v,m=(a+u)/2,g=(s+l)/2,y=1/0,b=0;b0&&(p=T,y=M)}for(var S=e[2*p],E=e[2*p+1],A=1/0,I=0;IL&&(P[O++]=j,L=this._dists[j])}return this.hull=P.subarray(0,O),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(dm(_,w,S,E,N,k)<0){var B=p,U=S,z=E;p=v,S=N,E=k,v=B,N=U,k=z}var F=function(e,t,n,r,i,o){var a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,h=u*u+l*l,d=.5/(a*l-s*u);return{x:e+(l*c-s*h)*d,y:t+(a*h-u*c)*d}}(_,w,S,E,N,k);this._cx=F.x,this._cy=F.y;for(var G=0;G0&&Math.abs(Q-V)<=fm&&Math.abs(Z-W)<=fm)&&(V=Q,W=Z,X!==f&&X!==p&&X!==v)){for(var q=0,J=0,K=this._hashKey(Q,Z);J=0;)if((ee=$)===q){ee=-1;break}if(-1!==ee){var te=this._addTriangle(ee,X,n[ee],-1,-1,r[ee]);r[X]=this._legalize(te+2),r[ee]=te,H++;for(var ne=n[ee];$=n[ne],dm(Q,Z,e[2*ne],e[2*ne+1],e[2*$],e[2*$+1])<0;)te=this._addTriangle(ne,X,$,r[X],-1,r[ne]),r[X]=this._legalize(te+2),n[ne]=ne,H--,ne=$;if(ee===q)for(;dm(Q,Z,e[2*($=t[ee])],e[2*$+1],e[2*ee],e[2*ee+1])<0;)te=this._addTriangle($,X,ee,-1,r[ee],r[$]),this._legalize(te+2),r[$]=te,n[ee]=ee,H--,ee=$;this._hullStart=t[X]=ee,n[ee]=t[ne]=X,n[X]=ne,i[this._hashKey(Q,Z)]=X,i[this._hashKey(e[2*ee],e[2*ee+1])]=ee}}}this.hull=new Uint32Array(H);for(var re=0,ie=this._hullStart;re0?3-i:1+i)/4*this._hashSize))%this._hashSize;var n,r,i}},{key:"_legalize",value:function(e){for(var t=this._triangles,n=this._halfedges,r=this.coords,i=0,o=0;;){var a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1!==a){var u=a-a%3,l=s+(e+1)%3,c=u+(a+2)%3,h=t[o],d=t[e],f=t[l],p=t[c];if(gm(r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=h;var v=n[c];if(-1===v){var m=this._hullStart;do{if(this._hullTri[m]===c){this._hullTri[m]=e;break}m=this._hullPrev[m]}while(m!==this._hullStart)}this._link(e,v),this._link(a,n[o]),this._link(o,c);var g=u+(a+1)%3;i=n&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{var u=n+1,l=r;xm(e,n+r>>1,u),t[e[n]]>t[e[r]]&&xm(e,n,r),t[e[u]]>t[e[r]]&&xm(e,u,r),t[e[n]]>t[e[u]]&&xm(e,n,u);for(var c=e[u],h=t[c];;){do{u++}while(t[e[u]]h);if(l=l-n?(bm(e,t,u,r),bm(e,t,n,l-1)):(bm(e,t,n,l-1),bm(e,t,u,r))}}function xm(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _m(e){return e[0]}function wm(e){return e[1]}function Tm(e,t,n){var r=t/2,i=n/2,o=[{x:-r,y:i},{x:-r,y:-i},{x:r,y:i},{x:r,y:-i}],s=[zv.fromPointSlope({x:-r,y:0},Math.PI/2),zv.fromPointSlope({x:0,y:i},0),zv.fromPointSlope({x:r,y:0},Math.PI/2),zv.fromPointSlope({x:0,y:-i},0)],u=[],l=e.stopList.slice(1,e.stopList.length-1).map((function(o){for(var l,c,h,d=2*Math.PI,f=null!==(c=null===(l=e.line)||void 0===l?void 0:l.ang)&&void 0!==c?c:0;f>d;)f-=d;for(;f<0;)f+=d;var p={x:0,y:0};Bv(f,Math.PI/2)?(p.x=0,p.y=n/2-o.pos*n):Bv(f,0)?(p.x=o.pos*t-t/2,p.y=0):(p.x=o.pos*t-t/2,p.y=n/2-o.pos*n),f>Math.PI/2&&f<=Math.PI&&(p.x*=-1),f>Math.PI&&f<=2*Math.PI&&(p.y*=-1);var v=zv.fromPointSlope(p,Math.PI/2-((null===(h=e.line)||void 0===h?void 0:h.ang)||0)),m=s.map((function(e){return v.crossPoint(e)})).filter((function(e){return e&&e.x<=r&&e.x>=-r&&e.y<=i&&e.y>=-i})).map((function(e){return{point:e,color:o.color}})).sort((function(e,t){return t.point.y-e.point.y}));u.push.apply(u,a(m));for(var g=Math.abs(m[1].point.x-m[0].point.x)/10,y=20;y--;){var b=y%2==0?1:-1,x=p.x+b*g,_=v.resolveY(x);x<=r&&x>=-r&&_<=i&&_>=-i&&u.push({point:{x:x,y:_},color:o.color}),g+=g}return v})),c=[],h=[];e:for(var d=0;d= 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",alphaBiLevel:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < arg) {\n result.a = 0.0;\n } else {\n result.a = 1.0;\n }\n return result;\n}\n",alphaCeiling:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a > 0.0) {\n result.a = 1.0;\n }\n return result;\n}\n",alphaFloor:"\nvec4 transform(vec4 texColor, float arg) {\n vec4 result = vec4(texColor);\n result.rgb = result.rgb / texColor.a;\n if (texColor.a < 1.0) {\n result.a = 0.0;\n }\n return result;\n}\n",grayscl:"\nvec4 transform(vec4 texColor, float arg) {\n float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n return vec4(avg, avg, avg, texColor.a);\n}\n"},Am=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),t.call(this,void 0,(i=Em[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n".concat(Sm.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg);\n}\n")),{arg:r})}return n}(Xl.k),Im=[Mm],Cm={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",duotone:"\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float avg = (texColor.r + texColor.g + texColor.b) / 3.0;\n\n vec3 hsl = rgb2hsl(vec3(avg, avg, avg));\n\n vec3 result = arg2.rgb * hsl.z + arg1.rgb * (1.0 - hsl.z);\n\n return vec4(result * texColor.a, texColor.a);\n}\n"},Nm=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),t.call(this,void 0,(o=Cm[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n".concat(Im.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:Float32Array.from(r),arg2:Float32Array.from(i)})}return n}(Xl.k),km=[Mm],Dm={lum:"\nvec4 transform(vec4 texColor, float arg1, float arg2) {\n vec3 rgb = texColor.rgb / texColor.a;\n\n // 对比度\n highp float C = arg2 * 255.0;\n highp float F = (259.0 * (255.0 + C)) / (255.0 * (259.0 - C));\n rgb.rgb = F * (rgb.rgb - 0.5) + 0.5;\n\n // 亮度\n rgb.rgb += arg1;\n\n rgb.rgb *= texColor.a;\n return vec4(rgb, texColor.a);\n}\n"},Pm=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),t.call(this,void 0,(o=Dm[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n".concat(km.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(o,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1, arg2);\n}\n")),{arg1:r,arg2:i})}return n}(Xl.k),Om=[Mm],Rm={alphaInv:"\nvec4 transform(vec4 texColor, vec4 arg1) {\n float alpha = 1.0 - texColor.a;\n arg1.rgb = arg1.rgb * alpha;\n arg1.a = alpha;\n return arg1;\n}\n"},Lm=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),t.call(this,void 0,(i=Rm[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform sampler2D uSampler;\n\n".concat(Om.map((function(e){return e+"\n"})).join("\n"),"\n\n").concat(i,"\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = transform(texColor, arg1);\n}\n")),{arg1:Float32Array.from(r)})}return n}(Xl.k);function jm(e,t){var n=[];return e.forEach((function(e){var r=((null==t?void 0:t.filter)||[]).indexOf(e.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(e.type)>=0&&r)n.push(new Am(e.type,e.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(e.type)>=0&&r){var i=Xv(e.args[0]),o=Xv(e.args[1]);n.push(new Nm(e.type,i,o))}else if("lum"===e.type&&r)n.push(new Pm(e.type,e.args[0],e.args[1]));else if("alphaInv"===e.type&&r){var a=Xv(e.args[0]);n.push(new Lm(e.type,a))}})),n}var Bm=function(){function e(t,n,r,i,o){_(this,e),this.ctx=t,this.fillStyle=n,this.width=r,this.height=i,this.config=o,this.clonedObjects=[],this._displayObject=null,this.gradientHash=_v()("".concat(JSON.stringify(n)).concat(Math.ceil(r)).concat(Math.ceil(i)))}return T(e,[{key:"createDisplayObject",value:function(){var e;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){var t=new Ld;return t.texture=this.ctx.bgTexture,t}if("solidFill"===this.fillStyle.fillType||"noFill"===this.fillStyle.fillType)return null;if("gradientFill"===this.fillStyle.fillType){var n=new Ld,r=function(e,t,n){var r,i=new Rl.b;if(e.stopList.sort((function(e,t){return e.pos-t.pos})),!e.stopList.find((function(e){return 0===e.pos}))){var o=e.stopList[0];e.stopList.unshift({pos:0,color:o.color})}if(!e.stopList.find((function(e){return 1===e.pos}))){var s=e.stopList[e.stopList.length-1];e.stopList.push({pos:1,color:s.color})}var u=function(e){for(var t=[],n=0,r=e.length;n0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(h.filters=jm(u,this.ctx.featureList)),this.config.fillFloat){var d=this.config.fillFloat.fillRect,f=d.l,p=d.t,v=d.r,m=d.b,g=this.width*(1-f-v),y=this.height*(1-p-m),b=null!==(e=this.config.shapeRotation)&&void 0!==e?e:0,x=new Dd;x.drawRect(0,0,g,y),x.pivot.x=g/2,x.pivot.y=y/2,x.rotation=b;var _=x.getBounds(),w=_.width,T=_.height;h.width=w,h.height=T,h.anchor.x=.5,h.anchor.y=.5,h.rotation=-1*b,h.name="math-texture",0===b?(h.position.x=w/2+f*this.width,h.position.y=T/2+p*this.height):(h.position.x=this.width/2,h.position.y=this.height/2)}else h.width=this.width,h.height=this.height,c.rotate&&(h.position.x=this.width/2,h.position.y=this.height/2,h.anchor.x=.5,h.anchor.y=.5,h.rotation=c.rotate/180*Math.PI);return h}}else if("gifFill"===this.fillStyle.fillType){var M=this.fillStyle,S=M.src,E=M.delays,A=M.filters,I=this.ctx.spriteTexture.getGifFrames(S).map((function(e,t){return{texture:e,time:E[t]||20}})),C=new jp(I,!0);C.name=uv(),C.width=this.width,C.height=this.height,A.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(C.filters=jm(A,this.ctx.featureList));var N=this.fillStyle.loop,k=1;return C.onLoop=function(){k+=1,N>0&&k>N&&C.gotoAndStop(C.totalFrames)},C}return null}},{key:"isSolidFill",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)}},{key:"getSolidFillColor",value:function(){var e;return"solidFill"===(null===(e=this.fillStyle)||void 0===e?void 0:e.fillType)?this.fillStyle.color:"#000000"}},{key:"getClonedDisplayObject",value:function(){var e=this.createDisplayObject();return this.clonedObjects.push(e),e}},{key:"destroy",value:function(){var e;null===(e=this._displayObject)||void 0===e||e.destroy(),this._displayObject=null,this.clonedObjects.forEach((function(e){null==e||e.destroy()})),this.clonedObjects=[]}},{key:"displayObject",get:function(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject},set:function(e){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=e}},{key:"hasFill",get:function(){return!!this.fillStyle&&"noFill"!==this.fillStyle.fillType}}]),e}(),Um=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(Xl.k),zm=n(113),Fm=n.n(zm),Gm=n(114),Hm=n.n(Gm),Vm=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Fm.a,Hm.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:Xv(e.color),uSdfSampler:Xl.t.WHITE,uSdfReady:0,uSdfMaxDis:0,uRad:e.rad/2,uSdfPosition:new Float32Array([0,0])})).priority=3,r.json=e,r}return T(n,[{key:"filterAreaJustify",value:function(e){var t=Math.ceil(this.json.rad),n=Math.ceil(e.width+2*t),r=Math.ceil(e.height+2*t);return new jl.j(e.x-t,e.y-t,n,r)}},{key:"sdfBox",value:function(e,t){var n=Math.ceil(this.json.rad),r=Math.ceil(e+2*n),i=Math.ceil(t+2*n);return new jl.j(n,n,r,i)}}]),n}(Um),Wm=n(19),Ym=n.n(Wm),Xm=n(115),Qm=n.n(Xm),Zm=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Ym.a,Qm.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:e.rad,uSdfSampler:Xl.t.WHITE,uSdfReady:0,uSdfMaxDis:1})).priority=2,r.json=e,r}return T(n,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(e,t){return new jl.j(0,0,e,t)}}]),n}(Um),qm=function e(){_(this,e)},Jm=n(116),Km=n.n(Jm),$m=function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,Ym.a,Km.a,{uColor:Xv(e)})}return n}(Xl.k),eg=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this)).order=1,o.outputTexture=Xl.t.WHITE,o.frameTextures=[],o.json=e,o.effectContainer=r,o.outputSprite=new Ld,o.targetScale=i,o.outputSprite.scale.x=o.json.sx,o.outputSprite.scale.y=o.json.sy,o.outputSprite.skew.x=(o.targetScale.x>0?1:-1)*o.json.kx,o.outputSprite.skew.y=(o.targetScale.y>0?1:-1)*o.json.ky,o.outputSprite.filters=[new Up.BlurFilter(o.json.blurRad/2,4),new $m(o.json.color)],o}return T(n,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];if(t){var n=this.effectContainer.getBounds(),r=(this.effectContainer.width-t.width)/2,i=(this.effectContainer.height-t.height)/2,o=new jl.g(n.x,n.y),a=new jl.g(n.x,n.y);switch(this.json.align){case"tl":a.x=n.x,a.y=n.y;break;case"t":a.x=n.x+n.width/2,a.y=n.y,o.x+=n.width/2;break;case"tr":a.x=n.x+n.width,a.y=n.y,o.x+=n.width;break;case"l":a.x=n.x,a.y=n.y+n.height/2,o.y+=n.height/2;break;case"ctr":a.x=n.x+n.width/2,a.y=n.y+n.height/2,o.x+=n.width/2,o.y+=n.height/2;break;case"r":a.x=n.x+n.width,a.y=n.y+n.height/2,o.x+=n.width,o.y+=n.height/2;break;case"bl":a.x=n.x,a.y=n.y+n.height,o.y+=n.height;break;case"b":a.x=n.x+n.width/2,a.y=n.y+n.height,o.x+=n.width/2,o.y+=n.height;break;case"br":a.x=n.x+n.width,a.y=n.y+n.height,o.x+=n.width,o.y+=n.height}var s=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=s.x,this.outputSprite.pivot.y=s.y;var u=new jl.g(this.json.dist,0),l=new jl.d;l.rotate(this.json.dir),l.translate(o.x+r,o.y+i),l.apply({x:u.x,y:u.y},u);var c=this.effectContainer.toLocal(u);this.outputSprite.position.x=c.x,this.outputSprite.position.y=c.y,this.outputSprite.texture=t}}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){}}]),n}(qm),tg=n(117),ng=n.n(tg),rg=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),i=t.call(this,Ym.a,ng.a,{uStartAlpha:e.startAlpha,uEndAlpha:e.endAlpha,uStartPos:e.startPos,uEndPos:e.endPos,uHeight:r}),console.log(y(i)),i}return n}(Xl.k),ig=function(e){p(n,e);var t=m(n);function n(e,r,i,o,a){var s;_(this,n),(s=t.call(this)).order=2,s.outputSprite=new Ld,s.outputTexture=Xl.t.WHITE,s.frameTextures=[],s.json=e,s.shapeScaleX=o,s.effectContainer=r,s.rotation=i,s.ctx=a,s.outputSprite.anchor.x=.5,s.outputSprite.anchor.y=.5;var u=s.effectContainer.getBounds();return s.outputSprite.filters=[new Up.BlurFilter(s.json.blurRad/2,4),new rg(s.json,u.height)],s.outputSprite.alpha=.5,s.outputSprite.rotation=-1===s.shapeScaleX?Math.PI+2*s.rotation:Math.PI-2*s.rotation,s.outputSprite.scale.x=-1,s}return T(n,[{key:"updateFrame",value:function(e){var t=this.frameTextures[e];t&&(this.outputSprite.texture=t)}},{key:"createOutput",value:function(e,t){this.frameTextures[t]=e}},{key:"setFrameOffset",value:function(e,t){var n=this.effectContainer.getBounds(),r=new jl.g(n.x+n.width/2,n.y+n.height/2),i=new jl.g(r.x,r.y+n.height+this.json.dist),o=this.effectContainer.toLocal(i);this.outputSprite.position.x=o.x+e,this.outputSprite.position.y=o.y+t}}]),n}(qm),og=n(118),ag=n.n(og),sg=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Ym.a,ag.a,{})).priority=1,r.json=e,r}return T(n,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(){return null}}]),n}(Um),ug=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},lg=function(e){p(n,e);var t=m(n);function n(e,r,i,o,s,u){var l;_(this,n),(l=t.call(this)).effects=[],l.attachs=[],l.frames=new Map,l._targetContainer=new Rl.b,l.frameCount=1,l.ctx=o,l.originWidth=e.width,l.originHeight=e.height,l.cacheKey=i,l.sourceSprite=new Ld;var c,h=S(r);try{for(h.s();!(c=h.n()).done;){var d=c.value;switch(d.type){case"innerShadow":l.effects.push(new sg(d));break;case"softEdge":l.effects.push(new Zm(d));break;case"glow":l.effects.push(new Vm(d));break;case"reflection":l.attachs.push(new ig(d,e,s,u.x,l.ctx));break;case"outerShadow":l.attachs.push(new eg(d,e,u))}}}catch(e){h.e(e)}finally{h.f()}l.effects=l.effects.sort((function(e,t){return e.priority-t.priority})),l.attachs=l.attachs.sort((function(e,t){return e.order-t.order}));var f,p=S(l.attachs);try{for(p.s();!(f=p.n()).done;){var v=f.value;l._targetContainer.addChild(v.outputSprite)}}catch(e){p.e(e)}finally{p.f()}l.sourceSprite.name="effect-sprite";var m=new jl.j(0,0,l.originWidth,l.originHeight),g=l.effects.map((function(e){return e.filterAreaJustify(m)})),y=g.map((function(e){return e.x})),b=g.map((function(e){return e.y})),x=g.map((function(e){return e.width})),w=g.map((function(e){return e.height}));return l.filterArea=new jl.j(Math.min.apply(Math,a(y).concat([0])),Math.min.apply(Math,a(b).concat([0])),Math.max.apply(Math,a(x).concat([l.originWidth])),Math.max.apply(Math,a(w).concat([l.originHeight]))),l.sourceSprite.filters=l.effects,l.sourceSprite.filterArea=new jl.j(0,0,l.filterArea.width,l.filterArea.height),l._targetSprite=new Ld,l._targetSprite.name="effect-sprite",l._targetContainer.sortableChildren=!0,l._targetSprite.zIndex=999,l._targetContainer.addChild(l._targetSprite),l}return T(n,[{key:"getSdfTexture",value:function(e,t){return ug(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r="".concat(this.cacheKey,"_").concat(e),i=this.effects.map((function(e){return{sdfRect:e.sdfBox(t.width,t.height)}})).reduce((function(e,t){return t.sdfRect?(e.width5&&(t.dist=5),x[e]})),o.ctx.slideScopeEventHub.once("slide-render",(function(e){if(o.ctx.slideIndex===e&&o.effectObject){var t=o.getEffectTexture();if(t){var n=t.texture,r=t.offsetX,i=t.offsetY;o.effectObject.setFrameOffset(r,i),o.effectObject.createFrame(1,n)}}}))}return o}return T(n,[{key:"getEffectTexture",value:function(){var e,t=this.json,n=t.lineHeight,r=t.fillLineHeight,i=t.isHorz,o=t.lineWidth,a=this.effectContainer.getLocalBounds(),s=0,u=0,l=S(this.effectContainer.children);try{for(l.s();!(e=l.n()).done;){var c=e.value;c.pivot.x>s&&(s=c.pivot.x),c.pivot.y>u&&(u=c.pivot.y)}}catch(e){l.e(e)}finally{l.f()}var h=new jl.d;h.translate(s,u);var d=Xl.p.create({width:i?a.width:o,height:i?Math.max(r,n):a.height,resolution:2});return this.ctx.renderer.render(this.effectContainer,{renderTexture:d,transform:h}),{texture:d,offsetX:s,offsetY:u}}},{key:"createStrokeFill",value:function(){var e=this.json,t=e.stroke,n=e.lineWidth,r=e.lineHeight;return new Bm(this.ctx,null==t?void 0:t.fill,n,r,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createStrokeGraphics",value:function(){var e=this.json.stroke,t=(null==e?void 0:e.key)?{fillType:"blipFill",src:e.key,filters:[]}:void 0;return new Bm(this.ctx,t,(null==e?void 0:e.width)||0,(null==e?void 0:e.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createTextFill",value:function(){var e=this.json,t=e.isHorz,n=e.fill,r=e.lineWidth,i=e.lineHeight,o=e.fillLineHeight;return t?new Bm(this.ctx,null==n?void 0:n.fill,r,Math.max(o,i),{useFilter:!1,useSlideBackgroundFill:!1}):new Bm(this.ctx,null==n?void 0:n.fill,o,i,{useFilter:!1,useSlideBackgroundFill:!1})}},{key:"createTextGraphics",value:function(){var e,t=this.json,n=t.fill,r=t.content,i="#000000";"solidFill"===(null===(e=null==n?void 0:n.fill)||void 0===e?void 0:e.fillType)&&(i=n.fill.color);var o=(null==n?void 0:n.key)?{fillType:"blipFill",src:n.key,filters:[{type:"changeBulletColor",args:["#000000",i]}]}:void 0;return new Bm(this.ctx,o,(null==n?void 0:n.width)||0,(null==n?void 0:n.height)||0,{useFilter:"◾"===r,useSlideBackgroundFill:!1})}},{key:"getIterateEntry",value:function(){return null}},{key:"getBgElement",value:function(){return null}},{key:"updateTransform",value:function(e){var t,r,i,o,a=this.json.isHorz;e.position={x:a&&null!==(r=null===(t=e.position)||void 0===t?void 0:t.x)&&void 0!==r?r:0,y:a?0:null!==(o=null===(i=e.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},e.width=a?this.json.width:this.json.lineWidth,e.height=a?this.json.lineHeight:this.json.height,f(x(n.prototype),"updateTransform",this).call(this,e)}},{key:"preRender",value:function(){var e;null===(e=this.underline)||void 0===e||e.preRender()}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return cg(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.doRender();case 1:case"end":return e.stop()}}),e,this)})))}),"@TextUnitImpl[doRender]"),e.addSubMTask((function(){return cg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.effectList&&this.effectList.length>0&&(n="".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(null===(t=this.json.fill)||void 0===t?void 0:t.key,"_").concat(this.json.effectIndexList),this.effectObject=new lg(this.effectContainer,this.effectList,n,this.ctx,0,new jl.g(1,1)),this.effectObject.on("ready",(function(){var e;r.effectContainer.visible=!1,r.effectObject.container.zIndex=10,r.container.addChild(r.effectObject.container),null===(e=r.effectObject)||void 0===e||e.updateFrame(1)})));case 1:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"doRender",value:function(){var e=!1,t=this.json,n=t.lineWidth,r=t.lineHeight,i=t.baseLine,o=t.isHorz,a=t.underline,s=t.height,u=t.width,l=t.highlightColor,h=t.x,d=t.y,f=t.content,p=t.fillLineHeight,v=t.fill,m=!1!==this.json.needFill;if(v&&v.fill&&"solidFill"!==v.fill.fillType&&(m=!0),l){var g=new Dd,y=c(Yv(l),2),b=y[0],x=y[1];g.beginFill(b,x),g.drawRect(0,0,o?u:n,o?r:s),g.endFill(),this.textureContainer.addChild(g)}if(this.textGraphics.displayObject){var _=this.textGraphics.displayObject;if(o&&(_.position.y=d>0?d:0),m){var w=this.textFill.displayObject;if(w)w.mask=_,w.addChild(_),w.position.x=-h,_.position.x+=h,e=!0,this.textureContainer.addChild(w);else if(this.textFill.isSolidFill()){var T=new qv;T.color=this.textFill.getSolidFillColor(),_.filters=[T],e=!0,this.textureContainer.addChild(_)}}else this.textureContainer.addChild(_)}if(this.strokeGraphics.displayObject){var M=this.strokeGraphics.displayObject;if(m){var S=this.strokeFill.displayObject;if(S)S.mask=M,S.addChild(M),o?S.position.y=d>0?d:0:S.position.x=h,this.textureContainer.addChild(S);else if(this.strokeFill.isSolidFill()){o?M.position.y=d>0?d:0:M.position.x=h;var E=new qv;E.color=this.strokeFill.getSolidFillColor(),M.filters=[E],e=!0,this.textureContainer.addChild(M)}}else o?M.position.y=d>0?d:0:M.position.x=h,this.textureContainer.addChild(M)}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=a?a-r/16:i,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);var A=this.textFill.getClonedDisplayObject();A?(A.mask=this.underline.sprite,A.addChild(this.underline.sprite),this.textureContainer.addChild(A)):this.textureContainer.addChild(this.underline.sprite)}if(e){var I=Xl.p.create({width:o?u:n,height:o?Math.max(p,r):s,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:I}),this.cacheSprite.texture=I,o&&d<0&&(this.cacheSprite.position.y=d),this.effectContainer.addChild(this.cacheSprite)}else this.effectContainer.addChild(this.textureContainer);this.container.name=f}},{key:"destroy",value:function(){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()}}]),n}(nm),dg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},fg=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,e,r,i)).units=[],o.isHorz=!0,o.hyperLinkMap=new Map,o.hyperLinkContainerMap=new Map,o.effectList=[],i.effectList&&(o.effectList=i.effectList),o}return T(n,[{key:"getIterateElements",value:function(){return this.units}},{key:"getIterateEntry",value:function(e,t,n){return this.units[t]?this.units[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}},{key:"preRender",value:function(){}},{key:"createUnits",value:function(e,t,n,r){for(var i=this,o=function(o,a){r.addSubMTask((function(){return dg(i,void 0,void 0,regeneratorRuntime.mark((function r(){var i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=this.json.textUnits[o],a=this.json,s=a.height,u=a.width,l=a.fillHeight,c=a.baseline,h=a.y,d=a.underline,(f=new hg(Object.assign(Object.assign({},i),{lineHeight:s,lineWidth:u,baseLine:c-h,underline:d,fillLineHeight:l||s,isHorz:this.isHorz,shapeId:e,paragraphIndex:t,lineIndex:n,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).preRender(),this.units.push(f),(i.hyperlink||i.hlinkHover)&&(p=new jv(f.container,this.ctx),i.hyperlink&&p.addAction(i.hyperlink,"click"),i.hlinkHover&&p.addAction(i.hlinkHover,"hover"),this.container.sortableChildren=!0);case 2:case"end":return r.stop()}}),r,this)})))}),"@TextLineImpl[createUnits]")},a=0,s=this.json.textUnits.length;a0)return this.iterateElements;var e=this.lines.reduce((function(e,t){return e.concat(t.getIterateElements())}),[]);return this.iterateElements=e,e}},{key:"getIterateEntry",value:function(e,t,n){var r=this.getIterateElements();return r[t]?r[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}},{key:"preRender",value:function(){}},{key:"createLines",value:function(e,t,n){for(var r=this,i=function(i,o){n.addSubMTask((function(){return pg(r,void 0,void 0,regeneratorRuntime.mark((function r(){var o,a;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:o=this.json.lines[i],(a=new fg(o,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).isHorz=this.isHorz,a.container.name="line-"+i,a.createUnits(e,t,i,n),this.lines.push(a);case 2:case"end":return r.stop()}}),r,this)})))}),"@TextParagraphImpl[createLines]")},o=0,a=this.json.lines.length;o90&&o<270||o<-90&&o>-270)&&(r=-r),i=-a*r}return{x:r,y:i}}((i=-i)/Math.PI*180,n,r),s=e.x-a.x,u=e.y-a.y;return{centerX:s/9525*t.x,centerY:u/9525*t.y,rx:n/9525*t.x,ry:r/9525*t.y,st:-i,end:-i+o,aClockWise:o<0}}function gg(e){for(var t=new os,n=e.scale,r={x:0,y:0},i=e.path.trim().split(" "),o=0;o=0&&(d=xg(s.paths[0].path,this.json.width,this.json.height,i,o),s.paths.unshift(Object.assign(Object.assign({},s.paths[0]),{path:d}))),f=function(e,t,n,r){if(!bg[n])return null;var i=bg[n].top(gg(t)),o=bg[n].bottom(gg(e));if(i.length!==o.length)return null;for(var a=Math.min(i.length,o.length),s=1/(a-1),u=[],l=[],c=new Array(2*a).fill("").map((function(e,t){return t})),h=0;h0&&(this.textColorFilter.color=e)},get:function(){return this.textColorFilter.color}},{key:"on",get:function(){var e;return(null!==(e=this.container.filters)&&void 0!==e?e:[]).length>0?"true":"false"},set:function(e){var t;"true"===e?(null!==(t=this.container.filters)&&void 0!==t?t:[]).indexOf(this.textColorFilter)<0&&(this.container.filters=[this.textColorFilter]):this.container.filters=[]}}]),e}(),Tg=function(){function e(t){_(this,e),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()}return T(e,[{key:"setPivot",value:function(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;default:this.pivot={x:this.width,y:this.height/2}}}},{key:"generatePaths",value:function(){this.hash="arrow-"+_v()(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}}]}},{key:"getUnitPath",value:function(){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""}}},{key:"setScaleFromLineWidth",value:function(){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!")}}},{key:"setScaleFromSize",value:function(){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}}]),e}(),Mg=function(){function e(t,n,r,i,o,a,s,u,l,c,h){_(this,e),this.id=t,this.ctx=n,this.paths=r,this.hash=i,this.nept=o,this.width=a,this.height=s,this.lineStyle=u,this.shouldFill=l,this.bgColor=c,this.lnColor=h,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(r),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)}return T(e,[{key:"pointDis",value:function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}},{key:"isPoint",value:function(e){return Number.isNaN(Number(e.x))||Number.isNaN(Number(e.y))}},{key:"isSquare",value:function(e,t){var n=this;if("MLLLC"!==e.join("")&&"MLLLCC"!==e.join(""))return!1;var r=t.filter((function(e){return!n.isPoint(e)}));if(4!==r.length)return!1;var i,o=Math.min.apply(Math,a(r.map((function(e){return e.x})))),s=Math.min.apply(Math,a(r.map((function(e){return e.y})))),u=Math.max.apply(Math,a(r.map((function(e){return e.x})))),l=Math.max.apply(Math,a(r.map((function(e){return e.y})))),c=S(r);try{for(c.s();!(i=c.n()).done;){var h=i.value;if(h.x!==o&&h.x!==u||h.y!==s&&h.y!==l)return!1}}catch(e){c.e(e)}finally{c.f()}return!0}},{key:"rectangleDetect",value:function(e){if(1!==e.length)return!1;var t=e[0].path.trim().split(" ");if(10!==t.length)return!1;for(var n=[],r=[],i=0;in&&(n=o.pivot.x),o.pivot.y>r&&(r=o.pivot.y)}}catch(e){i.e(e)}finally{i.f()}var a=new jl.d;if(a.translate(n,r),0===this.effectContainer.children.length)return null;var s=Xl.p.create({width:t.width,height:t.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(this.effectContainer,{renderTexture:s,transform:a}),{texture:s,offsetX:n,offsetY:r}}},{key:"createStrokeGraphics",value:function(){var e,t,n,r,i=this.json,o=i.id,a=i.geometry,s=i.lineStyle,u=(null==a?void 0:a.lineTransform)||Eg,l=u.width,c=u.height,h=u.pivot,d=l||this.json.width,f=c||this.json.height,p="solidFill"===(null===(e=null==s?void 0:s.fill)||void 0===e?void 0:e.fillType)?s.fill.color:null;return s&&"noFill"!==(null===(t=s.fill)||void 0===t?void 0:t.fillType)?new Mg(o+"-path-graphics",this.ctx,null!==(n=null==a?void 0:a.paths)&&void 0!==n?n:[],null!==(r=null==a?void 0:a.hash)&&void 0!==r?r:"",h||{x:0,y:0},d,f,s,!1,null,p):null}},{key:"createStrokeFill",value:function(){var e=c(this.calculateFillObjectOffset(),2),t=e[0],n=e[1],r=this.json,i=r.geometry,o=r.lineStyle,a=r.width,s=r.height,u=(null==i?void 0:i.lineTransform)||Eg,l=Tv()(null==o?void 0:o.width)?o.width:1;return new Bm(this.ctx,null==o?void 0:o.fill,(u.width||a)+l+t,Math.max((u.height||s)+l,n),{useFilter:!0,useSlideBackgroundFill:!1})}},{key:"createBackgroundGraphics",value:function(){var e,t=this.json,n=t.geometry,r=t.lineStyle,i=t.fillStyle,o=t.id,a=(null==n?void 0:n.lineTransform)||Eg,s=a.width,u=a.height,l=a.pivot,c=s||this.json.width,h=u||this.json.height,d="solidFill"===(null==i?void 0:i.fillType)?i.color:null;return i&&"noFill"!==i.fillType||this.json.isPicture?new Mg(o+"-bg-graphics",this.ctx,null!==(e=null==n?void 0:n.paths)&&void 0!==e?e:[],(null==n?void 0:n.hash)||"",l||{x:0,y:0},c,h,r,!0,d,null):null}},{key:"createBackgroundFill",value:function(){var e,t,n,r,i=this.json,o=i.fillStyle,a=i.width,s=i.height,u=i.lineStyle,l=i.geometry,c=(null==l?void 0:l.fillTransform)||Eg,h={useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation},d=this.useGroupFill&&(null===(e=this.option.groupSize)||void 0===e?void 0:e.w)?this.option.groupSize.w:c.width||a,f=this.useGroupFill&&(null===(t=this.option.groupSize)||void 0===t?void 0:t.h)?this.option.groupSize.h:c.height||s;return new Bm(this.ctx,o,d+(null!==(n=null==u?void 0:u.width)&&void 0!==n?n:0),f+(null!==(r=null==u?void 0:u.width)&&void 0!==r?r:0),h)}},{key:"createBackground",value:function(){var e,t,n,r,i,o,a,s,u,l,c,h,d=(null===(e=this.json.geometry)||void 0===e?void 0:e.fillTransform)||Eg,f=d.pivot,p=d.width,v=d.height,m=this.backgroundFill.displayObject;m?(this.json.useBgFill&&(null===(n=this.backgroundGraphics)||void 0===n?void 0:n.displayObject)?(this.needCacheAsBitMap=!0,m.mask=this.backgroundGraphics.displayObject,m.pivot.x=(null===(r=this.json.position)||void 0===r?void 0:r.x)||0,m.pivot.y=(null===(i=this.json.position)||void 0===i?void 0:i.y)||0,this.effectContainer.addChild(this.backgroundGraphics.displayObject)):"gifFill"===(null===(o=this.json.fillStyle)||void 0===o?void 0:o.fillType)?(m.height=v||this.designHeight,m.width=p||this.designWidth,m instanceof jp&&m.play(),(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.isNeedMask(m.width,m.height))&&(m.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):(null===(s=this.backgroundGraphics)||void 0===s?void 0:s.isNeedMask(m.width,m.height))&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,m.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(m.x=f.x,m.y=f.y),this.useGroupFill&&(m.x-=null!==(l=null===(u=this.json.position)||void 0===u?void 0:u.x)&&void 0!==l?l:0,m.y-=null!==(h=null===(c=this.json.position)||void 0===c?void 0:c.y)&&void 0!==h?h:0),this.effectContainer.addChild(m)):this.backgroundFill.hasFill&&(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.displayObject)&&this.effectContainer.addChild(this.backgroundGraphics.displayObject)}},{key:"createPathFill",value:function(){var e,t,n,r=this.strokeFill.displayObject,i=null===(e=this.strokeGraphics)||void 0===e?void 0:e.displayObject,o=c(this.calculateFillObjectOffset(),2),a=o[0],s=o[1];r?((null===(t=this.strokeGraphics)||void 0===t?void 0:t.isNeedMask(r.width,r.height))&&i&&(this.needCacheAsBitMap=!0,r.pivot.x=i.pivot.x,r.pivot.y=i.pivot.y,i.pivot.x=0,i.pivot.y=0,r.mask=i,r.addChild(i),r.position.x=-a/2,r.position.y=-s/2,i.position.x=a/2,i.position.y=s/2),this.effectContainer.addChild(r)):this.strokeFill.hasFill&&(null===(n=this.strokeGraphics)||void 0===n?void 0:n.displayObject)&&this.effectContainer.addChild(this.strokeGraphics.displayObject)}},{key:"createFilledPathMask",value:function(){var e,t,n,r,i=(null===(t=null===(e=this.json.geometry)||void 0===e?void 0:e.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],o=S(i);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=this.ctx.graphicsTexture.getGraphicsData(a.id);if(s){var u=new Ld(s.texture);u.pivot.x=s.pivot.x,u.pivot.y=s.pivot.y,u.scale.x=s.scale,u.scale.y=s.scale;var l=this.backgroundFill.getClonedDisplayObject(),c=null===(n=this.backgroundGraphics)||void 0===n?void 0:n.getClonedDisplayObject(),h=l||c;h&&(this.backgroundFill.displayObject&&(h.pivot.x=this.backgroundFill.displayObject.pivot.x,h.pivot.y=this.backgroundFill.displayObject.pivot.y),h.mask=u,h.filters=[tm[a.fill]],this.needCacheAsBitMap=!0,this.effectContainer.addChild(h),this.effectContainer.addChild(u))}}}catch(e){o.e(e)}finally{o.f()}}},{key:"createArrow",value:function(){var e=this;this.arrowList.length&&this.arrowList.forEach((function(t){var n,r=e.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(r){var i=r.texture,o=new Ld(i);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,o.scale.x=r.scale,o.scale.y=r.scale,null===(n=e.backgroundGraphics)||void 0===n||n.addArrows(o)}}))}},{key:"generateArrowList",value:function(){var e,t,n=this,r=this.json,i=r.lineArrowList,o=r.lineStyle,a=r.id,s="solidFill"===(null===(e=null==o?void 0:o.fill)||void 0===e?void 0:e.fillType)?o.fill.color:null;null===(t=i||[])||void 0===t||t.forEach((function(e,t){var r,i,u=new Tg(Object.assign(Object.assign({},e),{fillStyle:null==o?void 0:o.fill,lineWidth:null!==(r=null==o?void 0:o.width)&&void 0!==r?r:0}));u.graphicsId="".concat(a,"-arrow-").concat(t,"-graphics"),u.textureId="".concat(a,"-arrow-").concat(t,"-fill"),n.ctx.graphicsTexture.addGraphics(u.graphicsId,null!==(i=u.paths)&&void 0!==i?i:[],u.hash,{x:0,y:0},u.width,u.height,void 0,n.ctx.objectPoolGroup,!0,s,null),n.arrowList.push(u)}))}},{key:"calculateFillObjectOffset",value:function(){var e=0,t=0;return this.arrowList.length&&(e=this.arrowList.reduce((function(e,t){return Math.max(e,t.width)}),0),t=this.arrowList.reduce((function(e,t){return Math.max(e,t.height)}),0)),[e,t]}},{key:"preRender",value:function(e){var t,n,r,i=this,o=this.json,a=o.lineStyle,s=o.geometry,u=(null==s?void 0:s.lineTransform)||Eg,l=u.width,c=u.height,h=l||this.json.width,d=c||this.json.height,f=(null===(t=null==s?void 0:s.paths)||void 0===t?void 0:t.filter((function(e){return"none"!==e.fill&&"norm"!==e.fill})))||[],p="solidFill"===(null===(n=null==a?void 0:a.fill)||void 0===n?void 0:n.fillType)?a.fill.color:null;e.addSubMTask((function(){return Sg(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=S(f);try{for(t.s();!(n=t.n()).done;)r=n.value,this.ctx.graphicsTexture.addGraphics(r.id,[r],r.hash,((null==s?void 0:s.lineTransform)||Eg).pivot,h,d,a,this.ctx.objectPoolGroup,!0,null,p)}catch(e){t.e(e)}finally{t.f()}case 2:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[addGraphics]"),null===(r=this.text)||void 0===r||r.createParagraphs(this.json.id,e)}},{key:"subClassRender",value:function(){return Sg(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))}},{key:"render",value:function(e){var t=this;e.addSubMTask((function(){return Sg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null===(t=this.strokeGraphics)||void 0===t||t.render(),null===(n=this.backgroundGraphics)||void 0===n||n.render(),this.createBackground(),e.next=5,this.subClassRender();case 5:this.createFilledPathMask(),this.createPathFill(),this.createArrow();case 8:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[render]"),this.text&&this.text.render(e),e.addSubMTask((function(){return Sg(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,S,E,A,I,C=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"wd"===(null===(t=this.json.textBody)||void 0===t?void 0:t.iterateType)||"lt"===(null===(n=this.json.textBody)||void 0===n?void 0:n.iterateType)?(this.renderContainer.addChild(this.container),this.text&&(p=null!==(r=this.json.scale)&&void 0!==r?r:{x:1,y:1},v=p.x,m=p.y,this.text.container.scale.x=m<0?-Math.abs(v):Math.abs(v),this.text.container.scale.y=m,this.text.container.position.x=(null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.x)&&void 0!==o?o:0)+this.text.x,this.text.container.position.y=(null!==(s=null===(a=this.json.position)||void 0===a?void 0:a.y)&&void 0!==s?s:0)+this.text.y,this.text.container.scale.y<0&&(this.text.container.position.y+=this.text.height),this.text.container.scale.x<0&&(this.text.container.position.x+=this.json.width),this.json.textRotation&&(this.text.container.rotation=this.json.textRotation),this.renderContainer.addChild(this.text.container))):(this.text&&(this.json.textRotation&&(this.text.container.rotation=this.json.textRotation,g=this.text,y=g.width,b=g.height,x=this.text.container.position,_=x.x,w=x.y,this.text.container.pivot.x=y/2,this.text.container.pivot.y=b/2,this.text.container.x=_+y/2,this.text.container.y=w+b/2),Hv()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape&&(T=this.json.rotation||0,this.text.container.rotation=-T,M=this.text.width,this.text.container.position.x=M),this.text.container.zIndex=100,S=null===(u=this.json.effectList)||void 0===u?void 0:u.find((function(e){return"outerShadow"===e.type})),E=null===(l=this.json.effectList)||void 0===l?void 0:l.find((function(e){return"softEdge"===e.type})),A=null===(c=this.json.effectList)||void 0===c?void 0:c.find((function(e){return"glow"===e.type})),S&&1!==S.sx||E||A?this.container.addChild(this.text.container):this.effectContainer.addChild(this.text.container)),this.renderContainer.addChild(this.container)),this.needCacheAsBitMap,"background"===this.json.id&&this.ctx.hasBackgroundFillShape&&(I=Xl.p.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)}),this.ctx.renderer.render(this.renderContainer,{renderTexture:I}),this.ctx.bgTexture=I),this.json.effectList&&this.json.effectList.length>0&&(null===(h=this.ctx.featureList)||void 0===h?void 0:h.effect)&&!this.ctx.forceCanvas&&!this.json.media&&(this.effectObject=new lg(this.effectContainer,this.json.effectList,"".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(this.json.id),this.ctx,this.json.rotation||0,new jl.g((null===(d=this.json.scale)||void 0===d?void 0:d.x)||1,(null===(f=this.json.scale)||void 0===f?void 0:f.y)||1)),function(e){var t,n,r;return"gifFill"===(null===(t=e.fillStyle)||void 0===t?void 0:t.fillType)||"gifFill"===(null===(r=null===(n=e.lineStyle)||void 0===n?void 0:n.fill)||void 0===r?void 0:r.fillType)||!!e.picFill&&"gifFill"===e.picFill.fillType}(this.json)&&this.effectObject.setFrameCount(-1),this.effectObject.on("ready",(function(){var e;C.effectContainer.visible=!1,C.effectObject.container.zIndex=10,C.container.addChild(C.effectObject.container),null===(e=C.effectObject)||void 0===e||e.updateFrame(1)})));case 3:case"end":return e.stop()}}),e,this)})))}),"@ShapeImpl[post.render]")}},{key:"clearOnSlideChange",value:function(){}},{key:"initOnReuse",value:function(){}},{key:"destroy",value:function(){var e,t,n,r;null===(e=this.text)||void 0===e||e.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),null===(t=this.backgroundGraphics)||void 0===t||t.destroy(),this.strokeFill.destroy(),null===(n=this.strokeGraphics)||void 0===n||n.destroy(),this.renderContainer.destroy(),null===(r=this.arrowRenderTexture)||void 0===r||r.destroy(!0),this.arrowList=[],this.effectDisposer()}},{key:"interactiveContainer",get:function(){return this.renderContainer}},{key:"strokeActive",get:function(){var e,t,n,r,i,o,a;return this.strokeFill.displayObject?(null!==(n=null===(t=null===(e=this.strokeFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==n?n:-1)>0:(null!==(a=null===(o=null===(i=null===(r=this.strokeGraphics)||void 0===r?void 0:r.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,n,r,i,o,a,s=this.strokeFill.displayObject;e?s&&(null!==(n=null===(t=s.filters)||void 0===t?void 0:t.indexOf(this.strokeColorFilter))&&void 0!==n?n:-1)<0?s.filters=[this.strokeColorFilter]:(null===(r=this.strokeGraphics)||void 0===r?void 0:r.displayObject)&&(null!==(o=null===(i=this.strokeGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.strokeColorFilter))&&void 0!==o?o:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):s?s.filters=[]:(null===(a=this.strokeGraphics)||void 0===a?void 0:a.displayObject)&&(this.strokeGraphics.displayObject.filters=[])}},{key:"pptColorActive",get:function(){var e,t;return(null!==(t=null===(e=this.renderContainer.filters)||void 0===e?void 0:e.length)&&void 0!==t?t:-1)>0},set:function(e){this.renderContainer.filters=e?[this.pptColorFilter]:[]}},{key:"fillActive",get:function(){var e,t,n,r,i,o,a;return this.backgroundFill.displayObject?(null!==(n=null===(t=null===(e=this.backgroundFill.displayObject)||void 0===e?void 0:e.filters)||void 0===t?void 0:t.length)&&void 0!==n?n:-1)>0:(null!==(a=null===(o=null===(i=null===(r=this.backgroundGraphics)||void 0===r?void 0:r.displayObject)||void 0===i?void 0:i.filters)||void 0===o?void 0:o.length)&&void 0!==a?a:-1)>0},set:function(e){var t,n,r,i,o,a;e?this.backgroundFill.displayObject&&(null!==(n=null===(t=this.backgroundFill.displayObject.filters)||void 0===t?void 0:t.indexOf(this.fillColorFilter))&&void 0!==n?n:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:(null===(r=this.backgroundGraphics)||void 0===r?void 0:r.displayObject)&&(null!==(o=null===(i=this.backgroundGraphics.displayObject.filters)||void 0===i?void 0:i.indexOf(this.fillColorFilter))&&void 0!==o?o:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:(null===(a=this.backgroundGraphics)||void 0===a?void 0:a.displayObject)&&(this.backgroundGraphics.displayObject.filters=[])}}]),n}(Fv),Ig=n(119),Cg=new(n.n(Ig).a),Ng=Cg.getDevice(),kg=Cg.getBrowser(),Dg=Cg.getOS(),Pg={isDesktop:function(){var e=!0;return"mobile"===Ng.type&&(e=!1),/Samsung/.test(kg.name||"")&&(e=!1),window.__nativeTags&&window.__nativeTags.platform&&(e=!1),e},isIOS:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(e=!0),Dg.name&&/iOS/.test(Dg.name)&&(e=!0),e},isAndroid:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(e=!0),Dg.name&&/android/i.test(Dg.name)&&(e=!0),e},isLowGpuMemory:function(){var e,t,n=null!==(t=null===(e=window.__nativeTags)||void 0===e?void 0:e.platform)&&void 0!==t?t:"";if(n){var r=n.split(" ");if(r[1]){if(/^iPad/.test(r[1])){var i=r[1].match(/^iPad(\d+)/);return!(i&&i[1]&&parseInt(i[1],10)>=6)}if(/^iPhone/.test(r[1])){var o=r[1].match(/^iPhone(\d+)/);return!(o&&o[1]&&parseInt(o[1],10)>=9)}return!1}return!1}return!0}},Og=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function Rg(e,t){for(var n in t)e.style[n]=t[n]}var Lg="median-container",jg=1500,Bg=300,Ug=50,zg="0",Fg="1",Gg=.4,Hg=function(){function e(t){var n,r,i=this;_(this,e),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.fullScreenButton=document.createElement("div"),this.exitFullScreenButton=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.isVideo=!1,this.start=0,this.end=0,this.fullscreenStatus=!1,this.fadeState={in:!1,out:!1},this.changeMediaProgress=function(e){if(i.ctx.isPlayerPaused())i.ctx.logger.info("Media controller prevent seek event with paused state",i.ctx.taskId);else{e.stopPropagation();var t=e.offsetX/i.progress.clientWidth*i.duration;i.medianIsEnd=!1,"interactive"!==i.ctx.mode&&i.jumpToTime(t),"local"!==i.ctx.mode&&i.ctx.eventHub.emit(bb.mediaSeek,{id:i.targetId,time:t,isPlaying:i.media.isPlaying}),i.delayHide()}},this.jumpToTime=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Og(i,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,dv((function(){return!!r.duration}),3e3);case 2:n=Math.floor(e)+this.start,this.media.currentTime!==n&&(this.media.currentTime=n,this.changeBookmarkIndex(n,n>this.media.currentTime));case 4:case"end":return t.stop()}}),t,this)})))},this.showController=function(e){e.stopPropagation(),i.show()},this.getMediaDuration=function(){i.duration&&!Number.isNaN(i.duration)||(i.duration=i.media.duration,i.start&&(i.duration-=i.start,i.jumpToTime()),i.end&&(i.duration-=i.end)),i.totalTime.innerText=e.formatTime(i.duration)},this.playMedia=function(){return Og(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="none",this.pauseButton.style.display="block",e.next=4,this.media.play();case 4:this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach((function(e){e()})),this.delayHide();case 7:case"end":return e.stop()}}),e,this)})))},this.pauseMedia=function(){return Og(i,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.playButton.style.display="block",this.pauseButton.style.display="none",e.next=4,this.media.pause();case 4:case"end":return e.stop()}}),e,this)})))},this.onMouseOut=function(e){e.stopPropagation(),i.hide()},this.mediaTimeUpdate=function(){return Og(i,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.media.currentTime-this.start,t.t0=this.duration>0&&(Math.abs(n-this.duration)<.3||n>this.duration),!t.t0){t.next=9;break}return t.next=5,this.pauseMedia();case 5:this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(bb.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle();case 9:if(this.currentTime.innerText=e.formatTime(n),this.currentProgress.style.flex=(n/this.duration).toString(),!(this.bookmarkList&&this.bookmarkList.length>0)){t.next=14;break}(r=this.bookmarkList[this.pickBookmarkIndex])&&r.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit("shape ".concat(this.shapeId," onMediaBookmark ").concat(r.name)),this.pickBookmarkIndex+=1);case 14:this.fadeHit(n);case 15:case"end":return t.stop()}}),t,this)})))},this.onPauseMedia=function(){i.playButton.style.display="block",i.pauseButton.style.display="none"},this.onPlayMedia=function(){i.fadeState={in:!1,out:!1},i.fadeHit(0),i.playButton.style.display="none",i.pauseButton.style.display="block",i.playCallBackList.forEach((function(e){e()})),i.media.currentTime0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"viewBox","0 0 512 512"),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width",t.toString());var r=document.createElementNS("http://www.w3.org/2000/svg","polyline");return r.setAttributeNS(null,"points","35 0, 477 256, 35 512"),r.setAttributeNS(null,"fill","#000000"),n.appendChild(r),n}},{key:"generatePauseButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=document.createElementNS("http://www.w3.org/2000/svg","svg");Rg(n,{height:e+"px"}),n.setAttributeNS(null,"viewBox","0 0 512 512"),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width",t.toString());var r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttributeNS(null,"x","35"),r.setAttributeNS(null,"y","0"),r.setAttributeNS(null,"width","148"),r.setAttributeNS(null,"height","512");var i=r.cloneNode(!0);return i.setAttributeNS(null,"x","330"),n.append(r,i),n}},{key:"generateFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=document.createElementNS("http://www.w3.org/2000/svg","svg");Rg(n,{height:e+"px",width:t+"px"}),n.setAttributeNS(null,"width",t.toString()),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"viewBox","0 0 1024 1024");var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M918.116352 107.409408c10.186752 10.175488 10.186752 26.691584 0 36.87936L653.734912 407.038976c-10.187776 10.187776-26.703872 10.187776-36.891648 0-10.175488-10.187776-10.175488-26.703872 0.013312-36.891648l264.38144-262.73792c10.174464-10.187776 26.69056-10.200064 36.87936-0.013312L918.117376 107.409408zM878.281728 148.096l-161.155072-0.44544c-11.283456 0.279552-20.85888-8.226816-21.90336-19.458048l0-13.421568c0.318464-10.671104 8.889344-19.241984 19.560448-19.560448l187.030528 0.827392c0.1792-0.037888 0.357376-0.0768 0.523264-0.089088l9.549824-0.229376c5.005312-0.152576 9.843712 1.770496 13.372416 5.336064 3.32288 3.629056 4.9664 8.49408 4.545536 13.40928l-1.032192 9.537536c0 0.191488 0.70144 0.318464 0.70144 0.49664l-0.534528 188.279808c-0.54784 9.984-9.092096 17.637376-19.076096 17.089536-0.165888-0.012288-0.319488-0.0256-0.484352-0.037888L896.009216 329.8304c-10.379264-0.0512-18.733056-8.506368-18.681856-18.885632 0.013312-0.191488 0.013312-0.381952 0.013312-0.585728L878.281728 148.096zM105.884672 916.661248c-10.187776-10.175488-10.200064-26.691584-0.013312-36.87936 0 0 0-0.013312 0.013312-0.013312l265.19552-262.73792c10.35264-10.008576 26.86976-9.729024 36.866048 0.636928 9.766912 10.110976 9.766912 26.131456 0 36.242432L143.579136 916.661248C133.072896 926.848 116.3776 926.848 105.884672 916.661248L105.884672 916.661248zM146.533376 875.973632l161.154048 0.433152c11.283456-0.292864 20.85888 8.213504 21.891072 19.458048l0 13.38368c-0.292864 10.672128-8.876032 19.255296-19.560448 19.561472l-187.858944-0.828416c-0.165888 0.037888-0.344064 0.075776-0.509952 0.089088l-9.550848 0.229376c-5.004288 0.152576-9.831424-1.782784-13.35808-5.336064-3.323904-3.629056-4.979712-8.493056-4.54656-13.395968l1.031168-9.537536c0-0.191488-0.712704-0.330752-0.700416-0.509952l0.534528-188.278784c0.534528-9.984 9.066496-17.625088 19.050496-17.089536 0.165888 0.013312 0.330752 0.0256 0.508928 0.037888l14.212096 0c10.365952 0.0512 18.719744 8.507392 18.656256 18.873344 0 0.191488 0 0.395264-0.013312 0.598016L146.533376 875.973632zM918.116352 916.661248c10.186752-10.175488 10.200064-26.691584 0.012288-36.87936 0 0 0-0.013312-0.012288-0.013312l-264.38144-262.73792c-10.365952-10.008576-26.86976-9.729024-36.87936 0.636928-9.766912 10.110976-9.766912 26.131456 0 36.242432L881.22368 916.661248c10.186752 10.186752 26.703872 10.186752 36.891648 0.013312L918.115328 916.661248 918.116352 916.661248zM878.281728 875.973632l-161.168384 0.433152c-11.270144-0.292864-20.845568 8.213504-21.890048 19.458048l0 13.38368c0.306176 10.672128 8.889344 19.241984 19.560448 19.561472l187.030528-0.828416c0.1792 0.037888 0.357376 0.075776 0.523264 0.089088l9.549824 0.229376c5.005312 0.152576 9.843712-1.782784 13.372416-5.336064 3.32288-3.629056 4.978688-8.493056 4.545536-13.395968l-1.032192-9.537536c0-0.191488 0.70144-0.330752 0.70144-0.509952l-0.534528-188.278784c-0.54784-9.984-9.092096-17.637376-19.076096-17.089536-0.165888 0.013312-0.319488 0.0256-0.484352 0.037888L896.009216 694.19008c-10.379264 0.0512-18.733056 8.507392-18.681856 18.885632 0 0.191488 0.013312 0.381952 0.013312 0.584704L878.281728 875.973632zM105.884672 107.409408c-10.187776 10.175488-10.187776 26.691584 0 36.87936l265.19552 262.750208c10.187776 10.187776 26.691584 10.187776 36.87936 0s10.175488-26.703872-0.012288-36.891648l-264.368128-262.73792C133.072896 97.222656 116.3776 97.222656 105.884672 107.409408L105.884672 107.409408zM146.533376 148.096l161.154048-0.44544c11.283456 0.292864 20.85888-8.213504 21.891072-19.458048l0-13.421568c-0.306176-10.671104-8.889344-19.241984-19.560448-19.560448l-187.858944 0.827392c-0.165888-0.0512-0.344064-0.0768-0.509952-0.089088l-9.550848-0.229376c-5.004288-0.152576-9.831424 1.782784-13.35808 5.336064-3.323904 3.629056-4.979712 8.49408-4.54656 13.40928l1.031168 9.537536c0 0.191488-0.712704 0.318464-0.700416 0.49664l0.534528 188.279808c0.534528 9.970688 9.066496 17.624064 19.050496 17.089536 0.165888-0.012288 0.330752-0.0256 0.508928-0.037888l14.212096 0c10.365952-0.0512 18.719744-8.506368 18.656256-18.87232 0-0.191488 0-0.395264-0.013312-0.598016L146.533376 148.096z"),n.appendChild(r),document.body.appendChild(n),n}},{key:"generateExitFullScreenButton",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=document.createElementNS("http://www.w3.org/2000/svg","svg");Rg(n,{height:e+"px",width:t+"px"}),n.setAttributeNS(null,"width",t.toString()),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"viewBox","0 0 1024 1024");var r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M716.8 998.4a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 0 1 25.6-25.6h256a25.6 25.6 0 1 1 0 51.2h-230.4v230.4a25.6 25.6 0 0 1-25.6 25.6zM307.2 998.4a25.6 25.6 0 0 1-25.6-25.6v-230.4H51.2a25.6 25.6 0 1 1 0-51.2h256a25.6 25.6 0 0 1 25.6 25.6v256a25.6 25.6 0 0 1-25.6 25.6zM972.8 332.8h-256a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 1 1 51.2 0v230.4h230.4a25.6 25.6 0 1 1 0 51.2zM307.2 332.8h-256a25.6 25.6 0 1 1 0-51.2h230.4V51.2a25.6 25.6 0 1 1 51.2 0v256a25.6 25.6 0 0 1-25.6 25.6z"),i.setAttributeNS(null,"d","M307.2 332.8a25.6 25.6 0 0 1-18.112-7.488L56.896 93.12a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192A25.6 25.6 0 0 1 307.2 332.8zM716.8 332.8a25.6 25.6 0 0 1-18.112-43.712L930.88 56.896a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488zM948.992 974.592a25.6 25.6 0 0 1-18.112-7.488l-232.192-232.192a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192a25.6 25.6 0 0 1-18.112 43.712zM75.008 974.592a25.6 25.6 0 0 1-18.112-43.712l232.192-232.192a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488z"),n.appendChild(r),n.appendChild(i),document.body.appendChild(n),n}},{key:"createButton",value:function(){var e={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px",display:"flex",justifyContent:"center",alignItems:"center"};Rg(this.playButton,Object.assign(Object.assign({},e),{display:"block"}));var t=this.generatePlayButton();Rg(t,{height:"20px"}),this.playButton.appendChild(t),Rg(this.pauseButton,Object.assign(Object.assign({},e),{display:"none"}));var n=this.generatePauseButton();if(Rg(n,{height:"20px"}),this.pauseButton.appendChild(n),this.isVideo){var r=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(r),Rg(this.fullScreenButton,Object.assign(Object.assign({},e),{display:"block"}));var i=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(i),Rg(this.exitFullScreenButton,Object.assign(Object.assign({},e),{display:"none"}))}}},{key:"createTimer",value:function(){var e=document.createElement("div");Rg(e,{width:"100px"}),this.currentTime.innerText="00:00";var t=document.createElement("span");return t.innerText="/",e.append(this.currentTime,t,this.totalTime),e}},{key:"createProgress",value:function(){var e={flex:"1",position:"relative"};this.isVideo||(e.marginRight="10px"),Rg(this.progress,e);var t=document.createElement("div");Rg(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Rg(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),t.appendChild(this.currentProgress)}},{key:"fadeHit",value:function(e){if(this.info.fade){var t=this.info.fade,n=t.start,r=t.end;n&&!this.fadeState.in&&e>=0&&(this.fadeState.in=!0,this.media.fadeIn(0,n)),r&&!this.fadeState.out&&e>=this.duration-r/1e3&&(this.fadeState.out=!0,this.media.fadeOut(0,r))}}},{key:"changeBookmarkIndex",value:function(e,t){if(this.bookmarkList&&0!==this.bookmarkList.length){if(this.pickBookmarkIndex>0)for(var n=0;ne){this.pickBookmarkIndex=n;break}if(t){for(var r=this.pickBookmarkIndex-1,i=0;il?l/n:1);s.y=s.y+this.height-r,s.x=Math.max(s.x,0),s.x=Math.min(s.x,o-n*c),s.y=Math.max(s.y,0),s.y=Math.min(s.y,a-r),Rg(this.mediaController,{height:r+"px",borderRadius:r/2+"px",width:n+"px",flexDirection:"row",alignItems:"center",position:"absolute",left:s.x+"px",top:s.y+"px",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:"scale(".concat(c,")"),transformOrigin:"0 100%"}),this.fullscreenStatus&&Rg(this.mediaController,{left:"0",top:a-r+"px"})}},{key:"createMediaController",value:function(){this.setControllerPosition(),Rg(this.mediaController,{display:"none",transition:"opacity ".concat(Gg,"s")}),this.createButton();var e=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,e,this.progress),this.isVideo&&this.mediaController.append(this.fullScreenButton,this.exitFullScreenButton),this.container.appendChild(this.mediaController),this.bindEvent()}},{key:"addPlayCallBack",value:function(e){this.playCallBackList.push(e)}},{key:"fullscreenPlay",value:function(){this.fullscreenStatus=!0,"interactive"!==this.ctx.mode&&this.media.requestFullscreen(),"local"!==this.ctx.mode&&this.ctx.eventHub.emit(bb.fullscreenChange,{targetId:this.targetId,state:!0}),this.delayHide()}},{key:"changeFullScreenState",value:function(e,t,n){n===this.ctx.slideIndex&&(e&&this.targetId===t?this.fullscreenStatus=e:this.fullscreenStatus=!1,this.fullscreenStatus?(this.fullScreenButton.style.display="none",this.exitFullScreenButton.style.display="block"):(this.fullScreenButton.style.display="block",this.exitFullScreenButton.style.display="none"),this.setControllerPosition())}},{key:"bindEvent",value:function(){Pg.isDesktop()&&(this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.mediaController.addEventListener("mouseover",this.showController,!1)),this.progress.addEventListener("click",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),this.containerObserver=new MutationObserver(this.onContainerSizeChange),this.container&&this.containerObserver.observe(this.container,{attributes:!0,attributeFilter:["data-scale","style"]}),this.isVideo&&(this.ctx.globalEventHub.on("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.on("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.addEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.addEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"unbindEvent",value:function(){var e;Pg.isDesktop()&&(this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.mediaController.removeEventListener("mouseover",this.showController,!1)),this.progress.removeEventListener("click",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this._pauseMediaFromCtrl,!1),this.media.removeAllListeners(),null===(e=this.containerObserver)||void 0===e||e.disconnect(),this.isVideo&&(this.ctx.globalEventHub.removeListener("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.removeListener("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.removeEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.removeEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}},{key:"show",value:function(){this.setControllerPosition(),this.mediaController.style.opacity=Fg,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}},{key:"hide",value:function(){this.fullscreenStatus?this.mediaController.style.opacity=zg:this.mediaController.style.display="none"}},{key:"delayHide",value:function(){var e=this;clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout((function(){e.hide()}),jg)}},{key:"destroy",value:function(){var e;this.unbindEvent(),this.playCallBackList=[],null===(e=this.container)||void 0===e||e.removeChild(this.mediaController)}},{key:"clippedDuration",get:function(){return this.duration}}],[{key:"formatTime",value:function(e){var t="00:00";if(e){var n=Math.floor(e/60),r=String(n<0?0:n).padStart(2,"0"),i=Math.floor(e%60);t="".concat(r,":").concat(String(i<0?0:i).padStart(2,"0"))}return t}}]),e}(),Vg=n(120),Wg=function(e){p(n,e);var t=m(n);function n(e,r,i){var o,a,s,u;return _(this,n),(a=t.call(this)).isGlobalPause=!1,a.lastTime=-1,a.howl=null,a.rctClient=null,a.isHowlEnd=!1,a.isHowlLoadEmit=!1,a.staticEventId=1001,a._catParams=void 0,a.url=e,a.runningAudio=r,i&&(a._catParams=i),xb.RtcAudioClazz?(a.rctClient=new xb.RtcAudioClazz(e,null===(s=a._catParams)||void 0===s?void 0:s.start,null===(u=a._catParams)||void 0===u?void 0:u.end),a.rctClient.on("load",(function(){return a.emit("load")})),a.rctClient.on("pause",(function(){return a.emit("pause")})),a.rctClient.on("play",(function(){a.startTimeChangeEmit(),a.emit("play")})),a.rctClient.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){a.emit("resumeAllAudioInterruptByAudioSessionChanged")}))):(a.howl=new Vg.Howl({src:[e]}),o=c(a.howl._getSoundIds(),1),a.staticEventId=o[0],a.howl.load(),a.howl.on("load",(function(){a.isHowlLoadEmit=!0,a.emit("load")})),a.howl.on("pause",(function(){return a.emit("pause")})),a.howl.on("play",(function(){a.isHowlLoadEmit||a.emit("load"),a.isHowlEnd=!1,a.startTimeChangeEmit(),a.emit("play")})),a.howl.on("end",(function(){a.isHowlEnd=!0}))),a}return T(n,[{key:"startTimeChangeEmit",value:function(){var e=this;this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate",this.lastTime)),this.isPaused||setTimeout((function(){e.isPaused||e.startTimeChangeEmit()}),300)}},{key:"play",value:function(){var e,t,n;this.runningAudio.has(this.url)&&(null===(e=this.runningAudio.get(this.url))||void 0===e||e.stop(),this.runningAudio.delete(this.url)),this.isHowlEnd=!1,this.lastTime=-1,null===(t=this.howl)||void 0===t||t.play(this.staticEventId),null===(n=this.rctClient)||void 0===n||n.play(),this.runningAudio.set(this.url,this)}},{key:"fade",value:function(e,t,n){this.howl&&this.howl.fade(e,t,n)}},{key:"pause",value:function(){var e,t;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),null===(t=this.rctClient)||void 0===t||t.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"globalPause",value:function(){this.isPaused||(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"stop",value:function(){var e;null===(e=this.howl)||void 0===e||e.pause(this.staticEventId),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"destroy",value:function(){var e,t,n,r,i,o,a,s;null===(e=this.howl)||void 0===e||e.stop(this.staticEventId),null===(t=this.howl)||void 0===t||t.unload(),null===(n=this.rctClient)||void 0===n||n.pause(),null===(r=this.rctClient)||void 0===r||r.destroy(),null===(i=this.rctClient)||void 0===i||i.removeAllListeners("load"),null===(o=this.rctClient)||void 0===o||o.removeAllListeners("play"),null===(a=this.rctClient)||void 0===a||a.removeAllListeners("pause"),null===(s=this.rctClient)||void 0===s||s.removeAllListeners("resumeAllAudioInterruptByAudioSessionChanged"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}},{key:"volume",value:function(e){this.rctClient?this.rctClient.volume(e):this.howl&&this.howl.volume(e)}},{key:"currentTime",get:function(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek(this.staticEventId):-1},set:function(e){this.rctClient?this.rctClient.currentTime=e:this.howl&&this.howl.seek(e,this.staticEventId)}},{key:"duration",get:function(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration(this.staticEventId):0}},{key:"isPaused",get:function(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&!this.howl.playing(this.staticEventId)}}]),n}(Ks.a),Yg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Xg=function(e){p(n,e);var t=m(n);function n(e){var r,i,o,a,s,u,l,c;_(this,n),(r=t.call(this)).type="video",r.sprite=new Ld,r.isPlaying=!1,r.isGlobalPause=!1,r.fullscreen=!1,r.url="",r.isLoaded=!1,r.onVideoResourceLoaded=function(){r.isLoaded=!0},r.onVideoStalled=function(){r.ctx.logger.warn(r.url+", Failed to fetch data, but trying.",r.ctx.taskId)},r.updateVolume=function(e){r.rtcAudio.volume(e)},r.syncFullscreenVideoState=function(e){var t=e.targetId,n=e.state;e.slideIndex===r.ctx.slideIndex&&t===r.id&&(n?(r.requestFullscreen(),r.ctx.latestChangeFullscreenTargetId=t):r.requestCancelFullscreen())},r.id=e.id,r.start=null===(i=e.video.cut)||void 0===i?void 0:i.start,r.end=null===(o=e.video.cut)||void 0===o?void 0:o.end,r.fullscreen=null!==(a=e.video.fullscreen)&&void 0!==a&&a,r.container=e.container,r.ctx=e.ctx,r.ctx.medias[r.id]=y(r);var h=e.video.src;r.videoResource=new Xl.w(h,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0}),null===(s=r.videoElement)||void 0===s||s.addEventListener("stalled",r.onVideoStalled),null===(u=r.videoElement)||void 0===u||u.addEventListener("loadedmetadata",r.onVideoResourceLoaded),r.url=e.video.src;var d=e.video.src.replace(/4$/,"3");r.ctx.loaderDelegate&&(d=r.ctx.loaderDelegate.redirectMedia(d),r.ctx.logger.info("redirect media url from ".concat(e.video.src.replace(/4$/,"3")," to ").concat(d," by delegate."),e.ctx.taskId)),r.rtcAudio=new Wg(d,e.ctx.runningAudio,{start:null===(l=e.video.cut)||void 0===l?void 0:l.start,end:null===(c=e.video.cut)||void 0===c?void 0:c.end}),r.rtcAudio.on("timeupdate",(function(e){if(r.videoElement){var t=r.videoElement.currentTime;Math.abs(t-e)>.5&&(r.videoElement.currentTime=e)}})),r.rtcAudio.on("resumeAllAudioInterruptByAudioSessionChanged",(function(){var e;null===(e=r.videoElement)||void 0===e||e.pause(),setTimeout((function(){var e;r.rtcAudio.isPaused||null===(e=r.videoElement)||void 0===e||e.play()}),200)}));var f=e.video,p=e.width,v=e.height,m=e.target;r.controller=new Hg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,width:p,height:v,target:m,media:y(r),info:f,canvasElement:e.canvasElement}),r.controller.addPlayCallBack((function(){r.sprite.width=p,r.sprite.height=v,r.ctx.clock.setTimeout((function(){r.sprite.visible=!0}),50)}));var g=new Xl.c(null,{height:v,width:p});return g.resource=r.videoResource,r.videoResource.bind(g),r.sprite=new Ld,r.sprite.visible=!1,r.sprite.texture=new Xl.t(g),r.sprite.interactive=!0,r.container.addChild(r.sprite),r.sprite.on("mouseover",(function(e){e.stopPropagation(),r.controller.show()})),r.sprite.on("mouseout",(function(e){e.stopPropagation(),r.controller.hide()})),["durationchange","timeupdate","pause","play"].forEach((function(e){var t;null===(t=r.videoElement)||void 0===t||t.addEventListener(e,(function(){"timeupdate"===e&&r.isPlaying,r.emit(e)}))})),r.ctx.activeMedia.add(y(r)),r.ctx.volumeAdjuster.on("update",r.updateVolume),r.ctx.globalEventHub.on("syncFullscreenVideoState",r.syncFullscreenVideoState),r}return T(n,[{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return Yg(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isPlaying=!0,this.updateVolume(this.ctx.volumeAdjuster.volume),e.next=4,this.load();case 4:return e.next=6,this.ctx.clock.waitUntil((function(){var e=n.videoElement;return!!(e&&e.videoWidth>0)}),3e3);case 6:(t=this.videoElement)&&t.videoWidth<=0||(this.videoElement&&(this.videoElement.volume=0,this.videoElement.muted=!0),this.rtcAudio.on("play",(function(){var e;null===(e=n.videoElement)||void 0===e||e.play(),n.fullscreen&&n.controller.fullscreenPlay()})),this.rtcAudio.play());case 8:case"end":return e.stop()}}),e,this)})))}},{key:"load",value:function(){return this.videoResource.load()}},{key:"pause",value:function(){var e=this;this.isPlaying=!1,this.ctx.logger.warn(this.url+", pause video manual.",this.ctx.taskId),this.ctx.logger.warn(this.url+", pause rtc audio manual.",this.ctx.taskId),this.rtcAudio.on("pause",(function(){var t;null===(t=e.videoElement)||void 0===t||t.pause()})),this.rtcAudio.pause()}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.rtcAudio.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(bb.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){return Yg(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dv((function(){return n.isLoaded}),5e3);case 2:t=new Xl.t(this.sprite.texture.baseTexture),this.ctx.globalEventHub.emit("requestFullscreen",{texture:t,index:this.ctx.slideIndex,targetId:this.id});case 4:case"end":return e.stop()}}),e,this)})))}},{key:"requestCancelFullscreen",value:function(){this.ctx.globalEventHub.emit("requestCancelFullscreen",{targetId:this.id,index:this.ctx.slideIndex})}},{key:"destroy",value:function(){var e,t,n;this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.ctx.globalEventHub.removeListener("syncFullscreenVideoState",this.syncFullscreenVideoState),null===(e=this.videoElement)||void 0===e||e.removeEventListener("stalled",this.onVideoStalled),null===(t=this.videoElement)||void 0===t||t.removeEventListener("loadedmetadata",this.onVideoResourceLoaded),this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),null===(n=this.videoResource)||void 0===n||n.destroy(),this.rtcAudio.destroy(),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}},{key:"fadeIn",value:function(e,t){this.rtcAudio.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.rtcAudio.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"videoElement",get:function(){return this.videoResource.source}},{key:"currentTime",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.currentTime)&&void 0!==t?t:0},set:function(e){this.rtcAudio.currentTime=e,this.videoElement&&(this.videoElement.currentTime=e)}},{key:"paused",get:function(){var e,t;return null===(t=null===(e=this.videoElement)||void 0===e?void 0:e.paused)||void 0===t||t}},{key:"duration",get:function(){var e,t;return null!==(t=null===(e=this.videoElement)||void 0===e?void 0:e.duration)&&void 0!==t?t:0}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}}]),n}(Ks.a),Qg=function(e){p(n,e);var t=m(n);function n(e){var r,i,o;_(this,n),(r=t.call(this)).type="audio",r.isPlaying=!1,r.isGlobalPause=!1,r.updateVolume=function(e){r.audioPlayer.volume(e)},r.id=e.id;var a=e.audio.src;r.audioPlayer=new Wg(a,e.ctx.runningAudio,{start:null===(i=e.audio.cut)||void 0===i?void 0:i.start,end:null===(o=e.audio.cut)||void 0===o?void 0:o.end}),e.audio.cut&&(r.start=e.audio.cut.start,r.end=e.audio.cut.end),r.ctx=e.ctx,r.ctx.medias[r.id]=y(r);var s=e.width,u=e.height,l=e.target;return r.controller=new Hg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,height:u,width:s,target:l,media:y(r),info:e.audio,canvasElement:e.canvasElement}),r.audioPlayer.on("load",(function(){return r.emit("durationchange")})),r.audioPlayer.on("timeupdate",(function(){return r.emit("timeupdate")})),r.audioPlayer.on("pause",(function(){return r.emit("pause")})),r.audioPlayer.on("play",(function(){return r.emit("play")})),r.ctx.activeMedia.add(y(r)),r.ctx.volumeAdjuster.on("update",r.updateVolume),r}return T(n,[{key:"load",value:function(){return Promise.resolve()}},{key:"showController",value:function(){this.controller.show()}},{key:"hideController",value:function(){this.controller.hide()}},{key:"play",value:function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.updateVolume(this.ctx.volumeAdjuster.volume),this.isPlaying=!0,this.audioPlayer.play());case 1:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}},{key:"globalPause",value:function(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}},{key:"globalResume",value:function(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}},{key:"togglePause",value:function(){this.isPlaying?this.pause():this.play()}},{key:"seek",value:function(e){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(e)}},{key:"stop",value:function(){this.audioPlayer.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(bb.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){}},{key:"requestCancelFullscreen",value:function(){}},{key:"destroy",value:function(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this),this.audioPlayer.destroy()}},{key:"fadeIn",value:function(e,t){this.audioPlayer.fade(e,this.ctx.volumeAdjuster.volume,t)}},{key:"fadeOut",value:function(e,t){this.audioPlayer.fade(this.ctx.volumeAdjuster.volume,e,t)}},{key:"currentTime",get:function(){return this.audioPlayer.currentTime},set:function(e){this.audioPlayer.currentTime=e}},{key:"clippedDuration",get:function(){return this.controller.clippedDuration}},{key:"paused",get:function(){return this.audioPlayer.isPaused}},{key:"isPaused",get:function(){return this.audioPlayer.isPaused}},{key:"duration",get:function(){return this.audioPlayer.duration}}]),n}(Ks.a),Zg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},qg=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,Object.assign(Object.assign({},e),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),r,i)).isInteractiveOutside=!1,o.cmd=new Pv(y(o)),o.media=null==e?void 0:e.media,o.container.name=e.id+"_container_[Picture]",o.renderContainer.name=e.id+"_render_container_[Picture]",o.picFill=new Bm(o.ctx,e.picFill,e.width,e.height,{useFilter:!0,useSlideBackgroundFill:!1}),o}return T(n,[{key:"applyCommand",value:function(e,t){var n,r,i,o;if("call"===t)if(/playFrom\(([0-9.]+)\)/.test(e)){var a=e.match(/playFrom\(([0-9.]+)\)/),s=Number(a[1]||"0");null===(n=this.mediaPlayer)||void 0===n||n.controller.playMediaFromCtrl(!0),Math.abs(s)>.1&&(null===(r=this.mediaPlayer)||void 0===r||r.controller.jumpToTime(s))}else"custom-pause"===e?null===(i=this.mediaPlayer)||void 0===i||i.controller.pauseMediaFromCtrl(!0):"togglePause"===e?this.mediaPlayer&&(this.mediaPlayer.isPlaying?this.mediaPlayer.controller.pauseMediaFromCtrl(!0):this.mediaPlayer.controller.playMediaFromCtrl(!0)):"stop"===e&&(null===(o=this.mediaPlayer)||void 0===o||o.stop())}},{key:"renderPic",value:function(){var e,t,n,r,i,o;return Zg(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,l,c,h,d=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!(s=this.picFill.displayObject)){a.next=15;break}if(s.name=this.json.id+"_pic_fill_[Picture]",u=null===(e=this.backgroundGraphics)||void 0===e?void 0:e.getClonedDisplayObject(),(null===(t=this.backgroundGraphics)||void 0===t?void 0:t.isNeedMask(s.width,s.height))&&u&&(s.mask=u,this.effectContainer.addChild(u)),s.width=this.designWidth,s.height=this.designHeight,s instanceof jp&&this.ctx.slideScopeEventHub.once("slide-render",(function(e){var t;d.ctx.slideIndex===e&&(null===(t=d.effectObject)||void 0===t||t.setFrameCount(s.totalFrames),s.play(),s.onFrameChange=function(e){if(d.effectObject)if(d.effectObject.hasFrame(e))d.effectObject.updateFrame(e);else{var t=d.getEffectTexture();t&&(d.effectObject.createFrame(e,t.texture),d.effectObject.setFrameOffset(t.offsetX,t.offsetY))}})})),this.effectContainer.addChild(s),!this.media){a.next=13;break}if(l=this.media.src,"audio"===this.media.type&&/mp4$/.test(l)&&(l=l.replace(/mp4$/,"mp3")),!this.ctx.urlInterrupter){a.next=12;break}return c=Date.now(),a.next=10,this.ctx.urlInterrupter(l);case 10:l=a.sent,this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-c),this.ctx.taskId);case 12:this.ctx.loaderDelegate&&(l=this.ctx.loaderDelegate.redirectMedia(l),this.ctx.logger.info("redirect media url to ".concat(l," by delegate."),this.ctx.taskId)),this.media.src=l;case 13:"video"===(null===(n=this.media)||void 0===n?void 0:n.type)&&this.media.src?(this.mediaPlayer=new Xg({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:s,container:this.effectContainer,canvasElement:this.ctx.view}),(null===(r=this.mediaPlayer)||void 0===r?void 0:r.sprite)&&u&&(h=null===(i=this.backgroundGraphics)||void 0===i?void 0:i.getClonedDisplayObject())&&(this.mediaPlayer.sprite.mask=h,this.container.addChild(h))):"audio"===(null===(o=this.media)||void 0===o?void 0:o.type)&&this.media.src&&(this.mediaPlayer=new Qg({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:s,canvasElement:this.ctx.view,fade:this.media.fade})),this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,Pg.isDesktop()?(this.container.on("mouseover",(function(){d.mediaPlayer.showController()})),this.container.on("mouseout",(function(){d.mediaPlayer.hideController()}),!1)):this.container.on("pointerdown",(function(){d.mediaPlayer.showController()})));case 15:case"end":return a.stop()}}),a,this)})))}},{key:"preRender",value:function(e){f(x(n.prototype),"preRender",this).call(this,e)}},{key:"subClassRender",value:function(){return Zg(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.renderPic();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"clearOnSlideChange",value:function(){f(x(n.prototype),"clearOnSlideChange",this).call(this),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}},{key:"initOnReuse",value:function(){f(x(n.prototype),"initOnReuse",this).call(this),this.mediaPlayer&&(this.container.interactive=!0)}},{key:"destroy",value:function(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}]),n}(Ag),Jg=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Kg=function(e){p(n,e);var t=m(n);function n(e,r,i,o){var a;return _(this,n),(a=t.call(this,e,r,i)).children=[],a.cacheSprite=new Ld,a.cacheContainer=new Rl.b,a.json=e,a.json.fillStyle&&"groupFill"===a.json.fillStyle.fillType&&i.groupFillStyle&&(a.json.fillStyle=i.groupFillStyle),a.container.name=e.id+"_container_[Container]",a.cacheContainer.name=e.id+"_cache_container_[Container]",a.ctx.timingTargets.addTarget(e.id,y(a)),a.updateTransform(a.json),a.fillObject=new Bm(a.ctx,e.fillStyle,e.width,e.height,{useFilter:!1,useSlideBackgroundFill:!1}),a.createChildren(o),a}return T(n,[{key:"createChildren",value:function(e){for(var t,r,i,o,a=this,s={x:null!==(r=null===(t=this.json.position)||void 0===t?void 0:t.x)&&void 0!==r?r:0,y:null!==(o=null===(i=this.json.position)||void 0===i?void 0:i.y)&&void 0!==o?o:0},u=function(t,r){e.addSubMTask((function(){return Jg(a,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,u,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=this.json.children[t],o=null,this.ctx.featureList&&this.ctx.featureList.smartArt&&("Shape"===(null==i?void 0:i.type)||"Picture"===(null==i?void 0:i.type))&&this.ctx.smartArtShapeList&&(a=i.id,(u=this.ctx.smartArtShapeList.find((function(e){return e.id===a})))&&(i=u)),l={parentGlobalPos:s,groupFillStyle:this.json.fillStyle,groupSize:{w:this.json.width,h:this.json.height}},"Shape"===(null==i?void 0:i.type)?o=new Ag(i,this.ctx,l):"Picture"===(null==i?void 0:i.type)?o=new qg(i,this.ctx,l):"Container"===(null==i?void 0:i.type)&&(o=new n(i,this.ctx,l,e)),o&&this.children.push(o);case 4:case"end":return r.stop()}}),r,this)})))}),"@ContainerImpl[child.init]")},l=0,c=this.json.children.length;l1&&void 0!==arguments[1]?arguments[1]:{};if(e)if(e.delay&&e.delay>0){var n=a.ctx.clock.setTimeout((function(){e.event&&(a.cond[e.event]=!0,a.detectTrigger(t))}),e.delay);a.timeoutIds.push(n)}else a.cond[e.event]=!0,a.detectTrigger(t);else a.detectTrigger(t)},a.id=e,a.ctx=o,a.eventHubs=i,r.forEach((function(e){a.addCond(e)})),a}return T(n,[{key:"setTriggerParams",value:function(e){this.triggerParams=e}},{key:"addCond",value:function(e){var t=this,n=function(){for(var n=arguments.length,r=new Array(n),i=0;i0&&(this.cond[e.event]=!1,this.eventHubs.runtime.addListener(e.event,n)):this.cond[e.event]=!1)}},{key:"isTrigger",value:function(){var e=this;return Object.keys(this.cond).every((function(t){return!!e.cond[t]}))}},{key:"isTriggerWithoutParent",value:function(){var e=this;return Object.keys(this.cond).filter((function(e){return"self"!==e})).every((function(t){return!!e.cond[t]}))}},{key:"detectTrigger",value:function(e){var t=this;if(Object.keys(this.cond).every((function(e){return!!t.cond[e]}))){Object.keys(this.cond).forEach((function(e){t.cond[e]=!1}));var n=this.triggerParams;this.triggerParams=void 0,this.emit("active",n,e)}}},{key:"reset",value:function(){var e=this;Object.keys(this.cond).forEach((function(t){e.cond[t]=!1})),this.timeoutIds.forEach((function(t){return e.ctx.clock.clearTimeout(t)}))}}]),n}(Ks.a),ey=function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n),(r=t.call(this)).isTimeNodeEndSync=!1,r.interactiveListeners=[],r.runtimeNodeEventHub=new Ks.a,r._currentSeqIndex=0,r._currentSeqState="idle",r.isForward=!0,r.autoPlay=!1,r.handlePrev=function(){var e,t,n,i,o,a,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r.hasPrev()||!r.isMainSeq?"idle"===r.currentSeqState?(r.decrSeqIndex(),null===(e=r.commonTimeNode.children[r.currentSeqIndex])||void 0===e||e.commonTimeNode.seekToStart(),null===(t=r.commonTimeNode.children[r.currentSeqIndex])||void 0===t||t.commonTimeNode.clearSubList(),r.currentSeqState="idle"):"running"===r.currentSeqState?(null===(n=r.commonTimeNode.children[r.currentSeqIndex])||void 0===n||n.commonTimeNode.seekToStart(),null===(i=r.commonTimeNode.children[r.currentSeqIndex])||void 0===i||i.commonTimeNode.clearSubList(),r.currentSeqState="idle"):"end"===r.currentSeqState&&(r.currentSeqIndex>=r.commonTimeNode.children.length&&(r.currentSeqIndex=r.commonTimeNode.children.length-1),null===(o=r.commonTimeNode.children[r.currentSeqIndex])||void 0===o||o.commonTimeNode.seekToStart(),null===(a=r.commonTimeNode.children[r.currentSeqIndex])||void 0===a||a.commonTimeNode.clearSubList(),r.currentSeqState="idle"):r.globalEventHub.emit("c:prev slide",s)},r.handleNext=function(e,t){var n,i,o,a;if(r.isTimeNodeEndSync&&(r.isTimeNodeEndSync=!1,r.currentSeqState="idle",r.currentSeqIndex=0),!r.hasNext()&&r.isMainSeq&&t)r.globalEventHub.emit("c:next slide",e);else{if(r.isInteractiveSeq){r.globalEventHub.emit("shape slide onNext"+(r.json.ctn.id||""));var s={result:null};r.findChildInfiniteRepeat(r.commonTimeNode,s),1===r.commonTimeNode.children.length&&s.result&&(s.result.json.subTnLst||[]).length>0&&0===r.currentSeqIndex&&"running"===r.currentSeqState&&r.commonTimeNode.allChildrenEndHandle()}"idle"===r.currentSeqState?null===(n=r.commonTimeNode.children[r.currentSeqIndex])||void 0===n||n.commonTimeNode.startTimeNodeForce():"running"===r.currentSeqState?(null===(i=r.commonTimeNode.children[r.currentSeqIndex])||void 0===i||i.commonTimeNode.seekToEnd(!1,!0),r.currentSeqState="end",r.incrSeqIndex(),null===(o=r.commonTimeNode.children[r.currentSeqIndex])||void 0===o||o.commonTimeNode.startTimeNodeForce()):"end"===r.currentSeqState&&(r.incrSeqIndex(),null===(a=r.commonTimeNode.children[r.currentSeqIndex])||void 0===a||a.commonTimeNode.startTimeNodeForce())}};var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,h=e.eventHub,d=e.iterateIndex,f=e.iterateId,p=e.isInInteractiveSeq;return r.isMainSeq="mainSeq"===i.ctn.nodeType,r.isInteractiveSeq="interactiveSeq"===i.ctn.nodeType,r.id=i.ctn.id,r.isIterate=a,r.json=i,r.ctx=l,r.globalEventHub=h,r.commonTimeNode=new tb({json:i.ctn,isSub:s,eventHubs:{global:h,runtime:r.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:d,iterateId:f,isInInteractiveSeq:p||r.isInteractiveSeq,fromSeqId:r.isInteractiveSeq?r.json.ctn.id:""}),r.bindShapeEvent(),r.nextConds=new $g("mainSeq",i.nextCondLst,{global:h,runtime:r.runtimeNodeEventHub},r.ctx),r.prevConds=new $g("mainSeq",i.preCondLst,{global:h,runtime:r.runtimeNodeEventHub},r.ctx),r.commonTimeNode.on("timeNodeRestart",(function(){r.currentSeqIndex=0,r.currentSeqState="idle"})),r.commonTimeNode.on("childTimeNodeStart",(function(e){var t=r.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(r.currentSeqIndex=t),r.currentSeqState="running",r.isMainSeq&&r.ctx.eventHub.emit(bb.mainSeqStepStart,t)})),r.commonTimeNode.on("childTimeNodeEnd",(function(e){var t=r.commonTimeNode.children.findIndex((function(t){return t.commonTimeNode.uuid===e.id}));t>=0&&(r.currentSeqIndex=t),r.currentSeqState="end",r.autoPlay&&r.ctx.clock.setTimeout((function(){r.handleNext(!1,!0)})),r.isMainSeq&&r.ctx.eventHub.emit(bb.mainSeqStepEnd,t)})),r.commonTimeNode.on("timeNodeEndSync",(function(){r.isTimeNodeEndSync=!0,r.commonTimeNode.resetForRepeat()})),r.commonTimeNode.on("timeNodeDestroy",(function(){r.interactiveListeners.forEach((function(e){var t=c(e,2),n=t[0],r=t[1];n&&r&&n.interactiveContainer.removeListener("pointerdown",r)})),r.interactiveListeners=[]})),r.nextConds.on("active",(function(e,t){Array.isArray(t)?r.handleNext(t[0],t[1]):r.handleNext(t,!0)})),r.prevConds.on("active",(function(e,t){Array.isArray(t)?r.handlePrev(t[0]):r.handlePrev(t)})),r}return T(n,[{key:"startAutoPlay",value:function(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}},{key:"incrSeqIndex",value:function(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}},{key:"decrSeqIndex",value:function(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}},{key:"hasPrev",value:function(){return!(this.currentSeqIndex<=0&&"idle"===this.currentSeqState)}},{key:"hasNext",value:function(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&"end"===this.currentSeqState)}},{key:"findChildInfiniteRepeat",value:function(e,t){var n=this;e.isInfiniteRepeat()?t.result=e:e.children.map((function(e){return e.commonTimeNode})).forEach((function(e){return n.findChildInfiniteRepeat(e,t)}))}},{key:"bindShapeEvent",value:function(){var e=this;"interactiveSeq"===this.json.ctn.nodeType&&this.json.nextCondLst.forEach((function(t){if(/^shape/.test(t.event)){var n=t.event.split(" ")[1];if(n){var r=e.ctx.timingTargets.getTargetById(n);if(r){r.interactiveContainer.interactive=!0,r.interactiveContainer.cursor="pointer";var i=function(){e.ctx.eventHub.emit(bb.userInput);var t="shape ".concat(n," onClick"),r=e.ctx.mode;"interactive"!==r&&"sync"!==r||e.ctx.eventHub.emit(bb.interactiveSeqAction,{action:t,seqId:e.json.ctn.id}),"sync"!==r&&"local"!==r||e.globalEventHub.emit(t)};r.interactiveContainer.on("pointerdown",i),e.interactiveListeners.push([r,i])}}}}))}},{key:"setCurrentStep",value:function(e,t){var n=this.commonTimeNode.children.length;if(!(e>n)){this.isInteractiveSeq&&0===this.commonTimeNode.applyCount&&(this.commonTimeNode.applyCount=1);var r=e;if(this.commonTimeNode.seekToStart(),-1===r&&(r=n-1),0!==r||"start"!==t){if(r>=0&&r=1){var n=r.json.cBhvr.attrList[0];r.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");var i=r.json.cBhvr.to||r.json.to;i&&r.timingTarget&&ty(r.timingTarget,n,i)}})),r}return T(n,[{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(ry),oy=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==("undefined"==typeof Reflect?"undefined":M(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},ay=function(){function e(t,n){_(this,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:function(e){return e/Math.PI*180},exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:function(e){return e/180*Math.PI},rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=n,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}return T(e,[{key:"parseFmla",value:function(e){var t=e.replace(/#ppt_h/g,"(".concat(this.timingTarget.design_ppt_h,")"));return t=(t=(t=(t=(t=(t=(t=(t=t.replace(/#ppt_w/g,"(".concat(this.timingTarget.design_ppt_w,")"))).replace(/#ppt_x/g,"(".concat(this.timingTarget.design_ppt_x,")"))).replace(/#ppt_y/g,"(".concat(this.timingTarget.design_ppt_y,")"))).replace(/ppt_w/g,"vars.ppt_w")).replace(/ppt_h/g,"vars.ppt_h")).replace(/ppt_x/g,"vars.ppt_x")).replace(/ppt_y/g,"vars.ppt_y")).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((function(e){var n=new RegExp("([^a-z])".concat(e,"([^a-z])"),"g");t=t.replace(n,(function(t,n,r){return"".concat(n,"math.").concat(e).concat(r)}))})),new Function("vars","math","$","return "+t)}}]),e}(),sy=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this,e,r)).value=e.val.value,i&&(o.fmla=o.parseFmla(i)),o}return T(n,[{key:"resolveValue",value:function(){return this.value}},{key:"interpolationFrom",value:function(e,t,n){var r=e.resolveValue(n),i=r+(this.resolveValue()-r)*t;return e.fmla?e.fmla(n,this.math,i):i}}]),n}(ay);oy([iv()],sy.prototype,"interpolationFrom",null);var uy=function(e){p(n,e);var t=m(n);function n(e,r){var i,o;return _(this,n),(i=t.call(this,e,r)).value=null===(o=e.val)||void 0===o?void 0:o.value,i}return T(n,[{key:"interpolationFrom",value:function(e,t,n){var r=e.resolveValue(n);return t>this.time&&["hidden","visible"].indexOf(r)<0&&(r=this.resolveValue()),r}},{key:"resolveValue",value:function(){return this.value||""}}]),n}(ay);oy([iv()],uy.prototype,"interpolationFrom",null);var ly=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).fn=i.parseFmla(i.val),i}return T(n,[{key:"resolveValue",value:function(e){return this.fn(e,this.math,1)}},{key:"interpolationFrom",value:function(e,t,n){var r=e.resolveValue(n),i=r+(this.resolveValue(n)-r)*t;return e.fmla?e.fmla(n,this.math,i):i}}]),n}(ay);oy([iv()],ly.prototype,"interpolationFrom",null);var cy=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),(i=t.call(this,e,r)).value=e.val.value,i}return T(n,[{key:"interpolationFrom",value:function(e,t){return Zv(e.resolveValue(),this.value,t)}},{key:"resolveValue",value:function(){return this.value}}]),n}(ay);oy([iv()],cy.prototype,"interpolationFrom",null);var hy=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!0,r.activeWhenConflict="next",r.startVal=null,r.createVal=null,r.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},r.keyFrames=[],r.isColorAnim=!1,r.onTimeNodeStart=function(){r.timingTarget&&(r.startVal=ny(r.timingTarget,r.json.cBhvr.attrList[0]))},r.updateVars=function(){var e,t,n,i;(null===(e=r.timingTarget)||void 0===e?void 0:e.ppt_h)&&(r.vars.ppt_h=r.timingTarget.ppt_h),(null===(t=r.timingTarget)||void 0===t?void 0:t.ppt_w)&&(r.vars.ppt_w=r.timingTarget.ppt_w),(null===(n=r.timingTarget)||void 0===n?void 0:n.ppt_x)&&(r.vars.ppt_x=r.timingTarget.ppt_x),(null===(i=r.timingTarget)||void 0===i?void 0:i.ppt_y)&&(r.vars.ppt_y=r.timingTarget.ppt_y),r.isColorAnim},r.onTimeUpdate=function(e){var t=e.duration,n=e.delta/t,i=r.keyFrames.findIndex((function(e){return n<=e[0]})),o=r.json.cBhvr.attrList;if(i<0){var a=r.keyFrames[r.keyFrames.length-1];r.timingTarget&&o&&o[0]&&ty(r.timingTarget,o[0],a[1].resolveValue(r.vars))}else{var s=i-1,u=r.keyFrames[i],l=r.keyFrames[s]||u,c=u[0]-l[0]==0?1:(n-l[0])/(u[0]-l[0]),h=u[1].interpolationFrom(l[1],c,r.vars);r.timingTarget&&o&&o[0]&&ty(r.timingTarget,o[0],h)}},r.onSeekToStart=function(){null!==r.startVal&&r.timingTarget&&ty(r.timingTarget,r.json.cBhvr.attrList[0],r.startVal)},r.onSeekToEnd=function(){r.onTimeUpdate({duration:1,delta:1,isReverse:!1})},r.onDestroy=function(){null!==r.createVal&&r.timingTarget&&ty(r.timingTarget,r.json.cBhvr.attrList[0],r.createVal)},r.initKeyFrames(),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timelineStart",r.updateVars),r.commonTimeNode.on("timeNodeStart",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeDestroy",r.onDestroy),r.createVal=ny(r.timingTarget,r.json.cBhvr.attrList[0]),r}return T(n,[{key:"initKeyFrames",value:function(){var e,t=this.json.valueType;if(this.json.tavLst.length<=0)if(this.json.to){if(this.json.from||this.startVal){var n={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if("num"===t&&this.timingTarget){var r=new ly(n,this.timingTarget);this.keyFrames.push([n.time,r])}}var i={time:1,val:{type:"string",value:this.json.to},fmla:""};if("num"===t&&this.timingTarget){var o=new ly(i,this.timingTarget);this.keyFrames.push([i.time,o])}}else if(this.json.by){var a={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if("num"===t&&this.timingTarget){var s=new ly(a,this.timingTarget);this.keyFrames.push([a.time,s])}var u={time:1,val:{type:"string",value:((null===(e=a.val)||void 0===e?void 0:e.value)||"")+"+"+this.json.by},fmla:""};if("num"===t&&this.timingTarget){var l=new ly(u,this.timingTarget);this.keyFrames.push([u.time,l])}}if(this.json.tavLst.length>0){var c,h=S(this.json.tavLst);try{for(h.s();!(c=h.n()).done;){var d=c.value;if(d.val&&this.timingTarget){var f=null;"string"===d.val.type?"num"===t?f=new ly(d,this.timingTarget):"str"===t&&(f=new uy(d,this.timingTarget)):"number"===d.val.type?f=new sy(d,this.timingTarget):"color"===d.val.type?(this.isColorAnim=!0,f=new cy(d,this.timingTarget)):"boolean"===d.val.type&&console.warn("not implements"),f&&this.keyFrames.push([d.time,f])}}}catch(e){h.e(e)}finally{h.f()}}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(ry),dy=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,e,r,i)}return T(n,[{key:"percent",set:function(e){this.uniforms.percent=e}},{key:"transition",set:function(e){this.uniforms.transition=e}}]),n}(Xl.k),fy=n(121),py=n.n(fy),vy=n(122),my=n.n(vy),gy=n(123),yy=n.n(gy),by=n(124),xy=n.n(by),_y=n(9),wy=n.n(_y),Ty=n(125),My=n.n(Ty),Sy=n(126),Ey=n.n(Sy),Ay="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAr5QTFRFAAAATwAAOQAAZgAAKwAAPAAAPQAA7AAA/wAA/QAAugAA5QAAsQAAwQAAsAAAfwAAawAASQAAZAAAOAAAJwAALAAALQAAqQAAiwAAmgAA5AAA7QAAtQAAhQAALwAAfAAAXwAAYQAAigAAuQAAfgAAswAAcgAArQAAqgAAZwAAaQAAMgAAGAAAiAAAjwAA1gAA6QAA+wAA7wAA2AAAbQAA2gAA3QAAuwAA3wAA2QAAxQAA0QAAzwAA0gAAXQAAYAAADAAADwAAGQAALgAAjgAAcAAAzQAAwgAA+gAA3AAAGwAAoAAAowAAcQAAVwAA1QAAIQAAWQAA5wAAsgAAuAAASwAAbwAARwAAMAAAnAAAUQAAaAAA9wAA4gAAPwAAbAAAOwAAlwAA0wAAjQAAvAAAwwAAkwAAQQAAvgAAnwAAvQAA0AAA2wAAwAAAWwAATQAACwAABwAAQgAAtgAAgwAAvwAAgQAAlgAAEAAAxgAAtwAAmAAARgAAjAAAdwAAqwAArwAAywAAYgAACAAAmwAAHwAApQAA8QAAdAAAbgAAFgAAgAAAogAAewAAXgAA6AAA9gAA/AAAzgAA3gAAkgAAngAAdQAARAAAmQAATgAAUgAAJQAAIgAAqAAARQAAPgAAxwAACQAAAgAAMQAAiQAAhwAA4AAAUAAABQAAeQAAygAA9AAAFQAAVQAAyAAANQAA4wAAKAAAWAAAZQAApwAA4QAAyQAAXAAAkQAArAAAdgAApgAAHgAA8gAA/gAA6gAA8wAAFwAAHQAAhgAArgAAnQAANAAASAAA7gAAlQAAJgAA+AAA8AAANwAAJAAAHAAANgAAkAAAKQAAoQAAzAAABgAAFAAATAAAeAAAAQAADgAAggAA6wAAEQAAfQAAVAAA9QAAIAAADQAAEgAAVgAA5gAAQAAABAAA1wAA+QAAUHExBAAAJDlJREFUeJwlevk/lPv7/2XtOrKNsWcbzGCMJSmSpSxJZtQkjPEOg5mxRWns+xpZyr5ECGmcLIOsdVK2oyJbcVI0J8fp/Bff2+d7/+BhPO6Z1+u+ruf1XF4GAEAGZOXkFRQBTiD+dgKVTiqrqKqpq5M0ZMmaWtoAOrp6+qcMDMFIzdiEYmpmbqJBpVlYWtFJitYMG1sbFTskLvvTDmcQHM+ec3ImXp13uYCubvB/l7sHkC9eAk8jcy9Eb5/LvldQzQ+v+jsw1ZAlfwYDAK5dZ98IvIlBwXRNXVYIJ9TpLJUb9j9LvBVOj4jkRVGj/Y1i8AwiH09eEwhjMU4uXtsiAWLlqInMcLh+28okKRnuhNy945lic0+Uqu7NdErDdB/5DBo7MwuE4J+dw8jIzcsvwEIUFFGEisWQm1ACpcZlxF7vl1c8YMCJyqrqGio+fFRbVw8NjU2uec0isNWhVuq2XMPzmjcRBVHhSWCtXaPR2mZoybHzL0TUfmxPabeR6yg/+6QTY83VQNOkSwkbumsgkgzwtKe8tDdHYM7ts3sW1Q/Pn3PEWaGmYjoje+B3ewx9bM4V0LNfDB5XL3/o5v1hSBi5fzvQkQESOkQOwiiwI++5YBdkDjFIrKEx3cZK4Ti8eAlZpjcnYMSHKG0ygKKVeFSLRpOZNL9p19Ku1Q9enKlp45lZiQGr7hlWS17RKWp03mv8481cQnwBUNTAXwIUeAvsJwCCTnV4FyJC9CrKYDnOT91DpRZSG8Bsn7pAw2Ihd7Hn7R0hynXezjQcvQTyMGgUjV12kiW75XaR7Z9OK9kD0/j6ckfyk/fcPHCkvkz48NG/r3p4FeRpoQa9JA74sJAOcLubirEPqXqTpZ1hNzUN5exoNVbk5RmSOQqcJix5yWvvRZZ9nyay+tqAsb6U76oAwo3wgXvJkK6sCpOYQBTIdT6cg92rSxWh16pdV2c8NnDzfQhveqvND4k6aAB0ssWnHuL2yZQ7AHLzJTgUrreyZeWewhawpw1RMDWYHLP1OcNQgKzwlKVP5JV5crB7cZ+NRJ6AB3wx/x3RsEufEkozLu+g7+zkekfLbFQo8byEubp5ld7Ot2CQKxJ7qguZxF4SB3ozQF2pCEIbcaFxg6eAr0/MbeHb1DCK+vQCA3j4YTcwjNiWyEgcq1dRlfnXsq31K3hhhvNX/CYM0JC+asxk91d+7ahTr6AAaTAn3U2lTBfjIc1pr5VEX94yw8uIZhWQVAHQj66iLErxDLqNmN0wuO9hYf6FN+boQb1FjENYJAiWKrru2ejWzoZX6M9A91p2Sw1TTRT/rdDQsyiOT1f6br4fKm6Fpeb9qocNfvYOLPAuczuA5BTbeVT2O/ghlkYEScGHX0Df3StfyMT4iYHCTEQTLj04iWePVx6aomPYGLc08OXB+drJLqoq42/wXqB5eagtaqR+ZAPsymG8utBxt1rO8zFTPHITA50gCMQ4Gw7tQBZFo0DBsWb5ExlyKoBbvRAO7jdv6U8jMYne4Y+iWXmg53gvbNYsGg+gU3elEnaeXB/ufFUKJiyZdNZemo10NviBxr65KE1k/Rijg8KTan5647eoiJQAYPIL+9fuHPb/VSMucg/bcJHzKt557SPRYF8voq1+2SIWmSgQCZo2ZjhlymMigEZdZQ3MzX6wmmMTECwNWieLpWDlKihSZ2sVVwNX9AmecOXtMHP7C/WwPzvKbZqiJIYFZ7PuZngFJmNi9YatOLLQU77vGbS6PzGdsQVn/Ad7nQyALeZVbm01GA72t5bvR/aWTWVIIEVDwDJanzjqAc8QuFl4Yr9/2WTdPVPmHCtY7ZEZ4mJoDqURsbWcaHwtmIqJWrIXshpck5ilsHlYM34YFFXTG3dGzKrDMBxB8gsDn7G3bW/TDpe51ALDmy5KQW8lUgg4guspE7TN7wCTbFWnf7gBB16vuHtYoXsWo14j1cD9/Z+oyj5GF95jqI9KG0s6YtJ0N0jtISrVAZQcIO251QuKrBIaH7k2hLK/Mw8pyNmCnott3tGm6XjT9DsZUps7H8DCHwjc731hFRtTaF2UQ572Ca4Qp/On0RVdmFD0A219YL4DcFBN/lnfBvNr12E0W2MSZatepyNLVIbbFIg7jaYfoR/4W1VUKqL6zsF4NpNiq4orZEhCEjExd7AQ2j+B6GMOPmekeA7+DsM0IAsIqj31xrtAzvWqBsjmIWC6+uBONItM9R+HA8rGHxptX9JAF/G0L6QEiy3McdFEhp4+YNA0FHNwnW0/RFFEtwHRb/hwQsbzX/heYihsB6nNVJssfHnqQe/acYKMv8LqcRe7aEF7Y6ugtWxKLILeNmlzVF277PqxIg8dSxpo5gsaMBFxfgwvdWBhOvzOHHHzx4JUHLNpyc8LUzkLcfiIv3A2jQxpeQ1iL4IKUJ1dTmigtKLpgi6QjX2d8ISbHl1B8bH0UEbnI2DMVm5h4+6Ko+kTd3VVSVPGkpp4/p+BW7/faCjBhlD7MoDqRpcOJxz6lBe8gWYtBP80qaKf86k0FP9L1ziS+Y1m8MPaWpcD8BXkG2flILIvKvoC/hr8upkS1N2pwbQD5NtZmC6iNb2JUVJTRDoZxTXibAjQDp3w/y5Bhld8zynk7OU1S3S3LPnJLvjhzcfUaKeYeJwtkmPDDbYpWt0gTaf8e/gL32vUwV1i7lHVD65CN0n+CySLiHLZfbSx/XYollUUj09xeL/Cjqg2DUp2eM7igsEZPyXlnve63tfjYjZSbBwtUf7mlAhvX0N/CzxFIKE25lol9uEzuf4B95AK6EAVtXBSn3XGA6bVuISAxQuuFKTClSg4xz/VEivy43BYA1UY4x7aSd/i1RMdwdgzi68x0JEYIfLBbEMag6Kcur0R3WGGtXvT2744+WPE4QaWz1rrbq5fEmwQTMwOLPRNs2jAJiPTPpAjXA48lyGNDo/aEnNyEv39YQtTIKcLY2gVw/SWl2eGCgmvgRKcowIU96xWM6PvyJhk/4dRHbP4A2JaG+uq0xb1J15Gaa++VgngHKhh3L3grVzTsa95kyjw3wgZLYViuASK6smRQA8Ds39GAisCnrN+wiGik1BsIZfpFhk9aVvJNr+pUWJbSmxoOAqRzseBsHsCPJ+9EvFA6HLDuymPuB3VbLuUAeRzs5AnmhdV52drj6JdA/9JE6GEWqDZIrYYlrYCDM7hLcefRsAoFiZc4P3tYx5qFsH9ttFzAL0L/lgSwvjbS4Hlik7xGLuSVfejKzFhvtnHF3039B8VGq1UCpg4+cLt0KMDi46N3M5F9YWHiD/InKc21mDdj2pCGZNgqLihu2j14oFnH9dxycOd1FsVBZ+cMEBkuu0U7wwPJEfc9SWATH9MuG0EvfyJPxuf9enmuy3ipIOtB/Tq8fRSfpzQFs03/H+7yBgpxgsOgaPD69B90NfAH5SMhqmB4xns1ARtQlmao4VcBTRTDeuo6wPwzlIp/AQcGagk6KNOsPIQxV8P+wi/EIUDDVLWFGWvjTzIZnkLRH1UoJhWpXMTjPAjt3UAX17p6WGAJwxrWKi26AC0+gNR2jzhlwfEJrgvQCombOyaY8/bLwB9fMvueMLQvWNkBKGC0lq0Ht3KzP5jCcE4StVpESb3tdp2iHeZtLDMQ26rGa6n0GpULC4tIz4jBBxadsL3wHdFQPwahEAq1xR5rwJkcKwXQrx0f6F7awZw4fPbGa1gUiXJVpYOUgng1Il6/kdwHeGfQlS+PdZEZ/WbBBOmQjvC0LG6wpXRfApSSh5UP+GjCtGd2HwGkHtuvHkJDGvpqBlcXLXap5CKR9eJRzlgZ8W4zK891g7/yQl4SpDRz5B6E6FEUxFv8K/4i/p8Hn1DOZxLx2FQHi3X/cwgM0LCK+TZnTMszAMO3JUIXyO6zOQNiThG4OXOrwJNCE8XwV95JJ175KWLydZwJE882VhaOGyWMiSKcP771g4kaYKUFB2Dmz0JUdUk75Pplh8T7VBZwUY90zTpUDwWxIJNQ4p3+oSPgHVcJUQVskdpHklpVCunu2AMvq7HI2HuekbnizilxbZeVzVwQLUBT133fJUvswkKMu+OHgCDmIJX9+b8TDTiXIyTQUrXPXFm5NsIOF7X6snH0GkbLAqxPlJ9ecWoX5Ywy8Vl/GgAlgE21JAfp4T0F8NwItrDq/BXLuXDsET46eLTOOKK5svMyhZ3Ah1ePwHOvYdijiwWbAEJnbIP5V95SOcbXM43qIJm+5G32UABbhvaNNvRffVynh4jmDDQ3V+XtC1dHWnr5PFwd9Ds2UdVaIEHmECBo9V1OAz0w9Q7ZONc7xXtF+8+ETCmmX+G7+2+flmEDTEww2Dr5eQAbJggPltoLQ9vmismCRLQYIvSsXqDWOIS85DgRSlAhWjGdOxACJXNVdyGoSxA1lu2eETiYQrdn23iL9SxSRCa5LgEX0CruBRSxHIQWrdV/mq5qOUyNgs9QUYv+xsmlhwRichkxSqZko2RwH46USV7CUofNLnT23rewuaB+3Y+8g82zzjibgmdChhbQRFk34o/zPECaRHy7wKj5wlFDE8H30Jva81PwVlVT/UNLeH5C/T9cIDrBy3capubs5y2F7ATbAwpRvThn7BsaBvwbu0BBMDxHEtAsSE3DVOdF+kWWcXsfX3AFYeWSbrZP/TS/H80MGryotBYxj1U8rWXomZeevT+aQ0crFNLeulQLpiCr0J3rB5jTS3MR+wbSYRJirC2/5eEGCMHpzOUFWEplMsWaW0SVaCL8y8rZVI4hiy4qyEC7CW0YwNHTGLxvJ2vW6GNMctZQNF8YFxN+y/di6ENOZNtphmlCkIZsU3uvDqzlidm8vQCrkUfzYk6D4AYr6tk+mccy/i8xBKFQzibM/wWTIysZ6cDt/XhySBb1niUMBJRN+ILdWbj7Z6dnUgLZELPYXWeyXNhzV48NvUbAWzWEC0lD8PwVIGTt6rveS3h3gX3XiVRg1O5poRFvgPCL17nEx324dKJT5AC5OU7RFWXuEp0U1v+MRgY7mxikdoB4lle086YyXrr61aA8eVem+VOaY1TKn/sOxOeRhIcR4AZLNrygau7faIG/T/vTPO010Kbci6K9mAYPE3+D/Q/02VDHhOfPxxTud5MF+8KsrdY8Bw4TELjh26cdDiBfCo2ptEyDRsJrRk1KZcvgta3ckuK5CRPn7AxcptUHMpozoAU68b9ElVYL1uhaVz7RTJwRJ15W+0X8HZs7gUMi9wPAEik099Y6ilYhW7j1KNLmlFXlRwAb+NvU+PbN1AfHY1t+/sN4J1JVfn7FDYLloP1Scsg9GA3s2b6XMPgHYNbve6n3ghsmK0WGyzvNrCU7t0veADh7RGOKA7vXwYQc0uuPZMJMUQMLbBdz+2kFzkStJJNFEvH/f/cT1wnXJfsflkfnn+qJe89nGfU5c6Fpsd3vp8y31fD+eHg8uZSYXdwqcoBT9DS0aTRKoaZrdSqk0KtkFZb4+BBqXAnpKdyVLXBuP5clrK5wxSYyIWrghPCaNnLhJkp/A3x8fsMgMczROQeBhpGULvpU+ZNQqKLZQMr2c5uvEvEMHOemnBn5rN1M88Y+/TkhOxUIBP/2P2jr1+oIelfW2KEQFOnrjfGzrGWUsS6YsjIBTxTDwc64bw+fGhfW5AnvnpxLYAJDBm2lJ6rvaNZZMrsfTANYByHtYSbJahyNwhmaepqjdIPb+zS9jVAgfRHPZEjU1Gd3rhA/5cI2/I7HkyV/yE2rhd7VLRC+6h3nRnBwqHqGw2HNB46i9yPFIYrAbBjbP8Xiw3DuyzbyCf9d4TVDRcSKQussrgoejwBiAjYwZi0qcQK8KuYyotDvMBHuWgDgNhVUXyHsaOlkxmK4H0+NoRd5BhMX9v+E0DX3JzZF4fOt9EZhbDdj5dngkuAUBvofWKvSxgvWN/JXhGtuib/SxfY8KRQCXuP9M9m4RKN/YNl9WjkI76xL/vI3tkUW8UwNyBJ97wf3vZkr8zgZWjt09M51pPhhhhIa5n7iOjQUKxcVfAILZl0T4jc7FxaD1109JL9Ca0sSBbrEuNCQcFBiIv+SZSJPYe/1EYItPw54SrCk2fKxMmvjDJ19ORWT937dR9t2yrEWeJCbBTuaVFvARwhlXYkVrmPmMoeHL//5uHAvRj2Y8axOXO33AUsW/qXsBWn9CxkKIYN1C7xCb9tfTfE+3+m+utf4yM6L/i+ic02U8cQ2F98GKWj7KuD2pLDXkPCLCOzaCvJfwOemmSw+9kphfUY4yI+yj5/MmQxX+dJTNMaPNhkZY4Wbc3tEQKBn08wseAkoa6qqIQUIOD3kPmDGdgoM1ToC4KklkiDUBk4Uk/Fidp8zCJcFBMgHj+etTxbRFeHvwhf80CiSt3z3DIFYl6k1lWLVvRBn0lpMVKj6PITC0tar9jbVAPhHP8k4rhblOqCcOdqrAPy67Z1WL4TfMfVx0GLrHQJyH8iQUus8lkFKuv5kcYrNvW13YfKuZ89ORAmC15BmyKxBFilYKq8dxQRWdqGLLb8Rij6WrIs7/mxVyFptbrarK6uDO1v3yxzOWQjtaz2W/01pTvN/Omyfx8D2VGPK80olW8HfnliYW8J7UjIcIlewB+DJW6whrBEqHlPOAQ8W/xs1Hn5GmuasOM+K9M5T9RYI+PMwnvMsCTG6r+dbVXfMESA2YjneGLq0D1CQv4w2JrzNXBsshiH+QHHQa2Mr/AZ4I3FCYwSF30Bqgti3TOnZKmjAfxUANcv/0JqQQ2HHnOhMOwJodHns6/25Jg743Q1lQ+KbmEPuPq51Bt83snYTH17IxKtNv2roT2epeJDTPX4a0X9SZHNHJqSie0RtRDgKb5JGNRAJr4h2aypQVI68DWseD13hXjPfFQtgcpsWw3+bHWbYNMQ5bN4cjo9d8aBirB8/oJdnePZQoxNeCAZZbotwjOCA0wROeUdcuZjnmA4UdjXjcB5b5xb9AZYmwdFSH2DdhvscW5z5QnIMnYTFRngKajbkSdjvvVyWw6LwIJWxlYhshBPGlg4xDUFZOFLf2UlA4MUe8DA8TIea+IX2smNzuP0vmleE8ArQR+UsNqTqekrljgz0+vhX5+FaB5qs3t9J5cPuwScX+MPS/UkluQXNh5WrJFM9p4CGban0P71P43YKxglb2X+cyKQ94h/diX4v9RaCpnBsnLBEiBNo/0idpiYrznuGrJbXrCBGfcS8UOZNOTvW4hnUTwJkuVcBHodNx3R8t5LtTDmf9/EmsNByWOE4XyHplSzut+ilAlOYAW6FAoMlRP17j9CYvp40MImU7d5GfS2Drx+GW3yciuygcSeJPwW0wzd8Jx7iITtZPchNXC6aPAtKQrB2xa8z53r/+NXr2nhyLPFySAhSY0IYOQBgKT6h3kSWUhtwoeuSh11H23xn6OOue1lRwSZFtnWn9cdSaaEGqWp9dYsa7+ChyZcubQzxJjXzXLk9h89vBXfZGDIlvpsP4QIbmPMjqxhqsBfefv19nkI6ATGqFQsHNSKV1bi5RDhNzYOR3Ckunra8gfjADKT/ll0bAtT+Gyj2d7NLfv1oX/s3Dxbwcs6upK916xmn4Cn9qoUPECeybc02KdxfxGRB0zT8l0Zikliu1neuQQ0TmnzytBG1jCdcA7AUAfwLbEnAjIqNRI/tr3AS3HHzaJJ1AVHLTuHM72nkWqYVDDf+j66wmI+h8Lmvxl4OGEXnX3JOrwBz08R7ELtwHigs810rOj0viiWN/+sC7Ni5oBKQ6bZk8eHN3PYLZzQgVjEb5jNex3lMrEC0EzpQ3faNx4xd523exujDDnuf5ZP5S7v7/UuKqkqW2X94NfxXy7549ho3WWi6n1Vt7ABUIeJc5cdqWkRZrf4aNACabeODzxEINKtnW6CGh5734US98i9pjARiQfrdT+ax6iuaQ68hRSbykUQcJUr4DoFBkm4wgd2hq4tBIt5iGqkmIYjIK97X2Ac+y7Al6Eas2r5VF3EkYVixIGsqzlkm0RXA05xqwaznFZjzk8V80Y+iIDhMyNdfSpEMp3IheR2cbKGSnSfWK1HK5rU73te+Y+mp46Jt6oD3xe3/MKUzoD2UBzNmu3iQW2uCJHd2ne9t/x3h7lnn4kBxCEAK//UgVlyjyz9W5JHgDWu3g3OlGHBZO/680MjgZCrLsuOfLU+5jPl2Pxck02uqzyqmPlhPA0isbdnhRis6Qh/S179zV226tq30IMf1KqJ+bHgSCHhjM64dbIL8GGt21vGOEXP+/AJcER6NjIb286TKSzTCCidNp6Zf3rpsWZnG5dNhuEqU94Fd2sYHaDOgM3A3LO9nxQazFRTOJsT7cD4eScDOsG8UfQGqlmCqM7L0/3ZpnWylRSPqBu/B+eHEfYNZO+0QTaWrYVbLURYIK4TWR8iESRGfHHQWgthnGCFSR6XhpDR2Xtq0uhr2QQvOUVv8Giw6ImYIgOdd8OPo1dxm1hQCQV84zTzso6krY75wTfRjcwV5Geb/tJ4owfFd8kC7FDPX9B9mBYVZ0zuK21vYoVpvazdgKlwKfwFKZSgPgFfDQtTRYNOvy6JNZ7OeYCWEFJq/hygT5KPD9mIbenEBsAvHdzCG/K5iPb4S4aP/YhnMDJHIP/icNM6ztIK9gkRRdA71nyoMef+2jb3neklwx0pHH2SIdKb2jwOWG3JCmYK4Iva+7eEG0a3If9Da4KaFAGMYlTTCfFBFSoyK7YMSwyuICgV8M49c7bf4VqtKi5LOaLKCJlVZ5zBpLrIr9LvsMNctO/oiM3ab/MknNJPPbnirNLPbGflQrRr2aJJYXg/QIsh8k1PXzz+z9w5gIxiXea4P0RlO2OUDqhJdvv8EBpRLy6Z9p8GR+FFKgDHcGsMkkbMnJz0q7hAhDVdF3sCfBM6hj2P4SlE5njIsBmSky6FhkNYd2UfgLt37a35+BEvupCA+Jh5kmC5dWaGeQNmz35EEQvhwZG3qxKo/RZr66hM7IJ5Won7gh78anK172Zt3buKAMKyMDjzdR9ufcCZ0zU4DOA5RKIgkAMTbytB3LQFlT5MH/An6qfRJPjj2dg5WFP3mdlZkwFePrA+3eN2Wu0A+WAFKZrztzJRibcqCweEddxU/PSGWxOnjHtOUDzfDk9lEvDDj39cFH1E9dVeQLGVI3Qgeo0M34dZ6K/3cb9BBZcZf8uS+BivagqBuLW31L60FMADuX1jiTur3n1ZrBrIgpkFO//0OmyT9qWthHcnwzLRswTdDbgUflRNCAvfaODDSX8vQLo7QBDltK42Y/OdFbS1zUYFLv6qSiV43zDiUrcAtbEqoMVBPa37+RMTuT1gmrJVH1qqYsi12cyakNWPLrTGqg9NO1KY2vPwISkCnxobu6FodJWlXUwABhb1LwveepTps6Tt0E8j+tabfLiI+MdLLWSxLqA1cJON1hz8aZkisUWXUMhNOQpLrIR062CCV3Bg0ZwlU9OhbKefT1NjDog/g2q+TAW89zQllayE0d/y9qAdSAucb3iKOXZYzSSmdealQNS1IL3qMUpowYU6uuO7LEqyPD05MgXvXy6frzzrkpBXlAx+J30gur7J4OT/ziwA3fvIcKvLAHet4sqms0BCkZk6CKbyRPu8Xqwsv5KGfYcI4thniGI9nFwFwt1bfZm9racBom20+/R8n0upa1EAueM5b9A7lN3BE9empZqOTj5NkKNeCf630MV2jeKeEP8cImJ5W9l3gYGDg1wPxxZcmBvsZ4qZXUMim6a/M2jKAsHtYvPN1A0FsH3AAbpFvCxA200RpdN9ME2nSQL2g5pg9OIw6KkYT3gKe7QmWrItoXK1c/XBbJQ6pVOca2BzfQfoOCTygsFljpEPDG+tBLrte+jUDP2DcYKLisBjhgtTZnAmgmg8/Aus/awVIZGqScBZ1xa/82qG7rzT0BDLldEs0sP5HS8oNhU3lhDue5NS0TUt0T7YTZvSGH0HEYEs97dJ7xpNO1TKokYmLWenco4PvNEsv2hQ85pcgDjlA29jwVT9IoAcXQGCnhPG8fgYyhJ64NNzBiWf5p1XdoBx+xtXoPiVbK44FcHipEqTaar9/ruKsdneZuJmevOHPOjhmtvwVVX8Nmx+/eftj7gZmxlF3ocI/n5T0byPxzPfMi24AxSQeAGjdI3Q4hc5ffAT7v7F89ZNEgj6fheuHl2hjRQlG4EMMwpiAnsm1HT499a+zKPMejH0uAfnT4JyItDTiDQ4l5DoO/sQZ0HkzGpiM8KQNwaHk0Un9WaO+yuA1ZTV9z8Jm13bqwTlfNHncIi8M/kHQMFhMF7Imo2mUw/Sox7Bh3W6UplqvEiy+g2NvVzFPCtGkHSTLuFSL2CtGzpPY+E5O0PK3HSbUnBzNBZodkNnUAlch2Zk9/9F8JuAYBirgoVpE7QyheJ33WDOysDFYMSXBdm20XfXCWcGzsGyvXE8FJN7EadsGjIDzZ+GtIUEBWuQ6o87kaDvo4eplYs4dz6P06lSSCA0yAvpXKD1djjC8dnWdYtWsLpl4Fplhje74Y6i/M7VMSQnRvD54/CC4LPzx4vghhIOzVo6bLzl7QIHPvVyM/drqBBZ3tW1lYqvXfauRfH5WHe+RcHI+xxeqDECqJ9tdXLyy9L7RqxyUaZKwmlAux+zEzdzITSRlr36YuSm0LBhTpkivodWytR6BNULFxftqF42QqKLmoog9WlYNRb4GtNm93bHuxBvV5VcOUeY6N/9xDutwbqYhaN3rIzpg1M6XfrYctTdA5Msr2v4Aydmb+Nl2/Eqw+jSXYvctmuDHYUAei0pUc6E5N1bULPEjHAr+HI3gwDjpDg0nE2fMkXneCumq9ifZR5IKUOqn0aDIfN64olrhaHfV4msozkdG/3j5HHqsf5Els8kwvDrCaK4/BXb+YzYC00mJEOu8njPsKgB9dG+FjqqeToCsJKLTvHS+iQTnqFquCJ+yCckuDaHLnP4GzroGg7BelrYZWStEFay3j+vkEuXHy3B2zG5xBqSx+/pxoEOv+OfiCfq5QMCCNq26xXC+1DZ+eQdH2jJ9FXSh9yrISZTk56jTzMIzG9+Ye+pumQffxmh2lcvPXjmNWL3PoOgRpkx4o/TZzE2y3IMtEZNxpNUlBqFlnBVXuPS0TIBkF+ZfvW3y2bGWD14zb8Cju5+wiSW1pIIRRtD0DeaxOLIvup5BZ2R2QfQVx6ryHH4H/rls/fRJy6KIdsJ/qVsWrBZaKgKOhP0GOUjA16wS+vlpcmot72SIWJWQDwyiD04TLSU6LyObtnOC2W5QA0OCGXHtlTi9Cyh95AIL8UU6AaQOaDSDfuf3DbxO4065WUdqPZ6Zj9S26jGlhDs/3mX1c4h+to5J2UwvgO3dkFtmKMBF3OuQvskMsOO8R5FnXblT4zMUpkjhs3m1ygag6zQWKfFOQCFM8jmAFtaCpCqDX77xqhE3B99uGU3UT+41SufAp9fQENvgk5lwqneywazIE9IpGT8v23sBPibAHG34mLWiivxnjk8p2S5ofshihnLQd4CU5ABpVcMX/5Hg39Jm55k+hgxugBCGIR5KmY+qz6US5/wKYimBbjTOSBlyD9OiYpWxtoLH6PcoaUdK0dW4vKR121dfMwumvgSBf8g0fsVN0w8jbplh7Df1FVC9wZuTbZStSswGJu6IngHRvBgOFag8F3hwPVNuUYjxNngNURuMvnnOvway+3l+1sK7aILbzdSzAxUCtG9/CaaHsBFIVzMWEH7upNL6Hr6P+oI4i+VqT6NyQrYUMkRXYd2P1ZjEMDaJ1rrurxTBgTfMw9cZe8SHIAz0JA7jpgDmr+InVbg0HrkFNZVhQ2uBKn75tLEZwfMp2azBhkglsAXDPx2BccwTDGmnsjRDh2jHh9ynTQY4vLqcuv/NWRlP8sFHWyxSmm38ikF1UoTywoZL0oFE4I4ujqIcvCuo+0ABPohIMdyq8EqgTcogXcYNCGdgvytDCA/fwt2eG78+OAANOgmKkOI8WdjE3FaFdqW6rx/oOBunJoqMLOwnPtv67Cw7PY8c4jFvek2G/hk1Thivu5Pf2iV8YDA8DyziBPz6MKlF9XQlRt7ZRV09nZrygwo00ME7IpFuOiEsUrd14UcCvNC/DPkbFmqB1uQIg477mFiq2niVADUYnvdjiQPNpFfMTo4yg4X+tDW3rmH2WE9E2rY0ES40wM6QRwaQL5/fepJULkj3Zc6L1ItuWmO6zXbvou399GBCPcQwB2+rRpubsw03qWL2iRyHH9Afl/YHuFYa8v7zEXDEigXJo9RAtTM4BTzElQhSgePv55AmHTo4W9v4SmkPDlLIhOpcXBK4GO2AnyzeN0MaKP7umX9bZAfc5LA84bxj3frYCxezbP9KG7QeJzevIhiAU4p/j+y2OyMV2mxNgAAAABJRU5ErkJggg==",Iy=n(127),Cy=n.n(Iy),Ny=n(128),ky=n.n(Ny),Dy=n(129),Py=n.n(Dy),Oy=n(130),Ry=n.n(Oy),Ly=n(131),jy=n.n(Ly),By=n(132),Uy=n.n(By),zy=n(133),Fy=n.n(zy),Gy=n(134),Hy=n.n(Gy),Vy=n(135),Wy=n.n(Vy),Yy={wipe:function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n);var i=1;return"up"===e?i=1:"down"===e?i=2:"left"===e?i=3:"right"===e&&(i=4),(r=t.call(this,my.a,py.a,{percent:0,direction:1,transition:0})).uniforms.direction=i,r}return n}(dy),fade:function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n);var i=1;return"out"===e?i=-1:"in"===e&&(i=1),(r=t.call(this,void 0,yy.a,{percent:0,transition:1})).uniforms.transition=Math.pow(i,i),r}return n}(dy),blinds:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,xy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,r}return n}(dy),checkerboard:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,My.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="down"===e?1:0,r}return n}(dy),dissolve:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Ey.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).setTextTure(),r}return T(n,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=Xl.t.from(Ay)}}]),n}(dy),randombar:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Cy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,r.setTextTure(),r}return T(n,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=Xl.t.from(Ay)}}]),n}(dy),circle:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,ky.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(dy),box:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Py.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(dy),diamond:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Ry.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(dy),plus:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,jy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(dy),barn:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Uy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="inHorizontal"===e?1:"outHorizontal"===e?2:"outVertical"===e?3:0,r}return n}(dy),strips:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Fy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="upLeft"===e?1:"downRight"===e?2:"upRight"===e?3:0,r}return n}(dy),wedge:function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,wy.a,Hy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}return n}(dy),wheel:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,wy.a,Wy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option=Number(e)||1,r}return n}(dy)},Xy=function(e){p(n,e);var t=m(n);function n(e){var r,i;_(this,n),(r=t.call(this,e)).filterType="",r.isConflict=!1,r.activeWhenConflict="prev",r.onTimeUpdate=function(e){var t,n=e.duration,i=e.delta/n;if(r.filter){r.filter.percent=r.commonTimeNode.applyTimeFilter(i);var o=null===(t=r.timingTarget)||void 0===t?void 0:t.container.getBounds();o&&(r.filter.uniforms.uBoundRect=new Float32Array([o.x,o.y,o.width,o.height]))}i>=1&&r.timingTarget&&r.ctx.clock.setTimeout((function(){r.removeFilter()}),34)},r.onSeekToStart=function(){r.timingTarget&&r.removeFilter()},r.onSeekToEnd=function(){r.timingTarget&&r.removeFilter()},r.onDestroy=function(){r.removeFilter()},r.commonTimeNode.on("timelineStart",(function(){r.filter&&r.timingTarget&&(r.timingTarget.container.filters&&0!==r.timingTarget.container.filters.length?r.timingTarget.container.filters.push(r.filter):r.timingTarget.container.filters=[r.filter])})),r.commonTimeNode.on("timeNodeDestroy",r.onDestroy),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate);var o=1;"out"===e.json.transition&&(o=-1);var a=null===(i=e.json.filter)||void 0===i?void 0:i.match(/^([a-zA-Z]+)(\((.+)\))?/);if(a){var s=a[1],u=a[3];Yy[s]&&(r.filter=new Yy[s](u),r.filterType="".concat(s,"-").concat(u),r.filter&&(r.filter.transition=o))}return r}return T(n,[{key:"removeFilter",value:function(){var e,t=this;if((null===(e=this.timingTarget)||void 0===e?void 0:e.container.filters)&&this.filter){var n=this.timingTarget.container.filters.findIndex((function(e){return e===t.filter}));n>=0&&this.timingTarget.container.filters.splice(n,1)}}},{key:"modifyAttrKey",get:function(){return this.filterType}}]),n}(ry),Qy=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!0,r.activeWhenConflict="next",r.startPos=null,r.onTimeNodeStart=function(){var e,t;r.startPos={x:(null===(e=r.timingTarget)||void 0===e?void 0:e.ppt_x)||0,y:(null===(t=r.timingTarget)||void 0===t?void 0:t.ppt_y)||0}},r.onTimeUpdate=function(e){var t,n=e.duration,i=e.delta/n,o=null===(t=r.path)||void 0===t?void 0:t.getPoint(i);r.timingTarget&&o&&(r.timingTarget.ppt_x=o.x+r.timingTarget.design_ppt_x,r.timingTarget.ppt_y=o.y+ +r.timingTarget.design_ppt_y)},r.onSeekToStart=function(){r.timingTarget&&r.startPos&&(r.timingTarget.ppt_x=r.startPos.x,r.timingTarget.ppt_y=r.startPos.y)},r.onSeekToEnd=function(){var e,t,n,i=null!==(t=null===(e=r.commonTimeNode.json)||void 0===e?void 0:e.spd)&&void 0!==t?t:1,o=null===(n=r.path)||void 0===n?void 0:n.getPoint(i>0?1:0);r.timingTarget&&o&&(r.timingTarget.ppt_x=o.x+r.timingTarget.design_ppt_x,r.timingTarget.ppt_y=o.y+r.timingTarget.design_ppt_y)},r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeDestroy",r.onSeekToStart),r.createPath(),r}return T(n,[{key:"createPath",value:function(){var e,t,n=new os,r=null===(e=this.json.path)||void 0===e?void 0:e.match(/[MLCmlc][^MLCmlc]+/g);if(r){var i,o=S(r);try{for(o.s();!(i=o.n()).done;){var a=i.value.trim().replace(/\s+/g," ").split(" "),u=d(t=a)||s(t)||E(t)||h(),l=u[0],f=u.slice(1);if("M"===l){var p=c(f.map((function(e){return Number(e)})),2),v=p[0],m=p[1];n.moveTo(v,m)}else if("L"===l){var g=c(f.map((function(e){return Number(e)})),2),y=g[0],b=g[1];n.lineTo(y,b)}else if("C"===l){var x=c(f.map((function(e){return Number(e)})),6),_=x[0],w=x[1],T=x[2],M=x[3],A=x[4],I=x[5];n.bezierCurveTo(_,w,T,M,A,I)}else if("Z"===l)n.closePath();else if("E"===l)console.warn("not implements");else if("c"===l){var C=c(f.map((function(e){return Number(e)})),6),N=C[0],k=C[1],D=C[2],P=C[3],O=C[4],R=C[5],L=n.currentPoint;n.bezierCurveTo(N+L.x,k+L.y,D+L.x,P+L.y,O+L.x,R+L.y)}else if("l"===l){var j=n.currentPoint,B=c(f.map((function(e){return Number(e)})),2),U=B[0],z=B[1];n.lineTo(U+j.x,z+j.y)}else if("m"===l){var F=n.currentPoint,G=c(f.map((function(e){return Number(e)})),2),H=G[0],V=G[1];n.moveTo(H+F.x,V+F.y)}}}catch(e){o.e(e)}finally{o.f()}}this.path=n}},{key:"modifyAttrKey",get:function(){return"motion"}}]),n}(ry),Zy=function(e){p(n,e);var t=m(n);function n(e){var r,i;return _(this,n),(r=t.call(this,e)).isConflict=!0,r.activeWhenConflict="next",r.startVal=null,r.createVal=null,r.onTimelineStart=function(e){e.isReverse||r.updateCurrentValue()},r.onTimeUpdate=function(e){var t,n,i,o,a,s=e.duration,u=e.delta/s,l={x:1,y:1};if(r.to){var c=null!==(t=r.from)&&void 0!==t?t:{x:null!==(i=null===(n=r.startVal)||void 0===n?void 0:n.x)&&void 0!==i?i:1,y:null!==(a=null===(o=r.startVal)||void 0===o?void 0:o.y)&&void 0!==a?a:1};l.x=c.x+(r.to.x-c.x)*u,l.y=c.y+(r.to.y-c.y)*u}else if(r.by){var h={x:r.by.x,y:r.by.y};l.x=1+(h.x-1)*u,l.y=1+(h.y-1)*u}r.timingTarget&&(r.timingTarget.scale=l)},r.onTimeNodeStart=function(){r.timingTarget&&(r.startVal={x:r.timingTarget.scale.x,y:r.timingTarget.scale.y})},r.onSeekToStart=function(){r.timingTarget&&r.startVal&&(r.timingTarget.scale=r.startVal)},r.onSeekToEnd=function(){r.onTimeUpdate({duration:1,delta:1,isReverse:!1})},r.onDestroy=function(){null!==r.createVal&&r.timingTarget&&(r.timingTarget.scale=r.createVal)},r.from=e.json.from,r.to=e.json.to,r.by=e.json.by,r.commonTimeNode.on("timelineStart",r.onTimelineStart),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timeNodeStart",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeDestroy",r.onSeekToStart),(null===(i=r.timingTarget)||void 0===i?void 0:i.scale.x)&&(r.createVal={x:r.timingTarget.scale.x,y:r.timingTarget.scale.y}),r}return T(n,[{key:"updateCurrentValue",value:function(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}},{key:"modifyAttrKey",get:function(){return"scale"}}]),n}(ry),qy=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!1,r.activeWhenConflict="next",r.isTimelineStart=!1,r.startColorString=null,r.currentColorString="#FFFFFFFF",r.onTimelineStart=function(e){if(!r.isTimelineStart){r.isTimelineStart=!0,e.isReverse||r.updateCurrentValue(),r.from.isInit()||r.from.fromHexString(r.currentColorString),r.to.isInit()||r.from.by(r.by,r.to);var t=c(r.json.cBhvr.attrList[0].split("."),1)[0];ty(r.timingTarget,t+".on","true")}},r.onTimeNodeEnd=function(){var e=r.json.cBhvr.attrList[0];if("remove"===r.json.cBhvr.ctn.fill){var t=c(e.split("."),1)[0];ty(r.timingTarget,t+".on","false")}r.isTimelineStart=!1},r.onSeekToStart=function(){var e,t=r.json.cBhvr.attrList[0];if(r.timingTarget){r.onTimeUpdate({duration:1,delta:0});var n="ppt_c.color"===t||"text.color"===t;if((null===(e=r.timingTarget.fill)||void 0===e?void 0:e.designColor.toUpperCase())===r.from.toHexString().toUpperCase()||n){var i=c(t.split("."),1)[0];ty(r.timingTarget,i+".on","false")}}},r.onTimeNodeStart=function(){if(r.timingTarget){var e=r.json.cBhvr.attrList[0],t=ny(r.timingTarget,e);t&&(r.startColorString=t)}},r.onTimeUpdate=function(e){var t=e.delta/e.duration;if(r.to.interpolationFrom(r.from,t,r.target),r.timingTarget){var n=r.json.cBhvr.attrList[0];ty(r.timingTarget,n,r.target.toHexString())}},r.onSeekToEnd=function(){r.isTimelineStart||r.onTimelineStart({isReverse:!1,activeCount:0,id:""}),r.onTimeUpdate({duration:1,delta:1})},r.replaceAttrToRelation(),"rgb"===r.json.clrSpc?(r.from=new Wv(r.json.from),r.to=new Wv(r.json.to),r.by=new Wv(r.json.by),r.target=new Wv):(r.from=new Vv(r.json.from),r.to=new Vv(r.json.to),r.by=new Vv(r.json.by),r.target=new Vv),r.commonTimeNode.on("timeNodeStart",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timelineStart",r.onTimelineStart),r.commonTimeNode.on("timeNodeEnd",r.onTimeNodeEnd),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timeNodeDestroy",r.onSeekToStart),r}return T(n,[{key:"replaceAttrToRelation",value:function(){var e=this.json.cBhvr.attrList[0];"ppt_c"!==e?"style.color"===e&&(this.json.cBhvr.attrList[0]="text.color"):this.json.cBhvr.attrList[0]="ppt_c.color"}},{key:"updateCurrentValue",value:function(){if(this.timingTarget){var e=this.json.cBhvr.attrList[0],t=ny(this.timingTarget,e);t&&(this.currentColorString=t)}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(ry),Jy=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!1,r.activeWhenConflict="next",r.startVal=null,r.createVal=null,r.lastVal=null,r.onTimelineStart=function(e){r.lastVal=null,e.isReverse||r.updateCurrentValue()},r.onTimeUpdate=function(e){var t=e.duration,n=e.delta/t,i=0;if(void 0!==r.from&&void 0!==r.to){var o=(i=r.from)+(r.to-i)*n;r.timingTarget&&(r.timingTarget.r=o)}else if(void 0!==r.by){r.lastVal||(r.lastVal=0);var a=r.by*n-r.lastVal;r.lastVal=r.by*n,r.timingTarget&&(r.timingTarget.r+=a)}},r.onTimeNodeCreate=function(){var e;Tv()(null===(e=r.timingTarget)||void 0===e?void 0:e.r)&&(r.createVal=r.timingTarget.r)},r.onTimeNodeStart=function(){var e;Tv()(null===(e=r.timingTarget)||void 0===e?void 0:e.r)&&(r.startVal=r.timingTarget.r)},r.onSeekToStart=function(){r.timingTarget&&null!==r.startVal&&(r.timingTarget.r=r.startVal)},r.onSeekToEnd=function(){r.onTimeUpdate({duration:1,delta:1,isReverse:!1})},r.onDestroy=function(){r.timingTarget&&null!==r.createVal&&(r.timingTarget.r=r.createVal),r.startVal=null},r.from=r.json.from,r.to=r.json.to,r.by=r.json.by,r.by?r.isConflict=!1:r.isConflict=!0,r.onTimeNodeCreate(),r.commonTimeNode.on("timeNodeStart",r.onTimeNodeStart),r.commonTimeNode.on("timeNodeCreate",r.onTimeNodeStart),r.commonTimeNode.on("timelineStart",r.onTimelineStart),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("timeNodeDestroy",r.onDestroy),r}return T(n,[{key:"updateCurrentValue",value:function(){var e;this.currentVal=null===(e=this.timingTarget)||void 0===e?void 0:e.r}},{key:"modifyAttrKey",get:function(){return"rotate"}}]),n}(ry),Ky=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).isConflict=!1,r.activeWhenConflict="next",r.isApplied=!1,r.onTimeUpdate=function(){var e,t,n=r.json,i=n.cmd,o=n.cmdType;!r.isApplied&&i&&o&&(r.isApplied=!0,null===(t=null===(e=r.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand(i,o))},r.onSeekToStart=function(){var e,t;r.commonTimeNode.isInInteractiveSeq||null===(t=null===(e=r.timingTarget)||void 0===e?void 0:e.cmd)||void 0===t||t.applyCommand("custom-pause","call")},r.onSeekToEnd=function(){},r.commonTimeNode.on("timeNodeStart",(function(){r.isApplied=!1})),r.commonTimeNode.on("timeNodeEnd",(function(){r.isApplied=!1})),r.commonTimeNode.on("timeUpdate",r.onTimeUpdate),r.commonTimeNode.on("seekToStart",r.onSeekToStart),r.commonTimeNode.on("seekToEnd",r.onSeekToEnd),r}return T(n,[{key:"modifyAttrKey",get:function(){var e,t,n,r;return(null!==(t=null===(e=this.json)||void 0===e?void 0:e.cmd)&&void 0!==t?t:"")+(null!==(r=null===(n=this.json)||void 0===n?void 0:n.cmdType)&&void 0!==r?r:"")}}]),n}(ry),$y=function e(t){var n=this;_(this,e),this.runtimeNodeEventHub=new Ks.a,this.onVolumeUpdate=function(e){n.audio.volume(e)},this.stopAudio=function(){n.audio.stop()},this.destroy=function(){n.stopAudio(),n.audio.destroy(),n.ctx.activeMedia.delete(n.audio),n.ctx.volumeAdjuster.off("update",n.onVolumeUpdate)};var r=t.json,i=t.isIterate,o=t.isSub,a=t.eventHub,s=t.ctx,u=t.parent,l=t.iterateType,c=t.iterateIndex,h=t.iterateId,d=t.isInInteractiveSeq,f=t.fromSeqId;this.json=r,this.id=r.cMediaNode.ctn.id,this.commonTimeNode=new tb({json:r.cMediaNode.ctn,isSub:o,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:s,parent:u,isIterate:i,iterateType:l,iterateIndex:c,iterateId:h,isInInteractiveSeq:d,fromSeqId:f});var p=r.cMediaNode.tgtEl;s.loaderDelegate&&(p=s.loaderDelegate.redirectMedia(p),s.logger.info("redirect media url from ".concat(r.cMediaNode.tgtEl," to ").concat(p," by delegate."),s.taskId)),this.audio=new Wg(p,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",(function(){n.audio.volume(s.volumeAdjuster.volume),n.audio.play()})),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s,this.ctx.volumeAdjuster.on("update",this.onVolumeUpdate)};function eb(e){return(null===(t=e)||void 0===t?void 0:t.cBhvr)?e.cBhvr.ctn:function(e){var t,n;return!!(null===(n=null===(t=e)||void 0===t?void 0:t.cMediaNode)||void 0===n?void 0:n.ctn)}(e)?e.cMediaNode.ctn:e.ctn;var t}var tb=function(e){p(n,e);var t=m(n);function n(e){var r,i,o;_(this,n),(r=t.call(this)).uuid=uv(),r.isSub=!1,r.isShadow=!1,r.startCount=0,r.applyCount=0,r.isReverse=!1,r.isConflictDispose=!1,r.isIterateEnd=!1,r.parentTimeNode=null,r.isActive=!1,r.isDestroy=!1,r.shouldSeekOnStart=!1,r.repeatTimeoutId="",r.iterateShadows=[],r.isEndEventsEmitted=!1,r.tmFilter=[],r.timeDelta=0,r.isIterate=!1,r.iterateType="el",r.iterateIndex=0,r.children=[],r.subList=[],r.duration=0,r.isNegativeSpeed=!1,r.handleEndCond=function(){r.isActive&&(r.isActive=!1,r.isInfiniteRepeat()?r.repeatTimeNodeEnd():r.seekToEnd(!1,!0))},r.handleActive=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(r.isActive=!0,r.isConflictDispose=!1,r.applyCount+=1,r.json.iterate||r.emit("timeNodeStart",{id:r.uuid,activeCount:r.applyCount,isReverse:r.isReverse}),r.startCount>0&&r.json.restart){if("never"===r.json.restart)return;"whenNotActive"!==r.json.restart&&"always"!==r.json.restart||(r.seekToStart(),r.emit("timeNodeRestart",{id:r.uuid,activeCount:r.applyCount,isReverse:r.isReverse}),r.startTimeLine(e))}else r.startTimeLine(e)},r.updateTimeLine=function(e){var t=e/(nd.b.TARGET_FPMS||.06);r.timeDelta+=t,r.duration-r.timeDelta<=t&&(r.timeDelta=r.duration),r.timeDelta0&&void 0!==arguments[0]&&arguments[0];(r.isTimeNodeEnd()||e)&&(r.isActive=!1,r.isSub&&r.destroy(),r.emitEndEvents())};var a=e.isSub,s=e.isIterate,u=e.ctx,l=e.eventHubs,c=e.parent,h=e.json,d=e.iterateType,f=e.iterateId,p=e.iterateIndex,v=e.isInInteractiveSeq,m=e.fromSeqId;r.isSub=a,r.fromSeqId=m,r.isInInteractiveSeq=v,r.isIterate=s,r.parentTimeNode=c,r.json=h,r.ctx=u,r.iterateIndex=p,r.eventHubs=l,r.iterateType=d,r.iterateId=f,r.tmFilter=null!==(o=null===(i=h.tmFilter)||void 0===i?void 0:i.split(";").map((function(e){return e.split(",").map((function(e){return parseFloat(e.trim())}))})))&&void 0!==o?o:[];var g=Number(r.json.dur),y=r.json.spd||1;if(r.isNegativeSpeed=y<0,Number.isNaN(g)||(r.duration=g/Math.abs(y)),r.uuid+="--"+r.json.id,r.setPreStyle(),h.childTnLst&&r.createChildren(h.childTnLst),r.startConds=new $g(r.json.id||"",h.stCondLst,l,r.ctx),r.endConds=new $g(r.json.id||"",h.endCondLst,l,r.ctx),h.endSync&&(r.endSync=new $g(r.json.id||"",[h.endSync],l,r.ctx),r.endSync.on("active",(function(){var e;"interactiveSeq"===r.json.nodeType&&(r.isActive=!1,r.shouldSeekOnStart=!0,r.emit("timeNodeEndSync"),null===(e=r.endSync)||void 0===e||e.reset())}))),r.startConds.on("active",(function(e){r.isActive||(r.shouldSeekOnStart&&(r.shouldSeekOnStart=!1,r.seekToStart()),r.handleActive(e))})),r.endConds.on("active",(function(){r.handleEndCond(),r.children.forEach((function(e){return e.commonTimeNode.handleEndCond()}))})),r.parentTimeNode&&r.parentTimeNode.on("timeNodeStart",(function(){r.applyCount=0})),r.isSub&&"nextClick"===r.json.masterRel){var b="shape slide onNext"+r.fromSeqId;r.startConds.addCond({event:b})}return r.json.iterate&&!1===r.isIterate&&r.createIterateShadow(),r}return T(n,[{key:"createIterateShadow",value:function(){var e=this,t=uv(),r=!0,i=0;for(this.ctx.eventHub.on("IterateTimeNodeEnd",(function n(i){i===t&&(r=!1,e.ctx.eventHub.removeListener("IterateTimeNodeEnd",n))}));r;){var o=JSON.parse(JSON.stringify(this.json)),a=new n({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:i,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId});this.iterateShadows[i]=a,i+=1}}},{key:"isInfiniteRepeat",value:function(){return this.json.repeatCount>999999998}},{key:"getReverse",value:function(){return this.isReverse}},{key:"setReverse",value:function(e){this.isReverse=e}},{key:"createTimeNode",value:function(e,t){var n=null,r={json:e,isSub:t,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId};return"seq"===e.type?n=new ey(r):"par"===e.type?n=new nb(r):"set"===e.type?n=new iy(r):"anim"===e.type?n=new hy(r):"animEffect"===e.type?n=new Xy(r):"animMotion"===e.type?n=new Qy(r):"animScale"===e.type?n=new Zy(r):"animClr"===e.type?n=new qy(r):"animRot"===e.type?n=new Jy(r):"cmd"===e.type?n=new Ky(r):"audio"===e.type&&(n=new $y(r)),n}},{key:"createSubList",value:function(e){var t=this;this.subList&&this.subList.forEach((function(e){return e.commonTimeNode.destroy()})),this.subList=[],e.forEach((function(e){var n=t.createTimeNode(e,!0);n&&t.subList.push(n)}))}},{key:"bindCommonTimeNodeEvent",value:function(e){var t=this;e.commonTimeNode.on("timeNodeStart",(function(e){t.emit("childTimeNodeStart",e)})),e.commonTimeNode.on("timeNodeEnd",(function(e){t.emit("childTimeNodeEnd",e),t.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))&&(t.json.iterate||t.allChildrenEndHandle())}))}},{key:"createChildren",value:function(e){var t=this;function n(e){return eb(e).presetOrder}function r(e){return/^slide/.test(e)?"slide":/^layout/.test(e)?"layout":/^master/.test(e)?"master":"unknow"}var i=["master","layout","slide","unknow"];e&&e[0]&&n(e[0])?a(e).sort((function(e,t){var o,a,s,u,l=eb(e).id,c=eb(t).id;if(l&&c){var h=r(l),d=r(c);return h===d?(null!==(o=n(e))&&void 0!==o?o:0)-(null!==(a=n(t))&&void 0!==a?a:0):i.indexOf(h)-i.indexOf(d)}return(null!==(s=n(e))&&void 0!==s?s:0)-(null!==(u=n(t))&&void 0!==u?u:0)})).forEach((function(e){var n=t.createTimeNode(e,!1);n&&(t.bindCommonTimeNodeEvent(n),t.children.push(n))})):e.forEach((function(e){var n=t.createTimeNode(e,!1);n&&(t.bindCommonTimeNodeEvent(n),t.children.push(n))}))}},{key:"playReverse",value:function(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach((function(e){return e.commonTimeNode.playReverse()}))}},{key:"allChildrenEndHandle",value:function(){var e=this;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((function(){e.seekToStart(!1),e.resetForRepeat(),e.startTimeNodeRepeat()})):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}},{key:"resetForRepeat",value:function(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach((function(e){return e.commonTimeNode.resetForRepeat()}))}},{key:"startSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.startTimeNode()}))}},{key:"startReverseTimeLine",value:function(){this.isEndEventsEmitted=!1,this.timeDelta=0;var e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(bb.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(bb.animateStart),this.ctx.ticker.add(this.updateTimeLine))}},{key:"startTimeLine",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit("time ".concat(this.json.id," begin")),this.eventHubs.global.emit("time ".concat(this.json.id," onBegin")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," begin"))),this.json.iterate)this.startIterate();else{this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});var n=1e3/this.ctx.ticker.maxFPS;this.duration<=n&&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((function(){e.onTimeLineEnd()}))):this.duration>n&&(this.ctx.eventHub.emit(bb.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}}},{key:"startIterate",value:function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.json.iterate){e.next=24;break}this.isIterateEnd=!1,t=S(this.iterateShadows),e.prev=3,t.s();case 5:if((n=t.n()).done){e.next=15;break}if(r=n.value,!this.isIterateEnd){e.next=9;break}return e.abrupt("break",15);case 9:return r.children.forEach((function(e){e.commonTimeNode.startTimeNode()})),r.applyCount+=1,e.next=13,this.ctx.clock.delay(this.json.iterate.interval);case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),t.e(e.t0);case 20:return e.prev=20,t.f(),e.finish(20);case 23:this.onTimeLineEnd();case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])})))}},{key:"applyTimeFilter",value:function(e){if(!this.tmFilter.every((function(e){return Tv()(e[0])&&Tv()(e[1])})))return e;for(var t=0;t0?this.tmFilter[this.tmFilter.length-1][1]:e}},{key:"isNatureTimeEnd",value:function(){return this.duration>=0&&this.timeDelta>=this.duration}},{key:"findTargets",value:function(){var e=[];return function t(n){n.forEach((function(n){var r,i,o;n.cBhvr&&n.cBhvr.target&&e.findIndex((function(e){return e.id===n.cBhvr.target.id}))<0&&e.push(n.cBhvr.target),(null===(i=null===(r=null==n?void 0:n.cBhvr)||void 0===r?void 0:r.ctn)||void 0===i?void 0:i.childTnLst)&&n.cBhvr.ctn.childTnLst.length>0&&t(n.cBhvr.ctn.childTnLst),(null===(o=null==n?void 0:n.ctn)||void 0===o?void 0:o.childTnLst)&&n.ctn.childTnLst.length>0&&t(n.ctn.childTnLst)}))}(this.json.childTnLst||[]),e}},{key:"setPreStyle",value:function(){var e=this;this.json.presetClass&&this.findTargets().forEach((function(t){if(e.json.iterate)for(var n=0,r=!0;r;){var i=e.ctx.timingTargets.getTarget(t,!0,{type:e.json.iterate.type,index:n,id:""});i&&(e.setPreStyleForTarget(i),n+=1),r=!!i}else{var o=e.ctx.timingTargets.getTarget(t,!1);o&&e.setPreStyleForTarget(o)}}))}},{key:"setPreStyleForTarget",value:function(e){var t,n;if(e&&this.json.presetSubtype&&(e.presetSubType=this.json.presetSubtype),e&&!e.hasPreset)if("entr"===this.json.presetClass){var r=null===(n=null===(t=this.json)||void 0===t?void 0:t.childTnLst)||void 0===n?void 0:n.filter((function(e){return"set"===e.type&&"visible"===e.to}));(null==r?void 0:r.length)&&(e.hasPreset=!0,e.style.visibility="hidden")}else("exit"===this.json.presetClass||"path"===this.json.presetClass||"emph"===this.json.presetClass)&&(e.hasPreset=!0,e.style.visibility="visible")}},{key:"startTimeNodeRepeat",value:function(){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})}},{key:"startTimeNodeForce",value:function(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}},{key:"startTimeNode",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.isDestroy){this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(e);var t=this.json.stCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];t&&this.startConds.condHandle(t);var n=this.json.endCondLst.filter((function(e){return/^self/.test(e.event||"")}))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}}},{key:"onTimeLineEnd",value:function(){this.dispose(),(0===this.children.length||this.json.iterate)&&this.allChildrenEndHandle()}},{key:"clearSubList",value:function(){this.subList.forEach((function(e){return e.commonTimeNode.destroy()}))}},{key:"seekToStart",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[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((function(t){return t.seekToStart(e)}));if(e)for(var t=this.subList.length-1;t>=0;t--){var n=this.subList[t];null==n||n.commonTimeNode.seekToStart()}for(var r=this.children.length-1;r>=0;r--){var i=this.children[r];null==i||i.commonTimeNode.seekToStart()}if(this.children.length>1)for(var o=this.children.length-1;o>=0;o--){var a=this.children[o];null==a||a.commonTimeNode.seekToStart()}}},{key:"repeatTimeNodeEnd",value:function(){this.dispose(),this.children.forEach((function(e){e.commonTimeNode.isActive=!1,e.commonTimeNode.dispose()}))}},{key:"dispose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isConflictDispose=e,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(bb.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch(e){}this.startConds.reset(),this.endConds.reset()}},{key:"seekToEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isInfiniteRepeat()){!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();var n=this.json.autoRev||e;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach((function(e){return e.seekToEnd(n,t)}));0===this.children.length&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach((function(e){return e.commonTimeNode.seekToEnd(n,t)})),t&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach((function(e){return e.commonTimeNode.seekToEnd(!1)})),this.clearSubList())}}},{key:"isTimeNodeEndWhenDetectEndSync",value:function(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEndWhenDetectEndSync()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"isTimeNodeEnd",value:function(){var e=!0;return this.children.length>0&&(e=e&&this.children.every((function(e){return e.commonTimeNode.isTimeNodeEnd()}))),this.json.repeatCount&&(e=e&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(e=e&&!this.isReverse),e=e&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||e}},{key:"emitEndEvents",value:function(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit("time ".concat(this.json.id," end")),this.eventHubs.global.emit("time ".concat(this.json.id," onEnd")),this.eventHubs.runtime.emit("runtime ".concat(this.json.id," end")),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}},{key:"collectStartValue",value:function(){this.emit("timeNodeCreate"),this.children.forEach((function(e){return e.commonTimeNode.collectStartValue()}))}},{key:"destroy",value:function(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach((function(e){return e.commonTimeNode.destroy()})),this.clearSubList()}}]),n}(Ks.a),nb=function(e){p(n,e);var t=m(n);function n(e){var r;_(this,n),(r=t.call(this)).isRunning=!1,r.runtimeNodeEventHub=new Ks.a;var i=e.json,o=e.iterateType,a=e.isIterate,s=e.isSub,u=e.parent,l=e.ctx,c=e.eventHub,h=e.iterateIndex,d=e.iterateId,f=e.isInInteractiveSeq,p=e.fromSeqId;return r.id=i.ctn.id,r.json=i,r.ctx=l,r.isIterate=a,r.globalEventHub=c,r.commonTimeNode=new tb({json:i.ctn,isSub:s,eventHubs:{global:c,runtime:r.runtimeNodeEventHub},ctx:l,parent:u,isIterate:!1,iterateType:o,iterateIndex:h,iterateId:d,isInInteractiveSeq:f,fromSeqId:p}),r.commonTimeNode.on("timeNodeStart",(function(){r.commonTimeNode.children.forEach((function(e){e.commonTimeNode.setReverse(r.commonTimeNode.getReverse()),e.commonTimeNode.startTimeNode()})),r.isRunning||(r.isRunning=!0,r.globalEventHub.emit("runtime ".concat(r.id," begin")),r.emit("begin"))})),r.commonTimeNode.on("timeNodeRepeat",(function(){r.commonTimeNode.children.forEach((function(e){e.commonTimeNode.startTimeNode(!1)}))})),r.commonTimeNode.on("timeNodeEnd",(function(){r.commonTimeNode.isTimeNodeEnd()&&r.isRunning&&(r.isRunning=!1,r.globalEventHub.emit("runtime ".concat(r.id," end")),r.emit("end")),"exit"===r.commonTimeNode.json.presetClass&&r.commonTimeNode.children.length>=1&&r.commonTimeNode.children[r.commonTimeNode.children.length-1]instanceof iy&&r.commonTimeNode.children.forEach((function(e){e instanceof iy||"function"!=typeof e.onSeekToStart||e.onSeekToStart()}))})),r}return n}(Ks.a),rb=function(){function e(t,n,r){_(this,e),this.json=t,this.ctx=r,this.globalEventHub=n;var i=t.timeNodeList.find((function(e){return"par"===e.type&&"tmRoot"===e.ctn.nodeType}));i&&(this.tmRoot=new nb({json:i,isSub:!1,isIterate:!1,eventHub:n,ctx:r,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1,fromSeqId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find((function(e){var t,n,r;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"mainSeq"===(null===(r=null===(n=e.json)||void 0===n?void 0:n.ctn)||void 0===r?void 0:r.nodeType)})))}return T(e,[{key:"findSeq",value:function(e){var t;return null===(t=this.tmRoot)||void 0===t?void 0:t.commonTimeNode.children.find((function(t){var n,r,i;return"seq"===(null===(n=t.json)||void 0===n?void 0:n.type)&&(null===(i=null===(r=t.json)||void 0===r?void 0:r.ctn)||void 0===i?void 0:i.id)===e}))}},{key:"start",value:function(){var e,t;return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.json.autoPlayMainSeq){n.next=6;break}return n.next=3,this.ctx.clock.delay(16);case 3:null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.startTimeNode(),n.next=7;break;case 6:null===(t=this.mainSeq)||void 0===t||t.commonTimeNode.startTimeNode();case 7:case"end":return n.stop()}}),n,this)})))}},{key:"setMainSeqApplied",value:function(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}},{key:"collectMainSeqStartValue",value:function(){var e;null===(e=this.mainSeq)||void 0===e||e.commonTimeNode.collectStartValue()}},{key:"setMainSeqStep",value:function(e,t){var n;-1===e&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),null===(n=this.mainSeq)||void 0===n||n.setCurrentStep(e,t)}},{key:"destroy",value:function(){var e;this.globalEventHub.removeAllListeners(),null===(e=this.tmRoot)||void 0===e||e.commonTimeNode.destroy()}},{key:"hasMainSeq",value:function(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}},{key:"currentMainSeqState",value:function(){return this.mainSeq?this.mainSeq.currentState:null}},{key:"currentMainSeqStep",value:function(){return this.mainSeq?this.mainSeq.currentStep:0}},{key:"currentMainSeqLength",value:function(){return this.mainSeq?this.mainSeq.stepLength:0}},{key:"mainSeqHasNextStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasNext()}},{key:"mainSeqHasPrevStep",value:function(){return!!this.mainSeq&&this.mainSeq.hasPrev()}},{key:"seekInteractiveSeqToEnd",value:function(e){var t=this.findSeq(e);t&&t.commonTimeNode.seekToEnd(!1,!0)}},{key:"setInteractiveSeqState",value:function(e,t,n){var r=this.findSeq(e);r&&r.setCurrentStep(t,n)}},{key:"resetAllInteractiveSeq",value:function(){var e;((null===(e=this.tmRoot)||void 0===e?void 0:e.commonTimeNode.children.filter((function(e){var t,n,r;return"seq"===(null===(t=e.json)||void 0===t?void 0:t.type)&&"interactiveSeq"===(null===(r=null===(n=e.json)||void 0===n?void 0:n.ctn)||void 0===r?void 0:r.nodeType)})))||[]).forEach((function(e){e.setCurrentStep(0,"start")}))}},{key:"applyInteractiveAction",value:function(e){this.globalEventHub.emit(e)}}]),e}(),ib=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ob=function(e){p(n,e);var t=m(n);function n(e,r,i,o){var a;_(this,n),(a=t.call(this,{id:"stage",width:e.width,height:e.height,type:"Container",children:e.children},r,{parentGlobalPos:i},o)).isRendered=!1,a.isTimingStartValueCollected=!1,a.json=e,a.json.smartArtShapeList&&(r.smartArtShapeList=a.json.smartArtShapeList),r.hasBackgroundFillShape=a.detectUseBackgroundFill(a.json),a.container.visible=!1,a.ctx=r;var s=new Dd;return s.beginFill(16777215),s.drawRect(0,0,e.width,e.height),s.endFill(),a.container.addChild(s),a}return T(n,[{key:"detectUseBackgroundFill",value:function(e){var t=this;return!!e&&("Picture"===e.type||"Shape"===e.type?e.useBgFill:!(!e.children||!Array.isArray(e.children))&&e.children.some((function(e){return t.detectUseBackgroundFill(e)})))}},{key:"initOnReuse",value:function(){var e=this;f(x(n.prototype),"initOnReuse",this).call(this),this.ctx.timingEventHub.on("c:prev slide",(function(t){e.ctx.eventHub.emit(bb.requestPrevSlide,t)})),this.ctx.timingEventHub.on("c:next slide",(function(t,n){e.ctx.eventHub.emit(bb.requestNextSlide,t,n)}))}},{key:"render",value:function(e){var t=this;this.isRendered||(this.collectAnimatedIds().forEach((function(e){return t.ctx.animatedIds.add(e)})),this.isRendered=!0,f(x(n.prototype),"render",this).call(this,e),e.addSubMTask((function(){return ib(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ctx.eventHub.emit("StageRenderEnd");case 1:case"end":return e.stop()}}),e,this)})))}),"@StageImpl[emit.StageRenderEnd]"))}},{key:"isListTimeNode",value:function(e){return["excel","seq","par"].indexOf(e.type)>=0}},{key:"isAnimatedTimeNode",value:function(e){return!!e.cBhvr}},{key:"collectAnimatedIdsForTimeNode",value:function(e,t){var n,r=this;this.isListTimeNode(e)?null===(n=e.ctn.childTnLst)||void 0===n||n.forEach((function(e){r.collectAnimatedIdsForTimeNode(e,t)})):this.isAnimatedTimeNode(e)&&t.push(e.cBhvr.target.id)}},{key:"collectAnimatedIds",value:function(){var e=this,t=[];return this.json.timing&&this.json.timing.timeNodeList.forEach((function(n){e.collectAnimatedIdsForTimeNode(n,t)})),t}},{key:"createTiming",value:function(){this.json.timing&&!this.timing&&(this.timing=new rb(this.json.timing,this.ctx.timingEventHub,this.ctx))}},{key:"startTiming",value:function(){var e;return(null===(e=this.timing)||void 0===e?void 0:e.start())||Promise.resolve()}},{key:"setMainSeqApplied",value:function(){var e;null===(e=this.timing)||void 0===e||e.setMainSeqApplied()}},{key:"setMainSeqStep",value:function(e,t){var n;null===(n=this.timing)||void 0===n||n.setMainSeqStep(e,t)}},{key:"collectMainSeqStartValue",value:function(){var e;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,null===(e=this.timing)||void 0===e||e.collectMainSeqStartValue())}},{key:"hasTiming",value:function(){return!!this.timing}},{key:"clearOnSlideChange",value:function(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),f(x(n.prototype),"clearOnSlideChange",this).call(this)}},{key:"clearOnTransactionEnd",value:function(){var e,t;this.ctx.timingTargets.getTargets().forEach((function(e){e.hasPreset=!1})),null===(e=this.timing)||void 0===e||e.resetAllInteractiveSeq(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0}},{key:"destroy",value:function(){var e,t;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),null===(e=this.ctx.bgTexture)||void 0===e||e.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),null===(t=this.timing)||void 0===t||t.destroy(),this.timing=void 0,f(x(n.prototype),"destroy",this).call(this)}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqStep())&&void 0!==t?t:0}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.currentMainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.timing)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"mainSeqState",value:function(){return this.timing?this.timing.currentMainSeqState():null}},{key:"nextStep",value:function(e,t){var n;this.hasTiming()&&(null===(n=this.timing)||void 0===n?void 0:n.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",e,t)):this.ctx.eventHub.emit(bb.requestNextSlide,e,t)}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.hasTiming()&&(null===(e=this.timing)||void 0===e?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(bb.requestPrevSlide,t)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.timing)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.timing)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,n){var r;null===(r=this.timing)||void 0===r||r.setInteractiveSeqState(e,t,n)}},{key:"setMediaState",value:function(e,t,n){return ib(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=this.ctx.medias[e],r.t0=i,!r.t0){r.next=21;break}if(!t){r.next=18;break}if(!n){r.next=14;break}return r.next=7,dv((function(){return i.clippedDuration>0}),5e3);case 7:if(r.t1=n=0&&t.tasks.splice(n,1)})),e.once("task-error",(function(){var n=t.tasks.indexOf(e);n>=0&&t.tasks.splice(n,1)}))}},{key:"start",value:function(){this.couldRunning=!0}},{key:"stop",value:function(){this.couldRunning=!1}}]),e}(),sb=function(e){return new Promise((function(t){return setTimeout(t,e)}))},ub=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;return _(this,n),(o=t.call(this)).slideIndex=e,o.taskId=r,o.logger=i,o.uuid=uv(),o.isCancel=!1,o.tasks=[],o}return T(n,[{key:"addMTask",value:function(e,t){this.tasks.push({fn:e,state:"wait",sub:[],name:t})}},{key:"addSubMTask",value:function(e,t){var n=this.tasks.findIndex((function(e){return"running"===e.state}));n<0&&(n=0),this.tasks[n].sub.push({fn:e,state:"wait",sub:[],name:t})}},{key:"cancel",value:function(){this.tasks=[],this.isCancel=!0}},{key:"applyNext",value:function(){var e=this;if(!this.tasks.some((function(e){return"running"===e.state}))&&!this.tasks.some((function(e){return"error"===e.state})))if(this.tasks.every((function(e){return"finish"===e.state})))this.isCancel||this.emit("task-finish");else{var t=this.tasks.find((function(e){return"wait"===e.state}));t&&(t.state="running",t.fn.apply(null).then((function(){if(t.state="finish",t.sub.length>0){var n,r=e.tasks.findIndex((function(e){return e===t}));(n=e.tasks).splice.apply(n,[r+1,0].concat(a(t.sub)))}})).catch((function(n){t.state="error",e.logger.error("".concat(n," ").concat(n.stack),e.taskId),e.emit("task-error",rv.transform(n),e.slideIndex)})))}}},{key:"applyAll",value:function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.tasks.every((function(e){return"finish"===e.state}))){e.next=14;break}if(!this.tasks.some((function(e){return"running"===e.state}))){e.next=6;break}return e.next=4,sb(16);case 4:e.next=12;break;case 6:if(!this.tasks.some((function(e){return"error"===e.state}))){e.next=8;break}return e.abrupt("return");case 8:return e.delegateYield(regeneratorRuntime.mark((function e(){var n,r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.tasks.find((function(e){return"wait"===e.state})))){e.next=17;break}return n.state="running",e.prev=3,e.next=6,hv((function(){return n.fn.apply(null)}),6e4);case 6:if(e.t0=e.sent,e.t1=lv,e.t0!==e.t1){e.next=10;break}throw new rv(Jp.RuntimeError,"subtask ".concat(n.name," apply timeout"));case 10:n.state="finish",n.sub.length>0&&(i=t.tasks.findIndex((function(e){return e===n})),(r=t.tasks).splice.apply(r,[i+1,0].concat(a(n.sub)))),e.next=17;break;case 13:return e.prev=13,e.t2=e.catch(3),o=(null==e.t2?void 0:e.t2.errorType)?e.t2:new rv(Jp.RuntimeError,"subtask ".concat(n.name," error. ").concat(e.t2)),n.state="error",t.logger.error("".concat(e.t2," ").concat(e.t2.stack),t.taskId),t.emit("task-error",rv.transform(o),t.slideIndex),e.abrupt("return","break");case 17:case"end":return e.stop()}}),e,null,[[3,13]])}))(),"t0",9);case 9:if("break"!==e.t0){e.next=12;break}return e.abrupt("break",14);case 12:e.next=0;break;case 14:!this.isCancel&&this.tasks.every((function(e){return"finish"===e.state}))&&this.emit("task-finish");case 15:case"end":return e.stop()}}),e,this)})))}}]),n}(Ks.a),lb=function(){function e(t,n){var r=this;if(_(this,e),this.renderer=t,this.localStorage=n,this.outputData=new Map,this.loadingSdfKeys=new Set,!e.worker){var i=new Blob(['\nself.onmessage = function(e) {\n var data = e.data.data;\n var key = e.data.key;\n var height = Math.ceil(e.data.height);\n var width = Math.ceil(e.data.width);\n if (!data || !key) {\n return;\n }\n var maxDis = 0;\n var d = [];\n var p = [];\n var maxInt = Number.MAX_SAFE_INTEGER || 255 * 255 * 255;\n var setD = function(x, y, v) { d[y * width + x] = v; };\n var getD = function(x, y) { return d[y * width + x]; };\n var setP = function(x, y, v) { p[y * width + x] = v; };\n var getP = function(x, y) { return p[y * width + x]; };\n var isContains = function(x, y) { return x >= 0 && x < width && y >= 0 && y < height; };\n var isInterior = function(x, y) { return data[(y * width + x) * 4 + 3] > 10; };\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var c = isInterior(x, y);\n var t = isContains(x, y - 1) ? isInterior(x, y - 1) : false;\n var b = isContains(x, y + 1) ? isInterior(x, y + 1) : false;\n var l = isContains(x - 1, y) ? isInterior(x - 1, y) : false;\n var r = isContains(x + 1, y) ? isInterior(x + 1, y) : false;\n if (c !== t || c !== b || c !== l || c !== r) {\n setD(x, y, 0);\n setP(x, y, [x, y]);\n } else {\n setD(x, y, maxInt);\n setP(x, y, [-1, -1]);\n }\n }\n }\n \n var f = function (x, y, dir) {\n var d1 = 1;\n var d2 = Math.sqrt(2);\n var dx;\n var dy;\n var od;\n switch (dir) {\n case "TL": dx = -1; dy = -1; od = d2; break;\n case "T": dx = 0; dy = -1; od = d1; break;\n case "TR": dx = 1; dy = -1; od = d2; break;\n case "L": dx = -1; dy = 0; od = d1; break;\n case "R": dx = 1; dy = 0; od = d1; break;\n case "BL": dx = -1; dy = 1; od = d2; break;\n case "B": dx = 0; dy = 1; od = d1; break;\n case "BR": dx = 1; dy = 1; od = d2; break;\n }\n var b = isContains(x + dx, y + dy);\n var cb = b ? getD(x + dx, y + dy) : maxInt;\n if (cb + od < getD(x, y)) {\n var p = b ? getP(x + dx, y + dy) : [-1, -1];\n var dis = Math.sqrt(Math.pow(x - p[0], 2) + Math.pow(y - p[1], 2));\n setP(x, y, p);\n setD(x, y, dis);\n if (dis > maxDis) {\n maxDis = dis;\n }\n }\n };\n \n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n var dirs = ["TL", "T", "TR", "L"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n for (var y = height - 1; y >= 0; -- y) {\n for (var x = width - 1; x >= 0; -- x) {\n var dirs = ["R", "BL", "B", "BR"];\n for (var i = 0; i < dirs.length; ++ i) {\n var dir = dirs[i];\n f(x, y, dir);\n }\n }\n }\n\n var outputData = [];\n for (var y = 0; y < height; ++ y) {\n for (var x = 0; x < width; ++ x) {\n outputData.push(isInterior(x, y) ? 255: 0);\n outputData.push(0);\n outputData.push(0);\n outputData.push(Math.ceil(getD(x, y) / maxDis * 255));\n }\n }\n self.postMessage({\n key, outputData, maxDis\n });\n};\n'],{type:"text/javascript"});e.worker=new Worker(URL.createObjectURL(i)),e.worker.onmessage=function(e){r.outputData.set(e.data.key,{data:e.data.outputData,maxDis:e.data.maxDis})},this.outputData.set("111","222")}}return T(e,[{key:"createSdfByWorker",value:function(t,n,r,i,o,a,s,u){var l=document.createElement("canvas");l.width=o,l.height=a;var c=l.getContext("2d");if(c&&e.worker){c.drawImage(s,t,n,r,i);var h=c.getImageData(0,0,o,a).data;e.worker.postMessage({data:h,key:u,width:o,height:a})}}},{key:"createSdf",value:function(e,t,n){var r=document.createElement("canvas");r.width=e,r.height=t;var i=r.getContext("2d");if(!i)return{src:"",maxDis:1};i.drawImage(n,0,0);for(var o=0,a=i.getImageData(0,0,e,t).data,s=[],u=[],l=function(t,n,r){s[n*e+t]=r},c=function(t,n){return s[n*e+t]},h=function(t,n,r){u[n*e+t]=r},d=function(n,r){return n>=0&&n=0&&r10},p=0;po&&(o=m)}},w=0;w=0;--E)for(var A=e-1;A>=0;--A)for(var I=0,C=["R","BL","B","BR"];It.maxResolution.x||s>t.maxResolution.y){var r=(n=t.maxResolution.x/a)*s;r>t.maxResolution.y&&(n*=t.maxResolution.y/r)}return o.loadSpriteSheetItem(t.url,t.taskId,e,n)}),"@StagePool[spriteTexture.loadSpriteSheetItem]")})),Promise.resolve()}),"@StagePool[loadSpriteSheets]")}},{key:"createStage",value:function(e){var t=this,n=this.stageStates[e].task;n.addMTask((function(){var r=t.stageJsons[e],i=t.stageCtxs[e],o=new ob(r,i,{x:0,y:0},n);return t.stageImpls[e]=o,Promise.resolve()}),"@StagePool[createStage]")}},{key:"preRenderStage",value:function(e){var t=this,n=this.stageStates[e].task;n.addMTask((function(){return t.stageImpls[e].preRender(n),Promise.resolve()}),"@StagePool[preRenderStage]")}},{key:"createGraphicsTexture",value:function(e){var t=this,n=this.stageStates[e].task;n.addMTask((function(){return cb(t,void 0,void 0,regeneratorRuntime.mark((function t(){var r,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(r=this.stageCtxs[e]).graphicsTexture.pack().forEach((function(t,o){n.addSubMTask((function(){var n=i.stageCtxs[e],a=n.stageWidth,s=n.stageHeight,u=1;if(a>i.maxResolution.x||s>i.maxResolution.y){var l=(u=i.maxResolution.x/a)*s;l>i.maxResolution.y&&(u*=i.maxResolution.y/l)}return r.graphicsTexture.render(t,o,i.objPoolGroup,u)}),"@StagePool[graphicsTexture.render]")}));case 2:case"end":return t.stop()}}),t,this)})))}),"@StagePool[createGraphicsTexture]")}},{key:"renderStage",value:function(e){var t=this,n=this.stageStates[e].task;n.addMTask((function(){return cb(t,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.stageImpls[e],t.next=3,r.render(n);case 3:case"end":return t.stop()}}),t,this)})))}),"@StagePool[renderStage]")}},{key:"destroyStageByIndex",value:function(e){"load"===this.stageStates[e].state&&this.stageStates[e].task.cancel(),delete this.stageStates[e],this.stageImpls[e].destroy(),delete this.stageImpls[e],delete this.stageCtxs[e]}},{key:"destroyStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var n=parseInt(t,10);Math.abs(e.currentStageIndex-n)>e.cacheCount&&e.destroyStageByIndex(n)}))}},{key:"destroyAllStage",value:function(){var e=this;Object.keys(this.stageImpls).forEach((function(t){var n=parseInt(t,10);e.destroyStageByIndex(n)}))}},{key:"preload",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stageImpls[e]||this.stageStates[e])return Promise.resolve();var r=new ub(e,this.taskId,this.logger);return r.on("task-error",(function(e,n){delete t.stageStates[n],delete t.stageImpls[n],delete t.stageCtxs[n],t.errorChannel.emit("error",e,n)})),this.stageStates[e]={state:"load",task:r},this.createCtx(e),this.loadStageJson(e),this.loadSpriteSheets(e),this.createStage(e),this.preRenderStage(e),this.createGraphicsTexture(e),this.renderStage(e),this.microTaskManager.addTask(r),n?r.applyAll():new Promise((function(n){r.once("task-finish",(function(){t.stageStates[e].state="finish",Object.keys(t.stageStates).length>2*t.cacheCount+1&&t.destroyStage(),n()}))}))}},{key:"getStageJson",value:function(e){return this.stageJsons[e]||null}},{key:"getStage",value:function(e){return cb(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.currentStageIndex=e,"finish"!==(null==(n=this.stageStates[e])?void 0:n.state)||!this.stageImpls[e]){t.next=6;break}t.t0=this.stageImpls[e],t.next=16;break;case 6:if("load"!==(null==n?void 0:n.state)){t.next=12;break}return t.next=9,n.task.applyAll();case 9:t.t1=this.stageImpls[e],t.next=15;break;case 12:return t.next=14,this.preload(e,!0);case 14:t.t1=this.stageImpls[e];case 15:t.t0=t.t1;case 16:return t.abrupt("return",t.t0);case 17:case"end":return t.stop()}}),t,this)})))}},{key:"destroy",value:function(){this.runningAudio.clear()}}]),e}(),db=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},fb=function(){function e(t){var n,r=this;_(this,e),this.logger=t,this.taskId="",this.isIndexDBReady=!1,this.memoryCache=new Map,null===(n=e.localCache)||void 0===n||n.ready((function(e){e||(r.isIndexDBReady=!0)})).catch((function(){t.warn("local storage not ready",r.taskId)}))}return T(e,[{key:"attachTaskId",value:function(e){this.taskId=e}},{key:"getItem",value:function(t){return db(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=null,!this.couldUseIndexDBCache||!e.localCache){n.next=10;break}return n.prev=2,n.next=5,hv((function(){return e.localCache.getItem("".concat(i.taskId,"/").concat(t))}),500);case 5:r=n.sent,n.next=10;break;case 8:n.prev=8,n.t0=n.catch(2);case 10:return n.abrupt("return",(r=r===lv?null:r)||this.memoryCache.get(t)||null);case 11:case"end":return n.stop()}}),n,this,[[2,8]])})))}},{key:"setItem",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return db(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(this.couldUseIndexDBCache){i.next=2;break}return i.abrupt("return",(r&&this.memoryCache.set(t,n),Promise.resolve()));case 2:if(!e.localCache){i.next=13;break}return o=null,i.prev=4,i.next=7,hv((function(){return e.localCache.setItem("".concat(a.taskId,"/").concat(t),n).catch((function(){r&&a.memoryCache.set(t,n)}))}),500);case 7:o=i.sent,i.next=12;break;case 10:i.prev=10,i.t0=i.catch(4);case 12:o!==lv&&null!==o||!r||this.memoryCache.set(t,n);case 13:case"end":return i.stop()}}),i,this,[[4,10]])})))}},{key:"dispose",value:function(){var t,n=this;this.memoryCache=new Map,this.couldUseIndexDBCache&&(null===(t=e.localCache)||void 0===t||t.keys().then((function(t){t.filter((function(e){return e.indexOf(n.taskId)>=0})).forEach((function(t){var n;null===(n=e.localCache)||void 0===n||n.removeItem(t).catch((function(){}))}))})).catch((function(){})))}},{key:"couldUseIndexDBCache",get:function(){return this.isIndexDBReady&&this.taskId.length>0}}]),e}();fb.localCache=null;try{fb.localCache=b.createInstance({name:"slide_local_cache",driver:b.INDEXEDDB,version:1})}catch(u){}var pb=new jl.j,vb=function(){function e(t){_(this,e),this.localStorage=t}return T(e,[{key:"canvas",value:function(t,n,r,i){var o,a,s,u=!1,l=!1;t&&(t instanceof Xl.p?s=t:(s=n.generateTexture(t),l=!0)),s?(o=s.baseTexture.resolution,a=s.frame,u=!1,n.renderTexture.bind(s)):(o=n.resolution,u=!0,(a=pb).width=n.width,a.height=n.height,n.renderTexture.bind(null));var c=Math.floor(a.width*o+1e-4),h=Math.floor(a.height*o+1e-4),d=document.createElement("canvas");d.width=c,d.height=h;var f=d.getContext("2d");if(!f)throw new Error("ctx");if(r)f.putImageData(r,0,0);else{var p=f.getImageData(0,0,c,h),v=new Uint8Array(4*c*h),m=n.gl;m.readPixels(a.x*o,a.y*o,c,h,m.RGBA,m.UNSIGNED_BYTE,v),e.arrayPostDivide(v,p.data),f.putImageData(p,0,0),i&&this.localStorage.setItem(i,p).catch((function(){}))}if(u){var g=document.createElement("canvas");g.width=c,g.height=h;var y=g.getContext("2d");y.scale(1,-1),y.drawImage(d,0,-h),d=g}return l&&(null==s||s.destroy(!0)),d}}],[{key:"arrayPostDivide",value:function(e,t){for(var n=0;n1&&(e=1),this._volume=e,this.emit("update",this._volume)}}]),n}(Ks.a),gb=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Ol.skipHello();var yb={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",gallery:"Gallery",switch:"Switch",prism:"Prism",doors:"Doors"},bb={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",mediaStop:"mediaStop",requestNextSlide:"requestNextSlide",requestPrevSlide:"requestPrevSlide",requestGotoSlide:"requestGotoSlide",requestOpenUrl:"requestOpenUrl",userInput:"userInput",fullscreenChange:"fullscreenChange",changeLocalFullscreenState:"changeLocalFullscreenState"},xb=function(e){p(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_(this,n),(r=t.call(this)).errorChannel=new Ks.a,r.transactionPlayer=null,r.isForward=!0,r.drawCall=0,r.scale=1,r._isPaused=!1,r.maxResolution=new jl.g(0,0),r.isNVIDIA=!1,r.fps=new nv,r.designWidth=0,r.designHeight=0,r.currentIndex=0,r.slideCount=0,r.runtime={drawCall:0,fps:0},r.globalEventHub=new Ks.a,r.globalVideoBackground=new Dd,r.globalVideoSprite=new Ld,r.onMousemoveTimeout=null,r.cacheFunctionMap=new Map,r.isPlayerPaused=function(){return r._isPaused},r.onWebGLLost=function(){r.errorChannel.emit("error",new rv(Jp.CanvasCrash,"webgl context lost."))},r.fullscreenOnMousemove=function(e){var t=e.index,n=e.targetId;r.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:n,status:!0}),r.onMousemoveTimeout&&clearTimeout(r.onMousemoveTimeout),r.onMousemoveTimeout=setTimeout((function(){r.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:n,status:!1})}),jg)},r.fullscreenOnMouseleave=function(e){var t=e.index,n=e.targetId;r.globalEventHub.emit("controllerShowStatusChange",{slideIndex:t,targetId:n,status:!1})},r.calculateFullscreenVideoPosition=function(e){var t=e.width,n=e.height,i=y(r),o=i.designWidth,a=i.designHeight,s=Math.min(o/t,a/n);return{x:(o-t*s)/2,y:(a-n*s)/2,width:t*s,height:n*s}},r.onRequestFullscreenVideo=function(e){var t=e.texture,n=e.index,i=e.targetId;if(n===r.currentIndex){r.onRequestCancelFullscreenVideo(),r.globalVideoBackground.width=r.designWidth,r.globalVideoBackground.height=r.designHeight,r.globalVideoBackground.beginFill(0,1),r.globalVideoBackground.drawRect(0,0,r.designWidth,r.designHeight),r.globalVideoBackground.endFill(),r.globalVideoBackground.interactive=!0,r.app.stage.addChild(r.globalVideoBackground);var o=r.calculateFullscreenVideoPosition(t),a=o.x,s=o.y,u=o.width,l=o.height;r.globalVideoSprite.texture=t,r.globalVideoSprite.width=u,r.globalVideoSprite.height=l,r.globalVideoSprite.position.x=a,r.globalVideoSprite.position.y=s,r.globalVideoBackground.addChild(r.globalVideoSprite),r.globalEventHub.emit("onFullscreenChange",{status:!0,targetId:i,slideIndex:r.currentIndex}),r.clearFullscreenEventListenersWithAppView();var c={handleEvent:function(){var e;null===(e=r.currentStage)||void 0===e||e.ctx.eventHub.emit(bb.userInput)}};if(r.app.view.addEventListener("pointerdown",c,!1),r.cacheFunctionMap.set("pointerdown",c),Pg.isDesktop()){var h={handleEvent:function(){r.fullscreenOnMouseleave({index:n,targetId:i})}};r.app.view.addEventListener("mouseout",h,!1);var d={handleEvent:function(){r.globalEventHub.emit("controllerShowStatusChange",{slideIndex:n,targetId:i,status:!0})}};r.app.view.addEventListener("mouseover",d,!1);var f={handleEvent:function(){r.fullscreenOnMousemove({index:n,targetId:i})}};r.app.view.addEventListener("mousemove",f,!1),r.cacheFunctionMap.set("mouseover",d),r.cacheFunctionMap.set("mousemove",f),r.cacheFunctionMap.set("mouseout",h)}else{var p={handleEvent:function(){r.fullscreenOnMousemove({index:n,targetId:i})}};r.app.view.addEventListener("touchstart",p,!1),r.cacheFunctionMap.set("touchstart",p)}}else t.destroy(!1)},r.onRequestCancelFullscreenVideo=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r.globalVideoSprite.texture.destroy(!1),r.globalVideoBackground.removeChild(r.globalVideoSprite),r.app.stage.removeChild(r.globalVideoBackground),r.globalEventHub.emit("onFullscreenChange",{status:!1,slideIndex:r.currentIndex,targetId:null===(e=r.currentStage)||void 0===e?void 0:e.ctx.latestChangeFullscreenTargetId}),r.clearFullscreenEventListenersWithAppView(),n&&r.emit(bb.changeLocalFullscreenState,{status:!1,slideIndex:r.currentIndex,targetId:null===(t=r.currentStage)||void 0===t?void 0:t.ctx.latestChangeFullscreenTargetId})},r.logger=e.logger,r.tracker=e.tracker,r.mode=e.mode,r.volumeAdjuster=e.volumeAdjuster,r.localStorage=new fb(r.logger),r.cachedExtract=new vb(r.localStorage),r.config={minFPS:nu()(i.minFPS)?30:i.minFPS,maxFPS:nu()(i.maxFPS)?40:i.maxFPS,resolution:nu()(i.resolution)?1:i.resolution,autoFPS:!nu()(i.autoFPS)&&i.autoFPS,autoResolution:!nu()(i.autoResolution)&&i.autoResolution,transactionBgColor:nu()(i.transactionBgColor)?0:i.transactionBgColor,maxResolutionLevel:r.getMaxResolution(i.maxResolutionLevel),forceCanvas:!nu()(i.forceCanvas)&&i.forceCanvas,enableNvidiaDetect:!nu()(i.enableNvidiaDetect)&&i.enableNvidiaDetect},r.updateMaxResolutionLevel(r.config.maxResolutionLevel),r.loader=new vv(r.localStorage,e.useLocalCache,r.logger,r.tracker,e.resourceTimeout,e.loadDelegate,e.urlInterrupter);var o=Ol.isWebGLSupported();r.app=new Ql({antialias:!0,autoDensity:!1,backgroundColor:16777215,forceCanvas:r.config.forceCanvas||!o}),r.tracker({name:"slidePlayerCreate",result:"",reason:"",payload:{webgl:o,resolution:r.config.resolution,minFPS:r.config.minFPS,maxFPS:r.config.maxFPS,maxResolutionLevel:r.config.maxResolutionLevel,forceCanvas:r.config.forceCanvas}}),r.updateConfig(r.config),r.app.ticker.maxFPS=60,r.app.ticker.minFPS=r.config.minFPS,r.app.ticker.maxFPS=r.config.maxFPS,r.app.view.style.zIndex="1",r.app.stage.sortableChildren=!0;var a=r.app.renderer;if(a.gl){var s=a.gl.drawElements,u=a.gl.getExtension("WEBGL_debug_renderer_info"),l=a.gl.getParameter(u.UNMASKED_RENDERER_WEBGL);/nvidia/i.test(l)&&r.config.enableNvidiaDetect&&(r.isNVIDIA=!0),a.gl.drawElements=function(){for(var e=arguments.length,t=new Array(e),n=0;n=t&&r.updateResolution(i)}}else if(e>r.config.maxFPS&&r.config.autoResolution){var o=r.scale*r.config.resolution,a=r.app.renderer.resolution,s=Math.min(o,a+.1);s<=r.config.resolution&&r.updateResolution(s)}})),r.app.ticker.add((function(){r.runtime.drawCall=r.drawCall,r.runtime.fps=Math.floor(r.app.ticker.minFPS),r.drawCall=0}),null,Bl.c.LOW),r.clock=new mv(r.app.ticker),r.objPoolGroup=uv(),r.stagePool=new hb(r.loader,r.mode,r.app.renderer,r.app.ticker,r.app.view,r.clock,r.objPoolGroup,r.errorChannel,r.localStorage,r.logger,e.loadDelegate,e.urlInterrupter,r.isPlayerPaused,r.maxResolution,r.volumeAdjuster,r.config.forceCanvas,r.globalEventHub),r.app.view.addEventListener("webglcontextlost",r.onWebGLLost);try{r.config.forceCanvas||(r.transactionPlayer=new Pl)}catch(s){/Error creating WebGL context/.test(s.message)?r.errorChannel.emit("error",new rv(Jp.CanvasCrash,"webgl context lost.")):r.errorChannel.emit("error",new rv(Jp.RuntimeWarn,s.message))}return r.globalEventHub.on("requestFullscreen",r.onRequestFullscreenVideo),r.globalEventHub.on("requestCancelFullscreen",r.onRequestCancelFullscreenVideo),r}return T(n,[{key:"getMaxResolution",value:function(e){return!nu()(e)&&Number.isInteger(e)?(e<1&&(e=1),e>4&&(e=4),e):n.platform.isAndroid()||n.platform.isIOS()?2:4}},{key:"updateMaxResolutionLevel",value:function(e){e<0&&(e=0),e>4&&(e=4);var t=[640,960,1280,1920,3200][e],n=[360,540,720,1080,1800][e];this.maxResolution.set(t,n)}},{key:"updateConfig",value:function(e){nu()(e.maxFPS)||nu()(e.minFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS,this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),nu()(e.resolution)||(this.config.resolution=e.resolution,this.updateResolution(this.scale*this.config.resolution)),nu()(e.autoFPS)||(this.config.autoFPS=e.autoFPS),nu()(e.autoResolution)||(this.config.autoResolution=e.autoResolution),nu()(e.transactionBgColor)||(this.config.transactionBgColor=e.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),nu()(e.maxResolutionLevel)||(this.config.maxResolutionLevel=e.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}},{key:"preload",value:function(e){return gb(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e<1||e>this.slideCount,t.t0){t.next=6;break}return this.logger.info("preload slide ".concat(e," begin"),this.taskId),t.next=5,this.stagePool.preload(e);case 5:this.logger.info("preload slide ".concat(e," end"),this.taskId);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"setResourceData",value:function(e,t){this.logger.info("ppt player init config: "+JSON.stringify(this.config),e),this.logger.info("set resource to "+t,e),this.taskId=e,this.url=t,this.stagePool.setResourceData(e,t),this.localStorage.attachTaskId(e),this.loader.attachTaskId(e)}},{key:"setInteractive",value:function(e){this.app.stage.interactive=e,this.app.stage.interactiveChildren=e}},{key:"translateEvent",value:function(e,t){var n=this;t.forEach((function(t){e.on(t,(function(){for(var e,r,i,o,a=arguments.length,s=new Array(a),u=0;u0&&this.view&&p&&(m=s.json.transition,!this.isForward&&(null==p?void 0:p.json.transition)&&(m=p.json.transition),g=this.getTransactionTexture(p,this.view,null,null),this.initTransactionPlayer(m),null===(n=this.transactionPlayer)||void 0===n||n.setPrevTexture(g),v=!0),this.app.stage.addChild(s.container),this.updateResolution(this.config.resolution*this.scale),p&&(p.clearOnTransactionEnd(),this.app.stage.removeChild(p.container)),!(s.json.transition&&s.json.transition.type&&this.app.stage.children.length>0&&this.view&&this.transactionPlayer&&v)){i.next=30;break}return i.next=23,this.getTransactionTexture(s,this.view,u,l);case 23:return y=i.sent,this.transactionPlayer.setNextTexture(y),i.next=27,this.transactionPlayer.play();case 27:if(b=this.transactionPlayer.renderer.domElement,this.view.parentElement&&b)try{this.view.parentElement.removeChild(b)}catch(e){}null===(r=this.transactionPlayer)||void 0===r||r.dispose();case 30:if(!this.isForward){i.next=35;break}return i.next=33,s.startTiming();case 33:i.next=36;break;case 35:s.setMainSeqApplied();case 36:s.ctx.slideScopeEventHub.emit("slide-render",s.ctx.slideIndex),this.emit(bb.renderEnd,e),this.emit(bb.slideChange,e),s.ctx.isRendering=!1,this.preload(e+1).catch((function(t){x.errorChannel.emit("error",rv.transform(t),e+1)})),this.preload(e-1).catch((function(t){x.errorChannel.emit("error",rv.transform(t),e-1)})),this.logger.info("render slide ".concat(e," done, time: ").concat(Date.now()-a,"ms"),this.taskId),this.tracker({name:"slidePageChange",reason:"",result:"",payload:{duration:Date.now()-a,from:o,to:e}});case 44:case"end":return i.stop()}}),i,this)})))}},{key:"getTransactionTexture",value:function(e,t,n,r){var i=Xl.p.create({width:e.json.width,height:e.json.height,resolution:1});this.app.renderer.render(e.container,{renderTexture:i});var o=this.cachedExtract.canvas(i,this.app.renderer,r,n);return new G(o)}},{key:"renderToBase64",value:function(e,t,n){return gb(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.stagePool.getStage(e);case 2:if(!(i=r.sent)){r.next=10;break}return o=i.json,a=o.width,s=o.height,this.designWidth=a,this.designHeight=s,u=Xl.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),i.container.visible=!0,this.app.renderer.render(i.container,{renderTexture:u}),l=this.app.renderer.plugins.extract.base64(u,n),r.abrupt("return",(this.stagePool.destroyStageByIndex(e),l));case 10:return r.abrupt("return","__null__");case 11:case"end":return r.stop()}}),r,this)})))}},{key:"renderMainSeqToBase64",value:function(e,t,n){return gb(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,l,c,h,d,f;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=[],r.next=3,this.stagePool.getStage(e);case 3:if((o=r.sent).createTiming(),o)for(a=o.json,s=a.width,u=a.height,this.designWidth=s,this.designHeight=u,l=Xl.p.create({width:this.designWidth,height:this.designHeight,resolution:t}),o.container.visible=!0,c=o.mainSeqLength(),o.setMainSeqStep(0,"start"),this.app.renderer.render(o.container,{renderTexture:l}),h=this.app.renderer.plugins.extract.base64(l,n),i.push(h),d=0;dn.maxResolution.x||r*n.designHeight>n.maxResolution.y;)r-=.1;n.app.renderer.resolution=r,n.app.renderer.plugins.interaction.resolution=n.app.renderer.resolution,n.app.renderer.resize(n.designWidth,n.designHeight),eu()(t)&&t()}))}},{key:"nextStep",value:function(e,t){var n;if(this._isPaused)this.logger.info("ppt play prevent next step with paused state",this.taskId);else{this.logger.info("ppt play trigger next step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(n=this.currentStage)||void 0===n||n.nextStep(e,t)}catch(e){this.errorChannel.emit("error",rv.transform(e),this.currentIndex)}}}},{key:"prevStep",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._isPaused)this.logger.info("ppt play prevent prev step with paused state",this.taskId);else{this.logger.info("ppt play trigger prev step",this.taskId);try{this.onRequestCancelFullscreenVideo(!0),null===(e=this.currentStage)||void 0===e||e.prevStep(t)}catch(e){this.errorChannel.emit("error",rv.transform(e),this.currentIndex)}}}},{key:"mainSeqLength",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqLength())&&void 0!==t?t:0}},{key:"mainSeqStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqStep())&&void 0!==t?t:0}},{key:"setMainSeqStep",value:function(e,t){var n;null===(n=this.currentStage)||void 0===n||n.setMainSeqStep(e,t)}},{key:"mainSeqState",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqState())&&void 0!==t?t:null}},{key:"mainSeqHasNextStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasNextStep())&&void 0!==t&&t}},{key:"mainSeqHasPrevStep",value:function(){var e,t;return null!==(t=null===(e=this.currentStage)||void 0===e?void 0:e.mainSeqHasPrevStep())&&void 0!==t&&t}},{key:"nextTick",value:function(e){this.app.ticker.addOnce((function(){e()}),Bl.c.LOW)}},{key:"applyInteractiveAction",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.applyInteractiveAction(e)}},{key:"seekInteractiveSeqToEnd",value:function(e){var t;null===(t=this.currentStage)||void 0===t||t.seekInteractiveSeqToEnd(e)}},{key:"setInteractiveSeqState",value:function(e,t,n){var r;null===(r=this.currentStage)||void 0===r||r.setInteractiveSeqState(e,t,n)}},{key:"setMediaState",value:function(e,t,n){var r;return gb(this,void 0,void 0,regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=this.currentStage)||void 0===r?void 0:r.setMediaState(e,t,n);case 2:case"end":return i.stop()}}),i,this)})))}},{key:"setMediaCurrentTime",value:function(e,t){var n;null===(n=this.currentStage)||void 0===n||n.setMediaCurrentTime(e,t)}},{key:"pause",value:function(){var e;this.app.ticker.stop(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalPause()})),this._isPaused=!0}},{key:"resume",value:function(){var e;this._isPaused=!1,this.app.ticker.start(),null===(e=this.currentStage)||void 0===e||e.ctx.activeMedia.forEach((function(e){e.globalResume()}))}},{key:"getSnapshot",value:function(){return this.currentStage&&this.getBase64(this.currentStage)||""}},{key:"clearLocalCache",value:function(){this.localStorage.dispose()}},{key:"clearFullscreenEventListenersWithAppView",value:function(){var e=this;["mousemove","mouseout","mouseover","touchstart","pointerdown"].forEach((function(t){e.cacheFunctionMap.has(t)&&(e.app.view.removeEventListener(t,e.cacheFunctionMap.get(t),!1),e.cacheFunctionMap.delete(t))}))}},{key:"syncFullscreenVideoState",value:function(e){this.globalEventHub.emit("syncFullscreenVideoState",e)}},{key:"destroy",value:function(){var e,t;try{this.app.view.removeEventListener("webglcontextlost",this.onWebGLLost),this.app.renderer.filter.texturePool.clear(!0),Av.collectObjectByGroup(this.objPoolGroup),Iv.collectObjectByGroup(this.objPoolGroup),null===(e=this.transactionPlayer)||void 0===e||e.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy(),this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext(),this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0}),null===(t=lb.worker)||void 0===t||t.terminate(),this.tracker({name:"slidePlayerDestroy",result:"",reason:"",payload:{}})}catch(e){}}},{key:"view",get:function(){return this.app.renderer?this.app.view:null}},{key:"nextSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.nextIndex)?this.currentStage.json.nextIndex:this.currentIndex+1}},{key:"prevSlideIndex",get:function(){var e;return(null===(e=this.currentStage)||void 0===e?void 0:e.json.prevIndex)?this.currentStage.json.prevIndex:this.currentIndex-1}}],[{key:"clearLocalCache",value:function(){var e;null===(e=fb.localCache)||void 0===e||e.clear().catch((function(){}))}}]),n}(Ks.a);xb.platform=Pg,xb.RtcAudioClazz=null;var _b,wb=new Map,Tb=n(136),Mb=n.n(Tb),Sb=n(49),Eb=n.n(Sb),Ab=n(50),Ib=n.n(Ab),Cb=[],Nb="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(_b||(_b={}));var kb,Db=function(e){return Object.freeze(e)},Pb=function(e,t){this.inlineSize=e,this.blockSize=t,Db(this)},Ob=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Db(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Rb=function(e){return e instanceof SVGElement&&"getBBox"in e},Lb=function(e){if(Rb(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},jb=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Bb="undefined"!=typeof window?window:{},Ub=new WeakMap,zb=/auto|scroll/,Fb=/^tb|vertical/,Gb=/msie|trident/i.test(Bb.navigator&&Bb.navigator.userAgent),Hb=function(e){return parseFloat(e||"0")},Vb=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Pb((n?t:e)||0,(n?e:t)||0)},Wb=Db({devicePixelContentBoxSize:Vb(),borderBoxSize:Vb(),contentBoxSize:Vb(),contentRect:new Ob(0,0,0,0)}),Yb=function(e,t){if(void 0===t&&(t=!1),Ub.has(e)&&!t)return Ub.get(e);if(Lb(e))return Ub.set(e,Wb),Wb;var n=getComputedStyle(e),r=Rb(e)&&e.ownerSVGElement&&e.getBBox(),i=!Gb&&"border-box"===n.boxSizing,o=Fb.test(n.writingMode||""),a=!r&&zb.test(n.overflowY||""),s=!r&&zb.test(n.overflowX||""),u=r?0:Hb(n.paddingTop),l=r?0:Hb(n.paddingRight),c=r?0:Hb(n.paddingBottom),h=r?0:Hb(n.paddingLeft),d=r?0:Hb(n.borderTopWidth),f=r?0:Hb(n.borderRightWidth),p=r?0:Hb(n.borderBottomWidth),v=h+l,m=u+c,g=(r?0:Hb(n.borderLeftWidth))+f,y=d+p,b=s?e.offsetHeight-y-e.clientHeight:0,x=a?e.offsetWidth-g-e.clientWidth:0,_=i?v+g:0,w=i?m+y:0,T=r?r.width:Hb(n.width)-_-x,M=r?r.height:Hb(n.height)-w-b,S=T+v+x+g,E=M+m+b+y,A=Db({devicePixelContentBoxSize:Vb(Math.round(T*devicePixelRatio),Math.round(M*devicePixelRatio),o),borderBoxSize:Vb(S,E,o),contentBoxSize:Vb(T,M,o),contentRect:new Ob(h,u,T,M)});return Ub.set(e,A),A},Xb=function(e,t,n){var r=Yb(e,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case _b.DEVICE_PIXEL_CONTENT_BOX:return a;case _b.BORDER_BOX:return i;default:return o}},Qb=function(e){var t=Yb(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Db([t.borderBoxSize]),this.contentBoxSize=Db([t.contentBoxSize]),this.devicePixelContentBoxSize=Db([t.devicePixelContentBoxSize])},Zb=function(e){if(Lb(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},qb=function(){var e=1/0,t=[];Cb.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Qb(t.target),i=Zb(t.target);r.push(n),t.lastReportedSize=Xb(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Kb=[],$b=0,ex={attributes:!0,characterData:!0,childList:!0,subtree:!0},tx=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],nx=function(e){return void 0===e&&(e=0),Date.now()+e},rx=!1,ix=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!rx){rx=!0;var n,r=nx(e);n=function(){var n=!1;try{n=function(){var e,t=0;for(Jb(t);Cb.some((function(e){return e.activeTargets.length>0}));)t=qb(),Jb(t);return Cb.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Nb}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Nb),window.dispatchEvent(e)),t>0}()}finally{if(rx=!1,e=r-nx(),!$b)return;n?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!kb){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Kb.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),kb=function(){n.textContent="".concat(t?t--:t++)}}Kb.push(e),kb()}((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,ex)};document.body?t():Bb.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),tx.forEach((function(t){return Bb.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),tx.forEach((function(t){return Bb.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ox=function(e){!$b&&e>0&&ix.start(),!($b+=e)&&ix.stop()},ax=function(){function e(e,t){this.target=e,this.observedBox=t||_b.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=Xb(this.target,this.observedBox,!0);return e=this.target,Rb(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),sx=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ux=new WeakMap,lx=function(e,t){for(var n=0;n=0&&(i&&Cb.splice(Cb.indexOf(n),1),n.observationTargets.splice(r,1),ox(-1))},e.disconnect=function(e){var t=this,n=ux.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),hx=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");cx.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!jb(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");cx.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!jb(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");cx.unobserve(this,e)},e.prototype.disconnect=function(){cx.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),dx=function(){function e(e,t,n,r,i){this.state="idle",this.index=-1,this.slideIndex=-1,this.fn=n,this.index=e,this.slideIndex=t,this.eventHub=r,this.id=i}return e.prototype.apply=function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var e;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(null===(n=e.tasks[i])||void 0===n||n.apply()),r>=0&&(e.tasks.splice(r,1),e.replaceIdleTask()),e.eventHub.emit("task-end-"+t.id)})),this.eventHub.on("task-error",(function(t){var n=t.task,r=e.tasks.findIndex((function(e){return e.index===n.index}));r>=0&&(e.tasks.splice(r,1),e.replaceIdleTask())}))}return e.prototype.replaceIdleTask=function(){for(var e,t=this,n=new Set,r=0,i=this.tasks.length;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(vx&&e.forEach&&e.forEach===vx)e.forEach(t,n);else if(e.length===e.length+0){var r,i=void 0;for(i=0,r=e.length;i1?gx.toArray(arguments):arguments[0];return gx.each(yx,(function(t){if(t.litmus(e))return gx.each(t.conversions,(function(t,n){if(bx=t.read(e),!1===xx&&!1!==bx)return xx=bx,bx.conversionName=n,bx.conversion=t,gx.BREAK})),gx.BREAK})),xx},wx=void 0,Tx={hsv_to_rgb:function(e,t,n){var r=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),o=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),u=[[n,s,o],[a,n,o],[o,n,s],[o,a,n],[s,o,n],[n,o,a]][r];return{r:255*u[0],g:255*u[1],b:255*u[2]}},rgb_to_hsv:function(e,t,n){var r=Math.min(e,t,n),i=Math.max(e,t,n),o=i-r,a=void 0;return 0===i?{h:NaN,s:0,v:0}:(a=e===i?(t-n)/o:t===i?2+(n-e)/o:4+(e-t)/o,(a/=6)<0&&(a+=1),{h:360*a,s:o/i,v:i/255})},rgb_to_hex:function(e,t,n){var r=this.hex_with_component(0,2,e);return r=this.hex_with_component(r,1,t),this.hex_with_component(r,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(wx=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var Gx=function(e){function t(e,n,r){Sx(this,t);var i=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),o=r||{};return i.__min=o.min,i.__max=o.max,i.__step=o.step,gx.isUndefined(i.__step)?0===i.initialValue?i.__impliedStep=1:i.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(i.initialValue))/Math.LN10))/10:i.__impliedStep=i.__step,i.__precision=Fx(i.__impliedStep),i}return Ix(t,e),Ex(t,[{key:"setValue",value:function(e){var n=e;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),Ax(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=Fx(e),this}}]),t}(Px),Hx=function(e){function t(e,n,r){Sx(this,t);var i=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));i.__truncationSuspended=!1;var o=i,a=void 0;function s(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){var t=a-e.clientY;o.setValue(o.getValue()+t*o.__impliedStep),a=e.clientY}function l(){jx.unbind(window,"mousemove",u),jx.unbind(window,"mouseup",l),s()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),jx.bind(i.__input,"change",(function(){var e=parseFloat(o.__input.value);gx.isNaN(e)||o.setValue(e)})),jx.bind(i.__input,"blur",(function(){s()})),jx.bind(i.__input,"mousedown",(function(e){jx.bind(window,"mousemove",u),jx.bind(window,"mouseup",l),a=e.clientY})),jx.bind(i.__input,"keydown",(function(e){13===e.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,s())})),i.updateDisplay(),i.domElement.appendChild(i.__input),i}return Ix(t,e),Ex(t,[{key:"updateDisplay",value:function(){var e,n,r;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),n=this.__precision,r=Math.pow(10,n),Math.round(e*r)/r),Ax(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Gx);function Vx(e,t,n,r,i){return r+(e-t)/(n-t)*(i-r)}var Wx=function(e){function t(e,n,r,i,o){Sx(this,t);var a=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,{min:r,max:i,step:o})),s=a;function u(e){e.preventDefault();var t=s.__background.getBoundingClientRect();return s.setValue(Vx(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function l(){jx.unbind(window,"mousemove",u),jx.unbind(window,"mouseup",l),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function c(e){var t=e.touches[0].clientX,n=s.__background.getBoundingClientRect();s.setValue(Vx(t,n.left,n.right,s.__min,s.__max))}function h(){jx.unbind(window,"touchmove",c),jx.unbind(window,"touchend",h),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),jx.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),jx.bind(window,"mousemove",u),jx.bind(window,"mouseup",l),u(e)})),jx.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(jx.bind(window,"touchmove",c),jx.bind(window,"touchend",h),c(e))})),jx.addClass(a.__background,"slider"),jx.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return Ix(t,e),Ex(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Ax(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Gx),Yx=function(e){function t(e,n,r){Sx(this,t);var i=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),o=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===r?"Fire":r,jx.bind(i.__button,"click",(function(e){return e.preventDefault(),o.fire(),!1})),jx.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return Ix(t,e),Ex(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(Px),Xx=function(e){function t(e,n){Sx(this,t);var r=Cx(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));r.__color=new Nx(r.getValue()),r.__temp=new Nx(0);var i=r;r.domElement=document.createElement("div"),jx.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",jx.bind(r.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),jx.bind(r.__input,"blur",h),jx.bind(r.__selector,"mousedown",(function(){jx.addClass(this,"drag").bind(window,"mouseup",(function(){jx.removeClass(i.__selector,"drag")}))})),jx.bind(r.__selector,"touchstart",(function(){jx.addClass(this,"drag").bind(window,"touchend",(function(){jx.removeClass(i.__selector,"drag")}))}));var o,a=document.createElement("div");function s(e){f(e),jx.bind(window,"mousemove",f),jx.bind(window,"touchmove",f),jx.bind(window,"mouseup",l),jx.bind(window,"touchend",l)}function u(e){p(e),jx.bind(window,"mousemove",p),jx.bind(window,"touchmove",p),jx.bind(window,"mouseup",c),jx.bind(window,"touchend",c)}function l(){jx.unbind(window,"mousemove",f),jx.unbind(window,"touchmove",f),jx.unbind(window,"mouseup",l),jx.unbind(window,"touchend",l),d()}function c(){jx.unbind(window,"mousemove",p),jx.unbind(window,"touchmove",p),jx.unbind(window,"mouseup",c),jx.unbind(window,"touchend",c),d()}function h(){var e=_x(this.value);!1!==e?(i.__color.__state=e,i.setValue(i.__color.toOriginal())):this.value=i.__color.toString()}function d(){i.__onFinishChange&&i.__onFinishChange.call(i,i.__color.toOriginal())}function f(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__saturation_field.getBoundingClientRect(),n=e.touches&&e.touches[0]||e,r=n.clientX,o=n.clientY,a=(r-t.left)/(t.right-t.left),s=1-(o-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),i.__color.v=s,i.__color.s=a,i.setValue(i.__color.toOriginal()),!1}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=i.__hue_field.getBoundingClientRect(),n=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),i.__color.h=360*n,i.setValue(i.__color.toOriginal()),!1}return gx.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),gx.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),gx.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),gx.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),gx.extend(a.style,{width:"100%",height:"100%",background:"none"}),Zx(a,"top","rgba(0,0,0,0)","#000"),gx.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=r.__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%);",gx.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),jx.bind(r.__saturation_field,"mousedown",s),jx.bind(r.__saturation_field,"touchstart",s),jx.bind(r.__field_knob,"mousedown",s),jx.bind(r.__field_knob,"touchstart",s),jx.bind(r.__hue_field,"mousedown",u),jx.bind(r.__hue_field,"touchstart",u),r.__saturation_field.appendChild(a),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return Ix(t,e),Ex(t,[{key:"updateDisplay",value:function(){var e=_x(this.getValue());if(!1!==e){var t=!1;gx.each(Nx.COMPONENTS,(function(n){if(!gx.isUndefined(e[n])&&!gx.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&gx.extend(this.__color.__state,e)}gx.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,r=255-n;gx.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,Zx(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),gx.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),t}(Px),Qx=["-moz-","-o-","-webkit-","-ms-",""];function Zx(e,t,n,r){e.style.background="",gx.each(Qx,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+r+" 100%); "}))}var qx='
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
',Jx=function(e,t){var n=e[t];return gx.isArray(arguments[2])||gx.isObject(arguments[2])?new Ux(e,t,arguments[2]):gx.isNumber(n)?gx.isNumber(arguments[2])&&gx.isNumber(arguments[3])?gx.isNumber(arguments[4])?new Wx(e,t,arguments[2],arguments[3],arguments[4]):new Wx(e,t,arguments[2],arguments[3]):gx.isNumber(arguments[4])?new Hx(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Hx(e,t,{min:arguments[2],max:arguments[3]}):gx.isString(n)?new zx(e,t):gx.isFunction(n)?new Yx(e,t,""):gx.isBoolean(n)?new Bx(e,t):null},Kx=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},$x=function(){function e(){Sx(this,e),this.backgroundElement=document.createElement("div"),gx.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"}),jx.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),gx.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 t=this;jx.bind(this.backgroundElement,"click",(function(){t.hide()}))}return Ex(e,[{key:"show",value:function(){var e=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(),gx.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",jx.unbind(e.domElement,"webkitTransitionEnd",t),jx.unbind(e.domElement,"transitionend",t),jx.unbind(e.domElement,"oTransitionEnd",t)};jx.bind(this.domElement,"webkitTransitionEnd",t),jx.bind(this.domElement,"transitionend",t),jx.bind(this.domElement,"oTransitionEnd",t),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-jx.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-jx.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var n=t||document,r=document.createElement("style");r.type="text/css",r.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(r)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".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 .cr.function .property-name{width:100%}.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 e_=function(){try{return!!window.localStorage}catch(e){return!1}}(),t_=void 0,n_=!0,r_=void 0,i_=!1,o_=[],a_=function e(t){var n=this,r=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),jx.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=gx.defaults(r,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),r=gx.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),gx.isUndefined(r.load)?r.load={preset:"Default"}:r.preset&&(r.load.preset=r.preset),gx.isUndefined(r.parent)&&r.hideable&&o_.push(this),r.resizable=gx.isUndefined(r.parent)&&r.resizable,r.autoPlace&&gx.isUndefined(r.scrollable)&&(r.scrollable=!0);var i,o=e_&&"true"===localStorage.getItem(d_(this,"isLocal")),a=void 0,s=void 0;if(Object.defineProperties(this,{parent:{get:function(){return r.parent}},scrollable:{get:function(){return r.scrollable}},autoPlace:{get:function(){return r.autoPlace}},closeOnTop:{get:function(){return r.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:r.load.preset},set:function(e){n.parent?n.getRoot().preset=e:r.load.preset=e,function(e){for(var t=0;t1){var r=n.__li.nextElementSibling;return n.remove(),h_(e,n.object,n.property,{before:r,factoryArgs:[gx.toArray(arguments)]})}if(gx.isArray(t)||gx.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),h_(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof Wx){var r=new Hx(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});gx.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=n[e],i=r[e];n[e]=r[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(r,e),t.apply(n,e)}})),jx.addClass(t,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof Hx){var i=function(t){if(gx.isNumber(n.__min)&&gx.isNumber(n.__max)){var r=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var o=h_(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return o.name(r),i&&o.listen(),o}return t};n.min=gx.compose(i,n.min),n.max=gx.compose(i,n.max)}else n instanceof Bx?(jx.bind(t,"click",(function(){jx.fakeEvent(n.__checkbox,"click")})),jx.bind(n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof Yx?(jx.bind(t,"click",(function(){jx.fakeEvent(n.__button,"click")})),jx.bind(t,"mouseover",(function(){jx.addClass(n.__button,"hover")})),jx.bind(t,"mouseout",(function(){jx.removeClass(n.__button,"hover")}))):n instanceof Xx&&(jx.addClass(t,"color"),n.updateDisplay=gx.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=gx.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&l_(e.getRoot(),!0),t}),n.setValue)}(e,u,i),e.__controllers.push(i),i}function d_(e,t){return document.location.href+"."+t}function f_(e,t,n){var r=document.createElement("option");r.innerHTML=t,r.value=t,e.__preset_select.appendChild(r),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function p_(e,t){t.style.display=e.useLocalStorage?"block":"none"}function v_(e){var t=e.__save_row=document.createElement("li");jx.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),jx.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",jx.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",jx.addClass(r,"button"),jx.addClass(r,"save");var i=document.createElement("span");i.innerHTML="New",jx.addClass(i,"button"),jx.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",jx.addClass(o,"button"),jx.addClass(o,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?gx.each(e.load.remembered,(function(t,n){f_(e,n,n===e.preset)})):f_(e,"Default",!1),jx.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=g_(this)),e.folders={},gx.each(this.__folders,(function(t,n){e.folders[n]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=g_(this),l_(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=g_(this,!0)),this.load.remembered[e]=g_(this),this.preset=e,f_(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){gx.each(this.__controllers,(function(t){this.getRoot().load.remembered?c_(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),gx.each(this.__folders,(function(e){e.revert(e)})),e||l_(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&Kx.call(window,(function(){e(t)})),gx.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){gx.each(this.__controllers,(function(e){e.updateDisplay()})),gx.each(this.__folders,(function(e){e.updateDisplay()}))}});var y_=a_,b_=function(){function e(e){this.player=e}return Object.defineProperty(e.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(e){this.player.updateConfig({resolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var e,t;return(null===(e=this.player.view)||void 0===e?void 0:e.width)+"*"+(null===(t=this.player.view)||void 0===t?void 0:t.height)},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(e){this.player.updateConfig({minFPS:e,maxFPS:this.player.config.maxFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(e){this.player.updateConfig({maxFPS:e,minFPS:this.player.config.minFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(e){this.player.updateConfig({autoResolution:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(e){this.player.updateConfig({autoFPS:e})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(e){this.player.updateConfig({transactionBgColor:e})},enumerable:!1,configurable:!0}),e}(),x_=function(){function e(e,t){var n;this.config=new b_(e),this.anchor=t,n=this.createControllerGUI(),this.gui=n[0],this.controller=n[1],this.createStats()}return e.prototype.createStats=function(){var e=this;this.stateId=setInterval((function(){e.controller.frameRate.updateDisplay(),e.controller.size.updateDisplay(),e.controller.minFPS.updateDisplay(),e.controller.drawFrames.updateDisplay(),e.controller.maxFPS.updateDisplay(),e.controller.resolution.updateDisplay(),e.controller.autoFps.updateDisplay(),e.controller.autoResolution.updateDisplay(),e.controller.drawCall.updateDisplay()}),16)},e.prototype.createControllerGUI=function(){var e=new y_({autoPlace:!0,closed:!0});e.domElement.style.opacity=".6",e.domElement.style.transformOrigin="100% 0",e.domElement.style.transform="scale(1)",this.anchor.appendChild(e.domElement),e.domElement.style.position="absolute",e.domElement.style.right="0",e.domElement.style.top="0",e.domElement.style.zIndex="2";var t={frameRate:e.add(this.config,"frameRate"),drawFrames:e.add(this.config,"drawFrames"),drawCall:e.add(this.config,"drawCall"),size:e.add(this.config,"size"),minFPS:e.add(this.config,"minFPS",0,60),maxFPS:e.add(this.config,"maxFPS",0,60),resolution:e.add(this.config,"resolution",.5,8,.5),autoResolution:e.add(this.config,"autoResolution"),autoFps:e.add(this.config,"autoFPS"),transactionBgColor:e.addColor(this.config,"backgroundColor")};return[e,t]},e.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch(e){}},e}(),__=function(){function e(e){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&t.fn(e).then((function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))},this.fn=e}return e.prototype.destroy=function(){this.isDestroy=!0},e.prototype.addTask=function(e){this.tasks.push(e),this.isScheduling||this.schedule()},e}(),w_=function(){function e(e){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=e}return e.prototype.addLock=function(e,t){var n=this;this.available&&(this.locks[e]=t,this.autoUnlock[e]=window.setTimeout((function(){delete n.locks[e]}),3e3))},e.prototype.unlock=function(e,t){this.available&&t&&this.locks[e]&&this.locks[e]===t&&(window.clearTimeout(this.autoUnlock[e]),delete this.locks[e])},e.prototype.isLocked=function(e){return!!this.available&&!!this.locks[e]},e}(),T_=function(){function e(){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var t=e.tasks.shift();t&&!e.isDestroy&&(t.status="running",t.fn.apply(null).then((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})).catch((function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})))}}return e.prototype.getRunningTask=function(){return this.tasks[0]&&"running"===this.tasks[0].status?this.tasks[0]:null},e.prototype.addTask=function(e,t){var n={type:e,status:"wait",fn:t},r=this.getRunningTask();r&&e===r.type||(this.tasks=this.tasks.filter((function(t){return t.type!==e})),this.tasks.push(n),this.isScheduling||this.schedule())},e.prototype.destroy=function(){this.isDestroy=!0},e}(),M_=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},S_=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.config.buffer||e))return[2];t=this.logList.splice(0),n=function(){i.logList=t.concat(i.logList),i.retryTimes>3&&i.pause(),i.retryTimes+=1},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch("https://netless-ppt-plugin-dev.cn-hangzhou.log.aliyuncs.com/logstores/netless-ppt-plugin-dev/track",{method:"POST",headers:{"x-log-apiversion":"0.6.0","Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({__topic__:"netless-ppt-plugin-dev",__source__:"netless-ppt-plugin-dev",__logs__:t})})];case 2:return o.sent().ok?this.retryTimes=0:n(),[3,4];case 3:return r=o.sent(),console.warn(r),n(),[3,4];case 4:return[2]}}))}))},e.prototype.setEnable=function(e){this.enable!==e&&(e?this.start():this.pause())},e}();function A_(e,t,n){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var r,i,o,a;return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]500&&r.enableGlobalClick&&r.nextStep()}))},r.handleViewTouchStart=function(){window.clearTimeout(r.touchStartId),r.isTouchStart=!0,r.touchStartId=setTimeout((function(){r.isTouchStart=!1}),350)},r.handleViewTouchEnd=function(){r.isTouchStart&&(r.isTouchStart=!1,r.handleViewClick())},r.handleSlideRef=function(){console.log(r),window.__slide=r},r.receiveSyncHandler=function(e){return k_(r,void 0,void 0,(function(){var t,n,r,i,o,a=this;return D_(this,(function(s){switch(s.label){case 0:return Tv()(e.incrId)&&(e.incrId&&e.incrId-this._receiveIncrId!=1&&this.emit(L_.syncEventLag),this._receiveIncrId=e.incrId||0),this.logger.info("sync receive "+JSON.stringify(e),this.taskId),"nextStep"!==e.type?[3,1]:(this.mainSeqStep!==e.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(e.next,"start"),this.player.nextTick((function(){a.doNextStep(!0,e.clientId||"")}))):this.doNextStep(!0,e.clientId||""),[3,6]);case 1:return"prevStep"!==e.type?[3,2]:(0===this.mainSeqStep&&"idle"===this.mainSeqState||this.mainSeqStep===e.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(e.next+1,"start"),null===(t=this.player)||void 0===t||t.nextTick((function(){a.doPrevStep(!0)}))),[3,6]);case 2:return"interactiveAnim"!==e.type?[3,3]:(this.player?this.player.applyInteractiveAction(e.action):this.__slideState.interactiveSeqState[e.seqId]?this.__slideState.interactiveSeqState[e.seqId].step+=1:this.__slideState.interactiveSeqState[e.seqId]={step:0,state:"end"},[3,6]);case 3:return"renderSlide"!==e.type?[3,5]:[4,this.doRenderSlide(e.index,e.isForward)];case 4:return s.sent(),[3,6];case 5:"mediaPlay"===e.type?(null===(n=this.player)||void 0===n||n.setMediaState(e.id,!0),this.__slideState.mediaState[e.id]=e.state):"mediaPause"===e.type?(null===(r=this.player)||void 0===r||r.setMediaState(e.id,!1),this.__slideState.mediaState[e.id]=e.state):"mediaSeek"===e.type?(null===(i=this.player)||void 0===i||i.setMediaCurrentTime(e.id,e.time),this.__slideState.mediaState[e.id]=e.state):"mediaFullscreen"===e.type&&(e.targetId&&this.__slideState.mediaState[e.targetId]?this.__slideState.mediaState[e.targetId].fullscreen=e.state:this.__slideState.mediaState[e.targetId]={fullscreen:e.state,type:"pause",time:0},null===(o=this.player)||void 0===o||o.syncFullscreenVideoState({targetId:e.targetId,state:e.state,slideIndex:e.slideIndex})),s.label=6;case 6:return[2]}}))}))},r.handlePrevSlide=function(e){return void 0===e&&(e=!1),k_(r,void 0,void 0,(function(){var t,n;return D_(this,(function(r){return this.player?((t=this.player.prevSlideIndex)>=1&&((null===(n=this.config.navigatorDelegate)||void 0===n?void 0:n.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!1):this.renderSlide(t,!1)),[2]):[2]}))}))},r.handleNextSlide=function(e){return void 0===e&&(e=!1),k_(r,void 0,void 0,(function(){var t,n;return D_(this,(function(r){return this.player?((t=this.player.nextSlideIndex)<=this.slideCount&&((null===(n=this.config.navigatorDelegate)||void 0===n?void 0:n.gotoPage)?this.config.navigatorDelegate.gotoPage(t):e?this.doRenderSlide(t,!0):this.renderSlide(t,!0)),[2]):[2]}))}))},r.handleGotoSlide=function(e){if(e<=r.slideCount&&e>=1){var t=r.slideState.currentSlideIndex<=e;r.renderSlide(e,t)}else-1===e&&r.renderSlide(r.slideCount,!0)},t.instances.push(r),r.config=r.initSlideConfig(n),r.tracker=function(e){n.whiteTracker&&n.whiteTracker.commit({name:e.name,reason:e.reason,result:e.result,payload:N_(N_({},e.payload),{slideId:r.randomId,taskId:r.taskId})},{slideVersion:r.version||""})},t.trackLogger.setEnable(!!r.config.enableTracking),r.logger={info:function(e,n){var i;t.appendLogString("INFO - "+(new Date).toISOString()+" - {"+r.randomId+"}["+n+"] "+e+"\n"),t.trackLogger.addLog(e,"info",n,r.randomId);var o=null===(i=r.config.logger)||void 0===i?void 0:i.info;o&&o("["+n+"] "+e)},warn:function(e,n){var i;t.appendLogString("WARN - "+(new Date).toISOString()+" - {"+r.randomId+"}["+n+"] "+e+"\n"),t.trackLogger.addLog(e,"warn",n,r.randomId);var o=null===(i=r.config.logger)||void 0===i?void 0:i.warn;o&&o("["+n+"] "+e)},error:function(e,n){var i;t.appendLogString("ERROR - "+(new Date).toISOString()+" - {"+r.randomId+"}["+n+"] "+e+"\n"),t.trackLogger.addLog(e,"error",n,r.randomId);var o=null===(i=r.config.logger)||void 0===i?void 0:i.error;o&&o("["+n+"] "+e)}},r.logger.info("new slide with clientId: "+r.config.clientId+", version: "+r.version,r.taskId),r.tracker({name:"initSlide",result:"",reason:"",payload:{taskId:r.taskId}}),r.anchor=r.config.anchor,r.syncQueue=new __(r.receiveSyncHandler),r.lock=new w_("interactive"===r.mode),r.cacheImage.style.position="absolute",r.cacheImage.style.zIndex="100",r.setMedianControllerAttribute(),r.canvasContainer.style.position="relative",r.canvasContainer.style.fontSize="0",r.canvasContainer.appendChild(r.medianController),r.frame.appendChild(r.canvasContainer),r.frameResizeObserver.observe(r.frame),r.on(L_.syncReceive,(function(e){r.lock.unlock(e.type,e.uuid),r.syncQueue.addTask(e)})),r.renderingTaskManager.eventHub.on("task-error",(function(e){var t=e.error,n=e.task,i=rv.transform(t);i.errorType===Jp.RuntimeWarn?r.logger.warn(i.message,r.taskId):r.logger.error(i.message,r.taskId),r.isLoading=!1,r.reportError(i,n.slideIndex)})),window.addEventListener("__slide_ref__",r.handleSlideRef),r.resizeView=Eb()(r.resizeView.bind(r),50),r.player=r.initPlayer(r.config),r.config.controller&&r.createController(),r.player.view&&r.canvasContainer.appendChild(r.player.view),r.handleViewClick=Eb()(r.handleViewClick,300),r.player.errorChannel.on("error",(function(e,t){var n=rv.transform(e);n.errorType===Jp.RuntimeWarn?r.logger.warn(n.message,r.taskId):r.logger.error(n.message,r.taskId),r.isLoading=!1,r.reportError(e,t),r.tracker({name:"slideError",reason:n.errorMsg,result:"",payload:{code:n.errorType}})})),window.addEventListener("message",r.recoverHandler),t.volumeAdjuster.on("update",r._updateVolumeByStaticAdjuster),r.volumeAdjuster.volume=t.volumeAdjuster.volume,r}var n,r;return C_(t,e),t.flushLog=function(e){return void 0===e&&(e=!1),k_(this,void 0,void 0,(function(){return D_(this,(function(n){switch(n.label){case 0:if(!(t._tempLog.length>131072||e&&t._tempLog.length>0))return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,null==U_?void 0:U_.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)];case 2:case 3:return n.sent(),[3,4];case 4:t._tempLog="",t._tempLogIndex+=1,n.label=5;case 5:return[2]}}))}))},t.stopRemoteLog=function(){t.remoteLogAddress=null},t.startRemoteLog=function(e){return k_(this,void 0,void 0,(function(){var n,r,i,o,a;return D_(this,(function(s){switch(s.label){case 0:return t.remoteLogAddress=e,[4,t.flushLog(!0)];case 1:if(s.sent(),!U_)return[3,13];n=[],s.label=2;case 2:return s.trys.push([2,4,,5]),[4,U_.keys()];case 3:return n=(s.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return s.sent(),[3,5];case 5:r=0,i=n,s.label=6;case 6:if(!(r0&&o>0){var a=this.frameWidth/i,s=a*o;s>this.frameHeight&&(a*=this.frameHeight/s),null===(t=this.player)||void 0===t||t.scaleView(a,this.resize,e),this.cacheImage.style.transform="scale("+a+")",this.medianController.style.transform="scale("+a+")",this.medianController.setAttribute("data-scale",a.toString()),this.isInitResized||(this.isInitResized=!0,null===(n=this.player)||void 0===n||n.clock.setTimeout((function(){r.frame.style.visibility="visible"}),32))}},t.prototype.setSlideState=function(e){var t,n,r;return k_(this,void 0,void 0,(function(){var i,o=this;return D_(this,(function(a){switch(a.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(e),this.taskId),e.taskId&&e.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=e.taskId,null===(t=this.player)||void 0===t||t.setResourceData(e.taskId,this.__slideState.url)),e.url&&e.url!==this.__slideState.url&&(this.__slideState.url=e.url,null===(n=this.player)||void 0===n||n.setResourceData(this.__slideState.taskId,e.url)),Number.isInteger(e.currentSlideIndex)&&e.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=e.currentSlideIndex,[4,this.doRenderSlide(e.currentSlideIndex)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,null===(r=this.player)||void 0===r?void 0:r.clock.waitUntil((function(){var t,n;return(null===(t=o.player)||void 0===t?void 0:t.currentIndex)===e.currentSlideIndex&&(null===(n=o.player)||void 0===n?void 0:n.currentStage)}),3e3)];case 3:return a.sent(),i=!1,Number.isInteger(e.mainSeqStep)&&e.mainSeqStep!==this.__slideState.mainSeqStep&&(i=!0,this.__slideState.mainSeqStep=e.mainSeqStep),e.mainSeqState&&e.mainSeqState!==this.__slideState.mainSeqState&&(i=!0,this.__slideState.mainSeqState=e.mainSeqState),i&&this.setMainSeqStep(this.__slideState.mainSeqStep,"idle"===this.__slideState.mainSeqState?"start":"end"),e.interactiveSeqState&&(this.initInteractiveSeq(e),this.__slideState.interactiveSeqState=e.interactiveSeqState),[4,O_(1500)];case 4:return a.sent(),e.mediaState&&(this.initMedia(e),this.__slideState.mediaState=e.mediaState),this.isSyncingSlideState=!1,[2]}}))}))},t.prototype.initInteractiveSeq=function(e){var t;for(var n in e.interactiveSeqState){var r=e.interactiveSeqState[n];null===(t=this.player)||void 0===t||t.setInteractiveSeqState(n,r.step,"idle"===r.state?"start":"end")}},t.prototype.initMedia=function(e){var t,n,r;for(var i in e.mediaState){var o=e.mediaState[i],a=this.__slideState.mediaState[i];if(null===(t=this.player)||void 0===t||t.syncFullscreenVideoState({targetId:i,state:!!o.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!a||o.type!==a.type||o.time!==a.time)if("play"===o.type){var s=(this.timestamp()-o.time)/1e3;null===(n=this.player)||void 0===n||n.setMediaState(i,!0,s)}else null===(r=this.player)||void 0===r||r.setMediaState(i,!1,o.time)}},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return k_(this,void 0,void 0,(function(){var e;return D_(this,(function(t){switch(t.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];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,[(e=t.sent()).width,e.height]];case 4:return t.sent(),[2,[0,0]];case 5:return[2]}}))}))},t.prototype.getSlideCountAsync=function(){return k_(this,void 0,void 0,(function(){return D_(this,(function(e){switch(e.label){case 0:if(this._slideCount>0)return[2,this._slideCount];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,e.sent().json()];case 3:return[2,e.sent().slideCount];case 4:return e.sent(),[2,0];case 5:return[2]}}))}))},Object.defineProperty(t.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(t.prototype,"mainSeqLength",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var e;return(null===(e=this.player)||void 0===e?void 0:e.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(e){this.player&&(this.player.updateConfig(e),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(e,t){var n;this.taskId=e,null===(n=this.player)||void 0===n||n.setResourceData(e,t),this.__slideState.taskId=e,this.__slideState.url=t,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:e,url:t})},t.prototype._renderSlide=function(e){var t;return k_(this,void 0,void 0,(function(){var n=this;return D_(this,(function(r){switch(r.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((xb.platform.isIOS()||xb.platform.isAndroid())&&this.iosResetCache.indexOf(e)<0&&this.iosResetCache.push(e),[4,null===(t=this.player)||void 0===t?void 0:t.renderSlide(e)]);case 1:return r.sent(),this.__slideState.currentSlideIndex=e,this.resizeView(),this.__slideState.interactiveSeqState={},this.__slideState.mediaState={},this.emitStateChange(),setTimeout((function(){var e,t;if("hidden"===(null===(t=null===(e=n.player)||void 0===e?void 0:e.view)||void 0===t?void 0:t.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(e){}}),100),[2]}}))}))},t.prototype.renderSlide=function(e,t){if(void 0===t&&(t=!0),this.player){var n=Number(e);(n!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(n>this.slideCount&&this.slideCount>0||this.poseRenderSlide(n,t))}},t.prototype.needCreateNewPlayer=function(){var e=xb.platform.isLowGpuMemory()?15:30;return(xb.platform.isIOS()||xb.platform.isAndroid())&&this.iosResetCache.length>e},t.prototype.poseRenderSlide=function(e,t){"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t}):"sync"===this.mode?(this.doRenderSlide(e,t),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:e,isForward:t})):this.doRenderSlide(e,t)},t.prototype.doRenderSlide=function(e,t){var n,r,i,o=this;if(void 0===t&&(t=!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 a=this.player.getSnapshot();this.cacheImage.src=a,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===(r=this.config)||void 0===r?void 0:r.controller)&&this.createController(),this.needClearCacheImage=!0,(null===(i=null==this?void 0:this.player)||void 0===i?void 0:i.view)&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var s=Math.random().toString(32).substr(2);return this.player.isForward=t,this.renderingTaskManager.addTask((function(){return o._renderSlide(e)}),e,s),new Promise((function(e){o.renderingTaskManager.eventHub.once("task-end-"+s,e)}))},t.prototype.getSnapshot=function(){var e,t;return null!==(t=null===(e=this.player)||void 0===e?void 0:e.getSnapshot())&&void 0!==t?t:null},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasNextStep()||this.emit(L_.slideStepEnd),this.player.mainSeqHasNextStep()?"interactive"===this.mode?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):"sync"===this.mode?(this.doNextStep(!1,""),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep(!1,""):this.handleNextSlide()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+!!this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doNextStep=function(e,t){if(this.player){var n=!this.config.clientId||t===this.config.clientId;this.player.nextStep(e,n);var r=this.player.mainSeqStep();this.__slideState.mainSeqStep=r,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasPrevStep()||this.emit(L_.slideStepStart),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()):this.logger.info("prevent nextStep. isLoading: "+this.isLoading+", player: "+this.player+", interactive: "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(e){if(void 0===e&&(e=!1),this.player){this.player.prevStep(e);var t=this.player.mainSeqStep();this.__slideState.mainSeqStep=t,this.emitStateChange()}},t.prototype.isSlideStateReady=function(e){return e.taskId.length>0&&e.url.length>0&&e.currentSlideIndex>0},t.prototype.emitStateChange=function(){if("local"!==this.mode&&!this.isSyncingSlideState){var e=this.slideState;!Mb()(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(L_.stateChange,e),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(e){if(!this.lock.isLocked(e.type)){var t=Math.random().toString(32).substr(2);this.lock.addLock(e.type,t);var n=N_(N_({},e),{uuid:t,clientId:this.config.clientId});"sync"===this.config.mode&&(n.incrId=this.dispatchIncrId),this.emit(L_.syncDispatch,n),this.logger.info("sync dispatch "+JSON.stringify(n),this.taskId)}},t.prototype.setMainSeqStep=function(e,t){var n;null===(n=this.player)||void 0===n||n.setMainSeqStep(e,t)},t.prototype.setInteractive=function(e){var t;this.interactive=e,null===(t=this.player)||void 0===t||t.setInteractive(e)},t.prototype.pause=function(){var e;null===(e=this.player)||void 0===e||e.pause()},t.prototype.resume=function(){var e;null===(e=this.player)||void 0===e||e.resume()},t.prototype._doFrozen=function(){var e;return k_(this,void 0,void 0,(function(){var t,n,r,i=this;return D_(this,(function(o){switch(o.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.tracker({name:"frozenSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.view&&this.player?[4,this.player.clock.waitUntil((function(){return!i.isLoading}),6e4)]:[3,2];case 1:for(n in o.sent(),t=this.player.getSnapshot()||"",this.cacheImage.src=t,this.frame.appendChild(this.cacheImage),this.player.destroy(),null===(e=this.playerController)||void 0===e||e.destroy(),this.player=void 0,this.__slideState.mediaState)r=this.__slideState.mediaState[n],this.__slideState.mediaState[n]=N_(N_({},r),{frozenTime:this.timestamp()});o.label=2;case 2:return[2]}}))}))},t.prototype.frozen=function(){var e=this;this.frozenTaskManager.addTask("frozen",(function(){return e._doFrozen()}))},t.prototype._doRelease=function(){var e,t;return k_(this,void 0,void 0,(function(){var n,r,i,o;return D_(this,(function(a){switch(a.label){case 0:if(this.logger.info("do release slide",this.taskId),this.tracker({name:"releaseSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.player)return[2];for(r in this.player=this.initPlayer(this.config),(null===(e=this.config)||void 0===e?void 0:e.controller)&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),n=this.__slideState,this.__slideState=Ib()(j_),n.mediaState)"play"===(i=n.mediaState[r]).type&&(o=Math.max(null!==(t=i.frozenTime)&&void 0!==t?t:0,i.time),i.time=this.timestamp()-(o-i.time),i.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(e){}return[2]}}))}))},t.prototype.release=function(){var e=this;this.frozenTaskManager.addTask("release",(function(){return e._doRelease()}))},t.prototype._doDestroy=function(){var e,n,r,i,o=this;this.logger.info("do destroy slide",this.taskId),this.tracker({name:"destroySlide",reason:"",result:"",payload:{taskId:this.taskId}});var a=t.instances.findIndex((function(e){return e.randomId===o.randomId}));a>=0&&t.instances.splice(a,1),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),null===(e=this.player)||void 0===e||e.removeAllListeners(),null===(n=this.player)||void 0===n||n.destroy(),null===(r=this.player)||void 0===r||r.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),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(e){}t.volumeAdjuster.off("update",this._updateVolumeByStaticAdjuster)},t.prototype.waitLoadEnd=function(){return k_(this,void 0,void 0,(function(){var e;return D_(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return this.isLoading&&e<10?[4,O_(100)]:[3,3];case 2:return t.sent(),e+=1,[3,1];case 3:return[2]}}))}))},t.prototype.preload=function(e){return this.player?this.player.preload(e):Promise.resolve()},t.prototype.destroy=function(){var e=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then((function(){e._doDestroy()})):this._doDestroy()},t.prototype.clearSlideCache=function(){var e;null===(e=this.player)||void 0===e||e.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var e=this.player.currentIndex===this.slideCount,t=0===this.mainSeqLength||this.mainSeqStep>=this.mainSeqLength-1,n="end"===this.mainSeqState||"running"===this.mainSeqState||null==this.mainSeqState;return!(e&&t&&n)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var e=1===this.player.currentIndex,t=0===this.mainSeqLength||0===this.mainSeqStep,n="idle"===this.mainSeqState||null===this.mainSeqState;return!(e&&t&&n)},t.prototype.snapshot=function(){return k_(this,void 0,void 0,(function(){return D_(this,(function(e){return this.player?[2,this.player.getSnapshot()]:[2,null]}))}))},t.prototype.snapshotWithTimingEnd=function(e){return k_(this,void 0,void 0,(function(){return D_(this,(function(t){return this.player?[2,this.player.snapshotWithTimingEnd(e)]:[2,null]}))}))},t.prototype.updateGlobalVolume=function(e){this.volumeAdjuster.volume=e},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){xb.clearLocalCache()},t.disposeLocalCache=function(){},n=t,t.preloadResource=A_,t.instances=[],t._tempFrozenIds=[],t._tempLog="",t._tempLogIndex=1,t.remoteLogAddress=null,t.usePlugin=function(e){var n,r;e.context({logger:{info:function(e){t.appendLogString("INFO - "+(new Date).toISOString()+" - "+e+"\n")},warn:function(e){t.appendLogString("WARN - "+(new Date).toISOString()+" - "+e+"\n")},error:function(e){t.appendLogString("ERROR - "+(new Date).toISOString()+" - "+e+"\n")}}}),n=e,(r=wb.get(n.hookPoint)||[]).push(n),wb.set(n.hookPoint,r)},t.volumeAdjuster=new mb,t.trackLogger=new E_,t.handleFrozenAllSlide=function(){t.instances.forEach((function(e){e.player&&(t._tempFrozenIds.push(e.randomId),e.frozen())}))},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach((function(e){var n=t.instances.find((function(t){return t.randomId===e}));n&&n.release()})),t._tempFrozenIds=[]},t.handleLogReport=function(e){return k_(void 0,void 0,void 0,(function(){var r,i,o,a,s,u;return D_(n,(function(n){switch(n.label){case 0:return[4,t.flushLog(!0)];case 1:if(n.sent(),!U_)return[3,12];r=[],n.label=2;case 2:return n.trys.push([2,4,,5]),[4,U_.keys()];case 3:return r=(n.sent()||[]).sort((function(e,t){return parseInt(e.replace("run_time_log_",""))-parseInt(t.replace("run_time_log_",""))})),[3,5];case 4:return n.sent(),[3,5];case 5:if(0===r.length)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:e},"*"),[2];i=0,o=r,n.label=6;case 6:if(!(i=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([(r="Slide.initConfig",function(e,t,n){var i=n.value;n.value=function(){for(var e=[],t=0;t1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?F(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),n=e();return n?this.addDisposer(n,t):t}},{key:"addEventListener",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,n,r),this.addDisposer((function(){return e.removeEventListener(t,n,r)}),i),i}},{key:"setTimeout",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){n.remove(r),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),r)}},{key:"setInterval",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),r=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(r)}),n)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(U),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=B()}while(this.disposers.has(e));return e}}]),e}();function F(e){return function(){return e.forEach(U)}}function G(e,t,n){return Math.min(Math.max(e,t),n)}var H={exports:{}},V={exports:{}},W=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},Y=Array.prototype.concat,X=Array.prototype.slice,Q=V.exports=function(e){for(var t=[],n=0,r=e.length;n=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},ee.to.keyword=function(e){return K[e.slice(0,3)]};var re=H.exports,ie=function(){function e(t){var n=this;_(this,e),this.enable=t,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=function(e){var t,r;e instanceof CustomEvent?t=e.detail:"object"===M(r=e.data)&&null!==r&&(t=e.data),t&&("boolean"==typeof t.slide?n.enable=t.slide:"__instance"===t.slide?console.log(n):"__debug"===t.slide&&Object.values(n.apps).forEach((function(e){var t,n;null==(n=null==(t=e.controller)?void 0:t.slide)||n.createController()})))},this.initialize()}return T(e,[{key:"setAppContext",value:function(e,t){var n;((n=this.apps)[e]||(n[e]={})).context=t,this.log("[Slide] new ".concat(e))}},{key:"setAppController",value:function(e,t){var n;((n=this.apps)[e]||(n[e]={})).controller=t}},{key:"deleteApp",value:function(e){delete this.apps[e],this.log("[Slide] delete ".concat(e))}},{key:"initialize",value:function(){window.addEventListener("message",this._onMessage)}},{key:"dispose",value:function(){window.removeEventListener("message",this._onMessage)}},{key:"log",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).info.apply(e,arguments);else if(this.enable){var t;(t=console).log.apply(t,arguments)}}},{key:"verbose",value:function(){var e;if(this.roomLogger)(e=this.roomLogger).debug.apply(e,arguments);else if(this.enable&&"verbose"===this.level){var t;(t=console).log.apply(t,arguments)}}},{key:"warn",value:function(){var e,t;this.roomLogger?(e=this.roomLogger).warn.apply(e,arguments):(t=console).warn.apply(t,arguments)}}]),e}(),oe=new ie(!1),ae=oe.log.bind(oe),se=oe.verbose.bind(oe);function ue(e){try{var t=window.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"!==t&&"transparent"!==t)return t;if(e.parentElement)return ue(e.parentElement)}catch(e){}return"#ffffff"}var le="";function ce(e){return le||(le=function(e){var t=re.get(e);if(t&&"rgb"===t.model){var n=t.value,r=(((255&Math.round(n[0]))<<16)+((255&Math.round(n[1]))<<8)+(255&Math.round(n[2]))).toString(16);return"#"+"000000".substring(r.length)+r}return e}(ue(e)),ae("[Slide] guess bg color",le)),le}var he=function(e){return e.tracker};function de(e){for(var t=e.width,n=e.height,r=e.slideCount,i=e.slideState,o=i.taskId,a=i.url,s=[],u=1;u<=r;++u)s.push({width:t,height:n,thumbnail:"".concat(a,"/").concat(o,"/preview/").concat(u,".png"),src:"ppt"});return s}function fe(e,t,n,r){var i,o=n.slideState.currentSlideIndex;if(o>0&&t.getIsWritable()){var a=[r,o].join("/");if("page"!==e.scenePathType(a)){e.removeScenes(r);for(var s=n.slideCount,u=[],l=1;l<=s;++l)u.push({name:"".concat(l)});e.putScenes(r,u)}(t.getBox().focus?e.state.sceneState.scenePath:(null==(i=t.getView())?void 0:i.focusScenePath)||"")!==a&&t.setScenePath(a)}}var pe="https://convertcdn.netless.link/dynamicConvert";t.DefaultUrl=pe;var ve={taskId:"",url:"",state:null},me=function(){function e(t){var n,r=this,i=t.context,o=t.anchor,a=t.onRenderStart,s=t.onPageChanged,u=t.onTransitionStart,c=t.onTransitionEnd,h=t.onError,d=t.onRenderError,f=t.showRenderError;_(this,e),this.sideEffect=new z,this.ready=!1,this.readyPromise=new Promise((function(e){r.resolveReady=function(){r.ready?ae("[Slide] render end"):setTimeout((function(){r.ready=!0,e()}),1e3)}})),this.onSyncDispatch=function(e){if(r.context.getIsWritable()&&r.room){var t={type:L.SLIDE_EVENTS.syncDispatch,payload:e};se("[Slide] dispatch",JSON.stringify(e)),r.context.dispatchMagixEvent(L.SLIDE_EVENTS.syncDispatch,t)}},this.magixEventListener=function(e){var t=e.payload,n=t.type,i=t.payload;n===L.SLIDE_EVENTS.syncDispatch&&(r.syncStateOnce(),se("[Slide] receive",JSON.stringify(i)),r.slide.emit(L.SLIDE_EVENTS.syncReceive,i))},this.onStateChange=function(e){r.context.getIsWritable()&&(se("[Slide] state change",JSON.stringify(e,null,2)),r.context.storage.setState({state:e}))},this.pollCount=0,this.pollReadyState=function(){r.ready?1===r._toFreeze?r.freeze():-1===r._toFreeze&&r.unfreeze():r.pollCount<40?(r.pollCount++,setTimeout(r.pollReadyState,500)):(r.pollCount=0,ae("[Slide] renderSlide 1 (retry after timeout)"),r.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=function(){return r.room&&r.room.calibrationTimestamp?r.room.calibrationTimestamp:r.player?r.player.beginTimestamp+r.player.progressTime:Date.now()},this.isFrozen=!1,this._toFreeze=0,this.freeze=function(){r.isFrozen=!0,r.ready?(ae("[Slide] freeze",r.context.appId),r.slide.frozen()):r._toFreeze=1},this.unfreeze=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.visible){e.next=2;break}return e.abrupt("return");case 2:r.isFrozen=!1,r.ready?(ae("[Slide] unfreeze",r.context.appId),r.slide.release()):r._toFreeze=-1;case 4:case"end":return e.stop()}}),e)}))),this.onVisibilityChange=l(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(r.visible="visible"===document.visibilityState)?(ae("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:r.savedIsFrozen}),r.savedIsFrozen||r.unfreeze()):(r.savedIsFrozen=r.isFrozen,ae("[Slide] freeze because tab becomes invisible"),r.freeze());case 1:case"end":return e.stop()}}),e)}))),this.onRenderStart=a,this.onPageChanged=s,this.onTransitionStart=u,this.onTransitionEnd=c,this.onError=h,this.onRenderError=d,this.showRenderError=null==f||f,this.context=i,this.room=i.getRoom(),this.player=this.room?void 0:i.getDisplayer(),n=this.room||this.player,oe.roomLogger=n.logger,this.slide=this.createSlide(o,{whiteTracker:he(i.getDisplayer())}),this.syncStateOnceFlag=!this.context.isAddApp,this.visible="visible"===document.visibilityState,this.savedIsFrozen=!1,this.initialize()}return T(e,[{key:"jumpToPage",value:function(e){this.ready&&(e=G(e,1,this.pageCount),this.slide.renderSlide(e))}},{key:"initialize",value:function(){this.registerEventListeners(),this.kickStart()}},{key:"kickStart",value:function(){var e=this.context,t=this.slide;e.getIsWritable()&&e.storage.ensureState(ve);var n=e.storage.state,r=n.taskId,i=n.url,o=n.state;t.setResource(r,i||pe),o?(ae("[Slide] init with state",JSON.stringify(o)),this.syncStateOnceFlag=!1,t.setSlideState(o)):e.isAddApp&&(ae("[Slide] init by renderSlide",1),t.renderSlide(1)),this.pollReadyState()}},{key:"registerEventListeners",value:function(){var e=this,t=this.context,n=this.slide,r=this.sideEffect.addDisposer(t.storage.addStateChangedListener((function(){t.storage.state.state&&(e.syncStateOnce(),e.sideEffect.flush(r))})));this.sideEffect.add((function(){return t.addMagixEventListener(L.SLIDE_EVENTS.syncDispatch,e.magixEventListener,{fireSelfEventAfterCommit:!0})})),n.on(L.SLIDE_EVENTS.renderStart,this.onRenderStart),n.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),n.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),n.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),n.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),n.on(L.SLIDE_EVENTS.renderError,this.onError),n.on(L.SLIDE_EVENTS.stateChange,this.onStateChange),n.on(L.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),n.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add((function(){return document.addEventListener("visibilitychange",e.onVisibilityChange),function(){return document.removeEventListener("visibilitychange",e.onVisibilityChange)}}))}},{key:"syncStateOnce",value:function(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(ve);var e=this.context.storage.state.state;e&&(ae("[Slide] sync with state (once)",JSON.stringify(e)),this.slide.setSlideState(e),this.syncStateOnceFlag=!1)}}},{key:"createSlide",value:function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.context.getAppOptions()||{},a=new L.Slide({anchor:e,interactive:!0,mode:"interactive",controller:oe.enable,enableGlobalClick:null==(t=o.enableGlobalClick)||t,renderOptions:{minFPS:o.minFPS||25,maxFPS:o.maxFPS||30,autoFPS:null==(n=o.autoFPS)||n,autoResolution:null==(r=o.autoResolution)||r,resolution:o.resolution,transactionBgColor:o.bgColor||ce(e),maxResolutionLevel:o.maxResolutionLevel,forceCanvas:o.forceCanvas,enableNvidiaDetect:o.enableNvidiaDetect},fixedFrameSize:o.fixedFrameSize,loaderDelegate:o.loaderDelegate,navigatorDelegate:o.navigatorDelegate,urlInterrupter:o.urlInterrupter,resourceTimeout:o.resourceTimeout,rtcAudio:o.rtcAudio,useLocalCache:o.useLocalCache,logger:o.logger,whiteTracker:i.whiteTracker,timestamp:this.timestamp});return a}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.destroyed||(ae("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}},{key:"pageCount",get:function(){return this._pageCount>0||(this._pageCount=this.slide.slideCount),this._pageCount}},{key:"page",get:function(){return this.slide.slideState.currentSlideIndex}}]),e}();var ge="undefined"!=typeof window,ye=ge&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),be=ge&&"IntersectionObserver"in window,xe=ge&&"classList"in document.createElement("p"),_e=ge&&window.devicePixelRatio>1,we={elements_selector:".lazy",container:ye||ge?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Te=function(e){return Object.assign({},we,e)},Me=function(e,t){var n,r="LazyLoad::Initialized",i=new e(t);try{n=new CustomEvent(r,{detail:{instance:i}})}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent(r,!1,!1,{instance:i})}window.dispatchEvent(n)},Se="src",Ee="srcset",Ae="sizes",Ie="poster",Ce="llOriginalAttrs",Ne="data",ke="loading",De="loaded",Pe="applied",Oe="error",Re="native",Le="data-",je="ll-status",Be=function(e,t){return e.getAttribute(Le+t)},Ue=function(e){return Be(e,je)},ze=function(e,t){return function(e,t,n){var r=Le+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)}(e,je,t)},Fe=function(e){return ze(e,null)},Ge=function(e){return null===Ue(e)},He=function(e){return Ue(e)===Re},Ve=[ke,De,Pe,Oe],We=function(e,t,n,r){e&&(void 0===r?void 0===n?e(t):e(t,n):e(t,n,r))},Ye=function(e,t){xe?e.classList.add(t):e.className+=(e.className?" ":"")+t},Xe=function(e,t){xe?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Qe=function(e){return e.llTempImage},Ze=function(e,t){if(t){var n=t._observer;n&&n.unobserve(e)}},qe=function(e,t){e&&(e.loadingCount+=t)},Je=function(e,t){e&&(e.toLoadCount=t)},Ke=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},$e=function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&Ke(n).forEach(t)},et=function(e,t){Ke(e).forEach(t)},tt=[Se],nt=[Se,Ie],rt=[Se,Ee,Ae],it=[Ne],ot=function(e){return!!e[Ce]},at=function(e){return e[Ce]},st=function(e){return delete e[Ce]},ut=function(e,t){if(!ot(e)){var n={};t.forEach((function(t){n[t]=e.getAttribute(t)})),e[Ce]=n}},lt=function(e,t){if(ot(e)){var n=at(e);t.forEach((function(t){!function(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}(e,t,n[t])}))}},ct=function(e,t,n){Ye(e,t.class_applied),ze(e,Pe),n&&(t.unobserve_completed&&Ze(e,t),We(t.callback_applied,e,n))},ht=function(e,t,n){Ye(e,t.class_loading),ze(e,ke),n&&(qe(n,1),We(t.callback_loading,e,n))},dt=function(e,t,n){n&&e.setAttribute(t,n)},ft=function(e,t){dt(e,Ae,Be(e,t.data_sizes)),dt(e,Ee,Be(e,t.data_srcset)),dt(e,Se,Be(e,t.data_src))},pt={IMG:function(e,t){$e(e,(function(e){ut(e,rt),ft(e,t)})),ut(e,rt),ft(e,t)},IFRAME:function(e,t){ut(e,tt),dt(e,Se,Be(e,t.data_src))},VIDEO:function(e,t){et(e,(function(e){ut(e,tt),dt(e,Se,Be(e,t.data_src))})),ut(e,nt),dt(e,Ie,Be(e,t.data_poster)),dt(e,Se,Be(e,t.data_src)),e.load()},OBJECT:function(e,t){ut(e,it),dt(e,Ne,Be(e,t.data_src))}},vt=["IMG","IFRAME","VIDEO","OBJECT"],mt=function(e,t){!t||function(e){return e.loadingCount>0}(t)||function(e){return e.toLoadCount>0}(t)||We(e.callback_finish,t)},gt=function(e,t,n){e.addEventListener(t,n),e.llEvLisnrs[t]=n},yt=function(e,t,n){e.removeEventListener(t,n)},bt=function(e){return!!e.llEvLisnrs},xt=function(e){if(bt(e)){var t=e.llEvLisnrs;for(var n in t){var r=t[n];yt(e,n,r)}delete e.llEvLisnrs}},_t=function(e,t,n){!function(e){delete e.llTempImage}(e),qe(n,-1),function(e){e&&(e.toLoadCount-=1)}(n),Xe(e,t.class_loading),t.unobserve_completed&&Ze(e,n)},wt=function(e,t,n){var r=Qe(e)||e;if(!bt(r)){!function(e,t,n){bt(e)||(e.llEvLisnrs={});var r="VIDEO"===e.tagName?"loadeddata":"load";gt(e,r,t),gt(e,"error",n)}(r,(function(i){!function(e,t,n,r){var i=He(t);_t(t,n,r),Ye(t,n.class_loaded),ze(t,De),We(n.callback_loaded,t,r),i||mt(n,r)}(0,e,t,n),xt(r)}),(function(i){!function(e,t,n,r){var i=He(t);_t(t,n,r),Ye(t,n.class_error),ze(t,Oe),We(n.callback_error,t,r),n.restore_on_error&<(t,rt),i||mt(n,r)}(0,e,t,n),xt(r)}))}},Tt=function(e,t,n){!function(e){e.llTempImage=document.createElement("IMG")}(e),wt(e,t,n),function(e){ot(e)||(e[Ce]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,n){var r=Be(e,t.data_bg),i=Be(e,t.data_bg_hidpi),o=_e&&i?i:r;o&&(e.style.backgroundImage='url("'.concat(o,'")'),Qe(e).setAttribute(Se,o),ht(e,t,n))}(e,t,n),function(e,t,n){var r=Be(e,t.data_bg_multi),i=Be(e,t.data_bg_multi_hidpi),o=_e&&i?i:r;o&&(e.style.backgroundImage=o,ct(e,t,n))}(e,t,n),function(e,t,n){var r=Be(e,t.data_bg_set);if(r){var i=r.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),ct(e,t,n)}}(e,t,n)},Mt=function(e,t,n){wt(e,t,n),function(e,t,n){var r=pt[e.tagName];r&&(r(e,t),ht(e,t,n))}(e,t,n)},St=function(e,t,n){!function(e){return vt.indexOf(e.tagName)>-1}(e)?Tt(e,t,n):Mt(e,t,n)},Et=function(e,t,n){e.setAttribute("loading","lazy"),wt(e,t,n),function(e,t){var n=pt[e.tagName];n&&n(e,t)}(e,t),ze(e,Re)},At=function(e){e.removeAttribute(Se),e.removeAttribute(Ee),e.removeAttribute(Ae)},It=function(e){$e(e,(function(e){lt(e,rt)})),lt(e,rt)},Ct={IMG:It,IFRAME:function(e){lt(e,tt)},VIDEO:function(e){et(e,(function(e){lt(e,tt)})),lt(e,nt),e.load()},OBJECT:function(e){lt(e,it)}},Nt=function(e){var t=Ct[e.tagName];t?t(e):function(e){if(ot(e)){var t=at(e);e.style.backgroundImage=t.backgroundImage}}(e)},kt=function(e,t){Nt(e),function(e,t){Ge(e)||He(e)||(Xe(e,t.class_entered),Xe(e,t.class_exited),Xe(e,t.class_applied),Xe(e,t.class_loading),Xe(e,t.class_loaded),Xe(e,t.class_error))}(e,t),Fe(e),st(e)},Dt=function(e,t,n,r){n.cancel_on_exit&&function(e){return Ue(e)===ke}(e)&&"IMG"===e.tagName&&(xt(e),function(e){$e(e,(function(e){At(e)})),At(e)}(e),It(e),Xe(e,n.class_loading),qe(r,-1),Fe(e),We(n.callback_cancel,e,t,r))},Pt=function(e,t,n,r){var i=function(e){return Ve.indexOf(Ue(e))>=0}(e);ze(e,"entered"),Ye(e,n.class_entered),Xe(e,n.class_exited),function(e,t,n){t.unobserve_entered&&Ze(e,n)}(e,n,r),We(n.callback_enter,e,t,r),i||St(e,n,r)},Ot=["IMG","IFRAME","VIDEO"],Rt=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},Lt=function(e,t,n){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Pt(e.target,e,t,n):function(e,t,n,r){Ge(e)||(Ye(e,n.class_exited),Dt(e,t,n,r),We(n.callback_exit,e,t,r))}(e.target,e,t,n)}))},jt=function(e,t){be&&!Rt(e)&&(t._observer=new IntersectionObserver((function(n){Lt(n,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},Bt=function(e){return Array.prototype.slice.call(e)},Ut=function(e){return e.container.querySelectorAll(e.elements_selector)},zt=function(e){return function(e){return Ue(e)===Oe}(e)},Ft=function(e,t){return function(e){return Bt(e).filter(Ge)}(e||Ut(t))},Gt=function(e,t){var n;(n=Ut(e),Bt(n).filter(zt)).forEach((function(t){Xe(t,e.class_error),Fe(t)})),t.update()},Ht=function(e,t){var n=Te(e);this._settings=n,this.loadingCount=0,jt(n,this),function(e,t){ge&&(t._onlineHandler=function(){Gt(e,t)},window.addEventListener("online",t._onlineHandler))}(n,this),this.update(t)};Ht.prototype={update:function(e){var t,n,r=this._settings,i=Ft(e,r);(Je(this,i.length),!ye&&be)?Rt(r)?function(e,t,n){e.forEach((function(e){-1!==Ot.indexOf(e.tagName)&&Et(e,t,n)})),Je(n,0)}(i,r,this):(t=this._observer,n=i,function(e){e.disconnect()}(t),function(e,t){t.forEach((function(t){e.observe(t)}))}(t,n)):this.loadAll(i)},destroy:function(){var e;this._observer&&this._observer.disconnect(),e=this,ge&&window.removeEventListener("online",e._onlineHandler),Ut(this._settings).forEach((function(e){st(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,n=this._settings;Ft(e,n).forEach((function(e){Ze(e,t),St(e,n,t)}))},restoreAll:function(){var e=this._settings;Ut(e).forEach((function(t){kt(t,e)}))}},Ht.load=function(e,t){var n=Te(t);St(e,n)},Ht.resetStatus=function(e){Fe(e)},ge&&function(e,t){if(t)if(t.length)for(var n,r=0;n=t[r];r+=1)Me(e,n);else Me(e,t)}(Ht,window.lazyLoadOptions);var Vt=function(){function e(t){var n=this,r=t.readonly,i=t.onNewPageIndex,o=t.onPlay,a=t.onPagesReady,s=t.urlInterrupter;_(this,e),this._pages=[],this.pageIndex=0,this.setPaused=function(){n.$btnPlay.classList.toggle(n.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=function(){n.$btnPlay.classList.toggle(n.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new z,this.readonly=r,this.onNewPageIndex=i,this.onPlay=o,this.onPagesReady=a,this.urlInterrupter=s||function(e){return e},this.render()}var t;return T(e,[{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e}},{key:"destroy",value:function(){var e;null==(e=this.previewLazyLoad)||e.destroy(),this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1))}},{key:"refreshTotalPage",value:function(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t,this.refreshPreview(),this.sideEffect.addEventListener(t,"click",(function(t){var n;if(!e.readonly){var r=null==(n=t.target.dataset)?void 0:n.pageIndex;r&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(r)),e.togglePreview(!1))}}))}return this.$preview}},{key:"refreshPreview",value:(t=l(regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,l,c,h,d,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=this.$preview,i=this.wrapClassName("preview-page"),o=this.wrapClassName("preview-page-name");r.firstChild;)r.firstChild.remove();for(a=[],s=0,u=this.pages.length;s0?"":"none"}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer"));var n=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-sidebar")),n.setAttribute("viewBox","0 0 64 64");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(n,"click",(function(){e.readonly||e.togglePreview()})),this.$btnSidebar=n,this.$btnSidebar.style.display="none",this.$footer.appendChild(n);var r=document.createElement("div");r.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),n.appendChild(r),n}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1)})),r.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-play")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),n.appendChild(r),n}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-pause")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),n.appendChild(r),n}(this.namespace));this.$btnPlay=o,this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(e.setPlaying(),e.onPlay&&e.onPlay())})),r.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1)})),r.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1)}));var l=document.createElement("span");this.$totalPage=l,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(r),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,n){var r=document.createElement("button");return r.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),r.appendChild(t),n&&r.appendChild(n),r}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&(this.previewLazyLoad||(this.previewLazyLoad=new Ht({container:this.$preview,elements_selector:".".concat(this.wrapClassName("preview-page>img"))})),this.$preview.scrollTo({top:t.offsetTop-16}))}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"pages",set:function(e){this._pages=e,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage(),this.onPagesReady&&this.onPagesReady(e)},get:function(){return this._pages}}]),e}(),Wt=new Set(["clicker"]),Yt=function(){function e(t){var r=this,i=t.box,o=t.view,a=t.mountSlideController,s=t.mountWhiteboard,u=t.baseScenePath,c=t.appId,h=t.urlInterrupter,d=t.onPagesReady;_(this,e),this.slideController=null,this.isViewMounted=!1,this.onError=function(e){var t,n,i=e.error,o=e.index;r.viewer.setPaused(),(null==(t=r.slideController)?void 0:t.showRenderError)&&(r.$overlay.textContent="Error on slide[page=".concat(r.slideController.page,"]: ").concat(i.message),r.$overlay.style.opacity="1"),(null==(n=r.slideController)?void 0:n.onRenderError)&&r.slideController.onRenderError(i,o),oe.warn("[Slide] render error",i)},this.onRenderStart=function(){r.$whiteboardView.classList.add(r.wrapClassName("wb-view-hidden")),r.viewer.setPlaying()},this.onRenderEnd=function(){},this.onPageChanged=function(){clearTimeout(r._onPageChangedTimer),r._onPageChangedTimer=setTimeout(r._onPageChanged,200)},this._onPageChangedTimer=0,this._onPageChanged=function(){r.$overlay.style.opacity="",r.$whiteboardView.classList.remove(r.wrapClassName("wb-view-hidden"))},this.refreshPages=function(){r.slideController&&(r.viewer.pages=de(r.slideController.slide),r.viewer.setPageIndex(r.getPageIndex(r.slideController.page)),r.scaleDocsToFit())},this.scaleDocsToFit=function(){if(r.slideController){var e=r.slideController.slide,t=e.width,n=e.height;t&&n&&(r.whiteboardView.moveCameraToContain({originX:-t/2,originY:-n/2,width:t,height:n,animationMode:"immediately"}),r.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return r.whiteboardView.camera.scale},minContentMode:function(){return r.whiteboardView.camera.scale},centerX:0,centerY:0,width:t,height:n}),r.isViewMounted||(r.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),r.mountWhiteboard(r.$whiteboardView)))}},this.onPlay=function(){r.slideController&&r.slideController.slide.nextStep()},this.onNewPageIndex=function(e){r.slideController&&r.slideController.jumpToPage(e+1)},this.sideEffect=new z,this.namespace="netless-app-slide",this.toPdf=l(regeneratorRuntime.mark((function e(){var t,i,o,a,s,u,l,c,h,d,f,p,v,m,g,y,b,x,_,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.slideController){e.next=3;break}return r.reportProgress(100,null),e.abrupt("return");case 3:if(t=r.slideController.slide,i=1920,o=document.createElement("canvas"),a=o.getContext("2d"),s=t.slideCount,u=t.width,l=t.height,c=Math.floor(u),h=Math.floor(l),c>i&&(c=i,h=Math.floor(l*c/u)),h>i&&(h=i,c=Math.floor(u*h/l)),o.width=c,o.height=h,(d=document.createElement("canvas")).width=c,d.height=h,(f=d.getContext("2d"))&&r.getWhiteSnapshot&&a){e.next=21;break}return r.reportProgress(100,null),e.abrupt("return",null);case 21:return p=c>h?"l":"p",e.next=24,Promise.resolve().then(n.bind(n,88877));case 24:v=e.sent,m=v.jsPDF,g=new m({format:[c,h],orientation:p,compress:!0}),y=1;case 28:if(!(y<=s)){e.next=57;break}return b=null,e.prev=30,e.next=33,r.slideController.slide.snapshotWithTimingEnd(y);case 33:b=e.sent,e.next=38;break;case 36:e.prev=36,e.t0=e.catch(30);case 38:if(!b){e.next=40;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=document.createElement("img")).src=b,e.next=4,new Promise((function(e){return t.onload=e}));case 4:a.drawImage(t,0,0,c,h);case 5:case"end":return e.stop()}}),e)}))(),"t1",40);case 40:return f.clearRect(0,0,c,h),r.getWhiteSnapshot(y,d,f,u,l),e.prev=42,e.delegateYield(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.toDataURL("image/png"),(n=document.createElement("img")).src=t,e.next=5,new Promise((function(e){return n.onload=e}));case 5:a.drawImage(n,0,0,c,h);case 6:case"end":return e.stop()}}),e)}))(),"t2",44);case 44:e.next=48;break;case 46:e.prev=46,e.t3=e.catch(42);case 48:x=o.toDataURL("image/jpeg",.6),y>1&&g.addPage(),g.addImage(x,"JPEG",0,0,c,h,"","FAST"),a.clearRect(0,0,c,h),Math.ceil(y/s*100)<100&&r.reportProgress(Math.ceil(y/s*100),null);case 54:y++,e.next=28;break;case 57:_=g.output("arraybuffer"),w=r.box.title,r.reportProgress(100,{pdf:_,title:w});case 60:case"end":return e.stop()}}),e,null,[[30,36],[42,46]])}))),this.box=i,this.whiteboardView=o,this.mountSlideController=a,this.mountWhiteboard=s,this.baseScenePath=u,this.appId=c,this.viewer=new Vt({readonly:i.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:h,onPagesReady:d}),this.sideEffect.add((function(){var e=function(e){r.setReadonly(e)};return i.events.on("readonly",e),function(){return i.events.off("readonly",e)}})),this.sideEffect.add((function(){var e=function(e){"@netless/_request_save_pdf_"===e.data.type&&e.data.appId===r.appId&&r.toPdf().catch((function(){return r.reportProgress(100,null)}))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}})),this.render()}return T(e,[{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",(function(t){if(e.box.focus&&e.slideController&&!function(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.slideController.slide.prevStep();break;case"ArrowRight":case"ArrowDown":e.slideController.slide.nextStep()}}))}},{key:"renderOverlay",value:function(){if(!this.$overlay){var e=document.createElement("div");e.className=this.wrapClassName("overlay"),this.$overlay=e}return this.$overlay}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"renderWhiteboardView",value:function(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}},{key:"mount",value:function(){var e=this;return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderStart:this.onRenderStart,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){return e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"unmount",value:function(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.viewer.setReadonly(e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"toggleClickThrough",value:function(e){this.$whiteboardView.style.pointerEvents=!e||Wt.has(e)?"none":"auto"}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"getWhiteSnapshot",value:function(e,t,n,r,i){this.whiteboardView.screenshotToCanvas(n,"".concat(this.baseScenePath,"/").concat(e),t.width,t.height,{centerX:0,centerY:0,scale:Math.min(t.width/r,t.height/i)})}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),Xt=!1,Qt=2;t.FreezerLength=Qt;var Zt=function(e){return"["+e+"]"},qt={map:new Map,boxes:new Map,queue:[],validateQueue:function(){var e=this;for(this.queue.sort((function(t,n){var r,i,o,a;return-((null!=(i=null==(r=e.boxes.get(t))?void 0:r.zIndex)?i:0)-(null!=(a=null==(o=e.boxes.get(n))?void 0:o.zIndex)?a:0))})),ae("[Slide] freezer: validate",Zt(this.queue));this.queue.length>Qt;){var t=this.queue.pop(),n=this.map.get(t);n&&(ae("[Slide] freezer: validate-freeze",t,Zt(this.queue)),n.freeze())}},set:function(e,t,n){ae("[Slide] freezer: add",e,Zt(this.queue)),this.map.set(e,t),this.boxes.set(e,n),this.queue.includes(e)||this.queue.unshift(e),this.validateQueue()},delete:function(e){this.map.delete(e),this.boxes.delete(e),this.queue=this.queue.filter((function(t){return t!==e})),ae("[Slide] freezer: delete",e,Zt(this.queue))},focus:function(e){var t=this.map.get(e),n=this.queue.indexOf(e);n>-1&&this.queue.splice(n,1),this.queue.unshift(e),this.validateQueue(),ae("[Slide] freezer: focus",e,Zt(this.queue)),t&&t.unfreeze()}};t.apps=qt;var Jt=new Set;var Kt=new Set;t.addHooks=function(e){Xt=!0,e.on("focus",(function(e){var t=e.appId;qt.focus(t)})),e.on("created",(function(e){var t=e.appId;Jt.forEach((function(e){return e(t)}))})),e.on("destroy",(function(e){var t=e.appId;Kt.forEach((function(e){return e(t)}))}))};var $t=function(){return".netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden;transition:opacity .2s}.netless-app-slide-wb-view-hidden{opacity:0}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}\n"}();var en=function(){function e(t){var n=this;_(this,e),this.slide=null,this.debug=!1,this.sideEffect=new z,this.ready=!1,this.readyPromise=new Promise((function(e){n.resolveReady=function(){n.ready=!0,e()}})),this.hotkeyListener=function(e){if(n.slide)switch(e.key){case"ArrowUp":case"ArrowLeft":n.slide.prevStep();break;case"ArrowRight":case"ArrowDown":n.slide.nextStep()}},this.onPageChanged=function(e){n.viewer.setPageIndex(e-1)},this.onTransitionStart=function(){n.viewer.setPlaying()},this.onTransitionEnd=function(){n.viewer.setPaused()},this.onError=function(e){var t=e.error;n.viewer.setPaused(),console.warn("[Slide] render error",t)},this.destroyed=!1,this.refreshPages=function(){n.slide&&(n.viewer.pages=de(n.slide),n.viewer.setPageIndex(n.getPageIndex(n.slide.slideState.currentSlideIndex)))},this.onPlay=function(){n.slide&&n.slide.nextStep()},this.onNewPageIndex=function(e){n.slide&&n.slide.slideCount>0&&n.slide.renderSlide(G(e+1,1,n.slide.slideCount))},this.namespace="netless-app-slide",this.target=t.target,this.bgColor=ce(this.target),this.viewer=new Vt({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}return T(e,[{key:"render",value:function(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}},{key:"registerHotKeys",value:function(e){this.sideEffect.addEventListener(e,"keydown",this.hotkeyListener,void 0,"hotkey")}},{key:"mount",value:function(e,t){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new L.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(e,t),this.slide.renderSlide(1)}},{key:"renderStyle",value:function(){var e=document.createElement("style");return e.appendChild(document.createTextNode($t)),e}},{key:"registerEventListeners",value:function(){if(this.slide){var e=this.slide;e.on(L.SLIDE_EVENTS.slideChange,this.onPageChanged),e.on(L.SLIDE_EVENTS.renderStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),e.on(L.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),e.on(L.SLIDE_EVENTS.renderError,this.onError),e.on(L.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}},{key:"getPageIndex",value:function(e){return(e>0?e:1)-1}},{key:"renderSlideContainer",value:function(){if(!this.$slide){var e=document.createElement("div");e.className=this.wrapClassName("slide"),e.dataset.appKind="Slide",this.$slide=e}return this.$slide}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();t.SlidePreviewer=en;var tn=L.Slide.usePlugin.bind(L.Slide);t.usePlugin=tn;var nn="0.2.51";t.version=nn;var rn={kind:"Slide",setup:function(e){var t;if(console.log("[Slide] setup @ 0.2.51"),e.getIsWritable()&&e.storage.ensureState(ve),!e.storage.state.taskId)throw new Error("[Slide] no taskId");var n=e.getView();if(!n)throw new Error("[Slide] no view, please set scenePath on addApp()");n.disableCameraTransform=!0;var r=e.getBox();r.mountStyles($t);try{r.$content.dataset.appSlideVersion=nn}catch(e){}var i=e.getInitScenePath(),o=null,a=function(t){var n=e.getRoom();if(o&&o.slideController){var r=!1;n&&e.getIsWritable()&&(fe(n,e,o.slideController.slide,i),r=!0),ae("[Slide] page to",t,r?"(synced)":""),o.viewer.setPageIndex(t-1),o.viewer.setPaused(),o.onPageChanged();var a=o.viewer.pages.length;a>0&&e.dispatchAppEvent("pageStateChange",{index:t-1,length:a})}};o=new Yt({box:r,view:n,mountSlideController:function(t){var n,o,s=e.getAppOptions()||{},u=new me((n=R({context:e},t),o={onPageChanged:a,onRenderError:s.onRenderError,showRenderError:s.showRenderError},C(n,N(o))));return Xt&&qt.set(e.appId,u,r),oe.setAppController(e.appId,u),u.readyPromise.then(t.onReady).then((function(){var n=e.getRoom(),r=!1;n&&e.getIsWritable()&&(fe(n,e,u.slide,i),r=!0);var o=u.slide.slideState.currentSlideIndex;ae("[Slide] page to",o,r?"(synced)":"","(on ready)"),u.slide.on("renderEnd",t.onRenderEnd)})),u},mountWhiteboard:e.mountView.bind(e),baseScenePath:i,appId:e.appId,urlInterrupter:null==(t=e.getAppOptions())?void 0:t.urlInterrupter,onPagesReady:function(t){var n=t.length,r=(null==o?void 0:o.viewer.pageIndex)||0;e.dispatchAppEvent("pageStateChange",{index:r,length:n})}});var s=e.getRoom(),u=new z;return u.add((function(){var t;return oe.setAppContext(e.appId,e),oe.enable=(null==(t=e.getAppOptions())?void 0:t.debug)||!1,oe.level="debug",function(){return oe.deleteApp(e.appId)}})),s&&(o.toggleClickThrough(s.state.memberState.currentApplianceName),u.add((function(){var e=function(e){e.memberState&&o&&o.toggleClickThrough(e.memberState.currentApplianceName)};return s.callbacks.on("onRoomStateChanged",e),function(){return s.callbacks.off("onRoomStateChanged",e)}}))),e.emitter.on("destroy",(function(){ae("[Slide] destroy",e.appId),Xt&&qt.delete(e.appId),u.flushAll(),o&&(o.destroy(),o=null)})),o.mount(),{viewer:function(){return o},controller:function(){return null==o?void 0:o.slideController},slide:function(){var e;return null==(e=null==o?void 0:o.slideController)?void 0:e.slide},nextStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.nextStep(),!0)},prevStep:function(){var e;return!(!o||!o.slideController)&&(null==(e=null==o?void 0:o.slideController)||e.slide.prevStep(),!0)},position:function(){var e=null==o?void 0:o.slideController;if(e)return[e.page,e.pageCount]},nextPage:function(){var e=null==o?void 0:o.slideController;if(e){var t=e.page,n=e.pageCount;if(n>0&&t0&&t>1)return e.jumpToPage(t-1),!0}return!1},jumpToPage:function(e){var t=null==o?void 0:o.slideController;if(t){var n=t.page,r=t.pageCount;if(r>0&&n>0&&n<=r)return t.jumpToPage(e),!0}return!1}}}};t.default=rn;var on=L.Slide;t.Slide=on},18808:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t,n,r,i,o,a,s,u;void 0===CanvasRenderingContext2D.prototype.ellipse&&(CanvasRenderingContext2D.prototype.ellipse=function(e,t,n,r,i,o,a,s){this.save(),this.translate(e,t),this.rotate(i),this.scale(n,r),this.arc(0,0,1,o,a,s),this.restore()}),void 0===CanvasRenderingContext2D.prototype.resetTransform&&(CanvasRenderingContext2D.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)}),void 0===CanvasRenderingContext2D.prototype.getTransform&&(CanvasRenderingContext2D.prototype.getTransform=function(){return this._t2stack&&this._t2stack[this._t2stack.length-1]||{a:1,b:0,c:0,d:1,e:0,f:0}},CanvasRenderingContext2D.prototype.save=(t=CanvasRenderingContext2D.prototype.save,function(){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var e=this._t2stack[this._t2stack.length-1];this._t2stack.push(e&&{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}),t.call(this)}),CanvasRenderingContext2D.prototype.restore=(n=CanvasRenderingContext2D.prototype.restore,function(){this._t2stack&&this._t2stack.pop(),n.call(this)}),CanvasRenderingContext2D.prototype.transform=(r=CanvasRenderingContext2D.prototype.transform,function(e,t,n,i,o,a){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var s=this._t2stack[this._t2stack.length-1],u=s.a*e+s.c*t,l=s.b*e+s.d*t,c=s.a*n+s.c*i,h=s.b*n+s.d*i,d=s.e+s.a*o+s.c*a,f=s.f+s.b*o+s.d*a;s.a=u,s.b=l,s.c=c,s.d=h,s.e=d,s.f=f,r.call(this,e,t,n,i,o,a)}),CanvasRenderingContext2D.prototype.setTransform=(i=CanvasRenderingContext2D.prototype.setTransform,function(t,n,r,o,a,s){if(this._t2stack||(this._t2stack=[{}]),"object"===e(t)||void 0===t){var u=t.a,l=t.b,c=t.c,h=t.d,d=t.e,f=t.f;this._t2stack[this._t2stack.length-1]={a:u,b:l,c:c,d:h,e:d,f:f},i.call(this,u,l,c,h,d,f)}else this._t2stack[this._t2stack.length-1]={a:t,b:n,c:r,d:o,e:a,f:s},i.call(this,t,n,r,o,a,s)}),CanvasRenderingContext2D.prototype.resetTransform=(o=CanvasRenderingContext2D.prototype.resetTransform,function(){this._t2stack||(this._t2stack=[{}]),this._t2stack[this._t2stack.length-1]={a:1,b:0,c:0,d:1,e:0,f:0},o&&o.call(this)}),CanvasRenderingContext2D.prototype.scale=(a=CanvasRenderingContext2D.prototype.scale,function(e,t){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var n=this._t2stack[this._t2stack.length-1];e=e||1,t=t||e,n.a*=e,n.c*=t,n.b*=e,n.d*=t,a.call(this,e,t)}),CanvasRenderingContext2D.prototype.rotate=(s=CanvasRenderingContext2D.prototype.rotate,function(e){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var t=this._t2stack[this._t2stack.length-1],n=Math.cos(-e),r=Math.sin(-e),i=t.a*n-t.c*r,o=t.b*n-t.d*r,a=t.c*n+t.a*r,u=t.d*n+t.b*r;return t.a=i,t.b=o,t.c=a,t.d=u,s.call(this,e)}),CanvasRenderingContext2D.prototype.translate=(u=CanvasRenderingContext2D.prototype.translate,function(e,t){this._t2stack||(this._t2stack=[{a:1,b:0,c:0,d:1,e:0,f:0}]);var n=this._t2stack[this._t2stack.length-1];return n.e+=e*n.a+t*n.c,n.f+=e*n.b+t*n.d,u.call(this,e,t)}))},92710:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==r(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}({"./src/CombinePlayerImplement.ts":function(e,t,n){n.d(t,"a",(function(){return y}));var r=n("@babel/runtime/regenerator"),i=n.n(r),o=n("@babel/runtime/helpers/asyncToGenerator"),a=n.n(o),s=n("@babel/runtime/helpers/classCallCheck"),u=n.n(s),l=n("@babel/runtime/helpers/createClass"),c=n.n(l),h=function(e,t,n){"string"==typeof n?console.log("[Combine-Player][".concat(e,"]: ").concat(t," -"),n):console.log("[Combine-Player][".concat(e,"]: ").concat(t," -"),JSON.stringify(n,null,2))},d=n("./src/StatusContant.ts"),f=n("./src/EventEmitter.ts"),p=n("./src/ErrorConstant.ts");function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(this.statusIgnoreCrashByDisabled[0]);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.video;if(t===o.whiteboard&&a===e){r=!0;break}}}catch(e){i.e(e)}finally{i.f()}return!r}},{key:"unlockCombineStatus",value:function(){this.statusLockInfo.isLocked=!1,this.statusLockInfo.allowStatusList=[],this.statusLockInfo.unLockStatusList=[]}},{key:"setPreviousStatus",value:function(e,t){this.whiteboardStatus.previous=e,this.videoStatus.previous=t}},{key:"dispatchEvent",value:function(e){var t=this,n=e.videoStatus,r=e.whiteboardStatus,i=e.combineStatus,o={whiteboard:this.getStatus(d.a.Whiteboard).previous,video:this.getStatus(d.a.Video).previous},a={whiteboard:r,video:n};this.debug("CombinedStatus",i,{previous:{whiteboard:d.b[o.whiteboard],video:d.b[o.video]},current:{whiteboard:d.b[a.whiteboard],video:d.b[a.video]}}),this.events.emit(i,o,a,(function(){t.setPreviousStatus(r,n)}))}},{key:"initTables",value:function(){var e=function(e){return function(t,n){return Object.freeze({combineStatus:e,whiteboardStatus:t,videoStatus:n})}},t=e(d.c.PauseSeeking),n=e(d.c.PlayingSeeking),r=e(d.c.PauseBuffering),i=e(d.c.PlayingBuffering),o=e(d.c.ToPlay),a=e(d.c.ToPause),s=e(d.c.Pause),u=e(d.c.Playing),l=e(d.c.Disabled),c=e(d.c.Ended);return Object.freeze([Object.freeze([t(d.b.PauseSeeking,d.b.PauseSeeking),t(d.b.PauseSeeking,d.b.Pause),l(d.b.PauseSeeking,d.b.PauseBuffering),l(d.b.PauseSeeking,d.b.PlayingBuffering),l(d.b.PauseSeeking,d.b.Playing),l(d.b.PauseSeeking,d.b.PlayingSeeking),t(d.b.PauseSeeking,d.b.Ended)]),Object.freeze([t(d.b.Pause,d.b.PauseSeeking),s(d.b.Pause,d.b.Pause),r(d.b.Pause,d.b.PauseBuffering),i(d.b.Pause,d.b.PlayingBuffering),o(d.b.Pause,d.b.Playing),n(d.b.Pause,d.b.PlayingSeeking),c(d.b.Pause,d.b.Ended)]),Object.freeze([l(d.b.PauseBuffering,d.b.PauseSeeking),r(d.b.PauseBuffering,d.b.Pause),r(d.b.PauseBuffering,d.b.PauseBuffering),l(d.b.PauseBuffering,d.b.PlayingBuffering),l(d.b.PauseBuffering,d.b.Playing),l(d.b.PauseBuffering,d.b.PlayingSeeking),l(d.b.PauseBuffering,d.b.Ended)]),[l(d.b.PlayingBuffering,d.b.PauseSeeking),i(d.b.PlayingBuffering,d.b.Pause),l(d.b.PlayingBuffering,d.b.PauseBuffering),i(d.b.PlayingBuffering,d.b.PlayingBuffering),a(d.b.PlayingBuffering,d.b.Playing),l(d.b.PlayingBuffering,d.b.PlayingSeeking),l(d.b.PlayingBuffering,d.b.Ended)],Object.freeze([l(d.b.Playing,d.b.PauseSeeking),o(d.b.Playing,d.b.Pause),l(d.b.Playing,d.b.PauseBuffering),a(d.b.Playing,d.b.PlayingBuffering),u(d.b.Playing,d.b.Playing),a(d.b.Playing,d.b.PlayingSeeking),a(d.b.Playing,d.b.Ended)]),Object.freeze([l(d.b.PlayingSeeking,d.b.PauseSeeking),n(d.b.PlayingSeeking,d.b.Pause),l(d.b.PlayingSeeking,d.b.PauseBuffering),l(d.b.PlayingSeeking,d.b.PlayingBuffering),a(d.b.PlayingSeeking,d.b.Playing),n(d.b.PlayingSeeking,d.b.PlayingSeeking),n(d.b.PlayingSeeking,d.b.Ended)]),Object.freeze([t(d.b.Ended,d.b.PauseSeeking),c(d.b.Ended,d.b.Pause),l(d.b.Ended,d.b.PauseBuffering),l(d.b.Ended,d.b.PlayingBuffering),a(d.b.Ended,d.b.Playing),n(d.b.Ended,d.b.PlayingSeeking),c(d.b.Ended,d.b.Ended)])])}}]),e}(),g=function(){function e(){u()(this,e),this.queue=[],this.isHanding=!1}var t;return c()(e,[{key:"append",value:function(e){var t=this;return new Promise((function(n,r){var i={handler:e,resolve:n,reject:r};t.queue.push(i),t.isHanding||t.startHandingTasksLoop()}))}},{key:"destroy",value:function(){this.queue=[]}},{key:"startHandingTasksLoop",value:(t=a()(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.isHanding=!0;case 2:if(!(this.queue.length>0)){e.next=20;break}return t=this.queue[0],e.prev=4,e.t0=t,e.next=8,t.handler();case 8:e.t1=e.sent,e.t0.resolve.call(e.t0,e.t1),e.next=15;break;case 12:e.prev=12,e.t2=e.catch(4),t.reject(e.t2);case 15:return e.prev=15,this.queue.shift(),e.finish(15);case 18:e.next=2;break;case 20:e.next=25;break;case 22:throw e.prev=22,e.t3=e.catch(0),new Error(e.t3);case 25:return e.prev=25,this.isHanding=!1,e.finish(25);case 28:case"end":return e.stop()}}),e,this,[[0,22,25,28],[4,12,15,18]])}))),function(){return t.apply(this,arguments)})}]),e}(),y=function(){function e(t){u()(this,e),this.video=void 0,this.whiteboard=void 0,this.videoOptions=void 0,this.stateMachine=void 0,this._playbackRate=1,this.seekTime=NaN,this.triggerSource=d.e.None,this.currentCombineStatus=d.d.PauseBuffering,this.whiteboardEmitter=void 0,this.taskQueue=new g,this.onStatusChangeHandleList=[];var n=t.videoConfig,r=t.whiteboard,i=t.whiteboardEmitter,o=t.debug;this.videoOptions=n.videoOptions,this.video=n.video,this.whiteboard=r,this.whiteboardEmitter=i,this.stateMachine=new m(o),this.initOnCrashByDisabledStatusCallback(),this.initVideo(n.isCanplay),this.initWhiteboard()}var t,n,r,o,s,l,h,f,v,y,b,x,_,w,T,M,S,E;return c()(e,[{key:"setOnStatusChange",value:function(e){this.onStatusChangeHandleList.push(e)}},{key:"removeStatusChange",value:function(e){this.onStatusChangeHandleList=this.onStatusChangeHandleList.filter((function(t){return t!==e}))}},{key:"removeAllStatusChange",value:function(){this.onStatusChangeHandleList=[]}},{key:"getStatus",value:function(){return this.combinedStatus}},{key:"playbackSpeed",value:function(e){this.playbackRate=e}},{key:"stop",value:function(){if(this.currentCombineStatus===d.d.Stopped)throw new Error(p.d);if(this.currentCombineStatus===d.d.Disabled)throw new Error(p.c);this.releaseEvents(),this.onStatusUpdate(d.d.Stopped)}},{key:"play",value:(E=a()(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.taskQueue.append(a()(i.a.mark((function e(){var n,r,o;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.triggerSource=d.e.Plugin,n=t.stateMachine.getCombinationStatus().current,e.t0=n,e.next=e.t0===d.c.Pause?5:e.t0===d.c.PauseBuffering?8:e.t0===d.c.Ended?24:27;break;case 5:return e.next=7,t.playWhenPause();case 7:return e.abrupt("break",27);case 8:if(r=t.stateMachine.getStatus(d.a.Video).current,o=t.stateMachine.getStatus(d.a.Whiteboard).current,r!==d.b.Pause||o!==d.b.PauseBuffering){e.next=15;break}return e.next=13,t.playWhenVideoIsPauseAndWhiteboardIsPauseBuffering();case 13:e.next=23;break;case 15:if(r!==d.b.PauseBuffering||o!==d.b.Pause){e.next=21;break}return t.onStatusUpdate(d.d.PlayingBuffering),e.next=19,t.playWhenPause();case 19:e.next=23;break;case 21:return e.next=23,t.playWhenAllPlayerIsPauseBuffering();case 23:return e.abrupt("break",27);case 24:return e.next=26,t.playWhenEnded();case 26:return e.abrupt("break",27);case 27:if(isNaN(t.seekTime)){e.next=31;break}return e.next=30,t.seekWhenPlaying(t.seekTime);case 30:t.seekTime=NaN;case 31:t.triggerSource=d.e.None;case 32:case"end":return e.stop()}}),e)}))));case 4:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"pause",value:(S=a()(i.a.mark((function e(){var t=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.taskQueue.append(a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.triggerSource=d.e.Plugin,t.stateMachine.getCombinationStatus().current!==d.c.Playing){e.next=5;break}return e.next=5,t.pauseWhenPlaying();case 5:t.triggerSource=d.e.None;case 6:case"end":return e.stop()}}),e)})))));case 3:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"seek",value:(M=a()(i.a.mark((function e(t){var n=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isNotResponse()){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.taskQueue.append(a()(i.a.mark((function e(){var r,o,a,s,u,l,c,h,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.whiteboard.progressTime,o=n.video.currentTime(),0!==r||0!==o){e.next=5;break}return 0!==t&&(n.seekTime=t),e.abrupt("return");case 5:n.triggerSource=d.e.Plugin,a=n.stateMachine.getCombinationStatus().current,e.t0=a,e.next=e.t0===d.c.Playing?10:e.t0===d.c.Pause||e.t0===d.c.PauseBuffering?13:e.t0===d.c.Ended?23:30;break;case 10:return e.next=12,n.seekWhenPlaying(t);case 12:return e.abrupt("break",30);case 13:if(s=n.getPlayerDuration(),u=s.video,l=s.whiteboard,!(t>u||t>l)){e.next=20;break}return e.next=18,n.seekWhenPauseFinallyIsEnded(t,s);case 18:e.next=22;break;case 20:return e.next=22,n.seekWhenPause(t);case 22:return e.abrupt("break",30);case 23:if(c=n.getPlayerDuration(),h=c.video,f=c.whiteboard,!(t<=h&&t<=f)){e.next=29;break}return e.next=27,n.seekWhenPause(t);case 27:return e.next=29,n.playWhenPause();case 29:return e.abrupt("break",30);case 30:n.triggerSource=d.e.None;case 31:case"end":return e.stop()}}),e)})))));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"initVideo",value:function(e){this.stateMachine.setStatus(d.a.Video,e?d.b.Pause:d.b.PauseBuffering),e||(this.currentCombineStatus=d.d.PauseBuffering),this.initVideoJSEvents()}},{key:"initVideoJSEvents",value:function(){var e=this,t=!1,n=function(t){return a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.triggerSource!==d.e.None&&e.triggerSource!==d.e.Video){n.next=4;break}return e.triggerSource=d.e.Video,n.next=4,t();case 4:case"end":return n.stop()}}),n)})))};this.video.on("canplay",(function(){var t=e.stateMachine.getStatus(d.a.Whiteboard).current;e.stateMachine.getStatus(d.a.Video).current===d.b.PauseBuffering&&(e.stateMachine.setStatus(d.a.Video,d.b.Pause),t===d.b.Pause&&e.onStatusUpdate(d.d.Pause))})),this.video.on("seeking",n(a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.taskQueue.append((function(){t=!0}));case 2:case"end":return n.stop()}}),n)}))))),this.video.on("waiting",n(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.onStatusUpdate(d.d.PlayingBuffering),t.next=3,e.taskQueue.append((function(){return e.pauseWhiteboardWhenVideoWaiting()}));case 3:e.triggerSource=d.e.None;case 4:case"end":return t.stop()}}),t)}))))),this.video.on("playing",n(a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.taskQueue.append(a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=2;break}return n.abrupt("return",e.playingWhiteboardWhenVideoPlayingDropFrame());case 2:return n.abrupt("return",e.playingWhiteboardWhenVideoPlaying());case 3:case"end":return n.stop()}}),n)}))));case 2:t=!1,e.triggerSource=d.e.None;case 4:case"end":return n.stop()}}),n)}))))),this.video.on("ended",n(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseWhiteboardWhenVideoEnded()}));case 2:e.triggerSource=d.e.None;case 3:case"end":return t.stop()}}),t)}))))),this.video.on("fullscreenchange",n(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){var t=e.stateMachine.getStatus(d.a.Video).current;t!==d.b.Playing&&t!==d.b.PlayingBuffering||!e.video.isFullscreen()&&e.video.paused()&&(e.whiteboardEmitter.one("pause",(function(){e.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause),e.stateMachine.setStatus(d.a.Video,d.b.Pause),e.onStatusUpdate(d.d.Pause)})),e.whiteboard.pause()),e.triggerSource=d.e.None}));case 2:case"end":return t.stop()}}),t)})))))}},{key:"initWhiteboard",value:function(){this.initWhiteboardIsPlayable(),this.initWhiteboardEvents(),this.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseBuffering),this.currentCombineStatus=d.d.PauseBuffering,this.whiteboard.seekToProgressTime(0)}},{key:"initWhiteboardIsPlayable",value:function(){var e=this;this.whiteboardEmitter.addListener("playableChange",(function(t){var n=e.stateMachine.getStatus(d.a.Whiteboard).current,r=e.stateMachine.getStatus(d.a.Video).current;t&&n===d.b.PauseBuffering&&(e.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause),r===d.b.Pause&&e.onStatusUpdate(d.d.Pause))}))}},{key:"initWhiteboardEvents",value:function(){var e=this,t=function(t){return a()(i.a.mark((function n(){return i.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.triggerSource!==d.e.None&&e.triggerSource!==d.e.Whiteboard){n.next=5;break}return e.triggerSource=d.e.Whiteboard,n.next=4,t();case 4:e.triggerSource=d.e.None;case 5:case"end":return n.stop()}}),n)})))};this.whiteboardEmitter.addListener("buffering",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseVideoWhenWhiteboardBuffering()}));case 2:case"end":return t.stop()}}),t)}))))),this.whiteboardEmitter.addListener("playing",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.playingVideoWhenWhiteboardPlaying()}));case 2:case"end":return t.stop()}}),t)}))))),this.whiteboardEmitter.addListener("ended",t(a()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.taskQueue.append((function(){return e.pauseVideoWhenWhiteboardEnded()}));case 2:case"end":return t.stop()}}),t)})))))}},{key:"playWhenPause",value:(T=a()(i.a.mark((function e(){var t,n,r,o,s=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){s.stateMachine.setStatus(d.a.Video,d.b.Playing)},n=function(){s.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},this.whiteboardEmitter.one("playing",n),r=this.stateMachine.one(d.c.ToPlay,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),o=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.onStatusUpdate(d.d.Playing);case 1:case"end":return e.stop()}}),e)})))),this.video.one("playing",t),this.video.play(),e.next=10,Promise.all([r,o]);case 10:case"end":return e.stop()}}),e,this)}))),function(){return T.apply(this,arguments)})},{key:"playWhenVideoIsPauseAndWhiteboardIsPauseBuffering",value:(w=a()(i.a.mark((function e(){var t,n,r,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.Pause,d.c.PauseBuffering,d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){f.stateMachine.setStatus(d.a.Video,d.b.Playing)},n=function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)},r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingBuffering)},o=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},s=function(){f.whiteboardEmitter.removeListener("playing",o),f.whiteboardEmitter.removeListener("buffering",r),f.video.off("playing",t),f.video.off("pause",n)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.Playing,whiteboard:d.b.PauseBuffering}],a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.video.pause();case 1:case"end":return e.stop()}}),e)})))).catch((function(e){throw Error(e)})),u=this.stateMachine.one(d.c.PauseBuffering,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),l=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.whiteboard.play();case 1:case"end":return e.stop()}}),e)})))),c=this.stateMachine.one(d.c.ToPlay,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.video.play();case 1:case"end":return e.stop()}}),e)})))),h=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.onStatusUpdate(d.d.Playing),f.stateMachine.off([d.c.PauseBuffering,d.c.Pause,d.c.ToPlay]),s();case 3:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",r),this.whiteboardEmitter.one("playing",o),this.video.on("playing",t),this.video.one("pause",n),this.video.play(),e.next=18,Promise.all([Promise.race([u,l]),c,h]);case 18:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"playWhenAllPlayerIsPauseBuffering",value:(_=a()(i.a.mark((function e(){var t,n,r,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.ToPause,d.c.ToPlay,d.c.Playing],[d.c.Playing]),t=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingBuffering)},n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Playing)},r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},o=function(){f.stateMachine.setStatus(d.a.Video,d.b.Playing)},s=function(){f.stateMachine.setStatus(d.a.Video,d.b.PlayingBuffering)},u=function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.PlayingBuffering,whiteboard:d.b.PauseBuffering},{video:d.b.PauseBuffering,whiteboard:d.b.PlayingBuffering}],a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.stateMachine.oneButNotCrashByDisabled([{video:d.b.Playing,whiteboard:d.b.PauseBuffering},{video:d.b.PauseBuffering,whiteboard:d.b.Playing}],function(){var e=a()(i.a.mark((function e(t){var n;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=t.current).video===d.b.Playing?f.video.pause():n.whiteboard===d.b.Playing&&f.whiteboard.pause();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){throw Error(e)}));case 1:case"end":return e.stop()}}),e)})))).catch((function(e){throw Error(e)})),l=this.stateMachine.one(d.c.ToPause,function(){var e=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.current.video===d.b.Playing?f.video.pause():f.whiteboard.pause();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c=this.stateMachine.one(d.c.ToPlay,function(){var e=a()(i.a.mark((function e(t){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.current.video===d.b.Playing?f.whiteboard.play():f.video.play();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),h=this.stateMachine.one(d.c.Playing,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.onStatusUpdate(d.d.Playing),f.stateMachine.cancelOneButNotCrashByDisabled(),f.stateMachine.off([d.c.ToPause,d.c.ToPlay]),f.video.off("playing",o),f.whiteboardEmitter.removeListener("playing",n),f.whiteboardEmitter.removeListener("pause",r);case 6:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",t),this.whiteboardEmitter.addListener("playing",n),this.whiteboardEmitter.one("pause",r),this.video.on("playing",o),this.video.one("play",s),this.video.one("pause",u),this.video.play(),this.whiteboard.play(),e.next=21,Promise.all([Promise.race([l,c]),h]);case 21:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"playWhenEnded",value:(x=a()(i.a.mark((function e(){var t,n,r,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PlayingBuffering),t=NaN,this.stateMachine.lockCombineStatus([d.c.Pause],[d.c.Pause]),n=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseSeeking)},r=function(){f.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},o=function(){f.whiteboard.pause()},s=function(){f.video.off("pause",u),f.video.off("play",l),f.video.one("play",(function(){f.video.one("pause",(function(){f.stateMachine.setStatus(d.a.Video,d.b.Pause)})),f.video.pause()})),f.video.play()},u=function(){f.video.play()},l=function(){f.video.pause()},c=function(){f.stateMachine.setStatus(d.a.Video,d.b.PauseSeeking),t=window.setInterval((function(){f.video.readyState()>=d.f.HAVE_CURRENT_DATA&&(clearInterval(t),f.video.play())}),500)},h=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f.whiteboardEmitter.removeListener("buffering",n),f.whiteboardEmitter.removeListener("playing",o),clearInterval(t),e.next=5,f.playWhenPause();case 5:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("buffering",n),this.whiteboardEmitter.one("pause",r),this.whiteboardEmitter.one("playing",o),this.video.one("seeking",c),this.video.one("seeked",s),this.video.on("play",l),this.video.on("pause",u),this.whiteboard.seekToProgressTime(0),this.video.currentTime(0),e.next=22,h;case 22:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"pauseWhenPlaying",value:(b=a()(i.a.mark((function e(){var t,n,r,o=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateMachine.lockCombineStatus([d.c.Pause],[d.c.Pause]),t=function(){o.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},n=function(){o.stateMachine.setStatus(d.a.Video,d.b.Pause)},r=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o.onStatusUpdate(d.d.Pause);case 1:case"end":return e.stop()}}),e)})))),this.whiteboardEmitter.one("pause",t),this.video.one("pause",n),this.whiteboard.pause(),this.video.pause(),e.next=10,r;case 10:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"seekWhenPlaying",value:(y=a()(i.a.mark((function e(t){var n,r,o,s,u,l,c,h,f,p,v,m=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PlayingSeeking),n=NaN,r=this.getPlayerDuration(),this.stateMachine.lockCombineStatus([d.c.Pause,d.c.Ended,d.c.PlayingSeeking],[d.c.Pause,d.c.Ended]),o=function(){m.stateMachine.setStatus(d.a.Whiteboard,d.b.PlayingSeeking)},s=function(){t=d.f.HAVE_CURRENT_DATA&&(clearInterval(n),t=d.f.HAVE_CURRENT_DATA&&(clearInterval(n),h.stateMachine.setStatus(d.a.Video,d.b.Pause))}),500)},o=function(){h.stateMachine.setStatus(d.a.Whiteboard,d.b.PauseSeeking)},s=function(){h.stateMachine.setStatus(d.a.Whiteboard,d.b.Pause)},u=function(){h.whiteboard.pause()},l=function(){clearInterval(n),h.video.off("seeking",r),h.whiteboardEmitter.removeListener("buffering",o),h.whiteboardEmitter.removeListener("pause",s)},this.stateMachine.oneButNotCrashByDisabled([{video:d.b.PauseSeeking,whiteboard:d.b.PauseSeeking}]).catch((function(e){throw Error(e)})),c=this.stateMachine.one(d.c.Pause,a()(i.a.mark((function e(){return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.onStatusUpdate(d.d.Pause),h.stateMachine.cancelOneButNotCrashByDisabled(),h.stateMachine.off(d.c.Ended),h.whiteboardEmitter.removeListener("playing",u),l();case 5:case"end":return e.stop()}}),e)})))),this.video.one("seeking",r),this.whiteboardEmitter.one("buffering",o),this.whiteboardEmitter.one("playing",u),this.whiteboardEmitter.one("pause",s),this.whiteboard.seekToProgressTime(t),this.video.currentTime(t/1e3),e.next=18,c;case 18:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"seekWhenPauseFinallyIsEnded",value:(f=a()(i.a.mark((function e(t,n){var r,o,s,u,l,c,h,f=this;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.onStatusUpdate(d.d.PauseSeeking),r=NaN,this.stateMachine.lockCombineStatus([d.c.Disabled,d.c.Ended],[d.c.Ended]),o=function(){f.stateMachine.setStatus(d.a.Video,d.b.PauseSeeking),r=window.setInterval((function(){f.video.readyState()>=d.f.HAVE_CURRENT_DATA&&(clearInterval(r),f.stateMachine.setStatus(d.a.Video,d.b.Pause),t>=n.video&&f.stateMachine.setStatus(d.a.Video,d.b.Ended))}),500)},s=function(){t1?t-1:0),r=1;r2&&void 0!==arguments[2]&&arguments[2];a()(this,e),this.videoOptions=void 0,this.whiteboard=void 0,this.debug=void 0,Object(l.a)(n);var i=e.videoDefaultOptions(n);this.videoOptions=y(y(y({},i),n),{},{videoJsOptions:y(y({},i.videoJsOptions),n.videoJsOptions)}),this.whiteboard=t,this.debug=r}return u()(e,[{key:"create",value:function(){var e=new c.a;this.handleWhiteboardCallback(e);var t=this.getVideoDOM(),n=f()(t,this.videoOptions.videoJsOptions);return n.src(this.videoOptions.url),new h.a({videoConfig:{videoOptions:this.videoOptions,video:n,isCanplay:n.readyState()>p.f.HAVE_CURRENT_DATA},whiteboard:this.whiteboard,whiteboardEmitter:e,debug:this.debug})}},{key:"getVideoDOM",value:function(){return void 0!==this.videoOptions.videoElementID?document.getElementById(this.videoOptions.videoElementID):this.videoOptions.videoDOM}},{key:"handleWhiteboardCallback",value:function(e){this.whiteboard.callbacks.on("onPhaseChanged",(function(t){e.emit(t)})),this.whiteboard.callbacks.on("onIsPlayableChanged",(function(t){e.emit("playableChange",t)}))}}],[{key:"videoDefaultOptions",value:function(e){var t={videoJsOptions:{preload:"auto"}};return e.videoDOM||e.videoElementID||(t.videoDOM=document.createElement("video")),t}}]),e}()},0:function(e,t,n){e.exports=n("./src/index.ts")},"@babel/runtime/helpers/asyncToGenerator":function(e,t){e.exports=n(34397)},"@babel/runtime/helpers/classCallCheck":function(e,t){e.exports=n(57750)},"@babel/runtime/helpers/createClass":function(e,t){e.exports=n(67338)},"@babel/runtime/helpers/defineProperty":function(e,t){e.exports=n(91566)},"@babel/runtime/regenerator":function(e,t){e.exports=n(64910)},"video.js":function(e,t){e.exports=n(30825)}})},20597:function(e,t,n){var r,i,o,a;function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}e=n.nmd(e),window,a=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==s(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"},function(e,t){e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="},function(e,t,n){n.r(t),n.d(t,"CursorTool",(function(){return y}));var r,i=n(0),o=n(1),a=n(2),s=n.n(a),u=n(3),l=n.n(u),c=n(4),h=n.n(c),d=n(5),f=n.n(d),p=n(6),v=n.n(p),m=(n(8),r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),g=function(e){function t(t){var n=e.call(this,t)||this;return n.renderAvatar=function(e){var t,r="rgb("+e.memberState.strokeColor[0]+", "+e.memberState.strokeColor[1]+", "+e.memberState.strokeColor[2]+")";if(n.detectAvatar(e)){var o=n.detectCursorName(e);return i.createElement("img",{className:"cursor-selector-avatar",style:{width:o?19:28,height:o?19:28,position:o?"initial":"absolute",borderColor:o?"white":r,marginRight:o?4:0},src:null===(t=e.payload)||void 0===t?void 0:t.avatar,alt:"avatar"})}return null},n.getOpacity=function(e){var t=n.getCursorName(e),r=n.detectAvatar(e);return void 0===t&&void 0===r?0:1},n.getCursorName=function(e){return e.payload&&e.payload.cursorName?e.payload.cursorName:void 0},n.getThemeClass=function(e){return e.payload&&e.payload.theme?"cursor-inner-mellow":"cursor-inner"},n.getCursorBackgroundColor=function(e){var t=n.detectCursorName(e);return e.payload&&e.payload.cursorBackgroundColor?e.payload.cursorBackgroundColor:t?"rgb("+e.memberState.strokeColor[0]+", "+e.memberState.strokeColor[1]+", "+e.memberState.strokeColor[2]+")":void 0},n.getCursorTextColor=function(e){return e.payload&&e.payload.cursorTextColor?e.payload.cursorTextColor:"#FFFFFF"},n.getCursorTagBackgroundColor=function(e){return e.payload&&e.payload.cursorTagBackgroundColor?e.payload.cursorTagBackgroundColor:n.getCursorBackgroundColor(e)},n.detectCursorName=function(e){return!(!e.payload||!e.payload.cursorName)},n.detectAvatar=function(e){return!(!e.payload||!e.payload.avatar)},n.renderTag=function(e){return e.payload&&e.payload.cursorTagName?i.createElement("span",{className:"cursor-tag-name",style:{backgroundColor:n.getCursorTagBackgroundColor(e)}},e.payload.cursorTagName):void 0},n}return m(t,e),t.prototype.render=function(){var e=this.props.roomMember,t=this.getCursorName(e);switch(e.memberState.currentApplianceName){case o.ApplianceNames.pencil:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-pencil-offset"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{className:"cursor-pencil-image",src:s.a,alt:"pencilCursor"}))));case o.ApplianceNames.selector:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-selector-offset"},i.createElement("div",null,i.createElement("img",{className:"cursor-selector-image",src:l.a,alt:"selectorCursor"})),i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e)))));case o.ApplianceNames.eraser:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-mid cursor-pencil-offset"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{className:"cursor-pencil-image",src:h.a,alt:"selectorCursor"}))));case o.ApplianceNames.text:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-text-offset cursor-mid"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{src:v.a,alt:"selectorCursor"}))));default:return i.createElement("div",{className:"cursor-box"},i.createElement("div",{className:"cursor-shape-offset cursor-mid"},i.createElement("div",{className:"cursor-name"},i.createElement("div",{style:{opacity:this.getOpacity(e),backgroundColor:this.getCursorBackgroundColor(e),color:this.getCursorTextColor(e)},className:this.getThemeClass(e)},this.renderAvatar(e),t,this.renderTag(e))),i.createElement("div",null,i.createElement("img",{src:f.a,alt:"shapeCursor"}))))}},t}(i.Component),y=function(){function e(){this.cursors={},this.roomMembers=[],this.isFirstFrameReady=!1,this.isCursorDisappear=function(e){return!(!e.payload||!e.payload.disappearCursor)}}return e.prototype.createCursor=function(){return{x:64,y:64,width:128,height:128}},e.prototype.onAddedCursor=function(e){for(var t=0,n=this.roomMembers;t0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]this.totalPage)return;this.displayer.setSceneIndex(e-1),this.dispatchMagixEvent(h.NextPage,{})}},t.prototype.handlePrevPage=function(){if(this.canOperation){var e=this.currentPage-1;if(e<0)return;this.displayer.setSceneIndex(e-1),this.dispatchMagixEvent(h.PrevPage,{})}},t.prototype.handlePageTo=function(e){if(this.canOperation){var t=e.payload;if(!Number.isSafeInteger(t)||t<=0)return;var n=t-1;this.displayer.setSceneIndex(n),this.dispatchMagixEvent(h.PageTo,n)}},t.prototype.handleRemoveAllMagixEvent=function(){var e=this;this.magixEventMap.forEach((function(t,n){e.displayer.removeMagixEventListener(n,t)})),this.magixEventMap.clear()},t.prototype.handleGetAttributes=function(){this.postMessage({kind:h.GetAttributes,payload:this.attributes})},t.prototype.postMessage=function(e){var t;this.iframe&&(null===(t=this.iframe.contentWindow)||void 0===t||t.postMessage(JSON.parse(JSON.stringify(e)),"*"))},t.prototype.dispatchMagixEvent=function(t,n){this.canOperation&&(e.prototype.setAttributes.call(this,{lastEvent:{name:t,payload:n}}),this.displayer.dispatchMagixEvent(t,n))},Object.defineProperty(t.prototype,"currentIndex",{get:function(){return this.displayer.state.sceneState.index},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPage",{get:function(){return this.currentIndex+1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalPage",{get:function(){return this.displayer.state.sceneState.scenes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return!this.displayer.isWritable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReplay",{get:function(){return(0,o.isPlayer)(this.displayer)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisplaySceneDir",{get:function(){return this.displayer.state.sceneState.scenePath.startsWith(this.attributes.displaySceneDir)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canOperation",{get:function(){return!this.isReplay&&(!this.readonly&&this.displayer.phase===o.RoomPhase.Connected)},enumerable:!1,configurable:!0}),t.prototype.isClicker=function(){if(this.readonly)return!1;var e=this.displayer.state.memberState.currentApplianceName;return this.allowAppliances.includes(e)},Object.defineProperty(t.prototype,"isDisableInput",{get:function(){return!("disableDeviceInputs"in this.displayer)||this.displayer.disableDeviceInputs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iframeOrigin",{get:function(){return this.iframe?new URL(this.iframe.src).origin:void 0},enumerable:!1,configurable:!0}),t.prototype._destory=function(){var e=this;window.removeEventListener("message",this.messageListener),this.magixEventMap.forEach((function(t,n){e.displayer.removeMagixEventListener(n,t)})),this.displayer.callbacks.off(this.callbackName,this.stateChangeListener),this.displayer.callbacks.off("onPhaseChanged",this.onPhaseChangedListener),this.magixEventMap.clear(),this.iframe&&(t.emitter.emit(h.Destory),this.iframe=null,t.alreadyCreate=!1),this.bridgeDisposer(),t.emitter.removeAllListeners()},t.kind="IframeBridge",t.emitter=new a.EventEmitter2,t.alreadyCreate=!1,t}(o.InvisiblePlugin);t.IframeBridge=g},24182:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.times=void 0;t.times=function(e,t){return new Array(e).fill(0).map((function(e,n){return t(n)}))}},82372:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.EffectPlugin=void 0;var r,i=n(26913),o=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(n,r,i){var o,a,s,u,l,c,h,d=e.call(this)||this;return d._volume=50,d._currentTime=0,d._isPaused=!0,d._duration=0,d.timer=null,d._startPos=0,d.onDurationBack=function(e,t){d.url===e&&(d._duration=t/1e3),d.emit("load")},d.onEffectStop=function(e){e===d.soundIndex&&(window.clearInterval(d.timer),d._isPaused=!0,d._duration=0,d._currentTime=0,d.emit("pause"))},d.onEffectPause=function(e){e===d.soundIndex&&(d._isPaused=!0,d.emit("pause"))},d.onEffectPlay=function(e){e===d.soundIndex&&(d.timer&&clearInterval(d.timer),d.timer=window.setInterval((function(){var e;null===(e=t.audioEffector)||void 0===e||e.getEffectCurrentPosition(d.soundIndex).then((function(e){var n;d._currentTime=e,null===(n=t.ctx)||void 0===n||n.logger.info("rtc callback position, "+e+", endPos: "+d._endPos)})).catch((function(){}))}),300),d._isPaused=!1,d.emit("play"))},null===(o=t.ctx)||void 0===o||o.logger.info("url: "+n+", start: "+r+", end: "+i),d.url=n,r&&(d._startPos=r),i&&(d._endPos=i),d.soundIndex=t.nextSoundIndex(),window.addEventListener("message",(function(e){e.data&&"resumeAllAudioInterruptByAudioSessionChanged"===e.data.name&&d.emit("resumeAllAudioInterruptByAudioSessionChanged")})),null===(a=t.audioEffector)||void 0===a||a.on("play",d.onEffectPlay),null===(s=t.audioEffector)||void 0===s||s.on("pause",d.onEffectPause),null===(u=t.audioEffector)||void 0===u||u.on("effectFinished",d.onEffectPause),null===(l=t.audioEffector)||void 0===l||l.on("error",d.onEffectStop),null===(c=t.audioEffector)||void 0===c||c.on("duration",d.onDurationBack),null===(h=t.audioEffector)||void 0===h||h.getEffectDuration(d.url),d.onEffectPause(d.soundIndex),d}return o(t,e),t.nextSoundIndex=function(){return t.soundIndex+=1,t.soundIndex},t.prototype.play=function(){var e,n,r;clearInterval(this.timer),null===(e=t.ctx)||void 0===e||e.logger.info("effect play call, "+this.url),null===(n=t.ctx)||void 0===n||n.logger.info("play "+this.url+" from "+this._startPos+" by slide, current is "+this.currentTime),null===(r=t.audioEffector)||void 0===r||r.playEffect(this.soundIndex,this.url,0,1,0,this._volume,!1,Math.max(this._currentTime,this._startPos))},t.prototype.pause=function(){var e,n;null===(e=t.ctx)||void 0===e||e.logger.info(this.url+" pause by slide"),null===(n=t.audioEffector)||void 0===n||n.pauseEffect(this.soundIndex)},t.prototype.destroy=function(){var e,n,r,i,o,a,s,u;this._startPos=0,window.clearInterval(this.timer),null===(e=t.ctx)||void 0===e||e.logger.info(this.url+" destroy by slide"),null===(n=t.audioEffector)||void 0===n||n.stopEffect(this.soundIndex),null===(r=t.audioEffector)||void 0===r||r.unloadEffect(this.soundIndex),null===(i=t.audioEffector)||void 0===i||i.removeListener("play",this.onEffectPlay),null===(o=t.audioEffector)||void 0===o||o.removeListener("pause",this.onEffectPause),null===(a=t.audioEffector)||void 0===a||a.removeListener("effectFinished",this.onEffectPause),null===(s=t.audioEffector)||void 0===s||s.removeListener("error",this.onEffectStop),null===(u=t.audioEffector)||void 0===u||u.removeListener("duration",this.onDurationBack)},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._currentTime/1e3},set:function(e){var n;this._currentTime=1e3*e,null===(n=t.audioEffector)||void 0===n||n.setEffectPosition(this.soundIndex,1e3*e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this._isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),t.prototype.volume=function(e){var n;null===(n=t.audioEffector)||void 0===n||n.setEffectsVolume(100*e)},t.audioEffector=null,t.ctx=null,t.soundIndex=0,t}(i.EventEmitter),s=function(){function e(e){this.hookPoint="Slide.initConfig",this.rtc=e}return e.prototype.after=function(e){return e},e.prototype.before=function(e){var t=e[0];return a.audioEffector=this.rtc,t.rtcAudio=a,[t]},e.prototype.context=function(e){a.ctx=e},e}();t.EffectPlugin=s},29181:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.MixingPlugin=void 0;var r,i=n(26913),o=n(5495),a=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});var s=function(e){function t(n){var r=e.call(this)||this;return r.isStartPlaying=!1,r.isAudioPlaying=!1,r._volume=50,r.commandCaches=[],r.onError=function(e){var n;null===(n=t.ctx)||void 0===n||n.logger.error("audio error: "+e)},r.onAudioStalled=function(){var e;null===(e=t.ctx)||void 0===e||e.logger.warn(r.url+" Failed to fetch data, but trying.")},r.onMetaLoaded=function(){var e;null===(e=t.ctx)||void 0===e||e.logger.info(r.url+" load"),r.emit("load")},r.onAudioPlay=function(){var e,n,i,o;null===(e=t.ctx)||void 0===e||e.logger.info(r.url+" audio play"),null===(n=t.audioMixer)||void 0===n||n.startAudioMixing(r.url,!1,!1,1,(i=function(e,n){var i,o,a;r.isAudioPlaying=!0,r.isStartPlaying=!1,r.emit("play");var s=r.audio.seek();null===(i=t.audioMixer)||void 0===i||i.setAudioMixingPosition(Math.round(1e3*s)),(null===(o=t.audioMixer)||void 0===o?void 0:o.adjustAudioMixingVolume)&&(null===(a=t.audioMixer)||void 0===a||a.adjustAudioMixingVolume(r._volume)),r.commandCaches.forEach((function(e){return e()})),r.commandCaches=[]},o=0,function(){for(var e=[],t=0;t0&&void 0!==arguments[0]?arguments[0]:O.kind;return e=function(e){s(n,e);var t=l(n);function n(){return b(this,n),t.apply(this,arguments)}return n}(O),e.kind=t,e},t.SyncedStorePlugin=t.SyncedStore=t.Storage=t.STORAGE_NS=t.MAIN_STORAGE=void 0;var r=n(71895),i=n(73549),o=n(63266),a=n(5094);function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}function c(e,t){return!t||"object"!==T(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){p(o,r,i,a,s,"next",e)}function s(e){p(o,r,i,a,s,"throw",e)}a(void 0)}))}}function m(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:(0,i.genUID)();return w(t={},A,1),w(t,"k",n),w(t,"v",e),t}(e,this.genKey()),this.refMap.set(e,t)),this.refKeys.add(t.k),t}},{key:"deleteRefKey",value:function(e){var t=this.state[e],n=this.refMap.get(t);return n&&this.refKeys.delete(n.k),t}}]),e}(),C="_WM-StOrAgE_";t.STORAGE_NS=C;var N="_WM-MaIn-StOrAgE_";t.MAIN_STORAGE=N;var k=function(){function e(t){var n=this,a=t.plugin$,s=t.isWritable$,u=t.namespace,l=void 0===u?N:u,c=t.defaultState,h=void 0===c?{}:c;if(b(this,e),this._sideEffect=new i.SideEffectManager,this._events=new o.Remitter,this._disconnected=!1,h&&!M(h))throw new Error("Default state for Storage ".concat(l," is not an object."));this.on=this._events.on.bind(this._events),this.off=this._events.off.bind(this._events);var d=function(){var e,t;return null==(t=null==(e=a.value)?void 0:e.attributes[C])?void 0:t[l]};this.namespace=l,this.defaultState=h,this._plugin$=a,this._isWritable$=s,this._refine=new I((0,r.toJS)(d()),h);var f=function(e){e&&n._events.emit("stateChanged",e)},p=function(){var e,t=(0,r.reaction)(d,(function(){var t=d();t&&(f(n._refine.replaceState((0,r.toJS)(t))),null==e||e(),e=function(e){var t=function(e){if(!(e.length<=0)){for(var t={},i=!1,o=0;o0&&n._sideEffect.addDisposer(t,"plugin-init")})))}return _(e,[{key:"setState",value:function(e){var t=this._requireAccess("setState");if(!this.isWritable)throw new Error('Cannot setState on Storage "'.concat(this.namespace,'" without writable access'));for(var n=E(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?function(){return e.forEach(h)}:e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),n=e();return n?this.addDisposer(n,t):t}},{key:"addEventListener",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,n,r),this.addDisposer((function(){return e.removeEventListener(t,n,r)}),i),i}},{key:"setTimeout",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){n.remove(r),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),r)}},{key:"setInterval",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),r=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(r)}),n)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach(h),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=c()}while(this.disposers.has(e));return e}}]),e}();t.SideEffectManager=d;var f=function(){function e(){i(this,e),this.finished=Promise.resolve(),this.disposers=new Map,this._nextTask=new Map,this._isRunning=new Set}var t,n;return a(e,[{key:"add",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this._isRunning.has(n)?this._nextTask.set(n,(function(){return t._add(e,n)})):this._add(e,n),n}},{key:"_add",value:(n=r(regeneratorRuntime.mark((function e(t,n){var i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._startTask(n),!(i=this.remove(n))){e.next=11;break}return e.prev=3,e.next=6,i();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0);case 11:return e.prev=11,e.next=14,t();case 14:(o=e.sent)&&this.disposers.set(n,Array.isArray(o)?r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(o.map(h)));case 1:case"end":return e.stop()}}),e)}))):o),e.next=21;break;case 18:e.prev=18,e.t1=e.catch(11),console.error(e.t1);case 21:this._endTask(n),(a=this._nextTask.get(n))&&(this._nextTask.delete(n),a());case 24:case"end":return e.stop()}}),e,this,[[3,8],[11,18]])}))),function(e,t){return n.apply(this,arguments)})},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.add((function(){return e}),t)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this;this._isRunning.has(e)?this._nextTask.set(e,(function(){return t._flush(e)})):this._flush(e)}},{key:"_flush",value:(t=r(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.remove(t))){e.next=12;break}return this._startTask(t),e.prev=3,e.next=6,n();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0);case 11:this._endTask(t);case 12:(r=this._nextTask.get(t))&&(this._nextTask.delete(t),r());case 14:case"end":return e.stop()}}),e,this,[[3,8]])}))),function(e){return t.apply(this,arguments)})},{key:"flushAll",value:function(){var e=this;this.disposers.forEach((function(t,n){return e.flush(n)}))}},{key:"genUID",value:function(){var e;do{e=c()}while(this.disposers.has(e));return e}},{key:"_startTask",value:function(e){var t=this;this._isRunning.add(e),this._resolveFinished||(this.finished=new Promise((function(e){t._resolveFinished=e})))}},{key:"_endTask",value:function(e){this._isRunning.delete(e),this._resolveFinished&&this._isRunning.size<=0&&this._nextTask.size<=0&&(this._resolveFinished(),this._resolveFinished=void 0)}}]),e}();t.AsyncSideEffectManager=f},59849:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.videoJsPlugin=t.Version=t.PluginId=void 0;var r,i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==w(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(17328)),o=(r=n(30825))&&r.__esModule?r:{default:r},a=n(71895);function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,s,"next",e)}function s(e){u(o,r,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n=t||n<0||h&&e-l>=o}function m(){var e=ne();if(v(e))return g(e);s=setTimeout(m,function(e){var n=t-(e-u);return h?ie(n,o-(e-l)):n}(e))}function g(e){return s=void 0,d&&r?f(e):(r=i=void 0,a)}function y(){var e=ne(),n=v(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(m,t),f(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=te(t)||0,q(n)&&(c=!!n.leading,o=(h="maxWait"in n)?re(te(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},y.flush=function(){return void 0===s?a:g(ne())},y};function ae(e){var t=document.createElement("style"),n=document.createTextNode(e);t.appendChild(n),document.head.appendChild(t)}ae(".vjs-p .player-controller{position:absolute;z-index:100;bottom:0px;left:0;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;height:64px;background-image:linear-gradient(0deg,#000,transparent);transition:opacity .2s}.vjs-p .player-menu-box{display:flex;align-items:center;justify-content:center;flex-direction:column;margin-bottom:40px}.vjs-p .player-menu-cell{width:100%;text-align:center;font-size:12px;color:#7a7b7c}.vjs-p .player-multiple-play{width:64px;height:120px}.vjs-p .player-controller-actions-left{display:flex;justify-content:center;align-items:center;flex-shrink:0}.vjs-p .player-right-box{font-size:14px;color:#7a7b7c;cursor:pointer;margin-right:12px}.vjs-p .player-controller-actions{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-left:8px;padding-right:8px;margin-top:2px}.vjs-p .player-mid-box-time{font-size:9px;display:flex;justify-content:center;align-items:center;color:#fff;flex-shrink:0;margin-right:8px;font-family:monospace}.vjs-p .player-controller-play{display:flex;align-items:center;justify-content:center;cursor:pointer;padding-right:4px}.vjs-p .player-controller-progress{width:calc(100% - 28px);margin-left:14px;display:flex;align-items:center;justify-content:center;margin-top:8px}.vjs-p .player-volume{display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:16px;margin-left:16px}.vjs-p .player-volume-slider{width:60px;margin-right:12px;display:flex;align-items:center}.vjs-p .player-volume-box{display:flex;flex-direction:row}\n");ae(".vjs-p .seek-slider{position:relative;width:100%}.vjs-p .seek-slider:focus{outline:none}.vjs-p .seek-slider .track{padding:10px 0;cursor:pointer;outline:none}.vjs-p .seek-slider .track:focus{border:0;outline:none}.vjs-p .seek-slider .track .main{width:100%;height:3px;background-color:#ffffff4d;border-radius:30px;position:absolute;left:0;top:8.5px;transition:transform .4s;outline:none}.vjs-p .seek-slider .track .main:focus{border:0;outline:none}.vjs-p .seek-slider .track .main .buffered{position:absolute;background-color:#ffffff4d;width:100%;height:100%;transform:scaleX(.8);z-index:2;transform-origin:0 0}.vjs-p .seek-slider .track .main .seek-hover{position:absolute;background-color:#ffffff80;width:100%;height:100%;z-index:1;transform:scaleX(.6);transform-origin:0 0;opacity:0;transition:opacity .4s}.vjs-p .seek-slider .track .main .connect{position:absolute;background-color:#fff;width:100%;height:100%;z-index:3;left:0;transform:scaleX(.13);transform-origin:0 0}.vjs-p .seek-slider .track.active .main{transform:scaleY(2)}.vjs-p .seek-slider .thumb{pointer-events:none;position:absolute;width:12px;height:12px;left:-6px;top:4px;z-index:4;transform:translate(100px)}.vjs-p .seek-slider .thumb .handler{border-radius:100%;width:100%;height:100%;background-color:#fff;opacity:0;transform:scale(.4);cursor:pointer;transition:transform .2s;pointer-events:none}.vjs-p .seek-slider .thumb.active .handler{opacity:1;transform:scale(1)}.vjs-p .seek-slider .hover-time{position:absolute;background-color:#0000004d;line-height:18px;font-size:16px;color:#ddd;top:-25px;left:0;padding:5px 10px;border-radius:5px;box-shadow:0 0 5px #0000004d;opacity:0;transform:translate(150px);pointer-events:none}.vjs-p .seek-slider .hover-time.active{opacity:1}.vjs-p .seek-slider:hover .track .main .seek-hover{opacity:1}\n");var se=function(e){f(n,e);var t=v(n);function n(e){var r;return c(this,n),r=t.call(this,e),M(g(r),"seeking",!1),M(g(r),"mobileSeeking",!1),M(g(r),"track",null),M(g(r),"hoverTime",null),M(g(r),"offset",0),M(g(r),"secondsPrefix","00:00:"),M(g(r),"minutesPrefix","00:"),M(g(r),"seekPause",!1),M(g(r),"handleTouchSeeking",(function(e){for(var t=0,n=0;nthis.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:"translateX(".concat(e,"px)")}}},{key:"secondsToTime",value:function(e){e=Math.round(e+this.offset);var t=Math.floor(e/3600),n=e%3600,r=Math.floor(n/60),i=Math.ceil(n%60);return{hh:t.toString(),mm:r<10?"0"+r:r.toString(),ss:i<10?"0"+i:i.toString()}}},{key:"getHoverTime",value:function(){var e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),n=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+n.ss:this.props.total+this.offset<3600?this.minutesPrefix+n.mm+":"+n.ss:n.hh+":"+n.mm+":"+n.ss}},{key:"isThumbActive",value:function(){return this.state.seekHoverPosition>0||this.seeking}},{key:"drawHoverTime",value:function(){var e=this;return this.props.hideHoverTime?null:i.default.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:function(t){return e.hoverTime=t}},this.getHoverTime())}},{key:"render",value:function(){var e=this;return i.default.createElement("div",{className:"seek-slider"},i.default.createElement("div",{className:"track",ref:function(t){return e.track=t},onMouseMove:function(t){return e.handleTrackHover(!1,t)},onMouseLeave:function(t){return e.handleTrackHover(!0,t)},onMouseDown:this.onMouseDown,onTouchStart:function(t){e.setMobileSeeking(!0),e.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},i.default.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}]),n}(i.Component),ue=function(e){f(n,e);var t=v(n);function n(e){var r;return c(this,n),r=t.call(this,e),M(g(r),"stageVolume",0),M(g(r),"updateVolumeTimer",0),M(g(r),"onVolumeSeeking",!1),M(g(r),"onClickOperationButton",(function(){r.props.paused?r.props.play():r.props.pause()})),M(g(r),"operationButton",(function(){return r.props.paused?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjxwYXRoIGQ9Im03LjUxNCA1LjkwOSA3LjA1NyA0LjIzNGExIDEgMCAwIDEgMCAxLjcxNGwtNy4wNTcgNC4yMzRBMSAxIDAgMCAxIDYgMTUuMjM0VjYuNzY2YTEgMSAwIDAgMSAxLjUxNC0uODU3eiIvPjwvZz48L3N2Zz4="}):i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjxyZWN0IHg9IjciIHk9IjYiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIvPjxyZWN0IHg9IjEzIiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSIxMCIgcng9IjEiLz48L2c+PC9zdmc+"})})),M(g(r),"operationVolumeButton",(function(){return r.props.volume>.9?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXptNS43NDUgNC40MTNhLjU3Ni41NzYgMCAwIDAgMCAuODk4LjgwNS44MDUgMCAwIDAgMS4wNzggMCAyLjk0MyAyLjk0MyAwIDAgMC0uMDA0LTQuNTVoLjAwNGEuODA1LjgwNSAwIDAgMC0xLjA3OCAwIC41NzYuNTc2IDAgMCAwIDAgLjg5NiAxLjc5NCAxLjc5NCAwIDAgMSAwIDIuNzU2eiIvPjxwYXRoIGQ9Ik0xNC45MDYgNy40MTJhLjU3Ni41NzYgMCAwIDAgMCAuODk4IDQuMDcyIDQuMDcyIDAgMCAxIDAgNi40MTIuNTc2LjU3NiAwIDAgMCAwIC44OTYuODAzLjgwMyAwIDAgMCAxLjA3NiAwIDUuMjIzIDUuMjIzIDAgMCAwLS4wMDMtOC4yMDhoLjAwM2EuODA0LjgwNCAwIDAgMC0xLjA3Ni4wMDJ6Ii8+PHBhdGggZmlsbC1vcGFjaXR5PSIuMDEiIGQ9Ik0wIDBoMjJ2MjJIMHoiLz48L2c+PC9zdmc+"}):0===r.props.volume?i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXoiLz48cGF0aCBmaWxsLW9wYWNpdHk9Ii4wMSIgZD0iTTAgMGgyMnYyMkgweiIvPjwvZz48L3N2Zz4="}):i.default.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0ZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNNy4wOCA4LjQ0NUg1YS45NjIuOTYyIDAgMCAwLTEgLjkyNHYzLjkwN2EuOTYzLjk2MyAwIDAgMCAuOTYuOTY2bC4wNDYtLjAwMWgyLjAxbDMuMjI3IDIuMjc0Yy41MDIuMzQ0LjkzMi4xMzguOTMyLS4zNDVWNi41MTZjLS4wMDQtLjQ4My0uNDM2LS42OS0uODY2LS4zNDVMNy4wOCA4LjQ0NXptNS43NDUgNC40MTNhLjU3Ni41NzYgMCAwIDAgMCAuODk4LjgwNS44MDUgMCAwIDAgMS4wNzggMCAyLjk0MyAyLjk0MyAwIDAgMC0uMDA0LTQuNTVoLjAwNGEuODA1LjgwNSAwIDAgMC0xLjA3OCAwIC41NzYuNTc2IDAgMCAwIDAgLjg5NiAxLjc5NCAxLjc5NCAwIDAgMSAwIDIuNzU2eiIvPjxwYXRoIGZpbGwtb3BhY2l0eT0iLjAxIiBkPSJNMCAwaDIydjIySDB6Ii8+PC9nPjwvc3ZnPg=="})})),M(g(r),"handleClickVolume",(function(){0===r.props.volume?0!==r.stageVolume?r.props.setVolume(r.stageVolume):r.props.setVolume(1):(r.stageVolume=r.props.volume,r.props.setVolume(0))})),M(g(r),"onChange",(function(e){r.setState({currentTime:e}),e&&r.changeTime(e)})),M(g(r),"changeTime",oe((function(e){r.props.setCurrentTime(e)}),50)),M(g(r),"onVolumeChange",(function(e){r.changeVolume(e),r.setState({seekVolume:e/100})})),M(g(r),"changeVolume",oe((function(e){r.props.setVolume(e/100)}),50)),M(g(r),"onVolumeSeekStart",(function(){r.onVolumeSeeking=!0})),M(g(r),"onVolumeSeekEnd",oe((function(){r.onVolumeSeeking=!1}),500)),M(g(r),"onProgressSeekStart",(function(){return r.setState({isPlayerSeeking:!0})})),M(g(r),"onProgressSeekEnd",oe((function(){r.setState({isPlayerSeeking:!1})}),500)),r.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},r.stageVolume=e.volume,r}return d(n,[{key:"componentDidMount",value:function(){var e=this;this.updateVolumeTimer=setInterval((function(){e.onVolumeSeeking||e.setState({seekVolume:e.props.volume}),e.state.isPlayerSeeking||e.setState({currentTime:e.props.currentTime})}),100)}},{key:"componentWillUnmount",value:function(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}},{key:"render",value:function(){var e=this,t=this.props,n=t.duration,r=t.currentTime;return i.default.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},i.default.createElement("div",{className:"player-controller-progress"},i.default.createElement(se,{total:n,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),i.default.createElement("div",{className:"player-controller-actions"},i.default.createElement("div",{className:"player-controller-actions-left"},i.default.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),i.default.createElement("div",{className:"player-volume-box",onMouseEnter:function(){return e.setState({isVolumeHover:!0})},onMouseLeave:function(){return e.setState({isVolumeHover:!1})}},i.default.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),i.default.createElement("div",{className:"player-volume-slider"},i.default.createElement(se,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),i.default.createElement("div",{className:"player-mid-box-time"},le(Math.floor(r/1e3))," /"," ",le(Math.floor(n/1e3)))))}}]),n}(i.Component);function le(e){var t=e%60,n=(e-t)/60;if(n>=60){var r=n%60;return"".concat(ce((n-r)/60),":").concat(ce(r),":").concat(ce(t))}return"".concat(ce(n),":").concat(ce(t))}function ce(e){return e<=9?"0".concat(e):"".concat(e)}function he(e){var t=e.scale,n=void 0===t?1:t,r=e.size,o=e.children;return i.default.createElement("div",{style:{width:r.width/n,height:r.height/n,transform:"scale(".concat(n,")"),transformOrigin:"top left",display:"flex",overflow:"hidden"}},o)}ae('.vjs-p{display:flex;flex-grow:1;position:relative}.vjs-p *{pointer-events:auto}.vjs-p.disabled *{pointer-events:none}.vjs-p .videojs-plugin-close-icon,.vjs-p .player-controller,.vjs-p .videojs-plugin-muted-alert{pointer-events:auto}.vjs-p.disabled .videojs-plugin-close-icon,.vjs-p.disabled .player-controller{pointer-events:none}.vjs-p .video-js-plugin-header{position:absolute;z-index:100;top:-.5px;height:30px;width:100%;display:flex;background:linear-gradient(rgba(0,0,0,.85),rgba(0,0,0,.45) 40%,rgba(0,0,0,0));transition:opacity .2s;user-select:none}.vjs-p .video-js-plugin-title{padding:10px;font-size:14px;color:#fff}.vjs-p .video-js-plugin-player{position:absolute;top:0;left:0;right:0;bottom:0}.video-js,[data-vjs-player]{width:100%;height:100%}.vjs-p .videojs-plugin-close-icon.disabled{display:none}.vjs-p .videojs-plugin-close-icon{pointer-events:auto;z-index:42;color:#fff;position:absolute;top:0;right:0;width:32px;height:32px;font-size:20px;display:flex;align-items:center;justify-content:center}.vjs-p .videojs-plugin-muted-alert{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43}.vjs-p .videojs-plugin-muted-alert:before{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43;content:"";background:rgba(0,0,0,.3);font-family:VideoJS;font-size:2em;display:flex;align-items:center;justify-content:center;color:#fff}.vjs-p .videojs-plugin-recovery-mode{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:44}.vjs-p .videojs-plugin-recovery-mode button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n');var de=function(e){f(n,e);var t=v(n);function n(){return c(this,n),t.apply(this,arguments)}return d(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.cnode,r=t.size,o=t.scale;return i.default.createElement(a.CNode,{context:n},i.default.createElement(he,{size:r,scale:o},i.default.createElement(a.RoomConsumer,null,(function(t){return t&&i.default.createElement(fe,x({room:t},e.props))})),i.default.createElement(a.PlayerConsumer,null,(function(t){return t&&i.default.createElement(fe,x({player:t},e.props))}))))}}]),n}(i.Component),fe=function(e){f(n,e);var t=v(n);function n(e){var r;return c(this,n),r=t.call(this,e),M(g(r),"closeIcon",null),M(g(r),"alertMask",null),M(g(r),"container",i.default.createRef()),M(g(r),"player"),M(g(r),"controllerHiddenTimer",0),M(g(r),"syncPlayerTimer",0),M(g(r),"retryCount",0),M(g(r),"decreaseRetryTimer",0),M(g(r),"disposer"),M(g(r),"showController",(function(){r.setState({controllerVisible:!0}),r.debounceHidingController()})),M(g(r),"play",(function(){var e,t=null==(e=r.props.room)?void 0:e.calibrationTimestamp;r.debug(">>> play",{paused:!1,hostTime:t}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!1,hostTime:t})})),M(g(r),"pause",(function(){var e=r.getAttributes();if(e){var t=C(e,r.props);r.debug(">>> pause",{paused:!0,currentTime:t}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!0,currentTime:t})}})),M(g(r),"setVolume",(function(e){r.debug(">>> volume",{volume:e}),r.isEnabled()&&r.props.plugin.putAttributes({volume:e}),r.isEnabled()&&r.props.plugin.putAttributes({volume:e,muted:0===e})})),M(g(r),"setCurrentTime",(function(e){var t,n=null==(t=r.props.room)?void 0:t.calibrationTimestamp;r.debug(">>> seek",{currentTime:e/1e3,hostTime:n}),r.isEnabled()&&r.props.plugin.putAttributes({currentTime:e/1e3,hostTime:n})})),M(g(r),"resetPlayer",(function(){var e;null==(e=r.player)||e.autoplay(!1),r.debug(">>> ended",{paused:!0,currentTime:0}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!0,currentTime:0})})),M(g(r),"syncPlayerWithAttributes",(function(){var e;r.props.plugin.context;var t=r.getAttributes();if(t){var n=r.player;if(n){n.paused()!==t.paused&&(r.debug("<<< paused -> %o",t.paused),t.paused?n.pause():null==(e=n.play())||e.catch(r.catchPlayFail)),n.muted()!==t.muted&&(r.debug("<<< muted -> %o",t.muted),n.muted(t.muted)),n.volume()!==t.volume&&(r.debug("<<< volume -> %o",t.volume),n.volume(t.volume));var i=C(t,r.props);i>n.duration()?r.resetPlayer():Math.abs(n.currentTime()-i)>I.currentTimeMaxError&&(r.debug("<<< currentTime -> %o",i),n.currentTime(i))}}})),M(g(r),"debounceHidingController",(function(){r.controllerHiddenTimer&&(clearTimeout(r.controllerHiddenTimer),r.controllerHiddenTimer=0),r.controllerHiddenTimer=setTimeout((function(){r.setState({controllerVisible:!1}),r.controllerHiddenTimer=0}),3e3)})),M(g(r),"decreaseRetryCount",(function(){r.player&&r.retryCount>0&&(r.retryCount=r.retryCount-1)})),M(g(r),"catchPlayFail",(function(e){var t,n,i=String(e);if(N&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=r.player)||t.autoplay("any"),r.setState({NoSound:!0});else{var o=null==(n=r.player)?void 0:n.error();o&&(r.retryCount<=3?(r.initPlayer(),r.retryCount=r.retryCount+1):(r.debug("catch videojs media error",o),r.setState({MediaError:!0}))),r.debug("catch error",e)}})),M(g(r),"fixPlayFail",(function(){r.debug("try to fix play state"),r.setState({NoSound:!1});var e=r.getAttributes(),t=e.muted,n=e.volume;r.player&&(r.player.muted(t),r.player.volume(n))})),M(g(r),"initPlayer",l(regeneratorRuntime.mark((function e(){var t,n,i,a,s,u,l,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=r.player)||t.dispose(),r.player=void 0,r.debug("creating elements ..."),n=r.getAttributes(),i=n.type,a=n.src,s=n.poster,(u=document.createElement("div")).setAttribute("data-vjs-player",""),(l=document.createElement("video")).className="video-js",s&&(l.poster=s),l.setAttribute("playsInline",""),l.setAttribute("webkit-playsinline",""),c=document.createElement("source"),new URL(a).pathname.endsWith(".m3u8")?c.type="application/x-mpegURL":l.src=a,c.src=a,i&&(c.type=i),l.appendChild(c),u.appendChild(l),r.container.current.appendChild(u),e.next=20,new Promise((function(e){return(window.requestAnimationFrame||window.setTimeout)(e)}));case 20:r.debug("initializing videojs() ..."),h=(0,o.default)(l),r.player=h,h.one("loadedmetadata",r.gracefullyUpdate),h.on("ready",(function(){var e,t;null==(t=(e=I).onPlayer)||t.call(e,h),h.on("timeupdate",r.gracefullyUpdate),h.on("volumechange",r.gracefullyUpdate),h.on("seeked",r.gracefullyUpdate),h.on("play",r.gracefullyUpdate),h.on("pause",r.gracefullyUpdate),h.on("ended",r.resetPlayer)})),h.on("error",r.catchPlayFail),r.setState({MediaError:!1});case 27:case"end":return e.stop()}}),e)})))),M(g(r),"gracefullyUpdate",(function(){return r.setState({updater:!r.state.updater})})),M(g(r),"setupClose",(function(e){e&&(e.addEventListener("touchstart",r.removeSelf),e.addEventListener("click",r.removeSelf)),r.closeIcon=e})),M(g(r),"setupAlert",(function(e){e&&(e.addEventListener("touchstart",r.fixPlayFail),e.addEventListener("click",r.fixPlayFail)),r.alertMask=e})),M(g(r),"setupReload",(function(e){e&&(e.addEventListener("touchstart",r.initPlayer),e.addEventListener("click",r.initPlayer))})),M(g(r),"removeSelf",(function(){return r.props.plugin.remove()})),r.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/video-js-plugin@".concat(S," requires white-web-sdk@^2.13.8 to work properly."))}(e.room),r}return d(n,[{key:"getAttributes",value:function(){var e,t=this.props.plugin.attributes;if(t){var n=[a.PlayerPhase.Pause,a.PlayerPhase.Ended,a.PlayerPhase.Stopped];if(!t.paused&&n.includes(null==(e=this.props.player)?void 0:e.phase)){var r=C(t,this.props);t=x(x({},t),{},{currentTime:r,paused:!0})}return t}}},{key:"render",value:function(){var e,t,n,r;if(!this.props.room&&!this.props.player)return null;var o=this.getAttributes();if(!o)return null;var a=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),s=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return i.default.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},i.default.createElement("div",{className:"video-js-plugin-player",ref:this.container}),i.default.createElement("div",{className:"video-js-plugin-header"},o.title&&i.default.createElement("div",{className:"video-js-plugin-title"},o.title),(null==(n=o.close)||n)&&i.default.createElement("div",{className:"videojs-plugin-close-icon",ref:this.setupClose},"×")),i.default.createElement(ue,{duration:a,volume:o.volume,setVolume:this.setVolume,paused:o.paused,play:this.play,pause:this.pause,currentTime:1e3*C(o,this.props),setCurrentTime:this.setCurrentTime,buffered:a*s,scale:this.props.scale,visible:!0}),!(null==(r=this.props.plugin.context)?void 0:r.hideMuteAlert)&&this.state.NoSound&&i.default.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&i.default.createElement("div",{className:"videojs-plugin-recovery-mode"},i.default.createElement("button",{ref:this.setupReload},"Reload Player")))}},{key:"debug",value:function(e){var t;if(null==(t=this.props.plugin.context)?void 0:t.verbose){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i @@ -256,8 +256,8 @@ var Xp=new jl.j,Qp=function(){function e(e){this.renderer=e}return e.prototype.i * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ t.videoJsPlugin=function(e){var t;return e&&(t=e,I=x(x({},A),t)),{kind:E,render:de,defaultAttributes:{src:"",poster:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1,close:!0}}}},14976:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];n?this.asyncMethods.set(e,t):this.methods.set(e,t)}},{key:"registerAsyn",value:function(e,t){this.asyncMethods.set(e,t)}},{key:"recv",value:function(e){if("string"==typeof e){var t=(0,o.parseBridgeMessage)(e),n=t.type,r=t.actionId,i=t.method,a=t.payload;switch(this.verbose&&console.log({type:n,actionId:r,method:i,payload:a}),n){case o.BridgeEventType.req:var s={data:void 0,actionId:r,complete:!0},u=function(e,t){try{s.data=e.apply(t,a);var n=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,r,o.ackTypeSuccess,s);window.ReactNativeWebView.postMessage(n)}catch(e){var i=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,r,o.ackTypeError,e);window.ReactNativeWebView.postMessage(i)}},l=function(e,t){a.push((function(e,t){s.data=e,s.complete=!1!==t;var n="",i=!1;if("string"==typeof e)try{var a=JSON.parse(e);i=!(!a.error&&!a.__error)}catch(e){}else i=!(!e||!e.error&&!e.__error);n=i?(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,r,o.ackTypeError,s.data):(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,r,o.ackTypeSuccess,s),window.ReactNativeWebView.postMessage(n)}));try{e.apply(t,a)}catch(e){var n=(0,o.bridgeMessageTemplate)(o.BridgeEventType.ack,r,o.ackTypeError,e);window.ReactNativeWebView.postMessage(n)}},c=this.methods.get(i),h=this.asyncMethods.get(i);if(c)u(c,this.methods);else if(h)l(h,this.asyncMethods);else{var d=i.split(".");if(d.length<2)return;var f=d.pop(),p=d.join("."),v=this.methods.get(p);if(v){var m=v[f];if(m&&"function"==typeof m)return void u(m,v)}var g=this.asyncMethods.get(p);if(g){var y=g[f];if(y&&"function"==typeof y)return void l(y,g)}console.log("method ".concat(i," not found"))}break;case o.BridgeEventType.ack:var b=a;if(this.queue.has(r)){var x=this.queue.get(r);x.ack=!0,i===o.ackTypeError?x.reject(a):(x.resolve(b.data),x.callback&&x.callback(b.data)),b.complete&&this.queue.delete(r)}}}}}],n&&r(t.prototype,n),a&&r(t,a),e}();t.Bridge=a},5419:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBridgeMessage=t.bridgeMessageTemplate=t.ackTypeError=t.ackTypeSuccess=t.BridgeEventType=void 0,function(e){e.req="req",e.evt="evt",e.ack="ack"}(t.BridgeEventType||(t.BridgeEventType={})),t.ackTypeSuccess="success",t.ackTypeError="error",t.bridgeMessageTemplate=function(e,t,n,r){return JSON.stringify({type:e,actionId:t,method:n,payload:r})},t.parseBridgeMessage=function(e){try{var t=JSON.parse(e);return{type:t.type,actionId:t.actionId,method:t.method,payload:t.payload}}catch(t){return console.log("parse bridge message ".concat(e," failed: "),t),{type:"fail",actionId:"",method:"",payload:e}}}},13324:function(e,t,n){var r=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RNBridge=t.RNCommon=void 0,t.RNCommon=o(n(5419));var a=n(5397);Object.defineProperty(t,"RNBridge",{enumerable:!0,get:function(){return a.Bridge}})},79888:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},87980:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)} -/*! For license information please see index.js.LICENSE.txt */var i;e=n.nmd(e),window,i=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==r(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}([function(t,n){t.exports=e},function(e,t,n){(function(e,i){n.d(t,"a",(function(){return et}));var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(){for(var e=[],t=0;t2&&ne("box");var n=Q(t);return new Se(e,Z(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&ne("shallowBox"),te.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&ne("array");var n=Q(t);return new Tt(e,Z(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&ne("shallowArray"),te.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&ne("map");var n=Q(t);return new kt(e,Z(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&ne("shallowMap"),te.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&ne("set");var n=Q(t);return new Rt(e,Z(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&ne("object");var r=Q(n);return rt({},e,t,r)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&ne("shallowObject"),te.object(e,{},{name:t,deep:!1})},ref:K,shallow:J,deep:q,struct:$},te=function e(t,n,r){if("string"==typeof arguments[1])return q.apply(null,arguments);if(at(t))return t;var i=x(t)?e.object(t,n,r):Array.isArray(t)?e.array(t,n):M(t)?e.map(t,n):S(t)?e.set(t,n):t;if(i!==t)return i;v(!1)};function ne(e){v("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ee).forEach((function(e){return te[e]=ee[e]}));var re,ie,oe=G(!1,(function(e,t,n,r,i){var o=n.get,a=n.set,u=i[0]||{};!function(e,t,n){var r=Bt(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new Ee(n),Object.defineProperty(e,t,function(e){return Ft[e]||(Ft[e]={configurable:Ne.computedConfigurable,enumerable:!1,get:function(){return zt(this).read(this,e)},set:function(t){zt(this).write(this,e,t)}})}(t))}(e,t,s({get:o,set:a},u))}));oe({equals:j.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(re||(re={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ie||(ie={}));var ae=function(e){this.cause=e};function se(e){return e instanceof ae}function ue(e){switch(e.dependenciesState){case re.UP_TO_DATE:return!1;case re.NOT_TRACKING:case re.STALE:return!0;case re.POSSIBLY_STALE:for(var t=ve(!0),n=fe(),r=e.observing,i=r.length,o=0;o0;Ne.computationDepth>0&&t&&v(!1),Ne.allowStateChanges||!t&&"strict"!==Ne.enforceActions||v(!1)}function ce(e,t,n){var r=ve(!0);ge(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ne.runId;var i,o=Ne.trackingDerivation;if(Ne.trackingDerivation=e,!0===Ne.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(e){i=new ae(e)}return Ne.trackingDerivation=o,function(e){for(var t=e.observing,n=e.observing=e.newObserving,r=re.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;ar&&(r=s.dependenciesState);for(n.length=i,e.newObserving=null,o=t.length;o--;)0===(s=t[o]).diffValue&&De(s,e),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,ke(s,e))}r!==re.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),e.observing.length,me(r),i}function he(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)De(t[n],e);e.dependenciesState=re.NOT_TRACKING}function de(e){var t=fe(),n=e();return pe(t),n}function fe(){var e=Ne.trackingDerivation;return Ne.trackingDerivation=null,e}function pe(e){Ne.trackingDerivation=e}function ve(e){var t=Ne.allowStateReads;return Ne.allowStateReads=e,t}function me(e){Ne.allowStateReads=e}function ge(e){if(e.dependenciesState!==re.UP_TO_DATE){e.dependenciesState=re.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=re.UP_TO_DATE}}var ye=0,be=1,xe=Object.getOwnPropertyDescriptor((function(){}),"name");function _e(e,t){var n=function(){return we(e,t,this,arguments)};return n.isMobxAction=!0,n}function we(e,t,n,r){var i=function(e,t,n){var r=Ge()&&!!e,i=0;if(r){i=Date.now();var o=n&&n.length||0,a=new Array(o);if(o>0)for(var s=0;s0&&!e.__mobxGlobals&&(Ce=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ie).version&&(Ce=!1),Ce?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ie):(setTimeout((function(){v("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ie)}();function ke(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function De(e,t){if(1===e.observers.length)e.observers.length=0,Pe(e);else{var n=e.observers,r=e.observersIndexes,i=n.pop();if(i!==t){var o=r[t.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[t.__mapid]}}function Pe(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ne.pendingUnobservations.push(e))}function Oe(){Ne.inBatch++}function Re(){if(0==--Ne.inBatch){Ue();for(var e=Ne.pendingUnobservations,t=0;t0&&Pe(e),!1)}function je(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ie.BREAK){var n=[];!function e(t,n,r){n.length>=1e3?n.push("(and many more)"):(n.push(""+new Array(r).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,n,r+1)})))}((r=e,it(Vt(r,void 0))),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Ee?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}var r}var Be=function(){function e(e,t,n,r){void 0===e&&(e="Reaction@"+p()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=re.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+p(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ie.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ne.pendingReactions.push(this),Ue())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Oe(),this._isScheduled=!1,ue(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ge()&&He({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Re()}},e.prototype.track=function(e){Oe();var t,n=Ge();n&&(t=Date.now(),Ve({name:this.name,type:"reaction"})),this._isRunning=!0;var r=ce(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&he(this),se(r)&&this.reportExceptionInDerivation(r.cause),n&&Ye({time:Date.now()-t}),Re()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ne.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ne.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ge()&&He({type:"error",name:this.name,message:n,error:""+e}),Ne.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Oe(),he(this),Re()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Ne.isRunningReactions||function(e){e()}(Fe)}function Fe(){Ne.isRunningReactions=!0;for(var e=Ne.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r",e):2===arguments.length&&"function"==typeof t?_e(e,t):1===arguments.length&&"string"==typeof e?Qe(e):!0!==r?Qe(t).apply(null,arguments):void(e[t]=_e(e.name||t,n.value))};function Je(e,t,n){_(e,t,_e(t,n.bind(e)))}qe.bound=function(e,t,n,r){return!0===r?(Je(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Je(this,t,n.value||n.initializer.call(this)),this[t]},set:Xe}:{enumerable:!1,configurable:!0,set:function(e){Je(this,t,e)},get:function(){}}};var Ke=function(e){return e()};function $e(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Ke}function et(e,t,n){void 0===n&&(n=h),"boolean"==typeof n&&(n={fireImmediately:n});var r,i,o,a=n.name||"Reaction@"+p(),s=qe(a,n.onError?(r=n.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){r.call(this,e)}}):t),u=!n.scheduler&&!n.delay,l=$e(n),c=!0,d=!1,f=n.compareStructural?j.structural:n.equals||j.default,v=new Be(a,(function(){c||u?m():d||(d=!0,l(m))}),n.onError,n.requiresObservable);function m(){if(d=!1,!v.isDisposed){var t=!1;v.track((function(){var n=e(v);t=c||!f(o,n),o=n})),c&&n.fireImmediately&&s(o,v),c||!0!==t||s(o,v),c&&(c=!1)}}return v.schedule(),v.getDisposer()}function tt(e,t,n){return nt("onBecomeUnobserved",e,t,n)}function nt(e,t,n,r){var i="function"==typeof r?Vt(t,n):Vt(t),o="function"==typeof r?r:n,a=i[e];return"function"!=typeof a?v(!1):(i[e]=function(){a.call(this),o.call(this)},function(){i[e]=a})}function rt(e,t,n,r){var i=(r=Q(r)).defaultDecorator||(!1===r.deep?K:q);z(e),Bt(e,r.name,i.enhancer),Oe();try{for(var o in t){var a=Object.getOwnPropertyDescriptor(t,o),s=(n&&o in n?n[o]:a.get?oe:i)(e,o,a,!0);s&&Object.defineProperty(e,o,s)}}finally{Re()}return e}function it(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(it)),r}function ot(e,t){if(null==e)return!1;if(void 0!==t){if(Ht(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return Ht(e)||!!e.$mobx||R(e)||ze(e)||Ae(e)}function at(e){return 1!==arguments.length&&v(!1),ot(e)}function st(e){switch(e.length){case 0:return Ne.trackingDerivation;case 1:return Vt(e[0]);case 2:return Vt(e[0],e[1])}}function ut(e,t){void 0===t&&(t=void 0),Oe();try{return e.apply(t)}finally{Re()}}function lt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function ct(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function ht(e,t){var n=fe();try{var r=e.interceptors;if(r)for(var i=0,o=r.length;i0}function ft(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function pt(e,t){var n=fe(),r=e.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return ct(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ft(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r0&&e+t+1>xt&&At(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;le(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=c),lt(this)){var o=ht(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!o)return c;t=o.removedCount,n=o.added}var a=(n=0===n.length?n:n.map((function(e){return r.enhancer(e,void 0)}))).length-t;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,l([e,t],n));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&Ge(),i=dt(this),o=i||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&Ve(s(s({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&pt(this,o),r&&Ye()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&Ge(),i=dt(this),o=i||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&Ve(s(s({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&pt(this,o),r&&Ye()},e}(),Tt=function(e){function t(t,n,r,i){void 0===r&&(r="ObservableArray@"+p()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new wt(r,n,o,i);if(w(o,"$mobx",a),t&&t.length){var s=Te(!0);o.spliceWithArray(0,0,t),Me(s)}return bt&&Object.defineProperty(a.array,"0",Mt),o}return a(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,i=this.$mobx.values;r=e1)for(var n=1;n=2&&(this.player.currentTime=e)},e}(),d=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},p=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3&&(n.lastSyncProgressTimestamp=r,n.selfUserInf&&n.selfUserInf.identity===i.host&&t.putAttributes({currentTime:e,play:n.playerState}))},n.handleSeekReaction=function(e,t){n.isHost()||n.player.current&&void 0!==t&&(n.player.current.currentTime=e+Date.now()/1e3-t)},n.handleRemove=function(){return f(n,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.handleRemotePlayState(!1),[4,v(300)];case 1:return t.sent(),e.remove(),[2]}}))}))},n.timeUpdate=function(){if(n.player.current){var e=n.player.current.currentTime;n.onTimeUpdate(e)}},n.detectAudioClickEnable=function(){var e=n.props.plugin;return e.context&&e.context.identity?e.context.identity!==i.host?"none":"auto":"none"},n.renderMuteBox=function(){var e=n.props.plugin;return e.context&&e.context.identity&&e.context.identity!==i.host&&n.state.selfMute?o.createElement("div",{className:"media-mute-box"},o.createElement("div",{onClick:function(){n.setState({selfMute:!1})},onTouchStart:function(){n.setState({selfMute:!1})},style:{pointerEvents:"auto"},className:"media-mute-box-inner"},o.createElement("img",{src:u,alt:"mute_icon"}),o.createElement("span",null,"unmute"))):null},n.renderDeleteBtn=function(){var e=n.props.plugin;return e.context&&e.context.identity&&e.context.identity===i.host?o.createElement("div",{style:{pointerEvents:"auto"},className:"plugin-audio-box-delete",onClick:n.handleRemove},o.createElement("img",{src:c,alt:"delete_icon"})):null},n.renderNavigation=function(){return!0===n.props.plugin.attributes.isNavigationDisable?null:o.createElement("div",{className:"plugin-audio-box-nav"},o.createElement("div",null,o.createElement("img",{style:{width:20,marginLeft:8},src:l,alt:"audio_plugin"}),o.createElement("span",null,"Audio Player")),n.renderDeleteBtn())},n.handleFirstSeek=function(e){if(!e){var t,r=n.props.plugin,i=Date.now()/1e3;t=r.attributes.seekTime?r.attributes.seek+i-r.attributes.seekTime:r.attributes.seek,n.syncNode.syncProgress(t)}},n.player=o.createRef(),n.reactionPlayDisposer=n.startPlayReaction(),n.reactionSeekDisposer=n.startSeekReaction(),n.reactionVolumeDisposer=n.startVolumeReaction(),n.reactionMuteDisposer=n.startMuteTimeReaction(),n.reactionSeekTimeDisposer=n.startSeekTimeReaction(),n.reactionSyncDisposer=n.startSyncReaction(),n.state={play:!1,seek:0,selfMute:!1,currentTime:0,mute:!1,volume:1,isEnd:!1},n}return d(t,e),t.prototype.componentDidMount=function(){return f(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.syncNode=new h(this.player.current),[4,this.handleStartCondition()];case 1:return e.sent(),[2]}}))}))},t.prototype.startPlayReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.play}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.isHost()?[3,2]:[4,this.handleNativePlayerState(t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.startSeekTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seekTime}),(function(n){e.handleSeekReaction(t.attributes.seek,n)}))},t.prototype.startSeekReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seek}),(function(n){e.handleSeekReaction(n,t.attributes.seekTime)}))},t.prototype.startSyncReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.currentTime}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){return this.isHost()||this.player.current&&Math.abs(t-this.player.current.currentTime)>2&&(this.player.current.currentTime=t),[2]}))}))}))},t.prototype.startVolumeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.volume}),(function(t){e.isHost()||e.player.current&&(e.player.current.volume=t)}))},t.prototype.startMuteTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.mute}),(function(t){e.isHost()||e.setState({mute:t})}))},t.prototype.componentWillUnmount=function(){this.reactionPlayDisposer(),this.reactionSeekDisposer(),this.reactionMuteDisposer(),this.reactionVolumeDisposer(),this.reactionSyncDisposer(),this.player.current&&this.player.current.pause()},t.prototype.render=function(){var e=this,t=this.props,n=t.size,r=t.plugin,a=t.scale,s=0===a?1:a,u=navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);return o.createElement("div",{className:"plugin-audio-box",style:{width:n.width/s,height:n.height/s,transform:"scale("+s+")"}},this.renderNavigation(),o.createElement("div",{className:"plugin-audio-box-body"},this.renderMuteBox(),o.createElement("div",{className:"white-plugin-audio-box"},o.createElement("audio",{className:"white-plugin-audio",src:r.attributes.pluginAudioUrl,ref:this.player,muted:this.state.mute?this.state.mute:this.state.selfMute,style:{width:"100%",height:54,pointerEvents:this.detectAudioClickEnable(),outline:"none"},onLoadedMetadataCapture:function(){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return u?[4,v(300)]:[3,2];case 1:e.sent(),this.handleFirstSeek(this.state.isEnd),e.label=2;case 2:return[2]}}))}))},onEnded:function(){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.player.current?this.selfUserInf?this.selfUserInf.identity!==i.host?[3,2]:(r.putAttributes({seek:0,seekTime:void 0,currentTime:0}),[4,v(500)]):[3,5]:[3,7];case 1:return e.sent(),this.player.current.load(),[3,4];case 2:return[4,v(1e3)];case 3:e.sent(),this.player.current.load(),e.label=4;case 4:return[3,7];case 5:return[4,v(1e3)];case 6:e.sent(),this.player.current.load(),e.label=7;case 7:return this.setState({isEnd:!0}),[2]}}))}))},controls:!0,controlsList:"nodownload nofullscreen",onTimeUpdate:this.timeUpdate,preload:"auto"}))))},t}(o.Component),b=(g=function(e,t){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),x=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},_=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] img {\n width: 20px;\n margin-left: 8px;\n}\n.white-audio-plugin-nav-title {\n margin-left: 6px;\n font-size: 12px;\n font-weight: bold;\n flex-grow: 1;\n}\n.white-audio-plugin-nav-delete {\n width: 22px;\n height: 22px;\n border: 0;\n background-color: #ff756e;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n margin-right: 8px;\n cursor: pointer;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.white-audio-plugin-nav-delete > img {\n width: 14px;\n}\n.white-audio-plugin-nav-delete:hover {\n opacity: 1;\n}\n.white-audio-plugin-body {\n flex-grow: 1;\n background-color: #f2f4f5;\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n justify-content: center;\n}\n.white-audio-plugin-body > audio {\n flex-grow: 1;\n outline: none;\n}\n",""]),e.exports=t},function(e,t,n){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n,r,i,o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var s=(n=a,r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),"/*# ".concat(i," */")),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([s]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(d=Date.now(),this.props.player&&(d=this.props.player.beginTimestamp+r),f=l+(d-c)/1e3,Math.abs(n.currentTime-f)>2&&(n.currentTime=f)),this.changedMap.changed("rate",i)&&(n.playbackRate=i),[2]}}))}))}));this.disposers.push(r),this.disposers.push((function(){return e.changedMap.clear()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this.player.current)||void 0===e||e.pause(),this.disposers.forEach((function(e){return e()}))},Object.defineProperty(t.prototype,"containerStyle",{get:function(){var e=this.props,t=e.size,n=e.scale||1;return{width:t.width/n,height:t.height/n,transform:"scale("+n+")"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerEventsStyle",{get:function(){return{pointerEvents:this.isHost()?"auto":"none"}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.room,n=e.player,r=e.plugin;return t||n?i.a.createElement("div",{className:"white-audio-plugin-container",style:this.containerStyle},!r.attributes.isNavigationDisable&&i.a.createElement("div",{className:"white-audio-plugin-nav"},i.a.createElement("img",{src:s.a,alt:"audio_plugin"}),i.a.createElement("span",{className:"white-audio-plugin-nav-title"},"Audio Player"),i.a.createElement("span",{className:"white-audio-plugin-nav-delete",style:this.pointerEventsStyle,onClick:this.removeSelf},i.a.createElement("img",{src:l.a,alt:"delete_icon"}))),i.a.createElement("div",{className:"white-audio-plugin-body"},i.a.createElement("audio",{src:r.attributes.src,style:this.pointerEventsStyle,controls:!!t,controlsList:"nodownload nofullscreen",preload:"auto",ref:this.player}))):null},t}(r.Component);n.d(t,"audioPlugin2",(function(){return _}));var _=Object.freeze({kind:"audio2",render:b,defaultAttributes:{src:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1},hitTest:function(e){var t=e.component.context.getMemberState();return!("eraser"===(null==t?void 0:t.currentApplianceName))}})}])},"object"==r(t)&&"object"==r(e)?e.exports=i(n(17328),n(71895)):n.amdD([,],i)},44112:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)} -/*! For license information please see index.js.LICENSE.txt */var i;e=n.nmd(e),window,i=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==r(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}([function(t,n){t.exports=e},function(e,t,n){(function(e,i){n.d(t,"a",(function(){return nt}));var o=[];Object.freeze(o);var a={};Object.freeze(a);var s={};function u(){return"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:s}function l(){return++De.mobxGuid}function c(e){throw h(!1,e),"X"}function h(e,t){if(!e)throw new Error("[mobx] "+(t||"An invariant failed, however the error is obfuscated because this is an production build."))}function d(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var f=function(){};function p(e){return null!==e&&"object"==r(e)}function v(e){if(null===e||"object"!=r(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function m(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function y(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return p(e)&&!0===e[n]}}function b(e){return void 0!==u().Map&&e instanceof u().Map}function x(e){return e instanceof Set}function _(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function w(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function T(e){return null===e?null:"object"==r(e)?""+e:e}function M(e,t){for(var n=e.next();!n.done;)t(n.value),n=e.next()}function S(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function E(e,t){g(e,S(),t)}function A(e){return e[S()]=C,e}function I(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function C(){return this}var N=function(){function e(e){void 0===e&&(e="Atom@"+l()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=oe.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return Be(this)},e.prototype.reportChanged=function(){Le(),function(e){if(e.lowestObserverState!==oe.STALE){e.lowestObserverState=oe.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===oe.UP_TO_DATE&&(r.isTracing!==ae.NONE&&Ue(r,e),r.onBecomeStale()),r.dependenciesState=oe.STALE}}}(this),je()},e.prototype.toString=function(){return this.name},e}(),k=y("Atom",N);function D(e,t,n){void 0===t&&(t=f),void 0===n&&(n=f);var r=new N(e);return it("onBecomeObserved",r,t,void 0),rt(r,n),r}function P(e,t){return e===t}var O={identity:P,structural:function(e,t){return Zt(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||P(e,t)},shallow:function(e,t){return Zt(e,t,1)}},R=function(e,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function L(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var j=function(){return(j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function U(){for(var e=[],t=0;t2&&ie("box");var n=q(t);return new Ae(e,J(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&ie("shallowBox"),re.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&ie("array");var n=q(t);return new St(e,J(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&ie("shallowArray"),re.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&ie("map");var n=q(t);return new Pt(e,J(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&ie("shallowMap"),re.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&ie("set");var n=q(t);return new jt(e,J(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&ie("object");var r=q(n);return ot({},e,t,r)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&ie("shallowObject"),re.object(e,{},{name:t,deep:!1})},ref:ee,shallow:$,deep:K,struct:te},re=function e(t,n,r){if("string"==typeof arguments[1])return K.apply(null,arguments);if(ut(t))return t;var i=v(t)?e.object(t,n,r):Array.isArray(t)?e.array(t,n):b(t)?e.map(t,n):x(t)?e.set(t,n):t;if(i!==t)return i;c(!1)};function ie(e){c("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ne).forEach((function(e){return re[e]=ne[e]}));var oe,ae,se=V(!1,(function(e,t,n,r,i){var o=n.get,a=n.set,s=i[0]||{};!function(e,t,n){var r=Ft(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new Ie(n),Object.defineProperty(e,t,function(e){return Gt[e]||(Gt[e]={configurable:De.computedConfigurable,enumerable:!1,get:function(){return Ht(this).read(this,e)},set:function(t){Ht(this).write(this,e,t)}})}(t))}(e,t,j({get:o,set:a},s))}));se({equals:O.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(oe||(oe={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ae||(ae={}));var ue=function(e){this.cause=e};function le(e){return e instanceof ue}function ce(e){switch(e.dependenciesState){case oe.UP_TO_DATE:return!1;case oe.NOT_TRACKING:case oe.STALE:return!0;case oe.POSSIBLY_STALE:for(var t=ge(!0),n=ve(),r=e.observing,i=r.length,o=0;o0;De.computationDepth>0&&t&&c(!1),De.allowStateChanges||!t&&"strict"!==De.enforceActions||c(!1)}function de(e,t,n){var r=ge(!0);be(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++De.runId;var i,o=De.trackingDerivation;if(De.trackingDerivation=e,!0===De.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(e){i=new ue(e)}return De.trackingDerivation=o,function(e){for(var t=e.observing,n=e.observing=e.newObserving,r=oe.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;ar&&(r=s.dependenciesState);for(n.length=i,e.newObserving=null,o=t.length;o--;)0===(s=t[o]).diffValue&&Oe(s,e),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,Pe(s,e))}r!==oe.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),e.observing.length,ye(r),i}function fe(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)Oe(t[n],e);e.dependenciesState=oe.NOT_TRACKING}function pe(e){var t=ve(),n=e();return me(t),n}function ve(){var e=De.trackingDerivation;return De.trackingDerivation=null,e}function me(e){De.trackingDerivation=e}function ge(e){var t=De.allowStateReads;return De.allowStateReads=e,t}function ye(e){De.allowStateReads=e}function be(e){if(e.dependenciesState!==oe.UP_TO_DATE){e.dependenciesState=oe.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=oe.UP_TO_DATE}}var xe=0,_e=1,we=Object.getOwnPropertyDescriptor((function(){}),"name");function Te(e,t){var n=function(){return Me(e,t,this,arguments)};return n.isMobxAction=!0,n}function Me(e,t,n,r){var i=function(e,t,n){var r=Ve()&&!!e,i=0;if(r){i=Date.now();var o=n&&n.length||0,a=new Array(o);if(o>0)for(var s=0;s0&&!e.__mobxGlobals&&(ke=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ne).version&&(ke=!1),ke?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ne):(setTimeout((function(){c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ne)}();function Pe(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Oe(e,t){if(1===e.observers.length)e.observers.length=0,Re(e);else{var n=e.observers,r=e.observersIndexes,i=n.pop();if(i!==t){var o=r[t.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[t.__mapid]}}function Re(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,De.pendingUnobservations.push(e))}function Le(){De.inBatch++}function je(){if(0==--De.inBatch){ze();for(var e=De.pendingUnobservations,t=0;t0&&Re(e),!1)}function Ue(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ae.BREAK){var n=[];!function e(t,n,r){n.length>=1e3?n.push("(and many more)"):(n.push(""+new Array(r).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,n,r+1)})))}((r=e,at(Yt(r,void 0))),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Ie?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}var r}var Fe=function(){function e(e,t,n,r){void 0===e&&(e="Reaction@"+l()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=oe.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ae.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,De.pendingReactions.push(this),ze())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Le(),this._isScheduled=!1,ce(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ve()&&We({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}je()}},e.prototype.track=function(e){Le();var t,n=Ve();n&&(t=Date.now(),Ye({name:this.name,type:"reaction"})),this._isRunning=!0;var r=de(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&fe(this),le(r)&&this.reportExceptionInDerivation(r.cause),n&&Qe({time:Date.now()-t}),je()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(De.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";De.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ve()&&We({type:"error",name:this.name,message:n,error:""+e}),De.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Le(),fe(this),je()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||De.isRunningReactions||function(e){e()}(Ge)}function Ge(){De.isRunningReactions=!0;for(var e=De.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r",e):2===arguments.length&&"function"==typeof t?Te(e,t):1===arguments.length&&"string"==typeof e?qe(e):!0!==r?qe(t).apply(null,arguments):void(e[t]=Te(e.name||t,n.value))};function $e(e,t,n){m(e,t,Te(t,n.bind(e)))}Ke.bound=function(e,t,n,r){return!0===r?($e(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return $e(this,t,n.value||n.initializer.call(this)),this[t]},set:Ze}:{enumerable:!1,configurable:!0,set:function(e){$e(this,t,e)},get:function(){}}};var et=function(e){return e()};function tt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:et}function nt(e,t,n){void 0===n&&(n=a),"boolean"==typeof n&&(n={fireImmediately:n});var r,i,o,s=n.name||"Reaction@"+l(),u=Ke(s,n.onError?(r=n.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){r.call(this,e)}}):t),c=!n.scheduler&&!n.delay,h=tt(n),d=!0,f=!1,p=n.compareStructural?O.structural:n.equals||O.default,v=new Fe(s,(function(){d||c?m():f||(f=!0,h(m))}),n.onError,n.requiresObservable);function m(){if(f=!1,!v.isDisposed){var t=!1;v.track((function(){var n=e(v);t=d||!p(o,n),o=n})),d&&n.fireImmediately&&u(o,v),d||!0!==t||u(o,v),d&&(d=!1)}}return v.schedule(),v.getDisposer()}function rt(e,t,n){return it("onBecomeUnobserved",e,t,n)}function it(e,t,n,r){var i="function"==typeof r?Yt(t,n):Yt(t),o="function"==typeof r?r:n,a=i[e];return"function"!=typeof a?c(!1):(i[e]=function(){a.call(this),o.call(this)},function(){i[e]=a})}function ot(e,t,n,r){var i=(r=q(r)).defaultDecorator||(!1===r.deep?ee:K);H(e),Ft(e,r.name,i.enhancer),Le();try{for(var o=Object.getOwnPropertyNames(t),a=0,s=o.length;a0&&(r.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(at)),r}function st(e,t){if(null==e)return!1;if(void 0!==t){if(Wt(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return Wt(e)||!!e.$mobx||k(e)||He(e)||Ce(e)}function ut(e){return 1!==arguments.length&&c(!1),st(e)}function lt(e){switch(e.length){case 0:return De.trackingDerivation;case 1:return Yt(e[0]);case 2:return Yt(e[0],e[1])}}function ct(e,t){void 0===t&&(t=void 0),Le();try{return e.apply(t)}finally{je()}}function ht(e){return void 0!==e.interceptors&&e.interceptors.length>0}function dt(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),d((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function ft(e,t){var n=ve();try{var r=e.interceptors;if(r)for(var i=0,o=r.length;i0}function vt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),d((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function mt(e,t){var n=ve(),r=e.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return dt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),vt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r0&&e+t+1>wt&&Ct(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;he(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=o),ht(this)){var a=ft(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!a)return o;t=a.removedCount,n=a.added}var s=(n=0===n.length?n:n.map((function(e){return r.enhancer(e,void 0)}))).length-t;this.updateArrayLength(i,s);var u=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,U([e,t],n));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&Ve(),i=pt(this),o=i||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&Ye(j(j({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&mt(this,o),r&&Qe()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&Ve(),i=pt(this),o=i||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&Ye(j(j({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&mt(this,o),r&&Qe()},e}(),St=function(e){function t(t,n,r,i){void 0===r&&(r="ObservableArray@"+l()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new Mt(r,n,o,i);if(g(o,"$mobx",a),t&&t.length){var s=Se(!0);o.spliceWithArray(0,0,t),Ee(s)}return _t&&Object.defineProperty(a.array,"0",Et),o}return L(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,i=this.$mobx.values;r=e1)for(var n=1;n=2&&(this.player.currentTime=e)},e}(),d=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},p=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3&&(n.lastSyncProgressTimestamp=r,n.selfUserInf&&n.selfUserInf.identity===i.host&&t.putAttributes({currentTime:e,play:n.playerState}))},n.handleNativePlayerState=function(e){return f(n,void 0,void 0,(function(){var t;return p(this,(function(n){switch(n.label){case 0:if(!e)return[3,7];if(!this.player.current)return[3,6];n.label=1;case 1:return n.trys.push([1,3,,6]),[4,this.player.current.play()];case 2:return n.sent(),[3,6];case 3:return""+(t=n.sent()).name!="NotAllowedError"&&""+t.name!="AbortError"?[3,5]:(this.setState({selfMute:!0}),[4,this.player.current.play()]);case 4:n.sent(),n.label=5;case 5:return[3,6];case 6:return[3,8];case 7:this.player.current&&this.player.current.pause(),n.label=8;case 8:return[2]}}))}))},n.handleSeekReaction=function(e,t){return f(n,void 0,void 0,(function(){return p(this,(function(n){return this.isHost()||this.player.current&&void 0!==t&&(this.player.current.currentTime=e+Date.now()/1e3-t),[2]}))}))},n.timeUpdate=function(){if(n.player.current){var e=n.player.current.currentTime;n.onTimeUpdate(e)}},n.detectVideoClickEnable=function(){var e=n.props.plugin;return e.context&&e.context.identity?e.context.identity!==i.host?"none":"auto":"none"},n.renderMuteBox=function(){var e=n.props.plugin;return e.context&&e.context.identity&&e.context.identity!==i.host&&n.state.selfMute?o.createElement("div",{className:"media-mute-box"},o.createElement("div",{onClick:function(){n.setState({selfMute:!1})},onTouchStart:function(){n.setState({selfMute:!1})},style:{pointerEvents:"auto"},className:"media-mute-box-inner"},o.createElement("img",{src:u,alt:"mute_icon"}),o.createElement("span",null,"unmute"))):null},n.handleRemove=function(){return f(n,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.handleRemotePlayState(!1),[4,v(300)];case 1:return t.sent(),e.remove(),[2]}}))}))},n.renderDeleteBtn=function(){var e=n.props.plugin;return e.context&&e.context.identity&&e.context.identity===i.host?o.createElement("div",{style:{pointerEvents:"auto"},className:"plugin-audio-box-delete",onClick:n.handleRemove},o.createElement("img",{src:c,alt:"delete"})):null},n.renderNavigation=function(){return!0===n.props.plugin.attributes.isNavigationDisable?null:o.createElement("div",{className:"plugin-video-box-nav"},o.createElement("div",null,o.createElement("img",{style:{width:20,marginLeft:8},src:l,alt:"video_plugin"}),o.createElement("span",null,"Video Player")),n.renderDeleteBtn())},n.handleOnEnd=function(){return f(n,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.player.current?this.selfUserInf?this.selfUserInf.identity!==i.host?[3,2]:(e.putAttributes({seek:0,seekTime:void 0,currentTime:0}),[4,v(500)]):[3,5]:[3,7];case 1:return t.sent(),this.player.current.load(),[3,4];case 2:return[4,v(1e3)];case 3:t.sent(),this.player.current.load(),t.label=4;case 4:return[3,7];case 5:return[4,v(1e3)];case 6:t.sent(),this.player.current.load(),t.label=7;case 7:return this.setState({isEnd:!0}),[2]}}))}))},n.handleOnLoadedMetadataCapture=function(){return f(n,void 0,void 0,(function(){var e,t;return p(this,(function(n){switch(n.label){case 0:return e=navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),t=this.state.isEnd,e?[4,v(300)]:[3,2];case 1:n.sent(),this.handleFirstSeek(t),n.label=2;case 2:return[2]}}))}))},n.player=o.createRef(),n.reactionSeekDisposer=n.startSeekReaction(),n.reactionSeekTimeDisposer=n.startSeekTimeReaction(),n.reactionPlayDisposer=n.startPlayReaction(),n.reactionVolumeDisposer=n.startVolumeReaction(),n.reactionMuteDisposer=n.startMuteTimeReaction(),n.reactionSyncDisposer=n.startSyncReaction(),n.state={play:!1,seek:0,selfMute:!1,currentTime:0,mute:!1,volume:1,isEnd:!1},n}return d(t,e),t.prototype.componentDidMount=function(){return f(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.syncNode=new h(this.player.current),[4,this.handleStartCondition()];case 1:return e.sent(),[2]}}))}))},t.prototype.startPlayReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.play}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.isHost()?[3,2]:[4,this.handleNativePlayerState(t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.startSeekReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seek}),(function(n){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.handleSeekReaction(n,t.attributes.seekTime)];case 1:return e.sent(),[2]}}))}))}))},t.prototype.startSyncReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.currentTime}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){return this.isHost()||this.player.current&&Math.abs(t-this.player.current.currentTime)>2&&(this.player.current.currentTime=t),[2]}))}))}))},t.prototype.startSeekTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seekTime}),(function(n){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.handleSeekReaction(t.attributes.seek,n)];case 1:return e.sent(),[2]}}))}))}))},t.prototype.startVolumeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.volume}),(function(t){e.isHost()||e.player.current&&(e.player.current.volume=t)}))},t.prototype.startMuteTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.mute}),(function(t){e.isHost()||e.setState({mute:t})}))},t.prototype.componentWillUnmount=function(){this.reactionPlayDisposer(),this.reactionSeekDisposer(),this.reactionMuteDisposer(),this.reactionVolumeDisposer(),this.reactionSeekTimeDisposer(),this.reactionSyncDisposer(),this.player.current&&this.player.current.pause()},t.prototype.render=function(){var e=this.props,t=e.size,n=e.plugin,r=e.scale,i=this.state,a=i.mute,s=i.selfMute,u=0===r?1:r;return o.createElement("div",{className:"plugin-video-box",style:{width:t.width/u,height:t.height/u,transform:"scale("+u+")"}},this.renderNavigation(),o.createElement("div",{className:"plugin-video-box-body"},this.renderMuteBox(),o.createElement("div",{className:"white-plugin-video-box"},o.createElement("video",{"webkit-playsinline":"true",playsInline:!0,poster:n.attributes.poster,className:"white-plugin-video",src:n.attributes.pluginVideoUrl,ref:this.player,muted:a||s,style:{width:"100%",height:"100%",pointerEvents:this.detectVideoClickEnable(),outline:"none"},disablePictureInPicture:!0,onLoadedMetadataCapture:this.handleOnLoadedMetadataCapture,onEnded:this.handleOnEnd,controls:!0,controlsList:"nodownload nofullscreen",onTimeUpdate:this.timeUpdate,preload:"metadata"}))))},t}(o.Component),y=(m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),b=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},x=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] img {\n width: 20px;\n margin-left: 8px;\n}\n.white-video-plugin-nav-title {\n margin-left: 6px;\n font-size: 12px;\n font-weight: bold;\n flex-grow: 1;\n}\n.white-video-plugin-nav-delete {\n width: 22px;\n height: 22px;\n border: 0;\n background-color: #ff756e;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n margin-right: 8px;\n cursor: pointer;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.white-video-plugin-nav-delete > img {\n width: 14px;\n}\n.white-video-plugin-nav-delete:hover {\n opacity: 1;\n}\n.white-video-plugin-body {\n flex-grow: 1;\n background-color: #f2f4f5;\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n justify-content: center;\n height: calc(100% - 32px);\n}\n.white-video-plugin-body > audio {\n flex-grow: 1;\n outline: none;\n}\n",""]),e.exports=t},function(e,t,n){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n,r,i,o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var s=(n=a,r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),"/*# ".concat(i," */")),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([s]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(d=Date.now(),this.props.player&&(d=this.props.player.beginTimestamp+r),f=l+(d-c)/1e3,Math.abs(n.currentTime-f)>2&&(n.currentTime=f)),this.changedMap.changed("rate",i)&&(n.playbackRate=i),[2]}}))}))}));this.disposers.push(r),this.disposers.push((function(){return e.changedMap.clear()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this.player.current)||void 0===e||e.pause(),this.disposers.forEach((function(e){return e()}))},Object.defineProperty(t.prototype,"containerStyle",{get:function(){var e=this.props,t=e.size,n=e.scale||1;return{width:t.width/n,height:t.height/n,transform:"scale("+n+")"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerEventsStyle",{get:function(){return{pointerEvents:this.isHost()?"auto":"none"}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.room,n=e.player,r=e.plugin;return t||n?i.a.createElement("div",{className:"white-video-plugin-container",style:this.containerStyle},!r.attributes.isNavigationDisable&&i.a.createElement("div",{className:"white-video-plugin-nav"},i.a.createElement("img",{src:s.a,alt:"video_plugin"}),i.a.createElement("span",{className:"white-video-plugin-nav-title"},"Video Player"),i.a.createElement("span",{className:"white-video-plugin-nav-delete",style:this.pointerEventsStyle,onClick:this.removeSelf},i.a.createElement("img",{src:l.a,alt:"delete_icon"}))),i.a.createElement("div",{className:"white-video-plugin-body"},i.a.createElement("video",{src:r.attributes.src,style:m({maxWidth:"100%",maxHeight:"100%"},this.pointerEventsStyle),controls:!!t,controlsList:"nodownload nofullscreen",preload:"metadata",ref:this.player,playsInline:!0,"webkit-playsinline":"true",poster:r.attributes.poster,disablePictureInPicture:!0}))):null},t}(r.Component);n.d(t,"videoPlugin2",(function(){return _}));var _=Object.freeze({kind:"video2",render:b,defaultAttributes:{src:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1},hitTest:function(e){var t=e.component.context.getMemberState();return!("eraser"===(null==t?void 0:t.currentApplianceName))}})}])},"object"==r(t)&&"object"==r(e)?e.exports=i(n(17328),n(71895)):n.amdD([,],i)},18371:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.playerStateNameSpace=t.playerNameSpace=t.sdkNameSpace=t.roomStateNamespace=t.roomNamespace=t.roomSyncNamespace=t.pptNamespace=t.ScaleMode=void 0,function(e){e[e.Scale=0]="Scale",e[e.AspectFit=1]="AspectFit",e[e.AspectFitScale=2]="AspectFitScale",e[e.AspectFitSpace=3]="AspectFitSpace",e[e.AspectFill=4]="AspectFill",e[e.AspectFillScale=5]="AspectFillScale"}(t.ScaleMode||(t.ScaleMode={})),t.pptNamespace="ppt",t.roomSyncNamespace="room.sync",t.roomNamespace="room",t.roomStateNamespace="room.state",t.sdkNameSpace="sdk",t.playerNameSpace="player",t.playerStateNameSpace="player.state"},46640:function(e,t,n){var r;function i(e,t,n){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}},i(e,t,n||e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||M(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||M(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function u(e){var t=f();return function(){var n,r=v(e);if(t){var i=v(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function l(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?c(e):t}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){var t="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return d(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,e)},h(e)}function d(e,t,n){return d=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&p(i,n.prototype),i},d.apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){m(o,r,i,a,s,"next",e)}function s(e){m(o,r,i,a,s,"throw",e)}a(void 0)}))}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function M(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(this.timer=this.initInterval())}},{key:"invoke",value:function(){var e=this;if(0!==this.list.length&&void 0===this.currentInvoker){var t=this.list.shift();t&&(this.currentInvoker=t,t().then((function(){e.invoked()})).catch((function(t){console.error("[WindowManager]: create app error: ".concat(t.message)),e.invoked()})))}}},{key:"emitReady",value:function(){this.isEmit||setTimeout((function(){ae.emit("ready")}),50),this.isEmit=!0}},{key:"empty",value:function(){this.list=[],this.clear()}},{key:"destroy",value:function(){this.timer&&this.clear()}}]),e}(),ue=new Q.default,le=function(){var e=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,t){var n=indexedDB.open("__WindowManagerAppCache",2);n.onerror=function(e){t(e)},n.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains("apps")||t.createObjectStore("apps",{keyPath:"kind"}).createIndex("kind","kind",{unique:!0})},n.onsuccess=function(){var t=n.result;e(t)}}));case 2:Y=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=function(e,t){if(Y)return function(e,t){return new Promise((function(n,r){var i=e.transaction(["apps"],"readwrite").objectStore("apps").add(t);i.onsuccess=function(){return n()},i.onerror=function(){return r()}}))}(Y,{kind:e,sourceCode:t})},he=function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Y){e.next=6;break}return e.next=3,de(Y,t);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=null;case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function de(e,t){return new Promise((function(n,r){var i=e.transaction(["apps"]).objectStore("apps").index("kind").get(t);i.onerror=function(e){return r(e)},i.onsuccess=function(){i.result?n(i.result):n(null)}}))}var fe=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,he(t);case 2:if(!(n=e.sent)){e.next=5;break}return e.abrupt("return",n.sourceCode);case 5:return e.next=7,ge(t,{timeout:1e4});case 7:return e.next=9,e.sent.text();case 9:return r=e.sent,e.next=12,ce(t,r);case 12:return e.abrupt("return",r);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pe=function(e,t){var n=Function(e+"\n;return ".concat(t))();return void 0===n&&(n=window[t]),n},ve=function(){var e=g(regeneratorRuntime.mark((function e(t,n,r){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r||"NetlessApp"+n,ae.emit("loadApp",{kind:n,status:"start"}),e.prev=2,e.next=5,fe(t);case 5:if((o=e.sent)&&0!==o.length){e.next=8;break}throw ae.emit("loadApp",{kind:n,status:"failed",reason:"script is empty."}),new Error("[WindowManager]: script is empty.");case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(2),ae.emit("loadApp",{kind:n,status:"failed",reason:e.t0.message}),e.t0;case 13:return e.abrupt("return",me(o,i,n));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,n,r){return e.apply(this,arguments)}}(),me=function(e,t,n){try{var r=pe(e,t);return ae.emit("loadApp",{kind:n,status:"success"}),r}catch(r){if(r.message.includes("Can only have one anonymous define call per script file")){var i=window.define;"function"==typeof i&&i.amd&&delete i.amd;var o=pe(e,t);return ae.emit("loadApp",{kind:n,status:"success"}),o}throw ae.emit("loadApp",{kind:n,status:"failed",reason:r.message}),r}};function ge(e,t){return ye.apply(this,arguments)}function ye(){return ye=g(regeneratorRuntime.mark((function e(t,n){var r,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.timeout,i=void 0===r?1e4:r,o=new AbortController,a=setTimeout((function(){return o.abort()}),i),e.next=6,fetch(t,O(P({},n),{signal:o.signal,headers:{"content-type":"text/plain"}}));case 6:return s=e.sent,e.abrupt("return",(clearTimeout(a),s));case 8:case"end":return e.stop()}}),e)}))),ye.apply(this,arguments)}var be=function(){function e(){var t=this;y(this,e),this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=function(e){t.register({kind:e.kind,src:e.src})}}var t,n;return x(e,[{key:"setSyncRegisterApp",value:function(e){this.syncRegisterApp=e}},{key:"register",value:(n=g(regeneratorRuntime.mark((function e(t){var n,r,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appClassesCache.delete(t.kind),this.registered.set(t.kind,t),"string"==typeof(n=t.src)&&(r=function(){var e=g(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ve(n,t.kind,t.name);case 2:return r=e.sent,e.abrupt("return",r.__esModule?r.default:r);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),this.syncRegisterApp&&this.syncRegisterApp({kind:t.kind,src:n,name:t.name})),"function"==typeof n&&(r=function(){var e=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n();case 2:if(!(t=e.sent)){e.next=5;break}return e.abrupt("return",((t.__esModule||t.default)&&(t=t.default),t));case 5:throw new Error("[WindowManager]: load remote script failed, ".concat(n));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),"object"==_(n)&&(r=function(){var e=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),this.appClasses.set(t.kind,g(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.appClassesCache.get(t.kind),e.abrupt("return",(n||(n=r(),o.appClassesCache.set(t.kind,n)),n));case 2:case"end":return e.stop()}}),e)})))),t.addHooks&&(i=this.createKindEmitter(t.kind))&&t.addHooks(i);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unregister",value:function(e){this.appClasses.delete(e),this.appClassesCache.delete(e),this.registered.delete(e);var t=this.kindEmitters.get(e);t&&(t.clearListeners(),this.kindEmitters.delete(e))}},{key:"notifyApp",value:(t=g(regeneratorRuntime.mark((function e(t,n,r){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.kindEmitters.get(t),e.next=3,null==i?void 0:i.emit(n,r);case 3:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"createKindEmitter",value:function(e){if(!this.kindEmitters.has(e)){var t=new Q.default;this.kindEmitters.set(e,t)}return this.kindEmitters.get(e)}}]),e}(),xe=new be,_e=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==(n=xe.appClasses.get(t))?void 0:n();case 2:return i=e.sent,e.abrupt("return",i&&(null==(r=i.config)?void 0:r.singleton)?t:"".concat(t,"-").concat(U.v4().replace("-","").slice(0,8)));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),we=function(e,t){if(e.focusScenePath!==t)return e.focusScenePath=t,e},Te=function(e,t){if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){var n="/"===t?"":t;e.setScenePath(n)}},Me=function(e,t,n){e&&e.scenePathType(t)!==B.ScenePathType.None&&e.removeScenes(t,n)};j.debounce((function(e,t){e.emit("mainViewModeChange",t)}),200);var Se=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Ee(e)[t];if(r){var i=r[n];if(i){var o=i.name;return t===ie?"/".concat(o):"".concat(t,"/").concat(o)}}},Ee=function(e){return e.entireScenes()},Ae=function(e,t,n,r){for(var i,o=0;o0&&n.forEach((function(n){var r=e[n];if(r!==t._state[n])if(void 0===r)t._lastValue.set(n,t._state[n]),delete t._state[n],t._setRawState(n,r);else{t._lastValue.set(n,t._state[n]),t._state[n]=r;var i=r;if(j.isObject(r)){var o=t._refMap.get(r);o||(o=function(e){return{k:F.genUID(),v:e,__isRef:!0}}(r),t._refMap.set(r,o)),i=o}t._setRawState(n,i)}}))}else console.error(new Error('Cannot setState on Storage "'.concat(this.id,'" without writable access')),e)}},{key:"emptyStorage",value:function(){if(!(j.size(this._state)<=0)){if(this._destroyed)return void console.error(new Error('Cannot empty destroyed Storage "'.concat(this.id,'".')));if(!this._context.getIsWritable())return void console.error(new Error('Cannot empty Storage "'.concat(this.id,'" without writable access.')));this.setState(j.mapValues(this._state,j.noop))}}},{key:"deleteStorage",value:function(){if(null===this.id)throw new Error("Cannot delete main Storage");this._context.getIsWritable()?(this.destroy(),this._context.updateAttributes([Ze,this.id],void 0)):console.error(new Error('Cannot delete Storage "'.concat(this.id,'" without writable access.')))}},{key:"destroy",value:function(){this._destroyed=!0,this._sideEffect.flushAll()}},{key:"_getRawState",value:function(e){var t;return null===this.id?null!=(t=this._context.getAttributes())?t:e:j.get(this._context.getAttributes(),[Ze,this.id],e)}},{key:"_setRawState",value:function(e,t){if(null===this.id){if(e===Ze)throw new Error('Cannot set attribute internal filed "'.concat(Ze,'"'));return this._context.updateAttributes([e],t)}return this._context.updateAttributes([Ze,this.id,e],t)}},{key:"_updateProperties",value:function(e){var t;if(this._destroyed)console.error(new Error('Cannot call _updateProperties on destroyed Storage "'.concat(this.id,'".')));else if(e.length>0){for(var n={},r=0;rs.pageState.length-1?(console.warn("[WindowManager] nextPage: index out of range"),!1):(s.appProxy.setSceneIndex(t),!0));case 2:case"end":return e.stop()}}),e)}))),this.jumpPage=function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",0<=t&&t=s.pageState.length?(console.warn("[WindowManager]: page index ".concat(t," out of range")),!1):s.appProxy.removeSceneByIndex(n));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.emitter=i.appEmitter,this.isAddApp=i.isAddApp}return x(e,[{key:"dispatchAppEvent",value:function(e,t){ue.emit("custom-".concat(this.kind),{kind:this.kind,appId:this.appId,type:e,value:t})}},{key:"storage",get:function(){return this._storage||(this._storage=new qe(this)),this._storage}},{key:"pageState",get:function(){return this.appProxy.pageState}},{key:"kind",get:function(){return this.appProxy.kind}}]),e}(),Ke=function(){function e(t){var n=this;y(this,e),this.params=t,this.sceneNode=null,this.onSceneChange=function(e){n.sceneNode=e,n.params.notifyPageStateChange()};var r=this.params,i=r.displayer,o=r.scenePath;o&&(this.sceneNode=i.createScenesCallback(o,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}))}return x(e,[{key:"getFullPath",value:function(e){var t,n=null==(t=this.sceneNode)?void 0:t.scenes;if(this.params.scenePath&&n){var r=n[e];if(r)return"".concat(this.params.scenePath,"/").concat(r)}}},{key:"toObject",value:function(){var e,t;return{index:(null==(e=this.params.view)?void 0:e.focusSceneIndex)||0,length:(null==(t=this.sceneNode)?void 0:t.scenes.length)||0}}},{key:"destroy",value:function(){var e;null==(e=this.sceneNode)||e.dispose()}}]),e}(),$e=function(e){return e.Apps="apps",e.Focus="focus",e.State="state",e.BoxState="boxState",e.MainViewCamera="mainViewCamera",e.MainViewSize="mainViewSize",e.Broadcaster="broadcaster",e.Cursors="cursors",e.Position="position",e.CursorState="cursorState",e.FullPath="fullPath",e.Registered="registered",e.IframeBridge="iframeBridge",e}($e||{}),et=new(function(){function e(t){var n=this;y(this,e),this.context=t,this.setAppFocus=function(e,t){t?n.context.safeSetAttributes({focus:e}):n.context.safeSetAttributes({focus:void 0})}}return x(e,[{key:"setContext",value:function(e){this.context=e}},{key:"apps",value:function(){return j.get(this.attributes,["apps"])}},{key:"getAppAttributes",value:function(e){return j.get(this.apps(),[e])}},{key:"getAppState",value:function(e){return j.get(this.apps(),[e,"state"])}},{key:"getMaximized",value:function(){return j.get(this.attributes,["maximized"])}},{key:"getMinimized",value:function(){return j.get(this.attributes,["minimized"])}},{key:"setupAppAttributes",value:function(e,t,n){var r;this.attributes.apps||this.context.safeSetAttributes({apps:{}});var i=["scenePath","title"];n||i.push("scenes");var o=j.pick(e.options,i),a={kind:e.kind,options:o,isDynamicPPT:n};"string"==typeof e.src&&(a.src=e.src),a.createdAt=Date.now(),this.context.safeUpdateAttributes(["apps",t],a),this.context.safeUpdateAttributes(["apps",t,"state"],(w(r={},$.Size,{}),w(r,$.Position,{}),w(r,$.SceneIndex,0),r))}},{key:"updateAppState",value:function(e,t,n){j.get(this.attributes,["apps",e,"state"])&&this.context.safeUpdateAttributes(["apps",e,"state",t],n)}},{key:"cleanAppAttributes",value:function(e){this.context.safeUpdateAttributes(["apps",e],void 0),this.context.safeSetAttributes(w({},e,void 0)),this.attributes.focus===e&&this.cleanFocus()}},{key:"cleanFocus",value:function(){this.context.safeSetAttributes({focus:void 0})}},{key:"getAppSceneIndex",value:function(e){var t;return null==(t=this.getAppState(e))?void 0:t[$.SceneIndex]}},{key:"getAppScenePath",value:function(e){var t,n;return null==(n=null==(t=this.getAppAttributes(e))?void 0:t.options)?void 0:n.scenePath}},{key:"getMainViewScenePath",value:function(){return this.attributes._mainScenePath}},{key:"getMainViewSceneIndex",value:function(){return this.attributes._mainSceneIndex}},{key:"getBoxState",value:function(){return this.attributes.boxState}},{key:"setMainViewScenePath",value:function(e){this.context.safeSetAttributes({_mainScenePath:e})}},{key:"setMainViewSceneIndex",value:function(e){this.context.safeSetAttributes({_mainSceneIndex:e})}},{key:"getMainViewCamera",value:function(){return j.get(this.attributes,["mainViewCamera"])}},{key:"getMainViewSize",value:function(){return j.get(this.attributes,["mainViewSize"])}},{key:"setMainViewCamera",value:function(e){this.context.safeSetAttributes({mainViewCamera:P({},e)})}},{key:"setMainViewSize",value:function(e){this.context.safeSetAttributes({mainViewSize:P({},e)})}},{key:"setMainViewCameraAndSize",value:function(e,t){this.context.safeSetAttributes({mainViewCamera:P({},e),mainViewSize:P({},t)})}},{key:"updateCursor",value:function(e,t){j.get(this.attributes,["cursors"])||this.context.safeUpdateAttributes(["cursors"],{}),j.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"position"],t)}},{key:"updateCursorState",value:function(e,t){j.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"cursorState"],t)}},{key:"getCursorState",value:function(e){return j.get(this.attributes,["cursors",e,"cursorState"])}},{key:"cleanCursor",value:function(e){this.context.safeUpdateAttributes(["cursors",e],void 0)}},{key:"setMainViewFocusPath",value:function(e){var t=this.getMainViewScenePath();t&&we(e,t)}},{key:"getIframeBridge",value:function(){return j.get(this.attributes,["iframeBridge"])}},{key:"setIframeBridge",value:function(e){if(j.isObject(e)){var t=this.getIframeBridge();for(var n in e){var r=e[n];t[n]!==r&&this.context.safeUpdateAttributes(["iframeBridge",n],r)}}}},{key:"attributes",get:function(){return this.context.getAttributes()}},{key:"focus",get:function(){return j.get(this.attributes,["focus"])}}]),e}())({getAttributes:function(){throw new Error("getAttributes not implemented")},safeSetAttributes:function(){throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:function(){throw new Error("safeUpdateAttributes not implemented")}}),tt=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r0&&o.zIndex!==(null==(n=a.box)?void 0:n.zIndex)&&(null==(r=a.boxManager)||r.setZIndex(e,o.zIndex),null==(i=a.boxManager)||i.focusBox({appId:e}))}))})),null==(r=a.manager.refresher)||r.add("".concat(e,"-fullPath"),(function(){return B.autorun((function(){var e,t=null==(e=a.appAttributes)?void 0:e.fullPath;a.setFocusScenePathHandler(t),a._prevFullPath!==t&&(a.notifyPageStateChange(),a._prevFullPath=t)}))}))},this.setFocusScenePathHandler=j.debounce((function(e){var t;a.view&&e&&e!==(null==(t=a.view)?void 0:t.focusScenePath)&&we(a.view,e)}),50),this.notifyPageStateChange=j.debounce((function(){a.appEmitter.emit("pageStateChange",a.pageState)}),50),this.kind=t.kind,this.id=r,this.stateKey="".concat(this.id,"_state"),this.appProxies.set(this.id,this),this.appEmitter=new Q.default,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=i,this.initScenes(),null!=(o=this.params.options)&&o.scenePath&&this.createView(),this._pageState=new Ke({displayer:this.manager.displayer,scenePath:this.scenePath,view:this.view,notifyPageStateChange:this.notifyPageStateChange})}var t,n,r,i,o,a,s,u;return x(e,[{key:"initScenes",value:function(){var e,t=this.params.options;t&&(this.scenePath=t.scenePath,(null==(e=this.appAttributes)?void 0:e.isDynamicPPT)&&this.scenePath?this.scenes=Ee(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}},{key:"getFullScenePath",value:function(){if(this.scenePath)return j.get(this.appAttributes,[$e.FullPath])||this.getFullScenePathFromScenes()}},{key:"getFullScenePathFromScenes",value:function(){var e=j.get(this.appAttributes,["state","SceneIndex"],0),t=function(e,t,n){var r;if(e&&t){var i=null==(r=Ee(e)[t])?void 0:r[n];if(i)return"".concat(t,"/").concat(i.name)}}(this.manager.room,this.scenePath,e);return t&&this.setFullPath(t),t}},{key:"setFullPath",value:function(e){this.manager.safeUpdateAttributes(["apps",this.id,$e.FullPath],e)}},{key:"baseInsertApp",value:(u=g(regeneratorRuntime.mark((function e(){var t,n,r,i,o,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]&&a[0],(r=this.params).kind){e.next=4;break}throw new Error("[WindowManager]: kind require");case 4:return e.next=6,null==(n=xe.appClasses.get(r.kind))?void 0:n();case 6:if(i=e.sent,o=xe.registered.get(r.kind),!i){e.next=13;break}return e.next=11,this.setupApp(this.id,t,i,r.options,null==o?void 0:o.appOptions);case 11:e.next=14;break;case 13:throw new Error("[WindowManager]: app load failed ".concat(r.kind," ").concat(r.src));case 14:return e.abrupt("return",(ue.emit("updateManagerRect"),{appId:this.id,app:i}));case 15:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"setupApp",value:(s=g(regeneratorRuntime.mark((function e(t,n,r,i,o){var a,s,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tt("setupApp",t,r,i),this.boxManager){e.next=2;break}throw new ze;case 2:s=new Je(this.manager,this.boxManager,t,this,o),this.appContext=s,e.prev=4,ue.once("".concat(t).concat(q.WindowCreated)).then(g(regeneratorRuntime.mark((function e(){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n||(o=u.getAppInitState(t),null==(i=u.boxManager)||i.updateBoxState(o)),u.appEmitter.onAny(u.appListener),u.appAttributesUpdateListener(t),u.setViewFocusScenePath(),setTimeout(g(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("setup app",r),e.next=3,r.setup(s);case 3:n=e.sent,u.appResult=n,xe.notifyApp(u.kind,"created",{appId:t,result:n}),u.afterSetupApp(o),u.fixMobileSize();case 5:case"end":return e.stop()}}),e)}))),50);case 1:case"end":return e.stop()}}),e)})))),null==(a=this.boxManager)||a.createBox({appId:t,app:r,options:i,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),this.isAddApp&&this.box&&(this.store.updateAppState(t,$.ZIndex,this.box.zIndex),this.store.updateAppState(t,$.Size,{width:this.box.intrinsicWidth,height:this.box.intrinsicHeight}),this.boxManager.focusBox({appId:t},!1)),e.next=11;break;case 8:throw e.prev=8,e.t0=e.catch(4),console.error(e.t0),new Error("[WindowManager]: app setup error: ".concat(e.t0.message));case 11:case"end":return e.stop()}}),e,this,[[4,8]])}))),function(e,t,n,r,i){return s.apply(this,arguments)})},{key:"fixMobileSize",value:function(){var e,t,n=null==(e=this.boxManager)?void 0:e.getBox(this.id);n&&(null==(t=this.boxManager)||t.resizeBox({appId:this.id,width:n.intrinsicWidth+.001,height:n.intrinsicHeight+.001,skipUpdate:!0}))}},{key:"afterSetupApp",value:function(e){var t;e&&(null==e||!e.x||!e.y)&&(null==(t=this.boxManager)||t.setBoxInitState(this.id))}},{key:"onSeek",value:(a=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appEmitter.emit("seek",t).catch((function(e){console.log("[WindowManager]: emit seek error: ".concat(e.message))})),r=this.getAppInitState(this.id),null==(n=this.boxManager)||n.updateBoxState(r);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"onReconnected",value:(o=g(regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Boolean(this.manager.attributes.apps[this.id])){t.next=4;break}return t.next=3,this.destroy(!0,!1,!0);case 3:return t.abrupt("return");case 4:return this.appEmitter.emit("reconnected",void 0),r=this.getAppInitState(this.id),t.next=8,this.destroy(!0,!1,!0);case 8:return i=this.params,t.next=11,new e(i,this.manager,this.id,this.isAddApp).baseInsertApp(!0);case 11:null==(n=this.boxManager)||n.updateBoxState(r);case 12:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"onRemoveScene",value:(i=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.scenePath&&t.startsWith(this.scenePath+"/")&&(n=this.pageState.index,(r=this._pageState.getFullPath(n))||(n=0,r=this._pageState.getFullPath(n)),r&&this.setFullPath(r),this.setViewFocusScenePath(),this.view&&(this.view.focusSceneIndex=n));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"emitAppSceneStateChange",value:function(e){this.appEmitter.emit("sceneStateChange",e)}},{key:"emitAppIsWritableChange",value:function(){this.appEmitter.emit("writableChange",this.isWritable)}},{key:"makeAppEventListener",value:function(e){var t=this;return function(n,r){var i,o,a,s;if(t.manager.canOperate)switch(n){case"setBoxSize":null==(i=t.boxManager)||i.resizeBox({appId:e,width:r.width,height:r.height,skipUpdate:!1});break;case"setBoxMinSize":null==(o=t.boxManager)||o.setBoxMinSize({appId:e,minWidth:r.minwidth,minHeight:r.minheight});break;case"setBoxTitle":null==(a=t.boxManager)||a.setBoxTitle({appId:e,title:r.title});break;case ee.destroy:if("destroyed"===t.status)return;t.destroy(!0,!1,!0,null==r?void 0:r.error),null!=r&&r.error&&console.error(null==r?void 0:r.error);break;case"focus":null==(s=t.boxManager)||s.focusBox({appId:t.id}),rt.emit("focus",{appId:t.id})}}}},{key:"setScenePath",value:function(){if(this.manager.canOperate){var e=this.getFullScenePath();this.manager.room&&e&&this.view&&Te(this.manager.room,e)}}},{key:"setViewFocusScenePath",value:function(){var e=this.getFullScenePath();return e&&this.view&&we(this.view,e),e}},{key:"createView",value:(r=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.viewManager.createView(this.id);case 2:return t=e.sent,e.abrupt("return",(this.setViewFocusScenePath(),t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"removeSceneByIndex",value:(n=g(regeneratorRuntime.mark((function e(t){var n,r,i=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this._pageState.getFullPath(t))){e.next=6;break}return r=nt(t,this.pageState),e.abrupt("return",(this.setSceneIndexWithoutSync(r),this.manager.dispatchInternalEvent(q.SetAppFocusIndex,{type:"app",appID:this.id,index:r}),setTimeout((function(){Me(i.manager.room,n,t)}),100),!0));case 6:return e.abrupt("return",!1);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setSceneIndexWithoutSync",value:function(e){this.view&&(this.view.focusSceneIndex=e)}},{key:"setSceneIndex",value:function(e){if(this.view){this.view.focusSceneIndex=e;var t=this._pageState.getFullPath(e);t&&this.setFullPath(t)}}},{key:"destroy",value:(t=g(regeneratorRuntime.mark((function e(t,n,r,i){var o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("destroyed"===this.status){e.next=13;break}return this.status="destroyed",e.prev=2,e.next=5,xe.notifyApp(this.kind,"destroy",{appId:this.id});case 5:return e.next=7,this.appEmitter.emit("destroy",{error:i});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.error("[WindowManager]: notifyApp error",e.t0.message,e.t0.stack);case 12:this.appEmitter.clearListeners(),ue.emit("destroy-".concat(this.id),{error:i}),t&&(null==(o=this.boxManager)||o.closeBox(this.id,r)),n&&(this.store.cleanAppAttributes(this.id),this.scenePath&&Me(this.manager.room,this.scenePath)),this.appProxies.delete(this.id),this._pageState.destroy(),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),null==(a=this.manager.refresher)||a.remove(this.id),null==(s=this.manager.refresher)||s.remove(this.stateKey),null==(u=this.manager.refresher)||u.remove("".concat(this.id,"-fullPath")),this._prevFullPath=void 0;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"close",value:function(){return this.destroy(!0,!0,!1)}},{key:"view",get:function(){return this.manager.viewManager.getView(this.id)}},{key:"viewIndex",get:function(){var e;return null==(e=this.view)?void 0:e.focusSceneIndex}},{key:"isWritable",get:function(){var e;return this.manager.canOperate&&!(null!=(e=this.box)&&e.readonly)}},{key:"attributes",get:function(){return this.manager.attributes[this.id]}},{key:"appAttributes",get:function(){return this.store.getAppAttributes(this.id)}},{key:"box",get:function(){var e;return null==(e=this.boxManager)?void 0:e.getBox(this.id)}},{key:"pageState",get:function(){return this._pageState.toObject()}}]),e}(),ot=function(){function e(t){y(this,e),this.displayer=t,this.views=new Map}return x(e,[{key:"createView",value:function(e){var t=at(this.displayer);return this.views.set(e,t),t}},{key:"getView",value:function(e){return this.views.get(e)}},{key:"destroyView",value:function(e){var t=this.views.get(e);if(t){try{t.release()}catch(e){}this.views.delete(e)}}},{key:"setViewScenePath",value:function(e,t){var n=this.views.get(e);n&&(n.focusScenePath=t)}},{key:"destroy",value:function(){this.views.forEach((function(e){try{e.release()}catch(e){}})),this.views.clear()}}]),e}(),at=function(e){var t=e.views.createView();return st(t),t},st=function(e){e.setCameraBound({maxContentMode:function(){return 10},minContentMode:function(){return.1}})},ut=function(){function e(t){var n=this;y(this,e),this.manager=t,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.viewMode=this.manager.windowManger.viewMode,this.sideEffectManager=new F.SideEffectManager,this.startListenWritableChange=function(){n.sideEffectManager.add((function(){return ue.on("writableChange",(function(e){e&&n.ensureCameraAndSize(),n.manager.room&&n.syncMainView(n.manager.room)}))}))},this.addCameraReaction=function(){var e;null==(e=n.manager.refresher)||e.add($e.MainViewCamera,n.cameraReaction)},this.cameraReaction=function(){return B.reaction((function(){return n.mainViewCamera}),(function(e){e&&e.id!==n.manager.uid&&(n.moveCameraToContian(n.mainViewSize),n.moveCamera(e))}),{fireImmediately:!0})},this.sizeChangeHandler=j.debounce((function(e){e&&(n.moveCameraToContian(e),n.moveCamera(n.mainViewCamera))}),30),this.onUpdateContainerSizeRatio=function(){var e=n.store.getMainViewSize();n.sizeChangeHandler(e)},this.onCameraUpdatedByDevice=function(e){n.viewMode!==B.ViewMode.Follower&&(n.store.setMainViewCamera(O(P({},e),{id:n.manager.uid})),j.isEqual(n.mainViewSize,O(P({},n.mainView.size),{id:n.manager.uid}))||n.setMainViewSize(n.view.size))},this.mainViewClickListener=function(){n.mainViewClickHandler()},this.setMainViewSize=j.debounce((function(e){n.store.setMainViewSize(O(P({},e),{id:n.manager.uid}))}),50),this._syncMainViewTimer=0,this.onCameraOrSizeUpdated=function(){ae.emit("cameraStateChange",n.cameraState),n.manager.room&&n.manager.room.syncMainView&&(clearTimeout(n._syncMainViewTimer),n._syncMainViewTimer=setTimeout(n.syncMainView,100,n.manager.room))},this.syncMainView=function(e){e.isWritable&&e.syncMainView(n.mainView)},this.setViewMode=function(e){n.viewMode=e},this.mainView=this.createMainView(),this.moveCameraSizeByAttributes(),ue.once("mainViewMounted").then((function(){n.addMainViewListener(),n.start(),n.ensureCameraAndSize(),n.startListenWritableChange()}));var r=function(){n.sizeChangeHandler(n.mainViewSize)};this.sideEffectManager.add((function(){return ue.on("playgroundSizeChange",r)})),this.sideEffectManager.add((function(){return ue.on("containerSizeRatioUpdate",n.onUpdateContainerSizeRatio)})),this.sideEffectManager.add((function(){return ue.on("startReconnect",(function(){n.didRelease||n.mainView.release()}))}))}var t;return x(e,[{key:"ensureCameraAndSize",value:function(){this.viewMode===B.ViewMode.Broadcaster&&(!this.mainViewCamera||!this.mainViewSize)&&(this.manager.dispatchInternalEvent(q.InitMainViewCamera),this.setCameraAndSize())}},{key:"moveCameraSizeByAttributes",value:function(){this.moveCameraToContian(this.mainViewSize),this.moveCamera(this.mainViewCamera)}},{key:"start",value:function(){this.sizeChangeHandler(this.mainViewSize),!this.started&&(this.addCameraListener(),this.addCameraReaction(),this.manager.room&&this.syncMainView(this.manager.room),this.started=!0)}},{key:"setCameraAndSize",value:function(){var e=O(P({},this.mainView.camera),{id:this.manager.uid}),t=O(P({},this.mainView.size),{id:this.manager.uid});this.store.setMainViewCameraAndSize(e,t)}},{key:"createMainView",value:function(){var e=at(this.manager.displayer),t=this.store.getMainViewScenePath();return t&&we(e,t),e}},{key:"onReconnect",value:function(){if(this.didRelease)this.rebind();else{var e=this.store.getMainViewScenePath();this.setFocusScenePath(e)}}},{key:"setFocusScenePath",value:function(e){if(e)return we(this.view,e)}},{key:"rebind",value:function(){var e=this.mainView.divElement,t=this.mainView.disableCameraTransform;this.stop(),this.didRelease||this.mainView.release(),this.removeMainViewListener(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=t,this.mainView.divElement=e,this.addMainViewListener(),this.start()}},{key:"addMainViewListener",value:function(){this.mainViewIsAddListener||this.view.divElement&&(this.view.divElement.addEventListener("click",this.mainViewClickListener),this.view.divElement.addEventListener("touchend",this.mainViewClickListener),this.mainViewIsAddListener=!0)}},{key:"removeMainViewListener",value:function(){this.view.divElement&&(this.view.divElement.removeEventListener("click",this.mainViewClickListener),this.view.divElement.removeEventListener("touchend",this.mainViewClickListener)),this.mainViewIsAddListener=!1}},{key:"mainViewClickHandler",value:(t=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!this.manager.canOperate||(this.store.cleanFocus(),null==(t=this.manager.boxManager)||t.blurAllBox());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"addCameraListener",value:function(){this.view.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}},{key:"removeCameraListener",value:function(){this.view.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}},{key:"moveCameraToContian",value:function(e){j.isEmpty(e)||(this.view.moveCameraToContain({width:e.width,height:e.height,originX:-e.width/2,originY:-e.height/2,animationMode:B.AnimationMode.Immediately}),this.scale=this.view.camera.scale)}},{key:"moveCamera",value:function(e){if(!j.isEmpty(e)){if(j.isEqual(e,this.view.camera))return;var t=e.centerX,n=e.centerY,r=e.scale*(this.scale||1);this.view.moveCamera({centerX:t,centerY:n,scale:r,animationMode:B.AnimationMode.Immediately})}}},{key:"stop",value:function(){var e,t;this.removeCameraListener(),null==(e=this.manager.refresher)||e.remove($e.MainViewCamera),null==(t=this.manager.refresher)||t.remove($e.MainViewSize),this.started=!1}},{key:"destroy",value:function(){this.removeMainViewListener(),this.stop(),this.sideEffectManager.flushAll()}},{key:"mainViewCamera",get:function(){return this.store.getMainViewCamera()}},{key:"mainViewSize",get:function(){return this.store.getMainViewSize()}},{key:"didRelease",get:function(){return j.get(this.view,["didRelease"])}},{key:"view",get:function(){return this.mainView}},{key:"cameraState",get:function(){return P(P({},this.view.camera),this.view.size)}}]),e}(),lt=function(){function e(t){var n=this;y(this,e),this.context=t,this.addRedoUndoListeners=function(e){if(void 0===e)n.addViewCallbacks(n.context.mainView(),n.onCanRedoStepsUpdate,n.onCanUndoStepsUpdate);else{var t=n.context.getAppProxy(e);t&&t.view&&n.addViewCallbacks(t.view,n.onCanRedoStepsUpdate,n.onCanUndoStepsUpdate)}},this.addViewCallbacks=function(e,t,n){t(e.canRedoSteps),n(e.canUndoSteps),e.callbacks.on("onCanRedoStepsUpdate",t),e.callbacks.on("onCanUndoStepsUpdate",n)},this.disposeViewCallbacks=function(e){e.callbacks.off("onCanRedoStepsUpdate",n.onCanRedoStepsUpdate),e.callbacks.off("onCanUndoStepsUpdate",n.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=function(e){ae.emit("canRedoStepsChange",e)},this.onCanUndoStepsUpdate=function(e){ae.emit("canUndoStepsChange",e)},this.disposePrevFocusViewRedoUndoListeners=function(e){var t;if(void 0===e)t=n.context.mainView();else{var r=n.context.getAppProxy(e);r&&r.view&&(t=r.view)}t&&n.disposeViewCallbacks(t)},ue.on("focusedChange",(function(e){n.disposePrevFocusViewRedoUndoListeners(e.prev),setTimeout((function(){n.addRedoUndoListeners(e.focused)}),0)})),ue.on("rootDirRemoved",(function(){n.disposePrevFocusViewRedoUndoListeners(t.focus()),n.addRedoUndoListeners(t.focus())})),this.addRedoUndoListeners(t.focus())}return x(e,[{key:"destroy",value:function(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}]),e}(),ct=function(){function e(t){var n=this;y(this,e),this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=et,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new se,this.sideEffectManager=new F.SideEffectManager,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=function(){var e=g(regeneratorRuntime.mark((function e(t){var r,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((o=t.scenePath)!==ie){e.next=6;break}return e.next=4,n.onRootDirRemoved();case 4:return n.dispatchInternalEvent(q.RootDirRemoved),e.abrupt("return");case 6:if(!De(o)){e.next=14;break}return a=n.mainView.focusSceneIndex||0,(s=null==(r=n.callbacksNode)?void 0:r.scenes[a])||(a=0,s=null==(i=n.callbacksNode)?void 0:i.scenes[a]),s&&n.setMainViewScenePath("".concat(ie).concat(s)),e.next=12,n.setMainViewSceneIndex(a);case 12:e.next=15;break;case 14:n.appProxies.forEach((function(e){e.onRemoveScene(o)}));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onReadonlyChanged=function(){n.appProxies.forEach((function(e){e.emitAppIsWritableChange()}))},this.onPlayerSeekStart=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.closeAll();case 2:case"end":return e.stop()}}),e)}))),this.onPlayerSeekDone=function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.attributesUpdateCallback(n.attributes.apps);case 2:n.appProxies.forEach((function(e){e.onSeek(t)}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.createRootDirScenesCallback=function(){var e,t=!1;n.callbacksNode&&(n.callbacksNode.dispose(),t=!0),n.callbacksNode=n.displayer.createScenesCallback(ie,{onAddScene:n.onSceneChange,onRemoveScene:(e=g(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.onSceneChange(t);case 2:ue.emit("rootDirSceneRemoved",r);case 3:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})}),n.callbacksNode&&(n.updateSceneState(n.callbacksNode),n.mainViewScenesLength=n.callbacksNode.scenes.length,t&&n.emitMainViewScenesChange(n.callbacksNode.scenes.length))},this.removeSceneByIndex=function(){var e=g(regeneratorRuntime.mark((function e(t){var r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=nt(t,n.windowManger.pageState),n.setSceneIndexWithoutSync(i),n.dispatchInternalEvent(q.SetAppFocusIndex,{type:"main",index:i}),o=null==(r=n.callbacksNode)?void 0:r.scenes[t],e.abrupt("return",(setTimeout((function(){o&&Me(n.room,"".concat(ie).concat(o),t)}),100),new Promise((function(e,t){ue.once("rootDirSceneRemoved").then((function(t){t===o&&e(!0)})).catch((function(e){console.log("[WindowManager]: removePage error: ".concat(e)),t(!1)}))}))));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.setSceneIndexWithoutSync=function(e){var t,r=null==(t=n.callbacksNode)?void 0:t.scenes[e];r&&n.mainViewProxy.setFocusScenePath("".concat(ie).concat(r))},this.onSceneChange=function(e){return n.mainViewScenesLength=e.scenes.length,n.updateSceneState(e),n.emitMainViewScenesChange(n.mainViewScenesLength)},this.emitMainViewScenesChange=function(e){return Promise.all([ae.emit("mainViewScenesLengthChange",e),ue.emit("changePageState")])},this.updateSceneState=function(e){var t=n.store.getMainViewSceneIndex()||0,r=e.scenes[t];r||(r=e.scenes[n.mainView.focusSceneIndex||0]),n.sceneState={scenePath:"".concat(ie).concat(r),contextPath:e.path,index:t,scenes:e.scenes.map((function(e){return{name:e}})),sceneName:r},ae.emit("sceneStateChange",n.sceneState)},this.onBoxMove=function(e){n.dispatchInternalEvent(q.AppMove,e),n.store.updateAppState(e.appId,$.Position,{x:e.x,y:e.y})},this.onBoxResize=function(e){e.width&&e.height&&(n.dispatchInternalEvent(q.AppResize,e),n.store.updateAppState(e.appId,$.Size,{width:e.width,height:e.height}))},this.onBoxFocus=function(e){n.windowManger.safeSetAttributes({focus:e.appId})},this.onBoxClose=function(e){var t=n.appProxies.get(e.appId);t&&t.destroy(!1,!0,!0,e.error)},this.onBoxStateChange=function(e){n.dispatchInternalEvent(q.AppBoxStateChange,e)},this.addAppsChangeListener=function(){var e;null==(e=n.refresher)||e.add("apps",(function(){return Ve((function(){return n.attributes.apps}),(function(){n.attributesUpdateCallback(n.attributes.apps)}))}))},this.addAppCloseListener=function(){var e;null==(e=n.refresher)||e.add("appsClose",(function(){return We(n.attributes.apps,(function(){n.onAppDelete(n.attributes.apps)}))}))},this.onMainViewIndexChange=function(e){void 0!==e&&n._prevSceneIndex!==e&&(ae.emit("mainViewSceneIndexChange",e),ue.emit("changePageState"),n.callbacksNode&&n.updateSceneState(n.callbacksNode),n._prevSceneIndex=e)},this.onFocusChange=function(e){var t;n._prevFocused!==e&&(ae.emit("focusedChange",e),ue.emit("focusedChange",{focused:e,prev:n._prevFocused}),n._prevFocused=e,void 0!==e&&(null==(t=n.boxManager)||t.focusBox({appId:e}),setTimeout((function(){var t=n.appProxies.get(e);t&&xe.notifyApp(t.kind,"focus",{appId:e})}),0)))},this.attributesUpdateCallback=j.debounce((function(e){return n._attributesUpdateCallback(e)}),100),this._appIds=[],this.onRegisteredChange=function(e){!e||Object.entries(e).forEach((function(e){var t=o(e,2),n=t[0],r=t[1];xe.appClasses.has(n)||xe.register({kind:n,src:r.src,name:r.name})}))},this.onMinimized=function(e){var t,r;(null==(t=n.boxManager)?void 0:t.minimized)!==e&&(!0===e&&(null==(r=n.boxManager)||r.blurAllBox()),setTimeout((function(){var t;null==(t=n.boxManager)||t.setMinimized(Boolean(e))}),0))},this.onAppDelete=function(){var e=g(regeneratorRuntime.mark((function e(t){var r,i,a,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Object.keys(t),i=T(n.appProxies.entries()),e.prev=2,i.s();case 4:if((a=i.n()).done){e.next=12;break}if(s=o(a.value,2),u=s[0],l=s[1],e.t0=r.includes(u),e.t0){e.next=10;break}return e.next=10,l.destroy(!0,!1,!0);case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t1=e.catch(2),i.e(e.t1);case 17:return e.prev=17,i.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[2,14,17,20]])})));return function(t){return e.apply(this,arguments)}}(),this.closeAll=g(regeneratorRuntime.mark((function e(){var t,r,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=T(n.appProxies.entries()),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return i=o(r.value,2),i[0],a=i[1],e.next=7,a.destroy(!0,!1,!0);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])}))),this.displayerStateListener=function(e){var t=e.sceneState;if(t){var r=t.scenePath;n.appProxies.forEach((function(e){e.scenePath&&r.startsWith(e.scenePath)&&(e.emitAppSceneStateChange(t),e.setFullPath(r))}))}n.appProxies.forEach((function(t){t.appEmitter.emit("roomStateChange",e)})),ue.emit("observerIdChange",n.displayer.observerId)},this.displayerWritableListener=function(e){var t,r,i=!e,o=void 0===n.windowManger.readonly||!1===n.windowManger.readonly;void 0===n.windowManger.readonly?null==(t=n.boxManager)||t.setReadonly(e):null==(r=n.boxManager)||r.setReadonly(!(i&&o)),n.appProxies.forEach((function(e){e.emitAppIsWritableChange()})),ue.emit("writableChange",i)},this.updateSceneIndex=function(){var e=n.store.getMainViewScenePath(),t=Ie(e),r=Ee(n.displayer)[t];if(r.length){var i=e.replace(t,"").replace("/",""),o=r.findIndex((function(e){return e.name===i}));j.isInteger(o)&&o>=0&&n.safeSetAttributes({_mainSceneIndex:o})}},this.updateRootDirRemoving=function(e){n.rootDirRemoving=e},this.displayer=t.displayer,this.store.setContext({getAttributes:function(){return n.attributes},safeSetAttributes:function(e){return n.safeSetAttributes(e)},safeUpdateAttributes:function(e,t){return n.safeUpdateAttributes(e,t)}}),this.mainViewProxy=new ut(this),this.viewManager=new ot(this.displayer),this.appListeners=new Pe(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=Eb,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:ue}),this.sideEffectManager.add((function(){return function(){var e,t,r;n.appCreateQueue.destroy(),n.mainViewProxy.destroy(),null==(e=n.refresher)||e.destroy(),n.viewManager.destroy(),null==(t=n.boxManager)||t.destroy(),null==(r=n.callbacksNode)||r.dispose()}})),ue.once("onCreated").then((function(){return n.onCreated()})),ue.on("onReconnected",(function(){return n.onReconnected()})),B.isPlayer(this.displayer)&&(ue.on("seekStart",this.onPlayerSeekStart),ue.on("seek",this.onPlayerSeekDone)),ue.on("removeScenes",this.onRemoveScenes),ue.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),xe.setSyncRegisterApp((function(e){n.safeUpdateAttributes([$e.Registered,e.kind],e)}))}var t,n,r,i,a,s,u,l,c,h,d;return x(e,[{key:"onRootDirRemoved",value:(d=g(regeneratorRuntime.mark((function e(){var t,n,r,i,a,s,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!(u.length>0&&void 0!==u[0])||u[0],this.setMainViewScenePath(oe),this.createRootDirScenesCallback(),n=T(this.appProxies.entries()),e.prev=3,n.s();case 5:if((r=n.n()).done){e.next=13;break}if(i=o(r.value,2),a=i[0],s=i[1],e.t0=s.view,!e.t0){e.next=11;break}return e.next=11,this.closeApp(a,t);case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(3),n.e(e.t1);case 18:return e.prev=18,n.f(),e.finish(18);case 21:this.mainViewProxy.rebind(),ue.emit("rootDirRemoved"),this.updateRootDirRemoving(!1);case 22:case"end":return e.stop()}}),e,this,[[3,15,18,21]])}))),function(){return d.apply(this,arguments)})},{key:"getMainViewSceneDir",value:function(){var e=this.store.getMainViewScenePath();if(e)return Ie(e);throw new Error("[WindowManager]: mainViewSceneDir not found")}},{key:"onCreated",value:(h=g(regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.attributesUpdateCallback(this.attributes.apps);case 2:if(ue.emit("updateManagerRect"),rt.on("move",this.onBoxMove),rt.on("resize",this.onBoxResize),rt.on("focus",this.onBoxFocus),rt.on("close",this.onBoxClose),rt.on("boxStateChange",this.onBoxStateChange),this.addAppsChangeListener(),this.addAppCloseListener(),null==(t=this.refresher)||t.add("maximized",(function(){return B.autorun((function(){var e,t=u.attributes.maximized;null==(e=u.boxManager)||e.setMaximized(Boolean(t))}))})),null==(n=this.refresher)||n.add("minimized",(function(){return B.autorun((function(){var e=u.attributes.minimized;u.onMinimized(e)}))})),null==(r=this.refresher)||r.add("mainViewIndex",(function(){return B.autorun((function(){var e=j.get(u.attributes,"_mainSceneIndex");u.onMainViewIndexChange(e)}))})),null==(i=this.refresher)||i.add("focusedChange",(function(){return B.autorun((function(){var e=j.get(u.attributes,"focus");u.onFocusChange(e)}))})),null==(o=this.refresher)||o.add("registeredChange",(function(){return B.autorun((function(){var e=j.get(u.attributes,$e.Registered);u.onRegisteredChange(e)}))})),this.attributes.apps&&0!==Object.keys(this.attributes.apps).length){e.next=20;break}if(s=this.store.getMainViewScenePath()){e.next=19;break}return e.abrupt("return");case 19:this.resetScenePath(s);case 20:this.displayerWritableListener(!(null!=(a=this.room)&&a.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this._prevFocused=this.attributes.focus,this.sideEffectManager.add((function(){var e=new lt({mainView:function(){return u.mainViewProxy.view},focus:function(){return u.attributes.focus},getAppProxy:function(e){return u.appProxies.get(e)}});return function(){return e.destroy()}}));case 21:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"notifyAppsChange",value:function(e){(this._appIds.length!==e.length||!this._appIds.every((function(t){return e.includes(t)})))&&(this._appIds=e,ae.emit("appsChange",e))}},{key:"_attributesUpdateCallback",value:(c=g(regeneratorRuntime.mark((function e(t){var n,r,i,o,a,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&Ib.container){0===(n=Object.keys(t)).length&&this.appCreateQueue.emitReady(),r=j.orderBy(n.map((function(e){return{id:e,createdAt:t[e].createdAt}})),"createdAt","asc").map((function(e){return e.id})),this.notifyAppsChange(r),i=T(r);try{for(a=function(){var e=o.value;if(!s.appProxies.has(e)&&!s.appStatus.has(e)){var n=t[e];try{if(!s.attributes[e])throw new Error("appAttributes is undefined");s.appCreateQueue.push((function(){return s.appStatus.set(e,te.StartCreate),s.baseInsertApp({kind:n.kind,options:n.options,isDynamicPPT:n.isDynamicPPT},e,!1)})),s.focusByAttributes(t)}catch(e){console.warn("[WindowManager]: Insert App Error",e)}}},i.s();!(o=i.n()).done;)a()}catch(e){i.e(e)}finally{i.f()}}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"refresh",value:function(){this.attributesUpdateCallback(this.attributes.apps)}},{key:"setBoxManager",value:function(e){this.boxManager=e}},{key:"resetMaximized",value:function(){var e;null==(e=this.boxManager)||e.setMaximized(Boolean(this.store.getMaximized()))}},{key:"resetMinimized",value:function(){var e;null==(e=this.boxManager)||e.setMinimized(Boolean(this.store.getMinimized()))}},{key:"bindMainView",value:function(e,t){var n=this.mainViewProxy.view;n.disableCameraTransform=t,n.divElement=e,n.focusScenePath||this.setMainViewFocusPath(),ue.emit("mainViewMounted")}},{key:"setMainViewFocusPath",value:function(e){var t,n=e||this.store.getMainViewScenePath();if(n)return we(this.mainView,n),(null==(t=this.mainView)?void 0:t.focusScenePath)===n}},{key:"resetScenePath",value:function(e){this.displayer.state.sceneState.scenePath!==e&&Te(this.room,e)}},{key:"addApp",value:(l=g(regeneratorRuntime.mark((function e(t,n){var r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return tt("addApp",t),e.next=3,this.beforeAddApp(t,n);case 3:return r=e.sent,i=r.appId,o=r.needFocus,e.next=8,this.baseInsertApp(t,i,!0,o);case 8:return a=e.sent,e.abrupt("return",(this.afterAddApp(a),null==a?void 0:a.id));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"beforeAddApp",value:(u=g(regeneratorRuntime.mark((function e(t,n){var r,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e(t.kind);case 2:return o=e.sent,this.appStatus.set(o,te.StartCreate),a=null!=(r=t.attributes)?r:{},this.safeUpdateAttributes([o],a),this.store.setupAppAttributes(t,o,n),s=!(null!=(i=this.boxManager)&&i.minimized),e.abrupt("return",(s&&this.store.setAppFocus(o,!0),{appId:o,needFocus:s}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"afterAddApp",value:function(e){var t,n;if(e&&e.box){var r=e.box;rt.emit("move",{appId:e.id,x:null==r?void 0:r.intrinsicX,y:null==r?void 0:r.intrinsicY}),this.store.updateAppState(e.id,$.ZIndex,r.zIndex)}null!=(t=this.boxManager)&&t.minimized&&(null==(n=this.boxManager)||n.setMinimized(!1,!1))}},{key:"closeApp",value:(s=g(regeneratorRuntime.mark((function e(t){var n,r,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!(i.length>1&&void 0!==i[1])||i[1],(r=this.appProxies.get(t))&&r.destroy(!0,n,!1);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"baseInsertApp",value:(a=g(regeneratorRuntime.mark((function e(t,n,r,i){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appProxies.has(n)){e.next=3;break}return console.warn("[WindowManager]: app duplicate exists and cannot be created again"),e.abrupt("return");case 3:if(!(o=new it(t,this,n,r))){e.next=9;break}return e.next=7,o.baseInsertApp(i);case 7:return this.appStatus.delete(n),e.abrupt("return",o);case 9:throw this.appStatus.delete(n),new Error("[WindowManger]: initialize AppProxy failed");case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"safeSetAttributes",value:function(e){this.windowManger.safeSetAttributes(e)}},{key:"safeUpdateAttributes",value:function(e,t){this.windowManger.safeUpdateAttributes(e,t)}},{key:"setMainViewScenePath",value:(i=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.room){e.next=17;break}if(n=this.displayer.scenePathType(t),Ie(t)===ie){e.next=4;break}throw new Error('[WindowManager]: main view scenePath must in root dir "/"');case 4:if(n!==B.ScenePathType.None){e.next=6;break}throw new Error("[WindowManager]: ".concat(t," not valid scene"));case 6:if(n!==B.ScenePathType.Page){e.next=11;break}return e.next=9,this._setMainViewScenePath(t);case 9:e.next=17;break;case 11:if(n!==B.ScenePathType.Dir){e.next=17;break}if(r=Se(this.displayer,t),e.t0=r,!e.t0){e.next=17;break}return e.next=17,this._setMainViewScenePath(r);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_setMainViewScenePath",value:(r=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setMainViewFocusPath(t)&&(this.safeSetAttributes({_mainScenePath:t}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(n=g(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.room){e.next=9;break}if(this.store.getMainViewSceneIndex()!==t){e.next=3;break}return e.abrupt("return");case 3:if(r=null==(n=this.callbacksNode)?void 0:n.scenes[t],i="".concat(ie).concat(r),!r){e.next=8;break}this.setMainViewFocusPath(i)&&(this.store.setMainViewScenePath(i),this.store.setMainViewSceneIndex(t),this.dispatchSetMainViewScenePath(i)),e.next=9;break;case 8:throw new Error("[WindowManager]: ".concat(t," not valid index"));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"dispatchSetMainViewScenePath",value:function(e){this.dispatchInternalEvent(q.SetMainViewScenePath,{nextScenePath:e}),ae.emit("mainViewScenePathChange",e),Te(this.room,e)}},{key:"getAppInitPath",value:function(e){var t,n=this.store.getAppAttributes(e);if(n)return null==(t=null==n?void 0:n.options)?void 0:t.scenePath}},{key:"safeDispatchMagixEvent",value:function(e,t){this.canOperate&&this.displayer.dispatchMagixEvent(e,t)}},{key:"focusByAttributes",value:function(e){var t;if(e&&Object.keys(e).length===(null==(t=this.boxManager)?void 0:t.boxSize)){var n=this.store.focus;n&&this.boxManager.focusBox({appId:n})}}},{key:"onReconnected",value:(t=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.attributesUpdateCallback(this.attributes.apps),t=Array.from(this.appProxies.values()).map((function(e){return e.onReconnected()})),this.mainViewProxy.onReconnect(),e.next=5,Promise.all(t);case 5:this.callbacksNode&&this.onSceneChange(this.callbacksNode);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"notifyContainerRectUpdate",value:function(e){this.appProxies.forEach((function(t){t.appEmitter.emit("containerRectUpdate",e)}))}},{key:"dispatchInternalEvent",value:function(e,t){this.safeDispatchMagixEvent(J,{eventName:e,payload:t})}},{key:"destroy",value:function(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),rt.clearListeners(),ue.clearListeners(),this.appProxies.size&&this.appProxies.forEach((function(e){e.destroy(!0,!1,!0)})),ae.clearListeners(),this.sideEffectManager.flushAll(),this._prevFocused=void 0,this._prevSceneIndex=void 0}},{key:"eventName",get:function(){return B.isRoom(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}},{key:"attributes",get:function(){return this.windowManger.attributes}},{key:"canOperate",get:function(){return this.windowManger.canOperate}},{key:"room",get:function(){return B.isRoom(this.displayer)?this.displayer:void 0}},{key:"mainView",get:function(){return this.mainViewProxy.view}},{key:"focusApp",get:function(){if(this.store.focus)return this.appProxies.get(this.store.focus)}},{key:"uid",get:function(){var e;return(null==(e=this.room)?void 0:e.uid)||""}}]),e}(),ht=function(){if(Ne(B.WhiteVersion)Ib.containerSizeRatio?(i=r*Ib.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!0)):(r=i/Ib.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!1)),n.style.width="".concat(r,"px"),n.style.height="".concat(i,"px"))}},{key:"disconnect",value:function(){var e;null==(e=this.containerResizeObserver)||e.disconnect(),j.isFunction(this.disposer)&&(this.disposer(),this.disposer=void 0)}}],[{key:"create",value:function(t,n,r,i){var o=new e(i);return o.observePlaygroundSize(t,n,r),o}}]),e}(),mt={exports:{}},gt={},yt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable;function _t(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var wt=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=_t(e),o=1;o0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(){for(var e=[],t=0;t2&&ne("box");var n=Q(t);return new Se(e,Z(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&ne("shallowBox"),te.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&ne("array");var n=Q(t);return new Tt(e,Z(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&ne("shallowArray"),te.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&ne("map");var n=Q(t);return new kt(e,Z(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&ne("shallowMap"),te.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&ne("set");var n=Q(t);return new Rt(e,Z(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&ne("object");var r=Q(n);return rt({},e,t,r)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&ne("shallowObject"),te.object(e,{},{name:t,deep:!1})},ref:K,shallow:J,deep:q,struct:$},te=function e(t,n,r){if("string"==typeof arguments[1])return q.apply(null,arguments);if(at(t))return t;var i=x(t)?e.object(t,n,r):Array.isArray(t)?e.array(t,n):M(t)?e.map(t,n):S(t)?e.set(t,n):t;if(i!==t)return i;v(!1)};function ne(e){v("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ee).forEach((function(e){return te[e]=ee[e]}));var re,ie,oe=G(!1,(function(e,t,n,r,i){var o=n.get,a=n.set,u=i[0]||{};!function(e,t,n){var r=Bt(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new Ee(n),Object.defineProperty(e,t,function(e){return zt[e]||(zt[e]={configurable:Ne.computedConfigurable,enumerable:!1,get:function(){return Ft(this).read(this,e)},set:function(t){Ft(this).write(this,e,t)}})}(t))}(e,t,s({get:o,set:a},u))}));oe({equals:j.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(re||(re={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ie||(ie={}));var ae=function(e){this.cause=e};function se(e){return e instanceof ae}function ue(e){switch(e.dependenciesState){case re.UP_TO_DATE:return!1;case re.NOT_TRACKING:case re.STALE:return!0;case re.POSSIBLY_STALE:for(var t=ve(!0),n=fe(),r=e.observing,i=r.length,o=0;o0;Ne.computationDepth>0&&t&&v(!1),Ne.allowStateChanges||!t&&"strict"!==Ne.enforceActions||v(!1)}function ce(e,t,n){var r=ve(!0);ge(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ne.runId;var i,o=Ne.trackingDerivation;if(Ne.trackingDerivation=e,!0===Ne.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(e){i=new ae(e)}return Ne.trackingDerivation=o,function(e){for(var t=e.observing,n=e.observing=e.newObserving,r=re.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;ar&&(r=s.dependenciesState);for(n.length=i,e.newObserving=null,o=t.length;o--;)0===(s=t[o]).diffValue&&De(s,e),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,ke(s,e))}r!==re.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),e.observing.length,me(r),i}function he(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)De(t[n],e);e.dependenciesState=re.NOT_TRACKING}function de(e){var t=fe(),n=e();return pe(t),n}function fe(){var e=Ne.trackingDerivation;return Ne.trackingDerivation=null,e}function pe(e){Ne.trackingDerivation=e}function ve(e){var t=Ne.allowStateReads;return Ne.allowStateReads=e,t}function me(e){Ne.allowStateReads=e}function ge(e){if(e.dependenciesState!==re.UP_TO_DATE){e.dependenciesState=re.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=re.UP_TO_DATE}}var ye=0,be=1,xe=Object.getOwnPropertyDescriptor((function(){}),"name");function _e(e,t){var n=function(){return we(e,t,this,arguments)};return n.isMobxAction=!0,n}function we(e,t,n,r){var i=function(e,t,n){var r=Ge()&&!!e,i=0;if(r){i=Date.now();var o=n&&n.length||0,a=new Array(o);if(o>0)for(var s=0;s0&&!e.__mobxGlobals&&(Ce=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ie).version&&(Ce=!1),Ce?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ie):(setTimeout((function(){v("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ie)}();function ke(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function De(e,t){if(1===e.observers.length)e.observers.length=0,Pe(e);else{var n=e.observers,r=e.observersIndexes,i=n.pop();if(i!==t){var o=r[t.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[t.__mapid]}}function Pe(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ne.pendingUnobservations.push(e))}function Oe(){Ne.inBatch++}function Re(){if(0==--Ne.inBatch){Ue();for(var e=Ne.pendingUnobservations,t=0;t0&&Pe(e),!1)}function je(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ie.BREAK){var n=[];!function e(t,n,r){n.length>=1e3?n.push("(and many more)"):(n.push(""+new Array(r).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,n,r+1)})))}((r=e,it(Vt(r,void 0))),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Ee?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}var r}var Be=function(){function e(e,t,n,r){void 0===e&&(e="Reaction@"+p()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=re.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+p(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ie.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ne.pendingReactions.push(this),Ue())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Oe(),this._isScheduled=!1,ue(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ge()&&He({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Re()}},e.prototype.track=function(e){Oe();var t,n=Ge();n&&(t=Date.now(),Ve({name:this.name,type:"reaction"})),this._isRunning=!0;var r=ce(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&he(this),se(r)&&this.reportExceptionInDerivation(r.cause),n&&Ye({time:Date.now()-t}),Re()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ne.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ne.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ge()&&He({type:"error",name:this.name,message:n,error:""+e}),Ne.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Oe(),he(this),Re()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||Ne.isRunningReactions||function(e){e()}(ze)}function ze(){Ne.isRunningReactions=!0;for(var e=Ne.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r",e):2===arguments.length&&"function"==typeof t?_e(e,t):1===arguments.length&&"string"==typeof e?Qe(e):!0!==r?Qe(t).apply(null,arguments):void(e[t]=_e(e.name||t,n.value))};function Je(e,t,n){_(e,t,_e(t,n.bind(e)))}qe.bound=function(e,t,n,r){return!0===r?(Je(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Je(this,t,n.value||n.initializer.call(this)),this[t]},set:Xe}:{enumerable:!1,configurable:!0,set:function(e){Je(this,t,e)},get:function(){}}};var Ke=function(e){return e()};function $e(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Ke}function et(e,t,n){void 0===n&&(n=h),"boolean"==typeof n&&(n={fireImmediately:n});var r,i,o,a=n.name||"Reaction@"+p(),s=qe(a,n.onError?(r=n.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){r.call(this,e)}}):t),u=!n.scheduler&&!n.delay,l=$e(n),c=!0,d=!1,f=n.compareStructural?j.structural:n.equals||j.default,v=new Be(a,(function(){c||u?m():d||(d=!0,l(m))}),n.onError,n.requiresObservable);function m(){if(d=!1,!v.isDisposed){var t=!1;v.track((function(){var n=e(v);t=c||!f(o,n),o=n})),c&&n.fireImmediately&&s(o,v),c||!0!==t||s(o,v),c&&(c=!1)}}return v.schedule(),v.getDisposer()}function tt(e,t,n){return nt("onBecomeUnobserved",e,t,n)}function nt(e,t,n,r){var i="function"==typeof r?Vt(t,n):Vt(t),o="function"==typeof r?r:n,a=i[e];return"function"!=typeof a?v(!1):(i[e]=function(){a.call(this),o.call(this)},function(){i[e]=a})}function rt(e,t,n,r){var i=(r=Q(r)).defaultDecorator||(!1===r.deep?K:q);F(e),Bt(e,r.name,i.enhancer),Oe();try{for(var o in t){var a=Object.getOwnPropertyDescriptor(t,o),s=(n&&o in n?n[o]:a.get?oe:i)(e,o,a,!0);s&&Object.defineProperty(e,o,s)}}finally{Re()}return e}function it(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(it)),r}function ot(e,t){if(null==e)return!1;if(void 0!==t){if(Ht(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return Ht(e)||!!e.$mobx||R(e)||Fe(e)||Ae(e)}function at(e){return 1!==arguments.length&&v(!1),ot(e)}function st(e){switch(e.length){case 0:return Ne.trackingDerivation;case 1:return Vt(e[0]);case 2:return Vt(e[0],e[1])}}function ut(e,t){void 0===t&&(t=void 0),Oe();try{return e.apply(t)}finally{Re()}}function lt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function ct(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function ht(e,t){var n=fe();try{var r=e.interceptors;if(r)for(var i=0,o=r.length;i0}function ft(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function pt(e,t){var n=fe(),r=e.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return ct(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ft(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r0&&e+t+1>xt&&At(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;le(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=c),lt(this)){var o=ht(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!o)return c;t=o.removedCount,n=o.added}var a=(n=0===n.length?n:n.map((function(e){return r.enhancer(e,void 0)}))).length-t;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,l([e,t],n));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&Ge(),i=dt(this),o=i||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&Ve(s(s({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&pt(this,o),r&&Ye()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&Ge(),i=dt(this),o=i||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&Ve(s(s({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&pt(this,o),r&&Ye()},e}(),Tt=function(e){function t(t,n,r,i){void 0===r&&(r="ObservableArray@"+p()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new wt(r,n,o,i);if(w(o,"$mobx",a),t&&t.length){var s=Te(!0);o.spliceWithArray(0,0,t),Me(s)}return bt&&Object.defineProperty(a.array,"0",Mt),o}return a(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,i=this.$mobx.values;r=e1)for(var n=1;n=2&&(this.player.currentTime=e)},e}(),d=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},p=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3&&(n.lastSyncProgressTimestamp=r,n.selfUserInf&&n.selfUserInf.identity===i.host&&t.putAttributes({currentTime:e,play:n.playerState}))},n.handleSeekReaction=function(e,t){n.isHost()||n.player.current&&void 0!==t&&(n.player.current.currentTime=e+Date.now()/1e3-t)},n.handleRemove=function(){return f(n,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.handleRemotePlayState(!1),[4,v(300)];case 1:return t.sent(),e.remove(),[2]}}))}))},n.timeUpdate=function(){if(n.player.current){var e=n.player.current.currentTime;n.onTimeUpdate(e)}},n.detectAudioClickEnable=function(){var e=n.props.plugin;return e.context&&e.context.identity?e.context.identity!==i.host?"none":"auto":"none"},n.renderMuteBox=function(){var e=n.props.plugin;return e.context&&e.context.identity&&e.context.identity!==i.host&&n.state.selfMute?o.createElement("div",{className:"media-mute-box"},o.createElement("div",{onClick:function(){n.setState({selfMute:!1})},onTouchStart:function(){n.setState({selfMute:!1})},style:{pointerEvents:"auto"},className:"media-mute-box-inner"},o.createElement("img",{src:u,alt:"mute_icon"}),o.createElement("span",null,"unmute"))):null},n.renderDeleteBtn=function(){var e=n.props.plugin;return e.context&&e.context.identity&&e.context.identity===i.host?o.createElement("div",{style:{pointerEvents:"auto"},className:"plugin-audio-box-delete",onClick:n.handleRemove},o.createElement("img",{src:c,alt:"delete_icon"})):null},n.renderNavigation=function(){return!0===n.props.plugin.attributes.isNavigationDisable?null:o.createElement("div",{className:"plugin-audio-box-nav"},o.createElement("div",null,o.createElement("img",{style:{width:20,marginLeft:8},src:l,alt:"audio_plugin"}),o.createElement("span",null,"Audio Player")),n.renderDeleteBtn())},n.handleFirstSeek=function(e){if(!e){var t,r=n.props.plugin,i=Date.now()/1e3;t=r.attributes.seekTime?r.attributes.seek+i-r.attributes.seekTime:r.attributes.seek,n.syncNode.syncProgress(t)}},n.player=o.createRef(),n.reactionPlayDisposer=n.startPlayReaction(),n.reactionSeekDisposer=n.startSeekReaction(),n.reactionVolumeDisposer=n.startVolumeReaction(),n.reactionMuteDisposer=n.startMuteTimeReaction(),n.reactionSeekTimeDisposer=n.startSeekTimeReaction(),n.reactionSyncDisposer=n.startSyncReaction(),n.state={play:!1,seek:0,selfMute:!1,currentTime:0,mute:!1,volume:1,isEnd:!1},n}return d(t,e),t.prototype.componentDidMount=function(){return f(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.syncNode=new h(this.player.current),[4,this.handleStartCondition()];case 1:return e.sent(),[2]}}))}))},t.prototype.startPlayReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.play}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.isHost()?[3,2]:[4,this.handleNativePlayerState(t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.startSeekTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seekTime}),(function(n){e.handleSeekReaction(t.attributes.seek,n)}))},t.prototype.startSeekReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seek}),(function(n){e.handleSeekReaction(n,t.attributes.seekTime)}))},t.prototype.startSyncReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.currentTime}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){return this.isHost()||this.player.current&&Math.abs(t-this.player.current.currentTime)>2&&(this.player.current.currentTime=t),[2]}))}))}))},t.prototype.startVolumeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.volume}),(function(t){e.isHost()||e.player.current&&(e.player.current.volume=t)}))},t.prototype.startMuteTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.mute}),(function(t){e.isHost()||e.setState({mute:t})}))},t.prototype.componentWillUnmount=function(){this.reactionPlayDisposer(),this.reactionSeekDisposer(),this.reactionMuteDisposer(),this.reactionVolumeDisposer(),this.reactionSyncDisposer(),this.player.current&&this.player.current.pause()},t.prototype.render=function(){var e=this,t=this.props,n=t.size,r=t.plugin,a=t.scale,s=0===a?1:a,u=navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);return o.createElement("div",{className:"plugin-audio-box",style:{width:n.width/s,height:n.height/s,transform:"scale("+s+")"}},this.renderNavigation(),o.createElement("div",{className:"plugin-audio-box-body"},this.renderMuteBox(),o.createElement("div",{className:"white-plugin-audio-box"},o.createElement("audio",{className:"white-plugin-audio",src:r.attributes.pluginAudioUrl,ref:this.player,muted:this.state.mute?this.state.mute:this.state.selfMute,style:{width:"100%",height:54,pointerEvents:this.detectAudioClickEnable(),outline:"none"},onLoadedMetadataCapture:function(){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return u?[4,v(300)]:[3,2];case 1:e.sent(),this.handleFirstSeek(this.state.isEnd),e.label=2;case 2:return[2]}}))}))},onEnded:function(){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.player.current?this.selfUserInf?this.selfUserInf.identity!==i.host?[3,2]:(r.putAttributes({seek:0,seekTime:void 0,currentTime:0}),[4,v(500)]):[3,5]:[3,7];case 1:return e.sent(),this.player.current.load(),[3,4];case 2:return[4,v(1e3)];case 3:e.sent(),this.player.current.load(),e.label=4;case 4:return[3,7];case 5:return[4,v(1e3)];case 6:e.sent(),this.player.current.load(),e.label=7;case 7:return this.setState({isEnd:!0}),[2]}}))}))},controls:!0,controlsList:"nodownload nofullscreen",onTimeUpdate:this.timeUpdate,preload:"auto"}))))},t}(o.Component),b=(g=function(e,t){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),x=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},_=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] img {\n width: 20px;\n margin-left: 8px;\n}\n.white-audio-plugin-nav-title {\n margin-left: 6px;\n font-size: 12px;\n font-weight: bold;\n flex-grow: 1;\n}\n.white-audio-plugin-nav-delete {\n width: 22px;\n height: 22px;\n border: 0;\n background-color: #ff756e;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n margin-right: 8px;\n cursor: pointer;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.white-audio-plugin-nav-delete > img {\n width: 14px;\n}\n.white-audio-plugin-nav-delete:hover {\n opacity: 1;\n}\n.white-audio-plugin-body {\n flex-grow: 1;\n background-color: #f2f4f5;\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n justify-content: center;\n}\n.white-audio-plugin-body > audio {\n flex-grow: 1;\n outline: none;\n}\n",""]),e.exports=t},function(e,t,n){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n,r,i,o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var s=(n=a,r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),"/*# ".concat(i," */")),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([s]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(d=Date.now(),this.props.player&&(d=this.props.player.beginTimestamp+r),f=l+(d-c)/1e3,Math.abs(n.currentTime-f)>2&&(n.currentTime=f)),this.changedMap.changed("rate",i)&&(n.playbackRate=i),[2]}}))}))}));this.disposers.push(r),this.disposers.push((function(){return e.changedMap.clear()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this.player.current)||void 0===e||e.pause(),this.disposers.forEach((function(e){return e()}))},Object.defineProperty(t.prototype,"containerStyle",{get:function(){var e=this.props,t=e.size,n=e.scale||1;return{width:t.width/n,height:t.height/n,transform:"scale("+n+")"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerEventsStyle",{get:function(){return{pointerEvents:this.isHost()?"auto":"none"}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.room,n=e.player,r=e.plugin;return t||n?i.a.createElement("div",{className:"white-audio-plugin-container",style:this.containerStyle},!r.attributes.isNavigationDisable&&i.a.createElement("div",{className:"white-audio-plugin-nav"},i.a.createElement("img",{src:s.a,alt:"audio_plugin"}),i.a.createElement("span",{className:"white-audio-plugin-nav-title"},"Audio Player"),i.a.createElement("span",{className:"white-audio-plugin-nav-delete",style:this.pointerEventsStyle,onClick:this.removeSelf},i.a.createElement("img",{src:l.a,alt:"delete_icon"}))),i.a.createElement("div",{className:"white-audio-plugin-body"},i.a.createElement("audio",{src:r.attributes.src,style:this.pointerEventsStyle,controls:!!t,controlsList:"nodownload nofullscreen",preload:"auto",ref:this.player}))):null},t}(r.Component);n.d(t,"audioPlugin2",(function(){return _}));var _=Object.freeze({kind:"audio2",render:b,defaultAttributes:{src:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1},hitTest:function(e){var t=e.component.context.getMemberState();return!("eraser"===(null==t?void 0:t.currentApplianceName))}})}])},"object"==r(t)&&"object"==r(e)?e.exports=i(n(17328),n(71895)):n.amdD([,],i)},44112:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)} +/*! For license information please see index.js.LICENSE.txt */var i;e=n.nmd(e),window,i=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==r(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}([function(t,n){t.exports=e},function(e,t,n){(function(e,i){n.d(t,"a",(function(){return nt}));var o=[];Object.freeze(o);var a={};Object.freeze(a);var s={};function u(){return"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:s}function l(){return++De.mobxGuid}function c(e){throw h(!1,e),"X"}function h(e,t){if(!e)throw new Error("[mobx] "+(t||"An invariant failed, however the error is obfuscated because this is an production build."))}function d(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var f=function(){};function p(e){return null!==e&&"object"==r(e)}function v(e){if(null===e||"object"!=r(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function m(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function y(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return p(e)&&!0===e[n]}}function b(e){return void 0!==u().Map&&e instanceof u().Map}function x(e){return e instanceof Set}function _(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function w(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function T(e){return null===e?null:"object"==r(e)?""+e:e}function M(e,t){for(var n=e.next();!n.done;)t(n.value),n=e.next()}function S(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function E(e,t){g(e,S(),t)}function A(e){return e[S()]=C,e}function I(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function C(){return this}var N=function(){function e(e){void 0===e&&(e="Atom@"+l()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=oe.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return Be(this)},e.prototype.reportChanged=function(){Le(),function(e){if(e.lowestObserverState!==oe.STALE){e.lowestObserverState=oe.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===oe.UP_TO_DATE&&(r.isTracing!==ae.NONE&&Ue(r,e),r.onBecomeStale()),r.dependenciesState=oe.STALE}}}(this),je()},e.prototype.toString=function(){return this.name},e}(),k=y("Atom",N);function D(e,t,n){void 0===t&&(t=f),void 0===n&&(n=f);var r=new N(e);return it("onBecomeObserved",r,t,void 0),rt(r,n),r}function P(e,t){return e===t}var O={identity:P,structural:function(e,t){return Zt(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||P(e,t)},shallow:function(e,t){return Zt(e,t,1)}},R=function(e,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function L(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var j=function(){return(j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function U(){for(var e=[],t=0;t2&&ie("box");var n=q(t);return new Ae(e,J(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&ie("shallowBox"),re.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&ie("array");var n=q(t);return new St(e,J(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&ie("shallowArray"),re.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&ie("map");var n=q(t);return new Pt(e,J(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&ie("shallowMap"),re.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&ie("set");var n=q(t);return new jt(e,J(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&ie("object");var r=q(n);return ot({},e,t,r)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&ie("shallowObject"),re.object(e,{},{name:t,deep:!1})},ref:ee,shallow:$,deep:K,struct:te},re=function e(t,n,r){if("string"==typeof arguments[1])return K.apply(null,arguments);if(ut(t))return t;var i=v(t)?e.object(t,n,r):Array.isArray(t)?e.array(t,n):b(t)?e.map(t,n):x(t)?e.set(t,n):t;if(i!==t)return i;c(!1)};function ie(e){c("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ne).forEach((function(e){return re[e]=ne[e]}));var oe,ae,se=V(!1,(function(e,t,n,r,i){var o=n.get,a=n.set,s=i[0]||{};!function(e,t,n){var r=zt(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new Ie(n),Object.defineProperty(e,t,function(e){return Gt[e]||(Gt[e]={configurable:De.computedConfigurable,enumerable:!1,get:function(){return Ht(this).read(this,e)},set:function(t){Ht(this).write(this,e,t)}})}(t))}(e,t,j({get:o,set:a},s))}));se({equals:O.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(oe||(oe={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(ae||(ae={}));var ue=function(e){this.cause=e};function le(e){return e instanceof ue}function ce(e){switch(e.dependenciesState){case oe.UP_TO_DATE:return!1;case oe.NOT_TRACKING:case oe.STALE:return!0;case oe.POSSIBLY_STALE:for(var t=ge(!0),n=ve(),r=e.observing,i=r.length,o=0;o0;De.computationDepth>0&&t&&c(!1),De.allowStateChanges||!t&&"strict"!==De.enforceActions||c(!1)}function de(e,t,n){var r=ge(!0);be(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++De.runId;var i,o=De.trackingDerivation;if(De.trackingDerivation=e,!0===De.disableErrorBoundaries)i=t.call(n);else try{i=t.call(n)}catch(e){i=new ue(e)}return De.trackingDerivation=o,function(e){for(var t=e.observing,n=e.observing=e.newObserving,r=oe.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;ar&&(r=s.dependenciesState);for(n.length=i,e.newObserving=null,o=t.length;o--;)0===(s=t[o]).diffValue&&Oe(s,e),s.diffValue=0;for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,Pe(s,e))}r!==oe.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}(e),e.observing.length,ye(r),i}function fe(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)Oe(t[n],e);e.dependenciesState=oe.NOT_TRACKING}function pe(e){var t=ve(),n=e();return me(t),n}function ve(){var e=De.trackingDerivation;return De.trackingDerivation=null,e}function me(e){De.trackingDerivation=e}function ge(e){var t=De.allowStateReads;return De.allowStateReads=e,t}function ye(e){De.allowStateReads=e}function be(e){if(e.dependenciesState!==oe.UP_TO_DATE){e.dependenciesState=oe.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=oe.UP_TO_DATE}}var xe=0,_e=1,we=Object.getOwnPropertyDescriptor((function(){}),"name");function Te(e,t){var n=function(){return Me(e,t,this,arguments)};return n.isMobxAction=!0,n}function Me(e,t,n,r){var i=function(e,t,n){var r=Ve()&&!!e,i=0;if(r){i=Date.now();var o=n&&n.length||0,a=new Array(o);if(o>0)for(var s=0;s0&&!e.__mobxGlobals&&(ke=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ne).version&&(ke=!1),ke?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ne):(setTimeout((function(){c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Ne)}();function Pe(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Oe(e,t){if(1===e.observers.length)e.observers.length=0,Re(e);else{var n=e.observers,r=e.observersIndexes,i=n.pop();if(i!==t){var o=r[t.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[t.__mapid]}}function Re(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,De.pendingUnobservations.push(e))}function Le(){De.inBatch++}function je(){if(0==--De.inBatch){Fe();for(var e=De.pendingUnobservations,t=0;t0&&Re(e),!1)}function Ue(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ae.BREAK){var n=[];!function e(t,n,r){n.length>=1e3?n.push("(and many more)"):(n.push(""+new Array(r).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,n,r+1)})))}((r=e,at(Yt(r,void 0))),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Ie?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}var r}var ze=function(){function e(e,t,n,r){void 0===e&&(e="Reaction@"+l()),void 0===r&&(r=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=oe.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ae.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,De.pendingReactions.push(this),Fe())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Le(),this._isScheduled=!1,ce(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ve()&&We({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}je()}},e.prototype.track=function(e){Le();var t,n=Ve();n&&(t=Date.now(),Ye({name:this.name,type:"reaction"})),this._isRunning=!0;var r=de(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&fe(this),le(r)&&this.reportExceptionInDerivation(r.cause),n&&Qe({time:Date.now()-t}),je()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(De.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";De.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ve()&&We({type:"error",name:this.name,message:n,error:""+e}),De.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Le(),fe(this),je()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t0||De.isRunningReactions||function(e){e()}(Ge)}function Ge(){De.isRunningReactions=!0;for(var e=De.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r",e):2===arguments.length&&"function"==typeof t?Te(e,t):1===arguments.length&&"string"==typeof e?qe(e):!0!==r?qe(t).apply(null,arguments):void(e[t]=Te(e.name||t,n.value))};function $e(e,t,n){m(e,t,Te(t,n.bind(e)))}Ke.bound=function(e,t,n,r){return!0===r?($e(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return $e(this,t,n.value||n.initializer.call(this)),this[t]},set:Ze}:{enumerable:!1,configurable:!0,set:function(e){$e(this,t,e)},get:function(){}}};var et=function(e){return e()};function tt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:et}function nt(e,t,n){void 0===n&&(n=a),"boolean"==typeof n&&(n={fireImmediately:n});var r,i,o,s=n.name||"Reaction@"+l(),u=Ke(s,n.onError?(r=n.onError,i=t,function(){try{return i.apply(this,arguments)}catch(e){r.call(this,e)}}):t),c=!n.scheduler&&!n.delay,h=tt(n),d=!0,f=!1,p=n.compareStructural?O.structural:n.equals||O.default,v=new ze(s,(function(){d||c?m():f||(f=!0,h(m))}),n.onError,n.requiresObservable);function m(){if(f=!1,!v.isDisposed){var t=!1;v.track((function(){var n=e(v);t=d||!p(o,n),o=n})),d&&n.fireImmediately&&u(o,v),d||!0!==t||u(o,v),d&&(d=!1)}}return v.schedule(),v.getDisposer()}function rt(e,t,n){return it("onBecomeUnobserved",e,t,n)}function it(e,t,n,r){var i="function"==typeof r?Yt(t,n):Yt(t),o="function"==typeof r?r:n,a=i[e];return"function"!=typeof a?c(!1):(i[e]=function(){a.call(this),o.call(this)},function(){i[e]=a})}function ot(e,t,n,r){var i=(r=q(r)).defaultDecorator||(!1===r.deep?ee:K);H(e),zt(e,r.name,i.enhancer),Le();try{for(var o=Object.getOwnPropertyNames(t),a=0,s=o.length;a0&&(r.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(at)),r}function st(e,t){if(null==e)return!1;if(void 0!==t){if(Wt(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return Wt(e)||!!e.$mobx||k(e)||He(e)||Ce(e)}function ut(e){return 1!==arguments.length&&c(!1),st(e)}function lt(e){switch(e.length){case 0:return De.trackingDerivation;case 1:return Yt(e[0]);case 2:return Yt(e[0],e[1])}}function ct(e,t){void 0===t&&(t=void 0),Le();try{return e.apply(t)}finally{je()}}function ht(e){return void 0!==e.interceptors&&e.interceptors.length>0}function dt(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),d((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function ft(e,t){var n=ve();try{var r=e.interceptors;if(r)for(var i=0,o=r.length;i0}function vt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),d((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function mt(e,t){var n=ve(),r=e.changeListeners;if(r){for(var i=0,o=(r=r.slice()).length;i0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return dt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),vt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r0&&e+t+1>wt&&Ct(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;he(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=o),ht(this)){var a=ft(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!a)return o;t=a.removedCount,n=a.added}var s=(n=0===n.length?n:n.map((function(e){return r.enhancer(e,void 0)}))).length-t;this.updateArrayLength(i,s);var u=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,U([e,t],n));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&Ve(),i=pt(this),o=i||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&Ye(j(j({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&mt(this,o),r&&Qe()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&Ve(),i=pt(this),o=i||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&Ye(j(j({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&mt(this,o),r&&Qe()},e}(),St=function(e){function t(t,n,r,i){void 0===r&&(r="ObservableArray@"+l()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new Mt(r,n,o,i);if(g(o,"$mobx",a),t&&t.length){var s=Se(!0);o.spliceWithArray(0,0,t),Ee(s)}return _t&&Object.defineProperty(a.array,"0",Et),o}return L(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,i=this.$mobx.values;r=e1)for(var n=1;n=2&&(this.player.currentTime=e)},e}(),d=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},p=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3&&(n.lastSyncProgressTimestamp=r,n.selfUserInf&&n.selfUserInf.identity===i.host&&t.putAttributes({currentTime:e,play:n.playerState}))},n.handleNativePlayerState=function(e){return f(n,void 0,void 0,(function(){var t;return p(this,(function(n){switch(n.label){case 0:if(!e)return[3,7];if(!this.player.current)return[3,6];n.label=1;case 1:return n.trys.push([1,3,,6]),[4,this.player.current.play()];case 2:return n.sent(),[3,6];case 3:return""+(t=n.sent()).name!="NotAllowedError"&&""+t.name!="AbortError"?[3,5]:(this.setState({selfMute:!0}),[4,this.player.current.play()]);case 4:n.sent(),n.label=5;case 5:return[3,6];case 6:return[3,8];case 7:this.player.current&&this.player.current.pause(),n.label=8;case 8:return[2]}}))}))},n.handleSeekReaction=function(e,t){return f(n,void 0,void 0,(function(){return p(this,(function(n){return this.isHost()||this.player.current&&void 0!==t&&(this.player.current.currentTime=e+Date.now()/1e3-t),[2]}))}))},n.timeUpdate=function(){if(n.player.current){var e=n.player.current.currentTime;n.onTimeUpdate(e)}},n.detectVideoClickEnable=function(){var e=n.props.plugin;return e.context&&e.context.identity?e.context.identity!==i.host?"none":"auto":"none"},n.renderMuteBox=function(){var e=n.props.plugin;return e.context&&e.context.identity&&e.context.identity!==i.host&&n.state.selfMute?o.createElement("div",{className:"media-mute-box"},o.createElement("div",{onClick:function(){n.setState({selfMute:!1})},onTouchStart:function(){n.setState({selfMute:!1})},style:{pointerEvents:"auto"},className:"media-mute-box-inner"},o.createElement("img",{src:u,alt:"mute_icon"}),o.createElement("span",null,"unmute"))):null},n.handleRemove=function(){return f(n,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.handleRemotePlayState(!1),[4,v(300)];case 1:return t.sent(),e.remove(),[2]}}))}))},n.renderDeleteBtn=function(){var e=n.props.plugin;return e.context&&e.context.identity&&e.context.identity===i.host?o.createElement("div",{style:{pointerEvents:"auto"},className:"plugin-audio-box-delete",onClick:n.handleRemove},o.createElement("img",{src:c,alt:"delete"})):null},n.renderNavigation=function(){return!0===n.props.plugin.attributes.isNavigationDisable?null:o.createElement("div",{className:"plugin-video-box-nav"},o.createElement("div",null,o.createElement("img",{style:{width:20,marginLeft:8},src:l,alt:"video_plugin"}),o.createElement("span",null,"Video Player")),n.renderDeleteBtn())},n.handleOnEnd=function(){return f(n,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return e=this.props.plugin,this.player.current?this.selfUserInf?this.selfUserInf.identity!==i.host?[3,2]:(e.putAttributes({seek:0,seekTime:void 0,currentTime:0}),[4,v(500)]):[3,5]:[3,7];case 1:return t.sent(),this.player.current.load(),[3,4];case 2:return[4,v(1e3)];case 3:t.sent(),this.player.current.load(),t.label=4;case 4:return[3,7];case 5:return[4,v(1e3)];case 6:t.sent(),this.player.current.load(),t.label=7;case 7:return this.setState({isEnd:!0}),[2]}}))}))},n.handleOnLoadedMetadataCapture=function(){return f(n,void 0,void 0,(function(){var e,t;return p(this,(function(n){switch(n.label){case 0:return e=navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),t=this.state.isEnd,e?[4,v(300)]:[3,2];case 1:n.sent(),this.handleFirstSeek(t),n.label=2;case 2:return[2]}}))}))},n.player=o.createRef(),n.reactionSeekDisposer=n.startSeekReaction(),n.reactionSeekTimeDisposer=n.startSeekTimeReaction(),n.reactionPlayDisposer=n.startPlayReaction(),n.reactionVolumeDisposer=n.startVolumeReaction(),n.reactionMuteDisposer=n.startMuteTimeReaction(),n.reactionSyncDisposer=n.startSyncReaction(),n.state={play:!1,seek:0,selfMute:!1,currentTime:0,mute:!1,volume:1,isEnd:!1},n}return d(t,e),t.prototype.componentDidMount=function(){return f(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.syncNode=new h(this.player.current),[4,this.handleStartCondition()];case 1:return e.sent(),[2]}}))}))},t.prototype.startPlayReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.play}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.isHost()?[3,2]:[4,this.handleNativePlayerState(t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.startSeekReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seek}),(function(n){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.handleSeekReaction(n,t.attributes.seekTime)];case 1:return e.sent(),[2]}}))}))}))},t.prototype.startSyncReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.currentTime}),(function(t){return f(e,void 0,void 0,(function(){return p(this,(function(e){return this.isHost()||this.player.current&&Math.abs(t-this.player.current.currentTime)>2&&(this.player.current.currentTime=t),[2]}))}))}))},t.prototype.startSeekTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.seekTime}),(function(n){return f(e,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.handleSeekReaction(t.attributes.seek,n)];case 1:return e.sent(),[2]}}))}))}))},t.prototype.startVolumeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.volume}),(function(t){e.isHost()||e.player.current&&(e.player.current.volume=t)}))},t.prototype.startMuteTimeReaction=function(){var e=this,t=this.props.plugin;return Object(s.a)((function(){return t.attributes.mute}),(function(t){e.isHost()||e.setState({mute:t})}))},t.prototype.componentWillUnmount=function(){this.reactionPlayDisposer(),this.reactionSeekDisposer(),this.reactionMuteDisposer(),this.reactionVolumeDisposer(),this.reactionSeekTimeDisposer(),this.reactionSyncDisposer(),this.player.current&&this.player.current.pause()},t.prototype.render=function(){var e=this.props,t=e.size,n=e.plugin,r=e.scale,i=this.state,a=i.mute,s=i.selfMute,u=0===r?1:r;return o.createElement("div",{className:"plugin-video-box",style:{width:t.width/u,height:t.height/u,transform:"scale("+u+")"}},this.renderNavigation(),o.createElement("div",{className:"plugin-video-box-body"},this.renderMuteBox(),o.createElement("div",{className:"white-plugin-video-box"},o.createElement("video",{"webkit-playsinline":"true",playsInline:!0,poster:n.attributes.poster,className:"white-plugin-video",src:n.attributes.pluginVideoUrl,ref:this.player,muted:a||s,style:{width:"100%",height:"100%",pointerEvents:this.detectVideoClickEnable(),outline:"none"},disablePictureInPicture:!0,onLoadedMetadataCapture:this.handleOnLoadedMetadataCapture,onEnded:this.handleOnEnd,controls:!0,controlsList:"nodownload nofullscreen",onTimeUpdate:this.timeUpdate,preload:"metadata"}))))},t}(o.Component),y=(m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),b=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},x=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] img {\n width: 20px;\n margin-left: 8px;\n}\n.white-video-plugin-nav-title {\n margin-left: 6px;\n font-size: 12px;\n font-weight: bold;\n flex-grow: 1;\n}\n.white-video-plugin-nav-delete {\n width: 22px;\n height: 22px;\n border: 0;\n background-color: #ff756e;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n margin-right: 8px;\n cursor: pointer;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n}\n.white-video-plugin-nav-delete > img {\n width: 14px;\n}\n.white-video-plugin-nav-delete:hover {\n opacity: 1;\n}\n.white-video-plugin-body {\n flex-grow: 1;\n background-color: #f2f4f5;\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n justify-content: center;\n height: calc(100% - 32px);\n}\n.white-video-plugin-body > audio {\n flex-grow: 1;\n outline: none;\n}\n",""]),e.exports=t},function(e,t,n){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n,r,i,o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var s=(n=a,r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),"/*# ".concat(i," */")),u=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[o].concat(u).concat([s]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(d=Date.now(),this.props.player&&(d=this.props.player.beginTimestamp+r),f=l+(d-c)/1e3,Math.abs(n.currentTime-f)>2&&(n.currentTime=f)),this.changedMap.changed("rate",i)&&(n.playbackRate=i),[2]}}))}))}));this.disposers.push(r),this.disposers.push((function(){return e.changedMap.clear()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this.player.current)||void 0===e||e.pause(),this.disposers.forEach((function(e){return e()}))},Object.defineProperty(t.prototype,"containerStyle",{get:function(){var e=this.props,t=e.size,n=e.scale||1;return{width:t.width/n,height:t.height/n,transform:"scale("+n+")"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointerEventsStyle",{get:function(){return{pointerEvents:this.isHost()?"auto":"none"}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.room,n=e.player,r=e.plugin;return t||n?i.a.createElement("div",{className:"white-video-plugin-container",style:this.containerStyle},!r.attributes.isNavigationDisable&&i.a.createElement("div",{className:"white-video-plugin-nav"},i.a.createElement("img",{src:s.a,alt:"video_plugin"}),i.a.createElement("span",{className:"white-video-plugin-nav-title"},"Video Player"),i.a.createElement("span",{className:"white-video-plugin-nav-delete",style:this.pointerEventsStyle,onClick:this.removeSelf},i.a.createElement("img",{src:l.a,alt:"delete_icon"}))),i.a.createElement("div",{className:"white-video-plugin-body"},i.a.createElement("video",{src:r.attributes.src,style:m({maxWidth:"100%",maxHeight:"100%"},this.pointerEventsStyle),controls:!!t,controlsList:"nodownload nofullscreen",preload:"metadata",ref:this.player,playsInline:!0,"webkit-playsinline":"true",poster:r.attributes.poster,disablePictureInPicture:!0}))):null},t}(r.Component);n.d(t,"videoPlugin2",(function(){return _}));var _=Object.freeze({kind:"video2",render:b,defaultAttributes:{src:"",hostTime:0,currentTime:0,paused:!0,muted:!1,volume:1},hitTest:function(e){var t=e.component.context.getMemberState();return!("eraser"===(null==t?void 0:t.currentApplianceName))}})}])},"object"==r(t)&&"object"==r(e)?e.exports=i(n(17328),n(71895)):n.amdD([,],i)},18371:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.playerStateNameSpace=t.playerNameSpace=t.sdkNameSpace=t.roomStateNamespace=t.roomNamespace=t.roomSyncNamespace=t.pptNamespace=t.ScaleMode=void 0,function(e){e[e.Scale=0]="Scale",e[e.AspectFit=1]="AspectFit",e[e.AspectFitScale=2]="AspectFitScale",e[e.AspectFitSpace=3]="AspectFitSpace",e[e.AspectFill=4]="AspectFill",e[e.AspectFillScale=5]="AspectFillScale"}(t.ScaleMode||(t.ScaleMode={})),t.pptNamespace="ppt",t.roomSyncNamespace="room.sync",t.roomNamespace="room",t.roomStateNamespace="room.state",t.sdkNameSpace="sdk",t.playerNameSpace="player",t.playerStateNameSpace="player.state"},46640:function(e,t,n){var r;function i(e,t,n){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}},i(e,t,n||e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||M(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||M(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function u(e){var t=f();return function(){var n,r=v(e);if(t){var i=v(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function l(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?c(e):t}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){var t="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return d(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,e)},h(e)}function d(e,t,n){return d=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&p(i,n.prototype),i},d.apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){m(o,r,i,a,s,"next",e)}function s(e){m(o,r,i,a,s,"throw",e)}a(void 0)}))}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function M(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(this.timer=this.initInterval())}},{key:"invoke",value:function(){var e=this;if(0!==this.list.length&&void 0===this.currentInvoker){var t=this.list.shift();t&&(this.currentInvoker=t,t().then((function(){e.invoked()})).catch((function(t){console.error("[WindowManager]: create app error: ".concat(t.message)),e.invoked()})))}}},{key:"emitReady",value:function(){this.isEmit||setTimeout((function(){ae.emit("ready")}),50),this.isEmit=!0}},{key:"empty",value:function(){this.list=[],this.clear()}},{key:"destroy",value:function(){this.timer&&this.clear()}}]),e}(),ue=new Q.default,le=function(){var e=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,t){var n=indexedDB.open("__WindowManagerAppCache",2);n.onerror=function(e){t(e)},n.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains("apps")||t.createObjectStore("apps",{keyPath:"kind"}).createIndex("kind","kind",{unique:!0})},n.onsuccess=function(){var t=n.result;e(t)}}));case 2:Y=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=function(e,t){if(Y)return function(e,t){return new Promise((function(n,r){var i=e.transaction(["apps"],"readwrite").objectStore("apps").add(t);i.onsuccess=function(){return n()},i.onerror=function(){return r()}}))}(Y,{kind:e,sourceCode:t})},he=function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Y){e.next=6;break}return e.next=3,de(Y,t);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=null;case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function de(e,t){return new Promise((function(n,r){var i=e.transaction(["apps"]).objectStore("apps").index("kind").get(t);i.onerror=function(e){return r(e)},i.onsuccess=function(){i.result?n(i.result):n(null)}}))}var fe=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,he(t);case 2:if(!(n=e.sent)){e.next=5;break}return e.abrupt("return",n.sourceCode);case 5:return e.next=7,ge(t,{timeout:1e4});case 7:return e.next=9,e.sent.text();case 9:return r=e.sent,e.next=12,ce(t,r);case 12:return e.abrupt("return",r);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),pe=function(e,t){var n=Function(e+"\n;return ".concat(t))();return void 0===n&&(n=window[t]),n},ve=function(){var e=g(regeneratorRuntime.mark((function e(t,n,r){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r||"NetlessApp"+n,ae.emit("loadApp",{kind:n,status:"start"}),e.prev=2,e.next=5,fe(t);case 5:if((o=e.sent)&&0!==o.length){e.next=8;break}throw ae.emit("loadApp",{kind:n,status:"failed",reason:"script is empty."}),new Error("[WindowManager]: script is empty.");case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(2),ae.emit("loadApp",{kind:n,status:"failed",reason:e.t0.message}),e.t0;case 13:return e.abrupt("return",me(o,i,n));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,n,r){return e.apply(this,arguments)}}(),me=function(e,t,n){try{var r=pe(e,t);return ae.emit("loadApp",{kind:n,status:"success"}),r}catch(r){if(r.message.includes("Can only have one anonymous define call per script file")){var i=window.define;"function"==typeof i&&i.amd&&delete i.amd;var o=pe(e,t);return ae.emit("loadApp",{kind:n,status:"success"}),o}throw ae.emit("loadApp",{kind:n,status:"failed",reason:r.message}),r}};function ge(e,t){return ye.apply(this,arguments)}function ye(){return ye=g(regeneratorRuntime.mark((function e(t,n){var r,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.timeout,i=void 0===r?1e4:r,o=new AbortController,a=setTimeout((function(){return o.abort()}),i),e.next=6,fetch(t,O(P({},n),{signal:o.signal,headers:{"content-type":"text/plain"}}));case 6:return s=e.sent,e.abrupt("return",(clearTimeout(a),s));case 8:case"end":return e.stop()}}),e)}))),ye.apply(this,arguments)}var be=function(){function e(){var t=this;y(this,e),this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=function(e){t.register({kind:e.kind,src:e.src})}}var t,n;return x(e,[{key:"setSyncRegisterApp",value:function(e){this.syncRegisterApp=e}},{key:"register",value:(n=g(regeneratorRuntime.mark((function e(t){var n,r,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appClassesCache.delete(t.kind),this.registered.set(t.kind,t),"string"==typeof(n=t.src)&&(r=function(){var e=g(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ve(n,t.kind,t.name);case 2:return r=e.sent,e.abrupt("return",r.__esModule?r.default:r);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),this.syncRegisterApp&&this.syncRegisterApp({kind:t.kind,src:n,name:t.name})),"function"==typeof n&&(r=function(){var e=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n();case 2:if(!(t=e.sent)){e.next=5;break}return e.abrupt("return",((t.__esModule||t.default)&&(t=t.default),t));case 5:throw new Error("[WindowManager]: load remote script failed, ".concat(n));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),"object"==_(n)&&(r=function(){var e=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),this.appClasses.set(t.kind,g(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.appClassesCache.get(t.kind),e.abrupt("return",(n||(n=r(),o.appClassesCache.set(t.kind,n)),n));case 2:case"end":return e.stop()}}),e)})))),t.addHooks&&(i=this.createKindEmitter(t.kind))&&t.addHooks(i);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"unregister",value:function(e){this.appClasses.delete(e),this.appClassesCache.delete(e),this.registered.delete(e);var t=this.kindEmitters.get(e);t&&(t.clearListeners(),this.kindEmitters.delete(e))}},{key:"notifyApp",value:(t=g(regeneratorRuntime.mark((function e(t,n,r){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.kindEmitters.get(t),e.next=3,null==i?void 0:i.emit(n,r);case 3:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"createKindEmitter",value:function(e){if(!this.kindEmitters.has(e)){var t=new Q.default;this.kindEmitters.set(e,t)}return this.kindEmitters.get(e)}}]),e}(),xe=new be,_e=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==(n=xe.appClasses.get(t))?void 0:n();case 2:return i=e.sent,e.abrupt("return",i&&(null==(r=i.config)?void 0:r.singleton)?t:"".concat(t,"-").concat(U.v4().replace("-","").slice(0,8)));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),we=function(e,t){if(e.focusScenePath!==t)return e.focusScenePath=t,e},Te=function(e,t){if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){var n="/"===t?"":t;e.setScenePath(n)}},Me=function(e,t,n){e&&e.scenePathType(t)!==B.ScenePathType.None&&e.removeScenes(t,n)};j.debounce((function(e,t){e.emit("mainViewModeChange",t)}),200);var Se=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Ee(e)[t];if(r){var i=r[n];if(i){var o=i.name;return t===ie?"/".concat(o):"".concat(t,"/").concat(o)}}},Ee=function(e){return e.entireScenes()},Ae=function(e,t,n,r){for(var i,o=0;o0&&n.forEach((function(n){var r=e[n];if(r!==t._state[n])if(void 0===r)t._lastValue.set(n,t._state[n]),delete t._state[n],t._setRawState(n,r);else{t._lastValue.set(n,t._state[n]),t._state[n]=r;var i=r;if(j.isObject(r)){var o=t._refMap.get(r);o||(o=function(e){return{k:z.genUID(),v:e,__isRef:!0}}(r),t._refMap.set(r,o)),i=o}t._setRawState(n,i)}}))}else console.error(new Error('Cannot setState on Storage "'.concat(this.id,'" without writable access')),e)}},{key:"emptyStorage",value:function(){if(!(j.size(this._state)<=0)){if(this._destroyed)return void console.error(new Error('Cannot empty destroyed Storage "'.concat(this.id,'".')));if(!this._context.getIsWritable())return void console.error(new Error('Cannot empty Storage "'.concat(this.id,'" without writable access.')));this.setState(j.mapValues(this._state,j.noop))}}},{key:"deleteStorage",value:function(){if(null===this.id)throw new Error("Cannot delete main Storage");this._context.getIsWritable()?(this.destroy(),this._context.updateAttributes([Ze,this.id],void 0)):console.error(new Error('Cannot delete Storage "'.concat(this.id,'" without writable access.')))}},{key:"destroy",value:function(){this._destroyed=!0,this._sideEffect.flushAll()}},{key:"_getRawState",value:function(e){var t;return null===this.id?null!=(t=this._context.getAttributes())?t:e:j.get(this._context.getAttributes(),[Ze,this.id],e)}},{key:"_setRawState",value:function(e,t){if(null===this.id){if(e===Ze)throw new Error('Cannot set attribute internal filed "'.concat(Ze,'"'));return this._context.updateAttributes([e],t)}return this._context.updateAttributes([Ze,this.id,e],t)}},{key:"_updateProperties",value:function(e){var t;if(this._destroyed)console.error(new Error('Cannot call _updateProperties on destroyed Storage "'.concat(this.id,'".')));else if(e.length>0){for(var n={},r=0;rs.pageState.length-1?(console.warn("[WindowManager] nextPage: index out of range"),!1):(s.appProxy.setSceneIndex(t),!0));case 2:case"end":return e.stop()}}),e)}))),this.jumpPage=function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",0<=t&&t=s.pageState.length?(console.warn("[WindowManager]: page index ".concat(t," out of range")),!1):s.appProxy.removeSceneByIndex(n));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.emitter=i.appEmitter,this.isAddApp=i.isAddApp}return x(e,[{key:"dispatchAppEvent",value:function(e,t){ue.emit("custom-".concat(this.kind),{kind:this.kind,appId:this.appId,type:e,value:t})}},{key:"storage",get:function(){return this._storage||(this._storage=new qe(this)),this._storage}},{key:"pageState",get:function(){return this.appProxy.pageState}},{key:"kind",get:function(){return this.appProxy.kind}}]),e}(),Ke=function(){function e(t){var n=this;y(this,e),this.params=t,this.sceneNode=null,this.onSceneChange=function(e){n.sceneNode=e,n.params.notifyPageStateChange()};var r=this.params,i=r.displayer,o=r.scenePath;o&&(this.sceneNode=i.createScenesCallback(o,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}))}return x(e,[{key:"getFullPath",value:function(e){var t,n=null==(t=this.sceneNode)?void 0:t.scenes;if(this.params.scenePath&&n){var r=n[e];if(r)return"".concat(this.params.scenePath,"/").concat(r)}}},{key:"toObject",value:function(){var e,t;return{index:(null==(e=this.params.view)?void 0:e.focusSceneIndex)||0,length:(null==(t=this.sceneNode)?void 0:t.scenes.length)||0}}},{key:"destroy",value:function(){var e;null==(e=this.sceneNode)||e.dispose()}}]),e}(),$e=function(e){return e.Apps="apps",e.Focus="focus",e.State="state",e.BoxState="boxState",e.MainViewCamera="mainViewCamera",e.MainViewSize="mainViewSize",e.Broadcaster="broadcaster",e.Cursors="cursors",e.Position="position",e.CursorState="cursorState",e.FullPath="fullPath",e.Registered="registered",e.IframeBridge="iframeBridge",e}($e||{}),et=new(function(){function e(t){var n=this;y(this,e),this.context=t,this.setAppFocus=function(e,t){t?n.context.safeSetAttributes({focus:e}):n.context.safeSetAttributes({focus:void 0})}}return x(e,[{key:"setContext",value:function(e){this.context=e}},{key:"apps",value:function(){return j.get(this.attributes,["apps"])}},{key:"getAppAttributes",value:function(e){return j.get(this.apps(),[e])}},{key:"getAppState",value:function(e){return j.get(this.apps(),[e,"state"])}},{key:"getMaximized",value:function(){return j.get(this.attributes,["maximized"])}},{key:"getMinimized",value:function(){return j.get(this.attributes,["minimized"])}},{key:"setupAppAttributes",value:function(e,t,n){var r;this.attributes.apps||this.context.safeSetAttributes({apps:{}});var i=["scenePath","title"];n||i.push("scenes");var o=j.pick(e.options,i),a={kind:e.kind,options:o,isDynamicPPT:n};"string"==typeof e.src&&(a.src=e.src),a.createdAt=Date.now(),this.context.safeUpdateAttributes(["apps",t],a),this.context.safeUpdateAttributes(["apps",t,"state"],(w(r={},$.Size,{}),w(r,$.Position,{}),w(r,$.SceneIndex,0),r))}},{key:"updateAppState",value:function(e,t,n){j.get(this.attributes,["apps",e,"state"])&&this.context.safeUpdateAttributes(["apps",e,"state",t],n)}},{key:"cleanAppAttributes",value:function(e){this.context.safeUpdateAttributes(["apps",e],void 0),this.context.safeSetAttributes(w({},e,void 0)),this.attributes.focus===e&&this.cleanFocus()}},{key:"cleanFocus",value:function(){this.context.safeSetAttributes({focus:void 0})}},{key:"getAppSceneIndex",value:function(e){var t;return null==(t=this.getAppState(e))?void 0:t[$.SceneIndex]}},{key:"getAppScenePath",value:function(e){var t,n;return null==(n=null==(t=this.getAppAttributes(e))?void 0:t.options)?void 0:n.scenePath}},{key:"getMainViewScenePath",value:function(){return this.attributes._mainScenePath}},{key:"getMainViewSceneIndex",value:function(){return this.attributes._mainSceneIndex}},{key:"getBoxState",value:function(){return this.attributes.boxState}},{key:"setMainViewScenePath",value:function(e){this.context.safeSetAttributes({_mainScenePath:e})}},{key:"setMainViewSceneIndex",value:function(e){this.context.safeSetAttributes({_mainSceneIndex:e})}},{key:"getMainViewCamera",value:function(){return j.get(this.attributes,["mainViewCamera"])}},{key:"getMainViewSize",value:function(){return j.get(this.attributes,["mainViewSize"])}},{key:"setMainViewCamera",value:function(e){this.context.safeSetAttributes({mainViewCamera:P({},e)})}},{key:"setMainViewSize",value:function(e){0===e.width||0===e.height||this.context.safeSetAttributes({mainViewSize:P({},e)})}},{key:"setMainViewCameraAndSize",value:function(e,t){0===t.width||0===t.height||this.context.safeSetAttributes({mainViewCamera:P({},e),mainViewSize:P({},t)})}},{key:"updateCursor",value:function(e,t){j.get(this.attributes,["cursors"])||this.context.safeUpdateAttributes(["cursors"],{}),j.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"position"],t)}},{key:"updateCursorState",value:function(e,t){j.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"cursorState"],t)}},{key:"getCursorState",value:function(e){return j.get(this.attributes,["cursors",e,"cursorState"])}},{key:"cleanCursor",value:function(e){this.context.safeUpdateAttributes(["cursors",e],void 0)}},{key:"setMainViewFocusPath",value:function(e){var t=this.getMainViewScenePath();t&&we(e,t)}},{key:"getIframeBridge",value:function(){return j.get(this.attributes,["iframeBridge"])}},{key:"setIframeBridge",value:function(e){if(j.isObject(e)){var t=this.getIframeBridge();for(var n in e){var r=e[n];t[n]!==r&&this.context.safeUpdateAttributes(["iframeBridge",n],r)}}}},{key:"attributes",get:function(){return this.context.getAttributes()}},{key:"focus",get:function(){return j.get(this.attributes,["focus"])}}]),e}())({getAttributes:function(){throw new Error("getAttributes not implemented")},safeSetAttributes:function(){throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:function(){throw new Error("safeUpdateAttributes not implemented")}}),tt=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r0&&o.zIndex!==(null==(n=a.box)?void 0:n.zIndex)&&(null==(r=a.boxManager)||r.setZIndex(e,o.zIndex),null==(i=a.boxManager)||i.focusBox({appId:e}))}))})),a.manager.refresher.add("".concat(e,"-fullPath"),(function(){return B.autorun((function(){var e,t=null==(e=a.appAttributes)?void 0:e.fullPath;a.setFocusScenePathHandler(t),a._prevFullPath!==t&&(a.notifyPageStateChange(),a._prevFullPath=t)}))}))},this.setFocusScenePathHandler=j.debounce((function(e){var t;a.view&&e&&e!==(null==(t=a.view)?void 0:t.focusScenePath)&&we(a.view,e)}),50),this.notifyPageStateChange=j.debounce((function(){a.appEmitter.emit("pageStateChange",a.pageState)}),50),this.kind=t.kind,this.id=r,this.stateKey="".concat(this.id,"_state"),this.appProxies.set(this.id,this),this.appEmitter=new Q.default,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=i,this.initScenes(),null!=(o=this.params.options)&&o.scenePath&&this.createView(),this._pageState=new Ke({displayer:this.manager.displayer,scenePath:this.scenePath,view:this.view,notifyPageStateChange:this.notifyPageStateChange})}var t,n,r,i,o,a,s,u;return x(e,[{key:"initScenes",value:function(){var e,t=this.params.options;t&&(this.scenePath=t.scenePath,(null==(e=this.appAttributes)?void 0:e.isDynamicPPT)&&this.scenePath?this.scenes=Ee(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}},{key:"getFullScenePath",value:function(){if(this.scenePath)return j.get(this.appAttributes,[$e.FullPath])||this.getFullScenePathFromScenes()}},{key:"getFullScenePathFromScenes",value:function(){var e=j.get(this.appAttributes,["state","SceneIndex"],0),t=function(e,t,n){var r;if(e&&t){var i=null==(r=Ee(e)[t])?void 0:r[n];if(i)return"".concat(t,"/").concat(i.name)}}(this.manager.room,this.scenePath,e);return t&&this.setFullPath(t),t}},{key:"setFullPath",value:function(e){this.manager.safeUpdateAttributes(["apps",this.id,$e.FullPath],e)}},{key:"baseInsertApp",value:(u=g(regeneratorRuntime.mark((function e(){var t,n,r,i,o,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]&&a[0],(r=this.params).kind){e.next=4;break}throw new Error("[WindowManager]: kind require");case 4:return e.next=6,null==(n=xe.appClasses.get(r.kind))?void 0:n();case 6:if(i=e.sent,o=xe.registered.get(r.kind),!i){e.next=13;break}return e.next=11,this.setupApp(this.id,t,i,r.options,null==o?void 0:o.appOptions);case 11:e.next=14;break;case 13:throw new Error("[WindowManager]: app load failed ".concat(r.kind," ").concat(r.src));case 14:return e.abrupt("return",(ue.emit("updateManagerRect"),{appId:this.id,app:i}));case 15:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"setupApp",value:(s=g(regeneratorRuntime.mark((function e(t,n,r,i,o){var a,s,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tt("setupApp",t,r,i),this.boxManager){e.next=2;break}throw new Fe;case 2:s=new Je(this.manager,this.boxManager,t,this,o),this.appContext=s,e.prev=4,ue.once("".concat(t).concat(q.WindowCreated)).then(g(regeneratorRuntime.mark((function e(){var i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n||(o=u.getAppInitState(t),null==(i=u.boxManager)||i.updateBoxState(o)),u.appEmitter.onAny(u.appListener),u.appAttributesUpdateListener(t),u.setViewFocusScenePath(),setTimeout(g(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("setup app",r),e.next=3,r.setup(s);case 3:n=e.sent,u.appResult=n,xe.notifyApp(u.kind,"created",{appId:t,result:n}),u.afterSetupApp(o),u.fixMobileSize();case 5:case"end":return e.stop()}}),e)}))),50);case 1:case"end":return e.stop()}}),e)})))),null==(a=this.boxManager)||a.createBox({appId:t,app:r,options:i,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),this.isAddApp&&this.box&&(this.store.updateAppState(t,$.ZIndex,this.box.zIndex),this.store.updateAppState(t,$.Size,{width:this.box.intrinsicWidth,height:this.box.intrinsicHeight}),this.boxManager.focusBox({appId:t},!1)),e.next=11;break;case 8:throw e.prev=8,e.t0=e.catch(4),console.error(e.t0),new Error("[WindowManager]: app setup error: ".concat(e.t0.message));case 11:case"end":return e.stop()}}),e,this,[[4,8]])}))),function(e,t,n,r,i){return s.apply(this,arguments)})},{key:"fixMobileSize",value:function(){var e,t,n=null==(e=this.boxManager)?void 0:e.getBox(this.id);n&&(null==(t=this.boxManager)||t.resizeBox({appId:this.id,width:n.intrinsicWidth+.001,height:n.intrinsicHeight+.001,skipUpdate:!0}))}},{key:"afterSetupApp",value:function(e){var t;e&&(null==e||!e.x||!e.y)&&(null==(t=this.boxManager)||t.setBoxInitState(this.id))}},{key:"onSeek",value:(a=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appEmitter.emit("seek",t).catch((function(e){console.log("[WindowManager]: emit seek error: ".concat(e.message))})),r=this.getAppInitState(this.id),null==(n=this.boxManager)||n.updateBoxState(r);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"onReconnected",value:(o=g(regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Boolean(this.manager.attributes.apps[this.id])){t.next=4;break}return t.next=3,this.destroy(!0,!1,!0);case 3:return t.abrupt("return");case 4:return this.appEmitter.emit("reconnected",void 0),r=this.getAppInitState(this.id),t.next=8,this.destroy(!0,!1,!0);case 8:return i=this.params,t.next=11,new e(i,this.manager,this.id,this.isAddApp).baseInsertApp(!0);case 11:null==(n=this.boxManager)||n.updateBoxState(r);case 12:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"onRemoveScene",value:(i=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.scenePath&&t.startsWith(this.scenePath+"/")&&(n=this.pageState.index,(r=this._pageState.getFullPath(n))||(n=0,r=this._pageState.getFullPath(n)),r&&this.setFullPath(r),this.setViewFocusScenePath(),this.view&&(this.view.focusSceneIndex=n));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"emitAppSceneStateChange",value:function(e){this.appEmitter.emit("sceneStateChange",e)}},{key:"emitAppIsWritableChange",value:function(){this.appEmitter.emit("writableChange",this.isWritable)}},{key:"makeAppEventListener",value:function(e){var t=this;return function(n,r){var i,o,a,s;if(t.manager.canOperate)switch(n){case"setBoxSize":null==(i=t.boxManager)||i.resizeBox({appId:e,width:r.width,height:r.height,skipUpdate:!1});break;case"setBoxMinSize":null==(o=t.boxManager)||o.setBoxMinSize({appId:e,minWidth:r.minwidth,minHeight:r.minheight});break;case"setBoxTitle":null==(a=t.boxManager)||a.setBoxTitle({appId:e,title:r.title});break;case ee.destroy:if("destroyed"===t.status)return;t.destroy(!0,!1,!0,null==r?void 0:r.error),null!=r&&r.error&&console.error(null==r?void 0:r.error);break;case"focus":null==(s=t.boxManager)||s.focusBox({appId:t.id}),rt.emit("focus",{appId:t.id})}}}},{key:"setScenePath",value:function(){if(this.manager.canOperate){var e=this.getFullScenePath();this.manager.room&&e&&this.view&&Te(this.manager.room,e)}}},{key:"setViewFocusScenePath",value:function(){var e=this.getFullScenePath();return e&&this.view&&we(this.view,e),e}},{key:"createView",value:(r=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.viewManager.createView(this.id);case 2:return t=e.sent,e.abrupt("return",(this.setViewFocusScenePath(),t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"removeSceneByIndex",value:(n=g(regeneratorRuntime.mark((function e(t){var n,r,i=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this._pageState.getFullPath(t))){e.next=6;break}return r=nt(t,this.pageState),e.abrupt("return",(this.setSceneIndexWithoutSync(r),this.manager.dispatchInternalEvent(q.SetAppFocusIndex,{type:"app",appID:this.id,index:r}),setTimeout((function(){Me(i.manager.room,n,t)}),100),!0));case 6:return e.abrupt("return",!1);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setSceneIndexWithoutSync",value:function(e){this.view&&(this.view.focusSceneIndex=e)}},{key:"setSceneIndex",value:function(e){if(this.view){this.view.focusSceneIndex=e;var t=this._pageState.getFullPath(e);t&&this.setFullPath(t)}}},{key:"destroy",value:(t=g(regeneratorRuntime.mark((function e(t,n,r,i){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("destroyed"===this.status){e.next=13;break}return this.status="destroyed",e.prev=2,e.next=5,xe.notifyApp(this.kind,"destroy",{appId:this.id});case 5:return e.next=7,this.appEmitter.emit("destroy",{error:i});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.error("[WindowManager]: notifyApp error",e.t0.message,e.t0.stack);case 12:this.appEmitter.clearListeners(),ue.emit("destroy-".concat(this.id),{error:i}),t&&(null==(o=this.boxManager)||o.closeBox(this.id,r)),n&&(this.store.cleanAppAttributes(this.id),this.scenePath&&Me(this.manager.room,this.scenePath)),this.appProxies.delete(this.id),this._pageState.destroy(),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),this.manager.refresher.remove(this.id),this.manager.refresher.remove(this.stateKey),this.manager.refresher.remove("".concat(this.id,"-fullPath")),this._prevFullPath=void 0;case 13:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"close",value:function(){return this.destroy(!0,!0,!1)}},{key:"view",get:function(){return this.manager.viewManager.getView(this.id)}},{key:"viewIndex",get:function(){var e;return null==(e=this.view)?void 0:e.focusSceneIndex}},{key:"isWritable",get:function(){var e;return this.manager.canOperate&&!(null!=(e=this.box)&&e.readonly)}},{key:"attributes",get:function(){return this.manager.attributes[this.id]}},{key:"appAttributes",get:function(){return this.store.getAppAttributes(this.id)}},{key:"box",get:function(){var e;return null==(e=this.boxManager)?void 0:e.getBox(this.id)}},{key:"pageState",get:function(){return this._pageState.toObject()}}]),e}(),ot=function(){function e(t){y(this,e),this.displayer=t,this.views=new Map}return x(e,[{key:"createView",value:function(e){var t=at(this.displayer);return this.views.set(e,t),t}},{key:"getView",value:function(e){return this.views.get(e)}},{key:"destroyView",value:function(e){var t=this.views.get(e);if(t){try{t.release()}catch(e){}this.views.delete(e)}}},{key:"setViewScenePath",value:function(e,t){var n=this.views.get(e);n&&(n.focusScenePath=t)}},{key:"destroy",value:function(){this.views.forEach((function(e){try{e.release()}catch(e){}})),this.views.clear()}}]),e}(),at=function(e){var t=e.views.createView();return st(t),t},st=function(e){e.setCameraBound({maxContentMode:function(){return 10},minContentMode:function(){return.1}})},ut=function(){function e(t){var n=this;y(this,e),this.manager=t,this.polling=!1,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.viewMode=this.manager.windowManger.viewMode,this.sideEffectManager=new z.SideEffectManager,this.syncCamera=function(){if(n.polling&&n.viewMode===B.ViewMode.Broadcaster){var e=n.mainViewCamera;e&&e.id!==n.manager.uid&&n.moveCameraSizeByAttributes()}},this.startListenWritableChange=function(){n.sideEffectManager.add((function(){return ue.on("writableChange",(function(e){e&&n.ensureCameraAndSize(),n.manager.room&&n.syncMainView(n.manager.room)}))}))},this.addCameraReaction=function(){n.manager.refresher.add($e.MainViewCamera,n.cameraReaction)},this.cameraReaction=function(){return B.reaction((function(){return n.mainViewCamera}),(function(e){e&&e.id!==n.manager.uid&&(n.moveCameraToContian(n.mainViewSize),n.moveCamera(e))}),{fireImmediately:!0})},this.sizeChangeHandler=j.debounce((function(e){e&&(n.moveCameraToContian(e),n.moveCamera(n.mainViewCamera)),n.ensureMainViewSize()}),30),this.onUpdateContainerSizeRatio=function(){var e=n.store.getMainViewSize();n.sizeChangeHandler(e)},this.onCameraUpdatedByDevice=function(e){n.viewMode!==B.ViewMode.Follower&&(n.store.setMainViewCamera(O(P({},e),{id:n.manager.uid})),j.isEqual(n.mainViewSize,O(P({},n.mainView.size),{id:n.manager.uid}))||n.setMainViewSize(n.view.size))},this.mainViewClickListener=function(){n.mainViewClickHandler()},this.setMainViewSize=j.debounce((function(e){n.store.setMainViewSize(O(P({},e),{id:n.manager.uid}))}),50),this._syncMainViewTimer=0,this.onCameraOrSizeUpdated=function(){ae.emit("cameraStateChange",n.cameraState),n.manager.room&&n.manager.room.syncMainView&&(clearTimeout(n._syncMainViewTimer),n._syncMainViewTimer=setTimeout(n.syncMainView,100,n.manager.room)),n.ensureMainViewSize()},this.syncMainView=function(e){e.isWritable&&e.syncMainView(n.mainView)},this.setViewMode=function(e){n.viewMode=e},this.mainView=this.createMainView(),this.moveCameraSizeByAttributes(),ue.once("mainViewMounted").then((function(){n.addMainViewListener(),n.start(),n.ensureCameraAndSize(),n.startListenWritableChange()}));var r=function(){n.sizeChangeHandler(n.mainViewSize)};this.sideEffectManager.add((function(){return ue.on("playgroundSizeChange",r)})),this.sideEffectManager.add((function(){return ue.on("containerSizeRatioUpdate",n.onUpdateContainerSizeRatio)})),this.sideEffectManager.add((function(){return ue.on("startReconnect",(function(){n.didRelease||n.mainView.release()}))})),this.sideEffectManager.setInterval(this.syncCamera,1500)}var t;return x(e,[{key:"ensureCameraAndSize",value:function(){this.viewMode===B.ViewMode.Broadcaster&&(!this.mainViewCamera||!this.mainViewSize)&&(this.manager.dispatchInternalEvent(q.InitMainViewCamera),this.setCameraAndSize())}},{key:"moveCameraSizeByAttributes",value:function(){this.moveCameraToContian(this.mainViewSize),this.moveCamera(this.mainViewCamera)}},{key:"start",value:function(){this.sizeChangeHandler(this.mainViewSize),!this.started&&(this.addCameraListener(),this.addCameraReaction(),this.manager.room&&this.syncMainView(this.manager.room),this.started=!0)}},{key:"setCameraAndSize",value:function(){var e=O(P({},this.mainView.camera),{id:this.manager.uid}),t=O(P({},this.mainView.size),{id:this.manager.uid});this.store.setMainViewCameraAndSize(e,t)}},{key:"createMainView",value:function(){var e=at(this.manager.displayer),t=this.store.getMainViewScenePath();return t&&we(e,t),e}},{key:"onReconnect",value:function(){if(this.didRelease)this.rebind();else{var e=this.store.getMainViewScenePath();this.setFocusScenePath(e)}}},{key:"setFocusScenePath",value:function(e){if(e)return we(this.view,e)}},{key:"rebind",value:function(){var e=this.mainView.divElement,t=this.mainView.disableCameraTransform;this.stop(),this.didRelease||this.mainView.release(),this.removeMainViewListener(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=t,this.mainView.divElement=e,this.addMainViewListener(),this.start()}},{key:"addMainViewListener",value:function(){this.mainViewIsAddListener||this.view.divElement&&(this.view.divElement.addEventListener("click",this.mainViewClickListener),this.view.divElement.addEventListener("touchend",this.mainViewClickListener),this.mainViewIsAddListener=!0)}},{key:"removeMainViewListener",value:function(){this.view.divElement&&(this.view.divElement.removeEventListener("click",this.mainViewClickListener),this.view.divElement.removeEventListener("touchend",this.mainViewClickListener)),this.mainViewIsAddListener=!1}},{key:"mainViewClickHandler",value:(t=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!this.manager.canOperate||(this.store.cleanFocus(),null==(t=this.manager.boxManager)||t.blurAllBox());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"addCameraListener",value:function(){this.view.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}},{key:"removeCameraListener",value:function(){this.view.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}},{key:"ensureMainViewSize",value:function(){(!this.mainViewSize||0===this.mainViewSize.width||0===this.mainViewSize.height)&&this.mainView.size.width>0&&this.mainView.size.height>0&&this.setMainViewSize(this.mainView.size)}},{key:"moveCameraToContian",value:function(e){j.isEmpty(e)||(this.view.moveCameraToContain({width:e.width,height:e.height,originX:-e.width/2,originY:-e.height/2,animationMode:B.AnimationMode.Immediately}),this.scale=this.view.camera.scale)}},{key:"moveCamera",value:function(e){if(!j.isEmpty(e)){if(j.isEqual(e,this.view.camera))return;var t=e.centerX,n=e.centerY,r=e.scale*(this.scale||1);this.view.moveCamera({centerX:t,centerY:n,scale:r,animationMode:B.AnimationMode.Immediately})}}},{key:"stop",value:function(){this.removeCameraListener(),this.manager.refresher.remove($e.MainViewCamera),this.manager.refresher.remove($e.MainViewSize),this.started=!1}},{key:"destroy",value:function(){this.removeMainViewListener(),this.stop(),this.sideEffectManager.flushAll()}},{key:"mainViewCamera",get:function(){return this.store.getMainViewCamera()}},{key:"mainViewSize",get:function(){return this.store.getMainViewSize()}},{key:"didRelease",get:function(){return j.get(this.view,["didRelease"])}},{key:"view",get:function(){return this.mainView}},{key:"cameraState",get:function(){return P(P({},this.view.camera),this.view.size)}}]),e}(),lt=function(){function e(t){var n=this;y(this,e),this.context=t,this.addRedoUndoListeners=function(e){if(void 0===e)n.addViewCallbacks(n.context.mainView(),n.onCanRedoStepsUpdate,n.onCanUndoStepsUpdate);else{var t=n.context.getAppProxy(e);t&&t.view&&n.addViewCallbacks(t.view,n.onCanRedoStepsUpdate,n.onCanUndoStepsUpdate)}},this.addViewCallbacks=function(e,t,n){t(e.canRedoSteps),n(e.canUndoSteps),e.callbacks.on("onCanRedoStepsUpdate",t),e.callbacks.on("onCanUndoStepsUpdate",n)},this.disposeViewCallbacks=function(e){e.callbacks.off("onCanRedoStepsUpdate",n.onCanRedoStepsUpdate),e.callbacks.off("onCanUndoStepsUpdate",n.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=function(e){ae.emit("canRedoStepsChange",e)},this.onCanUndoStepsUpdate=function(e){ae.emit("canUndoStepsChange",e)},this.disposePrevFocusViewRedoUndoListeners=function(e){var t;if(void 0===e)t=n.context.mainView();else{var r=n.context.getAppProxy(e);r&&r.view&&(t=r.view)}t&&n.disposeViewCallbacks(t)},ue.on("focusedChange",(function(e){n.disposePrevFocusViewRedoUndoListeners(e.prev),setTimeout((function(){n.addRedoUndoListeners(e.focused)}),0)})),ue.on("rootDirRemoved",(function(){n.disposePrevFocusViewRedoUndoListeners(t.focus()),n.addRedoUndoListeners(t.focus())})),this.addRedoUndoListeners(t.focus())}return x(e,[{key:"destroy",value:function(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}]),e}(),ct=function(){function e(t){var n=this;y(this,e),this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=et,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new se,this.sideEffectManager=new z.SideEffectManager,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=function(){var e=g(regeneratorRuntime.mark((function e(t){var r,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((o=t.scenePath)!==ie){e.next=6;break}return e.next=4,n.onRootDirRemoved();case 4:return n.dispatchInternalEvent(q.RootDirRemoved),e.abrupt("return");case 6:if(!De(o)){e.next=14;break}return a=n.mainView.focusSceneIndex||0,(s=null==(r=n.callbacksNode)?void 0:r.scenes[a])||(a=0,s=null==(i=n.callbacksNode)?void 0:i.scenes[a]),s&&n.setMainViewScenePath("".concat(ie).concat(s)),e.next=12,n.setMainViewSceneIndex(a);case 12:e.next=15;break;case 14:n.appProxies.forEach((function(e){e.onRemoveScene(o)}));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onReadonlyChanged=function(){n.appProxies.forEach((function(e){e.emitAppIsWritableChange()}))},this.onPlayerSeekStart=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.closeAll();case 2:case"end":return e.stop()}}),e)}))),this.onPlayerSeekDone=function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.attributesUpdateCallback(n.attributes.apps);case 2:n.appProxies.forEach((function(e){e.onSeek(t)}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.createRootDirScenesCallback=function(){var e,t=!1;n.callbacksNode&&(n.callbacksNode.dispose(),t=!0),n.callbacksNode=n.displayer.createScenesCallback(ie,{onAddScene:n.onSceneChange,onRemoveScene:(e=g(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.onSceneChange(t);case 2:ue.emit("rootDirSceneRemoved",r);case 3:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})}),n.callbacksNode&&(n.updateSceneState(n.callbacksNode),n.mainViewScenesLength=n.callbacksNode.scenes.length,t&&n.emitMainViewScenesChange(n.callbacksNode.scenes.length))},this.removeSceneByIndex=function(){var e=g(regeneratorRuntime.mark((function e(t){var r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=nt(t,n.windowManger.pageState),n.setSceneIndexWithoutSync(i),n.dispatchInternalEvent(q.SetAppFocusIndex,{type:"main",index:i}),o=null==(r=n.callbacksNode)?void 0:r.scenes[t],e.abrupt("return",(setTimeout((function(){o&&Me(n.room,"".concat(ie).concat(o),t)}),100),new Promise((function(e,t){ue.once("rootDirSceneRemoved").then((function(t){t===o&&e(!0)})).catch((function(e){console.log("[WindowManager]: removePage error: ".concat(e)),t(!1)}))}))));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.setSceneIndexWithoutSync=function(e){var t,r=null==(t=n.callbacksNode)?void 0:t.scenes[e];r&&n.mainViewProxy.setFocusScenePath("".concat(ie).concat(r))},this.onSceneChange=function(e){return n.mainViewScenesLength=e.scenes.length,n.updateSceneState(e),n.emitMainViewScenesChange(n.mainViewScenesLength)},this.emitMainViewScenesChange=function(e){return Promise.all([ae.emit("mainViewScenesLengthChange",e),ue.emit("changePageState")])},this.updateSceneState=function(e){var t=n.store.getMainViewSceneIndex()||0,r=e.scenes[t];r||(r=e.scenes[n.mainView.focusSceneIndex||0]),n.sceneState={scenePath:"".concat(ie).concat(r),contextPath:e.path,index:t,scenes:e.scenes.map((function(e){return{name:e}})),sceneName:r},ae.emit("sceneStateChange",n.sceneState)},this.onBoxMove=function(e){n.dispatchInternalEvent(q.AppMove,e),n.store.updateAppState(e.appId,$.Position,{x:e.x,y:e.y})},this.onBoxResize=function(e){e.width&&e.height&&(n.dispatchInternalEvent(q.AppResize,e),n.store.updateAppState(e.appId,$.Size,{width:e.width,height:e.height}))},this.onBoxFocus=function(e){n.windowManger.safeSetAttributes({focus:e.appId})},this.onBoxClose=function(e){var t=n.appProxies.get(e.appId);t&&t.destroy(!1,!0,!0,e.error)},this.onBoxStateChange=function(e){n.dispatchInternalEvent(q.AppBoxStateChange,e)},this.addAppsChangeListener=function(){n.refresher.add("apps",(function(){return Ve((function(){return n.attributes.apps}),(function(){n.attributesUpdateCallback(n.attributes.apps)}))}))},this.addAppCloseListener=function(){n.refresher.add("appsClose",(function(){return We(n.attributes.apps,(function(){n.onAppDelete(n.attributes.apps)}))}))},this.onMainViewIndexChange=function(e){void 0!==e&&n._prevSceneIndex!==e&&(ae.emit("mainViewSceneIndexChange",e),ue.emit("changePageState"),n.callbacksNode&&n.updateSceneState(n.callbacksNode),n._prevSceneIndex=e)},this.onFocusChange=function(e){var t;n._prevFocused!==e&&(ae.emit("focusedChange",e),ue.emit("focusedChange",{focused:e,prev:n._prevFocused}),n._prevFocused=e,void 0!==e&&(null==(t=n.boxManager)||t.focusBox({appId:e}),setTimeout((function(){var t=n.appProxies.get(e);t&&xe.notifyApp(t.kind,"focus",{appId:e})}),0)))},this.attributesUpdateCallback=j.debounce((function(e){return n._attributesUpdateCallback(e)}),100),this._appIds=[],this.onRegisteredChange=function(e){!e||Object.entries(e).forEach((function(e){var t=o(e,2),n=t[0],r=t[1];xe.appClasses.has(n)||xe.register({kind:n,src:r.src,name:r.name})}))},this.onMinimized=function(e){var t,r;(null==(t=n.boxManager)?void 0:t.minimized)!==e&&(!0===e&&(null==(r=n.boxManager)||r.blurAllBox()),setTimeout((function(){var t;null==(t=n.boxManager)||t.setMinimized(Boolean(e))}),0))},this.onAppDelete=function(){var e=g(regeneratorRuntime.mark((function e(t){var r,i,a,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Object.keys(t),i=T(n.appProxies.entries()),e.prev=2,i.s();case 4:if((a=i.n()).done){e.next=12;break}if(s=o(a.value,2),u=s[0],l=s[1],e.t0=r.includes(u),e.t0){e.next=10;break}return e.next=10,l.destroy(!0,!1,!0);case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t1=e.catch(2),i.e(e.t1);case 17:return e.prev=17,i.f(),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[2,14,17,20]])})));return function(t){return e.apply(this,arguments)}}(),this.closeAll=g(regeneratorRuntime.mark((function e(){var t,r,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=T(n.appProxies.entries()),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return i=o(r.value,2),i[0],a=i[1],e.next=7,a.destroy(!0,!1,!0);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])}))),this.displayerStateListener=function(e){var t=e.sceneState;if(t){var r=t.scenePath;n.appProxies.forEach((function(e){e.scenePath&&r.startsWith(e.scenePath)&&(e.emitAppSceneStateChange(t),e.setFullPath(r))}))}n.appProxies.forEach((function(t){t.appEmitter.emit("roomStateChange",e)})),ue.emit("observerIdChange",n.displayer.observerId)},this.displayerWritableListener=function(e){var t,r,i=!e,o=void 0===n.windowManger.readonly||!1===n.windowManger.readonly;void 0===n.windowManger.readonly?null==(t=n.boxManager)||t.setReadonly(e):null==(r=n.boxManager)||r.setReadonly(!(i&&o)),n.appProxies.forEach((function(e){e.emitAppIsWritableChange()})),ue.emit("writableChange",i)},this.updateSceneIndex=function(){var e=n.store.getMainViewScenePath(),t=Ie(e),r=Ee(n.displayer)[t];if(r.length){var i=e.replace(t,"").replace("/",""),o=r.findIndex((function(e){return e.name===i}));j.isInteger(o)&&o>=0&&n.safeSetAttributes({_mainSceneIndex:o})}},this.updateRootDirRemoving=function(e){n.rootDirRemoving=e},this.displayer=t.displayer,this.store.setContext({getAttributes:function(){return n.attributes},safeSetAttributes:function(e){return n.safeSetAttributes(e)},safeUpdateAttributes:function(e,t){return n.safeUpdateAttributes(e,t)}}),this.mainViewProxy=new ut(this),this.viewManager=new ot(this.displayer),this.appListeners=new Pe(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=Eb,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:ue}),this.sideEffectManager.addDisposer((function(){var e,t;n.appCreateQueue.destroy(),n.mainViewProxy.destroy(),n.refresher.destroy(),n.viewManager.destroy(),null==(e=n.boxManager)||e.destroy(),null==(t=n.callbacksNode)||t.dispose()})),ue.once("onCreated").then((function(){return n.onCreated()})),ue.on("onReconnected",(function(){return n.onReconnected()})),B.isPlayer(this.displayer)&&(ue.on("seekStart",this.onPlayerSeekStart),ue.on("seek",this.onPlayerSeekDone)),ue.on("removeScenes",this.onRemoveScenes),ue.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),xe.setSyncRegisterApp((function(e){n.safeUpdateAttributes([$e.Registered,e.kind],e)}))}var t,n,r,i,a,s,u,l,c,h,d;return x(e,[{key:"onRootDirRemoved",value:(d=g(regeneratorRuntime.mark((function e(){var t,n,r,i,a,s,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!(u.length>0&&void 0!==u[0])||u[0],this.setMainViewScenePath(oe),this.createRootDirScenesCallback(),n=T(this.appProxies.entries()),e.prev=3,n.s();case 5:if((r=n.n()).done){e.next=13;break}if(i=o(r.value,2),a=i[0],s=i[1],e.t0=s.view,!e.t0){e.next=11;break}return e.next=11,this.closeApp(a,t);case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(3),n.e(e.t1);case 18:return e.prev=18,n.f(),e.finish(18);case 21:this.mainViewProxy.rebind(),ue.emit("rootDirRemoved"),this.updateRootDirRemoving(!1);case 22:case"end":return e.stop()}}),e,this,[[3,15,18,21]])}))),function(){return d.apply(this,arguments)})},{key:"getMainViewSceneDir",value:function(){var e=this.store.getMainViewScenePath();if(e)return Ie(e);throw new Error("[WindowManager]: mainViewSceneDir not found")}},{key:"onCreated",value:(h=g(regeneratorRuntime.mark((function e(){var t,n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.attributesUpdateCallback(this.attributes.apps);case 2:if(ue.emit("updateManagerRect"),rt.on("move",this.onBoxMove),rt.on("resize",this.onBoxResize),rt.on("focus",this.onBoxFocus),rt.on("close",this.onBoxClose),rt.on("boxStateChange",this.onBoxStateChange),this.addAppsChangeListener(),this.addAppCloseListener(),this.refresher.add("maximized",(function(){return B.autorun((function(){var e,t=r.attributes.maximized;null==(e=r.boxManager)||e.setMaximized(Boolean(t))}))})),this.refresher.add("minimized",(function(){return B.autorun((function(){var e=r.attributes.minimized;r.onMinimized(e)}))})),this.refresher.add("mainViewIndex",(function(){return B.autorun((function(){var e=j.get(r.attributes,"_mainSceneIndex");r.onMainViewIndexChange(e)}))})),this.refresher.add("focusedChange",(function(){return B.autorun((function(){var e=j.get(r.attributes,"focus");r.onFocusChange(e)}))})),this.refresher.add("registeredChange",(function(){return B.autorun((function(){var e=j.get(r.attributes,$e.Registered);r.onRegisteredChange(e)}))})),this.attributes.apps&&0!==Object.keys(this.attributes.apps).length){e.next=20;break}if(n=this.store.getMainViewScenePath()){e.next=19;break}return e.abrupt("return");case 19:this.resetScenePath(n);case 20:this.displayerWritableListener(!(null!=(t=this.room)&&t.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this._prevFocused=this.attributes.focus,this.sideEffectManager.add((function(){var e=new lt({mainView:function(){return r.mainViewProxy.view},focus:function(){return r.attributes.focus},getAppProxy:function(e){return r.appProxies.get(e)}});return function(){return e.destroy()}}));case 21:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"notifyAppsChange",value:function(e){(this._appIds.length!==e.length||!this._appIds.every((function(t){return e.includes(t)})))&&(this._appIds=e,ae.emit("appsChange",e))}},{key:"_attributesUpdateCallback",value:(c=g(regeneratorRuntime.mark((function e(t){var n,r,i,o,a,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&Ib.container){0===(n=Object.keys(t)).length&&this.appCreateQueue.emitReady(),r=j.orderBy(n.map((function(e){return{id:e,createdAt:t[e].createdAt}})),"createdAt","asc").map((function(e){return e.id})),this.notifyAppsChange(r),i=T(r);try{for(a=function(){var e=o.value;if(!s.appProxies.has(e)&&!s.appStatus.has(e)){var n=t[e];try{if(!s.attributes[e])throw new Error("appAttributes is undefined");s.appCreateQueue.push((function(){return s.appStatus.set(e,te.StartCreate),s.baseInsertApp({kind:n.kind,options:n.options,isDynamicPPT:n.isDynamicPPT},e,!1)})),s.focusByAttributes(t)}catch(e){console.warn("[WindowManager]: Insert App Error",e)}}},i.s();!(o=i.n()).done;)a()}catch(e){i.e(e)}finally{i.f()}}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"refresh",value:function(){this.attributesUpdateCallback(this.attributes.apps)}},{key:"setBoxManager",value:function(e){this.boxManager=e}},{key:"resetMaximized",value:function(){var e;null==(e=this.boxManager)||e.setMaximized(Boolean(this.store.getMaximized()))}},{key:"resetMinimized",value:function(){var e;null==(e=this.boxManager)||e.setMinimized(Boolean(this.store.getMinimized()))}},{key:"bindMainView",value:function(e,t){var n=this.mainViewProxy.view;n.disableCameraTransform=t,n.divElement=e,n.focusScenePath||this.setMainViewFocusPath(),ue.emit("mainViewMounted")}},{key:"setMainViewFocusPath",value:function(e){var t,n=e||this.store.getMainViewScenePath();if(n)return we(this.mainView,n),(null==(t=this.mainView)?void 0:t.focusScenePath)===n}},{key:"resetScenePath",value:function(e){this.displayer.state.sceneState.scenePath!==e&&Te(this.room,e)}},{key:"addApp",value:(l=g(regeneratorRuntime.mark((function e(t,n){var r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return tt("addApp",t),e.next=3,this.beforeAddApp(t,n);case 3:return r=e.sent,i=r.appId,o=r.needFocus,e.next=8,this.baseInsertApp(t,i,!0,o);case 8:return a=e.sent,e.abrupt("return",(this.afterAddApp(a),null==a?void 0:a.id));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"beforeAddApp",value:(u=g(regeneratorRuntime.mark((function e(t,n){var r,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e(t.kind);case 2:return o=e.sent,this.appStatus.set(o,te.StartCreate),a=null!=(r=t.attributes)?r:{},this.safeUpdateAttributes([o],a),this.store.setupAppAttributes(t,o,n),s=!(null!=(i=this.boxManager)&&i.minimized),e.abrupt("return",(s&&this.store.setAppFocus(o,!0),{appId:o,needFocus:s}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"afterAddApp",value:function(e){var t,n;if(e&&e.box){var r=e.box;rt.emit("move",{appId:e.id,x:null==r?void 0:r.intrinsicX,y:null==r?void 0:r.intrinsicY}),this.store.updateAppState(e.id,$.ZIndex,r.zIndex)}null!=(t=this.boxManager)&&t.minimized&&(null==(n=this.boxManager)||n.setMinimized(!1,!1))}},{key:"closeApp",value:(s=g(regeneratorRuntime.mark((function e(t){var n,r,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!(i.length>1&&void 0!==i[1])||i[1],(r=this.appProxies.get(t))&&r.destroy(!0,n,!1);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"baseInsertApp",value:(a=g(regeneratorRuntime.mark((function e(t,n,r,i){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appProxies.has(n)){e.next=3;break}return console.warn("[WindowManager]: app duplicate exists and cannot be created again"),e.abrupt("return");case 3:if(!(o=new it(t,this,n,r))){e.next=9;break}return e.next=7,o.baseInsertApp(i);case 7:return this.appStatus.delete(n),e.abrupt("return",o);case 9:throw this.appStatus.delete(n),new Error("[WindowManger]: initialize AppProxy failed");case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"safeSetAttributes",value:function(e){this.windowManger.safeSetAttributes(e)}},{key:"safeUpdateAttributes",value:function(e,t){this.windowManger.safeUpdateAttributes(e,t)}},{key:"setMainViewScenePath",value:(i=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.room){e.next=17;break}if(n=this.displayer.scenePathType(t),Ie(t)===ie){e.next=4;break}throw new Error('[WindowManager]: main view scenePath must in root dir "/"');case 4:if(n!==B.ScenePathType.None){e.next=6;break}throw new Error("[WindowManager]: ".concat(t," not valid scene"));case 6:if(n!==B.ScenePathType.Page){e.next=11;break}return e.next=9,this._setMainViewScenePath(t);case 9:e.next=17;break;case 11:if(n!==B.ScenePathType.Dir){e.next=17;break}if(r=Se(this.displayer,t),e.t0=r,!e.t0){e.next=17;break}return e.next=17,this._setMainViewScenePath(r);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_setMainViewScenePath",value:(r=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setMainViewFocusPath(t)&&(this.safeSetAttributes({_mainScenePath:t}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(n=g(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.room){e.next=9;break}if(this.store.getMainViewSceneIndex()!==t){e.next=3;break}return e.abrupt("return");case 3:if(r=null==(n=this.callbacksNode)?void 0:n.scenes[t],i="".concat(ie).concat(r),!r){e.next=8;break}this.setMainViewFocusPath(i)&&(this.store.setMainViewScenePath(i),this.store.setMainViewSceneIndex(t),this.dispatchSetMainViewScenePath(i)),e.next=9;break;case 8:throw new Error("[WindowManager]: ".concat(t," not valid index"));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"dispatchSetMainViewScenePath",value:function(e){this.dispatchInternalEvent(q.SetMainViewScenePath,{nextScenePath:e}),ae.emit("mainViewScenePathChange",e),Te(this.room,e)}},{key:"getAppInitPath",value:function(e){var t,n=this.store.getAppAttributes(e);if(n)return null==(t=null==n?void 0:n.options)?void 0:t.scenePath}},{key:"safeDispatchMagixEvent",value:function(e,t){this.canOperate&&this.displayer.dispatchMagixEvent(e,t)}},{key:"focusByAttributes",value:function(e){var t;if(e&&Object.keys(e).length===(null==(t=this.boxManager)?void 0:t.boxSize)){var n=this.store.focus;n&&this.boxManager.focusBox({appId:n})}}},{key:"onReconnected",value:(t=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.attributesUpdateCallback(this.attributes.apps),t=Array.from(this.appProxies.values()).map((function(e){return e.onReconnected()})),this.mainViewProxy.onReconnect(),e.next=5,Promise.all(t);case 5:this.callbacksNode&&this.onSceneChange(this.callbacksNode);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"notifyContainerRectUpdate",value:function(e){this.appProxies.forEach((function(t){t.appEmitter.emit("containerRectUpdate",e)}))}},{key:"dispatchInternalEvent",value:function(e,t){this.safeDispatchMagixEvent(J,{eventName:e,payload:t})}},{key:"destroy",value:function(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),rt.clearListeners(),ue.clearListeners(),this.appProxies.size&&this.appProxies.forEach((function(e){e.destroy(!0,!1,!0)})),ae.clearListeners(),this.sideEffectManager.flushAll(),this._prevFocused=void 0,this._prevSceneIndex=void 0}},{key:"eventName",get:function(){return B.isRoom(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}},{key:"attributes",get:function(){return this.windowManger.attributes}},{key:"canOperate",get:function(){return this.windowManger.canOperate}},{key:"room",get:function(){return B.isRoom(this.displayer)?this.displayer:void 0}},{key:"mainView",get:function(){return this.mainViewProxy.view}},{key:"polling",get:function(){return this.mainViewProxy.polling},set:function(e){this.mainViewProxy.polling=e}},{key:"focusApp",get:function(){if(this.store.focus)return this.appProxies.get(this.store.focus)}},{key:"uid",get:function(){var e;return(null==(e=this.room)?void 0:e.uid)||""}}]),e}(),ht=function(){if(Ne(B.WhiteVersion)Ib.containerSizeRatio?(i=r*Ib.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!0)):(r=i/Ib.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!1)),n.style.width="".concat(r,"px"),n.style.height="".concat(i,"px"))}},{key:"disconnect",value:function(){var e;null==(e=this.containerResizeObserver)||e.disconnect(),j.isFunction(this.disposer)&&(this.disposer(),this.disposer=void 0)}}],[{key:"create",value:function(t,n,r,i){var o=new e(i);return o.observePlaygroundSize(t,n,r),o}}]),e}(),mt={exports:{}},gt={},yt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable;function _t(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var wt=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=_t(e),o=1;oqt.length&&qt.push(e)}function $t(e,t,n,r){var i=_(e);("undefined"===i||"boolean"===i)&&(e=null);var o=!1;if(null===e)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case St:case Et:o=!0}}if(o)return n(r,e,""===t?"."+tn(e,0):t),1;if(o=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;aqt.length&&qt.push(e)}function $t(e,t,n,r){var i=_(e);("undefined"===i||"boolean"===i)&&(e=null);var o=!1;if(null===e)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case St:case Et:o=!0}}if(o)return n(r,e,""===t?"."+tn(e,0):t),1;if(o=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;a4?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),t+=t,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:1}}}),or={test:function(e){return"string"==typeof e&&Fn.test(e)||qn(e)||Jn(e)},parse:function(e){return nr.test(e)?nr.parse(e):rr.test(e)?rr.parse(e):ir.test(e)?ir.parse(e):e},transform:function(e){return qn(e)?nr.transform(e):Jn(e)?rr.transform(e):e}},ar=function(e){var t=e.onRead,n=e.onRender,r=e.uncachedValues,i=void 0===r?new Set:r,o=e.useCache,a=void 0===o||o;return function(e){void 0===e&&(e={});var r=wn(e,[]),o={},s=[],u=!1;function l(e,t){e.startsWith("--")&&(r.hasCSSVariable=!0);var n=o[e];o[e]=t,o[e]!==n&&(-1===s.indexOf(e)&&s.push(e),u||(u=!0,Pn.render(c.render)))}var c={get:function(e,n){return void 0===n&&(n=!1),!n&&a&&!i.has(e)&&void 0!==o[e]?o[e]:t(e,r)},set:function(e,t){if("string"==typeof e)l(e,t);else for(var n in e)l(n,e[n]);return this},render:function(e){return void 0===e&&(e=!1),(u||!0===e)&&(n(o,r,s),u=!1,s.length=0),this}};return c}},sr=/([a-z])([A-Z])/g,ur=function(e){return e.replace(sr,"$1-$2").toLowerCase()},lr=new Map,cr=new Map,hr=["Webkit","Moz","O","ms",""],dr=hr.length,fr="undefined"!=typeof document,pr=function(e,t){return cr.set(e,ur(t))},vr=function(e,t){void 0===t&&(t=!1);var n=t?cr:lr;return n.has(e)||(fr?function(e){tr=tr||document.createElement("div");for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:ri();return this.flush(t),this.disposers.set(t,e()),t}},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ri();return this.flush(t),this.disposers.set(t,e),t}},{key:"addEventListener",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ri();return this.add((function(){return e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n,r)}}),i),i}},{key:"setTimeout",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ri();return this.add((function(){var i=window.setTimeout((function(){n.remove(r),e()}),t);return function(){return window.clearTimeout(i)}}),r)}},{key:"setInterval",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ri();return this.add((function(){var n=window.setInterval(e,t);return function(){return window.clearInterval(n)}}),n)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach((function(e){try{e()}catch(e){console.error(e)}})),this.disposers.clear()}}]),e}(),oi=Object.defineProperty,ai=(n(80782),function(e,t,n){return r=e,i="symbol"!=_(t)?t+"":t,o=n,i in r?oi(r,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[i]=o,n;var r,i,o}),si=function(){function e(t,n){y(this,e),ai(this,"_value"),ai(this,"_beforeDestroys"),ai(this,"_subscribers"),this._value=t,n&&(this.compare=n)}return x(e,[{key:"setValue",value:function(e,t){if(!this.compare(e,this._value)){var n=this._value;this._value=e,this._subscribers&&this._subscribers.forEach((function(r){return r(e,n,t)}))}}},{key:"reaction",value:function(e){var t=this;return this._subscribers||(this._subscribers=new Set),this._subscribers.add(e),function(){t._subscribers&&t._subscribers.delete(e)}}},{key:"subscribe",value:function(e,t){var n=this.reaction(e);return e(this._value,void 0,t),n}},{key:"derive",value:function(t,n,r){var i=new e(t(this.value,void 0,r),n),o=this.reaction((function(e,n,r){i.setValue(t(e,n,r))}));return i.addBeforeDestroy(o),i}},{key:"destroy",value:function(){this._beforeDestroys&&(this._beforeDestroys.forEach((function(e){return e()})),this._beforeDestroys.clear()),this._subscribers&&this._subscribers.clear()}},{key:"addBeforeDestroy",value:function(e){var t=this;return this._beforeDestroys||(this._beforeDestroys=new Set),this._beforeDestroys.add(e),function(){t._beforeDestroys&&t._beforeDestroys.delete(e)}}},{key:"compare",value:function(e,t){return e===t}},{key:"value",get:function(){return this._value}}]),e}();function ui(e,t){Object.keys(t).forEach((function(n){!function(e,t,n){var r,i;Object.defineProperties(e,(w(r={},t,{get:function(){return n.value}}),w(r,"_".concat(t,"$"),{value:n}),w(r,"set".concat((i=t)[0].toUpperCase()+i.slice(1)),{value:function(e,t){return n.setValue(e,t)}}),r))}(e,n,t[n])}))}function li(e){var t=function(t){var n=e.addDisposer((function(){t.destroy()}));return t.addBeforeDestroy((function(){e.remove(n)})),t};return{bindSideEffect:t,combine:function(e,n,r,i){return t(function(e,t,n,r){var i=e.map((function(e){return e.value})),o=new si(t(i,void 0,r),n);return e.forEach((function(e,n){var r=e.reaction((function(e,r,a){var s=i.slice();s[n]=e;var u=i;i=s,o.setValue(t(s,u,a),a)}));o.addBeforeDestroy(r)})),o}(e,n,r,i))},createVal:function(e,n){return t(new si(e,n))}}}!function(e){e.Light="light",e.Dark="dark",e.Auto="auto"}(Qr||(Qr={})),function(e){e.Normal="normal",e.Minimized="minimized",e.Maximized="maximized"}(Zr||(Zr={})),function(e){e.DarkMode="dark_mode",e.PrefersColorScheme="prefers_color_scheme",e.Close="close",e.Focus="focus",e.Blur="blur",e.Move="move",e.Resize="resize",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.VisualResize="visual_resize",e.ZIndex="z_index",e.State="state",e.Minimized="minimized",e.Maximized="maximized",e.Readonly="readonly",e.Destroyed="destroyed"}(qr||(qr={})),function(e){e.Close="close",e.Maximize="maximize",e.Minimize="minimize"}(Jr||(Jr={})),function(e){e.North="n",e.South="s",e.West="w",e.East="e",e.NorthWest="nw",e.NorthEast="ne",e.SouthEast="se",e.SouthWest="sw"}(Kr||(Kr={}));var ci="dh";function hi(e,t,n){return Math.min(Math.max(e,t),n)}function di(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function fi(e){return e.touches?e.touches[0]:e}function pi(){return Date.now().toString().slice(6)+Math.random().toString().slice(2,8)}var vi=1;function mi(){return"New Box ".concat(vi++)}function gi(e){return Boolean(e)}function yi(e){return!e}var bi=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.readonly,i=void 0!==r&&r,o=n.title,a=n.buttons,s=n.onEvent,u=n.onDragStart,l=n.namespace,c=void 0===l?"telebox":l,h=n.state,d=void 0===h?Zr.Normal:h;y(this,e),this.$btns=[],this.sideEffect=new ii,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=function(e){var n;if(!(t.readonly||0!==e.button||null!=(n=e.target.dataset)&&n.teleTitleBarNoDblClick)){di(e);var r=Date.now();r-t.lastTitleBarClick.timestamp<=500?Math.abs(e.clientX-t.lastTitleBarClick.clientX)<=5&&Math.abs(e.clientY-t.lastTitleBarClick.clientY)<=5&&t.onEvent&&t.onEvent({type:Jr.Maximize}):t.onDragStart&&t.onDragStart(e),t.lastTitleBarClick.timestamp=r,t.lastTitleBarClick.clientX=e.clientX,t.lastTitleBarClick.clientY=e.clientY}},this.lastTitleBarTouch={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarTouch=function(e){var n;if(!(t.readonly||null!=(n=e.target.dataset)&&n.teleTitleBarNoDblClick)){di(e);var r=Date.now(),i=e.touches[0]||{},o=i.clientX,a=void 0===o?t.lastTitleBarTouch.clientX+100:o,s=i.clientY,u=void 0===s?t.lastTitleBarTouch.clientY+100:s;r-t.lastTitleBarTouch.timestamp<=500?Math.abs(a-t.lastTitleBarTouch.clientX)<=10&&Math.abs(u-t.lastTitleBarTouch.clientY)<=10&&t.onEvent&&t.onEvent({type:Jr.Maximize}):t.onDragStart&&t.onDragStart(e),t.lastTitleBarTouch.timestamp=r,t.lastTitleBarTouch.clientX=a,t.lastTitleBarTouch.clientY=u}},this.readonly=i,this.onEvent=s,this.onDragStart=u,this.namespace=c,this.title=o,this.state=d,this.buttons=a||[{type:Jr.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:Jr.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:function(e){return e===Zr.Maximized}},{type:Jr.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}return x(e,[{key:"setTitle",value:function(e){this.title=e,this.$title&&(this.$title.textContent=e,this.$title.title=e)}},{key:"setState",value:function(e){var t=this;this.state!==e&&(this.state=e,this.buttons.forEach((function(n,r){n.isActive&&t.$btns[r].classList.toggle("is-active",n.isActive(e))})))}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e)}},{key:"render",value:function(){var e=this;if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");var t=document.createElement("div");t.className=this.wrapClassName("title-area"),t.dataset.teleBoxHandle=ci,this.$title=document.createElement("h1"),this.$title.className=this.wrapClassName("title"),this.$title.dataset.teleBoxHandle=ci,this.title&&(this.$title.textContent=this.title,this.$title.title=this.title),t.appendChild(this.$title),t.appendChild(this.$dragArea);var n=document.createElement("div");n.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach((function(t,r){var i=t.iconClassName,o=t.isActive,a=String(r),s=document.createElement("button");s.className="".concat(e.wrapClassName("titlebar-btn")," ").concat(i),s.dataset.teleTitleBarBtnIndex=a,s.dataset.teleTitleBarNoDblClick="true",o&&s.classList.toggle("is-active",o(e.state)),e.$btns.push(s),n.appendChild(s)})),this.sideEffect.addEventListener(n,"click",(function(t){var n;if(!e.readonly){var r=t.target,i=Number(null==(n=r.dataset)?void 0:n.teleTitleBarBtnIndex);if(!Number.isNaN(i)&&i0&&void 0!==arguments[0]?arguments[0]:{},r=n.id,i=void 0===r?pi():r,a=n.title,s=void 0===a?mi():a,u=n.prefersColorScheme,l=void 0===u?Qr.Light:u,c=n.darkMode,h=n.visible,d=void 0===h||h,f=n.width,p=void 0===f?.5:f,v=n.height,m=void 0===v?.5:v,g=n.minWidth,b=void 0===g?0:g,x=n.minHeight,_=void 0===x?0:x,w=n.x,T=void 0===w?.1:w,M=n.y,S=void 0===M?.1:M,E=n.minimized,A=void 0!==E&&E,I=n.maximized,C=void 0!==I&&I,N=n.readonly,k=void 0!==N&&N,D=n.resizable,P=void 0===D||D,O=n.draggable,R=void 0===O||O,L=n.fence,j=void 0===L||L,B=n.fixRatio,U=void 0!==B&&B,F=n.focus,z=void 0!==F&&F,G=n.zIndex,H=void 0===G?100:G,V=n.namespace,W=void 0===V?"telebox":V,Y=n.titleBar,X=n.content,Q=n.footer,Z=n.styles,q=n.containerRect,J=void 0===q?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:q,K=n.collectorRect;y(this,e),this._renderSideEffect=new ii,this.handleTrackStart=function(e){var n;return null==(n=t._handleTrackStart)?void 0:n.call(t,e)},this._sideEffect=new ii,this._valSideEffectBinder=li(this._sideEffect);var $=this._valSideEffectBinder,ee=$.combine,te=$.createVal;this.id=i,this.namespace=W,this.events=new xn,this._delegateEvents=new xn;var ne=te(l);ne.reaction((function(e,n,r){r||t.events.emit(qr.PrefersColorScheme,e)}));var re=te(Boolean(c));null==c&&ne.subscribe((function(e,n,r){t._sideEffect.add((function(){if("auto"===e){var t=window.matchMedia("(prefers-color-scheme: dark)");if(t){re.setValue(t.matches,r);var n=function(e){re.setValue(e.matches,r)};return t.addListener(n),function(){return t.removeListener(n)}}return _i}return re.setValue("dark"===e,r),_i}),"prefers-color-scheme")})),re.reaction((function(e,n,r){r||t.events.emit(qr.DarkMode,e)}));var ie=te(J,$r),oe=te(K,$r),ae=te(s),se=te(d);se.reaction((function(e,n,r){!r&&!e&&t.events.emit(qr.Close)}));var ue=te(k);ue.reaction((function(e,n,r){r||t.events.emit(qr.Readonly,e)}));var le=te(P),ce=te(R),he=te(j),de=te(U),fe=te(H);fe.reaction((function(e,n,r){r||t.events.emit(qr.ZIndex,e)}));var pe=te(z);pe.reaction((function(e,n,r){r||t.events.emit(e?qr.Focus:qr.Blur)}));var ve=te(A);ve.reaction((function(e,n,r){r||t.events.emit(qr.Minimized,e)}));var me=te(C);me.reaction((function(e,n,r){r||t.events.emit(qr.Maximized,e)}));var ge=ee([ve,me],(function(e){var t=o(e,2),n=t[0],r=t[1];return n?Zr.Minimized:r?Zr.Maximized:Zr.Normal}));ge.reaction((function(e,n,r){r||t.events.emit(qr.State,e)}));var ye=te({width:hi(b,0,1),height:hi(_,0,1)},$r),be=te({width:hi(p,ye.value.width,1),height:hi(m,ye.value.height,1)},$r);ye.reaction((function(e,t,n){be.setValue({width:hi(p,e.width,1),height:hi(m,e.height,1)},n)})),be.reaction((function(e,n,r){r||t.events.emit(qr.IntrinsicResize,e)}));var xe=ee([be,me],(function(e){var t=o(e,2),n=t[0];return t[1]?{width:1,height:1}:n}),$r);xe.reaction((function(e,n,r){r||t.events.emit(qr.Resize,e)}));var _e=ee([xe,ve,ie,oe],(function(e){var t=o(e,4),n=t[0],r=t[1],i=t[2],a=t[3];return r&&a?{width:a.width/n.width/i.width,height:a.height/n.height/i.height}:n}),$r);_e.reaction((function(e,n,r){r||t.events.emit(qr.VisualResize,e)}));var we=te({x:hi(T,0,1),y:hi(S,0,1)},$r);we.reaction((function(e,n,r){r||t.events.emit(qr.IntrinsicMove,e)}));var Te=ee([we,be,ie,oe,ve,me],(function(e){var t=o(e,6),n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],u=t[5];return s&&a?u?{x:(a.x+a.width/2)/i.width-.5,y:(a.y+a.height/2)/i.height-.5}:{x:(a.x+a.width/2)/i.width-r.width/2,y:(a.y+a.height/2)/i.height-r.height/2}:u?{x:0,y:0}:n}),$r);Te.reaction((function(e,n,r){r||t.events.emit(qr.Move,e)})),this.titleBar=Y||new bi({readonly:ue.value,title:ae.value,namespace:this.namespace,onDragStart:function(e){var n;return null==(n=t._handleTrackStart)?void 0:n.call(t,e)},onEvent:function(e){if(t._delegateEvents.listeners.length>0)t._delegateEvents.emit(e.type);else switch(e.type){case Jr.Maximize:me.setValue(!me.value);break;case Jr.Minimize:ve.setValue(!0);break;case Jr.Close:se.setValue(!1);break;default:console.error("Unsupported titleBar event:",e)}}}),ue.reaction((function(e){t.titleBar.setReadonly(e)}));var Me=te(X),Se=te(Q),Ee=te(Z);ui(this,{prefersColorScheme:ne,darkMode:re,containerRect:ie,collectorRect:oe,title:ae,visible:se,readonly:ue,resizable:le,draggable:ce,fence:he,fixRatio:de,focus:pe,zIndex:fe,minimized:ve,maximized:me,$userContent:Me,$userFooter:Se,$userStyles:Ee}),this._state$=ge,this._minSize$=ye,this._size$=xe,this._intrinsicSize$=be,this._visualSize$=_e,this._coord$=Te,this._intrinsicCoord$=we,this.fixRatio&&this.transform(Te.value.x,Te.value.y,xe.value.width,xe.value.height,!0),this.$box=this.render()}return x(e,[{key:"setState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case Zr.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case Zr.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}},{key:"setMinWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._minSize$.setValue({width:e,height:this.minHeight},t),this}},{key:"setMinHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._minSize$.setValue({width:this.minWidth,height:e},t),this}},{key:"resize",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._intrinsicSize$.setValue({width:e,height:t},n),this}},{key:"move",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._intrinsicCoord$.setValue({x:e,y:t},n),this}},{key:"transform",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(this.fixRatio){var o=this.intrinsicHeight/this.intrinsicWidth*n;t!==this.intrinsicY&&(t-=o-r),r=o}return t<0&&(t=0,r>this.intrinsicHeight&&(r=this.intrinsicHeight)),this._intrinsicCoord$.setValue({x:n>=this.minWidth?e:this.intrinsicX,y:r>=this.minHeight?t:this.intrinsicY},i),this._intrinsicSize$.setValue({width:hi(n,this.minWidth,1),height:hi(r,this.minHeight,1)},i),this}},{key:"mount",value:function(e){return e.appendChild(this.render()),this}},{key:"unmount",value:function(){return this.$box&&this.$box.remove(),this}},{key:"mountContent",value:function(e){return this.set$userContent(e),this}},{key:"unmountContent",value:function(){return this.set$userContent(void 0),this}},{key:"mountFooter",value:function(e){return this.set$userFooter(e),this}},{key:"unmountFooter",value:function(){return this.set$userFooter(void 0),this}},{key:"getUserStyles",value:function(){return this.$userStyles}},{key:"mountStyles",value:function(e){var t;return"string"==typeof e?(t=document.createElement("style")).textContent=e:t=e,this.set$userStyles(t),this}},{key:"unmountStyles",value:function(){return this.set$userStyles(void 0),this}},{key:"render",value:function(e){var t=this;if(e){if(e===this.$box)return this.$box;this.$box=e}else{if(this.$box)return this.$box;this.$box=document.createElement("div")}this._renderSideEffect.flushAll(),this.$box.classList.add(this.wrapClassName("box"));var n=function(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:gi;return t._renderSideEffect.add((function(){var o=t.wrapClassName(r);return n.subscribe((function(t){e.classList.toggle(o,i(t))}))}))};n(this.$box,this._readonly$,"readonly"),n(this.$box,this._draggable$,"no-drag",yi),n(this.$box,this._resizable$,"no-resize",yi),n(this.$box,this._focus$,"blur",yi),n(this.$box,this._darkMode$,"color-scheme-dark"),n(this.$box,this._darkMode$,"color-scheme-light",yi),this._renderSideEffect.add((function(){var e=t.wrapClassName("minimized"),n=t.wrapClassName("maximized"),r="box-maximized-timer";return t._state$.subscribe((function(i){t.$box.classList.toggle(e,i===Zr.Minimized),i===Zr.Maximized?(t._renderSideEffect.flush(r),t.$box.classList.toggle(n,!0)):t._renderSideEffect.setTimeout((function(){t.$box.classList.toggle(n,!1)}),0,r)}))})),this._renderSideEffect.add((function(){return t._visible$.subscribe((function(e){t.$box.style.display=e?"block":"none"}))})),this._renderSideEffect.add((function(){return t._zIndex$.subscribe((function(e){t.$box.style.zIndex=String(e)}))}));var r=Xr(this.$box);this.$box.dataset.teleBoxID=this.id,this.$box.style.width=this.absoluteWidth+"px",this.$box.style.height=this.absoluteHeight+"px";var i=this.x*this.containerRect.width+this.containerRect.x,a=this.y*this.containerRect.height+this.containerRect.y;this.$box.style.transform="translate(".concat(i-10,"px,").concat(a-10,"px)"),this._valSideEffectBinder.combine([this._coord$,this._size$,this._minimized$,this._containerRect$,this._collectorRect$],(function(e){var t=o(e,5),n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],u=r.width*a.width,l=r.height*a.height;return{width:u+(i&&s?1:0),height:l+(i&&s?1:0),x:n.x*a.width,y:n.y*a.height,scaleX:i&&s?s.width/u:1,scaleY:i&&s?s.height/l:1}}),$r).subscribe((function(e){r.set(e)})),r.set({x:i,y:a});var s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);var u=document.createElement("div");u.className=this.wrapClassName("titlebar-wrap"),u.appendChild(this.titleBar.render()),this.$titleBar=u;var l=document.createElement("div");l.className=this.wrapClassName("content-wrap");var c=document.createElement("div");c.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=c,this._renderSideEffect.add((function(){var e;return t._$userStyles$.subscribe((function(t){e&&e.remove(),e=t,t&&l.appendChild(t)}))})),this._renderSideEffect.add((function(){var e;return t._$userContent$.subscribe((function(t){e&&e.remove(),e=t,t&&c.appendChild(t)}))})),l.appendChild(c);var h=document.createElement("div");return h.className=this.wrapClassName("footer-wrap"),this.$footer=h,this._renderSideEffect.add((function(){var e;return t._$userFooter$.subscribe((function(t){e&&e.remove(),e=t,t&&h.appendChild(t)}))})),s.appendChild(u),s.appendChild(l),s.appendChild(h),this._renderResizeHandlers(),this.$box}},{key:"_renderResizeHandlers",value:function(){var e=this,t=document.createElement("div");t.className=this.wrapClassName("resize-handles"),Object.values(Kr).forEach((function(n){var r=document.createElement("div");r.className=e.wrapClassName(n)+" "+e.wrapClassName("resize-handle"),r.dataset.teleBoxHandle=n,t.appendChild(r)})),this.$box.appendChild(t);var n,r,i="handle-tracking-listener",o=this.wrapClassName("transforming"),a=0,s=0,u=0,l=0,c=0,h=0,d=function(t){if(e.state===Zr.Normal){di(t);var n=fi(t),i=n.pageX,o=n.pageY;o<0&&(o=0);var d=(i-c)/e.containerRect.width,f=(o-h)/e.containerRect.height;switch(r){case Kr.North:e.transform(e.x,s+f,e.width,l-f);break;case Kr.South:e.transform(e.x,e.y,e.width,l+f);break;case Kr.West:e.transform(a+d,e.y,u-d,e.height);break;case Kr.East:e.transform(e.x,e.y,u+d,e.height);break;case Kr.NorthWest:e.transform(a+d,s+f,u-d,l-f);break;case Kr.NorthEast:e.transform(e.x,s+f,u+d,l-f);break;case Kr.SouthEast:e.transform(e.x,e.y,u+d,l+f);break;case Kr.SouthWest:e.transform(a+d,e.y,u-d,l+f);break;default:if(e.fence)e.move(hi(a+d,0,1-e.width),hi(s+f,0,1-e.height));else{var p=20/e.containerRect.width,v=20/e.containerRect.height;e.move(hi(a+d,p-e.width,1-p),hi(s+f,0,1-v))}}}},f=function(t){r=void 0,n&&(di(t),e.$box.classList.toggle(o,!1),e._sideEffect.flush(i),n.remove())},p=function(t){var p;if(!(e.readonly||null!=t.button&&0!==t.button||!e.draggable||r||e.state!==Zr.Normal)){var v=t.target;if(null!=(p=v.dataset)&&p.teleBoxHandle){var m;di(t),a=e.x,s=e.y,u=e.width,l=e.height,m=fi(t),c=m.pageX,h=m.pageY,r=v.dataset.teleBoxHandle,n||(n=document.createElement("div"));var g=r?e.wrapClassName("cursor-".concat(r)):"";n.className=e.wrapClassName("track-mask".concat(g?" ".concat(g):"")),e.$box.appendChild(n),e.$box.classList.add(o),e._sideEffect.add((function(){return window.addEventListener("mousemove",d),window.addEventListener("touchmove",d,{passive:!1}),window.addEventListener("mouseup",f),window.addEventListener("touchend",f,{passive:!1}),window.addEventListener("touchcancel",f,{passive:!1}),function(){window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),window.removeEventListener("touchcancel",f)}}),i)}}};this._handleTrackStart=p,this._sideEffect.addEventListener(t,"mousedown",p,{},"box-resizeHandles-mousedown"),this._sideEffect.addEventListener(t,"touchstart",p,{passive:!1},"box-resizeHandles-touchstart")}},{key:"destroy",value:function(){this.$box.remove(),this.events.emit(qr.Destroyed),this._sideEffect.flushAll(),this._renderSideEffect.flushAll(),this.events.removeAllListeners(),this._delegateEvents.removeAllListeners()}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"darkMode",get:function(){return this._darkMode$.value}},{key:"state",get:function(){return this._state$.value}},{key:"minWidth",get:function(){return this._minSize$.value.width}},{key:"minHeight",get:function(){return this._minSize$.value.height}},{key:"intrinsicWidth",get:function(){return this._intrinsicSize$.value.width}},{key:"intrinsicHeight",get:function(){return this._intrinsicSize$.value.height}},{key:"width",get:function(){return this._size$.value.width}},{key:"height",get:function(){return this._size$.value.height}},{key:"absoluteWidth",get:function(){return this.width*this.containerRect.width}},{key:"absoluteHeight",get:function(){return this.height*this.containerRect.height}},{key:"visualWidth",get:function(){return this._visualSize$.value.width}},{key:"visualHeight",get:function(){return this._visualSize$.value.height}},{key:"intrinsicX",get:function(){return this._intrinsicCoord$.value.x}},{key:"intrinsicY",get:function(){return this._intrinsicCoord$.value.y}},{key:"x",get:function(){return this._coord$.value.x}},{key:"y",get:function(){return this._coord$.value.y}}]),e}();function _i(){}var wi,Ti=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.visible,i=void 0===r||r,o=n.readonly,a=void 0!==o&&o,s=n.darkMode,u=void 0!==s&&s,l=n.namespace,c=void 0===l?"telebox":l,h=n.styles,d=void 0===h?{}:h,f=n.onClick;y(this,e),this.handleCollectorClick=function(){!t._readonly&&t.onClick&&t.onClick()},this._visible=i,this._readonly=a,this._darkMode=u,this.namespace=c,this.styles=d,this.onClick=f}return x(e,[{key:"mount",value:function(e){return e.appendChild(this.render()),this}},{key:"unmount",value:function(){return this.$collector&&this.$collector.remove(),this}},{key:"setVisible",value:function(e){return this._visible!==e&&(this._visible=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-visible"),e)),this}},{key:"setReadonly",value:function(e){return this._readonly!==e&&(this._readonly=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-readonly"),e)),this}},{key:"setDarkMode",value:function(e){return this._darkMode!==e&&(this._darkMode=e,this.$collector&&(this.$collector.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$collector.classList.toggle(this.wrapClassName("color-scheme-light"),!e))),this}},{key:"setStyles",value:function(e){if(Object.assign(this.styles,e),this.$collector){var t=this.$collector;Object.keys(e).forEach((function(n){var r=e[n];null!=r&&(t.style[n]=r)}))}return this}},{key:"render",value:function(){return this.$collector||(this.$collector=document.createElement("button"),this.$collector.className=this.wrapClassName("collector"),this.$collector.style.backgroundImage="url('".concat("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K","')"),this.$collector.addEventListener("click",this.handleCollectorClick),this._visible&&this.$collector.classList.add(this.wrapClassName("collector-visible")),this._readonly&&this.$collector.classList.add(this.wrapClassName("collector-readonly")),this.$collector.classList.add(this.wrapClassName(this._darkMode?"color-scheme-dark":"color-scheme-light")),this.setStyles(this.styles)),this.$collector}},{key:"destroy",value:function(){this.$collector&&(this.$collector.removeEventListener("click",this.handleCollectorClick),this.$collector.remove(),this.$collector=void 0),this.onClick=void 0}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"visible",get:function(){return this._visible}},{key:"readonly",get:function(){return this._readonly}},{key:"darkMode",get:function(){return this._darkMode}}]),e}();!function(e){e.Focused="focused",e.Blurred="blurred",e.Created="created",e.Removed="removed",e.State="state",e.Maximized="maximized",e.Minimized="minimized",e.Move="move",e.Resize="resize",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.VisualResize="visual_resize",e.ZIndex="z_index",e.PrefersColorScheme="prefers_color_scheme",e.DarkMode="dark_mode"}(wi||(wi={}));var Mi,Si,Ei=function(e){s(n,e);var t=u(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).boxes=e.boxes,r.focusedBox=e.focusedBox,r.containerRect=e.containerRect,r.darkMode=e.darkMode,r}return x(n,[{key:"focusBox",value:function(e){var t;if(!this.focusedBox||this.focusedBox!==e){if(this.$titles&&this.state===Zr.Maximized)for(var n=this.$titles.firstElementChild.children,r=n.length-1;r>=0;r-=1){var i=n[r],o=null==(t=i.dataset)?void 0:t.teleBoxID;o&&(e&&o===e.id?i.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&o===this.focusedBox.id&&i.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}this.focusedBox=e}}},{key:"setContainerRect",value:function(e){if(this.containerRect=e,this.$titleBar){var t=e.x,n=e.y,r=e.width;this.$titleBar.style.transform="translate(".concat(t,"px, ").concat(n,"px)"),this.$titleBar.style.width=r+"px"}}},{key:"setBoxes",value:function(e){this.boxes=e,this.updateTitles()}},{key:"setState",value:function(e){i(v(n.prototype),"setState",this).call(this,e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"),e===Zr.Maximized),this.updateTitles()}},{key:"setReadonly",value:function(e){i(v(n.prototype),"setReadonly",this).call(this,e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("readonly"),this.readonly)}},{key:"setDarkMode",value:function(e){e!==this.darkMode&&(this.darkMode=e,this.$titleBar&&(this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-light"),!e)))}},{key:"render",value:function(){var e=i(v(n.prototype),"render",this).call(this),t=this.containerRect,r=t.x,o=t.y,a=t.width;e.style.transform="translate(".concat(r,"px, ").concat(o,"px)"),e.style.width=a+"px",e.classList.add(this.wrapClassName("max-titlebar")),e.classList.toggle(this.wrapClassName("max-titlebar-maximized"),this.state===Zr.Maximized),e.classList.toggle(this.wrapClassName("readonly"),this.readonly),e.classList.add(this.wrapClassName(this.darkMode?"color-scheme-dark":"color-scheme-light"));var s=document.createElement("div");return s.classList.add(this.wrapClassName("titles-area")),e.insertBefore(s,e.firstElementChild),this.updateTitles(),e}},{key:"destroy",value:function(){i(v(n.prototype),"destroy",this).call(this),this.$titles=void 0,this.boxes.length=0,this.focusedBox=void 0}},{key:"updateTitles",value:function(){this.$titleBar&&this.state===Zr.Maximized&&(this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-single-title"),1===this.boxes.length),1===this.boxes.length?this.setTitle(this.boxes[0].title):this.$titleBar.replaceChild(this.renderTitles(),this.$titleBar.firstElementChild))}},{key:"renderTitles",value:function(){var e=this;this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.$titles.addEventListener("wheel",(function(e){e.currentTarget.scrollBy({left:e.deltaY>0?250:-250,behavior:"smooth"})}),{passive:!1});var t=document.createElement("div");return t.className=this.wrapClassName("titles-content"),this.$titles.appendChild(t),this.boxes.forEach((function(n){var r=document.createElement("button");r.className=e.wrapClassName("titles-tab"),r.textContent=n.title,r.dataset.teleBoxID=n.id,r.dataset.teleTitleBarNoDblClick="true",e.focusedBox&&n.id===e.focusedBox.id&&r.classList.add(e.wrapClassName("titles-tab-focus")),t.appendChild(r)})),this.$titles}}]),n}(bi),Ai=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.root,i=void 0===r?document.body:r,a=n.prefersColorScheme,s=void 0===a?Qr.Light:a,u=n.minimized,l=void 0!==u&&u,c=n.maximized,h=void 0!==c&&c,d=n.fence,f=void 0===d||d,p=n.containerRect,v=void 0===p?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:p,m=n.collector,g=n.namespace,b=void 0===g?"telebox":g,x=n.readonly,_=void 0!==x&&x;y(this,e),this.events=new xn,this._sideEffect=new ii;var w=li(this._sideEffect),T=w.combine,M=w.createVal;this.root=i,this.namespace=b,this.boxes$=M([]),this.topBox$=this.boxes$.derive((function(e){if(e.length>0)return e.reduce((function(e,t){return e.zIndex>t.zIndex?e:t}))}));var S=window.matchMedia("(prefers-color-scheme: dark)"),E=M(!1);S&&(E.setValue(S.matches),this._sideEffect.add((function(){var e=function(e){E.setValue(e.matches)};return S.addListener(e),function(){return S.removeListener(e)}})));var A=M(s);A.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setPrefersColorScheme(e,r)})),r||t.events.emit(wi.PrefersColorScheme,e)})),this._darkMode$=T([E,A],(function(e){var t=o(e,2),n=t[0],r=t[1];return"auto"===r?n:"dark"===r})),this._darkMode$.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setDarkMode(e,r)})),r||t.events.emit(wi.DarkMode,e)}));var I=M(_);I.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setReadonly(e,r)}))}));var C=M(l),N=M(h);N.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setMaximized(e,r)})),r||t.events.emit(wi.Maximized,e)}));var k=T([C,N],(function(e){var t=o(e,2),n=t[0],r=t[1];return n?Zr.Minimized:r?Zr.Maximized:Zr.Normal}));k.reaction((function(e,n,r){t.maxTitleBar.setState(e),r||t.events.emit(wi.State,e)}));var D=M(f);D.subscribe((function(e,n,r){t.boxes.forEach((function(t){return t.setFence(e,r)}))}));var P=M(v,$r);P.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setContainerRect(e,r)})),t.maxTitleBar.setContainerRect(e)}));var O=M(null===m?null:m||new Ti({visible:l,readonly:_,namespace:b}).mount(i));O.subscribe((function(e){e&&(e.setVisible(C.value),e.setReadonly(I.value),e.setDarkMode(t._darkMode$.value),t._sideEffect.add((function(){return e.onClick=function(){I.value||C.setValue(!1)},function(){return e.destroy()}}),"collect-onClick"))})),I.subscribe((function(e){var t;return null==(t=O.value)?void 0:t.setReadonly(e)})),this._darkMode$.subscribe((function(e){var t;null==(t=O.value)||t.setDarkMode(e)}));var R=function(){var e;if(null!=(e=O.value)&&e.$collector){var n=O.value.$collector.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height,s=t.root.getBoundingClientRect();return{x:r-s.x,y:i-s.y,width:o,height:a}}},L=M(C.value?R():void 0);L.subscribe((function(e,n,r){t.boxes.forEach((function(t){t.setCollectorRect(e,r)}))})),C.subscribe((function(e,n,r){var i,o;null==(i=O.value)||i.setVisible(e),e&&null!=(o=O.value)&&o.$collector&&L.setValue(R()),t.boxes.forEach((function(t){return t.setMinimized(e,r)})),r||t.events.emit(wi.Minimized,e)}));var j=this.wrapClassName("titlebar-icon-close"),B=function(e){var n;if(!I.value){var r=e.target;if(r.tagName)for(var i=r;i;i=i.parentElement){if(i.classList&&i.classList.contains(j))return;var o=null==(n=i.dataset)?void 0:n.teleBoxID;if(o){var a=t.getBox(o);if(a)return t.focusBox(a),void t.makeBoxTop(a)}}}};this._sideEffect.addEventListener(window,"mousedown",B,!0),this._sideEffect.addEventListener(window,"touchstart",B,!0),this.maxTitleBar=new Ei({darkMode:this.darkMode,readonly:I.value,namespace:this.namespace,state:k.value,boxes:this.boxes$.value,containerRect:P.value,onEvent:function(e){switch(e.type){case Jr.Maximize:N.setValue(!N.value);break;case Jr.Minimize:C.setValue(!0);break;case qr.Close:t.removeTopBox(),t.focusTopBox()}}}),I.subscribe((function(e){return t.maxTitleBar.setReadonly(e)})),this._darkMode$.subscribe((function(e){t.maxTitleBar.setDarkMode(e)})),this.boxes$.reaction((function(e){t.maxTitleBar.setBoxes(e)})),ui(this,{prefersColorScheme:A,containerRect:P,collector:O,collectorRect:L,readonly:I,fence:D,minimized:C,maximized:N}),this._state$=k,this.root.appendChild(this.maxTitleBar.render())}return x(e,[{key:"setState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case Zr.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case Zr.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}},{key:"create",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=new xi(yn(gn({zIndex:this.topBox?this.topBox.zIndex+1:100},n?this.smartPosition(t):t),{darkMode:this.darkMode,prefersColorScheme:this.prefersColorScheme,maximized:this.maximized,minimized:this.minimized,fence:this.fence,namespace:this.namespace,containerRect:this.containerRect,readonly:this.readonly,collectorRect:this.collectorRect}));return r.mount(this.root),r.focus&&(this.focusBox(r),n&&this.makeBoxTop(r)),this.boxes$.setValue([].concat(a(this.boxes),[r])),r._delegateEvents.on(Jr.Maximize,(function(){e.setMaximized(!e.maximized)})),r._delegateEvents.on(Jr.Minimize,(function(){e.setMinimized(!0)})),r._delegateEvents.on(Jr.Close,(function(){e.remove(r),e.focusTopBox()})),r._coord$.reaction((function(t,n,i){i||e.events.emit(wi.Move,r)})),r._size$.reaction((function(t,n,i){i||e.events.emit(wi.Resize,r)})),r._intrinsicCoord$.reaction((function(t,n,i){i||e.events.emit(wi.IntrinsicMove,r)})),r._intrinsicSize$.reaction((function(t,n,i){i||e.events.emit(wi.IntrinsicResize,r)})),r._visualSize$.reaction((function(t,n,i){i||e.events.emit(wi.VisualResize,r)})),r._zIndex$.reaction((function(t,n,i){if(e.boxes.length>0){var o=e.boxes.reduce((function(e,t){return e.zIndex>t.zIndex?e:t}));e.topBox$.setValue(o)}i||e.events.emit(wi.ZIndex,r)})),this.events.emit(wi.Created,r),r}},{key:"query",value:function(e){return e?this.boxes.filter(this.teleBoxMatcher(e)):a(this.boxes)}},{key:"queryOne",value:function(e){return e?this.boxes.find(this.teleBoxMatcher(e)):this.boxes[0]}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.boxes.find((function(t){return t.id===e}));if(r)return this.updateBox(r,t,n)}},{key:"updateAll",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.boxes.forEach((function(r){t.updateBox(r,e,n)}))}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getBoxIndex(e);if(n>=0){var r=this.boxes.slice(),i=r.splice(n,1);return this.boxes$.setValue(r),i.forEach((function(e){return e.destroy()})),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(wi.Removed,i)),i[0]}}},{key:"removeTopBox",value:function(){if(this.topBox)return this.remove(this.topBox)}},{key:"removeAll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.boxes$.value;return this.boxes$.setValue([]),t.forEach((function(e){return e.destroy()})),e||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(wi.Removed,t)),t}},{key:"destroy",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.events.removeAllListeners(),this._sideEffect.flushAll(),this.removeAll(t),Object.keys(this).forEach((function(t){var n=e[t];n instanceof si&&n.destroy()}))}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"focusBox",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBox(e);r&&(this.boxes.forEach((function(e){if(r===e){var i=!1;r.focus||(i=!0,r.setFocus(!0,n)),i&&!n&&t.events.emit(wi.Focused,r)}else e.focus&&t.blurBox(e,n)})),this.maxTitleBar.focusBox(r))}},{key:"focusTopBox",value:function(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}},{key:"blurBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getBox(e);n&&(n.focus&&(n.setFocus(!1,t),t||this.events.emit(wi.Blurred,n)),this.maxTitleBar.focusedBox===n&&this.maxTitleBar.focusBox())}},{key:"blurAll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.boxes.forEach((function(n){n.focus&&(n.setFocus(!1,t),t||e.events.emit(wi.Blurred,n))})),this.maxTitleBar.focusedBox&&this.maxTitleBar.focusBox()}},{key:"teleBoxMatcher",value:function(e){var t=Object.keys(e);return function(n){return t.every((function(t){return e[t]===n[t]}))}}},{key:"updateBox",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(null!=t.x||null!=t.y)&&e.move(null==t.x?e.intrinsicX:t.x,null==t.y?e.intrinsicY:t.y,n),(null!=t.width||null!=t.height)&&e.resize(null==t.width?e.intrinsicWidth:t.width,null==t.height?e.intrinsicHeight:t.height,n),null!=t.title&&(e.setTitle(t.title),this.maxTitleBar.updateTitles()),null!=t.visible&&e.setVisible(t.visible,n),null!=t.minHeight&&e.setMinHeight(t.minHeight,n),null!=t.minWidth&&e.setMinWidth(t.minWidth,n),null!=t.resizable&&e.setResizable(t.resizable,n),null!=t.draggable&&e.setDraggable(t.draggable,n),null!=t.fixRatio&&e.setFixRatio(t.fixRatio,n),null!=t.zIndex&&e.setZIndex(t.zIndex,n),null!=t.content&&e.mountContent(t.content),null!=t.footer&&e.mountFooter(t.footer)}},{key:"smartPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=void 0===r?.5:r,o=e.height,a=void 0===o?.5:o;if(null==t){var s=20;this.topBox&&((s=this.topBox.intrinsicX*this.containerRect.width+20)>this.containerRect.width-i*this.containerRect.width&&(s=20)),t=s/this.containerRect.width}if(null==n){var u=20;this.topBox&&((u=this.topBox.intrinsicY*this.containerRect.height+20)>this.containerRect.height-a*this.containerRect.height&&(u=20)),n=u/this.containerRect.height}return yn(gn({},e),{x:t,y:n,width:i,height:a})}},{key:"makeBoxTop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.topBox&&e!==this.topBox&&e.setZIndex(this.topBox.zIndex+1,t)}},{key:"getBoxIndex",value:function(e){return"string"==typeof e?this.boxes.findIndex((function(t){return t.id===e})):this.boxes.findIndex((function(t){return t===e}))}},{key:"getBox",value:function(e){return"string"==typeof e?this.boxes.find((function(t){return t.id===e})):e}},{key:"boxes",get:function(){return this.boxes$.value}},{key:"topBox",get:function(){return this.topBox$.value}},{key:"darkMode",get:function(){return this._darkMode$.value}},{key:"state",get:function(){return this._state$.value}}]),e}(),Ii=function(){function e(t,n){var r=this;y(this,e),this.context=t,this.createTeleBoxManagerConfig=n;var i=t.emitter,o=t.callbacks,a=t.boxEmitter;this.teleBoxManager=this.setupBoxManager(n),this.teleBoxManager._state$.reaction((function(e){o.emit("boxStateChange",e),i.emit("boxStateChange",e)})),this.teleBoxManager._darkMode$.reaction((function(e){o.emit("darkModeChange",e)})),this.teleBoxManager._prefersColorScheme$.reaction((function(e){o.emit("prefersColorSchemeChange",e)})),this.teleBoxManager._minimized$.reaction((function(e){e||setTimeout((function(){var e=.001*(Math.random()>.5?1:-1);r.teleBoxManager.boxes.forEach((function(t){t.resize(t.intrinsicWidth+e,t.intrinsicHeight+e,!0)}))}),400)})),this.teleBoxManager.events.on("minimized",(function(e){if(r.context.safeSetAttributes({minimized:e}),e)r.context.cleanFocus(),r.blurAllBox();else{var t=r.getTopBox();t&&(r.context.setAppFocus(t.id),r.focusBox({appId:t.id},!1))}})),this.teleBoxManager.events.on("maximized",(function(e){r.context.safeSetAttributes({maximized:e})})),this.teleBoxManager.events.on("removed",(function(e){e.forEach((function(e){a.emit("close",{appId:e.id})}))})),this.teleBoxManager.events.on("intrinsic_move",j.debounce((function(e){a.emit("move",{appId:e.id,x:e.intrinsicX,y:e.intrinsicY})}),50)),this.teleBoxManager.events.on("intrinsic_resize",j.debounce((function(e){a.emit("resize",{appId:e.id,width:e.intrinsicWidth,height:e.intrinsicHeight})}),200)),this.teleBoxManager.events.on("focused",(function(e){e&&(r.canOperate?a.emit("focus",{appId:e.id}):r.teleBoxManager.blurBox(e.id))})),this.teleBoxManager.events.on("z_index",(function(e){r.context.updateAppState(e.id,$.ZIndex,e.zIndex)})),i.on("playgroundSizeChange",(function(){return r.updateManagerRect()})),i.on("updateManagerRect",(function(){return r.updateManagerRect()}))}return x(e,[{key:"createBox",value:function(e){var t,n,r;if(this.teleBoxManager){var i=null!=(t=e.app.config)?t:{},o=i.minwidth,a=void 0===o?.4722222222222222:o,s=i.minheight,u=void 0===s?.4722222222222222:s,l=null!=(n=e.app.config)?n:{},c=l.width,h=l.height,d=(null==(r=e.options)?void 0:r.title)||e.appId,f=this.teleBoxManager.containerRect;a>1&&(a/=f.width),u>1&&(u/=f.height);var p={title:d,minWidth:a,minHeight:u,width:c,height:h,id:e.appId};this.teleBoxManager.create(p,e.smartPosition),this.context.emitter.emit("".concat(e.appId).concat(q.WindowCreated))}}},{key:"setBoxInitState",value:function(e){var t=this.teleBoxManager.queryOne({id:e});t&&t.state===Zr.Maximized&&this.context.boxEmitter.emit("resize",{appId:e,x:t.x,y:t.y,width:t.intrinsicWidth,height:t.intrinsicHeight})}},{key:"setupBoxManager",value:function(e){var t=Ib.wrapper?Ib.wrapper:document.body,n=t.getBoundingClientRect(),r={root:t,containerRect:{x:0,y:0,width:n.width,height:n.height},fence:!1,prefersColorScheme:null==e?void 0:e.prefersColorScheme},i=new Ai(r);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=i;var o=(null==e?void 0:e.collectorContainer)||Ib.wrapper;return o&&this.setCollectorContainer(o),i}},{key:"setCollectorContainer",value:function(e){var t,n=new Ti({styles:null==(t=this.createTeleBoxManagerConfig)?void 0:t.collectorStyles}).mount(e);this.teleBoxManager.setCollector(n)}},{key:"getBox",value:function(e){return this.teleBoxManager.queryOne({id:e})}},{key:"closeBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.teleBoxManager.remove(e,t)}},{key:"boxIsFocus",value:function(e){var t=this.getBox(e);return null==t?void 0:t.focus}},{key:"getFocusBox",value:function(){return this.teleBoxManager.query({focus:!0})[0]}},{key:"getTopBox",value:function(){return this.teleBoxManager.topBox}},{key:"updateBoxState",value:function(e){var t=this;if(e){var n=this.getBox(e.id);n&&(this.teleBoxManager.update(n.id,{x:e.x,y:e.y,width:e.width||.5,height:e.height||.5,zIndex:e.zIndex},!0),setTimeout((function(){e.focus&&t.teleBoxManager.focusBox(n.id,!0),null!=e.maximized&&t.teleBoxManager.setMaximized(Boolean(e.maximized),!0),null!=e.minimized&&t.teleBoxManager.setMinimized(Boolean(e.minimized),!0)}),50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}}},{key:"updateManagerRect",value:function(){var e,t=null==(e=this.mainView.divElement)?void 0:e.getBoundingClientRect();if(t&&t.width>0&&t.height>0){var n={x:0,y:0,width:t.width,height:t.height};this.teleBoxManager.setContainerRect(n),this.context.notifyContainerRectUpdate(this.teleBoxManager.containerRect)}}},{key:"moveBox",value:function(e){var t=e.appId,n=e.x,r=e.y;this.teleBoxManager.update(t,{x:n,y:r},!0)}},{key:"focusBox",value:function(e){var t=e.appId,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.teleBoxManager.focusBox(t,n)}},{key:"resizeBox",value:function(e){var t=e.appId,n=e.width,r=e.height,i=e.skipUpdate;this.teleBoxManager.update(t,{width:n,height:r},i)}},{key:"setBoxMinSize",value:function(e){this.teleBoxManager.update(e.appId,{minWidth:e.minWidth,minHeight:e.minHeight},!0)}},{key:"setBoxTitle",value:function(e){this.teleBoxManager.update(e.appId,{title:e.title},!0)}},{key:"blurAllBox",value:function(){this.teleBoxManager.blurAll()}},{key:"updateAll",value:function(e){this.teleBoxManager.updateAll(e)}},{key:"setMaximized",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e!==this.maximized&&this.teleBoxManager.setMaximized(e,t)}},{key:"setMinimized",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.teleBoxManager.setMinimized(e,t)}},{key:"focusTopBox",value:function(){if(this.teleBoxManager.query().length>=1){var e=this.getTopBox();e&&this.focusBox({appId:e.id},!1)}}},{key:"updateBox",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.teleBoxManager.update(e,t,n)}},{key:"setReadonly",value:function(e){this.teleBoxManager.setReadonly(e)}},{key:"setPrefersColorScheme",value:function(e){this.teleBoxManager.setPrefersColorScheme(e)}},{key:"setZIndex",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.teleBoxManager.update(e,{zIndex:t},n)}},{key:"destroy",value:function(){this.teleBoxManager.destroy()}},{key:"mainView",get:function(){return this.context.getMainView()}},{key:"canOperate",get:function(){return this.context.canOperate()}},{key:"boxState",get:function(){return this.teleBoxManager.state}},{key:"maximized",get:function(){return this.teleBoxManager.maximized}},{key:"minimized",get:function(){return this.teleBoxManager.minimized}},{key:"darkMode",get:function(){return this.teleBoxManager.darkMode}},{key:"prefersColorScheme",get:function(){return this.teleBoxManager.prefersColorScheme}},{key:"boxSize",get:function(){return this.teleBoxManager.boxes.length}}]),e}();function Ci(){}function Ni(e){return e()}function ki(){return Object.create(null)}function Di(e){e.forEach(Ni)}function Pi(e){return"function"==typeof e}function Oi(e,t){return e!=e?t==t:e!==t||e&&"object"==_(e)||"function"==typeof e}function Ri(e,t){return Mi||(Mi=document.createElement("a")),Mi.href=t,e===Mi.href}function Li(e,t){e.appendChild(t)}function ji(e,t,n){e.insertBefore(t,n||null)}function Bi(e){e.parentNode.removeChild(e)}function Ui(e){return document.createElement(e)}function Fi(e){return document.createTextNode(e)}function zi(){return Fi(" ")}function Gi(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Hi(e){return Array.from(e.childNodes)}function Vi(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Wi(e,t,n,r){null===n?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function Yi(e){Si=e}var Xi=[],Qi=[],Zi=[],qi=[],Ji=Promise.resolve(),Ki=!1;function $i(e){Zi.push(e)}var eo=new Set,to=0;function no(){var e=Si;do{for(;to7&&void 0!==arguments[7]?arguments[7]:[-1],u=Si;Yi(e);var l=e.$$={fragment:null,ctx:null,props:o,update:Ci,not_equal:i,bound:ki(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ki(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(l.root);var c=!1;if(l.ctx=n?n(e,t.props||{},(function(t,n){var r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=r)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](r),c&&so(e,t)),n})):[],l.update(),c=!0,Di(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){var h=Hi(t.target);l.fragment&&l.fragment.l(h),h.forEach(Bi)}else l.fragment&&l.fragment.c();t.intro&&oo(e.$$.fragment),ao(e,t.target,t.anchor,t.customElement),no()}Yi(u)}(c(r=t.call(this)),e,po,fo,Oi,{cursorName:0,tagName:1,backgroundColor:2,appliance:3,x:4,y:5,src:6,visible:19,avatar:7,theme:8,color:9,cursorTagBackgroundColor:10,opacity:11,pencilEraserSize:20}),r}return n}(uo),mo=function(){function e(t,n,r,i){var o=this;y(this,e),this.manager=t,this.memberId=n,this.cursorManager=r,this.wrapper=i,this.move=function(e){var t;if("main"===e.type){var n=o.cursorManager.wrapperRect;o.component&&n&&(o.autoHidden(),o.moveCursor(e,n,o.manager.mainView))}else{var r=o.cursorManager.focusView,i=null==(t=null==r?void 0:r.divElement)?void 0:t.getBoundingClientRect(),a=null==r?void 0:r.camera;r&&i&&a&&o.component&&(o.autoHidden(),o.moveCursor(e,i,r))}},this.leave=function(){o.hide()},this.updateMember(),this.createCursor(),this.autoHidden()}var t;return x(e,[{key:"moveCursor",value:function(e,t,n){var r,i,o=e.x,a=e.y,s=e.type,u=null==n?void 0:n.screen.convertPointToScreen(o,a);if(u){var l=u.x-2,c=u.y-18;if("app"===s){var h=this.cursorManager.wrapperRect;h&&(l=l+t.x-h.x,c=c+t.y-h.y)}u.x<0||u.x>t.width||u.y<0||u.y>t.height?null==(r=this.component)||r.$set({visible:!1,x:l,y:c}):null==(i=this.component)||i.$set({visible:!0,x:l,y:c})}}},{key:"autoHidden",value:function(){var e=this;this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout((function(){e.hide()}),1e4)}},{key:"createCursor",value:(t=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.member&&this.wrapper&&(this.component=new vo({target:this.wrapper,props:this.initProps()}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"initProps",value:function(){var e;return{x:0,y:0,appliance:this.memberApplianceName,avatar:this.memberAvatar,src:this.getIcon(),visible:!1,backgroundColor:this.memberColor,cursorName:this.memberCursorName,theme:this.memberTheme,color:this.memberCursorTextColor,cursorTagBackgroundColor:this.memberCursorTagBackgroundColor,opacity:this.memberOpacity,tagName:this.memberTagName,pencilEraserSize:null==(e=this.member)?void 0:e.memberState.pencilEraserSize}}},{key:"getIcon",value:function(){var e;if(this.member){var t=this.cursorManager.applianceIcons,n=t[B.ApplianceNames.shape];if(this.memberApplianceName===B.ApplianceNames.pencilEraser){var r=(null==(e=this.member)?void 0:e.memberState.pencilEraserSize)||1;n=t["".concat(this.memberApplianceName).concat(r)]}else n=t[this.memberApplianceName||B.ApplianceNames.shape];return n||t[B.ApplianceNames.shape]}}},{key:"updateMember",value:function(){return this.member=dt(this.manager.room,this.memberId),this.updateComponent(),this.member}},{key:"updateComponent",value:function(){var e;null==(e=this.component)||e.$set(j.omit(this.initProps(),["x","y"]))}},{key:"destroy",value:function(){this.component&&this.component.$destroy(),this.cursorManager.cursorInstances.delete(this.memberId),this.timer&&clearTimeout(this.timer)}},{key:"hide",value:function(){this.component&&(this.component.$set({visible:!1}),this.destroy())}},{key:"memberApplianceName",get:function(){var e,t;return null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.currentApplianceName}},{key:"memberColor",get:function(){var e,t;return"rgb(".concat(null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.strokeColor.join(","),")")}},{key:"payload",get:function(){var e;return null==(e=this.member)?void 0:e.payload}},{key:"memberCursorName",get:function(){var e,t;return(null==(e=this.payload)?void 0:e.nickName)||(null==(t=this.payload)?void 0:t.cursorName)||this.memberId}},{key:"memberTheme",get:function(){var e;return null!=(e=this.payload)&&e.theme?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}},{key:"memberCursorTextColor",get:function(){var e;return(null==(e=this.payload)?void 0:e.cursorTextColor)||"#FFFFFF"}},{key:"memberCursorTagBackgroundColor",get:function(){var e;return(null==(e=this.payload)?void 0:e.cursorTagBackgroundColor)||this.memberColor}},{key:"memberAvatar",get:function(){var e;return null==(e=this.payload)?void 0:e.avatar}},{key:"memberOpacity",get:function(){return this.memberCursorName||this.memberAvatar?1:0}},{key:"memberTagName",get:function(){var e;return null==(e=this.payload)?void 0:e.cursorTagName}}]),e}(),go=(w(r={},B.ApplianceNames.pencil,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg=="),w(r,B.ApplianceNames.selector,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg=="),w(r,B.ApplianceNames.eraser,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII="),w(r,B.ApplianceNames.shape,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"),w(r,B.ApplianceNames.text,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="),w(r,B.ApplianceNames.laserPointer,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"),w(r,"pencilEraser1","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMjYiIHZpZXdCb3g9IjAgMCAxOCAyNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIxNyIgaGVpZ2h0PSIyNSIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),w(r,"pencilEraser2","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjYiIGhlaWdodD0iMzQiIHZpZXdCb3g9IjAgMCAyNiAzNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIyNSIgaGVpZ2h0PSIzMyIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),w(r,"pencilEraser3","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iNTAiIHZpZXdCb3g9IjAgMCAzNCA1MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIzMyIgaGVpZ2h0PSI0OSIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),r),yo=function(){function e(t,n,r){var i,o=this;y(this,e),this.manager=t,this.enableCursor=n,this.cursorInstances=new Map,this.sideEffectManager=new F.SideEffectManager,this.store=this.manager.store,this.applianceIcons=go,this.onCursorMove=function(e){var t=o.initCursorInstance(e.uid);if(e.state===ne.Leave)t.leave();else{var n=t.updateMember();o.canMoveCursor(n)&&t.move(e.position)}},this.initCursorInstance=function(e){var t=o.cursorInstances.get(e);return t||(t=new mo(o.manager,e,o,Ib.wrapper),o.cursorInstances.set(e,t)),t},this.mouseMoveListener_=function(e,t){var n=o.getType(e);o.updateCursor(n,e.clientX,e.clientY),t&&o.showPencilEraserIfNeeded(n,e.clientX,e.clientY)},this.mouseMoveTimer=0,this.mouseMoveListener=function(e){var t="touch"===e.pointerType;if(!t||e.isPrimary){var n=Date.now();n-o.mouseMoveTimer>48&&(o.mouseMoveTimer=n,o.mouseMoveListener_(e,t))}},this.mouseLeaveListener=function(){o.hideCursor(o.manager.uid)},this.getPoint=function(e,t,n){var r,i=null==(r=null==e?void 0:e.divElement)?void 0:r.getBoundingClientRect();if(i)return null==e?void 0:e.convertToPointInWorld({x:t-i.x,y:n-i.y})},this.getType=function(e){var t,n=e.target,r=o.manager.focusApp;switch(n.parentElement){case o.mainViewElement:return{type:"main"};case null==(t=null==r?void 0:r.view)?void 0:t.divElement:return{type:"app"};default:return{type:"main"}}},this.roomMembers=null==(i=this.manager.room)?void 0:i.state.roomMembers;var a=Ib.wrapper;a&&this.setupWrapper(a),this.sideEffectManager.add((function(){return ue.on("cursorMove",o.onCursorMove)})),this.sideEffectManager.add((function(){return ue.on("playgroundSizeChange",(function(){return o.updateContainerRect()}))})),r&&(this.applianceIcons=P(P({},go),r))}return x(e,[{key:"canMoveCursor",value:function(e){var t=(null==e?void 0:e.memberState.currentApplianceName)===B.ApplianceNames.laserPointer;return this.enableCursor||t}},{key:"setupWrapper",value:function(e){var t=this;this.sideEffectManager.add((function(){return e.addEventListener("pointerenter",t.mouseMoveListener),e.addEventListener("pointermove",t.mouseMoveListener),e.addEventListener("pointerleave",t.mouseLeaveListener),function(){e.removeEventListener("pointerenter",t.mouseMoveListener),e.removeEventListener("pointermove",t.mouseMoveListener),e.removeEventListener("pointerleave",t.mouseLeaveListener)}})),this.wrapperRect=e.getBoundingClientRect()}},{key:"setMainViewDivElement",value:function(e){this.mainViewElement=e}},{key:"showPencilEraserIfNeeded",value:function(e,t,n){var r=dt(this.manager.room,this.manager.uid),i=(null==r?void 0:r.memberState.currentApplianceName)===B.ApplianceNames.pencilEraser;if(this.wrapperRect&&this.manager.canOperate&&this.canMoveCursor(r)&&i){var o="main"===e.type?this.manager.mainView:this.focusView,a=this.getPoint(o,t,n);a&&this.onCursorMove({uid:this.manager.uid,position:{x:a.x,y:a.y,type:e.type}})}}},{key:"updateCursor",value:function(e,t,n){var r=dt(this.manager.room,this.manager.uid);if(this.wrapperRect&&this.manager.canOperate&&this.canMoveCursor(r)){var i="main"===e.type?this.manager.mainView:this.focusView,o=this.getPoint(i,t,n);o&&this.manager.dispatchInternalEvent(q.CursorMove,{uid:this.manager.uid,position:{x:o.x,y:o.y,type:e.type}})}}},{key:"updateContainerRect",value:function(){var e,t;this.containerRect=null==(e=Ib.container)?void 0:e.getBoundingClientRect(),this.wrapperRect=null==(t=Ib.wrapper)?void 0:t.getBoundingClientRect()}},{key:"deleteCursor",value:function(e){this.store.cleanCursor(e);var t=this.cursorInstances.get(e);t&&t.destroy()}},{key:"hideCursor",value:function(e){var t=this.cursorInstances.get(e);t&&t.hide()}},{key:"destroy",value:function(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach((function(e){e.destroy()})),this.cursorInstances.clear())}},{key:"boxState",get:function(){return this.store.getBoxState()}},{key:"focusView",get:function(){var e;return null==(e=this.manager.focusApp)?void 0:e.view}}]),e}(),bo=function(){function e(t){var n=this;y(this,e),this.manager=t,ue.on("changePageState",(function(){ae.emit("pageStateChange",n.toObject())}))}return x(e,[{key:"toObject",value:function(){return{index:this.index>=this.length?this.length-1:this.index,length:this.length}}},{key:"index",get:function(){return this.manager.store.getMainViewSceneIndex()||0}},{key:"length",get:function(){return this.manager.mainViewScenesLength||0}}]),e}(),xo=function(){function e(t){var n=this;y(this,e),this.ctx=t,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=function(){var e=g(regeneratorRuntime.mark((function e(t){var r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t===B.RoomPhase.Reconnecting&&n.ctx.emitter.emit("startReconnect"),e.t0=t===B.RoomPhase.Connected&&n.phase===B.RoomPhase.Reconnecting,!e.t0){e.next=10;break}if(null==(r=n.room)||!r.isWritable){e.next=7;break}null==(i=n.room)||i.dispatchMagixEvent(K,{}),e.next=10;break;case 7:return e.next=9,ke(500);case 9:n.onReconnected();case 10:n.phase=t;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onReconnected=j.debounce((function(){n._onReconnected()}),1e3),this._onReconnected=function(){tt("onReconnected refresh reactors"),n.releaseDisposers(),n.reactors.forEach((function(e,t){j.isFunction(e)&&n.disposers.set(t,e())})),n.ctx.emitter.emit("onReconnected")}}return x(e,[{key:"setRoom",value:function(e){var t=this;this.room=e,this.phase=null==e?void 0:e.phase,e&&(e.callbacks.off("onPhaseChanged",this.onPhaseChanged),e.callbacks.on("onPhaseChanged",this.onPhaseChanged),e.addMagixEventListener(K,(function(n){n.authorId===e.observerId&&t.onReconnected()}),{fireSelfEventAfterCommit:!0}))}},{key:"setContext",value:function(e){this.ctx=e}},{key:"releaseDisposers",value:function(){this.disposers.forEach((function(e){j.isFunction(e)&&e()})),this.disposers.clear()}},{key:"refresh",value:function(){this._onReconnected()}},{key:"add",value:function(e,t){var n=this.disposers.get(e);n&&j.isFunction(n)&&n(),j.isFunction(t)&&(this.reactors.set(e,t),this.disposers.set(e,t()))}},{key:"remove",value:function(e){this.reactors.has(e)&&this.reactors.delete(e);var t=this.disposers.get(e);t&&(j.isFunction(t)&&t(),this.disposers.delete(e))}},{key:"hasReactor",value:function(e){return this.reactors.has(e)}},{key:"destroy",value:function(){var e,t;null==(e=this.room)||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),null==(t=this.room)||t.removeMagixEventListener(K,this.onReconnected),this.releaseDisposers()}}]),e}(),_o=function(e,t){if(B.isPlayer(e))To(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get:function(){return t.mainView.disableCameraTransform},set:function(e){t.mainView.disableCameraTransform=e}}),Object.defineProperty(e,"canUndoSteps",{get:function(){return t.canUndoSteps}}),Object.defineProperty(e,"canRedoSteps",{get:function(){return t.canRedoSteps}}),e.moveCamera=function(e){return t.moveCamera(e)},e.moveCameraToContain=function(){return t.moveCameraToContain.apply(t,arguments)},e.convertToPointInWorld=function(){var e;return(e=t.mainView).convertToPointInWorld.apply(e,arguments)},e.setCameraBound=function(){var e;return(e=t.mainView).setCameraBound.apply(e,arguments)},e.scenePreview=function(){var e;return(e=t.mainView).scenePreview.apply(e,arguments)},e.fillSceneSnapshot=function(){var e;return(e=t.mainView).fillSceneSnapshot.apply(e,arguments)},e.generateScreenshot=function(){var e;return(e=t.mainView).generateScreenshot.apply(e,arguments)},e.setMemberState=function(){var e;return(e=t.mainView).setMemberState.apply(e,arguments)},e.redo=function(){return t.redo()},e.undo=function(){return t.undo()},e.cleanCurrentScene=function(){return t.cleanCurrentScene()},e.delete=function(){return t.delete()},e.copy=function(){return t.copy()},e.paste=function(){return t.paste()},e.duplicate=function(){return t.duplicate()},e.insertImage=function(){return t.insertImage.apply(t,arguments)},e.completeImageUpload=function(){return t.completeImageUpload.apply(t,arguments)},e.insertText=function(){return t.insertText.apply(t,arguments)},e.lockImage=function(){return t.lockImage.apply(t,arguments)},e.lockImages=function(){return t.lockImages.apply(t,arguments)},wo(e,t)}},wo=function(e,t){var n=e.removeScenes;e.removeScenes=function(r,i){var o;r===ie&&(null==(o=t.appManager)||o.updateRootDirRemoving(!0));var a=n.call(e,r);return ue.emit("removeScenes",{scenePath:r,index:i}),a}},To=function(e){var t=e.seekToProgressTime;function n(){return(n=g(regeneratorRuntime.mark((function n(r){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,ue.emit("seekStart");case 2:return n.next=4,t.call(e,r);case 4:return i=n.sent,n.abrupt("return",(ue.emit("seek",r),i));case 6:case"end":return n.stop()}}),n)})))).apply(this,arguments)}e.seekToProgressTime=function(e){return n.apply(this,arguments)}},Mo=Object.defineProperty,So=Object.defineProperties,Eo=Object.getOwnPropertyDescriptors,Ao=Object.getOwnPropertySymbols,Io=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,No=function(e,t,n){return t in e?Mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ko=function(e,t){for(var n in t||(t={}))Io.call(t,n)&&No(e,n,t[n]);if(Ao){var r,i=T(Ao(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Co.call(t,n)&&No(e,n,t[n])}}catch(e){i.e(e)}finally{i.f()}}return e},Do=function(e,t){return So(e,Eo(t))},Po=function(e,t,n,r){if("length"!==n&&"prototype"!==n&&"arguments"!==n&&"caller"!==n){var i=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);!Oo(i,o)&&r||Object.defineProperty(e,n,o)}},Oo=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Ro=function(e,t){var n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Lo=function(e,t){return"/* Wrapped ".concat(e,"*/\n").concat(t)},jo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Bo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Uo=function(e,t,n){var r=""===n?"":"with ".concat(n.trim(),"() "),i=Lo.bind(null,r,t.toString());Object.defineProperty(i,"name",Bo),Object.defineProperty(e,"toString",Do(ko({},jo),{value:i}))};function Fo(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.ignoreNonConfigurable,o=void 0!==i&&i,a=e.name,s=T(Reflect.ownKeys(t));try{for(s.s();!(n=s.n()).done;){var u=n.value;Po(e,t,u,o)}}catch(e){s.e(e)}finally{s.f()}return Ro(e,t),Uo(e,t,a),e}var zo=[],Go=function(){for(var e=0;e<20;e++)zo[e]="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(87*Math.random());return zo.join("")};function Ho(e){try{return e()}catch(e){console.error(e)}}var Vo=function(){function e(){y(this,e),this.push=this.addDisposer,this.disposers=new Map}return x(e,[{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?Wo(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),n=e();return n?this.addDisposer(n,t):t}},{key:"addEventListener",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,n,r),this.addDisposer((function(){return e.removeEventListener(t,n,r)}),i),i}},{key:"setTimeout",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){n.remove(r),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),r)}},{key:"setInterval",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),r=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(r)}),n)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(Ho),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=Go()}while(this.disposers.has(e));return e}}]),e}();function Wo(e){return function(){return e.forEach(Ho)}}var Yo,Xo=[],Qo="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Yo||(Yo={}));var Zo,qo=function(e){return Object.freeze(e)},Jo=function(e,t){this.inlineSize=e,this.blockSize=t,qo(this)},Ko=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,qo(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),$o=function(e){return e instanceof SVGElement&&"getBBox"in e},ea=function(e){if($o(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},ta=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},na="undefined"!=typeof window?window:{},ra=new WeakMap,ia=/auto|scroll/,oa=/^tb|vertical/,aa=/msie|trident/i.test(na.navigator&&na.navigator.userAgent),sa=function(e){return parseFloat(e||"0")},ua=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Jo((n?t:e)||0,(n?e:t)||0)},la=qo({devicePixelContentBoxSize:ua(),borderBoxSize:ua(),contentBoxSize:ua(),contentRect:new Ko(0,0,0,0)}),ca=function(e,t){if(void 0===t&&(t=!1),ra.has(e)&&!t)return ra.get(e);if(ea(e))return ra.set(e,la),la;var n=getComputedStyle(e),r=$o(e)&&e.ownerSVGElement&&e.getBBox(),i=!aa&&"border-box"===n.boxSizing,o=oa.test(n.writingMode||""),a=!r&&ia.test(n.overflowY||""),s=!r&&ia.test(n.overflowX||""),u=r?0:sa(n.paddingTop),l=r?0:sa(n.paddingRight),c=r?0:sa(n.paddingBottom),h=r?0:sa(n.paddingLeft),d=r?0:sa(n.borderTopWidth),f=r?0:sa(n.borderRightWidth),p=r?0:sa(n.borderBottomWidth),v=h+l,m=u+c,g=(r?0:sa(n.borderLeftWidth))+f,y=d+p,b=s?e.offsetHeight-y-e.clientHeight:0,x=a?e.offsetWidth-g-e.clientWidth:0,_=i?v+g:0,w=i?m+y:0,T=r?r.width:sa(n.width)-_-x,M=r?r.height:sa(n.height)-w-b,S=T+v+x+g,E=M+m+b+y,A=qo({devicePixelContentBoxSize:ua(Math.round(T*devicePixelRatio),Math.round(M*devicePixelRatio),o),borderBoxSize:ua(S,E,o),contentBoxSize:ua(T,M,o),contentRect:new Ko(h,u,T,M)});return ra.set(e,A),A},ha=function(e,t,n){var r=ca(e,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case Yo.DEVICE_PIXEL_CONTENT_BOX:return a;case Yo.BORDER_BOX:return i;default:return o}},da=function(e){var t=ca(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=qo([t.borderBoxSize]),this.contentBoxSize=qo([t.contentBoxSize]),this.devicePixelContentBoxSize=qo([t.devicePixelContentBoxSize])},fa=function(e){if(ea(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},pa=function(){var e=1/0,t=[];Xo.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new da(t.target),i=fa(t.target);r.push(n),t.lastReportedSize=ha(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},ma=function(){var e=0;for(va(e);Xo.some((function(e){return e.activeTargets.length>0}));)e=pa(),va(e);return Xo.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Qo}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Qo),window.dispatchEvent(e)}(),e>0},ga=[],ya=function(e){if(!Zo){var t=0,n=document.createTextNode("");new MutationObserver((function(){return ga.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Zo=function(){n.textContent="".concat(t?t--:t++)}}ga.push(e),Zo()},ba=0,xa={attributes:!0,characterData:!0,childList:!0,subtree:!0},_a=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wa=function(e){return void 0===e&&(e=0),Date.now()+e},Ta=!1,Ma=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!Ta){Ta=!0;var n=wa(e);!function(e){ya((function(){requestAnimationFrame(e)}))}((function(){var r=!1;try{r=ma()}finally{if(Ta=!1,e=n-wa(),!ba)return;r?t.run(1e3):e>0?t.run(e):t.start()}}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,xa)};document.body?t():na.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),_a.forEach((function(t){return na.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),_a.forEach((function(t){return na.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}(),Sa=new Ma,Ea=function(e){!ba&&e>0&&Sa.start(),!(ba+=e)&&Sa.stop()},Aa=function(){function e(e,t){this.target=e,this.observedBox=t||Yo.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=ha(this.target,this.observedBox,!0);return function(e){return!$o(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),Ia=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Ca=new WeakMap,Na=function(e,t){for(var n=0;n=0&&(i&&Xo.splice(Xo.indexOf(n),1),n.observationTargets.splice(r,1),Ea(-1))},e.disconnect=function(e){var t=this,n=Ca.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Da=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ka.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ta(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ka.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ta(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ka.unobserve(this,e)},e.prototype.disconnect=function(){ka.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var Pa="undefined"!=typeof window,Oa=Pa&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Ra=Pa&&"IntersectionObserver"in window,La=Pa&&"classList"in document.createElement("p"),ja=Pa&&window.devicePixelRatio>1,Ba={elements_selector:".lazy",container:Oa||Pa?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Ua=function(e){return Object.assign({},Ba,e)},Fa=function(e,t){var n,r="LazyLoad::Initialized",i=new e(t);try{n=new CustomEvent(r,{detail:{instance:i}})}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent(r,!1,!1,{instance:i})}window.dispatchEvent(n)},za="src",Ga="srcset",Ha="sizes",Va="poster",Wa="llOriginalAttrs",Ya="data",Xa="loading",Qa="loaded",Za="applied",qa="error",Ja="native",Ka="data-",$a="ll-status",es=function(e,t){return e.getAttribute(Ka+t)},ts=function(e){return es(e,$a)},ns=function(e,t){return function(e,t,n){var r=Ka+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)}(e,$a,t)},rs=function(e){return ns(e,null)},is=function(e){return null===ts(e)},os=function(e){return ts(e)===Ja},as=[Xa,Qa,Za,qa],ss=function(e,t,n,r){if(e){if(void 0!==r)return void e(t,n,r);if(void 0!==n)return void e(t,n);e(t)}},us=function(e,t){La?e.classList.add(t):e.className+=(e.className?" ":"")+t},ls=function(e,t){La?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},cs=function(e){return e.llTempImage},hs=function(e,t){if(t){var n=t._observer;!n||n.unobserve(e)}},ds=function(e,t){!e||(e.loadingCount+=t)},fs=function(e,t){!e||(e.toLoadCount=t)},ps=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},vs=function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&ps(n).forEach(t)},ms=function(e,t){ps(e).forEach(t)},gs=[za],ys=[za,Va],bs=[za,Ga,Ha],xs=[Ya],_s=function(e){return!!e[Wa]},ws=function(e){return e[Wa]},Ts=function(e){return delete e[Wa]},Ms=function(e,t){if(!_s(e)){var n={};t.forEach((function(t){n[t]=e.getAttribute(t)})),e[Wa]=n}},Ss=function(e,t){if(_s(e)){var n=ws(e);t.forEach((function(t){!function(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}(e,t,n[t])}))}},Es=function(e,t,n){us(e,t.class_applied),ns(e,Za),n&&(t.unobserve_completed&&hs(e,t),ss(t.callback_applied,e,n))},As=function(e,t,n){us(e,t.class_loading),ns(e,Xa),n&&(ds(n,1),ss(t.callback_loading,e,n))},Is=function(e,t,n){!n||e.setAttribute(t,n)},Cs=function(e,t){Is(e,Ha,es(e,t.data_sizes)),Is(e,Ga,es(e,t.data_srcset)),Is(e,za,es(e,t.data_src))},Ns={IMG:function(e,t){vs(e,(function(e){Ms(e,bs),Cs(e,t)})),Ms(e,bs),Cs(e,t)},IFRAME:function(e,t){Ms(e,gs),Is(e,za,es(e,t.data_src))},VIDEO:function(e,t){ms(e,(function(e){Ms(e,gs),Is(e,za,es(e,t.data_src))})),Ms(e,ys),Is(e,Va,es(e,t.data_poster)),Is(e,za,es(e,t.data_src)),e.load()},OBJECT:function(e,t){Ms(e,xs),Is(e,Ya,es(e,t.data_src))}},ks=["IMG","IFRAME","VIDEO","OBJECT"],Ds=function(e,t){t&&!function(e){return e.loadingCount>0}(t)&&!function(e){return e.toLoadCount>0}(t)&&ss(e.callback_finish,t)},Ps=function(e,t,n){e.addEventListener(t,n),e.llEvLisnrs[t]=n},Os=function(e,t,n){e.removeEventListener(t,n)},Rs=function(e){return!!e.llEvLisnrs},Ls=function(e){if(Rs(e)){var t=e.llEvLisnrs;for(var n in t){var r=t[n];Os(e,n,r)}delete e.llEvLisnrs}},js=function(e,t,n){(function(e){delete e.llTempImage})(e),ds(n,-1),function(e){!e||(e.toLoadCount-=1)}(n),ls(e,t.class_loading),t.unobserve_completed&&hs(e,n)},Bs=function(e,t,n){var r=cs(e)||e;Rs(r)||function(e,t,n){Rs(e)||(e.llEvLisnrs={});var r="VIDEO"===e.tagName?"loadeddata":"load";Ps(e,r,t),Ps(e,"error",n)}(r,(function(i){(function(e,t,n,r){var i=os(t);js(t,n,r),us(t,n.class_loaded),ns(t,Qa),ss(n.callback_loaded,t,r),i||Ds(n,r)})(0,e,t,n),Ls(r)}),(function(i){(function(e,t,n,r){var i=os(t);js(t,n,r),us(t,n.class_error),ns(t,qa),ss(n.callback_error,t,r),n.restore_on_error&&Ss(t,bs),i||Ds(n,r)})(0,e,t,n),Ls(r)}))},Us=function(e,t,n){(function(e){e.llTempImage=document.createElement("IMG")})(e),Bs(e,t,n),function(e){_s(e)||(e[Wa]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,n){var r=es(e,t.data_bg),i=es(e,t.data_bg_hidpi),o=ja&&i?i:r;!o||(e.style.backgroundImage='url("'.concat(o,'")'),cs(e).setAttribute(za,o),As(e,t,n))}(e,t,n),function(e,t,n){var r=es(e,t.data_bg_multi),i=es(e,t.data_bg_multi_hidpi),o=ja&&i?i:r;!o||(e.style.backgroundImage=o,Es(e,t,n))}(e,t,n),function(e,t,n){var r=es(e,t.data_bg_set);if(r){var i=r.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),Es(e,t,n)}}(e,t,n)},Fs=function(e,t,n){Bs(e,t,n),function(e,t,n){var r=Ns[e.tagName];!r||(r(e,t),As(e,t,n))}(e,t,n)},zs=function(e,t,n){!function(e){return ks.indexOf(e.tagName)>-1}(e)?Us(e,t,n):Fs(e,t,n)},Gs=function(e,t,n){e.setAttribute("loading","lazy"),Bs(e,t,n),function(e,t){var n=Ns[e.tagName];!n||n(e,t)}(e,t),ns(e,Ja)},Hs=function(e){e.removeAttribute(za),e.removeAttribute(Ga),e.removeAttribute(Ha)},Vs=function(e){vs(e,(function(e){Ss(e,bs)})),Ss(e,bs)},Ws={IMG:Vs,IFRAME:function(e){Ss(e,gs)},VIDEO:function(e){ms(e,(function(e){Ss(e,gs)})),Ss(e,ys),e.load()},OBJECT:function(e){Ss(e,xs)}},Ys=function(e){var t=Ws[e.tagName];t?t(e):function(e){if(_s(e)){var t=ws(e);e.style.backgroundImage=t.backgroundImage}}(e)},Xs=function(e,t){Ys(e),function(e,t){is(e)||os(e)||(ls(e,t.class_entered),ls(e,t.class_exited),ls(e,t.class_applied),ls(e,t.class_loading),ls(e,t.class_loaded),ls(e,t.class_error))}(e,t),rs(e),Ts(e)},Qs=function(e,t,n,r){!n.cancel_on_exit||!function(e){return ts(e)===Xa}(e)||"IMG"===e.tagName&&(Ls(e),function(e){vs(e,(function(e){Hs(e)})),Hs(e)}(e),Vs(e),ls(e,n.class_loading),ds(r,-1),rs(e),ss(n.callback_cancel,e,t,r))},Zs=function(e,t,n,r){var i=function(e){return as.indexOf(ts(e))>=0}(e);ns(e,"entered"),us(e,n.class_entered),ls(e,n.class_exited),function(e,t,n){t.unobserve_entered&&hs(e,n)}(e,n,r),ss(n.callback_enter,e,t,r),!i&&zs(e,n,r)},qs=["IMG","IFRAME","VIDEO"],Js=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},Ks=function(e,t,n){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Zs(e.target,e,t,n):function(e,t,n,r){is(e)||(us(e,n.class_exited),Qs(e,t,n,r),ss(n.callback_exit,e,t,r))}(e.target,e,t,n)}))},$s=function(e,t){!Ra||Js(e)||(t._observer=new IntersectionObserver((function(n){Ks(n,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},eu=function(e){return Array.prototype.slice.call(e)},tu=function(e){return e.container.querySelectorAll(e.elements_selector)},nu=function(e){return function(e){return ts(e)===qa}(e)},ru=function(e,t){return function(e){return eu(e).filter(is)}(e||tu(t))},iu=function(e,t){(function(e){return eu(e).filter(nu)})(tu(e)).forEach((function(t){ls(t,e.class_error),rs(t)})),t.update()},ou=function(e,t){var n=Ua(e);this._settings=n,this.loadingCount=0,$s(n,this),function(e,t){!Pa||(t._onlineHandler=function(){iu(e,t)},window.addEventListener("online",t._onlineHandler))}(n,this),this.update(t)};ou.prototype={update:function(e){var t=this._settings,n=ru(e,t);fs(this,n.length),!Oa&&Ra?Js(t)?function(e,t,n){e.forEach((function(e){-1!==qs.indexOf(e.tagName)&&Gs(e,t,n)})),fs(n,0)}(n,t,this):function(e,t){(function(e){e.disconnect()})(e),function(e,t){t.forEach((function(t){e.observe(t)}))}(e,t)}(this._observer,n):this.loadAll(n)},destroy:function(){this._observer&&this._observer.disconnect(),function(e){!Pa||window.removeEventListener("online",e._onlineHandler)}(this),tu(this._settings).forEach((function(e){Ts(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,n=this._settings;ru(e,n).forEach((function(e){hs(e,t),zs(e,n,t)}))},restoreAll:function(){var e=this._settings;tu(e).forEach((function(t){Xs(t,e)}))}},ou.load=function(e,t){var n=Ua(t);zs(e,n)},ou.resetStatus=function(e){rs(e)},Pa&&function(e,t){if(t)if(t.length)for(var n,r=0;n=t[r];r+=1)Fa(e,n);else Fa(e,t)}(ou,window.lazyLoadOptions);var au=function(){function e(t){var n=t.readonly,r=t.box,i=t.pages,o=t.onNewPageIndex,a=t.onPlay;if(y(this,e),this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Vo,i.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=n,this.box=r,this.pages=i,this.onNewPageIndex=o,this.onPlay=a,this.onPageIndexChanged=function(){},this.render()}return x(e,[{key:"mount",value:function(){var e=this;this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add((function(){var t=new ou({container:e.$preview,elements_selector:".".concat(e.wrapClassName("preview-page>img"))});return function(){return t.destroy()}}),"preview-lazyload")}},{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1),this.onPageIndexChanged(e))}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t;var n=this.wrapClassName("preview-page"),r=this.wrapClassName("preview-page-name");this.pages.forEach((function(i,o){var a,s=null!=(a=i.thumbnail)?a:i.src.startsWith("ppt")?void 0:i.src;if(s){var u=String(o),l=document.createElement("a");l.className=n+" "+e.wrapClassName("preview-page-".concat(o)),l.setAttribute("href","#"),l.dataset.pageIndex=u;var c=document.createElement("span");c.className=r,c.textContent=String(o+1),c.dataset.pageIndex=u;var h=document.createElement("img");h.width=i.width,h.height=i.height,h.dataset.src=s,h.dataset.pageIndex=u,l.appendChild(h),l.appendChild(c),t.appendChild(l)}})),this.sideEffect.addEventListener(t,"click",(function(t){var n;if(!e.readonly){var r=null==(n=t.target.dataset)?void 0:n.pageIndex;r&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(r)),e.togglePreview(!1))}}))}return this.$preview}},{key:"renderPreviewMask",value:function(){var e=this;return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",(function(t){e.readonly||t.target===e.$previewMask&&e.togglePreview(!1)}))),this.$previewMask}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");if(t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer")),this.pages.some((function(e){return e.thumbnail||!e.src.startsWith("ppt")}))){var n=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-sidebar")),n.setAttribute("viewBox","0 0 64 64");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(n,"click",(function(){e.readonly||e.togglePreview()})),this.$footer.appendChild(n)}var r=document.createElement("div");r.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),n.appendChild(r),n}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1)})),r.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-play")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),n.appendChild(r),n}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-pause")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(o.classList.toggle(e.wrapClassName("footer-btn-playing"),!0),e.onPlay&&e.onPlay(),e.sideEffect.setTimeout((function(){o.classList.toggle(e.wrapClassName("footer-btn-playing"),!1)}),500,"returnPlay"))})),r.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1)})),r.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1)}));var l=document.createElement("span");l.textContent=" / "+this.pages.length,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(r),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,n){var r=document.createElement("button");return r.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),r.appendChild(t),n&&r.appendChild(n),r}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&this.$preview.scrollTo({top:t.offsetTop-16})}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();function su(e,t,n){return Math.min(Math.max(e,t),n)}function uu(e){return e.touches?e.touches[0]:e}function lu(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function cu(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}var hu=function(){function e(t){var n,r,i,o=this;y(this,e),this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=function(e){if(!o.paused){var t=Math.floor((e-o._loopTimestamp)/1e3*60)+1;for(o._loopTimestamp=e;t-- >0;)o.stepper();o.onStep(o.current,o),!o.paused&&o.current!==o.target&&window.requestAnimationFrame(o.looper)}},this.current=null!=(n=t.start)?n:0,this.target=this.current,this.stiffness=null!=(r=t.stiffness)?r:170,this.damping=null!=(i=t.damping)?i:26,this.onStep=t.onStep}return x(e,[{key:"stepTo",value:function(e,t){this.paused&&null!=t&&(this.current=t),this.paused=!1,this.target=e,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}},{key:"pause",value:function(){this.paused=!0}},{key:"destroy",value:function(){this.pause()}},{key:"stepper",value:function(){var e=-this.stiffness*(this.current-this.target),t=-this.damping*this.velocity,n=this.velocity+(e+t)/60,r=this.current+n/60;Math.abs(n-0)<.01&&Math.abs(r-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=r,this.velocity=n)}}]),e}(),du=function(){function e(t,n,r,i){y(this,e),this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=t,this.page=n,this.scale=r,this.pageOffsetX=(i-n.width)/2;var o=document.createElement("div");o.className="page-renderer-page",o.dataset.index="".concat(t),o.style.width="".concat(n.width*r,"px"),o.style.height="".concat(n.height*r,"px"),n.thumbnail&&(o.style.backgroundImage='url("'.concat(n.thumbnail,'")'));var a=document.createElement("img");a.className="page-renderer-page-img",a.width=n.width,a.height=n.height,a.src=n.src,o.appendChild(a),this.$page=o}return x(e,[{key:"translateY",value:function(e){Math.abs(e-this.pageOffsetY)>=.001&&(this.pageOffsetY=e,this.$page.style.transform="translate(".concat(this.pageOffsetX*this.scale,"px, ").concat(this.pageOffsetY*this.scale,"px)"))}},{key:"setScale",value:function(e){Math.abs(e-this.scale)>=.001&&(this.scale=e,this.$page.style.width="".concat(this.page.width*this.scale,"px"),this.$page.style.height="".concat(this.page.height*this.scale,"px"),this.$page.style.transform="translate(".concat(this.pageOffsetX*this.scale,"px, ").concat(this.pageOffsetY*this.scale,"px)"))}},{key:"setVisible",value:function(e){e!==this.visible&&(this.visible=e,this.$page.style.opacity=e?"1":"0")}}]),e}(),fu=window.requestIdleCallback||function(e){return window.setTimeout(e,5e3)},pu=window.cancelIdleCallback||window.clearTimeout,vu=function(){function e(t,n,r){var i=this;y(this,e),this.pages=t,this.pagesIntrinsicWidth=n,this.scale=r,this.els=new Map,this.maxElCount=200,this.gcTimer=null,this.gc=function(){if(i.gcTimer=null,i.els.size>i.maxElCount)for(var e=a(i.els.values()).sort((function(e,t){return t.lastVisit-e.lastVisit})),t=Math.floor(i.maxElCount/4);tthis.maxElCount&&null===this.gcTimer&&(this.gcTimer=fu(this.gc)),t}},{key:"setScale",value:function(e){e!==this.scale&&(this.scale=e,this.els.forEach((function(t){return t.setScale(e)})))}},{key:"destroy",value:function(){this.els.clear(),null!==this.gcTimer&&(pu(this.gcTimer),this.gcTimer=null)}}]),e}(),mu=function(){function e(t){var n=this;y(this,e),this._hwaTimeout=NaN,this._turnOffHWA=function(){window.clearTimeout(n._hwaTimeout),n._hwaTimeout=NaN,n.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pages=t.pages.map((function(e){if(e.thumbnail)return e;try{var t=new URL(e.src);return t.searchParams.set("x-oss-process","image/resize,l_50"),Do(ko({},e),{thumbnail:t.toString()})}catch(t){return console.error(t),e}}));var r=Array(this.pages.length),i=1/0,o=0;this.pagesIntrinsicHeight=this.pages.reduce((function(e,t,n){return r[n]=e,t.width>o&&(o=t.width),t.height<=i&&(i=t.height),e+t.height}),0),this.pagesIntrinsicWidth=o,this.pagesMinHeight=i,this.pagesIntrinsicYs=r,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=t.onPageIndexChanged,this.pageScrollIndex=0,0!==this.pagesScrollTop&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new vu(this.pages,o,this.scale),this.$pages=this.renderPages()}return x(e,[{key:"setContainerSize",value:function(e,t){e>0&&t>0&&(e!==this.containerWidth||t!==this.containerHeight)&&(this.containerWidth=e,this.containerHeight=t,this.$pages.style.width="".concat(this.containerWidth,"px"),this.$pages.style.height="".concat(this.containerHeight,"px"),this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.pageElManager.setScale(this.scale),this.$pages.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}},{key:"renderPages",value:function(){var e=document.createElement("div");return e.className="page-renderer-pages-container",e.style.width="".concat(this.containerWidth,"px"),e.style.height="".concat(this.containerHeight,"px"),e}},{key:"pagesScrollTo",value:function(e,t){if(e=su(e,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=e;for(var n=this.findScrollPageIndex(),r=Math.max(n-this.threshold,0),i=Math.min(n+this.threshold,this.pages.length-1),o=0;o=r&&s<=i||(a.remove(),o--)}for(var u=r;u<=i;u++){var l=this.pageElManager.getEl(u);l.$page.parentElement!==this.$pages&&this.$pages.appendChild(l.$page),l.translateY(this.pagesIntrinsicYs[u]-this.pagesScrollTop)}n!==this.pageScrollIndex&&(this.pageScrollIndex=n,this.onPageIndexChanged&&this.onPageIndexChanged(n))}}},{key:"findScrollPageIndex",value:function(){for(var e=0;e=.001)return e;return this.pagesIntrinsicYs.length-1}},{key:"mount",value:function(e){e.appendChild(this.$pages),this.pagesScrollTo(this.pagesScrollTop,!0)}},{key:"unmount",value:function(){this.$pages.remove()}},{key:"destroy",value:function(){this.unmount(),this.onPageIndexChanged=void 0,this.pageElManager.destroy(),this._hwaTimeout&&(window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN)}},{key:"_calcScale",value:function(){return this.containerWidth/this.pagesIntrinsicWidth||1}},{key:"_calcThreshold",value:function(){return su(Math.ceil(this.containerHeight/this.scale/this.pagesMinHeight/2),1,this.pages.length)}},{key:"_turnOnHWA",value:function(){this._hwaTimeout?window.clearTimeout(this._hwaTimeout):this.$pages.classList.toggle("is-hwa",!0),this._hwaTimeout=window.setTimeout(this._turnOffHWA,1e3)}}]),e}(),gu=function(){function e(t){y(this,e),this.sideEffect=new Vo,this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pagesWidth=t.pagesWidth||1,this.pagesHeight=t.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=t.scrollbarMinHeight||30,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=t.readonly,this.wrapClassName=t.wrapClassName,this.onDragScroll=t.onDragScroll,this.$scrollbar=this.renderScrollbar()}return x(e,[{key:"mount",value:function(e){e.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}},{key:"unmount",value:function(){this.$scrollbar.remove()}},{key:"setReadonly",value:function(e){this.readonly=e}},{key:"setContainerSize",value:function(e,t){e>0&&t>0&&(e!==this.containerWidth||t!==this.containerHeight)&&(this.containerWidth=e,this.containerHeight=t,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}},{key:"pagesScrollTo",value:function(e,t){var n=this;if(e=su(e,0,this.pagesHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this.pagesScrollTop=e;var r=this.pagesScrollTop*this.scale/(this.pagesHeight*this.scale-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame((function(){n.$scrollbar.style.transform="translateY(".concat(r,"px)")})):this.$scrollbar.style.transform="translateY(".concat(r,"px)")}}},{key:"destroy",value:function(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}},{key:"renderScrollbar",value:function(){var e=this,t=document.createElement("button");t.className=this.wrapClassName("scrollbar"),t.style.minHeight="".concat(this.scrollbarMinHeight,"px"),t.style.height="".concat(this.scrollbarHeight,"px");var n=function(n){if(!(e.readonly||null!=n.button&&0!==n.button)){lu(n);var r=e.wrapClassName("scrollbar-dragging");t.classList.toggle(r,!0);var i=e.pagesScrollTop,o=uu(n).clientY,a=function(t){if(!e.readonly){var n=(uu(t).clientY-o)/e.scale;Math.abs(n)>0&&e.onDragScroll&&e.onDragScroll(i+n*(e.pagesHeight*e.scale/e.containerHeight))}},s=function e(){t.classList.toggle(r,!1),window.removeEventListener("mousemove",a,!0),window.removeEventListener("touchmove",a,!0),window.removeEventListener("mouseup",e,!0),window.removeEventListener("touchend",e,!0),window.removeEventListener("touchcancel",e,!0)};window.addEventListener("mousemove",a,!0),window.addEventListener("touchmove",a,!0),window.addEventListener("mouseup",s,!0),window.addEventListener("touchend",s,!0),window.addEventListener("touchcancel",s,!0)}};return this.sideEffect.addEventListener(t,"mousedown",n),this.sideEffect.addEventListener(t,"touchstart",n),t}},{key:"_calcScale",value:function(){return this.containerWidth/this.pagesWidth||1}},{key:"_calcScrollbarHeight",value:function(){return su(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}},{key:"_updateScrollbarHeight",value:function(){var e=this._calcScrollbarHeight();Math.abs(e-this.scrollbarHeight)>.001&&(this.scrollbarHeight=e,this.$scrollbar.style.height="".concat(e,"px"))}}]),e}(),yu=window.ResizeObserver||Da,bu=640,xu=function(){function e(t){var r=this,i=t.whiteboardView,a=t.readonly,s=t.box,u=t.pages,l=t.pageScrollTop,c=void 0===l?0:l,h=t.mountWhiteboard,d=t.onUserScroll,f=t.baseScenePath,p=t.appId;y(this,e),this.sideEffect=new Vo,this.userScrolling=!1,this.onNewPageIndex=function(e){r.scrollToPage(e)},this.toPdf=g(regeneratorRuntime.mark((function e(){var t,i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.createElement("canvas"),(i=t.getContext("2d"))&&r.baseScenePath){e.next=4;break}return r.reportProgress(100,null),e.abrupt("return");case 4:return a=r.whiteboardView.focusScenePath||"".concat(r.baseScenePath,"/1"),s=r.pages[0],e.next=8,Promise.resolve().then((function(){return V(n(88877))}));case 8:u=e.sent,l=u.jsPDF,c=new l({format:[s.width,s.height],orientation:s.width>s.height?"l":"p",compress:!0}),h=T(r.pages.entries()),e.prev=12,f=regeneratorRuntime.mark((function e(){var n,s,u,l,h,f,p,v,m,g,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o(d.value,2),s=n[0],u=n[1],l=u.width,h=u.height,f=u.src,t.width=l,t.height=h,p=l>h?"l":"p",s>0&&c.addPage([l,h],p),e.next=7,r.getBase64FromUrl(f);case 7:return v=e.sent,(m=document.createElement("img")).src=v,e.next=12,new Promise((function(e){return m.onload=e}));case 12:i.drawImage(m,0,0),g=t.toDataURL("image/jpeg",.6),i.clearRect(0,0,l,h),r.whiteboardView.screenshotToCanvas(i,a,l,h,{centerX:l/2,centerY:h/2+s*h,scale:1}),y=t.toDataURL("image/png"),c.addImage(g,"JPEG",0,0,l,h,"","FAST"),c.addImage(y,"PNG",0,0,l,h,"","FAST"),i.clearRect(0,0,l,h),Math.ceil((s+1)/r.pages.length*100)<100&&r.reportProgress(Math.ceil((s+1)/r.pages.length*100),null);case 17:case"end":return e.stop()}}),e)})),h.s();case 15:if((d=h.n()).done){e.next=19;break}return e.delegateYield(f(),"t0",17);case 17:e.next=15;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(12),h.e(e.t1);case 24:return e.prev=24,h.f(),e.finish(24);case 27:p=c.output("arraybuffer"),r.reportProgress(100,{pdf:p,title:r.box.title});case 29:case"end":return e.stop()}}),e,null,[[12,21,24,27]])}))),this.whiteboardView=i,this.readonly=a,this.box=s,this.pages=u,this.baseScenePath=f,this.appId=p,this.mountWhiteboard=h,this._onUserScroll=d;var v=this.debounce((function(){r.userScrolling=!1,r._onUserScroll&&r._onUserScroll(r.pageRenderer.pagesScrollTop)}),{wait:80},"debounce-updateUserScroll");this.updateUserScroll=function(){r.userScrolling=!0,v()},this.viewer=new au({readonly:a,box:s,pages:u,onNewPageIndex:this.onNewPageIndex});var m=this.whiteboardView.size,b=m.width,x=m.height;this.pageRenderer=new mu({pagesScrollTop:c,pages:this.pages,containerWidth:b,containerHeight:x,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new gu({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:b,containerHeight:x,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:function(e){r.pageScrollTo(e),r.updateUserScroll()}}),this.pageScrollStepper=new hu({start:this.pageRenderer.pagesScrollTop,onStep:function(e){r.pageScrollTo(e)}}),this.render()}var t;return x(e,[{key:"mount",value:function(){var e=this;this.viewer.mount(),this.setupScrollListener();var t=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add((function(){var n=new yu(t);return n.observe(e.viewer.$content),function(){return n.disconnect()}})),this.sideEffect.setTimeout((function(){e.userScrolling||e.pageScrollTo(e.pageRenderer.pagesScrollTop)}),100),this.sideEffect.add((function(){var t=function(t){"@netless/_request_save_pdf_"===t.data.type&&t.data.appId===e.appId&&e.toPdf().catch((function(){return e.reportProgress(100,null)}))};return window.addEventListener("message",t),function(){window.removeEventListener("message",t)}})),this}},{key:"unmount",value:function(){return this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e,this.viewer.setReadonly(e),this.scrollbar.setReadonly(e))}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}},{key:"syncPageScrollTop",value:function(e){!this.userScrolling&&e>=0&&Math.abs(this.pageRenderer.pagesScrollTop-e)>.01&&this.pageScrollStepper.stepTo(e,this.pageRenderer.pagesScrollTop)}},{key:"render",value:function(){this.pageRenderer.mount(this.viewer.$content),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.scrollbar.mount(this.viewer.$content),this.renderRatioHeight()}},{key:"renderRatioHeight",value:function(){var e=this.box.absoluteHeight,t=e<=bu;if(this.viewer.setSmallBox(t),t){var n=26/e,r=Math.max((.08125-(n+0))/2,0);if(this.box.$titleBar){var i=n+r;this.box.$titleBar.style.height="".concat(100*i,"%")}if(this.box.$footer){var o=0+r;this.box.$footer.style.height="".concat(100*o,"%")}}else{if(this.box.$titleBar){var a=Math.max(26/bu,26/e);this.box.$titleBar.style.height="".concat(100*a,"%")}if(this.box.$footer){var s=Math.max(26/bu,26/e);this.box.$footer.style.height="".concat(100*s,"%")}}}},{key:"renderWhiteboardView",value:function(){var e=this;return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView),this.sideEffect.addEventListener(this.$whiteboardView,"wheel",(function(t){lu(t),e.readonly||(e.pageScrollTo(e.pageRenderer.pagesScrollTop+t.deltaY),e.updateUserScroll())}),{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",(function(t){e.readonly||t.touches.length<=1||e.updateUserScroll()}),{passive:!0,capture:!0})),this.$whiteboardView}},{key:"scrollTopPageToEl",value:function(e){return e*this.pageRenderer.scale}},{key:"scrollTopElToPage",value:function(e){return e/this.pageRenderer.scale}},{key:"elScrollTo",value:function(e){this.pageScrollTo(this.scrollTopElToPage(e))}},{key:"pageScrollTo",value:function(e){var t=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:su(e+t,t,this.pageRenderer.pagesIntrinsicHeight-t),animationMode:"immediately"})}},{key:"scrollToPage",value:function(e){if(!this.readonly&&!Number.isNaN(e)){var t=this.pageRenderer.pagesIntrinsicYs[e];t>=0&&(this.pageScrollTo(t+5/this.pageRenderer.scale),this.updateUserScroll())}}},{key:"setupScrollListener",value:function(){var e=this;this.sideEffect.add((function(){var t=function(t){var n=e.whiteboardView.size,r=n.width,i=n.height;if(!(r<=0||i<=0)){var o=t.centerY-e.pageRenderer.containerHeight/e.pageRenderer.scale/2;e.pageRenderer.pagesScrollTo(o),e.scrollbar.pagesScrollTo(o)}};return e.whiteboardView.callbacks.on("onCameraUpdated",t),function(){return e.whiteboardView.callbacks.off("onCameraUpdated",t)}})),this.sideEffect.add((function(){var t=e.updateUserScroll;return e.whiteboardView.callbacks.on("onCameraUpdatedByDevice",t),function(){return e.whiteboardView.callbacks.off("onCameraUpdatedByDevice",t)}})),this.sideEffect.add((function(){var t=function(t){var n=t.width,r=t.height;if(!(n<=0||r<=0)){e.pageRenderer.setContainerSize(n,r),e.scrollbar.setContainerSize(n,r);var i=e.pageRenderer,o=i.pagesIntrinsicWidth,a=i.pagesIntrinsicHeight;e.whiteboardView.moveCameraToContain({originX:0,originY:e.pageRenderer.pagesScrollTop,width:o,height:r/e.pageRenderer.scale,animationMode:"immediately"}),e.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return e.pageRenderer.scale},minContentMode:function(){return e.pageRenderer.scale},centerX:o/2,centerY:a/2,width:o,height:a})}};return e.whiteboardView.callbacks.on("onSizeUpdated",t),function(){e.whiteboardView.callbacks.off("onSizeUpdated",t)}}),"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",(function(t){if(!e.readonly&&e.box.focus&&!e.box.minimized&&!cu(t.target)){var n=null;switch(t.key){case"PageDown":n=e.pageRenderer.pagesScrollTop+e.pageRenderer.containerHeight/e.pageRenderer.scale;break;case"PageUp":n=e.pageRenderer.pagesScrollTop-e.pageRenderer.containerHeight/e.pageRenderer.scale;break;case"ArrowDown":n=e.pageRenderer.pagesScrollTop+e.pageRenderer.containerHeight/4/e.pageRenderer.scale;break;case"ArrowUp":n=e.pageRenderer.pagesScrollTop-e.pageRenderer.containerHeight/4/e.pageRenderer.scale}null!==n&&(e._onUserScroll?e._onUserScroll(n):(e.pageScrollTo(n),e.updateUserScroll()))}}),{capture:!0})}},{key:"debounce",value:function(e,t,n){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e)throw new TypeError("Expected the first argument to be a function, got `".concat(_(e),"`"));var n,r,i,o=t.wait,a=void 0===o?0:o,s=t.maxWait,u=void 0===s?Number.Infinity:s,l=t.before,c=void 0!==l&&l,h=t.after,d=void 0===h||h;if(!c&&!d)throw new Error("Both `before` and `after` are false, function wouldn't be called.");var f=function(){for(var t=arguments.length,o=new Array(t),s=0;s0&&u!==Number.Infinity&&!r&&(r=setTimeout(f,u)),p&&(i=e.apply(l,o)),i};return Fo(f,e),f.cancel=function(){n&&(clearTimeout(n),n=void 0),r&&(clearTimeout(r),r=void 0)},f}(e,t);return this.sideEffect.addDisposer((function(){return r.cancel()}),n),r}},{key:"wrapClassName",value:function(e){return"netless-app-docs-viewer-static-"+e}},{key:"getBase64FromUrl",value:(t=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(this._invalidate(t));case 2:return e.next=4,e.sent.blob();case 4:return n=e.sent,e.abrupt("return",new Promise((function(e){var t=new FileReader;t.readAsDataURL(n),t.onloadend=function(){var n=t.result;e(n)}})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_invalidate",value:function(e){try{var t=new URL(e);return t.searchParams.set("t",Date.now().toString()),t.toString()}catch(t){return e}}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),_u=function(){function e(t){var n=this,r=t.context,i=t.whiteboardView,o=t.box,a=t.pages;y(this,e),this.sideEffect=new Vo,this.onPlayPPT=function(){var e=n.context.getRoom();e&&e.pptNextStep()},this._scaleDocsToFitImpl=function(){var e=n.pages[n.getPageIndex()];e&&(n.whiteboardView.moveCameraToContain({originX:-e.width/2,originY:-e.height/2,width:e.width,height:e.height,animationMode:"immediately"}),n.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return n.whiteboardView.camera.scale},minContentMode:function(){return n.whiteboardView.camera.scale},centerX:0,centerY:0,width:e.width,height:e.height}))},this._scaleDocsToFitDebounced=function(){n.sideEffect.setTimeout(n._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=function(){n._scaleDocsToFitImpl(),n._scaleDocsToFitDebounced()},this.onNewPageIndex=function(e){n.jumpToPage(e,!0)},this.context=r,this.whiteboardView=i,this.box=o,this.pages=a,this.displayer=r.getDisplayer(),this.viewer=new au({readonly:!r.getIsWritable(),box:o,pages:a,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add((function(){var e=function(e){n.viewer.setReadonly(!e)};return n.context.emitter.on("writableChange",e),function(){return n.context.emitter.off("writableChange",e)}})),this.sideEffect.add((function(){var e=function(e){n.jumpToPage(e.index)};return n.context.emitter.on("sceneStateChange",e),function(){return n.context.emitter.off("sceneStateChange",e)}}))}return x(e,[{key:"mount",value:function(){var e=this;this.viewer.mount();var t=this.getPageIndex();return 0!==t&&this.jumpToPage(t),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"unmount",value:function(){return this.viewer.unmount(),this}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"getPageIndex",value:function(){return this.displayer.state.sceneState.index}},{key:"jumpToPage",value:function(e,t){var n,r;if((e=su(e,0,this.pages.length-1))!==this.getPageIndex()&&this.context.getIsWritable()){var i=this.context.getInitScenePath(),o=null==(r=null==(n=this.context.getScenes())?void 0:n[e])?void 0:r.name;i&&o&&this.context.setScenePath("".concat(i,"/").concat(o)),this.scaleDocsToFit()}if(e!==this.viewer.pageIndex&&this.viewer.setPageIndex(e),t){var a=this.context.getRoom();if(a){var s=a.state.globalState.__pptState;a.setGlobalState({__pptState:s&&{uuid:s.uuid,pageIndex:e,disableAutoPlay:s.disableAutoPlay}})}}}},{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",(function(t){var n;if(e.box.focus&&!cu(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.jumpToPage(e.getPageIndex()-1,!0);break;case"ArrowRight":case"ArrowDown":null==(n=e.context.getRoom())||n.pptNextStep()}}))}},{key:"renderMask",value:function(){if(!this.$mask){var e=document.createElement("div");e.className=this.wrapClassName("mask"),this.$mask=e,document.createElement("button").className=this.wrapClassName("back"),document.createElement("button").className=this.wrapClassName("next")}return this.$mask}},{key:"renderWhiteboardView",value:function(){var e=this;return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.sideEffect.addEventListener(this.$whiteboardView,"click",(function(t){var n,r=e.context.getRoom();if(r&&"clicker"===r.state.memberState.currentApplianceName){for(var i=t.target;i;i=i.parentElement)if(null!=(n=i.classList)&&n.contains("ppt-event-source"))return;r.pptNextStep()}})),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}},{key:"wrapClassName",value:function(e){return"netless-app-docs-viewer-dynamic-"+e}}]),e}(),wu={kind:"DocsViewer",setup:function(e){var t=e.getBox(),n=e.getScenes();if(!n)throw new Error("[Docs Viewer]: scenes not found.");var r=e.getView();if(!r)throw new Error("[Docs Viewer]: no whiteboard view.");var i=n.map((function(e){var t=e.ppt;return t?{width:t.width,height:t.height,src:t.src,thumbnail:t.previewURL}:null})).filter((function(e){return Boolean(e)}));if(i.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(".netless-app-docs-viewer-content{position:relative;height:100%;overflow:hidden}.netless-app-docs-viewer-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-docs-viewer-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview-mask{display:block}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview{transform:translate(0)}.netless-app-docs-viewer-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-docs-viewer-preview-page:hover,.netless-app-docs-viewer-preview-page.netless-app-docs-viewer-preview-page-active{border-color:#444e601a}.netless-app-docs-viewer-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-docs-viewer-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-docs-viewer-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-docs-viewer-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-docs-viewer-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-docs-viewer-footer-btn:hover{background:transparent!important}}.netless-app-docs-viewer-footer-btn>svg{width:100%;height:100%}.netless-app-docs-viewer-footer-btn>svg:nth-of-type(2){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-docs-viewer-footer-btn~.netless-app-docs-viewer-footer-btn{margin-left:15px}.netless-app-docs-viewer-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-docs-viewer-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-docs-viewer-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn:hover{background:transparent}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:active{background:transparent;box-shadow:none}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:disabled{color:inherit}.netless-app-docs-viewer-readonly.netless-app-docs-viewer-float-footer{display:none}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:active,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:focus,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-docs-viewer-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-docs-viewer-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-docs-viewer-preview{background:rgba(50,50,50,.9)}.netless-app-docs-viewer-static-scrollbar{position:absolute;top:0;right:0;z-index:2147483647;width:8px;min-height:30px;margin:0;padding:0;border:none;outline:none;border-radius:4px;background:rgba(68,78,96,.4);box-shadow:1px 1px 8px #ffffffb3;opacity:0;transition:background .4s,opacity .4s 3s,transform .2s;user-select:none}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging{background:rgba(68,78,96,.6);opacity:1;transition:background .4s,opacity .4s 3s!important}.netless-app-docs-viewer-static-scrollbar:hover,.netless-app-docs-viewer-static-scrollbar:focus{background:rgba(68,78,96,.5)}.netless-app-docs-viewer-static-scrollbar:active{background:rgba(68,78,96,.6)}.netless-app-docs-viewer-content:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-static-scrollbar{display:none}.netless-app-docs-viewer-static-pages:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.page-renderer-pages-container{position:relative;overflow:hidden}.page-renderer-page{position:absolute;top:0;left:0;background-position:center;background-size:cover;background-repeat:no-repeat}.page-renderer-pages-container.is-hwa .page-renderer-page{will-change:transform}.page-renderer-page-img{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-pages{overflow:hidden;position:relative;height:100%;user-select:none}.netless-app-docs-viewer-static-page{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-wb-view,.netless-app-docs-viewer-dynamic-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-docs-viewer-dynamic-wb-view .cursor-clicker .ppt-event-source{cursor:pointer}\n"),i[0].src.startsWith("ppt")?function(e,t,n,r){t.disableCameraTransform=!0;var i=new _u({context:e,whiteboardView:t,box:n,pages:r}).mount();i.viewer.onPageIndexChanged=function(t){e.dispatchAppEvent("pageStateChange",{index:t,length:r.length})},e.dispatchAppEvent("pageStateChange",{index:i.getPageIndex(),length:r.length}),e.mountView(i.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",(function(t){var i=t.width,o=t.height;if(r.length>0&&"maximized"!==n.state){var a=r[0],s=a.width,u=a.height/s*i-o;0!==u&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:n.width,height:n.height+u/n.containerRect.height})}}))}(e,r,t,i):function(e,t,n,r){var i;t.disableCameraTransform=!e.getIsWritable();var o=new xu({whiteboardView:t,readonly:!e.getIsWritable(),box:n,pages:r,pageScrollTop:null==(i=e.getAttributes())?void 0:i.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:function(t){var r;(null==(r=e.getAttributes())?void 0:r.pageScrollTop)!==t&&!n.readonly&&e.updateAttributes(["pageScrollTop"],t)},baseScenePath:e.getInitScenePath(),appId:e.appId}).mount();o.viewer.onPageIndexChanged=function(t){e.dispatchAppEvent("pageStateChange",{index:t,length:r.length})},e.dispatchAppEvent("pageStateChange",{index:o.viewer.pageIndex,length:r.length}),e.emitter.on("attributesUpdate",(function(e){e&&null!=e.pageScrollTop&&o.syncPageScrollTop(e.pageScrollTop)})),e.emitter.on("writableChange",(function(e){o.setReadonly(!e),t.disableCameraTransform=!e}))}(e,r,t,i)}};var Tu={exports:{}},Mu={},Su={exports:{}},Eu={}; +***************************************************************************** */var Kn=function(e){return function(t){if("string"!=typeof t)return t;for(var n={},r=function(e){return function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))}(e).replace(/(,|\/)/g," ").split(/ \s*/)}(t),i=0;i<4;i++)n[e[i]]=void 0!==r[i]?parseFloat(r[i]):1;return n}},$n=jn(jn({},Fn),{transform:function(e){return Math.round(Zn(e))}});function er(e,t){return e.startsWith(t)&&zn.test(e)}var tr,nr={test:function(e){return"string"==typeof e?er(e,"rgb"):qn(e)},parse:Kn(["red","green","blue","alpha"]),transform:function(e){var t=e.red,n=e.green,r=e.blue,i=e.alpha,o=void 0===i?1:i;return function(e){var t=e.red,n=e.green,r=e.blue,i=e.alpha;return"rgba("+t+", "+n+", "+r+", "+(void 0===i?1:i)+")"}({red:$n.transform(t),green:$n.transform(n),blue:$n.transform(r),alpha:Un(Gn.transform(o))})}},rr={test:function(e){return"string"==typeof e?er(e,"hsl"):Jn(e)},parse:Kn(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,n=e.saturation,r=e.lightness,i=e.alpha,o=void 0===i?1:i;return function(e){var t=e.hue,n=e.saturation,r=e.lightness,i=e.alpha;return"hsla("+t+", "+n+", "+r+", "+(void 0===i?1:i)+")"}({hue:Math.round(t),saturation:Yn.transform(Un(n)),lightness:Yn.transform(Un(r)),alpha:Un(Gn.transform(o))})}},ir=jn(jn({},nr),{test:function(e){return"string"==typeof e&&er(e,"#")},parse:function(e){var t="",n="",r="";return e.length>4?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),t+=t,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:1}}}),or={test:function(e){return"string"==typeof e&&zn.test(e)||qn(e)||Jn(e)},parse:function(e){return nr.test(e)?nr.parse(e):rr.test(e)?rr.parse(e):ir.test(e)?ir.parse(e):e},transform:function(e){return qn(e)?nr.transform(e):Jn(e)?rr.transform(e):e}},ar=function(e){var t=e.onRead,n=e.onRender,r=e.uncachedValues,i=void 0===r?new Set:r,o=e.useCache,a=void 0===o||o;return function(e){void 0===e&&(e={});var r=wn(e,[]),o={},s=[],u=!1;function l(e,t){e.startsWith("--")&&(r.hasCSSVariable=!0);var n=o[e];o[e]=t,o[e]!==n&&(-1===s.indexOf(e)&&s.push(e),u||(u=!0,Pn.render(c.render)))}var c={get:function(e,n){return void 0===n&&(n=!1),!n&&a&&!i.has(e)&&void 0!==o[e]?o[e]:t(e,r)},set:function(e,t){if("string"==typeof e)l(e,t);else for(var n in e)l(n,e[n]);return this},render:function(e){return void 0===e&&(e=!1),(u||!0===e)&&(n(o,r,s),u=!1,s.length=0),this}};return c}},sr=/([a-z])([A-Z])/g,ur=function(e){return e.replace(sr,"$1-$2").toLowerCase()},lr=new Map,cr=new Map,hr=["Webkit","Moz","O","ms",""],dr=hr.length,fr="undefined"!=typeof document,pr=function(e,t){return cr.set(e,ur(t))},vr=function(e,t){void 0===t&&(t=!1);var n=t?cr:lr;return n.has(e)||(fr?function(e){tr=tr||document.createElement("div");for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:ri();return this.flush(t),this.disposers.set(t,e()),t}},{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ri();return this.flush(t),this.disposers.set(t,e),t}},{key:"addEventListener",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ri();return this.add((function(){return e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n,r)}}),i),i}},{key:"setTimeout",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ri();return this.add((function(){var i=window.setTimeout((function(){n.remove(r),e()}),t);return function(){return window.clearTimeout(i)}}),r)}},{key:"setInterval",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ri();return this.add((function(){var n=window.setInterval(e,t);return function(){return window.clearInterval(n)}}),n)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);if(t)try{t()}catch(e){console.error(e)}}},{key:"flushAll",value:function(){this.disposers.forEach((function(e){try{e()}catch(e){console.error(e)}})),this.disposers.clear()}}]),e}(),oi=Object.defineProperty,ai=(n(80782),function(e,t,n){return r=e,i="symbol"!=_(t)?t+"":t,o=n,i in r?oi(r,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[i]=o,n;var r,i,o}),si=function(){function e(t,n){y(this,e),ai(this,"_value"),ai(this,"_beforeDestroys"),ai(this,"_subscribers"),this._value=t,n&&(this.compare=n)}return x(e,[{key:"setValue",value:function(e,t){if(!this.compare(e,this._value)){var n=this._value;this._value=e,this._subscribers&&this._subscribers.forEach((function(r){return r(e,n,t)}))}}},{key:"reaction",value:function(e){var t=this;return this._subscribers||(this._subscribers=new Set),this._subscribers.add(e),function(){t._subscribers&&t._subscribers.delete(e)}}},{key:"subscribe",value:function(e,t){var n=this.reaction(e);return e(this._value,void 0,t),n}},{key:"derive",value:function(t,n,r){var i=new e(t(this.value,void 0,r),n),o=this.reaction((function(e,n,r){i.setValue(t(e,n,r))}));return i.addBeforeDestroy(o),i}},{key:"destroy",value:function(){this._beforeDestroys&&(this._beforeDestroys.forEach((function(e){return e()})),this._beforeDestroys.clear()),this._subscribers&&this._subscribers.clear()}},{key:"addBeforeDestroy",value:function(e){var t=this;return this._beforeDestroys||(this._beforeDestroys=new Set),this._beforeDestroys.add(e),function(){t._beforeDestroys&&t._beforeDestroys.delete(e)}}},{key:"compare",value:function(e,t){return e===t}},{key:"value",get:function(){return this._value}}]),e}();function ui(e,t){Object.keys(t).forEach((function(n){!function(e,t,n){var r,i;Object.defineProperties(e,(w(r={},t,{get:function(){return n.value}}),w(r,"_".concat(t,"$"),{value:n}),w(r,"set".concat((i=t)[0].toUpperCase()+i.slice(1)),{value:function(e,t){return n.setValue(e,t)}}),r))}(e,n,t[n])}))}function li(e){var t=function(t){var n=e.addDisposer((function(){t.destroy()}));return t.addBeforeDestroy((function(){e.remove(n)})),t};return{bindSideEffect:t,combine:function(e,n,r,i){return t(function(e,t,n,r){var i=e.map((function(e){return e.value})),o=new si(t(i,void 0,r),n);return e.forEach((function(e,n){var r=e.reaction((function(e,r,a){var s=i.slice();s[n]=e;var u=i;i=s,o.setValue(t(s,u,a),a)}));o.addBeforeDestroy(r)})),o}(e,n,r,i))},createVal:function(e,n){return t(new si(e,n))}}}!function(e){e.Light="light",e.Dark="dark",e.Auto="auto"}(Qr||(Qr={})),function(e){e.Normal="normal",e.Minimized="minimized",e.Maximized="maximized"}(Zr||(Zr={})),function(e){e.DarkMode="dark_mode",e.PrefersColorScheme="prefers_color_scheme",e.Close="close",e.Focus="focus",e.Blur="blur",e.Move="move",e.Resize="resize",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.VisualResize="visual_resize",e.ZIndex="z_index",e.State="state",e.Minimized="minimized",e.Maximized="maximized",e.Readonly="readonly",e.Destroyed="destroyed"}(qr||(qr={})),function(e){e.Close="close",e.Maximize="maximize",e.Minimize="minimize"}(Jr||(Jr={})),function(e){e.North="n",e.South="s",e.West="w",e.East="e",e.NorthWest="nw",e.NorthEast="ne",e.SouthEast="se",e.SouthWest="sw"}(Kr||(Kr={}));var ci="dh";function hi(e,t,n){return Math.min(Math.max(e,t),n)}function di(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function fi(e){return e.touches?e.touches[0]:e}function pi(){return Date.now().toString().slice(6)+Math.random().toString().slice(2,8)}var vi=1;function mi(){return"New Box ".concat(vi++)}function gi(e){return Boolean(e)}function yi(e){return!e}var bi=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.readonly,i=void 0!==r&&r,o=n.title,a=n.buttons,s=n.onEvent,u=n.onDragStart,l=n.namespace,c=void 0===l?"telebox":l,h=n.state,d=void 0===h?Zr.Normal:h;y(this,e),this.$btns=[],this.sideEffect=new ii,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=function(e){var n;if(!(t.readonly||0!==e.button||null!=(n=e.target.dataset)&&n.teleTitleBarNoDblClick)){di(e);var r=Date.now();r-t.lastTitleBarClick.timestamp<=500?Math.abs(e.clientX-t.lastTitleBarClick.clientX)<=5&&Math.abs(e.clientY-t.lastTitleBarClick.clientY)<=5&&t.onEvent&&t.onEvent({type:Jr.Maximize}):t.onDragStart&&t.onDragStart(e),t.lastTitleBarClick.timestamp=r,t.lastTitleBarClick.clientX=e.clientX,t.lastTitleBarClick.clientY=e.clientY}},this.lastTitleBarTouch={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarTouch=function(e){var n;if(!(t.readonly||null!=(n=e.target.dataset)&&n.teleTitleBarNoDblClick)){di(e);var r=Date.now(),i=e.touches[0]||{},o=i.clientX,a=void 0===o?t.lastTitleBarTouch.clientX+100:o,s=i.clientY,u=void 0===s?t.lastTitleBarTouch.clientY+100:s;r-t.lastTitleBarTouch.timestamp<=500?Math.abs(a-t.lastTitleBarTouch.clientX)<=10&&Math.abs(u-t.lastTitleBarTouch.clientY)<=10&&t.onEvent&&t.onEvent({type:Jr.Maximize}):t.onDragStart&&t.onDragStart(e),t.lastTitleBarTouch.timestamp=r,t.lastTitleBarTouch.clientX=a,t.lastTitleBarTouch.clientY=u}},this.readonly=i,this.onEvent=s,this.onDragStart=u,this.namespace=c,this.title=o,this.state=d,this.buttons=a||[{type:Jr.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:Jr.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:function(e){return e===Zr.Maximized}},{type:Jr.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}return x(e,[{key:"setTitle",value:function(e){this.title=e,this.$title&&(this.$title.textContent=e,this.$title.title=e)}},{key:"setState",value:function(e){var t=this;this.state!==e&&(this.state=e,this.buttons.forEach((function(n,r){n.isActive&&t.$btns[r].classList.toggle("is-active",n.isActive(e))})))}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e)}},{key:"render",value:function(){var e=this;if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");var t=document.createElement("div");t.className=this.wrapClassName("title-area"),t.dataset.teleBoxHandle=ci,this.$title=document.createElement("h1"),this.$title.className=this.wrapClassName("title"),this.$title.dataset.teleBoxHandle=ci,this.title&&(this.$title.textContent=this.title,this.$title.title=this.title),t.appendChild(this.$title),t.appendChild(this.$dragArea);var n=document.createElement("div");n.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach((function(t,r){var i=t.iconClassName,o=t.isActive,a=String(r),s=document.createElement("button");s.className="".concat(e.wrapClassName("titlebar-btn")," ").concat(i),s.dataset.teleTitleBarBtnIndex=a,s.dataset.teleTitleBarNoDblClick="true",o&&s.classList.toggle("is-active",o(e.state)),e.$btns.push(s),n.appendChild(s)})),this.sideEffect.addEventListener(n,"click",(function(t){var n;if(!e.readonly){var r=t.target,i=Number(null==(n=r.dataset)?void 0:n.teleTitleBarBtnIndex);if(!Number.isNaN(i)&&i0&&void 0!==arguments[0]?arguments[0]:{},r=n.id,i=void 0===r?pi():r,a=n.title,s=void 0===a?mi():a,u=n.prefersColorScheme,l=void 0===u?Qr.Light:u,c=n.darkMode,h=n.visible,d=void 0===h||h,f=n.width,p=void 0===f?.5:f,v=n.height,m=void 0===v?.5:v,g=n.minWidth,b=void 0===g?0:g,x=n.minHeight,_=void 0===x?0:x,w=n.x,T=void 0===w?.1:w,M=n.y,S=void 0===M?.1:M,E=n.minimized,A=void 0!==E&&E,I=n.maximized,C=void 0!==I&&I,N=n.readonly,k=void 0!==N&&N,D=n.resizable,P=void 0===D||D,O=n.draggable,R=void 0===O||O,L=n.fence,j=void 0===L||L,B=n.fixRatio,U=void 0!==B&&B,z=n.focus,F=void 0!==z&&z,G=n.zIndex,H=void 0===G?100:G,V=n.namespace,W=void 0===V?"telebox":V,Y=n.titleBar,X=n.content,Q=n.footer,Z=n.styles,q=n.containerRect,J=void 0===q?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:q,K=n.collectorRect;y(this,e),this._renderSideEffect=new ii,this.handleTrackStart=function(e){var n;return null==(n=t._handleTrackStart)?void 0:n.call(t,e)},this._sideEffect=new ii,this._valSideEffectBinder=li(this._sideEffect);var $=this._valSideEffectBinder,ee=$.combine,te=$.createVal;this.id=i,this.namespace=W,this.events=new xn,this._delegateEvents=new xn;var ne=te(l);ne.reaction((function(e,n,r){r||t.events.emit(qr.PrefersColorScheme,e)}));var re=te(Boolean(c));null==c&&ne.subscribe((function(e,n,r){t._sideEffect.add((function(){if("auto"===e){var t=window.matchMedia("(prefers-color-scheme: dark)");if(t){re.setValue(t.matches,r);var n=function(e){re.setValue(e.matches,r)};return t.addListener(n),function(){return t.removeListener(n)}}return _i}return re.setValue("dark"===e,r),_i}),"prefers-color-scheme")})),re.reaction((function(e,n,r){r||t.events.emit(qr.DarkMode,e)}));var ie=te(J,$r),oe=te(K,$r),ae=te(s),se=te(d);se.reaction((function(e,n,r){!r&&!e&&t.events.emit(qr.Close)}));var ue=te(k);ue.reaction((function(e,n,r){r||t.events.emit(qr.Readonly,e)}));var le=te(P),ce=te(R),he=te(j),de=te(U),fe=te(H);fe.reaction((function(e,n,r){r||t.events.emit(qr.ZIndex,e)}));var pe=te(F);pe.reaction((function(e,n,r){r||t.events.emit(e?qr.Focus:qr.Blur)}));var ve=te(A);ve.reaction((function(e,n,r){r||t.events.emit(qr.Minimized,e)}));var me=te(C);me.reaction((function(e,n,r){r||t.events.emit(qr.Maximized,e)}));var ge=ee([ve,me],(function(e){var t=o(e,2),n=t[0],r=t[1];return n?Zr.Minimized:r?Zr.Maximized:Zr.Normal}));ge.reaction((function(e,n,r){r||t.events.emit(qr.State,e)}));var ye=te({width:hi(b,0,1),height:hi(_,0,1)},$r),be=te({width:hi(p,ye.value.width,1),height:hi(m,ye.value.height,1)},$r);ye.reaction((function(e,t,n){be.setValue({width:hi(p,e.width,1),height:hi(m,e.height,1)},n)})),be.reaction((function(e,n,r){r||t.events.emit(qr.IntrinsicResize,e)}));var xe=ee([be,me],(function(e){var t=o(e,2),n=t[0];return t[1]?{width:1,height:1}:n}),$r);xe.reaction((function(e,n,r){r||t.events.emit(qr.Resize,e)}));var _e=ee([xe,ve,ie,oe],(function(e){var t=o(e,4),n=t[0],r=t[1],i=t[2],a=t[3];return r&&a?{width:a.width/n.width/i.width,height:a.height/n.height/i.height}:n}),$r);_e.reaction((function(e,n,r){r||t.events.emit(qr.VisualResize,e)}));var we=te({x:hi(T,0,1),y:hi(S,0,1)},$r);we.reaction((function(e,n,r){r||t.events.emit(qr.IntrinsicMove,e)}));var Te=ee([we,be,ie,oe,ve,me],(function(e){var t=o(e,6),n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],u=t[5];return s&&a?u?{x:(a.x+a.width/2)/i.width-.5,y:(a.y+a.height/2)/i.height-.5}:{x:(a.x+a.width/2)/i.width-r.width/2,y:(a.y+a.height/2)/i.height-r.height/2}:u?{x:0,y:0}:n}),$r);Te.reaction((function(e,n,r){r||t.events.emit(qr.Move,e)})),this.titleBar=Y||new bi({readonly:ue.value,title:ae.value,namespace:this.namespace,onDragStart:function(e){var n;return null==(n=t._handleTrackStart)?void 0:n.call(t,e)},onEvent:function(e){if(t._delegateEvents.listeners.length>0)t._delegateEvents.emit(e.type);else switch(e.type){case Jr.Maximize:me.setValue(!me.value);break;case Jr.Minimize:ve.setValue(!0);break;case Jr.Close:se.setValue(!1);break;default:console.error("Unsupported titleBar event:",e)}}}),ue.reaction((function(e){t.titleBar.setReadonly(e)}));var Me=te(X),Se=te(Q),Ee=te(Z);ui(this,{prefersColorScheme:ne,darkMode:re,containerRect:ie,collectorRect:oe,title:ae,visible:se,readonly:ue,resizable:le,draggable:ce,fence:he,fixRatio:de,focus:pe,zIndex:fe,minimized:ve,maximized:me,$userContent:Me,$userFooter:Se,$userStyles:Ee}),this._state$=ge,this._minSize$=ye,this._size$=xe,this._intrinsicSize$=be,this._visualSize$=_e,this._coord$=Te,this._intrinsicCoord$=we,this.fixRatio&&this.transform(Te.value.x,Te.value.y,xe.value.width,xe.value.height,!0),this.$box=this.render()}return x(e,[{key:"setState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case Zr.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case Zr.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}},{key:"setMinWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._minSize$.setValue({width:e,height:this.minHeight},t),this}},{key:"setMinHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._minSize$.setValue({width:this.minWidth,height:e},t),this}},{key:"resize",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._intrinsicSize$.setValue({width:e,height:t},n),this}},{key:"move",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._intrinsicCoord$.setValue({x:e,y:t},n),this}},{key:"transform",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(this.fixRatio){var o=this.intrinsicHeight/this.intrinsicWidth*n;t!==this.intrinsicY&&(t-=o-r),r=o}return t<0&&(t=0,r>this.intrinsicHeight&&(r=this.intrinsicHeight)),this._intrinsicCoord$.setValue({x:n>=this.minWidth?e:this.intrinsicX,y:r>=this.minHeight?t:this.intrinsicY},i),this._intrinsicSize$.setValue({width:hi(n,this.minWidth,1),height:hi(r,this.minHeight,1)},i),this}},{key:"mount",value:function(e){return e.appendChild(this.render()),this}},{key:"unmount",value:function(){return this.$box&&this.$box.remove(),this}},{key:"mountContent",value:function(e){return this.set$userContent(e),this}},{key:"unmountContent",value:function(){return this.set$userContent(void 0),this}},{key:"mountFooter",value:function(e){return this.set$userFooter(e),this}},{key:"unmountFooter",value:function(){return this.set$userFooter(void 0),this}},{key:"getUserStyles",value:function(){return this.$userStyles}},{key:"mountStyles",value:function(e){var t;return"string"==typeof e?(t=document.createElement("style")).textContent=e:t=e,this.set$userStyles(t),this}},{key:"unmountStyles",value:function(){return this.set$userStyles(void 0),this}},{key:"render",value:function(e){var t=this;if(e){if(e===this.$box)return this.$box;this.$box=e}else{if(this.$box)return this.$box;this.$box=document.createElement("div")}this._renderSideEffect.flushAll(),this.$box.classList.add(this.wrapClassName("box"));var n=function(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:gi;return t._renderSideEffect.add((function(){var o=t.wrapClassName(r);return n.subscribe((function(t){e.classList.toggle(o,i(t))}))}))};n(this.$box,this._readonly$,"readonly"),n(this.$box,this._draggable$,"no-drag",yi),n(this.$box,this._resizable$,"no-resize",yi),n(this.$box,this._focus$,"blur",yi),n(this.$box,this._darkMode$,"color-scheme-dark"),n(this.$box,this._darkMode$,"color-scheme-light",yi),this._renderSideEffect.add((function(){var e=t.wrapClassName("minimized"),n=t.wrapClassName("maximized"),r="box-maximized-timer";return t._state$.subscribe((function(i){t.$box.classList.toggle(e,i===Zr.Minimized),i===Zr.Maximized?(t._renderSideEffect.flush(r),t.$box.classList.toggle(n,!0)):t._renderSideEffect.setTimeout((function(){t.$box.classList.toggle(n,!1)}),0,r)}))})),this._renderSideEffect.add((function(){return t._visible$.subscribe((function(e){t.$box.style.display=e?"block":"none"}))})),this._renderSideEffect.add((function(){return t._zIndex$.subscribe((function(e){t.$box.style.zIndex=String(e)}))}));var r=Xr(this.$box);this.$box.dataset.teleBoxID=this.id,this.$box.style.width=this.absoluteWidth+"px",this.$box.style.height=this.absoluteHeight+"px";var i=this.x*this.containerRect.width+this.containerRect.x,a=this.y*this.containerRect.height+this.containerRect.y;this.$box.style.transform="translate(".concat(i-10,"px,").concat(a-10,"px)"),this._valSideEffectBinder.combine([this._coord$,this._size$,this._minimized$,this._containerRect$,this._collectorRect$],(function(e){var t=o(e,5),n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],u=r.width*a.width,l=r.height*a.height;return{width:u+(i&&s?1:0),height:l+(i&&s?1:0),x:n.x*a.width,y:n.y*a.height,scaleX:i&&s?s.width/u:1,scaleY:i&&s?s.height/l:1}}),$r).subscribe((function(e){r.set(e)})),r.set({x:i,y:a});var s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);var u=document.createElement("div");u.className=this.wrapClassName("titlebar-wrap"),u.appendChild(this.titleBar.render()),this.$titleBar=u;var l=document.createElement("div");l.className=this.wrapClassName("content-wrap");var c=document.createElement("div");c.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=c,this._renderSideEffect.add((function(){var e;return t._$userStyles$.subscribe((function(t){e&&e.remove(),e=t,t&&l.appendChild(t)}))})),this._renderSideEffect.add((function(){var e;return t._$userContent$.subscribe((function(t){e&&e.remove(),e=t,t&&c.appendChild(t)}))})),l.appendChild(c);var h=document.createElement("div");return h.className=this.wrapClassName("footer-wrap"),this.$footer=h,this._renderSideEffect.add((function(){var e;return t._$userFooter$.subscribe((function(t){e&&e.remove(),e=t,t&&h.appendChild(t)}))})),s.appendChild(u),s.appendChild(l),s.appendChild(h),this._renderResizeHandlers(),this.$box}},{key:"_renderResizeHandlers",value:function(){var e=this,t=document.createElement("div");t.className=this.wrapClassName("resize-handles"),Object.values(Kr).forEach((function(n){var r=document.createElement("div");r.className=e.wrapClassName(n)+" "+e.wrapClassName("resize-handle"),r.dataset.teleBoxHandle=n,t.appendChild(r)})),this.$box.appendChild(t);var n,r,i="handle-tracking-listener",o=this.wrapClassName("transforming"),a=0,s=0,u=0,l=0,c=0,h=0,d=function(t){if(e.state===Zr.Normal){di(t);var n=fi(t),i=n.pageX,o=n.pageY;o<0&&(o=0);var d=(i-c)/e.containerRect.width,f=(o-h)/e.containerRect.height;switch(r){case Kr.North:e.transform(e.x,s+f,e.width,l-f);break;case Kr.South:e.transform(e.x,e.y,e.width,l+f);break;case Kr.West:e.transform(a+d,e.y,u-d,e.height);break;case Kr.East:e.transform(e.x,e.y,u+d,e.height);break;case Kr.NorthWest:e.transform(a+d,s+f,u-d,l-f);break;case Kr.NorthEast:e.transform(e.x,s+f,u+d,l-f);break;case Kr.SouthEast:e.transform(e.x,e.y,u+d,l+f);break;case Kr.SouthWest:e.transform(a+d,e.y,u-d,l+f);break;default:if(e.fence)e.move(hi(a+d,0,1-e.width),hi(s+f,0,1-e.height));else{var p=20/e.containerRect.width,v=20/e.containerRect.height;e.move(hi(a+d,p-e.width,1-p),hi(s+f,0,1-v))}}}},f=function(t){r=void 0,n&&(di(t),e.$box.classList.toggle(o,!1),e._sideEffect.flush(i),n.remove())},p=function(t){var p;if(!(e.readonly||null!=t.button&&0!==t.button||!e.draggable||r||e.state!==Zr.Normal)){var v=t.target;if(null!=(p=v.dataset)&&p.teleBoxHandle){var m;di(t),a=e.x,s=e.y,u=e.width,l=e.height,m=fi(t),c=m.pageX,h=m.pageY,r=v.dataset.teleBoxHandle,n||(n=document.createElement("div"));var g=r?e.wrapClassName("cursor-".concat(r)):"";n.className=e.wrapClassName("track-mask".concat(g?" ".concat(g):"")),e.$box.appendChild(n),e.$box.classList.add(o),e._sideEffect.add((function(){return window.addEventListener("mousemove",d),window.addEventListener("touchmove",d,{passive:!1}),window.addEventListener("mouseup",f),window.addEventListener("touchend",f,{passive:!1}),window.addEventListener("touchcancel",f,{passive:!1}),function(){window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",f),window.removeEventListener("touchend",f),window.removeEventListener("touchcancel",f)}}),i)}}};this._handleTrackStart=p,this._sideEffect.addEventListener(t,"mousedown",p,{},"box-resizeHandles-mousedown"),this._sideEffect.addEventListener(t,"touchstart",p,{passive:!1},"box-resizeHandles-touchstart")}},{key:"destroy",value:function(){this.$box.remove(),this.events.emit(qr.Destroyed),this._sideEffect.flushAll(),this._renderSideEffect.flushAll(),this.events.removeAllListeners(),this._delegateEvents.removeAllListeners()}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"darkMode",get:function(){return this._darkMode$.value}},{key:"state",get:function(){return this._state$.value}},{key:"minWidth",get:function(){return this._minSize$.value.width}},{key:"minHeight",get:function(){return this._minSize$.value.height}},{key:"intrinsicWidth",get:function(){return this._intrinsicSize$.value.width}},{key:"intrinsicHeight",get:function(){return this._intrinsicSize$.value.height}},{key:"width",get:function(){return this._size$.value.width}},{key:"height",get:function(){return this._size$.value.height}},{key:"absoluteWidth",get:function(){return this.width*this.containerRect.width}},{key:"absoluteHeight",get:function(){return this.height*this.containerRect.height}},{key:"visualWidth",get:function(){return this._visualSize$.value.width}},{key:"visualHeight",get:function(){return this._visualSize$.value.height}},{key:"intrinsicX",get:function(){return this._intrinsicCoord$.value.x}},{key:"intrinsicY",get:function(){return this._intrinsicCoord$.value.y}},{key:"x",get:function(){return this._coord$.value.x}},{key:"y",get:function(){return this._coord$.value.y}}]),e}();function _i(){}var wi,Ti=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.visible,i=void 0===r||r,o=n.readonly,a=void 0!==o&&o,s=n.darkMode,u=void 0!==s&&s,l=n.namespace,c=void 0===l?"telebox":l,h=n.styles,d=void 0===h?{}:h,f=n.onClick;y(this,e),this.handleCollectorClick=function(){!t._readonly&&t.onClick&&t.onClick()},this._visible=i,this._readonly=a,this._darkMode=u,this.namespace=c,this.styles=d,this.onClick=f}return x(e,[{key:"mount",value:function(e){return e.appendChild(this.render()),this}},{key:"unmount",value:function(){return this.$collector&&this.$collector.remove(),this}},{key:"setVisible",value:function(e){return this._visible!==e&&(this._visible=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-visible"),e)),this}},{key:"setReadonly",value:function(e){return this._readonly!==e&&(this._readonly=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-readonly"),e)),this}},{key:"setDarkMode",value:function(e){return this._darkMode!==e&&(this._darkMode=e,this.$collector&&(this.$collector.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$collector.classList.toggle(this.wrapClassName("color-scheme-light"),!e))),this}},{key:"setStyles",value:function(e){if(Object.assign(this.styles,e),this.$collector){var t=this.$collector;Object.keys(e).forEach((function(n){var r=e[n];null!=r&&(t.style[n]=r)}))}return this}},{key:"render",value:function(){return this.$collector||(this.$collector=document.createElement("button"),this.$collector.className=this.wrapClassName("collector"),this.$collector.style.backgroundImage="url('".concat("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K","')"),this.$collector.addEventListener("click",this.handleCollectorClick),this._visible&&this.$collector.classList.add(this.wrapClassName("collector-visible")),this._readonly&&this.$collector.classList.add(this.wrapClassName("collector-readonly")),this.$collector.classList.add(this.wrapClassName(this._darkMode?"color-scheme-dark":"color-scheme-light")),this.setStyles(this.styles)),this.$collector}},{key:"destroy",value:function(){this.$collector&&(this.$collector.removeEventListener("click",this.handleCollectorClick),this.$collector.remove(),this.$collector=void 0),this.onClick=void 0}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"visible",get:function(){return this._visible}},{key:"readonly",get:function(){return this._readonly}},{key:"darkMode",get:function(){return this._darkMode}}]),e}();!function(e){e.Focused="focused",e.Blurred="blurred",e.Created="created",e.Removed="removed",e.State="state",e.Maximized="maximized",e.Minimized="minimized",e.Move="move",e.Resize="resize",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.VisualResize="visual_resize",e.ZIndex="z_index",e.PrefersColorScheme="prefers_color_scheme",e.DarkMode="dark_mode"}(wi||(wi={}));var Mi,Si,Ei=function(e){s(n,e);var t=u(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).boxes=e.boxes,r.focusedBox=e.focusedBox,r.containerRect=e.containerRect,r.darkMode=e.darkMode,r}return x(n,[{key:"focusBox",value:function(e){var t;if(!this.focusedBox||this.focusedBox!==e){if(this.$titles&&this.state===Zr.Maximized)for(var n=this.$titles.firstElementChild.children,r=n.length-1;r>=0;r-=1){var i=n[r],o=null==(t=i.dataset)?void 0:t.teleBoxID;o&&(e&&o===e.id?i.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&o===this.focusedBox.id&&i.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}this.focusedBox=e}}},{key:"setContainerRect",value:function(e){if(this.containerRect=e,this.$titleBar){var t=e.x,n=e.y,r=e.width;this.$titleBar.style.transform="translate(".concat(t,"px, ").concat(n,"px)"),this.$titleBar.style.width=r+"px"}}},{key:"setBoxes",value:function(e){this.boxes=e,this.updateTitles()}},{key:"setState",value:function(e){i(v(n.prototype),"setState",this).call(this,e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"),e===Zr.Maximized),this.updateTitles()}},{key:"setReadonly",value:function(e){i(v(n.prototype),"setReadonly",this).call(this,e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("readonly"),this.readonly)}},{key:"setDarkMode",value:function(e){e!==this.darkMode&&(this.darkMode=e,this.$titleBar&&(this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-light"),!e)))}},{key:"render",value:function(){var e=i(v(n.prototype),"render",this).call(this),t=this.containerRect,r=t.x,o=t.y,a=t.width;e.style.transform="translate(".concat(r,"px, ").concat(o,"px)"),e.style.width=a+"px",e.classList.add(this.wrapClassName("max-titlebar")),e.classList.toggle(this.wrapClassName("max-titlebar-maximized"),this.state===Zr.Maximized),e.classList.toggle(this.wrapClassName("readonly"),this.readonly),e.classList.add(this.wrapClassName(this.darkMode?"color-scheme-dark":"color-scheme-light"));var s=document.createElement("div");return s.classList.add(this.wrapClassName("titles-area")),e.insertBefore(s,e.firstElementChild),this.updateTitles(),e}},{key:"destroy",value:function(){i(v(n.prototype),"destroy",this).call(this),this.$titles=void 0,this.boxes.length=0,this.focusedBox=void 0}},{key:"updateTitles",value:function(){this.$titleBar&&this.state===Zr.Maximized&&(this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-single-title"),1===this.boxes.length),1===this.boxes.length?this.setTitle(this.boxes[0].title):this.$titleBar.replaceChild(this.renderTitles(),this.$titleBar.firstElementChild))}},{key:"renderTitles",value:function(){var e=this;this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.$titles.addEventListener("wheel",(function(e){e.currentTarget.scrollBy({left:e.deltaY>0?250:-250,behavior:"smooth"})}),{passive:!1});var t=document.createElement("div");return t.className=this.wrapClassName("titles-content"),this.$titles.appendChild(t),this.boxes.forEach((function(n){var r=document.createElement("button");r.className=e.wrapClassName("titles-tab"),r.textContent=n.title,r.dataset.teleBoxID=n.id,r.dataset.teleTitleBarNoDblClick="true",e.focusedBox&&n.id===e.focusedBox.id&&r.classList.add(e.wrapClassName("titles-tab-focus")),t.appendChild(r)})),this.$titles}}]),n}(bi),Ai=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.root,i=void 0===r?document.body:r,a=n.prefersColorScheme,s=void 0===a?Qr.Light:a,u=n.minimized,l=void 0!==u&&u,c=n.maximized,h=void 0!==c&&c,d=n.fence,f=void 0===d||d,p=n.containerRect,v=void 0===p?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:p,m=n.collector,g=n.namespace,b=void 0===g?"telebox":g,x=n.readonly,_=void 0!==x&&x;y(this,e),this.events=new xn,this._sideEffect=new ii;var w=li(this._sideEffect),T=w.combine,M=w.createVal;this.root=i,this.namespace=b,this.boxes$=M([]),this.topBox$=this.boxes$.derive((function(e){if(e.length>0)return e.reduce((function(e,t){return e.zIndex>t.zIndex?e:t}))}));var S=window.matchMedia("(prefers-color-scheme: dark)"),E=M(!1);S&&(E.setValue(S.matches),this._sideEffect.add((function(){var e=function(e){E.setValue(e.matches)};return S.addListener(e),function(){return S.removeListener(e)}})));var A=M(s);A.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setPrefersColorScheme(e,r)})),r||t.events.emit(wi.PrefersColorScheme,e)})),this._darkMode$=T([E,A],(function(e){var t=o(e,2),n=t[0],r=t[1];return"auto"===r?n:"dark"===r})),this._darkMode$.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setDarkMode(e,r)})),r||t.events.emit(wi.DarkMode,e)}));var I=M(_);I.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setReadonly(e,r)}))}));var C=M(l),N=M(h);N.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setMaximized(e,r)})),r||t.events.emit(wi.Maximized,e)}));var k=T([C,N],(function(e){var t=o(e,2),n=t[0],r=t[1];return n?Zr.Minimized:r?Zr.Maximized:Zr.Normal}));k.reaction((function(e,n,r){t.maxTitleBar.setState(e),r||t.events.emit(wi.State,e)}));var D=M(f);D.subscribe((function(e,n,r){t.boxes.forEach((function(t){return t.setFence(e,r)}))}));var P=M(v,$r);P.reaction((function(e,n,r){t.boxes.forEach((function(t){return t.setContainerRect(e,r)})),t.maxTitleBar.setContainerRect(e)}));var O=M(null===m?null:m||new Ti({visible:l,readonly:_,namespace:b}).mount(i));O.subscribe((function(e){e&&(e.setVisible(C.value),e.setReadonly(I.value),e.setDarkMode(t._darkMode$.value),t._sideEffect.add((function(){return e.onClick=function(){I.value||C.setValue(!1)},function(){return e.destroy()}}),"collect-onClick"))})),I.subscribe((function(e){var t;return null==(t=O.value)?void 0:t.setReadonly(e)})),this._darkMode$.subscribe((function(e){var t;null==(t=O.value)||t.setDarkMode(e)}));var R=function(){var e;if(null!=(e=O.value)&&e.$collector){var n=O.value.$collector.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height,s=t.root.getBoundingClientRect();return{x:r-s.x,y:i-s.y,width:o,height:a}}},L=M(C.value?R():void 0);L.subscribe((function(e,n,r){t.boxes.forEach((function(t){t.setCollectorRect(e,r)}))})),C.subscribe((function(e,n,r){var i,o;null==(i=O.value)||i.setVisible(e),e&&null!=(o=O.value)&&o.$collector&&L.setValue(R()),t.boxes.forEach((function(t){return t.setMinimized(e,r)})),r||t.events.emit(wi.Minimized,e)}));var j=this.wrapClassName("titlebar-icon-close"),B=function(e){var n;if(!I.value){var r=e.target;if(r.tagName)for(var i=r;i;i=i.parentElement){if(i.classList&&i.classList.contains(j))return;var o=null==(n=i.dataset)?void 0:n.teleBoxID;if(o){var a=t.getBox(o);if(a)return t.focusBox(a),void t.makeBoxTop(a)}}}};this._sideEffect.addEventListener(window,"mousedown",B,!0),this._sideEffect.addEventListener(window,"touchstart",B,!0),this.maxTitleBar=new Ei({darkMode:this.darkMode,readonly:I.value,namespace:this.namespace,state:k.value,boxes:this.boxes$.value,containerRect:P.value,onEvent:function(e){switch(e.type){case Jr.Maximize:N.setValue(!N.value);break;case Jr.Minimize:C.setValue(!0);break;case qr.Close:t.removeTopBox(),t.focusTopBox()}}}),I.subscribe((function(e){return t.maxTitleBar.setReadonly(e)})),this._darkMode$.subscribe((function(e){t.maxTitleBar.setDarkMode(e)})),this.boxes$.reaction((function(e){t.maxTitleBar.setBoxes(e)})),ui(this,{prefersColorScheme:A,containerRect:P,collector:O,collectorRect:L,readonly:I,fence:D,minimized:C,maximized:N}),this._state$=k,this.root.appendChild(this.maxTitleBar.render())}return x(e,[{key:"setState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case Zr.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case Zr.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}},{key:"create",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=new xi(yn(gn({zIndex:this.topBox?this.topBox.zIndex+1:100},n?this.smartPosition(t):t),{darkMode:this.darkMode,prefersColorScheme:this.prefersColorScheme,maximized:this.maximized,minimized:this.minimized,fence:this.fence,namespace:this.namespace,containerRect:this.containerRect,readonly:this.readonly,collectorRect:this.collectorRect}));return r.mount(this.root),r.focus&&(this.focusBox(r),n&&this.makeBoxTop(r)),this.boxes$.setValue([].concat(a(this.boxes),[r])),r._delegateEvents.on(Jr.Maximize,(function(){e.setMaximized(!e.maximized)})),r._delegateEvents.on(Jr.Minimize,(function(){e.setMinimized(!0)})),r._delegateEvents.on(Jr.Close,(function(){e.remove(r),e.focusTopBox()})),r._coord$.reaction((function(t,n,i){i||e.events.emit(wi.Move,r)})),r._size$.reaction((function(t,n,i){i||e.events.emit(wi.Resize,r)})),r._intrinsicCoord$.reaction((function(t,n,i){i||e.events.emit(wi.IntrinsicMove,r)})),r._intrinsicSize$.reaction((function(t,n,i){i||e.events.emit(wi.IntrinsicResize,r)})),r._visualSize$.reaction((function(t,n,i){i||e.events.emit(wi.VisualResize,r)})),r._zIndex$.reaction((function(t,n,i){if(e.boxes.length>0){var o=e.boxes.reduce((function(e,t){return e.zIndex>t.zIndex?e:t}));e.topBox$.setValue(o)}i||e.events.emit(wi.ZIndex,r)})),this.events.emit(wi.Created,r),r}},{key:"query",value:function(e){return e?this.boxes.filter(this.teleBoxMatcher(e)):a(this.boxes)}},{key:"queryOne",value:function(e){return e?this.boxes.find(this.teleBoxMatcher(e)):this.boxes[0]}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.boxes.find((function(t){return t.id===e}));if(r)return this.updateBox(r,t,n)}},{key:"updateAll",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.boxes.forEach((function(r){t.updateBox(r,e,n)}))}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getBoxIndex(e);if(n>=0){var r=this.boxes.slice(),i=r.splice(n,1);return this.boxes$.setValue(r),i.forEach((function(e){return e.destroy()})),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(wi.Removed,i)),i[0]}}},{key:"removeTopBox",value:function(){if(this.topBox)return this.remove(this.topBox)}},{key:"removeAll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.boxes$.value;return this.boxes$.setValue([]),t.forEach((function(e){return e.destroy()})),e||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(wi.Removed,t)),t}},{key:"destroy",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.events.removeAllListeners(),this._sideEffect.flushAll(),this.removeAll(t),Object.keys(this).forEach((function(t){var n=e[t];n instanceof si&&n.destroy()}))}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}},{key:"focusBox",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBox(e);r&&(this.boxes.forEach((function(e){if(r===e){var i=!1;r.focus||(i=!0,r.setFocus(!0,n)),i&&!n&&t.events.emit(wi.Focused,r)}else e.focus&&t.blurBox(e,n)})),this.maxTitleBar.focusBox(r))}},{key:"focusTopBox",value:function(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}},{key:"blurBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getBox(e);n&&(n.focus&&(n.setFocus(!1,t),t||this.events.emit(wi.Blurred,n)),this.maxTitleBar.focusedBox===n&&this.maxTitleBar.focusBox())}},{key:"blurAll",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.boxes.forEach((function(n){n.focus&&(n.setFocus(!1,t),t||e.events.emit(wi.Blurred,n))})),this.maxTitleBar.focusedBox&&this.maxTitleBar.focusBox()}},{key:"teleBoxMatcher",value:function(e){var t=Object.keys(e);return function(n){return t.every((function(t){return e[t]===n[t]}))}}},{key:"updateBox",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(null!=t.x||null!=t.y)&&e.move(null==t.x?e.intrinsicX:t.x,null==t.y?e.intrinsicY:t.y,n),(null!=t.width||null!=t.height)&&e.resize(null==t.width?e.intrinsicWidth:t.width,null==t.height?e.intrinsicHeight:t.height,n),null!=t.title&&(e.setTitle(t.title),this.maxTitleBar.updateTitles()),null!=t.visible&&e.setVisible(t.visible,n),null!=t.minHeight&&e.setMinHeight(t.minHeight,n),null!=t.minWidth&&e.setMinWidth(t.minWidth,n),null!=t.resizable&&e.setResizable(t.resizable,n),null!=t.draggable&&e.setDraggable(t.draggable,n),null!=t.fixRatio&&e.setFixRatio(t.fixRatio,n),null!=t.zIndex&&e.setZIndex(t.zIndex,n),null!=t.content&&e.mountContent(t.content),null!=t.footer&&e.mountFooter(t.footer)}},{key:"smartPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=void 0===r?.5:r,o=e.height,a=void 0===o?.5:o;if(null==t){var s=20;this.topBox&&((s=this.topBox.intrinsicX*this.containerRect.width+20)>this.containerRect.width-i*this.containerRect.width&&(s=20)),t=s/this.containerRect.width}if(null==n){var u=20;this.topBox&&((u=this.topBox.intrinsicY*this.containerRect.height+20)>this.containerRect.height-a*this.containerRect.height&&(u=20)),n=u/this.containerRect.height}return yn(gn({},e),{x:t,y:n,width:i,height:a})}},{key:"makeBoxTop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.topBox&&e!==this.topBox&&e.setZIndex(this.topBox.zIndex+1,t)}},{key:"getBoxIndex",value:function(e){return"string"==typeof e?this.boxes.findIndex((function(t){return t.id===e})):this.boxes.findIndex((function(t){return t===e}))}},{key:"getBox",value:function(e){return"string"==typeof e?this.boxes.find((function(t){return t.id===e})):e}},{key:"boxes",get:function(){return this.boxes$.value}},{key:"topBox",get:function(){return this.topBox$.value}},{key:"darkMode",get:function(){return this._darkMode$.value}},{key:"state",get:function(){return this._state$.value}}]),e}(),Ii=function(){function e(t,n){var r=this;y(this,e),this.context=t,this.createTeleBoxManagerConfig=n;var i=t.emitter,o=t.callbacks,a=t.boxEmitter;this.teleBoxManager=this.setupBoxManager(n),this.teleBoxManager._state$.reaction((function(e){o.emit("boxStateChange",e),i.emit("boxStateChange",e)})),this.teleBoxManager._darkMode$.reaction((function(e){o.emit("darkModeChange",e)})),this.teleBoxManager._prefersColorScheme$.reaction((function(e){o.emit("prefersColorSchemeChange",e)})),this.teleBoxManager._minimized$.reaction((function(e){e||setTimeout((function(){var e=.001*(Math.random()>.5?1:-1);r.teleBoxManager.boxes.forEach((function(t){t.resize(t.intrinsicWidth+e,t.intrinsicHeight+e,!0)}))}),400)})),this.teleBoxManager.events.on("minimized",(function(e){if(r.context.safeSetAttributes({minimized:e}),e)r.context.cleanFocus(),r.blurAllBox();else{var t=r.getTopBox();t&&(r.context.setAppFocus(t.id),r.focusBox({appId:t.id},!1))}})),this.teleBoxManager.events.on("maximized",(function(e){r.context.safeSetAttributes({maximized:e})})),this.teleBoxManager.events.on("removed",(function(e){e.forEach((function(e){a.emit("close",{appId:e.id})}))})),this.teleBoxManager.events.on("intrinsic_move",j.debounce((function(e){a.emit("move",{appId:e.id,x:e.intrinsicX,y:e.intrinsicY})}),50)),this.teleBoxManager.events.on("intrinsic_resize",j.debounce((function(e){a.emit("resize",{appId:e.id,width:e.intrinsicWidth,height:e.intrinsicHeight})}),200)),this.teleBoxManager.events.on("focused",(function(e){e&&(r.canOperate?a.emit("focus",{appId:e.id}):r.teleBoxManager.blurBox(e.id))})),this.teleBoxManager.events.on("z_index",(function(e){r.context.updateAppState(e.id,$.ZIndex,e.zIndex)})),i.on("playgroundSizeChange",(function(){return r.updateManagerRect()})),i.on("updateManagerRect",(function(){return r.updateManagerRect()}))}return x(e,[{key:"createBox",value:function(e){var t,n,r;if(this.teleBoxManager){var i=null!=(t=e.app.config)?t:{},o=i.minwidth,a=void 0===o?.4722222222222222:o,s=i.minheight,u=void 0===s?.4722222222222222:s,l=null!=(n=e.app.config)?n:{},c=l.width,h=l.height,d=(null==(r=e.options)?void 0:r.title)||e.appId,f=this.teleBoxManager.containerRect;a>1&&(a/=f.width),u>1&&(u/=f.height);var p={title:d,minWidth:a,minHeight:u,width:c,height:h,id:e.appId};this.teleBoxManager.create(p,e.smartPosition),this.context.emitter.emit("".concat(e.appId).concat(q.WindowCreated))}}},{key:"setBoxInitState",value:function(e){var t=this.teleBoxManager.queryOne({id:e});t&&t.state===Zr.Maximized&&this.context.boxEmitter.emit("resize",{appId:e,x:t.x,y:t.y,width:t.intrinsicWidth,height:t.intrinsicHeight})}},{key:"setupBoxManager",value:function(e){var t=Ib.wrapper?Ib.wrapper:document.body,n=t.getBoundingClientRect(),r={root:t,containerRect:{x:0,y:0,width:n.width,height:n.height},fence:!1,prefersColorScheme:null==e?void 0:e.prefersColorScheme},i=new Ai(r);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=i;var o=(null==e?void 0:e.collectorContainer)||Ib.wrapper;return o&&this.setCollectorContainer(o),i}},{key:"setCollectorContainer",value:function(e){var t,n=new Ti({styles:null==(t=this.createTeleBoxManagerConfig)?void 0:t.collectorStyles}).mount(e);this.teleBoxManager.setCollector(n)}},{key:"getBox",value:function(e){return this.teleBoxManager.queryOne({id:e})}},{key:"closeBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.teleBoxManager.remove(e,t)}},{key:"boxIsFocus",value:function(e){var t=this.getBox(e);return null==t?void 0:t.focus}},{key:"getFocusBox",value:function(){return this.teleBoxManager.query({focus:!0})[0]}},{key:"getTopBox",value:function(){return this.teleBoxManager.topBox}},{key:"updateBoxState",value:function(e){var t=this;if(e){var n=this.getBox(e.id);n&&(this.teleBoxManager.update(n.id,{x:e.x,y:e.y,width:e.width||.5,height:e.height||.5,zIndex:e.zIndex},!0),setTimeout((function(){e.focus&&t.teleBoxManager.focusBox(n.id,!0),null!=e.maximized&&t.teleBoxManager.setMaximized(Boolean(e.maximized),!0),null!=e.minimized&&t.teleBoxManager.setMinimized(Boolean(e.minimized),!0)}),50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}}},{key:"updateManagerRect",value:function(){var e,t=null==(e=this.mainView.divElement)?void 0:e.getBoundingClientRect();if(t&&t.width>0&&t.height>0){var n={x:0,y:0,width:t.width,height:t.height};this.teleBoxManager.setContainerRect(n),this.context.notifyContainerRectUpdate(this.teleBoxManager.containerRect)}}},{key:"moveBox",value:function(e){var t=e.appId,n=e.x,r=e.y;this.teleBoxManager.update(t,{x:n,y:r},!0)}},{key:"focusBox",value:function(e){var t=e.appId,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.teleBoxManager.focusBox(t,n)}},{key:"resizeBox",value:function(e){var t=e.appId,n=e.width,r=e.height,i=e.skipUpdate;this.teleBoxManager.update(t,{width:n,height:r},i)}},{key:"setBoxMinSize",value:function(e){this.teleBoxManager.update(e.appId,{minWidth:e.minWidth,minHeight:e.minHeight},!0)}},{key:"setBoxTitle",value:function(e){this.teleBoxManager.update(e.appId,{title:e.title},!0)}},{key:"blurAllBox",value:function(){this.teleBoxManager.blurAll()}},{key:"updateAll",value:function(e){this.teleBoxManager.updateAll(e)}},{key:"setMaximized",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e!==this.maximized&&this.teleBoxManager.setMaximized(e,t)}},{key:"setMinimized",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.teleBoxManager.setMinimized(e,t)}},{key:"focusTopBox",value:function(){if(this.teleBoxManager.query().length>=1){var e=this.getTopBox();e&&this.focusBox({appId:e.id},!1)}}},{key:"updateBox",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.teleBoxManager.update(e,t,n)}},{key:"setReadonly",value:function(e){this.teleBoxManager.setReadonly(e)}},{key:"setPrefersColorScheme",value:function(e){this.teleBoxManager.setPrefersColorScheme(e)}},{key:"setZIndex",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.teleBoxManager.update(e,{zIndex:t},n)}},{key:"destroy",value:function(){this.teleBoxManager.destroy()}},{key:"mainView",get:function(){return this.context.getMainView()}},{key:"canOperate",get:function(){return this.context.canOperate()}},{key:"boxState",get:function(){return this.teleBoxManager.state}},{key:"maximized",get:function(){return this.teleBoxManager.maximized}},{key:"minimized",get:function(){return this.teleBoxManager.minimized}},{key:"darkMode",get:function(){return this.teleBoxManager.darkMode}},{key:"prefersColorScheme",get:function(){return this.teleBoxManager.prefersColorScheme}},{key:"boxSize",get:function(){return this.teleBoxManager.boxes.length}}]),e}();function Ci(){}function Ni(e){return e()}function ki(){return Object.create(null)}function Di(e){e.forEach(Ni)}function Pi(e){return"function"==typeof e}function Oi(e,t){return e!=e?t==t:e!==t||e&&"object"==_(e)||"function"==typeof e}function Ri(e,t){return Mi||(Mi=document.createElement("a")),Mi.href=t,e===Mi.href}function Li(e,t){e.appendChild(t)}function ji(e,t,n){e.insertBefore(t,n||null)}function Bi(e){e.parentNode.removeChild(e)}function Ui(e){return document.createElement(e)}function zi(e){return document.createTextNode(e)}function Fi(){return zi(" ")}function Gi(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Hi(e){return Array.from(e.childNodes)}function Vi(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Wi(e,t,n,r){null===n?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function Yi(e){Si=e}var Xi=[],Qi=[],Zi=[],qi=[],Ji=Promise.resolve(),Ki=!1;function $i(e){Zi.push(e)}var eo=new Set,to=0;function no(){var e=Si;do{for(;to7&&void 0!==arguments[7]?arguments[7]:[-1],u=Si;Yi(e);var l=e.$$={fragment:null,ctx:null,props:o,update:Ci,not_equal:i,bound:ki(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ki(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(l.root);var c=!1;if(l.ctx=n?n(e,t.props||{},(function(t,n){var r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=r)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](r),c&&so(e,t)),n})):[],l.update(),c=!0,Di(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){var h=Hi(t.target);l.fragment&&l.fragment.l(h),h.forEach(Bi)}else l.fragment&&l.fragment.c();t.intro&&oo(e.$$.fragment),ao(e,t.target,t.anchor,t.customElement),no()}Yi(u)}(c(r=t.call(this)),e,po,fo,Oi,{cursorName:0,tagName:1,backgroundColor:2,appliance:3,x:4,y:5,src:6,visible:19,avatar:7,theme:8,color:9,cursorTagBackgroundColor:10,opacity:11,pencilEraserSize:20}),r}return n}(uo),mo=function(){function e(t,n,r,i){var o=this;y(this,e),this.manager=t,this.memberId=n,this.cursorManager=r,this.wrapper=i,this.move=function(e){var t;if("main"===e.type){var n=o.cursorManager.wrapperRect;o.component&&n&&(o.autoHidden(),o.moveCursor(e,n,o.manager.mainView))}else{var r=o.cursorManager.focusView,i=null==(t=null==r?void 0:r.divElement)?void 0:t.getBoundingClientRect(),a=null==r?void 0:r.camera;r&&i&&a&&o.component&&(o.autoHidden(),o.moveCursor(e,i,r))}},this.leave=function(){o.hide()},this.updateMember(),this.createCursor(),this.autoHidden()}var t;return x(e,[{key:"moveCursor",value:function(e,t,n){var r,i,o=e.x,a=e.y,s=e.type,u=null==n?void 0:n.screen.convertPointToScreen(o,a);if(u){var l=u.x-2,c=u.y-18;if("app"===s){var h=this.cursorManager.wrapperRect;h&&(l=l+t.x-h.x,c=c+t.y-h.y)}u.x<0||u.x>t.width||u.y<0||u.y>t.height?null==(r=this.component)||r.$set({visible:!1,x:l,y:c}):null==(i=this.component)||i.$set({visible:!0,x:l,y:c})}}},{key:"autoHidden",value:function(){var e=this;this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout((function(){e.hide()}),1e4)}},{key:"createCursor",value:(t=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.member&&this.wrapper&&(this.component=new vo({target:this.wrapper,props:this.initProps()}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"initProps",value:function(){var e;return{x:0,y:0,appliance:this.memberApplianceName,avatar:this.memberAvatar,src:this.getIcon(),visible:!1,backgroundColor:this.memberColor,cursorName:this.memberCursorName,theme:this.memberTheme,color:this.memberCursorTextColor,cursorTagBackgroundColor:this.memberCursorTagBackgroundColor,opacity:this.memberOpacity,tagName:this.memberTagName,pencilEraserSize:null==(e=this.member)?void 0:e.memberState.pencilEraserSize}}},{key:"getIcon",value:function(){var e;if(this.member){var t=this.cursorManager.applianceIcons,n=t[B.ApplianceNames.shape];if(this.memberApplianceName===B.ApplianceNames.pencilEraser){var r=(null==(e=this.member)?void 0:e.memberState.pencilEraserSize)||1;n=t["".concat(this.memberApplianceName).concat(r)]}else n=t[this.memberApplianceName||B.ApplianceNames.shape];return n||t[B.ApplianceNames.shape]}}},{key:"updateMember",value:function(){return this.member=dt(this.manager.room,this.memberId),this.updateComponent(),this.member}},{key:"updateComponent",value:function(){var e;null==(e=this.component)||e.$set(j.omit(this.initProps(),["x","y"]))}},{key:"destroy",value:function(){this.component&&this.component.$destroy(),this.cursorManager.cursorInstances.delete(this.memberId),this.timer&&clearTimeout(this.timer)}},{key:"hide",value:function(){this.component&&(this.component.$set({visible:!1}),this.destroy())}},{key:"memberApplianceName",get:function(){var e,t;return null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.currentApplianceName}},{key:"memberColor",get:function(){var e,t;return"rgb(".concat(null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.strokeColor.join(","),")")}},{key:"payload",get:function(){var e;return null==(e=this.member)?void 0:e.payload}},{key:"memberCursorName",get:function(){var e,t;return(null==(e=this.payload)?void 0:e.nickName)||(null==(t=this.payload)?void 0:t.cursorName)||this.memberId}},{key:"memberTheme",get:function(){var e;return null!=(e=this.payload)&&e.theme?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}},{key:"memberCursorTextColor",get:function(){var e;return(null==(e=this.payload)?void 0:e.cursorTextColor)||"#FFFFFF"}},{key:"memberCursorTagBackgroundColor",get:function(){var e;return(null==(e=this.payload)?void 0:e.cursorTagBackgroundColor)||this.memberColor}},{key:"memberAvatar",get:function(){var e;return null==(e=this.payload)?void 0:e.avatar}},{key:"memberOpacity",get:function(){return this.memberCursorName||this.memberAvatar?1:0}},{key:"memberTagName",get:function(){var e;return null==(e=this.payload)?void 0:e.cursorTagName}}]),e}(),go=(w(r={},B.ApplianceNames.pencil,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg=="),w(r,B.ApplianceNames.selector,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg=="),w(r,B.ApplianceNames.eraser,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII="),w(r,B.ApplianceNames.shape,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"),w(r,B.ApplianceNames.text,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="),w(r,B.ApplianceNames.laserPointer,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"),w(r,"pencilEraser1","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMjYiIHZpZXdCb3g9IjAgMCAxOCAyNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIxNyIgaGVpZ2h0PSIyNSIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),w(r,"pencilEraser2","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjYiIGhlaWdodD0iMzQiIHZpZXdCb3g9IjAgMCAyNiAzNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIyNSIgaGVpZ2h0PSIzMyIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),w(r,"pencilEraser3","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iNTAiIHZpZXdCb3g9IjAgMCAzNCA1MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgeD0iMC41IiB5PSIwLjUiIHdpZHRoPSIzMyIgaGVpZ2h0PSI0OSIgcng9IjMuNSIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC4zNSIgc3Ryb2tlPSJ3aGl0ZSIvPgo8L3N2Zz4K"),r),yo=function(){function e(t,n,r){var i,o=this;y(this,e),this.manager=t,this.enableCursor=n,this.cursorInstances=new Map,this.sideEffectManager=new z.SideEffectManager,this.store=this.manager.store,this.applianceIcons=go,this.onCursorMove=function(e){var t=o.initCursorInstance(e.uid);if(e.state===ne.Leave)t.leave();else{var n=t.updateMember();o.canMoveCursor(n)&&t.move(e.position)}},this.initCursorInstance=function(e){var t=o.cursorInstances.get(e);return t||(t=new mo(o.manager,e,o,Ib.wrapper),o.cursorInstances.set(e,t)),t},this.mouseMoveListener_=function(e,t){var n=o.getType(e);o.updateCursor(n,e.clientX,e.clientY),t&&o.showPencilEraserIfNeeded(n,e.clientX,e.clientY)},this.mouseMoveTimer=0,this.mouseMoveListener=function(e){var t="touch"===e.pointerType;if(!t||e.isPrimary){var n=Date.now();n-o.mouseMoveTimer>48&&(o.mouseMoveTimer=n,o.mouseMoveListener_(e,t))}},this.mouseLeaveListener=function(){o.hideCursor(o.manager.uid)},this.getPoint=function(e,t,n){var r,i=null==(r=null==e?void 0:e.divElement)?void 0:r.getBoundingClientRect();if(i)return null==e?void 0:e.convertToPointInWorld({x:t-i.x,y:n-i.y})},this.getType=function(e){var t,n=e.target,r=o.manager.focusApp;switch(n.parentElement){case o.mainViewElement:return{type:"main"};case null==(t=null==r?void 0:r.view)?void 0:t.divElement:return{type:"app"};default:return{type:"main"}}},this.roomMembers=null==(i=this.manager.room)?void 0:i.state.roomMembers;var a=Ib.wrapper;a&&this.setupWrapper(a),this.sideEffectManager.add((function(){return ue.on("cursorMove",o.onCursorMove)})),this.sideEffectManager.add((function(){return ue.on("playgroundSizeChange",(function(){return o.updateContainerRect()}))})),r&&(this.applianceIcons=P(P({},go),r))}return x(e,[{key:"canMoveCursor",value:function(e){var t=(null==e?void 0:e.memberState.currentApplianceName)===B.ApplianceNames.laserPointer;return this.enableCursor||t}},{key:"setupWrapper",value:function(e){var t=this;this.sideEffectManager.add((function(){return e.addEventListener("pointerenter",t.mouseMoveListener),e.addEventListener("pointermove",t.mouseMoveListener),e.addEventListener("pointerleave",t.mouseLeaveListener),function(){e.removeEventListener("pointerenter",t.mouseMoveListener),e.removeEventListener("pointermove",t.mouseMoveListener),e.removeEventListener("pointerleave",t.mouseLeaveListener)}})),this.wrapperRect=e.getBoundingClientRect()}},{key:"setMainViewDivElement",value:function(e){this.mainViewElement=e}},{key:"showPencilEraserIfNeeded",value:function(e,t,n){var r=dt(this.manager.room,this.manager.uid),i=(null==r?void 0:r.memberState.currentApplianceName)===B.ApplianceNames.pencilEraser;if(this.wrapperRect&&this.manager.canOperate&&this.canMoveCursor(r)&&i){var o="main"===e.type?this.manager.mainView:this.focusView,a=this.getPoint(o,t,n);a&&this.onCursorMove({uid:this.manager.uid,position:{x:a.x,y:a.y,type:e.type}})}}},{key:"updateCursor",value:function(e,t,n){var r=dt(this.manager.room,this.manager.uid);if(this.wrapperRect&&this.manager.canOperate&&this.canMoveCursor(r)){var i="main"===e.type?this.manager.mainView:this.focusView,o=this.getPoint(i,t,n);o&&this.manager.dispatchInternalEvent(q.CursorMove,{uid:this.manager.uid,position:{x:o.x,y:o.y,type:e.type}})}}},{key:"updateContainerRect",value:function(){var e,t;this.containerRect=null==(e=Ib.container)?void 0:e.getBoundingClientRect(),this.wrapperRect=null==(t=Ib.wrapper)?void 0:t.getBoundingClientRect()}},{key:"deleteCursor",value:function(e){this.store.cleanCursor(e);var t=this.cursorInstances.get(e);t&&t.destroy()}},{key:"hideCursor",value:function(e){var t=this.cursorInstances.get(e);t&&t.hide()}},{key:"destroy",value:function(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach((function(e){e.destroy()})),this.cursorInstances.clear())}},{key:"boxState",get:function(){return this.store.getBoxState()}},{key:"focusView",get:function(){var e;return null==(e=this.manager.focusApp)?void 0:e.view}}]),e}(),bo=function(){function e(t){var n=this;y(this,e),this.manager=t,ue.on("changePageState",(function(){ae.emit("pageStateChange",n.toObject())}))}return x(e,[{key:"toObject",value:function(){return{index:this.index>=this.length?this.length-1:this.index,length:this.length}}},{key:"index",get:function(){return this.manager.store.getMainViewSceneIndex()||0}},{key:"length",get:function(){return this.manager.mainViewScenesLength||0}}]),e}(),xo=function(){function e(t){var n=this;y(this,e),this.ctx=t,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=function(){var e=g(regeneratorRuntime.mark((function e(t){var r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t===B.RoomPhase.Reconnecting&&n.ctx.emitter.emit("startReconnect"),e.t0=t===B.RoomPhase.Connected&&n.phase===B.RoomPhase.Reconnecting,!e.t0){e.next=10;break}if(null==(r=n.room)||!r.isWritable){e.next=7;break}null==(i=n.room)||i.dispatchMagixEvent(K,{}),e.next=10;break;case 7:return e.next=9,ke(500);case 9:n.onReconnected();case 10:n.phase=t;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onReconnected=j.debounce((function(){n._onReconnected()}),1e3),this._onReconnected=function(){tt("onReconnected refresh reactors"),n.releaseDisposers(),n.reactors.forEach((function(e,t){j.isFunction(e)&&n.disposers.set(t,e())})),n.ctx.emitter.emit("onReconnected")}}return x(e,[{key:"setRoom",value:function(e){var t=this;this.room=e,this.phase=null==e?void 0:e.phase,e&&(e.callbacks.off("onPhaseChanged",this.onPhaseChanged),e.callbacks.on("onPhaseChanged",this.onPhaseChanged),e.addMagixEventListener(K,(function(n){n.authorId===e.observerId&&t.onReconnected()}),{fireSelfEventAfterCommit:!0}))}},{key:"setContext",value:function(e){this.ctx=e}},{key:"releaseDisposers",value:function(){this.disposers.forEach((function(e){j.isFunction(e)&&e()})),this.disposers.clear()}},{key:"refresh",value:function(){this._onReconnected()}},{key:"add",value:function(e,t){var n=this.disposers.get(e);n&&j.isFunction(n)&&n(),j.isFunction(t)&&(this.reactors.set(e,t),this.disposers.set(e,t()))}},{key:"remove",value:function(e){this.reactors.has(e)&&this.reactors.delete(e);var t=this.disposers.get(e);t&&(j.isFunction(t)&&t(),this.disposers.delete(e))}},{key:"hasReactor",value:function(e){return this.reactors.has(e)}},{key:"destroy",value:function(){var e,t;null==(e=this.room)||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),null==(t=this.room)||t.removeMagixEventListener(K,this.onReconnected),this.releaseDisposers()}}]),e}(),_o=function(e,t){if(B.isPlayer(e))To(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get:function(){return t.mainView.disableCameraTransform},set:function(e){t.mainView.disableCameraTransform=e}}),Object.defineProperty(e,"canUndoSteps",{get:function(){return t.canUndoSteps}}),Object.defineProperty(e,"canRedoSteps",{get:function(){return t.canRedoSteps}}),e.moveCamera=function(e){return t.moveCamera(e)},e.moveCameraToContain=function(){return t.moveCameraToContain.apply(t,arguments)},e.convertToPointInWorld=function(){var e;return(e=t.mainView).convertToPointInWorld.apply(e,arguments)},e.setCameraBound=function(){var e;return(e=t.mainView).setCameraBound.apply(e,arguments)},e.scenePreview=function(){var e;return(e=t.mainView).scenePreview.apply(e,arguments)},e.fillSceneSnapshot=function(){var e;return(e=t.mainView).fillSceneSnapshot.apply(e,arguments)},e.generateScreenshot=function(){var e;return(e=t.mainView).generateScreenshot.apply(e,arguments)},e.setMemberState=function(){var e;return(e=t.mainView).setMemberState.apply(e,arguments)},e.redo=function(){return t.redo()},e.undo=function(){return t.undo()},e.cleanCurrentScene=function(){return t.cleanCurrentScene()},e.delete=function(){return t.delete()},e.copy=function(){return t.copy()},e.paste=function(){return t.paste()},e.duplicate=function(){return t.duplicate()},e.insertImage=function(){return t.insertImage.apply(t,arguments)},e.completeImageUpload=function(){return t.completeImageUpload.apply(t,arguments)},e.insertText=function(){return t.insertText.apply(t,arguments)},e.lockImage=function(){return t.lockImage.apply(t,arguments)},e.lockImages=function(){return t.lockImages.apply(t,arguments)},wo(e,t)}},wo=function(e,t){var n=e.removeScenes;e.removeScenes=function(r,i){var o;r===ie&&(null==(o=t.appManager)||o.updateRootDirRemoving(!0));var a=n.call(e,r);return ue.emit("removeScenes",{scenePath:r,index:i}),a}},To=function(e){var t=e.seekToProgressTime;function n(){return(n=g(regeneratorRuntime.mark((function n(r){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,ue.emit("seekStart");case 2:return n.next=4,t.call(e,r);case 4:return i=n.sent,n.abrupt("return",(ue.emit("seek",r),i));case 6:case"end":return n.stop()}}),n)})))).apply(this,arguments)}e.seekToProgressTime=function(e){return n.apply(this,arguments)}},Mo=Object.defineProperty,So=Object.defineProperties,Eo=Object.getOwnPropertyDescriptors,Ao=Object.getOwnPropertySymbols,Io=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,No=function(e,t,n){return t in e?Mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ko=function(e,t){for(var n in t||(t={}))Io.call(t,n)&&No(e,n,t[n]);if(Ao){var r,i=T(Ao(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Co.call(t,n)&&No(e,n,t[n])}}catch(e){i.e(e)}finally{i.f()}}return e},Do=function(e,t){return So(e,Eo(t))},Po=function(e,t,n,r){if("length"!==n&&"prototype"!==n&&"arguments"!==n&&"caller"!==n){var i=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);!Oo(i,o)&&r||Object.defineProperty(e,n,o)}},Oo=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Ro=function(e,t){var n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Lo=function(e,t){return"/* Wrapped ".concat(e,"*/\n").concat(t)},jo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Bo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Uo=function(e,t,n){var r=""===n?"":"with ".concat(n.trim(),"() "),i=Lo.bind(null,r,t.toString());Object.defineProperty(i,"name",Bo),Object.defineProperty(e,"toString",Do(ko({},jo),{value:i}))};function zo(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.ignoreNonConfigurable,o=void 0!==i&&i,a=e.name,s=T(Reflect.ownKeys(t));try{for(s.s();!(n=s.n()).done;){var u=n.value;Po(e,t,u,o)}}catch(e){s.e(e)}finally{s.f()}return Ro(e,t),Uo(e,t,a),e}var Fo=[],Go=function(){for(var e=0;e<20;e++)Fo[e]="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(87*Math.random());return Fo.join("")};function Ho(e){try{return e()}catch(e){console.error(e)}}var Vo=function(){function e(){y(this,e),this.push=this.addDisposer,this.disposers=new Map}return x(e,[{key:"addDisposer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.flush(t),this.disposers.set(t,Array.isArray(e)?Wo(e):e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID(),n=e();return n?this.addDisposer(n,t):t}},{key:"addEventListener",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.genUID();return e.addEventListener(t,n,r),this.addDisposer((function(){return e.removeEventListener(t,n,r)}),i),i}},{key:"setTimeout",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),i=window.setTimeout((function(){n.remove(r),e()}),t);return this.addDisposer((function(){return window.clearTimeout(i)}),r)}},{key:"setInterval",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.genUID(),r=window.setInterval(e,t);return this.addDisposer((function(){return window.clearInterval(r)}),n)}},{key:"remove",value:function(e){var t=this.disposers.get(e);return this.disposers.delete(e),t}},{key:"flush",value:function(e){var t=this.remove(e);t&&t()}},{key:"flushAll",value:function(){this.disposers.forEach(Ho),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=Go()}while(this.disposers.has(e));return e}}]),e}();function Wo(e){return function(){return e.forEach(Ho)}}var Yo,Xo=[],Qo="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Yo||(Yo={}));var Zo,qo=function(e){return Object.freeze(e)},Jo=function(e,t){this.inlineSize=e,this.blockSize=t,qo(this)},Ko=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,qo(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),$o=function(e){return e instanceof SVGElement&&"getBBox"in e},ea=function(e){if($o(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},ta=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},na="undefined"!=typeof window?window:{},ra=new WeakMap,ia=/auto|scroll/,oa=/^tb|vertical/,aa=/msie|trident/i.test(na.navigator&&na.navigator.userAgent),sa=function(e){return parseFloat(e||"0")},ua=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Jo((n?t:e)||0,(n?e:t)||0)},la=qo({devicePixelContentBoxSize:ua(),borderBoxSize:ua(),contentBoxSize:ua(),contentRect:new Ko(0,0,0,0)}),ca=function(e,t){if(void 0===t&&(t=!1),ra.has(e)&&!t)return ra.get(e);if(ea(e))return ra.set(e,la),la;var n=getComputedStyle(e),r=$o(e)&&e.ownerSVGElement&&e.getBBox(),i=!aa&&"border-box"===n.boxSizing,o=oa.test(n.writingMode||""),a=!r&&ia.test(n.overflowY||""),s=!r&&ia.test(n.overflowX||""),u=r?0:sa(n.paddingTop),l=r?0:sa(n.paddingRight),c=r?0:sa(n.paddingBottom),h=r?0:sa(n.paddingLeft),d=r?0:sa(n.borderTopWidth),f=r?0:sa(n.borderRightWidth),p=r?0:sa(n.borderBottomWidth),v=h+l,m=u+c,g=(r?0:sa(n.borderLeftWidth))+f,y=d+p,b=s?e.offsetHeight-y-e.clientHeight:0,x=a?e.offsetWidth-g-e.clientWidth:0,_=i?v+g:0,w=i?m+y:0,T=r?r.width:sa(n.width)-_-x,M=r?r.height:sa(n.height)-w-b,S=T+v+x+g,E=M+m+b+y,A=qo({devicePixelContentBoxSize:ua(Math.round(T*devicePixelRatio),Math.round(M*devicePixelRatio),o),borderBoxSize:ua(S,E,o),contentBoxSize:ua(T,M,o),contentRect:new Ko(h,u,T,M)});return ra.set(e,A),A},ha=function(e,t,n){var r=ca(e,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case Yo.DEVICE_PIXEL_CONTENT_BOX:return a;case Yo.BORDER_BOX:return i;default:return o}},da=function(e){var t=ca(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=qo([t.borderBoxSize]),this.contentBoxSize=qo([t.contentBoxSize]),this.devicePixelContentBoxSize=qo([t.devicePixelContentBoxSize])},fa=function(e){if(ea(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},pa=function(){var e=1/0,t=[];Xo.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new da(t.target),i=fa(t.target);r.push(n),t.lastReportedSize=ha(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},ma=function(){var e=0;for(va(e);Xo.some((function(e){return e.activeTargets.length>0}));)e=pa(),va(e);return Xo.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Qo}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Qo),window.dispatchEvent(e)}(),e>0},ga=[],ya=function(e){if(!Zo){var t=0,n=document.createTextNode("");new MutationObserver((function(){return ga.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Zo=function(){n.textContent="".concat(t?t--:t++)}}ga.push(e),Zo()},ba=0,xa={attributes:!0,characterData:!0,childList:!0,subtree:!0},_a=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],wa=function(e){return void 0===e&&(e=0),Date.now()+e},Ta=!1,Ma=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!Ta){Ta=!0;var n=wa(e);!function(e){ya((function(){requestAnimationFrame(e)}))}((function(){var r=!1;try{r=ma()}finally{if(Ta=!1,e=n-wa(),!ba)return;r?t.run(1e3):e>0?t.run(e):t.start()}}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,xa)};document.body?t():na.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),_a.forEach((function(t){return na.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),_a.forEach((function(t){return na.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}(),Sa=new Ma,Ea=function(e){!ba&&e>0&&Sa.start(),!(ba+=e)&&Sa.stop()},Aa=function(){function e(e,t){this.target=e,this.observedBox=t||Yo.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=ha(this.target,this.observedBox,!0);return function(e){return!$o(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),Ia=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Ca=new WeakMap,Na=function(e,t){for(var n=0;n=0&&(i&&Xo.splice(Xo.indexOf(n),1),n.observationTargets.splice(r,1),Ea(-1))},e.disconnect=function(e){var t=this,n=Ca.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Da=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ka.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ta(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ka.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ta(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ka.unobserve(this,e)},e.prototype.disconnect=function(){ka.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var Pa="undefined"!=typeof window,Oa=Pa&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Ra=Pa&&"IntersectionObserver"in window,La=Pa&&"classList"in document.createElement("p"),ja=Pa&&window.devicePixelRatio>1,Ba={elements_selector:".lazy",container:Oa||Pa?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Ua=function(e){return Object.assign({},Ba,e)},za=function(e,t){var n,r="LazyLoad::Initialized",i=new e(t);try{n=new CustomEvent(r,{detail:{instance:i}})}catch(e){(n=document.createEvent("CustomEvent")).initCustomEvent(r,!1,!1,{instance:i})}window.dispatchEvent(n)},Fa="src",Ga="srcset",Ha="sizes",Va="poster",Wa="llOriginalAttrs",Ya="data",Xa="loading",Qa="loaded",Za="applied",qa="error",Ja="native",Ka="data-",$a="ll-status",es=function(e,t){return e.getAttribute(Ka+t)},ts=function(e){return es(e,$a)},ns=function(e,t){return function(e,t,n){var r=Ka+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)}(e,$a,t)},rs=function(e){return ns(e,null)},is=function(e){return null===ts(e)},os=function(e){return ts(e)===Ja},as=[Xa,Qa,Za,qa],ss=function(e,t,n,r){if(e){if(void 0!==r)return void e(t,n,r);if(void 0!==n)return void e(t,n);e(t)}},us=function(e,t){La?e.classList.add(t):e.className+=(e.className?" ":"")+t},ls=function(e,t){La?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},cs=function(e){return e.llTempImage},hs=function(e,t){if(t){var n=t._observer;!n||n.unobserve(e)}},ds=function(e,t){!e||(e.loadingCount+=t)},fs=function(e,t){!e||(e.toLoadCount=t)},ps=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},vs=function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&ps(n).forEach(t)},ms=function(e,t){ps(e).forEach(t)},gs=[Fa],ys=[Fa,Va],bs=[Fa,Ga,Ha],xs=[Ya],_s=function(e){return!!e[Wa]},ws=function(e){return e[Wa]},Ts=function(e){return delete e[Wa]},Ms=function(e,t){if(!_s(e)){var n={};t.forEach((function(t){n[t]=e.getAttribute(t)})),e[Wa]=n}},Ss=function(e,t){if(_s(e)){var n=ws(e);t.forEach((function(t){!function(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}(e,t,n[t])}))}},Es=function(e,t,n){us(e,t.class_applied),ns(e,Za),n&&(t.unobserve_completed&&hs(e,t),ss(t.callback_applied,e,n))},As=function(e,t,n){us(e,t.class_loading),ns(e,Xa),n&&(ds(n,1),ss(t.callback_loading,e,n))},Is=function(e,t,n){!n||e.setAttribute(t,n)},Cs=function(e,t){Is(e,Ha,es(e,t.data_sizes)),Is(e,Ga,es(e,t.data_srcset)),Is(e,Fa,es(e,t.data_src))},Ns={IMG:function(e,t){vs(e,(function(e){Ms(e,bs),Cs(e,t)})),Ms(e,bs),Cs(e,t)},IFRAME:function(e,t){Ms(e,gs),Is(e,Fa,es(e,t.data_src))},VIDEO:function(e,t){ms(e,(function(e){Ms(e,gs),Is(e,Fa,es(e,t.data_src))})),Ms(e,ys),Is(e,Va,es(e,t.data_poster)),Is(e,Fa,es(e,t.data_src)),e.load()},OBJECT:function(e,t){Ms(e,xs),Is(e,Ya,es(e,t.data_src))}},ks=["IMG","IFRAME","VIDEO","OBJECT"],Ds=function(e,t){t&&!function(e){return e.loadingCount>0}(t)&&!function(e){return e.toLoadCount>0}(t)&&ss(e.callback_finish,t)},Ps=function(e,t,n){e.addEventListener(t,n),e.llEvLisnrs[t]=n},Os=function(e,t,n){e.removeEventListener(t,n)},Rs=function(e){return!!e.llEvLisnrs},Ls=function(e){if(Rs(e)){var t=e.llEvLisnrs;for(var n in t){var r=t[n];Os(e,n,r)}delete e.llEvLisnrs}},js=function(e,t,n){(function(e){delete e.llTempImage})(e),ds(n,-1),function(e){!e||(e.toLoadCount-=1)}(n),ls(e,t.class_loading),t.unobserve_completed&&hs(e,n)},Bs=function(e,t,n){var r=cs(e)||e;Rs(r)||function(e,t,n){Rs(e)||(e.llEvLisnrs={});var r="VIDEO"===e.tagName?"loadeddata":"load";Ps(e,r,t),Ps(e,"error",n)}(r,(function(i){(function(e,t,n,r){var i=os(t);js(t,n,r),us(t,n.class_loaded),ns(t,Qa),ss(n.callback_loaded,t,r),i||Ds(n,r)})(0,e,t,n),Ls(r)}),(function(i){(function(e,t,n,r){var i=os(t);js(t,n,r),us(t,n.class_error),ns(t,qa),ss(n.callback_error,t,r),n.restore_on_error&&Ss(t,bs),i||Ds(n,r)})(0,e,t,n),Ls(r)}))},Us=function(e,t,n){(function(e){e.llTempImage=document.createElement("IMG")})(e),Bs(e,t,n),function(e){_s(e)||(e[Wa]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,n){var r=es(e,t.data_bg),i=es(e,t.data_bg_hidpi),o=ja&&i?i:r;!o||(e.style.backgroundImage='url("'.concat(o,'")'),cs(e).setAttribute(Fa,o),As(e,t,n))}(e,t,n),function(e,t,n){var r=es(e,t.data_bg_multi),i=es(e,t.data_bg_multi_hidpi),o=ja&&i?i:r;!o||(e.style.backgroundImage=o,Es(e,t,n))}(e,t,n),function(e,t,n){var r=es(e,t.data_bg_set);if(r){var i=r.split("|"),o=i.map((function(e){return"image-set(".concat(e,")")}));e.style.backgroundImage=o.join(),""===e.style.backgroundImage&&(o=i.map((function(e){return"-webkit-image-set(".concat(e,")")})),e.style.backgroundImage=o.join()),Es(e,t,n)}}(e,t,n)},zs=function(e,t,n){Bs(e,t,n),function(e,t,n){var r=Ns[e.tagName];!r||(r(e,t),As(e,t,n))}(e,t,n)},Fs=function(e,t,n){!function(e){return ks.indexOf(e.tagName)>-1}(e)?Us(e,t,n):zs(e,t,n)},Gs=function(e,t,n){e.setAttribute("loading","lazy"),Bs(e,t,n),function(e,t){var n=Ns[e.tagName];!n||n(e,t)}(e,t),ns(e,Ja)},Hs=function(e){e.removeAttribute(Fa),e.removeAttribute(Ga),e.removeAttribute(Ha)},Vs=function(e){vs(e,(function(e){Ss(e,bs)})),Ss(e,bs)},Ws={IMG:Vs,IFRAME:function(e){Ss(e,gs)},VIDEO:function(e){ms(e,(function(e){Ss(e,gs)})),Ss(e,ys),e.load()},OBJECT:function(e){Ss(e,xs)}},Ys=function(e){var t=Ws[e.tagName];t?t(e):function(e){if(_s(e)){var t=ws(e);e.style.backgroundImage=t.backgroundImage}}(e)},Xs=function(e,t){Ys(e),function(e,t){is(e)||os(e)||(ls(e,t.class_entered),ls(e,t.class_exited),ls(e,t.class_applied),ls(e,t.class_loading),ls(e,t.class_loaded),ls(e,t.class_error))}(e,t),rs(e),Ts(e)},Qs=function(e,t,n,r){!n.cancel_on_exit||!function(e){return ts(e)===Xa}(e)||"IMG"===e.tagName&&(Ls(e),function(e){vs(e,(function(e){Hs(e)})),Hs(e)}(e),Vs(e),ls(e,n.class_loading),ds(r,-1),rs(e),ss(n.callback_cancel,e,t,r))},Zs=function(e,t,n,r){var i=function(e){return as.indexOf(ts(e))>=0}(e);ns(e,"entered"),us(e,n.class_entered),ls(e,n.class_exited),function(e,t,n){t.unobserve_entered&&hs(e,n)}(e,n,r),ss(n.callback_enter,e,t,r),!i&&Fs(e,n,r)},qs=["IMG","IFRAME","VIDEO"],Js=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},Ks=function(e,t,n){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Zs(e.target,e,t,n):function(e,t,n,r){is(e)||(us(e,n.class_exited),Qs(e,t,n,r),ss(n.callback_exit,e,t,r))}(e.target,e,t,n)}))},$s=function(e,t){!Ra||Js(e)||(t._observer=new IntersectionObserver((function(n){Ks(n,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},eu=function(e){return Array.prototype.slice.call(e)},tu=function(e){return e.container.querySelectorAll(e.elements_selector)},nu=function(e){return function(e){return ts(e)===qa}(e)},ru=function(e,t){return function(e){return eu(e).filter(is)}(e||tu(t))},iu=function(e,t){(function(e){return eu(e).filter(nu)})(tu(e)).forEach((function(t){ls(t,e.class_error),rs(t)})),t.update()},ou=function(e,t){var n=Ua(e);this._settings=n,this.loadingCount=0,$s(n,this),function(e,t){!Pa||(t._onlineHandler=function(){iu(e,t)},window.addEventListener("online",t._onlineHandler))}(n,this),this.update(t)};ou.prototype={update:function(e){var t=this._settings,n=ru(e,t);fs(this,n.length),!Oa&&Ra?Js(t)?function(e,t,n){e.forEach((function(e){-1!==qs.indexOf(e.tagName)&&Gs(e,t,n)})),fs(n,0)}(n,t,this):function(e,t){(function(e){e.disconnect()})(e),function(e,t){t.forEach((function(t){e.observe(t)}))}(e,t)}(this._observer,n):this.loadAll(n)},destroy:function(){this._observer&&this._observer.disconnect(),function(e){!Pa||window.removeEventListener("online",e._onlineHandler)}(this),tu(this._settings).forEach((function(e){Ts(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){var t=this,n=this._settings;ru(e,n).forEach((function(e){hs(e,t),Fs(e,n,t)}))},restoreAll:function(){var e=this._settings;tu(e).forEach((function(t){Xs(t,e)}))}},ou.load=function(e,t){var n=Ua(t);Fs(e,n)},ou.resetStatus=function(e){rs(e)},Pa&&function(e,t){if(t)if(t.length)for(var n,r=0;n=t[r];r+=1)za(e,n);else za(e,t)}(ou,window.lazyLoadOptions);var au=function(){function e(t){var n=t.readonly,r=t.box,i=t.pages,o=t.onNewPageIndex,a=t.onPlay;if(y(this,e),this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Vo,i.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=n,this.box=r,this.pages=i,this.onNewPageIndex=o,this.onPlay=a,this.onPageIndexChanged=function(){},this.render()}return x(e,[{key:"mount",value:function(){var e=this;this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add((function(){var t=new ou({container:e.$preview,elements_selector:".".concat(e.wrapClassName("preview-page>img"))});return function(){return t.destroy()}}),"preview-lazyload")}},{key:"unmount",value:function(){this.$content.remove(),this.$footer.remove()}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e)}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount()}},{key:"setPageIndex",value:function(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1),this.onPageIndexChanged(e))}},{key:"setSmallBox",value:function(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}},{key:"render",value:function(){return this.renderContent(),this.renderFooter(),this.$content}},{key:"renderContent",value:function(){if(!this.$content){var e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}},{key:"renderPreview",value:function(){var e=this;if(!this.$preview){var t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t;var n=this.wrapClassName("preview-page"),r=this.wrapClassName("preview-page-name");this.pages.forEach((function(i,o){var a,s=null!=(a=i.thumbnail)?a:i.src.startsWith("ppt")?void 0:i.src;if(s){var u=String(o),l=document.createElement("a");l.className=n+" "+e.wrapClassName("preview-page-".concat(o)),l.setAttribute("href","#"),l.dataset.pageIndex=u;var c=document.createElement("span");c.className=r,c.textContent=String(o+1),c.dataset.pageIndex=u;var h=document.createElement("img");h.width=i.width,h.height=i.height,h.dataset.src=s,h.dataset.pageIndex=u,l.appendChild(h),l.appendChild(c),t.appendChild(l)}})),this.sideEffect.addEventListener(t,"click",(function(t){var n;if(!e.readonly){var r=null==(n=t.target.dataset)?void 0:n.pageIndex;r&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e.onNewPageIndex(Number(r)),e.togglePreview(!1))}}))}return this.$preview}},{key:"renderPreviewMask",value:function(){var e=this;return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",(function(t){e.readonly||t.target===e.$previewMask&&e.togglePreview(!1)}))),this.$previewMask}},{key:"renderFooter",value:function(){var e=this;if(!this.$footer){var t=document.createElement("div");if(t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer")),this.pages.some((function(e){return e.thumbnail||!e.src.startsWith("ppt")}))){var n=this.renderFooterBtn("btn-sidebar",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-sidebar")),n.setAttribute("viewBox","0 0 64 64");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(n,"click",(function(){e.readonly||e.togglePreview()})),this.$footer.appendChild(n)}var r=document.createElement("div");r.className=this.wrapClassName("page-jumps");var i=this.renderFooterBtn("btn-page-back",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-arrow-left")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),n.appendChild(r),n}(this.namespace));if(this.sideEffect.addEventListener(i,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex-1)})),r.appendChild(i),this.onPlay){var o=this.renderFooterBtn("btn-page-play",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-play")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),n.appendChild(r),n}(this.namespace),function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-pause")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(o,"click",(function(){e.readonly||(o.classList.toggle(e.wrapClassName("footer-btn-playing"),!0),e.onPlay&&e.onPlay(),e.sideEffect.setTimeout((function(){o.classList.toggle(e.wrapClassName("footer-btn-playing"),!1)}),500,"returnPlay"))})),r.appendChild(o)}var a=this.renderFooterBtn("btn-page-next",function(e){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class","".concat(e,"-footer-icon-arrow-right")),n.setAttribute("viewBox","0 0 500 500");var r=document.createElementNS(t,"path");return r.setAttribute("fill","currentColor"),r.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),n.appendChild(r),n}(this.namespace));this.sideEffect.addEventListener(a,"click",(function(){e.readonly||e.onNewPageIndex(e.pageIndex+1)})),r.appendChild(a);var s=document.createElement("div");s.className=this.wrapClassName("page-number");var u=document.createElement("input");u.className=this.wrapClassName("page-number-input"),u.value=String(this.pageIndex+1),this.readonly&&(u.disabled=!0),this.$pageNumberInput=u,this.sideEffect.addEventListener(u,"focus",(function(){u.select()})),this.sideEffect.addEventListener(u,"change",(function(){e.readonly||u.value&&e.onNewPageIndex(Number(u.value)-1)}));var l=document.createElement("span");l.textContent=" / "+this.pages.length,s.appendChild(u),s.appendChild(l),this.$footer.appendChild(r),this.$footer.appendChild(s)}return this.$footer}},{key:"renderFooterBtn",value:function(e,t,n){var r=document.createElement("button");return r.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),r.appendChild(t),n&&r.appendChild(n),r}},{key:"togglePreview",value:function(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){var t=this.$preview.querySelector("."+this.wrapClassName("preview-page-".concat(this.pageIndex)));t&&this.$preview.scrollTo({top:t.offsetTop-16})}}},{key:"wrapClassName",value:function(e){return"".concat(this.namespace,"-").concat(e)}}]),e}();function su(e,t,n){return Math.min(Math.max(e,t),n)}function uu(e){return e.touches?e.touches[0]:e}function lu(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function cu(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}var hu=function(){function e(t){var n,r,i,o=this;y(this,e),this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=function(e){if(!o.paused){var t=Math.floor((e-o._loopTimestamp)/1e3*60)+1;for(o._loopTimestamp=e;t-- >0;)o.stepper();o.onStep(o.current,o),!o.paused&&o.current!==o.target&&window.requestAnimationFrame(o.looper)}},this.current=null!=(n=t.start)?n:0,this.target=this.current,this.stiffness=null!=(r=t.stiffness)?r:170,this.damping=null!=(i=t.damping)?i:26,this.onStep=t.onStep}return x(e,[{key:"stepTo",value:function(e,t){this.paused&&null!=t&&(this.current=t),this.paused=!1,this.target=e,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}},{key:"pause",value:function(){this.paused=!0}},{key:"destroy",value:function(){this.pause()}},{key:"stepper",value:function(){var e=-this.stiffness*(this.current-this.target),t=-this.damping*this.velocity,n=this.velocity+(e+t)/60,r=this.current+n/60;Math.abs(n-0)<.01&&Math.abs(r-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=r,this.velocity=n)}}]),e}(),du=function(){function e(t,n,r,i){y(this,e),this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=t,this.page=n,this.scale=r,this.pageOffsetX=(i-n.width)/2;var o=document.createElement("div");o.className="page-renderer-page",o.dataset.index="".concat(t),o.style.width="".concat(n.width*r,"px"),o.style.height="".concat(n.height*r,"px"),n.thumbnail&&(o.style.backgroundImage='url("'.concat(n.thumbnail,'")'));var a=document.createElement("img");a.className="page-renderer-page-img",a.width=n.width,a.height=n.height,a.src=n.src,o.appendChild(a),this.$page=o}return x(e,[{key:"translateY",value:function(e){Math.abs(e-this.pageOffsetY)>=.001&&(this.pageOffsetY=e,this.$page.style.transform="translate(".concat(this.pageOffsetX*this.scale,"px, ").concat(this.pageOffsetY*this.scale,"px)"))}},{key:"setScale",value:function(e){Math.abs(e-this.scale)>=.001&&(this.scale=e,this.$page.style.width="".concat(this.page.width*this.scale,"px"),this.$page.style.height="".concat(this.page.height*this.scale,"px"),this.$page.style.transform="translate(".concat(this.pageOffsetX*this.scale,"px, ").concat(this.pageOffsetY*this.scale,"px)"))}},{key:"setVisible",value:function(e){e!==this.visible&&(this.visible=e,this.$page.style.opacity=e?"1":"0")}}]),e}(),fu=window.requestIdleCallback||function(e){return window.setTimeout(e,5e3)},pu=window.cancelIdleCallback||window.clearTimeout,vu=function(){function e(t,n,r){var i=this;y(this,e),this.pages=t,this.pagesIntrinsicWidth=n,this.scale=r,this.els=new Map,this.maxElCount=200,this.gcTimer=null,this.gc=function(){if(i.gcTimer=null,i.els.size>i.maxElCount)for(var e=a(i.els.values()).sort((function(e,t){return t.lastVisit-e.lastVisit})),t=Math.floor(i.maxElCount/4);tthis.maxElCount&&null===this.gcTimer&&(this.gcTimer=fu(this.gc)),t}},{key:"setScale",value:function(e){e!==this.scale&&(this.scale=e,this.els.forEach((function(t){return t.setScale(e)})))}},{key:"destroy",value:function(){this.els.clear(),null!==this.gcTimer&&(pu(this.gcTimer),this.gcTimer=null)}}]),e}(),mu=function(){function e(t){var n=this;y(this,e),this._hwaTimeout=NaN,this._turnOffHWA=function(){window.clearTimeout(n._hwaTimeout),n._hwaTimeout=NaN,n.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pages=t.pages.map((function(e){if(e.thumbnail)return e;try{var t=new URL(e.src);return t.searchParams.set("x-oss-process","image/resize,l_50"),Do(ko({},e),{thumbnail:t.toString()})}catch(t){return console.error(t),e}}));var r=Array(this.pages.length),i=1/0,o=0;this.pagesIntrinsicHeight=this.pages.reduce((function(e,t,n){return r[n]=e,t.width>o&&(o=t.width),t.height<=i&&(i=t.height),e+t.height}),0),this.pagesIntrinsicWidth=o,this.pagesMinHeight=i,this.pagesIntrinsicYs=r,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=t.onPageIndexChanged,this.pageScrollIndex=0,0!==this.pagesScrollTop&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new vu(this.pages,o,this.scale),this.$pages=this.renderPages()}return x(e,[{key:"setContainerSize",value:function(e,t){e>0&&t>0&&(e!==this.containerWidth||t!==this.containerHeight)&&(this.containerWidth=e,this.containerHeight=t,this.$pages.style.width="".concat(this.containerWidth,"px"),this.$pages.style.height="".concat(this.containerHeight,"px"),this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.pageElManager.setScale(this.scale),this.$pages.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}},{key:"renderPages",value:function(){var e=document.createElement("div");return e.className="page-renderer-pages-container",e.style.width="".concat(this.containerWidth,"px"),e.style.height="".concat(this.containerHeight,"px"),e}},{key:"pagesScrollTo",value:function(e,t){if(e=su(e,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=e;for(var n=this.findScrollPageIndex(),r=Math.max(n-this.threshold,0),i=Math.min(n+this.threshold,this.pages.length-1),o=0;o=r&&s<=i||(a.remove(),o--)}for(var u=r;u<=i;u++){var l=this.pageElManager.getEl(u);l.$page.parentElement!==this.$pages&&this.$pages.appendChild(l.$page),l.translateY(this.pagesIntrinsicYs[u]-this.pagesScrollTop)}n!==this.pageScrollIndex&&(this.pageScrollIndex=n,this.onPageIndexChanged&&this.onPageIndexChanged(n))}}},{key:"findScrollPageIndex",value:function(){for(var e=0;e=.001)return e;return this.pagesIntrinsicYs.length-1}},{key:"mount",value:function(e){e.appendChild(this.$pages),this.pagesScrollTo(this.pagesScrollTop,!0)}},{key:"unmount",value:function(){this.$pages.remove()}},{key:"destroy",value:function(){this.unmount(),this.onPageIndexChanged=void 0,this.pageElManager.destroy(),this._hwaTimeout&&(window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN)}},{key:"_calcScale",value:function(){return this.containerWidth/this.pagesIntrinsicWidth||1}},{key:"_calcThreshold",value:function(){return su(Math.ceil(this.containerHeight/this.scale/this.pagesMinHeight/2),1,this.pages.length)}},{key:"_turnOnHWA",value:function(){this._hwaTimeout?window.clearTimeout(this._hwaTimeout):this.$pages.classList.toggle("is-hwa",!0),this._hwaTimeout=window.setTimeout(this._turnOffHWA,1e3)}}]),e}(),gu=function(){function e(t){y(this,e),this.sideEffect=new Vo,this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pagesWidth=t.pagesWidth||1,this.pagesHeight=t.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=t.scrollbarMinHeight||30,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=t.readonly,this.wrapClassName=t.wrapClassName,this.onDragScroll=t.onDragScroll,this.$scrollbar=this.renderScrollbar()}return x(e,[{key:"mount",value:function(e){e.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}},{key:"unmount",value:function(){this.$scrollbar.remove()}},{key:"setReadonly",value:function(e){this.readonly=e}},{key:"setContainerSize",value:function(e,t){e>0&&t>0&&(e!==this.containerWidth||t!==this.containerHeight)&&(this.containerWidth=e,this.containerHeight=t,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}},{key:"pagesScrollTo",value:function(e,t){var n=this;if(e=su(e,0,this.pagesHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this.pagesScrollTop=e;var r=this.pagesScrollTop*this.scale/(this.pagesHeight*this.scale-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame((function(){n.$scrollbar.style.transform="translateY(".concat(r,"px)")})):this.$scrollbar.style.transform="translateY(".concat(r,"px)")}}},{key:"destroy",value:function(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}},{key:"renderScrollbar",value:function(){var e=this,t=document.createElement("button");t.className=this.wrapClassName("scrollbar"),t.style.minHeight="".concat(this.scrollbarMinHeight,"px"),t.style.height="".concat(this.scrollbarHeight,"px");var n=function(n){if(!(e.readonly||null!=n.button&&0!==n.button)){lu(n);var r=e.wrapClassName("scrollbar-dragging");t.classList.toggle(r,!0);var i=e.pagesScrollTop,o=uu(n).clientY,a=function(t){if(!e.readonly){var n=(uu(t).clientY-o)/e.scale;Math.abs(n)>0&&e.onDragScroll&&e.onDragScroll(i+n*(e.pagesHeight*e.scale/e.containerHeight))}},s=function e(){t.classList.toggle(r,!1),window.removeEventListener("mousemove",a,!0),window.removeEventListener("touchmove",a,!0),window.removeEventListener("mouseup",e,!0),window.removeEventListener("touchend",e,!0),window.removeEventListener("touchcancel",e,!0)};window.addEventListener("mousemove",a,!0),window.addEventListener("touchmove",a,!0),window.addEventListener("mouseup",s,!0),window.addEventListener("touchend",s,!0),window.addEventListener("touchcancel",s,!0)}};return this.sideEffect.addEventListener(t,"mousedown",n),this.sideEffect.addEventListener(t,"touchstart",n),t}},{key:"_calcScale",value:function(){return this.containerWidth/this.pagesWidth||1}},{key:"_calcScrollbarHeight",value:function(){return su(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}},{key:"_updateScrollbarHeight",value:function(){var e=this._calcScrollbarHeight();Math.abs(e-this.scrollbarHeight)>.001&&(this.scrollbarHeight=e,this.$scrollbar.style.height="".concat(e,"px"))}}]),e}(),yu=window.ResizeObserver||Da,bu=640,xu=function(){function e(t){var r=this,i=t.whiteboardView,a=t.readonly,s=t.box,u=t.pages,l=t.pageScrollTop,c=void 0===l?0:l,h=t.mountWhiteboard,d=t.onUserScroll,f=t.baseScenePath,p=t.appId;y(this,e),this.sideEffect=new Vo,this.userScrolling=!1,this.onNewPageIndex=function(e){r.scrollToPage(e)},this.toPdf=g(regeneratorRuntime.mark((function e(){var t,i,a,s,u,l,c,h,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.createElement("canvas"),(i=t.getContext("2d"))&&r.baseScenePath){e.next=4;break}return r.reportProgress(100,null),e.abrupt("return");case 4:return a=r.whiteboardView.focusScenePath||"".concat(r.baseScenePath,"/1"),s=r.pages[0],e.next=8,Promise.resolve().then((function(){return V(n(88877))}));case 8:u=e.sent,l=u.jsPDF,c=new l({format:[s.width,s.height],orientation:s.width>s.height?"l":"p",compress:!0}),h=T(r.pages.entries()),e.prev=12,f=regeneratorRuntime.mark((function e(){var n,s,u,l,h,f,p,v,m,g,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o(d.value,2),s=n[0],u=n[1],l=u.width,h=u.height,f=u.src,t.width=l,t.height=h,p=l>h?"l":"p",s>0&&c.addPage([l,h],p),e.next=7,r.getBase64FromUrl(f);case 7:return v=e.sent,(m=document.createElement("img")).src=v,e.next=12,new Promise((function(e){return m.onload=e}));case 12:i.drawImage(m,0,0),g=t.toDataURL("image/jpeg",.6),i.clearRect(0,0,l,h),r.whiteboardView.screenshotToCanvas(i,a,l,h,{centerX:l/2,centerY:h/2+s*h,scale:1}),y=t.toDataURL("image/png"),c.addImage(g,"JPEG",0,0,l,h,"","FAST"),c.addImage(y,"PNG",0,0,l,h,"","FAST"),i.clearRect(0,0,l,h),Math.ceil((s+1)/r.pages.length*100)<100&&r.reportProgress(Math.ceil((s+1)/r.pages.length*100),null);case 17:case"end":return e.stop()}}),e)})),h.s();case 15:if((d=h.n()).done){e.next=19;break}return e.delegateYield(f(),"t0",17);case 17:e.next=15;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(12),h.e(e.t1);case 24:return e.prev=24,h.f(),e.finish(24);case 27:p=c.output("arraybuffer"),r.reportProgress(100,{pdf:p,title:r.box.title});case 29:case"end":return e.stop()}}),e,null,[[12,21,24,27]])}))),this.whiteboardView=i,this.readonly=a,this.box=s,this.pages=u,this.baseScenePath=f,this.appId=p,this.mountWhiteboard=h,this._onUserScroll=d;var v=this.debounce((function(){r.userScrolling=!1,r._onUserScroll&&r._onUserScroll(r.pageRenderer.pagesScrollTop)}),{wait:80},"debounce-updateUserScroll");this.updateUserScroll=function(){r.userScrolling=!0,v()},this.viewer=new au({readonly:a,box:s,pages:u,onNewPageIndex:this.onNewPageIndex});var m=this.whiteboardView.size,b=m.width,x=m.height;this.pageRenderer=new mu({pagesScrollTop:c,pages:this.pages,containerWidth:b,containerHeight:x,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new gu({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:b,containerHeight:x,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:function(e){r.pageScrollTo(e),r.updateUserScroll()}}),this.pageScrollStepper=new hu({start:this.pageRenderer.pagesScrollTop,onStep:function(e){r.pageScrollTo(e)}}),this.render()}var t;return x(e,[{key:"mount",value:function(){var e=this;this.viewer.mount(),this.setupScrollListener();var t=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add((function(){var n=new yu(t);return n.observe(e.viewer.$content),function(){return n.disconnect()}})),this.sideEffect.setTimeout((function(){e.userScrolling||e.pageScrollTo(e.pageRenderer.pagesScrollTop)}),100),this.sideEffect.add((function(){var t=function(t){"@netless/_request_save_pdf_"===t.data.type&&t.data.appId===e.appId&&e.toPdf().catch((function(){return e.reportProgress(100,null)}))};return window.addEventListener("message",t),function(){window.removeEventListener("message",t)}})),this}},{key:"unmount",value:function(){return this.viewer.unmount(),this}},{key:"setReadonly",value:function(e){this.readonly!==e&&(this.readonly=e,this.viewer.setReadonly(e),this.scrollbar.setReadonly(e))}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}},{key:"syncPageScrollTop",value:function(e){!this.userScrolling&&e>=0&&Math.abs(this.pageRenderer.pagesScrollTop-e)>.01&&this.pageScrollStepper.stepTo(e,this.pageRenderer.pagesScrollTop)}},{key:"render",value:function(){this.pageRenderer.mount(this.viewer.$content),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.scrollbar.mount(this.viewer.$content),this.renderRatioHeight()}},{key:"renderRatioHeight",value:function(){var e=this.box.absoluteHeight,t=e<=bu;if(this.viewer.setSmallBox(t),t){var n=26/e,r=Math.max((.08125-(n+0))/2,0);if(this.box.$titleBar){var i=n+r;this.box.$titleBar.style.height="".concat(100*i,"%")}if(this.box.$footer){var o=0+r;this.box.$footer.style.height="".concat(100*o,"%")}}else{if(this.box.$titleBar){var a=Math.max(26/bu,26/e);this.box.$titleBar.style.height="".concat(100*a,"%")}if(this.box.$footer){var s=Math.max(26/bu,26/e);this.box.$footer.style.height="".concat(100*s,"%")}}}},{key:"renderWhiteboardView",value:function(){var e=this;return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView),this.sideEffect.addEventListener(this.$whiteboardView,"wheel",(function(t){lu(t),e.readonly||(e.pageScrollTo(e.pageRenderer.pagesScrollTop+t.deltaY),e.updateUserScroll())}),{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",(function(t){e.readonly||t.touches.length<=1||e.updateUserScroll()}),{passive:!0,capture:!0})),this.$whiteboardView}},{key:"scrollTopPageToEl",value:function(e){return e*this.pageRenderer.scale}},{key:"scrollTopElToPage",value:function(e){return e/this.pageRenderer.scale}},{key:"elScrollTo",value:function(e){this.pageScrollTo(this.scrollTopElToPage(e))}},{key:"pageScrollTo",value:function(e){var t=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:su(e+t,t,this.pageRenderer.pagesIntrinsicHeight-t),animationMode:"immediately"})}},{key:"scrollToPage",value:function(e){if(!this.readonly&&!Number.isNaN(e)){var t=this.pageRenderer.pagesIntrinsicYs[e];t>=0&&(this.pageScrollTo(t+5/this.pageRenderer.scale),this.updateUserScroll())}}},{key:"setupScrollListener",value:function(){var e=this;this.sideEffect.add((function(){var t=function(t){var n=e.whiteboardView.size,r=n.width,i=n.height;if(!(r<=0||i<=0)){var o=t.centerY-e.pageRenderer.containerHeight/e.pageRenderer.scale/2;e.pageRenderer.pagesScrollTo(o),e.scrollbar.pagesScrollTo(o)}};return e.whiteboardView.callbacks.on("onCameraUpdated",t),function(){return e.whiteboardView.callbacks.off("onCameraUpdated",t)}})),this.sideEffect.add((function(){var t=e.updateUserScroll;return e.whiteboardView.callbacks.on("onCameraUpdatedByDevice",t),function(){return e.whiteboardView.callbacks.off("onCameraUpdatedByDevice",t)}})),this.sideEffect.add((function(){var t=function(t){var n=t.width,r=t.height;if(!(n<=0||r<=0)){e.pageRenderer.setContainerSize(n,r),e.scrollbar.setContainerSize(n,r);var i=e.pageRenderer,o=i.pagesIntrinsicWidth,a=i.pagesIntrinsicHeight;e.whiteboardView.moveCameraToContain({originX:0,originY:e.pageRenderer.pagesScrollTop,width:o,height:r/e.pageRenderer.scale,animationMode:"immediately"}),e.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return e.pageRenderer.scale},minContentMode:function(){return e.pageRenderer.scale},centerX:o/2,centerY:a/2,width:o,height:a})}};return e.whiteboardView.callbacks.on("onSizeUpdated",t),function(){e.whiteboardView.callbacks.off("onSizeUpdated",t)}}),"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",(function(t){if(!e.readonly&&e.box.focus&&!e.box.minimized&&!cu(t.target)){var n=null;switch(t.key){case"PageDown":n=e.pageRenderer.pagesScrollTop+e.pageRenderer.containerHeight/e.pageRenderer.scale;break;case"PageUp":n=e.pageRenderer.pagesScrollTop-e.pageRenderer.containerHeight/e.pageRenderer.scale;break;case"ArrowDown":n=e.pageRenderer.pagesScrollTop+e.pageRenderer.containerHeight/4/e.pageRenderer.scale;break;case"ArrowUp":n=e.pageRenderer.pagesScrollTop-e.pageRenderer.containerHeight/4/e.pageRenderer.scale}null!==n&&(e._onUserScroll?e._onUserScroll(n):(e.pageScrollTo(n),e.updateUserScroll()))}}),{capture:!0})}},{key:"debounce",value:function(e,t,n){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e)throw new TypeError("Expected the first argument to be a function, got `".concat(_(e),"`"));var n,r,i,o=t.wait,a=void 0===o?0:o,s=t.maxWait,u=void 0===s?Number.Infinity:s,l=t.before,c=void 0!==l&&l,h=t.after,d=void 0===h||h;if(!c&&!d)throw new Error("Both `before` and `after` are false, function wouldn't be called.");var f=function(){for(var t=arguments.length,o=new Array(t),s=0;s0&&u!==Number.Infinity&&!r&&(r=setTimeout(f,u)),p&&(i=e.apply(l,o)),i};return zo(f,e),f.cancel=function(){n&&(clearTimeout(n),n=void 0),r&&(clearTimeout(r),r=void 0)},f}(e,t);return this.sideEffect.addDisposer((function(){return r.cancel()}),n),r}},{key:"wrapClassName",value:function(e){return"netless-app-docs-viewer-static-"+e}},{key:"getBase64FromUrl",value:(t=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(this._invalidate(t));case 2:return e.next=4,e.sent.blob();case 4:return n=e.sent,e.abrupt("return",new Promise((function(e){var t=new FileReader;t.readAsDataURL(n),t.onloadend=function(){var n=t.result;e(n)}})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_invalidate",value:function(e){try{var t=new URL(e);return t.searchParams.set("t",Date.now().toString()),t.toString()}catch(t){return e}}},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),_u=function(){function e(t){var n=this,r=t.context,i=t.whiteboardView,o=t.box,a=t.pages;y(this,e),this.sideEffect=new Vo,this.onPlayPPT=function(){var e=n.context.getRoom();e&&e.pptNextStep()},this._scaleDocsToFitImpl=function(){var e=n.pages[n.getPageIndex()];e&&(n.whiteboardView.moveCameraToContain({originX:-e.width/2,originY:-e.height/2,width:e.width,height:e.height,animationMode:"immediately"}),n.whiteboardView.setCameraBound({damping:1,maxContentMode:function(){return n.whiteboardView.camera.scale},minContentMode:function(){return n.whiteboardView.camera.scale},centerX:0,centerY:0,width:e.width,height:e.height}))},this._scaleDocsToFitDebounced=function(){n.sideEffect.setTimeout(n._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=function(){n._scaleDocsToFitImpl(),n._scaleDocsToFitDebounced()},this.onNewPageIndex=function(e){n.jumpToPage(e,!0)},this.context=r,this.whiteboardView=i,this.box=o,this.pages=a,this.displayer=r.getDisplayer(),this.viewer=new au({readonly:!r.getIsWritable(),box:o,pages:a,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add((function(){var e=function(e){n.viewer.setReadonly(!e)};return n.context.emitter.on("writableChange",e),function(){return n.context.emitter.off("writableChange",e)}})),this.sideEffect.add((function(){var e=function(e){n.jumpToPage(e.index)};return n.context.emitter.on("sceneStateChange",e),function(){return n.context.emitter.off("sceneStateChange",e)}}))}return x(e,[{key:"mount",value:function(){var e=this;this.viewer.mount();var t=this.getPageIndex();return 0!==t&&this.jumpToPage(t),this.scaleDocsToFit(),this.sideEffect.add((function(){return e.whiteboardView.callbacks.on("onSizeUpdated",e.scaleDocsToFit),function(){e.whiteboardView.callbacks.off("onSizeUpdated",e.scaleDocsToFit)}})),this}},{key:"unmount",value:function(){return this.viewer.unmount(),this}},{key:"destroy",value:function(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}},{key:"getPageIndex",value:function(){return this.displayer.state.sceneState.index}},{key:"jumpToPage",value:function(e,t){var n,r;if((e=su(e,0,this.pages.length-1))!==this.getPageIndex()&&this.context.getIsWritable()){var i=this.context.getInitScenePath(),o=null==(r=null==(n=this.context.getScenes())?void 0:n[e])?void 0:r.name;i&&o&&this.context.setScenePath("".concat(i,"/").concat(o)),this.scaleDocsToFit()}if(e!==this.viewer.pageIndex&&this.viewer.setPageIndex(e),t){var a=this.context.getRoom();if(a){var s=a.state.globalState.__pptState;a.setGlobalState({__pptState:s&&{uuid:s.uuid,pageIndex:e,disableAutoPlay:s.disableAutoPlay}})}}}},{key:"render",value:function(){var e=this;this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",(function(t){var n;if(e.box.focus&&!cu(t.target))switch(t.key){case"ArrowUp":case"ArrowLeft":e.jumpToPage(e.getPageIndex()-1,!0);break;case"ArrowRight":case"ArrowDown":null==(n=e.context.getRoom())||n.pptNextStep()}}))}},{key:"renderMask",value:function(){if(!this.$mask){var e=document.createElement("div");e.className=this.wrapClassName("mask"),this.$mask=e,document.createElement("button").className=this.wrapClassName("back"),document.createElement("button").className=this.wrapClassName("next")}return this.$mask}},{key:"renderWhiteboardView",value:function(){var e=this;return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.sideEffect.addEventListener(this.$whiteboardView,"click",(function(t){var n,r=e.context.getRoom();if(r&&"clicker"===r.state.memberState.currentApplianceName){for(var i=t.target;i;i=i.parentElement)if(null!=(n=i.classList)&&n.contains("ppt-event-source"))return;r.pptNextStep()}})),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}},{key:"wrapClassName",value:function(e){return"netless-app-docs-viewer-dynamic-"+e}}]),e}(),wu={kind:"DocsViewer",setup:function(e){var t=e.getBox(),n=e.getScenes();if(!n)throw new Error("[Docs Viewer]: scenes not found.");var r=e.getView();if(!r)throw new Error("[Docs Viewer]: no whiteboard view.");var i=n.map((function(e){var t=e.ppt;return t?{width:t.width,height:t.height,src:t.src,thumbnail:t.previewURL}:null})).filter((function(e){return Boolean(e)}));if(i.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(".netless-app-docs-viewer-content{position:relative;height:100%;overflow:hidden}.netless-app-docs-viewer-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-docs-viewer-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview-mask{display:block}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview{transform:translate(0)}.netless-app-docs-viewer-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-docs-viewer-preview-page:hover,.netless-app-docs-viewer-preview-page.netless-app-docs-viewer-preview-page-active{border-color:#444e601a}.netless-app-docs-viewer-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-docs-viewer-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-docs-viewer-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-docs-viewer-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-docs-viewer-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-docs-viewer-footer-btn:hover{background:transparent!important}}.netless-app-docs-viewer-footer-btn>svg{width:100%;height:100%}.netless-app-docs-viewer-footer-btn>svg:nth-of-type(2){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-docs-viewer-footer-btn~.netless-app-docs-viewer-footer-btn{margin-left:15px}.netless-app-docs-viewer-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-docs-viewer-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-docs-viewer-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn:hover{background:transparent}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:active{background:transparent;box-shadow:none}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:disabled{color:inherit}.netless-app-docs-viewer-readonly.netless-app-docs-viewer-float-footer{display:none}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:active,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:focus,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-docs-viewer-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-docs-viewer-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-docs-viewer-preview{background:rgba(50,50,50,.9)}.netless-app-docs-viewer-static-scrollbar{position:absolute;top:0;right:0;z-index:2147483647;width:8px;min-height:30px;margin:0;padding:0;border:none;outline:none;border-radius:4px;background:rgba(68,78,96,.4);box-shadow:1px 1px 8px #ffffffb3;opacity:0;transition:background .4s,opacity .4s 3s,transform .2s;user-select:none}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging{background:rgba(68,78,96,.6);opacity:1;transition:background .4s,opacity .4s 3s!important}.netless-app-docs-viewer-static-scrollbar:hover,.netless-app-docs-viewer-static-scrollbar:focus{background:rgba(68,78,96,.5)}.netless-app-docs-viewer-static-scrollbar:active{background:rgba(68,78,96,.6)}.netless-app-docs-viewer-content:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-static-scrollbar{display:none}.netless-app-docs-viewer-static-pages:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.page-renderer-pages-container{position:relative;overflow:hidden}.page-renderer-page{position:absolute;top:0;left:0;background-position:center;background-size:cover;background-repeat:no-repeat}.page-renderer-pages-container.is-hwa .page-renderer-page{will-change:transform}.page-renderer-page-img{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-pages{overflow:hidden;position:relative;height:100%;user-select:none}.netless-app-docs-viewer-static-page{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-wb-view,.netless-app-docs-viewer-dynamic-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-docs-viewer-dynamic-wb-view .cursor-clicker .ppt-event-source{cursor:pointer}\n"),i[0].src.startsWith("ppt")?function(e,t,n,r){t.disableCameraTransform=!0;var i=new _u({context:e,whiteboardView:t,box:n,pages:r}).mount();i.viewer.onPageIndexChanged=function(t){e.dispatchAppEvent("pageStateChange",{index:t,length:r.length})},e.dispatchAppEvent("pageStateChange",{index:i.getPageIndex(),length:r.length}),e.mountView(i.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",(function(t){var i=t.width,o=t.height;if(r.length>0&&"maximized"!==n.state){var a=r[0],s=a.width,u=a.height/s*i-o;0!==u&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:n.width,height:n.height+u/n.containerRect.height})}}))}(e,r,t,i):function(e,t,n,r){var i;t.disableCameraTransform=!e.getIsWritable();var o=new xu({whiteboardView:t,readonly:!e.getIsWritable(),box:n,pages:r,pageScrollTop:null==(i=e.getAttributes())?void 0:i.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:function(t){var r;(null==(r=e.getAttributes())?void 0:r.pageScrollTop)!==t&&!n.readonly&&e.updateAttributes(["pageScrollTop"],t)},baseScenePath:e.getInitScenePath(),appId:e.appId}).mount();o.viewer.onPageIndexChanged=function(t){e.dispatchAppEvent("pageStateChange",{index:t,length:r.length})},e.dispatchAppEvent("pageStateChange",{index:o.viewer.pageIndex,length:r.length}),e.emitter.on("attributesUpdate",(function(e){e&&null!=e.pageScrollTop&&o.syncPageScrollTop(e.pageScrollTop)})),e.emitter.on("writableChange",(function(e){o.setReadonly(!e),t.disableCameraTransform=!e}))}(e,r,t,i)}};var Tu={exports:{}},Mu={},Su={exports:{}},Eu={}; /** @license React v0.19.1 * scheduler.production.min.js * @@ -297,7 +297,7 @@ PERFORMANCE OF THIS SOFTWARE. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. -*/!function(e){var t,n,r,i,o;if("undefined"==typeof window||"function"!=typeof MessageChannel){var a=null,s=null,u=function t(){if(null!==a)try{var n=e.unstable_now();a(!0,n),a=null}catch(e){throw setTimeout(t,0),e}},l=Date.now();e.unstable_now=function(){return Date.now()-l},t=function(e){null!==a?setTimeout(t,0,e):(a=e,setTimeout(u,0))},n=function(e,t){s=setTimeout(e,t)},r=function(){clearTimeout(s)},i=function(){return!1},o=e.unstable_forceFrameRate=function(){}}else{var c=window.performance,h=window.Date,d=window.setTimeout,f=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==_(c)&&"function"==typeof c.now)e.unstable_now=function(){return c.now()};else{var v=h.now();e.unstable_now=function(){return h.now()-v}}var m=!1,g=null,y=-1,b=5,x=0;i=function(){return e.unstable_now()>=x},o=function(){},e.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[r];if(!(void 0!==i&&0A(a,n))void 0!==u&&0>A(u,a)?(e[r]=u,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==u&&0>A(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function A(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var I=[],C=[],N=1,k=null,D=3,P=!1,O=!1,R=!1;function L(e){for(var t=S(C);null!==t;){if(null===t.callback)E(C);else{if(!(t.startTime<=e))break;E(C),t.sortIndex=t.expirationTime,M(I,t)}t=S(C)}}function j(e){if(R=!1,L(e),!O)if(null!==S(I))O=!0,t(B);else{var r=S(C);null!==r&&n(j,r.startTime-e)}}function B(t,o){O=!1,R&&(R=!1,r()),P=!0;var a=D;try{for(L(o),k=S(I);null!==k&&(!(k.expirationTime>o)||t&&!i());){var s=k.callback;if(null!==s){k.callback=null,D=k.priorityLevel;var u=s(k.expirationTime<=o);o=e.unstable_now(),"function"==typeof u?k.callback=u:k===S(I)&&E(I),L(o)}else E(I);k=S(I)}if(null!==k)var l=!0;else{var c=S(C);null!==c&&n(j,c.startTime-o),l=!1}return l}finally{k=null,D=a,P=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=o;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){O||P||(O=!0,t(B))},e.unstable_getCurrentPriorityLevel=function(){return D},e.unstable_getFirstCallbackNode=function(){return S(I)},e.unstable_next=function(e){switch(D){case 1:case 2:case 3:var t=3;break;default:t=D}var n=D;D=t;try{return e()}finally{D=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=F,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=D;D=e;try{return t()}finally{D=n}},e.unstable_scheduleCallback=function(i,o,a){var s=e.unstable_now();if("object"==_(a)&&null!==a){var u=a.delay;u="number"==typeof u&&0s?(i.sortIndex=u,M(C,i),null===S(I)&&i===S(C)&&(R?r():R=!0,n(j,u-s))):(i.sortIndex=a,M(I,i),O||P||(O=!0,t(B))),i},e.unstable_shouldYield=function(){var t=e.unstable_now();L(t);var n=S(I);return n!==k&&null!==k&&null!==n&&null!==n.callback&&n.startTime<=t&&n.expirationTime=x},o=function(){},e.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[r];if(!(void 0!==i&&0A(a,n))void 0!==u&&0>A(u,a)?(e[r]=u,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==u&&0>A(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function A(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var I=[],C=[],N=1,k=null,D=3,P=!1,O=!1,R=!1;function L(e){for(var t=S(C);null!==t;){if(null===t.callback)E(C);else{if(!(t.startTime<=e))break;E(C),t.sortIndex=t.expirationTime,M(I,t)}t=S(C)}}function j(e){if(R=!1,L(e),!O)if(null!==S(I))O=!0,t(B);else{var r=S(C);null!==r&&n(j,r.startTime-e)}}function B(t,o){O=!1,R&&(R=!1,r()),P=!0;var a=D;try{for(L(o),k=S(I);null!==k&&(!(k.expirationTime>o)||t&&!i());){var s=k.callback;if(null!==s){k.callback=null,D=k.priorityLevel;var u=s(k.expirationTime<=o);o=e.unstable_now(),"function"==typeof u?k.callback=u:k===S(I)&&E(I),L(o)}else E(I);k=S(I)}if(null!==k)var l=!0;else{var c=S(C);null!==c&&n(j,c.startTime-o),l=!1}return l}finally{k=null,D=a,P=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var z=o;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){O||P||(O=!0,t(B))},e.unstable_getCurrentPriorityLevel=function(){return D},e.unstable_getFirstCallbackNode=function(){return S(I)},e.unstable_next=function(e){switch(D){case 1:case 2:case 3:var t=3;break;default:t=D}var n=D;D=t;try{return e()}finally{D=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=z,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=D;D=e;try{return t()}finally{D=n}},e.unstable_scheduleCallback=function(i,o,a){var s=e.unstable_now();if("object"==_(a)&&null!==a){var u=a.delay;u="number"==typeof u&&0s?(i.sortIndex=u,M(C,i),null===S(I)&&i===S(C)&&(R?r():R=!0,n(j,u-s))):(i.sortIndex=a,M(I,i),O||P||(O=!0,t(B))),i},e.unstable_shouldYield=function(){var t=e.unstable_now();L(t);var n=S(I);return n!==k&&null!==k&&null!==n&&null!==n.callback&&n.startTime<=t&&n.expirationTimet}return!1}function gl(e,t,n,r,i,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o}var yl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){yl[e]=new gl(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];yl[t]=new gl(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){yl[e]=new gl(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){yl[e]=new gl(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){yl[e]=new gl(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){yl[e]=new gl(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){yl[e]=new gl(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){yl[e]=new gl(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){yl[e]=new gl(e,5,!1,e.toLowerCase(),null,!1)}));var bl=/[\-:]([a-z])/g;function xl(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(bl,xl);yl[t]=new gl(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(bl,xl);yl[t]=new gl(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(bl,xl);yl[t]=new gl(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){yl[e]=new gl(e,1,!1,e.toLowerCase(),null,!1)})),yl.xlinkHref=new gl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){yl[e]=new gl(e,1,!1,e.toLowerCase(),null,!0)}));var _l=Au.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function wl(e,t,n,r){var i=yl.hasOwnProperty(t)?yl[t]:null;(null!==i?0===i.type:!r&&!(!(2=n.length))throw Error(Nu(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Hl(n)}}function rc(e,t){var n=Hl(t.value),r=Hl(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ic(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var oc="http://www.w3.org/1999/xhtml",ac="http://www.w3.org/2000/svg";function sc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function uc(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?sc(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var lc,cc=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==ac||"innerHTML"in e)e.innerHTML=t;else{for((lc=lc||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=lc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function hc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function dc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var fc={animationend:dc("Animation","AnimationEnd"),animationiteration:dc("Animation","AnimationIteration"),animationstart:dc("Animation","AnimationStart"),transitionend:dc("Transition","TransitionEnd")},pc={},vc={};function mc(e){if(pc[e])return pc[e];if(!fc[e])return e;var t,n=fc[e];for(t in n)if(n.hasOwnProperty(t)&&t in vc)return pc[e]=n[t];return e}Ju&&(vc=document.createElement("div").style,"AnimationEvent"in window||(delete fc.animationend.animation,delete fc.animationiteration.animation,delete fc.animationstart.animation),"TransitionEvent"in window||delete fc.transitionend.transition);var gc=mc("animationend"),yc=mc("animationiteration"),bc=mc("animationstart"),xc=mc("transitionend"),_c="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wc=new("function"==typeof WeakMap?WeakMap:Map);function Tc(e){var t=wc.get(e);return void 0===t&&(t=new Map,wc.set(e,t)),t}function Mc(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Sc(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ec(e){if(Mc(e)!==e)throw Error(Nu(188))}function Ac(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Mc(e)))throw Error(Nu(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Ec(i),e;if(o===r)return Ec(i),t;o=o.sibling}throw Error(Nu(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(Nu(189))}}if(n.alternate!==r)throw Error(Nu(190))}if(3!==n.tag)throw Error(Nu(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ic(e,t){if(null==t)throw Error(Nu(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function Cc(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var Nc=null;function kc(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;rRc.length&&Rc.push(e)}function jc(e,t,n,r){if(Rc.length){var i=Rc.pop();return i.topLevelType=e,i.eventSystemFlags=r,i.nativeEvent=t,i.targetInst=n,i}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function Bc(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=ed(r)}while(n);for(n=0;n=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Rh(r)}}function jh(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?jh(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Bh(){for(var e=window,t=Oh();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=Oh((e=t.contentWindow).document)}return t}function Uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Fh="$?",zh="$!",Gh=null,Hh=null;function Vh(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Wh(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==_(t.dangerouslySetInnerHTML)&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Yh="function"==typeof setTimeout?setTimeout:void 0,Xh="function"==typeof clearTimeout?clearTimeout:void 0;function Qh(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Zh(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||n===zh||n===Fh){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var qh=Math.random().toString(36).slice(2),Jh="__reactInternalInstance$"+qh,Kh="__reactEventHandlers$"+qh,$h="__reactContainere$"+qh;function ed(e){var t=e[Jh];if(t)return t;for(var n=e.parentNode;n;){if(t=n[$h]||n[Jh]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Zh(e);null!==e;){if(n=e[Jh])return n;e=Zh(e)}return t}n=(e=n).parentNode}return null}function td(e){return!(e=e[Jh]||e[$h])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function nd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Nu(33))}function rd(e){return e[Kh]||null}function id(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function od(e,t){var n=e.stateNode;if(!n)return null;var r=Bu(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(Nu(231,t,_(n)));return n}function ad(e,t,n){(t=od(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=Ic(n._dispatchListeners,t),n._dispatchInstances=Ic(n._dispatchInstances,e))}function sd(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=id(t);for(t=n.length;0this.eventPool.length&&this.eventPool.push(e)}function xd(e){e.eventPool=[],e.getPooled=yd,e.release=bd}Iu(gd.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=vd)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=vd)},persist:function(){this.isPersistent=vd},isPersistent:md,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=md,this._dispatchInstances=this._dispatchListeners=null}}),gd.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},gd.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return Iu(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=Iu({},r.Interface,e),n.extend=r.extend,xd(n),n},xd(gd);var _d=gd.extend({data:null}),wd=gd.extend({data:null}),Td=[9,13,27,32],Md=Ju&&"CompositionEvent"in window,Sd=null;Ju&&"documentMode"in document&&(Sd=document.documentMode);var Ed=Ju&&"TextEvent"in window&&!Sd,Ad=Ju&&(!Md||Sd&&8=Sd),Id=String.fromCharCode(32),Cd={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Nd=!1;function kd(e,t){switch(e){case"keyup":return-1!==Td.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Dd(e){return"object"==_(e=e.detail)&&"data"in e?e.data:null}var Pd=!1;var Od={eventTypes:Cd,extractEvents:function(e,t,n,r){var i;if(Md)e:{switch(e){case"compositionstart":var o=Cd.compositionStart;break e;case"compositionend":o=Cd.compositionEnd;break e;case"compositionupdate":o=Cd.compositionUpdate;break e}o=void 0}else Pd?kd(e,n)&&(o=Cd.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=Cd.compositionStart);return o?(Ad&&"ko"!==n.locale&&(Pd||o!==Cd.compositionStart?o===Cd.compositionEnd&&Pd&&(i=pd()):(dd="value"in(hd=r)?hd.value:hd.textContent,Pd=!0)),o=_d.getPooled(o,t,n,r),i?o.data=i:null!==(i=Dd(n))&&(o.data=i),cd(o),i=o):i=null,(e=Ed?function(e,t){switch(e){case"compositionend":return Dd(t);case"keypress":return 32!==t.which?null:(Nd=!0,Id);case"textInput":return(e=t.data)===Id&&Nd?null:e;default:return null}}(e,n):function(e,t){if(Pd)return"compositionend"===e||!Md&&kd(e,t)?(e=pd(),fd=dd=hd=null,Pd=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,vf={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},mf=null,gf=null,yf=null,bf=!1;function xf(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return bf||null==mf||mf!==Oh(n)?null:("selectionStart"in(n=mf)&&Uh(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},yf&&ff(yf,n)?null:(yf=n,(e=gd.getPooled(vf.select,gf,e,t)).type="select",e.target=mf,cd(e),e))}var _f={eventTypes:vf,extractEvents:function(e,t,n,r,i,o){if(!(o=!(i=o||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{i=Tc(i),o=Zu.onSelect;for(var a=0;aRf||(e.current=Of[Rf],Of[Rf]=null,Rf--)}function jf(e,t){Rf++,Of[Rf]=e.current,e.current=t}var Bf={},Uf={current:Bf},Ff={current:!1},zf=Bf;function Gf(e,t){var n=e.type.contextTypes;if(!n)return Bf;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Hf(e){return null!=(e=e.childContextTypes)}function Vf(){Lf(Ff),Lf(Uf)}function Wf(e,t,n){if(Uf.current!==Bf)throw Error(Nu(168));jf(Uf,t),jf(Ff,n)}function Yf(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(Nu(108,zl(t)||"Unknown",i));return Iu({},n,{},r)}function Xf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bf,zf=Uf.current,jf(Uf,e),jf(Ff,Ff.current),!0}function Qf(e,t,n){var r=e.stateNode;if(!r)throw Error(Nu(169));n?(e=Yf(e,t,zf),r.__reactInternalMemoizedMergedChildContext=e,Lf(Ff),Lf(Uf),jf(Uf,e)):Lf(Ff),jf(Ff,n)}var Zf=Cu.unstable_runWithPriority,qf=Cu.unstable_scheduleCallback,Jf=Cu.unstable_cancelCallback,Kf=Cu.unstable_requestPaint,$f=Cu.unstable_now,ep=Cu.unstable_getCurrentPriorityLevel,tp=Cu.unstable_ImmediatePriority,np=Cu.unstable_UserBlockingPriority,rp=Cu.unstable_NormalPriority,ip=Cu.unstable_LowPriority,op=Cu.unstable_IdlePriority,ap={},sp=Cu.unstable_shouldYield,up=void 0!==Kf?Kf:function(){},lp=null,cp=null,hp=!1,dp=$f(),fp=1e4>dp?$f:function(){return $f()-dp};function pp(){switch(ep()){case tp:return 99;case np:return 98;case rp:return 97;case ip:return 96;case op:return 95;default:throw Error(Nu(332))}}function vp(e){switch(e){case 99:return tp;case 98:return np;case 97:return rp;case 96:return ip;case 95:return op;default:throw Error(Nu(332))}}function mp(e,t){return e=vp(e),Zf(e,t)}function gp(e,t,n){return e=vp(e),qf(e,t,n)}function yp(e){return null===lp?(lp=[e],cp=qf(tp,xp)):lp.push(e),ap}function bp(){if(null!==cp){var e=cp;cp=null,Jf(e)}xp()}function xp(){if(!hp&&null!==lp){hp=!0;var e=0;try{var t=lp;mp(99,(function(){for(;e=t&&(rm=!0),e.firstContext=null)}function kp(e,t){if(Ep!==e&&!1!==t&&0!==t)if(("number"!=typeof t||1073741823===t)&&(Ep=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Sp){if(null===Mp)throw Error(Nu(308));Sp=t,Mp.dependencies={expirationTime:0,firstContext:t,responders:null}}else Sp=Sp.next=t;return e._currentValue}var Dp=!1;function Pp(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function Op(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Rp(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function Lp(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function jp(e,t){var n=e.alternate;null!==n&&Op(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function Bp(e,t,n,r){var i=e.updateQueue;Dp=!1;var o=i.baseQueue,a=i.shared.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}o=a,i.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=a))}if(null!==o){s=o.next;var u=i.baseState,l=0,c=null,h=null,d=null;if(null!==s)for(var f=s;;){if((a=f.expirationTime)l&&(l=a)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:f.suspenseConfig,tag:f.tag,payload:f.payload,callback:f.callback,next:null}),Lg(a,f.suspenseConfig);e:{var v=e,m=f;switch(a=t,p=n,m.tag){case 1:if("function"==typeof(v=m.payload)){u=v.call(p,u,a);break e}u=v;break e;case 3:v.effectTag=-4097&v.effectTag|64;case 0:if(null==(a="function"==typeof(v=m.payload)?v.call(p,u,a):v))break e;u=Iu({},u,a);break e;case 2:Dp=!0}}null!==f.callback&&(e.effectTag|=32,null===(a=i.effects)?i.effects=[f]:a.push(f))}if(null===(f=f.next)||f===s){if(null===(a=i.shared.pending))break;f=o.next=a.next,a.next=s,i.baseQueue=o=a,i.shared.pending=null}}null===d?c=u:d.next=h,i.baseState=c,i.baseQueue=d,jg(l),e.expirationTime=l,e.memoizedState=u}}function Up(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;tv?(m=p,p=null):m=p.sibling;var g=d(i,p,s[v],u);if(null===g){null===p&&(p=m);break}e&&p&&null===g.alternate&&t(i,p),a=o(g,a,v),null===c?l=g:c.sibling=g,c=g,p=m}if(v===s.length)return n(i,p),l;if(null===p){for(;vv?(m=p,p=null):m=p.sibling;var y=d(i,p,g.value,u);if(null===y){null===p&&(p=m);break}e&&p&&null===y.alternate&&t(i,p),a=o(y,a,v),null===c?l=y:c.sibling=y,c=y,p=m}if(g.done)return n(i,p),l;if(null===p){for(;!g.done;v++,g=s.next())null!==(g=h(i,g.value,u))&&(a=o(g,a,v),null===c?l=g:c.sibling=g,c=g);return l}for(p=r(i,p);!g.done;v++,g=s.next())null!==(g=f(p,i,v,g.value,u))&&(e&&null!==g.alternate&&p.delete(null===g.key?v:g.key),a=o(g,a,v),null===c?l=g:c.sibling=g,c=g);return e&&p.forEach((function(e){return t(i,e)})),l}(s,u,l,c);if(v&&qp(s,l),void 0===l&&!p)switch(s.tag){case 1:case 0:throw s=s.type,Error(Nu(152,s.displayName||s.name||"Component"))}return n(s,u)}}var Kp=Jp(!0),$p=Jp(!1),ev={},tv={current:ev},nv={current:ev},rv={current:ev};function iv(e){if(e===ev)throw Error(Nu(174));return e}function ov(e,t){switch(jf(rv,t),jf(nv,e),jf(tv,ev),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:uc(null,"");break;default:t=uc(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Lf(tv),jf(tv,t)}function av(){Lf(tv),Lf(nv),Lf(rv)}function sv(e){iv(rv.current);var t=iv(tv.current),n=uc(t,e.type);t!==n&&(jf(nv,e),jf(tv,n))}function uv(e){nv.current===e&&(Lf(tv),Lf(nv))}var lv={current:0};function cv(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===Fh||n.data===zh))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function hv(e,t){return{responder:e,props:t}}var dv=_l.ReactCurrentDispatcher,fv=_l.ReactCurrentBatchConfig,pv=0,vv=null,mv=null,gv=null,yv=!1;function bv(){throw Error(Nu(321))}function xv(e,t){if(null===t)return!1;for(var n=0;no))throw Error(Nu(301));o+=1,gv=mv=null,t.updateQueue=null,dv.current=Yv,e=n(r,i)}while(t.expirationTime===pv)}if(dv.current=Hv,t=null!==mv&&null!==mv.next,pv=0,gv=mv=vv=null,yv=!1,t)throw Error(Nu(300));return e}function wv(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===gv?vv.memoizedState=gv=e:gv=gv.next=e,gv}function Tv(){if(null===mv){var e=vv.alternate;e=null!==e?e.memoizedState:null}else e=mv.next;var t=null===gv?vv.memoizedState:gv.next;if(null!==t)gv=t,mv=e;else{if(null===e)throw Error(Nu(310));e={memoizedState:(mv=e).memoizedState,baseState:mv.baseState,baseQueue:mv.baseQueue,queue:mv.queue,next:null},null===gv?vv.memoizedState=gv=e:gv=gv.next=e}return gv}function Mv(e,t){return"function"==typeof t?t(e):t}function Sv(e){var t=Tv(),n=t.queue;if(null===n)throw Error(Nu(311));n.lastRenderedReducer=e;var r=mv,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var s=a=o=null,u=i;do{var l=u.expirationTime;if(lvv.expirationTime&&(vv.expirationTime=l,jg(l))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:u.suspenseConfig,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),Lg(l,u.suspenseConfig),r=u.eagerReducer===e?u.eagerState:e(r,u.action);u=u.next}while(null!==u&&u!==i);null===s?o=r:s.next=a,hf(r,t.memoizedState)||(rm=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Ev(e){var t=Tv(),n=t.queue;if(null===n)throw Error(Nu(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);hf(o,t.memoizedState)||(rm=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Av(e){var t=wv();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Mv,lastRenderedState:e}).dispatch=Gv.bind(null,vv,e),[t.memoizedState,e]}function Iv(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=vv.updateQueue)?(t={lastEffect:null},vv.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Cv(){return Tv().memoizedState}function Nv(e,t,n,r){var i=wv();vv.effectTag|=e,i.memoizedState=Iv(1|t,n,void 0,void 0===r?null:r)}function kv(e,t,n,r){var i=Tv();r=void 0===r?null:r;var o=void 0;if(null!==mv){var a=mv.memoizedState;if(o=a.destroy,null!==r&&xv(r,a.deps))return void Iv(t,n,o,r)}vv.effectTag|=e,i.memoizedState=Iv(1|t,n,o,r)}function Dv(e,t){return Nv(516,4,e,t)}function Pv(e,t){return kv(516,4,e,t)}function Ov(e,t){return kv(4,2,e,t)}function Rv(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Lv(e,t,n){return n=null!=n?n.concat([e]):null,kv(4,2,Rv.bind(null,t,e),n)}function jv(){}function Bv(e,t){return wv().memoizedState=[e,void 0===t?null:t],e}function Uv(e,t){var n=Tv();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&xv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Fv(e,t){var n=Tv();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&xv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function zv(e,t,n){var r=pp();mp(98>r?98:r,(function(){e(!0)})),mp(97<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=a.createElement(i,{is:r.is}):(e=a.createElement(i),"select"===i&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,i),e[Jh]=t,e[Kh]=r,fm(e,t),t.stateNode=e,a=Nh(i,r),i){case"iframe":case"object":case"embed":yh("load",e),s=r;break;case"video":case"audio":for(s=0;s<_c.length;s++)yh(_c[s],e);s=r;break;case"source":yh("error",e),s=r;break;case"img":case"image":case"link":yh("error",e),yh("load",e),s=r;break;case"form":yh("reset",e),yh("submit",e),s=r;break;case"details":yh("toggle",e),s=r;break;case"input":Ql(e,r),s=Xl(e,r),yh("invalid",e),Dh(n,"onChange");break;case"option":s=$l(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Iu({},r,{value:void 0}),yh("invalid",e),Dh(n,"onChange");break;case"textarea":nc(e,r),s=tc(e,r),yh("invalid",e),Dh(n,"onChange");break;default:s=r}Ch(i,s);var u=s;for(o in u)if(u.hasOwnProperty(o)){var l=u[o];"style"===o?Ah(e,l):"dangerouslySetInnerHTML"===o?null!=(l=l?l.__html:void 0)&&cc(e,l):"children"===o?"string"==typeof l?("textarea"!==i||""!==l)&&hc(e,l):"number"==typeof l&&hc(e,""+l):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(Qu.hasOwnProperty(o)?null!=l&&Dh(n,o):null!=l&&wl(e,o,l,a))}switch(i){case"input":Wl(e),Jl(e,r,!1);break;case"textarea":Wl(e),ic(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Hl(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?ec(e,!!r.multiple,n,!1):null!=r.defaultValue&&ec(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=Ph)}Vh(i,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)vm(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(Nu(166));n=iv(rv.current),iv(tv.current),em(t)?(n=t.stateNode,r=t.memoizedProps,n[Jh]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Jh]=t,t.stateNode=n)}return null;case 13:return Lf(lv),r=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&em(t):(r=null!==(i=e.memoizedState),n||null===i||null!==(i=e.child.sibling)&&(null!==(o=t.firstEffect)?(t.firstEffect=i,i.nextEffect=o):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8)),n&&!r&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&lv.current)?ig===Jm&&(ig=Km):((ig===Jm||ig===Km)&&(ig=$m),0!==lg&&null!==tg&&(cy(tg,rg),hy(tg,lg)))),(n||r)&&(t.effectTag|=4),null);case 4:return av(),null;case 10:return Ip(t),null;case 19:if(Lf(lv),null===(r=t.memoizedState))return null;if(i=0!=(64&t.effectTag),null===(o=r.rendering)){if(i)wm(r,!1);else if(ig!==Jm||null!==e&&0!=(64&e.effectTag))for(o=t.child;null!==o;){if(null!==(e=cv(o))){for(t.effectTag|=64,wm(r,!1),null!==(i=e.updateQueue)&&(t.updateQueue=i,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)o=n,(i=r).effectTag&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(e=i.alternate)?(i.childExpirationTime=0,i.expirationTime=o,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null):(i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,o=e.dependencies,i.dependencies=null===o?null:{expirationTime:o.expirationTime,firstContext:o.firstContext,responders:o.responders}),r=r.sibling;return jf(lv,1&lv.current|2),t.child}o=o.sibling}}else{if(!i)if(null!==(e=cv(o))){if(t.effectTag|=64,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),wm(r,!0),null===r.tail&&"hidden"===r.tailMode&&!o.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*fp()-r.renderingStartTime>r.tailExpiration&&1t)&&bg.set(e,t))}}function Eg(e,t){e.expirationTime=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Ig(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=yp(Ng.bind(null,e));else{var t=Ag(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Tg();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==ap&&Jf(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?yp(Ng.bind(null,e)):gp(r,Cg.bind(null,e),{timeout:10*(1073741821-t)-fp()}),e.callbackNode=t}}}function Cg(e,t){if(wg=0,t)return dy(e,t=Tg()),Ig(e),null;var n=Ag(e);if(0!==n){if(t=e.callbackNode,0!=(48&eg))throw Error(Nu(327));if(Yg(),e===tg&&n===rg||Pg(e,n),null!==ng){var r=eg;eg|=Zm;for(var i=Rg();;)try{Ug();break}catch(t){Og(e,t)}if(Ap(),eg=r,Xm.current=i,1===ig)throw t=og,Pg(e,n),cy(e,n),Ig(e),t;if(null===ng)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=ig,tg=null,r){case Jm:case 1:throw Error(Nu(345));case 2:dy(e,2=n){e.lastPingedTime=n,Pg(e,n);break}}if(0!==(o=Ag(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=Yh(Hg.bind(null,e),i);break}Hg(e);break;case $m:if(cy(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Gg(i)),cg&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,Pg(e,n);break}if(0!==(i=Ag(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==sg?r=10*(1073741821-sg)-fp():1073741823===ag?r=0:(r=10*(1073741821-ag)-5e3,0>(r=(i=fp())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ym(r/1960))-r)&&(r=n)),10=(r=0|a.busyMinDurationMs)?r=0:(i=0|a.busyDelayMs,r=(o=fp()-(10*(1073741821-o)-(0|a.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+Gl(a))}5!==ig&&(ig=2),s=Sm(s,a),h=o;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=t,jp(h,Hm(h,u,t));break e;case 1:u=s;var x=h.type,w=h.stateNode;if(0==(64&h.effectTag)&&("function"==typeof x.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===vg||!vg.has(w)))){h.effectTag|=4096,h.expirationTime=t,jp(h,Vm(h,u,t));break e}}h=h.return}while(null!==h)}ng=zg(ng)}catch(e){t=e;continue}break}}function Rg(){var e=Xm.current;return Xm.current=Hv,null===e?Hv:e}function Lg(e,t){elg&&(lg=e)}function Bg(){for(;null!==ng;)ng=Fg(ng)}function Ug(){for(;null!==ng&&!sp();)ng=Fg(ng)}function Fg(e){var t=Wm(e.alternate,e,rg);return e.memoizedProps=e.pendingProps,null===t&&(t=zg(e)),Qm.current=null,t}function zg(e){ng=e;do{var t=ng.alternate;if(e=ng.return,0==(2048&ng.effectTag)){if(t=Tm(t,ng,rg),1===rg||1!==ng.childExpirationTime){for(var n=0,r=ng.child;null!==r;){var i=r.expirationTime,o=r.childExpirationTime;i>n&&(n=i),o>n&&(n=o),r=r.sibling}ng.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=ng.firstEffect),null!==ng.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=ng.firstEffect),e.lastEffect=ng.lastEffect),1(e=e.childExpirationTime)?t:e}function Hg(e){var t=pp();return mp(99,Vg.bind(null,e,t)),null}function Vg(e,t){do{Yg()}while(null!==gg);if(0!=(48&eg))throw Error(Nu(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(Nu(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Gg(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===tg&&(ng=tg=null,rg=0),1s&&(l=s,s=a,a=l),l=Lh(b,a),c=Lh(b,s),l&&c&&(1!==_.rangeCount||_.anchorNode!==l.node||_.anchorOffset!==l.offset||_.focusNode!==c.node||_.focusOffset!==c.offset)&&((x=x.createRange()).setStart(l.node,l.offset),_.removeAllRanges(),a>s?(_.addRange(x),_.extend(c.node,c.offset)):(x.setEnd(c.node,c.offset),_.addRange(x))))),x=[],_=b);_=_.parentNode;)1===_.nodeType&&x.push({element:_,left:_.scrollLeft,top:_.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b=n?gm(e,t,n):(jf(lv,1&lv.current),null!==(t=_m(e,t,n))?t.sibling:null);jf(lv,1&lv.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return xm(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),jf(lv,lv.current),!r)return null}return _m(e,t,n)}rm=!1}}else rm=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=Gf(t,Uf.current),Np(t,n),i=_v(null,t,r,e,i,n),t.effectTag|=1,"object"==_(i)&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,Hf(r)){var o=!0;Xf(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Pp(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&Gp(t,r,a,e),i.updater=Hp,t.stateNode=i,i._reactInternalFiber=t,Xp(t,r,e,n),t=hm(null,t,r,!0,o,n)}else t.tag=0,im(null,t,i,n),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=function(e){if("function"==typeof e)return ny(e)?1:0;if(null!=e){if((e=e.$$typeof)===Pl)return 11;if(e===Ll)return 14}return 2}(i),e=wp(i,e),o){case 0:t=lm(null,t,i,e,n);break e;case 1:t=cm(null,t,i,e,n);break e;case 11:t=om(null,t,i,e,n);break e;case 14:t=am(null,t,i,wp(i.type,e),r,n);break e}throw Error(Nu(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,lm(e,t,r,i=t.elementType===r?i:wp(r,i),n);case 1:return r=t.type,i=t.pendingProps,cm(e,t,r,i=t.elementType===r?i:wp(r,i),n);case 3:if(dm(t),r=t.updateQueue,null===e||null===r)throw Error(Nu(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,Op(e,t),Bp(t,r,null,n),(r=t.memoizedState.element)===i)tm(),t=_m(e,t,n);else{if((i=t.stateNode.hydrate)&&(Qv=Qh(t.stateNode.containerInfo.firstChild),Xv=t,i=Zv=!0),i)for(n=$p(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else im(e,t,r,n),tm();t=t.child}return t;case 5:return sv(t),null===e&&Kv(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,Wh(r,i)?a=null:null!==o&&Wh(r,o)&&(t.effectTag|=16),um(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(im(e,t,a,n),t=t.child),t;case 6:return null===e&&Kv(t),null;case 13:return gm(e,t,n);case 4:return ov(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Kp(t,null,r,n):im(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,om(e,t,r,i=t.elementType===r?i:wp(r,i),n);case 7:return im(e,t,t.pendingProps,n),t.child;case 8:case 12:return im(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value;var s=t.type._context;if(jf(Tp,s._currentValue),s._currentValue=o,null!==a)if(s=a.value,0===(o=hf(s,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,o):1073741823))){if(a.children===i.children&&!Ff.current){t=_m(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var u=s.dependencies;if(null!==u){a=s.child;for(var l=u.firstContext;null!==l;){if(l.context===r&&0!=(l.observedBits&o)){1===s.tag&&((l=Rp(n,null)).tag=2,Lp(s,l)),s.expirationTime=t&&e<=t}function cy(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function hy(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function dy(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function fy(e,t,n,r){var i=t.current,o=Tg(),a=Fp.suspense;o=Mg(o,i,a);e:if(n){t:{if(Mc(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(Nu(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(Hf(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(Nu(171))}if(1===n.tag){var u=n.type;if(Hf(u)){n=Yf(n,u,s);break e}}n=s}else n=Bf;return null===t.context?t.context=n:t.pendingContext=n,(t=Rp(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),Lp(i,t),Sg(i,o),o}function py(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function vy(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=t||n<0||h&&e-l>=o}function m(){var e,n,r=nb();if(v(r))return g(r);s=setTimeout(m,(n=t-((e=r)-u),h?ib(n,o-(e-l)):n))}function g(e){return s=void 0,d&&r?f(e):(r=i=void 0,a)}function y(){var e=nb(),n=v(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(m,t),f(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=tb(t)||0,qy(n)&&(c=!!n.leading,o=(h="maxWait"in n)?rb(tb(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},y.flush=function(){return void 0===s?a:g(nb())},y}var ab=function(e){s(n,e);var t=u(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).seeking=!1,r.mobileSeeking=!1,r.track=null,r.hoverTime=null,r.offset=0,r.secondsPrefix="00:00:",r.minutesPrefix="00:",r.seekPause=!1,r.handleTouchSeeking=function(e){for(var t=0,n=0;nthis.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:"translateX(".concat(e,"px)")}}},{key:"secondsToTime",value:function(e){e=Math.round(e+this.offset);var t=Math.floor(e/3600),n=e%3600,r=Math.floor(n/60),i=Math.ceil(n%60);return{hh:t.toString(),mm:r<10?"0"+r:r.toString(),ss:i<10?"0"+i:i.toString()}}},{key:"getHoverTime",value:function(){var e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),n=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+n.ss:this.props.total+this.offset<3600?this.minutesPrefix+n.mm+":"+n.ss:n.hh+":"+n.mm+":"+n.ss}},{key:"isThumbActive",value:function(){return this.state.seekHoverPosition>0||this.seeking}},{key:"drawHoverTime",value:function(){var e=this;return this.props.hideHoverTime?null:ln.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:function(t){return e.hoverTime=t}},this.getHoverTime())}},{key:"render",value:function(){var e=this;return ln.createElement("div",{className:"seek-slider"},ln.createElement("div",{className:"track",ref:function(t){return e.track=t},onMouseMove:function(t){return e.handleTrackHover(!1,t)},onMouseLeave:function(t){return e.handleTrackHover(!0,t)},onMouseDown:this.onMouseDown,onTouchStart:function(t){e.setMobileSeeking(!0),e.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},ln.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}]),n}(mt.exports.Component),sb=function(e){s(n,e);var t=u(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).stageVolume=0,r.updateVolumeTimer=0,r.onVolumeSeeking=!1,r.onClickOperationButton=function(){r.props.paused?r.props.play():r.props.pause()},r.operationButton=function(){return r.props.paused?ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},r.operationVolumeButton=function(){return r.props.volume>.9?ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):0===r.props.volume?ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="})},r.handleClickVolume=function(){0===r.props.volume?0!==r.stageVolume?r.props.setVolume(r.stageVolume):r.props.setVolume(1):(r.stageVolume=r.props.volume,r.props.setVolume(0))},r.onChange=function(e){r.setState({currentTime:e}),e&&r.changeTime(e)},r.changeTime=ob((function(e){r.props.setCurrentTime(e)}),50),r.onVolumeChange=function(e){r.changeVolume(e),r.setState({seekVolume:e/100})},r.changeVolume=ob((function(e){r.props.setVolume(e/100)}),50),r.onVolumeSeekStart=function(){r.onVolumeSeeking=!0},r.onVolumeSeekEnd=ob((function(){r.onVolumeSeeking=!1}),500),r.onProgressSeekStart=function(){return r.setState({isPlayerSeeking:!0})},r.onProgressSeekEnd=ob((function(){r.setState({isPlayerSeeking:!1})}),500),r.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},r.stageVolume=e.volume,r}return x(n,[{key:"componentDidMount",value:function(){var e=this;this.updateVolumeTimer=setInterval((function(){e.onVolumeSeeking||e.setState({seekVolume:e.props.volume}),e.state.isPlayerSeeking||e.setState({currentTime:e.props.currentTime})}),100)}},{key:"componentWillUnmount",value:function(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}},{key:"render",value:function(){var e=this,t=this.props,n=t.duration,r=t.currentTime;return ln.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},ln.createElement("div",{className:"player-controller-progress"},ln.createElement(ab,{total:n,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),ln.createElement("div",{className:"player-controller-actions"},ln.createElement("div",{className:"player-controller-actions-left"},ln.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),ln.createElement("div",{className:"player-volume-box",onMouseEnter:function(){return e.setState({isVolumeHover:!0})},onMouseLeave:function(){return e.setState({isVolumeHover:!1})}},ln.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),ln.createElement("div",{className:"player-volume-slider"},ln.createElement(ab,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),ln.createElement("div",{className:"player-mid-box-time"},ub(Math.floor(r/1e3))," /"," ",ub(Math.floor(n/1e3)))))}}]),n}(mt.exports.Component);function ub(e){var t=e%60,n=(e-t)/60;if(n>=60){var r=n%60;return"".concat(lb((n-r)/60),":").concat(lb(r),":").concat(lb(t))}return"".concat(lb(n),":").concat(lb(t))}function lb(e){return e<=9?"0".concat(e):"".concat(e)}var cb=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).putAttributes=function(t){var n=e.props.context,r=n.getAttributes()||{};for(var i in t)r[i]!==t[i]&&n.updateAttributes([i],t[i])},e}return x(n,[{key:"render",value:function(){var e=this.props.context,t=e.getRoom(),n=t?void 0:e.getDisplayer(),r=this.putAttributes;return ln.createElement(hb,{room:t,player:n,context:e,plugin:{putAttributes:r}})}}]),n}(mt.exports.Component),hb=function(e){s(n,e);var t=u(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).alertMask=null,r.container=ln.createRef(),r.controllerHiddenTimer=0,r.syncPlayerTimer=0,r.retryCount=0,r.decreaseRetryTimer=0,r.noSoundSyncCount=0,r.showController=function(){r.setState({controllerVisible:!0}),r.debounceHidingController()},r.play=function(){var e,t=null==(e=r.props.room)?void 0:e.calibrationTimestamp;r.debug(">>> play",{paused:!1,hostTime:t}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!1,hostTime:t})},r.pause=function(){var e=Ry(r.getAttributes(),r.props);r.debug(">>> pause",{paused:!0,currentTime:e}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!0,currentTime:e})},r.setVolume=function(e){r.debug(">>> volume",{volume:e}),r.isEnabled()&&r.props.plugin.putAttributes({volume:e}),r.isEnabled()&&r.props.plugin.putAttributes({volume:e,muted:0===e})},r.setCurrentTime=function(e){var t,n=null==(t=r.props.room)?void 0:t.calibrationTimestamp;r.debug(">>> seek",{currentTime:e/1e3,hostTime:n}),r.isEnabled()&&r.props.plugin.putAttributes({currentTime:e/1e3,hostTime:n})},r.resetPlayer=function(){var e;null==(e=r.player)||e.autoplay(!1),r.state.NoSound||(r.debug(">>> ended",{paused:!0,currentTime:0}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!0,currentTime:0}))},r.syncPlayerWithAttributes=function(){var e,t=r.getAttributes();if(t){var n=r.player;if(n&&(!r.state.NoSound||(r.noSoundSyncCount+=1)%8==0)){n.paused()!==t.paused&&(r.debug("<<< paused -> %o",t.paused),t.paused?n.pause():null==(e=n.play())||e.catch(r.catchPlayFail)),n.muted()!==t.muted&&(r.debug("<<< muted -> %o",t.muted),n.muted(t.muted)),n.volume()!==t.volume&&(r.debug("<<< volume -> %o",t.volume),n.volume(t.volume));var i=Ry(t,r.props),o=Oy.currentTimeMaxError;r.state.NoSound&&(o*=3),i>n.duration()?r.resetPlayer():Math.abs(n.currentTime()-i)>o&&(r.debug("<<< currentTime -> %o",i),n.currentTime(i))}}},r.debounceHidingController=function(){r.controllerHiddenTimer&&(clearTimeout(r.controllerHiddenTimer),r.controllerHiddenTimer=0),r.controllerHiddenTimer=setTimeout((function(){r.setState({controllerVisible:!1}),r.controllerHiddenTimer=0}),3e3)},r.decreaseRetryCount=function(){r.player&&r.retryCount>0&&(r.retryCount=r.retryCount-1)},r.catchPlayFail=function(e){var t,n,i=String(e);if(Ly&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=r.player)||t.autoplay("any"),r.setState({NoSound:!0});else{var o=null==(n=r.player)?void 0:n.error();o&&(r.retryCount<=3?(r.initPlayer(),r.retryCount=r.retryCount+1):(r.debug("catch videojs media error",o),r.setState({MediaError:!0}))),r.debug("catch error",e)}},r.fixPlayFail=function(){r.debug("try to fix play state"),r.setState({NoSound:!1});var e=r.getAttributes(),t=e.muted,n=e.volume;r.player&&(r.player.muted(t),r.player.volume(n))},r.initPlayer=g(regeneratorRuntime.mark((function e(){var t,n,i,o,a,s,u,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=r.player)||t.dispose(),r.player=void 0,r.debug("creating elements ..."),n=r.getAttributes(),i=n.type,o=n.src,a=n.poster,(s=document.createElement("div")).setAttribute("data-vjs-player",""),(u=document.createElement("video")).className="video-js",a&&(u.poster=a),u.setAttribute("playsInline",""),u.setAttribute("webkit-playsinline",""),l=document.createElement("source"),new URL(o).pathname.endsWith(".m3u8")?l.type="application/x-mpegURL":u.src=o,l.src=o,i&&(l.type=i),u.appendChild(l),s.appendChild(u),r.container.current.appendChild(s),e.next=14,new Promise((function(e){return(window.requestAnimationFrame||window.setTimeout)(e)}));case 14:r.debug("initializing videojs() ..."),c=Z.default(u),r.player=c,window.player=c,c.one("loadedmetadata",r.gracefullyUpdate),c.on("ready",(function(){var e;null==(e=Oy.onPlayer)||e.call(Oy,c),c.on("timeupdate",r.gracefullyUpdate),c.on("volumechange",r.gracefullyUpdate),c.on("seeked",r.gracefullyUpdate),c.on("play",r.gracefullyUpdate),c.on("pause",r.gracefullyUpdate),c.on("ended",r.resetPlayer)})),c.on("error",r.catchPlayFail),r.setState({MediaError:!1});case 17:case"end":return e.stop()}}),e)}))),r.gracefullyUpdate=function(){return r.setState({updater:!r.state.updater})},r.setupAlert=function(e){e&&(e.addEventListener("touchstart",r.fixPlayFail),e.addEventListener("click",r.fixPlayFail)),r.alertMask=e},r.setupReload=function(e){e&&(e.addEventListener("touchstart",r.initPlayer),e.addEventListener("click",r.initPlayer))},r.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/app-media-player@0.1.0-alpha.5 requires white-web-sdk@^2.13.8 to work properly.")}(e.room),r}return x(n,[{key:"getAttributes",value:function(){var e=this.props.context.getAttributes();if(e){if(e=ky(ky({},Dy),e),this.player){var t=Ry(e,this.props),n=this.player.duration();!e.paused&&t>n&&(r=ky({},e),e=Sy(r,Ey({currentTime:0,paused:!0})),this.resetPlayer())}var r;return e}}},{key:"isShowingPoster",value:function(){var e=this.getAttributes();return!(null!=e&&e.src)||jy.some((function(t){return e.src.endsWith(t)}))}},{key:"render",value:function(){var e,t;if(!this.props.room&&!this.props.player)return null;var n=this.getAttributes();if(!n)return null;var r=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),i=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return ln.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},ln.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&ln.createElement("div",{className:"video-js-plugin-poster"},n.poster&&ln.createElement("img",{src:n.poster,alt:"",draggable:!1})),ln.createElement(sb,{duration:r,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Ry(n,this.props),setCurrentTime:this.setCurrentTime,buffered:r*i,visible:!0}),this.state.NoSound&&ln.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&ln.createElement("div",{className:"videojs-plugin-recovery-mode"},ln.createElement("button",{ref:this.setupReload},"Reload Player")))}},{key:"debug",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:B.AnimationMode.Immediately;if(this.inDisplaySceneDir){var t=this.attributes,n=t.width,r=void 0===n?1280:n,i=t.height,o=void 0===i?720:i,a=r?-r/2:0,s=o?-o/2:0;this.manager.moveCameraToContain({originX:a,originY:s,width:r,height:o,animationMode:e})}}},{key:"handleSetPage",value:function(e){if(!this.isReplay&&this.attributes.displaySceneDir){var t=e.payload,n=this.displayer,r=n.entireScenes()[this.attributes.displaySceneDir];if(!r||r.length!==t){var i=function(e,t){return new Array(e).fill(0).map((function(e,n){return t(n)}))}(t,(function(e){return{name:String(e+1)}}));n.putScenes(this.attributes.displaySceneDir,i),this.manager.setMainViewScenePath(this.attributes.displaySceneDir)}}}},{key:"listenIframe",value:function(t){var n=this;t.url&&this.iframe.src!==t.url&&(this.src_url_equal_anchor||(this.src_url_equal_anchor=document.createElement("a")),this.src_url_equal_anchor.href=t.url,this.src_url_equal_anchor.href!==this.iframe.src&&(this.iframe.src=t.url)),this.iframe.width="".concat(t.width,"px"),this.iframe.height="".concat(t.height,"px"),this.sideEffectManager.addEventListener(this.iframe,"load",(function(t){var r;n.postMessage({kind:"Init",payload:{attributes:n.attributes,roomState:null==(r=e.displayer)?void 0:r.state,currentPage:n.currentPage,observerId:n.displayer.observerId}}),e.emitter.emit("IframeLoad",t),n.sideEffectManager.addDisposer(e.emitter.on("Ready",(function(){var e;n.postMessage(null==(e=n.attributes.lastEvent)?void 0:e.payload)})),mb),n.computedStyleAndIframeDisplay()}),void 0,xb)}},{key:"listenDisplayerState",value:function(){var e=this;this.isReplay&&(this.displayer._phase===B.PlayerPhase.Playing&&this.computedStyleAndIframeDisplay(),this.sideEffectManager.add((function(){return e.displayer.callbacks.on("onPhaseChanged",e.onPhaseChangedListener),function(){return e.displayer.callbacks.off("onPhaseChanged",e.onPhaseChangedListener)}}),_b)),this.computedStyleAndIframeDisplay()}},{key:"computedStyleAndIframeDisplay",value:function(){this.computedStyle(this.displayer.state),this.computedIframeDisplay(this.displayer.state,this.attributes)}},{key:"listenDisplayerCallbacks",value:function(){this.displayer.callbacks.on(this.callbackName,this.stateChangeListener)}},{key:"computedStyle",value:function(e){var t=this.manager.cameraState,n=this.attributes.width||1280,r=this.attributes.height||720;if(this.iframe){var i=t.width,o=t.height,a=t.scale,s=t.centerX,u=t.centerY,l=this.rootRect||{x:0,y:0},c="".concat(i/2+l.x,"px"),h="".concat(o/2+l.y,"px"),d=-u*a+(o-r)/2*a,f=["position: absolute;","border: 0.1px solid rgba(0,0,0,0);","top: 0px;","left: 0px;","transform-origin: ".concat(c," ").concat(h,";"),"transform: translate(".concat(-s*a+(i-n)/2*a,"px,").concat(d,"px) scale(").concat(a,", ").concat(a,");")];this.cssList=f,this.computedZindex(),this.updateStyle()}}},{key:"computedIframeDisplay",value:function(t,n){this.inDisplaySceneDir?e.emitter.emit("DispayIframe"):e.emitter.emit("HideIframe")}},{key:"computedZindex",value:function(){var e="z-index: -1;",t=this.cssList.findIndex((function(t){return t===e}));-1!==t&&this.cssList.splice(t,1),(!this.isClicker()||this.isDisableInput)&&this.cssList.push(e)}},{key:"updateStyle",value:function(){this.iframe.style.cssText=this.cssList.join(" ")}},{key:"messageListener",value:function(e){if(tt("<<<",JSON.stringify(e.data)),e.origin===this.iframeOrigin){var t=e.data;switch(t.kind){case"SetAttributes":this.handleSetAttributes(t);break;case"RegisterMagixEvent":this.handleRegisterMagixEvent(t);break;case"RemoveMagixEvent":this.handleRemoveMagixEvent(t);break;case"DispatchMagixEvent":this.handleDispatchMagixEvent(t);break;case"RemoveAllMagixEvent":this.handleRemoveAllMagixEvent();break;case"NextPage":this.handleNextPage();break;case"PrevPage":this.handlePrevPage();break;case"SDKCreate":this.handleSDKCreate();break;case"SetPage":this.handleSetPage(t);break;case"GetAttributes":this.handleGetAttributes();break;case"PageTo":this.handlePageTo(t);break;default:tt("".concat(t.kind," not allow event."))}}}},{key:"handleSDKCreate",value:function(){this.postMessage({kind:"Init",payload:{attributes:this.attributes,roomState:this.displayer.state,currentPage:this.currentPage,observerId:this.displayer.observerId}})}},{key:"handleDispatchMagixEvent",value:function(e){var t=e.payload;this.appManager.safeDispatchMagixEvent(t.event,t.payload)}},{key:"handleSetAttributes",value:function(e){this.setAttributes(e.payload)}},{key:"handleRegisterMagixEvent",value:function(e){var t=this,n=e.payload,r=function(e){e.authorId!==t.displayer.observerId&&t.postMessage({kind:"ReciveMagixEvent",payload:e})};this.magixEventMap.set(n,r),this.displayer.addMagixEventListener(n,r)}},{key:"handleRemoveMagixEvent",value:function(e){var t=e.payload,n=this.magixEventMap.get(t);this.displayer.removeMagixEventListener(t,n)}},{key:"handleNextPage",value:function(){this.manager.canOperate&&(this.manager.nextPage(),this.dispatchMagixEvent("NextPage",{}))}},{key:"handlePrevPage",value:function(){this.manager.canOperate&&(this.manager.prevPage(),this.dispatchMagixEvent("PrevPage",{}))}},{key:"handlePageTo",value:function(e){if(this.manager.canOperate){var t=e.payload;if(!Number.isSafeInteger(t)||t<=0)return;this.manager.setMainViewSceneIndex(t-1),this.dispatchMagixEvent("PageTo",t-1)}}},{key:"handleRemoveAllMagixEvent",value:function(){var e=this;this.magixEventMap.forEach((function(t,n){e.displayer.removeMagixEventListener(n,t)})),this.magixEventMap.clear()}},{key:"handleGetAttributes",value:function(){this.postMessage({kind:"GetAttributes",payload:this.attributes})}},{key:"postMessage",value:function(e){var t;this.iframe&&(null==(t=this.iframe.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),"*"))}},{key:"dispatchMagixEvent",value:function(e,t){this.manager.canOperate&&(this.setAttributes({lastEvent:{name:e,payload:t}}),this.displayer.dispatchMagixEvent(e,t))}},{key:"isClicker",value:function(){if(this.readonly)return!1;var e=this.displayer.state.memberState.currentApplianceName;return this.allowAppliances.includes(e)}},{key:"attributes",get:function(){return this.appManager.store.getIframeBridge()}},{key:"isReplay",get:function(){return this.manager.isReplay}},{key:"callbackName",get:function(){return this.isReplay?"onPlayerStateChanged":"onRoomStateChanged"}},{key:"iframeOrigin",get:function(){if(this.iframe)try{return new URL(this.iframe.src).origin}catch(e){console.warn(e)}}},{key:"currentIndex",get:function(){return this.manager.mainViewSceneIndex}},{key:"currentPage",get:function(){return this.currentIndex+1}},{key:"totalPage",get:function(){return this.manager.mainViewScenesLength}},{key:"readonly",get:function(){return!this.displayer.isWritable}},{key:"inDisplaySceneDir",get:function(){return this.manager.mainViewSceneDir===this.attributes.displaySceneDir}},{key:"isDisableInput",get:function(){return!("disableDeviceInputs"in this.displayer)||this.displayer.disableDeviceInputs}}],[{key:"onCreate",value:function(t){e.emitter.emit("StartCreate"),e.emitter.emit("OnCreate",t),e.emitter.emit("created")}}]),e}(),Sb=Mb;Sb.kind="IframeBridge",Sb.hiddenClass="netless-iframe-brdige-hidden",Sb.emitter=new Q.default,Sb.displayer=null,Sb.alreadyCreate=!1;var Eb=new xo({emitter:ue}),Ab=function(e){s(b,e);var t,n,r,i,o,a,l,c,h,d,f,p,v,m=u(b);function b(e){var t;return y(this,b),(t=m.call(this,e)).version="0.4.66-beta.0",t.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.27",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^0.1.5",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.17","@netless/app-media-player":"0.1.0-beta.5","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",jspdf:"^2.5.1",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3",vitest:"^0.14.1","white-web-sdk":"2.16.43"}},t.emitter=ae,t.viewMode=B.ViewMode.Broadcaster,t.isReplay=B.isPlayer(t.displayer),t.containerSizeRatio=b.containerSizeRatio,b.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.27",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^0.1.5",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.17","@netless/app-media-player":"0.1.0-beta.5","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",jspdf:"^2.5.1",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3",vitest:"^0.14.1","white-web-sdk":"2.16.43"}},t}return x(b,[{key:"bindContainer",value:function(e){var t,n,r,i,o,a;if(B.isRoom(this.displayer)&&this.room.phase!==B.RoomPhase.Connected)throw new Ge;if(b.isCreated&&b.container)b.container.firstChild&&e.appendChild(b.container.firstChild);else if(b.params){var s=b.params,u=b.initContainer(this,e,s);this.boxManager&&this.boxManager.destroy();var l=function(e,t,n,r,i){return new Ii({safeSetAttributes:function(t){return e.safeSetAttributes(t)},getMainView:function(){return e.mainView},updateAppState:function(){var t,n;return null==(n=e.appManager)?void 0:(t=n.store).updateAppState.apply(t,arguments)},canOperate:function(){return e.canOperate},notifyContainerRectUpdate:function(t){var n;return null==(n=e.appManager)?void 0:n.notifyContainerRectUpdate(t)},cleanFocus:function(){var t;return null==(t=e.appManager)?void 0:t.store.cleanFocus()},setAppFocus:function(t){var n;return null==(n=e.appManager)?void 0:n.store.setAppFocus(t,!0)},callbacks:t,emitter:n,boxEmitter:r},i)}(this,ae,ue,rt,{collectorContainer:s.collectorContainer,collectorStyles:s.collectorStyles,prefersColorScheme:s.prefersColorScheme});this.boxManager=l,null==(t=this.appManager)||t.setBoxManager(l),this.bindMainView(u,s.disableCameraTransform),b.wrapper&&(null==(n=this.cursorManager)||n.setupWrapper(b.wrapper))}ue.emit("updateManagerRect"),null==(r=this.appManager)||r.refresh(),null==(i=this.appManager)||i.resetMaximized(),null==(o=this.appManager)||o.resetMinimized(),null==(a=this.appManager)||a.displayerWritableListener(!this.room.isWritable),b.container=e}},{key:"bindCollectorContainer",value:function(e){b.isCreated&&this.boxManager?this.boxManager.setCollectorContainer(e):b.params&&(b.params.collectorContainer=e)}},{key:"addApp",value:(v=g(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=2;break}return e.abrupt("return",this.appManager.rootDirRemoving?new Promise((function(e,r){ue.once("rootDirRemoved").then(g(regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,n._addApp(t);case 3:o=i.sent,e(o),i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),r(i.t0.message);case 10:case"end":return i.stop()}}),i,null,[[0,7]])}))))})):this._addApp(t));case 2:throw new Le;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"_addApp",value:(p=g(regeneratorRuntime.mark((function e(t){var n,r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=20;break}if(t.kind&&"string"==typeof t.kind){e.next=3;break}throw new Be;case 3:return e.next=5,null==(n=xe.appClasses.get(t.kind))?void 0:n();case 5:if(!((o=e.sent)&&(null==(r=o.config)?void 0:r.singleton)&&this.appManager.appProxies.has(t.kind))){e.next=8;break}throw new Oe;case 8:if(void 0!==(a=this.setupScenePath(t,this.appManager))){e.next=13;break}e.t0=void 0,e.next=17;break;case 13:return null!=(i=null==t?void 0:t.options)&&i.scenePath&&(t.options.scenePath=Ce(t.options.scenePath)),e.next=16,this.appManager.addApp(t,Boolean(a));case 16:e.t0=e.sent;case 17:return e.abrupt("return",e.t0);case 20:throw new Le;case 21:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"setupScenePath",value:function(e,t){var n=!1;if(e.options){var r=e.options,i=r.scenePath,o=r.scenes;if(i){if(!function(e){return e.startsWith("/")}(i))throw new Fe;for(var a=0,s=Object.keys(this.apps||{});a0&&(this.isDynamicPPT(o)?(n=!0,Ee(this.displayer)[i]||Ae(this.room,i,o)):Ee(this.displayer)[i]||Ae(this.room,i,[{name:o[0].name}])),i&&void 0===o&&Ae(this.room,i,[{}])}return n}},{key:"setMainViewScenePath",value:(f=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.appManager,!e.t0){e.next=4;break}return e.next=4,this.appManager.setMainViewScenePath(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(d=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.appManager,!e.t0){e.next=4;break}return e.next=4,this.appManager.setMainViewSceneIndex(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"nextPage",value:(h=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=12;break}if(!((t=this.mainViewSceneIndex+1)>=this.mainViewScenesLength)){e.next=6;break}e.t0=(console.warn("[WindowManager]: current page is the last page"),!1),e.next=9;break;case 6:return e.next=8,this.appManager.setMainViewSceneIndex(t);case 8:e.t0=!0;case 9:return e.abrupt("return",e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"prevPage",value:(c=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=12;break}if(!((t=this.mainViewSceneIndex-1)<0)){e.next=6;break}e.t0=(console.warn("[WindowManager]: current page is the first page"),!1),e.next=9;break;case 6:return e.next=8,this.appManager.setMainViewSceneIndex(t);case 8:e.t0=!0;case 9:return e.abrupt("return",e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"jumpPage",value:(l=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=11;break}if(!(t<0||t>=this.pageState.length)){e.next=5;break}e.t1=(console.warn("[WindowManager]: index ".concat(t," out of range")),!1),e.next=8;break;case 5:return e.next=7,this.appManager.setMainViewSceneIndex(t);case 7:e.t1=!0;case 8:e.t0=e.t1,e.next=12;break;case 11:e.t0=!1;case 12:return e.abrupt("return",e.t0);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"addPage",value:(a=g(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appManager&&(n=null==t?void 0:t.after,r=null==t?void 0:t.scene,n?(i=this.mainViewSceneIndex+1,this.room.putScenes(ie,[r||{}],i)):this.room.putScenes(ie,[r||{}]));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"removePage",value:(o=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=5;break}return n=void 0===t?this.pageState.index:t,e.abrupt("return",1===this.pageState.length?(console.warn("[WindowManager]: can not remove the last page"),!1):n<0||n>=this.pageState.length?(console.warn("[WindowManager]: index ".concat(t," out of range")),!1):this.appManager.removeSceneByIndex(n));case 5:return e.abrupt("return",!1);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getMainViewScenePath",value:function(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewScenePath()}},{key:"getMainViewSceneIndex",value:function(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewSceneIndex()}},{key:"setReadonly",value:function(e){var t;this.readonly=e,null==(t=this.boxManager)||t.setReadonly(e),ue.emit("setReadonly",e)}},{key:"switchMainViewToWriter",value:function(){var e;return null==(e=this.appManager)?void 0:e.mainViewProxy.mainViewClickHandler()}},{key:"onAppDestroy",value:function(e,t){!function(e,t){ue.once(e).then(t)}("destroy-".concat(e),t)}},{key:"onAppEvent",value:function(e,t){return ue.on("custom-".concat(e),t)}},{key:"setViewMode",value:function(e){var t,n,r,i;(e===B.ViewMode.Broadcaster||e===B.ViewMode.Follower)&&(this.canOperate&&e===B.ViewMode.Broadcaster&&(null==(t=this.appManager)||t.mainViewProxy.setCameraAndSize()),null==(n=this.appManager)||n.mainViewProxy.start()),e===B.ViewMode.Freedom&&(null==(r=this.appManager)||r.mainViewProxy.stop()),this.viewMode=e,null==(i=this.appManager)||i.mainViewProxy.setViewMode(e)}},{key:"setBoxState",value:function(e){if(this.canOperate)switch(e){case"normal":this.setMaximized(!1),this.setMinimized(!1);break;case"maximized":this.setMaximized(!0),this.setMinimized(!1);break;case"minimized":this.setMinimized(!0)}}},{key:"setMaximized",value:function(e){var t;!this.canOperate||null==(t=this.boxManager)||t.setMaximized(e,!1)}},{key:"setMinimized",value:function(e){var t;!this.canOperate||null==(t=this.boxManager)||t.setMinimized(e,!1)}},{key:"setFullscreen",value:function(e){var t;this._fullscreen!==e&&(this._fullscreen=e,null==(t=b.sizer)||t.classList.toggle("netless-window-manager-fullscreen",e),ae.emit("fullscreenChange",e))}},{key:"queryAll",value:function(){var e;return Array.from((null==(e=this.appManager)?void 0:e.appProxies.values())||[])}},{key:"queryOne",value:function(e){var t;return null==(t=this.appManager)?void 0:t.appProxies.get(e)}},{key:"closeApp",value:(i=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null==(n=this.appManager)?void 0:n.closeApp(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"focusApp",value:function(e){var t,n,r,i=null==(t=this.boxManager)?void 0:t.getBox(e);i&&(null==(n=this.boxManager)||n.focusBox({appId:e},!1),(null==(r=this.boxManager)?void 0:r.teleBoxManager).makeBoxTop(i,!1))}},{key:"moveCamera",value:function(e){var t,n=this,r=j.omit(e,["animationMode"]),i=P({},this.mainView.camera);j.isEqual(P(P({},i),r),i)||(this.mainView.moveCamera(e),null==(t=this.appManager)||t.dispatchInternalEvent(q.MoveCamera,e),setTimeout((function(){var e;null==(e=n.appManager)||e.mainViewProxy.setCameraAndSize()}),500))}},{key:"moveCameraToContain",value:function(e){var t,n=this;this.mainView.moveCameraToContain(e),null==(t=this.appManager)||t.dispatchInternalEvent(q.MoveCameraToContain,e),setTimeout((function(){var e;null==(e=n.appManager)||e.mainViewProxy.setCameraAndSize()}),500)}},{key:"convertToPointInWorld",value:function(e){return this.mainView.convertToPointInWorld(e)}},{key:"setCameraBound",value:function(e){this.mainView.setCameraBound(e)}},{key:"onDestroy",value:function(){this._destroy()}},{key:"destroy",value:function(){this._destroy()}},{key:"_destroy",value:function(){var e,t,n,r,i;null==(e=this.containerResizeObserver)||e.disconnect(),null==(t=this.appManager)||t.destroy(),null==(n=this.cursorManager)||n.destroy(),b.container=void 0,b.wrapper=void 0,b.sizer=void 0,b.isCreated=!1,b.playground&&(null==(r=b.playground.parentNode)||r.removeChild(b.playground)),b.params=void 0,null==(i=this._iframeBridge)||i.destroy(),this._iframeBridge=void 0,tt("Destroyed")}},{key:"bindMainView",value:function(e,t){var n;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),null==(n=this.cursorManager)||n.setMainViewDivElement(e))}},{key:"safeSetAttributes",value:function(e){this.canOperate&&this.setAttributes(e)}},{key:"safeUpdateAttributes",value:function(e,t){this.canOperate&&this.updateAttributes(e,t)}},{key:"setPrefersColorScheme",value:function(e){var t,n;null==(n=null==(t=this.appManager)?void 0:t.boxManager)||n.setPrefersColorScheme(e)}},{key:"cleanCurrentScene",value:function(){var e;tt("clean current scene"),null==(e=this.focusedView)||e.cleanCurrentScene()}},{key:"redo",value:function(){var e;return(null==(e=this.focusedView)?void 0:e.redo())||0}},{key:"undo",value:function(){var e;return(null==(e=this.focusedView)?void 0:e.undo())||0}},{key:"delete",value:function(){var e;null==(e=this.focusedView)||e.delete()}},{key:"copy",value:function(){var e;null==(e=this.focusedView)||e.copy()}},{key:"paste",value:function(){var e;null==(e=this.focusedView)||e.paste()}},{key:"duplicate",value:function(){var e;null==(e=this.focusedView)||e.duplicate()}},{key:"insertText",value:function(e,t,n){var r;return(null==(r=this.focusedView)?void 0:r.insertText(e,t,n))||""}},{key:"insertImage",value:function(e){var t;return null==(t=this.focusedView)?void 0:t.insertImage(e)}},{key:"completeImageUpload",value:function(e,t){var n;return null==(n=this.focusedView)?void 0:n.completeImageUpload(e,t)}},{key:"lockImage",value:function(e,t){var n;return null==(n=this.focusedView)?void 0:n.lockImage(e,t)}},{key:"lockImages",value:function(e){var t;return null==(t=this.focusedView)?void 0:t.lockImages(e)}},{key:"refresh",value:function(){var e;this._refresh(),null==(e=this.appManager)||e.dispatchInternalEvent(q.Refresh)}},{key:"_refresh",value:function(){var e,t,n;null==(e=this.appManager)||e.mainViewProxy.rebind(),b.container&&this.bindContainer(b.container),null==(n=null==(t=this.appManager)?void 0:t.refresher)||n.refresh()}},{key:"setContainerSizeRatio",value:function(e){if(!(j.isNumber(e)&&e>0))throw new Error("[WindowManager]: updateContainerSizeRatio error, ratio must be a positive number. but got ".concat(e));b.containerSizeRatio=e,this.containerSizeRatio=e,ue.emit("containerSizeRatioUpdate",e)}},{key:"isDynamicPPT",value:function(e){var t,n,r=null==(n=null==(t=e[0])?void 0:t.ppt)?void 0:n.src;return null==r?void 0:r.startsWith("pptx://")}},{key:"ensureAttributes",value:(r=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=j.isNull(this.attributes),!e.t0){e.next=4;break}return e.next=4,ke(50);case 4:j.isObject(this.attributes)&&(this.attributes[$e.Apps]||this.safeSetAttributes(w({},$e.Apps,{})),this.attributes[$e.Cursors]||this.safeSetAttributes(w({},$e.Cursors,{})),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:oe}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[$e.Registered]||this.safeSetAttributes(w({},$e.Registered,{})),this.attributes[$e.IframeBridge]||this.safeSetAttributes(w({},$e.IframeBridge,{})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getIframeBridge",value:function(){if(!this.appManager)throw new Error("[WindowManager]: should call getIframeBridge() after await mount()");return this._iframeBridge||(this._iframeBridge=new Sb(this,this.appManager)),this._iframeBridge}},{key:"mainView",get:function(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new Le}},{key:"camera",get:function(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new Le}},{key:"cameraState",get:function(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new Le}},{key:"apps",get:function(){var e;return null==(e=this.appManager)?void 0:e.store.apps()}},{key:"boxState",get:function(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.boxState;throw new Le}},{key:"darkMode",get:function(){var e,t;return Boolean(null==(t=null==(e=this.appManager)?void 0:e.boxManager)?void 0:t.darkMode)}},{key:"prefersColorScheme",get:function(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.prefersColorScheme;throw new Le}},{key:"focused",get:function(){return this.attributes.focus}},{key:"focusedView",get:function(){var e,t;return(null==(t=null==(e=this.appManager)?void 0:e.focusApp)?void 0:t.view)||this.mainView}},{key:"mainViewSceneIndex",get:function(){var e;return(null==(e=this._pageState)?void 0:e.index)||0}},{key:"mainViewSceneDir",get:function(){var e;if(this.appManager)return null==(e=this.appManager)?void 0:e.getMainViewSceneDir();throw new Le}},{key:"topApp",get:function(){var e,t;return null==(t=null==(e=this.boxManager)?void 0:e.getTopBox())?void 0:t.id}},{key:"mainViewScenesLength",get:function(){var e;return(null==(e=this._pageState)?void 0:e.length)||0}},{key:"canRedoSteps",get:function(){var e;return(null==(e=this.focusedView)?void 0:e.canRedoSteps)||0}},{key:"canUndoSteps",get:function(){var e;return(null==(e=this.focusedView)?void 0:e.canUndoSteps)||0}},{key:"sceneState",get:function(){if(this.appManager)return this.appManager.sceneState;throw new Le}},{key:"pageState",get:function(){if(this._pageState)return this._pageState.toObject();throw new Le}},{key:"fullscreen",get:function(){return Boolean(this._fullscreen)}},{key:"canOperate",get:function(){return!!B.isRoom(this.displayer)&&(this.displayer.isWritable&&this.displayer.phase===B.RoomPhase.Connected)}},{key:"room",get:function(){return this.displayer}}],[{key:"mount",value:(n=g(regeneratorRuntime.mark((function e(t){var n,r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.room,b.container=t.container,r=t.containerSizeRatio,i=t.debug,o=t.cursor,b.params=t,b.displayer=t.room,ht(),!B.isRoom(n)){e.next=11;break}if(n.phase===B.RoomPhase.Connected){e.next=7;break}throw new Error("[WindowManager]: Room only Connected can be mount");case 7:return n.phase===B.RoomPhase.Connected&&n.isWritable&&(n.disableSerialization=!1),e.next=10,this.initManager(n);case 10:a=e.sent;case 11:if(!b.isCreated){e.next=13;break}throw new Error("[WindowManager]: Already created cannot be created again");case 13:if(this.debug=Boolean(i),tt("Already insert room",a),!B.isRoom(this.displayer)){e.next=18;break}if(a){e.next=16;break}throw new Error("[WindowManager]: init InvisiblePlugin failed");case 16:e.next=20;break;case 18:return e.next=20,X.default(function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.getInvisiblePlugin(b.kind);case 2:if(a=e.sent){e.next=5;break}throw tt("manager is empty. retrying ".concat(t)),new Error;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),{retries:10,maxTimeout:5e3});case 20:if(a){e.next=22;break}throw new Error("[WindowManager]: create manager failed");case 22:return r&&(b.containerSizeRatio=r),e.next=25,a.ensureAttributes();case 25:return a._fullscreen=t.fullscreen,a.appManager=new ct(a),a._pageState=new bo(a.appManager),a.cursorManager=new yo(a.appManager,Boolean(o),t.applianceIcons),r&&(a.containerSizeRatio=r),t.container&&a.bindContainer(t.container),_o(n,a),ue.emit("onCreated"),b.isCreated=!0,e.prev=34,e.next=37,le();case 37:e.next=42;break;case 39:e.prev=39,e.t0=e.catch(34),console.warn("[WindowManager]: indexedDB open failed"),console.log(e.t0);case 42:return e.abrupt("return",a);case 43:case"end":return e.stop()}}),e,this,[[34,39]])}))),function(e){return n.apply(this,arguments)})},{key:"initManager",value:(t=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=t.getInvisiblePlugin(b.kind))||!B.isRoom(t)){e.next=24;break}if(!1!==t.isWritable){e.next=21;break}return e.prev=3,e.next=6,t.setWritable(!0);case 6:e.next=11;break;case 8:throw e.prev=8,e.t0=e.catch(3),new Error("[WindowManger]: room must be switched to be writable");case 11:return e.next=13,ft(t);case 13:return null==(n=e.sent)||n.ensureAttributes(),e.next=17,ke(500);case 17:return e.next=19,t.setWritable(!1);case 19:e.next=24;break;case 21:return e.next=23,ft(t);case 23:n=e.sent;case 24:return e.abrupt("return",n);case 25:case"end":return e.stop()}}),e,null,[[3,8]])}))),function(e){return t.apply(this,arguments)})},{key:"initContainer",value:function(e,t,n){var r=n.chessboard,i=n.overwriteStyles,o=n.fullscreen;b.container||(b.container=t);var a=function(e){var t=document.createElement("div");t.className="netless-window-manager-playground";var n=document.createElement("div");n.className="netless-window-manager-sizer";var r=document.createElement("div");r.className="netless-window-manager-wrapper";var i=document.createElement("div");return i.className="netless-window-manager-main-view",t.appendChild(n),n.appendChild(r),r.appendChild(i),e.appendChild(t),Ib.wrapper=r,{playground:t,wrapper:r,sizer:n,mainViewElement:i}}(t),s=a.playground,u=a.wrapper,l=a.sizer,c=a.mainViewElement;if(b.playground=s,r&&l.classList.add("netless-window-manager-chess-sizer"),o&&l.classList.add("netless-window-manager-fullscreen"),i){var h=document.createElement("style");h.textContent=i,s.appendChild(h)}return e.containerResizeObserver=vt.create(s,l,u,ue),b.wrapper=u,b.sizer=l,c}},{key:"register",value:function(e){return xe.register(e)}},{key:"unregister",value:function(e){return xe.unregister(e)}},{key:"registered",get:function(){return xe.registered}}]),b}(B.InvisiblePlugin),Ib=Ab;Ib.kind="WindowManager",Ib.debug=!1,Ib.containerSizeRatio=9/16,Ib.isCreated=!1,Ib.debug&&function(e){Oy=ky(ky({},Py),e)}({verbose:!0}),Ib.register({kind:wu.kind,src:wu}),Ib.register({kind:db.kind,src:db}),t.AppCreateError=Oe,t.AppManagerNotInitError=Le,t.AppNotRegisterError=Re,t.BindContainerRoomPhaseInvalidError=Ge,t.BoxManagerNotFoundError=ze,t.BoxNotCreatedError=Ue,t.BuiltinApps=fb,t.DomEvents=vb,t.IframeBridge=Sb,t.IframeEvents=pb,t.InvalidScenePath=Fe,t.ParamsInvalidError=Be,t.WhiteWebSDKInvalidError=je,t.WindowManager=Ib,t.calculateNextIndex=nt,t.reconnectRefresher=Eb},6513:function(e,t,n){var r=n(49766).Buffer;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.xml2json=t.xml2js=t.json2xml=t.js2xml=void 0;var a=void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=[],u=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c=!1;function h(){c=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}function f(e){var t;c||h();for(var n=e.length,r=n%3,i="",o=[],a=16383,u=0,l=n-r;ul?l:u+a));return 1===r?(t=e[n-1],i+=s[t>>2],i+=s[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=s[t>>10],i+=s[t>>4&63],i+=s[t<<2&63],i+="="),o.push(i),o.join("")}function p(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)}function v(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,l-=8);e[n+f-p]|=128*v}var m={}.toString,g=Array.isArray||function(e){return"[object Array]"==m.call(e)};function y(){return x.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function b(e,t){if(y()=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return 0|e}function E(e){return!(null==e||!e._isBuffer)}function A(e,t){if(E(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return ee(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return te(e).length;default:if(r)return ee(e).length;t=(""+t).toLowerCase(),r=!0}}function I(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return H(this,t,n);case"utf8":case"utf-8":return U(this,t,n);case"ascii":return z(this,t,n);case"latin1":case"binary":return G(this,t,n);case"base64":return B(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function C(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function N(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=x.from(t,r)),E(t))return 0===t.length?-1:k(e,t,n,r,i);if("number"==typeof t)return t&=255,x.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):k(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function k(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,d=0;di&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function B(e,t,n){return 0===t&&n===e.length?f(e):f(e.slice(t,n))}function U(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+h<=n)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(e){var t=e.length;if(t<=F)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},x.prototype.compare=function(e,t,n,r,i){if(!E(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),l=e.slice(t,n),c=0;ci)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return D(this,e,t,n);case"utf8":case"utf-8":return P(this,e,t,n);case"ascii":return O(this,e,t,n);case"latin1":case"binary":return R(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},x.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var F=4096;function z(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function Y(e,t,n,r,i,o){if(!E(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function X(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function Q(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function Z(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function q(e,t,n,r,i){return i||Z(e,0,n,4),v(e,t,n,r,23,4),n+4}function J(e,t,n,r,i){return i||Z(e,0,n,8),v(e,t,n,r,52,8),n+8}x.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},x.prototype.readUInt8=function(e,t){return t||W(e,1,this.length),this[e]},x.prototype.readUInt16LE=function(e,t){return t||W(e,2,this.length),this[e]|this[e+1]<<8},x.prototype.readUInt16BE=function(e,t){return t||W(e,2,this.length),this[e]<<8|this[e+1]},x.prototype.readUInt32LE=function(e,t){return t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},x.prototype.readUInt32BE=function(e,t){return t||W(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},x.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||W(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},x.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||W(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},x.prototype.readInt8=function(e,t){return t||W(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},x.prototype.readInt16LE=function(e,t){t||W(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},x.prototype.readInt16BE=function(e,t){t||W(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},x.prototype.readInt32LE=function(e,t){return t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},x.prototype.readInt32BE=function(e,t){return t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},x.prototype.readFloatLE=function(e,t){return t||W(e,4,this.length),p(this,e,!0,23,4)},x.prototype.readFloatBE=function(e,t){return t||W(e,4,this.length),p(this,e,!1,23,4)},x.prototype.readDoubleLE=function(e,t){return t||W(e,8,this.length),p(this,e,!0,52,8)},x.prototype.readDoubleBE=function(e,t){return t||W(e,8,this.length),p(this,e,!1,52,8)},x.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Y(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},x.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,1,255,0),x.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},x.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,65535,0),x.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},x.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,65535,0),x.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},x.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,4294967295,0),x.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Q(this,e,t,!0),t+4},x.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,4294967295,0),x.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},x.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Y(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},x.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Y(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},x.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,1,127,-128),x.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},x.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,32767,-32768),x.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},x.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,32767,-32768),x.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},x.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,2147483647,-2147483648),x.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Q(this,e,t,!0),t+4},x.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),x.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},x.prototype.writeFloatLE=function(e,t,n){return q(this,e,t,!0,n)},x.prototype.writeFloatBE=function(e,t,n){return q(this,e,t,!1,n)},x.prototype.writeDoubleLE=function(e,t,n){return J(this,e,t,!0,n)},x.prototype.writeDoubleBE=function(e,t,n){return J(this,e,t,!1,n)},x.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!x.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function te(e){return function(e){var t,n,r,i,o,a;c||h();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new l(3*s/4-o),r=o>0?s-4:s;var d=0;for(t=0,n=0;t>16&255,a[d++]=i>>8&255,a[d++]=255&i;return 2===o?(i=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,a[d++]=255&i):1===o&&(i=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,a[d++]=i>>8&255,a[d++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ne(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function re(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ie={};function oe(){}function ae(){ae.init.call(this)}function se(e){return void 0===e._maxListeners?ae.defaultMaxListeners:e._maxListeners}function ue(e,t,n){if(t)e.call(n);else for(var r=e.length,i=me(e,r),o=0;o0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=n,++e._eventsCount;return e}function pe(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function ve(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function me(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function ge(){throw new Error("setTimeout has not been defined")}function ye(){throw new Error("clearTimeout has not been defined")}oe.prototype=Object.create(null),ae.EventEmitter=ae,ae.usingDomains=!1,ae.prototype.domain=void 0,ae.prototype._events=void 0,ae.prototype._maxListeners=void 0,ae.defaultMaxListeners=10,ae.init=function(){this.domain=null,ae.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new oe,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ae.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ae.prototype.getMaxListeners=function(){return se(this)},ae.prototype.emit=function(e){var t,n,r,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:ue(n,c,this);break;case 2:le(n,c,this,arguments[1]);break;case 3:ce(n,c,this,arguments[1],arguments[2]);break;case 4:he(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new oe,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r0?Reflect.ownKeys(this._events):[]};var be=ge,xe=ye;function _e(e){if(be===setTimeout)return setTimeout(e,0);if((be===ge||!be)&&setTimeout)return be=setTimeout,setTimeout(e,0);try{return be(e,0)}catch(t){try{return be.call(null,e,0)}catch(t){return be.call(this,e,0)}}}"function"==typeof a.setTimeout&&(be=setTimeout),"function"==typeof a.clearTimeout&&(xe=clearTimeout);var we,Te=[],Me=!1,Se=-1;function Ee(){Me&&we&&(Me=!1,we.length?Te=we.concat(Te):Se=-1,Te.length&&Ae())}function Ae(){if(!Me){var e=_e(Ee);Me=!0;for(var t=Te.length;t;){for(we=Te,Te=[];++Se1)for(var n=1;n=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),a=r[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),et(t)?n.showHidden=t:t&&ct(n,t),rt(n.showHidden)&&(n.showHidden=!1),rt(n.depth)&&(n.depth=2),rt(n.colors)&&(n.colors=!1),rt(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Ze),Je(n,e,n.depth)}function Ze(e,t){var n=Qe.styles[t];return n?"["+Qe.colors[n][0]+"m"+e+"["+Qe.colors[n][1]+"m":e}function qe(e,t){return e}function Je(e,t,n){if(e.customInspect&&t&&ut(t.inspect)&&t.inspect!==Qe&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return nt(r)||(r=Je(e,r,n)),r}var i=function(e,t){if(rt(t))return e.stylize("undefined","undefined");if(nt(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(r=t,"number"==typeof r)return e.stylize(""+t,"number");var r;if(et(t))return e.stylize(""+t,"boolean");if(tt(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),st(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ke(t);if(0===o.length){if(ut(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(it(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(at(t))return e.stylize(Date.prototype.toString.call(t),"date");if(st(t))return Ke(t)}var u,l,c="",h=!1,d=["{","}"];(u=t,Array.isArray(u)&&(h=!0,d=["[","]"]),ut(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return it(t)&&(c=" "+RegExp.prototype.toString.call(t)),at(t)&&(c=" "+Date.prototype.toUTCString.call(t)),st(t)&&(c=" "+Ke(t)),0!==o.length||h&&0!=t.length?n<0?it(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=h?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(l,c,d)):d[0]+c+d[1]}function Ke(e){return"["+Error.prototype.toString.call(e)+"]"}function $e(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),ht(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=tt(n)?Je(e,u.value,null):Je(e,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),rt(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function et(e){return"boolean"==typeof e}function tt(e){return null===e}function nt(e){return"string"==typeof e}function rt(e){return void 0===e}function it(e){return ot(e)&&"[object RegExp]"===lt(e)}function ot(e){return"object"===i(e)&&null!==e}function at(e){return ot(e)&&"[object Date]"===lt(e)}function st(e){return ot(e)&&("[object Error]"===lt(e)||e instanceof Error)}function ut(e){return"function"==typeof e}function lt(e){return Object.prototype.toString.call(e)}function ct(e,t){if(!t||!ot(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function ht(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dt(){this.head=null,this.tail=null,this.length=0}Qe.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Qe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},dt.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},dt.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},dt.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},dt.prototype.clear=function(){this.head=this.tail=null,this.length=0},dt.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},dt.prototype.concat=function(e){if(0===this.length)return x.alloc(0);if(1===this.length)return this.head.data;for(var t=x.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};var ft=x.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function pt(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!ft(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=mt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=gt;break;default:return void(this.write=vt)}this.charBuffer=new x(6),this.charReceived=0,this.charLength=0}function vt(e){return e.toString(this.encoding)}function mt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function gt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}pt.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var i;r=(t+=e.toString(this.encoding,0,r)).length-1;if((i=t.charCodeAt(r))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,r)}return t},pt.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},pt.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t};var yt=Object.freeze({__proto__:null,StringDecoder:pt});_t.ReadableState=xt;var bt=function(e){if(rt(Ye)&&(Ye=ze.env.NODE_DEBUG||""),e=e.toUpperCase(),!Xe[e])if(new RegExp("\\b"+e+"\\b","i").test(Ye)){Xe[e]=function(){var t=Ve.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else Xe[e]=function(){};return Xe[e]}("stream");function xt(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Zt&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new dt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new pt(e.encoding),this.encoding=e.encoding)}function _t(e){if(!(this instanceof _t))return new _t(e);this._readableState=new xt(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ae.call(this)}function wt(e,t,n,r,i){var o=function(e,t){var n=null;x.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(t,n);if(o)e.emit("error",o);else if(null===n)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,St(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||r||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&St(e))),function(e,t){t.readingMore||(t.readingMore=!0,Ie(At,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=Tt?e=Tt:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function St(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(bt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ie(Et,e):Et(e))}function Et(e){bt("emit readable"),e.emit("readable"),Nt(e)}function At(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=x.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function Dt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ie(Pt,t,e))}function Pt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Ot(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return bt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Dt(this):St(this),null;if(0===(e=Mt(e,t))&&t.ended)return 0===t.length&&Dt(this),null;var r,i=t.needReadable;return bt("need readable",i),(0===t.length||t.length-e0?kt(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&Dt(this)),null!==r&&this.emit("data",r),r},_t.prototype._read=function(e){this.emit("error",new Error("not implemented"))},_t.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,bt("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){bt("onunpipe"),e===n&&l()}function a(){bt("onend"),e.end()}r.endEmitted?Ie(i):n.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;bt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,Nt(e))}}(n);e.on("drain",s);var u=!1;function l(){bt("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",d),e.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",l),n.removeListener("data",h),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var c=!1;function h(t){bt("ondata"),c=!1,!1!==e.write(t)||c||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==Ot(r.pipes,e))&&!u&&(bt("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,c=!0),n.pause())}function d(t){var n;bt("onerror",t),v(),e.removeListener("error",d),0===(n="error",e.listeners(n).length)&&e.emit("error",t)}function f(){e.removeListener("finish",p),v()}function p(){bt("onfinish"),e.removeListener("close",f),v()}function v(){bt("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",n),r.flowing||(bt("pipe resume"),n.resume()),e},_t.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Bt.prototype._write=function(e,t,n){n(new Error("not implemented"))},Bt.prototype._writev=null,Bt.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,Vt(e,t),n&&(t.finished?Ie(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Ge(Zt,_t);for(var Yt=Object.keys(Bt.prototype),Xt=0;Xt"===a?(E(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=T.TEXT):v(a)?(r.state=T.SGML_DECL_QUOTED,r.sgmlDecl+=a):r.sgmlDecl+=a;continue;case T.SGML_DECL_QUOTED:a===r.q&&(r.state=T.SGML_DECL,r.q=""),r.sgmlDecl+=a;continue;case T.DOCTYPE:">"===a?(r.state=T.TEXT,E(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=a,"["===a?r.state=T.DOCTYPE_DTD:v(a)&&(r.state=T.DOCTYPE_QUOTED,r.q=a));continue;case T.DOCTYPE_QUOTED:r.doctype+=a,a===r.q&&(r.q="",r.state=T.DOCTYPE);continue;case T.DOCTYPE_DTD:r.doctype+=a,"]"===a?r.state=T.DOCTYPE:v(a)&&(r.state=T.DOCTYPE_DTD_QUOTED,r.q=a);continue;case T.DOCTYPE_DTD_QUOTED:r.doctype+=a,a===r.q&&(r.state=T.DOCTYPE_DTD,r.q="");continue;case T.COMMENT:"-"===a?r.state=T.COMMENT_ENDING:r.comment+=a;continue;case T.COMMENT_ENDING:"-"===a?(r.state=T.COMMENT_ENDED,r.comment=I(r.opt,r.comment),r.comment&&E(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+a,r.state=T.COMMENT);continue;case T.COMMENT_ENDED:">"!==a?(k(r,"Malformed comment"),r.comment+="--"+a,r.state=T.COMMENT):r.state=T.TEXT;continue;case T.CDATA:"]"===a?r.state=T.CDATA_ENDING:r.cdata+=a;continue;case T.CDATA_ENDING:"]"===a?r.state=T.CDATA_ENDING_2:(r.cdata+="]"+a,r.state=T.CDATA);continue;case T.CDATA_ENDING_2:">"===a?(r.cdata&&E(r,"oncdata",r.cdata),E(r,"onclosecdata"),r.cdata="",r.state=T.TEXT):"]"===a?r.cdata+="]":(r.cdata+="]]"+a,r.state=T.CDATA);continue;case T.PROC_INST:"?"===a?r.state=T.PROC_INST_ENDING:p(a)?r.state=T.PROC_INST_BODY:r.procInstName+=a;continue;case T.PROC_INST_BODY:if(!r.procInstBody&&p(a))continue;"?"===a?r.state=T.PROC_INST_ENDING:r.procInstBody+=a;continue;case T.PROC_INST_ENDING:">"===a?(E(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=T.TEXT):(r.procInstBody+="?"+a,r.state=T.PROC_INST_BODY);continue;case T.OPEN_TAG:g(h,a)?r.tagName+=a:(D(r),">"===a?R(r):"/"===a?r.state=T.OPEN_TAG_SLASH:(p(a)||k(r,"Invalid character in tag name"),r.state=T.ATTRIB));continue;case T.OPEN_TAG_SLASH:">"===a?(R(r,!0),L(r)):(k(r,"Forward-slash in opening tag not followed by >"),r.state=T.ATTRIB);continue;case T.ATTRIB:if(p(a))continue;">"===a?R(r):"/"===a?r.state=T.OPEN_TAG_SLASH:g(c,a)?(r.attribName=a,r.attribValue="",r.state=T.ATTRIB_NAME):k(r,"Invalid attribute name");continue;case T.ATTRIB_NAME:"="===a?r.state=T.ATTRIB_VALUE:">"===a?(k(r,"Attribute without value"),r.attribValue=r.attribName,O(r),R(r)):p(a)?r.state=T.ATTRIB_NAME_SAW_WHITE:g(h,a)?r.attribName+=a:k(r,"Invalid attribute name");continue;case T.ATTRIB_NAME_SAW_WHITE:if("="===a)r.state=T.ATTRIB_VALUE;else{if(p(a))continue;k(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",E(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===a?R(r):g(c,a)?(r.attribName=a,r.state=T.ATTRIB_NAME):(k(r,"Invalid attribute name"),r.state=T.ATTRIB)}continue;case T.ATTRIB_VALUE:if(p(a))continue;v(a)?(r.q=a,r.state=T.ATTRIB_VALUE_QUOTED):(k(r,"Unquoted attribute value"),r.state=T.ATTRIB_VALUE_UNQUOTED,r.attribValue=a);continue;case T.ATTRIB_VALUE_QUOTED:if(a!==r.q){"&"===a?r.state=T.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=a;continue}O(r),r.q="",r.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:p(a)?r.state=T.ATTRIB:">"===a?R(r):"/"===a?r.state=T.OPEN_TAG_SLASH:g(c,a)?(k(r,"No whitespace between attributes"),r.attribName=a,r.attribValue="",r.state=T.ATTRIB_NAME):k(r,"Invalid attribute name");continue;case T.ATTRIB_VALUE_UNQUOTED:if(!m(a)){"&"===a?r.state=T.ATTRIB_VALUE_ENTITY_U:r.attribValue+=a;continue}O(r),">"===a?R(r):r.state=T.ATTRIB;continue;case T.CLOSE_TAG:if(r.tagName)">"===a?L(r):g(h,a)?r.tagName+=a:r.script?(r.script+=""===a?L(r):k(r,"Invalid characters in closing tag");continue;case T.TEXT_ENTITY:case T.ATTRIB_VALUE_ENTITY_Q:case T.ATTRIB_VALUE_ENTITY_U:var l,b;switch(r.state){case T.TEXT_ENTITY:l=T.TEXT,b="textNode";break;case T.ATTRIB_VALUE_ENTITY_Q:l=T.ATTRIB_VALUE_QUOTED,b="attribValue";break;case T.ATTRIB_VALUE_ENTITY_U:l=T.ATTRIB_VALUE_UNQUOTED,b="attribValue"}";"===a?(r[b]+=j(r),r.entity="",r.state=l):g(r.entity.length?f:d,a)?r.entity+=a:(k(r,"Invalid character in entity name"),r[b]+="&"+r.entity+a,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}r.position>=r.bufferCheckPosition&&function(t){for(var r=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,o=0,a=n.length;or)switch(n[o]){case"textNode":A(t);break;case"cdata":E(t,"oncdata",t.cdata),t.cdata="";break;case"script":E(t,"onscript",t.script),t.script="";break;default:C(t,"Max buffer length exceeded: "+n[o])}i=Math.max(i,s)}var u=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=u+t.position}(r);return r} -/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;A(e=this),""!==e.cdata&&(E(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(E(e,"onscript",e.script),e.script="")}};try{t=rn.Stream}catch(e){t=function(){}}var o=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function a(e,n){if(!(this instanceof a))return new a(e,n);t.apply(this),this._parser=new r(e,n),this.writable=!0,this.readable=!0;var i=this;this._parser.onend=function(){i.emit("end")},this._parser.onerror=function(e){i.emit("error",e),i._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(i,"on"+e,{get:function(){return i._parser["on"+e]},set:function(t){if(!t)return i.removeAllListeners(e),i._parser["on"+e]=t,t;i.on(e,t)},enumerable:!0,configurable:!1})}))}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof x.isBuffer&&x.isBuffer(e)){if(!this._decoder){var t=on.StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,n){var r=this;return r._parser["on"+e]||-1===o.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var s="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",l={xml:s,xmlns:u},c=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function v(e){return'"'===e||"'"===e}function m(e){return">"===e||p(e)}function g(e,t){return e.test(t)}function y(e,t){return!g(e,t)}var b,_,w,T=0;for(var M in e.STATE={BEGIN:T++,BEGIN_WHITESPACE:T++,TEXT:T++,TEXT_ENTITY:T++,OPEN_WAKA:T++,SGML_DECL:T++,SGML_DECL_QUOTED:T++,DOCTYPE:T++,DOCTYPE_QUOTED:T++,DOCTYPE_DTD:T++,DOCTYPE_DTD_QUOTED:T++,COMMENT_STARTING:T++,COMMENT:T++,COMMENT_ENDING:T++,COMMENT_ENDED:T++,CDATA:T++,CDATA_ENDING:T++,CDATA_ENDING_2:T++,PROC_INST:T++,PROC_INST_BODY:T++,PROC_INST_ENDING:T++,OPEN_TAG:T++,OPEN_TAG_SLASH:T++,ATTRIB:T++,ATTRIB_NAME:T++,ATTRIB_NAME_SAW_WHITE:T++,ATTRIB_VALUE:T++,ATTRIB_VALUE_QUOTED:T++,ATTRIB_VALUE_CLOSED:T++,ATTRIB_VALUE_UNQUOTED:T++,ATTRIB_VALUE_ENTITY_Q:T++,ATTRIB_VALUE_ENTITY_U:T++,CLOSE_TAG:T++,CLOSE_TAG_SAW_WHITE:T++,SCRIPT:T++,SCRIPT_ENDING:T++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var n=e.ENTITIES[t],r="number"==typeof n?String.fromCharCode(n):n;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[M]]=M;function S(e,t,n){e[t]&&e[t](n)}function E(e,t,n){e.textNode&&A(e),S(e,t,n)}function A(e){e.textNode=I(e.opt,e.textNode),e.textNode&&S(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function C(e,t){return A(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,S(e,"onerror",t),e}function N(e){return e.sawRoot&&!e.closedRoot&&k(e,"Unclosed root tag"),e.state!==T.BEGIN&&e.state!==T.BEGIN_WHITESPACE&&e.state!==T.TEXT&&C(e,"Unexpected end"),A(e),e.c="",e.closed=!0,S(e,"onend"),r.call(e,e.strict,e.opt),e}function k(e,t){if("object"!==i(e)||!(e instanceof r))throw new Error("bad call to strictFail");e.strict&&C(e,t)}function D(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,E(e,"onopentagstart",n)}function P(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function O(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=P(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==s)k(e,"xml: prefix must be bound to "+s+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==u)k(e,"xmlns: prefix must be bound to "+u+"\nActual: "+e.attribValue);else{var i=e.tag,o=e.tags[e.tags.length-1]||e;i.ns===o.ns&&(i.ns=Object.create(o.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,E(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function R(e,t){if(e.opt.xmlns){var n=e.tag,r=P(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(k(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){E(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var o=0,a=e.attribList.length;o",e.tagName="",void(e.state=T.SCRIPT);E(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){if(e.tags[t].name===r)break;k(e,"Unexpected close tag")}if(t<0)return k(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=T.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,E(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==u.ns&&Object.keys(o.ns).forEach((function(t){var n=o.ns[t];E(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=T.TEXT}function j(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==n?(k(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function B(e,t){"<"===t?(e.state=T.OPEN_WAKA,e.startTagPosition=e.position):p(t)||(k(e,"Non-whitespace before first tag."),e.textNode=t,e.state=T.TEXT)}function U(e,t){var n="";return t1114111||_(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(i+1===o||r.length>n)&&(a+=b.apply(null,r),r.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(e)}(ie);var an,sn,un=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},ln=un,cn={copyOptions:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},ensureFlagExists:function(e,t){e in t&&"boolean"==typeof t[e]||(t[e]=!1)},ensureSpacesExists:function(e){(!("spaces"in e)||"number"!=typeof e.spaces&&"string"!=typeof e.spaces)&&(e.spaces=0)},ensureAlwaysArrayExists:function(e){"alwaysArray"in e&&("boolean"==typeof e.alwaysArray||ln(e.alwaysArray))||(e.alwaysArray=!1)},ensureKeyExists:function(e,t){e+"Key"in t&&"string"==typeof t[e+"Key"]||(t[e+"Key"]=t.compact?"_"+e:e)},checkFnExists:function(e,t){return e+"Fn"in t}},hn=ie,dn=cn,fn=un;function pn(e){var t=Number(e);if(!isNaN(t))return t;var n=e.toLowerCase();return"true"===n||"false"!==n&&e}function vn(e,t){var n;if(an.compact){if(!sn[an[e+"Key"]]&&(fn(an.alwaysArray)?-1!==an.alwaysArray.indexOf(an[e+"Key"]):an.alwaysArray)&&(sn[an[e+"Key"]]=[]),sn[an[e+"Key"]]&&!fn(sn[an[e+"Key"]])&&(sn[an[e+"Key"]]=[sn[an[e+"Key"]]]),e+"Fn"in an&&"string"==typeof t&&(t=an[e+"Fn"](t,sn)),"instruction"===e&&("instructionFn"in an||"instructionNameFn"in an))for(n in t)if(t.hasOwnProperty(n))if("instructionFn"in an)t[n]=an.instructionFn(t[n],n,sn);else{var r=t[n];delete t[n],t[an.instructionNameFn(n,r,sn)]=r}fn(sn[an[e+"Key"]])?sn[an[e+"Key"]].push(t):sn[an[e+"Key"]]=t}else{sn[an.elementsKey]||(sn[an.elementsKey]=[]);var i={};if(i[an.typeKey]=e,"instruction"===e){for(n in t)if(t.hasOwnProperty(n))break;i[an.nameKey]="instructionNameFn"in an?an.instructionNameFn(n,t,sn):n,an.instructionHasAttributes?(i[an.attributesKey]=t[n][an.attributesKey],"instructionFn"in an&&(i[an.attributesKey]=an.instructionFn(i[an.attributesKey],n,sn))):("instructionFn"in an&&(t[n]=an.instructionFn(t[n],n,sn)),i[an.instructionKey]=t[n])}else e+"Fn"in an&&(t=an[e+"Fn"](t,sn)),i[an[e+"Key"]]=t;an.addParent&&(i[an.parentKey]=sn),sn[an.elementsKey].push(i)}}function mn(e){var t;if("attributesFn"in an&&e&&(e=an.attributesFn(e,sn)),(an.trim||"attributeValueFn"in an||"attributeNameFn"in an||an.nativeTypeAttributes)&&e)for(t in e)if(e.hasOwnProperty(t)&&(an.trim&&(e[t]=e[t].trim()),an.nativeTypeAttributes&&(e[t]=pn(e[t])),"attributeValueFn"in an&&(e[t]=an.attributeValueFn(e[t],t,sn)),"attributeNameFn"in an)){var n=e[t];delete e[t],e[an.attributeNameFn(t,e[t],sn)]=n}return e}function gn(e){var t={};if(e.body&&("xml"===e.name.toLowerCase()||an.instructionHasAttributes)){for(var n,r=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(n=r.exec(e.body));)t[n[1]]=n[2]||n[3]||n[4];t=mn(t)}if("xml"===e.name.toLowerCase()){if(an.ignoreDeclaration)return;sn[an.declarationKey]={},Object.keys(t).length&&(sn[an.declarationKey][an.attributesKey]=t),an.addParent&&(sn[an.declarationKey][an.parentKey]=sn)}else{if(an.ignoreInstruction)return;an.trim&&(e.body=e.body.trim());var i={};an.instructionHasAttributes&&Object.keys(t).length?(i[e.name]={},i[e.name][an.attributesKey]=t):i[e.name]=e.body,vn("instruction",i)}}function yn(e,t){var n;if("object"===i(e)&&(t=e.attributes,e=e.name),t=mn(t),"elementNameFn"in an&&(e=an.elementNameFn(e,sn)),an.compact){var r;if(n={},!an.ignoreAttributes&&t&&Object.keys(t).length)for(r in n[an.attributesKey]={},t)t.hasOwnProperty(r)&&(n[an.attributesKey][r]=t[r]);!(e in sn)&&(fn(an.alwaysArray)?-1!==an.alwaysArray.indexOf(e):an.alwaysArray)&&(sn[e]=[]),sn[e]&&!fn(sn[e])&&(sn[e]=[sn[e]]),fn(sn[e])?sn[e].push(n):sn[e]=n}else sn[an.elementsKey]||(sn[an.elementsKey]=[]),(n={})[an.typeKey]="element",n[an.nameKey]=e,!an.ignoreAttributes&&t&&Object.keys(t).length&&(n[an.attributesKey]=t),an.alwaysChildren&&(n[an.elementsKey]=[]),sn[an.elementsKey].push(n);n[an.parentKey]=sn,sn=n}function bn(e){an.ignoreText||(e.trim()||an.captureSpacesBetweenElements)&&(an.trim&&(e=e.trim()),an.nativeType&&(e=pn(e)),an.sanitize&&(e=e.replace(/&/g,"&").replace(//g,">")),vn("text",e))}function xn(e){an.ignoreComment||(an.trim&&(e=e.trim()),vn("comment",e))}function _n(e){var t=sn[an.parentKey];an.addParent||delete sn[an.parentKey],sn=t}function wn(e){an.ignoreCdata||(an.trim&&(e=e.trim()),vn("cdata",e))}function Tn(e){an.ignoreDoctype||(e=e.replace(/^ /,""),an.trim&&(e=e.trim()),vn("doctype",e))}function Mn(e){e.note=e,"onErrorFn"in an&&an.onErrorFn(e)}var Sn=function(e,t){var n=hn.parser(!0,{}),r={};sn=r,an=function(e){return an=dn.copyOptions(e),dn.ensureFlagExists("ignoreDeclaration",an),dn.ensureFlagExists("ignoreInstruction",an),dn.ensureFlagExists("ignoreAttributes",an),dn.ensureFlagExists("ignoreText",an),dn.ensureFlagExists("ignoreComment",an),dn.ensureFlagExists("ignoreCdata",an),dn.ensureFlagExists("ignoreDoctype",an),dn.ensureFlagExists("compact",an),dn.ensureFlagExists("alwaysChildren",an),dn.ensureFlagExists("addParent",an),dn.ensureFlagExists("trim",an),dn.ensureFlagExists("nativeType",an),dn.ensureFlagExists("nativeTypeAttributes",an),dn.ensureFlagExists("sanitize",an),dn.ensureFlagExists("instructionHasAttributes",an),dn.ensureFlagExists("captureSpacesBetweenElements",an),dn.ensureAlwaysArrayExists(an),dn.ensureKeyExists("declaration",an),dn.ensureKeyExists("instruction",an),dn.ensureKeyExists("attributes",an),dn.ensureKeyExists("text",an),dn.ensureKeyExists("comment",an),dn.ensureKeyExists("cdata",an),dn.ensureKeyExists("doctype",an),dn.ensureKeyExists("type",an),dn.ensureKeyExists("name",an),dn.ensureKeyExists("elements",an),dn.ensureKeyExists("parent",an),an}(t),n.opt={strictEntities:!0},n.onopentag=yn,n.ontext=bn,n.oncomment=xn,n.onclosetag=_n,n.onerror=Mn,n.oncdata=wn,n.ondoctype=Tn,n.onprocessinginstruction=gn;try{n.write(e).close()}catch(e){}if(r[an.elementsKey]){var i=r[an.elementsKey];delete r[an.elementsKey],r[an.elementsKey]=i,delete r.text}return r};t.xml2js=Sn;var En=cn,An=Sn;t.xml2json=function(e,t){var n,r,i,o;return n=function(e){var t=En.copyOptions(e);return En.ensureSpacesExists(t),t}(t),r=An(e,n),o="compact"in n&&n.compact?"_parent":"parent",i="addParent"in n&&n.addParent?JSON.stringify(r,(function(e,t){return e===o?"_":t}),n.spaces):JSON.stringify(r,null,n.spaces),i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};var In,Cn,Nn=cn,kn=un;function Dn(e,t,n){return(!n&&e.spaces?"\n":"")+Array(t+1).join(e.spaces)}function Pn(e,t,n){if(t.ignoreAttributes)return"";"attributesFn"in t&&(e=t.attributesFn(e,Cn,In));var r,i,o,a,s=[];for(r in e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(a=t.noQuotesForNativeAttributes&&"string"!=typeof e[r]?"":'"',i=(i=""+e[r]).replace(/&/g,"&").replace(/"}function Rn(e,t,n){if(t.ignoreInstruction)return"";var r;for(r in e)if(e.hasOwnProperty(r))break;var o="instructionNameFn"in t?t.instructionNameFn(r,e[r],Cn,In):r;if("object"===i(e[r]))return In=e,Cn=o,"";var a=e[r]?e[r]:"";return"instructionFn"in t&&(a=t.instructionFn(a,r,Cn,In)),""}function Ln(e,t){return t.ignoreComment?"":"\x3c!--"+("commentFn"in t?t.commentFn(e,Cn,In):e)+"--\x3e"}function jn(e,t){return t.ignoreCdata?"":"","]]]]>"))+"]]>"}function Bn(e,t){return t.ignoreDoctype?"":""}function Un(e,t){return t.ignoreText?"":(e=(e=(e=""+e).replace(/&/g,"&")).replace(/&/g,"&").replace(//g,">"),"textFn"in t?t.textFn(e,Cn,In):e)}function Fn(e,t,n,r){return e.reduce((function(e,i){var o=Dn(t,n,r&&!e);switch(i.type){case"element":return e+o+function(e,t,n){In=e,Cn=e.name;var r=[],i="elementNameFn"in t?t.elementNameFn(e.name,e):e.name;r.push("<"+i),e[t.attributesKey]&&r.push(Pn(e[t.attributesKey],t,n));var o=e[t.elementsKey]&&e[t.elementsKey].length||e[t.attributesKey]&&"preserve"===e[t.attributesKey]["xml:space"];return o||(o="fullTagEmptyElementFn"in t?t.fullTagEmptyElementFn(e.name,e):t.fullTagEmptyElement),o?(r.push(">"),e[t.elementsKey]&&e[t.elementsKey].length&&(r.push(Fn(e[t.elementsKey],t,n+1)),In=e,Cn=e.name),r.push(t.spaces&&function(e,t){var n;if(e.elements&&e.elements.length)for(n=0;n")):r.push("/>"),r.join("")}(i,t,n);case"comment":return e+o+Ln(i[t.commentKey],t);case"doctype":return e+o+Bn(i[t.doctypeKey],t);case"cdata":return e+(t.indentCdata?o:"")+jn(i[t.cdataKey],t);case"text":return e+(t.indentText?o:"")+Un(i[t.textKey],t);case"instruction":var a={};return a[i[t.nameKey]]=i[t.attributesKey]?i:i[t.instructionKey],e+(t.indentInstruction?o:"")+Rn(a,t,n)}}),"")}function zn(e,t,n){var r;for(r in e)if(e.hasOwnProperty(r))switch(r){case t.parentKey:case t.attributesKey:break;case t.textKey:if(t.indentText||n)return!0;break;case t.cdataKey:if(t.indentCdata||n)return!0;break;case t.instructionKey:if(t.indentInstruction||n)return!0;break;case t.doctypeKey:case t.commentKey:default:return!0}return!1}function Gn(e,t,n,r,o){In=e,Cn=t;var a="elementNameFn"in n?n.elementNameFn(t,e):t;if(null==e||""===e)return"fullTagEmptyElementFn"in n&&n.fullTagEmptyElementFn(t,e)||n.fullTagEmptyElement?"<"+a+">":"<"+a+"/>";var s=[];if(t){if(s.push("<"+a),"object"!==i(e))return s.push(">"+Un(e,n)+""),s.join("");e[n.attributesKey]&&s.push(Pn(e[n.attributesKey],n,r));var u=zn(e,n,!0)||e[n.attributesKey]&&"preserve"===e[n.attributesKey]["xml:space"];if(u||(u="fullTagEmptyElementFn"in n?n.fullTagEmptyElementFn(t,e):n.fullTagEmptyElement),!u)return s.push("/>"),s.join("");s.push(">")}return s.push(Hn(e,n,r+1,!1)),In=e,Cn=t,t&&s.push((o?Dn(n,r,!1):"")+""),s.join("")}function Hn(e,t,n,r){var i,o,a,s=[];for(o in e)if(e.hasOwnProperty(o))for(a=kn(e[o])?e[o]:[e[o]],i=0;it}return!1}function gl(e,t,n,r,i,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o}var yl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){yl[e]=new gl(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];yl[t]=new gl(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){yl[e]=new gl(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){yl[e]=new gl(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){yl[e]=new gl(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){yl[e]=new gl(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){yl[e]=new gl(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){yl[e]=new gl(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){yl[e]=new gl(e,5,!1,e.toLowerCase(),null,!1)}));var bl=/[\-:]([a-z])/g;function xl(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(bl,xl);yl[t]=new gl(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(bl,xl);yl[t]=new gl(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(bl,xl);yl[t]=new gl(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){yl[e]=new gl(e,1,!1,e.toLowerCase(),null,!1)})),yl.xlinkHref=new gl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){yl[e]=new gl(e,1,!1,e.toLowerCase(),null,!0)}));var _l=Au.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function wl(e,t,n,r){var i=yl.hasOwnProperty(t)?yl[t]:null;(null!==i?0===i.type:!r&&!(!(2=n.length))throw Error(Nu(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Hl(n)}}function rc(e,t){var n=Hl(t.value),r=Hl(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ic(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var oc="http://www.w3.org/1999/xhtml",ac="http://www.w3.org/2000/svg";function sc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function uc(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?sc(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var lc,cc=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==ac||"innerHTML"in e)e.innerHTML=t;else{for((lc=lc||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=lc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function hc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function dc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var fc={animationend:dc("Animation","AnimationEnd"),animationiteration:dc("Animation","AnimationIteration"),animationstart:dc("Animation","AnimationStart"),transitionend:dc("Transition","TransitionEnd")},pc={},vc={};function mc(e){if(pc[e])return pc[e];if(!fc[e])return e;var t,n=fc[e];for(t in n)if(n.hasOwnProperty(t)&&t in vc)return pc[e]=n[t];return e}Ju&&(vc=document.createElement("div").style,"AnimationEvent"in window||(delete fc.animationend.animation,delete fc.animationiteration.animation,delete fc.animationstart.animation),"TransitionEvent"in window||delete fc.transitionend.transition);var gc=mc("animationend"),yc=mc("animationiteration"),bc=mc("animationstart"),xc=mc("transitionend"),_c="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wc=new("function"==typeof WeakMap?WeakMap:Map);function Tc(e){var t=wc.get(e);return void 0===t&&(t=new Map,wc.set(e,t)),t}function Mc(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Sc(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ec(e){if(Mc(e)!==e)throw Error(Nu(188))}function Ac(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Mc(e)))throw Error(Nu(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Ec(i),e;if(o===r)return Ec(i),t;o=o.sibling}throw Error(Nu(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(Nu(189))}}if(n.alternate!==r)throw Error(Nu(190))}if(3!==n.tag)throw Error(Nu(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ic(e,t){if(null==t)throw Error(Nu(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function Cc(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var Nc=null;function kc(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;rRc.length&&Rc.push(e)}function jc(e,t,n,r){if(Rc.length){var i=Rc.pop();return i.topLevelType=e,i.eventSystemFlags=r,i.nativeEvent=t,i.targetInst=n,i}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function Bc(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=ed(r)}while(n);for(n=0;n=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Rh(r)}}function jh(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?jh(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Bh(){for(var e=window,t=Oh();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=Oh((e=t.contentWindow).document)}return t}function Uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var zh="$?",Fh="$!",Gh=null,Hh=null;function Vh(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Wh(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==_(t.dangerouslySetInnerHTML)&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Yh="function"==typeof setTimeout?setTimeout:void 0,Xh="function"==typeof clearTimeout?clearTimeout:void 0;function Qh(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Zh(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||n===Fh||n===zh){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var qh=Math.random().toString(36).slice(2),Jh="__reactInternalInstance$"+qh,Kh="__reactEventHandlers$"+qh,$h="__reactContainere$"+qh;function ed(e){var t=e[Jh];if(t)return t;for(var n=e.parentNode;n;){if(t=n[$h]||n[Jh]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Zh(e);null!==e;){if(n=e[Jh])return n;e=Zh(e)}return t}n=(e=n).parentNode}return null}function td(e){return!(e=e[Jh]||e[$h])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function nd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Nu(33))}function rd(e){return e[Kh]||null}function id(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function od(e,t){var n=e.stateNode;if(!n)return null;var r=Bu(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(Nu(231,t,_(n)));return n}function ad(e,t,n){(t=od(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=Ic(n._dispatchListeners,t),n._dispatchInstances=Ic(n._dispatchInstances,e))}function sd(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=id(t);for(t=n.length;0this.eventPool.length&&this.eventPool.push(e)}function xd(e){e.eventPool=[],e.getPooled=yd,e.release=bd}Iu(gd.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=vd)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=vd)},persist:function(){this.isPersistent=vd},isPersistent:md,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=md,this._dispatchInstances=this._dispatchListeners=null}}),gd.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},gd.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return Iu(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=Iu({},r.Interface,e),n.extend=r.extend,xd(n),n},xd(gd);var _d=gd.extend({data:null}),wd=gd.extend({data:null}),Td=[9,13,27,32],Md=Ju&&"CompositionEvent"in window,Sd=null;Ju&&"documentMode"in document&&(Sd=document.documentMode);var Ed=Ju&&"TextEvent"in window&&!Sd,Ad=Ju&&(!Md||Sd&&8=Sd),Id=String.fromCharCode(32),Cd={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Nd=!1;function kd(e,t){switch(e){case"keyup":return-1!==Td.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Dd(e){return"object"==_(e=e.detail)&&"data"in e?e.data:null}var Pd=!1;var Od={eventTypes:Cd,extractEvents:function(e,t,n,r){var i;if(Md)e:{switch(e){case"compositionstart":var o=Cd.compositionStart;break e;case"compositionend":o=Cd.compositionEnd;break e;case"compositionupdate":o=Cd.compositionUpdate;break e}o=void 0}else Pd?kd(e,n)&&(o=Cd.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=Cd.compositionStart);return o?(Ad&&"ko"!==n.locale&&(Pd||o!==Cd.compositionStart?o===Cd.compositionEnd&&Pd&&(i=pd()):(dd="value"in(hd=r)?hd.value:hd.textContent,Pd=!0)),o=_d.getPooled(o,t,n,r),i?o.data=i:null!==(i=Dd(n))&&(o.data=i),cd(o),i=o):i=null,(e=Ed?function(e,t){switch(e){case"compositionend":return Dd(t);case"keypress":return 32!==t.which?null:(Nd=!0,Id);case"textInput":return(e=t.data)===Id&&Nd?null:e;default:return null}}(e,n):function(e,t){if(Pd)return"compositionend"===e||!Md&&kd(e,t)?(e=pd(),fd=dd=hd=null,Pd=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,vf={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},mf=null,gf=null,yf=null,bf=!1;function xf(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return bf||null==mf||mf!==Oh(n)?null:("selectionStart"in(n=mf)&&Uh(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},yf&&ff(yf,n)?null:(yf=n,(e=gd.getPooled(vf.select,gf,e,t)).type="select",e.target=mf,cd(e),e))}var _f={eventTypes:vf,extractEvents:function(e,t,n,r,i,o){if(!(o=!(i=o||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{i=Tc(i),o=Zu.onSelect;for(var a=0;aRf||(e.current=Of[Rf],Of[Rf]=null,Rf--)}function jf(e,t){Rf++,Of[Rf]=e.current,e.current=t}var Bf={},Uf={current:Bf},zf={current:!1},Ff=Bf;function Gf(e,t){var n=e.type.contextTypes;if(!n)return Bf;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Hf(e){return null!=(e=e.childContextTypes)}function Vf(){Lf(zf),Lf(Uf)}function Wf(e,t,n){if(Uf.current!==Bf)throw Error(Nu(168));jf(Uf,t),jf(zf,n)}function Yf(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(Nu(108,Fl(t)||"Unknown",i));return Iu({},n,{},r)}function Xf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bf,Ff=Uf.current,jf(Uf,e),jf(zf,zf.current),!0}function Qf(e,t,n){var r=e.stateNode;if(!r)throw Error(Nu(169));n?(e=Yf(e,t,Ff),r.__reactInternalMemoizedMergedChildContext=e,Lf(zf),Lf(Uf),jf(Uf,e)):Lf(zf),jf(zf,n)}var Zf=Cu.unstable_runWithPriority,qf=Cu.unstable_scheduleCallback,Jf=Cu.unstable_cancelCallback,Kf=Cu.unstable_requestPaint,$f=Cu.unstable_now,ep=Cu.unstable_getCurrentPriorityLevel,tp=Cu.unstable_ImmediatePriority,np=Cu.unstable_UserBlockingPriority,rp=Cu.unstable_NormalPriority,ip=Cu.unstable_LowPriority,op=Cu.unstable_IdlePriority,ap={},sp=Cu.unstable_shouldYield,up=void 0!==Kf?Kf:function(){},lp=null,cp=null,hp=!1,dp=$f(),fp=1e4>dp?$f:function(){return $f()-dp};function pp(){switch(ep()){case tp:return 99;case np:return 98;case rp:return 97;case ip:return 96;case op:return 95;default:throw Error(Nu(332))}}function vp(e){switch(e){case 99:return tp;case 98:return np;case 97:return rp;case 96:return ip;case 95:return op;default:throw Error(Nu(332))}}function mp(e,t){return e=vp(e),Zf(e,t)}function gp(e,t,n){return e=vp(e),qf(e,t,n)}function yp(e){return null===lp?(lp=[e],cp=qf(tp,xp)):lp.push(e),ap}function bp(){if(null!==cp){var e=cp;cp=null,Jf(e)}xp()}function xp(){if(!hp&&null!==lp){hp=!0;var e=0;try{var t=lp;mp(99,(function(){for(;e=t&&(rm=!0),e.firstContext=null)}function kp(e,t){if(Ep!==e&&!1!==t&&0!==t)if(("number"!=typeof t||1073741823===t)&&(Ep=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Sp){if(null===Mp)throw Error(Nu(308));Sp=t,Mp.dependencies={expirationTime:0,firstContext:t,responders:null}}else Sp=Sp.next=t;return e._currentValue}var Dp=!1;function Pp(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function Op(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Rp(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function Lp(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function jp(e,t){var n=e.alternate;null!==n&&Op(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function Bp(e,t,n,r){var i=e.updateQueue;Dp=!1;var o=i.baseQueue,a=i.shared.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}o=a,i.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=a))}if(null!==o){s=o.next;var u=i.baseState,l=0,c=null,h=null,d=null;if(null!==s)for(var f=s;;){if((a=f.expirationTime)l&&(l=a)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:f.suspenseConfig,tag:f.tag,payload:f.payload,callback:f.callback,next:null}),Lg(a,f.suspenseConfig);e:{var v=e,m=f;switch(a=t,p=n,m.tag){case 1:if("function"==typeof(v=m.payload)){u=v.call(p,u,a);break e}u=v;break e;case 3:v.effectTag=-4097&v.effectTag|64;case 0:if(null==(a="function"==typeof(v=m.payload)?v.call(p,u,a):v))break e;u=Iu({},u,a);break e;case 2:Dp=!0}}null!==f.callback&&(e.effectTag|=32,null===(a=i.effects)?i.effects=[f]:a.push(f))}if(null===(f=f.next)||f===s){if(null===(a=i.shared.pending))break;f=o.next=a.next,a.next=s,i.baseQueue=o=a,i.shared.pending=null}}null===d?c=u:d.next=h,i.baseState=c,i.baseQueue=d,jg(l),e.expirationTime=l,e.memoizedState=u}}function Up(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;tv?(m=p,p=null):m=p.sibling;var g=d(i,p,s[v],u);if(null===g){null===p&&(p=m);break}e&&p&&null===g.alternate&&t(i,p),a=o(g,a,v),null===c?l=g:c.sibling=g,c=g,p=m}if(v===s.length)return n(i,p),l;if(null===p){for(;vv?(m=p,p=null):m=p.sibling;var y=d(i,p,g.value,u);if(null===y){null===p&&(p=m);break}e&&p&&null===y.alternate&&t(i,p),a=o(y,a,v),null===c?l=y:c.sibling=y,c=y,p=m}if(g.done)return n(i,p),l;if(null===p){for(;!g.done;v++,g=s.next())null!==(g=h(i,g.value,u))&&(a=o(g,a,v),null===c?l=g:c.sibling=g,c=g);return l}for(p=r(i,p);!g.done;v++,g=s.next())null!==(g=f(p,i,v,g.value,u))&&(e&&null!==g.alternate&&p.delete(null===g.key?v:g.key),a=o(g,a,v),null===c?l=g:c.sibling=g,c=g);return e&&p.forEach((function(e){return t(i,e)})),l}(s,u,l,c);if(v&&qp(s,l),void 0===l&&!p)switch(s.tag){case 1:case 0:throw s=s.type,Error(Nu(152,s.displayName||s.name||"Component"))}return n(s,u)}}var Kp=Jp(!0),$p=Jp(!1),ev={},tv={current:ev},nv={current:ev},rv={current:ev};function iv(e){if(e===ev)throw Error(Nu(174));return e}function ov(e,t){switch(jf(rv,t),jf(nv,e),jf(tv,ev),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:uc(null,"");break;default:t=uc(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Lf(tv),jf(tv,t)}function av(){Lf(tv),Lf(nv),Lf(rv)}function sv(e){iv(rv.current);var t=iv(tv.current),n=uc(t,e.type);t!==n&&(jf(nv,e),jf(tv,n))}function uv(e){nv.current===e&&(Lf(tv),Lf(nv))}var lv={current:0};function cv(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===zh||n.data===Fh))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function hv(e,t){return{responder:e,props:t}}var dv=_l.ReactCurrentDispatcher,fv=_l.ReactCurrentBatchConfig,pv=0,vv=null,mv=null,gv=null,yv=!1;function bv(){throw Error(Nu(321))}function xv(e,t){if(null===t)return!1;for(var n=0;no))throw Error(Nu(301));o+=1,gv=mv=null,t.updateQueue=null,dv.current=Yv,e=n(r,i)}while(t.expirationTime===pv)}if(dv.current=Hv,t=null!==mv&&null!==mv.next,pv=0,gv=mv=vv=null,yv=!1,t)throw Error(Nu(300));return e}function wv(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===gv?vv.memoizedState=gv=e:gv=gv.next=e,gv}function Tv(){if(null===mv){var e=vv.alternate;e=null!==e?e.memoizedState:null}else e=mv.next;var t=null===gv?vv.memoizedState:gv.next;if(null!==t)gv=t,mv=e;else{if(null===e)throw Error(Nu(310));e={memoizedState:(mv=e).memoizedState,baseState:mv.baseState,baseQueue:mv.baseQueue,queue:mv.queue,next:null},null===gv?vv.memoizedState=gv=e:gv=gv.next=e}return gv}function Mv(e,t){return"function"==typeof t?t(e):t}function Sv(e){var t=Tv(),n=t.queue;if(null===n)throw Error(Nu(311));n.lastRenderedReducer=e;var r=mv,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var s=a=o=null,u=i;do{var l=u.expirationTime;if(lvv.expirationTime&&(vv.expirationTime=l,jg(l))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:u.suspenseConfig,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),Lg(l,u.suspenseConfig),r=u.eagerReducer===e?u.eagerState:e(r,u.action);u=u.next}while(null!==u&&u!==i);null===s?o=r:s.next=a,hf(r,t.memoizedState)||(rm=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Ev(e){var t=Tv(),n=t.queue;if(null===n)throw Error(Nu(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);hf(o,t.memoizedState)||(rm=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Av(e){var t=wv();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Mv,lastRenderedState:e}).dispatch=Gv.bind(null,vv,e),[t.memoizedState,e]}function Iv(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=vv.updateQueue)?(t={lastEffect:null},vv.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Cv(){return Tv().memoizedState}function Nv(e,t,n,r){var i=wv();vv.effectTag|=e,i.memoizedState=Iv(1|t,n,void 0,void 0===r?null:r)}function kv(e,t,n,r){var i=Tv();r=void 0===r?null:r;var o=void 0;if(null!==mv){var a=mv.memoizedState;if(o=a.destroy,null!==r&&xv(r,a.deps))return void Iv(t,n,o,r)}vv.effectTag|=e,i.memoizedState=Iv(1|t,n,o,r)}function Dv(e,t){return Nv(516,4,e,t)}function Pv(e,t){return kv(516,4,e,t)}function Ov(e,t){return kv(4,2,e,t)}function Rv(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Lv(e,t,n){return n=null!=n?n.concat([e]):null,kv(4,2,Rv.bind(null,t,e),n)}function jv(){}function Bv(e,t){return wv().memoizedState=[e,void 0===t?null:t],e}function Uv(e,t){var n=Tv();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&xv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function zv(e,t){var n=Tv();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&xv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Fv(e,t,n){var r=pp();mp(98>r?98:r,(function(){e(!0)})),mp(97<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=a.createElement(i,{is:r.is}):(e=a.createElement(i),"select"===i&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,i),e[Jh]=t,e[Kh]=r,fm(e,t),t.stateNode=e,a=Nh(i,r),i){case"iframe":case"object":case"embed":yh("load",e),s=r;break;case"video":case"audio":for(s=0;s<_c.length;s++)yh(_c[s],e);s=r;break;case"source":yh("error",e),s=r;break;case"img":case"image":case"link":yh("error",e),yh("load",e),s=r;break;case"form":yh("reset",e),yh("submit",e),s=r;break;case"details":yh("toggle",e),s=r;break;case"input":Ql(e,r),s=Xl(e,r),yh("invalid",e),Dh(n,"onChange");break;case"option":s=$l(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Iu({},r,{value:void 0}),yh("invalid",e),Dh(n,"onChange");break;case"textarea":nc(e,r),s=tc(e,r),yh("invalid",e),Dh(n,"onChange");break;default:s=r}Ch(i,s);var u=s;for(o in u)if(u.hasOwnProperty(o)){var l=u[o];"style"===o?Ah(e,l):"dangerouslySetInnerHTML"===o?null!=(l=l?l.__html:void 0)&&cc(e,l):"children"===o?"string"==typeof l?("textarea"!==i||""!==l)&&hc(e,l):"number"==typeof l&&hc(e,""+l):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(Qu.hasOwnProperty(o)?null!=l&&Dh(n,o):null!=l&&wl(e,o,l,a))}switch(i){case"input":Wl(e),Jl(e,r,!1);break;case"textarea":Wl(e),ic(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Hl(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?ec(e,!!r.multiple,n,!1):null!=r.defaultValue&&ec(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=Ph)}Vh(i,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)vm(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(Nu(166));n=iv(rv.current),iv(tv.current),em(t)?(n=t.stateNode,r=t.memoizedProps,n[Jh]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Jh]=t,t.stateNode=n)}return null;case 13:return Lf(lv),r=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&em(t):(r=null!==(i=e.memoizedState),n||null===i||null!==(i=e.child.sibling)&&(null!==(o=t.firstEffect)?(t.firstEffect=i,i.nextEffect=o):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8)),n&&!r&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&lv.current)?ig===Jm&&(ig=Km):((ig===Jm||ig===Km)&&(ig=$m),0!==lg&&null!==tg&&(cy(tg,rg),hy(tg,lg)))),(n||r)&&(t.effectTag|=4),null);case 4:return av(),null;case 10:return Ip(t),null;case 19:if(Lf(lv),null===(r=t.memoizedState))return null;if(i=0!=(64&t.effectTag),null===(o=r.rendering)){if(i)wm(r,!1);else if(ig!==Jm||null!==e&&0!=(64&e.effectTag))for(o=t.child;null!==o;){if(null!==(e=cv(o))){for(t.effectTag|=64,wm(r,!1),null!==(i=e.updateQueue)&&(t.updateQueue=i,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)o=n,(i=r).effectTag&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(e=i.alternate)?(i.childExpirationTime=0,i.expirationTime=o,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null):(i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,o=e.dependencies,i.dependencies=null===o?null:{expirationTime:o.expirationTime,firstContext:o.firstContext,responders:o.responders}),r=r.sibling;return jf(lv,1&lv.current|2),t.child}o=o.sibling}}else{if(!i)if(null!==(e=cv(o))){if(t.effectTag|=64,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),wm(r,!0),null===r.tail&&"hidden"===r.tailMode&&!o.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*fp()-r.renderingStartTime>r.tailExpiration&&1t)&&bg.set(e,t))}}function Eg(e,t){e.expirationTime=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Ig(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=yp(Ng.bind(null,e));else{var t=Ag(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Tg();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==ap&&Jf(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?yp(Ng.bind(null,e)):gp(r,Cg.bind(null,e),{timeout:10*(1073741821-t)-fp()}),e.callbackNode=t}}}function Cg(e,t){if(wg=0,t)return dy(e,t=Tg()),Ig(e),null;var n=Ag(e);if(0!==n){if(t=e.callbackNode,0!=(48&eg))throw Error(Nu(327));if(Yg(),e===tg&&n===rg||Pg(e,n),null!==ng){var r=eg;eg|=Zm;for(var i=Rg();;)try{Ug();break}catch(t){Og(e,t)}if(Ap(),eg=r,Xm.current=i,1===ig)throw t=og,Pg(e,n),cy(e,n),Ig(e),t;if(null===ng)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=ig,tg=null,r){case Jm:case 1:throw Error(Nu(345));case 2:dy(e,2=n){e.lastPingedTime=n,Pg(e,n);break}}if(0!==(o=Ag(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=Yh(Hg.bind(null,e),i);break}Hg(e);break;case $m:if(cy(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Gg(i)),cg&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,Pg(e,n);break}if(0!==(i=Ag(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==sg?r=10*(1073741821-sg)-fp():1073741823===ag?r=0:(r=10*(1073741821-ag)-5e3,0>(r=(i=fp())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ym(r/1960))-r)&&(r=n)),10=(r=0|a.busyMinDurationMs)?r=0:(i=0|a.busyDelayMs,r=(o=fp()-(10*(1073741821-o)-(0|a.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+Gl(a))}5!==ig&&(ig=2),s=Sm(s,a),h=o;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=t,jp(h,Hm(h,u,t));break e;case 1:u=s;var x=h.type,w=h.stateNode;if(0==(64&h.effectTag)&&("function"==typeof x.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===vg||!vg.has(w)))){h.effectTag|=4096,h.expirationTime=t,jp(h,Vm(h,u,t));break e}}h=h.return}while(null!==h)}ng=Fg(ng)}catch(e){t=e;continue}break}}function Rg(){var e=Xm.current;return Xm.current=Hv,null===e?Hv:e}function Lg(e,t){elg&&(lg=e)}function Bg(){for(;null!==ng;)ng=zg(ng)}function Ug(){for(;null!==ng&&!sp();)ng=zg(ng)}function zg(e){var t=Wm(e.alternate,e,rg);return e.memoizedProps=e.pendingProps,null===t&&(t=Fg(e)),Qm.current=null,t}function Fg(e){ng=e;do{var t=ng.alternate;if(e=ng.return,0==(2048&ng.effectTag)){if(t=Tm(t,ng,rg),1===rg||1!==ng.childExpirationTime){for(var n=0,r=ng.child;null!==r;){var i=r.expirationTime,o=r.childExpirationTime;i>n&&(n=i),o>n&&(n=o),r=r.sibling}ng.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=ng.firstEffect),null!==ng.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=ng.firstEffect),e.lastEffect=ng.lastEffect),1(e=e.childExpirationTime)?t:e}function Hg(e){var t=pp();return mp(99,Vg.bind(null,e,t)),null}function Vg(e,t){do{Yg()}while(null!==gg);if(0!=(48&eg))throw Error(Nu(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(Nu(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Gg(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===tg&&(ng=tg=null,rg=0),1s&&(l=s,s=a,a=l),l=Lh(b,a),c=Lh(b,s),l&&c&&(1!==_.rangeCount||_.anchorNode!==l.node||_.anchorOffset!==l.offset||_.focusNode!==c.node||_.focusOffset!==c.offset)&&((x=x.createRange()).setStart(l.node,l.offset),_.removeAllRanges(),a>s?(_.addRange(x),_.extend(c.node,c.offset)):(x.setEnd(c.node,c.offset),_.addRange(x))))),x=[],_=b);_=_.parentNode;)1===_.nodeType&&x.push({element:_,left:_.scrollLeft,top:_.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b=n?gm(e,t,n):(jf(lv,1&lv.current),null!==(t=_m(e,t,n))?t.sibling:null);jf(lv,1&lv.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return xm(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),jf(lv,lv.current),!r)return null}return _m(e,t,n)}rm=!1}}else rm=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=Gf(t,Uf.current),Np(t,n),i=_v(null,t,r,e,i,n),t.effectTag|=1,"object"==_(i)&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,Hf(r)){var o=!0;Xf(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Pp(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&Gp(t,r,a,e),i.updater=Hp,t.stateNode=i,i._reactInternalFiber=t,Xp(t,r,e,n),t=hm(null,t,r,!0,o,n)}else t.tag=0,im(null,t,i,n),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=function(e){if("function"==typeof e)return ny(e)?1:0;if(null!=e){if((e=e.$$typeof)===Pl)return 11;if(e===Ll)return 14}return 2}(i),e=wp(i,e),o){case 0:t=lm(null,t,i,e,n);break e;case 1:t=cm(null,t,i,e,n);break e;case 11:t=om(null,t,i,e,n);break e;case 14:t=am(null,t,i,wp(i.type,e),r,n);break e}throw Error(Nu(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,lm(e,t,r,i=t.elementType===r?i:wp(r,i),n);case 1:return r=t.type,i=t.pendingProps,cm(e,t,r,i=t.elementType===r?i:wp(r,i),n);case 3:if(dm(t),r=t.updateQueue,null===e||null===r)throw Error(Nu(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,Op(e,t),Bp(t,r,null,n),(r=t.memoizedState.element)===i)tm(),t=_m(e,t,n);else{if((i=t.stateNode.hydrate)&&(Qv=Qh(t.stateNode.containerInfo.firstChild),Xv=t,i=Zv=!0),i)for(n=$p(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else im(e,t,r,n),tm();t=t.child}return t;case 5:return sv(t),null===e&&Kv(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,Wh(r,i)?a=null:null!==o&&Wh(r,o)&&(t.effectTag|=16),um(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(im(e,t,a,n),t=t.child),t;case 6:return null===e&&Kv(t),null;case 13:return gm(e,t,n);case 4:return ov(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Kp(t,null,r,n):im(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,om(e,t,r,i=t.elementType===r?i:wp(r,i),n);case 7:return im(e,t,t.pendingProps,n),t.child;case 8:case 12:return im(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value;var s=t.type._context;if(jf(Tp,s._currentValue),s._currentValue=o,null!==a)if(s=a.value,0===(o=hf(s,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,o):1073741823))){if(a.children===i.children&&!zf.current){t=_m(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var u=s.dependencies;if(null!==u){a=s.child;for(var l=u.firstContext;null!==l;){if(l.context===r&&0!=(l.observedBits&o)){1===s.tag&&((l=Rp(n,null)).tag=2,Lp(s,l)),s.expirationTime=t&&e<=t}function cy(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function hy(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function dy(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function fy(e,t,n,r){var i=t.current,o=Tg(),a=zp.suspense;o=Mg(o,i,a);e:if(n){t:{if(Mc(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(Nu(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(Hf(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(Nu(171))}if(1===n.tag){var u=n.type;if(Hf(u)){n=Yf(n,u,s);break e}}n=s}else n=Bf;return null===t.context?t.context=n:t.pendingContext=n,(t=Rp(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),Lp(i,t),Sg(i,o),o}function py(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function vy(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=t||n<0||h&&e-l>=o}function m(){var e,n,r=nb();if(v(r))return g(r);s=setTimeout(m,(n=t-((e=r)-u),h?ib(n,o-(e-l)):n))}function g(e){return s=void 0,d&&r?f(e):(r=i=void 0,a)}function y(){var e=nb(),n=v(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return p(u);if(h)return clearTimeout(s),s=setTimeout(m,t),f(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=tb(t)||0,qy(n)&&(c=!!n.leading,o=(h="maxWait"in n)?rb(tb(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},y.flush=function(){return void 0===s?a:g(nb())},y}var ab=function(e){s(n,e);var t=u(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).seeking=!1,r.mobileSeeking=!1,r.track=null,r.hoverTime=null,r.offset=0,r.secondsPrefix="00:00:",r.minutesPrefix="00:",r.seekPause=!1,r.handleTouchSeeking=function(e){for(var t=0,n=0;nthis.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:"translateX(".concat(e,"px)")}}},{key:"secondsToTime",value:function(e){e=Math.round(e+this.offset);var t=Math.floor(e/3600),n=e%3600,r=Math.floor(n/60),i=Math.ceil(n%60);return{hh:t.toString(),mm:r<10?"0"+r:r.toString(),ss:i<10?"0"+i:i.toString()}}},{key:"getHoverTime",value:function(){var e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),n=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+n.ss:this.props.total+this.offset<3600?this.minutesPrefix+n.mm+":"+n.ss:n.hh+":"+n.mm+":"+n.ss}},{key:"isThumbActive",value:function(){return this.state.seekHoverPosition>0||this.seeking}},{key:"drawHoverTime",value:function(){var e=this;return this.props.hideHoverTime?null:ln.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:function(t){return e.hoverTime=t}},this.getHoverTime())}},{key:"render",value:function(){var e=this;return ln.createElement("div",{className:"seek-slider"},ln.createElement("div",{className:"track",ref:function(t){return e.track=t},onMouseMove:function(t){return e.handleTrackHover(!1,t)},onMouseLeave:function(t){return e.handleTrackHover(!0,t)},onMouseDown:this.onMouseDown,onTouchStart:function(t){e.setMobileSeeking(!0),e.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},ln.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}]),n}(mt.exports.Component),sb=function(e){s(n,e);var t=u(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).stageVolume=0,r.updateVolumeTimer=0,r.onVolumeSeeking=!1,r.onClickOperationButton=function(){r.props.paused?r.props.play():r.props.pause()},r.operationButton=function(){return r.props.paused?ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},r.operationVolumeButton=function(){return r.props.volume>.9?ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):0===r.props.volume?ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):ln.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="})},r.handleClickVolume=function(){0===r.props.volume?0!==r.stageVolume?r.props.setVolume(r.stageVolume):r.props.setVolume(1):(r.stageVolume=r.props.volume,r.props.setVolume(0))},r.onChange=function(e){r.setState({currentTime:e}),e&&r.changeTime(e)},r.changeTime=ob((function(e){r.props.setCurrentTime(e)}),50),r.onVolumeChange=function(e){r.changeVolume(e),r.setState({seekVolume:e/100})},r.changeVolume=ob((function(e){r.props.setVolume(e/100)}),50),r.onVolumeSeekStart=function(){r.onVolumeSeeking=!0},r.onVolumeSeekEnd=ob((function(){r.onVolumeSeeking=!1}),500),r.onProgressSeekStart=function(){return r.setState({isPlayerSeeking:!0})},r.onProgressSeekEnd=ob((function(){r.setState({isPlayerSeeking:!1})}),500),r.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},r.stageVolume=e.volume,r}return x(n,[{key:"componentDidMount",value:function(){var e=this;this.updateVolumeTimer=setInterval((function(){e.onVolumeSeeking||e.setState({seekVolume:e.props.volume}),e.state.isPlayerSeeking||e.setState({currentTime:e.props.currentTime})}),100)}},{key:"componentWillUnmount",value:function(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}},{key:"render",value:function(){var e=this,t=this.props,n=t.duration,r=t.currentTime;return ln.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},ln.createElement("div",{className:"player-controller-progress"},ln.createElement(ab,{total:n,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),ln.createElement("div",{className:"player-controller-actions"},ln.createElement("div",{className:"player-controller-actions-left"},ln.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),ln.createElement("div",{className:"player-volume-box",onMouseEnter:function(){return e.setState({isVolumeHover:!0})},onMouseLeave:function(){return e.setState({isVolumeHover:!1})}},ln.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),ln.createElement("div",{className:"player-volume-slider"},ln.createElement(ab,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),ln.createElement("div",{className:"player-mid-box-time"},ub(Math.floor(r/1e3))," /"," ",ub(Math.floor(n/1e3)))))}}]),n}(mt.exports.Component);function ub(e){var t=e%60,n=(e-t)/60;if(n>=60){var r=n%60;return"".concat(lb((n-r)/60),":").concat(lb(r),":").concat(lb(t))}return"".concat(lb(n),":").concat(lb(t))}function lb(e){return e<=9?"0".concat(e):"".concat(e)}var cb=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).putAttributes=function(t){var n=e.props.context,r=n.getAttributes()||{};for(var i in t)r[i]!==t[i]&&n.updateAttributes([i],t[i])},e}return x(n,[{key:"render",value:function(){var e=this.props.context,t=e.getRoom(),n=t?void 0:e.getDisplayer(),r=this.putAttributes;return ln.createElement(hb,{room:t,player:n,context:e,plugin:{putAttributes:r}})}}]),n}(mt.exports.Component),hb=function(e){s(n,e);var t=u(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).alertMask=null,r.container=ln.createRef(),r.controllerHiddenTimer=0,r.syncPlayerTimer=0,r.retryCount=0,r.decreaseRetryTimer=0,r.noSoundSyncCount=0,r.showController=function(){r.setState({controllerVisible:!0}),r.debounceHidingController()},r.play=function(){var e,t=null==(e=r.props.room)?void 0:e.calibrationTimestamp;r.debug(">>> play",{paused:!1,hostTime:t}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!1,hostTime:t})},r.pause=function(){var e=Ry(r.getAttributes(),r.props);r.debug(">>> pause",{paused:!0,currentTime:e}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!0,currentTime:e})},r.setVolume=function(e){r.debug(">>> volume",{volume:e}),r.isEnabled()&&r.props.plugin.putAttributes({volume:e}),r.isEnabled()&&r.props.plugin.putAttributes({volume:e,muted:0===e})},r.setCurrentTime=function(e){var t,n=null==(t=r.props.room)?void 0:t.calibrationTimestamp;r.debug(">>> seek",{currentTime:e/1e3,hostTime:n}),r.isEnabled()&&r.props.plugin.putAttributes({currentTime:e/1e3,hostTime:n})},r.resetPlayer=function(){var e;null==(e=r.player)||e.autoplay(!1),r.state.NoSound||(r.debug(">>> ended",{paused:!0,currentTime:0}),r.isEnabled()&&r.props.plugin.putAttributes({paused:!0,currentTime:0}))},r.syncPlayerWithAttributes=function(){var e,t=r.getAttributes();if(t){var n=r.player;if(n&&(!r.state.NoSound||(r.noSoundSyncCount+=1)%8==0)){n.paused()!==t.paused&&(r.debug("<<< paused -> %o",t.paused),t.paused?n.pause():null==(e=n.play())||e.catch(r.catchPlayFail)),n.muted()!==t.muted&&(r.debug("<<< muted -> %o",t.muted),n.muted(t.muted)),n.volume()!==t.volume&&(r.debug("<<< volume -> %o",t.volume),n.volume(t.volume));var i=Ry(t,r.props),o=Oy.currentTimeMaxError;r.state.NoSound&&(o*=3),i>n.duration()?r.resetPlayer():Math.abs(n.currentTime()-i)>o&&(r.debug("<<< currentTime -> %o",i),n.currentTime(i))}}},r.debounceHidingController=function(){r.controllerHiddenTimer&&(clearTimeout(r.controllerHiddenTimer),r.controllerHiddenTimer=0),r.controllerHiddenTimer=setTimeout((function(){r.setState({controllerVisible:!1}),r.controllerHiddenTimer=0}),3e3)},r.decreaseRetryCount=function(){r.player&&r.retryCount>0&&(r.retryCount=r.retryCount-1)},r.catchPlayFail=function(e){var t,n,i=String(e);if(Ly&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=r.player)||t.autoplay("any"),r.setState({NoSound:!0});else{var o=null==(n=r.player)?void 0:n.error();o&&(r.retryCount<=3?(r.initPlayer(),r.retryCount=r.retryCount+1):(r.debug("catch videojs media error",o),r.setState({MediaError:!0}))),r.debug("catch error",e)}},r.fixPlayFail=function(){r.debug("try to fix play state"),r.setState({NoSound:!1});var e=r.getAttributes(),t=e.muted,n=e.volume;r.player&&(r.player.muted(t),r.player.volume(n))},r.initPlayer=g(regeneratorRuntime.mark((function e(){var t,n,i,o,a,s,u,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==(t=r.player)||t.dispose(),r.player=void 0,r.debug("creating elements ..."),n=r.getAttributes(),i=n.type,o=n.src,a=n.poster,(s=document.createElement("div")).setAttribute("data-vjs-player",""),(u=document.createElement("video")).className="video-js",a&&(u.poster=a),u.setAttribute("playsInline",""),u.setAttribute("webkit-playsinline",""),l=document.createElement("source"),new URL(o).pathname.endsWith(".m3u8")?l.type="application/x-mpegURL":u.src=o,l.src=o,i&&(l.type=i),u.appendChild(l),s.appendChild(u),r.container.current.appendChild(s),e.next=14,new Promise((function(e){return(window.requestAnimationFrame||window.setTimeout)(e)}));case 14:r.debug("initializing videojs() ..."),c=Z.default(u),r.player=c,window.player=c,c.one("loadedmetadata",r.gracefullyUpdate),c.on("ready",(function(){var e;null==(e=Oy.onPlayer)||e.call(Oy,c),c.on("timeupdate",r.gracefullyUpdate),c.on("volumechange",r.gracefullyUpdate),c.on("seeked",r.gracefullyUpdate),c.on("play",r.gracefullyUpdate),c.on("pause",r.gracefullyUpdate),c.on("ended",r.resetPlayer)})),c.on("error",r.catchPlayFail),r.setState({MediaError:!1});case 17:case"end":return e.stop()}}),e)}))),r.gracefullyUpdate=function(){return r.setState({updater:!r.state.updater})},r.setupAlert=function(e){e&&(e.addEventListener("touchstart",r.fixPlayFail),e.addEventListener("click",r.fixPlayFail)),r.alertMask=e},r.setupReload=function(e){e&&(e.addEventListener("touchstart",r.initPlayer),e.addEventListener("click",r.initPlayer))},r.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/app-media-player@0.1.0-alpha.5 requires white-web-sdk@^2.13.8 to work properly.")}(e.room),r}return x(n,[{key:"getAttributes",value:function(){var e=this.props.context.getAttributes();if(e){if(e=ky(ky({},Dy),e),this.player){var t=Ry(e,this.props),n=this.player.duration();!e.paused&&t>n&&(r=ky({},e),e=Sy(r,Ey({currentTime:0,paused:!0})),this.resetPlayer())}var r;return e}}},{key:"isShowingPoster",value:function(){var e=this.getAttributes();return!(null!=e&&e.src)||jy.some((function(t){return e.src.endsWith(t)}))}},{key:"render",value:function(){var e,t;if(!this.props.room&&!this.props.player)return null;var n=this.getAttributes();if(!n)return null;var r=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),i=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return ln.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},ln.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&ln.createElement("div",{className:"video-js-plugin-poster"},n.poster&&ln.createElement("img",{src:n.poster,alt:"",draggable:!1})),ln.createElement(sb,{duration:r,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Ry(n,this.props),setCurrentTime:this.setCurrentTime,buffered:r*i,visible:!0}),this.state.NoSound&&ln.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&ln.createElement("div",{className:"videojs-plugin-recovery-mode"},ln.createElement("button",{ref:this.setupReload},"Reload Player")))}},{key:"debug",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:B.AnimationMode.Immediately;if(this.inDisplaySceneDir){var t=this.attributes,n=t.width,r=void 0===n?1280:n,i=t.height,o=void 0===i?720:i,a=r?-r/2:0,s=o?-o/2:0;this.manager.moveCameraToContain({originX:a,originY:s,width:r,height:o,animationMode:e})}}},{key:"handleSetPage",value:function(e){if(!this.isReplay&&this.attributes.displaySceneDir){var t=e.payload,n=this.displayer,r=n.entireScenes()[this.attributes.displaySceneDir];if(!r||r.length!==t){var i=function(e,t){return new Array(e).fill(0).map((function(e,n){return t(n)}))}(t,(function(e){return{name:String(e+1)}}));n.putScenes(this.attributes.displaySceneDir,i),this.manager.setMainViewScenePath(this.attributes.displaySceneDir)}}}},{key:"listenIframe",value:function(t){var n=this;t.url&&this.iframe.src!==t.url&&(this.src_url_equal_anchor||(this.src_url_equal_anchor=document.createElement("a")),this.src_url_equal_anchor.href=t.url,this.src_url_equal_anchor.href!==this.iframe.src&&(this.iframe.src=t.url)),this.iframe.width="".concat(t.width,"px"),this.iframe.height="".concat(t.height,"px"),this.sideEffectManager.addEventListener(this.iframe,"load",(function(t){var r;n.postMessage({kind:"Init",payload:{attributes:n.attributes,roomState:null==(r=e.displayer)?void 0:r.state,currentPage:n.currentPage,observerId:n.displayer.observerId}}),e.emitter.emit("IframeLoad",t),n.sideEffectManager.addDisposer(e.emitter.on("Ready",(function(){var e;n.postMessage(null==(e=n.attributes.lastEvent)?void 0:e.payload)})),mb),n.computedStyleAndIframeDisplay()}),void 0,xb)}},{key:"listenDisplayerState",value:function(){var e=this;this.isReplay&&(this.displayer._phase===B.PlayerPhase.Playing&&this.computedStyleAndIframeDisplay(),this.sideEffectManager.add((function(){return e.displayer.callbacks.on("onPhaseChanged",e.onPhaseChangedListener),function(){return e.displayer.callbacks.off("onPhaseChanged",e.onPhaseChangedListener)}}),_b)),this.computedStyleAndIframeDisplay()}},{key:"computedStyleAndIframeDisplay",value:function(){this.computedStyle(this.displayer.state),this.computedIframeDisplay(this.displayer.state,this.attributes)}},{key:"listenDisplayerCallbacks",value:function(){this.displayer.callbacks.on(this.callbackName,this.stateChangeListener)}},{key:"computedStyle",value:function(e){var t=this.manager.cameraState,n=this.attributes.width||1280,r=this.attributes.height||720;if(this.iframe){var i=t.width,o=t.height,a=t.scale,s=t.centerX,u=t.centerY,l=this.rootRect||{x:0,y:0},c="".concat(i/2+l.x,"px"),h="".concat(o/2+l.y,"px"),d=-u*a+(o-r)/2*a,f=["position: absolute;","border: 0.1px solid rgba(0,0,0,0);","top: 0px;","left: 0px;","transform-origin: ".concat(c," ").concat(h,";"),"transform: translate(".concat(-s*a+(i-n)/2*a,"px,").concat(d,"px) scale(").concat(a,", ").concat(a,");")];this.cssList=f,this.computedZindex(),this.updateStyle()}}},{key:"computedIframeDisplay",value:function(t,n){this.inDisplaySceneDir?e.emitter.emit("DispayIframe"):e.emitter.emit("HideIframe")}},{key:"computedZindex",value:function(){var e="z-index: -1;",t=this.cssList.findIndex((function(t){return t===e}));-1!==t&&this.cssList.splice(t,1),(!this.isClicker()||this.isDisableInput)&&this.cssList.push(e)}},{key:"updateStyle",value:function(){this.iframe.style.cssText=this.cssList.join(" ")}},{key:"messageListener",value:function(e){if(tt("<<<",JSON.stringify(e.data)),e.origin===this.iframeOrigin){var t=e.data;switch(t.kind){case"SetAttributes":this.handleSetAttributes(t);break;case"RegisterMagixEvent":this.handleRegisterMagixEvent(t);break;case"RemoveMagixEvent":this.handleRemoveMagixEvent(t);break;case"DispatchMagixEvent":this.handleDispatchMagixEvent(t);break;case"RemoveAllMagixEvent":this.handleRemoveAllMagixEvent();break;case"NextPage":this.handleNextPage();break;case"PrevPage":this.handlePrevPage();break;case"SDKCreate":this.handleSDKCreate();break;case"SetPage":this.handleSetPage(t);break;case"GetAttributes":this.handleGetAttributes();break;case"PageTo":this.handlePageTo(t);break;default:tt("".concat(t.kind," not allow event."))}}}},{key:"handleSDKCreate",value:function(){this.postMessage({kind:"Init",payload:{attributes:this.attributes,roomState:this.displayer.state,currentPage:this.currentPage,observerId:this.displayer.observerId}})}},{key:"handleDispatchMagixEvent",value:function(e){var t=e.payload;this.appManager.safeDispatchMagixEvent(t.event,t.payload)}},{key:"handleSetAttributes",value:function(e){this.setAttributes(e.payload)}},{key:"handleRegisterMagixEvent",value:function(e){var t=this,n=e.payload,r=function(e){e.authorId!==t.displayer.observerId&&t.postMessage({kind:"ReciveMagixEvent",payload:e})};this.magixEventMap.set(n,r),this.displayer.addMagixEventListener(n,r)}},{key:"handleRemoveMagixEvent",value:function(e){var t=e.payload,n=this.magixEventMap.get(t);this.displayer.removeMagixEventListener(t,n)}},{key:"handleNextPage",value:function(){this.manager.canOperate&&(this.manager.nextPage(),this.dispatchMagixEvent("NextPage",{}))}},{key:"handlePrevPage",value:function(){this.manager.canOperate&&(this.manager.prevPage(),this.dispatchMagixEvent("PrevPage",{}))}},{key:"handlePageTo",value:function(e){if(this.manager.canOperate){var t=e.payload;if(!Number.isSafeInteger(t)||t<=0)return;this.manager.setMainViewSceneIndex(t-1),this.dispatchMagixEvent("PageTo",t-1)}}},{key:"handleRemoveAllMagixEvent",value:function(){var e=this;this.magixEventMap.forEach((function(t,n){e.displayer.removeMagixEventListener(n,t)})),this.magixEventMap.clear()}},{key:"handleGetAttributes",value:function(){this.postMessage({kind:"GetAttributes",payload:this.attributes})}},{key:"postMessage",value:function(e){var t;this.iframe&&(null==(t=this.iframe.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),"*"))}},{key:"dispatchMagixEvent",value:function(e,t){this.manager.canOperate&&(this.setAttributes({lastEvent:{name:e,payload:t}}),this.displayer.dispatchMagixEvent(e,t))}},{key:"isClicker",value:function(){if(this.readonly)return!1;var e=this.displayer.state.memberState.currentApplianceName;return this.allowAppliances.includes(e)}},{key:"attributes",get:function(){return this.appManager.store.getIframeBridge()}},{key:"isReplay",get:function(){return this.manager.isReplay}},{key:"callbackName",get:function(){return this.isReplay?"onPlayerStateChanged":"onRoomStateChanged"}},{key:"iframeOrigin",get:function(){if(this.iframe)try{return new URL(this.iframe.src).origin}catch(e){console.warn(e)}}},{key:"currentIndex",get:function(){return this.manager.mainViewSceneIndex}},{key:"currentPage",get:function(){return this.currentIndex+1}},{key:"totalPage",get:function(){return this.manager.mainViewScenesLength}},{key:"readonly",get:function(){return!this.displayer.isWritable}},{key:"inDisplaySceneDir",get:function(){return this.manager.mainViewSceneDir===this.attributes.displaySceneDir}},{key:"isDisableInput",get:function(){return!("disableDeviceInputs"in this.displayer)||this.displayer.disableDeviceInputs}}],[{key:"onCreate",value:function(t){e.emitter.emit("StartCreate"),e.emitter.emit("OnCreate",t),e.emitter.emit("created")}}]),e}(),Sb=Mb;Sb.kind="IframeBridge",Sb.hiddenClass="netless-iframe-brdige-hidden",Sb.emitter=new Q.default,Sb.displayer=null,Sb.alreadyCreate=!1;var Eb=new xo({emitter:ue}),Ab=function(e){s(b,e);var t,n,r,i,o,a,l,c,h,d,f,p,v,m=u(b);function b(e){var t;return y(this,b),(t=m.call(this,e)).version="0.4.68",t.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.27",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^0.1.5",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.17","@netless/app-media-player":"0.1.0-beta.5","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",jspdf:"^2.5.1",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3",vitest:"^0.14.1","white-web-sdk":"2.16.43"}},t.emitter=ae,t.viewMode=B.ViewMode.Broadcaster,t.isReplay=B.isPlayer(t.displayer),t.containerSizeRatio=b.containerSizeRatio,b.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.27",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^0.1.5",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.17","@netless/app-media-player":"0.1.0-beta.5","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",jspdf:"^2.5.1",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3",vitest:"^0.14.1","white-web-sdk":"2.16.43"}},t}return x(b,[{key:"bindContainer",value:function(e){var t,n,r,i,o,a;if(B.isRoom(this.displayer)&&this.room.phase!==B.RoomPhase.Connected)throw new Ge;if(b.isCreated&&b.container)b.container.firstChild&&e.appendChild(b.container.firstChild);else if(b.params){var s=b.params,u=b.initContainer(this,e,s);this.boxManager&&this.boxManager.destroy();var l=function(e,t,n,r,i){return new Ii({safeSetAttributes:function(t){return e.safeSetAttributes(t)},getMainView:function(){return e.mainView},updateAppState:function(){var t,n;return null==(n=e.appManager)?void 0:(t=n.store).updateAppState.apply(t,arguments)},canOperate:function(){return e.canOperate},notifyContainerRectUpdate:function(t){var n;return null==(n=e.appManager)?void 0:n.notifyContainerRectUpdate(t)},cleanFocus:function(){var t;return null==(t=e.appManager)?void 0:t.store.cleanFocus()},setAppFocus:function(t){var n;return null==(n=e.appManager)?void 0:n.store.setAppFocus(t,!0)},callbacks:t,emitter:n,boxEmitter:r},i)}(this,ae,ue,rt,{collectorContainer:s.collectorContainer,collectorStyles:s.collectorStyles,prefersColorScheme:s.prefersColorScheme});this.boxManager=l,null==(t=this.appManager)||t.setBoxManager(l),this.bindMainView(u,s.disableCameraTransform),b.wrapper&&(null==(n=this.cursorManager)||n.setupWrapper(b.wrapper))}ue.emit("updateManagerRect"),null==(r=this.appManager)||r.refresh(),null==(i=this.appManager)||i.resetMaximized(),null==(o=this.appManager)||o.resetMinimized(),null==(a=this.appManager)||a.displayerWritableListener(!this.room.isWritable),b.container=e}},{key:"bindCollectorContainer",value:function(e){b.isCreated&&this.boxManager?this.boxManager.setCollectorContainer(e):b.params&&(b.params.collectorContainer=e)}},{key:"addApp",value:(v=g(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=2;break}return e.abrupt("return",this.appManager.rootDirRemoving?new Promise((function(e,r){ue.once("rootDirRemoved").then(g(regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,n._addApp(t);case 3:o=i.sent,e(o),i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),r(i.t0.message);case 10:case"end":return i.stop()}}),i,null,[[0,7]])}))))})):this._addApp(t));case 2:throw new Le;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"_addApp",value:(p=g(regeneratorRuntime.mark((function e(t){var n,r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=21;break}if(t.kind&&"string"==typeof t.kind){e.next=3;break}throw new Be;case 3:return t.src&&"string"==typeof t.src&&xe.register({kind:t.kind,src:t.src}),e.next=6,null==(n=xe.appClasses.get(t.kind))?void 0:n();case 6:if(!((o=e.sent)&&(null==(r=o.config)?void 0:r.singleton)&&this.appManager.appProxies.has(t.kind))){e.next=9;break}throw new Oe;case 9:if(void 0!==(a=this.setupScenePath(t,this.appManager))){e.next=14;break}e.t0=void 0,e.next=18;break;case 14:return null!=(i=null==t?void 0:t.options)&&i.scenePath&&(t.options.scenePath=Ce(t.options.scenePath)),e.next=17,this.appManager.addApp(t,Boolean(a));case 17:e.t0=e.sent;case 18:return e.abrupt("return",e.t0);case 21:throw new Le;case 22:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"setupScenePath",value:function(e,t){var n=!1;if(e.options){var r=e.options,i=r.scenePath,o=r.scenes;if(i){if(!function(e){return e.startsWith("/")}(i))throw new ze;for(var a=0,s=Object.keys(this.apps||{});a0&&(this.isDynamicPPT(o)?(n=!0,Ee(this.displayer)[i]||Ae(this.room,i,o)):Ee(this.displayer)[i]||Ae(this.room,i,[{name:o[0].name}])),i&&void 0===o&&Ae(this.room,i,[{}])}return n}},{key:"setMainViewScenePath",value:(f=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.appManager,!e.t0){e.next=4;break}return e.next=4,this.appManager.setMainViewScenePath(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(d=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.appManager,!e.t0){e.next=4;break}return e.next=4,this.appManager.setMainViewSceneIndex(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"nextPage",value:(h=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=12;break}if(!((t=this.mainViewSceneIndex+1)>=this.mainViewScenesLength)){e.next=6;break}e.t0=(console.warn("[WindowManager]: current page is the last page"),!1),e.next=9;break;case 6:return e.next=8,this.appManager.setMainViewSceneIndex(t);case 8:e.t0=!0;case 9:return e.abrupt("return",e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"prevPage",value:(c=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=12;break}if(!((t=this.mainViewSceneIndex-1)<0)){e.next=6;break}e.t0=(console.warn("[WindowManager]: current page is the first page"),!1),e.next=9;break;case 6:return e.next=8,this.appManager.setMainViewSceneIndex(t);case 8:e.t0=!0;case 9:return e.abrupt("return",e.t0);case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"jumpPage",value:(l=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=11;break}if(!(t<0||t>=this.pageState.length)){e.next=5;break}e.t1=(console.warn("[WindowManager]: index ".concat(t," out of range")),!1),e.next=8;break;case 5:return e.next=7,this.appManager.setMainViewSceneIndex(t);case 7:e.t1=!0;case 8:e.t0=e.t1,e.next=12;break;case 11:e.t0=!1;case 12:return e.abrupt("return",e.t0);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"addPage",value:(a=g(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.appManager&&(n=null==t?void 0:t.after,r=null==t?void 0:t.scene,n?(i=this.mainViewSceneIndex+1,this.room.putScenes(ie,[r||{}],i)):this.room.putScenes(ie,[r||{}]));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"removePage",value:(o=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.appManager){e.next=5;break}return n=void 0===t?this.pageState.index:t,e.abrupt("return",1===this.pageState.length?(console.warn("[WindowManager]: can not remove the last page"),!1):n<0||n>=this.pageState.length?(console.warn("[WindowManager]: index ".concat(t," out of range")),!1):this.appManager.removeSceneByIndex(n));case 5:return e.abrupt("return",!1);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getMainViewScenePath",value:function(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewScenePath()}},{key:"getMainViewSceneIndex",value:function(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewSceneIndex()}},{key:"setReadonly",value:function(e){var t;this.readonly=e,null==(t=this.boxManager)||t.setReadonly(e),ue.emit("setReadonly",e)}},{key:"switchMainViewToWriter",value:function(){var e;return null==(e=this.appManager)?void 0:e.mainViewProxy.mainViewClickHandler()}},{key:"onAppDestroy",value:function(e,t){!function(e,t){ue.once(e).then(t)}("destroy-".concat(e),t)}},{key:"onAppEvent",value:function(e,t){return ue.on("custom-".concat(e),t)}},{key:"setViewMode",value:function(e){var t,n,r,i;(e===B.ViewMode.Broadcaster||e===B.ViewMode.Follower)&&(this.canOperate&&e===B.ViewMode.Broadcaster&&(null==(t=this.appManager)||t.mainViewProxy.setCameraAndSize()),null==(n=this.appManager)||n.mainViewProxy.start()),e===B.ViewMode.Freedom&&(null==(r=this.appManager)||r.mainViewProxy.stop()),this.viewMode=e,null==(i=this.appManager)||i.mainViewProxy.setViewMode(e)}},{key:"setBoxState",value:function(e){if(this.canOperate)switch(e){case"normal":this.setMaximized(!1),this.setMinimized(!1);break;case"maximized":this.setMaximized(!0),this.setMinimized(!1);break;case"minimized":this.setMinimized(!0)}}},{key:"setMaximized",value:function(e){var t;!this.canOperate||null==(t=this.boxManager)||t.setMaximized(e,!1)}},{key:"setMinimized",value:function(e){var t;!this.canOperate||null==(t=this.boxManager)||t.setMinimized(e,!1)}},{key:"setFullscreen",value:function(e){var t;this._fullscreen!==e&&(this._fullscreen=e,null==(t=b.sizer)||t.classList.toggle("netless-window-manager-fullscreen",e),ae.emit("fullscreenChange",e))}},{key:"queryAll",value:function(){var e;return Array.from((null==(e=this.appManager)?void 0:e.appProxies.values())||[])}},{key:"queryOne",value:function(e){var t;return null==(t=this.appManager)?void 0:t.appProxies.get(e)}},{key:"closeApp",value:(i=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null==(n=this.appManager)?void 0:n.closeApp(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"focusApp",value:function(e){var t,n,r,i=null==(t=this.boxManager)?void 0:t.getBox(e);i&&(null==(n=this.boxManager)||n.focusBox({appId:e},!1),(null==(r=this.boxManager)?void 0:r.teleBoxManager).makeBoxTop(i,!1))}},{key:"moveCamera",value:function(e){var t,n=this,r=j.omit(e,["animationMode"]),i=P({},this.mainView.camera);j.isEqual(P(P({},i),r),i)||(this.mainView.moveCamera(e),null==(t=this.appManager)||t.dispatchInternalEvent(q.MoveCamera,e),setTimeout((function(){var e;null==(e=n.appManager)||e.mainViewProxy.setCameraAndSize()}),500))}},{key:"moveCameraToContain",value:function(e){var t,n=this;this.mainView.moveCameraToContain(e),null==(t=this.appManager)||t.dispatchInternalEvent(q.MoveCameraToContain,e),setTimeout((function(){var e;null==(e=n.appManager)||e.mainViewProxy.setCameraAndSize()}),500)}},{key:"convertToPointInWorld",value:function(e){return this.mainView.convertToPointInWorld(e)}},{key:"setCameraBound",value:function(e){this.mainView.setCameraBound(e)}},{key:"onDestroy",value:function(){this._destroy()}},{key:"destroy",value:function(){this._destroy()}},{key:"_destroy",value:function(){var e,t,n,r,i;null==(e=this.containerResizeObserver)||e.disconnect(),null==(t=this.appManager)||t.destroy(),null==(n=this.cursorManager)||n.destroy(),b.container=void 0,b.wrapper=void 0,b.sizer=void 0,b.isCreated=!1,b.playground&&(null==(r=b.playground.parentNode)||r.removeChild(b.playground)),b.params=void 0,null==(i=this._iframeBridge)||i.destroy(),this._iframeBridge=void 0,tt("Destroyed")}},{key:"bindMainView",value:function(e,t){var n;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),null==(n=this.cursorManager)||n.setMainViewDivElement(e))}},{key:"safeSetAttributes",value:function(e){this.canOperate&&this.setAttributes(e)}},{key:"safeUpdateAttributes",value:function(e,t){this.canOperate&&this.updateAttributes(e,t)}},{key:"setPrefersColorScheme",value:function(e){var t,n;null==(n=null==(t=this.appManager)?void 0:t.boxManager)||n.setPrefersColorScheme(e)}},{key:"cleanCurrentScene",value:function(){var e;tt("clean current scene"),null==(e=this.focusedView)||e.cleanCurrentScene()}},{key:"redo",value:function(){var e;return(null==(e=this.focusedView)?void 0:e.redo())||0}},{key:"undo",value:function(){var e;return(null==(e=this.focusedView)?void 0:e.undo())||0}},{key:"delete",value:function(){var e;null==(e=this.focusedView)||e.delete()}},{key:"copy",value:function(){var e;null==(e=this.focusedView)||e.copy()}},{key:"paste",value:function(){var e;null==(e=this.focusedView)||e.paste()}},{key:"duplicate",value:function(){var e;null==(e=this.focusedView)||e.duplicate()}},{key:"insertText",value:function(e,t,n){var r;return(null==(r=this.focusedView)?void 0:r.insertText(e,t,n))||""}},{key:"insertImage",value:function(e){var t;return null==(t=this.focusedView)?void 0:t.insertImage(e)}},{key:"completeImageUpload",value:function(e,t){var n;return null==(n=this.focusedView)?void 0:n.completeImageUpload(e,t)}},{key:"lockImage",value:function(e,t){var n;return null==(n=this.focusedView)?void 0:n.lockImage(e,t)}},{key:"lockImages",value:function(e){var t;return null==(t=this.focusedView)?void 0:t.lockImages(e)}},{key:"refresh",value:function(){var e;this._refresh(),null==(e=this.appManager)||e.dispatchInternalEvent(q.Refresh)}},{key:"_refresh",value:function(){var e,t;null==(e=this.appManager)||e.mainViewProxy.rebind(),b.container&&this.bindContainer(b.container),null==(t=this.appManager)||t.refresher.refresh()}},{key:"setContainerSizeRatio",value:function(e){if(!(j.isNumber(e)&&e>0))throw new Error("[WindowManager]: updateContainerSizeRatio error, ratio must be a positive number. but got ".concat(e));b.containerSizeRatio=e,this.containerSizeRatio=e,ue.emit("containerSizeRatioUpdate",e)}},{key:"isDynamicPPT",value:function(e){var t,n,r=null==(n=null==(t=e[0])?void 0:t.ppt)?void 0:n.src;return null==r?void 0:r.startsWith("pptx://")}},{key:"ensureAttributes",value:(r=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=j.isNull(this.attributes),!e.t0){e.next=4;break}return e.next=4,ke(50);case 4:j.isObject(this.attributes)&&(this.attributes[$e.Apps]||this.safeSetAttributes(w({},$e.Apps,{})),this.attributes[$e.Cursors]||this.safeSetAttributes(w({},$e.Cursors,{})),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:oe}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[$e.Registered]||this.safeSetAttributes(w({},$e.Registered,{})),this.attributes[$e.IframeBridge]||this.safeSetAttributes(w({},$e.IframeBridge,{})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getIframeBridge",value:function(){if(!this.appManager)throw new Error("[WindowManager]: should call getIframeBridge() after await mount()");return this._iframeBridge||(this._iframeBridge=new Sb(this,this.appManager)),this._iframeBridge}},{key:"mainView",get:function(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new Le}},{key:"camera",get:function(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new Le}},{key:"cameraState",get:function(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new Le}},{key:"apps",get:function(){var e;return null==(e=this.appManager)?void 0:e.store.apps()}},{key:"boxState",get:function(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.boxState;throw new Le}},{key:"darkMode",get:function(){var e,t;return Boolean(null==(t=null==(e=this.appManager)?void 0:e.boxManager)?void 0:t.darkMode)}},{key:"prefersColorScheme",get:function(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.prefersColorScheme;throw new Le}},{key:"focused",get:function(){return this.attributes.focus}},{key:"focusedView",get:function(){var e,t;return(null==(t=null==(e=this.appManager)?void 0:e.focusApp)?void 0:t.view)||this.mainView}},{key:"polling",get:function(){var e;return(null==(e=this.appManager)?void 0:e.polling)||!1},set:function(e){this.appManager&&(this.appManager.polling=e)}},{key:"mainViewSceneIndex",get:function(){var e;return(null==(e=this._pageState)?void 0:e.index)||0}},{key:"mainViewSceneDir",get:function(){var e;if(this.appManager)return null==(e=this.appManager)?void 0:e.getMainViewSceneDir();throw new Le}},{key:"topApp",get:function(){var e,t;return null==(t=null==(e=this.boxManager)?void 0:e.getTopBox())?void 0:t.id}},{key:"mainViewScenesLength",get:function(){var e;return(null==(e=this._pageState)?void 0:e.length)||0}},{key:"canRedoSteps",get:function(){var e;return(null==(e=this.focusedView)?void 0:e.canRedoSteps)||0}},{key:"canUndoSteps",get:function(){var e;return(null==(e=this.focusedView)?void 0:e.canUndoSteps)||0}},{key:"sceneState",get:function(){if(this.appManager)return this.appManager.sceneState;throw new Le}},{key:"pageState",get:function(){if(this._pageState)return this._pageState.toObject();throw new Le}},{key:"fullscreen",get:function(){return Boolean(this._fullscreen)}},{key:"canOperate",get:function(){return!!B.isRoom(this.displayer)&&(this.displayer.isWritable&&this.displayer.phase===B.RoomPhase.Connected)}},{key:"room",get:function(){return this.displayer}}],[{key:"mount",value:(n=g(regeneratorRuntime.mark((function e(t){var n,r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.room,b.container=t.container,r=t.containerSizeRatio,i=t.debug,o=t.cursor,b.params=t,b.displayer=t.room,ht(),!B.isRoom(n)){e.next=11;break}if(n.phase===B.RoomPhase.Connected){e.next=7;break}throw new Error("[WindowManager]: Room only Connected can be mount");case 7:return n.phase===B.RoomPhase.Connected&&n.isWritable&&(n.disableSerialization=!1),e.next=10,this.initManager(n);case 10:a=e.sent;case 11:if(!b.isCreated){e.next=13;break}throw new Error("[WindowManager]: Already created cannot be created again");case 13:if(this.debug=Boolean(i),tt("Already insert room",a),!B.isRoom(this.displayer)){e.next=18;break}if(a){e.next=16;break}throw new Error("[WindowManager]: init InvisiblePlugin failed");case 16:e.next=20;break;case 18:return e.next=20,X.default(function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getInvisiblePlugin(b.kind)){e.next=2;break}throw tt("manager is empty. retrying ".concat(t)),new Error;case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),{retries:10,maxTimeout:5e3});case 20:if(a){e.next=22;break}throw new Error("[WindowManager]: create manager failed");case 22:return r&&(b.containerSizeRatio=r),e.next=25,a.ensureAttributes();case 25:return a._fullscreen=t.fullscreen,a.appManager=new ct(a),a.appManager.polling=t.polling||!1,a._pageState=new bo(a.appManager),a.cursorManager=new yo(a.appManager,Boolean(o),t.applianceIcons),r&&(a.containerSizeRatio=r),t.container&&a.bindContainer(t.container),_o(n,a),ue.emit("onCreated"),b.isCreated=!0,e.prev=35,e.next=38,le();case 38:e.next=43;break;case 40:e.prev=40,e.t0=e.catch(35),console.warn("[WindowManager]: indexedDB open failed"),console.log(e.t0);case 43:return e.abrupt("return",a);case 44:case"end":return e.stop()}}),e,this,[[35,40]])}))),function(e){return n.apply(this,arguments)})},{key:"initManager",value:(t=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=t.getInvisiblePlugin(b.kind))||!B.isRoom(t)){e.next=24;break}if(!1!==t.isWritable){e.next=21;break}return e.prev=3,e.next=6,t.setWritable(!0);case 6:e.next=11;break;case 8:throw e.prev=8,e.t0=e.catch(3),new Error("[WindowManger]: room must be switched to be writable");case 11:return e.next=13,ft(t);case 13:return null==(n=e.sent)||n.ensureAttributes(),e.next=17,ke(500);case 17:return e.next=19,t.setWritable(!1);case 19:e.next=24;break;case 21:return e.next=23,ft(t);case 23:n=e.sent;case 24:return e.abrupt("return",n);case 25:case"end":return e.stop()}}),e,null,[[3,8]])}))),function(e){return t.apply(this,arguments)})},{key:"initContainer",value:function(e,t,n){var r=n.chessboard,i=n.overwriteStyles,o=n.fullscreen;b.container||(b.container=t);var a=function(e){var t=document.createElement("div");t.className="netless-window-manager-playground";var n=document.createElement("div");n.className="netless-window-manager-sizer";var r=document.createElement("div");r.className="netless-window-manager-wrapper";var i=document.createElement("div");return i.className="netless-window-manager-main-view",t.appendChild(n),n.appendChild(r),r.appendChild(i),e.appendChild(t),Ib.wrapper=r,{playground:t,wrapper:r,sizer:n,mainViewElement:i}}(t),s=a.playground,u=a.wrapper,l=a.sizer,c=a.mainViewElement;if(b.playground=s,r&&l.classList.add("netless-window-manager-chess-sizer"),o&&l.classList.add("netless-window-manager-fullscreen"),i){var h=document.createElement("style");h.textContent=i,s.appendChild(h)}return e.containerResizeObserver=vt.create(s,l,u,ue),b.wrapper=u,b.sizer=l,c}},{key:"register",value:function(e){return xe.register(e)}},{key:"unregister",value:function(e){return xe.unregister(e)}},{key:"registered",get:function(){return xe.registered}}]),b}(B.InvisiblePlugin),Ib=Ab;Ib.kind="WindowManager",Ib.debug=!1,Ib.containerSizeRatio=9/16,Ib.isCreated=!1,Ib.debug&&function(e){Oy=ky(ky({},Py),e)}({verbose:!0}),Ib.register({kind:wu.kind,src:wu}),Ib.register({kind:db.kind,src:db}),t.AppCreateError=Oe,t.AppManagerNotInitError=Le,t.AppNotRegisterError=Re,t.BindContainerRoomPhaseInvalidError=Ge,t.BoxManagerNotFoundError=Fe,t.BoxNotCreatedError=Ue,t.BuiltinApps=fb,t.DomEvents=vb,t.IframeBridge=Sb,t.IframeEvents=pb,t.InvalidScenePath=ze,t.ParamsInvalidError=Be,t.WhiteWebSDKInvalidError=je,t.WindowManager=Ib,t.calculateNextIndex=nt,t.reconnectRefresher=Eb},6513:function(e,t,n){var r=n(49766).Buffer;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.xml2json=t.xml2js=t.json2xml=t.js2xml=void 0;var a=void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=[],u=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c=!1;function h(){c=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}function f(e){var t;c||h();for(var n=e.length,r=n%3,i="",o=[],a=16383,u=0,l=n-r;ul?l:u+a));return 1===r?(t=e[n-1],i+=s[t>>2],i+=s[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=s[t>>10],i+=s[t>>4&63],i+=s[t<<2&63],i+="="),o.push(i),o.join("")}function p(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=l}return(f?-1:1)*a*Math.pow(2,o-r)}function v(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,l-=8);e[n+f-p]|=128*v}var m={}.toString,g=Array.isArray||function(e){return"[object Array]"==m.call(e)};function y(){return x.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function b(e,t){if(y()=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return 0|e}function E(e){return!(null==e||!e._isBuffer)}function A(e,t){if(E(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return ee(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return te(e).length;default:if(r)return ee(e).length;t=(""+t).toLowerCase(),r=!0}}function I(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return H(this,t,n);case"utf8":case"utf-8":return U(this,t,n);case"ascii":return F(this,t,n);case"latin1":case"binary":return G(this,t,n);case"base64":return B(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function C(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function N(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=x.from(t,r)),E(t))return 0===t.length?-1:k(e,t,n,r,i);if("number"==typeof t)return t&=255,x.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):k(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function k(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,d=0;di&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function B(e,t,n){return 0===t&&n===e.length?f(e):f(e.slice(t,n))}function U(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+h<=n)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(e){var t=e.length;if(t<=z)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},x.prototype.compare=function(e,t,n,r,i){if(!E(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),l=e.slice(t,n),c=0;ci)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return D(this,e,t,n);case"utf8":case"utf-8":return P(this,e,t,n);case"ascii":return O(this,e,t,n);case"latin1":case"binary":return R(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},x.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var z=4096;function F(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function Y(e,t,n,r,i,o){if(!E(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function X(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function Q(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function Z(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function q(e,t,n,r,i){return i||Z(e,0,n,4),v(e,t,n,r,23,4),n+4}function J(e,t,n,r,i){return i||Z(e,0,n,8),v(e,t,n,r,52,8),n+8}x.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},x.prototype.readUInt8=function(e,t){return t||W(e,1,this.length),this[e]},x.prototype.readUInt16LE=function(e,t){return t||W(e,2,this.length),this[e]|this[e+1]<<8},x.prototype.readUInt16BE=function(e,t){return t||W(e,2,this.length),this[e]<<8|this[e+1]},x.prototype.readUInt32LE=function(e,t){return t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},x.prototype.readUInt32BE=function(e,t){return t||W(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},x.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||W(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},x.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||W(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},x.prototype.readInt8=function(e,t){return t||W(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},x.prototype.readInt16LE=function(e,t){t||W(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},x.prototype.readInt16BE=function(e,t){t||W(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},x.prototype.readInt32LE=function(e,t){return t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},x.prototype.readInt32BE=function(e,t){return t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},x.prototype.readFloatLE=function(e,t){return t||W(e,4,this.length),p(this,e,!0,23,4)},x.prototype.readFloatBE=function(e,t){return t||W(e,4,this.length),p(this,e,!1,23,4)},x.prototype.readDoubleLE=function(e,t){return t||W(e,8,this.length),p(this,e,!0,52,8)},x.prototype.readDoubleBE=function(e,t){return t||W(e,8,this.length),p(this,e,!1,52,8)},x.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Y(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},x.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,1,255,0),x.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},x.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,65535,0),x.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},x.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,65535,0),x.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},x.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,4294967295,0),x.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Q(this,e,t,!0),t+4},x.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,4294967295,0),x.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},x.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Y(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},x.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Y(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},x.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,1,127,-128),x.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},x.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,32767,-32768),x.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},x.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,32767,-32768),x.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},x.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,2147483647,-2147483648),x.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Q(this,e,t,!0),t+4},x.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),x.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},x.prototype.writeFloatLE=function(e,t,n){return q(this,e,t,!0,n)},x.prototype.writeFloatBE=function(e,t,n){return q(this,e,t,!1,n)},x.prototype.writeDoubleLE=function(e,t,n){return J(this,e,t,!0,n)},x.prototype.writeDoubleBE=function(e,t,n){return J(this,e,t,!1,n)},x.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!x.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function te(e){return function(e){var t,n,r,i,o,a;c||h();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new l(3*s/4-o),r=o>0?s-4:s;var d=0;for(t=0,n=0;t>16&255,a[d++]=i>>8&255,a[d++]=255&i;return 2===o?(i=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,a[d++]=255&i):1===o&&(i=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,a[d++]=i>>8&255,a[d++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ne(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function re(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ie={};function oe(){}function ae(){ae.init.call(this)}function se(e){return void 0===e._maxListeners?ae.defaultMaxListeners:e._maxListeners}function ue(e,t,n){if(t)e.call(n);else for(var r=e.length,i=me(e,r),o=0;o0&&a.length>i){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=n,++e._eventsCount;return e}function pe(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function ve(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function me(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function ge(){throw new Error("setTimeout has not been defined")}function ye(){throw new Error("clearTimeout has not been defined")}oe.prototype=Object.create(null),ae.EventEmitter=ae,ae.usingDomains=!1,ae.prototype.domain=void 0,ae.prototype._events=void 0,ae.prototype._maxListeners=void 0,ae.defaultMaxListeners=10,ae.init=function(){this.domain=null,ae.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new oe,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ae.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ae.prototype.getMaxListeners=function(){return se(this)},ae.prototype.emit=function(e){var t,n,r,i,o,a,s,u="error"===e;if(a=this._events)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:ue(n,c,this);break;case 2:le(n,c,this,arguments[1]);break;case 3:ce(n,c,this,arguments[1],arguments[2]);break;case 4:he(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new oe,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r0?Reflect.ownKeys(this._events):[]};var be=ge,xe=ye;function _e(e){if(be===setTimeout)return setTimeout(e,0);if((be===ge||!be)&&setTimeout)return be=setTimeout,setTimeout(e,0);try{return be(e,0)}catch(t){try{return be.call(null,e,0)}catch(t){return be.call(this,e,0)}}}"function"==typeof a.setTimeout&&(be=setTimeout),"function"==typeof a.clearTimeout&&(xe=clearTimeout);var we,Te=[],Me=!1,Se=-1;function Ee(){Me&&we&&(Me=!1,we.length?Te=we.concat(Te):Se=-1,Te.length&&Ae())}function Ae(){if(!Me){var e=_e(Ee);Me=!0;for(var t=Te.length;t;){for(we=Te,Te=[];++Se1)for(var n=1;n=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),a=r[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),et(t)?n.showHidden=t:t&&ct(n,t),rt(n.showHidden)&&(n.showHidden=!1),rt(n.depth)&&(n.depth=2),rt(n.colors)&&(n.colors=!1),rt(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Ze),Je(n,e,n.depth)}function Ze(e,t){var n=Qe.styles[t];return n?"["+Qe.colors[n][0]+"m"+e+"["+Qe.colors[n][1]+"m":e}function qe(e,t){return e}function Je(e,t,n){if(e.customInspect&&t&&ut(t.inspect)&&t.inspect!==Qe&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return nt(r)||(r=Je(e,r,n)),r}var i=function(e,t){if(rt(t))return e.stylize("undefined","undefined");if(nt(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(r=t,"number"==typeof r)return e.stylize(""+t,"number");var r;if(et(t))return e.stylize(""+t,"boolean");if(tt(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),st(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ke(t);if(0===o.length){if(ut(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(it(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(at(t))return e.stylize(Date.prototype.toString.call(t),"date");if(st(t))return Ke(t)}var u,l,c="",h=!1,d=["{","}"];(u=t,Array.isArray(u)&&(h=!0,d=["[","]"]),ut(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return it(t)&&(c=" "+RegExp.prototype.toString.call(t)),at(t)&&(c=" "+Date.prototype.toUTCString.call(t)),st(t)&&(c=" "+Ke(t)),0!==o.length||h&&0!=t.length?n<0?it(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=h?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(l,c,d)):d[0]+c+d[1]}function Ke(e){return"["+Error.prototype.toString.call(e)+"]"}function $e(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),ht(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=tt(n)?Je(e,u.value,null):Je(e,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),rt(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function et(e){return"boolean"==typeof e}function tt(e){return null===e}function nt(e){return"string"==typeof e}function rt(e){return void 0===e}function it(e){return ot(e)&&"[object RegExp]"===lt(e)}function ot(e){return"object"===i(e)&&null!==e}function at(e){return ot(e)&&"[object Date]"===lt(e)}function st(e){return ot(e)&&("[object Error]"===lt(e)||e instanceof Error)}function ut(e){return"function"==typeof e}function lt(e){return Object.prototype.toString.call(e)}function ct(e,t){if(!t||!ot(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function ht(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dt(){this.head=null,this.tail=null,this.length=0}Qe.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Qe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},dt.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},dt.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},dt.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},dt.prototype.clear=function(){this.head=this.tail=null,this.length=0},dt.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},dt.prototype.concat=function(e){if(0===this.length)return x.alloc(0);if(1===this.length)return this.head.data;for(var t=x.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};var ft=x.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function pt(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!ft(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=mt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=gt;break;default:return void(this.write=vt)}this.charBuffer=new x(6),this.charReceived=0,this.charLength=0}function vt(e){return e.toString(this.encoding)}function mt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function gt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}pt.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var i;r=(t+=e.toString(this.encoding,0,r)).length-1;if((i=t.charCodeAt(r))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,r)}return t},pt.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},pt.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t};var yt=Object.freeze({__proto__:null,StringDecoder:pt});_t.ReadableState=xt;var bt=function(e){if(rt(Ye)&&(Ye=Fe.env.NODE_DEBUG||""),e=e.toUpperCase(),!Xe[e])if(new RegExp("\\b"+e+"\\b","i").test(Ye)){Xe[e]=function(){var t=Ve.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else Xe[e]=function(){};return Xe[e]}("stream");function xt(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Zt&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new dt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new pt(e.encoding),this.encoding=e.encoding)}function _t(e){if(!(this instanceof _t))return new _t(e);this._readableState=new xt(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ae.call(this)}function wt(e,t,n,r,i){var o=function(e,t){var n=null;x.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(t,n);if(o)e.emit("error",o);else if(null===n)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,St(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||r||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&St(e))),function(e,t){t.readingMore||(t.readingMore=!0,Ie(At,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=Tt?e=Tt:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function St(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(bt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ie(Et,e):Et(e))}function Et(e){bt("emit readable"),e.emit("readable"),Nt(e)}function At(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=x.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function Dt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ie(Pt,t,e))}function Pt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Ot(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return bt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Dt(this):St(this),null;if(0===(e=Mt(e,t))&&t.ended)return 0===t.length&&Dt(this),null;var r,i=t.needReadable;return bt("need readable",i),(0===t.length||t.length-e0?kt(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&Dt(this)),null!==r&&this.emit("data",r),r},_t.prototype._read=function(e){this.emit("error",new Error("not implemented"))},_t.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,bt("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){bt("onunpipe"),e===n&&l()}function a(){bt("onend"),e.end()}r.endEmitted?Ie(i):n.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;bt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,Nt(e))}}(n);e.on("drain",s);var u=!1;function l(){bt("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",d),e.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",l),n.removeListener("data",h),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var c=!1;function h(t){bt("ondata"),c=!1,!1!==e.write(t)||c||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==Ot(r.pipes,e))&&!u&&(bt("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,c=!0),n.pause())}function d(t){var n;bt("onerror",t),v(),e.removeListener("error",d),0===(n="error",e.listeners(n).length)&&e.emit("error",t)}function f(){e.removeListener("finish",p),v()}function p(){bt("onfinish"),e.removeListener("close",f),v()}function v(){bt("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",n),r.flowing||(bt("pipe resume"),n.resume()),e},_t.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Bt.prototype._write=function(e,t,n){n(new Error("not implemented"))},Bt.prototype._writev=null,Bt.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,Vt(e,t),n&&(t.finished?Ie(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Ge(Zt,_t);for(var Yt=Object.keys(Bt.prototype),Xt=0;Xt"===a?(E(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=T.TEXT):v(a)?(r.state=T.SGML_DECL_QUOTED,r.sgmlDecl+=a):r.sgmlDecl+=a;continue;case T.SGML_DECL_QUOTED:a===r.q&&(r.state=T.SGML_DECL,r.q=""),r.sgmlDecl+=a;continue;case T.DOCTYPE:">"===a?(r.state=T.TEXT,E(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=a,"["===a?r.state=T.DOCTYPE_DTD:v(a)&&(r.state=T.DOCTYPE_QUOTED,r.q=a));continue;case T.DOCTYPE_QUOTED:r.doctype+=a,a===r.q&&(r.q="",r.state=T.DOCTYPE);continue;case T.DOCTYPE_DTD:r.doctype+=a,"]"===a?r.state=T.DOCTYPE:v(a)&&(r.state=T.DOCTYPE_DTD_QUOTED,r.q=a);continue;case T.DOCTYPE_DTD_QUOTED:r.doctype+=a,a===r.q&&(r.state=T.DOCTYPE_DTD,r.q="");continue;case T.COMMENT:"-"===a?r.state=T.COMMENT_ENDING:r.comment+=a;continue;case T.COMMENT_ENDING:"-"===a?(r.state=T.COMMENT_ENDED,r.comment=I(r.opt,r.comment),r.comment&&E(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+a,r.state=T.COMMENT);continue;case T.COMMENT_ENDED:">"!==a?(k(r,"Malformed comment"),r.comment+="--"+a,r.state=T.COMMENT):r.state=T.TEXT;continue;case T.CDATA:"]"===a?r.state=T.CDATA_ENDING:r.cdata+=a;continue;case T.CDATA_ENDING:"]"===a?r.state=T.CDATA_ENDING_2:(r.cdata+="]"+a,r.state=T.CDATA);continue;case T.CDATA_ENDING_2:">"===a?(r.cdata&&E(r,"oncdata",r.cdata),E(r,"onclosecdata"),r.cdata="",r.state=T.TEXT):"]"===a?r.cdata+="]":(r.cdata+="]]"+a,r.state=T.CDATA);continue;case T.PROC_INST:"?"===a?r.state=T.PROC_INST_ENDING:p(a)?r.state=T.PROC_INST_BODY:r.procInstName+=a;continue;case T.PROC_INST_BODY:if(!r.procInstBody&&p(a))continue;"?"===a?r.state=T.PROC_INST_ENDING:r.procInstBody+=a;continue;case T.PROC_INST_ENDING:">"===a?(E(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=T.TEXT):(r.procInstBody+="?"+a,r.state=T.PROC_INST_BODY);continue;case T.OPEN_TAG:g(h,a)?r.tagName+=a:(D(r),">"===a?R(r):"/"===a?r.state=T.OPEN_TAG_SLASH:(p(a)||k(r,"Invalid character in tag name"),r.state=T.ATTRIB));continue;case T.OPEN_TAG_SLASH:">"===a?(R(r,!0),L(r)):(k(r,"Forward-slash in opening tag not followed by >"),r.state=T.ATTRIB);continue;case T.ATTRIB:if(p(a))continue;">"===a?R(r):"/"===a?r.state=T.OPEN_TAG_SLASH:g(c,a)?(r.attribName=a,r.attribValue="",r.state=T.ATTRIB_NAME):k(r,"Invalid attribute name");continue;case T.ATTRIB_NAME:"="===a?r.state=T.ATTRIB_VALUE:">"===a?(k(r,"Attribute without value"),r.attribValue=r.attribName,O(r),R(r)):p(a)?r.state=T.ATTRIB_NAME_SAW_WHITE:g(h,a)?r.attribName+=a:k(r,"Invalid attribute name");continue;case T.ATTRIB_NAME_SAW_WHITE:if("="===a)r.state=T.ATTRIB_VALUE;else{if(p(a))continue;k(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",E(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===a?R(r):g(c,a)?(r.attribName=a,r.state=T.ATTRIB_NAME):(k(r,"Invalid attribute name"),r.state=T.ATTRIB)}continue;case T.ATTRIB_VALUE:if(p(a))continue;v(a)?(r.q=a,r.state=T.ATTRIB_VALUE_QUOTED):(k(r,"Unquoted attribute value"),r.state=T.ATTRIB_VALUE_UNQUOTED,r.attribValue=a);continue;case T.ATTRIB_VALUE_QUOTED:if(a!==r.q){"&"===a?r.state=T.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=a;continue}O(r),r.q="",r.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:p(a)?r.state=T.ATTRIB:">"===a?R(r):"/"===a?r.state=T.OPEN_TAG_SLASH:g(c,a)?(k(r,"No whitespace between attributes"),r.attribName=a,r.attribValue="",r.state=T.ATTRIB_NAME):k(r,"Invalid attribute name");continue;case T.ATTRIB_VALUE_UNQUOTED:if(!m(a)){"&"===a?r.state=T.ATTRIB_VALUE_ENTITY_U:r.attribValue+=a;continue}O(r),">"===a?R(r):r.state=T.ATTRIB;continue;case T.CLOSE_TAG:if(r.tagName)">"===a?L(r):g(h,a)?r.tagName+=a:r.script?(r.script+=""===a?L(r):k(r,"Invalid characters in closing tag");continue;case T.TEXT_ENTITY:case T.ATTRIB_VALUE_ENTITY_Q:case T.ATTRIB_VALUE_ENTITY_U:var l,b;switch(r.state){case T.TEXT_ENTITY:l=T.TEXT,b="textNode";break;case T.ATTRIB_VALUE_ENTITY_Q:l=T.ATTRIB_VALUE_QUOTED,b="attribValue";break;case T.ATTRIB_VALUE_ENTITY_U:l=T.ATTRIB_VALUE_UNQUOTED,b="attribValue"}";"===a?(r[b]+=j(r),r.entity="",r.state=l):g(r.entity.length?f:d,a)?r.entity+=a:(k(r,"Invalid character in entity name"),r[b]+="&"+r.entity+a,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}r.position>=r.bufferCheckPosition&&function(t){for(var r=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,o=0,a=n.length;or)switch(n[o]){case"textNode":A(t);break;case"cdata":E(t,"oncdata",t.cdata),t.cdata="";break;case"script":E(t,"onscript",t.script),t.script="";break;default:C(t,"Max buffer length exceeded: "+n[o])}i=Math.max(i,s)}var u=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=u+t.position}(r);return r} +/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;A(e=this),""!==e.cdata&&(E(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(E(e,"onscript",e.script),e.script="")}};try{t=rn.Stream}catch(e){t=function(){}}var o=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function a(e,n){if(!(this instanceof a))return new a(e,n);t.apply(this),this._parser=new r(e,n),this.writable=!0,this.readable=!0;var i=this;this._parser.onend=function(){i.emit("end")},this._parser.onerror=function(e){i.emit("error",e),i._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(i,"on"+e,{get:function(){return i._parser["on"+e]},set:function(t){if(!t)return i.removeAllListeners(e),i._parser["on"+e]=t,t;i.on(e,t)},enumerable:!0,configurable:!1})}))}a.prototype=Object.create(t.prototype,{constructor:{value:a}}),a.prototype.write=function(e){if("function"==typeof x.isBuffer&&x.isBuffer(e)){if(!this._decoder){var t=on.StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},a.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},a.prototype.on=function(e,n){var r=this;return r._parser["on"+e]||-1===o.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var s="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",l={xml:s,xmlns:u},c=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function p(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function v(e){return'"'===e||"'"===e}function m(e){return">"===e||p(e)}function g(e,t){return e.test(t)}function y(e,t){return!g(e,t)}var b,_,w,T=0;for(var M in e.STATE={BEGIN:T++,BEGIN_WHITESPACE:T++,TEXT:T++,TEXT_ENTITY:T++,OPEN_WAKA:T++,SGML_DECL:T++,SGML_DECL_QUOTED:T++,DOCTYPE:T++,DOCTYPE_QUOTED:T++,DOCTYPE_DTD:T++,DOCTYPE_DTD_QUOTED:T++,COMMENT_STARTING:T++,COMMENT:T++,COMMENT_ENDING:T++,COMMENT_ENDED:T++,CDATA:T++,CDATA_ENDING:T++,CDATA_ENDING_2:T++,PROC_INST:T++,PROC_INST_BODY:T++,PROC_INST_ENDING:T++,OPEN_TAG:T++,OPEN_TAG_SLASH:T++,ATTRIB:T++,ATTRIB_NAME:T++,ATTRIB_NAME_SAW_WHITE:T++,ATTRIB_VALUE:T++,ATTRIB_VALUE_QUOTED:T++,ATTRIB_VALUE_CLOSED:T++,ATTRIB_VALUE_UNQUOTED:T++,ATTRIB_VALUE_ENTITY_Q:T++,ATTRIB_VALUE_ENTITY_U:T++,CLOSE_TAG:T++,CLOSE_TAG_SAW_WHITE:T++,SCRIPT:T++,SCRIPT_ENDING:T++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var n=e.ENTITIES[t],r="number"==typeof n?String.fromCharCode(n):n;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[M]]=M;function S(e,t,n){e[t]&&e[t](n)}function E(e,t,n){e.textNode&&A(e),S(e,t,n)}function A(e){e.textNode=I(e.opt,e.textNode),e.textNode&&S(e,"ontext",e.textNode),e.textNode=""}function I(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function C(e,t){return A(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,S(e,"onerror",t),e}function N(e){return e.sawRoot&&!e.closedRoot&&k(e,"Unclosed root tag"),e.state!==T.BEGIN&&e.state!==T.BEGIN_WHITESPACE&&e.state!==T.TEXT&&C(e,"Unexpected end"),A(e),e.c="",e.closed=!0,S(e,"onend"),r.call(e,e.strict,e.opt),e}function k(e,t){if("object"!==i(e)||!(e instanceof r))throw new Error("bad call to strictFail");e.strict&&C(e,t)}function D(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,E(e,"onopentagstart",n)}function P(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function O(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=P(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==s)k(e,"xml: prefix must be bound to "+s+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==u)k(e,"xmlns: prefix must be bound to "+u+"\nActual: "+e.attribValue);else{var i=e.tag,o=e.tags[e.tags.length-1]||e;i.ns===o.ns&&(i.ns=Object.create(o.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,E(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function R(e,t){if(e.opt.xmlns){var n=e.tag,r=P(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(k(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){E(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var o=0,a=e.attribList.length;o",e.tagName="",void(e.state=T.SCRIPT);E(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){if(e.tags[t].name===r)break;k(e,"Unexpected close tag")}if(t<0)return k(e,"Unmatched closing tag: "+e.tagName),e.textNode+="",void(e.state=T.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,E(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==u.ns&&Object.keys(o.ns).forEach((function(t){var n=o.ns[t];E(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=T.TEXT}function j(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==n?(k(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function B(e,t){"<"===t?(e.state=T.OPEN_WAKA,e.startTagPosition=e.position):p(t)||(k(e,"Non-whitespace before first tag."),e.textNode=t,e.state=T.TEXT)}function U(e,t){var n="";return t1114111||_(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(i+1===o||r.length>n)&&(a+=b.apply(null,r),r.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(e)}(ie);var an,sn,un=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},ln=un,cn={copyOptions:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},ensureFlagExists:function(e,t){e in t&&"boolean"==typeof t[e]||(t[e]=!1)},ensureSpacesExists:function(e){(!("spaces"in e)||"number"!=typeof e.spaces&&"string"!=typeof e.spaces)&&(e.spaces=0)},ensureAlwaysArrayExists:function(e){"alwaysArray"in e&&("boolean"==typeof e.alwaysArray||ln(e.alwaysArray))||(e.alwaysArray=!1)},ensureKeyExists:function(e,t){e+"Key"in t&&"string"==typeof t[e+"Key"]||(t[e+"Key"]=t.compact?"_"+e:e)},checkFnExists:function(e,t){return e+"Fn"in t}},hn=ie,dn=cn,fn=un;function pn(e){var t=Number(e);if(!isNaN(t))return t;var n=e.toLowerCase();return"true"===n||"false"!==n&&e}function vn(e,t){var n;if(an.compact){if(!sn[an[e+"Key"]]&&(fn(an.alwaysArray)?-1!==an.alwaysArray.indexOf(an[e+"Key"]):an.alwaysArray)&&(sn[an[e+"Key"]]=[]),sn[an[e+"Key"]]&&!fn(sn[an[e+"Key"]])&&(sn[an[e+"Key"]]=[sn[an[e+"Key"]]]),e+"Fn"in an&&"string"==typeof t&&(t=an[e+"Fn"](t,sn)),"instruction"===e&&("instructionFn"in an||"instructionNameFn"in an))for(n in t)if(t.hasOwnProperty(n))if("instructionFn"in an)t[n]=an.instructionFn(t[n],n,sn);else{var r=t[n];delete t[n],t[an.instructionNameFn(n,r,sn)]=r}fn(sn[an[e+"Key"]])?sn[an[e+"Key"]].push(t):sn[an[e+"Key"]]=t}else{sn[an.elementsKey]||(sn[an.elementsKey]=[]);var i={};if(i[an.typeKey]=e,"instruction"===e){for(n in t)if(t.hasOwnProperty(n))break;i[an.nameKey]="instructionNameFn"in an?an.instructionNameFn(n,t,sn):n,an.instructionHasAttributes?(i[an.attributesKey]=t[n][an.attributesKey],"instructionFn"in an&&(i[an.attributesKey]=an.instructionFn(i[an.attributesKey],n,sn))):("instructionFn"in an&&(t[n]=an.instructionFn(t[n],n,sn)),i[an.instructionKey]=t[n])}else e+"Fn"in an&&(t=an[e+"Fn"](t,sn)),i[an[e+"Key"]]=t;an.addParent&&(i[an.parentKey]=sn),sn[an.elementsKey].push(i)}}function mn(e){var t;if("attributesFn"in an&&e&&(e=an.attributesFn(e,sn)),(an.trim||"attributeValueFn"in an||"attributeNameFn"in an||an.nativeTypeAttributes)&&e)for(t in e)if(e.hasOwnProperty(t)&&(an.trim&&(e[t]=e[t].trim()),an.nativeTypeAttributes&&(e[t]=pn(e[t])),"attributeValueFn"in an&&(e[t]=an.attributeValueFn(e[t],t,sn)),"attributeNameFn"in an)){var n=e[t];delete e[t],e[an.attributeNameFn(t,e[t],sn)]=n}return e}function gn(e){var t={};if(e.body&&("xml"===e.name.toLowerCase()||an.instructionHasAttributes)){for(var n,r=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(n=r.exec(e.body));)t[n[1]]=n[2]||n[3]||n[4];t=mn(t)}if("xml"===e.name.toLowerCase()){if(an.ignoreDeclaration)return;sn[an.declarationKey]={},Object.keys(t).length&&(sn[an.declarationKey][an.attributesKey]=t),an.addParent&&(sn[an.declarationKey][an.parentKey]=sn)}else{if(an.ignoreInstruction)return;an.trim&&(e.body=e.body.trim());var i={};an.instructionHasAttributes&&Object.keys(t).length?(i[e.name]={},i[e.name][an.attributesKey]=t):i[e.name]=e.body,vn("instruction",i)}}function yn(e,t){var n;if("object"===i(e)&&(t=e.attributes,e=e.name),t=mn(t),"elementNameFn"in an&&(e=an.elementNameFn(e,sn)),an.compact){var r;if(n={},!an.ignoreAttributes&&t&&Object.keys(t).length)for(r in n[an.attributesKey]={},t)t.hasOwnProperty(r)&&(n[an.attributesKey][r]=t[r]);!(e in sn)&&(fn(an.alwaysArray)?-1!==an.alwaysArray.indexOf(e):an.alwaysArray)&&(sn[e]=[]),sn[e]&&!fn(sn[e])&&(sn[e]=[sn[e]]),fn(sn[e])?sn[e].push(n):sn[e]=n}else sn[an.elementsKey]||(sn[an.elementsKey]=[]),(n={})[an.typeKey]="element",n[an.nameKey]=e,!an.ignoreAttributes&&t&&Object.keys(t).length&&(n[an.attributesKey]=t),an.alwaysChildren&&(n[an.elementsKey]=[]),sn[an.elementsKey].push(n);n[an.parentKey]=sn,sn=n}function bn(e){an.ignoreText||(e.trim()||an.captureSpacesBetweenElements)&&(an.trim&&(e=e.trim()),an.nativeType&&(e=pn(e)),an.sanitize&&(e=e.replace(/&/g,"&").replace(//g,">")),vn("text",e))}function xn(e){an.ignoreComment||(an.trim&&(e=e.trim()),vn("comment",e))}function _n(e){var t=sn[an.parentKey];an.addParent||delete sn[an.parentKey],sn=t}function wn(e){an.ignoreCdata||(an.trim&&(e=e.trim()),vn("cdata",e))}function Tn(e){an.ignoreDoctype||(e=e.replace(/^ /,""),an.trim&&(e=e.trim()),vn("doctype",e))}function Mn(e){e.note=e,"onErrorFn"in an&&an.onErrorFn(e)}var Sn=function(e,t){var n=hn.parser(!0,{}),r={};sn=r,an=function(e){return an=dn.copyOptions(e),dn.ensureFlagExists("ignoreDeclaration",an),dn.ensureFlagExists("ignoreInstruction",an),dn.ensureFlagExists("ignoreAttributes",an),dn.ensureFlagExists("ignoreText",an),dn.ensureFlagExists("ignoreComment",an),dn.ensureFlagExists("ignoreCdata",an),dn.ensureFlagExists("ignoreDoctype",an),dn.ensureFlagExists("compact",an),dn.ensureFlagExists("alwaysChildren",an),dn.ensureFlagExists("addParent",an),dn.ensureFlagExists("trim",an),dn.ensureFlagExists("nativeType",an),dn.ensureFlagExists("nativeTypeAttributes",an),dn.ensureFlagExists("sanitize",an),dn.ensureFlagExists("instructionHasAttributes",an),dn.ensureFlagExists("captureSpacesBetweenElements",an),dn.ensureAlwaysArrayExists(an),dn.ensureKeyExists("declaration",an),dn.ensureKeyExists("instruction",an),dn.ensureKeyExists("attributes",an),dn.ensureKeyExists("text",an),dn.ensureKeyExists("comment",an),dn.ensureKeyExists("cdata",an),dn.ensureKeyExists("doctype",an),dn.ensureKeyExists("type",an),dn.ensureKeyExists("name",an),dn.ensureKeyExists("elements",an),dn.ensureKeyExists("parent",an),an}(t),n.opt={strictEntities:!0},n.onopentag=yn,n.ontext=bn,n.oncomment=xn,n.onclosetag=_n,n.onerror=Mn,n.oncdata=wn,n.ondoctype=Tn,n.onprocessinginstruction=gn;try{n.write(e).close()}catch(e){}if(r[an.elementsKey]){var i=r[an.elementsKey];delete r[an.elementsKey],r[an.elementsKey]=i,delete r.text}return r};t.xml2js=Sn;var En=cn,An=Sn;t.xml2json=function(e,t){var n,r,i,o;return n=function(e){var t=En.copyOptions(e);return En.ensureSpacesExists(t),t}(t),r=An(e,n),o="compact"in n&&n.compact?"_parent":"parent",i="addParent"in n&&n.addParent?JSON.stringify(r,(function(e,t){return e===o?"_":t}),n.spaces):JSON.stringify(r,null,n.spaces),i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};var In,Cn,Nn=cn,kn=un;function Dn(e,t,n){return(!n&&e.spaces?"\n":"")+Array(t+1).join(e.spaces)}function Pn(e,t,n){if(t.ignoreAttributes)return"";"attributesFn"in t&&(e=t.attributesFn(e,Cn,In));var r,i,o,a,s=[];for(r in e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(a=t.noQuotesForNativeAttributes&&"string"!=typeof e[r]?"":'"',i=(i=""+e[r]).replace(/&/g,"&").replace(/"}function Rn(e,t,n){if(t.ignoreInstruction)return"";var r;for(r in e)if(e.hasOwnProperty(r))break;var o="instructionNameFn"in t?t.instructionNameFn(r,e[r],Cn,In):r;if("object"===i(e[r]))return In=e,Cn=o,"";var a=e[r]?e[r]:"";return"instructionFn"in t&&(a=t.instructionFn(a,r,Cn,In)),""}function Ln(e,t){return t.ignoreComment?"":"\x3c!--"+("commentFn"in t?t.commentFn(e,Cn,In):e)+"--\x3e"}function jn(e,t){return t.ignoreCdata?"":"","]]]]>"))+"]]>"}function Bn(e,t){return t.ignoreDoctype?"":""}function Un(e,t){return t.ignoreText?"":(e=(e=(e=""+e).replace(/&/g,"&")).replace(/&/g,"&").replace(//g,">"),"textFn"in t?t.textFn(e,Cn,In):e)}function zn(e,t,n,r){return e.reduce((function(e,i){var o=Dn(t,n,r&&!e);switch(i.type){case"element":return e+o+function(e,t,n){In=e,Cn=e.name;var r=[],i="elementNameFn"in t?t.elementNameFn(e.name,e):e.name;r.push("<"+i),e[t.attributesKey]&&r.push(Pn(e[t.attributesKey],t,n));var o=e[t.elementsKey]&&e[t.elementsKey].length||e[t.attributesKey]&&"preserve"===e[t.attributesKey]["xml:space"];return o||(o="fullTagEmptyElementFn"in t?t.fullTagEmptyElementFn(e.name,e):t.fullTagEmptyElement),o?(r.push(">"),e[t.elementsKey]&&e[t.elementsKey].length&&(r.push(zn(e[t.elementsKey],t,n+1)),In=e,Cn=e.name),r.push(t.spaces&&function(e,t){var n;if(e.elements&&e.elements.length)for(n=0;n")):r.push("/>"),r.join("")}(i,t,n);case"comment":return e+o+Ln(i[t.commentKey],t);case"doctype":return e+o+Bn(i[t.doctypeKey],t);case"cdata":return e+(t.indentCdata?o:"")+jn(i[t.cdataKey],t);case"text":return e+(t.indentText?o:"")+Un(i[t.textKey],t);case"instruction":var a={};return a[i[t.nameKey]]=i[t.attributesKey]?i:i[t.instructionKey],e+(t.indentInstruction?o:"")+Rn(a,t,n)}}),"")}function Fn(e,t,n){var r;for(r in e)if(e.hasOwnProperty(r))switch(r){case t.parentKey:case t.attributesKey:break;case t.textKey:if(t.indentText||n)return!0;break;case t.cdataKey:if(t.indentCdata||n)return!0;break;case t.instructionKey:if(t.indentInstruction||n)return!0;break;case t.doctypeKey:case t.commentKey:default:return!0}return!1}function Gn(e,t,n,r,o){In=e,Cn=t;var a="elementNameFn"in n?n.elementNameFn(t,e):t;if(null==e||""===e)return"fullTagEmptyElementFn"in n&&n.fullTagEmptyElementFn(t,e)||n.fullTagEmptyElement?"<"+a+">":"<"+a+"/>";var s=[];if(t){if(s.push("<"+a),"object"!==i(e))return s.push(">"+Un(e,n)+""),s.join("");e[n.attributesKey]&&s.push(Pn(e[n.attributesKey],n,r));var u=Fn(e,n,!0)||e[n.attributesKey]&&"preserve"===e[n.attributesKey]["xml:space"];if(u||(u="fullTagEmptyElementFn"in n?n.fullTagEmptyElementFn(t,e):n.fullTagEmptyElement),!u)return s.push("/>"),s.join("");s.push(">")}return s.push(Hn(e,n,r+1,!1)),In=e,Cn=t,t&&s.push((o?Dn(n,r,!1):"")+""),s.join("")}function Hn(e,t,n,r){var i,o,a,s=[];for(o in e)if(e.hasOwnProperty(o))for(a=kn(e[o])?e[o]:[e[o]],i=0;i