diff --git a/README.md b/README.md index 8d7d7eae..750dcdcb 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ add dependency of whiteboard in the **app/build.gradle** file ```groovy dependencies { // Get the latest version number through the release notes. - implementation "com.github.netless-io:whiteboard-android:2.16.67" + implementation "com.github.netless-io:whiteboard-android:2.16.68" } ``` diff --git a/README_zh_CN.md b/README_zh_CN.md index 5da8048a..980964d9 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -45,7 +45,7 @@ allprojects { ```groovy dependencies { // 数字请根据最新版自行添加 - implementation "com.github.netless-io:whiteboard-android:2.16.67" + implementation "com.github.netless-io:whiteboard-android:2.16.68" } ``` diff --git a/carrot.yml b/carrot.yml index 5b26aeb7..0f956508 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: ed92cbc + commit: aae95af diff --git a/sdk/CHANGELOG.md b/sdk/CHANGELOG.md index 0e88b79f..3cb6902e 100644 --- a/sdk/CHANGELOG.md +++ b/sdk/CHANGELOG.md @@ -1,4 +1,8 @@ # 版本更新记录 +## [2.16.68] - 2023-09-18 +- 更新 `@netless/app-slide` 至 0.2.43。 +- 更新 `SlideAppOptions.maxResolutionLevel`, 取值范围变更为 0-4。 +- 新增 `MemberState.pencilEraserSize`, 用于更改局部橡皮擦尺寸,取之范围 1-3。 ## [2.16.67] - 2023-09-15 - 新增 `SlideAppOptions.bgColor`, `SlideAppOptions.forceCanvas`, 用于控制 PPT 渲染。 ## [2.16.66] - 2023-09-14 diff --git a/sdk/src/main/assets/whiteboard/ed92cbc b/sdk/src/main/assets/whiteboard/aae95af similarity index 100% rename from sdk/src/main/assets/whiteboard/ed92cbc rename to sdk/src/main/assets/whiteboard/aae95af diff --git a/sdk/src/main/assets/whiteboard/index.html b/sdk/src/main/assets/whiteboard/index.html index 41eb7053..5194ba04 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.ac26a975.js b/sdk/src/main/assets/whiteboard/netless.e4505a5c.js similarity index 51% rename from sdk/src/main/assets/whiteboard/netless.ac26a975.js rename to sdk/src/main/assets/whiteboard/netless.e4505a5c.js index c506bd06..09a7b8f5 100644 --- a/sdk/src/main/assets/whiteboard/netless.ac26a975.js +++ b/sdk/src/main/assets/whiteboard/netless.e4505a5c.js @@ -1,4 +1,4 @@ -"use strict";(self.webpackChunkwhiteboard_bridge=self.webpackChunkwhiteboard_bridge||[]).push([[83],{19418:function(e,t,n){n.r(t)},24496:function(e,t,n){function r(e){var t="function"==typeof Map?new Map:void 0;return r=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;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,r)}function r(){return i(e,arguments,x(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),v(r,e)},r(e)}function i(e,t,n){return i=b()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},i.apply(null,arguments)}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return function(e){if(Array.isArray(e))return A(e)}(e)||s(e)||S(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){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(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){return d(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)||S(e,t)||h()}function h(){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 d(e){if(Array.isArray(e))return e}function f(e,t,n){return f="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=x(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}},f(e,t,n||e)}function p(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&&v(e,t)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function m(e){var t=b();return function(){var n,r=x(e);if(t){var i=x(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function g(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){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 x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},x(e)}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(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 S(e,t){if(e){if("string"==typeof e)return A(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)?A(e,t):void 0}}function A(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[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 E(e,t){if(e){if("string"==typeof e)return A(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)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=this.x&&e=this.y&&te.right?e.right:this.right)<=n)return!1;var r=this.ye.bottom?e.bottom:this.bottom)>r}var i=this.left,o=this.right,a=this.top,s=this.bottom;if(o<=i||s<=a)return!1;var u=l[0].set(e.left,e.top),c=l[1].set(e.left,e.bottom),h=l[2].set(e.right,e.top),d=l[3].set(e.right,e.bottom);if(h.x<=u.x||c.y<=u.y)return!1;var f=Math.sign(t.a*t.d-t.b*t.c);if(0===f)return!1;if(t.apply(u,u),t.apply(c,c),t.apply(h,h),t.apply(d,d),Math.max(u.x,c.x,h.x,d.x)<=i||Math.min(u.x,c.x,h.x,d.x)>=o||Math.max(u.y,c.y,h.y,d.y)<=a||Math.min(u.y,c.y,h.y,d.y)>=s)return!1;var p=f*(c.y-u.y),v=f*(u.x-c.x),m=p*i+v*a,g=p*o+v*a,y=p*i+v*s,b=p*o+v*s;if(Math.max(m,g,y,b)<=p*u.x+v*u.y||Math.min(m,g,y,b)>=p*d.x+v*d.y)return!1;var x=f*(u.y-h.y),_=f*(h.x-u.x),w=x*i+_*a,T=x*o+_*a,M=x*i+_*s,E=x*o+_*s;return!(Math.max(w,T,M,E)<=x*u.x+_*u.y||Math.min(w,T,M,E)>=x*d.x+_*d.y)},e.prototype.pad=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.x-=e,this.y-=t,this.width+=2*e,this.height+=2*t,this},e.prototype.fit=function(e){var t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this},e.prototype.ceil=function(e,t){void 0===e&&(e=1),void 0===t&&(t=.001);var n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this},e.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this},e.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},e}(),h=function(){function e(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),this.x=e,this.y=t,this.radius=n,this.type=r.CIRC}return e.prototype.clone=function(){return new e(this.x,this.y,this.radius)},e.prototype.contains=function(e,t){if(this.radius<=0)return!1;var n=this.radius*this.radius,r=this.x-e,i=this.y-t;return(r*=r)+(i*=i)<=n},e.prototype.getBounds=function(){return new c(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},e.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},e}(),d=function(){function e(e,t,n,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),this.x=e,this.y=t,this.width=n,this.height=i,this.type=r.ELIP}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var n=(e-this.x)/this.width,r=(t-this.y)/this.height;return(n*=n)+(r*=r)<=1},e.prototype.getBounds=function(){return new c(this.x-this.width,this.y-this.height,this.width,this.height)},e.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},e}(),f=function(){function e(){for(var e=arguments,t=[],n=0;nt!=l>t&&e<(t-s)/(l-s)*(u-a)+a&&(n=!n)}return n},e.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(e,t){return e+", "+t}),"")+"]"},e}(),p=function(){function e(e,t,n,i,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),void 0===o&&(o=20),this.x=e,this.y=t,this.width=n,this.height=i,this.radius=o,this.type=r.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;var r=e-(this.x+n),i=t-(this.y+n),o=n*n;if(r*r+i*i<=o)return!0;if((r=e-(this.x+this.width-n))*r+i*i<=o)return!0;if(r*r+(i=t-(this.y+this.height-n))*i<=o)return!0;if((r=e-(this.x+n))*r+i*i<=o)return!0}return!1},e.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},e}(),v=function(){function e(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0),this._x=n,this._y=r,this.cb=e,this.scope=t}return e.prototype.clone=function(t,n){return void 0===t&&(t=this.cb),void 0===n&&(n=this.scope),new e(t,n,this._x,this._y)},e.prototype.set=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this._x===e&&this._y===t||(this._x=e,this._y=t,this.cb.call(this.scope)),this},e.prototype.copyFrom=function(e){return this._x===e.x&&this._y===e.y||(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},e.prototype.copyTo=function(e){return e.set(this._x,this._y),e},e.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},e.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),e}(),m=function(){function e(e,t,n,r,i,o){void 0===e&&(e=1),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===i&&(i=0),void 0===o&&(o=0),this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=o}return e.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},e.prototype.set=function(e,t,n,r,i,o){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=o,this},e.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},e.prototype.apply=function(e,t){t=t||new u;var n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t},e.prototype.applyInverse=function(e,t){t=t||new u;var n=1/(this.a*this.d+this.c*-this.b),r=e.x,i=e.y;return t.x=this.d*n*r+-this.c*n*i+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*i+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,t},e.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},e.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},e.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,o=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=o*t-this.ty*n,this.ty=o*n+this.ty*t,this},e.prototype.append=function(e){var t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this},e.prototype.setTransform=function(e,t,n,r,i,o,a,s,u){return this.a=Math.cos(a+u)*i,this.b=Math.sin(a+u)*i,this.c=-Math.sin(a-s)*o,this.d=Math.cos(a-s)*o,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this},e.prototype.prepend=function(e){var t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){var n=this.a,r=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},e.prototype.decompose=function(e){var t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,s=-Math.atan2(-r,i),u=Math.atan2(n,t),l=Math.abs(s+u);return l<1e-5||Math.abs(o-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=s,e.skew.y=u),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e},e.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,o=e*r-t*n;return this.a=r/o,this.b=-t/o,this.c=-n/o,this.d=e/o,this.tx=(n*this.ty-r*i)/o,this.ty=-(e*this.ty-t*i)/o,this},e.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},e.prototype.clone=function(){var t=new e;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},e.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},e.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},e.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(e,"IDENTITY",{get:function(){return new e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"TEMP_MATRIX",{get:function(){return new e},enumerable:!1,configurable:!0}),e}(),g=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],y=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],b=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],x=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],_=[],w=[],T=Math.sign;!function(){for(var e=0;e<16;e++){var t=[];_.push(t);for(var n=0;n<16;n++)for(var r=T(g[e]*g[n]+b[e]*y[n]),i=T(y[e]*g[n]+x[e]*y[n]),o=T(g[e]*b[n]+b[e]*x[n]),a=T(y[e]*b[n]+x[e]*x[n]),s=0;s<16;s++)if(g[s]===r&&y[s]===i&&b[s]===o&&x[s]===a){t.push(s);break}}for(e=0;e<16;e++){var u=new m;u.set(g[e],y[e],b[e],x[e],0,0),w.push(u)}}();var M={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(e){return g[e]},uY:function(e){return y[e]},vX:function(e){return b[e]},vY:function(e){return x[e]},inv:function(e){return 8&e?15&e:7&-e},add:function(e,t){return _[e][t]},sub:function(e,t){return _[e][M.inv(t)]},rotate180:function(e){return 4^e},isVertical:function(e){return 2==(3&e)},byDirection:function(e,t){return 2*Math.abs(e)<=Math.abs(t)?t>=0?M.S:M.N:2*Math.abs(t)<=Math.abs(e)?e>0?M.E:M.W:t>0?e>0?M.SE:M.SW:e>0?M.NE:M.NW},matrixAppendRotationInv:function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=w[M.inv(t)];i.tx=n,i.ty=r,e.append(i)}},E=function(){function e(){this.worldTransform=new m,this.localTransform=new m,this.position=new v(this.onChange,this,0,0),this.scale=new v(this.onChange,this,1,1),this.pivot=new v(this.onChange,this,0,0),this.skew=new v(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return e.prototype.onChange=function(){this._localID++},e.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},e.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},e.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},e.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var n=e.worldTransform,r=this.worldTransform;r.a=t.a*n.a+t.b*n.c,r.b=t.a*n.b+t.b*n.d,r.c=t.c*n.a+t.d*n.c,r.d=t.c*n.b+t.d*n.d,r.tx=t.tx*n.a+t.ty*n.c+n.tx,r.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}},e.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(e.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),e.IDENTITY=new e,e}()},function(e,t,n){n.d(t,"a",(function(){return rt})),n.d(t,"b",(function(){return C})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return ct})),n.d(t,"e",(function(){return vt})),n.d(t,"f",(function(){return yt})),n.d(t,"g",(function(){return ht})),n.d(t,"h",(function(){return B})),n.d(t,"i",(function(){return v})),n.d(t,"j",(function(){return _})),n.d(t,"k",(function(){return De})),n.d(t,"l",(function(){return H})),n.d(t,"m",(function(){return K})),n.d(t,"n",(function(){return Ce})),n.d(t,"o",(function(){return W})),n.d(t,"p",(function(){return O})),n.d(t,"q",(function(){return at})),n.d(t,"r",(function(){return Ne})),n.d(t,"s",(function(){return ke})),n.d(t,"t",(function(){return P})),n.d(t,"u",(function(){return Oe})),n.d(t,"v",(function(){return X})),n.d(t,"w",(function(){return E})),n.d(t,"x",(function(){return dt})),n.d(t,"y",(function(){return st})),n.d(t,"z",(function(){return lt})),n.d(t,"A",(function(){return ut}));var r=n(4),i=n(0),o=n(3),a=n(12),s=n(7),u=n(1); +var r,i,o=2*Math.PI,a=180/Math.PI,s=Math.PI/180;(i=r||(r={}))[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC";var u=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.x=0,this.y=0,this.x=e,this.y=t}return e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.copyFrom=function(e){return this.set(e.x,e.y),this},e.prototype.copyTo=function(e){return e.set(this.x,this.y),e},e.prototype.equals=function(e){return e.x===this.x&&e.y===this.y},e.prototype.set=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.x=e,this.y=t,this},e.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},e}(),l=[new u,new u,new u,new u],c=function(){function e(e,t,n,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),this.x=Number(e),this.y=Number(t),this.width=Number(n),this.height=Number(i),this.type=r.RECT}return Object.defineProperty(e.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(e,"EMPTY",{get:function(){return new e(0,0,0,0)},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this},e.prototype.copyTo=function(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},e.prototype.contains=function(e,t){return!(this.width<=0||this.height<=0)&&e>=this.x&&e=this.y&&te.right?e.right:this.right)<=n)return!1;var r=this.ye.bottom?e.bottom:this.bottom)>r}var i=this.left,o=this.right,a=this.top,s=this.bottom;if(o<=i||s<=a)return!1;var u=l[0].set(e.left,e.top),c=l[1].set(e.left,e.bottom),h=l[2].set(e.right,e.top),d=l[3].set(e.right,e.bottom);if(h.x<=u.x||c.y<=u.y)return!1;var f=Math.sign(t.a*t.d-t.b*t.c);if(0===f)return!1;if(t.apply(u,u),t.apply(c,c),t.apply(h,h),t.apply(d,d),Math.max(u.x,c.x,h.x,d.x)<=i||Math.min(u.x,c.x,h.x,d.x)>=o||Math.max(u.y,c.y,h.y,d.y)<=a||Math.min(u.y,c.y,h.y,d.y)>=s)return!1;var p=f*(c.y-u.y),v=f*(u.x-c.x),m=p*i+v*a,g=p*o+v*a,y=p*i+v*s,b=p*o+v*s;if(Math.max(m,g,y,b)<=p*u.x+v*u.y||Math.min(m,g,y,b)>=p*d.x+v*d.y)return!1;var x=f*(u.y-h.y),_=f*(h.x-u.x),w=x*i+_*a,T=x*o+_*a,M=x*i+_*s,S=x*o+_*s;return!(Math.max(w,T,M,S)<=x*u.x+_*u.y||Math.min(w,T,M,S)>=x*d.x+_*d.y)},e.prototype.pad=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.x-=e,this.y-=t,this.width+=2*e,this.height+=2*t,this},e.prototype.fit=function(e){var t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this},e.prototype.ceil=function(e,t){void 0===e&&(e=1),void 0===t&&(t=.001);var n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this},e.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this},e.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},e}(),h=function(){function e(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),this.x=e,this.y=t,this.radius=n,this.type=r.CIRC}return e.prototype.clone=function(){return new e(this.x,this.y,this.radius)},e.prototype.contains=function(e,t){if(this.radius<=0)return!1;var n=this.radius*this.radius,r=this.x-e,i=this.y-t;return(r*=r)+(i*=i)<=n},e.prototype.getBounds=function(){return new c(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},e.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},e}(),d=function(){function e(e,t,n,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),this.x=e,this.y=t,this.width=n,this.height=i,this.type=r.ELIP}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var n=(e-this.x)/this.width,r=(t-this.y)/this.height;return(n*=n)+(r*=r)<=1},e.prototype.getBounds=function(){return new c(this.x-this.width,this.y-this.height,this.width,this.height)},e.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},e}(),f=function(){function e(){for(var e=arguments,t=[],n=0;nt!=l>t&&e<(t-s)/(l-s)*(u-a)+a&&(n=!n)}return n},e.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(e,t){return e+", "+t}),"")+"]"},e}(),p=function(){function e(e,t,n,i,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),void 0===o&&(o=20),this.x=e,this.y=t,this.width=n,this.height=i,this.radius=o,this.type=r.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;var r=e-(this.x+n),i=t-(this.y+n),o=n*n;if(r*r+i*i<=o)return!0;if((r=e-(this.x+this.width-n))*r+i*i<=o)return!0;if(r*r+(i=t-(this.y+this.height-n))*i<=o)return!0;if((r=e-(this.x+n))*r+i*i<=o)return!0}return!1},e.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},e}(),v=function(){function e(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0),this._x=n,this._y=r,this.cb=e,this.scope=t}return e.prototype.clone=function(t,n){return void 0===t&&(t=this.cb),void 0===n&&(n=this.scope),new e(t,n,this._x,this._y)},e.prototype.set=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this._x===e&&this._y===t||(this._x=e,this._y=t,this.cb.call(this.scope)),this},e.prototype.copyFrom=function(e){return this._x===e.x&&this._y===e.y||(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},e.prototype.copyTo=function(e){return e.set(this._x,this._y),e},e.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},e.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),e}(),m=function(){function e(e,t,n,r,i,o){void 0===e&&(e=1),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===i&&(i=0),void 0===o&&(o=0),this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=o}return e.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},e.prototype.set=function(e,t,n,r,i,o){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=o,this},e.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},e.prototype.apply=function(e,t){t=t||new u;var n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t},e.prototype.applyInverse=function(e,t){t=t||new u;var n=1/(this.a*this.d+this.c*-this.b),r=e.x,i=e.y;return t.x=this.d*n*r+-this.c*n*i+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*i+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,t},e.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},e.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},e.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,o=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=o*t-this.ty*n,this.ty=o*n+this.ty*t,this},e.prototype.append=function(e){var t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this},e.prototype.setTransform=function(e,t,n,r,i,o,a,s,u){return this.a=Math.cos(a+u)*i,this.b=Math.sin(a+u)*i,this.c=-Math.sin(a-s)*o,this.d=Math.cos(a-s)*o,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this},e.prototype.prepend=function(e){var t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){var n=this.a,r=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},e.prototype.decompose=function(e){var t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,s=-Math.atan2(-r,i),u=Math.atan2(n,t),l=Math.abs(s+u);return l<1e-5||Math.abs(o-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=s,e.skew.y=u),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e},e.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,o=e*r-t*n;return this.a=r/o,this.b=-t/o,this.c=-n/o,this.d=e/o,this.tx=(n*this.ty-r*i)/o,this.ty=-(e*this.ty-t*i)/o,this},e.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},e.prototype.clone=function(){var t=new e;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},e.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},e.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},e.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(e,"IDENTITY",{get:function(){return new e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"TEMP_MATRIX",{get:function(){return new e},enumerable:!1,configurable:!0}),e}(),g=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],y=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],b=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],x=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],_=[],w=[],T=Math.sign;!function(){for(var e=0;e<16;e++){var t=[];_.push(t);for(var n=0;n<16;n++)for(var r=T(g[e]*g[n]+b[e]*y[n]),i=T(y[e]*g[n]+x[e]*y[n]),o=T(g[e]*b[n]+b[e]*x[n]),a=T(y[e]*b[n]+x[e]*x[n]),s=0;s<16;s++)if(g[s]===r&&y[s]===i&&b[s]===o&&x[s]===a){t.push(s);break}}for(e=0;e<16;e++){var u=new m;u.set(g[e],y[e],b[e],x[e],0,0),w.push(u)}}();var M={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(e){return g[e]},uY:function(e){return y[e]},vX:function(e){return b[e]},vY:function(e){return x[e]},inv:function(e){return 8&e?15&e:7&-e},add:function(e,t){return _[e][t]},sub:function(e,t){return _[e][M.inv(t)]},rotate180:function(e){return 4^e},isVertical:function(e){return 2==(3&e)},byDirection:function(e,t){return 2*Math.abs(e)<=Math.abs(t)?t>=0?M.S:M.N:2*Math.abs(t)<=Math.abs(e)?e>0?M.E:M.W:t>0?e>0?M.SE:M.SW:e>0?M.NE:M.NW},matrixAppendRotationInv:function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=w[M.inv(t)];i.tx=n,i.ty=r,e.append(i)}},S=function(){function e(){this.worldTransform=new m,this.localTransform=new m,this.position=new v(this.onChange,this,0,0),this.scale=new v(this.onChange,this,1,1),this.pivot=new v(this.onChange,this,0,0),this.skew=new v(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return e.prototype.onChange=function(){this._localID++},e.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},e.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},e.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},e.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var n=e.worldTransform,r=this.worldTransform;r.a=t.a*n.a+t.b*n.c,r.b=t.a*n.b+t.b*n.d,r.c=t.c*n.a+t.d*n.c,r.d=t.c*n.b+t.d*n.d,r.tx=t.tx*n.a+t.ty*n.c+n.tx,r.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}},e.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(e.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),e.IDENTITY=new e,e}()},function(e,t,n){n.d(t,"a",(function(){return rt})),n.d(t,"b",(function(){return C})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return ct})),n.d(t,"e",(function(){return vt})),n.d(t,"f",(function(){return yt})),n.d(t,"g",(function(){return ht})),n.d(t,"h",(function(){return B})),n.d(t,"i",(function(){return v})),n.d(t,"j",(function(){return _})),n.d(t,"k",(function(){return De})),n.d(t,"l",(function(){return H})),n.d(t,"m",(function(){return K})),n.d(t,"n",(function(){return Ce})),n.d(t,"o",(function(){return W})),n.d(t,"p",(function(){return R})),n.d(t,"q",(function(){return at})),n.d(t,"r",(function(){return Ne})),n.d(t,"s",(function(){return ke})),n.d(t,"t",(function(){return P})),n.d(t,"u",(function(){return Re})),n.d(t,"v",(function(){return X})),n.d(t,"w",(function(){return S})),n.d(t,"x",(function(){return dt})),n.d(t,"y",(function(){return st})),n.d(t,"z",(function(){return lt})),n.d(t,"A",(function(){return ut}));var r=n(4),i=n(0),o=n(3),a=n(12),s=n(7),u=n(1); /*! * @pixi/core - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -35,7 +35,7 @@ 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),E=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),S=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,S,_,E,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,E=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=E,"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 S=E.getParameter(E.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=S;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 E(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 S(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(E)||B(t))&&!o(k),universal:o(S),device:(o(T)||o(M)||o(E)||o(S)||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),R=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=q[0],r=q[1],i=q[2],o=q[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?Z.copyFrom(i):Z.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,Re=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 qe=0,Ze={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=qe++}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||(Ze.textureCount=0,Ze.uboCount=0,this.syncUniformGroup(e.uniformGroup,Ze)),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 R?(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(R),opera:o(O),firefox:o(j),chrome:o(L),device:o(P)||o(R)||o(O)||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 @@ -63,14 +63,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. - ***************************************************************************** */function u(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var l,c,h,d,f,p,v,m,g,y,b,x,_,w,T,M,E,S,A,I,C=function(e){function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new i.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 a,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 u(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(o.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(k),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;o1)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(o.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(k),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;ot.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}else e.connect(n);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var n=this._head.next;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(e){var t;if(void 0===e&&(e=performance.now()),e>this.lastTime){if((t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var n=e-this._lastFrame|0;if(n>16)+(65280&e)+((255&e)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;Object(u.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},t}(r.r),m=function(e){function t(t,n,i){var a=e.call(this)||this,s=new r.h(t),u=new r.h(n,!0),l=new r.h(i,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,o.r.FLOAT).addAttribute("aTextureCoord",u,2,!1,o.r.FLOAT).addIndex(l),a._updateId=-1,a}return c(t,e),Object.defineProperty(t.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),t}(r.l)},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){n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p}));var r=n(2),i=n(3),o=n(1),a=n(0),s=n(4),u=function(e,t){return(u=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)},l=function(){function e(e){this._foundShapes=[],this.renderer=e}return e.prototype.pushMask=function(e){var t=this.renderer,n=e.maskObject||e;t.context.save();var r=this._foundShapes;if(this.recursiveFindShapes(n,r),r.length>0){var i=t.context;i.beginPath();for(var o=0;o0){for(c=0,d=u[0],f=u[1],p=2;p+2=0;p-=2)t.lineTo(u[p],u[p+1]);l[v].shape.closeStroke&&t.closePath()}}u[0]===u[u.length-2]&&u[1]===u[u.length-1]&&t.closePath()}else if(s.type===o.l.RECT)t.rect(s.x,s.y,s.width,s.height),t.closePath();else if(s.type===o.l.CIRC)t.arc(s.x,s.y,s.radius,0,2*Math.PI),t.closePath();else if(s.type===o.l.ELIP){var m=2*s.width,g=2*s.height,y=s.x-m/2,b=s.y-g/2,x=m/2*.5522848,_=g/2*.5522848,w=y+m,T=b+g,M=y+m/2,E=b+g/2;t.moveTo(y,E),t.bezierCurveTo(y,E-_,M-x,b,M,b),t.bezierCurveTo(M+x,b,w,E-_,w,E),t.bezierCurveTo(w,E+_,M+x,T,M,T),t.bezierCurveTo(M-x,T,y,E+_,y,E),t.closePath()}else if(s.type===o.l.RREC){var S=s.x,A=s.y,I=s.width,C=s.height,N=s.radius,k=Math.min(I,C)/2;N=N>k?k:N,t.moveTo(S,A+N),t.lineTo(S,A+C-N),t.quadraticCurveTo(S,A+C,S+N,A+C),t.lineTo(S+I-N,A+C),t.quadraticCurveTo(S+I,A+C,S+I,A+C-N),t.lineTo(S+I,A+N),t.quadraticCurveTo(S+I,A,S+I-N,A),t.lineTo(S+N,A),t.quadraticCurveTo(S,A,S,A+N),t.closePath()}}},e.prototype.popMask=function(e){e.context.restore(),e.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function c(e){var t=document.createElement("canvas");t.width=6,t.height=1;var n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,6,1),t}function h(){if("undefined"==typeof document)return!1;var e=c("#ff00ff"),t=c("#ffff00"),n=document.createElement("canvas");n.width=6,n.height=1;var r=n.getContext("2d");r.globalCompositeOperation="multiply",r.drawImage(e,0,0),r.drawImage(t,2,0);var i=r.getImageData(2,0,1,1);if(!i)return!1;var o=i.data;return 255===o[0]&&0===o[1]&&0===o[2]}var d=new o.d,f=function(e){function t(n){var r,o=e.call(this,a.n.CANVAS,n)||this;if(o.refresh=!0,o.maskManager=new l(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=(void 0===r&&(r=[]),h()?(r[a.b.NORMAL]="source-over",r[a.b.ADD]="lighter",r[a.b.MULTIPLY]="multiply",r[a.b.SCREEN]="screen",r[a.b.OVERLAY]="overlay",r[a.b.DARKEN]="darken",r[a.b.LIGHTEN]="lighten",r[a.b.COLOR_DODGE]="color-dodge",r[a.b.COLOR_BURN]="color-burn",r[a.b.HARD_LIGHT]="hard-light",r[a.b.SOFT_LIGHT]="soft-light",r[a.b.DIFFERENCE]="difference",r[a.b.EXCLUSION]="exclusion",r[a.b.HUE]="hue",r[a.b.SATURATION]="saturate",r[a.b.COLOR]="color",r[a.b.LUMINOSITY]="luminosity"):(r[a.b.NORMAL]="source-over",r[a.b.ADD]="lighter",r[a.b.MULTIPLY]="source-over",r[a.b.SCREEN]="source-over",r[a.b.OVERLAY]="source-over",r[a.b.DARKEN]="source-over",r[a.b.LIGHTEN]="source-over",r[a.b.COLOR_DODGE]="source-over",r[a.b.COLOR_BURN]="source-over",r[a.b.HARD_LIGHT]="source-over",r[a.b.SOFT_LIGHT]="source-over",r[a.b.DIFFERENCE]="source-over",r[a.b.EXCLUSION]="source-over",r[a.b.HUE]="source-over",r[a.b.SATURATION]="source-over",r[a.b.COLOR]="source-over",r[a.b.LUMINOSITY]="source-over"),r[a.b.NORMAL_NPM]=r[a.b.NORMAL],r[a.b.ADD_NPM]=r[a.b.ADD],r[a.b.SCREEN_NPM]=r[a.b.SCREEN],r[a.b.SRC_IN]="source-in",r[a.b.SRC_OUT]="source-out",r[a.b.SRC_ATOP]="source-atop",r[a.b.DST_OVER]="destination-over",r[a.b.DST_IN]="destination-in",r[a.b.DST_OUT]="destination-out",r[a.b.DST_ATOP]="destination-atop",r[a.b.XOR]="xor",r[a.b.SUBTRACT]="source-over",r),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var s=o.rootContext;s.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":s.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":s.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":s.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(t.__plugins),Object(i.sayHello)("Canvas"),o.resize(o.options.width,o.options.height),o}return function(e,t){function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.addSystem=function(){return this},t.prototype.render=function(e,t){if(this.view){var n,o,s,u;t&&(t instanceof r.p||t instanceof r.b?(Object(i.deprecation)("6.0.0","CanvasRenderer#render arguments changed, use options instead."),n=t,o=arguments[2],s=arguments[3],u=arguments[4]):(n=t.renderTexture,o=t.clear,s=t.transform,u=t.skipUpdateTransform)),this.renderingToScreen=!n,this.emit("prerender");var l=this.resolution;n?((n=n.castToBaseTexture())._canvasRenderTarget||(n._canvasRenderTarget=new i.CanvasRenderTarget(n.width,n.height,n.resolution),n.resource=new r.j(n._canvasRenderTarget.canvas),n.valid=!0),this.context=n._canvasRenderTarget.context,this.resolution=n._canvasRenderTarget.resolution):this.context=this.rootContext;var c=this.context;if(this._projTransform=s||null,n||(this._lastObjectRendered=e),!u){var h=e.enableTempParent();e.updateTransform(),e.disableTempParent(h)}if(c.save(),c.setTransform(1,0,0,1,0,0),c.globalAlpha=1,this._activeBlendMode=a.b.NORMAL,this._outerBlend=!1,c.globalCompositeOperation=this.blendModes[a.b.NORMAL],void 0!==o?o:this.clearBeforeRender)if(this.renderingToScreen)c.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(c.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,c.fillStyle=this._backgroundColorString,c.fillRect(0,0,this.width,this.height),c.globalAlpha=1);else{(n=n)._canvasRenderTarget.clear();var d=n.clearColor;d[3]>0&&(c.globalAlpha=this.useContextAlpha?d[3]:1,c.fillStyle=Object(i.hex2string)(Object(i.rgb2hex)(d)),c.fillRect(0,0,n.realWidth,n.realHeight),c.globalAlpha=1)}var f=this.context;this.context=c,e.renderCanvas(this),this.context=f,c.restore(),this.resolution=l,this._projTransform=null,this.emit("postrender")}},t.prototype.setContextTransform=function(e,t,n){var r=e,i=this._projTransform,o=this.resolution;n=n||o,i&&((r=d).copyFrom(e),r.prepend(i)),t?this.context.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*o|0,r.ty*o|0):this.context.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*o,r.ty*o)},t.prototype.clear=function(e,t){void 0===e&&(e=this._backgroundColorString),void 0===t&&(t=this.backgroundAlpha);var n=this.context;n.clearRect(0,0,this.width,this.height),e&&(n.globalAlpha=this.useContextAlpha?t:1,n.fillStyle=e,n.fillRect(0,0,this.width,this.height),n.globalAlpha=1)},t.prototype.setBlendMode=function(e,t){var n=e===a.b.SRC_IN||e===a.b.SRC_OUT||e===a.b.DST_IN||e===a.b.DST_ATOP;!t&&n&&(e=a.b.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=n,this.context.globalCompositeOperation=this.blendModes[e])},t.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.smoothProperty&&(this.rootContext[this.smoothProperty]=s.b.SCALE_MODE===a.p.LINEAR)},t.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},t.registerPlugin=function(e,n){t.__plugins=t.__plugins||{},t.__plugins[e]=n},t}(r.a),p={canvas:null,getTintedCanvas:function(e,t){var n=e.texture,r="#"+("00000"+(0|(t=p.roundColor(t))).toString(16)).slice(-6);n.tintCache=n.tintCache||{};var i,o=n.tintCache[r];if(o){if(o.tintId===n._updateID)return n.tintCache[r];i=n.tintCache[r]}else i=document.createElement("canvas");if(p.tintMethod(n,t,i),i.tintId=n._updateID,p.convertTintToImage){var a=new Image;a.src=i.toDataURL(),n.tintCache[r]=a}else n.tintCache[r]=i;return i},getTintedPattern:function(e,t){var n="#"+("00000"+(0|(t=p.roundColor(t))).toString(16)).slice(-6);e.patternCache=e.patternCache||{};var r=e.patternCache[n];return r&&r.tintId===e._updateID||(p.canvas||(p.canvas=document.createElement("canvas")),p.tintMethod(e,t,p.canvas),(r=p.canvas.getContext("2d").createPattern(p.canvas,"repeat")).tintId=e._updateID,e.patternCache[n]=r),r},tintWithMultiply:function(e,t,n){var r=n.getContext("2d"),i=e._frame.clone(),o=e.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,n.width=Math.ceil(i.width),n.height=Math.ceil(i.height),r.save(),r.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),r.fillRect(0,0,i.width,i.height),r.globalCompositeOperation="multiply";var a=e.baseTexture.getDrawableSource();r.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.globalCompositeOperation="destination-atop",r.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore()},tintWithOverlay:function(e,t,n){var r=n.getContext("2d"),i=e._frame.clone(),o=e.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,n.width=Math.ceil(i.width),n.height=Math.ceil(i.height),r.save(),r.globalCompositeOperation="copy",r.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),r.fillRect(0,0,i.width,i.height),r.globalCompositeOperation="destination-atop",r.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore()},tintWithPerPixel:function(e,t,n){var r=n.getContext("2d"),o=e._frame.clone(),a=e.baseTexture.resolution;o.x*=a,o.y*=a,o.width*=a,o.height*=a,n.width=Math.ceil(o.width),n.height=Math.ceil(o.height),r.save(),r.globalCompositeOperation="copy",r.drawImage(e.baseTexture.getDrawableSource(),o.x,o.y,o.width,o.height,0,0,o.width,o.height),r.restore();for(var s=Object(i.hex2rgb)(t),u=s[0],l=s[1],c=s[2],h=r.getImageData(0,0,o.width,o.height),d=h.data,f=0;ft.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}else e.connect(n);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var n=this._head.next;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(e){var t;if(void 0===e&&(e=performance.now()),e>this.lastTime){if((t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var n=e-this._lastFrame|0;if(n>16)+(65280&e)+((255&e)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;Object(u.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},t}(r.r),m=function(e){function t(t,n,i){var a=e.call(this)||this,s=new r.h(t),u=new r.h(n,!0),l=new r.h(i,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,o.r.FLOAT).addAttribute("aTextureCoord",u,2,!1,o.r.FLOAT).addIndex(l),a._updateId=-1,a}return c(t,e),Object.defineProperty(t.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),t}(r.l)},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){n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p}));var r=n(2),i=n(3),o=n(1),a=n(0),s=n(4),u=function(e,t){return(u=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)},l=function(){function e(e){this._foundShapes=[],this.renderer=e}return e.prototype.pushMask=function(e){var t=this.renderer,n=e.maskObject||e;t.context.save();var r=this._foundShapes;if(this.recursiveFindShapes(n,r),r.length>0){var i=t.context;i.beginPath();for(var o=0;o0){for(c=0,d=u[0],f=u[1],p=2;p+2=0;p-=2)t.lineTo(u[p],u[p+1]);l[v].shape.closeStroke&&t.closePath()}}u[0]===u[u.length-2]&&u[1]===u[u.length-1]&&t.closePath()}else if(s.type===o.l.RECT)t.rect(s.x,s.y,s.width,s.height),t.closePath();else if(s.type===o.l.CIRC)t.arc(s.x,s.y,s.radius,0,2*Math.PI),t.closePath();else if(s.type===o.l.ELIP){var m=2*s.width,g=2*s.height,y=s.x-m/2,b=s.y-g/2,x=m/2*.5522848,_=g/2*.5522848,w=y+m,T=b+g,M=y+m/2,S=b+g/2;t.moveTo(y,S),t.bezierCurveTo(y,S-_,M-x,b,M,b),t.bezierCurveTo(M+x,b,w,S-_,w,S),t.bezierCurveTo(w,S+_,M+x,T,M,T),t.bezierCurveTo(M-x,T,y,S+_,y,S),t.closePath()}else if(s.type===o.l.RREC){var E=s.x,A=s.y,I=s.width,C=s.height,N=s.radius,k=Math.min(I,C)/2;N=N>k?k:N,t.moveTo(E,A+N),t.lineTo(E,A+C-N),t.quadraticCurveTo(E,A+C,E+N,A+C),t.lineTo(E+I-N,A+C),t.quadraticCurveTo(E+I,A+C,E+I,A+C-N),t.lineTo(E+I,A+N),t.quadraticCurveTo(E+I,A,E+I-N,A),t.lineTo(E+N,A),t.quadraticCurveTo(E,A,E,A+N),t.closePath()}}},e.prototype.popMask=function(e){e.context.restore(),e.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function c(e){var t=document.createElement("canvas");t.width=6,t.height=1;var n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,6,1),t}function h(){if("undefined"==typeof document)return!1;var e=c("#ff00ff"),t=c("#ffff00"),n=document.createElement("canvas");n.width=6,n.height=1;var r=n.getContext("2d");r.globalCompositeOperation="multiply",r.drawImage(e,0,0),r.drawImage(t,2,0);var i=r.getImageData(2,0,1,1);if(!i)return!1;var o=i.data;return 255===o[0]&&0===o[1]&&0===o[2]}var d=new o.d,f=function(e){function t(n){var r,o=e.call(this,a.n.CANVAS,n)||this;if(o.refresh=!0,o.maskManager=new l(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=(void 0===r&&(r=[]),h()?(r[a.b.NORMAL]="source-over",r[a.b.ADD]="lighter",r[a.b.MULTIPLY]="multiply",r[a.b.SCREEN]="screen",r[a.b.OVERLAY]="overlay",r[a.b.DARKEN]="darken",r[a.b.LIGHTEN]="lighten",r[a.b.COLOR_DODGE]="color-dodge",r[a.b.COLOR_BURN]="color-burn",r[a.b.HARD_LIGHT]="hard-light",r[a.b.SOFT_LIGHT]="soft-light",r[a.b.DIFFERENCE]="difference",r[a.b.EXCLUSION]="exclusion",r[a.b.HUE]="hue",r[a.b.SATURATION]="saturate",r[a.b.COLOR]="color",r[a.b.LUMINOSITY]="luminosity"):(r[a.b.NORMAL]="source-over",r[a.b.ADD]="lighter",r[a.b.MULTIPLY]="source-over",r[a.b.SCREEN]="source-over",r[a.b.OVERLAY]="source-over",r[a.b.DARKEN]="source-over",r[a.b.LIGHTEN]="source-over",r[a.b.COLOR_DODGE]="source-over",r[a.b.COLOR_BURN]="source-over",r[a.b.HARD_LIGHT]="source-over",r[a.b.SOFT_LIGHT]="source-over",r[a.b.DIFFERENCE]="source-over",r[a.b.EXCLUSION]="source-over",r[a.b.HUE]="source-over",r[a.b.SATURATION]="source-over",r[a.b.COLOR]="source-over",r[a.b.LUMINOSITY]="source-over"),r[a.b.NORMAL_NPM]=r[a.b.NORMAL],r[a.b.ADD_NPM]=r[a.b.ADD],r[a.b.SCREEN_NPM]=r[a.b.SCREEN],r[a.b.SRC_IN]="source-in",r[a.b.SRC_OUT]="source-out",r[a.b.SRC_ATOP]="source-atop",r[a.b.DST_OVER]="destination-over",r[a.b.DST_IN]="destination-in",r[a.b.DST_OUT]="destination-out",r[a.b.DST_ATOP]="destination-atop",r[a.b.XOR]="xor",r[a.b.SUBTRACT]="source-over",r),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var s=o.rootContext;s.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":s.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":s.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":s.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(t.__plugins),Object(i.sayHello)("Canvas"),o.resize(o.options.width,o.options.height),o}return function(e,t){function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.addSystem=function(){return this},t.prototype.render=function(e,t){if(this.view){var n,o,s,u;t&&(t instanceof r.p||t instanceof r.b?(Object(i.deprecation)("6.0.0","CanvasRenderer#render arguments changed, use options instead."),n=t,o=arguments[2],s=arguments[3],u=arguments[4]):(n=t.renderTexture,o=t.clear,s=t.transform,u=t.skipUpdateTransform)),this.renderingToScreen=!n,this.emit("prerender");var l=this.resolution;n?((n=n.castToBaseTexture())._canvasRenderTarget||(n._canvasRenderTarget=new i.CanvasRenderTarget(n.width,n.height,n.resolution),n.resource=new r.j(n._canvasRenderTarget.canvas),n.valid=!0),this.context=n._canvasRenderTarget.context,this.resolution=n._canvasRenderTarget.resolution):this.context=this.rootContext;var c=this.context;if(this._projTransform=s||null,n||(this._lastObjectRendered=e),!u){var h=e.enableTempParent();e.updateTransform(),e.disableTempParent(h)}if(c.save(),c.setTransform(1,0,0,1,0,0),c.globalAlpha=1,this._activeBlendMode=a.b.NORMAL,this._outerBlend=!1,c.globalCompositeOperation=this.blendModes[a.b.NORMAL],void 0!==o?o:this.clearBeforeRender)if(this.renderingToScreen)c.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(c.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,c.fillStyle=this._backgroundColorString,c.fillRect(0,0,this.width,this.height),c.globalAlpha=1);else{(n=n)._canvasRenderTarget.clear();var d=n.clearColor;d[3]>0&&(c.globalAlpha=this.useContextAlpha?d[3]:1,c.fillStyle=Object(i.hex2string)(Object(i.rgb2hex)(d)),c.fillRect(0,0,n.realWidth,n.realHeight),c.globalAlpha=1)}var f=this.context;this.context=c,e.renderCanvas(this),this.context=f,c.restore(),this.resolution=l,this._projTransform=null,this.emit("postrender")}},t.prototype.setContextTransform=function(e,t,n){var r=e,i=this._projTransform,o=this.resolution;n=n||o,i&&((r=d).copyFrom(e),r.prepend(i)),t?this.context.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*o|0,r.ty*o|0):this.context.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*o,r.ty*o)},t.prototype.clear=function(e,t){void 0===e&&(e=this._backgroundColorString),void 0===t&&(t=this.backgroundAlpha);var n=this.context;n.clearRect(0,0,this.width,this.height),e&&(n.globalAlpha=this.useContextAlpha?t:1,n.fillStyle=e,n.fillRect(0,0,this.width,this.height),n.globalAlpha=1)},t.prototype.setBlendMode=function(e,t){var n=e===a.b.SRC_IN||e===a.b.SRC_OUT||e===a.b.DST_IN||e===a.b.DST_ATOP;!t&&n&&(e=a.b.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=n,this.context.globalCompositeOperation=this.blendModes[e])},t.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.smoothProperty&&(this.rootContext[this.smoothProperty]=s.b.SCALE_MODE===a.p.LINEAR)},t.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},t.registerPlugin=function(e,n){t.__plugins=t.__plugins||{},t.__plugins[e]=n},t}(r.a),p={canvas:null,getTintedCanvas:function(e,t){var n=e.texture,r="#"+("00000"+(0|(t=p.roundColor(t))).toString(16)).slice(-6);n.tintCache=n.tintCache||{};var i,o=n.tintCache[r];if(o){if(o.tintId===n._updateID)return n.tintCache[r];i=n.tintCache[r]}else i=document.createElement("canvas");if(p.tintMethod(n,t,i),i.tintId=n._updateID,p.convertTintToImage){var a=new Image;a.src=i.toDataURL(),n.tintCache[r]=a}else n.tintCache[r]=i;return i},getTintedPattern:function(e,t){var n="#"+("00000"+(0|(t=p.roundColor(t))).toString(16)).slice(-6);e.patternCache=e.patternCache||{};var r=e.patternCache[n];return r&&r.tintId===e._updateID||(p.canvas||(p.canvas=document.createElement("canvas")),p.tintMethod(e,t,p.canvas),(r=p.canvas.getContext("2d").createPattern(p.canvas,"repeat")).tintId=e._updateID,e.patternCache[n]=r),r},tintWithMultiply:function(e,t,n){var r=n.getContext("2d"),i=e._frame.clone(),o=e.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,n.width=Math.ceil(i.width),n.height=Math.ceil(i.height),r.save(),r.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),r.fillRect(0,0,i.width,i.height),r.globalCompositeOperation="multiply";var a=e.baseTexture.getDrawableSource();r.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.globalCompositeOperation="destination-atop",r.drawImage(a,i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore()},tintWithOverlay:function(e,t,n){var r=n.getContext("2d"),i=e._frame.clone(),o=e.baseTexture.resolution;i.x*=o,i.y*=o,i.width*=o,i.height*=o,n.width=Math.ceil(i.width),n.height=Math.ceil(i.height),r.save(),r.globalCompositeOperation="copy",r.fillStyle="#"+("00000"+(0|t).toString(16)).slice(-6),r.fillRect(0,0,i.width,i.height),r.globalCompositeOperation="destination-atop",r.drawImage(e.baseTexture.getDrawableSource(),i.x,i.y,i.width,i.height,0,0,i.width,i.height),r.restore()},tintWithPerPixel:function(e,t,n){var r=n.getContext("2d"),o=e._frame.clone(),a=e.baseTexture.resolution;o.x*=a,o.y*=a,o.width*=a,o.height*=a,n.width=Math.ceil(o.width),n.height=Math.ceil(o.height),r.save(),r.globalCompositeOperation="copy",r.drawImage(e.baseTexture.getDrawableSource(),o.x,o.y,o.width,o.height,0,0,o.width,o.height),r.restore();for(var s=Object(i.hex2rgb)(t),u=s[0],l=s[1],c=s[2],h=r.getImageData(0,0,o.width,o.height),d=h.data,f=0;f8)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){E(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(){E(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(){E(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(){E(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(){E(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(){E(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 E(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:E,toASCII:function(e){return y(e,(function(e){return h.test(e)?"xn--"+E(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]*$/,E=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,S=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),A=["'"].concat(S),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?S+="x":S+=T[R];if(!S.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],E=(n.host||e.host||w.length>1)&&("."===M||".."===M)||""===M,S=0,A=w.length;A>=0;A--)"."===(M=w[A])?w.splice(A,1):".."===M?(w.splice(A,1),S++):S&&(w.splice(A,1),S--);if(!b&&!x)for(;S--;S)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),E&&"/"!==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(21),i=n(15);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==r(e)}},function(e,t,n){var r=n(50),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){var r;n.r(t),n.d(t,"ACESFilmicToneMapping",(function(){return me})),n.d(t,"AddEquation",(function(){return U})),n.d(t,"AddOperation",(function(){return he})),n.d(t,"AdditiveAnimationBlendMode",(function(){return sn})),n.d(t,"AdditiveBlending",(function(){return R})),n.d(t,"AlphaFormat",(function(){return Ze})),n.d(t,"AlwaysDepth",(function(){return ne})),n.d(t,"AlwaysStencilFunc",(function(){return Bn})),n.d(t,"AmbientLight",(function(){return Yh})),n.d(t,"AmbientLightProbe",(function(){return pd})),n.d(t,"AnimationClip",(function(){return fh})),n.d(t,"AnimationLoader",(function(){return _h})),n.d(t,"AnimationMixer",(function(){return Vd})),n.d(t,"AnimationObjectGroup",(function(){return Gd})),n.d(t,"AnimationUtils",(function(){return eh})),n.d(t,"ArcCurve",(function(){return Ll})),n.d(t,"ArrayCamera",(function(){return su})),n.d(t,"ArrowHelper",(function(){return Rf})),n.d(t,"Audio",(function(){return Sd})),n.d(t,"AudioAnalyser",(function(){return kd})),n.d(t,"AudioContext",(function(){return hd})),n.d(t,"AudioListener",(function(){return Md})),n.d(t,"AudioLoader",(function(){return dd})),n.d(t,"AxesHelper",(function(){return Of})),n.d(t,"AxisHelper",(function(){return Dp})),n.d(t,"BackSide",(function(){return I})),n.d(t,"BasicDepthPacking",(function(){return bn})),n.d(t,"BasicShadowMap",(function(){return b})),n.d(t,"BinaryTextureLoader",(function(){return jp})),n.d(t,"Bone",(function(){return Yu})),n.d(t,"BooleanKeyframeTrack",(function(){return ah})),n.d(t,"BoundingBoxHelper",(function(){return Pp})),n.d(t,"Box2",(function(){return ef})),n.d(t,"Box3",(function(){return Sr})),n.d(t,"Box3Helper",(function(){return kf})),n.d(t,"BoxBufferGeometry",(function(){return Lo})),n.d(t,"BoxGeometry",(function(){return Lo})),n.d(t,"BoxHelper",(function(){return Nf})),n.d(t,"BufferAttribute",(function(){return Qi})),n.d(t,"BufferGeometry",(function(){return mo})),n.d(t,"BufferGeometryLoader",(function(){return ed})),n.d(t,"ByteType",(function(){return Ue})),n.d(t,"Cache",(function(){return vh})),n.d(t,"Camera",(function(){return zo})),n.d(t,"CameraHelper",(function(){return Sf})),n.d(t,"CanvasRenderer",(function(){return Up})),n.d(t,"CanvasTexture",(function(){return wl})),n.d(t,"CatmullRomCurve3",(function(){return Gl})),n.d(t,"CineonToneMapping",(function(){return ve})),n.d(t,"CircleBufferGeometry",(function(){return Ml})),n.d(t,"CircleGeometry",(function(){return Ml})),n.d(t,"ClampToEdgeWrapping",(function(){return Ee})),n.d(t,"Clock",(function(){return yd})),n.d(t,"Color",(function(){return Vi})),n.d(t,"ColorKeyframeTrack",(function(){return sh})),n.d(t,"CompressedTexture",(function(){return _l})),n.d(t,"CompressedTextureLoader",(function(){return wh})),n.d(t,"ConeBufferGeometry",(function(){return El})),n.d(t,"ConeGeometry",(function(){return El})),n.d(t,"CubeCamera",(function(){return Ho})),n.d(t,"CubeReflectionMapping",(function(){return be})),n.d(t,"CubeRefractionMapping",(function(){return xe})),n.d(t,"CubeTexture",(function(){return Vo})),n.d(t,"CubeTextureLoader",(function(){return Mh})),n.d(t,"CubeUVReflectionMapping",(function(){return Te})),n.d(t,"CubeUVRefractionMapping",(function(){return Me})),n.d(t,"CubicBezierCurve",(function(){return Yl})),n.d(t,"CubicBezierCurve3",(function(){return Xl})),n.d(t,"CubicInterpolant",(function(){return nh})),n.d(t,"CullFaceBack",(function(){return h})),n.d(t,"CullFaceFront",(function(){return d})),n.d(t,"CullFaceFrontBack",(function(){return v})),n.d(t,"CullFaceNone",(function(){return s})),n.d(t,"Curve",(function(){return Rl})),n.d(t,"CurvePath",(function(){return Ah})),n.d(t,"CustomBlending",(function(){return B})),n.d(t,"CustomToneMapping",(function(){return ge})),n.d(t,"CylinderBufferGeometry",(function(){return Sl})),n.d(t,"CylinderGeometry",(function(){return Sl})),n.d(t,"Cylindrical",(function(){return Kd})),n.d(t,"DataTexture",(function(){return Xu})),n.d(t,"DataTexture2DArray",(function(){return ba})),n.d(t,"DataTexture3D",(function(){return xa})),n.d(t,"DataTextureLoader",(function(){return Sh})),n.d(t,"DataUtils",(function(){return Bf})),n.d(t,"DecrementStencilOp",(function(){return An})),n.d(t,"DecrementWrapStencilOp",(function(){return Cn})),n.d(t,"DefaultLoadingManager",(function(){return gh})),n.d(t,"DepthFormat",(function(){return nt})),n.d(t,"DepthStencilFormat",(function(){return rt})),n.d(t,"DepthTexture",(function(){return Tl})),n.d(t,"DirectionalLight",(function(){return Wh})),n.d(t,"DirectionalLightHelper",(function(){return wf})),n.d(t,"DiscreteInterpolant",(function(){return ih})),n.d(t,"DodecahedronBufferGeometry",(function(){return Il})),n.d(t,"DodecahedronGeometry",(function(){return Il})),n.d(t,"DoubleSide",(function(){return C})),n.d(t,"DstAlphaFactor",(function(){return Z})),n.d(t,"DstColorFactor",(function(){return K})),n.d(t,"DynamicBufferAttribute",(function(){return wp})),n.d(t,"DynamicCopyUsage",(function(){return Yn})),n.d(t,"DynamicDrawUsage",(function(){return Fn})),n.d(t,"DynamicReadUsage",(function(){return Hn})),n.d(t,"EdgesGeometry",(function(){return Pl})),n.d(t,"EdgesHelper",(function(){return Rp})),n.d(t,"EllipseCurve",(function(){return Ol})),n.d(t,"EqualDepth",(function(){return oe})),n.d(t,"EqualStencilFunc",(function(){return Pn})),n.d(t,"EquirectangularReflectionMapping",(function(){return _e})),n.d(t,"EquirectangularRefractionMapping",(function(){return we})),n.d(t,"Euler",(function(){return li})),n.d(t,"EventDispatcher",(function(){return Zn})),n.d(t,"ExtrudeBufferGeometry",(function(){return Ac})),n.d(t,"ExtrudeGeometry",(function(){return Ac})),n.d(t,"FaceColors",(function(){return hp})),n.d(t,"FileLoader",(function(){return xh})),n.d(t,"FlatShading",(function(){return N})),n.d(t,"Float16BufferAttribute",(function(){return no})),n.d(t,"Float32Attribute",(function(){return Np})),n.d(t,"Float32BufferAttribute",(function(){return ro})),n.d(t,"Float64Attribute",(function(){return kp})),n.d(t,"Float64BufferAttribute",(function(){return io})),n.d(t,"FloatType",(function(){return Ve})),n.d(t,"Fog",(function(){return mu})),n.d(t,"FogExp2",(function(){return vu})),n.d(t,"Font",(function(){return sd})),n.d(t,"FontLoader",(function(){return cd})),n.d(t,"FrontSide",(function(){return A})),n.d(t,"Frustum",(function(){return Ko})),n.d(t,"GLBufferAttribute",(function(){return Xd})),n.d(t,"GLSL1",(function(){return Qn})),n.d(t,"GLSL3",(function(){return qn})),n.d(t,"GammaEncoding",(function(){return fn})),n.d(t,"GreaterDepth",(function(){return se})),n.d(t,"GreaterEqualDepth",(function(){return ae})),n.d(t,"GreaterEqualStencilFunc",(function(){return jn})),n.d(t,"GreaterStencilFunc",(function(){return On})),n.d(t,"GridHelper",(function(){return gf})),n.d(t,"Group",(function(){return uu})),n.d(t,"HalfFloatType",(function(){return We})),n.d(t,"HemisphereLight",(function(){return kh})),n.d(t,"HemisphereLightHelper",(function(){return mf})),n.d(t,"HemisphereLightProbe",(function(){return fd})),n.d(t,"IcosahedronBufferGeometry",(function(){return Cc})),n.d(t,"IcosahedronGeometry",(function(){return Cc})),n.d(t,"ImageBitmapLoader",(function(){return od})),n.d(t,"ImageLoader",(function(){return Th})),n.d(t,"ImageUtils",(function(){return fr})),n.d(t,"ImmediateRenderObject",(function(){return of})),n.d(t,"IncrementStencilOp",(function(){return En})),n.d(t,"IncrementWrapStencilOp",(function(){return In})),n.d(t,"InstancedBufferAttribute",(function(){return $h})),n.d(t,"InstancedBufferGeometry",(function(){return Kh})),n.d(t,"InstancedInterleavedBuffer",(function(){return Yd})),n.d(t,"InstancedMesh",(function(){return tl})),n.d(t,"Int16Attribute",(function(){return Ep})),n.d(t,"Int16BufferAttribute",(function(){return Ki})),n.d(t,"Int32Attribute",(function(){return Ip})),n.d(t,"Int32BufferAttribute",(function(){return eo})),n.d(t,"Int8Attribute",(function(){return Tp})),n.d(t,"Int8BufferAttribute",(function(){return qi})),n.d(t,"IntType",(function(){return Ge})),n.d(t,"InterleavedBuffer",(function(){return yu})),n.d(t,"InterleavedBufferAttribute",(function(){return xu})),n.d(t,"Interpolant",(function(){return th})),n.d(t,"InterpolateDiscrete",(function(){return $t})),n.d(t,"InterpolateLinear",(function(){return en})),n.d(t,"InterpolateSmooth",(function(){return tn})),n.d(t,"InvertStencilOp",(function(){return Nn})),n.d(t,"JSONLoader",(function(){return Fp})),n.d(t,"KeepStencilOp",(function(){return Mn})),n.d(t,"KeyframeTrack",(function(){return oh})),n.d(t,"LOD",(function(){return Uu})),n.d(t,"LatheBufferGeometry",(function(){return Nc})),n.d(t,"LatheGeometry",(function(){return Nc})),n.d(t,"Layers",(function(){return ci})),n.d(t,"LensFlare",(function(){return Gp})),n.d(t,"LessDepth",(function(){return re})),n.d(t,"LessEqualDepth",(function(){return ie})),n.d(t,"LessEqualStencilFunc",(function(){return Rn})),n.d(t,"LessStencilFunc",(function(){return Dn})),n.d(t,"Light",(function(){return Nh})),n.d(t,"LightProbe",(function(){return qh})),n.d(t,"Line",(function(){return ul})),n.d(t,"Line3",(function(){return rf})),n.d(t,"LineBasicMaterial",(function(){return nl})),n.d(t,"LineCurve",(function(){return Ql})),n.d(t,"LineCurve3",(function(){return ql})),n.d(t,"LineDashedMaterial",(function(){return Kc})),n.d(t,"LineLoop",(function(){return dl})),n.d(t,"LinePieces",(function(){return lp})),n.d(t,"LineSegments",(function(){return hl})),n.d(t,"LineStrip",(function(){return up})),n.d(t,"LinearEncoding",(function(){return hn})),n.d(t,"LinearFilter",(function(){return Pe})),n.d(t,"LinearInterpolant",(function(){return rh})),n.d(t,"LinearMipMapLinearFilter",(function(){return je})),n.d(t,"LinearMipMapNearestFilter",(function(){return Oe})),n.d(t,"LinearMipmapLinearFilter",(function(){return Le})),n.d(t,"LinearMipmapNearestFilter",(function(){return Re})),n.d(t,"LinearToneMapping",(function(){return fe})),n.d(t,"Loader",(function(){return yh})),n.d(t,"LoaderUtils",(function(){return Jh})),n.d(t,"LoadingManager",(function(){return mh})),n.d(t,"LogLuvEncoding",(function(){return vn})),n.d(t,"LoopOnce",(function(){return Zt})),n.d(t,"LoopPingPong",(function(){return Kt})),n.d(t,"LoopRepeat",(function(){return Jt})),n.d(t,"LuminanceAlphaFormat",(function(){return et})),n.d(t,"LuminanceFormat",(function(){return $e})),n.d(t,"MOUSE",(function(){return o})),n.d(t,"Material",(function(){return ji})),n.d(t,"MaterialLoader",(function(){return Zh})),n.d(t,"Math",(function(){return lr})),n.d(t,"MathUtils",(function(){return lr})),n.d(t,"Matrix3",(function(){return dr})),n.d(t,"Matrix4",(function(){return $r})),n.d(t,"MaxEquation",(function(){return H})),n.d(t,"Mesh",(function(){return Ro})),n.d(t,"MeshBasicMaterial",(function(){return Wi})),n.d(t,"MeshDepthMaterial",(function(){return tu})),n.d(t,"MeshDistanceMaterial",(function(){return nu})),n.d(t,"MeshFaceMaterial",(function(){return fp})),n.d(t,"MeshLambertMaterial",(function(){return Zc})),n.d(t,"MeshMatcapMaterial",(function(){return Jc})),n.d(t,"MeshNormalMaterial",(function(){return qc})),n.d(t,"MeshPhongMaterial",(function(){return Xc})),n.d(t,"MeshPhysicalMaterial",(function(){return Yc})),n.d(t,"MeshStandardMaterial",(function(){return Wc})),n.d(t,"MeshToonMaterial",(function(){return Qc})),n.d(t,"MinEquation",(function(){return G})),n.d(t,"MirroredRepeatWrapping",(function(){return Ae})),n.d(t,"MixOperation",(function(){return ce})),n.d(t,"MultiMaterial",(function(){return pp})),n.d(t,"MultiplyBlending",(function(){return j})),n.d(t,"MultiplyOperation",(function(){return le})),n.d(t,"NearestFilter",(function(){return Ie})),n.d(t,"NearestMipMapLinearFilter",(function(){return De})),n.d(t,"NearestMipMapNearestFilter",(function(){return Ne})),n.d(t,"NearestMipmapLinearFilter",(function(){return ke})),n.d(t,"NearestMipmapNearestFilter",(function(){return Ce})),n.d(t,"NeverDepth",(function(){return te})),n.d(t,"NeverStencilFunc",(function(){return kn})),n.d(t,"NoBlending",(function(){return D})),n.d(t,"NoColors",(function(){return cp})),n.d(t,"NoToneMapping",(function(){return de})),n.d(t,"NormalAnimationBlendMode",(function(){return an})),n.d(t,"NormalBlending",(function(){return P})),n.d(t,"NotEqualDepth",(function(){return ue})),n.d(t,"NotEqualStencilFunc",(function(){return Ln})),n.d(t,"NumberKeyframeTrack",(function(){return uh})),n.d(t,"Object3D",(function(){return Mi})),n.d(t,"ObjectLoader",(function(){return td})),n.d(t,"ObjectSpaceNormalMap",(function(){return wn})),n.d(t,"OctahedronBufferGeometry",(function(){return kc})),n.d(t,"OctahedronGeometry",(function(){return kc})),n.d(t,"OneFactor",(function(){return W})),n.d(t,"OneMinusDstAlphaFactor",(function(){return J})),n.d(t,"OneMinusDstColorFactor",(function(){return $})),n.d(t,"OneMinusSrcAlphaFactor",(function(){return q})),n.d(t,"OneMinusSrcColorFactor",(function(){return X})),n.d(t,"OrthographicCamera",(function(){return Hh})),n.d(t,"PCFShadowMap",(function(){return w})),n.d(t,"PCFSoftShadowMap",(function(){return M})),n.d(t,"PMREMGenerator",(function(){return np})),n.d(t,"ParametricBufferGeometry",(function(){return Dc})),n.d(t,"ParametricGeometry",(function(){return Dc})),n.d(t,"Particle",(function(){return mp})),n.d(t,"ParticleBasicMaterial",(function(){return bp})),n.d(t,"ParticleSystem",(function(){return gp})),n.d(t,"ParticleSystemMaterial",(function(){return xp})),n.d(t,"Path",(function(){return Ih})),n.d(t,"PerspectiveCamera",(function(){return Go})),n.d(t,"Plane",(function(){return qo})),n.d(t,"PlaneBufferGeometry",(function(){return ta})),n.d(t,"PlaneGeometry",(function(){return ta})),n.d(t,"PlaneHelper",(function(){return Df})),n.d(t,"PointCloud",(function(){return vp})),n.d(t,"PointCloudMaterial",(function(){return yp})),n.d(t,"PointLight",(function(){return Gh})),n.d(t,"PointLightHelper",(function(){return df})),n.d(t,"Points",(function(){return yl})),n.d(t,"PointsMaterial",(function(){return fl})),n.d(t,"PolarGridHelper",(function(){return yf})),n.d(t,"PolyhedronBufferGeometry",(function(){return Al})),n.d(t,"PolyhedronGeometry",(function(){return Al})),n.d(t,"PositionalAudio",(function(){return Nd})),n.d(t,"PropertyBinding",(function(){return zd})),n.d(t,"PropertyMixer",(function(){return Dd})),n.d(t,"QuadraticBezierCurve",(function(){return Zl})),n.d(t,"QuadraticBezierCurve3",(function(){return Jl})),n.d(t,"Quaternion",(function(){return _r})),n.d(t,"QuaternionKeyframeTrack",(function(){return ch})),n.d(t,"QuaternionLinearInterpolant",(function(){return lh})),n.d(t,"REVISION",(function(){return i})),n.d(t,"RGBADepthPacking",(function(){return xn})),n.d(t,"RGBAFormat",(function(){return Ke})),n.d(t,"RGBAIntegerFormat",(function(){return lt})),n.d(t,"RGBA_ASTC_10x10_Format",(function(){return Dt})),n.d(t,"RGBA_ASTC_10x5_Format",(function(){return Ct})),n.d(t,"RGBA_ASTC_10x6_Format",(function(){return Nt})),n.d(t,"RGBA_ASTC_10x8_Format",(function(){return kt})),n.d(t,"RGBA_ASTC_12x10_Format",(function(){return Pt})),n.d(t,"RGBA_ASTC_12x12_Format",(function(){return Rt})),n.d(t,"RGBA_ASTC_4x4_Format",(function(){return _t})),n.d(t,"RGBA_ASTC_5x4_Format",(function(){return wt})),n.d(t,"RGBA_ASTC_5x5_Format",(function(){return Tt})),n.d(t,"RGBA_ASTC_6x5_Format",(function(){return Mt})),n.d(t,"RGBA_ASTC_6x6_Format",(function(){return St})),n.d(t,"RGBA_ASTC_8x5_Format",(function(){return Et})),n.d(t,"RGBA_ASTC_8x6_Format",(function(){return At})),n.d(t,"RGBA_ASTC_8x8_Format",(function(){return It})),n.d(t,"RGBA_BPTC_Format",(function(){return Ot})),n.d(t,"RGBA_ETC2_EAC_Format",(function(){return xt})),n.d(t,"RGBA_PVRTC_2BPPV1_Format",(function(){return gt})),n.d(t,"RGBA_PVRTC_4BPPV1_Format",(function(){return mt})),n.d(t,"RGBA_S3TC_DXT1_Format",(function(){return ht})),n.d(t,"RGBA_S3TC_DXT3_Format",(function(){return dt})),n.d(t,"RGBA_S3TC_DXT5_Format",(function(){return ft})),n.d(t,"RGBDEncoding",(function(){return yn})),n.d(t,"RGBEEncoding",(function(){return pn})),n.d(t,"RGBEFormat",(function(){return tt})),n.d(t,"RGBFormat",(function(){return Je})),n.d(t,"RGBIntegerFormat",(function(){return ut})),n.d(t,"RGBM16Encoding",(function(){return gn})),n.d(t,"RGBM7Encoding",(function(){return mn})),n.d(t,"RGB_ETC1_Format",(function(){return yt})),n.d(t,"RGB_ETC2_Format",(function(){return bt})),n.d(t,"RGB_PVRTC_2BPPV1_Format",(function(){return vt})),n.d(t,"RGB_PVRTC_4BPPV1_Format",(function(){return pt})),n.d(t,"RGB_S3TC_DXT1_Format",(function(){return ct})),n.d(t,"RGFormat",(function(){return at})),n.d(t,"RGIntegerFormat",(function(){return st})),n.d(t,"RawShaderMaterial",(function(){return Vc})),n.d(t,"Ray",(function(){return Kr})),n.d(t,"Raycaster",(function(){return Qd})),n.d(t,"RectAreaLight",(function(){return Xh})),n.d(t,"RedFormat",(function(){return it})),n.d(t,"RedIntegerFormat",(function(){return ot})),n.d(t,"ReinhardToneMapping",(function(){return pe})),n.d(t,"RepeatWrapping",(function(){return Se})),n.d(t,"ReplaceStencilOp",(function(){return Sn})),n.d(t,"ReverseSubtractEquation",(function(){return z})),n.d(t,"RingBufferGeometry",(function(){return Pc})),n.d(t,"RingGeometry",(function(){return Pc})),n.d(t,"SRGB8_ALPHA8_ASTC_10x10_Format",(function(){return Xt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x5_Format",(function(){return Vt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x6_Format",(function(){return Wt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x8_Format",(function(){return Yt})),n.d(t,"SRGB8_ALPHA8_ASTC_12x10_Format",(function(){return Qt})),n.d(t,"SRGB8_ALPHA8_ASTC_12x12_Format",(function(){return qt})),n.d(t,"SRGB8_ALPHA8_ASTC_4x4_Format",(function(){return Lt})),n.d(t,"SRGB8_ALPHA8_ASTC_5x4_Format",(function(){return jt})),n.d(t,"SRGB8_ALPHA8_ASTC_5x5_Format",(function(){return Bt})),n.d(t,"SRGB8_ALPHA8_ASTC_6x5_Format",(function(){return Ut})),n.d(t,"SRGB8_ALPHA8_ASTC_6x6_Format",(function(){return Ft})),n.d(t,"SRGB8_ALPHA8_ASTC_8x5_Format",(function(){return zt})),n.d(t,"SRGB8_ALPHA8_ASTC_8x6_Format",(function(){return Gt})),n.d(t,"SRGB8_ALPHA8_ASTC_8x8_Format",(function(){return Ht})),n.d(t,"Scene",(function(){return gu})),n.d(t,"SceneUtils",(function(){return zp})),n.d(t,"ShaderChunk",(function(){return na})),n.d(t,"ShaderLib",(function(){return ia})),n.d(t,"ShaderMaterial",(function(){return Fo})),n.d(t,"ShadowMaterial",(function(){return Hc})),n.d(t,"Shape",(function(){return Ch})),n.d(t,"ShapeBufferGeometry",(function(){return Rc})),n.d(t,"ShapeGeometry",(function(){return Rc})),n.d(t,"ShapePath",(function(){return ad})),n.d(t,"ShapeUtils",(function(){return Mc})),n.d(t,"ShortType",(function(){return Fe})),n.d(t,"Skeleton",(function(){return Zu})),n.d(t,"SkeletonHelper",(function(){return hf})),n.d(t,"SkinnedMesh",(function(){return Wu})),n.d(t,"SmoothShading",(function(){return k})),n.d(t,"Sphere",(function(){return Vr})),n.d(t,"SphereBufferGeometry",(function(){return Oc})),n.d(t,"SphereGeometry",(function(){return Oc})),n.d(t,"Spherical",(function(){return Jd})),n.d(t,"SphericalHarmonics3",(function(){return Qh})),n.d(t,"SplineCurve",(function(){return Kl})),n.d(t,"SpotLight",(function(){return jh})),n.d(t,"SpotLightHelper",(function(){return sf})),n.d(t,"Sprite",(function(){return Ou})),n.d(t,"SpriteMaterial",(function(){return wu})),n.d(t,"SrcAlphaFactor",(function(){return Q})),n.d(t,"SrcAlphaSaturateFactor",(function(){return ee})),n.d(t,"SrcColorFactor",(function(){return Y})),n.d(t,"StaticCopyUsage",(function(){return Wn})),n.d(t,"StaticDrawUsage",(function(){return Un})),n.d(t,"StaticReadUsage",(function(){return Gn})),n.d(t,"StereoCamera",(function(){return gd})),n.d(t,"StreamCopyUsage",(function(){return Xn})),n.d(t,"StreamDrawUsage",(function(){return zn})),n.d(t,"StreamReadUsage",(function(){return Vn})),n.d(t,"StringKeyframeTrack",(function(){return hh})),n.d(t,"SubtractEquation",(function(){return F})),n.d(t,"SubtractiveBlending",(function(){return L})),n.d(t,"TOUCH",(function(){return a})),n.d(t,"TangentSpaceNormalMap",(function(){return _n})),n.d(t,"TetrahedronBufferGeometry",(function(){return Lc})),n.d(t,"TetrahedronGeometry",(function(){return Lc})),n.d(t,"TextBufferGeometry",(function(){return jc})),n.d(t,"TextGeometry",(function(){return jc})),n.d(t,"Texture",(function(){return vr})),n.d(t,"TextureLoader",(function(){return Eh})),n.d(t,"TorusBufferGeometry",(function(){return Bc})),n.d(t,"TorusGeometry",(function(){return Bc})),n.d(t,"TorusKnotBufferGeometry",(function(){return Uc})),n.d(t,"TorusKnotGeometry",(function(){return Uc})),n.d(t,"Triangle",(function(){return Oi})),n.d(t,"TriangleFanDrawMode",(function(){return cn})),n.d(t,"TriangleStripDrawMode",(function(){return ln})),n.d(t,"TrianglesDrawMode",(function(){return un})),n.d(t,"TubeBufferGeometry",(function(){return Fc})),n.d(t,"TubeGeometry",(function(){return Fc})),n.d(t,"UVMapping",(function(){return ye})),n.d(t,"Uint16Attribute",(function(){return Ap})),n.d(t,"Uint16BufferAttribute",(function(){return $i})),n.d(t,"Uint32Attribute",(function(){return Cp})),n.d(t,"Uint32BufferAttribute",(function(){return to})),n.d(t,"Uint8Attribute",(function(){return Mp})),n.d(t,"Uint8BufferAttribute",(function(){return Zi})),n.d(t,"Uint8ClampedAttribute",(function(){return Sp})),n.d(t,"Uint8ClampedBufferAttribute",(function(){return Ji})),n.d(t,"Uniform",(function(){return Wd})),n.d(t,"UniformsLib",(function(){return ra})),n.d(t,"UniformsUtils",(function(){return Uo})),n.d(t,"UnsignedByteType",(function(){return Be})),n.d(t,"UnsignedInt248Type",(function(){return qe})),n.d(t,"UnsignedIntType",(function(){return He})),n.d(t,"UnsignedShort4444Type",(function(){return Ye})),n.d(t,"UnsignedShort5551Type",(function(){return Xe})),n.d(t,"UnsignedShort565Type",(function(){return Qe})),n.d(t,"UnsignedShortType",(function(){return ze})),n.d(t,"VSMShadowMap",(function(){return E})),n.d(t,"Vector2",(function(){return cr})),n.d(t,"Vector3",(function(){return wr})),n.d(t,"Vector4",(function(){return gr})),n.d(t,"VectorKeyframeTrack",(function(){return dh})),n.d(t,"Vertex",(function(){return _p})),n.d(t,"VertexColors",(function(){return dp})),n.d(t,"VideoTexture",(function(){return xl})),n.d(t,"WebGL1Renderer",(function(){return pu})),n.d(t,"WebGLCubeRenderTarget",(function(){return Wo})),n.d(t,"WebGLMultipleRenderTargets",(function(){return br})),n.d(t,"WebGLMultisampleRenderTarget",(function(){return xr})),n.d(t,"WebGLRenderTarget",(function(){return yr})),n.d(t,"WebGLRenderTargetCube",(function(){return Bp})),n.d(t,"WebGLRenderer",(function(){return fu})),n.d(t,"WebGLUtils",(function(){return au})),n.d(t,"WireframeGeometry",(function(){return zc})),n.d(t,"WireframeHelper",(function(){return Op})),n.d(t,"WrapAroundEnding",(function(){return on})),n.d(t,"XHRLoader",(function(){return Lp})),n.d(t,"ZeroCurvatureEnding",(function(){return nn})),n.d(t,"ZeroFactor",(function(){return V})),n.d(t,"ZeroSlopeEnding",(function(){return rn})),n.d(t,"ZeroStencilOp",(function(){return Tn})),n.d(t,"sRGBEncoding",(function(){return dn}));for( +/** + * @license + * Copyright 2010-2021 Three.js Authors + * SPDX-License-Identifier: MIT + */ +var i="130",o={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},a={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},s=0,h=1,d=2,v=3,b=0,w=1,M=2,E=3,A=0,I=1,C=2,N=1,k=2,D=0,P=1,R=2,L=3,j=4,B=5,U=100,F=101,z=102,G=103,H=104,V=200,W=201,Y=202,X=203,Q=204,q=205,Z=206,J=207,K=208,$=209,ee=210,te=0,ne=1,re=2,ie=3,oe=4,ae=5,se=6,ue=7,le=0,ce=1,he=2,de=0,fe=1,pe=2,ve=3,me=4,ge=5,ye=300,be=301,xe=302,_e=303,we=304,Te=306,Me=307,Se=1e3,Ee=1001,Ae=1002,Ie=1003,Ce=1004,Ne=1004,ke=1005,De=1005,Pe=1006,Re=1007,Oe=1007,Le=1008,je=1008,Be=1009,Ue=1010,Fe=1011,ze=1012,Ge=1013,He=1014,Ve=1015,We=1016,Ye=1017,Xe=1018,Qe=1019,qe=1020,Ze=1021,Je=1022,Ke=1023,$e=1024,et=1025,tt=Ke,nt=1026,rt=1027,it=1028,ot=1029,at=1030,st=1031,ut=1032,lt=1033,ct=33776,ht=33777,dt=33778,ft=33779,pt=35840,vt=35841,mt=35842,gt=35843,yt=36196,bt=37492,xt=37496,_t=37808,wt=37809,Tt=37810,Mt=37811,St=37812,Et=37813,At=37814,It=37815,Ct=37816,Nt=37817,kt=37818,Dt=37819,Pt=37820,Rt=37821,Ot=36492,Lt=37840,jt=37841,Bt=37842,Ut=37843,Ft=37844,zt=37845,Gt=37846,Ht=37847,Vt=37848,Wt=37849,Yt=37850,Xt=37851,Qt=37852,qt=37853,Zt=2200,Jt=2201,Kt=2202,$t=2300,en=2301,tn=2302,nn=2400,rn=2401,on=2402,an=2500,sn=2501,un=0,ln=1,cn=2,hn=3e3,dn=3001,fn=3007,pn=3002,vn=3003,mn=3004,gn=3005,yn=3006,bn=3200,xn=3201,_n=0,wn=1,Tn=0,Mn=7680,Sn=7681,En=7682,An=7683,In=34055,Cn=34056,Nn=5386,kn=512,Dn=513,Pn=514,Rn=515,On=516,Ln=517,jn=518,Bn=519,Un=35044,Fn=35048,zn=35040,Gn=35045,Hn=35049,Vn=35041,Wn=35046,Yn=35050,Xn=35042,Qn="100",qn="300 es",Zn=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]+Jn[e>>16&255]+Jn[e>>24&255]+"-"+Jn[255&t]+Jn[t>>8&255]+"-"+Jn[t>>16&15|64]+Jn[t>>24&255]+"-"+Jn[63&n|128]+Jn[n>>8&255]+"-"+Jn[n>>16&255]+Jn[n>>24&255]+Jn[255&r]+Jn[r>>8&255]+Jn[r>>16&255]+Jn[r>>24&255]).toUpperCase()}function rr(e,t,n){return Math.max(t,Math.min(n,e))}function ir(e,t){return(e%t+t)%t}function or(e,t,n){return(1-n)*e+n*t}function ar(e){return 0==(e&e-1)&&0!==e}function sr(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function ur(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var lr=Object.freeze({__proto__:null,DEG2RAD:er,RAD2DEG:tr,generateUUID:nr,clamp:rr,euclideanModulo:ir,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:or,damp:function(e,t,n,r){return or(e,t,1-Math.exp(-n*r))},pingpong:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(ir(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&($n=e%2147483647),(($n=16807*$n%2147483647)-1)/2147483646},degToRad:function(e){return e*er},radToDeg:function(e){return e*tr},isPowerOfTwo:ar,ceilPowerOfTwo:sr,floorPowerOfTwo:ur,setQuaternionFromProperEuler:function(e,t,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),u=a(n/2),l=o((t+r)/2),c=a((t+r)/2),h=o((t-r)/2),d=a((t-r)/2),f=o((r-t)/2),p=a((r-t)/2);switch(i){case"XYX":e.set(s*c,u*h,u*d,s*l);break;case"YZY":e.set(u*d,s*c,u*h,s*l);break;case"ZXZ":e.set(u*h,u*d,s*c,s*l);break;case"XZX":e.set(s*c,u*p,u*f,s*l);break;case"YXY":e.set(u*f,s*c,u*p,s*l);break;case"ZYZ":e.set(u*p,u*f,s*c,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}}),cr=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}();cr.prototype.isVector2=!0;var hr,dr=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}();dr.prototype.isMatrix3=!0;var fr=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===hr&&(hr=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),hr.width=e.width,hr.height=e.height;var n=hr.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=hr}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}(),pr=0,vr=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]:Ee,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ee,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Pe,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Le,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Ke,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Be,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:hn;return _(this,n),e=t.call(this),Object.defineProperty(y(e),"id",{value:pr++}),e.uuid=nr(),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 cr(0,0),e.repeat=new cr(1,1),e.center=new cr(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new dr,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=nr()),!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 Se:e.x=e.x-Math.floor(e.x);break;case Ee:e.x=e.x<0?0:1;break;case Ae: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 Se:e.y=e.y-Math.floor(e.y);break;case Ee:e.y=e.y<0?0:1;break;case Ae: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}(Zn);function mr(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?fr.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."),{})}vr.DEFAULT_IMAGE=void 0,vr.DEFAULT_MAPPING=ye,vr.prototype.isTexture=!0;var gr=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}();gr.prototype.isVector4=!0;var yr=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 gr(0,0,e,r),i.scissorTest=!1,i.viewport=new gr(0,0,e,r),i.texture=new vr(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:Pe,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=O({},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}(Zn);yr.prototype.isWebGLRenderTarget=!0;var br=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(rr(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}();_r.prototype.isQuaternion=!0;var wr=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(Mr.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(Mr.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 Tr.copy(this).projectOnVector(e),this.sub(Tr)}},{key:"reflect",value:function(e){return this.sub(Tr.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(rr(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}();wr.prototype.isVector3=!0;var Tr=new wr,Mr=new _r,Sr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr(1/0,1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wr(-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,Ar),Ar.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(Or),Lr.subVectors(this.max,Or),Cr.subVectors(e.a,Or),Nr.subVectors(e.b,Or),kr.subVectors(e.c,Or),Dr.subVectors(Nr,Cr),Pr.subVectors(kr,Nr),Rr.subVectors(Cr,kr);var t=[0,-Dr.z,Dr.y,0,-Pr.z,Pr.y,0,-Rr.z,Rr.y,Dr.z,0,-Dr.x,Pr.z,0,-Pr.x,Rr.z,0,-Rr.x,-Dr.y,Dr.x,0,-Pr.y,Pr.x,0,-Rr.y,Rr.x,0];return!!Ur(t,Cr,Nr,kr,Lr)&&(!!Ur(t=[1,0,0,0,1,0,0,0,1],Cr,Nr,kr,Lr)&&(jr.crossVectors(Dr,Pr),Ur(t=[jr.x,jr.y,jr.z],Cr,Nr,kr,Lr)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return Ar.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(Ar).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()||(Er[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Er[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Er[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Er[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Er[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Er[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Er[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Er[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Er)),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}();Sr.prototype.isBox3=!0;var Er=[new wr,new wr,new wr,new wr,new wr,new wr,new wr,new wr],Ar=new wr,Ir=new Sr,Cr=new wr,Nr=new wr,kr=new wr,Dr=new wr,Pr=new wr,Rr=new wr,Or=new wr,Lr=new wr,jr=new wr,Br=new wr;function Ur(e,t,n,r,i){for(var o=0,a=e.length-3;o<=a;o+=3){Br.fromArray(e,o);var s=i.x*Math.abs(Br.x)+i.y*Math.abs(Br.y)+i.z*Math.abs(Br.z),u=t.dot(Br),l=n.dot(Br),c=r.dot(Br);if(Math.max(-Math.max(u,l,c),Math.min(u,l,c))>s)return!1}return!0}var Fr=new Sr,zr=new wr,Gr=new wr,Hr=new wr,Vr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr,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):Fr.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){Hr.subVectors(e,this.center);var t=Hr.lengthSq();if(t>this.radius*this.radius){var n=Math.sqrt(t),r=.5*(n-this.radius);this.center.add(Hr.multiplyScalar(r/n)),this.radius+=r}return this}},{key:"union",value:function(e){return Gr.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(zr.copy(e.center).add(Gr)),this.expandByPoint(zr.copy(e.center).sub(Gr)),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}(),Wr=new wr,Yr=new wr,Xr=new wr,Qr=new wr,qr=new wr,Zr=new wr,Jr=new wr,Kr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wr(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,Wr)),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=Wr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Wr.copy(this.direction).multiplyScalar(t).add(this.origin),Wr.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,n,r){Yr.copy(e).add(t).multiplyScalar(.5),Xr.copy(t).sub(e).normalize(),Qr.copy(this.origin).sub(Yr);var i,o,a,s,u=.5*e.distanceTo(t),l=-this.direction.dot(Xr),c=Qr.dot(this.direction),h=-Qr.dot(Xr),d=Qr.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(Xr).multiplyScalar(o).add(Yr),a}},{key:"intersectSphere",value:function(e,t){Wr.subVectors(e.center,this.origin);var n=Wr.dot(this.direction),r=Wr.dot(Wr)-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,Wr)}},{key:"intersectTriangle",value:function(e,t,n,r,i){qr.subVectors(t,e),Zr.subVectors(n,e),Jr.crossVectors(qr,Zr);var o,a=this.direction.dot(Jr);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Qr.subVectors(this.origin,e);var s=o*this.direction.dot(Zr.crossVectors(Qr,Zr));if(s<0)return null;var u=o*this.direction.dot(qr.cross(Qr));if(u<0)return null;if(s+u>a)return null;var l=-o*Qr.dot(Jr);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}(),$r=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/ei.setFromMatrixColumn(e,0).length(),i=1/ei.setFromMatrixColumn(e,1).length(),o=1/ei.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,R=a*u;t[0]=s*l,t[4]=-c,t[8]=u*l,t[1]=k*c+R,t[5]=o*l,t[9]=D*c-P,t[2]=P*c-D,t[6]=a*l,t[10]=R*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(ni,e,ri)}},{key:"lookAt",value:function(e,t,n){var r=this.elements;return ai.subVectors(e,t),0===ai.lengthSq()&&(ai.z=1),ai.normalize(),ii.crossVectors(n,ai),0===ii.lengthSq()&&(1===Math.abs(n.z)?ai.x+=1e-4:ai.z+=1e-4,ai.normalize(),ii.crossVectors(n,ai)),ii.normalize(),oi.crossVectors(ai,ii),r[0]=ii.x,r[4]=oi.x,r[8]=ai.x,r[1]=ii.y,r[5]=oi.y,r[9]=ai.y,r[2]=ii.z,r[6]=oi.z,r[10]=ai.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],R=r[7],O=r[11],L=r[15];return i[0]=o*_+a*S+s*C+u*P,i[4]=o*w+a*E+s*N+u*R,i[8]=o*T+a*A+s*k+u*O,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*R,i[9]=l*T+c*A+h*k+d*O,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*R,i[10]=f*T+p*A+v*k+m*O,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*R,i[11]=g*T+y*A+b*k+x*O,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=ei.set(r[0],r[1],r[2]).length(),o=ei.set(r[4],r[5],r[6]).length(),a=ei.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],ti.copy(this);var s=1/i,u=1/o,l=1/a;return ti.elements[0]*=s,ti.elements[1]*=s,ti.elements[2]*=s,ti.elements[4]*=u,ti.elements[5]*=u,ti.elements[6]*=u,ti.elements[8]*=l,ti.elements[9]*=l,ti.elements[10]*=l,t.setFromRotationMatrix(ti),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}();$r.prototype.isMatrix4=!0;var ei=new wr,ti=new $r,ni=new wr(0,0,0),ri=new wr(1,1,1),ii=new wr,oi=new wr,ai=new wr,si=new $r,ui=new _r,li=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(rr(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(-rr(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(rr(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(-rr(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(rr(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(-rr(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 si.makeRotationFromQuaternion(e),this.setFromRotationMatrix(si,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 ui.setFromEuler(this),this.setFromQuaternion(ui,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 wr(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}();li.prototype.isEuler=!0,li.DefaultOrder="XYZ",li.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var ci=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 wr,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wr,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new wr;_(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 Si.subVectors(this.c,this.b),Ei.subVectors(this.a,this.b),.5*Si.cross(Ei).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;Ci.subVectors(o,i),Ni.subVectors(a,i),Di.subVectors(e,i);var s=Ci.dot(Di),u=Ni.dot(Di);if(s<=0&&u<=0)return t.copy(i);Pi.subVectors(e,o);var l=Ci.dot(Pi),c=Ni.dot(Pi);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(Ci,n);Ri.subVectors(e,a);var d=Ci.dot(Ri),f=Ni.dot(Ri);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(Ni,r);var v=l*f-d*c;if(v<=0&&c-l>=0&&d-f>=0)return ki.subVectors(a,o),r=(c-l)/(c-l+(d-f)),t.copy(o).addScaledVector(ki,r);var m=1/(v+p+h);return n=p*m,r=h*m,t.copy(i).addScaledVector(Ci,n).addScaledVector(Ni,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),Si.subVectors(e,t),r.cross(Si);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){Si.subVectors(r,t),Ei.subVectors(n,t),Ai.subVectors(e,t);var o=Si.dot(Si),a=Si.dot(Ei),s=Si.dot(Ai),u=Ei.dot(Ei),l=Ei.dot(Ai),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,Ii),Ii.x>=0&&Ii.y>=0&&Ii.x+Ii.y<=1}},{key:"getUV",value:function(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,Ii),s.set(0,0),s.addScaledVector(i,Ii.x),s.addScaledVector(o,Ii.y),s.addScaledVector(a,Ii.z),s}},{key:"isFrontFacing",value:function(e,t,n,r){return Si.subVectors(n,t),Ei.subVectors(e,t),Si.cross(Ei).dot(r)<0}}]),e}(),Li=0,ji=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:Li++}),e.uuid=nr(),e.name="",e.type="Material",e.fog=!0,e.blending=P,e.side=A,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.blendSrc=Q,e.blendDst=q,e.blendEquation=U,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.depthFunc=ie,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=Bn,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=Mn,e.stencilZFail=Mn,e.stencilZPass=Mn,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=n===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),this.blending!==P&&(n.blending=this.blending),this.side!==A&&(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}(Zn);ji.prototype.isMaterial=!0;var Bi={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},Ui={h:0,s:0,l:0},Fi={h:0,s:0,l:0};function zi(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 Gi(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Hi(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Vi=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=ir(e,1),t=rr(t,0,1),n=rr(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=zi(i,r,e+1/3),this.g=zi(i,r,e),this.b=zi(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=Bi[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=Gi(e.r),this.g=Gi(e.g),this.b=Gi(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Hi(e.r),this.g=Hi(e.g),this.b=Hi(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}();Vi.NAMES=Bi,Vi.prototype.isColor=!0,Vi.prototype.r=1,Vi.prototype.g=1,Vi.prototype.b=1;var Wi=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 Vi(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=le,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}(ji);Wi.prototype.isMeshBasicMaterial=!0;var Yi=new wr,Xi=new cr,Qi=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=Un,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),this.usage!==Un&&(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}();Qi.prototype.isBufferAttribute=!0;var qi=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Int8Array(e),r,i)}return n}(Qi),Zi=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Uint8Array(e),r,i)}return n}(Qi),Ji=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Uint8ClampedArray(e),r,i)}return n}(Qi),Ki=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Int16Array(e),r,i)}return n}(Qi),$i=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}(Qi),eo=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}(Qi),to=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}(Qi),no=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}(Qi);no.prototype.isFloat16BufferAttribute=!0;var ro=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}(Qi),io=function(e){p(n,e);var t=m(n);function n(e,r,i){return _(this,n),t.call(this,new Float64Array(e),r,i)}return n}(Qi);function oo(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 ao={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function so(e,t){return new ao[e](t)}var uo=0,lo=new $r,co=new Mi,ho=new wr,fo=new Sr,po=new Sr,vo=new wr,mo=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:uo++}),e.uuid=nr(),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(oo(e)>65535?to:$i)(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 dr).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 lo.makeRotationFromQuaternion(e),this.applyMatrix4(lo),this}},{key:"rotateX",value:function(e){return lo.makeRotationX(e),this.applyMatrix4(lo),this}},{key:"rotateY",value:function(e){return lo.makeRotationY(e),this.applyMatrix4(lo),this}},{key:"rotateZ",value:function(e){return lo.makeRotationZ(e),this.applyMatrix4(lo),this}},{key:"translate",value:function(e,t,n){return lo.makeTranslation(e,t,n),this.applyMatrix4(lo),this}},{key:"scale",value:function(e,t,n){return lo.makeScale(e,t,n),this.applyMatrix4(lo),this}},{key:"lookAt",value:function(e){return co.lookAt(e),co.updateMatrix(),this.applyMatrix4(co.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ho).negate(),this.translate(ho.x,ho.y,ho.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 mo,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wi;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(),bo.copy(r.boundingSphere),bo.applyMatrix4(o),!1!==e.ray.intersectsSphere(bo)&&(go.copy(o).invert(),yo.copy(e.ray).applyMatrix4(go),null===r.boundingBox||!1!==yo.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:Po.clone(),object:e}}(e,t,n,r,xo,_o,wo,Do);if(g){s&&(Co.fromBufferAttribute(s,l),No.fromBufferAttribute(s,c),ko.fromBufferAttribute(s,h),g.uv=Oi.getUV(Do,xo,_o,wo,Co,No,ko,new cr)),u&&(Co.fromBufferAttribute(u,l),No.fromBufferAttribute(u,c),ko.fromBufferAttribute(u,h),g.uv2=Oi.getUV(Do,xo,_o,wo,Co,No,ko,new cr));var y={a:l,b:c,c:h,normal:new wr,materialIndex:0};Oi.getNormal(xo,_o,wo,y.normal),g.face=y}return g}Ro.prototype.isMesh=!0;var Lo=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 wr,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}(ji);Fo.prototype.isShaderMaterial=!0;var zo=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 $r,e.projectionMatrix=new $r,e.projectionMatrixInverse=new $r,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}(Mi);zo.prototype.isCamera=!0;var Go=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*tr*Math.atan(t),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*er*this.fov);return.5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*tr*Math.atan(Math.tan(.5*er*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*er*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}(zo);Go.prototype.isPerspectiveCamera=!0;var Ho=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 Go(90,1,e,r);a.layers=o.layers,a.up.set(0,-1,0),a.lookAt(new wr(1,0,0)),o.add(a);var s=new Go(90,1,e,r);s.layers=o.layers,s.up.set(0,-1,0),s.lookAt(new wr(-1,0,0)),o.add(s);var u=new Go(90,1,e,r);u.layers=o.layers,u.up.set(0,0,1),u.lookAt(new wr(0,1,0)),o.add(u);var l=new Go(90,1,e,r);l.layers=o.layers,l.up.set(0,0,-1),l.lookAt(new wr(0,-1,0)),o.add(l);var c=new Go(90,1,e,r);c.layers=o.layers,c.up.set(0,-1,0),c.lookAt(new wr(0,0,1)),o.add(c);var h=new Go(90,1,e,r);return h.layers=o.layers,h.up.set(0,-1,0),h.lookAt(new wr(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}(Mi),Vo=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:be,i,o,a,s,u=void 0!==u?u:Je,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}(vr);Vo.prototype.isCubeTexture=!0;var Wo=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 Vo(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:Pe,o.texture._needsFlipEnvMap=!1,o}return T(n,[{key:"fromEquirectangularTexture",value:function(e,t){this.texture.type=t.type,this.texture.format=Ke,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 Lo(5,5,5),a=new Fo({name:"CubemapFromEquirect",uniforms:jo(n),vertexShader:r,fragmentShader:i,side:I,blending:D});a.uniforms.tEquirect.value=t;var s=new Ro(o,a),u=t.minFilter;return t.minFilter===Le&&(t.minFilter=Pe),new Ho(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}(yr);Wo.prototype.isWebGLCubeRenderTarget=!0;var Yo=new wr,Xo=new wr,Qo=new dr,qo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr(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=Yo.subVectors(n,t).cross(Xo.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(Yo),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||Qo.getNormalMatrix(e),r=this.coplanarPoint(Yo).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}();qo.prototype.isPlane=!0;var Zo=new Vr,Jo=new wr,Ko=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new qo,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qo,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new qo,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new qo,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new qo,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new qo;_(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(),Zo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Zo)}},{key:"intersectsSprite",value:function(e){return Zo.center.set(0,0,0),Zo.radius=.7071067811865476,Zo.applyMatrix4(e.matrixWorld),this.intersectsSphere(Zo)}},{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,Jo.y=r.normal.y>0?e.max.y:e.min.y,Jo.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Jo)<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 $o(){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 ea(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}"},ra={common:{diffuse:{value:new Vi(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new dr},uv2Transform:{value:new dr},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 cr(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 Vi(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 Vi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new dr}},sprite:{diffuse:{value:new Vi(16777215)},opacity:{value:1},center:{value:new cr(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new dr}}},ia={basic:{uniforms:Bo([ra.common,ra.specularmap,ra.envmap,ra.aomap,ra.lightmap,ra.fog]),vertexShader:na.meshbasic_vert,fragmentShader:na.meshbasic_frag},lambert:{uniforms:Bo([ra.common,ra.specularmap,ra.envmap,ra.aomap,ra.lightmap,ra.emissivemap,ra.fog,ra.lights,{emissive:{value:new Vi(0)}}]),vertexShader:na.meshlambert_vert,fragmentShader:na.meshlambert_frag},phong:{uniforms:Bo([ra.common,ra.specularmap,ra.envmap,ra.aomap,ra.lightmap,ra.emissivemap,ra.bumpmap,ra.normalmap,ra.displacementmap,ra.fog,ra.lights,{emissive:{value:new Vi(0)},specular:{value:new Vi(1118481)},shininess:{value:30}}]),vertexShader:na.meshphong_vert,fragmentShader:na.meshphong_frag},standard:{uniforms:Bo([ra.common,ra.envmap,ra.aomap,ra.lightmap,ra.emissivemap,ra.bumpmap,ra.normalmap,ra.displacementmap,ra.roughnessmap,ra.metalnessmap,ra.fog,ra.lights,{emissive:{value:new Vi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:na.meshphysical_vert,fragmentShader:na.meshphysical_frag},toon:{uniforms:Bo([ra.common,ra.aomap,ra.lightmap,ra.emissivemap,ra.bumpmap,ra.normalmap,ra.displacementmap,ra.gradientmap,ra.fog,ra.lights,{emissive:{value:new Vi(0)}}]),vertexShader:na.meshtoon_vert,fragmentShader:na.meshtoon_frag},matcap:{uniforms:Bo([ra.common,ra.bumpmap,ra.normalmap,ra.displacementmap,ra.fog,{matcap:{value:null}}]),vertexShader:na.meshmatcap_vert,fragmentShader:na.meshmatcap_frag},points:{uniforms:Bo([ra.points,ra.fog]),vertexShader:na.points_vert,fragmentShader:na.points_frag},dashed:{uniforms:Bo([ra.common,ra.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:na.linedashed_vert,fragmentShader:na.linedashed_frag},depth:{uniforms:Bo([ra.common,ra.displacementmap]),vertexShader:na.depth_vert,fragmentShader:na.depth_frag},normal:{uniforms:Bo([ra.common,ra.bumpmap,ra.normalmap,ra.displacementmap,{opacity:{value:1}}]),vertexShader:na.normal_vert,fragmentShader:na.normal_frag},sprite:{uniforms:Bo([ra.sprite,ra.fog]),vertexShader:na.sprite_vert,fragmentShader:na.sprite_frag},background:{uniforms:{uvTransform:{value:new dr},t2D:{value:null}},vertexShader:na.background_vert,fragmentShader:na.background_frag},cube:{uniforms:Bo([ra.envmap,{opacity:{value:1}}]),vertexShader:na.cube_vert,fragmentShader:na.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:na.equirect_vert,fragmentShader:na.equirect_frag},distanceRGBA:{uniforms:Bo([ra.common,ra.displacementmap,{referencePosition:{value:new wr},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:na.distanceRGBA_vert,fragmentShader:na.distanceRGBA_frag},shadow:{uniforms:Bo([ra.lights,ra.fog,{color:{value:new Vi(0)},opacity:{value:1}}]),vertexShader:na.shadow_vert,fragmentShader:na.shadow_frag}};function oa(e,t,n,r,i){var o,a,s=new Vi(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||p.mapping===Te)?(void 0===a&&((a=new Ro(new Lo(1,1,1),new Fo({name:"BackgroundCubeMaterial",uniforms:jo(ia.cube.uniforms),vertexShader:ia.cube.vertexShader,fragmentShader:ia.cube.fragmentShader,side:I,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 Ro(new ta(2,2),new Fo({name:"BackgroundMaterial",uniforms:jo(ia.background.uniforms),vertexShader:ia.background.vertexShader,fragmentShader:ia.background.fragmentShader,side:A,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 aa(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 R=c[h];if(void 0!==R)switch(R.length){case 2:e.vertexAttrib2fv(d,R);break;case 3:e.vertexAttrib3fv(d,R);break;case 4:e.vertexAttrib4fv(d,R);break;default:e.vertexAttrib1fv(d,R)}}}}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 sa(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 ua(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 la(e){var t=this,n=null,r=0,i=!1,o=!1,a=new qo,s=new dr,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 Wo(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 ha(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 da(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?to:$i)(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=Ie,e.minFilter=Ie,e.wrapR=Ee,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return n}(vr);ba.prototype.isDataTexture2DArray=!0;var xa=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=Ie,e.minFilter=Ie,e.wrapR=Ee,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e.needsUpdate=!0,e}return n}(vr);xa.prototype.isDataTexture3D=!0;var _a=new vr,wa=new ba,Ta=new xa,Ma=new Vo,Sa=[],Ea=[],Aa=new Float32Array(16),Ia=new Float32Array(9),Ca=new Float32Array(4);function Na(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,o=Sa[i];if(void 0===o&&(o=new Float32Array(i),Sa[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 ka(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n/gm;function Rs(e){return e.replace(Ps,Os)}function Os(e,t){var n=na[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Rs(n)}var Ls=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,js=/#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 Bs(e){return e.replace(js,Fs).replace(Ls,Us)}function Us(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Fs(e,t,n,r)}function Fs(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(Ns).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(Ns).join("\n")).length>0&&(i+="\n"),(o=[v,m].filter(Ns).join("\n")).length>0&&(o+="\n")):(i=[zs(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(Ns).join("\n"),o=[v,zs(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;",n.toneMapping!==de?"#define TONE_MAPPING":"",n.toneMapping!==de?na.tonemapping_pars_fragment:"",n.toneMapping!==de?Cs("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",na.encodings_pars_fragment,n.map?As("mapTexelToLinear",n.mapEncoding):"",n.matcap?As("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?As("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?As("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?As("lightMapTexelToLinear",n.lightMapEncoding):"",Is("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Ns).join("\n")),u=Ds(u=ks(u=Rs(u),n),n),l=Ds(l=ks(l=Rs(l),n),n),u=Bs(u),l=Bs(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",n.glslVersion===qn?"":"out highp vec4 pc_fragColor;",n.glslVersion===qn?"":"#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,T=Ts(a,35633,y+i+u),S=Ts(a,35632,_);if(a.attachShader(g,T),a.attachShader(g,S),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 A=a.getProgramInfoLog(g).trim(),I=a.getShaderInfoLog(T).trim(),C=a.getShaderInfoLog(S).trim(),N=!0,k=!0;if(!1===a.getProgramParameter(g,35714)){N=!1;var D=Es(a,T,"vertex"),P=Es(a,S,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(g,35715),"gl.getProgramInfoLog",A,D,P)}else""!==A?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",A):""!==I&&""!==C||(k=!1);k&&(this.diagnostics={runnable:N,programLog:A,vertexShader:{log:I,prefix:i},fragmentShader:{log:C,prefix:o}})}return a.deleteShader(T),a.deleteShader(S),this.getUniforms=function(){return void 0===b&&(b=new ws(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:de,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===C,flipSided:i.side===I,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||Ws),i.length>1&&i.sort(t||Ys),o.length>1&&o.sort(t||Ys)}}}function Qs(e){var t=new WeakMap;return{get:function(n,r){var i;return!1===t.has(n)?(i=new Xs(e),t.set(n,[i])):r>=t.get(n).length?(i=new Xs(e),t.get(n).push(i)):i=t.get(n)[r],i},dispose:function(){t=new WeakMap}}}function qs(){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 wr,color:new Vi};break;case"SpotLight":n={position:new wr,direction:new wr,color:new Vi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new wr,color:new Vi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new wr,skyColor:new Vi,groundColor:new Vi};break;case"RectAreaLight":n={color:new Vi,position:new wr,halfWidth:new wr,halfHeight:new wr}}return e[t.id]=n,n}}}var Zs=0;function Js(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Ks(e,t){for(var n=new qs,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 cr};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new cr,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 wr);var a=new wr,s=new $r,u=new $r;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(Js);for(var y=0,b=o.length;y0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=ra.LTC_FLOAT_1,i.rectAreaLTC2=ra.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=ra.LTC_HALF_1,i.rectAreaLTC2=ra.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=Zs++)},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 $s(e,t),n.set(r,[i])):o>=n.get(r).length?(i=new $s(e,t),n.get(r).push(i)):i=n.get(r)[o],i},dispose:function(){n=new WeakMap}}}var tu=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=bn,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}(ji);tu.prototype.isMeshDepthMaterial=!0;var nu=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 wr,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}(ji);function ru(e,t,n){var r=new Ko,i=new cr,o=new cr,a=new gr,s=[],u=[],l={},c=n.maxTextureSize,h={0:I,1:A,2:C},d=new Fo({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new cr},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 mo;p.setAttribute("position",new Qi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var v=new Ro(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 tu({depthPacking:xn,morphTargets:e}),s[t]=n),n}function b(e){var t=e<<0,n=u[t];return void 0===n&&(n=new nu({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=s===E?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&&s===E)&&(!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&&this.type===E){var x={minFilter:Pe,magFilter:Pe,format:Ke};y.map=new yr(i.x,i.y,x),y.map.texture.name=v.name+".shadowMap",y.mapPass=new yr(i.x,i.y,x),y.camera.updateProjectionMatrix()}if(null===y.map){var w={minFilter:Ie,magFilter:Ie,format:Ke};y.map=new yr(i.x,i.y,w),y.map.texture.name=v.name+".shadowMap",y.camera.updateProjectionMatrix()}e.setRenderTarget(y.map),e.clear();for(var T=y.getViewportCount(),M=0;M=1):-1!==de.indexOf("OpenGL ES")&&(he=parseFloat(/^OpenGL ES (\d)/.exec(de)[1]),ce=he>=2);var fe=null,pe={},ve=e.getParameter(3088),me=e.getParameter(2978),ge=(new gr).fromArray(ve),ye=(new gr).fromArray(me);function be(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?ur:Math.floor,a=o(i*e.width),s=o(i*e.height);void 0===c&&(c=y(a,s));var u=n?y(a,s):c;return u.width=a,u.height=s,u.getContext("2d").drawImage(e,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+s+")."),u}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return ar(e.width)&&ar(e.height)}function _(e,t){return e.generateMipmaps&&t&&e.minFilter!==Ie&&e.minFilter!==Pe}function w(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 T(n,r,i){if(!1===h)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 M(e){return e===Ie||e===Ce||e===ke?9728:9729}function S(t){var n,i,o=t.target;o.removeEventListener("dispose",S),n=o,void 0!==(i=r.get(n)).__webglInit&&(e.deleteTexture(i.__webglTexture),r.remove(n)),o.isVideoTexture&&m.delete(o),a.memory.textures--}function E(t){var n=t.target;n.removeEventListener("dispose",E),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 R(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 C(t,i){var a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6===r.image.length){P(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,u=[],l=0;l<6;l++)u[l]=a||s?s?r.image[l].image:r.image[l]:b(r.image[l],!1,!0,f);var c,d=u[0],p=x(d)||h,v=o.convert(r.format),m=o.convert(r.type),g=T(r.internalFormat,v,m);if(D(34067,r,p),a){for(var y=0;y<6;y++){c=u[y].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 P(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",S),t.__webglTexture=e.createTexture(),a.memory.textures++)}function R(t,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),P(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,u=function(e){return!h&&(e.wrapS!==Ee||e.wrapT!==Ee||e.minFilter!==Ie&&e.minFilter!==Pe)}(r)&&!1===x(r.image),l=b(r.image,u,!1,p),c=x(l)||h,d=o.convert(r.format),f=o.convert(r.type),v=T(r.internalFormat,d,f);D(a,r,c);var m=r.mipmaps;if(r.isDepthTexture)v=6402,h?v=r.type===Ve?36012:r.type===He?33190:r.type===qe?35056:33189:r.type===Ve&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===nt&&6402===v&&r.type!==ze&&r.type!==He&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=ze,f=o.convert(r.type)),r.format===rt&&6402===v&&(v=34041,r.type!==qe&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=qe,f=o.convert(r.type))),n.texImage2D(3553,0,v,l.width,l.height,0,d,f,null);else if(r.isDataTexture)if(m.length>0&&c){for(var g=0,y=m.length;g0&&c){for(var E=0,A=m.length;E=d&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+d),A+=1,e},this.resetTextureUnits=function(){A=0},this.setTexture2D=I,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?R(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?R(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=C,this.setupRenderTarget=function(t){var s=t.texture,u=r.get(t),l=r.get(s);t.addEventListener("dispose",E),!0!==t.isWebGLMultipleRenderTargets&&(l.__webglTexture=e.createTexture(),l.__version=s.version,a.memory.textures++);var c=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,f=!0===t.isWebGLMultisampleRenderTarget,p=s.isDataTexture3D||s.isDataTexture2DArray,v=x(t)||h;if(!h||s.format!==Je||s.type!==Ve&&s.type!==We||(s.format=Ke,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){u.__webglFramebuffer=[];for(var m=0;m<6;m++)u.__webglFramebuffer[m]=e.createFramebuffer()}else if(u.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers)for(var g=t.texture,y=0,b=g.length;y0&&void 0!==arguments[0]?arguments[0]:[];return _(this,n),(e=t.call(this)).cameras=r,e}return n}(Go);su.prototype.isArrayCamera=!0;var uu=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}(Mi);uu.prototype.isGroup=!0;var lu={type:"move"},cu=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 uu,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 uu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new wr,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new wr),this._targetRay}},{key:"getGripSpace",value:function(){return null===this._grip&&(this._grip=new uu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new wr,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new wr),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(lu))),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 uu;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}(),hu=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,l=1,c=null,h="local-floor",d=null,f=null,p=null,v=null,m=[],g=new Map,b=new Go;b.layers.enable(1),b.viewport=new gr;var x=new Go;x.layers.enable(2),x.viewport=new gr;var w=[b,x],T=new su;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,t.side===I&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===I&&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,t.side===I&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===I&&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 fu(){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=hn,this.physicallyCorrectLights=!1,this.toneMapping=de,this.toneMappingExposure=1;var v=this,m=!1,g=0,y=0,b=null,x=-1,_=null,w=new gr,T=new gr,M=null,S=t.width,E=t.height,N=1,k=null,D=null,P=new gr(0,0,S,E),R=new gr(0,0,S,E),O=!1,L=[],j=new Ko,B=!1,U=!1,F=null,z=new $r,G=new wr,H={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function V(){return null===b?N:1}var W,Y,X,Q,q,Z,J,K,$,ee,te,ne,re,ie,oe,ae,se,ue,le,ce,he,fe,pe=n;function ve(e,n){for(var r=0;r0&&Ce(r,e,t),i.length>0&&function(e,t,n,r){if(null===F){var i=!0===a&&!0===Y.isWebGL2;F=new(i?xr:yr)(1024,1024,{generateMipmaps:!0,type:null!==he.convert(We)?We:Be,minFilter:Le,magFilter:Ie,wrapS:Ee,wrapT:Ee})}var o=v.getRenderTarget();v.setRenderTarget(F),v.clear();var s=v.toneMapping;v.toneMapping=de,Ce(e,n,r),v.toneMapping=s,Z.updateMultisampleRenderTarget(F),Z.updateRenderTargetMipmap(F),v.setRenderTarget(o),Ce(t,n,r)}(r,i,e,t),o.length>0&&Ce(o,e,t),null!==b&&(Z.updateMultisampleRenderTarget(b),Z.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&&Z.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(P).multiplyScalar(N).floor(),T.copy(R).multiplyScalar(N).floor(),M=O;if(X.bindFramebuffer(36160,r)&&Y.drawBuffers){var u=!1;if(e)if(e.isWebGLMultipleRenderTargets){var l=e.texture;if(L.length!==l.length||36064!==L[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,he.convert(l),he.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=he.convert(t.format);Y.isWebGL2&&(6407===a&&(a=32849),6408===a&&(a=32856)),Z.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=he.convert(n.format),s=he.convert(n.type);Z.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=he.convert(r.format),c=he.convert(r.type);if(r.isDataTexture3D)Z.setTexture3D(r,0),o=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Z.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){Z.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}))}var pu=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(fu);pu.prototype.isWebGL1Renderer=!0;var vu=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25e-5;_(this,e),this.name="",this.color=new Vi(t),this.density=n}return T(e,[{key:"clone",value:function(){return new e(this.color,this.density)}},{key:"toJSON",value:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}]),e}();vu.prototype.isFogExp2=!0;var mu=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;_(this,e),this.name="",this.color=new Vi(t),this.near=n,this.far=r}return T(e,[{key:"clone",value:function(){return new e(this.color,this.near,this.far)}},{key:"toJSON",value:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}]),e}();mu.prototype.isFog=!0;var gu=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}(Mi);gu.prototype.isScene=!0;var yu=function(){function e(t,n){_(this,e),this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=Un,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=nr()}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=nr()),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=nr()),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}();yu.prototype.isInterleavedBuffer=!0;var bu=new wr,xu=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:Tu.clone(),uv:Oi.getUV(Tu,Cu,Nu,ku,Du,Pu,Ru,new cr),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}(Mi);function Lu(e,t,n,r,i,o){Eu.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(Au.x=o*Eu.x-i*Eu.y,Au.y=i*Eu.x+o*Eu.y):Au.copy(Eu),e.copy(t),e.x+=Au.x,e.y+=Au.y,e.applyMatrix4(Iu)}Ou.prototype.isSprite=!0;var ju=new wr,Bu=new wr,Uu=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this))._currentLevel=0,e.type="LOD",Object.defineProperties(y(e),{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),e.autoUpdate=!0,e}return T(n,[{key:"copy",value:function(e){f(x(n.prototype),"copy",this).call(this,e,!1);for(var t=e.levels,r=0,i=t.length;r1&&void 0!==arguments[1]?arguments[1]:0;t=Math.abs(t);var n,r=this.levels;for(n=0;n0){var n,r;for(n=1,r=t.length;n0){ju.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(ju);this.getObjectForDistance(n).raycast(e,t)}}},{key:"update",value:function(e){var t=this.levels;if(t.length>1){ju.setFromMatrixPosition(e.matrixWorld),Bu.setFromMatrixPosition(this.matrixWorld);var n,r,i=ju.distanceTo(Bu)/e.zoom;for(t[0].object.visible=!0,n=1,r=t.length;n=t[n].distance;n++)t[n-1].object.visible=!1,t[n].object.visible=!0;for(this._currentLevel=n-1;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]:Ie,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Ie,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}(vr);Xu.prototype.isDataTexture=!0;var Qu=new $r,qu=new $r,Zu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];_(this,e),this.uuid=nr(),this.bones=t.slice(0),this.boneInverses=n,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}return T(e,[{key:"init",value:function(){var e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(var n=0,r=this.bones.length;n0&&void 0!==arguments[0]?arguments[0]:new mo,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nl;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),!(al.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}(Mi);ul.prototype.isLine=!0;var ll=new wr,cl=new wr,hl=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 mo,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new fl;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(),ml.copy(n.boundingSphere),ml.applyMatrix4(r),ml.radius+=i,!1!==e.ray.intersectsSphere(ml)){pl.copy(r).invert(),vl.copy(e.ray).applyMatrix4(pl);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}(Mi);function bl(e,t,n,r,i,o,a){var s=vl.distanceSqToPoint(e);if(si.far)return;o.push({distance:l,distanceToRay:Math.sqrt(s),point:u,index:t,face:null,object:a})}}yl.prototype.isPoints=!0;var xl=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:Je,h.minFilter=void 0!==s?s:Pe,h.magFilter=void 0!==a?a:Pe,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}(vr);xl.prototype.isVideoTexture=!0;var _l=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}(vr);_l.prototype.isCompressedTexture=!0;var wl=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}(vr);wl.prototype.isCanvasTexture=!0;var Tl=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),(h=void 0!==h?h:nt)!==nt&&h!==rt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===i&&h===nt&&(i=ze),void 0===i&&h===rt&&(i=qe),(d=t.call(this,null,o,a,s,u,l,h,i,c)).image={width:e,height:r},d.magFilter=void 0!==u?u:Ie,d.minFilter=void 0!==l?l:Ie,d.flipY=!1,d.generateMipmaps=!1,d}return n}(vr);Tl.prototype.isDepthTexture=!0;var Ml=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]:8,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;_(this,n),(e=t.call(this)).type="CircleGeometry",e.parameters={radius:r,segments:i,thetaStart:o,thetaLength:a},i=Math.max(3,i);var s=[],u=[],l=[],c=[],h=new wr,d=new cr;u.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var f=0,p=3;f<=i;f++,p+=3){var v=o+f/i*a;h.x=r*Math.cos(v),h.y=r*Math.sin(v),u.push(h.x,h.y,h.z),l.push(0,0,1),d.x=(u[p]/r+1)/2,d.y=(u[p+1]/r+1)/2,c.push(d.x,d.y)}for(var m=1;m<=i;m++)s.push(m,m+1,0);return e.setIndex(s),e.setAttribute("position",new ro(u,3)),e.setAttribute("normal",new ro(l,3)),e.setAttribute("uv",new ro(c,2)),e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radius,e.segments,e.thetaStart,e.thetaLength)}}]),n}(mo),Sl=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]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;_(this,n),(e=t.call(this)).type="CylinderGeometry",e.parameters={radiusTop:r,radiusBottom:i,height:o,radialSegments:a,heightSegments:s,openEnded:u,thetaStart:l,thetaLength:c};var h=y(e);a=Math.floor(a),s=Math.floor(s);var d=[],f=[],p=[],v=[],m=0,g=[],b=o/2,x=0;function w(e){for(var t=m,n=new cr,o=new wr,s=0,u=!0===e?r:i,g=!0===e?1:-1,y=1;y<=a;y++)f.push(0,b*g,0),p.push(0,g,0),v.push(.5,.5),m++;for(var _=m,w=0;w<=a;w++){var T=w/a*c+l,M=Math.cos(T),S=Math.sin(T);o.x=u*S,o.y=b*g,o.z=u*M,f.push(o.x,o.y,o.z),p.push(0,g,0),n.x=.5*M+.5,n.y=.5*S*g+.5,v.push(n.x,n.y),m++}for(var E=0;E0&&w(!0),i>0&&w(!1)),e.setIndex(d),e.setAttribute("position",new ro(f,3)),e.setAttribute("normal",new ro(p,3)),e.setAttribute("uv",new ro(v,2)),e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}]),n}(mo),El=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]:8,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return _(this,n),(e=t.call(this,0,r,i,o,a,s,u,l)).type="ConeGeometry",e.parameters={radius:r,height:i,radialSegments:o,heightSegments:a,openEnded:s,thetaStart:u,thetaLength:l},e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}]),n}(Sl),Al=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,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;_(this,n),(i=t.call(this)).type="PolyhedronGeometry",i.parameters={vertices:e,indices:r,radius:o,detail:a};var s=[],u=[];function l(e,t,n,r){for(var i=r+1,o=[],a=0;a<=i;a++){o[a]=[];for(var s=e.clone().lerp(n,a/i),u=t.clone().lerp(n,a/i),l=i-a,h=0;h<=l;h++)o[a][h]=0===h&&a===i?s:s.clone().lerp(u,h/l)}for(var d=0;d.9&&o<.1&&(t<.2&&(u[e+0]+=1),n<.2&&(u[e+2]+=1),r<.2&&(u[e+4]+=1))}}()}(),i.setAttribute("position",new ro(s,3)),i.setAttribute("normal",new ro(s.slice(),3)),i.setAttribute("uv",new ro(u,2)),0===a?i.computeVertexNormals():i.normalizeNormals(),i}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.vertices,e.indices,e.radius,e.details)}}]),n}(mo),Il=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]:0;_(this,n);var o=(1+Math.sqrt(5))/2,a=1/o;return(e=t.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-a,-o,0,-a,o,0,a,-o,0,a,o,-a,-o,0,-a,o,0,a,-o,0,a,o,0,-o,0,-a,o,0,-a,-o,0,a,o,0,a],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],r,i)).type="DodecahedronGeometry",e.parameters={radius:r,detail:i},e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radius,e.detail)}}]),n}(Al),Cl=new wr,Nl=new wr,kl=new wr,Dl=new Oi,Pl=function(e){p(n,e);var t=m(n);function n(e,r){var i;if(_(this,n),(i=t.call(this)).type="EdgesGeometry",i.parameters={thresholdAngle:r},r=void 0!==r?r:1,!0===e.isGeometry)return g(i,void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."));for(var o=Math.pow(10,4),a=Math.cos(er*r),s=e.getIndex(),u=e.getAttribute("position"),l=s?s.count:u.count,c=[0,0,0],h=["a","b","c"],d=new Array(3),f={},p=[],v=0;v0&&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 cr:new wr);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 wr,r=[],i=[],o=[],a=new wr,s=new $r,u=0;u<=e;u++){var l=u/e;r[u]=this.getTangentAt(l,new wr),r[u].normalize()}i[0]=new wr,o[0]=new wr;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(rr(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(rr(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}(),Ol=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 cr,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 wr,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]:(Bl.subVectors(o[0],o[1]).add(o[0]),t=Bl);var c=o[u%a],h=o[(u+1)%a];if(this.closed||u+20&&void 0!==arguments[0]?arguments[0]:new cr,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new cr,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new cr,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new cr;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 cr,n=t,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Wl(e,r.x,i.x,o.x,a.x),Wl(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}(Rl);Yl.prototype.isCubicBezierCurve=!0;var Xl=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wr,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new wr,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new wr;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 wr,n=t,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Wl(e,r.x,i.x,o.x,a.x),Wl(e,r.y,i.y,o.y,a.y),Wl(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}(Rl);Xl.prototype.isCubicBezierCurve3=!0;var Ql=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new cr,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new cr;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 cr,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 cr;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}(Rl);Ql.prototype.isLineCurve=!0;var ql=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wr;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 wr,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}(Rl),Zl=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new cr,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new cr,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new cr;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 cr,n=t,r=this.v0,i=this.v1,o=this.v2;return n.set(Vl(e,r.x,i.x,o.x),Vl(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}(Rl);Zl.prototype.isQuadraticBezierCurve=!0;var Jl=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wr,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new wr;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 wr,n=t,r=this.v0,i=this.v1,o=this.v2;return n.set(Vl(e,r.x,i.x,o.x),Vl(e,r.y,i.y,o.y),Vl(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}(Rl);Jl.prototype.isQuadraticBezierCurve3=!0;var Kl=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 cr,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(Hl(a,s.x,u.x,l.x,c.x),Hl(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)for(o=t;o=t;o-=r)a=_c(o,e[o],e[o+1],a);return a&&vc(a,a.next)&&(wc(a),a=a.next),a}function tc(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!vc(r,r.next)&&0!==pc(r.prev,r,r.next))r=r.next;else{if(wc(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function nc(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=cc(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?ic(e,r,i,o):rc(e))t.push(s.i/n),t.push(e.i/n),t.push(u.i/n),wc(e),e=u.next,l=u.next;else if((e=u)===l){a?1===a?nc(e=oc(tc(e),t,n),t,n,r,i,o,2):2===a&&ac(e,t,n,r,i,o):nc(tc(e),t,n,r,i,o,1);break}}}function rc(e){var t=e.prev,n=e,r=e.next;if(pc(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(dc(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&pc(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ic(e,t,n,r){var i=e.prev,o=e,a=e.next;if(pc(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=cc(s,u,t,n,r),d=cc(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&&dc(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&pc(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&dc(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&pc(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&dc(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&pc(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&dc(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&pc(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function oc(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!vc(i,o)&&mc(i,r,r.next,o)&&bc(i,o)&&bc(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),wc(r),wc(r.next),r=e=o),r=r.next}while(r!==e);return tc(r)}function ac(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&fc(a,s)){var u=xc(a,s);return a=tc(a,a.next),u=tc(u,u.next),nc(a,t,n,r,i,o),void nc(u,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function sc(e,t){return e.x-t.x}function uc(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&&dc(on.x||r.x===n.x&&lc(n,r)))&&(n=r,d=u)),r=r.next}while(r!==l);return n}(e,t)){var n=xc(t,e);tc(t,t.next),tc(n,n.next)}}function lc(e,t){return pc(e.prev,e,t.prev)<0&&pc(t.next,e,e.next)<0}function cc(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 hc(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 fc(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&&mc(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(bc(e,t)&&bc(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)&&(pc(e.prev,e,t.prev)||pc(e,t.prev,t))||vc(e,t)&&pc(e.prev,e,e.next)>0&&pc(t.prev,t,t.next)>0)}function pc(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function vc(e,t){return e.x===t.x&&e.y===t.y}function mc(e,t,n,r){var i=yc(pc(e,t,n)),o=yc(pc(e,t,r)),a=yc(pc(n,r,e)),s=yc(pc(n,r,t));return i!==o&&a!==s||!(0!==i||!gc(e,n,t))||!(0!==o||!gc(e,r,t))||!(0!==a||!gc(n,e,r))||!(0!==s||!gc(n,t,r))}function gc(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 yc(e){return e>0?1:e<0?-1:0}function bc(e,t){return pc(e.prev,e,e.next)<0?pc(e,t,e.next)>=0&&pc(e,e.prev,t)>=0:pc(e,t,e.prev)<0||pc(e,e.next,t)<0}function xc(e,t){var n=new Tc(e.i,e.x,e.y),r=new Tc(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 _c(e,t,n,r){var i=new Tc(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 wc(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 Tc(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 Mc=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=ec(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 nc(d,f,l,n,r,u),f}(n,r),u=0;u2&&e[t-1].equals(e[0])&&e.pop()}function Ec(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 cr(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 cr(r/o,i/o)}for(var j=[],B=0,U=C.length,F=U-1,z=B+1;B=0;ge--){for(var ye=ge/f,be=c*Math.cos(ye*Math.PI/2),xe=h*Math.sin(ye*Math.PI/2)+d,_e=0,we=C.length;_e=0;){var r=n,o=n-1;o<0&&(o=e.length-1);for(var a=0,s=i+2*f;a0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_(this,n);var o=(1+Math.sqrt(5))/2;return(e=t.call(this,[-1,o,0,1,o,0,-1,-o,0,1,-o,0,0,-1,o,0,1,o,0,-1,-o,0,1,-o,o,0,-1,o,0,1,-o,0,-1,-o,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],r,i)).type="IcosahedronGeometry",e.parameters={radius:r,detail:i},e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radius,e.detail)}}]),n}(Al),Nc=function(e){p(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;_(this,n),(r=t.call(this)).type="LatheGeometry",r.parameters={points:e,segments:i,phiStart:o,phiLength:a},i=Math.floor(i),a=rr(a,0,2*Math.PI);for(var s=[],u=[],l=[],c=1/i,h=new wr,d=new cr,f=0;f<=i;f++)for(var p=o+f*c*a,v=Math.sin(p),m=Math.cos(p),g=0;g<=e.length-1;g++)h.x=e[g].x*v,h.y=e[g].y,h.z=e[g].x*m,u.push(h.x,h.y,h.z),d.x=f/i,d.y=g/(e.length-1),l.push(d.x,d.y);for(var y=0;y0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return _(this,n),(e=t.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],r,i)).type="OctahedronGeometry",e.parameters={radius:r,detail:i},e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radius,e.detail)}}]),n}(Al),Dc=function(e){p(n,e);var t=m(n);function n(e,r,i){var o;_(this,n),(o=t.call(this)).type="ParametricGeometry",o.parameters={func:e,slices:r,stacks:i};var a=[],s=[],u=[],l=[],c=1e-5,h=new wr,d=new wr,f=new wr,p=new wr,v=new wr;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var m=r+1,g=0;g<=i;g++)for(var y=g/i,b=0;b<=r;b++){var x=b/r;e(x,y,d),s.push(d.x,d.y,d.z),x-c>=0?(e(x-c,y,f),p.subVectors(d,f)):(e(x+c,y,f),p.subVectors(f,d)),y-c>=0?(e(x,y-c,f),v.subVectors(d,f)):(e(x,y+c,f),v.subVectors(f,d)),h.crossVectors(p,v).normalize(),u.push(h.x,h.y,h.z),l.push(x,y)}for(var w=0;w0&&void 0!==arguments[0]?arguments[0]:.5,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,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;_(this,n),(e=t.call(this)).type="RingGeometry",e.parameters={innerRadius:r,outerRadius:i,thetaSegments:o,phiSegments:a,thetaStart:s,thetaLength:u},o=Math.max(3,o);for(var l=[],c=[],h=[],d=[],f=r,p=(i-r)/(a=Math.max(1,a)),v=new wr,m=new cr,g=0;g<=a;g++){for(var y=0;y<=o;y++){var b=s+y/o*u;v.x=f*Math.cos(b),v.y=f*Math.sin(b),c.push(v.x,v.y,v.z),h.push(0,0,1),m.x=(v.x/i+1)/2,m.y=(v.y/i+1)/2,d.push(m.x,m.y)}f+=p}for(var x=0;x1&&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;h0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;_(this,n),(e=t.call(this)).type="SphereGeometry",e.parameters={radius:r,widthSegments:i,heightSegments:o,phiStart:a,phiLength:s,thetaStart:u,thetaLength:l},i=Math.max(3,Math.floor(i)),o=Math.max(2,Math.floor(o));for(var c=Math.min(u+l,Math.PI),h=0,d=[],f=new wr,p=new wr,v=[],m=[],g=[],y=[],b=0;b<=o;b++){var x=[],w=b/o,T=0;0==b&&0==u?T=.5/i:b==o&&c==Math.PI&&(T=-.5/i);for(var M=0;M<=i;M++){var S=M/i;f.x=-r*Math.cos(a+S*s)*Math.sin(u+w*l),f.y=r*Math.cos(u+w*l),f.z=r*Math.sin(a+S*s)*Math.sin(u+w*l),m.push(f.x,f.y,f.z),p.copy(f).normalize(),g.push(p.x,p.y,p.z),y.push(S+T,1-w),x.push(h++)}d.push(x)}for(var E=0;E0)&&v.push(I,C,k),(E!==o-1||c0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return _(this,n),(e=t.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],r,i)).type="TetrahedronGeometry",e.parameters={radius:r,detail:i},e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radius,e.detail)}}]),n}(Al),jc=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);var o=i.font;if(!o||!o.isFont)return g(r,(console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new mo));var a=o.generateShapes(e,i.size);return i.depth=void 0!==i.height?i.height:50,void 0===i.bevelThickness&&(i.bevelThickness=10),void 0===i.bevelSize&&(i.bevelSize=8),void 0===i.bevelEnabled&&(i.bevelEnabled=!1),(r=t.call(this,a,i)).type="TextGeometry",r}return n}(Ac),Bc=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]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;_(this,n),(e=t.call(this)).type="TorusGeometry",e.parameters={radius:r,tube:i,radialSegments:o,tubularSegments:a,arc:s},o=Math.floor(o),a=Math.floor(a);for(var u=[],l=[],c=[],h=[],d=new wr,f=new wr,p=new wr,v=0;v<=o;v++)for(var m=0;m<=a;m++){var g=m/a*s,y=v/o*Math.PI*2;f.x=(r+i*Math.cos(y))*Math.cos(g),f.y=(r+i*Math.cos(y))*Math.sin(g),f.z=i*Math.sin(y),l.push(f.x,f.y,f.z),d.x=r*Math.cos(g),d.y=r*Math.sin(g),p.subVectors(f,d).normalize(),c.push(p.x,p.y,p.z),h.push(m/a),h.push(v/o)}for(var b=1;b<=o;b++)for(var x=1;x<=a;x++){var w=(a+1)*b+x-1,T=(a+1)*(b-1)+x-1,M=(a+1)*(b-1)+x,S=(a+1)*b+x;u.push(w,T,S),u.push(T,M,S)}return e.setIndex(u),e.setAttribute("position",new ro(l,3)),e.setAttribute("normal",new ro(c,3)),e.setAttribute("uv",new ro(h,2)),e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}]),n}(mo),Uc=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]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;_(this,n),(e=t.call(this)).type="TorusKnotGeometry",e.parameters={radius:r,tube:i,tubularSegments:o,radialSegments:a,p:s,q:u},o=Math.floor(o),a=Math.floor(a);for(var l=[],c=[],h=[],d=[],f=new wr,p=new wr,v=new wr,m=new wr,g=new wr,y=new wr,b=new wr,x=0;x<=o;++x){var w=x/o*s*Math.PI*2;P(w,s,u,r,v),P(w+.01,s,u,r,m),y.subVectors(m,v),b.addVectors(m,v),g.crossVectors(y,b),b.crossVectors(g,y),g.normalize(),b.normalize();for(var T=0;T<=a;++T){var M=T/a*Math.PI*2,S=-i*Math.cos(M),E=i*Math.sin(M);f.x=v.x+(S*b.x+E*g.x),f.y=v.y+(S*b.y+E*g.y),f.z=v.z+(S*b.z+E*g.z),c.push(f.x,f.y,f.z),p.subVectors(f,v).normalize(),h.push(p.x,p.y,p.z),d.push(x/o),d.push(T/a)}}for(var A=1;A<=o;A++)for(var I=1;I<=a;I++){var C=(a+1)*(A-1)+(I-1),N=(a+1)*A+(I-1),k=(a+1)*A+I,D=(a+1)*(A-1)+I;l.push(C,N,D),l.push(N,k,D)}function P(e,t,n,r,i){var o=Math.cos(e),a=Math.sin(e),s=n/t*e,u=Math.cos(s);i.x=r*(2+u)*.5*o,i.y=r*(2+u)*a*.5,i.z=r*Math.sin(s)*.5}return e.setIndex(l),e.setAttribute("position",new ro(c,3)),e.setAttribute("normal",new ro(h,3)),e.setAttribute("uv",new ro(d,2)),e}return T(n,null,[{key:"fromJSON",value:function(e){return new n(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}]),n}(mo),Fc=function(e){p(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];_(this,n),(r=t.call(this)).type="TubeGeometry",r.parameters={path:e,tubularSegments:i,radius:o,radialSegments:a,closed:s};var u=e.computeFrenetFrames(i,s);r.tangents=u.tangents,r.normals=u.normals,r.binormals=u.binormals;var l=new wr,c=new wr,h=new cr,d=new wr,f=[],p=[],v=[],m=[];function g(t){d=e.getPointAt(t/i,d);for(var n=u.normals[t],r=u.binormals[t],s=0;s<=a;s++){var h=s/a*Math.PI*2,v=Math.sin(h),m=-Math.cos(h);c.x=m*n.x+v*r.x,c.y=m*n.y+v*r.y,c.z=m*n.z+v*r.z,c.normalize(),p.push(c.x,c.y,c.z),l.x=d.x+o*c.x,l.y=d.y+o*c.y,l.z=d.z+o*c.z,f.push(l.x,l.y,l.z)}}return function(){for(var e=0;e4&&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=eh.arraySlice(r.values,f,p)}else if(o>=r.times[h]){var v=h*u+s,m=v+u-s;d=eh.arraySlice(r.values,v,m)}else{var g=r.createInterpolant(),y=s,b=u-s;g.evaluate(o),d=eh.arraySlice(g.resultBuffer,y,b)}"quaternion"===i&&(new _r).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=eh.arraySlice(n,i,o),this.values=eh.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&&eh.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=eh.arraySlice(this.times),t=eh.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===tn,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=eh.arraySlice(e,0,o),this.values=eh.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=eh.arraySlice(this.times,0),t=eh.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:eh.convertArray(e.times,Array),values:eh.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}]),e}();oh.prototype.TimeBufferType=Float32Array,oh.prototype.ValueBufferType=Float32Array,oh.prototype.DefaultInterpolation=en;var ah=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(oh);ah.prototype.ValueTypeName="bool",ah.prototype.ValueBufferType=Array,ah.prototype.DefaultInterpolation=$t,ah.prototype.InterpolantFactoryMethodLinear=void 0,ah.prototype.InterpolantFactoryMethodSmooth=void 0;var sh=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(oh);sh.prototype.ValueTypeName="color";var uh=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(oh);uh.prototype.ValueTypeName="number";var lh=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)_r.slerpFlat(i,0,o,u-a,o,u,s);return i}}]),n}(th),ch=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 lh(this.times,this.values,this.getValueSize(),e)}}]),n}(oh);ch.prototype.ValueTypeName="quaternion",ch.prototype.DefaultInterpolation=en,ch.prototype.InterpolantFactoryMethodSmooth=void 0;var hh=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(oh);hh.prototype.ValueTypeName="string",hh.prototype.ValueBufferType=Array,hh.prototype.DefaultInterpolation=$t,hh.prototype.InterpolantFactoryMethodLinear=void 0,hh.prototype.InterpolantFactoryMethodSmooth=void 0;var dh=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(oh);dh.prototype.ValueTypeName="vector";var fh=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]:an;_(this,e),this.name=t,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=nr(),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=[];eh.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?Je:Ke,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}]),n}(yh),Ah=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 Ql(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}(Ah),Ch=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).uuid=nr(),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 Vi(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}(Mi);Nh.prototype.isLight=!0;var kh=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(Mi.DefaultUp),o.updateMatrix(),o.groundColor=new Vi(r),o}return T(n,[{key:"copy",value:function(e){return Nh.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}]),n}(Nh);kh.prototype.isHemisphereLight=!0;var Dh=new $r,Ph=new wr,Rh=new wr,Oh=function(){function e(t){_(this,e),this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new cr(512,512),this.map=null,this.mapPass=null,this.matrix=new $r,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ko,this._frameExtents=new cr(1,1),this._viewportCount=1,this._viewports=[new gr(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;Ph.setFromMatrixPosition(e.matrixWorld),t.position.copy(Ph),Rh.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Rh),t.updateMatrixWorld(),Dh.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Dh),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}(),Lh=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this,new Go(50,1,.5,500))).focus=1,e}return T(n,[{key:"updateMatrices",value:function(e){var t=this.camera,r=2*tr*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}(Oh);Lh.prototype.isSpotLightShadow=!0;var jh=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(Mi.DefaultUp),i.updateMatrix(),i.target=new Mi,i.distance=o,i.angle=a,i.penumbra=s,i.decay=u,i.shadow=new Lh,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}(Nh);jh.prototype.isSpotLight=!0;var Bh=new $r,Uh=new wr,Fh=new wr,zh=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this,new Go(90,1,.5,500)))._frameExtents=new cr(4,2),e._viewportCount=6,e._viewports=[new gr(2,1,1,1),new gr(0,1,1,1),new gr(3,1,1,1),new gr(1,1,1,1),new gr(3,0,1,1),new gr(1,0,1,1)],e._cubeDirections=[new wr(1,0,0),new wr(-1,0,0),new wr(0,0,1),new wr(0,0,-1),new wr(0,1,0),new wr(0,-1,0)],e._cubeUps=[new wr(0,1,0),new wr(0,1,0),new wr(0,1,0),new wr(0,1,0),new wr(0,0,1),new wr(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()),Uh.setFromMatrixPosition(e.matrixWorld),n.position.copy(Uh),Fh.copy(n.position),Fh.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Fh),n.updateMatrixWorld(),r.makeTranslation(-Uh.x,-Uh.y,-Uh.z),Bh.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Bh)}}]),n}(Oh);zh.prototype.isPointLightShadow=!0;var Gh=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 zh,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}(Nh);Gh.prototype.isPointLight=!0;var Hh=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}(zo);Hh.prototype.isOrthographicCamera=!0;var Vh=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.call(this,new Hh(-5,5,5,-5,.5,500))}return n}(Oh);Vh.prototype.isDirectionalLightShadow=!0;var Wh=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(Mi.DefaultUp),i.updateMatrix(),i.target=new Mi,i.shadow=new Vh,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}(Nh);Wh.prototype.isDirectionalLight=!0;var Yh=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}(Nh);Yh.prototype.isAmbientLight=!0;var Xh=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}(Nh);Xh.prototype.isRectAreaLight=!0;var Qh=function(){function e(){_(this,e),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new wr)}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}();Qh.prototype.isSphericalHarmonics3=!0;var qh=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Qh,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}(Nh);qh.prototype.isLightProbe=!0;var Zh=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).textures={},r}return T(n,[{key:"load",value:function(e,t,n,r){var i=this,o=new xh(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}},{key:"parse",value:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new $c[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new Vi).setHex(e.sheen)),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.vertexTangents&&(r.vertexTangents=e.vertexTangents),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var o=e.uniforms[i];switch(r.uniforms[i]={},o.type){case"t":r.uniforms[i].value=n(o.value);break;case"c":r.uniforms[i].value=(new Vi).setHex(o.value);break;case"v2":r.uniforms[i].value=(new cr).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new wr).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new gr).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new dr).fromArray(o.value);break;case"m4":r.uniforms[i].value=(new $r).fromArray(o.value);break;default:r.uniforms[i].value=o.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var a in e.extensions)r.extensions[a]=e.extensions[a];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new cr).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new cr).fromArray(e.clearcoatNormalScale)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),r}},{key:"setTextures",value:function(e){return this.textures=e,this}}]),n}(yh),Jh=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}(Qi);$h.prototype.isInstancedBufferAttribute=!0;var ed=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 xh(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}},{key:"parse",value:function(e){var t={},n={};function r(e,r){if(void 0!==t[r])return t[r];var i=e.interleavedBuffers[r],o=function(e,t){if(void 0!==n[t])return n[t];var r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),a=so(i.type,o),s=new yu(a,i.stride);return s.uuid=i.uuid,t[r]=s,s}var i=e.isInstancedBufferGeometry?new Kh:new mo,o=e.data.index;if(void 0!==o){var a=so(o.type,o.array);i.setIndex(new Qi(a,1))}var s=e.data.attributes;for(var u in s){var l=s[u],c=void 0;if(l.isInterleavedBufferAttribute){var h=r(e.data,l.data);c=new xu(h,l.itemSize,l.offset,l.normalized)}else{var d=so(l.type,l.array);c=new(l.isInstancedBufferAttribute?$h:Qi)(d,l.itemSize,l.normalized)}void 0!==l.name&&(c.name=l.name),void 0!==l.usage&&c.setUsage(l.usage),void 0!==l.updateRange&&(c.updateRange.offset=l.updateRange.offset,c.updateRange.count=l.updateRange.count),i.setAttribute(u,c)}var f=e.data.morphAttributes;if(f)for(var p in f){for(var v=f[p],m=[],g=0,y=v.length;g0){var a=new mh(t);(n=new Th(a)).setCrossOrigin(this.crossOrigin);for(var s=0,u=e.length;s0)){e.next=29;break}(i=new Th(this.manager)).setCrossOrigin(this.crossOrigin),s=0,l=t.length;case 6:if(!(sNumber.EPSILON){if(l<0&&(a=t[o],u=-u,s=t[i],l=-l),e.ys.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var c=l*(e.x-a.x)-u*(e.y-a.y);if(0===c)return!0;if(c<0)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var i,o,a,s=Mc.isClockWise,u=this.subPaths;if(0===u.length)return[];if(!0===t)return n(u);var l=[];if(1===u.length)return o=u[0],(a=new Ch).curves=o.curves,l.push(a),l;var c=!s(u[0].getPoints());c=e?!c:c;var h,d,f=[],p=[],v=[],m=0;p[m]=void 0,v[m]=[];for(var g=0,y=u.length;g1){for(var b=!1,x=[],_=0,w=p.length;_0&&(b||(v=f))}for(var N=0,k=p.length;N1&&void 0!==arguments[1]?arguments[1]:100,n=[],r=function(e,t,n){for(var r=Array.from(e),i=t/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[],s=0,u=0,l=0;l2&&void 0!==arguments[2]?arguments[2]:1;_(this,n),i=t.call(this,void 0,o);var a=(new Vi).set(e),s=(new Vi).set(r),u=new wr(a.r,a.g,a.b),l=new wr(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}(qh);fd.prototype.isHemisphereLightProbe=!0;var pd=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 Vi).set(e);return r.sh.coefficients[0].set(o.r,o.g,o.b).multiplyScalar(2*Math.sqrt(Math.PI)),r}return n}(qh);pd.prototype.isAmbientLightProbe=!0;var vd=new $r,md=new $r,gd=function(){function e(){_(this,e),this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Go,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Go,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}return T(e,[{key:"update",value:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,r,i=e.projectionMatrix.clone(),o=t.eyeSep/2,a=o*t.near/t.focus,s=t.near*Math.tan(er*t.fov*.5)/t.zoom;md.elements[12]=-o,vd.elements[12]=o,n=-s*t.aspect+a,r=s*t.aspect+a,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*t.aspect-a,r=s*t.aspect-a,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(md),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(vd)}}]),e}(),yd=function(){function e(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];_(this,e),this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}return T(e,[{key:"start",value:function(){this.startTime=bd(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=bd();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}]),e}();function bd(){return("undefined"==typeof performance?Date:performance).now()}var xd=new wr,_d=new _r,wd=new wr,Td=new wr,Md=function(e){p(n,e);var t=m(n);function n(){var e;return _(this,n),(e=t.call(this)).type="AudioListener",e.context=hd.getContext(),e.gain=e.context.createGain(),e.gain.connect(e.context.destination),e.filter=null,e.timeDelta=0,e._clock=new yd,e}return T(n,[{key:"getInput",value:function(){return this.gain}},{key:"removeFilter",value:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}},{key:"getFilter",value:function(){return this.filter}},{key:"setFilter",value:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}},{key:"getMasterVolume",value:function(){return this.gain.gain.value}},{key:"setMasterVolume",value:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}},{key:"updateMatrixWorld",value:function(e){f(x(n.prototype),"updateMatrixWorld",this).call(this,e);var t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(xd,_d,wd),Td.set(0,0,-1).applyQuaternion(_d),t.positionX){var i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(xd.x,i),t.positionY.linearRampToValueAtTime(xd.y,i),t.positionZ.linearRampToValueAtTime(xd.z,i),t.forwardX.linearRampToValueAtTime(Td.x,i),t.forwardY.linearRampToValueAtTime(Td.y,i),t.forwardZ.linearRampToValueAtTime(Td.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(xd.x,xd.y,xd.z),t.setOrientation(Td.x,Td.y,Td.z,r.x,r.y,r.z)}}]),n}(Mi),Sd=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;e1&&void 0!==arguments[1]?arguments[1]:2048;_(this,e),this.analyser=t.context.createAnalyser(),this.analyser.fftSize=n,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}return T(e,[{key:"getFrequencyData",value:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},{key:"getAverageFrequency",value:function(){for(var e=0,t=this.getFrequencyData(),n=0;n0&&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){_r.slerpFlat(e,t,e,t,e,n,r)}},{key:"_slerpAdditive",value:function(e,t,n,r,i){var o=this._workIndex*i;_r.multiplyQuaternionsFlat(e,o,e,t,e,n),_r.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}(),Pd=new RegExp("[\\[\\]\\.:\\/]","g"),Rd="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Od=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ld=/(WCOD+)?/.source.replace("WCOD",Rd),jd=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Bd=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ud=new RegExp("^"+Od+Ld+jd+Bd+"$"),Fd=["material","materials","bones"],zd=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;s=i){var c=i++,h=e[c];t[h.uuid]=l,e[l]=h,t[u]=c,e[c]=s;for(var d=0,f=r;d!==f;++d){var p=n[d],v=p[c],m=p[l];p[l]=v,p[c]=m}}}this.nCachedObjects_=i}},{key:"uncache",value:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,o=e.length,a=0,s=arguments.length;a!==s;++a){var u=arguments[a].uuid,l=t[u];if(void 0!==l)if(delete t[u],l0&&(t[x.uuid]=l),e[l]=x,e.pop();for(var _=0,w=r;_!==w;++_){var T=n[_];T[l]=T[b],T.pop()}}}this.nCachedObjects_=i}},{key:"subscribe_",value:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,u=s.length,l=this.nCachedObjects_,c=new Array(u);r=i.length,n[e]=r,o.push(e),a.push(t),i.push(c);for(var h=l,d=s.length;h!==d;++h){var f=s[h];c[h]=new zd(f,e,t)}return c}},{key:"unsubscribe_",value:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];t[e[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}]),e}();Gd.prototype.isAnimationObjectGroup=!0;var Hd=function(){function e(t,n){var r=arguments.length>2&&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:nn,endingEnd:nn},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=Jt,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(this.blendMode===sn)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=n===Kt;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(n===Zt){-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=rn,r.endingEnd=rn):(r.endingStart=e?this.zeroSlopeAtStart?rn:nn:on,r.endingEnd=t?this.zeroSlopeAtEnd?rn:nn:on)}},{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}(),Vd=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 Dd(zd.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}(yu);Yd.prototype.isInstancedInterleavedBuffer=!0;var Xd=function(){function e(t,n,r,i,o){_(this,e),this.buffer=t,this.type=n,this.itemSize=r,this.elementSize=i,this.count=o,this.version=0}return T(e,[{key:"setBuffer",value:function(e){return this.buffer=e,this}},{key:"setType",value:function(e,t){return this.type=e,this.elementSize=t,this}},{key:"setItemSize",value:function(e){return this.itemSize=e,this}},{key:"setCount",value:function(e){return this.count=e,this}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}]),e}();Xd.prototype.isGLBufferAttribute=!0;var Qd=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;_(this,e),this.ray=new Kr(t,n),this.near=r,this.far=i,this.camera=null,this.layers=new ci,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}return T(e,[{key:"set",value:function(e,t){this.ray.set(e,t)}},{key:"setFromCamera",value:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}},{key:"intersectObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Zd(e,this,n,t),n.sort(qd),n}},{key:"intersectObjects",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0,i=e.length;r0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _(this,e),this.radius=t,this.phi=n,this.theta=r,this}return T(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}},{key:"makeSafe",value:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(rr(t/this.radius,-1,1))),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),Kd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _(this,e),this.radius=t,this.theta=n,this.y=r,this}return T(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}},{key:"copy",value:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),$d=new cr,ef=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new cr(1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new cr(-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:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y)}},{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}},{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))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return $d.copy(e).clamp(this.min,this.max).sub(e).length()}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),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}();ef.prototype.isBox2=!0;var tf=new wr,nf=new wr,rf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wr;_(this,e),this.start=t,this.end=n}return T(e,[{key:"set",value:function(e,t){return this.start.copy(e),this.end.copy(t),this}},{key:"copy",value:function(e){return this.start.copy(e.start),this.end.copy(e.end),this}},{key:"getCenter",value:function(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}},{key:"delta",value:function(e){return e.subVectors(this.end,this.start)}},{key:"distanceSq",value:function(){return this.start.distanceToSquared(this.end)}},{key:"distance",value:function(){return this.start.distanceTo(this.end)}},{key:"at",value:function(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}},{key:"closestPointToPointParameter",value:function(e,t){tf.subVectors(e,this.start),nf.subVectors(this.end,this.start);var n=nf.dot(nf),r=nf.dot(tf)/n;return t&&(r=rr(r,0,1)),r}},{key:"closestPointToPoint",value:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}},{key:"applyMatrix4",value:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}},{key:"equals",value:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),e}(),of=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}(Mi);of.prototype.isImmediateRenderObject=!0;var af=new wr,sf=function(e){p(n,e);var t=m(n);function n(e,r){var i;_(this,n),(i=t.call(this)).light=e,i.light.updateMatrixWorld(),i.matrix=e.matrixWorld,i.matrixAutoUpdate=!1,i.color=r;for(var o=new mo,a=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],s=0,u=1;s<32;s++,u++){var l=s/32*Math.PI*2,c=u/32*Math.PI*2;a.push(Math.cos(l),Math.sin(l),1,Math.cos(c),Math.sin(c),1)}o.setAttribute("position",new ro(a,3));var h=new nl({fog:!1,toneMapped:!1});return i.cone=new hl(o,h),i.add(i.cone),i.update(),i}return T(n,[{key:"dispose",value:function(){this.cone.geometry.dispose(),this.cone.material.dispose()}},{key:"update",value:function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),af.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(af),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}]),n}(Mi),uf=new wr,lf=new $r,cf=new $r,hf=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;r0&&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 Vi(o),a=new Vi(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 mo;return m.setAttribute("position",new ro(c,3)),m.setAttribute("color",new ro(h,3)),(e=t.call(this,m,new nl({vertexColors:!0,toneMapped:!1}))).type="GridHelper",e}return n}(hl),yf=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]:16,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4473924,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8947848;_(this,n),s=new Vi(s),u=new Vi(u);for(var l=[],c=[],h=0;h<=i;h++){var d=h/i*(2*Math.PI),f=Math.sin(d)*r,p=Math.cos(d)*r;l.push(0,0,0),l.push(f,0,p);var v=1&h?s:u;c.push(v.r,v.g,v.b),c.push(v.r,v.g,v.b)}for(var m=0;m<=o;m++)for(var g=1&m?s:u,y=r-r/o*m,b=0;b1&&void 0!==arguments[1]?arguments[1]:16776960;_(this,n);var o=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),a=new Float32Array(24),s=new mo;return s.setIndex(new Qi(o,1)),s.setAttribute("position",new Qi(a,3)),(r=t.call(this,s,new nl({color:i,toneMapped:!1}))).object=e,r.type="BoxHelper",r.matrixAutoUpdate=!1,r.update(),r}return T(n,[{key:"update",value:function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Cf.setFromObject(this.object),!Cf.isEmpty()){var t=Cf.min,n=Cf.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}},{key:"setFromObject",value:function(e){return this.object=e,this.update(),this}},{key:"copy",value:function(e){return hl.prototype.copy.call(this,e),this.object=e.object,this}}]),n}(hl),kf=function(e){p(n,e);var t=m(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;_(this,n);var o=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),a=new mo;return a.setIndex(new Qi(o,1)),a.setAttribute("position",new ro([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),(r=t.call(this,a,new nl({color:i,toneMapped:!1}))).box=e,r.type="Box3Helper",r.geometry.computeBoundingSphere(),r}return T(n,[{key:"updateMatrixWorld",value:function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),f(x(n.prototype),"updateMatrixWorld",this).call(this,e))}}]),n}(hl),Df=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,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16776960;_(this,n);var a=o,s=new mo;s.setAttribute("position",new ro([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),s.computeBoundingSphere(),(r=t.call(this,s,new nl({color:a,toneMapped:!1}))).type="PlaneHelper",r.plane=e,r.size=i;var u=new mo;return u.setAttribute("position",new ro([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),u.computeBoundingSphere(),r.add(new Ro(u,new Wi({color:a,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1}))),r}return T(n,[{key:"updateMatrixWorld",value:function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?I:A,this.lookAt(this.plane.normal),f(x(n.prototype),"updateMatrixWorld",this).call(this,e)}}]),n}(ul),Pf=new wr,Rf=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new wr(0,0,1),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new wr(0,0,0),o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16776960,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.2*o,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.2*s;return _(this,n),(e=t.call(this)).type="ArrowHelper",void 0===Af&&((Af=new mo).setAttribute("position",new ro([0,0,0,0,1,0],3)),(If=new Sl(0,.5,1,5,1)).translate(0,-.5,0)),e.position.copy(i),e.line=new ul(Af,new nl({color:a,toneMapped:!1})),e.line.matrixAutoUpdate=!1,e.add(e.line),e.cone=new Ro(If,new Wi({color:a,toneMapped:!1})),e.cone.matrixAutoUpdate=!1,e.add(e.cone),e.setDirection(r),e.setLength(o,s,u),e}return T(n,[{key:"setDirection",value:function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Pf.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Pf,t)}}},{key:"setLength",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2*e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2*t;this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}},{key:"setColor",value:function(e){this.line.material.color.set(e),this.cone.material.color.set(e)}},{key:"copy",value:function(e){return f(x(n.prototype),"copy",this).call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}]),n}(Mi),Of=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;_(this,n);var i=[0,0,0,r,0,0,0,0,0,0,r,0,0,0,0,0,0,r],o=new mo;return o.setAttribute("position",new ro(i,3)),o.setAttribute("color",new ro([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),(e=t.call(this,o,new nl({vertexColors:!0,toneMapped:!1}))).type="AxesHelper",e}return T(n,[{key:"setColors",value:function(e,t,n){var r=new Vi,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}},{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose()}}]),n}(hl),Lf=new Float32Array(1),jf=new Int32Array(Lf.buffer),Bf=function(){function e(){_(this,e)}return T(e,null,[{key:"toHalfFloat",value:function(e){Lf[0]=e;var t=jf[0],n=t>>16&32768,r=t>>12&2047,i=t>>23&255;return i<103?n:i>142?(n|=31744,n|=(255==i?0:1)&&8388607&t):i<113?n|=((r|=2048)>>114-i)+(r>>113-i&1):(n|=i-112<<10|r>>1,n+=1&r)}}]),e}(),Uf=Math.pow(2,8),Ff=[.125,.215,.35,.446,.526,.582],zf=5+Ff.length,Gf=(l(r={},hn,0),l(r,dn,1),l(r,pn,2),l(r,mn,3),l(r,gn,4),l(r,yn,5),l(r,fn,6),r),Hf=new Wi({side:I,depthWrite:!1,depthTest:!1}),Vf=new Ro(new Lo,Hf),Wf=new Hh,Yf=function(){for(var e=[],t=[],n=[],r=8,i=0;i4?a=Ff[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 mo;b.setAttribute("position",new Qi(h,3)),b.setAttribute("uv",new Qi(d,2)),b.setAttribute("faceIndex",new Qi(f,1)),e.push(b),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),Xf=Yf._lodPlanes,Qf=Yf._sizeLods,qf=Yf._sigmas,Zf=new Vi,Jf=null,Kf=(1+Math.sqrt(5))/2,$f=1/Kf,ep=[new wr(1,1,1),new wr(-1,1,1),new wr(1,1,-1),new wr(-1,1,-1),new wr(0,Kf,$f),new wr(0,Kf,-$f),new wr($f,0,Kf),new wr(-$f,0,Kf),new wr(Kf,$f,0),new wr(-Kf,$f,0)];function tp(e){var t=Math.max(e.r,e.g,e.b),n=Math.min(Math.max(Math.ceil(Math.log2(t)),-128),127);return e.multiplyScalar(Math.pow(2,-n)),(n+128)/255}var np=function(){function e(t){var n,r;_(this,e),this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=(n=new Float32Array(20),r=new wr(0,1,0),new Vc({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r},inputEncoding:{value:Gf[hn]},outputEncoding:{value:Gf[hn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:D,depthTest:!1,depthWrite:!1})),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}return T(e,[{key:"fromScene",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;Jf=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}},{key:"fromEquirectangular",value:function(e){return this._fromTexture(e)}},{key:"fromCubemap",value:function(e){return this._fromTexture(e)}},{key:"compileCubemapShader",value:function(){null===this._cubemapShader&&(this._cubemapShader=sp(),this._compileMaterial(this._cubemapShader))}},{key:"compileEquirectangularShader",value:function(){null===this._equirectShader&&(this._equirectShader=ap(),this._compileMaterial(this._equirectShader))}},{key:"dispose",value:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e2?Uf:0,Uf,Uf),s.setRenderTarget(r),h&&s.render(Vf,i),s.render(e,i)}s.toneMapping=c,s.outputEncoding=l,s.autoClear=u}},{key:"_textureToCubeUV",value:function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=sp()):null==this._equirectShader&&(this._equirectShader=ap());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Ro(Xf[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=Gf[e.encoding],o.outputEncoding.value=Gf[t.texture.encoding],op(t,0,0,3*Uf,2*Uf),n.setRenderTarget(t),n.render(i,Wf)}},{key:"_applyPMREM",value:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;r20&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(p," samples when the maximum is set to 20"));for(var v=[],m=0,g=0;g<20;++g){var y=g/f,b=Math.exp(-y*y/2);v.push(b),0==g?m+=b:g4?r-8+4:0),3*_,2*_),s.setRenderTarget(t),s.render(l,Wf)}}]),e}();function rp(e){return void 0!==e&&e.type===Be&&(e.encoding===hn||e.encoding===dn||e.encoding===fn)}function ip(e){var t=new yr(3*Uf,3*Uf,e);return t.texture.mapping=Te,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function op(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function ap(){var e=new cr(1,1);return new Vc({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:Gf[hn]},outputEncoding:{value:Gf[hn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:D,depthTest:!1,depthWrite:!1})}function sp(){return new Vc({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Gf[hn]},outputEncoding:{value:Gf[hn]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:D,depthTest:!1,depthWrite:!1})}var up=0,lp=1,cp=0,hp=1,dp=2;function fp(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function pp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function vp(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new yl(e,t)}function mp(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Ou(e)}function gp(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new yl(e,t)}function yp(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new fl(e)}function bp(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new fl(e)}function xp(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new fl(e)}function _p(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new wr(e,t,n)}function wp(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Qi(e,t).setUsage(Fn)}function Tp(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new qi(e,t)}function Mp(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Zi(e,t)}function Sp(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Ji(e,t)}function Ep(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Ki(e,t)}function Ap(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new $i(e,t)}function Ip(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new eo(e,t)}function Cp(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new to(e,t)}function Np(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new ro(e,t)}function kp(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new io(e,t)}function Dp(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Of(e)}function Pp(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Nf(e,t)}function Rp(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new hl(new Pl(e.geometry),new nl({color:void 0!==t?t:16777215}))}function Op(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new hl(new zc(e.geometry),new nl({color:void 0!==t?t:16777215}))}function Lp(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new xh(e)}function jp(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Sh(e)}function Bp(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Wo(e,n)}function Up(){console.error("THREE.CanvasRenderer has been removed")}function Fp(){console.error("THREE.JSONLoader has been removed.")}Rl.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Rl.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Ih.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},gf.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},hf.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},yh.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Jh.extractUrlBase(e)},yh.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},ef.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},ef.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},ef.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},ef.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},Sr.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Sr.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Sr.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Sr.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},Sr.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},Vr.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Ko.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},rf.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},dr.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},dr.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},dr.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},dr.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},dr.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},dr.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},$r.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},$r.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},$r.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new wr).setFromMatrixColumn(this,3)},$r.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},$r.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},$r.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},$r.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},$r.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},$r.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},$r.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},$r.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},$r.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},$r.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},$r.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},$r.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},$r.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},$r.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},$r.prototype.makeFrustum=function(e,t,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,o)},$r.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},qo.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},_r.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},_r.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},Kr.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},Kr.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},Kr.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},Oi.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Oi.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},Oi.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},Oi.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},Oi.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},Oi.barycoordFromPoint=function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Oi.getBarycoord(e,t,n,r,i)},Oi.normal=function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Oi.getNormal(e,t,n,r)},Ch.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},Ch.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ac(this,e)},Ch.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Rc(this,e)},cr.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},cr.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},cr.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},wr.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},wr.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},wr.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},wr.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},wr.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},wr.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},wr.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},wr.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},wr.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},gr.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},gr.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Mi.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},Mi.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Mi.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},Mi.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},Mi.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(Mi.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Ro.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(Ro.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),un},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Wu.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Go.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Nh.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Qi.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Fn},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Fn)}}}),Qi.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Fn:Un),this},Qi.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Qi.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},mo.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},mo.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Qi(arguments[1],arguments[2])))},mo.prototype.addDrawCall=function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},mo.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},mo.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},mo.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},mo.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(mo.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),yu.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Fn:Un),this},yu.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Ac.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Ac.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Ac.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},gu.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Wd.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(ji.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Vi}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===N}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Fo.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),fu.prototype.clearTarget=function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},fu.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},fu.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},fu.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},fu.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},fu.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},fu.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},fu.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},fu.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},fu.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},fu.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},fu.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},fu.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},fu.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},fu.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},fu.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},fu.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},fu.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},fu.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},fu.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},fu.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},fu.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},fu.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},fu.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},fu.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(fu.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?dn:hn}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(ru.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(yr.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Sd.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new dd).load(e,(function(e){t.setBuffer(e)})),this},kd.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Ho.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Ho.prototype.clear=function(e,t,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,n,r)},fr.crossOrigin=void 0,fr.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Eh;i.setCrossOrigin(this.crossOrigin);var o=i.load(e,n,void 0,r);return t&&(o.mapping=t),o},fr.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Mh;i.setCrossOrigin(this.crossOrigin);var o=i.load(e,n,void 0,r);return t&&(o.mapping=t),o},fr.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},fr.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var zp={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function Gp(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:i}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=i)},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(25),i=n(101),o=n(102),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(126),i=n(129);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 R={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 O(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):O(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=R,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=O;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},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function O(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[O];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),R[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||R[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(O(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 +92,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=O(e)),e instanceof _?e.format():_.prototype.format.call(e)},resolve:function(e,t){return O(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,q={},Z=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,13 +113,13 @@ 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 Ee(e,{width:n,height:r}),s=e instanceof Float32Array?i.r.FLOAT:i.r.UNSIGNED_BYTE;return new t(a,Object.assign(Se,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,Ee,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}(Ee),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,E=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=(e=E,"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 S=E.getParameter(E.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=S;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+E)/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+S/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+S/(B=Math.sqrt(L*L+j*j))),M=P+R*U,L=I*(O=w-D)+N*(R=E-P),j=C*O+k*R,w=D+O*(U=1+S/(B=Math.sqrt(L*L+j*j))),E=P+R*U}i.save(),i.beginPath(),i.moveTo(x,T),i.lineTo(_,M),i.lineTo(w,E),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*E+M*b-y*E-g*M-T*b,W=p*M+T*m+v*E-M*m-T*v-p*E,Y=p*y*E+g*M*m+T*v*b-T*y*m-g*v*E-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 E=T.slice(-1)[0],S=(n.host||e.host||T.length>1)&&("."===E||".."===E)||""===E,A=0,I=T.length;I>=0;I--)"."===(E=T[I])?T.splice(I,1):".."===E?(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(""),S&&"/"!==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=E(o,e[o],e[o+1],a);return a&&b(a,a.next)&&(S(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(S(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),S(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),S(r),S(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 E(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 S(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 Z[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),Oe=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,Oe,Re,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 Z[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=q[i];return o||(q[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),Zt=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,R=x-D,O=T-P,L=I*R+N*O,j=C*R+k*O,B=Math.sqrt(L*L+j*j),U=1+E/B;x=D+R*U,T=P+O*U,L=I*(R=_-D)+N*(O=M-P),j=C*R+k*O,_=D+R*(U=1+E/(B=Math.sqrt(L*L+j*j))),M=P+O*U,L=I*(R=w-D)+N*(O=S-P),j=C*R+k*O,w=D+R*(U=1+E/(B=Math.sqrt(L*L+j*j))),S=P+O*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(109);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?R+="x":R+=P[O];if(!R.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(23)(n(14),"Map");e.exports=r},function(e,t,n){var r=n(151),i=n(61),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(62),i=n(158),o=n(66);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){(function(e){var r=n(14),i=n(155),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(26)(e))},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(50),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(26)(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(62),i=n(174),o=n(66);e.exports=function(e){return o(e)?r(e,!0):i(e)}},function(e,t,n){var r=n(57);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){var r=n(112);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(22),i=n(164),o=n(165),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(169);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(18))},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(27),i=n(121),o=n(122),a=n(123),s=n(124),u=n(125);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(130),i=n(137),o=n(139),a=n(140),s=n(141);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(34),i=n(64);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){var r=n(68),i=n(37),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(171);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(60),i=n(70),o=n(39),a=n(61),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(65)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){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"==M(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=39)}([function(e,t){e.exports=n(16)},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){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){n.r(t),n.d(t,"TransactionPlayer",(function(){return Ge}));var r=n(0),i=function(){function e(){_(this,e),this.camera=new r.OrthographicCamera(10,10,10,10),this.camera.position.z=100,this.camera.position.x=0,this.camera.position.y=0}return T(e,[{key:"focus",value:function(e,t){e.position.z=50}},{key:"updateAspect",value:function(e,t){this.camera.left=-1*e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-1*t/2,this.camera.updateProjectionMatrix()}}]),e}(),a={linear:function(e,t,n,r){return n*e/r+t},easeIn:function(e,t,n,r){return n*(e/=r)*e+t},strongEaseIn:function(e,t,n,r){return n*(e/=r)*e*e*e*e+t},strongEaseOut:function(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},sineaseIn:function(e,t,n,r){return n*(e/=r)*e*e+t},sineaseOut:function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}},s=new r.Texture,u=function(){function e(){_(this,e),this.camera=new i,this.mesh=new r.Mesh,this.material=null,this.geometry=null}return T(e,[{key:"applyOptions",value:function(e){}},{key:"addObjects",value:function(e){this.mesh.position.z=50,e.add(this.mesh)}},{key:"setSize",value:function(e,t){this.camera.updateAspect(e,t),this.geometry=new r.PlaneGeometry(e,t,1,1),this.material=new r.ShaderMaterial({fragmentShader:this.fragmentShader,vertexShader:"\nvarying vec2 vUv;\nvoid main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"}),this.material.uniforms={width:{value:e},height:{value:t},timePercent:{value:0},texturePrev:{value:s},textureNext:{value:s}},this.applyOptions(this.options),this.mesh.geometry=this.geometry,this.mesh.material=this.material}},{key:"setPrevTexture",value:function(e){this.material.uniforms.texturePrev.value=e}},{key:"setNextTexture",value:function(e){this.material.uniforms.textureNext.value=e}},{key:"updateAnimation",value:function(e){this.material.uniforms.timePercent.value=e}},{key:"dispose",value:function(){var e,t;null===(e=this.geometry)||void 0===e||e.dispose(),null===(t=this.material)||void 0===t||t.dispose()}}]),e}(),c=n(3),h=n.n(c),d=n(4),v=n.n(d),g=n(5),y=n.n(g),b=n(6),w=n.n(b),M=n(7),S=n.n(M),E=n(8),A=n.n(E),I=n(9),C=n.n(I),N=n(10),k=n.n(N),D=n(11),P=n.n(D),R=n(12),O=n.n(R),L=n(13),j=n.n(L),B=n(14),U=n.n(B),F=n(15),z=n.n(F),G=n(16),H=n.n(G),V=function(){function e(){_(this,e),this.camera=new r.PerspectiveCamera(60,1,1,2e3),this.camera.position.z=1e3,this.camera.position.x=0,this.camera.position.y=0}return T(e,[{key:"updateAspect",value:function(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix()}},{key:"focus",value:function(e,t){var n=.5*t/Math.tan(Math.PI/6);e.position.z=1e3-n}}]),e}(),W=function(){function e(){_(this,e),this.prevTexture=s,this.nextTexture=s,this.geometry=new r.BufferGeometry,this.material=null,this.camera=new V,this.mesh=new r.Mesh,this.textureWidth=0,this.textureHeight=0}return T(e,[{key:"horizontalSegments",value:function(){return Math.ceil(this.verticalSegments*this.textureWidth/this.textureHeight)}},{key:"applyOptions",value:function(e){this.options=e}},{key:"initMesh",value:function(e,t){for(var n=this,i=[],a=[],s=[],u=this.verticalSegments,l=this.horizontalSegments(),c=e/2,h=t/2,d=e/l,f=t/u,p=this.extraAttributes(),v=Object.keys(p),m=v.reduce((function(e,t){return e[t]=[],e}),{}),g=function(e){for(var t=e*f-h,n=function(n){var r=n*d-c;a.push(r,-t,0),s.push(1*n/l,1-1*e/u),v.forEach((function(t){var r;return(r=m[t]).push.apply(r,o(p[t].generator(e,n)))})),a.push(r+d,-t,0),s.push(1*(n+1)/l,1-1*e/u),v.forEach((function(t){var r;return(r=m[t]).push.apply(r,o(p[t].generator(e,n)))})),a.push(r,-t-f,0),s.push(1*n/l,1-1*(e+1)/u),v.forEach((function(t){var r;return(r=m[t]).push.apply(r,o(p[t].generator(e,n)))})),a.push(r+d,-t-f,0),s.push(1*(n+1)/l,1-1*(e+1)/u),v.forEach((function(t){var r;return(r=m[t]).push.apply(r,o(p[t].generator(e,n)))}))},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 V,this.duration=6e3,this.options=[],this.prevMesh=new r.Mesh,this.nextMesh=new r.Mesh,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 r.MeshBasicMaterial({map:e});this.nextMesh.material=t}},{key:"setPrevTexture",value:function(e){var t=new r.MeshBasicMaterial({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 r.PlaneGeometry(e,t,1,1);this.prevMesh.geometry=n;var i=new r.PlaneGeometry(e,t,1,1);this.nextMesh.geometry=i,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 V,this.duration=6e3,this.preset=null,this.presetZ=0,this.mesh=new r.Mesh,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 r.MeshBasicMaterial({map:e})),t.push(new r.MeshBasicMaterial({map:e})),t.push(new r.MeshBasicMaterial({map:e})),this.mesh.material=t}},{key:"setPrevTexture",value:function(e){var t=Array.isArray(this.mesh.material)?this.mesh.material:[];t.push(new r.MeshBasicMaterial({map:e})),t.push(new r.MeshBasicMaterial({map:e})),t.push(new r.MeshBasicMaterial({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 r.BoxGeometry(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 V,this.duration=1600,this.options=[],this.width=100,this.preMaterial=new r.ShaderMaterial({fragmentShader:Fe.a,vertexShader:Be.a,uniforms:{prevTexture:{value:s},timePercent:{value:0},offset:{value:0}}}),this.prevGeometry=new r.BufferGeometry,this.prevMesh=new r.Mesh,this.nextMesh=new r.Mesh}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 r.MeshBasicMaterial({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,i=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 o=this.options.find((function(e){return"dir"===e.name})),a=o&&"vert"===o.value?0:1;this.preMaterial.uniforms.option={value:a},1===a?(this.prevGeometry.setAttribute("position",new r.Float32BufferAttribute([-n,i,0,-n,0,0,n,i,0,-n,0,0,n,0,0,n,i,0,-n,0,0,-n,-i,0,n,0,0,-n,-i,0,n,-i,0,n,0,0],3)),this.prevGeometry.setAttribute("uv",new r.Float32BufferAttribute([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 r.Float32BufferAttribute([-n,i,0,-n,-i,0,0,i,0,-n,-i,0,0,-i,0,0,i,0,0,i,0,0,-i,0,n,i,0,0,-i,0,n,-i,0,n,i,0],3)),this.prevGeometry.setAttribute("uv",new r.Float32BufferAttribute([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 r.Float32BufferAttribute([1,1,1,1,1,1,0,0,0,0,0,0],1)),this.nextMesh.geometry=new r.PlaneGeometry(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}()},Ge=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 r.Scene,this.delay=0,this.easeFn=a.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 r.WebGLRenderer({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=a[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 ze[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}()}])},function(e,t,n){(function(e){var r=n(73),i=n(74),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?2===o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,s):this[o[0]]=o[1]:3===o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=s?s.replace(o[1],o[2]):void 0:this[o[0]]=s?o[1].call(this,s,o[2]):void 0:4===o.length&&(this[o[0]]=s?o[3].call(this,s.replace(o[1],o[2])):void 0):this[o]=s||void 0;u+=2}},b=function(e,t){for(var n in t)if("object"==M(t[n])&&t[n].length>0){for(var r=0;r255?g(e,255):e,this},this.setUA(r),this};w.VERSION="1.0.2",w.BROWSER=p([s,c,"major"]),w.CPU=p(["architecture"]),w.DEVICE=p([a,l,u,"console",h,f,d,"wearable","embedded"]),w.ENGINE=w.OS=p([s,c]),void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=w),t.UAParser=w):n(149)?void 0===(r=function(){return w}.call(t,n,t,e))||(e.exports=r):void 0!==i&&(i.UAParser=w);var T=void 0!==i&&(i.jQuery||i.Zepto);if(T&&!T.ua){var E=new w;T.ua=E.getResult(),T.ua.get=function(){return E.getUA()},T.ua.set=function(e){E.setUA(e);var t=E.getResult();for(var n in t)T.ua[n]=t[n]}}}("object"==("undefined"==typeof window?"undefined":M(window))?window:this)},function(e,t,n){(function(n){var r; +var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=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,s,u=a(e),l=1;l0?2===o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,s):this[o[0]]=o[1]:3===o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=s?s.replace(o[1],o[2]):void 0:this[o[0]]=s?o[1].call(this,s,o[2]):void 0:4===o.length&&(this[o[0]]=s?o[3].call(this,s.replace(o[1],o[2])):void 0):this[o]=s||void 0;u+=2}},b=function(e,t){for(var n in t)if("object"==M(t[n])&&t[n].length>0){for(var r=0;r255?g(e,255):e,this},this.setUA(r),this};w.VERSION="1.0.2",w.BROWSER=p([s,c,"major"]),w.CPU=p(["architecture"]),w.DEVICE=p([a,l,u,"console",h,f,d,"wearable","embedded"]),w.ENGINE=w.OS=p([s,c]),void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=w),t.UAParser=w):n(113)?void 0===(r=function(){return w}.call(t,n,t,e))||(e.exports=r):void 0!==i&&(i.UAParser=w);var T=void 0!==i&&(i.jQuery||i.Zepto);if(T&&!T.ua){var S=new w;T.ua=S.getResult(),T.ua.get=function(){return S.getUA()},T.ua.set=function(e){S.setUA(e);var t=S.getResult();for(var n in t)T.ua[n]=t[n]}}}("object"==("undefined"==typeof window?"undefined":M(window))?window:this)},function(e,t,n){(function(n){var r; /*! * howler.js v2.2.3 * howlerjs.com @@ -122,19 +128,14 @@ var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.pr * goldfirestudios.com * * MIT License - */!function(){var i=function(){this.init()};i.prototype={init:function(){var e=this||o;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||o;if(e=parseFloat(e),t.ctx||f(),void 0!==e&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,o.ctx.currentTime);for(var n=0;n=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,f()),e},codecs:function(e){return(this||o)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||o;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||o,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var n=t.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",i=r.match(/OPR\/([0-6].)/g),a=i&&parseInt(i[0].split("/")[1],10)<33,s=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),u=r.match(/Version\/(.*?) /),l=s&&u&&parseInt(u[1],10)<15;return e._codecs={mp3:!(a||!n&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||o;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function t(n){for(;e._html5AudioPool.length0?s._seek:n._sprite[e][0]/1e3),c=Math.max(0,(n._sprite[e][0]+n._sprite[e][1])/1e3-l),h=1e3*c/Math.abs(s._rate),d=n._sprite[e][0]/1e3,f=(n._sprite[e][0]+n._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var p=function(){s._paused=!1,s._seek=l,s._start=d,s._stop=f,s._loop=!(!s._loop&&!n._sprite[e][2])};if(!(l>=f)){var v=s._node;if(n._webAudio){var m=function(){n._playLock=!1,p(),n._refreshBuffer(s);var e=s._muted||n._muted?0:s._volume;v.gain.setValueAtTime(e,o.ctx.currentTime),s._playStart=o.ctx.currentTime,void 0===v.bufferSource.start?s._loop?v.bufferSource.noteGrainOn(0,l,86400):v.bufferSource.noteGrainOn(0,l,c):s._loop?v.bufferSource.start(0,l,86400):v.bufferSource.start(0,l,c),h!==1/0&&(n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),h)),t||setTimeout((function(){n._emit("play",s._id),n._loadQueue()}),0)};"running"===o.state&&"interrupted"!==o.ctx.state?m():(n._playLock=!0,n.once("resume",m),n._clearTimer(s._id))}else{var g=function(){v.currentTime=l,v.muted=s._muted||n._muted||o._muted||v.muted,v.volume=s._volume*o.volume(),v.playbackRate=s._rate;try{var r=v.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(n._playLock=!0,p(),r.then((function(){n._playLock=!1,v._unlocked=!0,t?n._loadQueue():n._emit("play",s._id)})).catch((function(){n._playLock=!1,n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):t||(n._playLock=!1,p(),n._emit("play",s._id)),v.playbackRate=s._rate,v.paused)return void n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),h):(n._endTimers[s._id]=function(){n._ended(s),v.removeEventListener("ended",n._endTimers[s._id],!1)},v.addEventListener("ended",n._endTimers[s._id],!1))}catch(e){n._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===v.src&&(v.src=n._src,v.load());var y=window&&window.ejecta||!v.readyState&&o._navigator.isCocoonJS;if(v.readyState>=3||y)g();else{n._playLock=!0,n._state="loading";v.addEventListener(o._canPlayEvent,(function e(){n._state="loaded",g(),v.removeEventListener(o._canPlayEvent,e,!1)}),!1),n._clearTimer(s._id)}}return s._id}n._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if(!(void 0!==e&&e>=0&&e<=1))return(n=t?r._soundById(t):r._sounds[0])?n._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,i)}}),r;void 0===t&&(r._volume=e),t=r._getSoundIds(t);for(var u=0;u0?r/l:r),h=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var i=(Date.now()-h)/r;h=Date.now(),s+=u*i,s=Math.round(100*s)/100,s=u<0?Math.max(n,s):Math.min(n,s),a._webAudio?e._volume=s:a.volume(s,e._id,!0),o&&(a._volume=s),(nt&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,a.volume(n,e._id),a._emit("fade",e._id))}),c)},_stopFade:function(e){var t=this._soundById(e);return t&&t._interval&&(this._webAudio&&t._node.gain.cancelScheduledValues(o.ctx.currentTime),clearInterval(t._interval),t._interval=null,this.volume(t._fadeTo,e),t._fadeTo=null,this._emit("fade",e)),this},loop:function(){var e,t,n,r=this,i=arguments;if(0===i.length)return r._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(n=r._soundById(parseInt(i[0],10)))&&n._loop;e=i[0],r._loop=e}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var o=r._getSoundIds(t),a=0;a=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(n=r._soundById(t))?n._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,i)}}),r;void 0===t&&(r._rate=e),t=r._getSoundIds(t);for(var u=0;u=0?t=parseInt(r[0],10):n._sounds.length&&(t=n._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),t=parseInt(r[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,r)}}),n;var s=n._soundById(t);if(s){if(!("number"==typeof e&&e>=0)){if(n._webAudio){var u=n.playing(t)?o.ctx.currentTime-s._playStart:0,l=s._rateSeek?s._rateSeek-s._seek:0;return s._seek+(l+u*Math.abs(s._rate))}return s._node.currentTime}var c=n.playing(t);c&&n.pause(t,!0),s._seek=e,s._ended=!1,n._clearTimer(t),n._webAudio||!s._node||isNaN(s._node.duration)||(s._node.currentTime=e);var h=function(){c&&n.play(t,!0),n._emit("seek",t)};if(c&&!n._webAudio){var d=function e(){n._playLock?setTimeout(e,0):h()};setTimeout(d,0)}else h()}return n},playing:function(e){if("number"==typeof e){var t=this._soundById(e);return!!t&&!t._paused}for(var n=0;n=0&&o._howls.splice(r,1);var i=!0;for(n=0;n=0){i=!1;break}return u&&i&&delete u[e._src],o.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,r){var i=this["_on"+e];return"function"==typeof t&&i.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),this},off:function(e,t,n){var r=this["_on"+e],i=0;if("number"==typeof t&&(n=t,t=null),t||n)for(i=0;i=0;i--)r[i].id&&r[i].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(this,r[i].fn),0),r[i].once&&this.off(e,r[i].fn,r[i].id));return this._loadQueue(e),this},_loadQueue:function(e){if(this._queue.length>0){var t=this._queue[0];t.event===e&&(this._queue.shift(),this._loadQueue()),e||t.action()}return this},_ended:function(e){var t=e._sprite;if(!this._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;n--){if(t<=e)return;this._sounds[n]._ended&&(this._webAudio&&this._sounds[n]._node&&this._sounds[n]._node.disconnect(0),this._sounds.splice(n,1),t--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n=0;if(o._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=o._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(o._navigator&&o._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var s=function(e){this._parent=e,this.init()};s.prototype={init:function(){var e=this._parent;return this._muted=e._muted,this._loop=e._loop,this._volume=e._volume,this._rate=e._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++o._counter,e._sounds.push(this),this.create(),this},create:function(){var e=this._parent,t=o._muted||this._muted||this._parent._muted?0:this._volume;return e._webAudio?(this._node=void 0===o.ctx.createGain?o.ctx.createGainNode():o.ctx.createGain(),this._node.gain.setValueAtTime(t,o.ctx.currentTime),this._node.paused=!0,this._node.connect(o.masterGain)):o.noAudio||(this._node=o._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(o._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=e._src,this._node.preload=!0===e._preload?"auto":e._preload,this._node.volume=t*o.volume(),this._node.load()),this},reset:function(){var e=this._parent;return this._muted=e._muted,this._loop=e._loop,this._volume=e._volume,this._rate=e._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++o._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var e=this._parent;e._duration=Math.ceil(10*this._node.duration)/10,0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue()),this._node.removeEventListener(o._canPlayEvent,this._loadFn,!1)},_endListener:function(){var e=this._parent;e._duration===1/0&&(e._duration=Math.ceil(10*this._node.duration)/10,e._sprite.__default[1]===1/0&&(e._sprite.__default[1]=1e3*e._duration),e._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var u={},l=function(e){var t=e._src;if(u[t])return e._duration=u[t].duration,void d(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),r=new Uint8Array(n.length),i=0;i0?(u[t._src]=e,d(t,e)):n()};"undefined"!=typeof Promise&&1===o.ctx.decodeAudioData.length?o.ctx.decodeAudioData(e).then(r).catch(n):o.ctx.decodeAudioData(e,r,n)},d=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},f=function(){if(o.usingWebAudio){try{"undefined"!=typeof AudioContext?o.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?o.ctx=new webkitAudioContext:o.usingWebAudio=!1}catch(e){o.usingWebAudio=!1}o.ctx||(o.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(o._navigator&&o._navigator.platform),t=o._navigator&&o._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=t?parseInt(t[1],10):null;if(e&&n&&n<9){var r=/safari/.test(o._navigator&&o._navigator.userAgent.toLowerCase());o._navigator&&!r&&(o.usingWebAudio=!1)}o.usingWebAudio&&(o.masterGain=void 0===o.ctx.createGain?o.ctx.createGainNode():o.ctx.createGain(),o.masterGain.gain.setValueAtTime(o._muted?0:o._volume,o.ctx.currentTime),o.masterGain.connect(o.ctx.destination)),o._setup()}};void 0===(r=function(){return{Howler:o,Howl:a}}.apply(t,[]))||(e.exports=r),t.Howler=o,t.Howl=a,void 0!==n?(n.HowlerGlobal=i,n.Howler=o,n.Howl=a,n.Sound=s):"undefined"!=typeof window&&(window.HowlerGlobal=i,window.Howler=o,window.Howl=a,window.Sound=s)}(),function(){var e,t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){if(!this.ctx||!this.ctx.listener)return this;for(var t=this._howls.length-1;t>=0;t--)this._howls[t].stereo(e);return this},HowlerGlobal.prototype.pos=function(e,t,n){return this.ctx&&this.ctx.listener?(t="number"!=typeof t?this._pos[1]:t,n="number"!=typeof n?this._pos[2]:n,"number"!=typeof e?this._pos:(this._pos=[e,t,n],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(e,t,n,r,i,o){if(!this.ctx||!this.ctx.listener)return this;var a=this._orientation;return t="number"!=typeof t?a[1]:t,n="number"!=typeof n?a[2]:n,r="number"!=typeof r?a[3]:r,i="number"!=typeof i?a[4]:i,o="number"!=typeof o?a[5]:o,"number"!=typeof e?a:(this._orientation=[e,t,n,r,i,o],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(e,t,n,r,i,o),this)},Howl.prototype.init=(e=Howl.prototype.init,function(t){return this._orientation=t.orientation||[1,0,0],this._stereo=t.stereo||null,this._pos=t.pos||null,this._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},this._onstereo=t.onstereo?[{fn:t.onstereo}]:[],this._onpos=t.onpos?[{fn:t.onpos}]:[],this._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,t){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(e,t)}}),r;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof e)return r._stereo;r._stereo=e,r._pos=[e,0,0]}for(var o=r._getSoundIds(t),a=0;a 1.5) && (vDirection < 2.5)) {\n\t\t\tdirection = 1.0;\n\t\t}\n\t\telse if ((vDirection > 0.5) && (vDirection < 1.5)) {\n\t\t\tdirection = 2.0;\n\t\t}\n\t\telse if ((vDirection > 2.5) && (vDirection < 3.5)) {\n\t\t\tdirection = 4.0;\n\t\t}\n\t\telse {\n\t\t\tdirection = 3.0;\n\t\t}\n\t}\n\tif ((direction > 1.5) && (direction < 2.5)) {\n\t\tif (vVertexPosition.y >= (1.0 - percent)) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.y >= (1.0 - percent)) && (vVertexPosition.y <= ((1.0 - percent) + 0.2))) {\n\t\t\toutputColor = outputColor * ((vVertexPosition.y - (1.0 - percent)) / 0.2);\n\t\t}\n\t}\n\telse if ((direction > 0.5) && (direction < 1.5)) {\n\t\tif (vVertexPosition.y <= percent) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.y <= percent) && (vVertexPosition.y >= (percent - 0.2))) {\n\t\t\toutputColor = outputColor * (1.0 - ((vVertexPosition.y - (percent - 0.2)) / 0.2));\n\t\t}\n\t}\n\telse if ((direction > 2.5) && (direction < 3.5)) {\n\t\tif (vVertexPosition.x <= percent) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.x <= percent) && (vVertexPosition.x >= (percent - 0.2))) {\n\t\t\toutputColor = outputColor * (1.0 - ((vVertexPosition.x - (percent - 0.2)) / 0.2));\n\t\t}\n\t}\n\telse {\n\t\tif (vVertexPosition.x >= (1.0 - percent)) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.x >= (1.0 - percent)) && (vVertexPosition.x <= ((1.0 - percent) + 0.2))) {\n\t\t\toutputColor = outputColor * ((vVertexPosition.x - (1.0 - percent)) / 0.2);\n\t\t}\n\t}\n\tgl_FragColor = outputColor;\n}\n"},function(e,t){e.exports="attribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nuniform float percent;\nuniform float direction;\nuniform float transition;\nvec4 filterVertexPosition() {\n\tvec2 position = (aVertexPosition * max(outputFrame.zw, vec2(0.))) + outputFrame.xy;\n\treturn vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\nvec2 filterTextureCoord(vec2 aVertexPosition) {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tvTransition = transition;\n\tvDirection = direction;\n\tvPercent = percent;\n\tvVertexPosition = aVertexPosition;\n\tvec2 localVertexPosition = aVertexPosition;\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord(localVertexPosition);\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nuniform float transition;\nvoid main() {\n\tfloat alpha = (transition * (percent - 0.5)) + 0.5;\n\tvec4 color1 = texture2D(uSampler, vTextureCoord);\n\tgl_FragColor = color1 * alpha;\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 position = vec2(uBoundRect.z - filterCoord.x, uBoundRect.w - filterCoord.y);\n\tfloat timePercent = transition > 0.0 ? percent : 1.0 - percent;\n\tfloat barCount = 6.0;\n\tfloat barWidth = (option < 0.5 ? uBoundRect.w : uBoundRect.z) / barCount;\n\tfloat alphaWidthPercent = 0.03;\n\tfloat alphaWidth = alphaWidthPercent * (option < 0.5 ? uBoundRect.w : uBoundRect.z);\n\tfloat selectAxis = option < 0.5 ? -position.y : -position.x;\n\tfloat countAxis = floor(selectAxis / barWidth);\n\tfloat modAxis = mod(selectAxis, barWidth);\n\tfloat timePosition = barWidth * timePercent;\n\tif (modAxis < timePosition) {\n\t\toutputColor = outputColor;\n\t}\n\telse if (modAxis < (timePosition + alphaWidth)) {\n\t\toutputColor = (outputColor * ((alphaWidth - modAxis) + timePosition)) / alphaWidth;\n\t}\n\telse {\n\t\toutputColor = outputColor * 0.0;\n\t}\n\tgl_FragColor = outputColor;\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 position = vec2(uBoundRect.z - filterCoord.x, uBoundRect.w - filterCoord.y);\n\tfloat timePercent = transition > 0.0 ? percent : 1.0 - percent;\n\tfloat barCount = 6.0;\n\tfloat horizontalBarWidth = uBoundRect.z / barCount;\n\tfloat verticalBarWidth = uBoundRect.w / barCount;\n\tfloat alphaWidthPercent = 0.01;\n\tfloat alphaWidth = alphaWidthPercent * (option < 0.5 ? uBoundRect.z : uBoundRect.w);\n\tfloat timePosition = horizontalBarWidth * timePercent;\n\tfloat countAxisY = floor(-position.y / verticalBarWidth);\n\tfloat modAxisY = mod(-position.y, verticalBarWidth);\n\tfloat countAxisX = floor(-position.x / horizontalBarWidth);\n\tfloat modAxisX = mod(-position.x, horizontalBarWidth);\n\tfloat modAxis = modAxisX;\n\tif (option < 0.5) {\n\t\tif (mod(countAxisY, 2.0) > 0.5) {\n\t\t\tcountAxisX = floor(((horizontalBarWidth * 0.5) - position.x) / horizontalBarWidth);\n\t\t\tmodAxisX = mod((horizontalBarWidth * 0.5) - position.x, horizontalBarWidth);\n\t\t}\n\t\tmodAxis = modAxisX;\n\t}\n\telse {\n\t\tif (mod(countAxisX, 2.0) > 0.5) {\n\t\t\tcountAxisY = floor(((verticalBarWidth * 0.5) - position.y) / verticalBarWidth);\n\t\t\tmodAxisY = mod((verticalBarWidth * 0.5) - position.y, verticalBarWidth);\n\t\t}\n\t\tmodAxis = modAxisY;\n\t}\n\tif (modAxis < timePosition) {\n\t\toutputColor = outputColor;\n\t}\n\telse if (modAxis < (timePosition + alphaWidth)) {\n\t\toutputColor = (outputColor * ((alphaWidth - modAxis) + timePosition)) / alphaWidth;\n\t}\n\telse {\n\t\toutputColor = outputColor * 0.0;\n\t}\n\tgl_FragColor = outputColor;\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 inputSize;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform sampler2D dissolveSampler;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tfloat splitWidth = max(uBoundRect.z, uBoundRect.w) / 3.0;\n\tvec2 position = mod(filterCoord.xy, splitWidth);\n\tvec2 loopTime = floor(filterCoord.xy / splitWidth);\n\tif (loopTime.x > 0.5) {\n\t\tposition.x = splitWidth - position.x;\n\t}\n\tif (loopTime.y > 0.5) {\n\t\tposition.y = splitWidth - position.y;\n\t}\n\tvec4 dissolveColor = texture2D(dissolveSampler, position.xy / splitWidth);\n\tfloat timePercent = transition > 0.0 ? percent : 1.0 - percent;\n\tif (dissolveColor.r < percent) {\n\t\tgl_FragColor = outputColor;\n\t}\n\telse {\n\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform sampler2D dissolveSampler;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 position = vec2(uBoundRect.z - filterCoord.x, uBoundRect.w - filterCoord.y);\n\tvec4 dissolveColor;\n\tif (option > 0.5) {\n\t\tdissolveColor = texture2D(dissolveSampler, vec2(vTextureCoord.x, 0.0));\n\t}\n\telse {\n\t\tdissolveColor = texture2D(dissolveSampler, vec2(0.0, vTextureCoord.y));\n\t}\n\tif (dissolveColor.r < percent) {\n\t\tgl_FragColor = outputColor * min(percent + dissolveColor.r, 1.0);\n\t}\n\telse {\n\t\tgl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\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}\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tfloat timePercent = interpolationFloat(0.0, 1.0, 0.0, 1.0, percent, 2);\n\tfloat radius = sqrt(pow(uBoundRect.z, 2.0) + pow(uBoundRect.w, 2.0)) / 2.0;\n\tfloat alphaWidth = 0.1;\n\tfloat pointDistance = sqrt(pow(point.x, 2.0) + pow(point.y, 2.0));\n\tfloat alphaRadiusFormula;\n\tif (option > 0.5) {\n\t\tif (transition > 0.0) {\n\t\t\talphaRadiusFormula = 1.0 - ((pointDistance - (radius * timePercent)) / (alphaWidth * radius));\n\t\t}\n\t\telse {\n\t\t\talphaRadiusFormula = (pointDistance - (radius * timePercent)) / (alphaWidth * radius);\n\t\t}\n\t}\n\telse {\n\t\tif (transition > 0.0) {\n\t\t\talphaRadiusFormula = (pointDistance - (radius * (1.0 - timePercent))) / (alphaWidth * radius);\n\t\t}\n\t\telse {\n\t\t\talphaRadiusFormula = 1.0 - ((pointDistance - (radius * (1.0 - timePercent))) / (alphaWidth * radius));\n\t\t}\n\t}\n\tif (option > 0.5) {\n\t\tif (pointDistance < (radius * timePercent)) {\n\t\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t\t}\n\t\telse if (pointDistance < (radius * (timePercent + alphaWidth))) {\n\t\t\tgl_FragColor = outputColor * alphaRadiusFormula;\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t\t}\n\t}\n\telse {\n\t\tif (pointDistance < (radius * (1.0 - timePercent))) {\n\t\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t\t}\n\t\telse if (pointDistance < (radius * ((1.0 - timePercent) + alphaWidth))) {\n\t\t\tgl_FragColor = outputColor * alphaRadiusFormula;\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t\t}\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}\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tfloat timePercent = interpolationFloat(0.0, 1.0, 0.0, 1.0, percent, 2);\n\tif (option < 0.5) {\n\t\ttimePercent = 1.0 - timePercent;\n\t}\n\tfloat alphaWidth = 0.2;\n\tvec2 halfRect = uBoundRect.zw / 2.0;\n\tvec2 absPoint = abs(point.xy);\n\tvec2 alphaFormula = vec2(((halfRect.x * (timePercent + alphaWidth)) - absPoint.x) / (halfRect.x * alphaWidth), ((halfRect.y * (timePercent + alphaWidth)) - absPoint.y) / (halfRect.y * alphaWidth));\n\tif (option < 0.5) {\n\t\tif ((absPoint.x < (halfRect.x * timePercent)) && (absPoint.y < (halfRect.y * timePercent))) {\n\t\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t\t}\n\t\telse if ((absPoint.x < (halfRect.x * (timePercent + alphaWidth))) && (absPoint.y < (halfRect.y * (timePercent + alphaWidth)))) {\n\t\t\tif (absPoint.x > absPoint.y) {\n\t\t\t\tgl_FragColor = outputColor * (transition > 0.0 ? 1.0 - alphaFormula.x : alphaFormula.x);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor * (transition > 0.0 ? 1.0 - alphaFormula.y : alphaFormula.y);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t\t}\n\t}\n\telse {\n\t\tif ((absPoint.x < (halfRect.x * timePercent)) && (absPoint.y < (halfRect.y * timePercent))) {\n\t\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t\t}\n\t\telse if ((absPoint.x < (halfRect.x * (timePercent + alphaWidth))) && (absPoint.y < (halfRect.y * (timePercent + alphaWidth)))) {\n\t\t\tif (absPoint.x > absPoint.y) {\n\t\t\t\tgl_FragColor = outputColor * (transition > 0.0 ? alphaFormula.x : 1.0 - alphaFormula.x);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor * (transition > 0.0 ? alphaFormula.y : 1.0 - alphaFormula.y);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t\t}\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}\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), (uBoundRect.w / 2.0) - filterCoord.y);\n\tfloat timePercent = interpolationFloat(0.0, 1.0, 0.0, 1.0, percent, 2);\n\tif (option < 0.5) {\n\t\ttimePercent = 1.0 - timePercent;\n\t}\n\tfloat alphaWidth = 0.1;\n\tfloat rightTop = (((2.0 * uBoundRect.w) * timePercent) - ((uBoundRect.w * point.x) / uBoundRect.z)) - point.y;\n\tfloat rightBottom = (((uBoundRect.w * point.x) / uBoundRect.z) - ((2.0 * uBoundRect.w) * timePercent)) - point.y;\n\tfloat leftTop = (((2.0 * uBoundRect.w) * timePercent) + ((uBoundRect.w * point.x) / uBoundRect.z)) - point.y;\n\tfloat leftBottom = (((-uBoundRect.w * point.x) / uBoundRect.z) - ((2.0 * uBoundRect.w) * timePercent)) - point.y;\n\tif (((option < 0.5) && (transition > 0.0)) || ((option > 0.5) && (transition < 0.0))) {\n\t\tif ((point.x >= 0.0) && (point.y >= 0.0)) {\n\t\t\tif (rightTop < (-alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t\telse if (rightTop < 0.0) {\n\t\t\t\tgl_FragColor = outputColor * (-rightTop / (alphaWidth * uBoundRect.w));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\tif ((point.x >= 0.0) && (point.y <= 0.0)) {\n\t\t\tif (rightBottom < 0.0) {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t\telse if (rightBottom < (alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = (outputColor * rightBottom) / (alphaWidth * uBoundRect.w);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t}\n\t\tif ((point.x <= 0.0) && (point.y >= 0.0)) {\n\t\t\tif (leftTop < (-alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t\telse if (leftTop < 0.0) {\n\t\t\t\tgl_FragColor = outputColor * (-leftTop / (alphaWidth * uBoundRect.w));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\tif ((point.x <= 0.0) && (point.y <= 0.0)) {\n\t\t\tif (leftBottom < 0.0) {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t\telse if (leftBottom < (alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = (outputColor * leftBottom) / (alphaWidth * uBoundRect.w);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tif ((point.x >= 0.0) && (point.y >= 0.0)) {\n\t\t\tif (rightTop < (-alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t\telse if (rightTop < 0.0) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 + (rightTop / (alphaWidth * uBoundRect.w)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t}\n\t\tif ((point.x >= 0.0) && (point.y <= 0.0)) {\n\t\t\tif (rightBottom < 0.0) {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t\telse if (rightBottom < (alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - (rightBottom / (alphaWidth * uBoundRect.w)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\tif ((point.x <= 0.0) && (point.y >= 0.0)) {\n\t\t\tif (leftTop < (-alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t\telse if (leftTop < 0.0) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 + (leftTop / (alphaWidth * uBoundRect.w)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t}\n\t\tif ((point.x <= 0.0) && (point.y <= 0.0)) {\n\t\t\tif (leftBottom < 0.0) {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t\telse if (leftBottom < (alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - (leftBottom / (alphaWidth * uBoundRect.w)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t}\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}\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tfloat timePercent = interpolationFloat(0.0, 1.0, 0.0, 1.0, percent, 2);\n\tif (option < 0.5) {\n\t\ttimePercent = 1.0 - timePercent;\n\t}\n\tfloat alphaWidth = 0.1;\n\tvec2 absPoint = abs(point);\n\tvec2 halfRect = uBoundRect.zw / 2.0;\n\tvec2 alphaFormula = vec2(((halfRect.x * (timePercent + alphaWidth)) - absPoint.x) / (halfRect.x * alphaWidth), ((halfRect.y * (timePercent + alphaWidth)) - absPoint.y) / (halfRect.y * alphaWidth));\n\tif (((option < 0.5) && (transition > 0.0)) || ((option > 0.5) && (transition < 0.0))) {\n\t\tif ((absPoint.x < ((uBoundRect.z * 0.5) * timePercent)) || (absPoint.y < ((uBoundRect.w * 0.5) * timePercent))) {\n\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t}\n\t\telse if ((absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) || (absPoint.y < ((uBoundRect.w * 0.5) * (timePercent + alphaWidth)))) {\n\t\t\tif ((absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) && (absPoint.y < ((uBoundRect.w * 0.5) * (timePercent + alphaWidth)))) {\n\t\t\t\tgl_FragColor = (outputColor * (1.0 - alphaFormula.x)) * (1.0 - alphaFormula.y);\n\t\t\t}\n\t\t\telse if (absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - alphaFormula.x);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - alphaFormula.y);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = outputColor;\n\t\t}\n\t}\n\telse {\n\t\tif ((absPoint.x < ((uBoundRect.z * 0.5) * timePercent)) || (absPoint.y < ((uBoundRect.w * 0.5) * timePercent))) {\n\t\t\tgl_FragColor = outputColor;\n\t\t}\n\t\telse if ((absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) || (absPoint.y < ((uBoundRect.w * 0.5) * (timePercent + alphaWidth)))) {\n\t\t\tif ((absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) && (absPoint.y < ((uBoundRect.w * 0.5) * (timePercent + alphaWidth)))) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - ((1.0 - alphaFormula.x) * (1.0 - alphaFormula.y)));\n\t\t\t}\n\t\t\telse if (absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) {\n\t\t\t\tgl_FragColor = outputColor * alphaFormula.x;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor * alphaFormula.y;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t}\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tvec2 absPoint = abs(point);\n\tvec2 halfRect = uBoundRect.zw / 2.0;\n\tfloat alphaWidth = 0.1;\n\tfloat timePercent = percent;\n\tif (option < 1.5) {\n\t\ttimePercent = 1.0 - timePercent;\n\t}\n\tfloat axis = (option > 0.5) && (option < 2.5) ? absPoint.y : absPoint.x;\n\tfloat compareAxis = (option > 0.5) && (option < 2.5) ? halfRect.y : halfRect.x;\n\tfloat alphaColor = abs(((timePercent * compareAxis) - axis) / (alphaWidth * compareAxis));\n\tvec4 beginColor;\n\tvec4 endColor;\n\tif ((option > 1.5) && (option < 3.5)) {\n\t\tif (transition < 0.0) {\n\t\t\tbeginColor = vec4(0, 0, 0, 0);\n\t\t\tendColor = outputColor;\n\t\t}\n\t\telse {\n\t\t\tbeginColor = outputColor;\n\t\t\tendColor = vec4(0, 0, 0, 0);\n\t\t\talphaColor = 1.0 - alphaColor;\n\t\t}\n\t}\n\telse {\n\t\tif (transition < 0.0) {\n\t\t\tbeginColor = outputColor;\n\t\t\tendColor = vec4(0, 0, 0, 0);\n\t\t\talphaColor = 1.0 - alphaColor;\n\t\t}\n\t\telse {\n\t\t\tbeginColor = vec4(0, 0, 0, 0);\n\t\t\tendColor = outputColor;\n\t\t}\n\t}\n\tif (axis < (timePercent * compareAxis)) {\n\t\tgl_FragColor = beginColor;\n\t}\n\telse if (axis < ((timePercent + alphaWidth) * compareAxis)) {\n\t\tgl_FragColor = outputColor * alphaColor;\n\t}\n\telse {\n\t\tgl_FragColor = endColor;\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x, filterCoord.y);\n\tif ((option > 0.5) && (option < 1.5)) {\n\t\tpoint = filterCoord.xy;\n\t}\n\telse if ((option > 1.5) && (option < 2.5)) {\n\t\tpoint = uBoundRect.zw - point.xy;\n\t}\n\telse if ((option > 2.5) && (option < 3.5)) {\n\t\tpoint = vec2(uBoundRect.z - filterCoord.x, filterCoord.y);\n\t}\n\telse {\n\t\tpoint = vec2(filterCoord.x, uBoundRect.w - filterCoord.y);\n\t}\n\tfloat squareCount = 16.0;\n\tfloat horzBarWidth = uBoundRect.z / squareCount;\n\tfloat verticalBarWidth = uBoundRect.w / squareCount;\n\tfloat horzCount = floor(point.x / horzBarWidth);\n\tfloat verticalCount = floor(point.y / verticalBarWidth);\n\tfloat timePercent = (percent * squareCount) * 2.5;\n\tvec4 alphaStage;\n\tif (transition > 0.0) {\n\t\talphaStage = vec4(0.2, 0.4, 0.6, 0.8);\n\t}\n\telse {\n\t\talphaStage = vec4(0.8, 0.6, 0.4, 0.2);\n\t}\n\tif ((horzCount + verticalCount) < (timePercent - 4.0)) {\n\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t}\n\telse if ((horzCount + verticalCount) < (timePercent - 3.0)) {\n\t\tgl_FragColor = outputColor * alphaStage.w;\n\t}\n\telse if ((horzCount + verticalCount) < (timePercent - 2.0)) {\n\t\tgl_FragColor = outputColor * alphaStage.z;\n\t}\n\telse if ((horzCount + verticalCount) < (timePercent - 1.0)) {\n\t\tgl_FragColor = outputColor * alphaStage.y;\n\t}\n\telse if ((horzCount + verticalCount) < timePercent) {\n\t\tgl_FragColor = outputColor * alphaStage.x;\n\t}\n\telse {\n\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\n#define PI 3.1415926538\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tvec2 start = vec2(0.0, -1.0);\n\tfloat arc = acos((dot(point.xy, start) / length(point)) / length(start));\n\tif ((point.x == 0.0) && (point.y < 0.0)) {\n\t\tarc = 0.0;\n\t}\n\tif ((point.x == 0.0) && (point.y > 0.0)) {\n\t\tarc = PI;\n\t}\n\tfloat alphaBarArcWidth = 0.3;\n\tfloat timePercent = (percent * PI) * (1.0 + alphaBarArcWidth);\n\tvec3 colorAlpha = transition > 0.0 ? vec3(1.0, (timePercent - arc) / alphaBarArcWidth, 0.0) : vec3(0.0, 1.0 - ((timePercent - arc) / alphaBarArcWidth), 1.0);\n\tif ((arc + alphaBarArcWidth) <= timePercent) {\n\t\tgl_FragColor = outputColor * colorAlpha.x;\n\t}\n\telse if (arc <= timePercent) {\n\t\tgl_FragColor = outputColor * colorAlpha.y;\n\t}\n\telse {\n\t\tgl_FragColor = outputColor * colorAlpha.z;\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\n#define PI 3.1415926538\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tvec2 start = vec2(0.0, -1.0);\n\tfloat arc = acos((dot(point.xy, start) / length(point)) / length(start));\n\tif ((point.x == 0.0) && (point.y < 0.0)) {\n\t\tarc = 0.0;\n\t}\n\tif ((point.x == 0.0) && (point.y > 0.0)) {\n\t\tarc = PI;\n\t}\n\tif (point.x < 0.0) {\n\t\tarc = (2.0 * PI) - arc;\n\t}\n\tarc = arc == 0.0 ? arc : mod(arc, (2.0 * PI) / option);\n\tfloat totalAlphaBarArcWidth = 0.75;\n\tfloat alphaBarArcWidth = totalAlphaBarArcWidth / option;\n\tfloat timePercent = ((percent * PI) * (2.0 + totalAlphaBarArcWidth)) / option;\n\tvec3 colorAlpha = transition > 0.0 ? vec3(1.0, (timePercent - arc) / alphaBarArcWidth, 0.0) : vec3(0.0, 1.0 - ((timePercent - arc) / alphaBarArcWidth), 1.0);\n\tif ((arc + alphaBarArcWidth) <= timePercent) {\n\t\tgl_FragColor = outputColor * colorAlpha.x;\n\t}\n\telse if (arc <= timePercent) {\n\t\tgl_FragColor = outputColor * colorAlpha.y;\n\t}\n\telse {\n\t\tgl_FragColor = outputColor * colorAlpha.z;\n\t}\n}\n"},function(e,t,n){var r=n(150);e.exports=function(e,t){return r(e,t)}},function(e,t,n){var r=n(24),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){(function(e){var t=n(108),r=n(111),i=n.n(r); + */!function(){var i=function(){this.init()};i.prototype={init:function(){var e=this||o;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||o;if(e=parseFloat(e),t.ctx||f(),void 0!==e&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,o.ctx.currentTime);for(var n=0;n=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,f()),e},codecs:function(e){return(this||o)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||o;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||o,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var n=t.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",i=r.match(/OPR\/([0-6].)/g),a=i&&parseInt(i[0].split("/")[1],10)<33,s=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),u=r.match(/Version\/(.*?) /),l=s&&u&&parseInt(u[1],10)<15;return e._codecs={mp3:!(a||!n&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||o;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function t(n){for(;e._html5AudioPool.length0?s._seek:n._sprite[e][0]/1e3),c=Math.max(0,(n._sprite[e][0]+n._sprite[e][1])/1e3-l),h=1e3*c/Math.abs(s._rate),d=n._sprite[e][0]/1e3,f=(n._sprite[e][0]+n._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var p=function(){s._paused=!1,s._seek=l,s._start=d,s._stop=f,s._loop=!(!s._loop&&!n._sprite[e][2])};if(!(l>=f)){var v=s._node;if(n._webAudio){var m=function(){n._playLock=!1,p(),n._refreshBuffer(s);var e=s._muted||n._muted?0:s._volume;v.gain.setValueAtTime(e,o.ctx.currentTime),s._playStart=o.ctx.currentTime,void 0===v.bufferSource.start?s._loop?v.bufferSource.noteGrainOn(0,l,86400):v.bufferSource.noteGrainOn(0,l,c):s._loop?v.bufferSource.start(0,l,86400):v.bufferSource.start(0,l,c),h!==1/0&&(n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),h)),t||setTimeout((function(){n._emit("play",s._id),n._loadQueue()}),0)};"running"===o.state&&"interrupted"!==o.ctx.state?m():(n._playLock=!0,n.once("resume",m),n._clearTimer(s._id))}else{var g=function(){v.currentTime=l,v.muted=s._muted||n._muted||o._muted||v.muted,v.volume=s._volume*o.volume(),v.playbackRate=s._rate;try{var r=v.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(n._playLock=!0,p(),r.then((function(){n._playLock=!1,v._unlocked=!0,t?n._loadQueue():n._emit("play",s._id)})).catch((function(){n._playLock=!1,n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):t||(n._playLock=!1,p(),n._emit("play",s._id)),v.playbackRate=s._rate,v.paused)return void n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),h):(n._endTimers[s._id]=function(){n._ended(s),v.removeEventListener("ended",n._endTimers[s._id],!1)},v.addEventListener("ended",n._endTimers[s._id],!1))}catch(e){n._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===v.src&&(v.src=n._src,v.load());var y=window&&window.ejecta||!v.readyState&&o._navigator.isCocoonJS;if(v.readyState>=3||y)g();else{n._playLock=!0,n._state="loading";v.addEventListener(o._canPlayEvent,(function e(){n._state="loaded",g(),v.removeEventListener(o._canPlayEvent,e,!1)}),!1),n._clearTimer(s._id)}}return s._id}n._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if(!(void 0!==e&&e>=0&&e<=1))return(n=t?r._soundById(t):r._sounds[0])?n._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,i)}}),r;void 0===t&&(r._volume=e),t=r._getSoundIds(t);for(var u=0;u0?r/l:r),h=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var i=(Date.now()-h)/r;h=Date.now(),s+=u*i,s=Math.round(100*s)/100,s=u<0?Math.max(n,s):Math.min(n,s),a._webAudio?e._volume=s:a.volume(s,e._id,!0),o&&(a._volume=s),(nt&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,a.volume(n,e._id),a._emit("fade",e._id))}),c)},_stopFade:function(e){var t=this._soundById(e);return t&&t._interval&&(this._webAudio&&t._node.gain.cancelScheduledValues(o.ctx.currentTime),clearInterval(t._interval),t._interval=null,this.volume(t._fadeTo,e),t._fadeTo=null,this._emit("fade",e)),this},loop:function(){var e,t,n,r=this,i=arguments;if(0===i.length)return r._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(n=r._soundById(parseInt(i[0],10)))&&n._loop;e=i[0],r._loop=e}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var o=r._getSoundIds(t),a=0;a=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(n=r._soundById(t))?n._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,i)}}),r;void 0===t&&(r._rate=e),t=r._getSoundIds(t);for(var u=0;u=0?t=parseInt(r[0],10):n._sounds.length&&(t=n._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),t=parseInt(r[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,r)}}),n;var s=n._soundById(t);if(s){if(!("number"==typeof e&&e>=0)){if(n._webAudio){var u=n.playing(t)?o.ctx.currentTime-s._playStart:0,l=s._rateSeek?s._rateSeek-s._seek:0;return s._seek+(l+u*Math.abs(s._rate))}return s._node.currentTime}var c=n.playing(t);c&&n.pause(t,!0),s._seek=e,s._ended=!1,n._clearTimer(t),n._webAudio||!s._node||isNaN(s._node.duration)||(s._node.currentTime=e);var h=function(){c&&n.play(t,!0),n._emit("seek",t)};if(c&&!n._webAudio){var d=function e(){n._playLock?setTimeout(e,0):h()};setTimeout(d,0)}else h()}return n},playing:function(e){if("number"==typeof e){var t=this._soundById(e);return!!t&&!t._paused}for(var n=0;n=0&&o._howls.splice(r,1);var i=!0;for(n=0;n=0){i=!1;break}return u&&i&&delete u[e._src],o.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,r){var i=this["_on"+e];return"function"==typeof t&&i.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),this},off:function(e,t,n){var r=this["_on"+e],i=0;if("number"==typeof t&&(n=t,t=null),t||n)for(i=0;i=0;i--)r[i].id&&r[i].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(this,r[i].fn),0),r[i].once&&this.off(e,r[i].fn,r[i].id));return this._loadQueue(e),this},_loadQueue:function(e){if(this._queue.length>0){var t=this._queue[0];t.event===e&&(this._queue.shift(),this._loadQueue()),e||t.action()}return this},_ended:function(e){var t=e._sprite;if(!this._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;n--){if(t<=e)return;this._sounds[n]._ended&&(this._webAudio&&this._sounds[n]._node&&this._sounds[n]._node.disconnect(0),this._sounds.splice(n,1),t--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n=0;if(o._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=o._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(o._navigator&&o._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var s=function(e){this._parent=e,this.init()};s.prototype={init:function(){var e=this._parent;return this._muted=e._muted,this._loop=e._loop,this._volume=e._volume,this._rate=e._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++o._counter,e._sounds.push(this),this.create(),this},create:function(){var e=this._parent,t=o._muted||this._muted||this._parent._muted?0:this._volume;return e._webAudio?(this._node=void 0===o.ctx.createGain?o.ctx.createGainNode():o.ctx.createGain(),this._node.gain.setValueAtTime(t,o.ctx.currentTime),this._node.paused=!0,this._node.connect(o.masterGain)):o.noAudio||(this._node=o._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(o._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=e._src,this._node.preload=!0===e._preload?"auto":e._preload,this._node.volume=t*o.volume(),this._node.load()),this},reset:function(){var e=this._parent;return this._muted=e._muted,this._loop=e._loop,this._volume=e._volume,this._rate=e._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++o._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var e=this._parent;e._duration=Math.ceil(10*this._node.duration)/10,0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue()),this._node.removeEventListener(o._canPlayEvent,this._loadFn,!1)},_endListener:function(){var e=this._parent;e._duration===1/0&&(e._duration=Math.ceil(10*this._node.duration)/10,e._sprite.__default[1]===1/0&&(e._sprite.__default[1]=1e3*e._duration),e._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var u={},l=function(e){var t=e._src;if(u[t])return e._duration=u[t].duration,void d(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),r=new Uint8Array(n.length),i=0;i0?(u[t._src]=e,d(t,e)):n()};"undefined"!=typeof Promise&&1===o.ctx.decodeAudioData.length?o.ctx.decodeAudioData(e).then(r).catch(n):o.ctx.decodeAudioData(e,r,n)},d=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},f=function(){if(o.usingWebAudio){try{"undefined"!=typeof AudioContext?o.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?o.ctx=new webkitAudioContext:o.usingWebAudio=!1}catch(e){o.usingWebAudio=!1}o.ctx||(o.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(o._navigator&&o._navigator.platform),t=o._navigator&&o._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=t?parseInt(t[1],10):null;if(e&&n&&n<9){var r=/safari/.test(o._navigator&&o._navigator.userAgent.toLowerCase());o._navigator&&!r&&(o.usingWebAudio=!1)}o.usingWebAudio&&(o.masterGain=void 0===o.ctx.createGain?o.ctx.createGainNode():o.ctx.createGain(),o.masterGain.gain.setValueAtTime(o._muted?0:o._volume,o.ctx.currentTime),o.masterGain.connect(o.ctx.destination)),o._setup()}};void 0===(r=function(){return{Howler:o,Howl:a}}.apply(t,[]))||(e.exports=r),t.Howler=o,t.Howl=a,void 0!==n?(n.HowlerGlobal=i,n.Howler=o,n.Howl=a,n.Sound=s):"undefined"!=typeof window&&(window.HowlerGlobal=i,window.Howler=o,window.Howl=a,window.Sound=s)}(),function(){var e,t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){if(!this.ctx||!this.ctx.listener)return this;for(var t=this._howls.length-1;t>=0;t--)this._howls[t].stereo(e);return this},HowlerGlobal.prototype.pos=function(e,t,n){return this.ctx&&this.ctx.listener?(t="number"!=typeof t?this._pos[1]:t,n="number"!=typeof n?this._pos[2]:n,"number"!=typeof e?this._pos:(this._pos=[e,t,n],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(e,t,n,r,i,o){if(!this.ctx||!this.ctx.listener)return this;var a=this._orientation;return t="number"!=typeof t?a[1]:t,n="number"!=typeof n?a[2]:n,r="number"!=typeof r?a[3]:r,i="number"!=typeof i?a[4]:i,o="number"!=typeof o?a[5]:o,"number"!=typeof e?a:(this._orientation=[e,t,n,r,i,o],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(e,t,n,r,i,o),this)},Howl.prototype.init=(e=Howl.prototype.init,function(t){return this._orientation=t.orientation||[1,0,0],this._stereo=t.stereo||null,this._pos=t.pos||null,this._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},this._onstereo=t.onstereo?[{fn:t.onstereo}]:[],this._onpos=t.onpos?[{fn:t.onpos}]:[],this._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,t){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(e,t)}}),r;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof e)return r._stereo;r._stereo=e,r._pos=[e,0,0]}for(var o=r._getSoundIds(t),a=0;a 1.5) && (vDirection < 2.5)) {\n\t\t\tdirection = 1.0;\n\t\t}\n\t\telse if ((vDirection > 0.5) && (vDirection < 1.5)) {\n\t\t\tdirection = 2.0;\n\t\t}\n\t\telse if ((vDirection > 2.5) && (vDirection < 3.5)) {\n\t\t\tdirection = 4.0;\n\t\t}\n\t\telse {\n\t\t\tdirection = 3.0;\n\t\t}\n\t}\n\tif ((direction > 1.5) && (direction < 2.5)) {\n\t\tif (vVertexPosition.y >= (1.0 - percent)) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.y >= (1.0 - percent)) && (vVertexPosition.y <= ((1.0 - percent) + 0.2))) {\n\t\t\toutputColor = outputColor * ((vVertexPosition.y - (1.0 - percent)) / 0.2);\n\t\t}\n\t}\n\telse if ((direction > 0.5) && (direction < 1.5)) {\n\t\tif (vVertexPosition.y <= percent) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.y <= percent) && (vVertexPosition.y >= (percent - 0.2))) {\n\t\t\toutputColor = outputColor * (1.0 - ((vVertexPosition.y - (percent - 0.2)) / 0.2));\n\t\t}\n\t}\n\telse if ((direction > 2.5) && (direction < 3.5)) {\n\t\tif (vVertexPosition.x <= percent) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.x <= percent) && (vVertexPosition.x >= (percent - 0.2))) {\n\t\t\toutputColor = outputColor * (1.0 - ((vVertexPosition.x - (percent - 0.2)) / 0.2));\n\t\t}\n\t}\n\telse {\n\t\tif (vVertexPosition.x >= (1.0 - percent)) {\n\t\t\toutputColor = texture2D(uSampler, vTextureCoord);\n\t\t}\n\t\telse {\n\t\t\toutputColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t}\n\t\tif ((vVertexPosition.x >= (1.0 - percent)) && (vVertexPosition.x <= ((1.0 - percent) + 0.2))) {\n\t\t\toutputColor = outputColor * ((vVertexPosition.x - (1.0 - percent)) / 0.2);\n\t\t}\n\t}\n\tgl_FragColor = outputColor;\n}\n"},function(e,t){e.exports="attribute vec2 aVertexPosition;\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\nvarying vec2 vVertexPosition;\nvarying float vPercent;\nvarying float vDirection;\nvarying float vTransition;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\nuniform float percent;\nuniform float direction;\nuniform float transition;\nvec4 filterVertexPosition() {\n\tvec2 position = (aVertexPosition * max(outputFrame.zw, vec2(0.))) + outputFrame.xy;\n\treturn vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\nvec2 filterTextureCoord(vec2 aVertexPosition) {\n\treturn aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\nvoid main() {\n\tvTransition = transition;\n\tvDirection = direction;\n\tvPercent = percent;\n\tvVertexPosition = aVertexPosition;\n\tvec2 localVertexPosition = aVertexPosition;\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord(localVertexPosition);\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nuniform float transition;\nvoid main() {\n\tfloat alpha = (transition * (percent - 0.5)) + 0.5;\n\tvec4 color1 = texture2D(uSampler, vTextureCoord);\n\tgl_FragColor = color1 * alpha;\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 position = vec2(uBoundRect.z - filterCoord.x, uBoundRect.w - filterCoord.y);\n\tfloat timePercent = transition > 0.0 ? percent : 1.0 - percent;\n\tfloat barCount = 6.0;\n\tfloat barWidth = (option < 0.5 ? uBoundRect.w : uBoundRect.z) / barCount;\n\tfloat alphaWidthPercent = 0.03;\n\tfloat alphaWidth = alphaWidthPercent * (option < 0.5 ? uBoundRect.w : uBoundRect.z);\n\tfloat selectAxis = option < 0.5 ? -position.y : -position.x;\n\tfloat countAxis = floor(selectAxis / barWidth);\n\tfloat modAxis = mod(selectAxis, barWidth);\n\tfloat timePosition = barWidth * timePercent;\n\tif (modAxis < timePosition) {\n\t\toutputColor = outputColor;\n\t}\n\telse if (modAxis < (timePosition + alphaWidth)) {\n\t\toutputColor = (outputColor * ((alphaWidth - modAxis) + timePosition)) / alphaWidth;\n\t}\n\telse {\n\t\toutputColor = outputColor * 0.0;\n\t}\n\tgl_FragColor = outputColor;\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 position = vec2(uBoundRect.z - filterCoord.x, uBoundRect.w - filterCoord.y);\n\tfloat timePercent = transition > 0.0 ? percent : 1.0 - percent;\n\tfloat barCount = 6.0;\n\tfloat horizontalBarWidth = uBoundRect.z / barCount;\n\tfloat verticalBarWidth = uBoundRect.w / barCount;\n\tfloat alphaWidthPercent = 0.01;\n\tfloat alphaWidth = alphaWidthPercent * (option < 0.5 ? uBoundRect.z : uBoundRect.w);\n\tfloat timePosition = horizontalBarWidth * timePercent;\n\tfloat countAxisY = floor(-position.y / verticalBarWidth);\n\tfloat modAxisY = mod(-position.y, verticalBarWidth);\n\tfloat countAxisX = floor(-position.x / horizontalBarWidth);\n\tfloat modAxisX = mod(-position.x, horizontalBarWidth);\n\tfloat modAxis = modAxisX;\n\tif (option < 0.5) {\n\t\tif (mod(countAxisY, 2.0) > 0.5) {\n\t\t\tcountAxisX = floor(((horizontalBarWidth * 0.5) - position.x) / horizontalBarWidth);\n\t\t\tmodAxisX = mod((horizontalBarWidth * 0.5) - position.x, horizontalBarWidth);\n\t\t}\n\t\tmodAxis = modAxisX;\n\t}\n\telse {\n\t\tif (mod(countAxisX, 2.0) > 0.5) {\n\t\t\tcountAxisY = floor(((verticalBarWidth * 0.5) - position.y) / verticalBarWidth);\n\t\t\tmodAxisY = mod((verticalBarWidth * 0.5) - position.y, verticalBarWidth);\n\t\t}\n\t\tmodAxis = modAxisY;\n\t}\n\tif (modAxis < timePosition) {\n\t\toutputColor = outputColor;\n\t}\n\telse if (modAxis < (timePosition + alphaWidth)) {\n\t\toutputColor = (outputColor * ((alphaWidth - modAxis) + timePosition)) / alphaWidth;\n\t}\n\telse {\n\t\toutputColor = outputColor * 0.0;\n\t}\n\tgl_FragColor = outputColor;\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 inputSize;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform sampler2D dissolveSampler;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tfloat splitWidth = max(uBoundRect.z, uBoundRect.w) / 3.0;\n\tvec2 position = mod(filterCoord.xy, splitWidth);\n\tvec2 loopTime = floor(filterCoord.xy / splitWidth);\n\tif (loopTime.x > 0.5) {\n\t\tposition.x = splitWidth - position.x;\n\t}\n\tif (loopTime.y > 0.5) {\n\t\tposition.y = splitWidth - position.y;\n\t}\n\tvec4 dissolveColor = texture2D(dissolveSampler, position.xy / splitWidth);\n\tfloat timePercent = transition > 0.0 ? percent : 1.0 - percent;\n\tif (dissolveColor.r < percent) {\n\t\tgl_FragColor = outputColor;\n\t}\n\telse {\n\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform sampler2D dissolveSampler;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 position = vec2(uBoundRect.z - filterCoord.x, uBoundRect.w - filterCoord.y);\n\tvec4 dissolveColor;\n\tif (option > 0.5) {\n\t\tdissolveColor = texture2D(dissolveSampler, vec2(vTextureCoord.x, 0.0));\n\t}\n\telse {\n\t\tdissolveColor = texture2D(dissolveSampler, vec2(0.0, vTextureCoord.y));\n\t}\n\tif (dissolveColor.r < percent) {\n\t\tgl_FragColor = outputColor * min(percent + dissolveColor.r, 1.0);\n\t}\n\telse {\n\t\tgl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\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}\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tfloat timePercent = interpolationFloat(0.0, 1.0, 0.0, 1.0, percent, 2);\n\tfloat radius = sqrt(pow(uBoundRect.z, 2.0) + pow(uBoundRect.w, 2.0)) / 2.0;\n\tfloat alphaWidth = 0.1;\n\tfloat pointDistance = sqrt(pow(point.x, 2.0) + pow(point.y, 2.0));\n\tfloat alphaRadiusFormula;\n\tif (option > 0.5) {\n\t\tif (transition > 0.0) {\n\t\t\talphaRadiusFormula = 1.0 - ((pointDistance - (radius * timePercent)) / (alphaWidth * radius));\n\t\t}\n\t\telse {\n\t\t\talphaRadiusFormula = (pointDistance - (radius * timePercent)) / (alphaWidth * radius);\n\t\t}\n\t}\n\telse {\n\t\tif (transition > 0.0) {\n\t\t\talphaRadiusFormula = (pointDistance - (radius * (1.0 - timePercent))) / (alphaWidth * radius);\n\t\t}\n\t\telse {\n\t\t\talphaRadiusFormula = 1.0 - ((pointDistance - (radius * (1.0 - timePercent))) / (alphaWidth * radius));\n\t\t}\n\t}\n\tif (option > 0.5) {\n\t\tif (pointDistance < (radius * timePercent)) {\n\t\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t\t}\n\t\telse if (pointDistance < (radius * (timePercent + alphaWidth))) {\n\t\t\tgl_FragColor = outputColor * alphaRadiusFormula;\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t\t}\n\t}\n\telse {\n\t\tif (pointDistance < (radius * (1.0 - timePercent))) {\n\t\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t\t}\n\t\telse if (pointDistance < (radius * ((1.0 - timePercent) + alphaWidth))) {\n\t\t\tgl_FragColor = outputColor * alphaRadiusFormula;\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t\t}\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}\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tfloat timePercent = interpolationFloat(0.0, 1.0, 0.0, 1.0, percent, 2);\n\tif (option < 0.5) {\n\t\ttimePercent = 1.0 - timePercent;\n\t}\n\tfloat alphaWidth = 0.2;\n\tvec2 halfRect = uBoundRect.zw / 2.0;\n\tvec2 absPoint = abs(point.xy);\n\tvec2 alphaFormula = vec2(((halfRect.x * (timePercent + alphaWidth)) - absPoint.x) / (halfRect.x * alphaWidth), ((halfRect.y * (timePercent + alphaWidth)) - absPoint.y) / (halfRect.y * alphaWidth));\n\tif (option < 0.5) {\n\t\tif ((absPoint.x < (halfRect.x * timePercent)) && (absPoint.y < (halfRect.y * timePercent))) {\n\t\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t\t}\n\t\telse if ((absPoint.x < (halfRect.x * (timePercent + alphaWidth))) && (absPoint.y < (halfRect.y * (timePercent + alphaWidth)))) {\n\t\t\tif (absPoint.x > absPoint.y) {\n\t\t\t\tgl_FragColor = outputColor * (transition > 0.0 ? 1.0 - alphaFormula.x : alphaFormula.x);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor * (transition > 0.0 ? 1.0 - alphaFormula.y : alphaFormula.y);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t\t}\n\t}\n\telse {\n\t\tif ((absPoint.x < (halfRect.x * timePercent)) && (absPoint.y < (halfRect.y * timePercent))) {\n\t\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t\t}\n\t\telse if ((absPoint.x < (halfRect.x * (timePercent + alphaWidth))) && (absPoint.y < (halfRect.y * (timePercent + alphaWidth)))) {\n\t\t\tif (absPoint.x > absPoint.y) {\n\t\t\t\tgl_FragColor = outputColor * (transition > 0.0 ? alphaFormula.x : 1.0 - alphaFormula.x);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor * (transition > 0.0 ? alphaFormula.y : 1.0 - alphaFormula.y);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t\t}\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}\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), (uBoundRect.w / 2.0) - filterCoord.y);\n\tfloat timePercent = interpolationFloat(0.0, 1.0, 0.0, 1.0, percent, 2);\n\tif (option < 0.5) {\n\t\ttimePercent = 1.0 - timePercent;\n\t}\n\tfloat alphaWidth = 0.1;\n\tfloat rightTop = (((2.0 * uBoundRect.w) * timePercent) - ((uBoundRect.w * point.x) / uBoundRect.z)) - point.y;\n\tfloat rightBottom = (((uBoundRect.w * point.x) / uBoundRect.z) - ((2.0 * uBoundRect.w) * timePercent)) - point.y;\n\tfloat leftTop = (((2.0 * uBoundRect.w) * timePercent) + ((uBoundRect.w * point.x) / uBoundRect.z)) - point.y;\n\tfloat leftBottom = (((-uBoundRect.w * point.x) / uBoundRect.z) - ((2.0 * uBoundRect.w) * timePercent)) - point.y;\n\tif (((option < 0.5) && (transition > 0.0)) || ((option > 0.5) && (transition < 0.0))) {\n\t\tif ((point.x >= 0.0) && (point.y >= 0.0)) {\n\t\t\tif (rightTop < (-alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t\telse if (rightTop < 0.0) {\n\t\t\t\tgl_FragColor = outputColor * (-rightTop / (alphaWidth * uBoundRect.w));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\tif ((point.x >= 0.0) && (point.y <= 0.0)) {\n\t\t\tif (rightBottom < 0.0) {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t\telse if (rightBottom < (alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = (outputColor * rightBottom) / (alphaWidth * uBoundRect.w);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t}\n\t\tif ((point.x <= 0.0) && (point.y >= 0.0)) {\n\t\t\tif (leftTop < (-alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t\telse if (leftTop < 0.0) {\n\t\t\t\tgl_FragColor = outputColor * (-leftTop / (alphaWidth * uBoundRect.w));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\tif ((point.x <= 0.0) && (point.y <= 0.0)) {\n\t\t\tif (leftBottom < 0.0) {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t\telse if (leftBottom < (alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = (outputColor * leftBottom) / (alphaWidth * uBoundRect.w);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tif ((point.x >= 0.0) && (point.y >= 0.0)) {\n\t\t\tif (rightTop < (-alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t\telse if (rightTop < 0.0) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 + (rightTop / (alphaWidth * uBoundRect.w)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t}\n\t\tif ((point.x >= 0.0) && (point.y <= 0.0)) {\n\t\t\tif (rightBottom < 0.0) {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t\telse if (rightBottom < (alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - (rightBottom / (alphaWidth * uBoundRect.w)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\tif ((point.x <= 0.0) && (point.y >= 0.0)) {\n\t\t\tif (leftTop < (-alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t\telse if (leftTop < 0.0) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 + (leftTop / (alphaWidth * uBoundRect.w)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t}\n\t\tif ((point.x <= 0.0) && (point.y <= 0.0)) {\n\t\t\tif (leftBottom < 0.0) {\n\t\t\t\tgl_FragColor = outputColor;\n\t\t\t}\n\t\t\telse if (leftBottom < (alphaWidth * uBoundRect.w)) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - (leftBottom / (alphaWidth * uBoundRect.w)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t\t}\n\t\t}\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}\nvarying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tfloat timePercent = interpolationFloat(0.0, 1.0, 0.0, 1.0, percent, 2);\n\tif (option < 0.5) {\n\t\ttimePercent = 1.0 - timePercent;\n\t}\n\tfloat alphaWidth = 0.1;\n\tvec2 absPoint = abs(point);\n\tvec2 halfRect = uBoundRect.zw / 2.0;\n\tvec2 alphaFormula = vec2(((halfRect.x * (timePercent + alphaWidth)) - absPoint.x) / (halfRect.x * alphaWidth), ((halfRect.y * (timePercent + alphaWidth)) - absPoint.y) / (halfRect.y * alphaWidth));\n\tif (((option < 0.5) && (transition > 0.0)) || ((option > 0.5) && (transition < 0.0))) {\n\t\tif ((absPoint.x < ((uBoundRect.z * 0.5) * timePercent)) || (absPoint.y < ((uBoundRect.w * 0.5) * timePercent))) {\n\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t}\n\t\telse if ((absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) || (absPoint.y < ((uBoundRect.w * 0.5) * (timePercent + alphaWidth)))) {\n\t\t\tif ((absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) && (absPoint.y < ((uBoundRect.w * 0.5) * (timePercent + alphaWidth)))) {\n\t\t\t\tgl_FragColor = (outputColor * (1.0 - alphaFormula.x)) * (1.0 - alphaFormula.y);\n\t\t\t}\n\t\t\telse if (absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - alphaFormula.x);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - alphaFormula.y);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = outputColor;\n\t\t}\n\t}\n\telse {\n\t\tif ((absPoint.x < ((uBoundRect.z * 0.5) * timePercent)) || (absPoint.y < ((uBoundRect.w * 0.5) * timePercent))) {\n\t\t\tgl_FragColor = outputColor;\n\t\t}\n\t\telse if ((absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) || (absPoint.y < ((uBoundRect.w * 0.5) * (timePercent + alphaWidth)))) {\n\t\t\tif ((absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) && (absPoint.y < ((uBoundRect.w * 0.5) * (timePercent + alphaWidth)))) {\n\t\t\t\tgl_FragColor = outputColor * (1.0 - ((1.0 - alphaFormula.x) * (1.0 - alphaFormula.y)));\n\t\t\t}\n\t\t\telse if (absPoint.x < ((uBoundRect.z * 0.5) * (timePercent + alphaWidth))) {\n\t\t\t\tgl_FragColor = outputColor * alphaFormula.x;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgl_FragColor = outputColor * alphaFormula.y;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tgl_FragColor = vec4(0, 0, 0, 0);\n\t\t}\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tvec2 absPoint = abs(point);\n\tvec2 halfRect = uBoundRect.zw / 2.0;\n\tfloat alphaWidth = 0.1;\n\tfloat timePercent = percent;\n\tif (option < 1.5) {\n\t\ttimePercent = 1.0 - timePercent;\n\t}\n\tfloat axis = (option > 0.5) && (option < 2.5) ? absPoint.y : absPoint.x;\n\tfloat compareAxis = (option > 0.5) && (option < 2.5) ? halfRect.y : halfRect.x;\n\tfloat alphaColor = abs(((timePercent * compareAxis) - axis) / (alphaWidth * compareAxis));\n\tvec4 beginColor;\n\tvec4 endColor;\n\tif ((option > 1.5) && (option < 3.5)) {\n\t\tif (transition < 0.0) {\n\t\t\tbeginColor = vec4(0, 0, 0, 0);\n\t\t\tendColor = outputColor;\n\t\t}\n\t\telse {\n\t\t\tbeginColor = outputColor;\n\t\t\tendColor = vec4(0, 0, 0, 0);\n\t\t\talphaColor = 1.0 - alphaColor;\n\t\t}\n\t}\n\telse {\n\t\tif (transition < 0.0) {\n\t\t\tbeginColor = outputColor;\n\t\t\tendColor = vec4(0, 0, 0, 0);\n\t\t\talphaColor = 1.0 - alphaColor;\n\t\t}\n\t\telse {\n\t\t\tbeginColor = vec4(0, 0, 0, 0);\n\t\t\tendColor = outputColor;\n\t\t}\n\t}\n\tif (axis < (timePercent * compareAxis)) {\n\t\tgl_FragColor = beginColor;\n\t}\n\telse if (axis < ((timePercent + alphaWidth) * compareAxis)) {\n\t\tgl_FragColor = outputColor * alphaColor;\n\t}\n\telse {\n\t\tgl_FragColor = endColor;\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x, filterCoord.y);\n\tif ((option > 0.5) && (option < 1.5)) {\n\t\tpoint = filterCoord.xy;\n\t}\n\telse if ((option > 1.5) && (option < 2.5)) {\n\t\tpoint = uBoundRect.zw - point.xy;\n\t}\n\telse if ((option > 2.5) && (option < 3.5)) {\n\t\tpoint = vec2(uBoundRect.z - filterCoord.x, filterCoord.y);\n\t}\n\telse {\n\t\tpoint = vec2(filterCoord.x, uBoundRect.w - filterCoord.y);\n\t}\n\tfloat squareCount = 16.0;\n\tfloat horzBarWidth = uBoundRect.z / squareCount;\n\tfloat verticalBarWidth = uBoundRect.w / squareCount;\n\tfloat horzCount = floor(point.x / horzBarWidth);\n\tfloat verticalCount = floor(point.y / verticalBarWidth);\n\tfloat timePercent = (percent * squareCount) * 2.5;\n\tvec4 alphaStage;\n\tif (transition > 0.0) {\n\t\talphaStage = vec4(0.2, 0.4, 0.6, 0.8);\n\t}\n\telse {\n\t\talphaStage = vec4(0.8, 0.6, 0.4, 0.2);\n\t}\n\tif ((horzCount + verticalCount) < (timePercent - 4.0)) {\n\t\tgl_FragColor = transition > 0.0 ? outputColor : vec4(0, 0, 0, 0);\n\t}\n\telse if ((horzCount + verticalCount) < (timePercent - 3.0)) {\n\t\tgl_FragColor = outputColor * alphaStage.w;\n\t}\n\telse if ((horzCount + verticalCount) < (timePercent - 2.0)) {\n\t\tgl_FragColor = outputColor * alphaStage.z;\n\t}\n\telse if ((horzCount + verticalCount) < (timePercent - 1.0)) {\n\t\tgl_FragColor = outputColor * alphaStage.y;\n\t}\n\telse if ((horzCount + verticalCount) < timePercent) {\n\t\tgl_FragColor = outputColor * alphaStage.x;\n\t}\n\telse {\n\t\tgl_FragColor = transition > 0.0 ? vec4(0, 0, 0, 0) : outputColor;\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\n#define PI 3.1415926538\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tvec2 start = vec2(0.0, -1.0);\n\tfloat arc = acos((dot(point.xy, start) / length(point)) / length(start));\n\tif ((point.x == 0.0) && (point.y < 0.0)) {\n\t\tarc = 0.0;\n\t}\n\tif ((point.x == 0.0) && (point.y > 0.0)) {\n\t\tarc = PI;\n\t}\n\tfloat alphaBarArcWidth = 0.3;\n\tfloat timePercent = (percent * PI) * (1.0 + alphaBarArcWidth);\n\tvec3 colorAlpha = transition > 0.0 ? vec3(1.0, (timePercent - arc) / alphaBarArcWidth, 0.0) : vec3(0.0, 1.0 - ((timePercent - arc) / alphaBarArcWidth), 1.0);\n\tif ((arc + alphaBarArcWidth) <= timePercent) {\n\t\tgl_FragColor = outputColor * colorAlpha.x;\n\t}\n\telse if (arc <= timePercent) {\n\t\tgl_FragColor = outputColor * colorAlpha.y;\n\t}\n\telse {\n\t\tgl_FragColor = outputColor * colorAlpha.z;\n\t}\n}\n"},function(e,t){e.exports="varying vec2 vTextureCoord;\nuniform float percent;\nuniform sampler2D uSampler;\nvarying vec2 filterCoord;\nuniform vec4 uBoundRect;\nuniform float transition;\nuniform float option;\n#define PI 3.1415926538\nvoid main() {\n\tvec4 outputColor = texture2D(uSampler, vTextureCoord);\n\tvec2 point = vec2(filterCoord.x - (uBoundRect.z / 2.0), filterCoord.y - (uBoundRect.w / 2.0));\n\tvec2 start = vec2(0.0, -1.0);\n\tfloat arc = acos((dot(point.xy, start) / length(point)) / length(start));\n\tif ((point.x == 0.0) && (point.y < 0.0)) {\n\t\tarc = 0.0;\n\t}\n\tif ((point.x == 0.0) && (point.y > 0.0)) {\n\t\tarc = PI;\n\t}\n\tif (point.x < 0.0) {\n\t\tarc = (2.0 * PI) - arc;\n\t}\n\tarc = arc == 0.0 ? arc : mod(arc, (2.0 * PI) / option);\n\tfloat totalAlphaBarArcWidth = 0.75;\n\tfloat alphaBarArcWidth = totalAlphaBarArcWidth / option;\n\tfloat timePercent = ((percent * PI) * (2.0 + totalAlphaBarArcWidth)) / option;\n\tvec3 colorAlpha = transition > 0.0 ? vec3(1.0, (timePercent - arc) / alphaBarArcWidth, 0.0) : vec3(0.0, 1.0 - ((timePercent - arc) / alphaBarArcWidth), 1.0);\n\tif ((arc + alphaBarArcWidth) <= timePercent) {\n\t\tgl_FragColor = outputColor * colorAlpha.x;\n\t}\n\telse if (arc <= timePercent) {\n\t\tgl_FragColor = outputColor * colorAlpha.y;\n\t}\n\telse {\n\t\tgl_FragColor = outputColor * colorAlpha.z;\n\t}\n}\n"},function(e,t,n){var r=n(114);e.exports=function(e,t){return r(e,t)}},function(e,t,n){var r=n(25),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){(function(e){var t=n(72),r=n(75),i=n.n(r); /*! * @pixi/polyfill - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC * * @pixi/polyfill is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license - */if("undefined"==typeof globalThis&&("undefined"!=typeof self?self.globalThis=self:void 0!==e&&(e.globalThis=e)),globalThis.Promise||(globalThis.Promise=t.a),Object.assign||(Object.assign=i.a),Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!globalThis.performance||!globalThis.performance.now){var o=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-o}}for(var a=Date.now(),s=["ms","moz","webkit","o"],u=0;u0?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 E=T?e.value():e,S=M?t.value():t;return v||(v=new r),p(E,S,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}(),Ee=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/Se.setFromMatrixColumn(e,0).length(),i=1/Se.setFromMatrixColumn(e,1).length(),o=1/Se.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,E=a*l,S=a*c;t[0]=s*l,t[4]=E*u-M,t[8]=T*u+S,t[1]=s*c,t[5]=S*u+T,t[9]=M*u-E,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],E=r[1],S=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*E+s*C+u*P,i[4]=o*w+a*S+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*E+h*C+d*P,i[5]=l*w+c*S+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*E+v*C+m*P,i[6]=f*w+p*S+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*E+b*C+x*P,i[7]=g*w+y*S+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=Se.set(r[0],r[1],r[2]).length(),o=Se.set(r[4],r[5],r[6]).length(),a=Se.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}();Ee.prototype.isMatrix4=!0;var Se=new Q,Ae=new Ee,Ie=new Q(0,0,0),Ce=new Q(1,1,1),Ne=new Q,ke=new Q,De=new Q,Pe=new Ee,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 Et(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 St=0,At=new Ee,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:St++}),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(Et(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,E=0,S=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),E+=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 Ee,e.projectionMatrix=new Ee,e.projectionMatrixInverse=new Ee,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 E=y.data,S=E.stride,A=y.offset;E&&E.isInstancedInterleavedBuffer?(v(d,E.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=E.meshPerAttribute*E.count)):p(d),e.bindBuffer(34962,w),g(d,x,T,b,S*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 En(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 Sn(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(),E=a.getShaderInfoLog(w).trim(),S=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):""!==E&&""!==S||(I=!1);I&&(this.diagnostics={runnable:A,programLog:M,vertexShader:{log:E,prefix:i},fragmentShader:{log:S,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 Ee,u=new Ee;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]),S=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 S(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 S=0,A=_.length;S=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=E,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=S,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);Ei.prototype.isArrayCamera=!0;var Si=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);Si.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 Si,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 Si,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 Si,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=E(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 Si;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 Ei;T.layers.enable(1),T.layers.enable(2);var M=null,E=null;function S(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,E=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,E=t.width,S=t.height,A=1,I=null,C=null,N=new V(0,0,E,S),k=new V(0,0,E,S),D=!1,P=[],O=new mn,R=!1,L=!1,j=null,B=new Ee,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 Ee,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 Ee,i.bindMatrixInverse=new Ee,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 Ee,ao=new Ee,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(),Eo.copy(n.boundingSphere),Eo.applyMatrix4(r),Eo.radius+=i,!1!==e.ray.intersectsSphere(Eo)){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 Ee,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 Ee,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 Ee,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 Ee,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 Es=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}();Es.prototype.isSphericalHarmonics3=!0;var Ss=function(e){p(n,e);var t=m(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Es,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);Ss.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})(Ss).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}(Ss).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 Ee,Ys=new Ee,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._deltaTime0?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(18))},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(105),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(18))},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(26)(e),n(18))},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(110),t.encode=t.stringify=n(111)},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(115),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(53),i=n(56),o=n(147),a=n(150),s=n(32),u=n(31),l=n(41),c=n(63),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(28),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(28);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(28);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(28);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(27);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(27),i=n(38),o=n(55);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(34),i=n(127),o=n(22),a=n(54),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(128),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(131),i=n(27),o=n(38);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(132),i=n(133),o=n(134),a=n(135),s=n(136);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()}var l=n(24),v=n(16),g=n(6),b=n.n(g),w=n(34),A=n.n(w),I=n(11),C=n.n(I),N=n(71),k=(n(103),n(3)),D=n(5);D.c.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var P=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,(k.isMobile.tablet||k.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}(),R=n(1),O=n(7),L=function(){function e(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new R.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}(),j=function(e,t){return(j=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)},B=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}(),U=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}(),F=function(){function e(){this._tempPoint=new R.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}(),z={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};D.c.mixin(z);var G={target:null,data:{global:null}},H=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 L,r.mouse.identifier=1,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[1]=r.mouse,r.interactionDataPool=[],r.eventData=new B,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 F,r._tempDisplayObject=new D.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}j(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 G.target=null,G.data.global=e,t||(t=this.lastObjectRendered),this.processInteractive(G,t,null,!0),G.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&&(O.a.system.add(this.tickerUpdate,this,O.c.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(O.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._deltaTime1&&"undefined"==typeof MSStream},kc=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(vc)&&!o(Tc),ipod:o(mc),tablet:!o(vc)&&(o(gc)||Nc(t))&&!o(Tc),universal:o(yc),device:(o(vc)||o(mc)||o(gc)||o(yc)||Nc(t))&&!o(Tc)},amazon:{phone:o(_c),tablet:!o(_c)&&o(wc),device:o(_c)||o(wc)},android:{phone:!o(Tc)&&o(_c)||!o(Tc)&&o(bc),tablet:!o(Tc)&&!o(_c)&&!o(bc)&&(o(wc)||o(xc)),device:!o(Tc)&&(o(_c)||o(wc)||o(bc)||o(xc))||o(/\bokhttp\b/i)},windows:{phone:o(Tc),tablet:o(Mc),device:o(Tc)||o(Mc)},other:{blackberry:o(Ec),blackberry10:o(Sc),opera:o(Ac),firefox:o(Cc),chrome:o(Ic),device:o(Ec)||o(Sc)||o(Ac)||o(Cc)||o(Ic)},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 X,Q,q,Z,J,K,$,ee,te,ne,re,ie,oe,ae,se,ue,le,ce,he,de=/iPhone/i,fe=/iPod/i,pe=/iPad/i,ve=/\biOS-universal(?:.+)Mac\b/i,me=/\bAndroid(?:.+)Mobile\b/i,ge=/Android/i,ye=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,be=/Silk/i,xe=/Windows Phone/i,_e=/\bWindows(?:.+)ARM\b/i,we=/BlackBerry/i,Te=/BB10/i,Me=/Opera Mini/i,Se=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ee=/Mobile(?:.+)Firefox\b/i,Ae=function(e){return void 0!==e&&"MacIntel"===e.platform&&"number"==typeof e.maxTouchPoints&&e.maxTouchPoints>1&&"undefined"==typeof MSStream},Ie=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(de)&&!o(xe),ipod:o(fe),tablet:!o(de)&&(o(pe)||Ae(t))&&!o(xe),universal:o(ve),device:(o(de)||o(fe)||o(pe)||o(ve)||Ae(t))&&!o(xe)},amazon:{phone:o(ye),tablet:!o(ye)&&o(be),device:o(ye)||o(be)},android:{phone:!o(xe)&&o(ye)||!o(xe)&&o(me),tablet:!o(xe)&&!o(ye)&&!o(me)&&(o(be)||o(ge)),device:!o(xe)&&(o(ye)||o(be)||o(me)||o(ge))||o(/\bokhttp\b/i)},windows:{phone:o(xe),tablet:o(_e),device:o(xe)||o(_e)},other:{blackberry:o(we),blackberry10:o(Te),opera:o(Me),firefox:o(Ee),chrome:o(Se),device:o(we)||o(Te)||o(Me)||o(Ee)||o(Se)},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 - */!function(e){e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2"}(ql||(ql={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(Jl||(Jl={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(Kl||(Kl={})),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"}($l||($l={})),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"}(ec||(ec={})),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"}(tc||(tc={})),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"}(nc||(nc={})),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"}(rc||(rc={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(ic||(ic={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(oc||(oc={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(ac||(ac={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(sc||(sc={})),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"}(uc||(uc={})),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"}(lc||(lc={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(cc||(cc={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(hc||(hc={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(dc||(dc={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(fc||(fc={})),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"}(pc||(pc={}));sc.POW2,fc.NONE,function(e){var t,n=!0;(kc.tablet||kc.phone)&&(kc.apple.device&&(t=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(t[1],10)<11&&(n=!1),kc.android.device&&(t=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(t[1],10)<7&&(n=!1))}(),cc.AUTO,ac.CLAMP,oc.LINEAR,hc.HIGH,kc.apple.device?hc.HIGH:hc.MEDIUM,kc.apple.device;var Dc=!1,Pc=function(){function e(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return e.prototype.isEmpty=function(){return this.minX>this.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?R.j.EMPTY:((e=e||new R.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}(),ke=function(e,t){return(ke=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 De(e,t){function n(){this.constructor=e}ke(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Pe,Re,Oe,Le,je,Be,Ue,Fe,ze,Ge,He,Ve,We,Ye,Xe,Qe,qe,Ze,Je,Ke=function(e){function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new R.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 Ne,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 De(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(k.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(et),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,lt||(lt=document.createElement("a")),lt.href=e;var n=ut(lt.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 pt(){}function vt(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:E,levelBuffer:new Uint8Array(n,C,_)},C+=_}S=(S+=I+4)%4!=0?S+4-S%4:S,_=(M=(w=w>>1||1)+4-1&-4)*(E=(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 E=1;Eh&&(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(_+E*D,w+S*D),d.push(W,Y),d.push(_+A*D,w+I*D)):(d.push(_-E*k,w-S*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(_+E*D,w+S*D),p+=pd(_,w,_+E*D,w+S*D,_+A*D,w+I*D,d,!0)+4,d.push(W,Y),d.push(_+A*D,w+I*D)):(d.push(_-E*k,w-S*k),d.push(X,Q),p+=pd(_,w,_-E*k,w-S*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(_-E*k,w-S*k),d.push(_+E*D,w+S*D),o.join===Jh.ROUND?p+=U?pd(_,w,_+E*D,w+S*D,_+A*D,w+I*D,d,!0)+2:pd(_,w,_-E*k,w-S*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)],E=-(x-(w=r[2*(f-1)+1])),S=b-_,E/=C=Math.sqrt(E*E+S*S),S/=C,E*=m,S*=m,d.push(_-E*k,w-S*k),d.push(_+E*D,w+S*D),u||(o.cap===Kh.ROUND?p+=pd(_-E*(k-D)*.5,w-S*(k-D)*.5,_-E*k,w-S*k,_+E*D,w+S*D,d,!1)+2:o.cap===Kh.SQUARE&&(p+=fd(_,w,E,S,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=[],Ed=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}(),Sd=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 Ed(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 Ed(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 E=_[w+M],S=T[T.length-1];if(e.canBreakChars(S,E,g,w,n.breakWords))break;T+=E,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*St[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))*St[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 V.x(i):null,o.origin&&!1!==n.autoLoad&&o.load(),i&&i.length&&(o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),o}return At(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===Mt.r.FLOAT?n=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===Mt.r.UNSIGNED_INT?(r=!0,n=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===Mt.r.INT&&(r=!0,n=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new V.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 Nt(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=Mt.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 Xt(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(k.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(k.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(k.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(k.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}(V.m),$t=n(4);!function(e){e.MITER="miter",e.BEVEL="bevel",e.ROUND="round"}(Qt||(Qt={})),function(e){e.BUTT="butt",e.ROUND="round",e.SQUARE="square"}(qt||(qt={}));var en={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}},tn=function(){function e(){this.color=16777215,this.alpha=1,this.texture=V.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=V.t.WHITE,this.matrix=null,this.visible=!1},e.prototype.destroy=function(){this.texture=null,this.matrix=null},e}(),nn=function(e,t){return(nn=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 rn(e,t){function n(){this.constructor=e}nn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function on(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){on(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?(F?(d.push(Y,X),d.push(_+S*D,w+E*D),d.push(Y,X),d.push(_+A*D,w+I*D)):(d.push(_-S*k,w-E*k),d.push(Q,q),d.push(_-A*k,w-I*k),d.push(Q,q)),p+=2):o.join===Qt.ROUND?F?(d.push(Y,X),d.push(_+S*D,w+E*D),p+=dn(_,w,_+S*D,w+E*D,_+A*D,w+I*D,d,!0)+4,d.push(Y,X),d.push(_+A*D,w+I*D)):(d.push(_-S*k,w-E*k),d.push(Q,q),p+=dn(_,w,_-S*k,w-E*k,_-A*k,w-I*k,d,!1)+4,d.push(_-A*k,w-I*k),d.push(Q,q)):(d.push(Y,X),d.push(Q,q)):(d.push(_-S*k,w-E*k),d.push(_+S*D,w+E*D),o.join===Qt.ROUND?p+=F?dn(_,w,_+S*D,w+E*D,_+A*D,w+I*D,d,!0)+2:dn(_,w,_-S*k,w-E*k,_-A*k,w-I*k,d,!1)+2:o.join===Qt.MITER&&W/g<=y&&(F?(d.push(Q,q),d.push(Q,q)):(d.push(Y,X),d.push(Y,X)),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===qt.ROUND?p+=dn(_-S*(k-D)*.5,w-E*(k-D)*.5,_-S*k,w-E*k,_+S*D,w+E*D,d,!1)+2:o.cap===qt.SQUARE&&(p+=hn(_,w,S,E,k,D,!1,d)));var J=t.indices,K=en.epsilon*en.epsilon;for(P=v;Pc*s}},e.arc=function(e,t,n,r,i,o,a,s,u){for(var l=a-o,c=en._segmentsCount(Math.abs(l)*i,40*Math.ceil(Math.abs(l)/R.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}(),gn=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=en._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}(),yn=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=en._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}(),bn=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}(),xn=((pn={})[R.l.POLY]=an,pn[R.l.CIRC]=sn,pn[R.l.ELIP]=sn,pn[R.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)}},pn[R.l.RREC]=cn,pn),_n=[],wn=[],Tn=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}(),Mn=new R.g,Sn=new D.a,En=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 D.a,t.boundsDirty=-1,t}return rn(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 Tn(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 Tn(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=wn.pop())||((i=new V.d).texArray=new V.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=Mt.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)}V.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(k.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 R.h,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new R.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),yn.curveTo(e,t,n,r,i),this},t.prototype.bezierCurveTo=function(e,t,n,r,i,o){return this._initCurve(),gn.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=mn.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+=R.f:o&&r<=i&&(r+=R.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 R.j(e,t,n,r))},t.prototype.drawRoundedRect=function(e,t,n,r,i){return this.drawShape(new R.k(e,t,n,r,i))},t.prototype.drawCircle=function(e,t,n){return this.drawShape(new R.a(e,t,n))},t.prototype.drawEllipse=function(e,t,n,r){return this.drawShape(new R.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&&Dn.x=i&&Dn.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||V.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}(D.b),On=function(e,t){return(On=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"}(vn||(vn={}));var Ln={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:vn.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},jn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Bn=function(){function e(e){this.styleID=0,this.reset(),zn(this,e,e)}return e.prototype.clone=function(){var t={};return zn(t,this,Ln),new e(t)},e.prototype.reset=function(){zn(this,Ln,Ln)},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=Fn(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=Fn(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)&&jn.indexOf(r)<0&&(r='"'+r+'"'),t[n]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},e}();function Un(e){return"number"==typeof e?Object(k.hex2string)(e):("string"==typeof e&&0===e.indexOf("0x")&&(e=e.replace("0x","#")),e)}function Fn(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),E*s+g>=d)--_,y+=b*s,y=Math.ceil(y),g=0,b=0;else{Ef(p,v,w,g,y,s,h);var S=Af(w.text);f.char.push({id:S,page:x.length-1,x:g/s,y:y/s,width:E,height:M,xoffset:0,yoffset:0,xadvance:Math.ceil(T-(h.dropShadow?h.dropShadowDistance:0)-(h.stroke?h.strokeThickness:0))}),g+=(E+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 E=0;"right"===this._align?E=d-o[b]:"center"===this._align?E=(d-o[b])/2:"justify"===this._align&&(E=a[b]<0?0:(d-o[b])/a[b]),M.push(E)}var S=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 Wn=function(e,t){return(Wn=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)},Yn=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 Xn(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&&O.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 tr(e,t){return t instanceof V.c&&(t._glTextures[e.CONTEXT_UID]||e.texture.bind(t),!0)}function nr(e,t){if(!(t instanceof Nn))return!1;var n=t.geometry;t.finishPoly(),n.updateBatches();for(var r=n.batches,i=0;i=r&&lr.x=i&&lr.y1?V.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):V.r.from(hr,"#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!==Mt.s.CLAMP:s.wrapMode===Mt.s.CLAMP&&(s.wrapMode=Mt.s.REPEAT));var h=c?this.simpleShader:this.shader,d=a.width,f=a.height,p=e._width,v=e._height;dr.set(u.a*d/p,u.b*d/v,u.c*f/p,u.d*f/v,u.tx/p,u.ty/v),dr.invert(),c?dr.prepend(l.mapCoord):(h.uniforms.uMapCoord=l.mapCoord.toArray(!0),h.uniforms.uClampFrame=l.uClampFrame,h.uniforms.uClampOffset=l.uClampOffset),h.uniforms.uTransform=dr.toArray(!0),h.uniforms.uColor=Object(k.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(k.correctBlendMode)(e.blendMode,s.alphaMode),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},t}(V.m),pr=n(8),vr=function(e,t){return(vr=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)},mr=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},gr=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 mr;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}(),yr=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 mr,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 yr.test(t)}return!1},e.parse=function(e){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return yr.parse(t)},e}(),xr=[gr,yr,br];function _r(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{wr(p,v,w,g,y,s,h);var E=Mr(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(k.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*B)||K.vertices.length<2*pr.a.BATCHABLE_SIZE)K.vertices=new Float32Array(8*B),K.uvs=new Float32Array(8*B),K.indices=new Uint16Array(6*B);else for(var U=K.total,F=K.vertices,z=4*U*2;z=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 Pr(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,Xr.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}ri(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}(V.k);ii.prototype.grayscale=ii.prototype.greyscale; /*! * @pixi/filter-displacement - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -214,7 +215,7 @@ var Xd=function(e,t){return(Xd=Object.setPrototypeOf||{__proto__:[]}instanceof A See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var up,lp,cp,hp,dp,fp,pp,vp,mp,gp,yp,bp,xp,_p,wp,Tp,Mp,Ep,Sp,Ap=function(e,t){return(Ap=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)},Ip=function(e){function t(t,n){var r=this,i=new jl.d;return t.renderable=!1,(r=e.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\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\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=t,r.maskMatrix=i,null==n&&(n=20),r.scale=new jl.g(n,n),r}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.apply=function(e,t,n,r){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var i=this.maskSprite.worldTransform,o=Math.sqrt(i.a*i.a+i.b*i.b),a=Math.sqrt(i.c*i.c+i.d*i.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=i.a/o,this.uniforms.rotation[1]=i.b/o,this.uniforms.rotation[2]=i.c/a,this.uniforms.rotation[3]=i.d/a),e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(e){this.uniforms.mapSampler=e},enumerable:!1,configurable:!0}),t}(Xl.k),Cp=function(e,t){return(Cp=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)},Np=function(e){function t(){return e.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\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\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(e,t){function n(){this.constructor=e}Cp(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Xl.k),kp=function(e,t){return(kp=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)},Dp=function(e){function t(t,n){void 0===t&&(t=.5),void 0===n&&(n=Math.random());var r=e.call(this,Xl.z,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return r.noise=t,r.seed=n,r}return function(e,t){function n(){this.constructor=e}kp(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e},enumerable:!1,configurable:!0}),t}(Xl.k);!function(e){e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2"}(up||(up={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(lp||(lp={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(cp||(cp={})),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"}(hp||(hp={})),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"}(dp||(dp={})),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"}(fp||(fp={})),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"}(pp||(pp={})),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"}(vp||(vp={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(mp||(mp={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(gp||(gp={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(yp||(yp={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(bp||(bp={})),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"}(xp||(xp={})),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"}(_p||(_p={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(wp||(wp={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(Tp||(Tp={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(Mp||(Mp={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(Ep||(Ep={})),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"}(Sp||(Sp={}));var Pp=new jl.d;Rl.c.prototype._cacheAsBitmap=!1,Rl.c.prototype._cacheData=null,Rl.c.prototype._cacheAsBitmapResolution=null,Rl.c.prototype._cacheAsBitmapMultisample=Ep.NONE;var Op=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(Rl.c.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(e){e!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(e){e!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(e){var t;this._cacheAsBitmap!==e&&(this._cacheAsBitmap=e,e?(this._cacheData||(this._cacheData=new Op),(t=this._cacheData).originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((t=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea))}}}),Rl.c.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},Rl.c.prototype._initCachedDisplayObject=function(e){var t;if(!this._cacheData||!this._cacheData.sprite){var n=this.alpha;this.alpha=1,e.batch.flush();var r=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var i=this.filters[0].padding;r.pad(i)}r.ceil(nd.b.RESOLUTION);var o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),s=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=Xl.p.create({width:r.width,height:r.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:null!==(t=this.cacheAsBitmapMultisample)&&void 0!==t?t:e.multisample}),c="cacheAsBitmap_"+Object(Ol.uid)();this._cacheData.textureCacheId=c,Xl.c.addToCache(l.baseTexture,c),Xl.t.addToCache(l,c);var h=this.transform.localTransform.copyTo(Pp).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:l,clear:!0,transform:h,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=u,e.renderTexture.bind(o,a,s),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var d=new Ld(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-r.x/r.width,d.anchor.y=-r.y/r.height,d.alpha=n,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},Rl.c.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},Rl.c.prototype._initCachedDisplayObjectCanvas=function(e){if(!this._cacheData||!this._cacheData.sprite){var t=this.getLocalBounds(null,!0),n=this.alpha;this.alpha=1;var r=e.context,i=e._projTransform;t.ceil(nd.b.RESOLUTION);var o=Xl.p.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+Object(Ol.uid)();this._cacheData.textureCacheId=a,Xl.c.addToCache(o.baseTexture,a),Xl.t.addToCache(o,a);var s=Pp;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=t.x,s.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:o,clear:!0,transform:s,skipUpdateTransform:!1}),e.context=r,e._projTransform=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var u=new Ld(o);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-t.x/t.width,u.anchor.y=-t.y/t.height,u.alpha=n,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},Rl.c.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Rl.c.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Rl.c.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Xl.c.removeFromCache(this._cacheData.textureCacheId),Xl.t.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Rl.c.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)},Rl.c.prototype.name=null,Rl.b.prototype.getChildByName=function(e,t){for(var n=0,r=this.children.length;n=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramen)&&this.onLoop(),this.updateTexture())}},t.prototype.updateTexture=function(){var e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},t.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},t.fromFrames=function(e){for(var n=[],r=0;r lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(e,t){function n(){this.constructor=e}Ei(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(V.k),Ii=function(e,t){return(Ii=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)},Ci=function(e){function t(t,n){void 0===t&&(t=.5),void 0===n&&(n=Math.random());var r=e.call(this,V.z,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return r.noise=t,r.seed=n,r}return function(e,t){function n(){this.constructor=e}Ii(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e},enumerable:!1,configurable:!0}),t}(V.k);!function(e){e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2"}(oi||(oi={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(ai||(ai={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(si||(si={})),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"}(ui||(ui={})),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"}(li||(li={})),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"}(ci||(ci={})),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"}(hi||(hi={})),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"}(di||(di={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(fi||(fi={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(pi||(pi={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(vi||(vi={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(mi||(mi={})),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"}(gi||(gi={})),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"}(yi||(yi={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(bi||(bi={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(xi||(xi={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(_i||(_i={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(wi||(wi={})),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"}(Ti||(Ti={}));var Ni=new R.d;D.c.prototype._cacheAsBitmap=!1,D.c.prototype._cacheData=null,D.c.prototype._cacheAsBitmapResolution=null,D.c.prototype._cacheAsBitmapMultisample=wi.NONE;var ki=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(D.c.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(e){e!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(e){e!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(e){var t;this._cacheAsBitmap!==e&&(this._cacheAsBitmap=e,e?(this._cacheData||(this._cacheData=new ki),(t=this._cacheData).originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((t=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea))}}}),D.c.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},D.c.prototype._initCachedDisplayObject=function(e){var t;if(!this._cacheData||!this._cacheData.sprite){var n=this.alpha;this.alpha=1,e.batch.flush();var r=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var i=this.filters[0].padding;r.pad(i)}r.ceil($t.b.RESOLUTION);var o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),s=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=V.p.create({width:r.width,height:r.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:null!==(t=this.cacheAsBitmapMultisample)&&void 0!==t?t:e.multisample}),c="cacheAsBitmap_"+Object(k.uid)();this._cacheData.textureCacheId=c,V.c.addToCache(l.baseTexture,c),V.t.addToCache(l,c);var h=this.transform.localTransform.copyTo(Ni).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:l,clear:!0,transform:h,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=u,e.renderTexture.bind(o,a,s),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var d=new Rn(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-r.x/r.width,d.anchor.y=-r.y/r.height,d.alpha=n,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},D.c.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},D.c.prototype._initCachedDisplayObjectCanvas=function(e){if(!this._cacheData||!this._cacheData.sprite){var t=this.getLocalBounds(null,!0),n=this.alpha;this.alpha=1;var r=e.context,i=e._projTransform;t.ceil($t.b.RESOLUTION);var o=V.p.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+Object(k.uid)();this._cacheData.textureCacheId=a,V.c.addToCache(o.baseTexture,a),V.t.addToCache(o,a);var s=Ni;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=t.x,s.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:o,clear:!0,transform:s,skipUpdateTransform:!1}),e.context=r,e._projTransform=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var u=new Rn(o);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-t.x/t.width,u.anchor.y=-t.y/t.height,u.alpha=n,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},D.c.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},D.c.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},D.c.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,V.c.removeFromCache(this._cacheData.textureCacheId),V.t.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},D.c.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)},D.c.prototype.name=null,D.b.prototype.getChildByName=function(e,t){for(var n=0,r=this.children.length;n=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramen)&&this.onLoop(),this.updateTexture())}},t.prototype.updateTexture=function(){var e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},t.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},t.fromFrames=function(e){for(var n=[],r=0;r0},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,E=void 0,S=void 0;n.moveTo(x[0],x[1]);for(var A=2;A0){for(S=[],w=0,M=x[0],E=x[1],A=2;A+2=0;A-=2)n.lineTo(x[A],x[A+1]);_[I].shape.closeStroke&&n.closePath(),S[I]=T*w<0}}p.visible&&(n.globalAlpha=p.alpha*r,n.fillStyle=o,n.fill()),v.visible&&this.paintPolygonStroke(C,v,a,_,S,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))}; +V.q.registerPlugin("accessibility",P),V.q.registerPlugin("extract",rt),V.q.registerPlugin("interaction",H),V.q.registerPlugin("particle",Kt),V.q.registerPlugin("prepare",ir),V.q.registerPlugin("batch",V.f),V.q.registerPlugin("tilingSprite",fr),bt.registerPlugin(Cr),bt.registerPlugin(kt),bt.registerPlugin(Ft),bt.registerPlugin(Wt),bt.registerPlugin(ar),W.registerPlugin(O.b),W.registerPlugin(xt);var Oi,Li={AlphaFilter:kr,BlurFilter:ni,BlurFilterPass:ti,ColorMatrixFilter:ii,DisplacementFilter:Si,FXAAFilter:Ai,NoiseFilter:Ci},ji=n(10),Bi=n(35),Ui=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}(),Fi=function(){function e(e){this._svgMatrix=null,this._tempMatrix=new R.d,this.renderer=e}return e.prototype._calcCanvasStyle=function(e,t){var n;return e.texture&&e.texture.baseTexture!==V.t.WHITE.baseTexture?e.texture.valid?(n=ji.b.getTintedPattern(e.texture,t),this.setPatternTransform(n,e.matrix||R.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===R.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===R.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===R.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===R.l.ELIP){if(C=f,(V=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),L=C.x-P/2,j=C.y-O/2,B=P/2*.5522848,U=O/2*.5522848,F=L+P,z=j+O,G=L+P/2,H=j+O/2;n.beginPath(),n.moveTo(L,H),n.bezierCurveTo(L,H-U,G-B,j,G,j),n.bezierCurveTo(G+B,j,F,H-U,F,H),n.bezierCurveTo(F,H+U,G+B,z,G,z),n.bezierCurveTo(G-B,z,L,H+U,L,H),n.closePath()}n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.stroke()}V&&this.paintEllipse(C,p,v,o,r,n)}else if(d.type===R.l.RREC){var V;if(C=f,(V=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 W=C.x-N,Y=C.y-N,X=C.width+2*N,Q=C.height+2*N,q=N*(v.alignment>=1?Math.min(X/k,Q/D):Math.min(k/X,D/Q)),Z=C.radius+q,J=Math.min(X,Q)/2;Z=Z>J?J:Z,n.beginPath(),n.moveTo(W,Y+Z),n.lineTo(W,Y+Q-Z),n.quadraticCurveTo(W,Y+Q,W+Z,Y+Q),n.lineTo(W+X-Z,Y+Q),n.quadraticCurveTo(W+X,Y+Q,W+X,Y+Q-Z),n.lineTo(W+X,Y+Z),n.quadraticCurveTo(W+X,Y,W+X-Z,Y),n.lineTo(W+Z,Y),n.quadraticCurveTo(W,Y,W,Y+Z),n.closePath()}n.globalAlpha=v.alpha*r,n.strokeStyle=a,n.stroke()}V&&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=Ui.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}(),zi=new R.d;Nn.prototype.generateCanvasTexture=function(e,t){void 0===t&&(t=1);var n=this.getLocalBounds(),r=V.p.create({width:n.width,height:n.height,scaleMode:e,resolution:t});Oi||(Oi=new ji.a),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(zi),zi.invert(),zi.tx-=n.x,zi.ty-=n.y,Oi.render(this,{renderTexture:r,clear:!0,transform:zi});var i=V.t.from(r.baseTexture._canvasRenderTarget.canvas,{scaleMode:e});return i.baseTexture.setResolution(t),i},Nn.prototype.cachedGraphicsData=[],Nn.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 +231,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 Gi=new R.d,Hi=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===Mt.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(Gi),a=Gi,R.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=ji.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(Mt.b.NORMAL)}}},e.prototype.destroy=function(){this.renderer=null},e}();Rn.prototype._tintedCanvas=null,Rn.prototype._renderCanvas=function(e){e.plugins.sprite.render(this)}; /*! * @pixi/canvas-extract - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC @@ -238,14 +239,14 @@ var Wp=new jl.d,Yp=function(){function e(e){this.renderer=e}return e.prototype.r * @pixi/canvas-extract is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -var Xp=new jl.j,Qp=function(){function e(e){this.renderer=e}return e.prototype.image=function(e,t,n){var r=new Image;return r.src=this.base64(e,t,n),r},e.prototype.base64=function(e,t,n){return this.canvas(e).toDataURL(t,n)},e.prototype.canvas=function(e){var t,n,r,i,o=this.renderer;e&&(i=e instanceof Xl.p?e:o.generateTexture(e)),i?(t=i.baseTexture._canvasRenderTarget.context,n=i.baseTexture._canvasRenderTarget.resolution,r=i.frame):(t=o.rootContext,n=o.resolution,(r=Xp).width=this.renderer.width,r.height=this.renderer.height);var a=Math.floor(r.width*n+1e-4),s=Math.floor(r.height*n+1e-4),u=new Ol.CanvasRenderTarget(a,s,1),l=t.getImageData(r.x*n,r.y*n,a,s);return u.context.putImageData(l,0,0),u.canvas},e.prototype.pixels=function(e){var t,n,r,i,o=this.renderer;e&&(i=e instanceof Xl.p?e:o.generateTexture(e)),i?(t=i.baseTexture._canvasRenderTarget.context,n=i.baseTexture._canvasRenderTarget.resolution,r=i.frame):(t=o.rootContext,n=o.resolution,(r=Xp).width=o.width,r.height=o.height);var a=r.x*n,s=r.y*n,u=r.width*n,l=r.height*n;return t.getImageData(a,s,u,l).data},e.prototype.destroy=function(){this.renderer=null},e}(),Zp=function(e,t){return(Zp=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 qp(e,t){var n=e;if(t instanceof Xl.c){var r=t.source,i=0===r.width?n.canvas.width:Math.min(n.canvas.width,r.width),o=0===r.height?n.canvas.height:Math.min(n.canvas.height,r.height);return n.ctx.drawImage(r,0,0,i,o,0,0,n.canvas.width,n.canvas.height),!0}return!1}var Jp,Kp=function(e){function t(t){var n=e.call(this,t)||this;return n.uploadHookHelper=n,n.canvas=document.createElement("canvas"),n.canvas.width=16,n.canvas.height=16,n.ctx=n.canvas.getContext("2d"),n.registerUploadHook(qp),n}return function(e,t){function n(){this.constructor=e}Zp(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.ctx=null,this.canvas=null},t}(nf),$p=new jl.d,ev=new jl.d,tv=[new jl.g,new jl.g,new jl.g,new jl.g]; +var Vi=new R.j,Wi=function(){function e(e){this.renderer=e}return e.prototype.image=function(e,t,n){var r=new Image;return r.src=this.base64(e,t,n),r},e.prototype.base64=function(e,t,n){return this.canvas(e).toDataURL(t,n)},e.prototype.canvas=function(e){var t,n,r,i,o=this.renderer;e&&(i=e instanceof V.p?e:o.generateTexture(e)),i?(t=i.baseTexture._canvasRenderTarget.context,n=i.baseTexture._canvasRenderTarget.resolution,r=i.frame):(t=o.rootContext,n=o.resolution,(r=Vi).width=this.renderer.width,r.height=this.renderer.height);var a=Math.floor(r.width*n+1e-4),s=Math.floor(r.height*n+1e-4),u=new k.CanvasRenderTarget(a,s,1),l=t.getImageData(r.x*n,r.y*n,a,s);return u.context.putImageData(l,0,0),u.canvas},e.prototype.pixels=function(e){var t,n,r,i,o=this.renderer;e&&(i=e instanceof V.p?e:o.generateTexture(e)),i?(t=i.baseTexture._canvasRenderTarget.context,n=i.baseTexture._canvasRenderTarget.resolution,r=i.frame):(t=o.rootContext,n=o.resolution,(r=Vi).width=o.width,r.height=o.height);var a=r.x*n,s=r.y*n,u=r.width*n,l=r.height*n;return t.getImageData(a,s,u,l).data},e.prototype.destroy=function(){this.renderer=null},e}(),Yi=function(e,t){return(Yi=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 Xi(e,t){var n=e;if(t instanceof V.c){var r=t.source,i=0===r.width?n.canvas.width:Math.min(n.canvas.width,r.width),o=0===r.height?n.canvas.height:Math.min(n.canvas.height,r.height);return n.ctx.drawImage(r,0,0,i,o,0,0,n.canvas.width,n.canvas.height),!0}return!1}var Qi,qi=function(e){function t(t){var n=e.call(this,t)||this;return n.uploadHookHelper=n,n.canvas=document.createElement("canvas"),n.canvas.width=16,n.canvas.height=16,n.ctx=n.canvas.getContext("2d"),n.registerUploadHook(Xi),n}return function(e,t){function n(){this.constructor=e}Yi(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),this.ctx=null,this.canvas=null},t}(er),Zi=new R.d,Ji=new R.d,Ki=[new R.g,new R.g,new R.g,new R.g]; /*! * @pixi/canvas-sprite-tiling - v6.4.2 * Compiled Thu, 02 Jun 2022 15:39:26 UTC * * @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||y>2048)&&(b=(m*=2048/g)*y)>2048&&(m*=y/b),x=document.createElement("canvas"),_=Math.ceil(v.width*m),w=Math.ceil(v.height*m),x.width=_,x.height=w,x.getContext("2d").drawImage(v,0,0,_,w),T=x.toDataURL("image/png"),M=new Xl.c(T,{resolution:1}),n.abrupt("return",(this.logger.info("load end. "+i,this.taskId||""),this.useCache&&this.localStorage.setItem(s,{scale:m,scaledBase64:T}).catch((function(){})),{baseTexture:M,scale:m}));case 54:case"end":return n.stop()}}),n,this)})))}},{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 Ev(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 Sv=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}(Sv)),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}(Sv)),Cv=function(){function e(){_(this,e),this.imgElements=[],this.svgElements=[],this.idToHashMap=Object.create(null),this.textures=Object.create(null),this.graphics=[],this.hashToIdMap=Object.create(null)}return T(e,[{key:"render",value:function(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,regeneratorRuntime.mark((function t(){var r,i,o,a,s,u,l,h,d,f,p=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.items,i=e.width,o=e.height,a=Iv.getObject(n),s=new Xl.c(a,{width:i,height:o,resolution:1}),u=Av.getObject(n),this.imgElements.push(a),this.svgElements.push(u),u.setAttribute("viewBox","0 0 ".concat(i," ").concat(o)),u.setAttribute("width",""+i),u.setAttribute("height",""+o),l={},h={},r.forEach((function(e){var t=e.item,n=e.x,r=e.y,i=n+2,o=r+2;t.pathsData.forEach((function(e){var t="";e.cmds.forEach((function(n){var r=c(n,2),a=r[0],s=r[1];t+=a+" ",t+=s.map((function(t){return Tv()(t)||(t.x=t.x+e.offset.x+i,t.y=t.y+e.offset.y+o),t})).reduce((function(e,t){return Tv()(t)?e+=t+" ":e+="".concat(t.x," ").concat(t.y," "),e}),""),t+=" "})),e.pathElement.setAttribute("d",t),u.appendChild(e.pathElement)}));var a=t.width-4-2*t.padding,d=t.height-4-2*t.padding;p.textures[t.hash]={texture:new Xl.t(s,new jl.j(i+2,o+2,a,d)),pivot:t.pivot},l[t.hash]={x:i+2,y:o+2,w:a,h:d,pivot:t.pivot},h[t.hash]=p.hashToIdMap[t.hash]})),f=''+u.outerHTML,d="data:image/svg+xml,"+encodeURIComponent(f).replace(/'/g,"%27").replace(/"/g,"%22"),a.src=d,t.next=8,new Promise((function(e,t){a.onload=function(){return e("")},a.onerror=function(){return t()}}));case 8: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,E,S,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)},E=0,S=0,A=0,I=0,C=0,N="none",k=null!==(w=null==g?void 0:g.width)&&void 0!==w?w:0,b?(E=v,S=m,C=0):(N=_||"#ff0000",C=k,A=.5*k,I=.5*k,E=v+k,S=m+k,M.x+=.5*k,M.y+=.5*k),E+=Math.abs(y.x),S+=Math.abs(y.y),A+=Math.abs(y.x),I+=Math.abs(y.y),E+=4,S+=4,A+=2,I+=2,E=Math.ceil(E),S=Math.ceil(S),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 E=c(u.split(",").map((function(e){return Number(e)})),2),S=E[0],k=E[1];i={x:S,y:k},S=S/9525*n.x,k=k/9525*n.y,o.cmds.push(["L",[{x:S,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:E,graphicsHeight:S,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("click",(function(){return n.handleAction(e)})),this.object.cursor="pointer"):"hover"===t&&this.object.addListener("mouseover",(function(){return n.handleAction(e)}))}},{key:"addProxy",value:function(e){var t=this;this.proxy=e,this.hitArea=this.getOriginHitArea(),this.proxy.interactive=!0,this.actions.forEach((function(e){var n,r,i=c(e,2),o=i[0],a=i[1];"click"===a?null===(n=t.proxy)||void 0===n||n.addListener("click",(function(e){return t.handleProxyAction(e,o)})):"hover"===a&&(null===(r=t.proxy)||void 0===r||r.addListener("mouseover",(function(e){return t.handleProxyAction(e,o)})))}))}},{key:"handleProxyAction",value:function(e,t){var n,r=e.data.global,i=this.object.getGlobalPosition(),o=r.x-i.x+this.object.pivot.x,a=r.y-i.y+this.object.pivot.y;(null===(n=this.hitArea)||void 0===n?void 0:n.contains(o,a))&&this.object.visible&&this.handleAction(t,!0)}},{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){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.proxy&&!t||(this.ctx.eventHub.emit(yb.hyperlinkTrigger,e),this.execAction(e))}},{key:"execAction",value:function(e){var t;if(this.ctx.eventHub.emit(yb.userInput),"ppaction://hlinksldjump"===e.action){var n=(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"").match(/slide(\d+)\.xml/);n&&n[1]&&this.ctx.eventHub.emit(yb.requestGotoSlide,Number(n[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===e.action)this.ctx.eventHub.emit(yb.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===e.action)this.ctx.eventHub.emit(yb.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===e.action)this.ctx.eventHub.emit(yb.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===e.action)this.ctx.eventHub.emit(yb.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===e.action){var r=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(yb.requestGotoSlide,r)}else"ppaction://hlinkshowjump?jump=endshow"===e.action&&this.ctx.eventHub.emit(yb.requestGotoSlide,-1)}}]),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.animationFilterQueue=[],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:"addToAnimationFilterQueue",value:function(e){this.animationFilterQueue.push(e)}},{key:"removeAnimationFilterQueue",value:function(e){var t=this.animationFilterQueue.findIndex((function(t){return t===e}));t<0||this.animationFilterQueue.splice(t,1)}},{key:"getFirstAnimationFilter",value:function(){return this.animationFilterQueue.length>0?this.animationFilterQueue[0]:null}},{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)}}},{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,E=e-i,S=n-i,A=t-o,I=r-o;h=(_=(p=E-(f=(d=im*E)-(d-E)))*(m=I-(v=(d=im*I)-(d-I)))-((x=E*I)-f*v-p*v-f*m))-(g=_-(T=(p=A-(f=(d=im*A)-(d-A)))*(m=S-(v=(d=im*S)-(d-S)))-((w=A*S)-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-(E+(h=e-E))+(h-i),l=n-(S+(h=n-S))+(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+=E*c+I*s-(A*l+S*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=S-(v=(d=im*S)-(d-S)))-((w=u*S)-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=E-(f=(d=im*E)-(d-E)))*(m=c-(v=(d=im*c)-(d-c)))-((x=E*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 E=e[2*p],S=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,E,S,N,k)<0){var B=p,U=E,F=S;p=v,E=N,S=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,E,S,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=Sm[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n".concat(Em.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),jm=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=function(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}(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,E=M.src,S=M.delays,A=this.ctx.spriteTexture.getGifFrames(E).map((function(e,t){return{texture:e,time:S[t]||20}})),I=new jp(A,!0);I.name=uv(),I.width=this.width,I.height=this.height;var C=this.fillStyle.loop,N=1;return I.onLoop=function(){N+=1,C>0&&N>C&&I.gotoAndStop(I.totalFrames)},I}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}(),Bm=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(Xl.k),Um=n(113),Fm=n.n(Um),zm=n(114),Gm=n.n(zm),Hm=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Fm.a,Gm.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}(Bm),Vm=n(19),Wm=n.n(Vm),Ym=n(115),Xm=n.n(Ym),Qm=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Wm.a,Xm.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}(Bm),Zm=function e(){_(this,e)},qm=n(116),Jm=n.n(qm),Km=function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,Wm.a,Jm.a,{uColor:Xv(e)})}return n}(Xl.k),$m=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 Km(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}(Zm),eg=n(117),tg=n.n(eg),ng=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),i=t.call(this,Wm.a,tg.a,{uStartAlpha:e.startAlpha,uEndAlpha:e.endAlpha,uStartPos:e.startPos,uEndPos:e.endPos,uHeight:r}),console.log(y(i)),i}return n}(Xl.k),rg=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 ng(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}(Zm),ig=n(118),og=n.n(ig),ag=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Wm.a,og.a,{})).priority=1,r.json=e,r}return T(n,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(){return null}}]),n}(Bm),sg=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())}))},ug=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=E(r);try{for(h.s();!(c=h.n()).done;){var d=c.value;switch(d.type){case"innerShadow":l.effects.push(new ag(d));break;case"softEdge":l.effects.push(new Qm(d));break;case"glow":l.effects.push(new Hm(d));break;case"reflection":l.attachs.push(new rg(d,e,s,u.x,l.ctx));break;case"outerShadow":l.attachs.push(new $m(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=E(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 sg(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=E(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 jm(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 jm(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 jm(this.ctx,null==n?void 0:n.fill,r,Math.max(o,i),{useFilter:!1,useSlideBackgroundFill:!1}):new jm(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 jm(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 lg(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 lg(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 ug(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 E=this.strokeFill.displayObject;if(E)E.mask=M,E.addChild(M),o?E.position.y=d>0?d:0:E.position.x=h,this.textureContainer.addChild(E);else if(this.strokeFill.isSolidFill()){o?M.position.y=d>0?d:0:M.position.x=h;var S=new qv;S.color=this.strokeFill.getSolidFillColor(),M.filters=[S],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),hg=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())}))},dg=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 hg(i,void 0,void 0,regeneratorRuntime.mark((function r(){var i,a,s,u,l,c,h,d,f,p,v,m,g,y,b;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:a=this.json.textUnits[o],s=this.json,u=s.height,l=s.width,c=s.fillHeight,h=s.baseline,d=s.y,f=s.underline,(p=new cg(Object.assign(Object.assign({},a),{lineHeight:u,lineWidth:l,baseLine:h-d,underline:f,fillLineHeight:c||u,isHorz:this.isHorz,shapeId:e,paragraphIndex:t,lineIndex:n,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList})).preRender(),this.units.push(p),(a.hyperlink||a.hlinkHover)&&(v=a.hyperlink?"click-"+JSON.stringify({action:a.hyperlink.action,target:a.hyperlink.target}):"hover-"+JSON.stringify({action:a.hlinkHover.action,target:a.hlinkHover.target}),m=this.hyperLinkContainerMap.has(v),(g=null!==(i=this.hyperLinkContainerMap.get(v))&&void 0!==i?i:new Rl.b).name=v,g.hitArea=new jl.j(0,0,this.json.width,this.json.height),y=this.hyperLinkMap.get(v)||new jv(this.container,this.ctx),(b=new Dd).beginFill(0,1e-5).drawRect(a.x,a.y,a.width,a.height).endFill(),g.addChild(b),m||(a.hyperlink&&y.addAction(a.hyperlink,"click"),a.hlinkHover&&y.addAction(a.hlinkHover,"hover"),y.addProxy(g),g.zIndex=999,this.container.addChild(g),this.container.sortableChildren=!0,this.hyperLinkContainerMap.set(v,g),this.hyperLinkMap.set(v,y)));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 fg(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 dg(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 mg(e){for(var t=new os,n=e.scale,r={x:0,y:0},i=e.path.trim().split(" "),o=0;o=0&&(d=bg(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(!yg[n])return null;var i=yg[n].top(mg(t)),o=yg[n].bottom(mg(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}(),wg=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}(),Tg=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:"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 Tg(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 jm(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 Tg(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 jm(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=E(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;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,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 wg(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 Mg(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=E(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 Mg(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 Mg(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 Mg(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,E,S,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,E=null===(u=this.json.effectList)||void 0===u?void 0:u.find((function(e){return"outerShadow"===e.type})),S=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})),E&&1!==E.sx||S||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 ug(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),Ag=n(119),Ig=new(n.n(Ag).a),Cg=Ig.getDevice(),Ng=Ig.getBrowser(),kg=Ig.getOS(),Dg={isDesktop:function(){var e=!0;return"mobile"===Cg.type&&(e=!1),/Samsung/.test(Ng.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),kg.name&&/iOS/.test(kg.name)&&(e=!0),e},isAndroid:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(e=!0),kg.name&&/android/i.test(kg.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}},Pg=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 Og(e,t){for(var n in t)e.style[n]=t[n]}var Rg="median-container",Lg=1500,jg=300,Bg=50,Ug="0",Fg="1",zg=.4,Gg=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(yb.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 Pg(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 Pg(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 Pg(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 Pg(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&&(n>this.duration||this.media.ended),!t.t0){t.next=9;break}return t.next=5,this.pauseMedia();case 5:this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(yb.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()}))},this._playMediaFromCtrl=function(){i.playMediaFromCtrl(!1)},this._pauseMediaFromCtrl=function(){i.pauseMediaFromCtrl(!1),i.delayHide()},this.onClickFullScreenButtonHandle=function(){i.fullscreenPlay()},this.onClickCancelFullScreenButtonHandle=function(){i.fullscreenStatus=!1,i.media.requestCancelFullscreen(),i.ctx.eventHub.emit(yb.fullscreenChange,{targetId:i.targetId,state:!1}),i.delayHide()},this.onFullScreenChange=function(e){var t=e.status,n=e.targetId,r=e.slideIndex;i.changeFullScreenState(t,n,r),i.delayHide()},this.onContainerSizeChange=function(){i.setControllerPosition()},this.onControllerShowStatusChange=function(e){var t=e.slideIndex,n=e.targetId,r=e.status;if(t===i.ctx.slideIndex){if(i.targetId===n){var o=Ug,a=Fg;r?(i.mediaController.style.opacity=a,i.mediaController.style.display="flex"):i.mediaController.style.opacity=o}i.delayHide()}},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.target=t.target,this.media=t.media,this.info=t.info,this.shapeId=t.shapeId,this.canvasElement=t.canvasElement,"video"===this.media.type&&(this.isVideo=!0),this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=null!==(n=this.info.cut.start)&&void 0!==n?n:0,this.end=null!==(r=this.info.cut.end)&&void 0!==r?r:0),this.info.bookmarkList&&(this.bookmarkList=this.info.bookmarkList.sort((function(e,t){return e.time-t.time})))}return T(e,[{key:"getMedianContainer",value:function(){var e,t=Rg,n=null===(e=this.canvasElement.parentElement)||void 0===e?void 0:e.querySelector("."+t);n||((n=document.createElement("div")).className=t,this.canvasElement.parentElement.appendChild(n)),this.container=n}},{key:"generatePlayButton",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");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");Og(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");Og(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");Og(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"};Og(this.playButton,Object.assign(Object.assign({},e),{display:"block"}));var t=this.generatePlayButton();Og(t,{height:"20px"}),this.playButton.appendChild(t),Og(this.pauseButton,Object.assign(Object.assign({},e),{display:"none"}));var n=this.generatePauseButton();if(Og(n,{height:"20px"}),this.pauseButton.appendChild(n),this.isVideo){var r=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(r),Og(this.fullScreenButton,Object.assign(Object.assign({},e),{display:"block"}));var i=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(i),Og(this.exitFullScreenButton,Object.assign(Object.assign({},e),{display:"none"}))}}},{key:"createTimer",value:function(){var e=document.createElement("div");Og(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"),Og(this.progress,e);var t=document.createElement("div");Og(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Og(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),Og(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&&Og(this.mediaController,{left:"0",top:a-r+"px"})}},{key:"createMediaController",value:function(){this.setControllerPosition(),Og(this.mediaController,{display:"none",transition:"opacity ".concat(zg,"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(yb.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(){Dg.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;Dg.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=Ug:this.mediaController.style.display="none"}},{key:"delayHide",value:function(){var e=this;clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout((function(){e.hide()}),Lg)}},{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}(),Hg=n(120),Vg=function(e){p(n,e);var t=m(n);function n(e,r){var i,o;return _(this,n),(o=t.call(this)).isGlobalPause=!1,o.lastTime=-1,o.howl=null,o.rctClient=null,o.isHowlEnd=!1,o.isHowlLoadEmit=!1,o.staticEventId=1001,o.url=e,o.runningAudio=r,bb.RtcAudioClazz?(o.rctClient=new bb.RtcAudioClazz(e),o.rctClient.on("load",(function(){return o.emit("load")})),o.rctClient.on("pause",(function(){return o.emit("pause")})),o.rctClient.on("play",(function(){return o.emit("play")}))):(o.howl=new Hg.Howl({src:[e]}),i=c(o.howl._getSoundIds(),1),o.staticEventId=i[0],o.howl.load(),o.howl.on("load",(function(){o.isHowlLoadEmit=!0,o.emit("load")})),o.howl.on("pause",(function(){return o.emit("pause")})),o.howl.on("play",(function(){o.isHowlLoadEmit||o.emit("load"),o.isHowlEnd=!1,o.emit("play")})),o.howl.on("end",(function(){o.isHowlEnd=!0}))),o}return T(n,[{key:"startTimeChangeEmit",value:function(){var e=this;this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate")),(!this.isEnded||this.duration<=0)&&setTimeout((function(){return 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.startTimeChangeEmit(),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;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"),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:"isEnded",get:function(){return this.howl?this.isHowlEnd:Math.abs(this.currentTime-this.duration)<.001}},{key:"isPaused",get:function(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&this.howl.playing(this.staticEventId)}}]),n}(Ks.a),Wg=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())}))},Yg=function(e){p(n,e);var t=m(n);function n(e){var r,i,o,a,s,u;_(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 l=e.video.src;r.videoResource=new Xl.w(l,{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 c=e.video.src.replace(/4$/,"3");r.ctx.loaderDelegate&&(c=r.ctx.loaderDelegate.redirectMedia(c),r.ctx.logger.info("redirect media url from ".concat(e.video.src.replace(/4$/,"3")," to ").concat(c," by delegate."),e.ctx.taskId)),r.rtcAudio=new Vg(c,e.ctx.runningAudio);var h=e.video,d=e.width,f=e.height,p=e.target;r.controller=new Gg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,width:d,height:f,target:p,media:y(r),info:h,canvasElement:e.canvasElement}),r.controller.addPlayCallBack((function(){r.sprite.width=d,r.sprite.height=f,r.ctx.clock.setTimeout((function(){r.sprite.visible=!0}),50)}));var v=new Xl.c(null,{height:f,width:d});return v.resource=r.videoResource,r.videoResource.bind(v),r.sprite=new Ld,r.sprite.visible=!1,r.sprite.texture=new Xl.t(v),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 Wg(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.once("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.once("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.seek(0),this.pause(),this.ctx.eventHub.emit(yb.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){return Wg(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:"ended",get:function(){var e,t;return null===(t=null===(e=this.videoElement)||void 0===e?void 0:e.ended)||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),Xg=function(e){p(n,e);var t=m(n);function n(e){var r;_(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 i=e.audio.src;r.audioPlayer=new Vg(i,e.ctx.runningAudio),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 o=e.width,a=e.height,s=e.target;return r.controller=new Gg({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,height:a,width:o,target:s,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.seek(0),this.pause(),this.ctx.eventHub.emit(yb.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)}},{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:"ended",get:function(){return this.audioPlayer.isEnded}},{key:"duration",get:function(){return this.audioPlayer.duration}}]),n}(Ks.a),Qg=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())}))},Zg=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 jm(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 Qg(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 Yg({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 Xg({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,Dg.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 Qg(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}(Sg),qg=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())}))},Jg=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 jm(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 qg(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 Sg(i,this.ctx,l):"Picture"===(null==i?void 0:i.type)?o=new Zg(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),$g=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 eb({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 Kg("mainSeq",i.nextCondLst,{global:h,runtime:r.runtimeNodeEventHub},r.ctx),r.prevConds=new Kg("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(yb.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(yb.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(yb.userInput);var t="shape ".concat(n," onClick"),r=e.ctx.mode;"interactive"!==r&&"sync"!==r||e.ctx.eventHub.emit(yb.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&&ey(r.timingTarget,n,i)}})),r}return T(n,[{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(ny),iy=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},oy=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}(),ay=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}(oy);iy([iv()],ay.prototype,"interpolationFrom",null);var sy=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&&(r=this.resolveValue()),r}},{key:"resolveValue",value:function(){return this.value||""}}]),n}(oy);iy([iv()],sy.prototype,"interpolationFrom",null);var uy=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}(oy);iy([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)).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}(oy);iy([iv()],ly.prototype,"interpolationFrom",null);var cy=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.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=ty(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]&&ey(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]&&ey(r.timingTarget,o[0],h)}},r.onSeekToStart=function(){null!==r.startVal&&r.timingTarget&&ey(r.timingTarget,r.json.cBhvr.attrList[0],r.startVal)},r.onSeekToEnd=function(){r.onTimeUpdate({duration:1,delta:1,isReverse:!1})},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}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 uy(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 uy(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 uy(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 uy(u,this.timingTarget);this.keyFrames.push([u.time,l])}}if(this.json.tavLst.length>0){var c,h=E(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 uy(d,this.timingTarget):"str"===t&&(f=new sy(d,this.timingTarget)):"number"===d.val.type?f=new ay(d,this.timingTarget):"color"===d.val.type?(this.isColorAnim=!0,f=new ly(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}(ny),hy=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),dy=n(121),fy=n.n(dy),py=n(122),vy=n.n(py),my=n(123),gy=n.n(my),yy=n(124),by=n.n(yy),xy=n(9),_y=n.n(xy),wy=n(125),Ty=n.n(wy),My=n(126),Ey=n.n(My),Sy="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==",Ay=n(127),Iy=n.n(Ay),Cy=n(128),Ny=n.n(Cy),ky=n(129),Dy=n.n(ky),Py=n(130),Oy=n.n(Py),Ry=n(131),Ly=n.n(Ry),jy=n(132),By=n.n(jy),Uy=n(133),Fy=n.n(Uy),zy=n(134),Gy=n.n(zy),Hy=n(135),Vy=n.n(Hy),Wy={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,vy.a,fy.a,{percent:0,direction:1,transition:0})).uniforms.direction=i,r}return n}(hy),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,gy.a,{percent:0,transition:1})).uniforms.transition=Math.pow(i,i),r}return n}(hy),blinds:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,by.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,r}return n}(hy),checkerboard:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,Ty.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="down"===e?1:0,r}return n}(hy),dissolve:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.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(Sy)}}]),n}(hy),randombar:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,Iy.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(Sy)}}]),n}(hy),circle:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,Ny.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(hy),box:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,Dy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(hy),diamond:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,Oy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(hy),plus:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,Ly.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(hy),barn:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,By.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}(hy),strips:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.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}(hy),wedge:function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,_y.a,Gy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}return n}(hy),wheel:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,_y.a,Vy.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option=Number(e)||1,r}return n}(hy)},Yy=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(){var e;if((null===(e=r.timingTarget)||void 0===e?void 0:e.container.filters)&&r.filter){r.timingTarget.removeAnimationFilterQueue(r.filter);var t=r.timingTarget.getFirstAnimationFilter();r.timingTarget.container.filters=t?[t]:[]}}))},r.onSeekToStart=function(){r.timingTarget&&(r.timingTarget.container.filters=[],r.filter&&r.timingTarget.removeAnimationFilterQueue(r.filter))},r.onSeekToEnd=function(){r.timingTarget&&(r.timingTarget.container.filters=[],r.filter&&r.timingTarget.removeAnimationFilterQueue(r.filter))},r.commonTimeNode.on("timelineStart",(function(){r.filter&&r.timingTarget&&(r.timingTarget.addToAnimationFilterQueue(r.filter),r.timingTarget.container.filters&&0!==r.timingTarget.container.filters.length||(r.timingTarget.container.filters=[r.filter]))})),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];Wy[s]&&(r.filter=new Wy[s](u),r.filterType="".concat(s,"-").concat(u),r.filter&&(r.filter.transition=o))}return r}return T(n,[{key:"modifyAttrKey",get:function(){return this.filterType}}]),n}(ny),Xy=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.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=E(r);try{for(o.s();!(i=o.n()).done;){var a=i.value.trim().replace(/\s+/g," ").split(" "),u=d(t=a)||s(t)||S(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}(ny),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.startVal=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.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}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}(ny),Zy=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];ey(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];ey(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];ey(r.timingTarget,i+".on","false")}}},r.onTimeNodeStart=function(){if(r.timingTarget){var e=r.json.cBhvr.attrList[0],t=ty(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];ey(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}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=ty(this.timingTarget,e);t&&(this.currentColorString=t)}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(ny),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.startVal=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.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.from=r.json.from,r.to=r.json.to,r.by=r.json.by,r.by?r.isConflict=!1:r.isConflict=!0,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}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}(ny),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.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}(ny),Ky=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 eb({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 Vg(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 $y(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 eb=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 Kg(r.json.id||"",h.stCondLst,l,r.ctx),r.endConds=new Kg(r.json.id||"",h.endCondLst,l,r.ctx),h.endSync&&(r.endSync=new Kg(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 $g(r):"par"===e.type?n=new tb(r):"set"===e.type?n=new ry(r):"anim"===e.type?n=new cy(r):"animEffect"===e.type?n=new Yy(r):"animMotion"===e.type?n=new Xy(r):"animScale"===e.type?n=new Qy(r):"animClr"===e.type?n=new Zy(r):"animRot"===e.type?n=new qy(r):"cmd"===e.type?n=new Jy(r):"audio"===e.type&&(n=new Ky(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 $y(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=$y(e).id,c=$y(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(yb.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(yb.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(yb.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=E(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(yb.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),tb=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 eb({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 ry&&r.commonTimeNode.children.forEach((function(e){e instanceof ry||"function"!=typeof e.onSeekToStart||e.onSeekToStart()}))})),r}return n}(Ks.a),nb=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 tb({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}(),rb=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())}))},ib=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(yb.requestPrevSlide,t)})),this.ctx.timingEventHub.on("c:next slide",(function(t,n){e.ctx.eventHub.emit(yb.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 rb(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 nb(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(yb.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(yb.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 rb(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}(),ab=function(e){return new Promise((function(t){return setTimeout(t,e)}))},sb=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,ab(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),ub=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;--S)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 ib(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 lb(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(e,t){n.addSubMTask((function(){return r.graphicsTexture.render(e,t,i.objPoolGroup)}),"@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 lb(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 sb(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 lb(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}(),hb=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())}))},db=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 hb(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 hb(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}();db.localCache=null;try{db.localCache=b.createInstance({name:"slide_local_cache",driver:b.INDEXEDDB,version:1})}catch(u){}var fb=new jl.j,pb=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=fb).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),mb=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 gb={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"},yb={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",userInput:"userInput",fullscreenChange:"fullscreenChange",changeLocalFullscreenState:"changeLocalFullscreenState"},bb=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})}),Lg)},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(yb.userInput)}};if(r.app.view.addEventListener("pointerdown",c,!1),r.cacheFunctionMap.set("pointerdown",c),Dg.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(yb.changeLocalFullscreenState,{status:!1,slideIndex:r.currentIndex,targetId:null===(t=r.currentStage)||void 0===t?void 0:t.ctx.latestChangeFullscreenTargetId})},r.logger=e.logger,r.mode=e.mode,r.volumeAdjuster=e.volumeAdjuster,r.localStorage=new db(r.logger),r.cachedExtract=new pb(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,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.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 cb(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<1&&(e=1),e>4&&(e=4);var t=[999999,960,1280,1920,3200][e],n=[999999,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 mb(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=arguments.length,r=new Array(e),i=0;i0&&this.view&&f&&(v=a.json.transition,!this.isForward&&(null==f?void 0:f.json.transition)&&(v=f.json.transition),m=this.getTransactionTexture(f,this.view,null,null),this.initTransactionPlayer(v),null===(n=this.transactionPlayer)||void 0===n||n.setPrevTexture(m),p=!0),this.app.stage.addChild(a.container),this.updateResolution(this.config.resolution*this.scale),f&&(f.clearOnTransactionEnd(),this.app.stage.removeChild(f.container)),!(a.json.transition&&a.json.transition.type&&this.app.stage.children.length>0&&this.view&&this.transactionPlayer&&p)){i.next=30;break}return i.next=23,this.getTransactionTexture(a,this.view,s,u);case 23:return g=i.sent,this.transactionPlayer.setNextTexture(g),i.next=27,this.transactionPlayer.play();case 27:if(y=this.transactionPlayer.renderer.domElement,this.view.parentElement&&y)try{this.view.parentElement.removeChild(y)}catch(e){}null===(r=this.transactionPlayer)||void 0===r||r.dispose();case 30:if(!this.isForward){i.next=35;break}return i.next=33,a.startTiming();case 33:i.next=36;break;case 35:a.setMainSeqApplied();case 36:a.ctx.slideScopeEventHub.emit("slide-render",a.ctx.slideIndex),this.emit(yb.renderEnd,e),this.emit(yb.slideChange,e),a.ctx.isRendering=!1,this.preload(e+1).catch((function(t){b.errorChannel.emit("error",rv.transform(t),e+1)})),this.preload(e-1).catch((function(t){b.errorChannel.emit("error",rv.transform(t),e-1)})),this.logger.info("render slide ".concat(e," done, time: ").concat(Date.now()-o,"ms"),this.taskId);case 43: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 mb(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 mb(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 mb(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);try{this.app.renderer.filter.texturePool.clear(!0)}catch(e){}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();try{this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext()}catch(e){}this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0}),null===(t=ub.worker)||void 0===t||t.terminate()}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=db.localCache)||void 0===e||e.clear().catch((function(){}))}}]),n}(Ks.a);bb.platform=Dg,bb.RtcAudioClazz=null;var xb,_b=new Map,wb=n(136),Tb=n.n(wb),Mb=n(49),Eb=n.n(Mb),Sb=n(50),Ab=n.n(Sb),Ib=[],Cb="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"}(xb||(xb={}));var Nb,kb=function(e){return Object.freeze(e)},Db=function(e,t){this.inlineSize=e,this.blockSize=t,kb(this)},Pb=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,kb(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}(),Ob=function(e){return e instanceof SVGElement&&"getBBox"in e},Rb=function(e){if(Ob(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)},Lb=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)},jb="undefined"!=typeof window?window:{},Bb=new WeakMap,Ub=/auto|scroll/,Fb=/^tb|vertical/,zb=/msie|trident/i.test(jb.navigator&&jb.navigator.userAgent),Gb=function(e){return parseFloat(e||"0")},Hb=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Db((n?t:e)||0,(n?e:t)||0)},Vb=kb({devicePixelContentBoxSize:Hb(),borderBoxSize:Hb(),contentBoxSize:Hb(),contentRect:new Pb(0,0,0,0)}),Wb=function(e,t){if(void 0===t&&(t=!1),Bb.has(e)&&!t)return Bb.get(e);if(Rb(e))return Bb.set(e,Vb),Vb;var n=getComputedStyle(e),r=Ob(e)&&e.ownerSVGElement&&e.getBBox(),i=!zb&&"border-box"===n.boxSizing,o=Fb.test(n.writingMode||""),a=!r&&Ub.test(n.overflowY||""),s=!r&&Ub.test(n.overflowX||""),u=r?0:Gb(n.paddingTop),l=r?0:Gb(n.paddingRight),c=r?0:Gb(n.paddingBottom),h=r?0:Gb(n.paddingLeft),d=r?0:Gb(n.borderTopWidth),f=r?0:Gb(n.borderRightWidth),p=r?0:Gb(n.borderBottomWidth),v=h+l,m=u+c,g=(r?0:Gb(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:Gb(n.width)-_-x,M=r?r.height:Gb(n.height)-w-b,E=T+v+x+g,S=M+m+b+y,A=kb({devicePixelContentBoxSize:Hb(Math.round(T*devicePixelRatio),Math.round(M*devicePixelRatio),o),borderBoxSize:Hb(E,S,o),contentBoxSize:Hb(T,M,o),contentRect:new Pb(h,u,T,M)});return Bb.set(e,A),A},Yb=function(e,t,n){var r=Wb(e,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case xb.DEVICE_PIXEL_CONTENT_BOX:return a;case xb.BORDER_BOX:return i;default:return o}},Xb=function(e){var t=Wb(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=kb([t.borderBoxSize]),this.contentBoxSize=kb([t.contentBoxSize]),this.devicePixelContentBoxSize=kb([t.devicePixelContentBoxSize])},Qb=function(e){if(Rb(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Zb=function(){var e=1/0,t=[];Ib.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Xb(t.target),i=Qb(t.target);r.push(n),t.lastReportedSize=Yb(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Jb=[],Kb=0,$b={attributes:!0,characterData:!0,childList:!0,subtree:!0},ex=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],tx=function(e){return void 0===e&&(e=0),Date.now()+e},nx=!1,rx=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),!nx){nx=!0;var n,r=tx(e);n=function(){var n=!1;try{n=function(){var e,t=0;for(qb(t);Ib.some((function(e){return e.activeTargets.length>0}));)t=Zb(),qb(t);return Ib.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Cb}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Cb),window.dispatchEvent(e)),t>0}()}finally{if(nx=!1,e=r-tx(),!Kb)return;n?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!Nb){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Jb.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Nb=function(){n.textContent="".concat(t?t--:t++)}}Jb.push(e),Nb()}((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,$b)};document.body?t():jb.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),ex.forEach((function(t){return jb.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),ex.forEach((function(t){return jb.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ix=function(e){!Kb&&e>0&&rx.start(),!(Kb+=e)&&rx.stop()},ox=function(){function e(e,t){this.target=e,this.observedBox=t||xb.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=Yb(this.target,this.observedBox,!0);return e=this.target,Ob(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}(),ax=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},sx=new WeakMap,ux=function(e,t){for(var n=0;n=0&&(i&&Ib.splice(Ib.indexOf(n),1),n.observationTargets.splice(r,1),ix(-1))},e.disconnect=function(e){var t=this,n=sx.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),cx=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.");lx.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(!Lb(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");lx.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(!Lb(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");lx.unobserve(this,e)},e.prototype.disconnect=function(){lx.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),hx=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(px&&e.forEach&&e.forEach===px)e.forEach(t,n);else if(e.length===e.length+0){var r,i=void 0;for(i=0,r=e.length;i1?mx.toArray(arguments):arguments[0];return mx.each(gx,(function(t){if(t.litmus(e))return mx.each(t.conversions,(function(t,n){if(yx=t.read(e),!1===bx&&!1!==yx)return bx=yx,yx.conversionName=n,yx.conversion=t,mx.BREAK})),mx.BREAK})),bx},_x=void 0,wx={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<<(_x=8*t)|e&~(255<<_x)}},Tx="function"==typeof Symbol&&"symbol"==M(Symbol.iterator)?function(e){return M(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":M(e)},Mx=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ex=function(){function e(e,t){for(var n=0;n-1?t.length-t.indexOf(".")-1:0}var zx=function(e){function t(e,n,r){Mx(this,t);var i=Ix(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,mx.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 Ax(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),Sx(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}(Dx),Gx=function(e){function t(e,n,r){Mx(this,t);var i=Ix(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(){Lx.unbind(window,"mousemove",u),Lx.unbind(window,"mouseup",l),s()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),Lx.bind(i.__input,"change",(function(){var e=parseFloat(o.__input.value);mx.isNaN(e)||o.setValue(e)})),Lx.bind(i.__input,"blur",(function(){s()})),Lx.bind(i.__input,"mousedown",(function(e){Lx.bind(window,"mousemove",u),Lx.bind(window,"mouseup",l),a=e.clientY})),Lx.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 Ax(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),Sx(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(zx);function Hx(e,t,n,r,i){return r+(e-t)/(n-t)*(i-r)}var Vx=function(e){function t(e,n,r,i,o){Mx(this,t);var a=Ix(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(Hx(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function l(){Lx.unbind(window,"mousemove",u),Lx.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(Hx(t,n.left,n.right,s.__min,s.__max))}function h(){Lx.unbind(window,"touchmove",c),Lx.unbind(window,"touchend",h),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),Lx.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),Lx.bind(window,"mousemove",u),Lx.bind(window,"mouseup",l),u(e)})),Lx.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(Lx.bind(window,"touchmove",c),Lx.bind(window,"touchend",h),c(e))})),Lx.addClass(a.__background,"slider"),Lx.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return Ax(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+"%",Sx(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(zx),Wx=function(e){function t(e,n,r){Mx(this,t);var i=Ix(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,Lx.bind(i.__button,"click",(function(e){return e.preventDefault(),o.fire(),!1})),Lx.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return Ax(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}(Dx),Yx=function(e){function t(e,n){Mx(this,t);var r=Ix(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));r.__color=new Cx(r.getValue()),r.__temp=new Cx(0);var i=r;r.domElement=document.createElement("div"),Lx.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 ",Lx.bind(r.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),Lx.bind(r.__input,"blur",h),Lx.bind(r.__selector,"mousedown",(function(){Lx.addClass(this,"drag").bind(window,"mouseup",(function(){Lx.removeClass(i.__selector,"drag")}))})),Lx.bind(r.__selector,"touchstart",(function(){Lx.addClass(this,"drag").bind(window,"touchend",(function(){Lx.removeClass(i.__selector,"drag")}))}));var o,a=document.createElement("div");function s(e){f(e),Lx.bind(window,"mousemove",f),Lx.bind(window,"touchmove",f),Lx.bind(window,"mouseup",l),Lx.bind(window,"touchend",l)}function u(e){p(e),Lx.bind(window,"mousemove",p),Lx.bind(window,"touchmove",p),Lx.bind(window,"mouseup",c),Lx.bind(window,"touchend",c)}function l(){Lx.unbind(window,"mousemove",f),Lx.unbind(window,"touchmove",f),Lx.unbind(window,"mouseup",l),Lx.unbind(window,"touchend",l),d()}function c(){Lx.unbind(window,"mousemove",p),Lx.unbind(window,"touchmove",p),Lx.unbind(window,"mouseup",c),Lx.unbind(window,"touchend",c),d()}function h(){var e=xx(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 mx.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),mx.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}),mx.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),mx.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),mx.extend(a.style,{width:"100%",height:"100%",background:"none"}),Qx(a,"top","rgba(0,0,0,0)","#000"),mx.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%);",mx.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),Lx.bind(r.__saturation_field,"mousedown",s),Lx.bind(r.__saturation_field,"touchstart",s),Lx.bind(r.__field_knob,"mousedown",s),Lx.bind(r.__field_knob,"touchstart",s),Lx.bind(r.__hue_field,"mousedown",u),Lx.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 Ax(t,e),Ex(t,[{key:"updateDisplay",value:function(){var e=xx(this.getValue());if(!1!==e){var t=!1;mx.each(Cx.COMPONENTS,(function(n){if(!mx.isUndefined(e[n])&&!mx.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&mx.extend(this.__color.__state,e)}mx.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;mx.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,Qx(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),mx.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),t}(Dx),Xx=["-moz-","-o-","-webkit-","-ms-",""];function Qx(e,t,n,r){e.style.background="",mx.each(Xx,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+r+" 100%); "}))}var Zx='
\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
',qx=function(e,t){var n=e[t];return mx.isArray(arguments[2])||mx.isObject(arguments[2])?new Bx(e,t,arguments[2]):mx.isNumber(n)?mx.isNumber(arguments[2])&&mx.isNumber(arguments[3])?mx.isNumber(arguments[4])?new Vx(e,t,arguments[2],arguments[3],arguments[4]):new Vx(e,t,arguments[2],arguments[3]):mx.isNumber(arguments[4])?new Gx(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Gx(e,t,{min:arguments[2],max:arguments[3]}):mx.isString(n)?new Ux(e,t):mx.isFunction(n)?new Wx(e,t,""):mx.isBoolean(n)?new jx(e,t):null},Jx=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},Kx=function(){function e(){Mx(this,e),this.backgroundElement=document.createElement("div"),mx.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"}),Lx.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),mx.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;Lx.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(),mx.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",Lx.unbind(e.domElement,"webkitTransitionEnd",t),Lx.unbind(e.domElement,"transitionend",t),Lx.unbind(e.domElement,"oTransitionEnd",t)};Lx.bind(this.domElement,"webkitTransitionEnd",t),Lx.bind(this.domElement,"transitionend",t),Lx.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-Lx.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-Lx.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 $x=function(){try{return!!window.localStorage}catch(e){return!1}}(),e_=void 0,t_=!0,n_=void 0,r_=!1,i_=[],o_=function e(t){var n=this,r=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),Lx.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=mx.defaults(r,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),r=mx.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),mx.isUndefined(r.load)?r.load={preset:"Default"}:r.preset&&(r.load.preset=r.preset),mx.isUndefined(r.parent)&&r.hideable&&i_.push(this),r.resizable=mx.isUndefined(r.parent)&&r.resizable,r.autoPlace&&mx.isUndefined(r.scrollable)&&(r.scrollable=!0);var i,o=$x&&"true"===localStorage.getItem(h_(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(),c_(e,n.object,n.property,{before:r,factoryArgs:[mx.toArray(arguments)]})}if(mx.isArray(t)||mx.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),c_(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 Vx){var r=new Gx(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});mx.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)}})),Lx.addClass(t,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof Gx){var i=function(t){if(mx.isNumber(n.__min)&&mx.isNumber(n.__max)){var r=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var o=c_(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=mx.compose(i,n.min),n.max=mx.compose(i,n.max)}else n instanceof jx?(Lx.bind(t,"click",(function(){Lx.fakeEvent(n.__checkbox,"click")})),Lx.bind(n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof Wx?(Lx.bind(t,"click",(function(){Lx.fakeEvent(n.__button,"click")})),Lx.bind(t,"mouseover",(function(){Lx.addClass(n.__button,"hover")})),Lx.bind(t,"mouseout",(function(){Lx.removeClass(n.__button,"hover")}))):n instanceof Yx&&(Lx.addClass(t,"color"),n.updateDisplay=mx.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=mx.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&u_(e.getRoot(),!0),t}),n.setValue)}(e,u,i),e.__controllers.push(i),i}function h_(e,t){return document.location.href+"."+t}function d_(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 f_(e,t){t.style.display=e.useLocalStorage?"block":"none"}function p_(e){var t=e.__save_row=document.createElement("li");Lx.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),Lx.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",Lx.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",Lx.addClass(r,"button"),Lx.addClass(r,"save");var i=document.createElement("span");i.innerHTML="New",Lx.addClass(i,"button"),Lx.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",Lx.addClass(o,"button"),Lx.addClass(o,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?mx.each(e.load.remembered,(function(t,n){d_(e,n,n===e.preset)})):d_(e,"Default",!1),Lx.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=m_(this)),e.folders={},mx.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]=m_(this),u_(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=m_(this,!0)),this.load.remembered[e]=m_(this),this.preset=e,d_(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){mx.each(this.__controllers,(function(t){this.getRoot().load.remembered?l_(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),mx.each(this.__folders,(function(e){e.revert(e)})),e||u_(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&Jx.call(window,(function(){e(t)})),mx.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){mx.each(this.__controllers,(function(e){e.updateDisplay()})),mx.each(this.__folders,(function(e){e.updateDisplay()}))}});var g_=o_,y_=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})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(e){this.player.updateConfig({maxFPS:e})},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}(),b_=function(){function e(e,t){var n;this.config=new y_(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 g_({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}(),x_=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}(),__=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}(),w_=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}(),T_=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())}))},M_=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 S_(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 N_(r,void 0,void 0,(function(){var t,n,r,i,o,a=this;return k_(this,(function(s){switch(s.label){case 0:return Tv()(e.incrId)&&(e.incrId&&e.incrId-this._receiveIncrId!=1&&this.emit(R_.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),N_(r,void 0,void 0,(function(){var t;return k_(this,(function(n){return this.player?((t=this.player.prevSlideIndex)>=1&&(this.config.navigatorDelegate?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),N_(r,void 0,void 0,(function(){var t;return k_(this,(function(n){return this.player?((t=this.player.nextSlideIndex)<=this.slideCount&&(this.config.navigatorDelegate?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),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.anchor=r.config.anchor,r.syncQueue=new x_(r.receiveSyncHandler),r.lock=new __("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(R_.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)})),window.addEventListener("message",r.recoverHandler),t.volumeAdjuster.on("update",r._updateVolumeByStaticAdjuster),r}var n,r;return I_(t,e),t.flushLog=function(e){return void 0===e&&(e=!1),N_(this,void 0,void 0,(function(){return k_(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==B_?void 0:B_.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 N_(this,void 0,void 0,(function(){var n,r,i,o,a;return k_(this,(function(s){switch(s.label){case 0:return t.remoteLogAddress=e,[4,t.flushLog(!0)];case 1:if(s.sent(),!B_)return[3,13];n=[],s.label=2;case 2:return s.trys.push([2,4,,5]),[4,B_.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 N_(this,void 0,void 0,(function(){var i,o=this;return k_(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,P_(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 N_(this,void 0,void 0,(function(){var e;return k_(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 N_(this,void 0,void 0,(function(){return k_(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 N_(this,void 0,void 0,(function(){var n=this;return k_(this,(function(r){switch(r.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((bb.platform.isIOS()||bb.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=bb.platform.isLowGpuMemory()?15:30;return(bb.platform.isIOS()||bb.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(R_.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(R_.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;!Tb()(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(R_.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=C_(C_({},e),{uuid:t,clientId:this.config.clientId});"sync"===this.config.mode&&(n.incrId=this.dispatchIncrId),this.emit(R_.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 N_(this,void 0,void 0,(function(){var t,n,r,i=this;return k_(this,(function(o){switch(o.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",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]=C_(C_({},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 N_(this,void 0,void 0,(function(){var n,r,i,o;return k_(this,(function(a){switch(a.label){case 0:if(this.logger.info("do release slide",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=Ab()(L_),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);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 N_(this,void 0,void 0,(function(){var e;return k_(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return this.isLoading&&e<10?[4,P_(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 N_(this,void 0,void 0,(function(){return k_(this,(function(e){return this.player?[2,this.player.getSnapshot()]:[2,null]}))}))},t.prototype.snapshotWithTimingEnd=function(e){return N_(this,void 0,void 0,(function(){return k_(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(){bb.clearLocalCache()},t.disposeLocalCache=function(){},n=t,t.preloadResource=S_,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=_b.get(n.hookPoint)||[]).push(n),_b.set(n.hookPoint,r)},t.volumeAdjuster=new vb,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 N_(void 0,void 0,void 0,(function(){var r,i,o,a,s,u;return k_(n,(function(n){switch(n.label){case 0:return[4,t.flushLog(!0)];case 1:if(n.sent(),!B_)return[3,12];r=[],n.label=2;case 2:return n.trys.push([2,4,,5]),[4,B_.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}function he(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 de(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 fe="https://convertcdn.netless.link/dynamicConvert";t.DefaultUrl=fe;var pe={taskId:"",url:"",state:null},ve=function(){function e(t){var n,r=this,i=t.context,o=t.anchor,a=t.onPageChanged,s=t.onTransitionStart,u=t.onTransitionEnd,c=t.onError,h=t.onRenderError,d=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.onPageChanged=a,this.onTransitionStart=s,this.onTransitionEnd=u,this.onError=c,this.onRenderError=h,this.showRenderError=null==d||d,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),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(pe);var n=e.storage.state,r=n.taskId,i=n.url,o=n.state;t.setResource(r,i||fe),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.slideChange,this.onPageChanged),n.on(L.SLIDE_EVENTS.renderStart,this.onTransitionStart),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(pe);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=this.context.getAppOptions()||{};return new L.Slide({anchor:e,interactive:!0,mode:"interactive",controller:oe.enable,enableGlobalClick:null==(t=i.enableGlobalClick)||t,renderOptions:{minFPS:i.minFPS||25,maxFPS:i.maxFPS||30,autoFPS:null==(n=i.autoFPS)||n,autoResolution:null==(r=i.autoResolution)||r,resolution:i.resolution,transactionBgColor:i.bgColor||ce(e),maxResolutionLevel:i.maxResolutionLevel,forceCanvas:i.forceCanvas,enableNvidiaDetect:i.enableNvidiaDetect},fixedFrameSize:i.fixedFrameSize,loaderDelegate:i.loaderDelegate,navigatorDelegate:i.navigatorDelegate,urlInterrupter:i.urlInterrupter,resourceTimeout:i.resourceTimeout,rtcAudio:i.rtcAudio,useLocalCache:i.useLocalCache,logger:i.logger,timestamp:this.timestamp})}},{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 me="undefined"!=typeof window,ge=me&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),ye=me&&"IntersectionObserver"in window,be=me&&"classList"in document.createElement("p"),xe=me&&window.devicePixelRatio>1,_e={elements_selector:".lazy",container:ge||me?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},we=function(e){return Object.assign({},_e,e)},Te=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)},Me="src",Ee="srcset",Se="sizes",Ae="poster",Ie="llOriginalAttrs",Ce="data",Ne="loading",ke="loaded",De="applied",Pe="error",Oe="native",Re="data-",Le="ll-status",je=function(e,t){return e.getAttribute(Re+t)},Be=function(e){return je(e,Le)},Ue=function(e,t){return function(e,t,n){var r=Re+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)}(e,Le,t)},Fe=function(e){return Ue(e,null)},ze=function(e){return null===Be(e)},Ge=function(e){return Be(e)===Oe},He=[Ne,ke,De,Pe],Ve=function(e,t,n,r){e&&(void 0===r?void 0===n?e(t):e(t,n):e(t,n,r))},We=function(e,t){be?e.classList.add(t):e.className+=(e.className?" ":"")+t},Ye=function(e,t){be?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Xe=function(e){return e.llTempImage},Qe=function(e,t){if(t){var n=t._observer;n&&n.unobserve(e)}},Ze=function(e,t){e&&(e.loadingCount+=t)},qe=function(e,t){e&&(e.toLoadCount=t)},Je=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},Ke=function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&Je(n).forEach(t)},$e=function(e,t){Je(e).forEach(t)},et=[Me],tt=[Me,Ae],nt=[Me,Ee,Se],rt=[Ce],it=function(e){return!!e[Ie]},ot=function(e){return e[Ie]},at=function(e){return delete e[Ie]},st=function(e,t){if(!it(e)){var n={};t.forEach((function(t){n[t]=e.getAttribute(t)})),e[Ie]=n}},ut=function(e,t){if(it(e)){var n=ot(e);t.forEach((function(t){!function(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}(e,t,n[t])}))}},lt=function(e,t,n){We(e,t.class_applied),Ue(e,De),n&&(t.unobserve_completed&&Qe(e,t),Ve(t.callback_applied,e,n))},ct=function(e,t,n){We(e,t.class_loading),Ue(e,Ne),n&&(Ze(n,1),Ve(t.callback_loading,e,n))},ht=function(e,t,n){n&&e.setAttribute(t,n)},dt=function(e,t){ht(e,Se,je(e,t.data_sizes)),ht(e,Ee,je(e,t.data_srcset)),ht(e,Me,je(e,t.data_src))},ft={IMG:function(e,t){Ke(e,(function(e){st(e,nt),dt(e,t)})),st(e,nt),dt(e,t)},IFRAME:function(e,t){st(e,et),ht(e,Me,je(e,t.data_src))},VIDEO:function(e,t){$e(e,(function(e){st(e,et),ht(e,Me,je(e,t.data_src))})),st(e,tt),ht(e,Ae,je(e,t.data_poster)),ht(e,Me,je(e,t.data_src)),e.load()},OBJECT:function(e,t){st(e,rt),ht(e,Ce,je(e,t.data_src))}},pt=["IMG","IFRAME","VIDEO","OBJECT"],vt=function(e,t){!t||function(e){return e.loadingCount>0}(t)||function(e){return e.toLoadCount>0}(t)||Ve(e.callback_finish,t)},mt=function(e,t,n){e.addEventListener(t,n),e.llEvLisnrs[t]=n},gt=function(e,t,n){e.removeEventListener(t,n)},yt=function(e){return!!e.llEvLisnrs},bt=function(e){if(yt(e)){var t=e.llEvLisnrs;for(var n in t){var r=t[n];gt(e,n,r)}delete e.llEvLisnrs}},xt=function(e,t,n){!function(e){delete e.llTempImage}(e),Ze(n,-1),function(e){e&&(e.toLoadCount-=1)}(n),Ye(e,t.class_loading),t.unobserve_completed&&Qe(e,n)},_t=function(e,t,n){var r=Xe(e)||e;if(!yt(r)){!function(e,t,n){yt(e)||(e.llEvLisnrs={});var r="VIDEO"===e.tagName?"loadeddata":"load";mt(e,r,t),mt(e,"error",n)}(r,(function(i){!function(e,t,n,r){var i=Ge(t);xt(t,n,r),We(t,n.class_loaded),Ue(t,ke),Ve(n.callback_loaded,t,r),i||vt(n,r)}(0,e,t,n),bt(r)}),(function(i){!function(e,t,n,r){var i=Ge(t);xt(t,n,r),We(t,n.class_error),Ue(t,Pe),Ve(n.callback_error,t,r),n.restore_on_error&&ut(t,nt),i||vt(n,r)}(0,e,t,n),bt(r)}))}},wt=function(e,t,n){!function(e){e.llTempImage=document.createElement("IMG")}(e),_t(e,t,n),function(e){it(e)||(e[Ie]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,n){var r=je(e,t.data_bg),i=je(e,t.data_bg_hidpi),o=xe&&i?i:r;o&&(e.style.backgroundImage='url("'.concat(o,'")'),Xe(e).setAttribute(Me,o),ct(e,t,n))}(e,t,n),function(e,t,n){var r=je(e,t.data_bg_multi),i=je(e,t.data_bg_multi_hidpi),o=xe&&i?i:r;o&&(e.style.backgroundImage=o,lt(e,t,n))}(e,t,n),function(e,t,n){var r=je(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()),lt(e,t,n)}}(e,t,n)},Tt=function(e,t,n){_t(e,t,n),function(e,t,n){var r=ft[e.tagName];r&&(r(e,t),ct(e,t,n))}(e,t,n)},Mt=function(e,t,n){!function(e){return pt.indexOf(e.tagName)>-1}(e)?wt(e,t,n):Tt(e,t,n)},Et=function(e,t,n){e.setAttribute("loading","lazy"),_t(e,t,n),function(e,t){var n=ft[e.tagName];n&&n(e,t)}(e,t),Ue(e,Oe)},St=function(e){e.removeAttribute(Me),e.removeAttribute(Ee),e.removeAttribute(Se)},At=function(e){Ke(e,(function(e){ut(e,nt)})),ut(e,nt)},It={IMG:At,IFRAME:function(e){ut(e,et)},VIDEO:function(e){$e(e,(function(e){ut(e,et)})),ut(e,tt),e.load()},OBJECT:function(e){ut(e,rt)}},Ct=function(e){var t=It[e.tagName];t?t(e):function(e){if(it(e)){var t=ot(e);e.style.backgroundImage=t.backgroundImage}}(e)},Nt=function(e,t){Ct(e),function(e,t){ze(e)||Ge(e)||(Ye(e,t.class_entered),Ye(e,t.class_exited),Ye(e,t.class_applied),Ye(e,t.class_loading),Ye(e,t.class_loaded),Ye(e,t.class_error))}(e,t),Fe(e),at(e)},kt=function(e,t,n,r){n.cancel_on_exit&&function(e){return Be(e)===Ne}(e)&&"IMG"===e.tagName&&(bt(e),function(e){Ke(e,(function(e){St(e)})),St(e)}(e),At(e),Ye(e,n.class_loading),Ze(r,-1),Fe(e),Ve(n.callback_cancel,e,t,r))},Dt=function(e,t,n,r){var i=function(e){return He.indexOf(Be(e))>=0}(e);Ue(e,"entered"),We(e,n.class_entered),Ye(e,n.class_exited),function(e,t,n){t.unobserve_entered&&Qe(e,n)}(e,n,r),Ve(n.callback_enter,e,t,r),i||Mt(e,n,r)},Pt=["IMG","IFRAME","VIDEO"],Ot=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},Rt=function(e,t,n){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Dt(e.target,e,t,n):function(e,t,n,r){ze(e)||(We(e,n.class_exited),kt(e,t,n,r),Ve(n.callback_exit,e,t,r))}(e.target,e,t,n)}))},Lt=function(e,t){ye&&!Ot(e)&&(t._observer=new IntersectionObserver((function(n){Rt(n,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},jt=function(e){return Array.prototype.slice.call(e)},Bt=function(e){return e.container.querySelectorAll(e.elements_selector)},Ut=function(e){return function(e){return Be(e)===Pe}(e)},Ft=function(e,t){return function(e){return jt(e).filter(ze)}(e||Bt(t))},zt=function(e,t){var n;(n=Bt(e),jt(n).filter(Ut)).forEach((function(t){Ye(t,e.class_error),Fe(t)})),t.update()},Gt=function(e,t){var n=we(e);this._settings=n,this.loadingCount=0,Lt(n,this),function(e,t){me&&(t._onlineHandler=function(){zt(e,t)},window.addEventListener("online",t._onlineHandler))}(n,this),this.update(t)};Gt.prototype={update:function(e){var t,n,r=this._settings,i=Ft(e,r);(qe(this,i.length),!ge&&ye)?Ot(r)?function(e,t,n){e.forEach((function(e){-1!==Pt.indexOf(e.tagName)&&Et(e,t,n)})),qe(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,me&&window.removeEventListener("online",e._onlineHandler),Bt(this._settings).forEach((function(e){at(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){Qe(e,t),Mt(e,n,t)}))},restoreAll:function(){var e=this._settings;Bt(e).forEach((function(t){Nt(t,e)}))}},Gt.load=function(e,t){var n=we(t);Mt(e,n)},Gt.resetStatus=function(e){Fe(e)},me&&function(e,t){if(t)if(t.length)for(var n,r=0;n=t[r];r+=1)Te(e,n);else Te(e,t)}(Gt,window.lazyLoadOptions);var Ht=function(){function e(t){var n=this,r=t.readonly,i=t.onNewPageIndex,o=t.onPlay,a=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.urlInterrupter=a||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 Gt({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()},get:function(){return this._pages}}]),e}(),Vt=new Set(["clicker"]),Wt=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;_(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.onRenderEnd=function(){r.$overlay.style.opacity=""},this.refreshPages=function(){r.slideController&&(r.viewer.pages=he(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 Ht({readonly:i.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:h}),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,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||Vt.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}(),Yt=!1,Xt=2;t.FreezerLength=Xt;var Qt=function(e){return"["+e+"]"},Zt={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",Qt(this.queue));this.queue.length>Xt;){var t=this.queue.pop(),n=this.map.get(t);n&&(ae("[Slide] freezer: validate-freeze",t,Qt(this.queue)),n.freeze())}},set:function(e,t,n){ae("[Slide] freezer: add",e,Qt(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,Qt(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,Qt(this.queue)),t&&t.unfreeze()}};t.apps=Zt;var qt=new Set;var Jt=new Set;t.addHooks=function(e){Yt=!0,e.on("focus",(function(e){var t=e.appId;Zt.focus(t)})),e.on("created",(function(e){var t=e.appId;qt.forEach((function(e){return e(t)}))})),e.on("destroy",(function(e){var t=e.appId;Jt.forEach((function(e){return e(t)}))}))};var Kt=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}.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 $t=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=he(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 Ht({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(Kt)),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=$t;var en=L.Slide.usePlugin.bind(L.Slide);t.usePlugin=en;var tn="0.2.42";t.version=tn;var nn={kind:"Slide",setup:function(e){var t;if(console.log("[Slide] setup @ 0.2.42"),e.getIsWritable()&&e.storage.ensureState(pe),!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(Kt);try{r.$content.dataset.appSlideVersion=tn}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()&&(de(n,e,o.slideController.slide,i),r=!0),ae("[Slide] page to",t,r?"(synced)":""),o.viewer.setPageIndex(t-1)}};o=new Wt({box:r,view:n,mountSlideController:function(t){var n,o,s=e.getAppOptions()||{},u=new ve((n=R({context:e},t),o={onPageChanged:a,onRenderError:s.onRenderError,showRenderError:s.showRenderError},C(n,N(o))));return Yt&&Zt.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()&&(de(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});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),Yt&&Zt.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=nn;var rn=L.Slide;t.Slide=rn},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,E,S;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:(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.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 S.apply(this,arguments)})},{key:"pause",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.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 E.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)}))}},29165:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.RTCPlugin=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=S(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(E," 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}(b.a);!function(e){e.ResourceError="RESOURCE_ERROR",e.RuntimeError="RUNTIME_ERROR",e.RuntimeWarn="RUNTIME_WARN",e.CanvasCrash="CANVAS_CRASH"}(Qi||(Qi={}));var eo=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(Qi.RuntimeError,e.message)}}]),n}(r(Error));function to(){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||y>2048)&&(b=(m*=2048/g)*y)>2048&&(m*=y/b),x=document.createElement("canvas"),_=Math.ceil(v.width*m),w=Math.ceil(v.height*m),x.width=_,x.height=w,x.getContext("2d").drawImage(v,0,0,_,w),T=x.toDataURL("image/png"),M=new V.c(T,{resolution:1}),n.abrupt("return",(this.logger.info("load end. "+i,this.taskId||""),this.useCache&&this.localStorage.setItem(s,{scale:m,scaledBase64:T}).catch((function(){})),{baseTexture:M,scale:m}));case 54:case"end":return n.stop()}}),n,this)})))}},{key:"destroy",value:function(){}}]),e}(),po=function(){function e(t){var n=this;_(this,e),this.isPaused=!1,this.timestamp=0,this.callbackList=[],this.onTimeUpdate=function(e){var t=e/($t.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 To(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=wo(-n,h,d),v=i-p.x,m=o+p.y,g=wo(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 Mo=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}(),So=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}(Mo)),Eo=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}(Mo)),Ao=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=Eo.getObject(n),u=new V.c(s,{width:o*r,height:a*r,resolution:1}),l=So.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 _o()(t)||(t.x=t.x+e.offset.x+o,t.y=t.y+e.offset.y+a),t})).reduce((function(e,t){return _o()(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 V.t(u,new R.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=bo()(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],R=D[1],O=D[2],L=D[3];i={x:O,y:L},P=P/9525*n.x,R=R/9525*n.y,O=O/9525*n.x,L=L/9525*n.y,o.cmds.push(["Q",[{x:P,y:R},{x:O,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}),R=P.graphicsWidth,O=P.graphicsHeight,L=P.pathsData,j=P.pivot,B=P.padding;this.graphics.push({hash:D,pathsData:L,pivot:j,width:R,height:O,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=ro()(r.slice(0,i))).width,a=u.height;return u&&s.push(u),n.forEach((function(e){var t=ro()([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}(),No=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}(),ko=function e(t){var n=this;_(this,e),this.applyCommand=function(e,t){n.target.applyCommand(e,t)},this.target=t},Do=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}(),Po=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}(),Ro=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}(),Oo=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("click",(function(){return n.handleAction(e)})),this.object.cursor="pointer"):"hover"===t&&this.object.addListener("mouseover",(function(){return n.handleAction(e)}))}},{key:"addProxy",value:function(e){var t=this;this.proxy=e,this.hitArea=this.getOriginHitArea(),this.proxy.interactive=!0,this.actions.forEach((function(e){var n,r,i=c(e,2),o=i[0],a=i[1];"click"===a?null===(n=t.proxy)||void 0===n||n.addListener("click",(function(e){return t.handleProxyAction(e,o)})):"hover"===a&&(null===(r=t.proxy)||void 0===r||r.addListener("mouseover",(function(e){return t.handleProxyAction(e,o)})))}))}},{key:"handleProxyAction",value:function(e,t){var n,r=e.data.global,i=this.object.getGlobalPosition(),o=r.x-i.x+this.object.pivot.x,a=r.y-i.y+this.object.pivot.y;(null===(n=this.hitArea)||void 0===n?void 0:n.contains(o,a))&&this.object.visible&&this.handleAction(t,!0)}},{key:"getOriginHitArea",value:function(){return this.object.hitArea?this.object.hitArea:new R.k(0,0,this.object.width,this.object.height)}},{key:"handleAction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.proxy&&!t||(this.ctx.eventHub.emit(ml.hyperlinkTrigger,e),this.execAction(e))}},{key:"execAction",value:function(e){var t,n;if(this.ctx.eventHub.emit(ml.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(ml.requestGotoSlide,Number(r[1]))}else if("ppaction://hlinkshowjump?jump=nextslide"===e.action)this.ctx.eventHub.emit(ml.requestNextSlide);else if("ppaction://hlinkshowjump?jump=previousslide"===e.action)this.ctx.eventHub.emit(ml.requestPrevSlide);else if("ppaction://hlinkshowjump?jump=firstslide"===e.action)this.ctx.eventHub.emit(ml.requestGotoSlide,1);else if("ppaction://hlinkshowjump?jump=lastslide"===e.action)this.ctx.eventHub.emit(ml.requestGotoSlide,-1);else if("ppaction://hlinkshowjump?jump=lastslideviewed"===e.action){var i=this.ctx.lastViewedIndex;this.ctx.eventHub.emit(ml.requestGotoSlide,i)}else"ppaction://hlinkshowjump?jump=endshow"===e.action?this.ctx.eventHub.emit(ml.requestGotoSlide,-1):""===e.action&&(null===(n=e.target)||void 0===n?void 0:n.startsWith("http"))&&this.ctx.eventHub.emit(ml.requestOpenUrl,e.target)}}]),e}();function Lo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return Math.abs(e-t)<=Math.pow(10,-n)}function jo(e){return Math.floor(1e6*e)/1e6}var Bo=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 Lo(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(Lo(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 Lo(this.slope,Math.PI/2)?n=r*((t=this.point.x)-l)+c:Lo(e.slope,Math.PI/2)?n=i*((t=e.point.x)-a)+s:Lo(this.slope,Math.PI)||Lo(this.slope,0)?t=((n=this.point.y)-c)/r+l:Lo(e.slope,Math.PI)||Lo(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}(),Uo=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 R.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 D.b,this.animationFilterQueue=[],this.ctx=n,this.style=new Ro(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 Oo(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 Nn;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:"addToAnimationFilterQueue",value:function(e){this.animationFilterQueue.push(e)}},{key:"removeAnimationFilterQueue",value:function(e){var t=this.animationFilterQueue.findIndex((function(t){return t===e}));t<0||this.animationFilterQueue.splice(t,1)}},{key:"getFirstAnimationFilter",value:function(){return this.animationFilterQueue.length>0?this.animationFilterQueue[0]:null}},{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 jo(this.designWidth/this.ctx.stageWidth)}},{key:"design_ppt_h",get:function(){return jo((this.designHeight||this.container.height)/this.ctx.stageHeight)}},{key:"design_ppt_x",get:function(){return jo(this.designX/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return jo(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}(),Fo=n(76),zo=n.n(Fo),Go=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(Wo(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 Yo(e)}}]),e}(),Ho=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(Wo(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 Yo([this.r,this.g,this.b,this.a])}}]),e}();function Vo(e){var t=e.substring(1);return[parseInt(t.substring(0,6),16),parseInt(t.substring(6,8),16)/255]}function Wo(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 Yo(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 Xo(e,t,n){var r=Wo(e),i=Wo(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 Qo=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=Wo(e);this.uniforms.color=Float32Array.from(t)},get:function(){return this.currentColor}}]),n}(V.k),qo=new Li.ColorMatrixFilter;qo.matrix=[1,0,0,0,-.2,0,1,0,0,-.2,0,0,1,0,-.2,0,0,0,1,0];var Zo=new Li.ColorMatrixFilter;Zo.matrix=[1,0,0,0,-.1,0,1,0,0,-.1,0,0,1,0,-.1,0,0,0,1,0];var Jo=new Li.ColorMatrixFilter;Jo.matrix=[1,0,0,0,.2,0,1,0,0,.2,0,0,1,0,.2,0,0,0,1,0];var Ko=new Li.ColorMatrixFilter;Ko.matrix=[1,0,0,0,.1,0,1,0,0,.1,0,0,1,0,.1,0,0,0,1,0];var $o={darken:qo,darkenLess:Zo,lightenLess:Ko,lighten:Jo},ea=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 Qo,o.fill=new Po(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 jo(this.global.x/this.ctx.stageWidth)}},{key:"design_ppt_y",get:function(){return jo(this.global.y/this.ctx.stageHeight)}}]),n}(Uo),ta=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 D.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:oo(),path:t,fill:"norm",hasStroke:!0,scale:{x:1,y:1},hash:bo()(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 Rn,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}(),na=134217729;function ra(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=na*S)-(d-S)))*(m=I-(v=(d=na*I)-(d-I)))-((x=S*I)-f*v-p*v-f*m))-(g=_-(T=(p=A-(f=(d=na*A)-(d-A)))*(m=E-(v=(d=na*E)-(d-E)))-((w=A*E)-f*v-p*v-f*m))),oa[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),oa[1]=b-(g+h)+(h-w),h=(M=y+g)-y,oa[2]=y-(M-h)+(g-h),oa[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=na*s)-(d-s)))*(m=I-(v=(d=na*I)-(d-I)))-((x=s*I)-f*v-p*v-f*m))-(g=_-(T=(p=u-(f=(d=na*u)-(d-u)))*(m=E-(v=(d=na*E)-(d-E)))-((w=u*E)-f*v-p*v-f*m))),la[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),la[1]=b-(g+h)+(h-w),h=(M=y+g)-y,la[2]=y-(M-h)+(g-h),la[3]=M;var k=ra(4,oa,4,la,aa);h=(_=(p=S-(f=(d=na*S)-(d-S)))*(m=c-(v=(d=na*c)-(d-c)))-((x=S*c)-f*v-p*v-f*m))-(g=_-(T=(p=A-(f=(d=na*A)-(d-A)))*(m=l-(v=(d=na*l)-(d-l)))-((w=A*l)-f*v-p*v-f*m))),la[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),la[1]=b-(g+h)+(h-w),h=(M=y+g)-y,la[2]=y-(M-h)+(g-h),la[3]=M;var D=ra(k,aa,4,la,sa);h=(_=(p=s-(f=(d=na*s)-(d-s)))*(m=c-(v=(d=na*c)-(d-c)))-((x=s*c)-f*v-p*v-f*m))-(g=_-(T=(p=u-(f=(d=na*u)-(d-u)))*(m=l-(v=(d=na*l)-(d-l)))-((w=u*l)-f*v-p*v-f*m))),la[0]=_-(g+h)+(h-T),h=(b=x-((y=x+g)-(h=y-x))+(g-h))-(g=b-w),la[1]=b-(g+h)+(h-w),h=(M=y+g)-y,la[2]=y-(M-h)+(g-h),la[3]=M;var P=ra(D,sa,4,la,ua);return ua[P-1]}(e,t,n,r,i,o,l)}var ha=Math.pow(2,-52),da=new Uint32Array(512),fa=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]:ba,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:xa,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[R++]=j,L=this._dists[j])}return this.hull=P.subarray(0,R),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(ca(_,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)<=ha&&Math.abs(q-W)<=ha)&&(V=Q,W=q,X!==f&&X!==p&&X!==v)){for(var Z=0,J=0,K=this._hashKey(Q,q);J=0;)if((ee=$)===Z){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],ca(Q,q,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===Z)for(;ca(Q,q,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,q)]=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(va(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;ya(e,n+r>>1,u),t[e[n]]>t[e[r]]&&ya(e,n,r),t[e[u]]>t[e[r]]&&ya(e,u,r),t[e[n]]>t[e[u]]&&ya(e,n,u);for(var c=e[u],h=t[c];;){do{u++}while(t[e[u]]h);if(l=l-n?(ga(e,t,u,r),ga(e,t,n,l-1)):(ga(e,t,n,l-1),ga(e,t,u,r))}}function ya(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function ba(e){return e[0]}function xa(e){return e[1]}function _a(e,t,n){var r=t/2,i=n/2,a=[{x:-r,y:i},{x:-r,y:-i},{x:r,y:i},{x:r,y:-i}],s=[Bo.fromPointSlope({x:-r,y:0},Math.PI/2),Bo.fromPointSlope({x:0,y:i},0),Bo.fromPointSlope({x:r,y:0},Math.PI/2),Bo.fromPointSlope({x:0,y:-i},0)],u=[],l=e.stopList.slice(1,e.stopList.length-1).map((function(a){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};Lo(f,Math.PI/2)?(p.x=0,p.y=n/2-a.pos*n):Lo(f,0)?(p.x=a.pos*t-t/2,p.y=0):(p.x=a.pos*t-t/2,p.y=n/2-a.pos*n),f>Math.PI/2&&f<=Math.PI&&(p.x*=-1),f>Math.PI&&f<=2*Math.PI&&(p.y*=-1);var v=Bo.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:a.color}})).sort((function(e,t){return t.point.y-e.point.y}));u.push.apply(u,o(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:a.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"},Sa=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),t.call(this,void 0,(i=Ma[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg;\nuniform sampler2D uSampler;\n\n".concat(Ta.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}(V.k),Ea=[wa],Aa={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"},Ia=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=Aa[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform vec4 arg2;\nuniform sampler2D uSampler;\n\n".concat(Ea.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}(V.k),Ca=[wa],Na={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"},ka=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=Na[e],"\nvarying vec2 vTextureCoord;\n\nuniform float arg1;\nuniform float arg2;\nuniform sampler2D uSampler;\n\n".concat(Ca.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}(V.k),Da=[wa],Pa={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"},Ra=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),t.call(this,void 0,(i=Pa[e],"\nvarying vec2 vTextureCoord;\n\nuniform vec4 arg1;\nuniform sampler2D uSampler;\n\n".concat(Da.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}(V.k),Oa=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=bo()("".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 Rn;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 Rn,r=function(e,t,n){var r,i=new D.b;if(e.stopList.sort((function(e,t){return e.pos-t.pos})),!e.stopList.find((function(e){return 0===e.pos}))){var a=e.stopList[0];e.stopList.unshift({pos:0,color:a.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=function(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 Sa(e.type,e.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(e.type)>=0&&r){var i=Wo(e.args[0]),o=Wo(e.args[1]);n.push(new Ia(e.type,i,o))}else if("lum"===e.type&&r)n.push(new ka(e.type,e.args[0],e.args[1]));else if("alphaInv"===e.type&&r){var a=Wo(e.args[0]);n.push(new Ra(e.type,a))}})),n}(u,this.ctx.featureList)),this.config.fillFloat){var d=this.config.fillFloat.fillRect,f=d.l,p=d.t,m=d.r,g=d.b,y=this.width*(1-f-m),b=this.height*(1-p-g),x=null!==(e=this.config.shapeRotation)&&void 0!==e?e:0,_=new Nn;_.drawRect(0,0,y,b),_.pivot.x=y/2,_.pivot.y=b/2,_.rotation=x;var w=_.getBounds(),T=w.width,M=w.height;h.width=T,h.height=M,h.anchor.x=.5,h.anchor.y=.5,h.rotation=-1*x,h.name="math-texture",0===x?(h.position.x=T/2+f*this.width,h.position.y=M/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 S=this.fillStyle,E=S.src,A=S.delays,I=this.ctx.spriteTexture.getGifFrames(E).map((function(e,t){return{texture:e,time:A[t]||20}})),C=new Ri(I,!0);C.name=oo(),C.width=this.width,C.height=this.height;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}(),La=function(e){p(n,e);var t=m(n);function n(){return _(this,n),t.apply(this,arguments)}return n}(V.k),ja=n(77),Ba=n.n(ja),Ua=n(78),Fa=n.n(Ua),za=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Ba.a,Fa.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:Wo(e.color),uSdfSampler:V.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 R.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 R.j(n,n,r,i)}}]),n}(La),Ga=n(20),Ha=n.n(Ga),Va=n(79),Wa=n.n(Va),Ya=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Ha.a,Wa.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:e.rad,uSdfSampler:V.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 R.j(0,0,e,t)}}]),n}(La),Xa=function e(){_(this,e)},Qa=n(80),qa=n.n(Qa),Za=function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,Ha.a,qa.a,{uColor:Wo(e)})}return n}(V.k),Ja=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=V.t.WHITE,o.frameTextures=[],o.json=e,o.effectContainer=r,o.outputSprite=new Rn,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 Li.BlurFilter(o.json.blurRad/2,4),new Za(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 R.g(n.x,n.y),a=new R.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 R.g(this.json.dist,0),l=new R.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}(Xa),Ka=n(81),$a=n.n(Ka),es=function(e){p(n,e);var t=m(n);function n(e,r){var i;return _(this,n),i=t.call(this,Ha.a,$a.a,{uStartAlpha:e.startAlpha,uEndAlpha:e.endAlpha,uStartPos:e.startPos,uEndPos:e.endPos,uHeight:r}),console.log(y(i)),i}return n}(V.k),ts=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 Rn,s.outputTexture=V.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 Li.BlurFilter(s.json.blurRad/2,4),new es(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 R.g(n.x+n.width/2,n.y+n.height/2),i=new R.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}(Xa),ns=n(82),rs=n.n(ns),is=function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,Ha.a,rs.a,{})).priority=1,r.json=e,r}return T(n,[{key:"filterAreaJustify",value:function(e){return e}},{key:"sdfBox",value:function(){return null}}]),n}(La),os=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())}))},as=function(e){p(n,e);var t=m(n);function n(e,r,i,a,s,u){var l;_(this,n),(l=t.call(this)).effects=[],l.attachs=[],l.frames=new Map,l._targetContainer=new D.b,l.frameCount=1,l.ctx=a,l.originWidth=e.width,l.originHeight=e.height,l.cacheKey=i,l.sourceSprite=new Rn;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 is(d));break;case"softEdge":l.effects.push(new Ya(d));break;case"glow":l.effects.push(new za(d));break;case"reflection":l.attachs.push(new ts(d,e,s,u.x,l.ctx));break;case"outerShadow":l.attachs.push(new Ja(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 R.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 R.j(Math.min.apply(Math,o(y).concat([0])),Math.min.apply(Math,o(b).concat([0])),Math.max.apply(Math,o(x).concat([l.originWidth])),Math.max.apply(Math,o(w).concat([l.originHeight]))),l.sourceSprite.filters=l.effects,l.sourceSprite.filterArea=new R.j(0,0,l.filterArea.width,l.filterArea.height),l._targetSprite=new Rn,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 os(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 R.d;h.translate(s,u);var d=V.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 Oa(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 Oa(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 Oa(this.ctx,null==n?void 0:n.fill,r,Math.max(o,i),{useFilter:!1,useSlideBackgroundFill:!1}):new Oa(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 Oa(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 ss(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 ss(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 as(this.effectContainer,this.effectList,n,this.ctx,0,new R.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 Nn,y=c(Vo(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 Qo;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 Qo;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=V.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}(ea),ls=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())}))},cs=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 ls(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 us(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 Oo(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 hs(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 cs(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 ps(e){for(var t=new v.Path,n=e.scale,r={x:0,y:0},i=e.path.trim().split(" "),o=0;o=0&&(d=gs(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(!ms[n])return null;var i=ms[n].top(ps(t)),o=ms[n].bottom(ps(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}(),xs=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-"+bo()(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}(),_s=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:"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 R.d;if(a.translate(n,r),0===this.effectContainer.children.length)return null;var s=V.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)||Ts,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 _s(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)||Ts,l=_o()(null==o?void 0:o.width)?o.width:1;return new Oa(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)||Ts,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 _s(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)||Ts,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 Oa(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)||Ts,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 Ri&&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 Rn(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=[$o[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 Rn(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 xs(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)||Ts,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 ws(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)||Ts).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 ws(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 ws(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 ws(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),zo()(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=V.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 as(this.effectContainer,this.json.effectList,"".concat(this.ctx.taskId,"_").concat(this.ctx.slideIndex,"_").concat(this.json.id),this.ctx,this.json.rotation||0,new R.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}(Uo),Ss=n(83),Es=new(n.n(Ss).a),As=Es.getDevice(),Is=Es.getBrowser(),Cs=Es.getOS(),Ns={isDesktop:function(){var e=!0;return"mobile"===As.type&&(e=!1),/Samsung/.test(Is.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),Cs.name&&/iOS/.test(Cs.name)&&(e=!0),e},isAndroid:function(){var e=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(e=!0),Cs.name&&/android/i.test(Cs.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}},ks=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 Ds(e,t){for(var n in t)e.style[n]=t[n]}var Ps="median-container",Rs=1500,Os=300,Ls=50,js="0",Bs="1",Us=.4,Fs=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(ml.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 ks(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,lo((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 ks(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 ks(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 ks(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&&(n>this.duration||this.media.ended),!t.t0){t.next=9;break}return t.next=5,this.pauseMedia();case 5:this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(ml.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()}))},this._playMediaFromCtrl=function(){i.playMediaFromCtrl(!1)},this._pauseMediaFromCtrl=function(){i.pauseMediaFromCtrl(!1),i.delayHide()},this.onClickFullScreenButtonHandle=function(){i.fullscreenPlay()},this.onClickCancelFullScreenButtonHandle=function(){i.fullscreenStatus=!1,i.media.requestCancelFullscreen(),i.ctx.eventHub.emit(ml.fullscreenChange,{targetId:i.targetId,state:!1}),i.delayHide()},this.onFullScreenChange=function(e){var t=e.status,n=e.targetId,r=e.slideIndex;i.changeFullScreenState(t,n,r),i.delayHide()},this.onContainerSizeChange=function(){i.setControllerPosition()},this.onControllerShowStatusChange=function(e){var t=e.slideIndex,n=e.targetId,r=e.status;if(t===i.ctx.slideIndex){if(i.targetId===n){var o=js,a=Bs;r?(i.mediaController.style.opacity=a,i.mediaController.style.display="flex"):i.mediaController.style.opacity=o}i.delayHide()}},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.target=t.target,this.media=t.media,this.info=t.info,this.shapeId=t.shapeId,this.canvasElement=t.canvasElement,"video"===this.media.type&&(this.isVideo=!0),this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=null!==(n=this.info.cut.start)&&void 0!==n?n:0,this.end=null!==(r=this.info.cut.end)&&void 0!==r?r:0),this.info.bookmarkList&&(this.bookmarkList=this.info.bookmarkList.sort((function(e,t){return e.time-t.time})))}return T(e,[{key:"getMedianContainer",value:function(){var e,t=Ps,n=null===(e=this.canvasElement.parentElement)||void 0===e?void 0:e.querySelector("."+t);n||((n=document.createElement("div")).className=t,this.canvasElement.parentElement.appendChild(n)),this.container=n}},{key:"generatePlayButton",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");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");Ds(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");Ds(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");Ds(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"};Ds(this.playButton,Object.assign(Object.assign({},e),{display:"block"}));var t=this.generatePlayButton();Ds(t,{height:"20px"}),this.playButton.appendChild(t),Ds(this.pauseButton,Object.assign(Object.assign({},e),{display:"none"}));var n=this.generatePauseButton();if(Ds(n,{height:"20px"}),this.pauseButton.appendChild(n),this.isVideo){var r=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(r),Ds(this.fullScreenButton,Object.assign(Object.assign({},e),{display:"block"}));var i=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(i),Ds(this.exitFullScreenButton,Object.assign(Object.assign({},e),{display:"none"}))}}},{key:"createTimer",value:function(){var e=document.createElement("div");Ds(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"),Ds(this.progress,e);var t=document.createElement("div");Ds(t,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(t),Ds(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),Ds(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&&Ds(this.mediaController,{left:"0",top:a-r+"px"})}},{key:"createMediaController",value:function(){this.setControllerPosition(),Ds(this.mediaController,{display:"none",transition:"opacity ".concat(Us,"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(ml.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(){Ns.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;Ns.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=Bs,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}},{key:"hide",value:function(){this.fullscreenStatus?this.mediaController.style.opacity=js:this.mediaController.style.display="none"}},{key:"delayHide",value:function(){var e=this;clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout((function(){e.hide()}),Rs)}},{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}(),zs=n(84),Gs=function(e){p(n,e);var t=m(n);function n(e,r){var i,o;return _(this,n),(o=t.call(this)).isGlobalPause=!1,o.lastTime=-1,o.howl=null,o.rctClient=null,o.isHowlEnd=!1,o.isHowlLoadEmit=!1,o.staticEventId=1001,o.url=e,o.runningAudio=r,gl.RtcAudioClazz?(o.rctClient=new gl.RtcAudioClazz(e),o.rctClient.on("load",(function(){return o.emit("load")})),o.rctClient.on("pause",(function(){return o.emit("pause")})),o.rctClient.on("play",(function(){return o.emit("play")}))):(o.howl=new zs.Howl({src:[e]}),i=c(o.howl._getSoundIds(),1),o.staticEventId=i[0],o.howl.load(),o.howl.on("load",(function(){o.isHowlLoadEmit=!0,o.emit("load")})),o.howl.on("pause",(function(){return o.emit("pause")})),o.howl.on("play",(function(){o.isHowlLoadEmit||o.emit("load"),o.isHowlEnd=!1,o.emit("play")})),o.howl.on("end",(function(){o.isHowlEnd=!0}))),o}return T(n,[{key:"startTimeChangeEmit",value:function(){var e=this;this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate")),(!this.isEnded||this.duration<=0)&&setTimeout((function(){return 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.startTimeChangeEmit(),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;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"),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:"isEnded",get:function(){return this.howl?this.isHowlEnd:Math.abs(this.currentTime-this.duration)<.001}},{key:"isPaused",get:function(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&this.howl.playing(this.staticEventId)}}]),n}(b.a),Hs=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())}))},Vs=function(e){p(n,e);var t=m(n);function n(e){var r,i,o,a,s,u;_(this,n),(r=t.call(this)).type="video",r.sprite=new Rn,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 l=e.video.src;r.videoResource=new V.w(l,{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 c=e.video.src.replace(/4$/,"3");r.ctx.loaderDelegate&&(c=r.ctx.loaderDelegate.redirectMedia(c),r.ctx.logger.info("redirect media url from ".concat(e.video.src.replace(/4$/,"3")," to ").concat(c," by delegate."),e.ctx.taskId)),r.rtcAudio=new Gs(c,e.ctx.runningAudio);var h=e.video,d=e.width,f=e.height,p=e.target;r.controller=new Fs({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,width:d,height:f,target:p,media:y(r),info:h,canvasElement:e.canvasElement}),r.controller.addPlayCallBack((function(){r.sprite.width=d,r.sprite.height=f,r.ctx.clock.setTimeout((function(){r.sprite.visible=!0}),50)}));var v=new V.c(null,{height:f,width:d});return v.resource=r.videoResource,r.videoResource.bind(v),r.sprite=new Rn,r.sprite.visible=!1,r.sprite.texture=new V.t(v),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 Hs(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.once("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.once("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.seek(0),this.pause(),this.ctx.eventHub.emit(ml.mediaStop,{id:this.id})}},{key:"requestFullscreen",value:function(){return Hs(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,lo((function(){return n.isLoaded}),5e3);case 2:t=new V.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:"ended",get:function(){var e,t;return null===(t=null===(e=this.videoElement)||void 0===e?void 0:e.ended)||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}(b.a),Ws=function(e){p(n,e);var t=m(n);function n(e){var r;_(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 i=e.audio.src;r.audioPlayer=new Gs(i,e.ctx.runningAudio),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 o=e.width,a=e.height,s=e.target;return r.controller=new Fs({targetId:e.id,shapeId:e.shapeId,ctx:e.ctx,height:a,width:o,target:s,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.seek(0),this.pause(),this.ctx.eventHub.emit(ml.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)}},{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:"ended",get:function(){return this.audioPlayer.isEnded}},{key:"duration",get:function(){return this.audioPlayer.duration}}]),n}(b.a),Ys=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())}))},Xs=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 ko(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 Oa(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 Ys(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 Ri&&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 Vs({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 Ws({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,Ns.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 Ys(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}(Ms),Qs=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())}))},qs=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 Rn,a.cacheContainer=new D.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 Oa(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 Qs(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 Ms(i,this.ctx,l):"Picture"===(null==i?void 0:i.type)?o=new Xs(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}(b.a),Js=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 b.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 Ku({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 Zs("mainSeq",i.nextCondLst,{global:h,runtime:r.runtimeNodeEventHub},r.ctx),r.prevConds=new Zs("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(ml.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(ml.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(ml.userInput);var t="shape ".concat(n," onClick"),r=e.ctx.mode;"interactive"!==r&&"sync"!==r||e.ctx.eventHub.emit(ml.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&&Ks(r.timingTarget,n,i)}})),r}return T(n,[{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(eu),nu=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},ru=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}(),iu=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}(ru);nu([to()],iu.prototype,"interpolationFrom",null);var ou=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&&(r=this.resolveValue()),r}},{key:"resolveValue",value:function(){return this.value||""}}]),n}(ru);nu([to()],ou.prototype,"interpolationFrom",null);var au=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}(ru);nu([to()],au.prototype,"interpolationFrom",null);var su=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 Xo(e.resolveValue(),this.value,t)}},{key:"resolveValue",value:function(){return this.value}}]),n}(ru);nu([to()],su.prototype,"interpolationFrom",null);var uu=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.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=$s(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]&&Ks(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]&&Ks(r.timingTarget,o[0],h)}},r.onSeekToStart=function(){null!==r.startVal&&r.timingTarget&&Ks(r.timingTarget,r.json.cBhvr.attrList[0],r.startVal)},r.onSeekToEnd=function(){r.onTimeUpdate({duration:1,delta:1,isReverse:!1})},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}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 au(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 au(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 au(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 au(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 au(d,this.timingTarget):"str"===t&&(f=new ou(d,this.timingTarget)):"number"===d.val.type?f=new iu(d,this.timingTarget):"color"===d.val.type?(this.isColorAnim=!0,f=new su(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}(eu),lu=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}(V.k),cu=n(85),hu=n.n(cu),du=n(86),fu=n.n(du),pu=n(87),vu=n.n(pu),mu=n(88),gu=n.n(mu),yu=n(9),bu=n.n(yu),xu=n(89),_u=n.n(xu),wu=n(90),Tu=n.n(wu),Mu="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==",Su=n(91),Eu=n.n(Su),Au=n(92),Iu=n.n(Au),Cu=n(93),Nu=n.n(Cu),ku=n(94),Du=n.n(ku),Pu=n(95),Ru=n.n(Pu),Ou=n(96),Lu=n.n(Ou),ju=n(97),Bu=n.n(ju),Uu=n(98),Fu=n.n(Uu),zu=n(99),Gu=n.n(zu),Hu={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,fu.a,hu.a,{percent:0,direction:1,transition:0})).uniforms.direction=i,r}return n}(lu),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,vu.a,{percent:0,transition:1})).uniforms.transition=Math.pow(i,i),r}return n}(lu),blinds:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,gu.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="vertical"===e?1:0,r}return n}(lu),checkerboard:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,_u.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="down"===e?1:0,r}return n}(lu),dissolve:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Tu.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).setTextTure(),r}return T(n,[{key:"setTextTure",value:function(){this.uniforms.dissolveSampler=V.t.from(Mu)}}]),n}(lu),randombar:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Eu.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=V.t.from(Mu)}}]),n}(lu),circle:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Iu.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(lu),box:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Nu.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(lu),diamond:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Du.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(lu),plus:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Ru.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option="out"===e?1:0,r}return n}(lu),barn:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Lu.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}(lu),strips:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Bu.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}(lu),wedge:function(e){p(n,e);var t=m(n);function n(e){return _(this,n),t.call(this,bu.a,Fu.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}return n}(lu),wheel:function(e){p(n,e);var t=m(n);function n(e){var r;return _(this,n),(r=t.call(this,bu.a,Gu.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})).uniforms.option=Number(e)||1,r}return n}(lu)},Vu=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(){var e;if((null===(e=r.timingTarget)||void 0===e?void 0:e.container.filters)&&r.filter){r.timingTarget.removeAnimationFilterQueue(r.filter);var t=r.timingTarget.getFirstAnimationFilter();r.timingTarget.container.filters=t?[t]:[]}}))},r.onSeekToStart=function(){r.timingTarget&&(r.timingTarget.container.filters=[],r.filter&&r.timingTarget.removeAnimationFilterQueue(r.filter))},r.onSeekToEnd=function(){r.timingTarget&&(r.timingTarget.container.filters=[],r.filter&&r.timingTarget.removeAnimationFilterQueue(r.filter))},r.commonTimeNode.on("timelineStart",(function(){r.filter&&r.timingTarget&&(r.timingTarget.addToAnimationFilterQueue(r.filter),r.timingTarget.container.filters&&0!==r.timingTarget.container.filters.length||(r.timingTarget.container.filters=[r.filter]))})),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];Hu[s]&&(r.filter=new Hu[s](u),r.filterType="".concat(s,"-").concat(u),r.filter&&(r.filter.transition=o))}return r}return T(n,[{key:"modifyAttrKey",get:function(){return this.filterType}}]),n}(eu),Wu=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.createPath(),r}return T(n,[{key:"createPath",value:function(){var e,t,n=new v.Path,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 s=i.value.trim().replace(/\s+/g," ").split(" "),u=d(t=s)||a(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),m=p[0],g=p[1];n.moveTo(m,g)}else if("L"===l){var y=c(f.map((function(e){return Number(e)})),2),b=y[0],x=y[1];n.lineTo(b,x)}else if("C"===l){var _=c(f.map((function(e){return Number(e)})),6),w=_[0],T=_[1],M=_[2],A=_[3],I=_[4],C=_[5];n.bezierCurveTo(w,T,M,A,I,C)}else if("Z"===l)n.closePath();else if("E"===l)console.warn("not implements");else if("c"===l){var N=c(f.map((function(e){return Number(e)})),6),k=N[0],D=N[1],P=N[2],R=N[3],O=N[4],L=N[5],j=n.currentPoint;n.bezierCurveTo(k+j.x,D+j.y,P+j.x,R+j.y,O+j.x,L+j.y)}else if("l"===l){var B=n.currentPoint,U=c(f.map((function(e){return Number(e)})),2),F=U[0],z=U[1];n.lineTo(F+B.x,z+B.y)}else if("m"===l){var G=n.currentPoint,H=c(f.map((function(e){return Number(e)})),2),V=H[0],W=H[1];n.moveTo(V+G.x,W+G.y)}}}catch(e){o.e(e)}finally{o.f()}}this.path=n}},{key:"modifyAttrKey",get:function(){return"motion"}}]),n}(eu),Yu=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.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.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}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}(eu),Xu=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];Ks(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];Ks(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];Ks(r.timingTarget,i+".on","false")}}},r.onTimeNodeStart=function(){if(r.timingTarget){var e=r.json.cBhvr.attrList[0],t=$s(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];Ks(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 Ho(r.json.from),r.to=new Ho(r.json.to),r.by=new Ho(r.json.by),r.target=new Ho):(r.from=new Go(r.json.from),r.to=new Go(r.json.to),r.by=new Go(r.json.by),r.target=new Go),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}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=$s(this.timingTarget,e);t&&(this.currentColorString=t)}}},{key:"modifyAttrKey",get:function(){return this.json.cBhvr.attrList[0]}}]),n}(eu),Qu=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.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.onTimeNodeStart=function(){var e;_o()(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.from=r.json.from,r.to=r.json.to,r.by=r.json.by,r.by?r.isConflict=!1:r.isConflict=!0,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}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}(eu),qu=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}(eu),Zu=function e(t){var n=this;_(this,e),this.runtimeNodeEventHub=new b.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 Ku({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 Gs(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 Ju(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 Ku=function(e){p(n,e);var t=m(n);function n(e){var r,i,o;_(this,n),(r=t.call(this)).uuid=oo(),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/($t.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 Zs(r.json.id||"",h.stCondLst,l,r.ctx),r.endConds=new Zs(r.json.id||"",h.endCondLst,l,r.ctx),h.endSync&&(r.endSync=new Zs(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=oo(),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 Js(r):"par"===e.type?n=new $u(r):"set"===e.type?n=new tu(r):"anim"===e.type?n=new uu(r):"animEffect"===e.type?n=new Vu(r):"animMotion"===e.type?n=new Wu(r):"animScale"===e.type?n=new Yu(r):"animClr"===e.type?n=new Xu(r):"animRot"===e.type?n=new Qu(r):"cmd"===e.type?n=new qu(r):"audio"===e.type&&(n=new Zu(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 Ju(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])?o(e).sort((function(e,t){var o,a,s,u,l=Ju(e).id,c=Ju(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(ml.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>e&&(this.ctx.eventHub.emit(ml.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(ml.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 _o()(e[0])&&_o()(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(ml.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}(b.a),$u=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 b.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 Ku({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 tu&&r.commonTimeNode.children.forEach((function(e){e instanceof tu||"function"!=typeof e.onSeekToStart||e.onSeekToStart()}))})),r}return n}(b.a),el=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 $u({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}(),tl=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())}))},nl=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 Nn;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(ml.requestPrevSlide,t)})),this.ctx.timingEventHub.on("c:next slide",(function(t,n){e.ctx.eventHub.emit(ml.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 tl(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 el(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(ml.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(ml.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 tl(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,lo((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}(),il=function(e){return new Promise((function(t){return setTimeout(t,e)}))},ol=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=oo(),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(o(t.sub)))}})).catch((function(n){t.state="error",e.logger.error("".concat(n," ").concat(n.stack),e.taskId),e.emit("task-error",eo.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,il(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,a;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,uo((function(){return n.fn.apply(null)}),6e4);case 6:if(e.t0=e.sent,e.t1=ao,e.t0!==e.t1){e.next=10;break}throw new eo(Qi.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(o(n.sub)))),e.next=17;break;case 13:return e.prev=13,e.t2=e.catch(3),a=(null==e.t2?void 0:e.t2.errorType)?e.t2:new eo(Qi.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",eo.transform(a),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}(b.a),al=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 nl(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 sl(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 sl(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 ol(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 sl(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}(),ll=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())}))},cl=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 ll(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,uo((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===ao?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 ll(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,uo((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!==ao&&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}();cl.localCache=null;try{cl.localCache=l.createInstance({name:"slide_local_cache",driver:l.INDEXEDDB,version:1})}catch(s){}var hl=new R.j,dl=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 V.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=hl).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}(b.a),pl=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())}))};k.skipHello();var vl={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"},ml={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"},gl=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 b.a,r.transactionPlayer=null,r.isForward=!0,r.drawCall=0,r.scale=1,r._isPaused=!1,r.maxResolution=new R.g(0,0),r.isNVIDIA=!1,r.fps=new $i,r.designWidth=0,r.designHeight=0,r.currentIndex=0,r.slideCount=0,r.runtime={drawCall:0,fps:0},r.globalEventHub=new b.a,r.globalVideoBackground=new Nn,r.globalVideoSprite=new Rn,r.onMousemoveTimeout=null,r.cacheFunctionMap=new Map,r.isPlayerPaused=function(){return r._isPaused},r.onWebGLLost=function(){r.errorChannel.emit("error",new eo(Qi.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})}),Rs)},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(ml.userInput)}};if(r.app.view.addEventListener("pointerdown",c,!1),r.cacheFunctionMap.set("pointerdown",c),Ns.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(ml.changeLocalFullscreenState,{status:!1,slideIndex:r.currentIndex,targetId:null===(t=r.currentStage)||void 0===t?void 0:t.ctx.latestChangeFullscreenTargetId})},r.logger=e.logger,r.mode=e.mode,r.volumeAdjuster=e.volumeAdjuster,r.localStorage=new cl(r.logger),r.cachedExtract=new dl(r.localStorage),r.config={minFPS:C()(i.minFPS)?30:i.minFPS,maxFPS:C()(i.maxFPS)?40:i.maxFPS,resolution:C()(i.resolution)?1:i.resolution,autoFPS:!C()(i.autoFPS)&&i.autoFPS,autoResolution:!C()(i.autoResolution)&&i.autoResolution,transactionBgColor:C()(i.transactionBgColor)?0:i.transactionBgColor,maxResolutionLevel:r.getMaxResolution(i.maxResolutionLevel),forceCanvas:!C()(i.forceCanvas)&&i.forceCanvas,enableNvidiaDetect:!C()(i.enableNvidiaDetect)&&i.enableNvidiaDetect},r.updateMaxResolutionLevel(r.config.maxResolutionLevel),r.loader=new fo(r.localStorage,e.useLocalCache,r.logger,e.resourceTimeout,e.loadDelegate,e.urlInterrupter);var o=k.isWebGLSupported();r.app=new W({antialias:!0,autoDensity:!1,backgroundColor:16777215,forceCanvas:r.config.forceCanvas||!o}),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,O.c.LOW),r.clock=new po(r.app.ticker),r.objPoolGroup=oo(),r.stagePool=new ul(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 N.TransactionPlayer)}catch(s){/Error creating WebGL context/.test(s.message)?r.errorChannel.emit("error",new eo(Qi.CanvasCrash,"webgl context lost.")):r.errorChannel.emit("error",new eo(Qi.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!C()(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){C()(e.maxFPS)||C()(e.minFPS)||(this.config.maxFPS=e.maxFPS,this.app.ticker.maxFPS=e.maxFPS,this.config.minFPS=e.minFPS,this.app.ticker.minFPS=e.minFPS),C()(e.resolution)||(this.config.resolution=e.resolution,this.updateResolution(this.scale*this.config.resolution)),C()(e.autoFPS)||(this.config.autoFPS=e.autoFPS),C()(e.autoResolution)||(this.config.autoResolution=e.autoResolution),C()(e.transactionBgColor)||(this.config.transactionBgColor=e.transactionBgColor),this.taskId&&this.logger.info("ppt player update config: "+JSON.stringify(this.config),this.taskId),C()(e.maxResolutionLevel)||(this.config.maxResolutionLevel=e.maxResolutionLevel,this.updateMaxResolutionLevel(this.config.maxResolutionLevel))}},{key:"preload",value:function(e){return pl(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&&f&&(v=a.json.transition,!this.isForward&&(null==f?void 0:f.json.transition)&&(v=f.json.transition),m=this.getTransactionTexture(f,this.view,null,null),this.initTransactionPlayer(v),null===(n=this.transactionPlayer)||void 0===n||n.setPrevTexture(m),p=!0),this.app.stage.addChild(a.container),this.updateResolution(this.config.resolution*this.scale),f&&(f.clearOnTransactionEnd(),this.app.stage.removeChild(f.container)),!(a.json.transition&&a.json.transition.type&&this.app.stage.children.length>0&&this.view&&this.transactionPlayer&&p)){i.next=30;break}return i.next=23,this.getTransactionTexture(a,this.view,s,u);case 23:return g=i.sent,this.transactionPlayer.setNextTexture(g),i.next=27,this.transactionPlayer.play();case 27:if(y=this.transactionPlayer.renderer.domElement,this.view.parentElement&&y)try{this.view.parentElement.removeChild(y)}catch(e){}null===(r=this.transactionPlayer)||void 0===r||r.dispose();case 30:if(!this.isForward){i.next=35;break}return i.next=33,a.startTiming();case 33:i.next=36;break;case 35:a.setMainSeqApplied();case 36:a.ctx.slideScopeEventHub.emit("slide-render",a.ctx.slideIndex),this.emit(ml.renderEnd,e),this.emit(ml.slideChange,e),a.ctx.isRendering=!1,this.preload(e+1).catch((function(t){b.errorChannel.emit("error",eo.transform(t),e+1)})),this.preload(e-1).catch((function(t){b.errorChannel.emit("error",eo.transform(t),e-1)})),this.logger.info("render slide ".concat(e," done, time: ").concat(Date.now()-o,"ms"),this.taskId);case 43:case"end":return i.stop()}}),i,this)})))}},{key:"getTransactionTexture",value:function(e,t,n,r){var i=V.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 v.Texture(o)}},{key:"renderToBase64",value:function(e,t,n){return pl(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=V.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 pl(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=V.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),A()(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",eo.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",eo.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()}),O.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 pl(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);try{this.app.renderer.filter.texturePool.clear(!0)}catch(e){}So.collectObjectByGroup(this.objPoolGroup),Eo.collectObjectByGroup(this.objPoolGroup),null===(e=this.transactionPlayer)||void 0===e||e.destroy(),this.loader.destroy(),this.fps.destroy(),this.stagePool.destroyAllStage(),this.stagePool.destroy();try{this.app.renderer.gl.getExtension("WEBGL_lose_context").loseContext()}catch(e){}this.app.destroy(!0,{children:!0,texture:!0,baseTexture:!0}),null===(t=al.worker)||void 0===t||t.terminate()}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=cl.localCache)||void 0===e||e.clear().catch((function(){}))}}]),n}(b.a);gl.platform=Ns,gl.RtcAudioClazz=null;var yl,bl=new Map,xl=n(100),_l=n.n(xl),wl=n(48),Tl=n.n(wl),Ml=n(49),Sl=n.n(Ml),El=[],Al="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"}(yl||(yl={}));var Il,Cl=function(e){return Object.freeze(e)},Nl=function(e,t){this.inlineSize=e,this.blockSize=t,Cl(this)},kl=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,Cl(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}(),Dl=function(e){return e instanceof SVGElement&&"getBBox"in e},Pl=function(e){if(Dl(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)},Rl=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)},Ol="undefined"!=typeof window?window:{},Ll=new WeakMap,jl=/auto|scroll/,Bl=/^tb|vertical/,Ul=/msie|trident/i.test(Ol.navigator&&Ol.navigator.userAgent),Fl=function(e){return parseFloat(e||"0")},zl=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Nl((n?t:e)||0,(n?e:t)||0)},Gl=Cl({devicePixelContentBoxSize:zl(),borderBoxSize:zl(),contentBoxSize:zl(),contentRect:new kl(0,0,0,0)}),Hl=function(e,t){if(void 0===t&&(t=!1),Ll.has(e)&&!t)return Ll.get(e);if(Pl(e))return Ll.set(e,Gl),Gl;var n=getComputedStyle(e),r=Dl(e)&&e.ownerSVGElement&&e.getBBox(),i=!Ul&&"border-box"===n.boxSizing,o=Bl.test(n.writingMode||""),a=!r&&jl.test(n.overflowY||""),s=!r&&jl.test(n.overflowX||""),u=r?0:Fl(n.paddingTop),l=r?0:Fl(n.paddingRight),c=r?0:Fl(n.paddingBottom),h=r?0:Fl(n.paddingLeft),d=r?0:Fl(n.borderTopWidth),f=r?0:Fl(n.borderRightWidth),p=r?0:Fl(n.borderBottomWidth),v=h+l,m=u+c,g=(r?0:Fl(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:Fl(n.width)-_-x,M=r?r.height:Fl(n.height)-w-b,S=T+v+x+g,E=M+m+b+y,A=Cl({devicePixelContentBoxSize:zl(Math.round(T*devicePixelRatio),Math.round(M*devicePixelRatio),o),borderBoxSize:zl(S,E,o),contentBoxSize:zl(T,M,o),contentRect:new kl(h,u,T,M)});return Ll.set(e,A),A},Vl=function(e,t,n){var r=Hl(e,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case yl.DEVICE_PIXEL_CONTENT_BOX:return a;case yl.BORDER_BOX:return i;default:return o}},Wl=function(e){var t=Hl(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Cl([t.borderBoxSize]),this.contentBoxSize=Cl([t.contentBoxSize]),this.devicePixelContentBoxSize=Cl([t.devicePixelContentBoxSize])},Yl=function(e){if(Pl(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Xl=function(){var e=1/0,t=[];El.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new Wl(t.target),i=Yl(t.target);r.push(n),t.lastReportedSize=Vl(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},ql=[],Zl=0,Jl={attributes:!0,characterData:!0,childList:!0,subtree:!0},Kl=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],$l=function(e){return void 0===e&&(e=0),Date.now()+e},ec=!1,tc=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),!ec){ec=!0;var n,r=$l(e);n=function(){var n=!1;try{n=function(){var e,t=0;for(Ql(t);El.some((function(e){return e.activeTargets.length>0}));)t=Xl(),Ql(t);return El.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Al}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Al),window.dispatchEvent(e)),t>0}()}finally{if(ec=!1,e=r-$l(),!Zl)return;n?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!Il){var t=0,n=document.createTextNode("");new MutationObserver((function(){return ql.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Il=function(){n.textContent="".concat(t?t--:t++)}}ql.push(e),Il()}((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,Jl)};document.body?t():Ol.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Kl.forEach((function(t){return Ol.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Kl.forEach((function(t){return Ol.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),nc=function(e){!Zl&&e>0&&tc.start(),!(Zl+=e)&&tc.stop()},rc=function(){function e(e,t){this.target=e,this.observedBox=t||yl.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=Vl(this.target,this.observedBox,!0);return e=this.target,Dl(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}(),ic=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},oc=new WeakMap,ac=function(e,t){for(var n=0;n=0&&(i&&El.splice(El.indexOf(n),1),n.observationTargets.splice(r,1),nc(-1))},e.disconnect=function(e){var t=this,n=oc.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),uc=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.");sc.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(!Rl(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");sc.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(!Rl(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");sc.unobserve(this,e)},e.prototype.disconnect=function(){sc.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),lc=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(dc&&e.forEach&&e.forEach===dc)e.forEach(t,n);else if(e.length===e.length+0){var r,i=void 0;for(i=0,r=e.length;i1?pc.toArray(arguments):arguments[0];return pc.each(vc,(function(t){if(t.litmus(e))return pc.each(t.conversions,(function(t,n){if(mc=t.read(e),!1===gc&&!1!==mc)return gc=mc,mc.conversionName=n,mc.conversion=t,pc.BREAK})),pc.BREAK})),gc},bc=void 0,xc={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<<(bc=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}var Uc=function(e){function t(e,n,r){wc(this,t);var i=Ec(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,pc.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=Bc(i.__impliedStep),i}return Sc(t,e),Tc(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),Mc(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=Bc(e),this}}]),t}(Nc),Fc=function(e){function t(e,n,r){wc(this,t);var i=Ec(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(){Rc.unbind(window,"mousemove",u),Rc.unbind(window,"mouseup",l),s()}return i.__input=document.createElement("input"),i.__input.setAttribute("type","text"),Rc.bind(i.__input,"change",(function(){var e=parseFloat(o.__input.value);pc.isNaN(e)||o.setValue(e)})),Rc.bind(i.__input,"blur",(function(){s()})),Rc.bind(i.__input,"mousedown",(function(e){Rc.bind(window,"mousemove",u),Rc.bind(window,"mouseup",l),a=e.clientY})),Rc.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 Sc(t,e),Tc(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),Mc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Uc);function zc(e,t,n,r,i){return r+(e-t)/(n-t)*(i-r)}var Gc=function(e){function t(e,n,r,i,o){wc(this,t);var a=Ec(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(zc(e.clientX,t.left,t.right,s.__min,s.__max)),!1}function l(){Rc.unbind(window,"mousemove",u),Rc.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(zc(t,n.left,n.right,s.__min,s.__max))}function h(){Rc.unbind(window,"touchmove",c),Rc.unbind(window,"touchend",h),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),Rc.bind(a.__background,"mousedown",(function(e){document.activeElement.blur(),Rc.bind(window,"mousemove",u),Rc.bind(window,"mouseup",l),u(e)})),Rc.bind(a.__background,"touchstart",(function(e){1===e.touches.length&&(Rc.bind(window,"touchmove",c),Rc.bind(window,"touchend",h),c(e))})),Rc.addClass(a.__background,"slider"),Rc.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return Sc(t,e),Tc(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Mc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Uc),Hc=function(e){function t(e,n,r){wc(this,t);var i=Ec(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,Rc.bind(i.__button,"click",(function(e){return e.preventDefault(),o.fire(),!1})),Rc.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return Sc(t,e),Tc(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}(Nc),Vc=function(e){function t(e,n){wc(this,t);var r=Ec(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));r.__color=new Ac(r.getValue()),r.__temp=new Ac(0);var i=r;r.domElement=document.createElement("div"),Rc.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 ",Rc.bind(r.__input,"keydown",(function(e){13===e.keyCode&&h.call(this)})),Rc.bind(r.__input,"blur",h),Rc.bind(r.__selector,"mousedown",(function(){Rc.addClass(this,"drag").bind(window,"mouseup",(function(){Rc.removeClass(i.__selector,"drag")}))})),Rc.bind(r.__selector,"touchstart",(function(){Rc.addClass(this,"drag").bind(window,"touchend",(function(){Rc.removeClass(i.__selector,"drag")}))}));var o,a=document.createElement("div");function s(e){f(e),Rc.bind(window,"mousemove",f),Rc.bind(window,"touchmove",f),Rc.bind(window,"mouseup",l),Rc.bind(window,"touchend",l)}function u(e){p(e),Rc.bind(window,"mousemove",p),Rc.bind(window,"touchmove",p),Rc.bind(window,"mouseup",c),Rc.bind(window,"touchend",c)}function l(){Rc.unbind(window,"mousemove",f),Rc.unbind(window,"touchmove",f),Rc.unbind(window,"mouseup",l),Rc.unbind(window,"touchend",l),d()}function c(){Rc.unbind(window,"mousemove",p),Rc.unbind(window,"touchmove",p),Rc.unbind(window,"mouseup",c),Rc.unbind(window,"touchend",c),d()}function h(){var e=yc(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 pc.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),pc.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}),pc.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),pc.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),pc.extend(a.style,{width:"100%",height:"100%",background:"none"}),Yc(a,"top","rgba(0,0,0,0)","#000"),pc.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%);",pc.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),Rc.bind(r.__saturation_field,"mousedown",s),Rc.bind(r.__saturation_field,"touchstart",s),Rc.bind(r.__field_knob,"mousedown",s),Rc.bind(r.__field_knob,"touchstart",s),Rc.bind(r.__hue_field,"mousedown",u),Rc.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 Sc(t,e),Tc(t,[{key:"updateDisplay",value:function(){var e=yc(this.getValue());if(!1!==e){var t=!1;pc.each(Ac.COMPONENTS,(function(n){if(!pc.isUndefined(e[n])&&!pc.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&pc.extend(this.__color.__state,e)}pc.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;pc.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,Yc(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),pc.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),t}(Nc),Wc=["-moz-","-o-","-webkit-","-ms-",""];function Yc(e,t,n,r){e.style.background="",pc.each(Wc,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+r+" 100%); "}))}var Xc='
\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
',Qc=function(e,t){var n=e[t];return pc.isArray(arguments[2])||pc.isObject(arguments[2])?new Lc(e,t,arguments[2]):pc.isNumber(n)?pc.isNumber(arguments[2])&&pc.isNumber(arguments[3])?pc.isNumber(arguments[4])?new Gc(e,t,arguments[2],arguments[3],arguments[4]):new Gc(e,t,arguments[2],arguments[3]):pc.isNumber(arguments[4])?new Fc(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Fc(e,t,{min:arguments[2],max:arguments[3]}):pc.isString(n)?new jc(e,t):pc.isFunction(n)?new Hc(e,t,""):pc.isBoolean(n)?new Oc(e,t):null},qc=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},Zc=function(){function e(){wc(this,e),this.backgroundElement=document.createElement("div"),pc.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"}),Rc.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),pc.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;Rc.bind(this.backgroundElement,"click",(function(){t.hide()}))}return Tc(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(),pc.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",Rc.unbind(e.domElement,"webkitTransitionEnd",t),Rc.unbind(e.domElement,"transitionend",t),Rc.unbind(e.domElement,"oTransitionEnd",t)};Rc.bind(this.domElement,"webkitTransitionEnd",t),Rc.bind(this.domElement,"transitionend",t),Rc.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-Rc.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-Rc.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 Jc=function(){try{return!!window.localStorage}catch(e){return!1}}(),Kc=void 0,$c=!0,eh=void 0,th=!1,nh=[],rh=function e(t){var n=this,r=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),Rc.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=pc.defaults(r,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),r=pc.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),pc.isUndefined(r.load)?r.load={preset:"Default"}:r.preset&&(r.load.preset=r.preset),pc.isUndefined(r.parent)&&r.hideable&&nh.push(this),r.resizable=pc.isUndefined(r.parent)&&r.resizable,r.autoPlace&&pc.isUndefined(r.scrollable)&&(r.scrollable=!0);var i,o=Jc&&"true"===localStorage.getItem(lh(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(),uh(e,n.object,n.property,{before:r,factoryArgs:[pc.toArray(arguments)]})}if(pc.isArray(t)||pc.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),uh(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 Gc){var r=new Fc(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});pc.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)}})),Rc.addClass(t,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof Fc){var i=function(t){if(pc.isNumber(n.__min)&&pc.isNumber(n.__max)){var r=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var o=uh(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=pc.compose(i,n.min),n.max=pc.compose(i,n.max)}else n instanceof Oc?(Rc.bind(t,"click",(function(){Rc.fakeEvent(n.__checkbox,"click")})),Rc.bind(n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof Hc?(Rc.bind(t,"click",(function(){Rc.fakeEvent(n.__button,"click")})),Rc.bind(t,"mouseover",(function(){Rc.addClass(n.__button,"hover")})),Rc.bind(t,"mouseout",(function(){Rc.removeClass(n.__button,"hover")}))):n instanceof Vc&&(Rc.addClass(t,"color"),n.updateDisplay=pc.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=pc.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&ah(e.getRoot(),!0),t}),n.setValue)}(e,u,i),e.__controllers.push(i),i}function lh(e,t){return document.location.href+"."+t}function ch(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 hh(e,t){t.style.display=e.useLocalStorage?"block":"none"}function dh(e){var t=e.__save_row=document.createElement("li");Rc.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),Rc.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",Rc.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",Rc.addClass(r,"button"),Rc.addClass(r,"save");var i=document.createElement("span");i.innerHTML="New",Rc.addClass(i,"button"),Rc.addClass(i,"save-as");var o=document.createElement("span");o.innerHTML="Revert",Rc.addClass(o,"button"),Rc.addClass(o,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?pc.each(e.load.remembered,(function(t,n){ch(e,n,n===e.preset)})):ch(e,"Default",!1),Rc.bind(a,"change",(function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=ph(this)),e.folders={},pc.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]=ph(this),ah(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=ph(this,!0)),this.load.remembered[e]=ph(this),this.preset=e,ch(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){pc.each(this.__controllers,(function(t){this.getRoot().load.remembered?sh(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),pc.each(this.__folders,(function(e){e.revert(e)})),e||ah(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&qc.call(window,(function(){e(t)})),pc.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){pc.each(this.__controllers,(function(e){e.updateDisplay()})),pc.each(this.__folders,(function(e){e.updateDisplay()}))}});var vh=rh,mh=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}(),gh=function(){function e(e,t){var n;this.config=new mh(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 vh({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}(),yh=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}(),bh=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}(),xh=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}(),_h=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())}))},wh=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 Mh(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 Ih(r,void 0,void 0,(function(){var t,n,r,i,o,a=this;return Ch(this,(function(s){switch(s.label){case 0:return _o()(e.incrId)&&(e.incrId&&e.incrId-this._receiveIncrId!=1&&this.emit(Ph.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),Ih(r,void 0,void 0,(function(){var t,n;return Ch(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),Ih(r,void 0,void 0,(function(){var t,n;return Ch(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),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.anchor=r.config.anchor,r.syncQueue=new yh(r.receiveSyncHandler),r.lock=new bh("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(Ph.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=eo.transform(t);i.errorType===Qi.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=Tl()(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=Tl()(r.handleViewClick,300),r.player.errorChannel.on("error",(function(e,t){var n=eo.transform(e);n.errorType===Qi.RuntimeWarn?r.logger.warn(n.message,r.taskId):r.logger.error(n.message,r.taskId),r.isLoading=!1,r.reportError(e,t)})),window.addEventListener("message",r.recoverHandler),t.volumeAdjuster.on("update",r._updateVolumeByStaticAdjuster),r}var n,r;return Eh(t,e),t.flushLog=function(e){return void 0===e&&(e=!1),Ih(this,void 0,void 0,(function(){return Ch(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==Lh?void 0:Lh.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 Ih(this,void 0,void 0,(function(){var n,r,i,o,a;return Ch(this,(function(s){switch(s.label){case 0:return t.remoteLogAddress=e,[4,t.flushLog(!0)];case 1:if(s.sent(),!Lh)return[3,13];n=[],s.label=2;case 2:return s.trys.push([2,4,,5]),[4,Lh.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 Ih(this,void 0,void 0,(function(){var i,o=this;return Ch(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,kh(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 Ih(this,void 0,void 0,(function(){var e;return Ch(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 Ih(this,void 0,void 0,(function(){return Ch(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 Ih(this,void 0,void 0,(function(){var n=this;return Ch(this,(function(r){switch(r.label){case 0:return this.renderingIndex=e,this.player&&e===this.player.currentIndex?[2]:((gl.platform.isIOS()||gl.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=gl.platform.isLowGpuMemory()?15:30;return(gl.platform.isIOS()||gl.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(Ph.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(Ph.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;!_l()(this.lastEmitedState,e)&&this.isSlideStateReady(e)&&(this.lastEmitedState=e,this.emit(Ph.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=Ah(Ah({},e),{uuid:t,clientId:this.config.clientId});"sync"===this.config.mode&&(n.incrId=this.dispatchIncrId),this.emit(Ph.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 Ih(this,void 0,void 0,(function(){var t,n,r,i=this;return Ch(this,(function(o){switch(o.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",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]=Ah(Ah({},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 Ih(this,void 0,void 0,(function(){var n,r,i,o;return Ch(this,(function(a){switch(a.label){case 0:if(this.logger.info("do release slide",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=Sl()(Rh),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);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 Ih(this,void 0,void 0,(function(){var e;return Ch(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return this.isLoading&&e<10?[4,kh(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 Ih(this,void 0,void 0,(function(){return Ch(this,(function(e){return this.player?[2,this.player.getSnapshot()]:[2,null]}))}))},t.prototype.snapshotWithTimingEnd=function(e){return Ih(this,void 0,void 0,(function(){return Ch(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(){gl.clearLocalCache()},t.disposeLocalCache=function(){},n=t,t.preloadResource=Mh,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=bl.get(n.hookPoint)||[]).push(n),bl.set(n.hookPoint,r)},t.volumeAdjuster=new fl,t.trackLogger=new Th,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 Ih(void 0,void 0,void 0,(function(){var r,i,o,a,s,u;return Ch(n,(function(n){switch(n.label){case 0:return[4,t.flushLog(!0)];case 1:if(n.sent(),!Lh)return[3,12];r=[],n.label=2;case 2:return n.trys.push([2,4,,5]),[4,Lh.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}function he(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 de(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 fe="https://convertcdn.netless.link/dynamicConvert";t.DefaultUrl=fe;var pe={taskId:"",url:"",state:null},ve=function(){function e(t){var n,r=this,i=t.context,o=t.anchor,a=t.onPageChanged,s=t.onTransitionStart,l=t.onTransitionEnd,c=t.onError,h=t.onRenderError,d=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=u(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=u(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.onPageChanged=a,this.onTransitionStart=s,this.onTransitionEnd=l,this.onError=c,this.onRenderError=h,this.showRenderError=null==d||d,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),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(pe);var n=e.storage.state,r=n.taskId,i=n.url,o=n.state;t.setResource(r,i||fe),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.slideChange,this.onPageChanged),n.on(L.SLIDE_EVENTS.renderStart,this.onTransitionStart),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(pe);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=this.context.getAppOptions()||{};return new L.Slide({anchor:e,interactive:!0,mode:"interactive",controller:oe.enable,enableGlobalClick:null==(t=i.enableGlobalClick)||t,renderOptions:{minFPS:i.minFPS||25,maxFPS:i.maxFPS||30,autoFPS:null==(n=i.autoFPS)||n,autoResolution:null==(r=i.autoResolution)||r,resolution:i.resolution,transactionBgColor:i.bgColor||ce(e),maxResolutionLevel:i.maxResolutionLevel,forceCanvas:i.forceCanvas,enableNvidiaDetect:i.enableNvidiaDetect},fixedFrameSize:i.fixedFrameSize,loaderDelegate:i.loaderDelegate,navigatorDelegate:i.navigatorDelegate,urlInterrupter:i.urlInterrupter,resourceTimeout:i.resourceTimeout,rtcAudio:i.rtcAudio,useLocalCache:i.useLocalCache,logger:i.logger,timestamp:this.timestamp})}},{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 me="undefined"!=typeof window,ge=me&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),ye=me&&"IntersectionObserver"in window,be=me&&"classList"in document.createElement("p"),xe=me&&window.devicePixelRatio>1,_e={elements_selector:".lazy",container:ge||me?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},we=function(e){return Object.assign({},_e,e)},Te=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)},Me="src",Se="srcset",Ee="sizes",Ae="poster",Ie="llOriginalAttrs",Ce="data",Ne="loading",ke="loaded",De="applied",Pe="error",Re="native",Oe="data-",Le="ll-status",je=function(e,t){return e.getAttribute(Oe+t)},Be=function(e){return je(e,Le)},Ue=function(e,t){return function(e,t,n){var r=Oe+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)}(e,Le,t)},Fe=function(e){return Ue(e,null)},ze=function(e){return null===Be(e)},Ge=function(e){return Be(e)===Re},He=[Ne,ke,De,Pe],Ve=function(e,t,n,r){e&&(void 0===r?void 0===n?e(t):e(t,n):e(t,n,r))},We=function(e,t){be?e.classList.add(t):e.className+=(e.className?" ":"")+t},Ye=function(e,t){be?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Xe=function(e){return e.llTempImage},Qe=function(e,t){if(t){var n=t._observer;n&&n.unobserve(e)}},qe=function(e,t){e&&(e.loadingCount+=t)},Ze=function(e,t){e&&(e.toLoadCount=t)},Je=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},Ke=function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&Je(n).forEach(t)},$e=function(e,t){Je(e).forEach(t)},et=[Me],tt=[Me,Ae],nt=[Me,Se,Ee],rt=[Ce],it=function(e){return!!e[Ie]},ot=function(e){return e[Ie]},at=function(e){return delete e[Ie]},st=function(e,t){if(!it(e)){var n={};t.forEach((function(t){n[t]=e.getAttribute(t)})),e[Ie]=n}},ut=function(e,t){if(it(e)){var n=ot(e);t.forEach((function(t){!function(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}(e,t,n[t])}))}},lt=function(e,t,n){We(e,t.class_applied),Ue(e,De),n&&(t.unobserve_completed&&Qe(e,t),Ve(t.callback_applied,e,n))},ct=function(e,t,n){We(e,t.class_loading),Ue(e,Ne),n&&(qe(n,1),Ve(t.callback_loading,e,n))},ht=function(e,t,n){n&&e.setAttribute(t,n)},dt=function(e,t){ht(e,Ee,je(e,t.data_sizes)),ht(e,Se,je(e,t.data_srcset)),ht(e,Me,je(e,t.data_src))},ft={IMG:function(e,t){Ke(e,(function(e){st(e,nt),dt(e,t)})),st(e,nt),dt(e,t)},IFRAME:function(e,t){st(e,et),ht(e,Me,je(e,t.data_src))},VIDEO:function(e,t){$e(e,(function(e){st(e,et),ht(e,Me,je(e,t.data_src))})),st(e,tt),ht(e,Ae,je(e,t.data_poster)),ht(e,Me,je(e,t.data_src)),e.load()},OBJECT:function(e,t){st(e,rt),ht(e,Ce,je(e,t.data_src))}},pt=["IMG","IFRAME","VIDEO","OBJECT"],vt=function(e,t){!t||function(e){return e.loadingCount>0}(t)||function(e){return e.toLoadCount>0}(t)||Ve(e.callback_finish,t)},mt=function(e,t,n){e.addEventListener(t,n),e.llEvLisnrs[t]=n},gt=function(e,t,n){e.removeEventListener(t,n)},yt=function(e){return!!e.llEvLisnrs},bt=function(e){if(yt(e)){var t=e.llEvLisnrs;for(var n in t){var r=t[n];gt(e,n,r)}delete e.llEvLisnrs}},xt=function(e,t,n){!function(e){delete e.llTempImage}(e),qe(n,-1),function(e){e&&(e.toLoadCount-=1)}(n),Ye(e,t.class_loading),t.unobserve_completed&&Qe(e,n)},_t=function(e,t,n){var r=Xe(e)||e;if(!yt(r)){!function(e,t,n){yt(e)||(e.llEvLisnrs={});var r="VIDEO"===e.tagName?"loadeddata":"load";mt(e,r,t),mt(e,"error",n)}(r,(function(i){!function(e,t,n,r){var i=Ge(t);xt(t,n,r),We(t,n.class_loaded),Ue(t,ke),Ve(n.callback_loaded,t,r),i||vt(n,r)}(0,e,t,n),bt(r)}),(function(i){!function(e,t,n,r){var i=Ge(t);xt(t,n,r),We(t,n.class_error),Ue(t,Pe),Ve(n.callback_error,t,r),n.restore_on_error&&ut(t,nt),i||vt(n,r)}(0,e,t,n),bt(r)}))}},wt=function(e,t,n){!function(e){e.llTempImage=document.createElement("IMG")}(e),_t(e,t,n),function(e){it(e)||(e[Ie]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,n){var r=je(e,t.data_bg),i=je(e,t.data_bg_hidpi),o=xe&&i?i:r;o&&(e.style.backgroundImage='url("'.concat(o,'")'),Xe(e).setAttribute(Me,o),ct(e,t,n))}(e,t,n),function(e,t,n){var r=je(e,t.data_bg_multi),i=je(e,t.data_bg_multi_hidpi),o=xe&&i?i:r;o&&(e.style.backgroundImage=o,lt(e,t,n))}(e,t,n),function(e,t,n){var r=je(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()),lt(e,t,n)}}(e,t,n)},Tt=function(e,t,n){_t(e,t,n),function(e,t,n){var r=ft[e.tagName];r&&(r(e,t),ct(e,t,n))}(e,t,n)},Mt=function(e,t,n){!function(e){return pt.indexOf(e.tagName)>-1}(e)?wt(e,t,n):Tt(e,t,n)},St=function(e,t,n){e.setAttribute("loading","lazy"),_t(e,t,n),function(e,t){var n=ft[e.tagName];n&&n(e,t)}(e,t),Ue(e,Re)},Et=function(e){e.removeAttribute(Me),e.removeAttribute(Se),e.removeAttribute(Ee)},At=function(e){Ke(e,(function(e){ut(e,nt)})),ut(e,nt)},It={IMG:At,IFRAME:function(e){ut(e,et)},VIDEO:function(e){$e(e,(function(e){ut(e,et)})),ut(e,tt),e.load()},OBJECT:function(e){ut(e,rt)}},Ct=function(e){var t=It[e.tagName];t?t(e):function(e){if(it(e)){var t=ot(e);e.style.backgroundImage=t.backgroundImage}}(e)},Nt=function(e,t){Ct(e),function(e,t){ze(e)||Ge(e)||(Ye(e,t.class_entered),Ye(e,t.class_exited),Ye(e,t.class_applied),Ye(e,t.class_loading),Ye(e,t.class_loaded),Ye(e,t.class_error))}(e,t),Fe(e),at(e)},kt=function(e,t,n,r){n.cancel_on_exit&&function(e){return Be(e)===Ne}(e)&&"IMG"===e.tagName&&(bt(e),function(e){Ke(e,(function(e){Et(e)})),Et(e)}(e),At(e),Ye(e,n.class_loading),qe(r,-1),Fe(e),Ve(n.callback_cancel,e,t,r))},Dt=function(e,t,n,r){var i=function(e){return He.indexOf(Be(e))>=0}(e);Ue(e,"entered"),We(e,n.class_entered),Ye(e,n.class_exited),function(e,t,n){t.unobserve_entered&&Qe(e,n)}(e,n,r),Ve(n.callback_enter,e,t,r),i||Mt(e,n,r)},Pt=["IMG","IFRAME","VIDEO"],Rt=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},Ot=function(e,t,n){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?Dt(e.target,e,t,n):function(e,t,n,r){ze(e)||(We(e,n.class_exited),kt(e,t,n,r),Ve(n.callback_exit,e,t,r))}(e.target,e,t,n)}))},Lt=function(e,t){ye&&!Rt(e)&&(t._observer=new IntersectionObserver((function(n){Ot(n,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},jt=function(e){return Array.prototype.slice.call(e)},Bt=function(e){return e.container.querySelectorAll(e.elements_selector)},Ut=function(e){return function(e){return Be(e)===Pe}(e)},Ft=function(e,t){return function(e){return jt(e).filter(ze)}(e||Bt(t))},zt=function(e,t){var n;(n=Bt(e),jt(n).filter(Ut)).forEach((function(t){Ye(t,e.class_error),Fe(t)})),t.update()},Gt=function(e,t){var n=we(e);this._settings=n,this.loadingCount=0,Lt(n,this),function(e,t){me&&(t._onlineHandler=function(){zt(e,t)},window.addEventListener("online",t._onlineHandler))}(n,this),this.update(t)};Gt.prototype={update:function(e){var t,n,r=this._settings,i=Ft(e,r);(Ze(this,i.length),!ge&&ye)?Rt(r)?function(e,t,n){e.forEach((function(e){-1!==Pt.indexOf(e.tagName)&&St(e,t,n)})),Ze(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,me&&window.removeEventListener("online",e._onlineHandler),Bt(this._settings).forEach((function(e){at(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){Qe(e,t),Mt(e,n,t)}))},restoreAll:function(){var e=this._settings;Bt(e).forEach((function(t){Nt(t,e)}))}},Gt.load=function(e,t){var n=we(t);Mt(e,n)},Gt.resetStatus=function(e){Fe(e)},me&&function(e,t){if(t)if(t.length)for(var n,r=0;n=t[r];r+=1)Te(e,n);else Te(e,t)}(Gt,window.lazyLoadOptions);var Ht=function(){function e(t){var n=this,r=t.readonly,i=t.onNewPageIndex,o=t.onPlay,a=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.urlInterrupter=a||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=u(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 Gt({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()},get:function(){return this._pages}}]),e}(),Vt=new Set(["clicker"]),Wt=function(){function e(t){var r=this,i=t.box,o=t.view,a=t.mountSlideController,s=t.mountWhiteboard,l=t.baseScenePath,c=t.appId,h=t.urlInterrupter;_(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.onRenderEnd=function(){r.$overlay.style.opacity=""},this.refreshPages=function(){r.slideController&&(r.viewer.pages=he(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=u(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=l,this.appId=c,this.viewer=new Ht({readonly:i.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:h}),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,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||Vt.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}(),Yt=!1,Xt=2;t.FreezerLength=Xt;var Qt=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",Qt(this.queue));this.queue.length>Xt;){var t=this.queue.pop(),n=this.map.get(t);n&&(ae("[Slide] freezer: validate-freeze",t,Qt(this.queue)),n.freeze())}},set:function(e,t,n){ae("[Slide] freezer: add",e,Qt(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,Qt(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,Qt(this.queue)),t&&t.unfreeze()}};t.apps=qt;var Zt=new Set;var Jt=new Set;t.addHooks=function(e){Yt=!0,e.on("focus",(function(e){var t=e.appId;qt.focus(t)})),e.on("created",(function(e){var t=e.appId;Zt.forEach((function(e){return e(t)}))})),e.on("destroy",(function(e){var t=e.appId;Jt.forEach((function(e){return e(t)}))}))};var Kt=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}.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 $t=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=he(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 Ht({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(Kt)),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=$t;var en=L.Slide.usePlugin.bind(L.Slide);t.usePlugin=en;var tn="0.2.43";t.version=tn;var nn={kind:"Slide",setup:function(e){var t;if(console.log("[Slide] setup @ 0.2.43"),e.getIsWritable()&&e.storage.ensureState(pe),!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(Kt);try{r.$content.dataset.appSlideVersion=tn}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()&&(de(n,e,o.slideController.slide,i),r=!0),ae("[Slide] page to",t,r?"(synced)":""),o.viewer.setPageIndex(t-1)}};o=new Wt({box:r,view:n,mountSlideController:function(t){var n,o,s=e.getAppOptions()||{},u=new ve((n=O({context:e},t),o={onPageChanged:a,onRenderError:s.onRenderError,showRenderError:s.showRenderError},C(n,N(o))));return Yt&&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()&&(de(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});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),Yt&&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=nn;var rn=L.Slide;t.Slide=rn},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)}))}},29165:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.RTCPlugin=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]:R.kind;return e=function(e){s(n,e);var t=l(n);function n(){return b(this,n),t.apply(this,arguments)}return n}(R),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,Z(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 @@ -255,9 +256,9 @@ var Xp=new jl.j,Qp=function(){function e(e){this.renderer=e}return e.prototype.i * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -t.videoJsPlugin=function(e){var t;return e&&(t=e,I=x(x({},A),t)),{kind:S,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 Ee(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):E(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 Se(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 Se?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 E(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function S(e,t){g(e,E(),t)}function A(e){return e[E()]=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 Et(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}(),Et=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=Ee(!0);o.spliceWithArray(0,0,t),Se(s)}return _t&&Object.defineProperty(a.array,"0",St),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 E(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 E(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)?E(e,t):void 0}}function E(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 Ee=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Se(e)[t];if(r){var i=r[n];if(i){var o=i.name;return t===ie?"/".concat(o):"".concat(t,"/").concat(o)}}},Se=function(e){return e.entireScenes()},Ae=function(e,t,n,r){return null==e?void 0:e.putScenes(t,n,r)},Ie=function(e){var t=e.split("/");t.pop();var n=t.join("/");return""===n&&(n="/"),n},Ce=function(e){return e.endsWith("/")?e.slice(0,-1):e},Ne=function(e){var t=e.split(".").map((function(e){return e.padStart(2,"0")})).join("");return parseInt(t)},ke=function(e){return new Promise((function(t){return setTimeout(t,e)}))},De=function(e){return 1===e.split("").reduce((function(e,t){return t===ie&&(e+=1),e}),0)},Pe=function(){function e(t){var n=this;y(this,e),this.manager=t,this.displayer=this.manager.displayer,this.mainMagixEventListener=function(e){if(e.authorId!==n.displayer.observerId){var t=e.payload;switch(t.eventName){case q.AppMove:n.appMoveHandler(t.payload);break;case q.AppResize:n.appResizeHandler(t.payload);break;case q.AppBoxStateChange:n.boxStateChangeHandler(t.payload);break;case q.SetMainViewScenePath:n.setMainViewScenePathHandler(t.payload);break;case q.MoveCamera:n.moveCameraHandler(t.payload);break;case q.MoveCameraToContain:n.moveCameraToContainHandler(t.payload);break;case q.CursorMove:n.cursorMoveHandler(t.payload);break;case q.RootDirRemoved:n.rootDirRemovedHandler();break;case q.Refresh:n.refreshHandler();break;case q.InitMainViewCamera:n.initMainViewCameraHandler();break;case q.SetAppFocusIndex:n.setAppFocusViewIndexHandler(t.payload)}}},this.appMoveHandler=function(e){var t;null==(t=n.boxManager)||t.moveBox(e)},this.appResizeHandler=function(e){var t,r;null==(t=n.boxManager)||t.resizeBox(Object.assign(e,{skipUpdate:!0})),null==(r=n.manager.room)||r.refreshViewSize()},this.boxStateChangeHandler=function(e){ae.emit("boxStateChange",e)},this.setMainViewScenePathHandler=function(e){var t=e.nextScenePath;we(n.manager.mainView,t),ae.emit("mainViewScenePathChange",t)},this.moveCameraHandler=function(e){j.isEqual(j.omit(e,["animationMode"]),P({},n.manager.mainView.camera))||n.manager.mainView.moveCamera(e)},this.moveCameraToContainHandler=function(e){n.manager.mainView.moveCameraToContain(e)},this.cursorMoveHandler=function(e){ue.emit("cursorMove",e)},this.rootDirRemovedHandler=function(){n.manager.createRootDirScenesCallback(),n.manager.mainViewProxy.rebind(),ue.emit("rootDirRemoved")},this.refreshHandler=function(){n.manager.windowManger._refresh()},this.initMainViewCameraHandler=function(){n.manager.mainViewProxy.addCameraReaction()},this.setAppFocusViewIndexHandler=function(e){if("main"===e.type)n.manager.setSceneIndexWithoutSync(e.index);else if("app"===e.type&&e.appID){var t=n.manager.appProxies.get(e.appID);t&&t.setSceneIndexWithoutSync(e.index)}}}return x(e,[{key:"addListeners",value:function(){this.displayer.addMagixEventListener(J,this.mainMagixEventListener)}},{key:"removeListeners",value:function(){this.displayer.removeMagixEventListener(J,this.mainMagixEventListener)}},{key:"boxManager",get:function(){return this.manager.boxManager}}]),e}(),Oe=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: app duplicate exists and cannot be created again",e}return n}(h(Error)),Re=function(e){s(n,e);var t=u(n);function n(e){return y(this,n),t.call(this,"[WindowManager]: app ".concat(e," need register or provide src"))}return n}(h(Error)),Le=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: AppManager must be initialized",e}return n}(h(Error)),je=function(e){s(n,e);var t=u(n);function n(e){return y(this,n),t.call(this,"[WindowManager]: white-web-sdk version must large than ".concat(e))}return n}(h(Error)),Be=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: kind must be a valid string",e}return n}(h(Error)),Ue=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: box need created",e}return n}(h(Error)),Fe=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message='[WindowManager]: ScenePath should start with "/"',e}return n}(h(Error)),ze=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: boxManager not found",e}return n}(h(Error)),Ge=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: room phase only Connected can be bindContainer",e}return n}(h(Error)),He=function(e){return function(t,n){if(void 0!==t){if(B.listenUpdated){var r=function(t){t.map((function(e){return e.kind})).includes(e)&&n()};return B.listenUpdated(t,r),n(),function(){return B.unlistenUpdated(t,r)}}return B.reaction((function(){return t}),(function(){n()}),{fireImmediately:!0})}}},Ve=function(e,t,n){var r=null,i=B.reaction(e,(function(){r&&(r(),r=null);var i=e();j.isObject(i)?(r=function(){return B.unlistenUpdated(i,t)},B.listenUpdated(i,t)):null==n||n(i)}),{fireImmediately:!0});return function(){null==r||r(),i()}},We=He(B.UpdateEventKind.Removed);He(B.UpdateEventKind.Inserted);var Ye=Object.keys;function Xe(e){return Boolean(j.has(e,"__isRef"))}var Qe=function(){function e(){y(this,e),this.listeners=new Set}return x(e,[{key:"dispatch",value:function(e){this.listeners.forEach((function(t){return t(e)}))}},{key:"addListener",value:function(e){this.listeners.add(e)}},{key:"removeListener",value:function(e){this.listeners.delete(e)}},{key:"length",get:function(){return this.listeners.size}}]),e}(),Ze="_WM-STORAGE_",qe=function(){function e(t,n,r){var i=this;if(y(this,e),this._sideEffect=new F.SideEffectManager,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Qe,r&&!j.isObject(r))throw new Error("Default state for Storage ".concat(n," is not an object."));this._context=t,this.id=n||null,this._state={};var o=this._getRawState(this._state);this._context.getIsWritable()&&(null===this.id?t.isAddApp&&r&&this.setState(r):(o===this._state||!j.isObject(o))&&(j.get(this._context.getAttributes(),[Ze])||this._context.updateAttributes([Ze],{}),this._context.updateAttributes([Ze,this.id],this._state),r&&this.setState(r))),Ye(o).forEach((function(e){if(null!==i.id||e!==Ze)try{var t=j.isObject(o[e])?JSON.parse(JSON.stringify(o[e])):o[e];Xe(t)?(i._state[e]=t.v,j.isObject(t.v)&&i._refMap.set(t.v,t)):i._state[e]=t}catch(t){console.error(t)}})),this._sideEffect.addDisposer(Ve((function(){return null===i.id?t.getAttributes():j.get(t.getAttributes(),[Ze,i.id])}),this._updateProperties.bind(this),this.destroy.bind(this)))}return x(e,[{key:"addStateChangedListener",value:function(e){var t=this;return this.onStateChanged.addListener(e),function(){return t.onStateChanged.removeListener(e)}}},{key:"ensureState",value:function(e){var t=this;return this.setState(Ye(e).reduce((function(n,r){return j.has(t._state,r)||(n[r]=e[r]),n}),{}))}},{key:"setState",value:function(e){var t=this;if(this._destroyed)console.error(new Error('Cannot call setState on destroyed Storage "'.concat(this.id,'".')));else if(this._context.getIsWritable()){var n=Ye(e);n.length>0&&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.prevPage=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.pageState.index-1,e.abrupt("return",t<0?(console.warn("[WindowManager] prevPage: index out of range"),!1):(s.appProxy.setSceneIndex(t),!0));case 2:case"end":return e.stop()}}),e)}))),this.addPage=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=null==t?void 0:t.after,r=null==t?void 0:t.scene,(i=s.appProxy.scenePath)&&(n?(o=s.pageState.index+1,Ae(s.manager.room,i,[r||{}],o)):Ae(s.manager.room,i,[r||{}]));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.removePage=function(){var e=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=void 0===t?s.pageState.index:t,e.abrupt("return",1===s.pageState.length?(console.warn("[WindowManager]: can not remove the last page"),!1):n<0||n>=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:"storage",get:function(){return this._storage||(this._storage=new qe(this)),this._storage}},{key:"pageState",get:function(){return this.appProxy.pageState}}]),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}($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:"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&&i.zIndex!==(null==(n=a.box)?void 0:n.zIndex)&&(null==(r=a.boxManager)||r.setZIndex(e,i.zIndex))}))})),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=Se(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=Se(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()}))}))},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.onCameraOrSizeUpdated=function(){ae.emit("cameraStateChange",n.cameraState)},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.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.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=Se(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=vb,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:"_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&&gb.container){0===(n=Object.keys(t)).length&&this.appCreateQueue.emitReady(),r=n.map((function(e){return{id:e,createdAt:t[e].createdAt}})),i=T(j.orderBy(r,"createdAt","asc"));try{for(a=function(){var e=o.value.id;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=Ee(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.safeSetAttributes({_mainSceneIndex: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}),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)gb.containerSizeRatio?(i=r*gb.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!0)):(r=i/gb.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;oe.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,q(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,q(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,q(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 Ot(e,q(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:Z,struct:$},te=function e(t,n,r){if("string"==typeof arguments[1])return Z.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 Re(){Ne.inBatch++}function Oe(){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(Re(),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)}}Oe()}},e.prototype.track=function(e){Re();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}),Oe()},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||(Re(),he(this),Oe()))},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)))}Ze.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=Ze(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:Z);z(e),Bt(e,r.name,i.enhancer),Re();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{Oe()}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||O(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),Re();try{return e.apply(t)}finally{Oe()}}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 R={identity:P,structural:function(e,t){return qt(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 qt(e,t,1)}},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 L(e,t){function n(){this.constructor=e}O(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=Z(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=Z(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=Z(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=Z(t);return new jt(e,J(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&ie("object");var r=Z(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:R.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&&Re(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--;)Re(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 Re(e,t){if(1===e.observers.length)e.observers.length=0,Oe(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 Oe(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&&Oe(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?Ze(e):!0!==r?Ze(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:qe}:{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?R.structural:n.equals||R.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=Z(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,R(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){return null==e?void 0:e.putScenes(t,n,r)},Ie=function(e){var t=e.split("/");t.pop();var n=t.join("/");return""===n&&(n="/"),n},Ce=function(e){return e.endsWith("/")?e.slice(0,-1):e},Ne=function(e){var t=e.split(".").map((function(e){return e.padStart(2,"0")})).join("");return parseInt(t)},ke=function(e){return new Promise((function(t){return setTimeout(t,e)}))},De=function(e){return 1===e.split("").reduce((function(e,t){return t===ie&&(e+=1),e}),0)},Pe=function(){function e(t){var n=this;y(this,e),this.manager=t,this.displayer=this.manager.displayer,this.mainMagixEventListener=function(e){if(e.authorId!==n.displayer.observerId){var t=e.payload;switch(t.eventName){case Z.AppMove:n.appMoveHandler(t.payload);break;case Z.AppResize:n.appResizeHandler(t.payload);break;case Z.AppBoxStateChange:n.boxStateChangeHandler(t.payload);break;case Z.SetMainViewScenePath:n.setMainViewScenePathHandler(t.payload);break;case Z.MoveCamera:n.moveCameraHandler(t.payload);break;case Z.MoveCameraToContain:n.moveCameraToContainHandler(t.payload);break;case Z.CursorMove:n.cursorMoveHandler(t.payload);break;case Z.RootDirRemoved:n.rootDirRemovedHandler();break;case Z.Refresh:n.refreshHandler();break;case Z.InitMainViewCamera:n.initMainViewCameraHandler();break;case Z.SetAppFocusIndex:n.setAppFocusViewIndexHandler(t.payload)}}},this.appMoveHandler=function(e){var t;null==(t=n.boxManager)||t.moveBox(e)},this.appResizeHandler=function(e){var t,r;null==(t=n.boxManager)||t.resizeBox(Object.assign(e,{skipUpdate:!0})),null==(r=n.manager.room)||r.refreshViewSize()},this.boxStateChangeHandler=function(e){ae.emit("boxStateChange",e)},this.setMainViewScenePathHandler=function(e){var t=e.nextScenePath;we(n.manager.mainView,t),ae.emit("mainViewScenePathChange",t)},this.moveCameraHandler=function(e){j.isEqual(j.omit(e,["animationMode"]),P({},n.manager.mainView.camera))||n.manager.mainView.moveCamera(e)},this.moveCameraToContainHandler=function(e){n.manager.mainView.moveCameraToContain(e)},this.cursorMoveHandler=function(e){ue.emit("cursorMove",e)},this.rootDirRemovedHandler=function(){n.manager.createRootDirScenesCallback(),n.manager.mainViewProxy.rebind(),ue.emit("rootDirRemoved")},this.refreshHandler=function(){n.manager.windowManger._refresh()},this.initMainViewCameraHandler=function(){n.manager.mainViewProxy.addCameraReaction()},this.setAppFocusViewIndexHandler=function(e){if("main"===e.type)n.manager.setSceneIndexWithoutSync(e.index);else if("app"===e.type&&e.appID){var t=n.manager.appProxies.get(e.appID);t&&t.setSceneIndexWithoutSync(e.index)}}}return x(e,[{key:"addListeners",value:function(){this.displayer.addMagixEventListener(J,this.mainMagixEventListener)}},{key:"removeListeners",value:function(){this.displayer.removeMagixEventListener(J,this.mainMagixEventListener)}},{key:"boxManager",get:function(){return this.manager.boxManager}}]),e}(),Re=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: app duplicate exists and cannot be created again",e}return n}(h(Error)),Oe=function(e){s(n,e);var t=u(n);function n(e){return y(this,n),t.call(this,"[WindowManager]: app ".concat(e," need register or provide src"))}return n}(h(Error)),Le=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: AppManager must be initialized",e}return n}(h(Error)),je=function(e){s(n,e);var t=u(n);function n(e){return y(this,n),t.call(this,"[WindowManager]: white-web-sdk version must large than ".concat(e))}return n}(h(Error)),Be=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: kind must be a valid string",e}return n}(h(Error)),Ue=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: box need created",e}return n}(h(Error)),Fe=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message='[WindowManager]: ScenePath should start with "/"',e}return n}(h(Error)),ze=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: boxManager not found",e}return n}(h(Error)),Ge=function(e){s(n,e);var t=u(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).message="[WindowManager]: room phase only Connected can be bindContainer",e}return n}(h(Error)),He=function(e){return function(t,n){if(void 0!==t){if(B.listenUpdated){var r=function(t){t.map((function(e){return e.kind})).includes(e)&&n()};return B.listenUpdated(t,r),n(),function(){return B.unlistenUpdated(t,r)}}return B.reaction((function(){return t}),(function(){n()}),{fireImmediately:!0})}}},Ve=function(e,t,n){var r=null,i=B.reaction(e,(function(){r&&(r(),r=null);var i=e();j.isObject(i)?(r=function(){return B.unlistenUpdated(i,t)},B.listenUpdated(i,t)):null==n||n(i)}),{fireImmediately:!0});return function(){null==r||r(),i()}},We=He(B.UpdateEventKind.Removed);He(B.UpdateEventKind.Inserted);var Ye=Object.keys;function Xe(e){return Boolean(j.has(e,"__isRef"))}var Qe=function(){function e(){y(this,e),this.listeners=new Set}return x(e,[{key:"dispatch",value:function(e){this.listeners.forEach((function(t){return t(e)}))}},{key:"addListener",value:function(e){this.listeners.add(e)}},{key:"removeListener",value:function(e){this.listeners.delete(e)}},{key:"length",get:function(){return this.listeners.size}}]),e}(),qe="_WM-STORAGE_",Ze=function(){function e(t,n,r){var i=this;if(y(this,e),this._sideEffect=new F.SideEffectManager,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Qe,r&&!j.isObject(r))throw new Error("Default state for Storage ".concat(n," is not an object."));this._context=t,this.id=n||null,this._state={};var o=this._getRawState(this._state);this._context.getIsWritable()&&(null===this.id?t.isAddApp&&r&&this.setState(r):(o===this._state||!j.isObject(o))&&(j.get(this._context.getAttributes(),[qe])||this._context.updateAttributes([qe],{}),this._context.updateAttributes([qe,this.id],this._state),r&&this.setState(r))),Ye(o).forEach((function(e){if(null!==i.id||e!==qe)try{var t=j.isObject(o[e])?JSON.parse(JSON.stringify(o[e])):o[e];Xe(t)?(i._state[e]=t.v,j.isObject(t.v)&&i._refMap.set(t.v,t)):i._state[e]=t}catch(t){console.error(t)}})),this._sideEffect.addDisposer(Ve((function(){return null===i.id?t.getAttributes():j.get(t.getAttributes(),[qe,i.id])}),this._updateProperties.bind(this),this.destroy.bind(this)))}return x(e,[{key:"addStateChangedListener",value:function(e){var t=this;return this.onStateChanged.addListener(e),function(){return t.onStateChanged.removeListener(e)}}},{key:"ensureState",value:function(e){var t=this;return this.setState(Ye(e).reduce((function(n,r){return j.has(t._state,r)||(n[r]=e[r]),n}),{}))}},{key:"setState",value:function(e){var t=this;if(this._destroyed)console.error(new Error('Cannot call setState on destroyed Storage "'.concat(this.id,'".')));else if(this._context.getIsWritable()){var n=Ye(e);n.length>0&&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([qe,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(),[qe,this.id],e)}},{key:"_setRawState",value:function(e,t){if(null===this.id){if(e===qe)throw new Error('Cannot set attribute internal filed "'.concat(qe,'"'));return this._context.updateAttributes([e],t)}return this._context.updateAttributes([qe,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.prevPage=g(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.pageState.index-1,e.abrupt("return",t<0?(console.warn("[WindowManager] prevPage: index out of range"),!1):(s.appProxy.setSceneIndex(t),!0));case 2:case"end":return e.stop()}}),e)}))),this.addPage=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=null==t?void 0:t.after,r=null==t?void 0:t.scene,(i=s.appProxy.scenePath)&&(n?(o=s.pageState.index+1,Ae(s.manager.room,i,[r||{}],o)):Ae(s.manager.room,i,[r||{}]));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.removePage=function(){var e=g(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=void 0===t?s.pageState.index:t,e.abrupt("return",1===s.pageState.length?(console.warn("[WindowManager]: can not remove the last page"),!1):n<0||n>=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:"storage",get:function(){return this._storage||(this._storage=new Ze(this)),this._storage}},{key:"pageState",get:function(){return this.appProxy.pageState}}]),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}($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:"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&&i.zIndex!==(null==(n=a.box)?void 0:n.zIndex)&&(null==(r=a.boxManager)||r.setZIndex(e,i.zIndex))}))})),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(Z.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(Z.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()}))}))},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(R(P({},e),{id:n.manager.uid})),j.isEqual(n.mainViewSize,R(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(R(P({},e),{id:n.manager.uid}))}),50),this.onCameraOrSizeUpdated=function(){ae.emit("cameraStateChange",n.cameraState)},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(Z.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.started=!0)}},{key:"setCameraAndSize",value:function(){var e=R(P({},this.mainView.camera),{id:this.manager.uid}),t=R(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(Z.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(Z.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(Z.AppMove,e),n.store.updateAppState(e.appId,$.Position,{x:e.x,y:e.y})},this.onBoxResize=function(e){e.width&&e.height&&(n.dispatchInternalEvent(Z.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(Z.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.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=vb,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:"_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&&gb.container){0===(n=Object.keys(t)).length&&this.appCreateQueue.emitReady(),r=n.map((function(e){return{id:e,createdAt:t[e].createdAt}})),i=T(j.orderBy(r,"createdAt","asc"));try{for(a=function(){var e=o.value.id;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.safeSetAttributes({_mainSceneIndex: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(Z.SetMainViewScenePath,{nextScenePath: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)gb.containerSizeRatio?(i=r*gb.containerSizeRatio,t.classList.toggle("netless-window-manager-sizer-horizontal",!0)):(r=i/gb.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 Et:case St: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;aZt.length&&Zt.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,E=void 0===M?.1:M,S=n.minimized,A=void 0!==S&&S,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(E,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),Ee=te(Q),Se=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:Ee,$userStyles:Se}),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,Ei,Si=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 E=window.matchMedia("(prefers-color-scheme: dark)"),S=M(!1);E&&(S.setValue(E.matches),this._sideEffect.add((function(){var e=function(e){S.setValue(e.matches)};return E.addListener(e),function(){return E.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([S,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 Si({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=gb.wrapper?gb.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)||gb.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){Ei=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=Ei;do{for(;to7&&void 0!==arguments[7]?arguments[7]:[-1],u=Ei;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,gb.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=gb.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=gb.container)?void 0:e.getBoundingClientRect(),this.wrapperRect=null==(t=gb.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(){var e;return(null==(e=this.manager)?void 0:e.store.getMainViewSceneIndex())||0}},{key:"length",get:function(){var e;return(null==(e=this.manager)?void 0:e.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,Eo=Object.defineProperties,So=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 Eo(e,So(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="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Go=zo.length,Ho=Array(20),Vo=function(){for(var e=0;e<20;e++)Ho[e]=zo.charAt(Math.random()*Go);return Ho.join("")};function Wo(e){try{return e()}catch(e){console.error(e)}}var Yo,Xo=function(){function e(){y(this,e),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)?function(){return e.forEach(Wo)}:e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.addDisposer(e(),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(Wo),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=Vo()}while(this.disposers.has(e));return e}}]),e}(),Qo=[],Zo="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 qo,Jo=function(e){return Object.freeze(e)},Ko=function(e,t){this.inlineSize=e,this.blockSize=t,Jo(this)},$o=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,Jo(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}(),ea=function(e){return e instanceof SVGElement&&"getBBox"in e},ta=function(e){if(ea(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)},na=function(e){var t,n;if(e instanceof Element)return!0;var r=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&e instanceof r.Element)},ra="undefined"!=typeof window?window:{},ia=new WeakMap,oa=/auto|scroll/,aa=/^tb|vertical/,sa=/msie|trident/i.test(ra.navigator&&ra.navigator.userAgent),ua=function(e){return parseFloat(e||"0")},la=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Ko((n?t:e)||0,(n?e:t)||0)},ca=Jo({devicePixelContentBoxSize:la(),borderBoxSize:la(),contentBoxSize:la(),contentRect:new $o(0,0,0,0)}),ha=function(e,t){if(void 0===t&&(t=!1),ia.has(e)&&!t)return ia.get(e);if(ta(e))return ia.set(e,ca),ca;var n=getComputedStyle(e),r=ea(e)&&e.ownerSVGElement&&e.getBBox(),i=!sa&&"border-box"===n.boxSizing,o=aa.test(n.writingMode||""),a=!r&&oa.test(n.overflowY||""),s=!r&&oa.test(n.overflowX||""),u=r?0:ua(n.paddingTop),l=r?0:ua(n.paddingRight),c=r?0:ua(n.paddingBottom),h=r?0:ua(n.paddingLeft),d=r?0:ua(n.borderTopWidth),f=r?0:ua(n.borderRightWidth),p=r?0:ua(n.borderBottomWidth),v=h+l,m=u+c,g=(r?0:ua(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:ua(n.width)-_-x,M=r?r.height:ua(n.height)-w-b,E=T+v+x+g,S=M+m+b+y,A=Jo({devicePixelContentBoxSize:la(Math.round(T*devicePixelRatio),Math.round(M*devicePixelRatio),o),borderBoxSize:la(E,S,o),contentBoxSize:la(T,M,o),contentRect:new $o(h,u,T,M)});return ia.set(e,A),A},da=function(e,t,n){var r=ha(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}},fa=function(e){var t=ha(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Jo([t.borderBoxSize]),this.contentBoxSize=Jo([t.contentBoxSize]),this.devicePixelContentBoxSize=Jo([t.devicePixelContentBoxSize])},pa=function(e){if(ta(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},va=function(){var e=1/0,t=[];Qo.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new fa(t.target),i=pa(t.target);r.push(n),t.lastReportedSize=da(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},ga=function(){var e=0;for(ma(e);Qo.some((function(e){return e.activeTargets.length>0}));)e=va(),ma(e);return Qo.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Zo}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Zo),window.dispatchEvent(e)}(),e>0},ya=[],ba=function(e){if(!qo){var t=0,n=document.createTextNode("");new MutationObserver((function(){return ya.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),qo=function(){n.textContent=""+(t?t--:t++)}}ya.push(e),qo()},xa=0,_a={attributes:!0,characterData:!0,childList:!0,subtree:!0},wa=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ta=function(e){return void 0===e&&(e=0),Date.now()+e},Ma=!1,Ea=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),!Ma){Ma=!0;var n=Ta(e);!function(e){ba((function(){requestAnimationFrame(e)}))}((function(){var r=!1;try{r=ga()}finally{if(Ma=!1,e=n-Ta(),!xa)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,_a)};document.body?t():ra.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),wa.forEach((function(t){return ra.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),wa.forEach((function(t){return ra.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}(),Sa=new Ea,Aa=function(e){!xa&&e>0&&Sa.start(),!(xa+=e)&&Sa.stop()},Ia=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=da(this.target,this.observedBox,!0);return function(e){return!ea(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}(),Ca=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Na=new WeakMap,ka=function(e,t){for(var n=0;n=0&&(i&&Qo.splice(Qo.indexOf(n),1),n.observationTargets.splice(r,1),Aa(-1))},e.disconnect=function(e){var t=this,n=Na.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Pa=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.");Da.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(!na(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Da.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(!na(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Da.unobserve(this,e)},e.prototype.disconnect=function(){Da.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var Oa="undefined"!=typeof window,Ra=Oa&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),La=Oa&&"IntersectionObserver"in window,ja=Oa&&"classList"in document.createElement("p"),Ba=Oa&&window.devicePixelRatio>1,Ua={elements_selector:".lazy",container:Ra||Oa?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},Fa=function(e){return Object.assign({},Ua,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)},Ga="src",Ha="srcset",Va="sizes",Wa="poster",Ya="llOriginalAttrs",Xa="data",Qa="loading",Za="loaded",qa="applied",Ja="error",Ka="native",$a="data-",es="ll-status",ts=function(e,t){return e.getAttribute($a+t)},ns=function(e){return ts(e,es)},rs=function(e,t){return function(e,t,n){var r=$a+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)}(e,es,t)},is=function(e){return rs(e,null)},os=function(e){return null===ns(e)},as=function(e){return ns(e)===Ka},ss=[Qa,Za,qa,Ja],us=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)}},ls=function(e,t){ja?e.classList.add(t):e.className+=(e.className?" ":"")+t},cs=function(e,t){ja?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},hs=function(e){return e.llTempImage},ds=function(e,t){if(t){var n=t._observer;!n||n.unobserve(e)}},fs=function(e,t){!e||(e.loadingCount+=t)},ps=function(e,t){!e||(e.toLoadCount=t)},vs=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},ms=function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&vs(n).forEach(t)},gs=function(e,t){vs(e).forEach(t)},ys=[Ga],bs=[Ga,Wa],xs=[Ga,Ha,Va],_s=[Xa],ws=function(e){return!!e[Ya]},Ts=function(e){return e[Ya]},Ms=function(e){return delete e[Ya]},Es=function(e,t){if(!ws(e)){var n={};t.forEach((function(t){n[t]=e.getAttribute(t)})),e[Ya]=n}},Ss=function(e,t){if(ws(e)){var n=Ts(e);t.forEach((function(t){!function(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}(e,t,n[t])}))}},As=function(e,t,n){ls(e,t.class_applied),rs(e,qa),n&&(t.unobserve_completed&&ds(e,t),us(t.callback_applied,e,n))},Is=function(e,t,n){ls(e,t.class_loading),rs(e,Qa),n&&(fs(n,1),us(t.callback_loading,e,n))},Cs=function(e,t,n){!n||e.setAttribute(t,n)},Ns=function(e,t){Cs(e,Va,ts(e,t.data_sizes)),Cs(e,Ha,ts(e,t.data_srcset)),Cs(e,Ga,ts(e,t.data_src))},ks={IMG:function(e,t){ms(e,(function(e){Es(e,xs),Ns(e,t)})),Es(e,xs),Ns(e,t)},IFRAME:function(e,t){Es(e,ys),Cs(e,Ga,ts(e,t.data_src))},VIDEO:function(e,t){gs(e,(function(e){Es(e,ys),Cs(e,Ga,ts(e,t.data_src))})),Es(e,bs),Cs(e,Wa,ts(e,t.data_poster)),Cs(e,Ga,ts(e,t.data_src)),e.load()},OBJECT:function(e,t){Es(e,_s),Cs(e,Xa,ts(e,t.data_src))}},Ds=["IMG","IFRAME","VIDEO","OBJECT"],Ps=function(e,t){t&&!function(e){return e.loadingCount>0}(t)&&!function(e){return e.toLoadCount>0}(t)&&us(e.callback_finish,t)},Os=function(e,t,n){e.addEventListener(t,n),e.llEvLisnrs[t]=n},Rs=function(e,t,n){e.removeEventListener(t,n)},Ls=function(e){return!!e.llEvLisnrs},js=function(e){if(Ls(e)){var t=e.llEvLisnrs;for(var n in t){var r=t[n];Rs(e,n,r)}delete e.llEvLisnrs}},Bs=function(e,t,n){(function(e){delete e.llTempImage})(e),fs(n,-1),function(e){!e||(e.toLoadCount-=1)}(n),cs(e,t.class_loading),t.unobserve_completed&&ds(e,n)},Us=function(e,t,n){var r=hs(e)||e;Ls(r)||function(e,t,n){Ls(e)||(e.llEvLisnrs={});var r="VIDEO"===e.tagName?"loadeddata":"load";Os(e,r,t),Os(e,"error",n)}(r,(function(i){(function(e,t,n,r){var i=as(t);Bs(t,n,r),ls(t,n.class_loaded),rs(t,Za),us(n.callback_loaded,t,r),i||Ps(n,r)})(0,e,t,n),js(r)}),(function(i){(function(e,t,n,r){var i=as(t);Bs(t,n,r),ls(t,n.class_error),rs(t,Ja),us(n.callback_error,t,r),n.restore_on_error&&Ss(t,xs),i||Ps(n,r)})(0,e,t,n),js(r)}))},Fs=function(e,t,n){(function(e){e.llTempImage=document.createElement("IMG")})(e),Us(e,t,n),function(e){ws(e)||(e[Ya]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,n){var r=ts(e,t.data_bg),i=ts(e,t.data_bg_hidpi),o=Ba&&i?i:r;!o||(e.style.backgroundImage='url("'.concat(o,'")'),hs(e).setAttribute(Ga,o),Is(e,t,n))}(e,t,n),function(e,t,n){var r=ts(e,t.data_bg_multi),i=ts(e,t.data_bg_multi_hidpi),o=Ba&&i?i:r;!o||(e.style.backgroundImage=o,As(e,t,n))}(e,t,n),function(e,t,n){var r=ts(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()),As(e,t,n)}}(e,t,n)},zs=function(e,t,n){Us(e,t,n),function(e,t,n){var r=ks[e.tagName];!r||(r(e,t),Is(e,t,n))}(e,t,n)},Gs=function(e,t,n){!function(e){return Ds.indexOf(e.tagName)>-1}(e)?Fs(e,t,n):zs(e,t,n)},Hs=function(e,t,n){e.setAttribute("loading","lazy"),Us(e,t,n),function(e,t){var n=ks[e.tagName];!n||n(e,t)}(e,t),rs(e,Ka)},Vs=function(e){e.removeAttribute(Ga),e.removeAttribute(Ha),e.removeAttribute(Va)},Ws=function(e){ms(e,(function(e){Ss(e,xs)})),Ss(e,xs)},Ys={IMG:Ws,IFRAME:function(e){Ss(e,ys)},VIDEO:function(e){gs(e,(function(e){Ss(e,ys)})),Ss(e,bs),e.load()},OBJECT:function(e){Ss(e,_s)}},Xs=function(e){var t=Ys[e.tagName];t?t(e):function(e){if(ws(e)){var t=Ts(e);e.style.backgroundImage=t.backgroundImage}}(e)},Qs=function(e,t){Xs(e),function(e,t){os(e)||as(e)||(cs(e,t.class_entered),cs(e,t.class_exited),cs(e,t.class_applied),cs(e,t.class_loading),cs(e,t.class_loaded),cs(e,t.class_error))}(e,t),is(e),Ms(e)},Zs=function(e,t,n,r){!n.cancel_on_exit||!function(e){return ns(e)===Qa}(e)||"IMG"===e.tagName&&(js(e),function(e){ms(e,(function(e){Vs(e)})),Vs(e)}(e),Ws(e),cs(e,n.class_loading),fs(r,-1),is(e),us(n.callback_cancel,e,t,r))},qs=function(e,t,n,r){var i=function(e){return ss.indexOf(ns(e))>=0}(e);rs(e,"entered"),ls(e,n.class_entered),cs(e,n.class_exited),function(e,t,n){t.unobserve_entered&&ds(e,n)}(e,n,r),us(n.callback_enter,e,t,r),!i&&Gs(e,n,r)},Js=["IMG","IFRAME","VIDEO"],Ks=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},$s=function(e,t,n){e.forEach((function(e){return function(e){return e.isIntersecting||e.intersectionRatio>0}(e)?qs(e.target,e,t,n):function(e,t,n,r){os(e)||(ls(e,n.class_exited),Zs(e,t,n,r),us(n.callback_exit,e,t,r))}(e.target,e,t,n)}))},eu=function(e,t){!La||Ks(e)||(t._observer=new IntersectionObserver((function(n){$s(n,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},tu=function(e){return Array.prototype.slice.call(e)},nu=function(e){return e.container.querySelectorAll(e.elements_selector)},ru=function(e){return function(e){return ns(e)===Ja}(e)},iu=function(e,t){return function(e){return tu(e).filter(os)}(e||nu(t))},ou=function(e,t){(function(e){return tu(e).filter(ru)})(nu(e)).forEach((function(t){cs(t,e.class_error),is(t)})),t.update()},au=function(e,t){var n=Fa(e);this._settings=n,this.loadingCount=0,eu(n,this),function(e,t){!Oa||(t._onlineHandler=function(){ou(e,t)},window.addEventListener("online",t._onlineHandler))}(n,this),this.update(t)};au.prototype={update:function(e){var t=this._settings,n=iu(e,t);ps(this,n.length),!Ra&&La?Ks(t)?function(e,t,n){e.forEach((function(e){-1!==Js.indexOf(e.tagName)&&Hs(e,t,n)})),ps(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){!Oa||window.removeEventListener("online",e._onlineHandler)}(this),nu(this._settings).forEach((function(e){Ms(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;iu(e,n).forEach((function(e){ds(e,t),Gs(e,n,t)}))},restoreAll:function(){var e=this._settings;nu(e).forEach((function(t){Qs(t,e)}))}},au.load=function(e,t){var n=Fa(t);Gs(e,n)},au.resetStatus=function(e){is(e)},Oa&&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)}(au,window.lazyLoadOptions);var su=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 Xo,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.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 au({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))}},{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 uu(e,t,n){return Math.min(Math.max(e,t),n)}function lu(e){return e.touches?e.touches[0]:e}function cu(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function hu(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}var du=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}(),fu=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}(),pu=window.requestIdleCallback||function(e){return window.setTimeout(e,5e3)},vu=window.cancelIdleCallback||window.clearTimeout,mu=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=pu(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&&(vu(this.gcTimer),this.gcTimer=null)}}]),e}(),gu=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 mu(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=uu(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 uu(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}(),yu=function(){function e(t){y(this,e),this.sideEffect=new Xo,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=uu(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)){cu(n);var r=e.wrapClassName("scrollbar-dragging");t.classList.toggle(r,!0);var i=e.pagesScrollTop,o=lu(n).clientY,a=function(t){if(!e.readonly){var n=(lu(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 uu(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}(),bu=window.ResizeObserver||Pa,xu=640,_u=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 Xo,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="".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 su({readonly:a,box:s,pages:u,onNewPageIndex:this.onNewPageIndex});var m=this.whiteboardView.size,b=m.width,x=m.height;this.pageRenderer=new gu({pagesScrollTop:c,pages:this.pages,containerWidth:b,containerHeight:x,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new yu({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 du({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 bu(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<=xu;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/xu,26/e);this.box.$titleBar.style.height="".concat(100*a,"%")}if(this.box.$footer){var s=Math.max(26/xu,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){cu(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:uu(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=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&&!hu(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(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)}))),function(e){return t.apply(this,arguments)})},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),wu=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 Xo,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 su({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=uu(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&&!hu(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}(),Tu={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 wu({context:e,whiteboardView:t,box:n,pages:r}).mount();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 _u({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();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 Mu={exports:{}},Eu={},Su={exports:{}},Au={}; +***************************************************************************** */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({},zn),{transform:function(e){return Math.round(qn(e))}});function er(e,t){return e.startsWith(t)&&Fn.test(e)}var tr,nr={test:function(e){return"string"==typeof e?er(e,"rgb"):Zn(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&&Fn.test(e)||Zn(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 Zn(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"}(qr||(qr={})),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"}(Zr||(Zr={})),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?qr.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===qr.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,R=n.draggable,O=void 0===R||R,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,q=n.styles,Z=n.containerRect,J=void 0===Z?{x:0,y:0,width:window.innerWidth,height:window.innerHeight}:Z,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(Zr.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(Zr.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(Zr.Close)}));var ue=te(k);ue.reaction((function(e,n,r){r||t.events.emit(Zr.Readonly,e)}));var le=te(P),ce=te(O),he=te(j),de=te(U),fe=te(H);fe.reaction((function(e,n,r){r||t.events.emit(Zr.ZIndex,e)}));var pe=te(z);pe.reaction((function(e,n,r){r||t.events.emit(e?Zr.Focus:Zr.Blur)}));var ve=te(A);ve.reaction((function(e,n,r){r||t.events.emit(Zr.Minimized,e)}));var me=te(C);me.reaction((function(e,n,r){r||t.events.emit(Zr.Maximized,e)}));var ge=ee([ve,me],(function(e){var t=o(e,2),n=t[0],r=t[1];return n?qr.Minimized:r?qr.Maximized:qr.Normal}));ge.reaction((function(e,n,r){r||t.events.emit(Zr.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(Zr.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(Zr.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(Zr.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(Zr.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(Zr.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(q);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 qr.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case qr.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===qr.Minimized),i===qr.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===qr.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!==qr.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(Zr.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===qr.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===qr.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===qr.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===qr.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?qr.Minimized:r?qr.Maximized:qr.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 R=M(null===m?null:m||new Ti({visible:l,readonly:_,namespace:b}).mount(i));R.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=R.value)?void 0:t.setReadonly(e)})),this._darkMode$.subscribe((function(e){var t;null==(t=R.value)||t.setDarkMode(e)}));var O=function(){var e;if(null!=(e=R.value)&&e.$collector){var n=R.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?O():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=R.value)||i.setVisible(e),e&&null!=(o=R.value)&&o.$collector&&L.setValue(O()),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 Zr.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:R,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 qr.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case qr.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(Z.WindowCreated))}}},{key:"setBoxInitState",value:function(e){var t=this.teleBoxManager.queryOne({id:e});t&&t.state===qr.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=gb.wrapper?gb.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)||gb.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 Ri(e,t){return e!=e?t==t:e!==t||e&&"object"==_(e)||"function"==typeof e}function Oi(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=[],qi=[],Zi=[],Ji=Promise.resolve(),Ki=!1;function $i(e){qi.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,Ri,{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,gb.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=gb.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(Z.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=gb.container)?void 0:e.getBoundingClientRect(),this.wrapperRect=null==(t=gb.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(){var e;return(null==(e=this.manager)?void 0:e.store.getMainViewSceneIndex())||0}},{key:"length",get:function(){var e;return(null==(e=this.manager)?void 0:e.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);!Ro(i,o)&&r||Object.defineProperty(e,n,o)}},Ro=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)},Oo=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 Oo(e,t),Uo(e,t,a),e}var zo="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Go=zo.length,Ho=Array(20),Vo=function(){for(var e=0;e<20;e++)Ho[e]=zo.charAt(Math.random()*Go);return Ho.join("")};function Wo(e){try{return e()}catch(e){console.error(e)}}var Yo,Xo=function(){function e(){y(this,e),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)?function(){return e.forEach(Wo)}:e),t}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.genUID();return this.addDisposer(e(),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(Wo),this.disposers.clear()}},{key:"genUID",value:function(){var e;do{e=Vo()}while(this.disposers.has(e));return e}}]),e}(),Qo=[],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,Jo=function(e){return Object.freeze(e)},Ko=function(e,t){this.inlineSize=e,this.blockSize=t,Jo(this)},$o=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,Jo(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}(),ea=function(e){return e instanceof SVGElement&&"getBBox"in e},ta=function(e){if(ea(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)},na=function(e){var t,n;if(e instanceof Element)return!0;var r=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&e instanceof r.Element)},ra="undefined"!=typeof window?window:{},ia=new WeakMap,oa=/auto|scroll/,aa=/^tb|vertical/,sa=/msie|trident/i.test(ra.navigator&&ra.navigator.userAgent),ua=function(e){return parseFloat(e||"0")},la=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Ko((n?t:e)||0,(n?e:t)||0)},ca=Jo({devicePixelContentBoxSize:la(),borderBoxSize:la(),contentBoxSize:la(),contentRect:new $o(0,0,0,0)}),ha=function(e,t){if(void 0===t&&(t=!1),ia.has(e)&&!t)return ia.get(e);if(ta(e))return ia.set(e,ca),ca;var n=getComputedStyle(e),r=ea(e)&&e.ownerSVGElement&&e.getBBox(),i=!sa&&"border-box"===n.boxSizing,o=aa.test(n.writingMode||""),a=!r&&oa.test(n.overflowY||""),s=!r&&oa.test(n.overflowX||""),u=r?0:ua(n.paddingTop),l=r?0:ua(n.paddingRight),c=r?0:ua(n.paddingBottom),h=r?0:ua(n.paddingLeft),d=r?0:ua(n.borderTopWidth),f=r?0:ua(n.borderRightWidth),p=r?0:ua(n.borderBottomWidth),v=h+l,m=u+c,g=(r?0:ua(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:ua(n.width)-_-x,M=r?r.height:ua(n.height)-w-b,S=T+v+x+g,E=M+m+b+y,A=Jo({devicePixelContentBoxSize:la(Math.round(T*devicePixelRatio),Math.round(M*devicePixelRatio),o),borderBoxSize:la(S,E,o),contentBoxSize:la(T,M,o),contentRect:new $o(h,u,T,M)});return ia.set(e,A),A},da=function(e,t,n){var r=ha(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}},fa=function(e){var t=ha(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Jo([t.borderBoxSize]),this.contentBoxSize=Jo([t.contentBoxSize]),this.devicePixelContentBoxSize=Jo([t.devicePixelContentBoxSize])},pa=function(e){if(ta(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},va=function(){var e=1/0,t=[];Qo.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new fa(t.target),i=pa(t.target);r.push(n),t.lastReportedSize=da(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},ga=function(){var e=0;for(ma(e);Qo.some((function(e){return e.activeTargets.length>0}));)e=va(),ma(e);return Qo.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},ya=[],ba=function(e){if(!Zo){var t=0,n=document.createTextNode("");new MutationObserver((function(){return ya.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Zo=function(){n.textContent=""+(t?t--:t++)}}ya.push(e),Zo()},xa=0,_a={attributes:!0,characterData:!0,childList:!0,subtree:!0},wa=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ta=function(e){return void 0===e&&(e=0),Date.now()+e},Ma=!1,Sa=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),!Ma){Ma=!0;var n=Ta(e);!function(e){ba((function(){requestAnimationFrame(e)}))}((function(){var r=!1;try{r=ga()}finally{if(Ma=!1,e=n-Ta(),!xa)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,_a)};document.body?t():ra.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),wa.forEach((function(t){return ra.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),wa.forEach((function(t){return ra.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}(),Ea=new Sa,Aa=function(e){!xa&&e>0&&Ea.start(),!(xa+=e)&&Ea.stop()},Ia=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=da(this.target,this.observedBox,!0);return function(e){return!ea(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}(),Ca=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Na=new WeakMap,ka=function(e,t){for(var n=0;n=0&&(i&&Qo.splice(Qo.indexOf(n),1),n.observationTargets.splice(r,1),Aa(-1))},e.disconnect=function(e){var t=this,n=Na.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Pa=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.");Da.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(!na(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Da.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(!na(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Da.unobserve(this,e)},e.prototype.disconnect=function(){Da.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();var Ra="undefined"!=typeof window,Oa=Ra&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),La=Ra&&"IntersectionObserver"in window,ja=Ra&&"classList"in document.createElement("p"),Ba=Ra&&window.devicePixelRatio>1,Ua={elements_selector:".lazy",container:Oa||Ra?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},Fa=function(e){return Object.assign({},Ua,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)},Ga="src",Ha="srcset",Va="sizes",Wa="poster",Ya="llOriginalAttrs",Xa="data",Qa="loading",qa="loaded",Za="applied",Ja="error",Ka="native",$a="data-",es="ll-status",ts=function(e,t){return e.getAttribute($a+t)},ns=function(e){return ts(e,es)},rs=function(e,t){return function(e,t,n){var r=$a+t;null!==n?e.setAttribute(r,n):e.removeAttribute(r)}(e,es,t)},is=function(e){return rs(e,null)},os=function(e){return null===ns(e)},as=function(e){return ns(e)===Ka},ss=[Qa,qa,Za,Ja],us=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)}},ls=function(e,t){ja?e.classList.add(t):e.className+=(e.className?" ":"")+t},cs=function(e,t){ja?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},hs=function(e){return e.llTempImage},ds=function(e,t){if(t){var n=t._observer;!n||n.unobserve(e)}},fs=function(e,t){!e||(e.loadingCount+=t)},ps=function(e,t){!e||(e.toLoadCount=t)},vs=function(e){for(var t,n=[],r=0;t=e.children[r];r+=1)"SOURCE"===t.tagName&&n.push(t);return n},ms=function(e,t){var n=e.parentNode;n&&"PICTURE"===n.tagName&&vs(n).forEach(t)},gs=function(e,t){vs(e).forEach(t)},ys=[Ga],bs=[Ga,Wa],xs=[Ga,Ha,Va],_s=[Xa],ws=function(e){return!!e[Ya]},Ts=function(e){return e[Ya]},Ms=function(e){return delete e[Ya]},Ss=function(e,t){if(!ws(e)){var n={};t.forEach((function(t){n[t]=e.getAttribute(t)})),e[Ya]=n}},Es=function(e,t){if(ws(e)){var n=Ts(e);t.forEach((function(t){!function(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}(e,t,n[t])}))}},As=function(e,t,n){ls(e,t.class_applied),rs(e,Za),n&&(t.unobserve_completed&&ds(e,t),us(t.callback_applied,e,n))},Is=function(e,t,n){ls(e,t.class_loading),rs(e,Qa),n&&(fs(n,1),us(t.callback_loading,e,n))},Cs=function(e,t,n){!n||e.setAttribute(t,n)},Ns=function(e,t){Cs(e,Va,ts(e,t.data_sizes)),Cs(e,Ha,ts(e,t.data_srcset)),Cs(e,Ga,ts(e,t.data_src))},ks={IMG:function(e,t){ms(e,(function(e){Ss(e,xs),Ns(e,t)})),Ss(e,xs),Ns(e,t)},IFRAME:function(e,t){Ss(e,ys),Cs(e,Ga,ts(e,t.data_src))},VIDEO:function(e,t){gs(e,(function(e){Ss(e,ys),Cs(e,Ga,ts(e,t.data_src))})),Ss(e,bs),Cs(e,Wa,ts(e,t.data_poster)),Cs(e,Ga,ts(e,t.data_src)),e.load()},OBJECT:function(e,t){Ss(e,_s),Cs(e,Xa,ts(e,t.data_src))}},Ds=["IMG","IFRAME","VIDEO","OBJECT"],Ps=function(e,t){t&&!function(e){return e.loadingCount>0}(t)&&!function(e){return e.toLoadCount>0}(t)&&us(e.callback_finish,t)},Rs=function(e,t,n){e.addEventListener(t,n),e.llEvLisnrs[t]=n},Os=function(e,t,n){e.removeEventListener(t,n)},Ls=function(e){return!!e.llEvLisnrs},js=function(e){if(Ls(e)){var t=e.llEvLisnrs;for(var n in t){var r=t[n];Os(e,n,r)}delete e.llEvLisnrs}},Bs=function(e,t,n){(function(e){delete e.llTempImage})(e),fs(n,-1),function(e){!e||(e.toLoadCount-=1)}(n),cs(e,t.class_loading),t.unobserve_completed&&ds(e,n)},Us=function(e,t,n){var r=hs(e)||e;Ls(r)||function(e,t,n){Ls(e)||(e.llEvLisnrs={});var r="VIDEO"===e.tagName?"loadeddata":"load";Rs(e,r,t),Rs(e,"error",n)}(r,(function(i){(function(e,t,n,r){var i=as(t);Bs(t,n,r),ls(t,n.class_loaded),rs(t,qa),us(n.callback_loaded,t,r),i||Ps(n,r)})(0,e,t,n),js(r)}),(function(i){(function(e,t,n,r){var i=as(t);Bs(t,n,r),ls(t,n.class_error),rs(t,Ja),us(n.callback_error,t,r),n.restore_on_error&&Es(t,xs),i||Ps(n,r)})(0,e,t,n),js(r)}))},Fs=function(e,t,n){(function(e){e.llTempImage=document.createElement("IMG")})(e),Us(e,t,n),function(e){ws(e)||(e[Ya]={backgroundImage:e.style.backgroundImage})}(e),function(e,t,n){var r=ts(e,t.data_bg),i=ts(e,t.data_bg_hidpi),o=Ba&&i?i:r;!o||(e.style.backgroundImage='url("'.concat(o,'")'),hs(e).setAttribute(Ga,o),Is(e,t,n))}(e,t,n),function(e,t,n){var r=ts(e,t.data_bg_multi),i=ts(e,t.data_bg_multi_hidpi),o=Ba&&i?i:r;!o||(e.style.backgroundImage=o,As(e,t,n))}(e,t,n),function(e,t,n){var r=ts(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()),As(e,t,n)}}(e,t,n)},zs=function(e,t,n){Us(e,t,n),function(e,t,n){var r=ks[e.tagName];!r||(r(e,t),Is(e,t,n))}(e,t,n)},Gs=function(e,t,n){!function(e){return Ds.indexOf(e.tagName)>-1}(e)?Fs(e,t,n):zs(e,t,n)},Hs=function(e,t,n){e.setAttribute("loading","lazy"),Us(e,t,n),function(e,t){var n=ks[e.tagName];!n||n(e,t)}(e,t),rs(e,Ka)},Vs=function(e){e.removeAttribute(Ga),e.removeAttribute(Ha),e.removeAttribute(Va)},Ws=function(e){ms(e,(function(e){Es(e,xs)})),Es(e,xs)},Ys={IMG:Ws,IFRAME:function(e){Es(e,ys)},VIDEO:function(e){gs(e,(function(e){Es(e,ys)})),Es(e,bs),e.load()},OBJECT:function(e){Es(e,_s)}},Xs=function(e){var t=Ys[e.tagName];t?t(e):function(e){if(ws(e)){var t=Ts(e);e.style.backgroundImage=t.backgroundImage}}(e)},Qs=function(e,t){Xs(e),function(e,t){os(e)||as(e)||(cs(e,t.class_entered),cs(e,t.class_exited),cs(e,t.class_applied),cs(e,t.class_loading),cs(e,t.class_loaded),cs(e,t.class_error))}(e,t),is(e),Ms(e)},qs=function(e,t,n,r){!n.cancel_on_exit||!function(e){return ns(e)===Qa}(e)||"IMG"===e.tagName&&(js(e),function(e){ms(e,(function(e){Vs(e)})),Vs(e)}(e),Ws(e),cs(e,n.class_loading),fs(r,-1),is(e),us(n.callback_cancel,e,t,r))},Zs=function(e,t,n,r){var i=function(e){return ss.indexOf(ns(e))>=0}(e);rs(e,"entered"),ls(e,n.class_entered),cs(e,n.class_exited),function(e,t,n){t.unobserve_entered&&ds(e,n)}(e,n,r),us(n.callback_enter,e,t,r),!i&&Gs(e,n,r)},Js=["IMG","IFRAME","VIDEO"],Ks=function(e){return e.use_native&&"loading"in HTMLImageElement.prototype},$s=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){os(e)||(ls(e,n.class_exited),qs(e,t,n,r),us(n.callback_exit,e,t,r))}(e.target,e,t,n)}))},eu=function(e,t){!La||Ks(e)||(t._observer=new IntersectionObserver((function(n){$s(n,e,t)}),function(e){return{root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}}(e)))},tu=function(e){return Array.prototype.slice.call(e)},nu=function(e){return e.container.querySelectorAll(e.elements_selector)},ru=function(e){return function(e){return ns(e)===Ja}(e)},iu=function(e,t){return function(e){return tu(e).filter(os)}(e||nu(t))},ou=function(e,t){(function(e){return tu(e).filter(ru)})(nu(e)).forEach((function(t){cs(t,e.class_error),is(t)})),t.update()},au=function(e,t){var n=Fa(e);this._settings=n,this.loadingCount=0,eu(n,this),function(e,t){!Ra||(t._onlineHandler=function(){ou(e,t)},window.addEventListener("online",t._onlineHandler))}(n,this),this.update(t)};au.prototype={update:function(e){var t=this._settings,n=iu(e,t);ps(this,n.length),!Oa&&La?Ks(t)?function(e,t,n){e.forEach((function(e){-1!==Js.indexOf(e.tagName)&&Hs(e,t,n)})),ps(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){!Ra||window.removeEventListener("online",e._onlineHandler)}(this),nu(this._settings).forEach((function(e){Ms(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;iu(e,n).forEach((function(e){ds(e,t),Gs(e,n,t)}))},restoreAll:function(){var e=this._settings;nu(e).forEach((function(t){Qs(t,e)}))}},au.load=function(e,t){var n=Fa(t);Gs(e,n)},au.resetStatus=function(e){is(e)},Ra&&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)}(au,window.lazyLoadOptions);var su=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 Xo,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.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 au({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))}},{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 uu(e,t,n){return Math.min(Math.max(e,t),n)}function lu(e){return e.touches?e.touches[0]:e}function cu(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function hu(e){if(!e)return!1;var t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}var du=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}(),fu=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}(),pu=window.requestIdleCallback||function(e){return window.setTimeout(e,5e3)},vu=window.cancelIdleCallback||window.clearTimeout,mu=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=pu(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&&(vu(this.gcTimer),this.gcTimer=null)}}]),e}(),gu=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 mu(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=uu(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 uu(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}(),yu=function(){function e(t){y(this,e),this.sideEffect=new Xo,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=uu(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)){cu(n);var r=e.wrapClassName("scrollbar-dragging");t.classList.toggle(r,!0);var i=e.pagesScrollTop,o=lu(n).clientY,a=function(t){if(!e.readonly){var n=(lu(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 uu(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}(),bu=window.ResizeObserver||Pa,xu=640,_u=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 Xo,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="".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 su({readonly:a,box:s,pages:u,onNewPageIndex:this.onNewPageIndex});var m=this.whiteboardView.size,b=m.width,x=m.height;this.pageRenderer=new gu({pagesScrollTop:c,pages:this.pages,containerWidth:b,containerHeight:x,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new yu({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 du({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 bu(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<=xu;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/xu,26/e);this.box.$titleBar.style.height="".concat(100*a,"%")}if(this.box.$footer){var s=Math.max(26/xu,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){cu(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:uu(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=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&&!hu(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(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)}))),function(e){return t.apply(this,arguments)})},{key:"reportProgress",value:function(e,t){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:e,result:t})}}]),e}(),wu=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 Xo,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 su({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=uu(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&&!hu(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}(),Tu={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 wu({context:e,whiteboardView:t,box:n,pages:r}).mount();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 _u({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();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 Mu={exports:{}},Su={},Eu={exports:{}},Au={}; /** @license React v0.19.1 * scheduler.production.min.js * @@ -297,7 +298,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=E(C);null!==t;){if(null===t.callback)S(C);else{if(!(t.startTime<=e))break;S(C),t.sortIndex=t.expirationTime,M(I,t)}t=E(C)}}function j(e){if(R=!1,L(e),!O)if(null!==E(I))O=!0,t(B);else{var r=E(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=E(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===E(I)&&S(I),L(o)}else S(I);k=E(I)}if(null!==k)var l=!0;else{var c=E(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 E(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===E(I)&&i===E(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=E(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,R=!1,O=!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(O=!1,L(e),!R)if(null!==S(I))R=!0,t(B);else{var r=S(C);null!==r&&n(j,r.startTime-e)}}function B(t,o){R=!1,O&&(O=!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(){R||P||(R=!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)&&(O?r():O=!0,n(j,u-s))):(i.sortIndex=a,M(I,i),R||P||(R=!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 yl(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 bl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){bl[e]=new yl(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];bl[t]=new yl(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){bl[e]=new yl(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){bl[e]=new yl(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){bl[e]=new yl(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){bl[e]=new yl(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){bl[e]=new yl(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){bl[e]=new yl(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){bl[e]=new yl(e,5,!1,e.toLowerCase(),null,!1)}));var xl=/[\-:]([a-z])/g;function _l(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(xl,_l);bl[t]=new yl(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(xl,_l);bl[t]=new yl(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(xl,_l);bl[t]=new yl(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){bl[e]=new yl(e,1,!1,e.toLowerCase(),null,!1)})),bl.xlinkHref=new yl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){bl[e]=new yl(e,1,!1,e.toLowerCase(),null,!0)}));var wl=Iu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Tl(e,t,n,r){var i=bl.hasOwnProperty(t)?bl[t]:null;(null!==i?0===i.type:!r&&!(!(2=n.length))throw Error(ku(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Vl(n)}}function ic(e,t){var n=Vl(t.value),r=Vl(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 oc(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var ac="http://www.w3.org/1999/xhtml",sc="http://www.w3.org/2000/svg";function uc(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 lc(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?uc(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var cc,hc=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!==sc||"innerHTML"in e)e.innerHTML=t;else{for((cc=cc||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=cc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function dc(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 fc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var pc={animationend:fc("Animation","AnimationEnd"),animationiteration:fc("Animation","AnimationIteration"),animationstart:fc("Animation","AnimationStart"),transitionend:fc("Transition","TransitionEnd")},vc={},mc={};function gc(e){if(vc[e])return vc[e];if(!pc[e])return e;var t,n=pc[e];for(t in n)if(n.hasOwnProperty(t)&&t in mc)return vc[e]=n[t];return e}Ku&&(mc=document.createElement("div").style,"AnimationEvent"in window||(delete pc.animationend.animation,delete pc.animationiteration.animation,delete pc.animationstart.animation),"TransitionEvent"in window||delete pc.transitionend.transition);var yc=gc("animationend"),bc=gc("animationiteration"),xc=gc("animationstart"),_c=gc("transitionend"),wc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tc=new("function"==typeof WeakMap?WeakMap:Map);function Mc(e){var t=Tc.get(e);return void 0===t&&(t=new Map,Tc.set(e,t)),t}function Ec(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 Ac(e){if(Ec(e)!==e)throw Error(ku(188))}function Ic(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ec(e)))throw Error(ku(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 Ac(i),e;if(o===r)return Ac(i),t;o=o.sibling}throw Error(ku(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(ku(189))}}if(n.alternate!==r)throw Error(ku(190))}if(3!==n.tag)throw Error(ku(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 Cc(e,t){if(null==t)throw Error(ku(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 Nc(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var kc=null;function Dc(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;rLc.length&&Lc.push(e)}function Bc(e,t,n,r){if(Lc.length){var i=Lc.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 Uc(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=td(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=Lh(r)}}function Bh(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Bh(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Uh(){for(var e=window,t=Rh();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=Rh((e=t.contentWindow).document)}return t}function Fh(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="$?",Gh="$!",Hh=null,Vh=null;function Wh(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Yh(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 Xh="function"==typeof setTimeout?setTimeout:void 0,Qh="function"==typeof clearTimeout?clearTimeout:void 0;function Zh(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function qh(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||n===Gh||n===zh){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Jh=Math.random().toString(36).slice(2),Kh="__reactInternalInstance$"+Jh,$h="__reactEventHandlers$"+Jh,ed="__reactContainere$"+Jh;function td(e){var t=e[Kh];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ed]||n[Kh]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=qh(e);null!==e;){if(n=e[Kh])return n;e=qh(e)}return t}n=(e=n).parentNode}return null}function nd(e){return!(e=e[Kh]||e[ed])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function rd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(ku(33))}function id(e){return e[$h]||null}function od(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function ad(e,t){var n=e.stateNode;if(!n)return null;var r=Uu(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(ku(231,t,_(n)));return n}function sd(e,t,n){(t=ad(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=Cc(n._dispatchListeners,t),n._dispatchInstances=Cc(n._dispatchInstances,e))}function ud(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=od(t);for(t=n.length;0this.eventPool.length&&this.eventPool.push(e)}function _d(e){e.eventPool=[],e.getPooled=bd,e.release=xd}Cu(yd.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=md)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=md)},persist:function(){this.isPersistent=md},isPersistent:gd,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=gd,this._dispatchInstances=this._dispatchListeners=null}}),yd.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},yd.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return Cu(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=Cu({},r.Interface,e),n.extend=r.extend,_d(n),n},_d(yd);var wd=yd.extend({data:null}),Td=yd.extend({data:null}),Md=[9,13,27,32],Ed=Ku&&"CompositionEvent"in window,Sd=null;Ku&&"documentMode"in document&&(Sd=document.documentMode);var Ad=Ku&&"TextEvent"in window&&!Sd,Id=Ku&&(!Ed||Sd&&8=Sd),Cd=String.fromCharCode(32),Nd={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(" ")}},kd=!1;function Dd(e,t){switch(e){case"keyup":return-1!==Md.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Pd(e){return"object"==_(e=e.detail)&&"data"in e?e.data:null}var Od=!1;var Rd={eventTypes:Nd,extractEvents:function(e,t,n,r){var i;if(Ed)e:{switch(e){case"compositionstart":var o=Nd.compositionStart;break e;case"compositionend":o=Nd.compositionEnd;break e;case"compositionupdate":o=Nd.compositionUpdate;break e}o=void 0}else Od?Dd(e,n)&&(o=Nd.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=Nd.compositionStart);return o?(Id&&"ko"!==n.locale&&(Od||o!==Nd.compositionStart?o===Nd.compositionEnd&&Od&&(i=vd()):(fd="value"in(dd=r)?dd.value:dd.textContent,Od=!0)),o=wd.getPooled(o,t,n,r),i?o.data=i:null!==(i=Pd(n))&&(o.data=i),hd(o),i=o):i=null,(e=Ad?function(e,t){switch(e){case"compositionend":return Pd(t);case"keypress":return 32!==t.which?null:(kd=!0,Cd);case"textInput":return(e=t.data)===Cd&&kd?null:e;default:return null}}(e,n):function(e,t){if(Od)return"compositionend"===e||!Ed&&Dd(e,t)?(e=vd(),pd=fd=dd=null,Od=!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,mf={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},gf=null,yf=null,bf=null,xf=!1;function _f(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return xf||null==gf||gf!==Rh(n)?null:("selectionStart"in(n=gf)&&Fh(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},bf&&pf(bf,n)?null:(bf=n,(e=yd.getPooled(mf.select,yf,e,t)).type="select",e.target=gf,hd(e),e))}var wf={eventTypes:mf,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=Mc(i),o=qu.onSelect;for(var a=0;aLf||(e.current=Rf[Lf],Rf[Lf]=null,Lf--)}function Bf(e,t){Lf++,Rf[Lf]=e.current,e.current=t}var Uf={},Ff={current:Uf},zf={current:!1},Gf=Uf;function Hf(e,t){var n=e.type.contextTypes;if(!n)return Uf;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 Vf(e){return null!=(e=e.childContextTypes)}function Wf(){jf(zf),jf(Ff)}function Yf(e,t,n){if(Ff.current!==Uf)throw Error(ku(168));Bf(Ff,t),Bf(zf,n)}function Xf(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(ku(108,Gl(t)||"Unknown",i));return Cu({},n,{},r)}function Qf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Uf,Gf=Ff.current,Bf(Ff,e),Bf(zf,zf.current),!0}function Zf(e,t,n){var r=e.stateNode;if(!r)throw Error(ku(169));n?(e=Xf(e,t,Gf),r.__reactInternalMemoizedMergedChildContext=e,jf(zf),jf(Ff),Bf(Ff,e)):jf(zf),Bf(zf,n)}var qf=Nu.unstable_runWithPriority,Jf=Nu.unstable_scheduleCallback,Kf=Nu.unstable_cancelCallback,$f=Nu.unstable_requestPaint,ep=Nu.unstable_now,tp=Nu.unstable_getCurrentPriorityLevel,np=Nu.unstable_ImmediatePriority,rp=Nu.unstable_UserBlockingPriority,ip=Nu.unstable_NormalPriority,op=Nu.unstable_LowPriority,ap=Nu.unstable_IdlePriority,sp={},up=Nu.unstable_shouldYield,lp=void 0!==$f?$f:function(){},cp=null,hp=null,dp=!1,fp=ep(),pp=1e4>fp?ep:function(){return ep()-fp};function vp(){switch(tp()){case np:return 99;case rp:return 98;case ip:return 97;case op:return 96;case ap:return 95;default:throw Error(ku(332))}}function mp(e){switch(e){case 99:return np;case 98:return rp;case 97:return ip;case 96:return op;case 95:return ap;default:throw Error(ku(332))}}function gp(e,t){return e=mp(e),qf(e,t)}function yp(e,t,n){return e=mp(e),Jf(e,t,n)}function bp(e){return null===cp?(cp=[e],hp=Jf(np,_p)):cp.push(e),sp}function xp(){if(null!==hp){var e=hp;hp=null,Kf(e)}_p()}function _p(){if(!dp&&null!==cp){dp=!0;var e=0;try{var t=cp;gp(99,(function(){for(;e=t&&(im=!0),e.firstContext=null)}function Dp(e,t){if(Ap!==e&&!1!==t&&0!==t)if(("number"!=typeof t||1073741823===t)&&(Ap=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Sp){if(null===Ep)throw Error(ku(308));Sp=t,Ep.dependencies={expirationTime:0,firstContext:t,responders:null}}else Sp=Sp.next=t;return e._currentValue}var Pp=!1;function Op(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function Rp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Lp(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function jp(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 Bp(e,t){var n=e.alternate;null!==n&&Rp(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function Up(e,t,n,r){var i=e.updateQueue;Pp=!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}),jg(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=Cu({},u,a);break e;case 2:Pp=!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,Bg(l),e.expirationTime=l,e.memoizedState=u}}function Fp(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&&Jp(s,l),void 0===l&&!p)switch(s.tag){case 1:case 0:throw s=s.type,Error(ku(152,s.displayName||s.name||"Component"))}return n(s,u)}}var $p=Kp(!0),ev=Kp(!1),tv={},nv={current:tv},rv={current:tv},iv={current:tv};function ov(e){if(e===tv)throw Error(ku(174));return e}function av(e,t){switch(Bf(iv,t),Bf(rv,e),Bf(nv,tv),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:lc(null,"");break;default:t=lc(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}jf(nv),Bf(nv,t)}function sv(){jf(nv),jf(rv),jf(iv)}function uv(e){ov(iv.current);var t=ov(nv.current),n=lc(t,e.type);t!==n&&(Bf(rv,e),Bf(nv,n))}function lv(e){rv.current===e&&(jf(nv),jf(rv))}var cv={current:0};function hv(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===Gh))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 dv(e,t){return{responder:e,props:t}}var fv=wl.ReactCurrentDispatcher,pv=wl.ReactCurrentBatchConfig,vv=0,mv=null,gv=null,yv=null,bv=!1;function xv(){throw Error(ku(321))}function _v(e,t){if(null===t)return!1;for(var n=0;no))throw Error(ku(301));o+=1,yv=gv=null,t.updateQueue=null,fv.current=Xv,e=n(r,i)}while(t.expirationTime===vv)}if(fv.current=Vv,t=null!==gv&&null!==gv.next,vv=0,yv=gv=mv=null,bv=!1,t)throw Error(ku(300));return e}function Tv(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===yv?mv.memoizedState=yv=e:yv=yv.next=e,yv}function Mv(){if(null===gv){var e=mv.alternate;e=null!==e?e.memoizedState:null}else e=gv.next;var t=null===yv?mv.memoizedState:yv.next;if(null!==t)yv=t,gv=e;else{if(null===e)throw Error(ku(310));e={memoizedState:(gv=e).memoizedState,baseState:gv.baseState,baseQueue:gv.baseQueue,queue:gv.queue,next:null},null===yv?mv.memoizedState=yv=e:yv=yv.next=e}return yv}function Ev(e,t){return"function"==typeof t?t(e):t}function Sv(e){var t=Mv(),n=t.queue;if(null===n)throw Error(ku(311));n.lastRenderedReducer=e;var r=gv,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(lmv.expirationTime&&(mv.expirationTime=l,Bg(l))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:u.suspenseConfig,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),jg(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,df(r,t.memoizedState)||(im=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Av(e){var t=Mv(),n=t.queue;if(null===n)throw Error(ku(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);df(o,t.memoizedState)||(im=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Iv(e){var t=Tv();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Ev,lastRenderedState:e}).dispatch=Hv.bind(null,mv,e),[t.memoizedState,e]}function Cv(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=mv.updateQueue)?(t={lastEffect:null},mv.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 Nv(){return Mv().memoizedState}function kv(e,t,n,r){var i=Tv();mv.effectTag|=e,i.memoizedState=Cv(1|t,n,void 0,void 0===r?null:r)}function Dv(e,t,n,r){var i=Mv();r=void 0===r?null:r;var o=void 0;if(null!==gv){var a=gv.memoizedState;if(o=a.destroy,null!==r&&_v(r,a.deps))return void Cv(t,n,o,r)}mv.effectTag|=e,i.memoizedState=Cv(1|t,n,o,r)}function Pv(e,t){return kv(516,4,e,t)}function Ov(e,t){return Dv(516,4,e,t)}function Rv(e,t){return Dv(4,2,e,t)}function Lv(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 jv(e,t,n){return n=null!=n?n.concat([e]):null,Dv(4,2,Lv.bind(null,t,e),n)}function Bv(){}function Uv(e,t){return Tv().memoizedState=[e,void 0===t?null:t],e}function Fv(e,t){var n=Mv();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&_v(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function zv(e,t){var n=Mv();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&_v(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Gv(e,t,n){var r=vp();gp(98>r?98:r,(function(){e(!0)})),gp(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[Kh]=t,e[$h]=r,pm(e,t),t.stateNode=e,a=kh(i,r),i){case"iframe":case"object":case"embed":bh("load",e),s=r;break;case"video":case"audio":for(s=0;sr.tailExpiration&&1t)&&xg.set(e,t))}}function Ag(e,t){e.expirationTime=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Cg(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=bp(kg.bind(null,e));else{var t=Ig(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Mg();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!==sp&&Kf(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?bp(kg.bind(null,e)):yp(r,Ng.bind(null,e),{timeout:10*(1073741821-t)-pp()}),e.callbackNode=t}}}function Ng(e,t){if(Tg=0,t)return fy(e,t=Mg()),Cg(e),null;var n=Ig(e);if(0!==n){if(t=e.callbackNode,0!=(48&tg))throw Error(ku(327));if(Xg(),e===ng&&n===ig||Og(e,n),null!==rg){var r=tg;tg|=qm;for(var i=Lg();;)try{Fg();break}catch(t){Rg(e,t)}if(Ip(),tg=r,Qm.current=i,1===og)throw t=ag,Og(e,n),hy(e,n),Cg(e),t;if(null===rg)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=og,ng=null,r){case Km:case 1:throw Error(ku(345));case 2:fy(e,2=n){e.lastPingedTime=n,Og(e,n);break}}if(0!==(o=Ig(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=Xh(Vg.bind(null,e),i);break}Vg(e);break;case eg:if(hy(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Hg(i)),hg&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,Og(e,n);break}if(0!==(i=Ig(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==ug?r=10*(1073741821-ug)-pp():1073741823===sg?r=0:(r=10*(1073741821-sg)-5e3,0>(r=(i=pp())-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*Xm(r/1960))-r)&&(r=n)),10=(r=0|a.busyMinDurationMs)?r=0:(i=0|a.busyDelayMs,r=(o=pp()-(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."+Hl(a))}5!==og&&(og=2),s=Sm(s,a),h=o;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=t,Bp(h,Vm(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===mg||!mg.has(w)))){h.effectTag|=4096,h.expirationTime=t,Bp(h,Wm(h,u,t));break e}}h=h.return}while(null!==h)}rg=Gg(rg)}catch(e){t=e;continue}break}}function Lg(){var e=Qm.current;return Qm.current=Vv,null===e?Vv:e}function jg(e,t){ecg&&(cg=e)}function Ug(){for(;null!==rg;)rg=zg(rg)}function Fg(){for(;null!==rg&&!up();)rg=zg(rg)}function zg(e){var t=Ym(e.alternate,e,ig);return e.memoizedProps=e.pendingProps,null===t&&(t=Gg(e)),Zm.current=null,t}function Gg(e){rg=e;do{var t=rg.alternate;if(e=rg.return,0==(2048&rg.effectTag)){if(t=Mm(t,rg,ig),1===ig||1!==rg.childExpirationTime){for(var n=0,r=rg.child;null!==r;){var i=r.expirationTime,o=r.childExpirationTime;i>n&&(n=i),o>n&&(n=o),r=r.sibling}rg.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=rg.firstEffect),null!==rg.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=rg.firstEffect),e.lastEffect=rg.lastEffect),1(e=e.childExpirationTime)?t:e}function Vg(e){var t=vp();return gp(99,Wg.bind(null,e,t)),null}function Wg(e,t){do{Xg()}while(null!==yg);if(0!=(48&tg))throw Error(ku(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(ku(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Hg(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===ng&&(rg=ng=null,ig=0),1s&&(l=s,s=a,a=l),l=jh(b,a),c=jh(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?ym(e,t,n):(Bf(cv,1&cv.current),null!==(t=wm(e,t,n))?t.sibling:null);Bf(cv,1&cv.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return _m(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),Bf(cv,cv.current),!r)return null}return wm(e,t,n)}im=!1}}else im=!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=Hf(t,Ff.current),kp(t,n),i=wv(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,Vf(r)){var o=!0;Qf(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Op(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&Hp(t,r,a,e),i.updater=Vp,t.stateNode=i,i._reactInternalFiber=t,Qp(t,r,e,n),t=dm(null,t,r,!0,o,n)}else t.tag=0,om(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 ry(e)?1:0;if(null!=e){if((e=e.$$typeof)===Ol)return 11;if(e===jl)return 14}return 2}(i),e=Tp(i,e),o){case 0:t=cm(null,t,i,e,n);break e;case 1:t=hm(null,t,i,e,n);break e;case 11:t=am(null,t,i,e,n);break e;case 14:t=sm(null,t,i,Tp(i.type,e),r,n);break e}throw Error(ku(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,cm(e,t,r,i=t.elementType===r?i:Tp(r,i),n);case 1:return r=t.type,i=t.pendingProps,hm(e,t,r,i=t.elementType===r?i:Tp(r,i),n);case 3:if(fm(t),r=t.updateQueue,null===e||null===r)throw Error(ku(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,Rp(e,t),Up(t,r,null,n),(r=t.memoizedState.element)===i)nm(),t=wm(e,t,n);else{if((i=t.stateNode.hydrate)&&(Zv=Zh(t.stateNode.containerInfo.firstChild),Qv=t,i=qv=!0),i)for(n=ev(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else om(e,t,r,n),nm();t=t.child}return t;case 5:return uv(t),null===e&&$v(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,Yh(r,i)?a=null:null!==o&&Yh(r,o)&&(t.effectTag|=16),lm(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(om(e,t,a,n),t=t.child),t;case 6:return null===e&&$v(t),null;case 13:return ym(e,t,n);case 4:return av(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=$p(t,null,r,n):om(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,am(e,t,r,i=t.elementType===r?i:Tp(r,i),n);case 7:return om(e,t,t.pendingProps,n),t.child;case 8:case 12:return om(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(Bf(Mp,s._currentValue),s._currentValue=o,null!==a)if(s=a.value,0===(o=df(s,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,o):1073741823))){if(a.children===i.children&&!zf.current){t=wm(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=Lp(n,null)).tag=2,jp(s,l)),s.expirationTime=t&&e<=t}function hy(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 dy(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 fy(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function py(e,t,n,r){var i=t.current,o=Mg(),a=zp.suspense;o=Eg(o,i,a);e:if(n){t:{if(Ec(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(ku(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(Vf(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(ku(171))}if(1===n.tag){var u=n.type;if(Vf(u)){n=Xf(n,u,s);break e}}n=s}else n=Uf;return null===t.context?t.context=n:t.pendingContext=n,(t=Lp(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),jp(i,t),Sg(i,o),o}function vy(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function my(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=t||n<0||h&&e-l>=o}function m(){var e,n,r=rb();if(v(r))return g(r);s=setTimeout(m,(n=t-((e=r)-u),h?ob(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=rb(),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=nb(t)||0,Jy(n)&&(c=!!n.leading,o=(h="maxWait"in n)?ib(nb(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(rb())},y}var sb=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),ub=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=ab((function(e){r.props.setCurrentTime(e)}),50),r.onVolumeChange=function(e){r.changeVolume(e),r.setState({seekVolume:e/100})},r.changeVolume=ab((function(e){r.props.setVolume(e/100)}),50),r.onVolumeSeekStart=function(){r.onVolumeSeeking=!0},r.onVolumeSeekEnd=ab((function(){r.onVolumeSeeking=!1}),500),r.onProgressSeekStart=function(){return r.setState({isPlayerSeeking:!0})},r.onProgressSeekEnd=ab((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(sb,{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(sb,{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"},lb(Math.floor(r/1e3))," /"," ",lb(Math.floor(n/1e3)))))}}]),n}(mt.exports.Component);function lb(e){var t=e%60,n=(e-t)/60;if(n>=60){var r=n%60;return"".concat(cb((n-r)/60),":").concat(cb(r),":").concat(cb(t))}return"".concat(cb(n),":").concat(cb(t))}function cb(e){return e<=9?"0".concat(e):"".concat(e)}var hb=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(db,{room:t,player:n,context:e,plugin:{putAttributes:r}})}}]),n}(mt.exports.Component),db=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=Ly(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=Ly(t,r.props),o=Ry.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(jy&&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=Ry.onPlayer)||e.call(Ry,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=Dy(Dy({},Py),e),this.player){var t=Ly(e,this.props),n=this.player.duration();!e.paused&&t>n&&(r=Dy({},e),e=Sy(r,Ay({currentTime:0,paused:!0})),this.resetPlayer())}var r;return e}}},{key:"isShowingPoster",value:function(){var e=this.getAttributes();return!(null!=e&&e.src)||By.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(ub,{duration:r,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Ly(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;i=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.13","@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.33"}},t.emitter=ae,t.viewMode=B.ViewMode.Broadcaster,t.isReplay=B.isPlayer(t.displayer),t.containerSizeRatio=m.containerSizeRatio,m.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.13","@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.33"}},t}return x(m,[{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(m.isCreated&&m.container)m.container.firstChild&&e.appendChild(m.container.firstChild);else if(m.params){var s=m.params,u=m.initContainer(this,e,s.chessboard,s.overwriteStyles);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),m.wrapper&&(null==(n=this.cursorManager)||n.setupWrapper(m.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),m.container=e}},{key:"bindCollectorContainer",value:function(e){m.isCreated&&this.boxManager?this.boxManager.setCollectorContainer(e):m.params&&(m.params.collectorContainer=e)}},{key:"addApp",value:(p=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 p.apply(this,arguments)})},{key:"_addApp",value:(f=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 f.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,Se(this.displayer)[i]||Ae(this.room,i,o)):Se(this.displayer)[i]||Ae(this.room,i,[{name:o[0].name}])),i&&void 0===o&&Ae(this.room,i,[{}])}return n}},{key:"setMainViewScenePath",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.setMainViewScenePath(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(h=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 h.apply(this,arguments)})},{key:"nextPage",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)>=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 c.apply(this,arguments)})},{key:"prevPage",value:(l=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 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:"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:"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;null==(e=this.containerResizeObserver)||e.disconnect(),null==(t=this.appManager)||t.destroy(),null==(n=this.cursorManager)||n.destroy(),m.container=void 0,m.wrapper=void 0,m.isCreated=!1,m.playground&&(null==(r=m.playground.parentNode)||r.removeChild(m.playground)),m.params=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(),m.container&&this.bindContainer(m.container),null==(n=null==(t=this.appManager)?void 0:t.refresher)||n.refresh()}},{key:"setContainerSizeRatio",value:function(e){if(!j.isNumber(e))throw new Error("[WindowManager]: updateContainerSizeRatio error, ratio must be a number. but got ".concat(e));m.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,{})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{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:"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,m.container=t.container,r=t.containerSizeRatio,i=t.debug,o=t.cursor,m.params=t,m.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(!m.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(m.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});case 20:if(a){e.next=22;break}throw new Error("[WindowManager]: create manager failed");case 22:return r&&(m.containerSizeRatio=r),e.next=25,a.ensureAttributes();case 25:return 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"),m.isCreated=!0,e.prev=33,e.next=36,le();case 36:e.next=41;break;case 38:e.prev=38,e.t0=e.catch(33),console.warn("[WindowManager]: indexedDB open failed"),console.log(e.t0);case 41:return e.abrupt("return",a);case 42:case"end":return e.stop()}}),e,this,[[33,38]])}))),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(m.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,r){m.container||(m.container=t);var i=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),gb.wrapper=r,{playground:t,wrapper:r,sizer:n,mainViewElement:i}}(t),o=i.playground,a=i.wrapper,s=i.sizer,u=i.mainViewElement;if(m.playground=o,n&&s.classList.add("netless-window-manager-chess-sizer"),r){var l=document.createElement("style");l.textContent=r,o.appendChild(l)}return e.containerResizeObserver=vt.create(o,s,a,ue),m.wrapper=a,u}},{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}}]),m}(B.InvisiblePlugin),gb=mb;gb.kind="WindowManager",gb.debug=!1,gb.containerSizeRatio=9/16,gb.isCreated=!1,gb.debug&&function(e){Ry=Dy(Dy({},Oy),e)}({verbose:!0}),gb.register({kind:Tu.kind,src:Tu}),gb.register({kind:fb.kind,src:fb}),t.AppCreateError=Oe,t.AppManagerNotInitError=Le,t.AppNotRegisterError=Re,t.BindContainerRoomPhaseInvalidError=Ge,t.BoxManagerNotFoundError=ze,t.BoxNotCreatedError=Ue,t.BuiltinApps=pb,t.InvalidScenePath=Fe,t.ParamsInvalidError=Be,t.WhiteWebSDKInvalidError=je,t.WindowManager=gb,t.calculateNextIndex=nt,t.reconnectRefresher=vb},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 S(e){return!(null==e||!e._isBuffer)}function A(e,t){if(S(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)),S(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(!S(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(!S(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,Ee=-1;function Se(){Me&&we&&(Me=!1,we.length?Te=we.concat(Te):Ee=-1,Te.length&&Ae())}function Ae(){if(!Me){var e=_e(Se);Me=!0;for(var t=Te.length;t;){for(we=Te,Te=[];++Ee1)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,Et(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&&Et(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 Et(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(bt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ie(St,e):St(e))}function St(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):Et(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?(S(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,S(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&&S(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&&S(r,"oncdata",r.cdata),S(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?(S(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="",S(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":S(t,"oncdata",t.cdata),t.cdata="";break;case"script":S(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&&(S(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(S(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 E(e,t,n){e[t]&&e[t](n)}function S(e,t,n){e.textNode&&A(e),E(e,t,n)}function A(e){e.textNode=I(e.opt,e.textNode),e.textNode&&E(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,E(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,E(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,S(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,S(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){S(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var o=0,a=e.attribList.length;o",e.tagName="",void(e.state=T.SCRIPT);S(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,S(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];S(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 En=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=En;var Sn=cn,An=En;t.xml2json=function(e,t){var n,r,i,o;return n=function(e){var t=Sn.copyOptions(e);return Sn.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 yl(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 bl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){bl[e]=new yl(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];bl[t]=new yl(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){bl[e]=new yl(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){bl[e]=new yl(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){bl[e]=new yl(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){bl[e]=new yl(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){bl[e]=new yl(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){bl[e]=new yl(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){bl[e]=new yl(e,5,!1,e.toLowerCase(),null,!1)}));var xl=/[\-:]([a-z])/g;function _l(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(xl,_l);bl[t]=new yl(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(xl,_l);bl[t]=new yl(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(xl,_l);bl[t]=new yl(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){bl[e]=new yl(e,1,!1,e.toLowerCase(),null,!1)})),bl.xlinkHref=new yl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){bl[e]=new yl(e,1,!1,e.toLowerCase(),null,!0)}));var wl=Iu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Tl(e,t,n,r){var i=bl.hasOwnProperty(t)?bl[t]:null;(null!==i?0===i.type:!r&&!(!(2=n.length))throw Error(ku(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Vl(n)}}function ic(e,t){var n=Vl(t.value),r=Vl(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 oc(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var ac="http://www.w3.org/1999/xhtml",sc="http://www.w3.org/2000/svg";function uc(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 lc(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?uc(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var cc,hc=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!==sc||"innerHTML"in e)e.innerHTML=t;else{for((cc=cc||document.createElement("div")).innerHTML=""+t.valueOf().toString()+"",t=cc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function dc(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 fc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var pc={animationend:fc("Animation","AnimationEnd"),animationiteration:fc("Animation","AnimationIteration"),animationstart:fc("Animation","AnimationStart"),transitionend:fc("Transition","TransitionEnd")},vc={},mc={};function gc(e){if(vc[e])return vc[e];if(!pc[e])return e;var t,n=pc[e];for(t in n)if(n.hasOwnProperty(t)&&t in mc)return vc[e]=n[t];return e}Ku&&(mc=document.createElement("div").style,"AnimationEvent"in window||(delete pc.animationend.animation,delete pc.animationiteration.animation,delete pc.animationstart.animation),"TransitionEvent"in window||delete pc.transitionend.transition);var yc=gc("animationend"),bc=gc("animationiteration"),xc=gc("animationstart"),_c=gc("transitionend"),wc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tc=new("function"==typeof WeakMap?WeakMap:Map);function Mc(e){var t=Tc.get(e);return void 0===t&&(t=new Map,Tc.set(e,t)),t}function Sc(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 Ec(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 Ac(e){if(Sc(e)!==e)throw Error(ku(188))}function Ic(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Sc(e)))throw Error(ku(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 Ac(i),e;if(o===r)return Ac(i),t;o=o.sibling}throw Error(ku(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(ku(189))}}if(n.alternate!==r)throw Error(ku(190))}if(3!==n.tag)throw Error(ku(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 Cc(e,t){if(null==t)throw Error(ku(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 Nc(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var kc=null;function Dc(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;rLc.length&&Lc.push(e)}function Bc(e,t,n,r){if(Lc.length){var i=Lc.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 Uc(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=td(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=Lh(r)}}function Bh(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Bh(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Uh(){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 Fh(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="$?",Gh="$!",Hh=null,Vh=null;function Wh(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Yh(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 Xh="function"==typeof setTimeout?setTimeout:void 0,Qh="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===Gh||n===zh){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Jh=Math.random().toString(36).slice(2),Kh="__reactInternalInstance$"+Jh,$h="__reactEventHandlers$"+Jh,ed="__reactContainere$"+Jh;function td(e){var t=e[Kh];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ed]||n[Kh]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Zh(e);null!==e;){if(n=e[Kh])return n;e=Zh(e)}return t}n=(e=n).parentNode}return null}function nd(e){return!(e=e[Kh]||e[ed])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function rd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(ku(33))}function id(e){return e[$h]||null}function od(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function ad(e,t){var n=e.stateNode;if(!n)return null;var r=Uu(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(ku(231,t,_(n)));return n}function sd(e,t,n){(t=ad(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=Cc(n._dispatchListeners,t),n._dispatchInstances=Cc(n._dispatchInstances,e))}function ud(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=od(t);for(t=n.length;0this.eventPool.length&&this.eventPool.push(e)}function _d(e){e.eventPool=[],e.getPooled=bd,e.release=xd}Cu(yd.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=md)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=md)},persist:function(){this.isPersistent=md},isPersistent:gd,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=gd,this._dispatchInstances=this._dispatchListeners=null}}),yd.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},yd.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return Cu(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=Cu({},r.Interface,e),n.extend=r.extend,_d(n),n},_d(yd);var wd=yd.extend({data:null}),Td=yd.extend({data:null}),Md=[9,13,27,32],Sd=Ku&&"CompositionEvent"in window,Ed=null;Ku&&"documentMode"in document&&(Ed=document.documentMode);var Ad=Ku&&"TextEvent"in window&&!Ed,Id=Ku&&(!Sd||Ed&&8=Ed),Cd=String.fromCharCode(32),Nd={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(" ")}},kd=!1;function Dd(e,t){switch(e){case"keyup":return-1!==Md.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Pd(e){return"object"==_(e=e.detail)&&"data"in e?e.data:null}var Rd=!1;var Od={eventTypes:Nd,extractEvents:function(e,t,n,r){var i;if(Sd)e:{switch(e){case"compositionstart":var o=Nd.compositionStart;break e;case"compositionend":o=Nd.compositionEnd;break e;case"compositionupdate":o=Nd.compositionUpdate;break e}o=void 0}else Rd?Dd(e,n)&&(o=Nd.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=Nd.compositionStart);return o?(Id&&"ko"!==n.locale&&(Rd||o!==Nd.compositionStart?o===Nd.compositionEnd&&Rd&&(i=vd()):(fd="value"in(dd=r)?dd.value:dd.textContent,Rd=!0)),o=wd.getPooled(o,t,n,r),i?o.data=i:null!==(i=Pd(n))&&(o.data=i),hd(o),i=o):i=null,(e=Ad?function(e,t){switch(e){case"compositionend":return Pd(t);case"keypress":return 32!==t.which?null:(kd=!0,Cd);case"textInput":return(e=t.data)===Cd&&kd?null:e;default:return null}}(e,n):function(e,t){if(Rd)return"compositionend"===e||!Sd&&Dd(e,t)?(e=vd(),pd=fd=dd=null,Rd=!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,mf={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},gf=null,yf=null,bf=null,xf=!1;function _f(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return xf||null==gf||gf!==Oh(n)?null:("selectionStart"in(n=gf)&&Fh(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},bf&&pf(bf,n)?null:(bf=n,(e=yd.getPooled(mf.select,yf,e,t)).type="select",e.target=gf,hd(e),e))}var wf={eventTypes:mf,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=Mc(i),o=Zu.onSelect;for(var a=0;aLf||(e.current=Of[Lf],Of[Lf]=null,Lf--)}function Bf(e,t){Lf++,Of[Lf]=e.current,e.current=t}var Uf={},Ff={current:Uf},zf={current:!1},Gf=Uf;function Hf(e,t){var n=e.type.contextTypes;if(!n)return Uf;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 Vf(e){return null!=(e=e.childContextTypes)}function Wf(){jf(zf),jf(Ff)}function Yf(e,t,n){if(Ff.current!==Uf)throw Error(ku(168));Bf(Ff,t),Bf(zf,n)}function Xf(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(ku(108,Gl(t)||"Unknown",i));return Cu({},n,{},r)}function Qf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Uf,Gf=Ff.current,Bf(Ff,e),Bf(zf,zf.current),!0}function qf(e,t,n){var r=e.stateNode;if(!r)throw Error(ku(169));n?(e=Xf(e,t,Gf),r.__reactInternalMemoizedMergedChildContext=e,jf(zf),jf(Ff),Bf(Ff,e)):jf(zf),Bf(zf,n)}var Zf=Nu.unstable_runWithPriority,Jf=Nu.unstable_scheduleCallback,Kf=Nu.unstable_cancelCallback,$f=Nu.unstable_requestPaint,ep=Nu.unstable_now,tp=Nu.unstable_getCurrentPriorityLevel,np=Nu.unstable_ImmediatePriority,rp=Nu.unstable_UserBlockingPriority,ip=Nu.unstable_NormalPriority,op=Nu.unstable_LowPriority,ap=Nu.unstable_IdlePriority,sp={},up=Nu.unstable_shouldYield,lp=void 0!==$f?$f:function(){},cp=null,hp=null,dp=!1,fp=ep(),pp=1e4>fp?ep:function(){return ep()-fp};function vp(){switch(tp()){case np:return 99;case rp:return 98;case ip:return 97;case op:return 96;case ap:return 95;default:throw Error(ku(332))}}function mp(e){switch(e){case 99:return np;case 98:return rp;case 97:return ip;case 96:return op;case 95:return ap;default:throw Error(ku(332))}}function gp(e,t){return e=mp(e),Zf(e,t)}function yp(e,t,n){return e=mp(e),Jf(e,t,n)}function bp(e){return null===cp?(cp=[e],hp=Jf(np,_p)):cp.push(e),sp}function xp(){if(null!==hp){var e=hp;hp=null,Kf(e)}_p()}function _p(){if(!dp&&null!==cp){dp=!0;var e=0;try{var t=cp;gp(99,(function(){for(;e=t&&(im=!0),e.firstContext=null)}function Dp(e,t){if(Ap!==e&&!1!==t&&0!==t)if(("number"!=typeof t||1073741823===t)&&(Ap=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Ep){if(null===Sp)throw Error(ku(308));Ep=t,Sp.dependencies={expirationTime:0,firstContext:t,responders:null}}else Ep=Ep.next=t;return e._currentValue}var Pp=!1;function Rp(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 Lp(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function jp(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 Bp(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 Up(e,t,n,r){var i=e.updateQueue;Pp=!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}),jg(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=Cu({},u,a);break e;case 2:Pp=!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,Bg(l),e.expirationTime=l,e.memoizedState=u}}function Fp(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&&Jp(s,l),void 0===l&&!p)switch(s.tag){case 1:case 0:throw s=s.type,Error(ku(152,s.displayName||s.name||"Component"))}return n(s,u)}}var $p=Kp(!0),ev=Kp(!1),tv={},nv={current:tv},rv={current:tv},iv={current:tv};function ov(e){if(e===tv)throw Error(ku(174));return e}function av(e,t){switch(Bf(iv,t),Bf(rv,e),Bf(nv,tv),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:lc(null,"");break;default:t=lc(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}jf(nv),Bf(nv,t)}function sv(){jf(nv),jf(rv),jf(iv)}function uv(e){ov(iv.current);var t=ov(nv.current),n=lc(t,e.type);t!==n&&(Bf(rv,e),Bf(nv,n))}function lv(e){rv.current===e&&(jf(nv),jf(rv))}var cv={current:0};function hv(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===Gh))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 dv(e,t){return{responder:e,props:t}}var fv=wl.ReactCurrentDispatcher,pv=wl.ReactCurrentBatchConfig,vv=0,mv=null,gv=null,yv=null,bv=!1;function xv(){throw Error(ku(321))}function _v(e,t){if(null===t)return!1;for(var n=0;no))throw Error(ku(301));o+=1,yv=gv=null,t.updateQueue=null,fv.current=Xv,e=n(r,i)}while(t.expirationTime===vv)}if(fv.current=Vv,t=null!==gv&&null!==gv.next,vv=0,yv=gv=mv=null,bv=!1,t)throw Error(ku(300));return e}function Tv(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===yv?mv.memoizedState=yv=e:yv=yv.next=e,yv}function Mv(){if(null===gv){var e=mv.alternate;e=null!==e?e.memoizedState:null}else e=gv.next;var t=null===yv?mv.memoizedState:yv.next;if(null!==t)yv=t,gv=e;else{if(null===e)throw Error(ku(310));e={memoizedState:(gv=e).memoizedState,baseState:gv.baseState,baseQueue:gv.baseQueue,queue:gv.queue,next:null},null===yv?mv.memoizedState=yv=e:yv=yv.next=e}return yv}function Sv(e,t){return"function"==typeof t?t(e):t}function Ev(e){var t=Mv(),n=t.queue;if(null===n)throw Error(ku(311));n.lastRenderedReducer=e;var r=gv,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(lmv.expirationTime&&(mv.expirationTime=l,Bg(l))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:u.suspenseConfig,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),jg(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,df(r,t.memoizedState)||(im=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Av(e){var t=Mv(),n=t.queue;if(null===n)throw Error(ku(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);df(o,t.memoizedState)||(im=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Iv(e){var t=Tv();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Sv,lastRenderedState:e}).dispatch=Hv.bind(null,mv,e),[t.memoizedState,e]}function Cv(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=mv.updateQueue)?(t={lastEffect:null},mv.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 Nv(){return Mv().memoizedState}function kv(e,t,n,r){var i=Tv();mv.effectTag|=e,i.memoizedState=Cv(1|t,n,void 0,void 0===r?null:r)}function Dv(e,t,n,r){var i=Mv();r=void 0===r?null:r;var o=void 0;if(null!==gv){var a=gv.memoizedState;if(o=a.destroy,null!==r&&_v(r,a.deps))return void Cv(t,n,o,r)}mv.effectTag|=e,i.memoizedState=Cv(1|t,n,o,r)}function Pv(e,t){return kv(516,4,e,t)}function Rv(e,t){return Dv(516,4,e,t)}function Ov(e,t){return Dv(4,2,e,t)}function Lv(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 jv(e,t,n){return n=null!=n?n.concat([e]):null,Dv(4,2,Lv.bind(null,t,e),n)}function Bv(){}function Uv(e,t){return Tv().memoizedState=[e,void 0===t?null:t],e}function Fv(e,t){var n=Mv();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&_v(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function zv(e,t){var n=Mv();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&_v(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Gv(e,t,n){var r=vp();gp(98>r?98:r,(function(){e(!0)})),gp(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[Kh]=t,e[$h]=r,pm(e,t),t.stateNode=e,a=kh(i,r),i){case"iframe":case"object":case"embed":bh("load",e),s=r;break;case"video":case"audio":for(s=0;sr.tailExpiration&&1t)&&xg.set(e,t))}}function Ag(e,t){e.expirationTime=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Cg(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=bp(kg.bind(null,e));else{var t=Ig(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Mg();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!==sp&&Kf(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?bp(kg.bind(null,e)):yp(r,Ng.bind(null,e),{timeout:10*(1073741821-t)-pp()}),e.callbackNode=t}}}function Ng(e,t){if(Tg=0,t)return fy(e,t=Mg()),Cg(e),null;var n=Ig(e);if(0!==n){if(t=e.callbackNode,0!=(48&tg))throw Error(ku(327));if(Xg(),e===ng&&n===ig||Rg(e,n),null!==rg){var r=tg;tg|=Zm;for(var i=Lg();;)try{Fg();break}catch(t){Og(e,t)}if(Ip(),tg=r,Qm.current=i,1===og)throw t=ag,Rg(e,n),hy(e,n),Cg(e),t;if(null===rg)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=og,ng=null,r){case Km:case 1:throw Error(ku(345));case 2:fy(e,2=n){e.lastPingedTime=n,Rg(e,n);break}}if(0!==(o=Ig(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=Xh(Vg.bind(null,e),i);break}Vg(e);break;case eg:if(hy(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Hg(i)),hg&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,Rg(e,n);break}if(0!==(i=Ig(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==ug?r=10*(1073741821-ug)-pp():1073741823===sg?r=0:(r=10*(1073741821-sg)-5e3,0>(r=(i=pp())-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*Xm(r/1960))-r)&&(r=n)),10=(r=0|a.busyMinDurationMs)?r=0:(i=0|a.busyDelayMs,r=(o=pp()-(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."+Hl(a))}5!==og&&(og=2),s=Em(s,a),h=o;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=t,Bp(h,Vm(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===mg||!mg.has(w)))){h.effectTag|=4096,h.expirationTime=t,Bp(h,Wm(h,u,t));break e}}h=h.return}while(null!==h)}rg=Gg(rg)}catch(e){t=e;continue}break}}function Lg(){var e=Qm.current;return Qm.current=Vv,null===e?Vv:e}function jg(e,t){ecg&&(cg=e)}function Ug(){for(;null!==rg;)rg=zg(rg)}function Fg(){for(;null!==rg&&!up();)rg=zg(rg)}function zg(e){var t=Ym(e.alternate,e,ig);return e.memoizedProps=e.pendingProps,null===t&&(t=Gg(e)),qm.current=null,t}function Gg(e){rg=e;do{var t=rg.alternate;if(e=rg.return,0==(2048&rg.effectTag)){if(t=Mm(t,rg,ig),1===ig||1!==rg.childExpirationTime){for(var n=0,r=rg.child;null!==r;){var i=r.expirationTime,o=r.childExpirationTime;i>n&&(n=i),o>n&&(n=o),r=r.sibling}rg.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=rg.firstEffect),null!==rg.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=rg.firstEffect),e.lastEffect=rg.lastEffect),1(e=e.childExpirationTime)?t:e}function Vg(e){var t=vp();return gp(99,Wg.bind(null,e,t)),null}function Wg(e,t){do{Xg()}while(null!==yg);if(0!=(48&tg))throw Error(ku(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(ku(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Hg(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===ng&&(rg=ng=null,ig=0),1s&&(l=s,s=a,a=l),l=jh(b,a),c=jh(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?ym(e,t,n):(Bf(cv,1&cv.current),null!==(t=wm(e,t,n))?t.sibling:null);Bf(cv,1&cv.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return _m(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),Bf(cv,cv.current),!r)return null}return wm(e,t,n)}im=!1}}else im=!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=Hf(t,Ff.current),kp(t,n),i=wv(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,Vf(r)){var o=!0;Qf(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Rp(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&Hp(t,r,a,e),i.updater=Vp,t.stateNode=i,i._reactInternalFiber=t,Qp(t,r,e,n),t=dm(null,t,r,!0,o,n)}else t.tag=0,om(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 ry(e)?1:0;if(null!=e){if((e=e.$$typeof)===Rl)return 11;if(e===jl)return 14}return 2}(i),e=Tp(i,e),o){case 0:t=cm(null,t,i,e,n);break e;case 1:t=hm(null,t,i,e,n);break e;case 11:t=am(null,t,i,e,n);break e;case 14:t=sm(null,t,i,Tp(i.type,e),r,n);break e}throw Error(ku(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,cm(e,t,r,i=t.elementType===r?i:Tp(r,i),n);case 1:return r=t.type,i=t.pendingProps,hm(e,t,r,i=t.elementType===r?i:Tp(r,i),n);case 3:if(fm(t),r=t.updateQueue,null===e||null===r)throw Error(ku(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,Op(e,t),Up(t,r,null,n),(r=t.memoizedState.element)===i)nm(),t=wm(e,t,n);else{if((i=t.stateNode.hydrate)&&(qv=qh(t.stateNode.containerInfo.firstChild),Qv=t,i=Zv=!0),i)for(n=ev(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else om(e,t,r,n),nm();t=t.child}return t;case 5:return uv(t),null===e&&$v(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,Yh(r,i)?a=null:null!==o&&Yh(r,o)&&(t.effectTag|=16),lm(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(om(e,t,a,n),t=t.child),t;case 6:return null===e&&$v(t),null;case 13:return ym(e,t,n);case 4:return av(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=$p(t,null,r,n):om(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,am(e,t,r,i=t.elementType===r?i:Tp(r,i),n);case 7:return om(e,t,t.pendingProps,n),t.child;case 8:case 12:return om(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(Bf(Mp,s._currentValue),s._currentValue=o,null!==a)if(s=a.value,0===(o=df(s,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,o):1073741823))){if(a.children===i.children&&!zf.current){t=wm(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=Lp(n,null)).tag=2,jp(s,l)),s.expirationTime=t&&e<=t}function hy(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 dy(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 fy(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function py(e,t,n,r){var i=t.current,o=Mg(),a=zp.suspense;o=Sg(o,i,a);e:if(n){t:{if(Sc(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(ku(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(Vf(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(ku(171))}if(1===n.tag){var u=n.type;if(Vf(u)){n=Xf(n,u,s);break e}}n=s}else n=Uf;return null===t.context?t.context=n:t.pendingContext=n,(t=Lp(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),jp(i,t),Eg(i,o),o}function vy(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function my(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=t||n<0||h&&e-l>=o}function m(){var e,n,r=rb();if(v(r))return g(r);s=setTimeout(m,(n=t-((e=r)-u),h?ob(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=rb(),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=nb(t)||0,Jy(n)&&(c=!!n.leading,o=(h="maxWait"in n)?ib(nb(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(rb())},y}var sb=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),ub=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=ab((function(e){r.props.setCurrentTime(e)}),50),r.onVolumeChange=function(e){r.changeVolume(e),r.setState({seekVolume:e/100})},r.changeVolume=ab((function(e){r.props.setVolume(e/100)}),50),r.onVolumeSeekStart=function(){r.onVolumeSeeking=!0},r.onVolumeSeekEnd=ab((function(){r.onVolumeSeeking=!1}),500),r.onProgressSeekStart=function(){return r.setState({isPlayerSeeking:!0})},r.onProgressSeekEnd=ab((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(sb,{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(sb,{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"},lb(Math.floor(r/1e3))," /"," ",lb(Math.floor(n/1e3)))))}}]),n}(mt.exports.Component);function lb(e){var t=e%60,n=(e-t)/60;if(n>=60){var r=n%60;return"".concat(cb((n-r)/60),":").concat(cb(r),":").concat(cb(t))}return"".concat(cb(n),":").concat(cb(t))}function cb(e){return e<=9?"0".concat(e):"".concat(e)}var hb=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(db,{room:t,player:n,context:e,plugin:{putAttributes:r}})}}]),n}(mt.exports.Component),db=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=Ly(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=Ly(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(jy&&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=q.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=Dy(Dy({},Py),e),this.player){var t=Ly(e,this.props),n=this.player.duration();!e.paused&&t>n&&(r=Dy({},e),e=Ey(r,Ay({currentTime:0,paused:!0})),this.resetPlayer())}var r;return e}}},{key:"isShowingPoster",value:function(){var e=this.getAttributes();return!(null!=e&&e.src)||By.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(ub,{duration:r,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Ly(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;i=7"},peerDependencies:{jspdf:"2.5.1","white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.13","@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.33"}},t.emitter=ae,t.viewMode=B.ViewMode.Broadcaster,t.isReplay=B.isPlayer(t.displayer),t.containerSizeRatio=m.containerSizeRatio,m.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.13","@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.33"}},t}return x(m,[{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(m.isCreated&&m.container)m.container.firstChild&&e.appendChild(m.container.firstChild);else if(m.params){var s=m.params,u=m.initContainer(this,e,s.chessboard,s.overwriteStyles);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),m.wrapper&&(null==(n=this.cursorManager)||n.setupWrapper(m.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),m.container=e}},{key:"bindCollectorContainer",value:function(e){m.isCreated&&this.boxManager?this.boxManager.setCollectorContainer(e):m.params&&(m.params.collectorContainer=e)}},{key:"addApp",value:(p=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 p.apply(this,arguments)})},{key:"_addApp",value:(f=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 Re;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 f.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:(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.setMainViewScenePath(t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"setMainViewSceneIndex",value:(h=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 h.apply(this,arguments)})},{key:"nextPage",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)>=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 c.apply(this,arguments)})},{key:"prevPage",value:(l=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 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:"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:"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(Z.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(Z.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;null==(e=this.containerResizeObserver)||e.disconnect(),null==(t=this.appManager)||t.destroy(),null==(n=this.cursorManager)||n.destroy(),m.container=void 0,m.wrapper=void 0,m.isCreated=!1,m.playground&&(null==(r=m.playground.parentNode)||r.removeChild(m.playground)),m.params=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(Z.Refresh)}},{key:"_refresh",value:function(){var e,t,n;null==(e=this.appManager)||e.mainViewProxy.rebind(),m.container&&this.bindContainer(m.container),null==(n=null==(t=this.appManager)?void 0:t.refresher)||n.refresh()}},{key:"setContainerSizeRatio",value:function(e){if(!j.isNumber(e))throw new Error("[WindowManager]: updateContainerSizeRatio error, ratio must be a number. but got ".concat(e));m.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,{})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{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:"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,m.container=t.container,r=t.containerSizeRatio,i=t.debug,o=t.cursor,m.params=t,m.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(!m.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(m.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});case 20:if(a){e.next=22;break}throw new Error("[WindowManager]: create manager failed");case 22:return r&&(m.containerSizeRatio=r),e.next=25,a.ensureAttributes();case 25:return 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"),m.isCreated=!0,e.prev=33,e.next=36,le();case 36:e.next=41;break;case 38:e.prev=38,e.t0=e.catch(33),console.warn("[WindowManager]: indexedDB open failed"),console.log(e.t0);case 41:return e.abrupt("return",a);case 42:case"end":return e.stop()}}),e,this,[[33,38]])}))),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(m.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,r){m.container||(m.container=t);var i=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),gb.wrapper=r,{playground:t,wrapper:r,sizer:n,mainViewElement:i}}(t),o=i.playground,a=i.wrapper,s=i.sizer,u=i.mainViewElement;if(m.playground=o,n&&s.classList.add("netless-window-manager-chess-sizer"),r){var l=document.createElement("style");l.textContent=r,o.appendChild(l)}return e.containerResizeObserver=vt.create(o,s,a,ue),m.wrapper=a,u}},{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}}]),m}(B.InvisiblePlugin),gb=mb;gb.kind="WindowManager",gb.debug=!1,gb.containerSizeRatio=9/16,gb.isCreated=!1,gb.debug&&function(e){Oy=Dy(Dy({},Ry),e)}({verbose:!0}),gb.register({kind:Tu.kind,src:Tu}),gb.register({kind:fb.kind,src:fb}),t.AppCreateError=Re,t.AppManagerNotInitError=Le,t.AppNotRegisterError=Oe,t.BindContainerRoomPhaseInvalidError=Ge,t.BoxManagerNotFoundError=ze,t.BoxNotCreatedError=Ue,t.BuiltinApps=pb,t.InvalidScenePath=Fe,t.ParamsInvalidError=Be,t.WhiteWebSDKInvalidError=je,t.WindowManager=gb,t.calculateNextIndex=nt,t.reconnectRefresher=vb},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 R(this,e,t,n);case"latin1":case"binary":return O(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 q(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 Z(e,t,n,r,i){return i||q(e,0,n,4),v(e,t,n,r,23,4),n+4}function J(e,t,n,r,i){return i||q(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 Z(this,e,t,!0,n)},x.prototype.writeFloatBE=function(e,t,n){return Z(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=qe),Je(n,e,n.depth)}function qe(e,t){var n=Qe.styles[t];return n?"["+Qe.colors[n][0]+"m"+e+"["+Qe.colors[n][1]+"m":e}function Ze(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 qt&&(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 Rt(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!==Rt(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(qt,_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?O(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?(O(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?O(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,R(r),O(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?O(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}R(r),r.q="",r.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:p(a)?r.state=T.ATTRIB:">"===a?O(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}R(r),">"===a?O(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 R(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 O(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 On(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:"")+On(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;i