@galacean/effects-threejs 2.10.0-alpha.1 → 2.10.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2192 -1127
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +2185 -1128
- package/dist/index.mjs.map +1 -1
- package/dist/three-data-buffer.d.ts +11 -0
- package/dist/three-engine.d.ts +13 -2
- package/dist/three-geometry.d.ts +3 -155
- package/package.json +2 -2
package/dist/index.min.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.10.0-alpha.
|
|
7
|
-
*/function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.three={}),t.THREE)}(this,function(t,e){"use strict";var i,r,n,a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,C,E,_,w,S,M,A,P,R,I,O,L,F,V,N,k,D,z,B,U,G,W,j,X,H,Y,Z,q,K,Q,J,$,tt,te,ti,tr,tn,ta,to,ts,tu,th,tl,tc,tf,td,tp,tm,tv,ty,tg,tx,tb,tT,tC,tE,t_,tw,tS,tM,tA,tP,tR,tI,tO,tL,tF,tV,tN,tk,tD,tz,tB,tU,tG,tW,tj,tX,tH,tY,tZ,tq,tK,tQ,tJ,t$,t0,t1,t2,t3,t4,t5,t6,t8,t9,t7,et,ee,ei,er,en,ea,eo,es,eu,eh,el,ec,ef,ed,ep,em,ev,ey,eg,ex,eb,eT,eC,eE,e_,ew,eS,eM,eA,eP,eR,eI,eO,eL,eF,eV,eN,ek,eD=function(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(i){if("default"!==i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}}),e.default=t,Object.freeze(e)}(e);function ez(t,e,i,r,n,a,o){try{var s=t[a](o),u=s.value}catch(t){i(t);return}s.done?e(u):Promise.resolve(u).then(r,n)}function eB(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var a=t.apply(e,i);function o(t){ez(a,r,n,o,s,"next",t)}function s(t){ez(a,r,n,o,s,"throw",t)}o(void 0)})}}function eU(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):eU(t,e)}function eG(t,e,i,r){var n,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o}function eW(t,e){var i,r,n,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(i)throw TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;for(var ej=new Uint8Array(16),eX=[],eH=0;eH<256;++eH)eX.push((eH+256).toString(16).slice(1));var eY={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eZ(t,e){return t.includes(e)||t.push(e),t}function eq(t,e){var i=t.indexOf(e);return i>-1&&t.splice(i,1),t}function eK(t,e,i,r){if(void 0===r&&(r=1),t.buffer.byteLength<t.BYTES_PER_ELEMENT*e){var n=Math.ceil(e*r);Number.isNaN(i)||(n=Math.min(n,i));var a=new ArrayBuffer(t.BYTES_PER_ELEMENT*n),o=new t.constructor(a);return o.set(t),o}return t}var eQ=Math.PI/180,eJ=180/Math.PI;function e$(t,e){return 1e-6>Math.abs(t-e)||t===1/0&&e===1/0||t===-1/0&&e===-1/0}var e0=function(t,e,i){return(1-i)*t+i*e};function e1(t,e,i){var r=isNaN(e)?-1/0:e,n=isNaN(i)?1/0:i;return Math.min(Math.max(t,Math.min(r,n)),Math.max(r,n))}var e2=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}var e=t.prototype;return e.set=function(t,e){return this.x=t,this.y=e,this},e.setZero=function(){return this.x=0,this.y=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this},e.setFromArray=function(t,e){var i,r;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this},e.clone=function(){return new t(this.x,this.y)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t):eU(t,Array)?(this.x+=t[0],this.y+=t[1]):(this.x+=t.x,this.y+=t.y),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t):eU(t,Array)?(this.x-=t[0],this.y-=t[1]):(this.x-=t.x,this.y-=t.y),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t):eU(t,Array)?(this.x*=t[0],this.y*=t[1]):(this.x*=t.x,this.y*=t.y),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t):eU(t,Array)?(this.x/=t[0],this.y/=t[1]):(this.x/=t.x,this.y/=t.y),this},e.scale=function(t){return this.x*=t,this.y*=t,this},e.sum=function(){return this.x+this.y},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.cross=function(t){return this.x*t.y-this.y*t.x},e.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.distanceSquared=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},e.equals=function(t){return this.x===t.x&&this.y===t.y},e.isZero=function(){var t=this.x,e=this.y;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)},e.toArray=function(){return[this.x,this.y]},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y},e.angle=function(){return Math.atan2(-this.y,-this.x)+Math.PI},e.rotateAround=function(t,e){var i=Math.cos(e),r=Math.sin(e),n=this.x-t.x,a=this.y-t.y;return this.x=n*i-a*r+t.x,this.y=n*r+a*i+t.y,this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e2.ONE=new e2(1,1),e2.ZERO=new e2(0,0);var e3=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=i}var e=t.prototype;return e.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},e.setZero=function(){return this.x=0,this.y=0,this.z=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this.z=t,this},e.setFromArray=function(t,e){var i,r,n;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this.z=null!=(n=t[e+2])?n:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},e.clone=function(){return new t(this.x,this.y,this.z)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t,this.z+=t):eU(t,Array)?(this.x+=t[0],this.y+=t[1],this.z+=t[2]):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t,this.z-=t):eU(t,Array)?(this.x-=t[0],this.y-=t[1],this.z-=t[2]):(this.x-=t.x,this.y-=t.y,this.z-=t.z),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t,this.z*=t):eU(t,Array)?(this.x*=t[0],this.y*=t[1],this.z*=t[2]):(this.x*=t.x,this.y*=t.y,this.z*=t.z),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t,this.z/=t):eU(t,Array)?(this.x/=t[0],this.y/=t[1],this.z/=t[2]):(this.x/=t.x,this.y/=t.y,this.z/=t.z),this},e.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.sum=function(){return this.x+this.y+this.z},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t),this.z=Math.min(this.z,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t),this.z=Math.max(this.z,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.cross=function(t){return this.crossVectors(this,t)},e.crossVectors=function(t,e){var i=t.x,r=t.y,n=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-n*o,this.y=n*a-i*s,this.z=i*o-r*a,this},e.reflect=function(t){return this.subtract(t.clone().multiply(2*this.dot(t)))},e.distance=function(t){return Math.sqrt(this.distanceSquared(t))},e.distanceSquared=function(t){var e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},e.isZero=function(){var t=this.x,e=this.y,i=this.z;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)&&1e-6>=Math.abs(i)},e.toArray=function(){return[this.x,this.y,this.z]},e.toVector2=function(){return new e2(this.x,this.y)},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},e.applyEuler=function(t,e){return t.rotateVector3(this,e)},e.applyQuaternion=function(t,e){return t.rotateVector3(this,e)},e.applyMatrix=function(t,e){return t.transformPoint(this,e)},e.applyNormalMatrix=function(t,e){return t.transformNormal(this,e)},e.applyProjectionMatrix=function(t,e){return t.projectPoint(this,e)},e.setFromMatrixPosition=function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},e.setFromMatrixColumn=function(t,e){return this.setFromArray(t.elements,4*e)},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e3.X=new e3(1,0,0),e3.Y=new e3(0,1,0),e3.Z=new e3(0,0,1),e3.ONE=new e3(1,1,1),e3.ZERO=new e3(0,0,0);var e4=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.z=i,this.w=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},e.setZero=function(){return this.x=0,this.y=0,this.z=0,this.w=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},e.setFromArray=function(t,e){var i,r,n,a;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this.z=null!=(n=t[e+2])?n:0,this.w=null!=(a=t[e+3])?a:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t,this.z+=t,this.w+=t):eU(t,Array)?(this.x+=t[0],this.y+=t[1],this.z+=t[2],this.w+=t[3]):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t,this.z-=t,this.w-=t):eU(t,Array)?(this.x-=t[0],this.y-=t[1],this.z-=t[2],this.w-=t[3]):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):eU(t,Array)?(this.x*=t[0],this.y*=t[1],this.z*=t[2],this.w*=t[3]):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this.w=t.w*e.w,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t,this.z/=t,this.w/=t):eU(t,Array)?(this.x/=t[0],this.y/=t[1],this.z/=t[2],this.w/=t[3]):(this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w),this},e.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.sum=function(){return this.x+this.y+this.z+this.w},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t),this.z=Math.min(this.z,t),this.w=Math.min(this.w,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t),this.z=Math.max(this.z,t),this.w=Math.max(this.w,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=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},e.ceil=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},e.round=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},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this.w=Math.abs(this.w),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.isZero=function(){var t=this.x,e=this.y,i=this.z,r=this.w;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)&&1e-6>=Math.abs(i)&&1e-6>=Math.abs(r)},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector3=function(){return new e3(this.x,this.y,this.z)},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this},e.applyMatrix=function(t,e){return t.transformVector4(this,e)},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e4.ONE=new e4(1,1,1,1),e4.ZERO=new e4(0,0,0,0);var e5=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=i,this.a=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.r=t,this.g=e,this.b=i,this.a=r,this},e.setZero=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this},e.setFromNumber=function(t){return this.r=t,this.g=t,this.b=t,this.a=t,this},e.setFromVector4=function(t){return this.r=t.x,this.g=t.y,this.b=t.z,this.a=t.w,this},e.setFromArray=function(t,e){var i,r,n,a;return void 0===e&&(e=0),this.r=null!=(i=t[e])?i:0,this.g=null!=(r=t[e+1])?r:0,this.b=null!=(n=t[e+2])?n:0,this.a=null!=(a=t[e+3])?a:0,this},e.setFromHSV=function(t,e,i,r){void 0===r&&(r=1);var n=i*e,a=t/60,o=n*(1-Math.abs(a%2-1)),s=0,u=0,h=0;a>=0&&a<=1?(s=n,u=o):a>=1&&a<=2?(s=o,u=n):a>=2&&a<=3?(u=n,h=o):a>=3&&a<=4?(u=o,h=n):a>=4&&a<=5?(s=o,h=n):a>=5&&a<=6&&(s=n,h=o);var l=i-n;return this.set(s+l,u+l,h+l,r)},e.setFromHexString=function(t){if("#"!==t.substring(0,1)||9!==t.length&&7!==t.length)return this;var e=parseInt(t.substring(1,3),16)/255,i=parseInt(t.substring(3,5),16)/255,r=parseInt(t.substring(5,7),16)/255,n=9===t.length?parseInt(t.substring(7,9),16)/255:1;return this.set(e,i,r,n)},e.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},e.clone=function(){return new t(this.r,this.g,this.b,this.a)},e.setElement=function(t,e){switch(t){case 0:this.r=e;break;case 1:this.g=e;break;case 2:this.b=e;break;case 3:this.a=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.r;case 1:return this.g;case 2:return this.b;case 3:return this.a;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.r+=t,this.g+=t,this.b+=t,this.a+=t):eU(t,Array)?(this.r+=t[0],this.g+=t[1],this.b+=t[2],this.a+=t[3]):(this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a),this},e.subtract=function(t){return"number"==typeof t?(this.r-=t,this.g-=t,this.b-=t,this.a-=t):eU(t,Array)?(this.r-=t[0],this.g-=t[1],this.b-=t[2],this.a-=t[3]):(this.r-=t.r,this.g-=t.g,this.b-=t.b,this.a-=t.a),this},e.multiply=function(t){return"number"==typeof t?(this.r*=t,this.g*=t,this.b*=t,this.a*=t):eU(t,Array)?(this.r*=t[0],this.g*=t[1],this.b*=t[2],this.a*=t[3]):(this.r*=t.r,this.g*=t.g,this.b*=t.b,this.a*=t.a),this},e.divide=function(t){return"number"==typeof t?(this.r/=t,this.g/=t,this.b/=t,this.a/=t):eU(t,Array)?(this.r/=t[0],this.g/=t[1],this.b/=t[2],this.a/=t[3]):(this.r/=t.r,this.g/=t.g,this.b/=t.b,this.a/=t.a),this},e.scale=function(t){return this.r*=t,this.g*=t,this.b*=t,this.a*=t,this},e.min=function(t){return"number"==typeof t?(this.r=Math.min(this.r,t),this.g=Math.min(this.g,t),this.b=Math.min(this.b,t),this.a=Math.min(this.a,t)):(this.r=Math.min(this.r,t.r),this.g=Math.min(this.g,t.g),this.b=Math.min(this.b,t.b),this.a=Math.min(this.a,t.a)),this},e.max=function(t){return"number"==typeof t?(this.r=Math.max(this.r,t),this.g=Math.max(this.g,t),this.b=Math.max(this.b,t),this.a=Math.max(this.a,t)):(this.r=Math.max(this.r,t.r),this.g=Math.max(this.g,t.g),this.b=Math.max(this.b,t.b),this.a=Math.max(this.a,t.a)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.lerp=function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this.a+=(t.a-this.a)*e,this},e.luminance=function(){return .3*this.r+.59*this.g+.11*this.b},e.equals=function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a},e.toLinear=function(){return this.r=t.gammaToLinear(this.r),this.g=t.gammaToLinear(this.g),this.b=t.gammaToLinear(this.b),this},e.toGamma=function(){return this.r=t.linearToGamma(this.r),this.g=t.linearToGamma(this.g),this.b=t.linearToGamma(this.b),this},e.toArray=function(){return[this.r,this.g,this.b,this.a]},e.toVector4=function(){return new e4(this.r,this.g,this.b,this.a)},e.toHSV=function(){var e=this.r,i=this.g,r=this.b,n=this.a,a=Math.max(e,i,r),o=Math.min(e,i,r),s=a-o,u=0,h=0;return 0!==a&&(h=s/a),a!=o&&(a==e?(u=(i-r)/s,i<r&&(u+=6)):a==i?u=(r-e)/s+2:a==r&&(u=(e-i)/s+4),u*=60),new t(u,h,a,n)},e.toHexString=function(e){void 0===e&&(e=!0);var i=t.ToHex(Math.round(255*this.r)),r=t.ToHex(Math.round(255*this.g)),n=t.ToHex(Math.round(255*this.b)),a=t.ToHex(Math.round(255*this.a));return e?"#"+i+r+n+a:"#"+i+r+n},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromHexString=function(e){return new t().setFromHexString(e)},t.fromHSV=function(e,i,r,n){return void 0===n&&(n=1),new t().setFromHSV(e,i,r,n)},t.gammaToLinear=function(t){return t<=0?0:t<=.04045?t/12.92:t<1?Math.pow((t+.055)/1.055,2.4):Math.pow(t,2.4)},t.linearToGamma=function(t){return t<=0?0:t<.0031308?12.92*t:t<1?1.055*Math.pow(t,.41666)-.055:Math.pow(t,.41666)},t.ToHex=function(t){var e=t.toString(16);return t<=15?("0"+e).toUpperCase():e.toUpperCase()},t}();function e6(t,e){var i=[0,0,0,0];if(iT(t)){t=t.replace(/[\s\t\r\n]/g,"");var r=/rgba?\(([.\d]+),([.\d]+),([.\d]+),?([.\d]+)?\)/.exec(t);if(r){var n=+r[4];i=[+r[1],+r[2],+r[3],isNaN(n)?255:255*n]}else/^#[a-f\d]{3}$/i.test(t)?i=[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))&&(i=[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),255])}else eU(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:t[3]]);if(e)for(var a=0;a<4;a++)i[a]/=255;return i}function e8(t,e,i){if(0===t.length)return[0,0,0,0];if(e<=t[0].time)r=t[0].color.toArray();else if(e>=t[t.length-1].time)r=t[t.length-1].color.toArray();else{r=t[t.length-1].color.toArray();for(var r,n=1;n<=t.length-1;n++){var a=t[n-1],o=t[n];if(a.time<=e&&e<=o.time){r=e7(a.color.toArray(),o.color.toArray(),(e-a.time)/(o.time-a.time));break}}}return i?r.map(function(t){return t/255}):r}function e9(t){var e=[];return eU(t,Array)?t.forEach(function(t){var i=t[0],r=t[1],n=t[2],a=t[3],o=t[4];e.push({time:it(i),color:new e5(r,n,a,o)})}):Object.keys(t).forEach(function(i){var r=t[i],n=new e5().setFromArray(e6(r));e.push({time:it(i),color:n})}),e=e.sort(function(t,e){return t.time-e.time})}function e7(t,e,i,r){var n=[],a=1-i;if(r)for(var o=0;o<4;o++)n[o]=t[o]*a+e[o]*i;else{for(var s=0;s<3;s++)n[s]=Math.round(Math.sqrt(t[s]*t[s]*a+e[s]*e[s]*i));n[3]=Math.round(t[3]*a+e[3]*i)}return n}function it(t){var e=/^(-)?([\d+.]+)%$/.exec(t);return e?+e[2]/100*(e[1]?-1:1):+t}function ie(){return"object"==typeof window?Math.min(2,window.devicePixelRatio||1):1}e5.BLACK=new e5(0,0,0,1),e5.BLUE=new e5(0,0,1,1),e5.CLEAR=new e5(0,0,0,0),e5.CYAN=new e5(0,1,1,1),e5.GRAY=new e5(.5,.5,.5,1),e5.GREEN=new e5(0,1,0,1),e5.MAGENTA=new e5(1,0,1,1),e5.RED=new e5(1,0,0,1),e5.WHITE=new e5(1,1,1,1),e5.YELLOW=new e5(1,.92,.016,1);var ii="undefined"!=typeof window;function ir(){return!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)}function ia(){return/\b[Aa]ndroid\b/.test(navigator.userAgent)}function io(){return/\bOpenHarmony\b/.test(navigator.userAgent)}function is(){return ia()||io()||/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)}function iu(){var t;return"undefined"!=typeof my&&(null==(t=my)?void 0:t.renderTarget)==="web"}function ih(){return"miniprogram"===window.__wxjs_environment}function il(t){var e={width:128,height:1,data:new Uint8Array(512)},i=e.data,r=e9(t);if(r.length)for(var n=0;n<128;n++){var a=n/127;if(a<=r[0].time)i.set(r[0].color.toArray(),4*n);else if(a>=r[r.length-1].time)i.set(r[r.length-1].color.toArray(),4*n);else for(var o=0;o<r.length-1;o++){var s=r[o],u=r[o+1];if(s.time<=a&&u.time>a){var h=e7(s.color.toArray(),u.color.toArray(),(a-s.time)/(u.time-s.time));i.set(h,4*n);break}}}return e}function ic(t,e){void 0===e&&(e=2);var i=t.length;if(i<=1||1===e)return t;if(!(i<=30))return function t(e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=e.length-1),r>=n)return e;for(var a,o,s=e[r],u=r,h=n;u<h;){if(2===i){for(;e[h].priority>s.priority&&h>=u;)h--;for(;e[u].priority<=s.priority&&u<h;)u++}else{for(;e[h].priority<s.priority&&h>=u;)h--;for(;e[u].priority>=s.priority&&u<h;)u++}a=[e[h],e[u]],e[u]=a[0],e[h]=a[1]}return o=[e[u],e[r]],e[r]=o[0],e[u]=o[1],t(e,i,r,u-1),t(e,i,h+1,n),e}(t,e);for(var r=1;r<i;r++)ip(t,r,e);return t}function id(t,e,i){return void 0===i&&(i=2),t.includes(e)||(t.push(e),1===t.length||1!==i&&ip(t,t.length-1,i)),t}function ip(t,e,i){var r=t[e];if(2!==i)for(;e>=1&&t[e-1].priority<r.priority&&(t[e]=t[e-1],0!=--e););else for(;e>=1&&t[e-1].priority>r.priority&&(t[e]=t[e-1],0!=--e););t[e]=r}function im(t,e){if(void 0===e&&(e="item doesn't exist"),null==t)throw Error(e)}function iv(t){return iy(t)||!is()}function iy(t){return/^[^\d.][\w-]*$/.test(t)}function ig(t){return["%c[Galacean Effects]","color: #AA0100",""+t]}t.OrderType=void 0,(i=t.OrderType||(t.OrderType={}))[i.none=1]="none",i[i.ascending=2]="ascending",i[i.descending=3]="descending";var ix={error:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).error.apply(e,[].concat(ig(t),[r])),null==tN||tN("error",t,r)},info:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).debug.apply(e,[].concat(ig(t))),null==tN||tN("info",t,r)},warn:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).warn.apply(e,[].concat(ig(t))),null==tN||tN("warn",t,r)},register:function(t){t&&iE(t)&&(tN=t)}};function ib(){}function iT(t){return"string"==typeof t}t.DestroyOptions=void 0,(r=t.DestroyOptions||(t.DestroyOptions={}))[r.destroy=0]="destroy",r[r.keep=1]="keep",r[r.force=0]="force";var iC=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function iE(t){return"[object Function]"===Object.prototype.toString.call(t)}function i_(t){return"[object Object]"===Object.prototype.toString.call(t)}function iw(t){if(null===t||"object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return"function"==typeof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)}function iS(t){var e;return"object"==typeof t&&null!==t&&(null==(e=t.tagName)?void 0:e.toUpperCase())==="CANVAS"}function iM(t,e){return t+Math.random()*(e-t)}function iA(){throw Error("Destroyed item cannot be used again.")}function iP(){return(function(t,e,i){if(eY.randomUUID&&!t)return eY.randomUUID();var r,n=(t=t||{}).random||(t.rng||function(){if(!tV&&!(tV="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tV(ej)})();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,void 0===r&&(r=0),eX[n[r+0]]+eX[n[r+1]]+eX[n[r+2]]+eX[n[r+3]]+"-"+eX[n[r+4]]+eX[n[r+5]]+"-"+eX[n[r+6]]+eX[n[r+7]]+"-"+eX[n[r+8]]+eX[n[r+9]]+"-"+eX[n[r+10]]+eX[n[r+11]]+eX[n[r+12]]+eX[n[r+13]]+eX[n[r+14]]+eX[n[r+15]]})().replace(/-/g,"")}function iR(t,e,i){void 0===e&&(e="base64File"),void 0===i&&(i="");for(var r=atob(t.split(",")[1]||t),n=[],a=0;a<r.length;a+=512){for(var o=r.slice(a,a+512),s=Array(o.length),u=0;u<o.length;u++)s[u]=o.charCodeAt(u);var h=new Uint8Array(s);n.push(h)}return new File([new Blob(n,{type:i})],e,{type:i})}function iI(t,e){e.forEach(function(e){Object.getOwnPropertyNames(e.prototype).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e.prototype,i);if(!r)throw Error("Cannot find property descriptor of class "+e);Object.defineProperty(t.prototype,i,r)})})}var iO={},iL=[];function iF(t,e){iO[t]&&ix.error("Duplicate registration for plugin "+t+"."),iO[t]=e;var i=new e;i.name=t,iL.push(i),iL.sort(function(t,e){return t.order-e.order})}var iV=function(){function t(){}return t.getPlugins=function(){return iL},t.notifyCompositionCreated=function(t,e){iL.forEach(function(i){return i.onCompositionCreated(t,e)})},t.notifyCompositionDestroy=function(t){iL.forEach(function(e){return e.onCompositionDestroy(t)})},t.notifyEngineCreated=function(t){iL.forEach(function(e){return e.onEngineCreated(t)})},t.notifyEngineDestroy=function(t){iL.forEach(function(e){return e.onEngineDestroy(t)})},t.notifyAssetsLoadStart=function(t,e){return eB(function(){return eW(this,function(i){return[2,Promise.all(iL.map(function(i){return i.onAssetsLoadStart(t,e)}))]})})()},t.notifyAssetsLoadFinish=function(t,e,i){iL.forEach(function(r){return r.onAssetsLoadFinish(t,e,i)})},t}(),iN={"alipay-downgrade":"@galacean/effects-plugin-alipay-downgrade",downgrade:"@galacean/effects-plugin-downgrade","editor-gizmo":"@galacean/effects-plugin-editor-gizmo",ffd:"@galacean/effects-plugin-ffd",ktx2:"@galacean/effects-plugin-ktx2",model:"@galacean/effects-plugin-model",video:"@galacean/effects-plugin-multimedia",audio:"@galacean/effects-plugin-multimedia","orientation-transformer":"@galacean/effects-plugin-orientation-transformer","rich-text":"@galacean/effects-plugin-rich-text",spine:"@galacean/effects-plugin-spine"};function ik(t){var e=iN[t];return e?"\n请按如下命令进行操作(Please follow the commands below to proceed):\n1、使用 npm 安装插件(Install Plugin):npm i "+e+"@latest --save\n2、导入插件(Import Plugin):import '"+e+"'":""}var iD=function(){function t(){this.order=100,this.name="Plugin"}var e=t.prototype;return e.onAssetsLoadStart=function(t,e){return eB(function(){return eW(this,function(t){return[2]})})()},e.onAssetsLoadFinish=function(t,e,i){},e.onCompositionCreated=function(t,e){},e.onCompositionDestroy=function(t){},e.onEngineCreated=function(t){},e.onEngineDestroy=function(t){},t}();function iz(t,e){return(iz=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function iB(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&iz(t,e)}(n=tk||(tk={}))["1_0"]="1.0",n["1_1"]="1.1",n["1_2"]="1.2",n["1_3"]="1.3",n["1_5"]="1.5",n["1_8"]="1.8",n["2_0"]="2.0",n["2_1"]="2.1",n["2_2"]="2.2",n["2_3"]="2.3",n["2_4"]="2.4",n["3_0"]="3.0",n["3_1"]="3.1",n["3_2"]="3.2",n["3_3"]="3.3",n["3_4"]="3.4",n["3_5"]="3.5",n["3_6"]="3.6",n["3_7"]="3.7",n.LATEST="3.7",(a=tD||(tD={})).S="S",a.APlus="A+",a.A="A",a.BPlus="B+",a.B="B",(o=tz||(tz={}))[o.ALPHA=0]="ALPHA",o[o.ADD=1]="ADD",o[o.MULTIPLY=2]="MULTIPLY",o[o.BRIGHTNESS=3]="BRIGHTNESS",o[o.SUBTRACTION=4]="SUBTRACTION",o[o.STRONG_LIGHT=5]="STRONG_LIGHT",o[o.WEAK_LIGHT=6]="WEAK_LIGHT",o[o.SUPERPOSITION=7]="SUPERPOSITION",(s=tB||(tB={}))[s.DOUBLE=1032]="DOUBLE",s[s.FRONT=1028]="FRONT",s[s.BACK=1029]="BACK",(u=tU||(tU={}))[u.OBSCURED=2]="OBSCURED",u[u.REVERSE_OBSCURED=3]="REVERSE_OBSCURED",(h=tG||(tG={}))[h.NONE=0]="NONE",h[h.SPHERE=1]="SPHERE",h[h.CONE=2]="CONE",h[h.HEMISPHERE=3]="HEMISPHERE",h[h.CIRCLE=4]="CIRCLE",h[h.DONUT=5]="DONUT",h[h.RECTANGLE=6]="RECTANGLE",h[h.RECTANGLE_EDGE=7]="RECTANGLE_EDGE",h[h.EDGE=8]="EDGE",h[h.TEXTURE=9]="TEXTURE",(l=tW||(tW={}))[l.GYROSCOPE=0]="GYROSCOPE",l[l.SPINE=1]="SPINE",(c=tj||(tj={}))[c.CLICK=0]="CLICK",c[c.MESSAGE=1]="MESSAGE",c[c.DRAG=2]="DRAG",(f=tX||(tX={}))[f.NONE=0]="NONE",f[f.NOTIFY=1]="NOTIFY",f[f.RESUME_PLAYER=2]="RESUME_PLAYER",f[f.REMOVE=3]="REMOVE",f[f.PAUSE=4]="PAUSE",(d=tH||(tH={})).base="0",d.sprite="1",d.particle="2",d.null="3",d.interact="4",d.plugin="5",d.camera="6",d.composition="7",d.spine="spine",d.mesh="mesh",d.tree="tree",d.text="text",d.light="light",d.skybox="skybox",d.effect="effect",d.shape="shape",d.postProcessVolume="postProcessVolume",d.node="node",d.video="video",d.audio="audio",d.richtext="richtext",(p=tY||(tY={}))[p.BILLBOARD=0]="BILLBOARD",p[p.MESH=1]="MESH",p[p.VERTICAL_BILLBOARD=2]="VERTICAL_BILLBOARD",p[p.HORIZONTAL_BILLBOARD=3]="HORIZONTAL_BILLBOARD",(m=tZ||(tZ={}))[m.PARTICLE_ORIGIN_CENTER=0]="PARTICLE_ORIGIN_CENTER",m[m.PARTICLE_ORIGIN_LEFT_TOP=1]="PARTICLE_ORIGIN_LEFT_TOP",m[m.PARTICLE_ORIGIN_LEFT_CENTER=2]="PARTICLE_ORIGIN_LEFT_CENTER",m[m.PARTICLE_ORIGIN_LEFT_BOTTOM=3]="PARTICLE_ORIGIN_LEFT_BOTTOM",m[m.PARTICLE_ORIGIN_CENTER_TOP=4]="PARTICLE_ORIGIN_CENTER_TOP",m[m.PARTICLE_ORIGIN_CENTER_BOTTOM=5]="PARTICLE_ORIGIN_CENTER_BOTTOM",m[m.PARTICLE_ORIGIN_RIGHT_TOP=6]="PARTICLE_ORIGIN_RIGHT_TOP",m[m.PARTICLE_ORIGIN_RIGHT_CENTER=7]="PARTICLE_ORIGIN_RIGHT_CENTER",m[m.PARTICLE_ORIGIN_RIGHT_BOTTOM=8]="PARTICLE_ORIGIN_RIGHT_BOTTOM",(v=tq||(tq={})).Opaque="Opaque",v.Transparent="Transparent",(y=tK||(tK={})).Both="Both",y.Back="Back",y.Front="Front",(g=tQ||(tQ={}))[g.portrait=1]="portrait",g[g.landscape=0]="landscape",(x=tJ||(tJ={}))[x.CONSTANT=0]="CONSTANT",x[x.CONSTANT_VEC2=1]="CONSTANT_VEC2",x[x.CONSTANT_VEC3=2]="CONSTANT_VEC3",x[x.CONSTANT_VEC4=3]="CONSTANT_VEC4",x[x.RANDOM=4]="RANDOM",x[x.LINE=5]="LINE",x[x.CURVE=6]="CURVE",x[x.BEZIER_PATH=7]="BEZIER_PATH",x[x.RGBA_COLOR=8]="RGBA_COLOR",x[x.GRADIENT_COLOR=9]="GRADIENT_COLOR",x[x.SHAPE_POINTS=10]="SHAPE_POINTS",x[x.SHAPE_SPLITS=11]="SHAPE_SPLITS",x[x.LINEAR_PATH=12]="LINEAR_PATH",x[x.COLORS=13]="COLORS",x[x.BINARY=20]="BINARY",x[x.BEZIER_CURVE=21]="BEZIER_CURVE",x[x.BEZIER_CURVE_PATH=22]="BEZIER_CURVE_PATH",x[x.BEZIER_CURVE_QUAT=23]="BEZIER_CURVE_QUAT",x[x.COLOR_CURVE=24]="COLOR_CURVE",x[x.VECTOR4_CURVE=25]="VECTOR4_CURVE",x[x.VECTOR2_CURVE=26]="VECTOR2_CURVE",x[x.VECTOR3_CURVE=27]="VECTOR3_CURVE",(b=t$||(t$={}))[b.AUTO=0]="AUTO",b[b.EASE=1]="EASE",b[b.EASE_IN=2]="EASE_IN",b[b.EASE_OUT=3]="EASE_OUT",b[b.LINE=4]="LINE",b[b.HOLD=5]="HOLD",b[b.LINE_OUT=6]="LINE_OUT",(T=t0||(t0={}))[T.destroy=0]="destroy",T[T.restart=5]="restart",T[T.forward=2]="forward",T[T.freeze=4]="freeze",(C=t1||(t1={}))[C.none=0]="none",C[C.removeParticle=1]="removeParticle",(E=t2||(t2={}))[E.RANDOM=0]="RANDOM",E[E.UNIDIRECTIONAL_CYCLE=1]="UNIDIRECTIONAL_CYCLE",E[E.BIDIRECTIONAL_CYCLE=2]="BIDIRECTIONAL_CYCLE",E[E.UNIFORM_BURST=3]="UNIFORM_BURST",(_=t3||(t3={})).point="point",_.spot="spot",_.directional="directional",_.ambient="ambient",(w=t4||(t4={}))[w.box=2]="box",w[w.sphere=3]="sphere",(S=t5||(t5={})).orthographic="orthographic",S.perspective="perspective",(M=t6||(t6={})).unlit="unlit",M.pbr="pbr",M.hair="hair",(A=t8||(t8={}))[A.opaque=100]="opaque",A[A.masked=101]="masked",A[A.translucent=102]="translucent",A[A.additive=103]="additive",(P=t9||(t9={})).none="none",P.uv="uv",P.normal="normal",P.basecolor="basecolor",P.alpha="alpha",P.metallic="metallic",P.roughness="roughness",P.ao="ao",P.emissive="emissive",P.diffuse="diffuse",(R=t7||(t7={}))[R.visible=0]="visible",R[R.display=1]="display",R[R.clip=2]="clip",R[R.ellipsis=3]="ellipsis",(I=et||(et={}))[I.autoWidth=0]="autoWidth",I[I.autoHeight=1]="autoHeight",I[I.fixed=2]="fixed",(O=ee||(ee={}))[O.top=0]="top",O[O.middle=1]="middle",O[O.bottom=2]="bottom",(L=ei||(ei={}))[L.left=0]="left",L[L.middle=1]="middle",L[L.right=2]="right",(F=er||(er={}))[F.top=0]="top",F[F.middle=1]="middle",F[F.bottom=2]="bottom",(V=en||(en={})).normal="normal",V.bold="bold",V.lighter="lighter",(N=ea||(ea={})).normal="normal",N.italic="italic",N.oblique="oblique";var iU={WhiteTexture:"whitetexture00000000000000000000",EmptyTexture:"emptyTexture00000000000000000000",PBRShader:"pbr00000000000000000000000000000",UnlitShader:"unlit000000000000000000000000000"};(k=eo||(eo={}))[k.Solid=0]="Solid",k[k.GradientLinear=1]="GradientLinear",k[k.GradientRadial=2]="GradientRadial",k[k.GradientAngular=3]="GradientAngular",k[k.Texture=4]="Texture",(D=es||(es={}))[D.Fill=0]="Fill",D[D.Fit=1]="Fit",D[D.Crop=2]="Crop",D[D.Tile=3]="Tile",(z=eu||(eu={}))[z.Custom=0]="Custom",z[z.Rectangle=1]="Rectangle",z[z.Ellipse=2]="Ellipse",z[z.Polygon=3]="Polygon",z[z.Star=4]="Star",(B=eh||(eh={}))[B.Butt=0]="Butt",B[B.Round=1]="Round",B[B.Square=2]="Square",(U=el||(el={}))[U.Round=0]="Round",U[U.Bevel=1]="Bevel",U[U.Miter=2]="Miter",(G=ec||(ec={})).AnimationClipNodeData="AnimationClipNodeData",G.BlendNodeData="BlendNodeData",G.ApplyAdditiveNodeData="ApplyAdditiveNodeData",G.LayerBlendNodeData="LayerBlendNodeData",G.StateMachineNodeData="StateMachineNodeData",G.TransitionNodeData="TransitionNodeData",G.StateNodeData="StateNodeData",G.ConstFloatNodeData="ConstFloatNodeData",G.ConstBoolNodeData="ConstBoolNodeData",G.ControlParameterBoolNodeData="ControlParameterBoolNodeData",G.ControlParameterFloatNodeData="ControlParameterFloatNodeData",G.ControlParameterTriggerNodeData="ControlParameterTriggerNodeData",G.NotNodeData="NotNodeData",G.AndNodeData="AndNodeData",G.OrNodeData="OrNodeData",G.EqualNodeData="EqualNodeData",G.GreaterNodeData="GreaterNodeData",G.LessNodeData="LessNodeData",(W=ef||(ef={})).video="video",W.image="image",(j=ed||(ed={})).video="video",j.audio="audio",(X=ep||(ep={})).L30="hev1.1.0.L30.B0",X.L60="hev1.1.0.L60.B0",X.L63="hev1.1.0.L63.B0",X.L90="hev1.1.0.L90.B0",X.L93="hev1.1.0.L93.B0",X.L120="hev1.1.0.L120.B0",X.L150="hev1.1.0.L150.B0",X.L180="hev1.1.0.L180.B0",(H=em||(em={})).VFXItemData="VFXItemData",H.Material="Material",H.Shader="Shader",H.Geometry="Geometry",H.Texture="Texture",H.Image="Image",H.AnimationClip="AnimationClip",H.BinaryAsset="BinaryAsset",H.TrackAsset="TrackAsset",H.TimelineAsset="TimelineAsset",H.ObjectBindingTrack="ObjectBindingTrack",H.TransformTrack="TransformTrack",H.SpriteColorTrack="SpriteColorTrack",H.ActivationTrack="ActivationTrack",H.SubCompositionTrack="SubCompositionTrack",H.FloatPropertyTrack="FloatPropertyTrack",H.ColorPropertyTrack="ColorPropertyTrack",H.Vector2PropertyTrack="Vector2PropertyTrack",H.Vector3PropertyTrack="Vector3PropertyTrack",H.Vector4PropertyTrack="Vector4PropertyTrack",H.TransformPlayableAsset="TransformPlayableAsset",H.SpriteColorPlayableAsset="SpriteColorPlayableAsset",H.ActivationPlayableAsset="ActivationPlayableAsset",H.SubCompositionPlayableAsset="SubCompositionPlayableAsset",H.FloatPropertyPlayableAsset="FloatPropertyPlayableAsset",H.ColorPropertyPlayableAsset="ColorPropertyPlayableAsset",H.Vector2PropertyPlayableAsset="Vector2PropertyPlayableAsset",H.Vector3PropertyPlayableAsset="Vector3PropertyPlayableAsset",H.Vector4PropertyPlayableAsset="Vector4PropertyPlayableAsset",H.MeshComponent="MeshComponent",H.SkyboxComponent="SkyboxComponent",H.LightComponent="LightComponent",H.CameraComponent="CameraComponent",H.ModelPluginComponent="ModelPluginComponent",H.TreeComponent="TreeComponent",H.AnimationComponent="AnimationComponent",H.SpineComponent="SpineComponent",H.VideoComponent="VideoComponent",H.AudioComponent="AudioComponent",H.RichTextComponent="RichTextComponent",H.OrientationComponent="OrientationComponent",H.ShapeComponent="ShapeComponent",H.SpriteComponent="SpriteComponent",H.ParticleSystem="ParticleSystem",H.InteractComponent="InteractComponent",H.CameraController="CameraController",H.PostProcessVolume="PostProcessVolume",H.EffectComponent="EffectComponent",H.TextComponent="TextComponent",H.AnimationGraphAsset="AnimationGraphAsset",H.CompositionComponent="CompositionComponent",H.FFDComponent="FFDComponent",H.FrameComponent="FrameComponent",H.Animator="Animator",H.TimelineClip="TimelineClip",(Y=ev||(ev={}))[Y.POINTS=0]="POINTS",Y[Y.LINES=1]="LINES",Y[Y.LINE_LOOP=2]="LINE_LOOP",Y[Y.LINE_STRIP=3]="LINE_STRIP",Y[Y.TRIANGLES=4]="TRIANGLES",Y[Y.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",Y[Y.TRIANGLE_FAN=6]="TRIANGLE_FAN",(Z=ey||(ey={}))[Z.Float16=0]="Float16",Z[Z.Float32=1]="Float32",Z[Z.Int8=2]="Int8",Z[Z.Int16=3]="Int16",Z[Z.Int32=4]="Int32",Z[Z.UInt8=5]="UInt8",Z[Z.UInt16=6]="UInt16",Z[Z.UInt32=7]="UInt32",(q=eg||(eg={}))[q.None=-1]="None",q[q.UInt8=0]="UInt8",q[q.UInt16=1]="UInt16",q[q.UInt32=2]="UInt32",(K=ex||(ex={})).Position="POSITION",K.Uv="TEXCOORD0",K.Uv2="TEXCOORD1",K.Normal="NORMAL",K.Tangent="TANGENT",K.Color="COLOR",K.Joints="JOINTS",K.Weights="WEIGHTS",K.PositionBS0="POSITION_BS0",K.PositionBS1="POSITION_BS1",K.PositionBS2="POSITION_BS2",K.PositionBS3="POSITION_BS3",K.PositionBS4="POSITION_BS4",K.PositionBS5="POSITION_BS5",K.PositionBS6="POSITION_BS6",K.PositionBS7="POSITION_BS7",K.NormalBS0="NORMAL_BS0",K.NormalBS1="NORMAL_BS1",K.NormalBS2="NORMAL_BS2",K.NormalBS3="NORMAL_BS3",K.TangentBS0="TANGENT_BS0",K.TangentBS1="TANGENT_BS1",K.TangentBS2="TANGENT_BS2",K.TangentBS3="TANGENT_BS3";var iG=Object.freeze({__proto__:null,LATEST_VERSION:tk.LATEST,get RenderLevel(){return tD},get BlendingMode(){return tz},get SideMode(){return tB},get ObscuredMode(){return tU},get ParticleEmitterShapeType(){return tG},get PluginType(){return tW},get InteractType(){return tj},get InteractBehavior(){return tX},get ItemType(){return tH},get RenderMode(){return tY},get ParticleOrigin(){return tZ},get RenderType(){return tq},get RenderFace(){return tK},get CameraClipMode(){return tQ},END_BEHAVIOR_DESTROY:0,END_BEHAVIOR_PAUSE:1,END_BEHAVIOR_FORWARD:2,END_BEHAVIOR_PAUSE_AND_DESTROY:3,END_BEHAVIOR_FREEZE:4,END_BEHAVIOR_RESTART:5,END_BEHAVIOR_DESTROY_CHILDREN:6,CAMERA_CLIP_MODE_VERTICAL:1,CAMERA_CLIP_MODE_NORMAL:0,MESSAGE_ITEM_PHRASE_BEGIN:2,MESSAGE_ITEM_PHRASE_END:1,get ValueType(){return tJ},get BezierKeyframeType(){return t$},get JSONSceneVersion(){return tk},get EndBehavior(){return t0},get ParticleInteractionBehavior(){return t1},get ShapeArcMode(){return t2},get LightType(){return t3},get ModelBoundingType(){return t4},get CameraType(){return t5},get MaterialType(){return t6},get MaterialBlending(){return t8},get RenderMode3D(){return t9},get TextOverflow(){return t7},get TextSizeMode(){return et},get TextBaseline(){return ee},get TextAlignment(){return ei},get TextVerticalAlign(){return er},get TextWeight(){return en},get FontStyle(){return ea},BuiltinObjectGUID:iU,get FillType(){return eo},get TexturePaintScaleMode(){return es},get ShapePrimitiveType(){return eu},get LineCap(){return eh},get LineJoin(){return el},get NodeDataType(){return ec},get BackgroundType(){return ef},get MultimediaType(){return ed},get HevcVideoCodec(){return ep},get DataType(){return em},get GeometryType(){return ev},get VertexFormatType(){return ey},get IndexFormatType(){return eg},get VertexBufferSemantic(){return ex}});function iW(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function ij(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return iW(t,void 0);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return iW(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var iX=new Map,iH=new Map,iY={};function iZ(t){return function(e,i){iY[t]&&console.warn("Class "+t+" is already registered."),iY[t]=e}}function iq(t){var e=t.constructor;if(iH.get(e))return iH.get(e);var i={};iH.set(e,i);for(var r=t,n=e;n;){var a=iX.get(n);for(var o in a)i[o]=a[o];var s=Object.getPrototypeOf(r);if((n=Object.getPrototypeOf(s).constructor)===Object)break;r=s}return i}function iK(t,e){return function(i,r){var n,a=(n=i.constructor,iX.get(n)||iX.set(n,{}),iX.get(n));a&&(a[r]||(a[r]={type:t,sourceName:e}))}}var iQ=function(){function t(t){this.engine=t,this.guid=iP(),this.definition={},this.engine.addInstance(this)}var e=t.prototype;return e.getInstanceId=function(){return this.guid},e.setInstanceId=function(t){this.engine.removeInstance(this.guid),this.guid=t,this.engine.addInstance(this)},e.toData=function(){},e.fromData=function(t){void 0!==t.id&&this.setInstanceId(t.id)},e.dispose=function(){this.engine.removeInstance(this.guid)},t.is=function(e){return eU(e,t)&&"guid"in e},t}(),iJ=function(){function t(){this.resources=[]}return t.prototype.getResource=function(t){return this.resources[t]},t}(),i$={};function i0(t){return function(e,i){i$[t]&&console.warn("NodeData Class "+t+" is already registered."),i$[t]=e}}var i1=function(){function t(){this.initializationCount=0,this.lastUpdateID=-1}var e=t.prototype;return e.getNodeData=function(){return this.asset},e.isValid=function(){return!0},e.isInitialized=function(){return this.initializationCount>0},e.initialize=function(t){this.isInitialized()?this.initializationCount++:this.initializeInternal(t)},e.shutdown=function(t){if(!this.isInitialized())throw Error("Node not initialized!");0==--this.initializationCount&&this.shutdownInternal(t)},e.isNodeActive=function(t){return this.lastUpdateID===t},e.isUpdated=function(t){return this.isNodeActive(t.updateID)},e.markNodeActive=function(t){this.lastUpdateID=t.updateID},e.initializeInternal=function(t){this.initializationCount++},e.shutdownInternal=function(t){if(this.isInitialized())throw Error("Node still initialized!");this.lastUpdateID=-1},t}(),i2=function(){function t(){}var e=t.prototype;return e.load=function(t){this.index=t.index},e.createNode=function(t,e){var i=new t;return e.nodes[this.index]=i,i.asset=this,i},t}(),i3=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.previousTime=0,e.currentTime=0,e}iB(e,t);var i=e.prototype;return i.getCurrentTime=function(){return this.currentTime},i.getPreviousTime=function(){return this.previousTime},i.getDuration=function(){return this.duration},i.getDebugInfo=function(){return{duration:this.duration,currentTime:this.currentTime,previousTime:this.previousTime}},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.previousTime=0,this.currentTime=this.previousTime,this.duration=0},e}(i1),i4=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.setValue=function(t){},e}(i1),i5=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(i4),i6=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(i4);t.AnimationGraphAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.nodeDatas=[],e.graphDataSet=new iJ,e.controlParameterIDs=[],e.parameterLookupMap=new Map,e.rootNodeIndex=-1,e}return iB(e,t),e.prototype.fromData=function(t){var i=t.nodeDatas;this.rootNodeIndex=t.rootNodeIndex,this.controlParameterIDs=t.controlParameterIDs;for(var r=t.controlParameterIDs.length,n=0;n<r;n++)this.parameterLookupMap.set(t.controlParameterIDs[n],n);this.nodeDatas=[];for(var a=0;a<i.length;a++)this.nodeDatas[a]=e.createNodeData(i[a].type),this.nodeDatas[a].load(i[a]);this.graphDataSet=new iJ,this.graphDataSet.resources=[];for(var o,s=ij(t.graphDataSet.resources);!(o=s()).done;){var u=o.value,h=this.engine.findObject(u);this.graphDataSet.resources.push(h)}},e.createNodeData=function(t){var e=i$[t];if(e)return new e;throw Error("Unknown node type: "+t+".")},e}(iQ),t.AnimationGraphAsset=eG([iZ("AnimationGraphAsset")],t.AnimationGraphAsset),(Q=eb||(eb={}))[Q.Active=0]="Active",Q[Q.Inactive=1]="Inactive";var i8=function(){function t(){this.deltaTime=0,this.updateID=0,this.branchState=0}return t.prototype.update=function(t){this.deltaTime=t,this.updateID++,this.branchState=0},t}(),i9=function(){function t(){this.nodeDatas=[],this.nodes=[]}return t.prototype.getNode=function(t){return this.nodes[t]?this.nodes[t]:this.nodeDatas[t]?(this.nodeDatas[t].instantiate(this),this.nodes[t]):null},t}();function i7(){return(i7=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}t.AnimationClipNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.playRate=1,e.loopAnimation=!0,e.dataSlotIndex=-1,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rt,t).animation=t.dataSet.getResource(this.dataSlotIndex)},i.load=function(e){t.prototype.load.call(this,e);var i=i7({playRate:1,loopAnimation:!0},e);this.dataSlotIndex=e.dataSlotIndex,this.playRate=i.playRate,this.loopAnimation=i.loopAnimation},e}(i2),t.AnimationClipNodeData=eG([i0(ec.AnimationClipNodeData)],t.AnimationClipNodeData);var rt=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.animation=null,e.animatable=null,e}iB(e,t);var i=e.prototype;return i.evaluate=function(t,e){if(!this.animatable)return e;this.markNodeActive(t);var i=this.getNodeData();this.previousTime=this.currentTime,this.currentTime=this.previousTime+t.deltaTime/this.duration*i.playRate,i.loopAnimation?this.currentTime>1&&(this.currentTime=this.currentTime%1):this.currentTime=e1(this.currentTime,0,1),this.sampleEvents(t);var r=this.currentTime*this.duration;return this.animatable.getPose(r,e.pose),e},i.sampleEvents=function(t){if(this.animatable&&0!==this.animatable.events.length)for(var e,i=this.previousTime*this.duration,r=this.currentTime*this.duration,n=ij(this.animatable.events);!(e=n()).done;){var a=e.value,o=a.data.startTime;(this.previousTime<=this.currentTime?i<o&&o<=r:o>i||o<=r)&&(a.currentTime=r,a.deltaTime=t.deltaTime,t.activeEvents.push(a))}},i.initializeInternal=function(e){var i,r;t.prototype.initializeInternal.call(this,e),this.duration=null!=(r=null==(i=this.animation)?void 0:i.duration)?r:0,this.previousTime=this.currentTime=0,this.animation&&(this.animatable=new re(e.skeleton,this.animation))},e}(i3);(J=eT||(eT={}))[J.Position=0]="Position",J[J.Scale=1]="Scale",J[J.Rotation=2]="Rotation",J[J.Euler=3]="Euler";var re=function(){function t(t,e){this.skeleton=t,this.animationClip=e,this.events=[],this.transformCurveInfos=[],this.floatCurveInfos=[],this.colorCurveInfos=[];for(var i,r=ij(e.positionCurves);!(i=r()).done;){var n=i.value;this.addTransformCurveInfo(n,0)}for(var a,o=ij(e.scaleCurves);!(a=o()).done;){var s=a.value;this.addTransformCurveInfo(s,1)}for(var u,h=ij(e.rotationCurves);!(u=h()).done;){var l=u.value;this.addTransformCurveInfo(l,2)}for(var c,f=ij(e.eulerCurves);!(c=f()).done;){var d=c.value;this.addTransformCurveInfo(d,3)}for(var p,m=ij(e.floatCurves);!(p=m()).done;){var v=p.value;this.addFloatCurveInfo(v)}for(var y,g=ij(e.colorCurves);!(y=g()).done;){var x=y.value;this.addColorCurveInfo(x)}for(var b,T=ij(this.animationClip.events);!(b=T()).done;){var C=b.value;this.events.push({data:C,currentTime:0,deltaTime:0})}}var e=t.prototype;return e.getPose=function(t,e){for(var i,r=e1(t,0,this.animationClip.duration),n=ij(this.transformCurveInfos);!(i=n()).done;){var a=i.value,o=a.curve.keyFrames.getValue(r),s=e.parentSpaceTransforms[a.boneIndex];switch(a.type){case 0:s.position.copyFrom(o);break;case 1:s.scale.copyFrom(o);break;case 2:s.rotation.copyFrom(o);break;case 3:s.euler.copyFrom(o)}}for(var u,h=ij(this.floatCurveInfos);!(u=h()).done;){var l=u.value,c=l.curve.keyFrames.getValue(r);e.floatPropertyValues[l.animatedObjectIndex]=c}for(var f,d=ij(this.colorCurveInfos);!(f=d()).done;){var p=f.value,m=p.curve.keyFrames.getValue(r);e.colorPropertyValues[p.animatedObjectIndex]=m}},e.addTransformCurveInfo=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t.path);void 0!==i&&this.transformCurveInfos.push({curve:t,boneIndex:i,type:e})},e.addFloatCurveInfo=function(t){var e=this.skeleton.pathToObjectIndex.get(t.path+t.className+t.property);void 0!==e&&this.floatCurveInfos.push({curve:t,animatedObjectIndex:e})},e.addColorCurveInfo=function(t){var e=this.skeleton.pathToObjectIndex.get(t.path+t.className+t.property);void 0!==e&&this.colorCurveInfos.push({curve:t,animatedObjectIndex:e})},t}(),ri=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),this.x=t,this.y=e,this.z=i,this.w=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},e.setFromEuler=function(t){return t.toQuaternion(this),this},e.setFromAxisAngle=function(e,i){var r=i/2,n=Math.sin(r),a=t.tempVec0;return a.copyFrom(e).normalize(),this.x=a.x*n,this.y=a.y*n,this.z=a.z*n,this.w=Math.cos(r),this},e.setFromVector4=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.setFromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},e.setFromRotationMatrix=function(t){var e=t.elements,i=e[0],r=e[4],n=e[8],a=e[1],o=e[5],s=e[9],u=e[2],h=e[6],l=e[10],c=i+o+l;if(c>0){var f=.5/Math.sqrt(c+1);this.w=.25/f,this.x=(h-s)*f,this.y=(n-u)*f,this.z=(a-r)*f}else if(i>o&&i>l){var d=2*Math.sqrt(1+i-o-l);this.w=(h-s)/d,this.x=.25*d,this.y=(r+a)/d,this.z=(n+u)/d,this.negate()}else if(o>l){var p=2*Math.sqrt(1+o-i-l);this.w=(n-u)/p,this.x=(r+a)/p,this.y=.25*p,this.z=(s+h)/p,this.negate()}else{var m=2*Math.sqrt(1+l-i-o);this.w=(a-r)/m,this.x=(n+u)/m,this.y=(s+h)/m,this.z=.25*m,this.negate()}return this},e.setFromUnitVectors=function(t,e){var i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this.x=-t.y,this.y=t.x,this.z=0):(this.x=0,this.y=-t.z,this.z=t.y)):(this.x=t.y*e.z-t.z*e.y,this.y=t.z*e.x-t.x*e.z,this.z=t.x*e.y-t.y*e.x),this.w=i,this.normalize()},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.angleTo=function(t){return 2*Math.acos(Math.abs(e1(this.dot(t),-1,1)))},e.rotateTowards=function(t,e){var i=this.angleTo(t);return 0===i||this.slerp(t,Math.min(1,e/i)),this},e.identity=function(){return this.set(0,0,0,1)},e.invert=function(){return this.conjugate()},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.conjugate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.normalize=function(){var t=this.length();return 0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x=this.x*t,this.y=this.y*t,this.z=this.z*t,this.w=this.w*t),this},e.multiply=function(t){return this.multiplyQuaternions(this,t)},e.premultiply=function(t){return this.multiplyQuaternions(t,this)},e.multiplyQuaternions=function(t,e){var i=t.x,r=t.y,n=t.z,a=t.w,o=e.x,s=e.y,u=e.z,h=e.w;return this.x=i*h+a*o+r*u-n*s,this.y=r*h+a*s+n*o-i*u,this.z=n*h+a*u+i*s-r*o,this.w=a*h-i*o-r*s-n*u,this},e.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copyFrom(t);var i=this.x,r=this.y,n=this.z,a=this.w,o=a*t.w+i*t.x+r*t.y+n*t.z;if(o<0?(this.w=-t.w,this.x=-t.x,this.y=-t.y,this.z=-t.z,o=-o):this.copyFrom(t),o>=1)return this.w=a,this.x=i,this.y=r,this.z=n,this;var s=1-o*o;if(s<=Number.EPSILON){var u=1-e;return this.w=u*a+e*this.w,this.x=u*i+e*this.x,this.y=u*r+e*this.y,this.z=u*n+e*this.z,this.normalize(),this}var h=Math.sqrt(s),l=Math.atan2(h,o),c=Math.sin((1-e)*l)/h,f=Math.sin(e*l)/h;return this.w=a*c+this.w*f,this.x=i*c+this.x*f,this.y=r*c+this.y*f,this.z=n*c+this.z*f,this},e.slerpQuaternions=function(t,e,i){return this.copyFrom(t).slerp(e,i)},e.rotateVector3=function(t,e){var i=this.x,r=this.y,n=this.z,a=this.w,o=t.x,s=t.y,u=t.z,h=a*o+r*u-n*s,l=a*s+n*o-i*u,c=a*u+i*s-r*o,f=-i*o-r*s-n*u,d=null!=e?e:t;return d.x=h*a+-(f*i)+-(l*n)- -(c*r),d.y=l*a+-(f*r)+-(c*i)- -(h*n),d.z=c*a+-(f*n)+-(h*r)- -(l*i),d},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector4=function(t){return t.set(this.x,this.y,this.z,this.w)},e.toEuler=function(t){return t.setFromQuaternion(this)},e.toMatrix4=function(t){return t.compose(e3.ZERO,this,e3.ONE)},t.fromEuler=function(e){return new t().setFromEuler(e)},t.fromAxisAngle=function(e,i){return new t().setFromAxisAngle(e,i)},t.fromVector4=function(e){return new t().setFromVector4(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromRotationMatrix=function(e){return new t().setFromRotationMatrix(e)},t.fromUnitVectors=function(e,i){return new t().setFromUnitVectors(e,i)},t}();ri.tempVec0=new e3;var rr=new ri,rn=function(){},ra=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.blendVector3=function(t,e,i,r){r.x=t.x+(e.x-t.x)*i,r.y=t.y+(e.y-t.y)*i,r.z=t.z+(e.z-t.z)*i},i.blendQuaternion=function(t,e,i,r){r.copyFrom(t).slerp(e,i)},i.blendEuler=function(t,e,i,r){this.lerpEuler(t,e,i,r)},i.blendFloat=function(t,e,i){return t+(e-t)*i},i.blendColor=function(t,e,i,r){r.r=t.r+(e.r-t.r)*i,r.g=t.g+(e.g-t.g)*i,r.b=t.b+(e.b-t.b)*i,r.a=t.a+(e.a-t.a)*i},i.lerpEuler=function(t,e,i,r){r.x=this.lerpAngle(t.x,e.x,i),r.y=this.lerpAngle(t.y,e.y,i),r.z=this.lerpAngle(t.z,e.z,i)},i.normalizeAngle=function(t){return(t%360+360)%360},i.shortestAngleDiff=function(t,e){var i=this.normalizeAngle(e)-this.normalizeAngle(t);return i>180&&(i-=360),i<-180&&(i+=360),i},i.lerpAngle=function(t,e,i){var r=this.shortestAngleDiff(t,e);return this.normalizeAngle(t+r*i)},e}(rn),ro=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.blendVector3=function(t,e,i,r){r.x=t.x+e.x*i,r.y=t.y+e.y*i,r.z=t.z+e.z*i},i.blendQuaternion=function(t,e,i,r){var n=rr.copyFrom(t).multiply(e);r.copyFrom(t).slerp(n,i)},i.blendEuler=function(t,e,i,r){this.blendVector3(t,e,i,r)},i.blendFloat=function(t,e,i){return t+e*i},i.blendColor=function(t,e,i,r){r.r=t.r+e.r*i,r.g=t.g+e.g*i,r.b=t.b+e.b*i,r.a=t.a+e.a*i},e}(rn),rs=function(){function t(){}return t.localBlend=function(e,i,r,n){t.localBlendInternal(e,i,r,n,t.normalBlendFunction)},t.additiveBlend=function(e,i,r,n){t.localBlendInternal(e,i,r,n,t.additiveBlendFunction)},t.localBlendInternal=function(t,e,i,r,n){for(var a=0;a<t.parentSpaceTransforms.length;a++){var o=t.parentSpaceTransforms[a],s=e.parentSpaceTransforms[a],u=r.parentSpaceTransforms[a],h=o.position,l=s.position,c=u.position;n.blendVector3(h,l,i,c);var f=o.rotation,d=s.rotation,p=u.rotation;n.blendQuaternion(f,d,i,p);var m=o.scale,v=s.scale,y=u.scale;n.blendVector3(m,v,i,y);var g=o.euler,x=s.euler,b=u.euler;n.blendEuler(g,x,i,b)}for(var T=0;T<t.floatPropertyValues.length;T++){var C=t.floatPropertyValues[T],E=e.floatPropertyValues[T];r.floatPropertyValues[T]=n.blendFloat(C,E,i)}for(var _=0;_<t.colorPropertyValues.length;_++){var w=t.colorPropertyValues[_],S=e.colorPropertyValues[_],M=r.colorPropertyValues[_];n.blendColor(w,S,i,M)}},t}();rs.normalBlendFunction=new ra,rs.additiveBlendFunction=new ro;var ru=function(){function t(t){this.position=new e3,this.rotation=new ri,this.scale=new e3,this.euler=new e3,t&&(this.position.copyFrom(t.position),this.rotation.copyFrom(t.quat),this.scale.copyFrom(t.scale),this.euler.copyFrom(t.rotation))}return t.prototype.copyFrom=function(t){return this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scale.copyFrom(t.scale),this.euler.copyFrom(t.euler),this},t}(),rh=function(){function t(t){this.skeleton=t,this.parentSpaceTransforms=[],this.floatPropertyValues=[],this.colorPropertyValues=[];for(var e,i=ij(t.parentSpaceTransforms);!(e=i()).done;){var r=e.value;this.parentSpaceTransforms.push(new ru().copyFrom(r))}for(var n,a=ij(t.defaultFloatPropertyValues);!(n=a()).done;){var o=n.value;this.floatPropertyValues.push(o)}for(var s,u=ij(t.defaultColorPropertyValues);!(s=u()).done;){var h=s.value;this.colorPropertyValues.push(new e5().copyFrom(h))}}var e=t.prototype;return e.setPosition=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].position.copyFrom(e)},e.setRotation=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].rotation.copyFrom(e)},e.setEuler=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].euler.copyFrom(e)},e.setScale=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].scale.copyFrom(e)},e.setFloat=function(t,e){var i=this.skeleton.pathToObjectIndex.get(t);void 0!==i&&(this.floatPropertyValues[i]=e)},e.copyFrom=function(t){for(var e=0;e<this.parentSpaceTransforms.length;e++)this.parentSpaceTransforms[e].copyFrom(t.parentSpaceTransforms[e]);for(var i=0;i<this.colorPropertyValues.length;i++)this.colorPropertyValues[i].copyFrom(t.colorPropertyValues[i]);for(var r=0;r<this.floatPropertyValues.length;r++)this.floatPropertyValues[r]=t.floatPropertyValues[r]},t}(),rl=function(t){this.pose=new rh(t)};t.ApplyAdditiveNodeData=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rc,t);e.baseNode=t.getNode(this.baseNodeIndex),e.additiveNode=t.getNode(this.additiveNodeIndex),e.inputParameterValueNode=t.getNode(this.inputParameterValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.baseNodeIndex=e.baseNodeIndex,this.additiveNodeIndex=e.additiveNodeIndex,this.inputParameterValueNodeIndex=e.inputParameterValueNodeIndex},e}(i2),t.ApplyAdditiveNodeData=eG([i0(ec.ApplyAdditiveNodeData)],t.ApplyAdditiveNodeData);var rc=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseNode=null,e.additiveNode=null,e.inputParameterValueNode=null,e}iB(e,t);var i=e.prototype;return i.initializeInternal=function(e){var i,r,n;t.prototype.initializeInternal.call(this,e),this.baseNodeResult=new rl(e.skeleton),this.additiveNodeResult=new rl(e.skeleton),null==(i=this.baseNode)||i.initialize(e),null==(r=this.additiveNode)||r.initialize(e),null==(n=this.inputParameterValueNode)||n.initialize(e)},i.shutdownInternal=function(e){var i,r,n;null==(i=this.baseNode)||i.shutdown(e),null==(r=this.additiveNode)||r.shutdown(e),null==(n=this.inputParameterValueNode)||n.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){if(!this.inputParameterValueNode)return e;this.markNodeActive(t);var i=this.inputParameterValueNode.getValue(t);return this.baseNode&&!this.additiveNode?(this.baseNode.evaluate(t,this.baseNodeResult),this.applyAdditive(this.baseNodeResult.pose,this.additiveNodeResult.pose,i,e.pose)):this.baseNode&&this.additiveNode&&(this.baseNode.evaluate(t,this.baseNodeResult),this.additiveNode.evaluate(t,this.additiveNodeResult),this.applyAdditive(this.baseNodeResult.pose,this.additiveNodeResult.pose,i,e.pose)),e},i.applyAdditive=function(t,e,i,r){rs.additiveBlend(t,e,i,r)},e}(i3);t.BlendNodeData=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rf,t);e.source0=t.getNode(this.sourceNodeIndex0),e.source1=t.getNode(this.sourceNodeIndex1),e.inputParameterValueNode=t.getNode(this.inputParameterValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.sourceNodeIndex0=e.sourceNodeIndex0,this.sourceNodeIndex1=e.sourceNodeIndex1,this.inputParameterValueNodeIndex=e.inputParameterValueNodeIndex},e}(i2),t.BlendNodeData=eG([i0(ec.BlendNodeData)],t.BlendNodeData);var rf=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.source0=null,e.source1=null,e.inputParameterValueNode=null,e}iB(e,t);var i=e.prototype;return i.initializeInternal=function(e){var i,r,n;t.prototype.initializeInternal.call(this,e),this.source0Result=new rl(e.skeleton),this.source1Result=new rl(e.skeleton),null==(i=this.source0)||i.initialize(e),null==(r=this.source1)||r.initialize(e),null==(n=this.inputParameterValueNode)||n.initialize(e)},i.shutdownInternal=function(e){var i,r,n;null==(i=this.source0)||i.shutdown(e),null==(r=this.source1)||r.shutdown(e),null==(n=this.inputParameterValueNode)||n.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){if(!this.inputParameterValueNode)return e;this.markNodeActive(t);var i=this.inputParameterValueNode.getValue(t);return this.source0&&!this.source1?(this.source0.evaluate(t,this.source0Result),this.localBlend(this.source0Result.pose,this.source1Result.pose,i,e.pose)):this.source0&&this.source1&&(this.source0.evaluate(t,this.source0Result),this.source1.evaluate(t,this.source1Result),this.localBlend(this.source0Result.pose,this.source1Result.pose,i,e.pose)),e},i.localBlend=function(t,e,i,r){rs.localBlend(t,e,i,r)},e}(i3);t.AndNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodeIndices=[],e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rd,t),r=ij(this.conditionNodeIndices);!(e=r()).done;){var n=e.value;i.conditionNodes.push(t.getNode(n))}},i.load=function(e){t.prototype.load.call(this,e),this.conditionNodeIndices=e.conditionNodeIndices},e}(i2),t.AndNodeData=eG([i0(ec.AndNodeData)],t.AndNodeData);var rd=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodes=[],e.result=!1,e}iB(e,t);var i=e.prototype;return i.getValue=function(t){if(!this.isUpdated(t)){this.markNodeActive(t),this.result=!0;for(var e,i=ij(this.conditionNodes);!(e=i()).done;)if(!e.value.getValue(t)){this.result=!1;break}}return this.result},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e);for(var i,r=ij(this.conditionNodes);!(i=r()).done;)i.value.initialize(e);this.result=!1},i.shutdownInternal=function(e){for(var i,r=ij(this.conditionNodes);!(i=r()).done;)i.value.shutdown(e);t.prototype.shutdownInternal.call(this,e)},e}(i6);t.OrNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodeIndices=[],e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rp,t),r=ij(this.conditionNodeIndices);!(e=r()).done;){var n=e.value;i.conditionNodes.push(t.getNode(n))}},i.load=function(e){t.prototype.load.call(this,e),this.conditionNodeIndices=e.conditionNodeIndices},e}(i2),t.OrNodeData=eG([i0(ec.OrNodeData)],t.OrNodeData);var rp=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodes=[],e.result=!1,e}iB(e,t);var i=e.prototype;return i.getValue=function(t){if(!this.isUpdated(t)){this.markNodeActive(t),this.result=!1;for(var e,i=ij(this.conditionNodes);!(e=i()).done;)if(e.value.getValue(t)){this.result=!0;break}}return this.result},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e);for(var i,r=ij(this.conditionNodes);!(i=r()).done;)i.value.initialize(e);this.result=!1},i.shutdownInternal=function(e){for(var i,r=ij(this.conditionNodes);!(i=r()).done;)i.value.shutdown(e);t.prototype.shutdownInternal.call(this,e)},e}(i6);t.NotNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rm,t).inputValueNode=t.getNode(this.inputValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex},e}(i2),t.NotNodeData=eG([i0(ec.NotNodeData)],t.NotNodeData);var rm=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.result=!1,e}iB(e,t);var i=e.prototype;return i.getValue=function(t){return!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&(this.result=!this.inputValueNode.getValue(t))),this.result},i.initializeInternal=function(e){var i;t.prototype.initializeInternal.call(this,e),null==(i=this.inputValueNode)||i.initialize(e),this.result=!1},i.shutdownInternal=function(e){var i;null==(i=this.inputValueNode)||i.shutdown(e),t.prototype.shutdownInternal.call(this,e)},e}(i6);t.ConstFloatNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rv,t).value=this.value},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(i2),t.ConstFloatNodeData=eG([i0(ec.ConstFloatNodeData)],t.ConstFloatNodeData);var rv=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}return iB(e,t),e.prototype.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},e}(i5);t.ConstBoolNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!0,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(ry,t).value=this.value},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(i2),t.ConstBoolNodeData=eG([i0(ec.ConstBoolNodeData)],t.ConstBoolNodeData);var ry=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!0,e}return iB(e,t),e.prototype.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},e}(i6);t.ControlParameterFloatNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rg,t).setValue(this.value)},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(i2),t.ControlParameterFloatNodeData=eG([i0(ec.ControlParameterFloatNodeData)],t.ControlParameterFloatNodeData);var rg=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iB(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i5);t.ControlParameterBoolNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rx,t).setValue(this.value)},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(i2),t.ControlParameterBoolNodeData=eG([i0(ec.ControlParameterBoolNodeData)],t.ControlParameterBoolNodeData);var rx=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iB(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i6);t.ControlParameterTriggerNodeData=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rb,t)},i.load=function(e){t.prototype.load.call(this,e)},e}(i2),t.ControlParameterTriggerNodeData=eG([i0(ec.ControlParameterTriggerNodeData)],t.ControlParameterTriggerNodeData);var rb=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iB(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i6);t.LayerBlendNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseNodeIndex=-1,e.layerDatas=[],e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rT,t);e.baseLayerNode=t.getNode(this.baseNodeIndex);for(var i,r=ij(this.layerDatas);!(i=r()).done;){var n=i.value;e.layers.push({inputNode:t.getNode(n.inputNodeIndex),weightValueNode:t.getNode(n.weightValueNodeIndex),weight:0})}},i.load=function(e){if(t.prototype.load.call(this,e),this.baseNodeIndex=null!=(i=e.baseNodeIndex)?i:-1,e.layerDatas)for(var i,r,n=ij(e.layerDatas);!(r=n()).done;){var a=r.value;this.layerDatas.push(i7({inputNodeIndex:-1,weightValueNodeIndex:-1},a))}},e}(i2),t.LayerBlendNodeData=eG([i0(ec.LayerBlendNodeData)],t.LayerBlendNodeData);var rT=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseLayerNode=null,e.layers=[],e}iB(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.layerNodeResult=new rl(e.skeleton),null==(i=this.baseLayerNode)||i.initialize(e);for(var i,r,n=ij(this.layers);!(r=n()).done;){var a,o,s=r.value;null==(a=s.inputNode)||a.initialize(e),null==(o=s.weightValueNode)||o.initialize(e)}},i.shutdownInternal=function(e){null==(i=this.baseLayerNode)||i.shutdown(e);for(var i,r,n=ij(this.layers);!(r=n()).done;){var a,o,s=r.value;null==(a=s.inputNode)||a.shutdown(e),null==(o=s.weightValueNode)||o.shutdown(e)}t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){return this.baseLayerNode&&this.baseLayerNode.isValid()&&(this.markNodeActive(t),this.previousTime=this.baseLayerNode.getCurrentTime(),e=this.baseLayerNode.evaluate(t,e),this.currentTime=this.baseLayerNode.getCurrentTime(),this.duration=this.baseLayerNode.getDuration(),this.updateLayers(t,e)),e},i.updateLayers=function(t,e){for(var i,r=ij(this.layers);!(i=r()).done;){var n=i.value;if(n.inputNode&&n.weightValueNode){this.layerNodeResult.pose.copyFrom(e.pose),n.inputNode.evaluate(t,this.layerNodeResult);var a=n.weightValueNode.getValue(t);rs.localBlend(e.pose,this.layerNodeResult.pose,a,e.pose)}}return e},e}(i3);t.EqualNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e.comparandValueNodeIndex=-1,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rC,t);e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex,this.comparandValueNodeIndex=e.comparandValueNodeIndex},e}(i2),t.EqualNodeData=eG([i0(ec.EqualNodeData)],t.EqualNodeData);var rC=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.comparandValueNode=null,e.result=!1,e}iB(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.inputValueNode&&this.inputValueNode.initialize(e),this.comparandValueNode&&this.comparandValueNode.initialize(e)},i.shutdownInternal=function(e){this.inputValueNode&&this.inputValueNode.shutdown(e),this.comparandValueNode&&this.comparandValueNode.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.getValue=function(t){if(!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&this.comparandValueNode)){var e=this.inputValueNode.getValue(t),i=this.comparandValueNode.getValue(t);this.result=e===i}return this.result},e}(i6),rE=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e.comparandValueNodeIndex=-1,e}return iB(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex,this.comparandValueNodeIndex=e.comparandValueNodeIndex},e}(i2);($=eC||(eC={}))[$.GreaterThan=0]="GreaterThan",$[$.LessThan=1]="LessThan";var r_=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.comparandValueNode=null,e.comparison=0,e.result=!1,e}iB(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.inputValueNode&&this.inputValueNode.initialize(e),this.comparandValueNode&&this.comparandValueNode.initialize(e)},i.shutdownInternal=function(e){this.inputValueNode&&this.inputValueNode.shutdown(e),this.comparandValueNode&&this.comparandValueNode.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.getValue=function(t){if(!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&this.comparandValueNode)){var e=this.inputValueNode.getValue(t),i=this.comparandValueNode.getValue(t);switch(this.comparison){case 0:this.result=e>i;break;case 1:this.result=e<i}}return this.result},e}(i6);t.GreaterNodeData=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.instantiate=function(t){var e=this.createNode(r_,t);e.comparison=0,e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},e}(rE),t.GreaterNodeData=eG([i0(ec.GreaterNodeData)],t.GreaterNodeData),t.LessNodeData=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.instantiate=function(t){var e=this.createNode(r_,t);e.comparison=1,e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},e}(rE),t.LessNodeData=eG([i0(ec.LessNodeData)],t.LessNodeData),t.StateMachineNodeData=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rw,t),r=ij(this.stateDatas);!(e=r()).done;){var n=e.value,a={stateNode:t.getNode(n.stateNodeIndex),transitions:[]};i.states.push(a);for(var o,s=ij(n.transitionDatas);!(o=s()).done;){var u=o.value,h={transitionNode:t.getNode(u.transitionNodeIndex),conditionNode:t.getNode(u.conditionNodeIndex),targetStateIndex:u.targetStateIndex};a.transitions.push(h)}}},i.load=function(e){t.prototype.load.call(this,e),this.stateDatas=e.stateDatas,this.defaultStateIndex=e.defaultStateIndex,this.machineName=e.machineName},e}(i2),t.StateMachineNodeData=eG([i0(ec.StateMachineNodeData)],t.StateMachineNodeData);var rw=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.states=[],e.activeTransition=null,e.activeStateIndex=-1,e}iB(e,t);var i=e.prototype;return i.getCurrentStateName=function(){return this.states[this.activeStateIndex].stateNode.getNodeData().stateName},i.evaluate=function(t,e){if(this.markNodeActive(t),null!==this.activeTransition&&this.activeTransition.isComplete(t)&&(this.activeTransition.shutdown(t),this.activeTransition=null),null===this.activeTransition){var i=this.states[this.activeStateIndex].stateNode;e=i.evaluate(t,e),this.duration=i.getDuration(),this.previousTime=i.getPreviousTime(),this.currentTime=i.getCurrentTime()}else e=this.activeTransition.evaluate(t,e),this.duration=this.activeTransition.getDuration(),this.previousTime=this.activeTransition.getPreviousTime(),this.currentTime=this.activeTransition.getCurrentTime();return t.branchState===eb.Active&&this.evaluateTransitions(t,e),e},i.evaluateTransitions=function(t,e){for(var i=this.states[this.activeStateIndex],r=-1,n=i.transitions.length,a=0;a<n;a++){var o=i.transitions[a];if(-1===o.targetStateIndex)throw Error("Invalid target state index.");if(!this.states[o.targetStateIndex].stateNode.isTransitioning()){var s=!1;if(o.transitionNode.hasExitTime){var u=i.stateNode;u.getElapsedTimeInState()/u.getDuration()>o.transitionNode.exitTime&&(s=!0)}else null!==o.conditionNode&&o.conditionNode.getValue(t)&&(s=!0);if(s){r=a;break}}}if(-1!==r){var h=i.transitions[r];h.transitionNode.initialize(t),e=null!==this.activeTransition?h.transitionNode.startTransitionFromTransition(t,e,this.activeTransition,e):h.transitionNode.startTransitionFromState(t,e,this.states[this.activeStateIndex].stateNode,e),this.activeTransition=h.transitionNode,this.shutdownTransitionConditions(t),this.activeStateIndex=h.targetStateIndex,this.initializeTransitionConditions(t),this.duration=this.states[this.activeStateIndex].stateNode.getDuration(),this.previousTime=this.states[this.activeStateIndex].stateNode.getPreviousTime(),this.currentTime=this.states[this.activeStateIndex].stateNode.getCurrentTime()}},i.selectDefaultState=function(t){return this.getNodeData().defaultStateIndex},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.activeStateIndex=this.selectDefaultState(e);var i=this.states[this.activeStateIndex].stateNode;i.initialize(e),this.duration=i.getDuration(),this.previousTime=i.getPreviousTime(),this.currentTime=i.getCurrentTime(),this.initializeTransitionConditions(e)},i.shutdownInternal=function(e){null!==this.activeTransition&&this.activeTransition.shutdown(e),this.shutdownTransitionConditions(e),this.states[this.activeStateIndex].stateNode.shutdown(e),this.activeStateIndex=-1,this.activeTransition=null,t.prototype.shutdownInternal.call(this,e)},i.initializeTransitionConditions=function(t){for(var e,i=ij(this.states[this.activeStateIndex].transitions);!(e=i()).done;){var r=e.value;null!==r.conditionNode&&r.conditionNode.initialize(t)}},i.shutdownTransitionConditions=function(t){for(var e,i=ij(this.states[this.activeStateIndex].transitions);!(e=i()).done;){var r=e.value;null!==r.conditionNode&&r.conditionNode.shutdown(t)}},e}(i3);t.TransitionState=void 0,(tt=t.TransitionState||(t.TransitionState={}))[tt.None=0]="None",tt[tt.TransitioningIn=1]="TransitioningIn",tt[tt.TransitioningOut=2]="TransitioningOut",t.StateNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.childNodeIndex=-1,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rS,t).childNode=t.getNode(this.childNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.childNodeIndex=e.childNodeIndex,this.stateName=e.stateName},e}(i2),t.StateNodeData=eG([i0(ec.StateNodeData)],t.StateNodeData);var rS=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.childNode=null,e.transitionState=0,e.elapsedTimeInState=0,e.isFirstStateUpdate=!1,e}iB(e,t);var i=e.prototype;return i.isTransitioning=function(){return 0!==this.transitionState},i.isTransitioningIn=function(){return 1===this.transitionState},i.isTransitioningOut=function(){return 2===this.transitionState},i.startTransitionIn=function(t){this.transitionState=1},i.startTransitionOut=function(t){this.transitionState=2},i.setTransitioningState=function(t){this.transitionState=t},i.getElapsedTimeInState=function(){return this.elapsedTimeInState},i.evaluate=function(t,e){return this.markNodeActive(t),null!==this.childNode&&this.childNode.isValid()&&(e=this.childNode.evaluate(t,e),this.duration=this.childNode.getDuration(),this.previousTime=this.childNode.getPreviousTime(),this.currentTime=this.childNode.getCurrentTime()),this.elapsedTimeInState+=t.deltaTime,this.isFirstStateUpdate=!1,e},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.transitionState=0,this.elapsedTimeInState=0,this.previousTime=this.currentTime=0,this.duration=0,null!==this.childNode&&(this.childNode.initialize(e),this.childNode.isValid()&&(this.duration=this.childNode.getDuration(),this.previousTime=this.childNode.getPreviousTime(),this.currentTime=this.childNode.getCurrentTime())),this.isFirstStateUpdate=!0},i.shutdownInternal=function(e){null!==this.childNode&&this.childNode.shutdown(e),this.transitionState=0,t.prototype.shutdownInternal.call(this,e)},e}(i3);t.SourceType=void 0,(te=t.SourceType||(t.SourceType={}))[te.State=0]="State",te[te.Transition=1]="Transition",te[te.CachedPose=2]="CachedPose",t.TransitionNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.hasExitTime=!1,e.exitTime=.75,e.targetStateNodeIndex=-1,e}iB(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rM,t);e.targetNode=t.getNode(this.targetStateNodeIndex),e.hasExitTime=this.hasExitTime,e.exitTime=this.exitTime},i.load=function(e){t.prototype.load.call(this,e),this.duration=e.duration,this.hasExitTime=e.hasExitTime,this.exitTime=e.exitTime,this.targetStateNodeIndex=e.targetStateNodeIndex},e}(i2),t.TransitionNodeData=eG([i0(ec.TransitionNodeData)],t.TransitionNodeData);var rM=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.hasExitTime=!1,t.exitTime=.75,t.transitionLength=0,t.transitionProgress=0,t.blendWeight=0,t.sourceNode=null,t.sourceType=0,t.blendedDuration=0,t}iB(i,e);var r=i.prototype;return r.evaluate=function(t,e){im(this.sourceNode),this.markNodeActive(t),this.isSourceATransition()&&this.getSourceTransitionNode().isComplete(t)&&this.endSourceTransition(t),this.transitionProgress=this.transitionProgress+t.deltaTime/this.transitionLength,this.transitionProgress=e1(this.transitionProgress,0,1),this.calculateBlendWeight();var i=this.sourceNodeResult,r=t.branchState;t.branchState=eb.Inactive,i=this.sourceNode.evaluate(t,i),t.branchState=r;var n=this.targetNode.evaluate(t,this.targetNodeResult);if(this.registerPoseTasksAndUpdateRootMotion(i,n,e),this.blendedDuration=e0(this.sourceNode.getDuration(),this.targetNode.getDuration(),this.blendWeight),this.blendedDuration>0){var a=t.deltaTime/this.blendedDuration;this.previousTime=this.currentTime,this.currentTime=(this.currentTime+a)%1}else this.previousTime=this.currentTime=1;return this.duration=this.targetNode.getDuration(),e},r.isComplete=function(t){return this.transitionLength<=0||this.transitionProgress+t.deltaTime/this.transitionLength>=1},r.getProgressPercentage=function(){return this.transitionProgress},r.getSourceType=function(){return this.sourceType},r.isSourceATransition=function(){return 1===this.sourceType},r.isSourceAState=function(){return 0===this.sourceType},r.startTransitionFromState=function(t,e,i,r){return this.sourceNode=i,this.sourceType=0,this.initializeTargetStateAndUpdateTransition(t,e,r)},r.startTransitionFromTransition=function(t,e,i,r){return this.sourceNode=i,this.sourceType=1,this.initializeTargetStateAndUpdateTransition(t,e,r)},r.getSourceStateNode=function(){return this.sourceNode},r.getSourceTransitionNode=function(){return this.sourceNode},r.notifyNewTransitionStarting=function(t,e){if(this.isSourceATransition()){var i=this.getSourceTransitionNode().targetNode;i===e&&(this.sourceType=2,i.shutdown(t),this.sourceNode=null)}else this.isSourceAState()&&this.sourceNode===e&&(this.sourceType=2,this.sourceNode.shutdown(t),this.sourceNode=null);this.isSourceATransition()&&this.getSourceTransitionNode().notifyNewTransitionStarting(t,e)},r.initializeInternal=function(t){e.prototype.initializeInternal.call(this,t),this.sourceNodeResult=new rl(t.skeleton),this.targetNodeResult=new rl(t.skeleton),this.transitionLength=this.getNodeData().duration,this.transitionProgress=0,this.blendWeight=0},r.shutdownInternal=function(i){this.targetNode.setTransitioningState(t.TransitionState.None),this.currentTime=1,this.sourceNode&&(this.isSourceATransition()&&this.endSourceTransition(i),this.sourceNode.shutdown(i),this.sourceNode=null),e.prototype.shutdownInternal.call(this,i)},r.endSourceTransition=function(e){var i,r=this.getSourceTransitionNode().targetNode;null==(i=this.sourceNode)||i.shutdown(e),this.sourceNode=r,this.sourceType=0,this.getSourceStateNode().setTransitioningState(t.TransitionState.TransitioningOut)},r.initializeTargetStateAndUpdateTransition=function(t,e,i){this.markNodeActive(t);var r=this.targetNodeResult;return 0===this.sourceType&&this.getSourceStateNode().startTransitionOut(t),this.targetNode.initialize(t),this.targetNode.startTransitionIn(t),r=this.targetNode.evaluate(t,r),this.calculateBlendWeight(),this.registerPoseTasksAndUpdateRootMotion(e,r,i),this.previousTime=0,this.currentTime=0,this.blendedDuration=e0(this.sourceNode.getDuration(),this.targetNode.getDuration(),this.blendWeight),this.duration=this.targetNode.getDuration(),i},r.calculateBlendWeight=function(){0===this.transitionLength?this.blendWeight=1:(this.blendWeight=this.transitionProgress,this.blendWeight=e1(this.blendWeight,0,1))},r.registerPoseTasksAndUpdateRootMotion=function(t,e,i){var r=this.blendWeight;rs.localBlend(t.pose,e.pose,r,i.pose)},i}(i3);(ti=eE||(eE={}))[ti.Float=0]="Float",ti[ti.Color=1]="Color";var rA=function(){function t(t,e){this.rootBone=t,this.useEuler=!1,this.pathToObjectIndex=new Map,this.floatAnimatedObjects=[],this.defaultFloatPropertyValues=[],this.colorAnimatedObjects=[],this.defaultColorPropertyValues=[],this.animatedTransforms=[],this.parentSpaceTransforms=[],this.pathToBoneIndex=new Map;for(var i,r=ij(e.position);!(i=r()).done;){var n=i.value;this.addReferenceTransform(n)}for(var a,o=ij(e.rotation);!(a=o()).done;){var s=a.value;this.addReferenceTransform(s)}for(var u,h=ij(e.scale);!(u=h()).done;){var l=u.value;this.addReferenceTransform(l)}for(var c,f=ij(e.euler);!(c=f()).done;){var d=c.value;this.addReferenceTransform(d),this.useEuler=!0}for(var p=0;p<e.floats.length;p++){var m=e.floats[p];this.addRecordedProperty(m.path,m.className,m.property,0)}for(var v=0;v<e.colors.length;v++){var y=e.colors[v];this.addRecordedProperty(y.path,y.className,y.property,1)}}var e=t.prototype;return e.addReferenceTransform=function(t){if(!this.pathToBoneIndex.get(t)){var e=this.findTarget(t);e&&(this.parentSpaceTransforms.push(new ru(e.transform)),this.animatedTransforms.push(e.transform),this.pathToBoneIndex.set(t,this.parentSpaceTransforms.length-1))}},e.addRecordedProperty=function(t,e,i,r){var n,a=t+e+i;if(void 0===this.pathToObjectIndex.get(a)){var o=this.findTarget(t);if(o){(n="VFXItem"===e?o:o.getComponent(iY[e]))||console.error("The "+e+" Component was not found.");for(var s=i.split("."),u=s[s.length-1],h=n,l=0;l<s.length-1;l++){var c=h[s[l]];void 0===c&&console.error("The "+s[l]+" property of "+h+" was not found."),h=c}var f={target:n,propertyPath:i,directTarget:h,propertyName:u};switch(r){case 0:this.floatAnimatedObjects.push(f),this.defaultFloatPropertyValues.push(h[u]),this.pathToObjectIndex.set(a,this.floatAnimatedObjects.length-1);break;case 1:this.colorAnimatedObjects.push(f),this.defaultColorPropertyValues.push(new e5().copyFrom(h[u])),this.pathToObjectIndex.set(a,this.colorAnimatedObjects.length-1)}}}},e.findTarget=function(t){if(""===t)return this.rootBone;for(var e,i=t.split("/"),r=this.rootBone,n=ij(i);!(e=n()).done;){var a=e.value,o=r.find(a);if(!o)return null;r=o}return r},t}(),rP=function(){function t(t,e){this.graphAsset=t,this.nodes=[],this.activeEvents=[],this.context=new i8;for(var i,r={position:[],scale:[],rotation:[],euler:[],floats:[],colors:[]},n=ij(t.graphDataSet.resources);!(i=n()).done;){var a=i.value;if(a){for(var o,s=ij(a.positionCurves);!(o=s()).done;){var u=o.value;r.position.push(u.path)}for(var h,l=ij(a.rotationCurves);!(h=l()).done;){var c=h.value;r.rotation.push(c.path)}for(var f,d=ij(a.scaleCurves);!(f=d()).done;){var p=f.value;r.scale.push(p.path)}for(var m,v=ij(a.eulerCurves);!(m=v()).done;){var y=m.value;r.euler.push(y.path)}for(var g,x=ij(a.floatCurves);!(g=x()).done;){var b=g.value;r.floats.push(b)}for(var T,C=ij(a.colorCurves);!(T=C()).done;){var E=T.value;r.colors.push(E)}}}this.skeleton=new rA(e,r),this.result=new rl(this.skeleton),this.context.skeleton=this.skeleton,this.context.activeEvents=this.activeEvents;var _=new i9;_.nodes=this.nodes,_.nodeDatas=t.nodeDatas,_.dataSet=t.graphDataSet;for(var w=0;w<t.nodeDatas.length;w++)_.nodes[w]||t.nodeDatas[w].instantiate(_);this.rootNode=this.nodes[t.rootNodeIndex]}var e=t.prototype;return e.evaluateGraph=function(t){this.activeEvents.length=0,this.context.update(t),this.rootNode.isInitialized()||this.resetGraphState(),this.rootNode&&(this.result=this.rootNode.evaluate(this.context,this.result));for(var e=0;e<this.getNumControlParameters();e++){var i=this.nodes[e];eU(i,rb)&&i.setValue(!1)}return this.result},e.isInitialized=function(){return this.rootNode&&this.rootNode.isInitialized()},e.isNodeActive=function(t){return this.isControlParameter(t)||this.nodes[t].isNodeActive(this.context.updateID)},e.getStateMachineNode=function(t){for(var e,i=null,r=ij(this.nodes);!(e=r()).done;){var n=e.value;eU(n,rw)&&n.getNodeData().machineName===t&&(i=n)}return i},e.resetGraphState=function(){this.rootNode.isInitialized()&&this.rootNode.shutdown(this.context),this.context.updateID++,this.rootNode.initialize(this.context)},e.getNumControlParameters=function(){return this.graphAsset.controlParameterIDs.length},e.getControlParameterIndex=function(t){var e=this.graphAsset.parameterLookupMap.get(t);return void 0!==e?e:(console.warn("Parameter '"+t+"' does not exist."),-1)},e.getControlParameterID=function(t){return this.graphAsset.controlParameterIDs[t]},e.setBool=function(t,e){this.setControlParameterValue(t,e)},e.setFloat=function(t,e){this.setControlParameterValue(t,e)},e.setTrigger=function(t){this.setControlParameterValue(t,!0)},e.resetTrigger=function(t){this.setControlParameterValue(t,!1)},e.getPoseNodeDebugInfo=function(t){return this.nodes[t].getDebugInfo()},e.getRuntimeNodeDebugValue=function(t){return this.nodes[t].getValue(this.context)},e.getNodeDebugInstance=function(t){return this.nodes[t]},e.isControlParameter=function(t){return t<this.getNumControlParameters()},e.setControlParameterValue=function(t,e){var i=this.getControlParameterIndex(t);-1!==i&&this.nodes[i].setValue(e)},t}();function rR(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rI(t,e,i){return e&&rR(t.prototype,e),i&&rR(t,i),t}var rO=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.isAwakeCalled=!1,e.isStartCalled=!1,e.isEnableCalled=!1,e._enabled=!0,e}iB(e,t);var i=e.prototype;return i.onAwake=function(){},i.onEnable=function(){},i.onDisable=function(){},i.onStart=function(){},i.onUpdate=function(t){},i.onLateUpdate=function(t){},i.onPreRender=function(){},i.onDestroy=function(){},i.onApplyAnimationProperties=function(){},i.onParentChanged=function(){},i.enable=function(){this.item.composition&&(this.item.composition.sceneTicking.addComponent(this),this.isEnableCalled=!0),this.onEnable()},i.disable=function(){this.onDisable(),this.item.composition&&(this.isEnableCalled=!1,this.item.composition.sceneTicking.removeComponent(this))},i.setVFXItem=function(t){this.item=t,t.isDuringPlay&&(this.isAwakeCalled||(this.onAwake(),this.isAwakeCalled=!0),t.isActive&&this.enabled&&(this.start(),this.enable()))},i.fromData=function(e){t.prototype.fromData.call(this,e)},i.dispose=function(){this.isEnableCalled&&this.disable(),this.isAwakeCalled&&(this.isAwakeCalled=!1,this.onDestroy()),this.item&&eq(this.item.components,this),t.prototype.dispose.call(this)},i.start=function(){this.isStartCalled||(this.isStartCalled=!0,this.onStart())},rI(e,[{key:"transform",get:function(){return this.item.transform}},{key:"isActiveAndEnabled",get:function(){return this.item.isActive&&this.enabled}},{key:"enabled",get:function(){return this._enabled},set:function(t){if(this.enabled!==t){var e;this._enabled=t,(null==(e=this.item)?void 0:e.isDuringPlay)&&this.item.isActive&&(t?this.isEnableCalled||(this.enable(),this.isStartCalled||(this.onStart(),this.isStartCalled=!0)):this.isEnableCalled&&this.disable())}}}]),e}(iQ);eG([iK(void 0,void 0)],rO.prototype,"item",void 0),eG([iK(void 0,void 0)],rO.prototype,"_enabled",void 0);var rL=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.setVFXItem=function(e){t.prototype.setVFXItem.call(this,e)},i.dispose=function(){t.prototype.dispose.call(this)},e}(rO);t.Animator=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.graphInstance=null,e.graphAsset=null,e}iB(e,t);var i=e.prototype;return i.setBool=function(t,e){this.graphInstance&&this.graphInstance.setBool(t,e)},i.setFloat=function(t,e){this.graphInstance&&this.graphInstance.setFloat(t,e)},i.setTrigger=function(t){this.graphInstance&&this.graphInstance.setTrigger(t)},i.resetTrigger=function(t){this.graphInstance&&this.graphInstance.resetTrigger(t)},i.getStateMachineNode=function(t){var e=null;return this.graphInstance&&(e=this.graphInstance.getStateMachineNode(t)),e},i.onStart=function(){this.graphAsset&&(this.graphInstance=new rP(this.graphAsset,this.item))},i.onUpdate=function(t){if(this.graphInstance){for(var e=this.graphInstance.evaluateGraph(t/1e3),i=this.graphInstance.skeleton.animatedTransforms,r=0;r<i.length;r++){var n=e.pose.parentSpaceTransforms[r].position,a=e.pose.parentSpaceTransforms[r].rotation,o=e.pose.parentSpaceTransforms[r].scale,s=e.pose.parentSpaceTransforms[r].euler;i[r].setPosition(n.x,n.y,n.z),i[r].setScale(o.x,o.y,o.z),this.graphInstance.skeleton.useEuler?i[r].setRotation(s.x,s.y,s.z):i[r].setQuaternion(a.x,a.y,a.z,a.w)}for(var u=this.graphInstance.skeleton.floatAnimatedObjects,h=0;h<u.length;h++){var l=u[h],c=l.propertyName;l.directTarget[c]=e.pose.floatPropertyValues[h],eU(l.target,rO)&&l.target.onApplyAnimationProperties()}for(var f=this.graphInstance.skeleton.colorAnimatedObjects,d=0;d<f.length;d++){var p=f[d],m=p.propertyName;p.directTarget[m]=e.pose.colorPropertyValues[d],eU(p.target,rO)&&p.target.onApplyAnimationProperties()}for(var v,y=ij(this.graphInstance.activeEvents);!(v=y()).done;){var g=v.value;g.data.event.onEvent(this.item,g)}}},i.fromData=function(t){this.graphAsset=this.engine.findObject(t.graphAsset)},e}(rO),t.Animator=eG([iZ("Animator")],t.Animator),t.ShaderType=void 0,(tr=t.ShaderType||(t.ShaderType={}))[tr.vertex=0]="vertex",tr[tr.fragment=1]="fragment",t.MaskMode=void 0,(tn=t.MaskMode||(t.MaskMode={}))[tn.NONE=0]="NONE",tn[tn.MASK=1]="MASK",tn[tn.OBSCURED=2]="OBSCURED",tn[tn.REVERSE_OBSCURED=3]="REVERSE_OBSCURED";var rF=[],rV={},rN="WebGL Constants not in global, please check your environment";function rk(){"function"==typeof WebGL2RenderingContext?rD(WebGL2RenderingContext):"undefined"!=typeof WebGLRenderingContext?(rD(WebGLRenderingContext),rD(WebGLRenderingContext.prototype)):ii?rF.push(ir()?"iOS16 lockdown mode, WebGL Constants not in global":rN):rF.push(rN),rF.length||"HALF_FLOAT"in rV||(rV.HALF_FLOAT=5131)}function rD(t){for(var e in t)/^[A-Z_]/.test(e)&&(rV[e]=t[e])}function rz(t){switch(t){case tz.ALPHA:case tz.ADD:case tz.SUBTRACTION:case tz.STRONG_LIGHT:case tz.WEAK_LIGHT:return 1;case tz.SUPERPOSITION:return 2;case tz.BRIGHTNESS:return 3;case tz.MULTIPLY:return 0;default:return 1}}function rB(t,e){switch(e){case void 0:case tz.ALPHA:t.blendFunction=[rV.ONE,rV.ONE_MINUS_SRC_ALPHA,rV.ONE,rV.ONE_MINUS_SRC_ALPHA];break;case tz.ADD:t.blendFunction=[rV.ONE,rV.ONE,rV.ONE,rV.ONE];break;case tz.SUBTRACTION:t.blendFunction=[rV.ONE,rV.ONE,rV.ZERO,rV.ONE],t.blendEquation=[rV.FUNC_REVERSE_SUBTRACT,rV.FUNC_REVERSE_SUBTRACT];break;case tz.SUPERPOSITION:t.blendFunction=[rV.ONE,rV.ONE,rV.ONE,rV.ONE];break;case tz.MULTIPLY:t.blendFunction=[rV.DST_COLOR,rV.ONE_MINUS_SRC_ALPHA,rV.DST_COLOR,rV.ONE_MINUS_SRC_ALPHA];break;case tz.BRIGHTNESS:t.blendFunction=[rV.ONE,rV.ONE_MINUS_SRC_ALPHA,rV.ONE,rV.ONE_MINUS_SRC_ALPHA];break;case tz.STRONG_LIGHT:t.blendFunction=[rV.DST_COLOR,rV.DST_ALPHA,rV.ZERO,rV.ONE];break;case tz.WEAK_LIGHT:t.blendFunction=[rV.DST_COLOR,rV.ZERO,rV.ZERO,rV.ONE];break;default:console.warn("BlendMode "+e+" not in specification, please set blend params separately.")}}function rU(t,e){e===tB.DOUBLE?t.culling=!1:(t.culling=!0,t.frontFace=rV.CW,t.cullFace=e===tB.BACK?rV.BACK:rV.FRONT)}rF.length||rk(),t.TextureLoadAction=void 0,(ta=t.TextureLoadAction||(t.TextureLoadAction={}))[ta.whatever=0]="whatever",ta[ta.clear=2]="clear",t.TextureSourceType=void 0,(to=t.TextureSourceType||(t.TextureSourceType={}))[to.none=0]="none",to[to.data=1]="data",to[to.image=2]="image",to[to.compressed=3]="compressed",to[to.video=4]="video",to[to.canvas=5]="canvas",to[to.framebuffer=6]="framebuffer",to[to.mipmaps=7]="mipmaps";var rG=function(){function t(){this.callbacks={}}var e=t.prototype;return e.downloadJSON=function(t,e,i){this.download(t,"json",e,i)},e.downloadBinary=function(t,e,i){this.download(t,"arraybuffer",e,i)},e.downloadBlob=function(t,e,i){this.download(t,"blob",e,i)},e.downloadText=function(t,e,i){this.download(t,"text",e,i)},e.download=function(e,i,r,n){var a=this;if(void 0===i&&(i="json"),!this.start(e,r,n)){var o=new XMLHttpRequest,s=function(){a.finish(e,o.status,o.response)};o.responseType=i,o.addEventListener("load",function(){200==o.status||0==o.status&&t.trustXHRStatusZero?a.finish(e,200,o.response):s()}),o.addEventListener("error",s),o.open("GET",e,!0),o.send()}},e.start=function(t,e,i){var r=this.callbacks[t];try{if(r)return!0;this.callbacks[t]=r=[]}finally{r.push(e,i)}},e.finish=function(e,i,r){var n=this.callbacks[e];delete this.callbacks[e];for(var a=200==i||0==i&&t.trustXHRStatusZero?[r]:[i,r],o=a.length-1,s=n.length;o<s;o+=2)n[o].apply(null,a)},t}();rG.trustXHRStatusZero=!1;var rW=!1,rj=!1;function rX(t,e){return rH.apply(this,arguments)}function rH(){return(rH=eB(function(t,e){return eW(this,function(i){switch(i.label){case 0:if(!(rW||!e))return[3,2];return[4,rq(t)];case 1:case 5:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,rq(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),rW=!0,[4,rq(t)];case 6:return[2]}})})).apply(this,arguments)}function rY(t,e){return rZ.apply(this,arguments)}function rZ(){return(rZ=eB(function(t,e){return eW(this,function(i){switch(i.label){case 0:if(!(rj||!e))return[3,2];return[4,rq(t)];case 1:case 5:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,rq(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),rj=!0,[4,rq(t)];case 6:return[2]}})})).apply(this,arguments)}function rq(t){return rK.apply(this,arguments)}function rK(){return(rK=eB(function(t){var e,i;return eW(this,function(r){if(e="",eU(t,HTMLImageElement)){if(t.complete)return[2,t];e=t.src}else eU(t,Blob)?(e=URL.createObjectURL(t),i=!0):"string"==typeof t&&(e=t);if(!e)throw Error("Invalid url type: "+JSON.stringify(t)+".");return[2,new Promise(function(t,r){var n=new Image;/^data:/.test(e)||(n.crossOrigin="*"),n.onload=function(){return n.onload=null,i&&URL.revokeObjectURL(e),t(n)},n.onerror=function(t){return n.onerror=null,i&&URL.revokeObjectURL(e),r("Load image fail: "+e+", reason: "+JSON.stringify(t))},n.src=e})]})})).apply(this,arguments)}function rQ(t){return rJ.apply(this,arguments)}function rJ(){return(rJ=eB(function(t){return eW(this,function(e){return[2,new Promise(function(e,i){new rG().downloadBinary(t,e,function(e,r){i("Couldn't load bins "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function r$(){return(r$=eB(function(t){return eW(this,function(e){return[2,new Promise(function(e,i){new rG().downloadBlob(t,e,function(e,r){i("Couldn't load blob "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function r0(t){return r1.apply(this,arguments)}function r1(){return(r1=eB(function(t){var e;return eW(this,function(i){return e=document.createElement("video"),"string"==typeof t?e.src=t:e.srcObject=t,e.crossOrigin="anonymous",e.muted=!0,e.autoplay=!1,ia()&&e.setAttribute("renderer","standard"),e.setAttribute("playsinline","playsinline"),[2,new Promise(function(t,i){var r=!1,n=function(){r||(r=!0,o(),t(e))},a=function(){r||(r=!0,o(),i("Load video fail."))},o=function(){e.removeEventListener("loadeddata",n),e.removeEventListener("canplay",n),e.removeEventListener("error",a)};e.addEventListener("loadeddata",n),e.addEventListener("canplay",n),e.addEventListener("error",a),e.play().catch(function(t){console.warn("Autoplay blocked:",t)})})]})})).apply(this,arguments)}function r2(t,e){return r3.apply(this,arguments)}function r3(){return(r3=eB(function(t,e){return eW(this,function(i){switch(i.label){case 0:if(!Array.isArray(t))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,5]),[4,e(t[0])];case 2:case 4:return[2,i.sent()];case 3:return i.sent(),[4,e(t[1])];case 5:return[2,e(t)]}})})).apply(this,arguments)}function r4(t,e,i){return r5.apply(this,arguments)}function r5(){return(r5=eB(function(e,i,r,n){var a,o,s,u,h,l,c;return eW(this,function(f){switch(f.label){case 0:if(void 0===n&&(n=[]),34067!==e.target)return[3,2];return a=e.mipmaps,o=e.target,[4,Promise.all(a.map(function(t){return Promise.all(t.map(function(t){return t.id?r[t.id]:r6(t,i)}))}))];case 1:return s=f.sent(),[2,i7({keepImageSource:!1},e,{mipmaps:s,sourceFrom:{target:o,type:t.TextureSourceType.mipmaps}})];case 2:return u=e.mipmaps,h=e.target,[4,Promise.all(u.map(function(t){return r6(t,i)}))];case 3:return l=f.sent(),c=n[u[0][1][0]].url,[2,i7({keepImageSource:!1},e,{mipmaps:l,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{target:h,bin:c,type:t.TextureSourceType.mipmaps,mipmaps:u.map(function(t){return[t[1][1],t[1][2]]})}})];case 4:return[2]}})})).apply(this,arguments)}function r6(t,e){return r8.apply(this,arguments)}function r8(){return(r8=eB(function(t,e){var i,r,n,a,o;return eW(this,function(s){if(r=(i=t[1])[0],n=i[1],a=i[2],!(o=e[r]))throw Error("Invalid bin pointer: "+JSON.stringify(t)+".");return[2,rq(new Blob([new Uint8Array(o,n,a)]))]})})).apply(this,arguments)}var r9=1,r7=function(e){function i(t){var i;return(i=e.call(this,t)||this).destroyed=!1,i.id="Tex"+r9++,i}iB(i,e);var r=i.prototype;return r.getWidth=function(){return this.width||0},r.getHeight=function(){return this.height||0},r.uploadCurrentVideoFrame=function(){},r.offloadData=function(){},r.reloadData=function(){},r.initialize=function(){},r.assembleOptions=function(e){var i=e.target,r=void 0===i?rV.TEXTURE_2D:i,n=e.format,a=void 0===n?rV.RGBA:n;return e.sourceType||("image"in e?e.sourceType=t.TextureSourceType.image:"data"in e?e.sourceType=t.TextureSourceType.data:"video"in e?e.sourceType=t.TextureSourceType.video:e.sourceType=0),i7({minFilter:rV.NEAREST,magFilter:rV.NEAREST,wrapS:rV.CLAMP_TO_EDGE,wrapT:rV.CLAMP_TO_EDGE,target:r,format:rV.RGBA,internalFormat:a,type:rV.UNSIGNED_BYTE},e)},i.fromImage=function(e,r,n){return eB(function(){var a,o;return eW(this,function(s){switch(s.label){case 0:return[4,rq(e)];case 1:return a=s.sent(),(o=i.create(r,i7({sourceType:t.TextureSourceType.image,image:a,target:rV.TEXTURE_2D,id:iP(),flipY:!0},n))).initialize(),[2,o]}})})()},i.fromVideo=function(e,r,n){return eB(function(){var a,o;return eW(this,function(s){switch(s.label){case 0:return[4,r0(e)];case 1:return a=s.sent(),(o=i.create(r,i7({sourceType:t.TextureSourceType.video,video:a,id:iP(),flipY:!0},n))).initialize(),[2,o]}})})()},rI(i,[{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(iQ);function nt(t,e,i,r){var n,a,o=e.length/i/r;return a=n=4===o||0===o?rV.RGBA:3===o?rV.RGB:2===o?rV.LUMINANCE_ALPHA:rV.LUMINANCE,r7.createWithData(t,{data:e,width:i,height:r},{type:rV.HALF_FLOAT,format:n,internalFormat:a,wrapS:rV.CLAMP_TO_EDGE,wrapT:rV.CLAMP_TO_EDGE})}var ne={type:rV.UNSIGNED_BYTE,format:rV.RGBA,internalFormat:rV.RGBA,wrapS:rV.MIRRORED_REPEAT,wrapT:rV.MIRRORED_REPEAT,minFilter:rV.NEAREST,magFilter:rV.NEAREST};function ni(e){return r7.create(e,i7({id:iU.WhiteTexture,data:{width:1,height:1,data:new Uint8Array([255,255,255,255])},sourceType:t.TextureSourceType.data},ne))}function nr(e){return r7.create(e,i7({id:iU.EmptyTexture,data:{width:1,height:1,data:new Uint8Array([0,0,0,0])},sourceType:t.TextureSourceType.data},ne))}var nn=new(function(){function t(){this.loaders=new Map,this.instances=new Map}var e=t.prototype;return e.register=function(t,e){if(this.loaders.has(t)){console.warn('TextureLoader for type "'+t+'" is already registered, skipping.');return}this.loaders.set(t,e)},e.unregister=function(t){var e=this.instances.get(t);e&&(e.dispose(),this.instances.delete(t)),this.loaders.delete(t)},e.getLoader=function(t){if(this.instances.has(t))return this.instances.get(t);var e=this.loaders.get(t);if(!e)return console.error('TextureLoader for type "'+t+'" is not registered.'),null;var i=e();return this.instances.set(t,i),i},e.has=function(t){return this.loaders.has(t)},e.getRegisteredTypes=function(){return Array.from(this.loaders.keys())},e.dispose=function(){this.instances.forEach(function(t){return t.dispose()}),this.instances.clear(),this.loaders.clear()},t}()),na=function(){function e(){this.reloadPending={}}var i=e.prototype;return i.reload=function(t){var e=this;return eB(function(){var i,r;return eW(this,function(n){switch(n.label){case 0:if(i=t.id,e.reloadPending[i])return[2];if(!t.sourceFrom)return[3,2];return e.reloadPending[i]=!0,[4,e.loadSource(t.sourceFrom)];case 1:return r=n.sent(),t.updateSource(r),e.reloadPending[i]=!1,[3,3];case 2:throw Error("No source from.");case 3:return[2]}})})()},i.canOffloadTexture=function(e){if(e){var i=e.type;if(i===t.TextureSourceType.compressed||i===t.TextureSourceType.image){var r=e.target,n=e.map,a=e.url;return r===rV.TEXTURE_CUBE_MAP?"object"==typeof n&&!!n:iT(a)&&a.length>0}if(i===t.TextureSourceType.mipmaps){var o=e.bin,s=e.mipmaps,u=e.target,h=e.maps,l=e.urls;return o?s.length>0:u===rV.TEXTURE_CUBE_MAP?h.every(function(t){return"object"==typeof t&&t}):l.every(function(t){return iT(t)&&t.length>0})}}return!1},i.loadSource=function(e,i){var r=this;return eB(function(){var n,a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,C,E,_,w;return eW(this,function(S){switch(S.label){case 0:if(n=e.type,a=e.target,o=e.map,s=e.url,u=e.bin,h=e.mipmaps,l=e.urls,c=e.maps,!(a===rV.TEXTURE_CUBE_MAP&&n!==t.TextureSourceType.mipmaps))return[3,2];return[4,r.loadCubeMap(o)];case 1:return f=S.sent(),[2,i7({},i,{cube:f,target:rV.TEXTURE_CUBE_MAP,sourceType:t.TextureSourceType.image,sourceFrom:{type:t.TextureSourceType.image,map:i7({},o),target:rV.TEXTURE_CUBE_MAP}})];case 2:if(n!==t.TextureSourceType.image)return[3,4];return[4,rq(s)];case 3:return d=S.sent(),[2,i7({},i,{image:d,sourceType:t.TextureSourceType.image,sourceFrom:{type:n,url:s,target:rV.TEXTURE_2D}})];case 4:if(n!==t.TextureSourceType.video)return[3,6];return[4,r0(s)];case 5:return p=S.sent(),[2,i7({},i,{video:p,sourceType:t.TextureSourceType.video})];case 6:if(n!==t.TextureSourceType.compressed)return[3,14];return[4,rQ(s)];case 7:if(m=S.sent(),!(v=nn.getLoader("ktx2")))return[3,12];S.label=8;case 8:return S.trys.push([8,10,,11]),[4,v.loadFromBuffer(m)];case 9:if((y=S.sent()).sourceType===t.TextureSourceType.compressed)return[2,i7({sourceType:y.sourceType,type:y.type,target:y.target,internalFormat:y.internalFormat,format:y.format,mipmaps:y.mipmaps,minFilter:rV.LINEAR,magFilter:rV.LINEAR,sourceFrom:e},i)];return[3,11];case 10:throw g=S.sent(),Error("Failed to parse KTX2 from "+(null!=(x=null==e?void 0:e.url)?x:"buffer")+": "+(g.message||g));case 11:return[3,13];case 12:throw Error("KTX2 loader not found. Please register it first.");case 13:return[3,23];case 14:if(n!==t.TextureSourceType.mipmaps)return[3,23];if(!u)return[3,19];return[4,rQ(u)];case 15:if(b=S.sent(),C=(T=null!=a?a:rV.TEXTURE_2D)===rV.TEXTURE_2D?h.slice():h.map(function(t){return t.slice()}),a!==rV.TEXTURE_CUBE_MAP)return[3,17];return[4,Promise.all(h.map(function(t){return r.loadMipmapImages(t,b)}))];case 16:return E=S.sent(),[3,18];case 17:E=r.loadMipmapImages(h,b),S.label=18;case 18:return[2,i7({},i,{mipmaps:E,target:T,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{bin:u,mipmaps:C,target:T,type:t.TextureSourceType.mipmaps}})];case 19:if(!(a===rV.TEXTURE_2D||!a))return[3,21];return[4,Promise.all(l.map(function(t){return rq(t)}))];case 20:return _=S.sent(),[2,i7({},i,{mipmaps:_,target:rV.TEXTURE_2D,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{type:n,urls:l.slice(),target:rV.TEXTURE_2D}})];case 21:if(a!==rV.TEXTURE_CUBE_MAP)return[3,23];return[4,Promise.all(c.map(function(t){return r.loadCubeMap(t)}))];case 22:return w=S.sent(),[2,i7({},i,{mipmaps:w,target:rV.TEXTURE_CUBE_MAP,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{type:n,maps:c.map(function(t){return i7({},t)}),target:rV.TEXTURE_CUBE_MAP}})];case 23:throw Error("Invalid resource type: "+n+".")}})})()},i.loadMipmapImages=function(t,e){return eB(function(){return eW(this,function(i){return[2,Promise.all(t.map(function(t){return rq(new Blob([new Uint8Array(e,t[0],t[1])]))}))]})})()},i.loadCubeMap=function(t){return eB(function(){return eW(this,function(e){return[2,Promise.all(t.map(function(t){return rq(t)}))]})})()},e}(),no=function(){function t(t){this.destroyed=!1;var e=t.name;this.name=void 0===e?"defaultDataBlock":e}var e=t.prototype;return e.setUniformValues=function(t){var e=this;Object.keys(t).forEach(function(i){e.setUniformValue(i,t[i])})},e.invalidAllFlags=function(){},e.updateUniformSubData=function(t,e,i){},t}();function ns(t){return"object"==typeof t&&t&&void 0===t.length&&eU(t,r7)}var nu=function(){function t(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=1),void 0===o&&(o=0),void 0===s&&(s=0),void 0===u&&(u=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===c&&(c=0),void 0===f&&(f=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===m&&(m=1),this.elements=[t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m]}var e=t.prototype;return e.set=function(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){var v=this.elements;return v[0]=t,v[1]=e,v[2]=i,v[3]=r,v[4]=n,v[5]=a,v[6]=o,v[7]=s,v[8]=u,v[9]=h,v[10]=l,v[11]=c,v[12]=f,v[13]=d,v[14]=p,v[15]=m,this},e.setFromRowMajorData=function(t,e,i,r,n,a,o,s,u,h,l,c,f,d,p,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=i,v[12]=r,v[1]=n,v[5]=a,v[9]=o,v[13]=s,v[2]=u,v[6]=h,v[10]=l,v[14]=c,v[3]=f,v[7]=d,v[11]=p,v[15]=m,this},e.setFromColumnVectors=function(t,e,i,r){return this.set(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,i.x,i.y,i.z,i.w,r.x,r.y,r.z,r.w)},e.setFromMatrix3=function(t){var e=t.elements;return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1),this},e.setFromArray=function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[e+i];return this},e.setFromScale=function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)},e.setFromTranslation=function(t,e,i){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1)},e.setFromRotationX=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1)},e.setFromRotationY=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1)},e.setFromRotationZ=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1)},e.setFromRotationAxis=function(e,i){var r=t.tempVec0;r.copyFrom(e).normalize();var n=Math.cos(i),a=Math.sin(i),o=1-n,s=r.x,u=r.y,h=r.z,l=o*s,c=o*u;return this.set(l*s+n,l*u+a*h,l*h-a*u,0,l*u-a*h,c*u+n,c*h+a*s,0,l*h+a*u,c*h-a*s,o*h*h+n,0,0,0,0,1)},e.setFromEuler=function(t){return t.toMatrix4(this),this},e.setFromQuaternion=function(t){return this.compose(e3.ZERO,t,e3.ONE)},e.setFromShear=function(t,e,i){return this.set(1,t,t,0,e,1,e,0,i,i,1,0,0,0,0,1)},e.setFromBasis=function(t,e,i){return this.set(t.x,t.y,t.z,0,e.x,e.y,e.z,0,i.x,i.y,i.z,0,0,0,0,1)},e.setZero=function(){for(var t=0;t<16;t++)this.elements[t]=0;return this},e.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},e.isIdentity=function(){var t=this.elements;return 1===t[0]&&0===t[4]&&0===t[8]&&0===t[12]&&0===t[1]&&1===t[5]&&0===t[9]&&0===t[13]&&0===t[2]&&0===t[6]&&1===t[10]&&0===t[14]&&0===t[3]&&0===t[7]&&0===t[11]&&1===t[15]},e.clone=function(){var e=this.elements;return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},e.copyFrom=function(t){return this.elements=[].concat(t.elements),this},e.getColumnVector=function(t,e){return e.set(this.elements[4*t],this.elements[4*t+1],this.elements[4*t+2],this.elements[4*t+3])},e.lookAt=function(e,i,r){var n=t.tempVec0,a=t.tempVec1,o=t.tempVec2;o.subtractVectors(e,i),o.normalize(),n.crossVectors(r,o),n.normalize(),a.crossVectors(o,n);var s=this.elements;return s[0]=n.x,s[1]=a.x,s[2]=o.x,s[3]=0,s[4]=n.y,s[5]=a.y,s[6]=o.y,s[7]=0,s[8]=n.z,s[9]=a.z,s[10]=o.z,s[11]=0,s[12]=-n.dot(e),s[13]=-a.dot(e),s[14]=-o.dot(e),s[15]=1,this},e.addScaledMatrix=function(t,e){for(var i=this.elements,r=t.elements,n=0;n<16;n++)i[n]+=r[n]*e;return this},e.multiply=function(t){if("number"!=typeof t)return this.multiplyMatrices(this,t);for(var e=0;e<16;e++)this.elements[e]*=t;return this},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],o=i[4],s=i[8],u=i[12],h=i[1],l=i[5],c=i[9],f=i[13],d=i[2],p=i[6],m=i[10],v=i[14],y=i[3],g=i[7],x=i[11],b=i[15],T=r[0],C=r[4],E=r[8],_=r[12],w=r[1],S=r[5],M=r[9],A=r[13],P=r[2],R=r[6],I=r[10],O=r[14],L=r[3],F=r[7],V=r[11],N=r[15];return n[0]=a*T+o*w+s*P+u*L,n[4]=a*C+o*S+s*R+u*F,n[8]=a*E+o*M+s*I+u*V,n[12]=a*_+o*A+s*O+u*N,n[1]=h*T+l*w+c*P+f*L,n[5]=h*C+l*S+c*R+f*F,n[9]=h*E+l*M+c*I+f*V,n[13]=h*_+l*A+c*O+f*N,n[2]=d*T+p*w+m*P+v*L,n[6]=d*C+p*S+m*R+v*F,n[10]=d*E+p*M+m*I+v*V,n[14]=d*_+p*A+m*O+v*N,n[3]=y*T+g*w+x*P+b*L,n[7]=y*C+g*S+x*R+b*F,n[11]=y*E+g*M+x*I+b*V,n[15]=y*_+g*A+x*O+b*N,this},e.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[4],r=t[8],n=t[12],a=t[1],o=t[5],s=t[9],u=t[13],h=t[2],l=t[6],c=t[10],f=t[14];return t[3]*(+n*s*l-r*u*l-n*o*c+i*u*c+r*o*f-i*s*f)+t[7]*(+e*s*f-e*u*c+n*a*c-r*a*f+r*u*h-n*s*h)+t[11]*(+e*u*l-e*o*f-n*a*l+i*a*f+n*o*h-i*u*h)+t[15]*(-r*o*h-e*s*l+e*o*c+r*a*l-i*a*c+i*s*h)},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.invert=function(){var t=this.elements,e=t[0],i=t[1],r=t[2],n=t[3],a=t[4],o=t[5],s=t[6],u=t[7],h=t[8],l=t[9],c=t[10],f=t[11],d=t[12],p=t[13],m=t[14],v=t[15],y=l*m*u-p*c*u+p*s*f-o*m*f-l*s*v+o*c*v,g=d*c*u-h*m*u-d*s*f+a*m*f+h*s*v-a*c*v,x=h*p*u-d*l*u+d*o*f-a*p*f-h*o*v+a*l*v,b=d*l*s-h*p*s-d*o*c+a*p*c+h*o*m-a*l*m,T=e*y+i*g+r*x+n*b;if(0===T)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var C=1/T;return t[0]=y*C,t[1]=(p*c*n-l*m*n-p*r*f+i*m*f+l*r*v-i*c*v)*C,t[2]=(o*m*n-p*s*n+p*r*u-i*m*u-o*r*v+i*s*v)*C,t[3]=(l*s*n-o*c*n-l*r*u+i*c*u+o*r*f-i*s*f)*C,t[4]=g*C,t[5]=(h*m*n-d*c*n+d*r*f-e*m*f-h*r*v+e*c*v)*C,t[6]=(d*s*n-a*m*n-d*r*u+e*m*u+a*r*v-e*s*v)*C,t[7]=(a*c*n-h*s*n+h*r*u-e*c*u-a*r*f+e*s*f)*C,t[8]=x*C,t[9]=(d*l*n-h*p*n-d*i*f+e*p*f+h*i*v-e*l*v)*C,t[10]=(a*p*n-d*o*n+d*i*u-e*p*u-a*i*v+e*o*v)*C,t[11]=(h*o*n-a*l*n-h*i*u+e*l*u+a*i*f-e*o*f)*C,t[12]=b*C,t[13]=(h*p*r-d*l*r+d*i*c-e*p*c-h*i*m+e*l*m)*C,t[14]=(d*o*r-a*p*r-d*i*s+e*p*s+a*i*m-e*o*m)*C,t[15]=(a*l*r-h*o*r+h*i*s-e*l*s-a*i*c+e*o*c)*C,this},e.extractBasis=function(t,e,i){var r=this.elements;return t.set(r[0],r[1],r[2]),e.set(r[4],r[5],r[6]),i.set(r[8],r[9],r[10]),this},e.compose=function(t,e,i,r){void 0===r&&(r=e3.ZERO);var n=this.elements,a=e.x,o=e.y,s=e.z,u=e.w,h=-r.x,l=-r.y,c=-r.z,f=a+a,d=o+o,p=s+s,m=a*f,v=a*d,y=a*p,g=o*d,x=o*p,b=s*p,T=u*f,C=u*d,E=u*p,_=i.x,w=i.y,S=i.z;return n[0]=(1-(g+b))*_,n[1]=(v+E)*_,n[2]=(y-C)*_,n[3]=0,n[4]=(v-E)*w,n[5]=(1-(m+b))*w,n[6]=(x+T)*w,n[7]=0,n[8]=(y+C)*S,n[9]=(x-T)*S,n[10]=(1-(m+g))*S,n[11]=0,n[12]=h*n[0]+l*n[4]+c*n[8]-h+t.x,n[13]=h*n[1]+l*n[5]+c*n[9]-l+t.y,n[14]=h*n[2]+l*n[6]+c*n[10]-c+t.z,this},e.decompose=function(e,i,r){var n=t.tempVec0,a=this.elements,o=n.set(a[0],a[1],a[2]).length(),s=n.set(a[4],a[5],a[6]).length(),u=n.set(a[8],a[9],a[10]).length();if(0>this.determinant()&&(o=-o),e.x=a[12],e.y=a[13],e.z=a[14],r.x=o,r.y=s,r.z=u,1e-8>Math.abs(o)||1e-8>Math.abs(s)||1e-8>Math.abs(u))return i.set(0,0,0,1),this;var h=t.tempMat0;h.copyFrom(this);var l=1/o,c=1/s,f=1/u;return h.elements[0]*=l,h.elements[1]*=l,h.elements[2]*=l,h.elements[4]*=c,h.elements[5]*=c,h.elements[6]*=c,h.elements[8]*=f,h.elements[9]*=f,h.elements[10]*=f,i.setFromRotationMatrix(h),this},e.getTranslation=function(t){var e=this.elements;return t.set(e[12],e[13],e[14])},e.getScale=function(t){var e=this.elements;return t.set(Math.hypot(e[0],e[1],e[2]),Math.hypot(e[4],e[5],e[6]),Math.hypot(e[8],e[9],e[10]))},e.extractRotation=function(e){var i=t.tempVec0,r=e.elements,n=this.elements,a=1/i.set(r[0],r[1],r[2]).length(),o=1/i.set(r[4],r[5],r[6]).length(),s=1/i.set(r[8],r[9],r[10]).length();return n[0]=r[0]*a,n[1]=r[1]*a,n[2]=r[2]*a,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},e.setPosition=function(t){return this.elements[12]=t.x,this.elements[13]=t.y,this.elements[14]=t.z,this},e.getTransform=function(){var t=new e3,e=new ri,i=new e3;return this.decompose(t,e,i),{translation:t,rotation:e,scale:i}},e.orthographic=function(t,e,i,r,n,a){var o=1/(e-t),s=1/(i-r),u=1/(a-n),h=-(e+t)*o,l=-(i+r)*s,c=-(a+n)*u;o*=2,s*=2,u*=-2;var f=this.elements;return f[0]=o,f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[5]=s,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[10]=u,f[11]=0,f[12]=h,f[13]=l,f[14]=c,f[15]=1,this},e.perspective=function(t,e,i,r,n){var a=1/Math.tan(.5*t),o=1/(i-r),s=this.elements;return s[0]=n?a:a/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=n?a*e:a,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(r+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*r*i*o,s[15]=0,(null===r||r===1/0)&&(s[10]=-1,s[14]=-2*i),this},e.projectPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;o.x=a[0]*i+a[4]*r+a[8]*n+a[12],o.y=a[1]*i+a[5]*r+a[9]*n+a[13],o.z=a[2]*i+a[6]*r+a[10]*n+a[14];var s=a[3]*i+a[7]*r+a[11]*n+a[15];return o.multiply(1/s)},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[4]*r+a[8]*n+a[12],o.y=a[1]*i+a[5]*r+a[9]*n+a[13],o.z=a[2]*i+a[6]*r+a[10]*n+a[14],o},e.transformNormal=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[4]*r+a[8]*n,o.y=a[1]*i+a[5]*r+a[9]*n,o.z=a[2]*i+a[6]*r+a[10]*n,o.normalize()},e.transformVector4=function(t,e){var i=t.x,r=t.y,n=t.z,a=t.w,o=this.elements,s=null!=e?e:t;return s.x=o[0]*i+o[4]*r+o[8]*n+o[12]*a,s.y=o[1]*i+o[5]*r+o[9]*n+o[13]*a,s.z=o[2]*i+o[6]*r+o[10]*n+o[14]*a,s.w=o[3]*i+o[7]*r+o[11]*n+o[15]*a,s},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<16;r++)if(!e$(e[r],i[r]))return!1;return!0},e.toArray=function(){return[].concat(this.elements)},e.fill=function(t,e){void 0===e&&(e=0);var i=this.elements;t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15]},t.fromIdentity=function(){return new t(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},t.fromLookAt=function(e,i,r){return new t().lookAt(e,i,r)},t.fromPerspective=function(e,i,r,n,a){return new t().perspective(e,i,r,n,a)},t.fromColumnVectors=function(e,i,r,n){return new t().setFromColumnVectors(e,i,r,n)},t.fromMatrix3=function(e){return new t().setFromMatrix3(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromScale=function(e,i,r){return new t().setFromScale(e,i,r)},t.fromTranslation=function(e,i,r){return new t().setFromTranslation(e,i,r)},t.fromRotationX=function(e){return new t().setFromRotationX(e)},t.fromRotationY=function(e){return new t().setFromRotationY(e)},t.fromRotationZ=function(e){return new t().setFromRotationZ(e)},t.fromRotationAxis=function(e,i){return new t().setFromRotationAxis(e,i)},t.fromEuler=function(e){return new t().setFromEuler(e)},t.fromQuaternion=function(e){return new t().setFromQuaternion(e)},t.fromShear=function(e,i,r){return new t().setFromShear(e,i,r)},t.fromBasis=function(e,i,r){return new t().setFromBasis(e,i,r)},t.fromRowMajorData=function(e,i,r,n,a,o,s,u,h,l,c,f,d,p,m,v){return new t(e,a,h,d,i,o,l,p,r,s,c,m,n,u,f,v)},t}();nu.IDENTITY=new nu(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),nu.ZERO=new nu(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),nu.tempVec0=new e3,nu.tempVec1=new e3,nu.tempVec2=new e3,nu.tempMat0=new nu,(ts=ew||(ew={}))[ts.XYZ=0]="XYZ",ts[ts.XZY=1]="XZY",ts[ts.YXZ=2]="YXZ",ts[ts.YZX=3]="YZX",ts[ts.ZXY=4]="ZXY",ts[ts.ZYX=5]="ZYX";var nh=function(){function t(e,i,r,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=t.DEFAULT_ORDER),this.x=e,this.y=i,this.z=r,this.order=n}var e=t.prototype;return e.set=function(t,e,i,r){return void 0===r&&(r=this.order),this.x=t,this.y=e,this.z=i,this.order=r,this},e.setZero=function(t){return void 0===t&&(t=this.order),this.set(0,0,0,t)},e.setFromRotationMatrix4=function(t,e){void 0===e&&(e=this.order);var i=t.elements,r=i[0],n=i[4],a=i[8],o=i[1],s=i[5],u=i[9],h=i[2],l=i[6],c=i[10];switch(e){case ew.XYZ:this.y=Math.asin(e1(a,-1,1)),.9999999>Math.abs(a)?(this.x=Math.atan2(-u,c),this.z=Math.atan2(-n,r)):(this.x=Math.atan2(l,s),this.z=0);break;case ew.YXZ:this.x=Math.asin(-e1(u,-1,1)),.9999999>Math.abs(u)?(this.y=Math.atan2(a,c),this.z=Math.atan2(o,s)):(this.y=Math.atan2(-h,r),this.z=0);break;case ew.ZXY:this.x=Math.asin(e1(l,-1,1)),.9999999>Math.abs(l)?(this.y=Math.atan2(-h,c),this.z=Math.atan2(-n,s)):(this.y=0,this.z=Math.atan2(o,r));break;case ew.ZYX:this.y=Math.asin(-e1(h,-1,1)),.9999999>Math.abs(h)?(this.x=Math.atan2(l,c),this.z=Math.atan2(o,r)):(this.x=0,this.z=Math.atan2(-n,s));break;case ew.YZX:this.z=Math.asin(e1(o,-1,1)),.9999999>Math.abs(o)?(this.x=Math.atan2(-u,s),this.y=Math.atan2(-h,r)):(this.x=0,this.y=Math.atan2(a,c));break;case ew.XZY:this.z=Math.asin(-e1(n,-1,1)),.9999999>Math.abs(n)?(this.x=Math.atan2(l,s),this.y=Math.atan2(a,r)):(this.x=Math.atan2(-u,c),this.y=0);break;default:console.error("setFromRotationMatrix: unknown order: "+e)}return this.x*=eJ,this.y*=eJ,this.z*=eJ,this.order=e,this},e.setFromQuaternion=function(e,i){void 0===i&&(i=this.order);var r=t.tempMat0;return r.setFromQuaternion(e),this.setFromRotationMatrix4(r,i)},e.setFromVector3=function(t,e){return void 0===e&&(e=this.order),this.set(t.x,t.y,t.z,e)},e.setFromArray=function(t,e,i){var r,n,a,o;return void 0===e&&(e=0),void 0===i&&(i=this.order),this.x=null!=(r=t[e])?r:0,this.y=null!=(n=t[e+1])?n:0,this.z=null!=(a=t[e+2])?a:0,this.order=null!=(o=t[e+3])?o:i,this},e.clone=function(){return new t(this.x,this.y,this.z,this.order)},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.order=t.order,this},e.add=function(t){return this.order!=t.order?console.error("add euler with different order"):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this},e.addEulers=function(t,e){return t.order!=e.order?console.error("add euler with different order"):(this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.order=t.order),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.reorder=function(t){var e=new ri;return e.setFromEuler(this),this.setFromQuaternion(e,t)},e.rotateVector3=function(e,i){return t.tempQuat0.setFromEuler(this).rotateVector3(e,i)},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.order===this.order},e.toVector3=function(t){return t.set(this.x,this.y,this.z)},e.toArray=function(){return[this.x,this.y,this.z]},e.toQuaternion=function(t){var e=this.x,i=this.y,r=this.z,n=this.order,a=Math.cos(e*eQ*.5),o=Math.cos(i*eQ*.5),s=Math.cos(r*eQ*.5),u=Math.sin(e*eQ*.5),h=Math.sin(i*eQ*.5),l=Math.sin(r*eQ*.5);switch(n){case ew.XYZ:t.set(u*o*s+a*h*l,a*h*s-u*o*l,a*o*l+u*h*s,a*o*s-u*h*l);break;case ew.YXZ:t.set(u*o*s+a*h*l,a*h*s-u*o*l,a*o*l-u*h*s,a*o*s+u*h*l);break;case ew.ZXY:t.set(u*o*s-a*h*l,a*h*s+u*o*l,a*o*l+u*h*s,a*o*s-u*h*l);break;case ew.ZYX:t.set(u*o*s-a*h*l,a*h*s+u*o*l,a*o*l-u*h*s,a*o*s+u*h*l);break;case ew.YZX:t.set(u*o*s+a*h*l,a*h*s+u*o*l,a*o*l-u*h*s,a*o*s-u*h*l);break;case ew.XZY:t.set(u*o*s-a*h*l,a*h*s-u*o*l,a*o*l+u*h*s,a*o*s+u*h*l);break;default:console.error("unknown euler order: "+n)}return t},e.toMatrix4=function(t){var e=t.elements,i=this.x,r=this.y,n=this.z,a=this.order,o=Math.cos(i*eQ),s=Math.sin(i*eQ),u=Math.cos(r*eQ),h=Math.sin(r*eQ),l=Math.cos(n*eQ),c=Math.sin(n*eQ);if(a===ew.XYZ){var f=o*l,d=o*c,p=s*l,m=s*c;e[0]=u*l,e[4]=-u*c,e[8]=h,e[1]=d+p*h,e[5]=f-m*h,e[9]=-s*u,e[2]=m-f*h,e[6]=p+d*h,e[10]=o*u}else if(a===ew.YXZ){var v=u*l,y=u*c,g=h*l,x=h*c;e[0]=v+x*s,e[4]=g*s-y,e[8]=o*h,e[1]=o*c,e[5]=o*l,e[9]=-s,e[2]=y*s-g,e[6]=x+v*s,e[10]=o*u}else if(a===ew.ZXY){var b=u*l,T=u*c,C=h*l,E=h*c;e[0]=b-E*s,e[4]=-o*c,e[8]=C+T*s,e[1]=T+C*s,e[5]=o*l,e[9]=E-b*s,e[2]=-o*h,e[6]=s,e[10]=o*u}else if(a===ew.ZYX){var _=o*l,w=o*c,S=s*l,M=s*c;e[0]=u*l,e[4]=S*h-w,e[8]=_*h+M,e[1]=u*c,e[5]=M*h+_,e[9]=w*h-S,e[2]=-h,e[6]=s*u,e[10]=o*u}else if(a===ew.YZX){var A=o*u,P=o*h,R=s*u,I=s*h;e[0]=u*l,e[4]=I-A*c,e[8]=R*c+P,e[1]=c,e[5]=o*l,e[9]=-s*l,e[2]=-h*l,e[6]=P*c+R,e[10]=A-I*c}else if(a===ew.XZY){var O=o*u,L=o*h,F=s*u,V=s*h;e[0]=u*l,e[4]=-c,e[8]=h*l,e[1]=O*c+V,e[5]=o*l,e[9]=L*c-F,e[2]=F*c-L,e[6]=s*l,e[10]=V*c+O}else console.error("toMatrix4: Invalid order "+a);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,t},t.fromRotationMatrix4=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromRotationMatrix4(e,i)},t.fromQuaternion=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromQuaternion(e,i)},t.fromVector3=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromVector3(e,i)},t.fromArray=function(e,i,r){return void 0===i&&(i=0),void 0===r&&(r=t.DEFAULT_ORDER),new t().setFromArray(e,i,r)},t}();nh.DEFAULT_ORDER=ew.ZYX,nh.tempQuat0=new ri,nh.tempMat0=new nu;var nl=function(){function t(t,e,i,r,n,a,o,s,u){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===a&&(a=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===u&&(u=1),this.elements=[t,e,i,r,n,a,o,s,u]}var e=t.prototype;return e.set=function(t,e,i,r,n,a,o,s,u){var h=this.elements;return h[0]=t,h[3]=r,h[6]=o,h[1]=e,h[4]=n,h[7]=s,h[2]=i,h[5]=a,h[8]=u,this},e.setFromRowMajorData=function(t,e,i,r,n,a,o,s,u){var h=this.elements;return h[0]=t,h[3]=e,h[6]=i,h[1]=r,h[4]=n,h[7]=a,h[2]=o,h[5]=s,h[8]=u,this},e.setFromColumnVectors=function(t,e,i){return this.set(t.x,t.y,t.z,e.x,e.y,e.z,i.x,i.y,i.z)},e.setFromMatrix4=function(t){var e=t.elements;return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])},e.setFromArray=function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[e+i];return this},e.setFromQuaternion=function(t){var e=t.x,i=t.y,r=t.z,n=t.w,a=e+e,o=i+i,s=r+r,u=e*a,h=e*o,l=e*s,c=i*o,f=i*s,d=r*s,p=n*a,m=n*o,v=n*s,y=this.elements;return y[0]=1-(c+d),y[1]=h+v,y[2]=l-m,y[3]=h-v,y[4]=1-(u+d),y[5]=f+p,y[6]=l+m,y[7]=f-p,y[8]=1-(u+c),this},e.setZero=function(){for(var t=0;t<9;t++)this.elements[t]=0;return this},e.identity=function(){return this.set(1,0,0,0,1,0,0,0,1)},e.clone=function(){var e=this.elements;return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},e.copyFrom=function(t){return this.elements=[].concat(t.elements),this},e.getColumnVector=function(t,e){return e.set(this.elements[3*t],this.elements[3*t+1],this.elements[3*t+2])},e.scale=function(t,e){var i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},e.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.elements,n=r[0],a=r[3],o=r[6],s=r[1],u=r[4],h=r[7];return r[0]=e*n+i*s,r[3]=e*a+i*u,r[6]=e*o+i*h,r[1]=-i*n+e*s,r[4]=-i*a+e*u,r[7]=-i*o+e*h,this},e.translate=function(t,e){var i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},e.multiply=function(t){if("number"!=typeof t)return this.multiplyMatrices(this,t);for(var e=0;e<9;e++)this.elements[e]*=t;return this},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],o=i[3],s=i[6],u=i[1],h=i[4],l=i[7],c=i[2],f=i[5],d=i[8],p=r[0],m=r[3],v=r[6],y=r[1],g=r[4],x=r[7],b=r[2],T=r[5],C=r[8];return n[0]=a*p+o*y+s*b,n[3]=a*m+o*g+s*T,n[6]=a*v+o*x+s*C,n[1]=u*p+h*y+l*b,n[4]=u*m+h*g+l*T,n[7]=u*v+h*x+l*C,n[2]=c*p+f*y+d*b,n[5]=c*m+f*g+d*T,n[8]=c*v+f*x+d*C,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],a=t[4],o=t[7],s=t[2],u=t[5],h=t[8];return e*(a*h-u*o)+n*(u*r-i*h)+s*(i*o-a*r)},e.invert=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],a=t[4],o=t[7],s=t[2],u=t[5],h=t[8],l=h*a-u*o,c=u*r-h*i,f=o*i-a*r,d=e*l+n*c+s*f;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var p=1/d;return t[0]=l*p,t[1]=(s*o-h*n)*p,t[2]=(u*n-s*a)*p,t[3]=c*p,t[4]=(h*e-s*r)*p,t[5]=(s*i-u*e)*p,t[6]=f*p,t[7]=(n*r-o*e)*p,t[8]=(a*e-n*i)*p,this},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,o=null!=e?e:t;return o.x=a[0]*i+a[3]*r+a[6]*n,o.y=a[1]*i+a[4]*r+a[7]*n,o.z=a[2]*i+a[5]*r+a[8]*n,o},e.transformNormal=function(t,e){return this.transformPoint(t,e).normalize()},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<9;r++)if(!e$(e[r],i[r]))return!1;return!0},e.toArray=function(){return[].concat(this.elements)},e.fill=function(t,e){void 0===e&&(e=0);var i=this.elements;t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8]},t.fromIdentity=function(){return new t(1,0,0,0,1,0,0,0,1)},t.fromColumnVectors=function(e,i,r){return new t().setFromColumnVectors(e,i,r)},t.fromMatrix4=function(e){return new t().setFromMatrix4(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromQuaternion=function(e){return new t().setFromQuaternion(e)},t.fromRowMajorData=function(e,i,r,n,a,o,s,u,h){return new t(e,n,s,i,a,u,r,o,h)},t}(),nc=function(){function t(t,e){void 0===t&&(t=e3.ZERO),void 0===e&&(e=e3.X),this.origin=new e3,this.direction=new e3,this.origin.copyFrom(t),this.direction.copyFrom(e).normalize()}var e=t.prototype;return e.set=function(t,e){return this.origin.copyFrom(t),this.direction.copyFrom(e).normalize(),this},e.clone=function(){return new t(this.origin,this.direction)},e.copyFrom=function(t){return this.set(t.origin,t.direction)},e.recast=function(e){return this.origin.copyFrom(this.at(e,t.tempVec0)),this},e.at=function(t,e){var i=e||new e3;return i.copyFrom(this.origin),i.addScaledVector(this.direction,t)},e.equals=function(t){return this.origin.equals(t.origin)&&this.direction.equals(t.direction)},e.distanceToPlane=function(t){var e=t.normal,i=e.dot(this.direction);if(0===i)return e.dot(this.origin)+t.distance===0?0:null;var r=-(this.origin.dot(e)+t.distance)/i;return r>=0?r:null},e.applyMatrix=function(t){return this.origin.applyProjectionMatrix(t),this.direction.applyNormalMatrix(t),this},e.intersectBox=function(t,e){var i,r,n,a,o,s,u=this.origin,h=u.x,l=u.y,c=u.z,f=this.direction,d=f.x,p=f.y,m=f.z,v=t.min,y=v.x,g=v.y,x=v.z,b=t.max,T=b.x,C=b.y,E=b.z,_=1/d,w=1/p,S=1/m;if(_>=0?(i=(y-h)*_,r=(T-h)*_):(i=(T-h)*_,r=(y-h)*_),w>=0?(n=(g-l)*w,a=(C-l)*w):(n=(C-l)*w,a=(g-l)*w),!(i>a)&&!(n>r)&&((n>i||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),(n>i||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),S>=0?(o=(x-c)*S,s=(E-c)*S):(o=(E-c)*S,s=(x-c)*S),!(i>s)&&!(o>r))&&((o>i||i!=i)&&(i=o),(s<r||r!=r)&&(r=s),!(r<0)))return i>=0?this.at(i,e):this.at(r,e)},e.intersectPlane=function(t,e){var i=t.normal,r=t.distance,n=i.dot(this.direction);if(0===n)return 0===i.dot(this.origin)+r?(e||new e3).copyFrom(this.origin):void 0;var a=-(this.origin.dot(i)+r)/n;return a>=0?this.at(a,e):void 0},e.intersectSphere=function(e,i){var r=e.center,n=t.tempVec0.subtractVectors(r,this.origin),a=n.dot(this.direction),o=n.dot(n)-a*a,s=e.radius*e.radius;if(!(o>s)){var u=Math.sqrt(s-o),h=a-u,l=a+u;if(!(l<0))return h>=0?this.at(h,i):this.at(l,i)}},e.intersectTriangle=function(e,i,r){var n,a=e.p0,o=e.p1,s=e.p2,u=t.tempVec0.subtractVectors(o,a),h=t.tempVec1.subtractVectors(s,a),l=t.tempVec2.subtractVectors(this.origin,a),c=t.tempVec3.crossVectors(u,h),f=this.direction.dot(c);if(f>0){if(r)return;n=1}else{if(!(f<0))return;n=-1,f=-f}h.crossVectors(l,h);var d=n*this.direction.dot(h);if(!(d<0)){u.cross(l);var p=n*this.direction.dot(u);if(!(p<0)&&!(d+p>f)){var m=-n*l.dot(c);if(!(m<0))return this.at(m/f,i)}}},t}();nc.tempVec0=new e3,nc.tempVec1=new e3,nc.tempVec2=new e3,nc.tempVec3=new e3;var nf=function(){function t(t,e){void 0===t&&(t=new e3(1/0,1/0,1/0)),void 0===e&&(e=new e3(-1/0,-1/0,-1/0)),this.min=t.clone(),this.max=e.clone()}var e=t.prototype;return e.set=function(t,e){return this.min.copyFrom(t),this.max.copyFrom(e),this},e.setFromArray=function(t){for(var e=Number(1/0),i=Number(1/0),r=Number(1/0),n=-1/0,a=-1/0,o=-1/0,s=0,u=t.length;s<u;s+=3){var h=t[s],l=t[s+1],c=t[s+2];h<e&&(e=h),l<i&&(i=l),c<r&&(r=c),h>n&&(n=h),l>a&&(a=l),c>o&&(o=c)}return this.min.set(e,i,r),this.max.set(n,a,o),this},e.setFromPoints=function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},e.setFromCenterAndSize=function(t,e){var i=e.clone().multiply(.5);return this.min.copyFrom(t).subtract(i),this.max.copyFrom(t).add(i),this},e.setFromObject=function(t){return this.makeEmpty(),this.expandByObject(t)},e.clone=function(){return new t().copyFrom(this)},e.copyFrom=function(t){return this.min.copyFrom(t.min),this.max.copyFrom(t.max),this},e.makeEmpty=function(){return this.min.x=this.min.y=this.min.z=Number(1/0),this.max.x=this.max.y=this.max.z=-1/0,this},e.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},e.getCenter=function(t){return void 0===t&&(t=new e3),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiply(.5)},e.getSize=function(t){return void 0===t&&(t=new e3),this.isEmpty()?t.set(0,0,0):t.subtractVectors(this.max,this.min)},e.expandByPoint=function(t){return this.min.min(t),this.max.max(t),this},e.expandByVector=function(t){return this.min.subtract(t),this.max.add(t),this},e.expandByScalar=function(t){return this.min.add(-t),this.max.add(t),this},e.expandByBox=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.expandByObject=function(e){e.updateWorldMatrix(!1,!1);var i=e.geometry;if(void 0!==i){null===i.boundingBox&&i.computeBoundingBox();var r=new t;r.copyFrom(i.boundingBox),r.applyMatrix4(e.matrixWorld),this.union(r)}for(var n=e.children,a=0,o=n.length;a<o;a++)this.expandByObject(n[a]);return this},e.containsPoint=function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},e.containsBox=function(t){return this.min.x<=t.min.x&&this.max.x>=t.max.x&&this.min.y<=t.min.y&&this.max.y>=t.max.y&&this.min.z<=t.min.z&&this.max.z>=t.max.z},e.getParameter=function(t,e){return void 0===e&&(e=new e3),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},e.intersectsBox=function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},e.intersectsSphere=function(t){var e=new e3;return this.clampPoint(t.center,e),e.distanceSquared(t.center)<=t.radius*t.radius},e.clampPoint=function(t,e){return void 0===e&&(e=new e3),e.copyFrom(t).clamp(this.min,this.max)},e.distanceToPoint=function(t){return t.clone().clamp(this.min,this.max).subtract(t).length()},e.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},e.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.applyMatrix4=function(t,e){if(void 0===e&&(e=new e3),this.isEmpty())return this;var i=this.getOBBPoints(t,e);return this.setFromPoints(i),this},e.getOBBPoints=function(t,e){if(void 0===e&&(e=new e3),this.isEmpty())return[];var i=[];return i[0]=new e3(this.min.x,this.min.y,this.min.z),i[1]=new e3(this.min.x,this.min.y,this.max.z),i[2]=new e3(this.min.x,this.max.y,this.min.z),i[3]=new e3(this.min.x,this.max.y,this.max.z),i[4]=new e3(this.max.x,this.min.y,this.min.z),i[5]=new e3(this.max.x,this.min.y,this.max.z),i[6]=new e3(this.max.x,this.max.y,this.min.z),i[7]=new e3(this.max.x,this.max.y,this.max.z),i.forEach(function(i){i.subtract(e),i.applyMatrix(t),i.add(e)}),i},e.getBoundingSphere=function(t){this.getCenter(t.center);var e=new e3;return t.radius=.5*this.getSize(e).length(),t},e.translate=function(t){return this.min.add(t),this.max.add(t),this},e.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},t}(),nd=function(){function t(t,e){void 0===t&&(t=e3.ZERO),void 0===e&&(e=-1),this.center=t.clone(),this.radius=e}var e=t.prototype;return e.set=function(t,e){return this.center.copyFrom(t),this.radius=e,this},e.setFromPoints=function(t,e){var i=this.center;if(void 0!==e){i.copyFrom(e);for(var r=0,n=0;n<t.length;n++)r=Math.max(r,i.distanceSquared(t[n]));this.radius=Math.sqrt(r)}else{var a=new nf().setFromPoints(t);a.getCenter(i),this.radius=a.getSize().length()/2}return this},e.copyFrom=function(t){return this.center.copyFrom(t.center),this.radius=t.radius,this},e.isEmpty=function(){return this.radius<0},e.makeEmpty=function(){return this.center.set(0,0,0),this.radius=-1,this},e.containsPoint=function(t){return t.distanceSquared(this.center)<=this.radius*this.radius},e.distanceToPoint=function(t){return t.distance(this.center)-this.radius},e.intersectsSphere=function(t){var e=this.radius+t.radius;return t.center.distanceSquared(this.center)<=e*e},e.intersectsBox=function(t){return t.intersectsSphere(this)},e.clampPoint=function(t,e){var i=this.center.distanceSquared(t);return void 0===e&&(e=new e3),e.copyFrom(t),i>this.radius*this.radius&&(e.subtract(this.center).normalize(),e.multiply(this.radius).add(this.center)),e},e.getBoundingBox=function(t){return(void 0===t&&(t=new nf),this.isEmpty())?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t},e.applyMatrix4=function(t){var e=t.elements,i=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return this.center.applyMatrix(t),this.radius=this.radius*Math.sqrt(Math.max(i,r,n)),this},e.translate=function(t){return this.center.add(t),this},e.expandByPoint=function(t){var e=new e3().subtractVectors(t,this.center),i=e.lengthSquared();if(i>this.radius*this.radius){var r=Math.sqrt(i),n=(r-this.radius)*.5;this.center.add(e.multiply(n/r)),this.radius+=n}return this},e.union=function(t){var e=new e3,i=new e3;return i.subtractVectors(t.center,this.center).normalize().multiply(t.radius),this.expandByPoint(e.copyFrom(t.center).add(i)),this.expandByPoint(e.copyFrom(t.center).subtract(i)),this},e.intersect=function(t){var e=new e3().subtractVectors(this.center,t.center),i=e.length();return i>this.radius+t.radius?this.makeEmpty():(this.center=this.center.add(e.normalize().multiply(i/2)),this.radius=this.radius+t.radius-i,this)},e.equals=function(t){return t.center.equals(this.center)&&t.radius===this.radius},e.clone=function(){return new t().copyFrom(this)},t}(),np=Object.freeze({__proto__:null,get EulerOrder(){return ew},Euler:nh,Quaternion:ri,Vector2:e2,Vector3:e3,Vector4:e4,Matrix3:nl,Matrix4:nu,Ray:nc,PI2:2*Math.PI,DEG2RAD:eQ,RAD2DEG:eJ,NumberEpsilon:1e-6,isZero:function(t){return isNaN(t)||1e-6>Math.abs(t)},isEqual:e$,damp:function(t,e,i,r){return e0(t,e,1-Math.exp(-i*r))},lerp:e0,degToRad:function(t){return t*eQ},radToDeg:function(t){return t*eJ},clamp:e1,Color:e5,Box3:nf,Sphere:nd});t.ShaderCompileResultStatus=void 0,(tu=t.ShaderCompileResultStatus||(t.ShaderCompileResultStatus={}))[tu.noShader=0]="noShader",tu[tu.success=1]="success",tu[tu.fail=2]="fail",tu[tu.compiling=3]="compiling",t.GLSLVersion=void 0,(th=t.GLSLVersion||(t.GLSLVersion={})).GLSL1="100",th.GLSL3="300 es";var nm=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).source=i,r}return iB(e,t),e.prototype.initialize=function(){},e}(iQ);t.Shader=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.createVariant=function(t){var e=[];if(t)for(var i,r=ij(Object.keys(t));!(i=r()).done;){var n=i.value;e.push([n,t[n]])}var a=this.engine.getShaderLibrary().createShader(this.shaderData,e);return a.shader=this,a},i.fromData=function(e){t.prototype.fromData.call(this,e),this.shaderData=e},e}(iQ),t.Shader=eG([iZ(em.Shader)],t.Shader);var nv=function(){function t(){this.reset()}var e=t.prototype;return e.setBlendColor=function(t){var e=t[0],i=t[1],r=t[2],n=t[3];(this.blendColor[0]!==e||this.blendColor[1]!==i||this.blendColor[2]!==r||this.blendColor[3]!==n)&&(this.blendColor[0]=e,this.blendColor[1]=i,this.blendColor[2]=r,this.blendColor[3]=n)},e.setBlending=function(t){this.blending!==t&&(this.blending=t)},e.setBlendFunctionParameters=function(t){var e=t[0],i=t[1],r=t[2],n=t[3];(this.blendFunctionParameters[0]!==e||this.blendFunctionParameters[1]!==i||this.blendFunctionParameters[2]!==r||this.blendFunctionParameters[3]!==n)&&(this.blendFunctionParameters[0]=e,this.blendFunctionParameters[1]=i,this.blendFunctionParameters[2]=r,this.blendFunctionParameters[3]=n)},e.setBlendEquationParameters=function(t){var e=t[0],i=t[1];(this.blendEquationParameters[0]!==e||this.blendEquationParameters[1]!==i)&&(this.blendEquationParameters[0]=e,this.blendEquationParameters[1]=i)},e.setDepthTest=function(t){this.depthTest!==t&&(this.depthTest=t)},e.setDepthMask=function(t){this.depthMask!==t&&(this.depthMask=t)},e.setDepthRange=function(t){(this.depthRange[0]!==t[0]||this.depthRange[1]!==t[1])&&(this.depthRange[0]=t[0],this.depthRange[1]=t[1])},e.setDepthFunc=function(t){this.depthFunc!==t&&(this.depthFunc=t)},e.setPolygonOffsetFill=function(t){this.polygonOffsetFill!==t&&(this.polygonOffsetFill=t)},e.setPolygonOffset=function(t){(this.polygonOffset[0]!==t[0]||this.polygonOffset[1]!==t[1])&&(this.polygonOffset[0]=t[0],this.polygonOffset[1]=t[1])},e.setSampleAlphaToCoverage=function(t){this.sampleAlphaToCoverage!==t&&(this.sampleAlphaToCoverage=t)},e.setColorMask=function(t){this.colorMask[0]=t,this.colorMask[1]=t,this.colorMask[2]=t,this.colorMask[3]=t},e.setStencilTest=function(t){this.stencilTest!==t&&(this.stencilTest=t)},e.setStencilMask=function(t){(this.stencilMask[0]!==t[0]||this.stencilMask[1]!==t[1])&&(this.stencilMask[0]=t[0],this.stencilMask[1]=t[1])},e.setStencilRef=function(t){(this.stencilRef[0]!==t[0]||this.stencilRef[1]!==t[1])&&(this.stencilRef[0]=t[0],this.stencilRef[1]=t[1])},e.setStencilFunc=function(t){(this.stencilFunc[0]!==t[0]||this.stencilFunc[1]!==t[1])&&(this.stencilFunc[0]=t[0],this.stencilFunc[1]=t[1])},e.setStencilOpFail=function(t){(this.stencilOpFail[0]!==t[0]||this.stencilOpFail[1]!==t[1])&&(this.stencilOpFail[0]=t[0],this.stencilOpFail[1]=t[1])},e.setStencilOpZFail=function(t){(this.stencilOpZFail[0]!==t[0]||this.stencilOpZFail[1]!==t[1])&&(this.stencilOpZFail[0]=t[0],this.stencilOpZFail[1]=t[1])},e.setStencilOpZPass=function(t){(this.stencilOpZPass[0]!==t[0]||this.stencilOpZPass[1]!==t[1])&&(this.stencilOpZPass[0]=t[0],this.stencilOpZPass[1]=t[1])},e.setCulling=function(t){this.culling!==t&&(this.culling=t)},e.setFrontFace=function(t){this.frontFace!==t&&(this.frontFace=t)},e.setCullFace=function(t){this.cullFace!==t&&(this.cullFace=t)},e.reset=function(){this.blending=!1,this.blendColor=[0,0,0,0],this.blendFunctionParameters=[rV.ONE,rV.ONE_MINUS_SRC_ALPHA,rV.ONE,rV.ONE_MINUS_SRC_ALPHA],this.blendEquationParameters=[rV.FUNC_ADD,rV.FUNC_ADD],this.depthTest=!0,this.depthMask=!0,this.depthRange=[0,1],this.depthFunc=rV.LESS,this.polygonOffset=[0,0],this.polygonOffsetFill=!1,this.sampleAlphaToCoverage=!1,this.colorMask=[!0,!0,!0,!0],this.stencilTest=!1,this.stencilMask=[255,255],this.stencilRef=[0,0],this.stencilFunc=[rV.ALWAYS,rV.ALWAYS],this.stencilOpFail=[rV.KEEP,rV.KEEP],this.stencilOpZFail=[rV.KEEP,rV.KEEP],this.stencilOpZPass=[rV.KEEP,rV.KEEP],this.culling=!1,this.frontFace=rV.CCW,this.cullFace=rV.FRONT},e.apply=function(t){if(t.setSampleAlphaToCoverage(this.sampleAlphaToCoverage),t.setBlending(this.blending),t.setDepthTest(this.depthTest),t.setStencilTest(this.stencilTest),t.setCulling(this.culling),t.setPolygonOffsetFill(this.polygonOffsetFill),this.stencilTest&&(t.stencilMaskSeparate(rV.BACK,this.stencilMask[1]),t.stencilMaskSeparate(rV.FRONT,this.stencilMask[0]),t.stencilFuncSeparate(rV.BACK,this.stencilFunc[0],this.stencilRef[0],this.stencilMask[0]),t.stencilFuncSeparate(rV.FRONT,this.stencilFunc[1],this.stencilRef[1],this.stencilMask[1]),t.stencilOpSeparate(rV.BACK,this.stencilOpFail[0],this.stencilOpZFail[0],this.stencilOpZPass[0]),t.stencilOpSeparate(rV.FRONT,this.stencilOpFail[1],this.stencilOpZFail[1],this.stencilOpZPass[1])),this.blending){var e=this.blendColor,i=this.blendEquationParameters,r=this.blendFunctionParameters;t.blendColor(e[0],e[1],e[2],e[3]),t.blendEquationSeparate(i[0],i[1]),t.blendFuncSeparate(r[0],r[1],r[2],r[3])}t.colorMask(this.colorMask[0],this.colorMask[1],this.colorMask[2],this.colorMask[3]),this.depthTest&&(t.depthMask(this.depthMask),t.depthFunc(this.depthFunc),t.depthRange(this.depthRange[0],this.depthRange[1])),this.culling&&(t.cullFace(this.cullFace),t.frontFace(this.frontFace)),this.polygonOffsetFill&&t.polygonOffset(this.polygonOffset[0],this.polygonOffset[1])},t}();t.MaterialRenderType=void 0,(tl=t.MaterialRenderType||(t.MaterialRenderType={}))[tl.normal=0]="normal",tl[tl.transformFeedback=1]="transformFeedback";var ny=1,ng=function(e){function i(i,r){var n;if((n=e.call(this,i)||this).stringTags={},n.enabledMacros={},n.destroyed=!1,n.initialized=!1,n.shaderDirty=!0,n.floats={},n.ints={},n.vector2s={},n.vector3s={},n.vector4s={},n.colors={},n.quaternions={},n.matrices={},n.matrice3s={},n.textures={},n.floatArrays={},n.vector4Arrays={},n.matrixArrays={},n.samplers=[],n.uniforms=[],n.uniformDirty=!0,n.macrosDirty=!0,n.materialState=new nv,r){var a=r.name,o=void 0===a?"Material"+ny++:a,s=r.renderType,u=r.shader;n.name=o,n.renderType=void 0===s?0:s,n.shaderSource=u,n.props=r,n._shader=new t.Shader(i),n._shader.shaderData=i7({},r.shader,{id:iP(),dataType:em.Shader})}else n.name="Material"+ny++,n.renderType=0;return n}iB(i,e);var r=i.prototype;return r.enableMacro=function(t,e){this.isMacroEnabled(t)&&this.enabledMacros[t]===e||(this.enabledMacros[t]=null==e||e,this.macrosDirty=!0)},r.disableMacro=function(t){this.isMacroEnabled(t)&&(delete this.enabledMacros[t],this.macrosDirty=!0)},r.isMacroEnabled=function(t){return void 0!==this.enabledMacros[t]},r.initialize=function(){var t=this,e=this.engine;this.createShaderVariant(),this.shaderVariant.initialize(),this.initialized||(e.addMaterial(this),Object.keys(this.textures).forEach(function(e){var i=t.textures[e];if(!iE(i.initialize)){ix.error("Failed to initialize texture: "+JSON.stringify(i)+". Ensure the texture conforms to the expected format.");return}i.initialize()}),this.initialized=!0)},r.createShaderVariant=function(){(this.shaderDirty||this.macrosDirty)&&(this.shaderVariant=this._shader.createVariant(this.enabledMacros),this.macrosDirty=!1,this.shaderDirty=!1,this.uniformDirty=!0)},r.setupStates=function(t){this.materialState.apply(t)},r.use=function(t,e){var i=t.engine,r=this.shaderVariant;if(r.bind(),this.setupStates(i),e){for(var n,a,o=ij(e.uniforms);!(a=o()).done;)n=a.value,this.checkUniform(n);for(var s,u=ij(e.samplers);!(s=u()).done;)n=s.value,this.samplers.includes(n)||(this.samplers.push(n),this.uniformDirty=!0)}if(this.uniformDirty&&(r.fillShaderInformation(this.uniforms,this.samplers),this.uniformDirty=!1),e){for(n in e.floats)r.setFloat(n,e.floats[n]);for(n in e.ints)r.setInt(n,e.ints[n]);for(n in e.vector4s)r.setVector4(n,e.vector4s[n]);for(n in e.vector3s)r.setVector3(n,e.vector3s[n]);for(n in e.matrices)r.setMatrix(n,e.matrices[n])}for(n in this.textures)this.textures[n].initialize();for(n in this.floats)r.setFloat(n,this.floats[n]);for(n in this.ints)r.setInt(n,this.ints[n]);for(n in this.floatArrays)r.setFloats(n,this.floatArrays[n]);for(n in this.textures)r.setTexture(n,this.textures[n]);for(n in this.vector2s)r.setVector2(n,this.vector2s[n]);for(n in this.vector3s)r.setVector3(n,this.vector3s[n]);for(n in this.vector4s)r.setVector4(n,this.vector4s[n]);for(n in this.colors)r.setColor(n,this.colors[n]);for(n in this.quaternions)r.setQuaternion(n,this.quaternions[n]);for(n in this.matrices)r.setMatrix(n,this.matrices[n]);for(n in this.matrice3s)r.setMatrix3(n,this.matrice3s[n]);for(n in this.vector4Arrays)r.setVector4Array(n,this.vector4Arrays[n]);for(n in this.matrixArrays)r.setMatrixArray(n,this.matrixArrays[n])},r.getFloat=function(t){return this.floats[t]},r.setFloat=function(t,e){this.checkUniform(t),this.floats[t]=e},r.getInt=function(t){return this.ints[t]},r.setInt=function(t,e){this.checkUniform(t),this.ints[t]=e},r.getFloats=function(t){return this.floatArrays[t]},r.setFloats=function(t,e){this.checkUniform(t),this.floatArrays[t]=e},r.getVector2=function(t){return this.vector2s[t]},r.setVector2=function(t,e){this.checkUniform(t),this.vector2s[t]=e},r.getVector3=function(t){return this.vector3s[t]},r.setVector3=function(t,e){this.checkUniform(t),this.vector3s[t]=e},r.getVector4=function(t){return this.vector4s[t]},r.setVector4=function(t,e){this.checkUniform(t),this.vector4s[t]=e},r.getColor=function(t){return this.colors[t]},r.setColor=function(t,e){this.checkUniform(t),this.colors[t]=e},r.getQuaternion=function(t){return this.quaternions[t]},r.setQuaternion=function(t,e){this.checkUniform(t),this.quaternions[t]=e},r.getMatrix=function(t){return this.matrices[t]},r.setMatrix=function(t,e){this.checkUniform(t),this.matrices[t]=e},r.setMatrix3=function(t,e){this.checkUniform(t),this.matrice3s[t]=e},r.getVector4Array=function(t){return this.vector4Arrays[t]},r.setVector4Array=function(t,e){this.checkUniform(t),this.vector4Arrays[t]=[];for(var i,r=ij(e);!(i=r()).done;){var n=i.value;this.vector4Arrays[t].push(n.x,n.y,n.z,n.w)}},r.getMatrixArray=function(t){return this.matrixArrays[t]},r.setMatrixArray=function(t,e){this.checkUniform(t),this.matrixArrays[t]=[];for(var i,r=ij(e);!(i=r()).done;)for(var n=i.value,a=0;a<16;a++)this.matrixArrays[t].push(n.elements[a])},r.setMatrixNumberArray=function(t,e){this.checkUniform(t),this.matrixArrays[t]=e},r.getTexture=function(t){return this.textures[t]},r.setTexture=function(t,e){this.samplers.includes(t)||(this.samplers.push(t),this.uniformDirty=!0),this.textures[t]=e},r.hasUniform=function(t){return this.uniforms.includes(t)||this.samplers.includes(t)},r.clone=function(t){var e=t||this.props,r=this.engine;im(r);var n=i.create(r,e);return n.materialState=Object.assign(new nv,n.materialState),n.floats=this.floats,n.ints=this.ints,n.vector2s=this.vector2s,n.vector3s=this.vector3s,n.vector4s=this.vector4s,n.colors=this.colors,n.quaternions=this.quaternions,n.matrices=this.matrices,n.textures=this.textures,n.floatArrays=this.floatArrays,n.vector4Arrays=this.vector4Arrays,n.matrixArrays=this.matrixArrays,n.samplers=this.samplers,n.uniforms=this.uniforms,n.uniformDirty=!0,n},r.cloneUniforms=function(t){var e;for(e in t.floats)this.setFloat(e,t.floats[e]);for(e in t.ints)this.setInt(e,t.ints[e]);for(e in t.floatArrays)this.setFloats(e,t.floatArrays[e]);for(e in t.textures)this.setTexture(e,t.textures[e]);for(e in t.vector2s)this.setVector2(e,t.vector2s[e]);for(e in t.vector3s)this.setVector3(e,t.vector3s[e]);for(e in t.vector4s)this.setVector4(e,t.vector4s[e]);for(e in t.colors)this.setColor(e,t.colors[e]);for(e in t.quaternions)this.setQuaternion(e,t.quaternions[e]);for(e in t.matrices)this.setMatrix(e,t.matrices[e]);for(e in t.vector4Arrays){for(var i=[],r=0;r<t.vector4Arrays[e].length;r+=4)i.push(new e4(t.vector4Arrays[e][r],t.vector4Arrays[e][r+1],t.vector4Arrays[e][r+2],t.vector4Arrays[e][r+3]));this.setVector4Array(e,i)}for(e in t.matrixArrays){for(var n=[],a=0;a<t.matrixArrays[e].length;a+=16){for(var o=nu.fromIdentity(),s=0;s<16;s++)o.elements[s]=t.matrixArrays[e][a+s];n.push(o)}this.setMatrixArray(e,n)}},r.fromData=function(t){e.prototype.fromData.call(this,t),this.uniforms=[],this.samplers=[],this.textures={},this.floats={},this.ints={},this.floatArrays={},this.vector4s={};var i,r,n=i7({},t);void 0!==t.stringTags.RenderType&&(this.blending=t.stringTags.RenderType===tq.Transparent),void 0!==t.floats.ZTest&&(this.depthTest=0!==t.floats.ZTest),void 0!==t.floats.ZWrite&&(this.depthMask=0!==t.floats.ZWrite);var a=t.stringTags.RenderFace;for(i in a===tK.Front?(this.culling=!0,this.cullFace=rV.BACK):a===tK.Back?(this.culling=!0,this.cullFace=rV.FRONT):this.culling=!1,n.floats)this.setFloat(i,n.floats[i]);for(i in n.ints)this.setInt(i,n.ints[i]);for(i in n.vector4s){var o=n.vector4s[i];this.setVector4(i,new e4(o.x,o.y,o.z,o.w))}for(i in n.colors){var s=n.colors[i];this.setColor(i,new e5(s.r,s.g,s.b,s.a))}for(i in n.textures){var u=n.textures[i],h=this.engine.findObject(u.texture);this.setTexture(i,h);var l=u.offset,c=u.scale;l&&c&&this.setVector4(i+"_ST",new e4(c.x,c.y,l.x,l.y))}if(t.shader){var f=this.engine.findObject(t.shader);f&&(this.shader=f,this.shaderSource=f.shaderData)}this.stringTags=null!=(r=t.stringTags)?r:{},this.initialized=!1},r.toData=function(){var t=this.definition;for(var e in this._shader&&(t.shader=this._shader),t.floats={},t.ints={},t.vector4s={},t.colors={},t.textures={},t.dataType=em.Material,t.stringTags=this.stringTags,this.floats)t.floats[e]=this.floats[e];for(var i in this.ints)t.ints[i]=this.ints[i];for(var r in this.vector4s)t.vector4s[r]=this.vector4s[r];for(var n in this.colors)t.colors[n]=this.colors[n];for(var a in this.textures){t.textures[a]||(t.textures[a]={texture:this.textures[a]});var o=t.textures[a],s=this.getVector4(a+"_ST");s&&(o.scale={x:s.x,y:s.y},o.offset={x:s.z,y:s.w},delete t.vector4s[a+"_ST"])}return t},r.checkUniform=function(t){this.uniforms.includes(t)||(this.uniforms.push(t),this.uniformDirty=!0)},r.dispose=function(){var t;this.destroyed||(null==(t=this.shaderVariant)||t.dispose(),this.textures={},this.shaderSource=null,this.floats={},this.ints={},this.vector2s={},this.vector3s={},this.vector4s={},this.quaternions={},this.matrices={},this.matrice3s={},this.textures={},this.floatArrays={},this.vector4Arrays={},this.matrixArrays={},this.samplers=[],this.uniforms=[],this.initialize=iA,this.destroyed=!0,void 0!==this.engine&&this.engine.removeMaterial(this),e.prototype.dispose.call(this))},rI(i,[{key:"shader",get:function(){return this._shader},set:function(t){this._shader!==t&&(this._shader=t,this.shaderDirty=!0)}},{key:"mainTexture",get:function(){return this.getTexture("_MainTex")},set:function(t){this.setTexture("_MainTex",t)}},{key:"color",get:function(){return this.getColor("_Color")},set:function(t){this.setColor("_Color",t)}},{key:"blending",get:function(){return this.materialState.blending},set:function(t){void 0!==t&&this.materialState.setBlending(t)}},{key:"blendColor",get:function(){return this.materialState.blendColor},set:function(t){t&&this.materialState.setBlendColor(t)}},{key:"blendFunction",get:function(){return this.materialState.blendFunctionParameters},set:function(t){t&&this.materialState.setBlendFunctionParameters(t)}},{key:"blendEquation",get:function(){return this.materialState.blendEquationParameters},set:function(t){t&&this.materialState.setBlendEquationParameters(t)}},{key:"depthTest",get:function(){return this.materialState.depthTest},set:function(t){void 0!==t&&this.materialState.setDepthTest(t)}},{key:"depthMask",get:function(){return this.materialState.depthMask},set:function(t){void 0!==t&&this.materialState.setDepthMask(t)}},{key:"depthRange",get:function(){return this.materialState.depthRange},set:function(t){t&&this.materialState.setDepthRange(t)}},{key:"depthFunc",get:function(){return this.materialState.depthFunc},set:function(t){void 0!==t&&this.materialState.setDepthFunc(t)}},{key:"polygonOffsetFill",get:function(){return this.materialState.polygonOffsetFill},set:function(t){void 0!==t&&this.materialState.setPolygonOffsetFill(t)}},{key:"polygonOffset",get:function(){return this.materialState.polygonOffset},set:function(t){t&&this.materialState.setPolygonOffset(t)}},{key:"sampleAlphaToCoverage",get:function(){return this.materialState.sampleAlphaToCoverage},set:function(t){void 0!==t&&this.materialState.setSampleAlphaToCoverage(t)}},{key:"colorMask",get:function(){return this.materialState.colorMask[0]},set:function(t){this.materialState.setColorMask(t)}},{key:"stencilTest",get:function(){return this.materialState.stencilTest},set:function(t){void 0!==t&&this.materialState.setStencilTest(t)}},{key:"stencilMask",get:function(){return this.materialState.stencilMask},set:function(t){t&&this.materialState.setStencilMask(t)}},{key:"stencilRef",get:function(){return this.materialState.stencilRef},set:function(t){t&&this.materialState.setStencilRef(t)}},{key:"stencilFunc",get:function(){return this.materialState.stencilFunc},set:function(t){t&&this.materialState.setStencilFunc(t)}},{key:"stencilOpFail",get:function(){return this.materialState.stencilOpFail},set:function(t){t&&this.materialState.setStencilOpFail(t)}},{key:"stencilOpZFail",get:function(){return this.materialState.stencilOpZFail},set:function(t){t&&this.materialState.setStencilOpZFail(t)}},{key:"stencilOpZPass",get:function(){return this.materialState.stencilOpZPass},set:function(t){t&&this.materialState.setStencilOpZPass(t)}},{key:"culling",get:function(){return this.materialState.culling},set:function(t){void 0!==t&&this.materialState.setCulling(t)}},{key:"frontFace",get:function(){return this.materialState.frontFace},set:function(t){void 0!==t&&this.materialState.setFrontFace(t)}},{key:"cullFace",get:function(){return this.materialState.cullFace},set:function(t){void 0!==t&&this.materialState.setCullFace(t)}},{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(iQ);ng.create=function(t,e){return new ng(t,e)};var nx=function(){function e(){this.alphaMaskEnabled=!1,this.isMask=!1,this.maskReferences=[],this.expectedStencilValue=0,this.stencilClearAction={stencilAction:t.TextureLoadAction.clear}}var i=e.prototype;return i.setMaskOptions=function(t,e){var i=e.isMask,r=void 0!==i&&i,n=e.references,a=void 0===n?[]:n,o=e.alphaMaskEnabled;if(this.alphaMaskEnabled=void 0!==o&&o,this.isMask=r,this.maskReferences=[],!r&&0!==a.length)for(var s,u=new Map,h=ij(a);!(s=h()).done;){var l,c=s.value,f=c.mask;if(f){var d=t.findObject(f);if(!d){console.warn("Mask reference not found: "+JSON.stringify(f)+". Skipping.");continue}var p=null!=(l=c.inverted)&&l,m=u.get(d);if(void 0!==m){m!==p&&console.warn("Same maskable referenced with conflicting inverted flags; keeping the first occurrence.");continue}if(this.maskReferences.length>=254){console.warn("Maximum of 254 mask references exceeded. Additional masks will be ignored.");break}u.set(d,p),this.maskReferences.push({maskable:d,inverted:p})}}},i.addMaskReference=function(t,e){if(void 0===e&&(e=!1),!this.maskReferences.some(function(e){return e.maskable===t})){if(this.maskReferences.length>=254){console.warn("Maximum of 254 mask references exceeded. Additional masks will be ignored.");return}this.maskReferences.push({maskable:t,inverted:e})}},i.removeMaskReference=function(t){var e=this.maskReferences.findIndex(function(e){return e.maskable===t});-1!==e&&this.maskReferences.splice(e,1)},i.clearMaskReferences=function(){this.maskReferences=[]},i.getMaskReferences=function(){return this.maskReferences.slice()},i.drawStencilMask=function(t,e){for(var i,r=e.frameClipMasks,n=[],a=ij(r);!(i=a()).done;){var o=i.value,s=this.maskReferences.length;this.addMaskReference(o,!1),this.maskReferences.length>s&&n.push(o)}if(this.maskReferences.length>0){t.clear(this.stencilClearAction);for(var u,h=[],l=[],c=ij(this.maskReferences);!(u=c()).done;){var f=u.value;f.inverted?l.push(f):h.push(f)}for(var d=0;d<h.length;d++)h[d].maskable.drawStencilMask(d);for(var p,m=h.length,v=ij(l);!(p=v()).done;)p.value.maskable.drawStencilMask(m);this.expectedStencilValue=m}for(var y,g=ij(e.materials);!(y=g()).done;){var x=y.value;this.setupMaskedMaterial(x)}for(var b,T=ij(n);!(b=T()).done;){var C=b.value;this.removeMaskReference(C)}},i.drawGeometryMask=function(t,e,i,r,n,a){void 0===a&&(a=0);var o=r.colorMask,s=r.stencilTest,u=r.stencilFunc,h=r.stencilOpFail,l=r.stencilOpZFail,c=r.stencilOpZPass,f=r.stencilRef,d=r.stencilMask;this.setupMaskMaterial(r,n),t.drawGeometry(e,i,r,a),r.colorMask=o,r.stencilTest=s,r.stencilFunc=u,r.stencilOpFail=h,r.stencilOpZFail=l,r.stencilOpZPass=c,r.stencilRef=f,r.stencilMask=d},i.setupMaskMaterial=function(t,e){t.stencilTest=!0,t.stencilFunc=[rV.EQUAL,rV.EQUAL],t.stencilRef=[e,e],t.stencilMask=[255,255],t.stencilOpFail=[rV.KEEP,rV.KEEP],t.stencilOpZFail=[rV.KEEP,rV.KEEP],t.stencilOpZPass=[rV.INCR,rV.INCR],t.colorMask=!1},i.setupMaskedMaterial=function(t){this.maskReferences.length>0?(t.stencilTest=!0,t.stencilRef=[this.expectedStencilValue,this.expectedStencilValue],t.stencilMask=[255,255],t.stencilFunc=[rV.EQUAL,rV.EQUAL],t.stencilOpZPass=[rV.KEEP,rV.KEEP]):t.stencilTest=!1},rI(e,[{key:"maskable",get:function(){return this.maskReferences.length>0?this.maskReferences[0].maskable:null},set:function(t){this.maskReferences=[],t&&this.maskReferences.push({maskable:t,inverted:!1})}}]),e}();t.HitTestType=void 0,(tc=t.HitTestType||(t.HitTestType={}))[tc.triangle=1]="triangle",tc[tc.box=2]="box",tc[tc.sphere=3]="sphere",tc[tc.custom=4]="custom";var nb=function(){this.position=new e2,this.delta=new e2,this.pointerCurrentRaycast=new nT},nT=function(){this.point=null,this.item=null},nC=function(){function t(t,e,i){this.vectors=[],this.vectorsWorld=[],this.directions=[];for(var r=0;r<8;r++)this.vectors.push(new e3),this.vectorsWorld.push(new e3);for(var n=0;n<3;n++)this.directions.push(new e3);this.minimum=new e3,this.maximum=new e3,this.minimumWorld=new e3,this.maximumWorld=new e3,this.center=new e3,this.centerWorld=new e3,this.extendSize=new e3,this.extendSizeWorld=new e3,this.worldMatrix=i||nu.fromIdentity(),this.reConstruct(t,e,i)}var e=t.prototype;return e.reConstruct=function(e,i,r){var n=e.x,a=e.y,o=e.z,s=i.x,u=i.y,h=i.z;this.minimum.set(n,a,o),this.maximum.set(s,u,h),this.vectors[0].set(n,a,o),this.vectors[1].set(s,u,h),this.vectors[2].set(s,a,o),this.vectors[3].set(n,u,o),this.vectors[4].set(n,a,h),this.vectors[5].set(s,u,o),this.vectors[6].set(n,u,h),this.vectors[7].set(s,a,h);var l=t.tempVector0,c=t.tempVector1;l.copyFrom(i).add(e),this.center.copyFrom(l).scale(.5),c.copyFrom(i).subtract(e),this.extendSize.copyFrom(c).scale(.5),this.worldMatrix=r||nu.fromIdentity(),this.update(this.worldMatrix)},e.update=function(e){var i=this.minimumWorld,r=this.maximumWorld,n=this.vectorsWorld,a=this.vectors;if(e.isIdentity()){i.copyFrom(this.minimum),r.copyFrom(this.maximum);for(var o=0;o<8;o++)n[o].copyFrom(a[o]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{i.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(var s=0;s<8;s++){e.transformPoint(a[s],n[s]);var u=n[s];i.x=Math.min(i.x,u.x),i.y=Math.min(i.y,u.y),i.z=Math.min(i.z,u.z),r.x=Math.max(r.x,u.x),r.y=Math.max(r.y,u.y),r.z=Math.max(r.z,u.z)}var h=t.tempVector0,l=t.tempVector1;h.copyFrom(r).subtract(i),this.extendSizeWorld.copyFrom(h).scale(.5),l.copyFrom(r).add(i),this.centerWorld.copyFrom(l).scale(.5)}var c=e.elements;this.directions[0].set(c[0],c[1],c[2]),this.directions[1].set(c[4],c[5],c[6]),this.directions[2].set(c[8],c[9],c[10]),this.worldMatrix=e},e.scale=function(e){var i=t.tempVector0;i.copyFrom(this.maximum).subtract(this.minimum);var r=i.length();i.scale(1/r),i.scale(r*e*.5);var n=t.tempVector1,a=t.tempVector2;return n.copyFrom(this.center).subtract(i),a.copyFrom(this.center).add(i),this.reConstruct(n,a,this.worldMatrix),this},e.getWorldMatrix=function(){return this.worldMatrix},e.intersectsPoint=function(t){var e=this.minimumWorld,i=this.maximumWorld;return!(i.x-t.x<-.000001)&&!(-.000001>t.x-e.x)&&!(i.y-t.y<-.000001)&&!(-.000001>t.y-e.y)&&!(i.z-t.z<-.000001)&&!(-.000001>t.z-e.z)},e.intersectsBox=function(t){return this.intersectsMinMax(t.minimumWorld,t.maximumWorld)},e.intersectsMinMax=function(t,e){var i=this.minimumWorld,r=this.maximumWorld;return!(r.x<t.x)&&!(i.x>e.x)&&!(r.y<t.y)&&!(i.y>e.y)&&!(r.z<t.z)&&!(i.z>e.z)},t.intersects=function(t,e){return t.intersectsMinMax(e.minimumWorld,e.maximumWorld)},t}();nC.tempVector0=new e3,nC.tempVector1=new e3,nC.tempVector2=new e3;var nE=function(){function e(){this.boundingBox=new nC(new e3,new e3),this.triangles=[],this.worldMatrix=new nu,this.assemblyTriangles=function(t,e,i,r,n){for(var a=i;a<r;a+=3){var o=3*e[a],s=3*e[a+1],u=3*e[a+2],h={x:t[o],y:t[o+1],z:t[o+2]},l={x:t[s],y:t[s+1],z:t[s+2]},c={x:t[u],y:t[u+1],z:t[u+2]};n.push({p0:h,p1:l,p2:c})}}}var i=e.prototype;return i.reConstruct=function(t,e,i){this.boundingBox.reConstruct(t,e,i)},i.getRawBoundingBoxTriangle=function(){return this.applyWorldMatrix(this.boundingBoxTriangle.area),this.boundingBoxTriangle},i.getBoundingBoxTriangle=function(e){for(var i,r=-Number.MAX_VALUE,n=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=Number.MAX_VALUE,s=ij(this.boundingBoxTriangle.area);!(i=s()).done;){var u=i.value;r=Math.max(u.p0.x,u.p1.x,u.p2.x,r),n=Math.max(u.p0.y,u.p1.y,u.p2.y,n),a=Math.min(u.p0.x,u.p1.x,u.p2.x,a),o=Math.min(u.p0.y,u.p1.y,u.p2.y,o)}var h=[],l=new e3(a,n,0),c=new e3(r,n,0),f=new e3(r,o,0),d=new e3(a,o,0);return h.push({p0:l,p1:c,p2:f}),h.push({p0:l,p1:f,p2:d}),this.applyWorldMatrix(h),{type:t.HitTestType.triangle,area:h}},i.setGeometry=function(e,i){this.triangles=this.geometryToTriangles(e);for(var r,n=[],a=ij(this.triangles);!(r=a()).done;){var o=r.value;n.push({p0:o.p0,p1:o.p1,p2:o.p2})}i&&this.worldMatrix.copyFrom(i),this.boundingBoxTriangle={type:t.HitTestType.triangle,area:n}},i.geometryToTriangles=function(t){var e=t.getIndexData(),i=t.getAttributeData("aPos"),r=[];if(!e||!i)return r;if(0===t.subMeshes.length)this.assemblyTriangles(i,e,0,e.length,r);else for(var n,a=ij(t.subMeshes);!(n=a()).done;){var o=n.value;if(void 0!==o.indexCount){var s=e.BYTES_PER_ELEMENT,u=o.offset/s,h=u+o.indexCount;this.assemblyTriangles(i,e,u,h,r)}}return r},i.applyWorldMatrix=function(t){var e=this;return t.forEach(function(t){t.p0=e.worldMatrix.transformPoint(t.p0,new e3),t.p1=e.worldMatrix.transformPoint(t.p1,new e3),t.p2=e.worldMatrix.transformPoint(t.p2,new e3)}),t},e}(),n_=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.materials=[],e.frameClipMasks=[],e.maskManager=new nx,e._priority=0,e.boundingBoxInfo=new nE,e}iB(e,t);var i=e.prototype;return i.onEnable=function(){var t;null==(t=this.item.composition)||t.renderFrame.addMeshToDefaultRenderPass(this)},i.onDisable=function(){var t;null==(t=this.item.composition)||t.renderFrame.removeMeshFromDefaultRenderPass(this)},i.onParentChanged=function(){this.frameClipMasks=[]},i.getBoundingBoxInfo=function(){return this.boundingBoxInfo},i.render=function(t){},rI(e,[{key:"priority",get:function(){return this._priority},set:function(t){this._priority=t}},{key:"material",get:function(){return this.materials[0]},set:function(t){0===this.materials.length?this.materials.push(t):this.materials[0]=t}}]),e}(rO);eG([iK(void 0,void 0)],n_.prototype,"materials",void 0),eG([iK(void 0,void 0)],n_.prototype,"_priority",void 0);var nw="editor",nS={"Item duration can't be less than 0":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#AOnQS","ValueType: 21/22 is not supported":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#smO1b","Container size overflowed":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#MvjnY","Container is not an HTMLElement":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#WZaWg","Invalid container size":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#lLlSW","DPI overflowed":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#ulfNT"},nM=function(){var t=this,e=this;this.listeners={},this.off=function(e,i){t.listeners[e]&&(t.listeners[e]=t.listeners[e].filter(function(t){return t.listener!==i}))},this.on=function(e,i,r){return t.listeners[e]=t.listeners[e]||[],t.listeners[e].push({listener:i,options:r}),function(){return t.off(e,i)}},this.once=function(e,i){t.on(e,i,{once:!0})},this.emit=function(t){for(var i,r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];null==(i=e.listeners[t])||i.forEach(function(i){var r=i.listener,a=i.options;r.apply(void 0,[].concat(n)),(null==a?void 0:a.once)&&e.off(t,r)})},this.getListeners=function(e){var i;return(null==(i=t.listeners[e])?void 0:i.map(function(t){return t.listener}))||[]}},nA=new ri,nP=new e3,nR=new e3,nI=1,nO=function(){function t(t,e){void 0===t&&(t={}),this.taggedProperties={},this.position=new e3(0,0,0),this.quat=new ri(0,0,0,1),this.rotation=new nh(0,0,0),this.scale=new e3(1,1,1),this.anchor=new e3(0,0,0),this.size=new e2(1,1),this.children=[],this.worldMatrix=nu.fromIdentity(),this.localMatrix=nu.fromIdentity(),this.localMatrix2D=nl.fromIdentity(),this.valid=!0,this.dirtyFlags={localData:!1,localMatrix2D:!1,worldMatrix:!1,worldTRS:!1},this.worldTRSCache={position:new e3(0,0,0),quat:new ri(0,0,0,1),scale:new e3(1,1,1)},this.name="transform_"+nI++,t&&this.setTransform(t),e&&(this.parentTransform=e),void 0!==t.valid&&this.setValid(t.valid)}var e=t.prototype;return e.onParentTransformChanged=function(t,e){},e.setPosition=function(t,e,i){(this.position.x!==t||this.position.y!==e||this.position.z!==i)&&(this.position.x=t,this.position.y=e,this.position.z=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.translate=function(t,e,i){(0!==t||0!==e||0!==i)&&(this.position.x+=t,this.position.y+=e,this.position.z+=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setRotation=function(t,e,i){(this.rotation.x!==t||this.rotation.y!==e||this.rotation.z!==i)&&(this.rotation.x=t,this.rotation.y=e,this.rotation.z=i,this.quat.setFromEuler(this.rotation),this.quat.conjugate(),this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setQuaternion=function(t,e,i,r){(this.quat.x!==t||this.quat.y!==e||this.quat.z!==i||this.quat.w!==r)&&(this.quat.x=t,this.quat.y=e,this.quat.z=i,this.quat.w=r,this.rotation.setFromQuaternion(this.quat),this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setScale=function(t,e,i){(this.scale.x!==t||this.scale.y!==e||this.scale.z!==i)&&(this.scale.x=t,this.scale.y=e,this.scale.z=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setSize=function(t,e){(this.size.x!==t||this.size.y!==e)&&(this.size.x=t,this.size.y=e,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.rotateByQuat=function(t){this.quat.multiply(t),this.rotation.setFromQuaternion(this.quat),this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.scaleBy=function(t,e,i){this.scale.x*=t,this.scale.y*=e,this.scale.z*=i,this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.setAnchor=function(t,e){(this.anchor.x!==t||this.anchor.y!==e)&&(this.anchor.x=t,this.anchor.y=e,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setTransform=function(t,e){var i=t.position,r=t.rotation,n=t.scale,a=t.size,o=t.quat,s=t.name,u=t.anchor;if(s&&(this.name=s),i&&(eU(i,e3)?this.setPosition(i.x,i.y,i.z):this.setPosition(i[0],i[1],i[2])),o)eU(o,ri)?this.setQuaternion(o.x,o.y,o.z,o.w):this.setQuaternion(o[0],o[1],o[2],o[3]);else if(r){var h=e?-1:1;eU(r,nh)?this.setRotation(r.x*h,r.y*h,r.z*h):this.setRotation(r[0]*h,r[1]*h,r[2]*h)}n&&(eU(n,e3)?this.setScale(n.x,n.y,n.z):this.setScale(n[0],n[1],n[2])),a&&this.setSize(a.x,a.y),u&&(eU(u,e2)?this.setAnchor(u.x,u.y):this.setAnchor(u[0],u[1]))},e.addChild=function(t){eZ(this.children,t)},e.removeChild=function(t){eq(this.children,t)},e.getRotation=function(){return t.getRotation(this.quat,new nh)},e.getQuaternion=function(){return this.quat},e.updateLocalMatrix=function(){this.valid?(this.dirtyFlags.localData&&(this.localMatrix.compose(this.position,this.quat,this.scale,this.anchor),this.dirtyFlags.worldMatrix=!0,this.dirtyFlags.localMatrix2D=!0),this.dirtyFlags.localData=!1):this.localMatrix.isIdentity()||(this.localMatrix.identity(),this.dirtyFlags.worldMatrix=!0,this.dirtyFlags.localMatrix2D=!0)},e.getMatrix=function(){return this.updateLocalMatrix(),this.localMatrix},e.getMatrix2D=function(){var t,e,i;return this.updateLocalMatrix(),this.dirtyFlags.localMatrix2D&&(t=this.localMatrix2D,e=this.localMatrix.elements,(i=t.elements)[0]=e[0],i[1]=e[1],i[2]=0,i[3]=e[4],i[4]=e[5],i[5]=0,i[6]=e[12],i[7]=e[13],i[8]=1,this.dirtyFlags.localMatrix2D=!1),this.localMatrix2D},e.getParentMatrix=function(){return this.parent&&(this.parentMatrix=this.parent.getWorldMatrix()),this.parentMatrix},e.getWorldMatrix=function(){var t=this.getMatrix(),e=this.getParentMatrix();return this.dirtyFlags.worldMatrix&&(e?this.worldMatrix.multiplyMatrices(e,t):this.worldMatrix.copyFrom(t),this.dirtyFlags.worldTRS=!0,this.dirtyFlags.worldMatrix=!1),this.worldMatrix},e.getWorldScale=function(){return this.updateTRSCache(),this.worldTRSCache.scale.clone()},e.getWorldPosition=function(){return this.updateTRSCache(),this.worldTRSCache.position.clone()},e.setWorldPosition=function(t,e,i){var r=this.getParentMatrix();r?(nP.set(0,0,0),nA.set(0,0,0,1),nR.set(1,1,1),r.decompose(nP,nA,nR),nP.set(t-nP.x,e-nP.y,i-nP.z),nA.invert(),nP.applyQuaternion(nA),nP.x=0!==nR.x?nP.x/nR.x:0,nP.y=0!==nR.y?nP.y/nR.y:0,nP.z=0!==nR.z?nP.z/nR.z:0,this.setPosition(nP.x,nP.y,nP.z)):this.setPosition(t,e,i)},e.getWorldRotation=function(){return this.updateTRSCache(),t.getRotation(this.worldTRSCache.quat,new nh)},e.assignWorldTRS=function(t,e,i){this.updateTRSCache(),t&&t.copyFrom(this.worldTRSCache.position),e&&e.copyFrom(this.worldTRSCache.quat),i&&i.copyFrom(this.worldTRSCache.scale)},e.cloneFromMatrix=function(t,e){t.decompose(this.position,this.quat,this.scale),this.rotation.setFromQuaternion(this.quat.clone().conjugate()),e&&e.copyFrom(this.scale),this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.setValid=function(t){this.valid!==t&&(this.valid=t,t?this.dirtyFlags.localData=!0:(this.localMatrix.identity(),this.dirtyFlags.worldMatrix=!0,this.dirtyFlags.localMatrix2D=!0),this.dispatchValueChange())},e.getValid=function(){return this.valid},e.toData=function(){var t=this.taggedProperties;return t.position=this.position.clone(),t.eulerHint={x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},t.scale=this.scale.clone(),t},e.fromData=function(t){var e={};e.position=new e3().copyFrom(t.position),t.quat?e.quat=new ri(t.quat.x,t.quat.y,t.quat.z,t.quat.w):e.rotation=new nh(t.eulerHint.x,t.eulerHint.y,t.eulerHint.z),e.scale=new e3().copyFrom(t.scale),t.size&&(e.size=new e2().copyFrom(t.size)),t.anchor&&(e.anchor=new e2().copyFrom(t.anchor)),this.setTransform(e)},e.dispose=function(){},e.updateTRSCache=function(){var t=this.getWorldMatrix();if(this.dirtyFlags.worldTRS){var e=this.worldTRSCache;t.decompose(e.position,e.quat,e.scale),this.dirtyFlags.worldTRS=!1}},e.dispatchValueChange=function(){this.children.forEach(function(t){t.worldMatrixDirty=!0})},t.getRotation=function(t,e){var i=nA.copyFrom(t);return i.conjugate(),e.setFromQuaternion(i)},rI(t,[{key:"parentTransform",get:function(){return this.parent},set:function(t){if(t&&this.parent!==t&&this!==t){var e=this.parent;this.parent&&this.parent.removeChild(this),t.addChild(this),this.parent=t,this.worldMatrixDirty=!0,this.onParentTransformChanged(e,t)}}},{key:"worldMatrixDirty",get:function(){return this.dirtyFlags.worldMatrix},set:function(t){this.dirtyFlags.worldMatrix!==t&&(this.dirtyFlags.worldMatrix=t,this.dispatchValueChange())}}]),t}();t.VFXItem=function(e){function i(t,i){var r;return(r=e.call(this,t)||this).children=[],r.transform=new nO,r.time=-1,r.duration=0,r.endBehavior=t0.forward,r.type=tH.base,r.components=[],r.isDuringPlay=!1,r.isManuallySetRenderOrder=!1,r.active=!0,r.visible=!0,r.listIndex=0,r.isEnabled=!1,r.eventProcessor=new nM,r.name="VFXItem",r.transform.name=r.name,r.transform.engine=t,i&&r.fromData(i),r}iB(i,e);var r=i.prototype;return r.on=function(t,e,i){this.eventProcessor.on(t,e,i)},r.off=function(t,e){this.eventProcessor.off(t,e)},r.once=function(t,e){this.eventProcessor.once(t,e)},r.emit=function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=this.eventProcessor).emit.apply(e,[].concat([t],r))},r.getListeners=function(t){return this.eventProcessor.getListeners(t)},r.addComponent=function(t){var e=new t(this.engine);return this.components.push(e),e.setVFXItem(this),e},r.getComponent=function(t){for(var e,i,r=ij(this.components);!(i=r()).done;){var n=i.value;if(eU(n,t)){e=n;break}}return e},r.getComponents=function(t){for(var e,i=[],r=ij(this.components);!(e=r()).done;){var n=e.value;eU(n,t)&&i.push(n)}return i},r.getDescendants=function(t,e){var i=[];return this.getDescendantsInternal(i,t,e),i},r.setParent=function(t){(t!==this||t)&&(this.parent&&eq(this.parent.children,this),this.parent=t,this.transform.parentTransform=t.transform,t.children.push(this),!this.composition&&t.composition&&(this.composition=t.composition),this.onParentChanged(),!this.isDuringPlay&&t.isDuringPlay&&(this.awake(),this.beginPlay()))},r.setColor=function(t,e,i,r){},r.setOpacity=function(t){},r.setActive=function(t){!!t!==this.active&&(this.active=!!t,this.onActiveChanged())},r.setVisible=function(t){for(var e,i=ij(this.components);!(e=i()).done;)e.value.enabled=t;this.visible=t},r.getVisible=function(){return this.visible},r.getWorldTransform=function(t){var e=null!=t?t:new nO({valid:!0});return e.cloneFromMatrix(this.transform.getWorldMatrix()),e},r.translate=function(t,e,i){this.transform.translate(t,e,i)},r.rotate=function(t,e,i){var r=new nh(t,e,i),n=ri.fromEuler(r);n.conjugate(),this.transform.rotateByQuat(n)},r.scale=function(t,e,i){this.transform.scaleBy(t,e,i)},r.setPosition=function(t,e,i){this.transform.setPosition(t,e,i)},r.setRotation=function(t,e,i){this.transform.setRotation(t,e,i)},r.setScale=function(t,e,i){this.transform.setScale(t,e,i)},r.setWorldPosition=function(t,e,i){this.transform.setWorldPosition(t,e,i)},r.setPositionByPixel=function(t,e){if(this.composition){var i=this.transform.getWorldPosition().z,r=this.composition.camera.getInverseVPRatio(i),n=r.x,a=r.y,o=this.composition.engine.canvas.getBoundingClientRect(),s=o.width,u=o.height;this.transform.setPosition((2*t/s-1)*n,(1-2*e/u)*a,i)}},r.translateByPixel=function(t,e){if(this.composition){var i=this.composition.engine.canvas.getBoundingClientRect(),r=i.width,n=i.height,a=this.transform.getWorldPosition().z,o=this.composition.camera.getInverseVPRatio(a),s=o.x,u=o.y;this.transform.translate(2*t*s/r,-2*e*u/n,0)}},r.getBoundingBox=function(){},r.getHitTestParams=function(t){},r.hitTest=function(e,r,n,a,o,s,u){if(!this.isActive)return!1;var h=!1,l=null==u?void 0:u.maxCount,c=this.getHitTestParams(s);if(c){var f=c.clipMasks,d=!0;if(f.length>0&&!function(t,e){for(var i,r=ij(e);!(i=r()).done;){var n=i.value.item;if(n.isActive&&n.transform.getValid()){var a=n.transform,o=a.getWorldMatrix(),s=a.size.x,u=a.size.y,h=new e3(-.5*s,.5*u,0).applyMatrix(o),l=new e3(-.5*s,-.5*u,0).applyMatrix(o),c=new e3(.5*s,.5*u,0).applyMatrix(o),f=new e3(.5*s,-.5*u,0).applyMatrix(o),d={p0:h,p1:l,p2:c},p={p0:c,p1:l,p2:f};if(!t.intersectTriangle(d)&&!t.intersectTriangle(p))return!1}}return!0}(e,f)&&(d=!1),d){var p=!1,m=new e3;if(c.type===t.HitTestType.triangle){for(var v=c.triangles,y=c.backfaceCulling,g=0;g<v.length;g++)if(e.intersectTriangle(v[g],m,y)){p=!0,o.push(m);break}}else if(c.type===t.HitTestType.box){var x=c.center,b=c.size,T=x.clone().addScaledVector(b,.5),C=x.clone().addScaledVector(b,-.5);e.intersectBox({min:T,max:C},m)&&(p=!0,o.push(m))}else if(c.type===t.HitTestType.sphere){var E=c.center,_=c.radius;e.intersectSphere({center:E,radius:_},m)&&(p=!0,o.push(m))}else if(c.type===t.HitTestType.custom){var w=c.collect(e,new e2(r,n));w&&w.length>0&&(w.forEach(function(t){o.push(t)}),p=!0)}if(p){var S,M,A={id:this.getInstanceId(),name:this.name,position:o[o.length-1],parentId:this.parentId,hitPositions:o,behavior:c.behavior,item:this,composition:this.composition};if(a.push(A),h=!0,null==u?void 0:null==(M=u.stop)?void 0:M.call(u,A))return!0}}}for(var P,R=ij(this.children);!(P=R()).done;){var I,O=P.value;if(void 0!==l&&a.length>=l)break;(null==u||null==(I=u.skip)||!I.call(u,O))&&O.hitTest(e,r,n,a,o,s,u)&&(h=!0)}return i.isComposition(this)&&h&&this!==(null==(S=this.composition)?void 0:S.sceneRoot)&&a.push({id:this.getInstanceId(),name:this.name,position:o[o.length-1],parentId:this.parentId,hitPositions:o,behavior:tX.NONE,item:this,composition:this.composition}),h},r.getCurrentPosition=function(){var t=new e3;return this.transform.assignWorldTRS(t),t},r.find=function(t){if(this.name===t)return this;var e=[];e.push.apply(e,[].concat(this.children));for(var i=0;i<e.length;){var r=e[i];if(i++,r.name===t)return r;e.push.apply(e,[].concat(r.children))}},r.duplicate=function(){var t=new Map;this.gatherPreviousObjectID(t),this.refreshGUIDRecursive();var e=this.engine.findObject({id:this.definition.id});return e.refreshGUIDRecursive(),this.refreshGUIDRecursive(t),this.composition&&e.setParent(this.composition.sceneRoot),e},r.beginPlay=function(){this.isDuringPlay=!0,this.composition&&this.active&&!this.isEnabled&&this.onEnable();for(var t,e=ij(this.children);!(t=e()).done;){var i=t.value;i.isDuringPlay||i.beginPlay()}},r.awake=function(){for(var t,e=ij(this.components);!(t=e()).done;){var i=t.value;i.isAwakeCalled||(i.onAwake(),i.isAwakeCalled=!0)}for(var r,n=ij(this.children);!(r=n()).done;)r.value.awake()},r.onActiveChanged=function(){this.isDuringPlay&&this.composition&&(this.active?this.isEnabled||this.onEnable():this.isEnabled&&this.onDisable())},r.onEnable=function(){this.isEnabled=!0;for(var t,e=ij(this.components);!(t=e()).done;){var i=t.value;i.enabled&&!i.isStartCalled&&(i.onStart(),i.isStartCalled=!0)}for(var r,n=ij(this.components);!(r=n()).done;){var a=r.value;a.enabled&&!a.isEnableCalled&&a.enable()}},r.onDisable=function(){this.isEnabled=!1;for(var t,e=ij(this.components);!(t=e()).done;){var i=t.value;i.enabled&&i.isEnableCalled&&i.disable()}},r.onParentChanged=function(){for(var t,e=ij(this.components);!(t=e()).done;)t.value.onParentChanged();for(var i,r=ij(this.children);!(i=r()).done;)i.value.onParentChanged()},r.setRendererComponentOrder=function(t){for(var e,i=ij(this.components);!(e=i()).done;){var r=e.value;eU(r,n_)&&(r.priority=t)}},r.fromData=function(t){e.prototype.fromData.call(this,t);var r=t.id,n=t.name,a=t.parentId,o=t.endBehavior,s=t.transform,u=t.duration,h=void 0===u?0:u,l=t.visible;if(this.type=t.type,this.props=t,this.id=r.toString(),this.parentId=a,this.components.length=0,i.isComposition(this)){var c=this.definition.content.options.refId,f=this.engine.findEffectsObjectData(c);if(!f)throw Error("Referenced precomposition with Id: "+c+" does not exist.");this.instantiatePreComposition(f)}if(this.name=n,this.duration=h,this.endBehavior=o,s&&this.transform.fromData(s),this.transform.name=this.name,this.transform.engine=this.engine,t.content||(t.content={options:{}}),h<0)throw Error("Item duration can't be less than 0, see "+nS["Item duration can't be less than 0"]+".");if(t.components)for(var d,p=ij(t.components);!(d=p()).done;){var m=d.value,v=this.engine.findObject(m);this.components.push(v)}for(var y,g,x=ij(null!=(y=t.children)?y:[]);!(g=x()).done;){var b=g.value;this.engine.findObject(b).setParent(this)}this.setVisible(void 0===l||l)},r.toData=function(){if(this.definition.id=this.guid,this.definition.transform=this.transform.toData(),this.definition.dataType=em.VFXItemData,(null==(e=this.parent)?void 0:e.name)!=="sceneRoot"&&(this.definition.parentId=null==(i=this.parent)?void 0:i.guid),!this.definition.components){this.definition.components=[];for(var e,i,r,n=ij(this.components);!(r=n()).done;){var a=r.value;eU(a,t.EffectComponent)&&this.definition.components.push(a)}}this.definition.content={}},r.dispose=function(){if(this.composition){this.composition.destroyItem(this);for(var t,i=ij(this.components.slice());!(t=i()).done;)t.value.dispose();this.components=[],this._composition=null,this.transform.setValid(!1)}this.resetChildrenParent(),e.prototype.dispose.call(this)},r.resetChildrenParent=function(){for(var t,e,i=ij(this.children);!(e=i()).done;){var r=e.value;this.parent&&r.setParent(this.parent)}this.parent&&eq(null==(t=this.parent)?void 0:t.children,this)},r.instantiatePreComposition=function(t,e){void 0===e&&(e=!0),this.name=t.name,this.duration=t.duration,this.endBehavior=t.endBehavior;var i=this.getInstanceId();this.setInstanceId(t.id);for(var r,n=ij(t.components);!(r=n()).done;){var a=r.value,o=this.engine.findObject(a);o.item=this,this.components.push(o)}for(var s,u,h=ij(null!=(s=t.children)?s:[]);!(u=h()).done;){var l=u.value;this.engine.findObject(l).setParent(this)}if(e){for(var c,f=ij(this.components);!(c=f()).done;)c.value.setInstanceId(iP());for(var d,p=ij(this.children);!(d=p()).done;)d.value.refreshGUIDRecursive()}this.setInstanceId(i)},r.refreshGUIDRecursive=function(t){var e=null!=(i=null==t?void 0:t.get(this))?i:iP();this.setInstanceId(e);for(var i,r,n=ij(this.components);!(r=n()).done;){var a,o=r.value,s=null!=(a=null==t?void 0:t.get(o))?a:iP();o.setInstanceId(s)}for(var u,h=ij(this.children);!(u=h()).done;)u.value.refreshGUIDRecursive(t)},r.gatherPreviousObjectID=function(t){t.set(this,this.getInstanceId());for(var e,i=ij(this.components);!(e=i()).done;){var r=e.value;t.set(r,r.getInstanceId())}for(var n,a=ij(this.children);!(n=a()).done;)n.value.gatherPreviousObjectID(t)},r.getDescendantsInternal=function(t,e,i){if(void 0===e&&(e=!1),this.children)for(var r=0;r<this.children.length;r++){var n=this.children[r];(!i||i(n))&&t.push(n),e||n.getDescendantsInternal(t,!1,i)}},i.isComposition=function(t){return t.type===tH.composition},i.isSprite=function(t){return t.type===tH.sprite},i.isParticle=function(t){return t.type===tH.particle},i.isNull=function(t){return t.type===tH.null},i.isTree=function(t){return t.type===tH.tree},i.isCamera=function(t){return t.type===tH.camera},i.isAncestor=function(t,e){for(var i=e.parent;i;){if(i===t)return!0;i=i.parent}return!1},rI(i,[{key:"composition",get:function(){return this._composition},set:function(t){this._composition=t;for(var e,i=ij(this.children);!(e=i()).done;){var r=e.value;r.composition||(r.composition=t)}}},{key:"compositionReusable",get:function(){var t,e;return null!=(e=null==(t=this.composition)?void 0:t.reusable)&&e}},{key:"renderOrder",get:function(){return this.listIndex},set:function(t){this.listIndex=t,this.isManuallySetRenderOrder=!0,this.setRendererComponentOrder(t)}},{key:"isActive",get:function(){return this.active},set:function(t){this.setActive(t)}},{key:"isVisible",get:function(){return this.visible}}]),i}(iQ),t.VFXItem=eG([iZ(em.VFXItemData)],t.VFXItem),t.Item=void 0,(tf=t.Item||(t.Item={})).is=function(t,e){return t.type===e},tf.isComposition=function(t){return t.type===tH.composition},tf.isParticle=function(t){return t.type===tH.particle},tf.isNull=function(t){return t.type===tH.null};var nL=(tp=new Int32Array((td=new Float32Array(1)).buffer),function(t){td[0]=t;var e=tp[0],i=e>>16&32768,r=e>>12&2047,n=e>>23&255;return n<103?i:n>142?(i|=31744,i|=(255==n?0:1)&&8388607&e):n<113?(r|=2048,i|=(r>>114-n)+(r>>113-n&1)):(i|=n-112<<10|r>>1,i+=1&r)}),nF=function(){function t(t){if(Number.isInteger(t))this.data=new Uint16Array(t);else if(t&&"object"==typeof t&&Number.isInteger(t.length))for(var e=this.data=new Uint16Array(t.length),i=0;i<e.length;i++)e[i]=nL(t[i])}return t.prototype.set=function(t,e){for(var i=0;i<t.length;i++)this.data[i+e]=nL(t[i])},t}(),nV=new nh,nN=new nu;function nk(t,e,i,r,n,a,o){var s=r/n,u=r,h=e.speedOverLifetime;h&&(u=h.getIntegrateValue(0,r,n));var l=e.gravityModifier?e.gravityModifier.getIntegrateByTime(0,r):0;t.copyFrom(a),t.addScaledVector(o,u),t.addScaledVector(i,l);var c=e.linearVelOverLifetime||{},f=e.orbitalVelOverLifetime||{};if(f.enabled){var d=new e3;f.center&&d.setFromArray(f.center);var p=t.clone().subtract(d),m=f.asRotation,v=["x","y","z"].map(function(t){var e=f[t];return e?m?e.getValue(s):e.getIntegrateValue(0,r,n):0});nV.setFromArray(v).negate(),nN.setFromEuler(nV);var y=nN.transformPoint(p);t.addVectors(d,y)}if(c.enabled){var g=c.asMovement,x=c.x,b=c.y,T=c.z;if(x){var C=g?x.getValue(s):x.getIntegrateValue(0,r,n);t.x=t.x+C}if(b){var E=g?b.getValue(s):b.getIntegrateValue(0,r,n);t.y=t.y+E}if(T){var _=g?T.getValue(s):T.getIntegrateValue(0,r,n);t.z=t.z+_}}return t}function nD(t){return Array.isArray(t)?[t[0],t[1],t[2]]:[0,0,0]}function nz(t,e){for(var i=0,r=t.length;i<r;i++)t[i]=e;return t}function nB(t,e,i){if(e&&i)for(var r=0,n=e.length;r<n;r++)t[r]=e[r]*i[r];else if(e){if(t!==e)for(var a=0;a<e.length;a++)t[a]=e[a]}else if(i&&t!==i)for(var o=0;o<i.length;o++)t[o]=i[o];return t}var nU=((eS={})[tZ.PARTICLE_ORIGIN_CENTER]=[0,0],eS[tZ.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],eS[tZ.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],eS[tZ.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],eS[tZ.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],eS[tZ.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],eS[tZ.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],eS[tZ.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],eS[tZ.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],eS);function nG(t,e,i){var r=i.position,n=new e3(t,e,0),a=new e3;return i.getInverseViewProjectionMatrix().projectPoint(n,a),a.subtract(r),new nc(r,a)}function nW(t,e,i){var r=t.x,n=t.y,a=t.z,o=new e3(r-e,n+i,a),s=new e3(r-e,n-i,a),u=new e3(r+e,n-i,a),h=new e3(r+e,n+i,a);return[{p0:o,p1:s,p2:u},{p0:o.clone(),p1:u.clone(),p2:h}]}function nj(t,e,i){return void 0===i&&(i=1e-6),Math.abs(t-e)<i}function nX(t,e){void 0===e&&(e=2);var i=Math.pow(10,e);return Math.floor(t*i)/i}function nH(t,e,i,r,n){void 0===r&&(r=null);var a=new e3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o=new e3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);n||(n=3);for(var s=e,u=e*n;s<e+i;s++,u+=n){var h=t[u],l=t[u+1],c=t[u+2];a.x=Math.min(a.x,h),a.y=Math.min(a.y,l),a.z=Math.min(a.z,c),o.x=Math.max(o.x,h),o.y=Math.max(o.y,l),o.z=Math.max(o.z,c)}return r&&(a.x-=a.x*r.x+r.y,a.y-=a.y*r.x+r.y,a.z-=a.z*r.x+r.y,o.x+=o.x*r.x+r.y,o.y+=o.y*r.x+r.y,o.z+=o.z*r.x+r.y),{minimum:a,maximum:o}}var nY={pointIndexCache:{xIndex:0,yIndex:0},getPointInCurve:function(t){t[0];var e=t[1],i=this.getPointIndexInCurve(t,this.pointIndexCache),r=i.xIndex,n=i.yIndex;return new e2(e[r],e[n])},getPointIndexInCurve:function(t,e){var i=t[0],r=t[2],n=i===t$.LINE?0:i===t$.EASE_OUT?0:i===t$.EASE_IN?2:i===t$.EASE?2:i===t$.HOLD&&r===t$.EASE_IN?2:0;return e?(e.xIndex=n,e.yIndex=n+1,e):{xIndex:n,yIndex:n+1}},isLeftSideEase:function(t){var e=t[0];t[1];var i=t[2];return!!(e===t$.HOLD&&this.isKeyframeTypeLeftSideEase(i))||this.isKeyframeTypeLeftSideEase(e)},isRightSideEase:function(t){var e=t[0];t[1];var i=t[2];return!!(e===t$.HOLD&&this.isKeyframeTypeRightSideEase(i))||this.isKeyframeTypeRightSideEase(e)},isKeyframeTypeLeftSideEase:function(t){return[t$.EASE,t$.EASE_IN,t$.AUTO].includes(t)},isKeyframeTypeRightSideEase:function(t){return[t$.EASE,t$.EASE_OUT,t$.AUTO].includes(t)},isHoldInKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===t$.HOLD&&[t$.HOLD,t$.LINE_OUT,t$.EASE_OUT].includes(i)},isHoldOutKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===t$.HOLD&&[t$.HOLD,t$.LINE,t$.EASE_IN].includes(i)}},nZ=function(t,e){this.points=t,this.totalLength=e},nq={},nK={};function nQ(t,e,i){return(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t}function nJ(t,e,i){return 3*(1-3*i+3*e)*t*t+2*(3*i-6*e)*t+3*e}function n$(t,e,i,r){var n=nX(e.x-t.x,3)+"_"+nX(e.y-t.y,3)+"_"+nX(e.z-t.z,3)+"&"+(nX(i.x-t.x,3)+"_"+nX(i.y-t.y,3))+"_"+nX(i.z-t.z,3)+"&"+(nX(r.x-t.x,3)+"_"+nX(r.y-t.y,3))+"_"+nX(r.z-t.z,3);if(nK[n])return{data:nK[n],interval:t};for(var a=[],o=null,s=0,u=0,h=0;h<300;h+=1){var l=new e3,c=h/299;u=0,l.x=3*Math.pow(1-c,2)*c*(i.x-t.x)+3*(1-c)*Math.pow(c,2)*(r.x-t.x)+Math.pow(c,3)*(e.x-t.x),l.y=3*Math.pow(1-c,2)*c*(i.y-t.y)+3*(1-c)*Math.pow(c,2)*(r.y-t.y)+Math.pow(c,3)*(e.y-t.y),l.z=3*Math.pow(1-c,2)*c*(i.z-t.z)+3*(1-c)*Math.pow(c,2)*(r.z-t.z)+Math.pow(c,3)*(e.z-t.z),null!==o&&(u+=Math.pow(l.x-o.x,2)+Math.pow(l.y-o.y,2)+Math.pow(l.z-o.z,2)),o=l,s+=u=Math.sqrt(u),a[h]={partialLength:u,point:l}}var f=new nZ(a,s);return nK[n]=f,{data:f,interval:new e3(t.x,t.y,t.z)}}var n0=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.catching={lastPoint:0,lastAddedLength:0};var n=n$(t,e,i,r),a=n.data,o=n.interval;this.lengthData=a,this.interval=o,this.totalLength=a.totalLength}return t.prototype.getPointInPercent=function(t){var e=this.lengthData;if(0===t)return e.points[0].point.clone().add(this.interval);if(nj(1-t,0))return e.points[299].point.clone().add(this.interval);if(nj(e.totalLength,0))return this.p1.clone();var i=new e3,r=nX(e.totalLength*t,4),n=this.catching.lastAddedLength,a=this.catching.lastPoint;if(nj(n,r))return e.points[a].point.clone().add(this.interval);var o=!0,s=1;for(r<n&&(s=-1);o;){if(r>=n){if(299===a){i.x=e.points[a].point.x,i.y=e.points[a].point.y,i.z=e.points[a].point.z;break}if(r<n+e.points[a+1].partialLength){var u=(r-n)/e.points[a+1].partialLength;i.x=e.points[a].point.x+(e.points[a+1].point.x-e.points[a].point.x)*u,i.y=e.points[a].point.y+(e.points[a+1].point.y-e.points[a].point.y)*u,i.z=e.points[a].point.z+(e.points[a+1].point.z-e.points[a].point.z)*u;break}}s>0&&a<299?(a+=s,n+=nX(e.points[a].partialLength,5)):s<0&&a>0?(n-=nX(e.points[a].partialLength,5),a+=s):o=!1}return this.catching.lastPoint=a,this.catching.lastAddedLength=n,i.add(this.interval),i},t}(),n1=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.temp=new ri,this.totalLength=0}return t.prototype.getPointInPercent=function(t){return 0===t?this.temp.copyFrom(this.p1):nj(1-t,0)?this.temp.copyFrom(this.p2):(n5.slerpFlat(this.temp,this.p1,this.p2,t),this.temp)},t}(),n2=function(){function t(t,e,i,r){this.precomputed=!1,this.control1=new e2,this.control2=new e2,this.weighted=!1,this.isConstant=!1,this.mSampleValues=Array(11),void 0!==t&&void 0!==e&&void 0!==i&&void 0!==r?(this.control1.x=t,this.control1.y=e,this.control2.x=i,this.control2.y=r,this.weighted=!0):void 0!==t&&void 0!==e?(this.control1.x=1/3,this.control1.y=t,this.control2.x=2/3,this.control2.y=e):this.isConstant=!0}var e=t.prototype;return e.getValue=function(t){return this.isConstant?0:this.control1.x===this.control1.y&&this.control2.x===this.control2.y||0===t||1===t?t:this.weighted?(this.precomputed||this.precompute(),nQ(this.getTForX(t),this.control1.y,this.control2.y)):this.bezierInterpolate(0,this.control1.y,this.control2.y,1,t)},e.bezierInterpolate=function(t,e,i,r,n){var a=1-n,o=a*a,s=n*n;return o*a*t+e*o*n*3+i*a*s*3+s*n*r},e.calcSampleValues=function(){for(var t=0;t<11;++t)this.mSampleValues[t]=nQ(.1*t,this.control1.x,this.control2.x)},e.getTForX=function(t){for(var e=this.mSampleValues,i=0,r=1;10!==r&&e[r]<=t;++r)i+=.1;var n=i+(t-e[--r])/(e[r+1]-e[r])*.1,a=nJ(n,this.control1.x,this.control2.x);return a>=.001?function(t,e,i,r){for(var n=0;n<4;++n){var a=nJ(e,i,r);if(0===a)break;var o=nQ(e,i,r)-t;e-=o/a}return e}(t,n,this.control1.x,this.control2.x):0===a?n:function(t,e,i,r,n){var a,o,s=0;do(a=nQ(o=e+(i-e)/2,r,n)-t)>0?i=o:e=o;while(Math.abs(a)>1e-7&&++s<10);return o}(t,i,i+.1,this.control1.x,this.control2.x)},e.precompute=function(){this.precomputed=!0,(this.control1.x!==this.control1.y||this.control2.x!==this.control2.y)&&this.calcSampleValues()},t}();function n3(t,e){var i,r,n,a=n4(t,e,!0),o=a.p0,s=a.p1,u=a.p2,h=a.p3;im(u),im(h);var l=h.x-o.x,c=h.y-o.y,f=nX((s.x-o.x)/l,5),d=nX((u.x-o.x)/l,5);nj(c,0)?i=r=NaN:(i=nX((s.y-o.y)/c,5),r=nX((u.y-o.y)/c,5)),f<0&&(f=0),d<0&&(d=0),f>1&&(f=1),d>1&&(d=1);var p=("bez_"+f+"_"+i+"_"+d+"_"+r).replace(/\./g,"p");return nq[p]?n=nq[p]:(n=nj(c,0)?new n2:new n2(f,i,d,r),nq[p]=n),{points:[o,s,u,h],timeInterval:l,valueInterval:c,curve:n}}function n4(t,e,i){var r=t[1],n=nY.isHoldOutKeyframe(t),a=nY.isHoldInKeyframe(e),o=!a&&nY.isRightSideEase(t),s=!n&&nY.isLeftSideEase(e);if(o&&!s&&!a){var u=new e2(r[r.length-4],r[r.length-3]),h=new e2(r[r.length-2],r[r.length-1]),l=nY.getPointInCurve(e),c=new e2(l.x,l.y),f=new e2(c.x-(c.x-u.x)/10,c.y);return{type:"ease",p0:u,p1:h,p2:f,p3:c}}if(!o&&s&&!n){var d=e[1],p=nY.getPointInCurve(t),m=new e2(p.x,p.y),v=new e2(d[0],d[1]),y=new e2(d[2],d[3]),g=new e2(m.x+(y.x-m.x)/10,m.y);return{type:"ease",p0:m,p1:g,p2:v,p3:y}}if(o&&s){var x=e[1];return{type:"ease",p0:new e2(r[r.length-4],r[r.length-3]),p1:new e2(r[r.length-2],r[r.length-1]),p2:new e2(x[0],x[1]),p3:new e2(x[2],x[3])}}var b=nY.getPointInCurve(t),T=nY.getPointInCurve(e);if(n?T.y=b.y:a&&(b.y=T.y),!i)return{type:"line",p0:b,p1:T,isHold:n||a,leftHoldLine:n,rightHoldLine:a};var C=new e2((T.x-b.x)/3+b.x,(T.y-b.y)/3+b.y),E=new e2((T.x-b.x)/3*2+b.x,(T.y-b.y)/3*2+b.y);return{type:"line",p0:b,p1:C,p2:E,p3:T,isHold:n||a,leftHoldLine:n,rightHoldLine:a}}var n5=function(){function t(){}return t.slerpFlat=function(t,e,i,r){var n=e.x,a=e.y,o=e.z,s=e.w,u=i.x,h=i.y,l=i.z,c=i.w;if(0===r){t.x=n,t.y=a,t.z=o,t.w=s;return}if(1===r){t.x=u,t.y=h,t.z=l,t.w=c;return}if(s!==c||n!==u||a!==h||o!==l){var f=1-r,d=n*u+a*h+o*l+s*c,p=d>=0?1:-1,m=1-d*d;if(m>Number.EPSILON){var v=Math.sqrt(m),y=Math.atan2(v,d*p);f=Math.sin(f*y)/v,r=Math.sin(r*y)/v}var g=r*p;if(n=n*f+u*g,a=a*f+h*g,o=o*f+l*g,s=s*f+c*g,f===1-r){var x=1/Math.sqrt(n*n+a*a+o*o+s*s);n*=x,a*=x,o*=x,s*=x}}t.x=n,t.y=a,t.z=o,t.w=s},t}(),n6="not_implement",n8=function(){function t(t){this.onCreate(t)}var e=t.prototype;return e.onCreate=function(t){throw Error(n6)},e.getIntegrateValue=function(t,e,i){throw Error(n6)},e.getIntegrateByTime=function(t,e){throw Error(n6)},e.getValue=function(t){throw Error(n6)},e.getMaxTime=function(){throw Error(n6)},e.toUniform=function(t){throw Error(n6)},e.map=function(t){throw Error(n6)},e.scaleXCoord=function(t){return this},e.toData=function(){throw Error(n6)},t.getAllData=function(t,e){for(var i=new(e?nF:Float32Array)(4*t.index),r=0,n=0,a=t.curves;r<a.length;r++){var o=a[r].toData();i.set(o,n),n+=o.length}return e?i.data:i},t}(),n9=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.value=t},i.getIntegrateValue=function(t,e,i){return this.value*(e-t)},i.getIntegrateByTime=function(t,e){return .5*this.value*(e*e-t*t)},i.getValue=function(t){return this.value},i.toUniform=function(){return new Float32Array([0,this.value,0,0])},i.map=function(t){var e=this.value;return this.value=t(e),this},i.getMaxTime=function(){return 0},e}(n8),n7=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.items=t},i.getValue=function(t){var e=this.items;return e[Math.floor(Math.random()*e.length)]},i.map=function(t){return this.items=this.items.map(t),this},e}(n8),at=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t,e){return this.min+(null!=e?e:Math.random())*(this.max-this.min)},i.getIntegrateValue=function(t,e,i){return(this.min+(null!=i?i:1)*(this.max-this.min))*(e-t)},i.toUniform=function(){return new Float32Array([4,this.min,this.max,0])},i.map=function(t){return this.min=t(this.min),this.max=t(this.max),this},e}(n8),ae=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t){for(var e=this.min,i=this.max,r=[],n=0;n<e.length;n++){var a=Math.random();r[n]=e[n]*(1-a)+i[n]*a}return r},i.map=function(t){return this.min=this.min.map(t),this.max=this.max.map(t),this},e}(n8),ai=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1],this.xCoord=1},i.getValue=function(t){return t/=this.xCoord,this.min*(1-t)+this.max*t},i.toUniform=function(){return new Float32Array([1,this.min,this.max,this.xCoord])},i.getIntegrateValue=function(t,e,i){void 0===i&&(i=1);var r=this.min,n=this.max,a=this.xCoord*i;return((r+e/a*(n-r)+r)*e-(r+t/a*(n-r)+r)*t)/2},i.getIntegrateByTime=function(t,e){return ah(e,0,this.xCoord,this.min,this.max)-ah(t,0,this.xCoord,this.min,this.max)},i.map=function(t){return this.min=t(this.min),this.max=t(this.max),this},i.scaleXCoord=function(t){return this.xCoord=t,this},e}(n8),ar=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.stops=e9(t)},i.getStops=function(){return this.stops},i.getValue=function(t){var e=this.stops;if(0===e.length)return[0,0,0,0];if(t<=e[0].time)return e[0].color.toArray();var i=e.length-1;if(t>=e[i].time)return e[i].color.toArray();for(var r=0;r<i;r++){var n=e[r],a=e[r+1];if(n.time<=t&&a.time>t){var o=(t-n.time)/(a.time-n.time);return e7(n.color.toArray(),a.color.toArray(),o,!0)}}return e[i].color.toArray()},e}(n8),an=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.keys=t.map(function(t){return t.slice?t.slice(0,2):[t.time,t.value]}).sort(function(t,e){return t[0]-e[0]});var e=this.keys[this.keys.length-1];e[0]<1&&this.keys.push([1,e[1]]);var i=this.keys[0];i[0]>0&&this.keys.unshift([0,i[1]]),this.isLineSeg=!0},i.getValue=function(t){var e=this.keys;if(t<e[0][0])return e[0][1];for(var i=e.length-1,r=0;r<i;r++){var n=e[r],a=e[r+1],o=n[0],s=a[0];if(t>=o&&t<=s){var u=(t-o)/(s-o),h=n[1];return h+u*(a[1]-h)}}return e[i][1]},i.getIntegrateValue=function(t,e,i){return void 0===i&&(i=1),(this.integrate(e,!1)-this.integrate(t,!1))*i},i.getIntegrateByTime=function(t,e){return this.integrate(e,!0)-this.integrate(t,!0)},i.integrate=function(t,e){var i=this.keys;if(t<=i[0][0])return 0;for(var r=0,n=i.length-1,a=e?ah:au,o=0;o<n;o++){var s=i[o],u=i[o+1],h=s[0],l=u[0];if(t>h&&t<=l)return r+a(t,h,l,s[1],u[1]);r+=a(l,h,l,s[1],u[1])}return r},i.toData=function(){for(var t=this.keys,e=new Float32Array(4*Math.ceil(t.length/2)),i=0,r=0;i<t.length;i++,r+=2)e.set(t[i],r);return e.set(t[t.length-1],e.length-2),e},i.toUniform=function(t){var e=t.index,i=Math.ceil(this.keys.length/2);return t.lineSegCount+=i,t.curves.push(this),t.index+=i,t.max=Math.max(t.max,i),new Float32Array([3,e,i,0])},i.map=function(t){return this.keys.forEach(function(e){return e[1]=t(e[1])}),this},i.scaleXCoord=function(t){return this.keys.forEach(function(e){return e[0]=t*e[0]}),this},e}(n8),aa=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.keys=t[0],this.values=t[1]},i.getValue=function(t){for(var e=this.keys,i=this.values,r=0;r<e.length-1;r++){var n=e[r],a=e[r+1];if(n[0]<=t&&a[0]>=t){var o=a[1]-n[1],s=void 0;return s=0===o?(t-n[0])/(a[0]-n[0]):(function(t,e,i){var r=i[0]-e[0],n=e[3]*r,a=i[2]*r,o=(t-e[0])/r,s=o*o,u=s*o;return(2*u-3*s+1)*e[1]+(u-2*s+o)*n+(u-s)*a+(-2*u+3*s)*i[1]}(t,n,a)-n[1])/o,this.calculateVec(r,s)}}return t<=e[0][0]?i[0].slice():i[i.length-1].slice()},i.calculateVec=function(t,e){for(var i=this.values[t],r=this.values[t+1],n=[0,0,0],a=0;a<i.length;a++)n[a]=i[a]*(1-e)+r[a]*e;return n},e}(n8),ao=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){var e=t[0],i=t[1],r=t[2];if(this.curveSegments={},r.length){for(var n=0;n<e.length-1;n++){var a=e[n],o=e[n+1],s=new e3(i[n][0],i[n][1],i[n][2]),u=new e3(i[n+1][0],i[n+1][1],i[n+1][2]),h=new e3(r[2*n][0],r[2*n][1],r[2*n][2]),l=new e3(r[2*n+1][0],r[2*n+1][1],r[2*n+1][2]),c=n3(a,o),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new n0(s,u,h,l);this.curveSegments[v.x+"&"+y.x]={points:f,timeInterval:p,valueInterval:m,easingCurve:d,pathCurve:g,timeStart:Number(v.x),timeEnd:Number(y.x)}}this.keyTimeData=Object.keys(this.curveSegments)}},i.getValue=function(t){var e=nX(t,5),i=0,r=new e3,n=this.keyTimeData;if(!n.length)return r;var a=this.curveSegments[n[0]].timeStart,o=this.curveSegments[n[n.length-1]].timeEnd;if(e<=a)return this.curveSegments[n[0]].pathCurve.getPointInPercent(0);if(e>=o)return this.curveSegments[n[n.length-1]].pathCurve.getPointInPercent(1);for(var s=0;s<n.length;s++){var u=this.curveSegments[n[s]].timeStart,h=this.curveSegments[n[s]].timeEnd;if(e>=Number(u)&&e<Number(h)){var l=this.curveSegments[n[s]].pathCurve;i=this.getPercValue(n[s],e),r=l.getPointInPercent(i)}}return r},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,a=nX((e-r.x)/n,4);return e1(i.easingCurve.getValue(a),0,1)},i.getMaxTime=function(){var t=this.keyTimeData;return this.curveSegments[t[t.length-1]].timeEnd},e}(n8),as=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){var e=t[0],i=t[1],r=t[2];if(this.curveSegments={},r.length)for(var n=0;n<e.length-1;n++){var a=e[n],o=e[n+1],s=ri.fromArray(i[n]),u=ri.fromArray(i[n+1]),h=ri.fromArray(r[2*n]),l=ri.fromArray(r[2*n+1]),c=n3(a,o),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new n1(s,u,h,l);this.curveSegments[v.x+"&"+y.x]={points:f,timeInterval:p,valueInterval:m,easingCurve:d,pathCurve:g}}},i.getValue=function(t){var e=0,i=nX(t,5),r=Object.keys(this.curveSegments),n=Number(r[0].split("&")[0]),a=Number(r[r.length-1].split("&")[1]);if(i<=n)return this.curveSegments[r[0]].pathCurve.getPointInPercent(0);if(i>=a)return this.curveSegments[r[r.length-1]].pathCurve.getPointInPercent(1);for(var o=0;o<r.length;o++){var s=r[o].split("&"),u=s[0],h=s[1];if(i>=Number(u)&&i<Number(h)){var l=this.curveSegments[r[o]].pathCurve;return e=this.getPercValue(r[o],i),l.getPointInPercent(e)}}return this.curveSegments[r[0]].pathCurve.getPointInPercent(0)},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,a=nX((e-r.x)/n,4);return e1(i.easingCurve.getValue(a),0,1)},i.getMaxTime=function(){var t=Object.keys(this.curveSegments);return Number(t[t.length-1].split("&")[1])},e}(n8);function au(t,e,i,r,n){var a=t-e;return(r+r+(n-r)*a/(i-e))*a/2}function ah(t,e,i,r,n){var a=t*t,o=e*e;return(a*t*2*(r-n)+3*a*(e*n-i*r)-o*e*(2*r+n)+3*o*i*r)/(6*(e-i))}function al(t,e){if(e){var i=e[0],r=e[1];if(i===tJ.CURVE){t.curves.push(r);var n=r.length;r[0][0]>0&&n++,r[r.length-1][0]<1&&n++,t.index+=n,t.max=Math.max(t.max,n),t.curveCount+=n}else if(i===tJ.LINE){var a=r.length;if(2===a&&0===r[0][0]&&1===r[1][0])return;r[0][0]>0&&a++,r[r.length-1][0]<1&&a++;var o=Math.ceil(a/2);t.lineSegCount+=o,t.curves.push(r),t.index+=o,t.max=Math.max(t.max,o)}else if(i===tJ.BEZIER_CURVE){var s=r.length-1;t.index+=2*s,t.curves.push(r),t.max=Math.max(t.max,2*s),t.curveCount+=2*s}}}function ac(){return{curves:[],index:0,max:0,lineSegCount:0,curveCount:0}}function af(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(af=function(){return!!t})()}function ad(t,e,i){return(ad=af()?Reflect.construct:function(t,e,i){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return i&&iz(n,i.prototype),n}).apply(null,arguments)}var ap=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e4,e}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aT(t[0]),this.yCurve=aT(t[1]),this.zCurve=aT(t[2]),this.wCurve=aT(t[3])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t),r=this.zCurve.getValue(t),n=this.wCurve.getValue(t);return this.value.set(e,i,r,n),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime(),this.zCurve.getMaxTime(),this.wCurve.getMaxTime())},e}(n8),am=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e3,e}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aT(t[0]),this.yCurve=aT(t[1]),this.zCurve=aT(t[2])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t),r=this.zCurve.getValue(t);return this.value.set(e,i,r),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime(),this.zCurve.getMaxTime())},e}(n8),av=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e2,e}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aT(t[0]),this.yCurve=aT(t[1])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t);return this.value.set(e,i),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime())},e}(n8);t.TangentMode=void 0,(tm=t.TangentMode||(t.TangentMode={}))[tm.Cubic=0]="Cubic",tm[tm.Linear=1]="Linear",tm[tm.Constant=2]="Constant",t.WeightedMode=void 0,(tv=t.WeightedMode||(t.WeightedMode={}))[tv.None=0]="None",tv[tv.In=1]="In",tv[tv.Out=2]="Out",tv[tv.Both=3]="Both";var ay=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.keyFrames=ag(t);var e=this.keyFrames;this.curveMap={},this.keys=[],this.curveInfos=[];for(var i=0;i<e.length-1;i++){var r=function(t,e){var i,r,n,a=new e2(t.time,t.value),o=new e2,s=new e2,u=new e2,h=2===t.weightedMode||3===t.weightedMode||1===e.weightedMode||3===e.weightedMode,l=2===t.tangentMode,c=(h?t.outWeight:1)*(e.time-t.time)/3;o.x=t.time+c,o.y=t.value+c*(l?0:t.outSlope);var f=(h?e.inWeight:1)*(e.time-t.time)/3;s.x=e.time-f,s.y=e.value-f*(l?0:e.inSlope),u.x=e.time,u.y=l?t.value:e.value,im(s),im(u);var d=u.x-a.x,p=u.y-a.y,m=nX((o.x-a.x)/d,5),v=nX((s.x-a.x)/d,5);nj(p,0)?i=r=NaN:(i=nX((o.y-a.y)/p,5),r=nX((s.y-a.y)/p,5)),m<0&&(m=0),v<0&&(v=0),m>1&&(m=1),v>1&&(v=1);var y=("bez_"+m+"_"+i+"_"+v+"_"+r).replace(/\./g,"p");return nq[y]?n=nq[y]:(n=nj(p,0)?new n2:h?new n2(m,i,v,r):new n2(i,r),nq[y]=n),{points:[a,o,s,u],timeInterval:d,valueInterval:p,curve:n}}(e[i],e[i+1]),n=r.points,a=r.curve,o=r.timeInterval,s=r.valueInterval,u=n[0],h=n[n.length-1];this.keys.push([].concat(u.toArray(),n[1].toArray())),this.keys.push([].concat(h.toArray(),n[2].toArray()));var l={points:n,timeInterval:o,valueInterval:s,curve:a,timeStart:Number(u.x),timeEnd:Number(h.x)};this.curveMap[u.x+"&"+h.x]=l,this.curveInfos.push(l)}},i.getValue=function(t){var e=0,i=this.keyFrames.length;if(t<=this.keyFrames[0].time)e=this.keyFrames[0].value;else if(t<this.keyFrames[i-1].time)for(var r=0;r<this.keyFrames.length-1;r++){var n=this.keyFrames[r].time,a=this.keyFrames[r+1].time;if(t>=n&&t<a){var o=this.curveInfos[r],s=o.points[0],u=o.timeInterval,h=o.valueInterval,l=(t-s.x)/u,c=0;c=1===this.keyFrames[r].tangentMode?l:o.curve.getValue(l),e=s.y+h*c;break}}else t>=this.keyFrames[i-1].time&&(e=this.keyFrames[i-1].value);return e},i.getIntegrateValue=function(t,e,i){void 0===i&&(i=1);var r=(e-t)/i,n=0,a=Object.keys(this.curveMap);if(r<=this.curveMap[a[0]].timeStart)return 0;for(var o=0;o<a.length;o++){var s=this.curveMap[a[o]].timeStart,u=this.curveMap[a[o]].timeEnd;if(r>=Number(u)&&(n+=i*this.getCurveIntegrateValue(a[o],Number(u))),r>=Number(s)&&r<Number(u)){n+=i*this.getCurveIntegrateValue(a[o],r);break}}return n},i.getIntegrateByTime=function(t,e){return this.getIntegrateValue(0,e)-this.getIntegrateValue(0,t)},i.getCurveIntegrateValue=function(t,e){for(var i=this.curveMap[t],r=i.points[0],n=i.timeInterval,a=i.valueInterval,o=0,s=(e-r.x)/20,u=0;u<=20;u++){var h=u*s/n,l=r.y+a*i.curve.getValue(h);0===u||20===u?o+=l:u%2==1?o+=4*l:o+=2*l}return s/3*o},i.toUniform=function(t){var e=t.index,i=this.keys.length;return t.curves.push(this),t.index=e+i,t.max=Math.max(t.max,i),t.curveCount+=i,new Float32Array([5,e+1/i,e,i])},i.toData=function(){for(var t=this.keys,e=new Float32Array(4*t.length),i=0,r=0;i<t.length;i++,r+=4)e.set(t[i],r);return e},i.getMaxTime=function(){return this.keyFrames[this.keyFrames.length-1].time},e}(n8);function ag(t){for(var e=[],i=[],r={x:0,y:0},n=0;n<t.length;n++){var a=t[n],o=n4(a,n+1<t.length?t[n+1]:t[n],!0),s=o.p0,u=o.p1,h=o.p2,l=o.p3,c=o.type;im(h),im(l);var f={leftControl:r,value:s,rightControl:u,tangentMode:"line"===c?1:0};a[0]===t$.HOLD&&(f.tangentMode=2),i.push(f),r=h}for(var d=function(t,e){return(e.y-t.y)/(e.x-t.x+1e-6)},p=0;p<i.length;p++){var m=i[p].leftControl,v=i[p].value,y=i[p].rightControl,g=0,x=0;p>0&&(g=d(m,v)),p<i.length-1&&(x=d(v,y));var b={time:v.x,value:v.y,inSlope:g,outSlope:x,inWeight:0,outWeight:0,tangentMode:i[p].tangentMode,weightedMode:3};e.push(b),p>0&&(b.inWeight=(v.x-m.x)/((v.x-i[p-1].value.x)/3)),p+1<i.length&&(b.outWeight=(y.x-v.x)/((i[p+1].value.x-v.x)/3))}return e}var ax=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.keyframes=t},i.getValue=function(t){var e=this.keyframes;if(0!==e.length){for(var i=e[0][1],r=0;r<e.length;r++)if(e[r][0]<=(null!=t?t:0))i=e[r][1];else break;return i}},e}(n8),ab=((eM={})[tJ.RANDOM]=function(t){return eU(t[0],Array)?new ae(t):new at(t)},eM[tJ.CONSTANT]=function(t){return new n9(t)},eM[tJ.CONSTANT_VEC2]=function(t){return new n9(t)},eM[tJ.CONSTANT_VEC3]=function(t){return new n9(t)},eM[tJ.CONSTANT_VEC4]=function(t){return new n9(t)},eM[tJ.RGBA_COLOR]=function(t){return new n9(t)},eM[tJ.COLORS]=function(t){return new n7(t.map(function(t){return e6(t,!1)}))},eM[tJ.LINE]=function(t){return 2===t.length&&0===t[0][0]&&1===t[1][0]?new ai([t[0][1],t[1][1]]):new an(t)},eM[tJ.GRADIENT_COLOR]=function(t){return new ar(t)},eM[tJ.LINEAR_PATH]=function(t){return new aa(t)},eM[tJ.BEZIER_CURVE]=function(t){return 1===t.length?new n9(t[0][1][1]):new ay(t)},eM[tJ.BEZIER_CURVE_PATH]=function(t){return 1===t[0].length?new n9(ad(e3,[].concat(t[1][0]))):new ao(t)},eM[tJ.BEZIER_CURVE_QUAT]=function(t){return 1===t[0].length?new n9(ad(ri,[].concat(t[1][0]))):new as(t)},eM[tJ.COLOR_CURVE]=function(t){return new aC(t)},eM[tJ.VECTOR4_CURVE]=function(t){return new ap(t)},eM[tJ.VECTOR2_CURVE]=function(t){return new av(t)},eM[27]=function(t){return new am(t)},eM[28]=function(t){return new ax(t)},eM);function aT(t){if(!t||!isNaN(+t))return new n9(t||0);if(eU(t,n8))return t;if(iE(ab[t[0]]))return ab[t[0]](t[1]);throw Error("ValueType: "+t[0]+" is not supported, see "+nS["ValueType: 21/22 is not supported"]+".")}var aC=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e5,e}iB(e,t);var i=e.prototype;return i.onCreate=function(t){this.rCurve=aT(t[0]),this.gCurve=aT(t[1]),this.bCurve=aT(t[2]),this.aCurve=aT(t[3])},i.getValue=function(t){var e=this.rCurve.getValue(t),i=this.gCurve.getValue(t),r=this.bCurve.getValue(t),n=this.aCurve.getValue(t);return this.value.set(e,i,r,n),this.value},i.getMaxTime=function(){return Math.max(this.rCurve.getMaxTime(),this.gCurve.getMaxTime(),this.bCurve.getMaxTime(),this.aCurve.getMaxTime())},e}(n8),aE=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){return this.set(t.x,t.y),this},e.copyTo=function(t){return t.set(this.x,this.y),t},e.equals=function(t){return t.x===this.x&&t.y===this.y},e.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},rI(t,null,[{key:"shared",get:function(){return a_.x=0,a_.y=0,a_}}]),t}(),a_=new aE;function aw(t,e,i,r,n,a,o,s){o?(u=r,h=-i):(u=-r,h=i);var u,h,l=t-i*n+u,c=e-r*n+h,f=t+i*a+u,d=e+r*a+h;return s.push(l,c),s.push(f,d),2}function aS(t,e,i,r,n,a,o,s){var u=i-t,h=r-e,l=Math.atan2(u,h),c=Math.atan2(n-t,a-e);s&&l<c?l+=2*Math.PI:!s&&l>c&&(c+=2*Math.PI);var f=l,d=c-l,p=Math.sqrt(u*u+h*h),m=(15*Math.abs(d)*Math.sqrt(p)/Math.PI>>0)+1,v=d/m;if(f+=v,s){o.push(t,e),o.push(i,r);for(var y=1,g=f;y<m;y++,g+=v)o.push(t,e),o.push(t+Math.sin(g)*p,e+Math.cos(g)*p);o.push(t,e),o.push(n,a)}else{o.push(i,r),o.push(t,e);for(var x=1,b=f;x<m;x++,b+=v)o.push(t+Math.sin(b)*p,e+Math.cos(b)*p),o.push(t,e);o.push(n,a),o.push(t,e)}return 2*m}function aM(t,e,i,r,n,a,o,s,u){if(0!==t.length){var h=e.alignment;if(.5!==e.alignment){var l=function(t){var e=t.length;if(e<6)return 1;for(var i=0,r=0,n=t[e-2],a=t[e-1];r<e;r+=2){var o=t[r],s=t[r+1];i+=(o-n)*(s+a),n=o,a=s}return i<0?-1:1}(t);i&&(l*=-1),h=(h-.5)*l+.5}var c=new aE(t[0],t[1]),f=new aE(t[t.length-2],t[t.length-1]),d=1e-4>Math.abs(c.x-f.x)&&1e-4>Math.abs(c.y-f.y);if(r){t=t.slice(),d&&(t.pop(),t.pop(),f.set(t[t.length-2],t[t.length-1]));var p=(c.x+f.x)*.5,m=(f.y+c.y)*.5;t.unshift(p,m),t.push(p,m)}var v=t.length/2,y=t.length,g=n.length/2,x=e.width/2,b=x*x,T=e.miterLimit*e.miterLimit,C=t[0],E=t[1],_=t[2],w=t[3],S=0,M=0,A=-(E-w),P=C-_,R=0,I=0,O=Math.sqrt(A*A+P*P)+1e-6;A/=O,P/=O,A*=x,P*=x;var L=h,F=(1-L)*2,V=2*L;r||(e.cap===eh.Round?y+=aS(C-A*(F-V)*.5,E-P*(F-V)*.5,C-A*F,E-P*F,C+A*V,E+P*V,n,!0)+2:e.cap===eh.Square&&(y+=aw(C,E,A,P,F,V,!0,n))),n.push(C-A*F,E-P*F),n.push(C+A*V,E+P*V);for(var N=1;N<v-1;++N){C=t[(N-1)*2],E=t[(N-1)*2+1],_=t[2*N],w=t[2*N+1],S=t[(N+1)*2],M=t[(N+1)*2+1],O=Math.sqrt((A=-(E-w))*A+(P=C-_)*P)+1e-6,A/=O,P/=O,A*=x,P*=x,O=Math.sqrt((R=-(w-M))*R+(I=_-S)*I)+1e-6,R/=O,I/=O,R*=x,I*=x;var k=_-C,D=E-w,z=_-S,B=M-w,U=k*z+D*B,G=D*z-B*k,W=G<0;if(Math.abs(G)<.001*Math.abs(U)){n.push(_-A*F,w-P*F),n.push(_+A*V,w+P*V),U>=0&&(e.join===el.Round?y+=aS(_,w,_-A*F,w-P*F,_-R*F,w-I*F,n,!1)+4:y+=2,n.push(_-R*V,w-I*V),n.push(_+R*F,w+I*F));continue}var j=(-A+C)*(-P+w)-(-A+_)*(-P+E),X=(-R+S)*(-I+w)-(-R+_)*(-I+M),H=(k*X-z*j)/G,Y=(B*j-D*X)/G,Z=(H-_)*(H-_)+(Y-w)*(Y-w),q=_+(H-_)*F,K=w+(Y-w)*F,Q=_-(H-_)*V,J=w-(Y-w)*V,$=W?F:V;Z<=Math.min(k*k+D*D,z*z+B*B)+$*$*b?e.join===el.Bevel||Z/b>T?(W?(n.push(q,K),n.push(_+A*V,w+P*V),n.push(q,K),n.push(_+R*V,w+I*V)):(n.push(_-A*F,w-P*F),n.push(Q,J),n.push(_-R*F,w-I*F),n.push(Q,J)),y+=2):e.join===el.Round?W?(n.push(q,K),n.push(_+A*V,w+P*V),y+=aS(_,w,_+A*V,w+P*V,_+R*V,w+I*V,n,!0)+4,n.push(q,K),n.push(_+R*V,w+I*V)):(n.push(_-A*F,w-P*F),n.push(Q,J),y+=aS(_,w,_-A*F,w-P*F,_-R*F,w-I*F,n,!1)+4,n.push(_-R*F,w-I*F),n.push(Q,J)):(n.push(q,K),n.push(Q,J)):(n.push(_-A*F,w-P*F),n.push(_+A*V,w+P*V),e.join===el.Round?W?y+=aS(_,w,_+A*V,w+P*V,_+R*V,w+I*V,n,!0)+2:y+=aS(_,w,_-A*F,w-P*F,_-R*F,w-I*F,n,!1)+2:e.join===el.Miter&&Z/b<=T&&(W?(n.push(Q,J),n.push(Q,J)):(n.push(q,K),n.push(q,K)),y+=2),n.push(_-R*F,w-I*F),n.push(_+R*V,w+I*V),y+=2)}C=t[(v-2)*2],E=t[(v-2)*2+1],_=t[(v-1)*2],O=Math.sqrt((A=-(E-(w=t[(v-1)*2+1])))*A+(P=C-_)*P)+1e-6,A/=O,P/=O,A*=x,P*=x,n.push(_-A*F,w-P*F),n.push(_+A*V,w+P*V),r||(e.cap===eh.Round?y+=aS(_-A*(F-V)*.5,w-P*(F-V)*.5,_-A*F,w-P*F,_+A*V,w+P*V,n,!1)+2:e.cap===eh.Square&&(y+=aw(_,w,A,P,F,V,!1,n)));for(var tt=g;tt<y+g-2;++tt)C=n[2*tt],E=n[2*tt+1],_=n[(tt+1)*2],w=n[(tt+1)*2+1],S=n[(tt+2)*2],1e-8>Math.abs(C*(w-(M=n[(tt+2)*2+1]))+_*(M-E)+S*(E-w))||s.push(tt,tt+1,tt+2)}}var aA=function(){},aP=function(t){function e(e,i,r,n){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),(a=t.call(this)||this).type="ellipse",a.x=e,a.y=i,a.halfWidth=r,a.halfHeight=n,a}iB(e,t);var i=e.prototype;return i.clone=function(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)},i.contains=function(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;var i=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1},i.strokeContains=function(t,e,i){var r=this.halfWidth,n=this.halfHeight;if(r<=0||n<=0)return!1;var a=i/2,o=r-a,s=n-a,u=r+a,h=n+a,l=t-this.x,c=e-this.y;return l*l/(o*o)+c*c/(s*s)>1&&l*l/(u*u)+c*c/(h*h)<=1},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getX=function(){return this.x},i.getY=function(){return this.y},i.build=function(t,e){var i=this.x,r=this.y,n=this.halfWidth,a=this.halfHeight;if(!(n>=0&&a>=0))return t;var o=Math.ceil(Math.sqrt((null!=e?e:1)*(n+a))),s=8*o+0+0;if(0===s)return t;if(0===o)return t[0]=t[6]=i+0,t[1]=t[3]=r+0,t[2]=t[4]=i-0,t[5]=t[7]=r-0,t;var u=0,h=4*o+0+2,l=h,c=s,f=0+n,d=0,p=i+f,m=i-f,v=r+0;t[u++]=p,t[u++]=v,t[--h]=v,t[--h]=m;for(var y=1;y<o;y++){var g=Math.PI/2*(y/o),x=0+Math.cos(g)*n,b=0+Math.sin(g)*a,T=i+x,C=i-x,E=r+b,_=r-b;t[u++]=T,t[u++]=E,t[--h]=E,t[--h]=C,t[l++]=C,t[l++]=_,t[--c]=_,t[--c]=T}f=0,d=0+a,p=i+f,m=i-f,v=r+d;var w=r-d;return t[u++]=p,t[u++]=v,t[--c]=w,t[--c]=p,t},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,o=0,s=0;s<t.length;s+=2)a+=t[s],o+=t[s+1];a/=t.length/2,o/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=o;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(aA),aR=function(t){function e(e,i,r,n,a){var o;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=20),(o=t.call(this)||this).x=e,o.y=i,o.width=r,o.height=n,o.roundness=a,o}iB(e,t);var i=e.prototype;return i.getBounds=function(t){return(t=t||new e).x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.clone=function(){return new e(this.x,this.y,this.width,this.height,this.roundness)},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.roundness=t.roundness,this},i.copyTo=function(t){return t.copyFrom(this),t},i.build=function(t,e){var i,r=this.width/2,n=this.height/2,a=this.x+r,o=this.y+n,s=i=Math.max(0,Math.min(this.roundness/100,1)*Math.min(r,n)),u=r-s,h=n-i;if(s>=0&&i>=0&&u>=0&&h>=0){var l=Math.ceil(Math.sqrt((null!=e?e:1)*(s+i))),c=8*l+(u?4:0)+(h?4:0);if(0!==c){if(0===l){t[0]=t[6]=a+u,t[1]=t[3]=o+h,t[2]=t[4]=a-u,t[5]=t[7]=o-h;return}var f=0,d=4*l+(u?2:0)+2,p=d,m=c,v=u+s,y=h,g=a+v,x=a-v,b=o+y;if(t[f++]=g,t[f++]=b,t[--d]=b,t[--d]=x,h){var T=o-y;t[p++]=x,t[p++]=T,t[--m]=T,t[--m]=g}for(var C=1;C<l;C++){var E=Math.PI/2*(C/l),_=u+Math.cos(E)*s,w=h+Math.sin(E)*i,S=a+_,M=a-_,A=o+w,P=o-w;t[f++]=S,t[f++]=A,t[--d]=A,t[--d]=M,t[p++]=M,t[p++]=P,t[--m]=P,t[--m]=S}v=u,y=h+i,g=a+v,x=a-v,b=o+y;var R=o-y;t[f++]=g,t[f++]=b,t[--m]=R,t[--m]=g,u&&(t[f++]=x,t[f++]=b,t[--m]=R,t[--m]=x)}}},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,o=0,s=0;s<t.length;s+=2)a+=t[s],o+=t[s+1];a/=t.length/2,o/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=o;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(aA),aI=function(t){function e(e,i,r,n,a,o){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=0),(s=t.call(this)||this).x=e,s.y=i,s.x2=r,s.y2=n,s.x3=a,s.y3=o,s}iB(e,t);var i=e.prototype;return i.contains=function(t,e){var i=(this.x-this.x3)*(e-this.y3)-(this.y-this.y3)*(t-this.x3),r=(this.x2-this.x)*(e-this.y)-(this.y2-this.y)*(t-this.x);if(i<0!=r<0&&0!==i&&0!==r)return!1;var n=(this.x3-this.x2)*(e-this.y2)-(this.y3-this.y2)*(t-this.x2);return 0===n||n<0==i+r<=0},i.clone=function(){return new e(this.x,this.y,this.x2,this.y2,this.x3,this.y3)},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.x2=t.x2,this.y2=t.y2,this.x3=t.x3,this.y3=t.y3,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getBounds=function(t){t=t||new aR;var e=Math.min(this.x,this.x2,this.x3),i=Math.max(this.x,this.x2,this.x3),r=Math.min(this.y,this.y2,this.y3),n=Math.max(this.y,this.y2,this.y3);return t.x=e,t.y=r,t.width=i-e,t.height=n-r,t},i.getX=function(){return this.x},i.getY=function(){return this.y},i.build=function(t,e){t[0]=this.x,t[1]=this.y,t[2]=this.x2,t[3]=this.y2,t[4]=this.x3,t[5]=this.y3},i.triangulate=function(t,e,i,r,n){var a=0;e[(i*=2)+0]=t[0],e[i+a+1]=t[1],e[i+(a+=2)]=t[2],e[i+a+1]=t[3],e[i+(a+=2)]=t[4],e[i+a+1]=t[5];var o=i/2;r[n++]=o,r[n++]=o+1,r[n++]=o+2},e}(aA);function aO(t,e,i,r,n,a,o,s,u,h,l,c){var f=(1-Math.min(.99,Math.max(0,null!=h?h:.5)))/(null!=l?l:1);return function t(e,i,r,n,a,o,s,u,h,l,c,f,d,p){if(void 0===d&&(d=0),void 0===p&&(p=1),!(c>8)){var m=(e+r)/2,v=(i+n)/2,y=(r+a)/2,g=(n+o)/2,x=(a+s)/2,b=(o+u)/2,T=(m+y)/2,C=(v+g)/2,E=(y+x)/2,_=(g+b)/2,w=(T+E)/2,S=(C+_)/2,M=(d+p)/2;if(c>0){var A=s-e,P=u-i,R=Math.abs((r-s)*P-(n-u)*A),I=Math.abs((a-s)*P-(o-u)*A);if(R>11920929e-14&&I>11920929e-14){if((R+I)*(R+I)<=l*(A*A+P*P)){h.push(w,S),null==f||f.push(M);return}}else if(R>11920929e-14){if(R*R<=l*(A*A+P*P)){h.push(w,S),null==f||f.push(M);return}}else if(I>11920929e-14){if(I*I<=l*(A*A+P*P)){h.push(w,S),null==f||f.push(M);return}}else if((A=w-(e+s)/2)*A+(P=S-(i+u)/2)*P<=l){h.push(w,S),null==f||f.push(M);return}}t(e,i,m,v,T,C,w,S,h,l,c+1,f,d,M),t(w,S,E,_,x,b,s,u,h,l,c+1,f,M,p)}}(e,i,r,n,a,o,s,u,t,f*=f,0,c),t.push(s,u),null==c||c.push(1),t}var aL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},aF={exports:{}};!function(t){function e(t,e){return t.b===e.b&&t.a===e.a}function i(t,e){return t.b<e.b||t.b===e.b&&t.a<=e.a}function r(t,e,i){var r=e.b-t.b,n=i.b-e.b;return 0<r+n?r<n?e.a-t.a+r/(r+n)*(t.a-i.a):e.a-i.a+n/(r+n)*(i.a-t.a):0}function n(t,e,i){var r=e.b-t.b,n=i.b-e.b;return 0<r+n?(e.a-i.a)*r+(e.a-t.a)*n:0}function a(t,e){return t.a<e.a||t.a===e.a&&t.b<=e.b}function o(t,e,i){var r=e.a-t.a,n=i.a-e.a;return 0<r+n?r<n?e.b-t.b+r/(r+n)*(t.b-i.b):e.b-i.b+n/(r+n)*(i.b-t.b):0}function s(t,e,i){var r=e.a-t.a,n=i.a-e.a;return 0<r+n?(e.b-i.b)*r+(e.b-t.b)*n:0}function u(t,e,i,r){return(t=0>t?0:t)<=(i=0>i?0:i)?0===i?(e+r)/2:e+t/(t+i)*(r-e):r+i/(t+i)*(e-r)}function h(t){var e=p(t.b);return v(e,t.c),v(e.b,t.c),y(e,t.a),e}function l(t,e){var i=!1,r=!1;t!==e&&(e.a!==t.a&&(r=!0,x(e.a,t.a)),e.d!==t.d&&(i=!0,b(e.d,t.d)),m(e,t),r||(v(e,t.a),t.a.c=t),i||(y(e,t.d),t.d.a=t))}function c(t){var e=t.b,i=!1;t.d!==t.b.d&&(i=!0,b(t.d,t.b.d)),t.c===t?x(t.a,null):(t.b.d.a=K(t),t.a.c=t.c,m(t,K(t)),i||y(t,t.d)),e.c===e?(x(e.a,null),b(e.d,null)):(t.d.a=K(e),e.a.c=e.c,m(e,K(e))),g(t)}function f(t){var e=p(t),i=e.b;return m(e,t.e),e.a=t.b.a,v(i,e.a),e.d=i.d=t.d,e=e.b,m(t.b,K(t.b)),m(t.b,e),t.b.a=e.a,e.b.a.c=e.b,e.b.d=t.b.d,e.f=t.f,e.b.f=t.b.f,e}function d(t,e){var i=!1,r=p(t),n=r.b;return e.d!==t.d&&(i=!0,b(e.d,t.d)),m(r,t.e),m(n,e),r.a=t.b.a,n.a=e.a,r.d=n.d=t.d,t.d.a=n,i||y(r,t.d),r}function p(t){var e=new q,i=new q,r=t.b.h;return i.h=r,r.b.h=e,e.h=t,t.b.h=i,e.b=i,e.c=e,e.e=i,i.b=e,i.c=i,i.e=e}function m(t,e){var i=t.c,r=e.c;i.b.e=e,r.b.e=t,t.c=r,e.c=i}function v(t,e){var i=e.f,r=new J(e,i);i.e=r,e.f=r,i=r.c=t;do i.a=r,i=i.c;while(i!==t)}function y(t,e){var i=e.d,r=new Z(e,i);i.b=r,e.d=r,r.a=t,r.c=e.c,i=t;do i.d=r,i=i.e;while(i!==t)}function g(t){var e=t.h;t=t.b.h,e.b.h=t,t.b.h=e}function x(t,e){var i=t.c,r=i;do r.a=e,r=r.c;while(r!==i);i=t.f,(r=t.e).f=i,i.e=r}function b(t,e){var i=t.a,r=i;do r.d=e,r=r.e;while(r!==i);i=t.d,(r=t.b).d=i,i.b=r}function T(t){var e=0;return Math.abs(t[1])>Math.abs(t[0])&&(e=1),Math.abs(t[2])>Math.abs(t[e])&&(e=2),e}var C,E=4*1e150;function _(t,e){t.f+=e.f,t.b.f+=e.b.f}function w(t,e,a){return(t=t.a,e=e.a,a=a.a,e.b.a===t)?a.b.a===t?i(e.a,a.a)?0>=n(a.b.a,e.a,a.a):0<=n(e.b.a,a.a,e.a):0>=n(a.b.a,t,a.a):a.b.a===t?0<=n(e.b.a,t,e.a):(e=r(e.b.a,t,e.a))>=(t=r(a.b.a,t,a.a))}function S(t){t.a.i=null;var e=t.e;e.a.c=e.c,e.c.a=e.a,t.e=null}function M(t,e){c(t.a),t.c=!1,t.a=e,e.i=t}function A(t){var e=t.a.a;do t=tl(t);while(t.a.a===e);return t.c&&(e=d(th(t).a.b,t.a.e),M(t,e),t=tl(t)),t}function P(t,e,i){var r=new tu;return r.a=i,r.e=G(t.f,e.e,r),i.i=r}function R(t,e){switch(t.s){case 100130:return 0!=(1&e);case 100131:return 0!==e;case 100132:return 0<e;case 100133:return 0>e;case 100134:return 2<=e||-2>=e}return!1}function I(t){var e=t.a,i=e.d;i.c=t.d,i.a=e,S(t)}function O(t,e,i){for(t=e,e=e.a;t!==i;){t.c=!1;var r=th(t),n=r.a;if(n.a!==e.a){if(!r.c){I(t);break}M(r,n=d(e.c.b,n.b))}e.c!==n&&(l(K(n),n),l(e,n)),I(t),e=r.a,t=r}return e}function L(t,e,i,r,n,a){var o=!0;do P(t,e,i.b),i=i.c;while(i!==r);for(null===n&&(n=th(e).a.b.c);(i=(r=th(e)).a.b).a===n.a;)i.c!==n&&(l(K(i),i),l(K(n),i)),r.f=e.f-i.f,r.d=R(t,r.f),e.b=!0,!o&&k(t,e)&&(_(i,n),S(e),c(n)),o=!1,e=r,n=i;e.b=!0,a&&z(t,e)}function F(t,e,i,r,n){var a=[e.g[0],e.g[1],e.g[2]];e.d=null,e.d=t.o&&t.o(a,i,r,t.c)||null,null===e.d&&(n?t.n||(Y(t,100156),t.n=!0):e.d=i[0])}function V(t,e,i){var r=[null,null,null,null];r[0]=e.a.d,r[1]=i.a.d,F(t,e.a,r,[.5,.5,0,0],!1),l(e,i)}function N(t,e,i,r,n){var a=Math.abs(e.b-t.b)+Math.abs(e.a-t.a),o=Math.abs(i.b-t.b)+Math.abs(i.a-t.a),s=n+1;r[n]=.5*o/(a+o),r[s]=.5*a/(a+o),t.g[0]+=r[n]*e.g[0]+r[s]*i.g[0],t.g[1]+=r[n]*e.g[1]+r[s]*i.g[1],t.g[2]+=r[n]*e.g[2]+r[s]*i.g[2]}function k(t,r){var a=th(r),o=r.a,s=a.a;if(i(o.a,s.a)){if(0<n(s.b.a,o.a,s.a))return!1;if(e(o.a,s.a)){if(o.a!==s.a){var a=t.e,u=o.a.h;if(0<=u){var a=a.b,h=a.d,c=a.e,d=a.c,p=d[u];h[p]=h[a.a],d[h[p]]=p,p<=--a.a&&(1>=p?to(a,p):i(c[h[p>>1]],c[h[p]])?to(a,p):ts(a,p)),c[u]=null,d[u]=a.b,a.b=u}else for(a.c[-(u+1)]=null;0<a.a&&null===a.c[a.d[a.a-1]];)--a.a;V(t,K(s),o)}}else f(s.b),l(o,K(s)),r.b=a.b=!0}else{if(0>n(o.b.a,s.a,o.a))return!1;tl(r).b=r.b=!0,f(o.b),l(K(s),o)}return!0}function D(t,h){var c=th(h),d=h.a,p=c.a,m=d.a,v=p.a,y=d.b.a,g=p.b.a,x=new J;if(n(y,t.a,m),n(g,t.a,v),m===v||Math.min(m.a,y.a)>Math.max(v.a,g.a))return!1;if(i(m,v)){if(0<n(g,m,v))return!1}else if(0>n(y,v,m))return!1;var b,T,C=y,E=m,_=g,w=v;if(i(C,E)||(b=C,C=E,E=b),i(_,w)||(b=_,_=w,w=b),i(C,_)||(b=C,C=_,_=b,b=E,E=w,w=b),i(_,E)?i(E,w)?(0>(b=r(C,_,E))+(T=r(_,E,w))&&(b=-b,T=-T),x.b=u(b,_.b,T,E.b)):(0>(b=n(C,_,E))+(T=-n(C,w,E))&&(b=-b,T=-T),x.b=u(b,_.b,T,w.b)):x.b=(_.b+E.b)/2,a(C,E)||(b=C,C=E,E=b),a(_,w)||(b=_,_=w,w=b),a(C,_)||(b=C,C=_,_=b,b=E,E=w,w=b),a(_,E)?a(E,w)?(0>(b=o(C,_,E))+(T=o(_,E,w))&&(b=-b,T=-T),x.a=u(b,_.a,T,E.a)):(0>(b=s(C,_,E))+(T=-s(C,w,E))&&(b=-b,T=-T),x.a=u(b,_.a,T,w.a)):x.a=(_.a+E.a)/2,i(x,t.a)&&(x.b=t.a.b,x.a=t.a.a),C=i(m,v)?m:v,i(C,x)&&(x.b=C.b,x.a=C.a),e(x,m)||e(x,v))return k(t,h),!1;if(!e(y,t.a)&&0<=n(y,t.a,x)||!e(g,t.a)&&0>=n(g,t.a,x)){if(g===t.a)return f(d.b),l(p.b,d),d=th(h=A(h)).a,O(t,th(h),c),L(t,h,K(d),d,d,!0),!0;if(y===t.a){f(p.b),l(d.e,K(p)),v=(m=c=h).a.b.a;do m=tl(m);while(m.a.b.a===v);return m=th(h=m).a.b.c,c.a=K(p),p=O(t,c,null),L(t,h,p.c,d.b.c,m,!0),!0}return 0<=n(y,t.a,x)&&(tl(h).b=h.b=!0,f(d.b),d.a.b=t.a.b,d.a.a=t.a.a),0>=n(g,t.a,x)&&(h.b=c.b=!0,f(p.b),p.a.b=t.a.b,p.a.a=t.a.a),!1}return f(d.b),f(p.b),l(K(p),d),d.a.b=x.b,d.a.a=x.a,d.a.h=tt(t.e,d.a),d=d.a,p=[0,0,0,0],x=[m.d,y.d,v.d,g.d],d.g[0]=d.g[1]=d.g[2]=0,N(d,m,y,p,0),N(d,v,g,p,2),F(t,d,x,p,!0),tl(h).b=h.b=c.b=!0,!1}function z(t,e){for(var r=th(e);;){for(;r.b;)e=r,r=th(r);if(!e.b&&(r=e,null===(e=tl(e))||!e.b))break;e.b=!1;var a,o=e.a,s=r.a;if(a=o.b.a!==s.b.a)t:{var u=th(a=e),h=a.a,d=u.a,p=void 0;if(i(h.b.a,d.b.a)){if(0>n(h.b.a,d.b.a,h.a)){a=!1;break t}tl(a).b=a.b=!0,p=f(h),l(d.b,p),p.d.c=a.d}else{if(0<n(d.b.a,h.b.a,d.a)){a=!1;break t}a.b=u.b=!0,p=f(d),l(h.e,d.b),p.b.d.c=a.d}a=!0}if(a&&(r.c?(S(r),c(s),s=(r=th(e)).a):e.c&&(S(e),c(o),o=(e=tl(r)).a)),o.a!==s.a){if(o.b.a===s.b.a||e.c||r.c||o.b.a!==t.a&&s.b.a!==t.a)k(t,e);else if(D(t,e))break}o.a===s.a&&o.b.a===s.b.a&&(_(s,o),S(e),c(o),e=tl(r))}}function B(t,e){var i=new tu,r=h(t.b);r.a.b=E,r.a.a=e,r.b.a.b=-E,r.b.a.a=e,t.a=r.b.a,i.a=r,i.f=0,i.d=!1,i.c=!1,i.h=!0,i.b=!1,r=G(r=t.f,r.a,i),i.e=r}function U(t){this.a=new W,this.b=t,this.c=w}function G(t,e,i){do e=e.c;while(null!==e.b&&!t.c(t.b,e.b,i));return t=new W(i,e.a,e),e.a.c=t,e.a=t}function W(t,e,i){this.b=t||null,this.a=e||this,this.c=i||this}function j(){this.d=X,this.p=this.b=this.q=null,this.j=[0,0,0],this.s=100130,this.n=!1,this.o=this.a=this.e=this.f=null,this.m=!1,this.c=this.r=this.i=this.k=this.l=this.h=null}var X=0;function H(t,e){if(t.d!==e)for(;t.d!==e;)if(t.d<e)switch(t.d){case X:Y(t,100151),t.u(null);break;case 1:Y(t,100152),t.t()}else switch(t.d){case 2:Y(t,100154),t.v();break;case 1:Y(t,100153),t.w()}}function Y(t,e){t.p&&t.p(e,t.c)}function Z(t,e){this.b=t||this,this.d=e||this,this.a=null,this.c=!1}function q(){this.h=this,this.i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function K(t){return t.b.e}function Q(){this.c=new J,this.a=new Z,this.b=new q,this.d=new q,this.b.b=this.d,this.d.b=this.b}function J(t,e){this.e=t||this,this.f=e||this,this.d=this.c=null,this.g=[0,0,0],this.h=this.a=this.b=0}function $(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new ti}function tt(t,e){if(t.e){var i,r=t.b,n=++r.a;return 2*n>r.f&&(r.f*=2,r.c=tr(r.c,r.f+1)),0===r.b?i=n:(i=r.b,r.b=r.c[r.b]),r.e[i]=e,r.c[i]=n,r.d[n]=i,r.h&&ts(r,n),i}return r=t.a++,t.c[r]=e,-(r+1)}function te(t){if(0===t.a)return ta(t.b);var e=t.c[t.d[t.a-1]];if(0!==t.b.a&&i(tn(t.b),e))return ta(t.b);do--t.a;while(0<t.a&&null===t.c[t.d[t.a-1]]);return e}function ti(){this.d=tr([0],33),this.e=[null,null],this.c=[0,0],this.a=0,this.f=32,this.b=0,this.h=!1,this.d[1]=1}function tr(t,e){for(var i=Array(e),r=0;r<t.length;r++)i[r]=t[r];for(;r<e;r++)i[r]=0;return i}function tn(t){return t.e[t.d[1]]}function ta(t){var e=t.d,i=t.e,r=t.c,n=e[1],a=i[n];return 0<t.a&&(e[1]=e[t.a],r[e[1]]=1,i[n]=null,r[n]=t.b,t.b=n,0<--t.a&&to(t,1)),a}function to(t,e){for(var r=t.d,n=t.e,a=t.c,o=e,s=r[o];;){var u=o<<1;u<t.a&&i(n[r[u+1]],n[r[u]])&&(u+=1);var h=r[u];if(u>t.a||i(n[s],n[h])){r[o]=s,a[s]=o;break}r[o]=h,a[h]=o,o=u}}function ts(t,e){for(var r=t.d,n=t.e,a=t.c,o=e,s=r[o];;){var u=o>>1,h=r[u];if(0===u||i(n[h],n[s])){r[o]=s,a[s]=o;break}r[o]=h,a[h]=o,o=u}}function tu(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function th(t){return t.e.c.b}function tl(t){return t.e.a.b}(C=j.prototype).x=function(){H(this,X)},C.B=function(t,e){switch(t){case 100142:return;case 100140:switch(e){case 100130:case 100131:case 100132:case 100133:case 100134:this.s=e;return}break;case 100141:this.m=!!e;return;default:Y(this,100900);return}Y(this,100901)},C.y=function(t){switch(t){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Y(this,100900)}return!1},C.A=function(t,e,i){this.j[0]=t,this.j[1]=e,this.j[2]=i},C.z=function(t,e){var i=e||null;switch(t){case 100100:case 100106:this.h=i;break;case 100104:case 100110:this.l=i;break;case 100101:case 100107:this.k=i;break;case 100102:case 100108:this.i=i;break;case 100103:case 100109:this.p=i;break;case 100105:case 100111:this.o=i;break;case 100112:this.r=i;break;default:Y(this,100900)}},C.C=function(t,e){var i=!1,r=[0,0,0];H(this,2);for(var n=0;3>n;++n){var a=t[n];-1e150>a&&(a=-1e150,i=!0),1e150<a&&(a=1e150,i=!0),r[n]=a}i&&Y(this,100155),null===(i=this.q)?l(i=h(this.b),i.b):(f(i),i=i.e),i.a.d=e,i.a.g[0]=r[0],i.a.g[1]=r[1],i.a.g[2]=r[2],i.f=1,i.b.f=-1,this.q=i},C.u=function(t){H(this,X),this.d=1,this.b=new Q,this.c=t},C.t=function(){H(this,1),this.d=2,this.q=null},C.v=function(){H(this,2),this.d=1},C.w=function(){H(this,1),this.d=X;var t,r,a=this.j[0],o=this.j[1],s=this.j[2],u=!1,h=[a,o,s];if(0===a&&0===o&&0===s){for(var o=[-2*1e150,-2*1e150,-2*1e150],p=[2*1e150,2*1e150,2*1e150],s=[],v=[],u=this.b.c,a=u.e;a!==u;a=a.e)for(var y=0;3>y;++y){var b=a.g[y];b<p[y]&&(p[y]=b,v[y]=a),b>o[y]&&(o[y]=b,s[y]=a)}if(a=0,o[1]-p[1]>o[0]-p[0]&&(a=1),o[2]-p[2]>o[a]-p[a]&&(a=2),p[a]>=o[a])h[0]=0,h[1]=0,h[2]=1;else{for(o=0,p=v[a],s=s[a],v=[0,0,0],p=[p.g[0]-s.g[0],p.g[1]-s.g[1],p.g[2]-s.g[2]],y=[0,0,0],a=u.e;a!==u;a=a.e)y[0]=a.g[0]-s.g[0],y[1]=a.g[1]-s.g[1],y[2]=a.g[2]-s.g[2],v[0]=p[1]*y[2]-p[2]*y[1],v[1]=p[2]*y[0]-p[0]*y[2],v[2]=p[0]*y[1]-p[1]*y[0],(b=v[0]*v[0]+v[1]*v[1]+v[2]*v[2])>o&&(o=b,h[0]=v[0],h[1]=v[1],h[2]=v[2]);0>=o&&(h[0]=h[1]=h[2]=0,h[T(p)]=1)}u=!0}for(v=T(h),a=this.b.c,o=(v+1)%3,s=(v+2)%3,v=0<h[v]?1:-1,h=a.e;h!==a;h=h.e)h.b=h.g[o],h.a=v*h.g[s];if(u){for(h=0,a=(u=this.b.a).b;a!==u;a=a.b)if(!(0>=(o=a.a).f))do h+=(o.a.b-o.b.a.b)*(o.a.a+o.b.a.a),o=o.e;while(o!==a.a);if(0>h)for(u=(h=this.b.c).e;u!==h;u=u.e)u.a=-u.a}for(this.n=!1,a=(h=this.b.b).h;a!==h;a=u)u=a.h,o=a.e,e(a.a,a.b.a)&&a.e.e!==a&&(V(this,o,a),c(a),o=(a=o).e),o.e===a&&(o!==a&&((o===u||o===u.b)&&(u=u.h),c(o)),(a===u||a===u.b)&&(u=u.h),c(a));for(this.e=h=new $,a=(u=this.b.c).e;a!==u;a=a.e)a.h=tt(h,a);for(function(t){t.d=[];for(var e,r=0;r<t.a;r++)t.d[r]=r;t.d.sort((e=t.c,function(t,r){return i(e[t],e[r])?1:-1})),t.e=!0,function(t){for(var e=t.a;1<=e;--e)to(t,e);t.h=!0}(t.b)}(h),this.f=new U(this),B(this,-E),B(this,E);null!==(h=te(this.e));){for(;;){t:if(0===(a=this.e).a)u=tn(a.b);else if(u=a.c[a.d[a.a-1]],0!==a.b.a&&i(a=tn(a.b),u)){u=a;break t}if(null===u||!e(u,h))break;u=te(this.e),V(this,h.c,u.c)}!function t(r,a){r.a=a;for(var o=a.c;null===o.i;)if((o=o.c)===a.c){var o=r,s=a,u=new tu;u.a=s.c.b;var h=o.f,p=h.a;do p=p.a;while(null!==p.b&&!h.c(h.b,u,p.b));var h=p.b,m=th(h),u=h.a,p=m.a;if(0===n(u.b.a,s,u.a))e((u=h.a).a,s)||e(u.b.a,s)||(f(u.b),h.c&&(c(u.c),h.c=!1),l(s.c,u),t(o,s));else{var v=i(p.b.a,u.b.a)?h:m,m=void 0;h.d||v.c?(m=v===h?d(s.c.b,u.e):d(p.b.c.b,s.c).b,v.c?M(v,m):(u=o,(h=P(o,h,m)).f=tl(h).f+h.a.f,h.d=R(u,h.f)),t(o,s)):L(o,h,s.c,s.c,null,!0)}return}if(h=(u=th(o=A(o.i))).a,(u=O(r,u,null)).c===h){var h=u,u=h.c,p=th(o),m=o.a,v=p.a,y=!1;m.b.a!==v.b.a&&D(r,o),e(m.a,r.a)&&(l(K(u),m),u=th(o=A(o)).a,O(r,th(o),p),y=!0),e(v.a,r.a)&&(l(h,K(v)),h=O(r,p,null),y=!0),y?L(r,o,h.c,u,u,!0):(s=i(v.a,m.a)?K(v):m,L(r,o,s=d(h.c.b,s),s.c,s.c,!1),s.b.i.c=!0,z(r,o))}else L(r,o,u.c,h,h,!0)}(this,h)}for(h=0,this.a=this.f.a.a.b.a.a;null!==(u=this.f.a.a.b);)u.h||++h,S(u);for(this.f=null,(h=this.e).b=null,h.d=null,this.e=h.c=null,a=(h=this.b).a.b;a!==h.a;a=u)u=a.b,(a=a.a).e.e===a&&(_(a.c,a),c(a));if(!this.n){if(h=this.b,this.m)for(a=h.b.h;a!==h.b;a=u)u=a.h,a.b.d.c!==a.d.c?a.f=a.d.c?1:-1:c(a);else for(a=h.a.b;a!==h.a;a=u)if(u=a.b,a.c){for(a=a.a;i(a.b.a,a.a);a=a.c.b);for(;i(a.a,a.b.a);a=a.e);for(o=a.c.b,s=void 0;a.e!==o;)if(i(a.b.a,o.a)){for(;o.e!==a&&(i((t=o.e).b.a,t.a)||0>=n(o.a,o.b.a,o.e.b.a));)o=(s=d(o.e,o)).b;o=o.c.b}else{for(;o.e!==a&&(i((r=a.c.b).a,r.b.a)||0<=n(a.b.a,a.a,a.c.b.a));)a=(s=d(a,a.c.b)).b;a=a.e}for(;o.e.e!==a;)o=(s=d(o.e,o)).b}if(this.h||this.i||this.k||this.l){if(this.m){for(u=(h=this.b).a.b;u!==h.a;u=u.b)if(u.c){this.h&&this.h(2,this.c),a=u.a;do this.k&&this.k(a.a.d,this.c),a=a.e;while(a!==u.a);this.i&&this.i(this.c)}}else{for(h=this.b,u=!!this.l,a=!1,o=-1,s=h.a.d;s!==h.a;s=s.d)if(s.c){a||(this.h&&this.h(4,this.c),a=!0),v=s.a;do u&&o!==(p=v.b.d.c?0:1)&&(o=p,this.l&&this.l(!!o,this.c)),this.k&&this.k(v.a.d,this.c),v=v.e;while(v!==s.a)}a&&this.i&&this.i(this.c)}}if(this.r){for(a=(h=this.b).a.b;a!==h.a;a=u)if(u=a.b,!a.c){s=(o=a.a).e,v=void 0;do s=(v=s).e,v.d=null,null===v.b.d&&(v.c===v?x(v.a,null):(v.a.c=v.c,m(v,K(v))),(p=v.b).c===p?x(p.a,null):(p.a.c=p.c,m(p,K(p))),g(v));while(v!==o);o=a.d,(a=a.b).d=o,o.b=a}this.r(this.b),this.c=this.b=null;return}}this.b=this.c=null},aL.libtess={GluTesselator:j,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}},j.prototype.gluDeleteTess=j.prototype.x,j.prototype.gluTessProperty=j.prototype.B,j.prototype.gluGetTessProperty=j.prototype.y,j.prototype.gluTessNormal=j.prototype.A,j.prototype.gluTessCallback=j.prototype.z,j.prototype.gluTessVertex=j.prototype.C,j.prototype.gluTessBeginPolygon=j.prototype.u,j.prototype.gluTessBeginContour=j.prototype.t,j.prototype.gluTessEndContour=j.prototype.v,j.prototype.gluTessEndPolygon=j.prototype.w,t.exports=aL.libtess}(aF);var aV=((ty=new aF.exports.GluTesselator).gluTessCallback(aF.exports.gluEnum.GLU_TESS_VERTEX_DATA,function(t,e){e[e.length]=t[0],e[e.length]=t[1]}),ty.gluTessCallback(aF.exports.gluEnum.GLU_TESS_BEGIN,function(t){t!==aF.exports.primitiveType.GL_TRIANGLES&&console.info("expected TRIANGLES but got type: "+t)}),ty.gluTessCallback(aF.exports.gluEnum.GLU_TESS_ERROR,function(t){console.error("error callback, error number: "+t)}),ty.gluTessCallback(aF.exports.gluEnum.GLU_TESS_COMBINE,function(t,e,i){return[t[0],t[1],t[2]]}),ty.gluTessCallback(aF.exports.gluEnum.GLU_TESS_EDGE_FLAG,function(t){}),ty);function aN(t){aV.gluTessNormal(0,0,1);var e=[];aV.gluTessBeginPolygon(e);for(var i=0;i<t.length;i++){aV.gluTessBeginContour();for(var r=t[i],n=0;n<r.length;n+=2){var a=[r[n],r[n+1],0];aV.gluTessVertex(a,a)}aV.gluTessEndContour()}return aV.gluTessEndPolygon(),e}t.StarType=void 0,(tg=t.StarType||(t.StarType={}))[tg.Star=0]="Star",tg[tg.Polygon=1]="Polygon";var ak=function(t){function e(e,i,r,n,a,o){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===o&&(o=0),(s=t.call(this)||this).pointCount=e,s.outerRadius=i,s.innerRadius=r,s.outerRoundness=n,s.innerRoundness=a,s.starType=o,s.v=[],s.in=[],s.out=[],s}iB(e,t);var i=e.prototype;return i.clone=function(){return new e(this.pointCount,this.outerRadius,this.innerRadius,this.outerRoundness,this.innerRoundness,this.starType)},i.copyFrom=function(t){this.pointCount=t.pointCount,this.outerRadius=t.outerRadius,this.innerRadius=t.innerRadius,this.outerRoundness=t.outerRoundness,this.innerRoundness=t.innerRoundness,this.starType=t.starType},i.copyTo=function(t){t.copyFrom(this)},i.build=function(t,e){switch(this.starType){case 0:this.buildStarPath();break;case 1:this.buildPolygonPath()}for(var i=null!=e?e:1,r=0;r<this.v.length-2;r+=2)aO(t,this.v[r],this.v[r+1],this.out[r],this.out[r+1],this.in[r+2],this.in[r+3],this.v[r+2],this.v[r+3],void 0,i);var n=this.v.length-1;aO(t,this.v[n-1],this.v[n],this.out[n-1],this.out[n],this.in[0],this.in[1],this.v[0],this.v[1],void 0,i)},i.triangulate=function(t,e,i,r,n){for(var a=aN([t]),o=e.length/2,s=0;s<a.length;s++)e[2*i+s]=a[s];for(var u=a.length/2,h=0;h<u;h++)r[n+h]=o+h},i.buildStarPath=function(){this.v=[],this.in=[],this.out=[];var t,e,i,r,n=2*Math.floor(this.pointCount),a=2*Math.PI/n,o=!0,s=this.outerRadius,u=this.innerRadius,h=this.outerRoundness/100,l=this.innerRoundness/100,c=2*Math.PI*s/(2*n),f=2*Math.PI*u/(2*n),d=-Math.PI/2;for(t=0;t<n;t++){e=o?s:u,i=o?h:l,r=o?c:f;var p=e*Math.cos(d),m=e*Math.sin(d),v=0===p&&0===m?0:m/Math.sqrt(p*p+m*m),y=0===p&&0===m?0:-p/Math.sqrt(p*p+m*m),g=2*t;this.v[g]=p,this.v[g+1]=m,this.in[g]=p+v*r*i*1,this.in[g+1]=m+y*r*i*1,this.out[g]=p-v*r*i*1,this.out[g+1]=m-y*r*i*1,o=!o,d+=1*a}},i.buildPolygonPath=function(){this.v=[],this.in=[],this.out=[];var t,e=Math.floor(this.pointCount),i=2*Math.PI/e,r=this.outerRadius,n=this.outerRoundness/100,a=2*Math.PI*r/(4*e),o=-(.5*Math.PI);for(t=0;t<e;t++){var s=r*Math.cos(o),u=r*Math.sin(o),h=0===s&&0===u?0:u/Math.sqrt(s*s+u*u),l=0===s&&0===u?0:-s/Math.sqrt(s*s+u*u),c=2*t;this.v[c]=s,this.v[c+1]=u,this.in[c]=s+h*a*n*1,this.in[c+1]=u+l*a*n*1,this.out[c]=s-h*a*n*1,this.out[c+1]=u-l*a*n*1,o+=1*i}},e}(aA),aD=function(t){function e(e,i,r){var n;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),(n=t.call(this)||this).x=e,n.y=i,n.radius=r,n}iB(e,t);var i=e.prototype;return i.clone=function(){return new e(this.x,this.y,this.radius)},i.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=i},i.strokeContains=function(t,e,i,r){if(void 0===r&&(r=.5),0===this.radius)return!1;var n=this.x-t,a=this.y-e,o=this.radius,s=(1-r)*i,u=Math.sqrt(n*n+a*a);return u<=o+s&&u>o-(i-s)},i.getBounds=function(t){return t||(t=new aR),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=2*this.radius,t.height=2*this.radius,t},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this},i.copyTo=function(t){return t.copyFrom(this),t},i.build=function(t,e){var i=this.x,r=this.y,n=this.radius,a=this.radius;if(!(n<=0)){var o=Math.ceil(Math.sqrt((null!=e?e:1)*(n+a))),s=8*o+0+0;if(0!==s){if(0===o){t[0]=t[6]=i+0,t[1]=t[3]=r+0,t[2]=t[4]=i-0,t[5]=t[7]=r-0;return}var u=0,h=4*o+0+2,l=h,c=s,f=0+n,d=0,p=i+f,m=i-f,v=r+0;t[u++]=p,t[u++]=v,t[--h]=v,t[--h]=m;for(var y=1;y<o;y++){var g=Math.PI/2*(y/o),x=0+Math.cos(g)*n,b=0+Math.sin(g)*a,T=i+x,C=i-x,E=r+b,_=r-b;t[u++]=T,t[u++]=E,t[--h]=E,t[--h]=C,t[l++]=C,t[l++]=_,t[--c]=_,t[--c]=T}f=0,d=0+a,p=i+f,m=i-f,v=r+d;var w=r-d;t[u++]=p,t[u++]=v,t[--c]=w,t[--c]=p}}},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,o=0,s=0;s<t.length;s+=2)a+=t[s],o+=t[s+1];a/=t.length/2,o/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=o;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(aA),az=function(t){function e(){for(var e,i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];(e=t.call(this)||this).points=[],e.closePath=!1;var a=Array.isArray(r[0])?r[0]:r;if("number"!=typeof a[0]){for(var o=[],s=0,u=a.length;s<u;s++)o.push(a[s].x,a[s].y);a=o}return e.points=a,e.closePath=!0,e}iB(e,t);var i=e.prototype;return i.clone=function(){var t=new e(this.points.slice());return t.closePath=this.closePath,t},i.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,a=r-1;n<r;a=n++){var o=this.points[2*n],s=this.points[2*n+1],u=this.points[2*a],h=this.points[2*a+1];s>e!=h>e&&t<(e-s)/(h-s)*(u-o)+o&&(i=!i)}return i},i.copyFrom=function(t){return this.points=t.points.slice(),this.closePath=t.closePath,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getX=function(){return this.points[this.points.length-2]},i.getY=function(){return this.points[this.points.length-1]},i.build=function(t,e){for(var i=0;i<this.points.length;i++)t[i]=this.points[i]},i.triangulate=function(t,e,i,r,n){var a=aN([t]),o=e.length/2;0===a.length&&this.getLineEndPointsTriangle(t,a);for(var s=0;s<a.length;s++)e[2*i+s]=a[s];for(var u=a.length/2,h=0;h<u;h++)r[n+h]=o+h},i.getLineEndPointsTriangle=function(t,e){if(!t||t.length<2||t.length%2!=0)throw Error("Invalid points array");if(2===t.length){e.push(t[0],t[1],t[0],t[1],t[0],t[1]);return}var i=t[2]-t[0],r=t[3]-t[1],n=t[0],a=t[1],o=t[0],s=t[1];if(Math.abs(i)>=Math.abs(r))for(var u=0;u<t.length;u+=2){var h=t[u],l=t[u+1];h<n&&(n=h,a=l),h>o&&(o=h,s=l)}else for(var c=0;c<t.length;c+=2){var f=t[c],d=t[c+1];d<a&&(n=f,a=d),d>s&&(o=f,s=d)}e.push(n,a,o,s,o,s)},rI(e,[{key:"lastX",get:function(){return this.points[this.points.length-2]}},{key:"lastY",get:function(){return this.points[this.points.length-1]}}]),e}(aA);t.UpdateModes=void 0,(tx=t.UpdateModes||(t.UpdateModes={}))[tx.EveryUpdate=0]="EveryUpdate",tx[tx.Manual=1]="Manual",t.CompositionComponent=function(e){function i(){var i;return i=e.apply(this,arguments)||this,i.items=[],i.state=t.PlayState.Stopped,i.updateMode=0,i.playOnStart=!1,i.endBehavior=t0.forward,i.time=0,i.lastTime=0,i.sceneBindings=[],i.timelineAsset=null,i._timelineInstance=null,i.nestedCompositions=[],i}iB(i,e);var r=i.prototype;return r.onStart=function(){this.playOnStart&&this.play()},r.pause=function(){this.state=t.PlayState.Paused;for(var e,i=ij(this.nestedCompositions);!(e=i()).done;)e.value.pause()},r.play=function(){this.state=t.PlayState.Playing;for(var e,i=ij(this.nestedCompositions);!(e=i()).done;)e.value.play()},r.stop=function(){this.state=t.PlayState.Stopped,this.time=0,this.lastTime=0;for(var e,i=ij(this.nestedCompositions);!(e=i()).done;)e.value.stop()},r.getTime=function(){return this.time},r.setTime=function(t){this.time=t},r.onUpdate=function(e){this.state===t.PlayState.Playing&&0===this.updateMode&&this.tick(e/1e3)},r.tick=function(t){if(this.timelineInstance){var e=this.time;if(nj(this.lastTime,this.time)&&(e+=t),e>this.item.duration)switch(this.endBehavior){case t0.forward:break;case t0.freeze:e=this.item.duration;break;case t0.restart:e%=this.item.duration;break;case t0.destroy:this.item.dispose();return}this.timelineInstance.evaluate(e,t),this.lastTime=this.time=e}},r.onEnable=function(){this.item.getDescendants(!1,function(t){return t.setActive(!0),!1})},r.onDisable=function(){this.item.getDescendants(!1,function(t){return t.setActive(!1),!1})},r.onDestroy=function(){this.item.getDescendants().forEach(function(t){return t.dispose()})},r.setChildrenRenderOrder=function(e){if(!this.timelineInstance)return e;var r=[];this.collectChildren(this.item,r);for(var n,a=new Set,o=ij(this.timelineInstance.masterTrackInstances);!(n=o()).done;){var s=n.value;eU(s.boundObject,t.VFXItem)&&a.add(s.boundObject)}for(var u=[],h=0;h<r.length;h++)a.has(r[h])&&u.push(h);for(var l,c=[],f=ij(this.timelineInstance.masterTrackInstances);!(l=f()).done;){var d=l.value;eU(d.boundObject,t.VFXItem)&&c.push(d.boundObject)}for(var p=0;p<u.length&&p<c.length;p++)r[u[p]]=c[p];for(var m,v=ij(r);!(m=v()).done;){var y=m.value,g=e++;y.isManuallySetRenderOrder||y.setRendererComponentOrder(g);var x=y.getComponent(i);x&&(e=x.setChildrenRenderOrder(e))}return e},r.collectChildren=function(e,i){for(var r,n=ij(e.children);!(r=n()).done;){var a=r.value;i.push(a),t.VFXItem.isComposition(a)||this.collectChildren(a,i)}},r.fromData=function(t){e.prototype.fromData.call(this,t),this._timelineInstance=null},rI(i,[{key:"timelineInstance",get:function(){if(!this._timelineInstance&&this.timelineAsset){this._timelineInstance=new us(this.timelineAsset,this.sceneBindings),this.nestedCompositions=[];for(var e,r=ij(this._timelineInstance.masterTrackInstances);!(e=r()).done;){var n=e.value.boundObject;if(eU(n,t.VFXItem)&&t.VFXItem.isComposition(n)){var a=n.getComponent(i);a.updateMode=1,this.nestedCompositions.push(a)}}}return this._timelineInstance}}]),i}(rO),eG([iK(void 0,void 0)],t.CompositionComponent.prototype,"items",void 0),eG([iK(void 0,void 0)],t.CompositionComponent.prototype,"sceneBindings",void 0),eG([iK(void 0,void 0)],t.CompositionComponent.prototype,"timelineAsset",void 0),t.CompositionComponent=eG([iZ("CompositionComponent")],t.CompositionComponent);var aB=function(t){function e(e){var i;return(i=t.call(this,e)||this).getHitTestParams=function(t){var e=i.transform.getWorldMatrix();i.boundingBoxInfo.setGeometry(i.geometry,e);var r=i.boundingBoxInfo.getRawBoundingBoxTriangle();if(r)return{type:r.type,triangles:r.area,clipMasks:i.frameClipMasks}},i}iB(e,t);var i=e.prototype;return i.render=function(t){this.maskManager.drawStencilMask(t,this);for(var e=0;e<this.materials.length;e++){var i=this.materials[e];t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),i,e)}},i.drawStencilMask=function(t){if(this.isActiveAndEnabled)for(var e=0;e<this.materials.length;e++){var i=this.materials[e];this.maskManager.drawGeometryMask(this.engine.renderer,this.geometry,this.transform.getWorldMatrix(),i,t,e)}},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.boundingBoxInfo.setGeometry(this.geometry,t),this.boundingBoxInfo.getBoundingBoxTriangle()},i.getBoundingBoxInfo=function(){var t=this.geometry.getAttributeData("aPos");if(t){var e=nH(t,0,t.length/3);e.minimum.x*=this.transform.size.x,e.minimum.y*=this.transform.size.y,e.maximum.x*=this.transform.size.x,e.maximum.y*=this.transform.size.y,this.boundingBoxInfo.reConstruct(e.minimum,e.maximum,this.transform.getWorldMatrix())}return this.boundingBoxInfo},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.mask;i&&this.maskManager.setMaskOptions(this.engine,i)},e}(n_);eG([iK(void 0,void 0)],aB.prototype,"geometry",void 0),t.EffectComponent=function(t){function e(e){var i;return(i=t.call(this,e)||this).time=0,i.name="EffectComponent",i}iB(e,t);var i=e.prototype;return i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.onUpdate=function(t){var e,i=this.time,r=null!=(e=this.material.getVector4("_Time"))?e:new e4;this.material.setVector4("_Time",r.set(i/20,i,2*i,3*i)),this.time+=t/1e3},i.fromData=function(e){t.prototype.fromData.call(this,e),this.material=this.materials[0]},e}(aB),t.EffectComponent=eG([iZ(em.EffectComponent)],t.EffectComponent);var aU=new e3(0,0,0),aG=new e3(0,0,0),aW=function(){this.target=null,this.weight=1};t.PositionConstraint=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.positionAtRest=new e3(0,0,0),e.positionOffset=new e3(0,0,0),e.weight=1,e.constrainX=!0,e.constrainY=!0,e.constrainZ=!0,e.targets=[],e}iB(e,t);var i=e.prototype;return i.onStart=function(){var t=this.item.transform.getWorldPosition();this.positionAtRest.copyFrom(t)},i.onUpdate=function(t){if(0!==this.targets.length){aU.set(0,0,0);for(var e,i=0,r=ij(this.targets);!(e=r()).done;){var n=e.value;if(n.target){var a=n.target.transform.getWorldPosition(),o=n.weight;aU.x+=a.x*o,aU.y+=a.y*o,aU.z+=a.z*o,i+=o}}i>0&&(aU.x/=i,aU.y/=i,aU.z/=i),aU.x+=this.positionOffset.x,aU.y+=this.positionOffset.y,aU.z+=this.positionOffset.z,aG.set(this.lerp(this.positionAtRest.x,aU.x,this.weight),this.lerp(this.positionAtRest.y,aU.y,this.weight),this.lerp(this.positionAtRest.z,aU.z,this.weight)),aU.copyFrom(this.item.transform.getWorldPosition());var s=this.constrainX?aG.x:aU.x,u=this.constrainY?aG.y:aU.y,h=this.constrainZ?aG.z:aU.z;this.item.transform.setWorldPosition(s,u,h)}},i.addTarget=function(t,e){void 0===e&&(e=1);var i=new aW;i.target=t,i.weight=Math.max(0,Math.min(1,e)),this.targets.push(i)},i.removeTarget=function(t){var e=this.targets.findIndex(function(e){return e.target===t});-1!==e&&this.targets.splice(e,1)},i.clearTargets=function(){this.targets=[]},i.setPositionOffset=function(t,e,i){this.positionOffset.set(t,e,i)},i.setWeight=function(t){this.weight=Math.max(0,Math.min(1,t))},i.lerp=function(t,e,i){return t+(e-t)*i},i.fromData=function(e){t.prototype.fromData.call(this,e),this.positionAtRest.copyFrom(e.positionAtRest),this.positionOffset.copyFrom(e.positionOffset),this.weight=e.weight,this.constrainX=e.constrainX,this.constrainY=e.constrainY,this.constrainZ=e.constrainZ,this.targets=[];for(var i,r=ij(e.targets);!(i=r()).done;){var n=i.value,a=new aW;a.target=this.engine.findObject(n.target),a.weight=n.weight,this.targets.push(a)}},e}(rO),t.PositionConstraint=eG([iZ("PositionConstraint")],t.PositionConstraint),t.PostProcessVolume=function(t){function e(e){var i;return(i=t.call(this,e)||this).bloom={threshold:0,intensity:0,active:!1},i.vignette={intensity:0,smoothness:0,roundness:0,active:!1},i.tonemapping={active:!1},i.colorAdjustments={brightness:0,saturation:0,contrast:0,active:!1},i}return iB(e,t),e.prototype.onStart=function(){var t=this.item.composition;t&&(t.renderFrame.globalVolume=this)},e}(rO),eG([iK(void 0,void 0)],t.PostProcessVolume.prototype,"bloom",void 0),eG([iK(void 0,void 0)],t.PostProcessVolume.prototype,"vignette",void 0),eG([iK(void 0,void 0)],t.PostProcessVolume.prototype,"tonemapping",void 0),eG([iK(void 0,void 0)],t.PostProcessVolume.prototype,"colorAdjustments",void 0),t.PostProcessVolume=eG([iZ(em.PostProcessVolume)],t.PostProcessVolume),t.FilterMode=void 0,(tb=t.FilterMode||(t.FilterMode={}))[tb.Nearest=0]="Nearest",tb[tb.Linear=1]="Linear",t.RenderTextureFormat=void 0,(tT=t.RenderTextureFormat||(t.RenderTextureFormat={}))[tT.RGBA32=0]="RGBA32",tT[tT.RGBAHalf=1]="RGBAHalf";var aj=function(){function t(){}var e=t.prototype;return e.resize=function(t,e,i,r){},e.resetColorTextures=function(t){},e.unbind=function(){},e.bind=function(){},e.getDepthTexture=function(){},e.getStencilTexture=function(){},e.getColorTextures=function(){return[]},e.dispose=function(t){},rI(t,[{key:"stencilStorage",get:function(){}},{key:"depthStorage",get:function(){}}]),t}();t.RenderPassAttachmentStorageType=void 0,(tC=t.RenderPassAttachmentStorageType||(t.RenderPassAttachmentStorageType={}))[tC.none=0]="none",tC[tC.color=1]="color",tC[tC.stencil_8_opaque=2]="stencil_8_opaque",tC[tC.depth_16_opaque=3]="depth_16_opaque",tC[tC.depth_stencil_opaque=4]="depth_stencil_opaque",tC[tC.depth_16_texture=5]="depth_16_texture",tC[tC.depth_24_stencil_8_texture=6]="depth_24_stencil_8_texture",t.TextureStoreAction=void 0,(tE=t.TextureStoreAction||(t.TextureStoreAction={}))[tE.store=0]="store",tE[tE.clear=2]="clear";var aX=function(){function e(e,i){if(this.destroyed=!1,i){var r=i.texture,n=i.size;if(eU(r,r7))this.texture=r,this.externalTexture=!0;else if(r){var a=r.wrapT,o=r.wrapS,s=r.minFilter,u=r.magFilter,h=r.internalFormat,l=r.format,c=void 0===l?rV.RGBA:l,f=r.type,d=void 0===f?rV.UNSIGNED_BYTE:f;this.externalTexture=!1,this.textureOptions={size:n,format:c,type:d,internalFormat:h||c,wrapT:a,wrapS:o,minFilter:s,magFilter:u,name:i.name},this.texture=r7.create(e,i7({},this.textureOptions,{sourceType:t.TextureSourceType.framebuffer,data:{width:n[0],height:n[1]}}))}}}return e.prototype.dispose=function(){this.destroyed||(this.texture.dispose(),this.destroyed=!0)},rI(e,[{key:"isDestroyed",get:function(){return this.destroyed}},{key:"storageType",get:function(){return 1}},{key:"size",get:function(){var t=this.texture;return t?[t.getWidth(),t.getHeight()]:[0,0]}},{key:"width",get:function(){return this.texture.getWidth()||0}},{key:"height",get:function(){return this.texture.getHeight()||0}}]),e}();t.RenderPassDestroyAttachmentType=void 0,(t_=t.RenderPassDestroyAttachmentType||(t.RenderPassDestroyAttachmentType={}))[t_.force=0]="force",t_[t_.keep=1]="keep",t_[t_.keepExternal=2]="keepExternal",t_[t_.destroy=0]="destroy";var aH=1,aY=function(){function e(t){this.priority=0,this.name="RenderPass"+aH++,this.meshes=[],this.disposed=!1,this.framebuffer=null,this.renderer=t}var i=e.prototype;return i.addMesh=function(t){id(this.meshes,t)},i.removeMesh=function(t){eq(this.meshes,t)},i.configure=function(t){},i.execute=function(t){},i.onCameraCleanup=function(t){},i.getViewport=function(){var t,e=null==(t=this.framebuffer)?void 0:t.viewport;if(e)return e;var i=this.renderer;return i?[0,0,i.getWidth(),i.getHeight()]:[0,0,0,0]},i.dispose=function(e){if(!this.disposed){var i=(null==e?void 0:e.meshes)||void 0;i!==t.DestroyOptions.keep&&this.meshes.forEach(function(t){t.dispose(i)}),this.meshes.length=0,this.disposed=!0}},rI(e,[{key:"isDisposed",get:function(){return this.disposed}},{key:"viewport",get:function(){return this.getViewport()}}]),e}(),aZ=function(e){function i(t){var i;return(i=e.call(this,t)||this).useRenderTarget=!1,i.priority=1e3,i.name="DrawObjectPass",i}iB(i,e);var r=i.prototype;return r.setup=function(t){this.useRenderTarget=t},r.configure=function(e){this.useRenderTarget&&(this.framebuffer=e.getTemporaryRT("DrawObjectPass",e.getWidth(),e.getHeight(),16,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),e.setFramebuffer(this.framebuffer))},r.execute=function(e){this.useRenderTarget&&e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear}),this.meshes.sort(function(t,e){return t.priority-e.priority}),e.renderMeshes(this.meshes)},r.onCameraCleanup=function(t){this.useRenderTarget&&this.framebuffer&&t.releaseTemporaryRT(this.framebuffer)},i}(aY),aq=((eA={})[rV.FLOAT]=Float32Array.BYTES_PER_ELEMENT,eA[rV.INT]=Int32Array.BYTES_PER_ELEMENT,eA[rV.SHORT]=Int16Array.BYTES_PER_ELEMENT,eA[rV.BYTE]=Int8Array.BYTES_PER_ELEMENT,eA),aK=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="",e.subMeshes=[],e}iB(e,t);var i=e.prototype;return i.initialize=function(){},i.flush=function(){},e}(iQ);function aQ(t){return t===rV.INT?new Int32Array(0):t===rV.SHORT?new Int16Array(0):new Float32Array(0)}var aJ=1,a$=function(e){function i(t,i){var r;if((r=e.call(this,t)||this).destroyed=!1,r.visible=!0,i){var n=i.material,a=i.geometry,o=i.name,s=i.priority,u=i.worldMatrix,h=void 0===u?nu.fromIdentity():u;r.id="Mesh"+aJ++,r.name=void 0===o?"<unnamed>":o,r.geometry=a,r.material=n,r.priority=void 0===s?0:s,r.worldMatrix=h}else r.id="Mesh"+aJ++,r.name="<unnamed>",r.worldMatrix=nu.fromIdentity(),r._priority=0;return r}iB(i,e);var r=i.prototype;return r.setVisible=function(t){this.visible=t},r.getVisible=function(){return this.visible},r.render=function(t){!this.isDestroyed&&this.getVisible()&&t.drawGeometry(this.geometry,this.worldMatrix,this.material)},r.firstGeometry=function(){return this.geometry},r.setMaterial=function(e,i){i!==t.DestroyOptions.keep&&this.material.dispose(),this.material=e},r.restore=function(){},r.dispose=function(i){this.destroyed||((null==i?void 0:i.geometries)!==t.DestroyOptions.keep&&this.geometry.dispose(),(null==i?void 0:i.material)!==t.DestroyOptions.keep&&this.material.dispose(),this.destroyed=!0,void 0!==this.engine&&this.engine.removeMesh(this),e.prototype.dispose.call(this))},rI(i,[{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(n_),a0="precision highp float;attribute vec2 aUV;attribute vec3 aPos;varying vec2 vTexCoord;varying vec3 vParams;varying vec4 vColor;uniform vec2 _Size;uniform vec3 _Scale;uniform vec4 _Color;uniform vec4 _TexParams;uniform vec4 _TexOffset;uniform mat4 effects_MatrixVP;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;void main(){vec4 texParams=_TexParams;vTexCoord=vec2(aUV.xy*_TexOffset.zw+_TexOffset.xy);vColor=_Color;vParams=vec3(texParams.w,texParams.y,texParams.x);if(texParams.z==1.0){vec4 pos=vec4(aPos.xy*_Size,aPos.z,1.0);gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}else{mat4 view=effects_MatrixV;vec3 camRight=vec3(view[0][0],view[1][0],view[2][0]);vec3 camUp=vec3(view[0][1],view[1][1],view[2][1]);vec3 worldPosition=vec3(effects_ObjectToWorld*vec4(0.0,0.0,0.0,1.0));vec3 vertexPosition=worldPosition+camRight*aPos.x*_Size.x*_Scale.x+camUp*aPos.y*_Size.y*_Scale.y;gl_Position=effects_MatrixVP*vec4(vertexPosition,1.0);}}",a1="precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D _MainTex;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);\n#ifdef TRANSPARENT_VIDEO\nfloat halfX=vTexCoord.x*0.5;vec2 uv_rgb=vec2(halfX,vTexCoord.y);vec2 uv_alpha=vec2(halfX+0.5,vTexCoord.y);vec3 rgb=texture2D(_MainTex,uv_rgb).rgb;float alpha=max(texture2D(_MainTex,uv_alpha).r,1e-5);vec4 texColor=vec4(rgb/alpha,alpha);\n#else\nvec4 texColor=texture2D(_MainTex,vTexCoord.xy);\n#endif\ncolor=blendColor(texColor,vColor,floor(0.5+vParams.y));\n#ifdef ALPHA_CLIP\nif(color.a<0.04){discard;}\n#endif\ncolor.a=clamp(color.a,0.0,1.0);gl_FragColor=color;}",a2="#version 100\nprecision mediump float;\n#define PATICLE_SHADER 1\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;uniform vec3 emissionColor;uniform float emissionIntensity;uniform sampler2D uMaskTex;uniform vec4 uColorParams;uniform vec2 uTexOffset;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\n#ifdef USE_SPRITE\nvarying vec4 vTexCoordBlend;\n#endif\nvarying float vSeed;\n#ifdef PREVIEW_BORDER\nuniform vec4 uPreviewColor;\n#endif\n#ifdef USE_SPRITE\nvec4 getTextureColor(sampler2D tex,vec2 texCoord){if(vTexCoordBlend.w>0.){return mix(texture2D(tex,texCoord),texture2D(tex,vTexCoordBlend.xy+texCoord),vTexCoordBlend.z);}return texture2D(tex,texCoord);}\n#else\n#define getTextureColor texture2D\n#endif\n#ifndef WEBGL2\n#define round(a) floor(0.5+a)\n#endif\nvec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}\n#ifdef PREVIEW_BORDER\nvoid main(){gl_FragColor=uPreviewColor;}\n#else\nvoid main(){vec4 color=vec4(1.0);vec4 tempColor=vColor;vec2 texOffset=uTexOffset;if(vLife<0.){discard;}if(uColorParams.x>0.0){color=getTextureColor(uMaskTex,vTexCoord);}\n#ifdef COLOR_OVER_LIFETIME\n#ifndef ENABLE_VERTEX_TEXTURE\ntempColor*=texture2D(uColorOverLifetime,vec2(vLife,0.));\n#endif\n#endif\ncolor=blendColor(color,tempColor,round(uColorParams.y));if(color.a<=0.01&&uColorParams.w>0.){float _at=texture2D(uMaskTex,vTexCoord+texOffset).a+texture2D(uMaskTex,vTexCoord+texOffset*-1.).a;if(_at<=0.02){discard;}}vec3 emission=emissionColor*pow(2.0,emissionIntensity);color=vec4(pow(pow(color.rgb,vec3(2.2))+emission,vec3(1.0/2.2)),color.a);gl_FragColor=color;}\n#endif\n",a3="#version 100\nprecision mediump float;\n#define SHADER_VERTEX 1\n#define PATICLE_SHADER 1\n#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4){float movement=0.0;float h=(t-p1.x)*0.05;for(int i=0;i<=20;i++){float t=float(i)*h;float nt=binarySearchT(t,p1.x,p2.x,p3.x,p4.x);float y=cubicBezier(nt,p1.y,p2.y,p3.y,p4.y);float weight=(i==0||i==20)? 1.0 :(mod(float(i),2.)!=0.)? 4.0 : 2.0;movement+=weight*y;}movement*=h/3.;return movement;}float integrateFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i+=2){vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return ret;}vec2 p1=vec2(k0.x,k0.y);vec2 p2=vec2(k0.z,k0.w);vec2 p3=vec2(k1.z,k1.w);vec2 p4=vec2(k1.x,k1.y);if(time>=k1.x){ret+=calculateMovement(k1.x,p1,p2,p3,p4);}if(time>=k0.x&&time<k1.x){return ret+calculateMovement(time,p1,p2,p3,p4);}}return ret;}float integrateByTimeLineSeg(float t,vec2 p0,vec2 p1){float t0=p0.x;float t1=p1.x;float y0=p0.y;float y1=p1.y;vec4 tSqr=vec4(t,t,t0,t0);tSqr=tSqr*tSqr;vec4 a=vec4(2.*t,3.,-t0,3.)*tSqr;float t1y0=t1*y0;vec4 b=vec4(y0-y1,t0*y1-t1y0,2.*y0+y1,t1y0);float r=dot(a,b);return r/(t0-t1)*0.16666667;}float integrateLineSeg(float time,vec2 p0,vec2 p1){float h=time-p0.x;float y0=p0.y;return(y0+y0+(p1.y-y0)*h/(p1.x-p0.x))*h/2.;}float integrateFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateLineSeg(time,k0,k1);}ret+=integrateLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateLineSeg(time,k1,k2);}ret+=integrateLineSeg(k2.x,k1,k2);}return ret;}float integrateByTimeFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateByTimeLineSeg(time,k0,k1);}ret+=integrateByTimeLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateByTimeLineSeg(time,k1,k2);}ret+=integrateByTimeLineSeg(k2.x,k1,k2);}return ret;}float getIntegrateFromTime0(float t1,vec4 value){float type=value.x;if(type==0.){return value.y*t1;}if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateLineSeg(t1,p0,p1);}if(type==3.){return integrateFromLineSeg(t1,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*t1;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w);}return 0.;}float getIntegrateByTimeFromTime(float t0,float t1,vec4 value){float type=value.x;if(type==0.){return value.y*(t1*t1-t0*t0)/2.;}else if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateByTimeLineSeg(t1,p0,p1)-integrateByTimeLineSeg(t0,p0,p1);}if(type==3.){return integrateByTimeFromLineSeg(t1,value.y,value.z)-integrateByTimeFromLineSeg(t0,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*(t1*t1-t0*t0)/2.;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w)-integrateFromBezierCurveFrames(t0,value.z,value.w);}return 0.;}const float d2r=3.141592653589793/180.;attribute vec3 aPos;attribute vec4 aOffset;attribute vec4 aColor;attribute vec3 aDirX;attribute vec3 aDirY;attribute vec3 aTranslation;attribute vec3 aRotation0;attribute vec3 aRotation1;attribute vec3 aRotation2;attribute vec3 aLinearMove;\n#ifdef USE_SPRITE\nattribute vec3 aSprite;uniform vec4 uSprite;struct UVDetail{vec2 uv0;vec3 uv1;};UVDetail getSpriteUV(vec2 uv,float lifeTime);varying vec4 vTexCoordBlend;\n#endif\n#ifdef FINAL_TARGET\nuniform vec3 uFinalTarget;uniform vec4 uForceCurve;\n#endif\nuniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;uniform mat4 effects_MatrixVP;uniform vec4 uParams;uniform vec4 uOpacityOverLifetimeValue;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\nuniform vec4 uOrbXByLifetimeValue;uniform vec4 uOrbYByLifetimeValue;uniform vec4 uOrbZByLifetimeValue;uniform vec3 uOrbCenter;uniform vec4 uSizeByLifetimeValue;\n#ifdef SIZE_Y_BY_LIFE\nuniform vec4 uSizeYByLifetimeValue;\n#endif\nvarying float vLife;varying vec4 vColor;varying vec2 vTexCoord;vec3 calOrbitalMov(float _life,float _dur){vec3 orb=vec3(0.0);\n#ifdef AS_ORBITAL_MOVEMENT\n#define FUNC(a) getValueFromTime(_life,a)\n#else\n#define FUNC(a) getIntegrateFromTime0(_life,a) * _dur\n#endif\n#if ORB_VEL_X\norb.x=FUNC(uOrbXByLifetimeValue);\n#endif\n#if ORB_VEL_Y\norb.y=FUNC(uOrbYByLifetimeValue);\n#endif\n#if ORB_VEL_Z\norb.z=FUNC(uOrbZByLifetimeValue);\n#endif\n#undef FUNC\nreturn orb;}mat3 mat3FromRotation(vec3 rotation){vec3 sinR=sin(rotation*d2r);vec3 cosR=cos(rotation*d2r);return mat3(cosR.z,-sinR.z,0.,sinR.z,cosR.z,0.,0.,0.,1.)*mat3(cosR.y,0.,sinR.y,0.,1.,0.,-sinR.y,0,cosR.y)*mat3(1.,0.,0.,0,cosR.x,-sinR.x,0.,sinR.x,cosR.x);}\n#ifdef USE_SPRITE\nUVDetail getSpriteUV(vec2 uv,float lifeTime){float t=fract(clamp((lifeTime-aSprite.x)/aSprite.y,0.0,1.)*aSprite.z);float frame=uSprite.z*t;float frameIndex=max(ceil(frame)-1.,0.);float row=floor((frameIndex+0.1)/uSprite.x);float col=frameIndex-row*uSprite.x;vec2 retUV=(vec2(col,row)+uv)/uSprite.xy;UVDetail ret;if(uSprite.w>0.){float blend=frame-frameIndex;float frameIndex1=min(ceil(frame),uSprite.z-1.);float row1=floor((frameIndex1+0.1)/uSprite.x);float col1=frameIndex1-row1*uSprite.x;vec2 coord=(vec2(col1,row1)+uv)/uSprite.xy-retUV;ret.uv1=vec3(coord.x,1.-coord.y,blend);}ret.uv0=vec2(retUV.x,1.-retUV.y);return ret;}\n#endif\nvoid main(){float time=uParams.x-aOffset.z;float dur=aOffset.w;if(time<0.||time>dur){gl_Position=vec4(-3.,-3.,-3.,1.);}else{float life=clamp(time/dur,0.0,1.0);vLife=life;\n#ifdef USE_SPRITE\nUVDetail uvD=getSpriteUV(aOffset.xy,time);vTexCoord=uvD.uv0;vTexCoordBlend=vec4(uvD.uv1,uSprite.w);\n#else\nvTexCoord=aOffset.xy;\n#endif\nvColor=aColor;\n#ifdef COLOR_OVER_LIFETIME\n#ifdef ENABLE_VERTEX_TEXTURE\nvColor*=texture2D(uColorOverLifetime,vec2(life,0.));\n#endif\n#endif\nvColor.a*=clamp(getValueFromTime(life,uOpacityOverLifetimeValue),0.,1.);vec3 size=vec3(vec2(getValueFromTime(life,uSizeByLifetimeValue)),1.0);\n#ifdef SIZE_Y_BY_LIFE\nsize.y=getValueFromTime(life,uSizeYByLifetimeValue);\n#endif\nmat3 aRotation=mat3(aRotation0,aRotation1,aRotation2);vec3 point=aRotation*(aDirX*size.x+aDirY*size.y);vec3 _pos=aPos+aTranslation;\n#if ORB_VEL_X + ORB_VEL_Y + ORB_VEL_Z\n_pos=mat3FromRotation(calOrbitalMov(life,dur))*(_pos-uOrbCenter);_pos+=uOrbCenter;\n#endif\n_pos.xyz+=aLinearMove;\n#ifdef FINAL_TARGET\nfloat force=getValueFromTime(life,uForceCurve);vec4 pos=vec4(mix(_pos,uFinalTarget,force),1.);\n#else\nvec4 pos=vec4(_pos,1.0);\n#endif\n#if RENDER_MODE == 1\npos.xyz+=point;pos=effects_ObjectToWorld*pos;\n#elif RENDER_MODE == 3\npos=effects_ObjectToWorld*pos;pos.xyz+=effects_MatrixV[0].xyz*point.x+effects_MatrixV[2].xyz*point.y;\n#elif RENDER_MODE == 2\npos=effects_ObjectToWorld*pos;pos.xy+=point.xy;\n#elif RENDER_MODE == 0\npos=effects_ObjectToWorld*pos;pos.xyz+=effects_MatrixV[0].xyz*point.x+effects_MatrixV[1].xyz*point.y;\n#endif\ngl_Position=effects_MatrixVP*pos;vSeed=aSeed;gl_PointSize=6.0;}}",a4="#version 100\nprecision mediump float;\n#define SHADER_VERTEX 1\n#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}attribute vec4 aPos;attribute vec3 aDir;attribute vec3 aInfo;attribute vec4 aColor;attribute float aTime;\n#ifdef ATTR_TRAIL_START\nattribute float aTrailStart;\n#else\nuniform float uTrailStart[64];attribute float aTrailStartIndex;\n#endif\nuniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixVP;uniform vec4 uTextureMap;uniform float uTime;uniform vec4 uParams;uniform vec4 uColorParams;uniform vec4 uOpacityOverLifetimeValue;uniform vec4 uWidthOverTrail;\n#ifdef COLOR_OVER_TRAIL\nuniform sampler2D uColorOverTrail;\n#endif\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;void main(){vec4 _pa=effects_MatrixVP*vec4(aPos.xyz,1.);vec4 _pb=effects_MatrixVP*vec4(aPos.xyz+aDir,1.);vec2 dir=normalize(_pb.xy/_pb.w-_pa.xy/_pa.w);vec2 screen_xy=vec2(-dir.y,dir.x);vec4 pos=effects_ObjectToWorld*vec4(aPos.xyz,1.);\n#ifdef ATTR_TRAIL_START\nfloat ts=aTrailStart;\n#else\nfloat ts=uTrailStart[int(aTrailStartIndex)];\n#endif\nfloat trail=(ts-aInfo.y)/uParams.y;float width=aPos.w*getValueFromTime(trail,uWidthOverTrail)/max(abs(screen_xy.x),abs(screen_xy.y));pos.xyz+=(effects_MatrixInvV[0].xyz*screen_xy.x+effects_MatrixInvV[1].xyz*screen_xy.y)*width;float time=min((uTime-aTime)/aInfo.x,1.0);gl_Position=effects_MatrixVP*pos;vColor=aColor;\n#ifdef COLOR_OVER_LIFETIME\n#ifdef ENABLE_VERTEX_TEXTURE\nvColor*=texture2D(uColorOverLifetime,vec2(time,0.));\n#endif\n#endif\n#ifdef COLOR_OVER_TRAIL\nvColor*=texture2D(uColorOverTrail,vec2(trail,0.));\n#endif\nvColor.a*=clamp(getValueFromTime(time,uOpacityOverLifetimeValue),0.,1.);vLife=time;vTexCoord=uTextureMap.xy+vec2(trail,aInfo.z)*uTextureMap.zw;vSeed=aSeed;}",a5="precision highp float;attribute vec2 aPos;varying vec2 uv;void main(){gl_Position=vec4(aPos,0.,1.0);uv=(aPos+vec2(1.0))/2.;}",a6="precision highp float;\n#define HALF_MAX 60000.0\n#define ACEScc_MIDGRAY 0.4135884\nvarying vec2 uv;uniform sampler2D _GaussianTex;uniform sampler2D _SceneTex;uniform float _BloomIntensity;uniform float _Brightness;uniform float _Saturation;uniform float _Contrast;uniform bool _UseBloom;uniform bool _UseToneMapping;uniform vec3 _VignetteColor;uniform vec2 _VignetteCenter;uniform float _VignetteIntensity;uniform float _VignetteSmoothness;uniform float _VignetteRoundness;mat3 LinearToACES=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);mat3 ACESToLinear=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);float log10(float x){return log(x)/log(10.0);}vec3 log10(vec3 v){return vec3(log10(v.x),log10(v.y),log10(v.z));}vec3 LinearToLogC(vec3 x){return 0.244161*log10(5.555556*x+0.047996)+0.386036;}vec3 LogCToLinear(vec3 x){return(pow(vec3(10.0),(x-0.386036)/0.244161)-0.047996)/5.555556;}vec3 rrt_and_odt_fit(vec3 col){vec3 a=col*(col+0.0245786)-0.000090537;vec3 b=col*(0.983729*col+0.4329510)+0.238081;return a/b;}vec3 ACESToneMapping(vec3 col){vec3 aces=LinearToACES*col;aces=rrt_and_odt_fit(aces);col=ACESToLinear*aces;return col;}vec3 LinearToSrgb(vec3 c){return mix(1.055*pow(c,vec3(1./2.4))-0.055,12.92*c,step(c,vec3(0.0031308)));}vec3 GammaCorrection(vec3 c){return pow(c,vec3(1.0/2.2));}vec3 ApplyVignette(vec3 inputColor,vec2 uv,vec2 center,float intensity,float roundness,float smoothness,vec3 color){vec2 dist=abs(uv-center)*intensity;dist.x*=roundness;float vfactor=pow(clamp((1.0-dot(dist,dist)),0.0,1.0),smoothness);return inputColor*mix(color,vec3(1.0),vfactor);}void main(){vec4 hdrColor=texture2D(_SceneTex,uv);hdrColor.rgb=pow(hdrColor.rgb,vec3(2.2));vec3 finalColor=hdrColor.rgb;if(_UseBloom){vec4 bloomColor=texture2D(_GaussianTex,uv);bloomColor.rgb*=_BloomIntensity;finalColor+=bloomColor.rgb;}if(_VignetteIntensity>0.0){finalColor=ApplyVignette(finalColor,uv,_VignetteCenter,_VignetteIntensity,_VignetteRoundness,_VignetteSmoothness,_VignetteColor);}finalColor=finalColor*_Brightness;vec3 colorLog=LinearToLogC(finalColor);colorLog=(colorLog-ACEScc_MIDGRAY)*_Contrast+ACEScc_MIDGRAY;finalColor=LogCToLinear(colorLog);finalColor=max(finalColor,0.0);float luminance=0.2125*finalColor.r+0.7154*finalColor.g+0.0721*finalColor.b;vec3 luminanceColor=vec3(luminance,luminance,luminance);finalColor=(finalColor-luminanceColor)*_Saturation+luminanceColor;finalColor=max(finalColor,0.0);if(_UseToneMapping){finalColor=max(vec3(0.0),ACESToneMapping(finalColor));}float alpha=min(hdrColor.a,1.0);gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),alpha);}",a8="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;vec3 GaussH(sampler2D tex,vec2 uv){vec3 color=vec3(0.0);float offsets[9];offsets[0]=-4.0;offsets[1]=-3.0;offsets[2]=-2.0;offsets[3]=-1.0;offsets[4]=0.0;offsets[5]=1.0;offsets[6]=2.0;offsets[7]=3.0;offsets[8]=4.0;float weights[9];weights[0]=0.01621622;weights[1]=0.05405405;weights[2]=0.12162162;weights[3]=0.19459459;weights[4]=0.22702703;weights[5]=0.19459459;weights[6]=0.12162162;weights[7]=0.05405405;weights[8]=0.01621622;for(int i=0;i<9;i++){vec2 offset=vec2(offsets[i]*2.0*(1.0/_TextureSize.x),0);color+=texture2D(tex,uv+offset).rgb*weights[i];}return color;}void main(){vec3 color=GaussH(_MainTex,uv);gl_FragColor=vec4(color,1.0);}",a9="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;vec3 GaussV(sampler2D tex,vec2 uv){vec3 color=vec3(0.0);float offsets[5];offsets[0]=-3.23076923;offsets[1]=-1.38461538;offsets[2]=0.0;offsets[3]=1.38461538;offsets[4]=3.23076923;float weights[5];weights[0]=0.07027027;weights[1]=0.31621622;weights[2]=0.22702703;weights[3]=0.31621622;weights[4]=0.07027027;for(int i=0;i<5;i++){vec2 offset=vec2(0,offsets[i]*(1.0/_TextureSize.y));color+=texture2D(tex,uv+offset).rgb*weights[i];}return color;}void main(){vec3 color=GaussV(_MainTex,uv);gl_FragColor=vec4(color,1.0);}",a7="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform sampler2D _GaussianDownTex;uniform vec2 _GaussianDownTextureSize;float GaussWeight2D(float x,float y,float sigma){float PI=3.14159265358;float E=2.71828182846;float sigma_2=pow(sigma,2.0);float a=-(x*x+y*y)/(2.0*sigma_2);return pow(E,a)/(2.0*PI*sigma_2);}vec3 GaussNxN(sampler2D tex,vec2 uv,vec2 stride,float sigma){vec3 color=vec3(0.,0.,0.);const int r=1;float weight=0.0;for(int i=-r;i<=r;i++){for(int j=-r;j<=r;j++){float w=GaussWeight2D(float(i),float(j),sigma);vec2 coord=uv+vec2(i,j)*stride;color+=texture2D(tex,coord).rgb*w;weight+=w;}}color/=weight;return color;}void main(){vec3 lowResColor=GaussNxN(_MainTex,uv,0.5/_GaussianDownTextureSize,1.0);vec3 highResColor=GaussNxN(_GaussianDownTex,uv,1.0/_GaussianDownTextureSize,1.0);vec3 color=mix(highResColor,lowResColor,0.7);gl_FragColor=vec4(color,1.0);}",ot="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform float _Threshold;void main(){vec4 mainTex=texture2D(_MainTex,uv);mainTex.rgb=pow(mainTex.rgb,vec3(2.2));float brightness=max(mainTex.r,max(mainTex.g,mainTex.b));float w=max(0.0,brightness-_Threshold)/max(brightness,0.00001);mainTex.rgb*=w;mainTex.rgb*=mainTex.a;gl_FragColor=vec4(mainTex.rgb,1.0);}",oe={},oi=function(){function e(){}return e.registerInclude=function(t,e){oe[t]&&ix.warn('The "'+t+'" shader include already exist.'),oe[t]=e},e.unRegisterInclude=function(t){delete oe[t]},e.unRegisterAllIncludes=function(){Object.keys(oe).forEach(function(t){e.unRegisterInclude(t)})},e.genFinalShaderCode=function(i){var r=i.level,n=i.shaderType,a=i.shader,o=i.macros,s=i.removeVersion,u=e.genMacroString(r,o),h=e.genShaderVersion(r),l=e.parseIncludes(a),c=e.isVersion300(l);return(l=e.removeWebGLVersion(l),2!==r||c||(l=e.convertTo300(l,n===t.ShaderType.fragment)),s)?u+l:h+u+l},e.convertTo300=function(t,i){if(t=(t=(t=t.replace(/\bvarying\b/g,i?"in":"out")).replace(/\btexture(2D|Cube)\b/g,"texture")).replace(/#extension.+(GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,""),i){if(t=(t=(t=t.replace(/\btexture(2D|Cube)LodEXT\b/g,"textureLod")).replace(/\btexture(2D|Cube)GradEXT\b/g,"textureGrad")).replace(/\bgl_FragDepthEXT\b/g,"gl_FragDepth"),!e.has300Output(t)){if(/\bgl_FragData\[.+?\]/g.test(t)){var r=(t=t.replace(/\bgl_FragColor\b/g,"gl_FragData[0]")).match(/\bgl_FragData\[.+?\]/g);r&&(t=e.replaceMRTShader(t,r))}else t=(t=t.replace(/void\s+?main\s*\(/g,"out vec4 glFragColor;\nvoid main(")).replace(/\bgl_FragColor\b/g,"glFragColor")}}else t=t.replace(/\battribute\b/g,"in");return t},e.parseIncludes=function(t,e){for(void 0===e&&(e=/#include <(.+)>/gm);null!==(i=e.exec(t));){var i,r=i[1],n=oe[r];if(void 0===n)throw Error("Can't find include shader name "+r);t=t.replace(i[0],n)}return t},e.genMacroString=function(t,e,i){void 0===i&&(i=!0);var r=[],n="WEBGL"+t;return(r.push("#ifndef "+n),r.push("#define "+n),r.push("#endif"),i&&r.push("#define GE_RUNTIME"),e&&e.length&&e.forEach(function(t){var e=t[0],i=t[1];!0===i?r.push("#define "+e):Number.isFinite(i)&&r.push("#define "+e+" "+i)}),r.length)?r.join("\n")+"\n":""},e.genShaderVersion=function(t){return 1===t?"#version 100\n":"#version 300 es\n"},e.isVersion300=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return(e?e[0]:"").includes("300")},e.removeWebGLVersion=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return e?t.replace(e[0],""):t},e.has300Output=function(t){return/\bout\s+(?:\w+\s+)?(?:vec4)\s+(?:\w+)\s*;/.test(t)},e.replaceMRTShader=function(t,e){for(var i=new Set,r="",n=0;n<e.length;n++){var a=e[n].match(/\bgl_FragData\[(.+?)\]/);a&&i.add(a[1])}return i.forEach(function(t){r+="layout(location="+t+") out vec4 fragOutColor"+t+";\n"}),r+="void main(",t=(t=t.replace(/\bgl_FragData\[(.+?)\]/g,"fragOutColor$1")).replace(/void\s+?main\s*\(/g,r)},e}(),or=function(e){function i(i,r){void 0===r&&(r=4),(n=e.call(this,i)||this).tempRTs=[],n.iterationCount=r;var n,a=n.renderer.engine;return n.thresholdMaterial=ng.create(a,{shader:{vertex:a5,fragment:ot,glslVersion:t.GLSLVersion.GLSL1}}),n.thresholdMaterial.blending=!1,n.thresholdMaterial.depthTest=!1,n.thresholdMaterial.culling=!1,n.downSampleHMaterial=ng.create(a,{shader:{vertex:a5,fragment:a8,glslVersion:t.GLSLVersion.GLSL1}}),n.downSampleHMaterial.blending=!1,n.downSampleHMaterial.depthTest=!1,n.downSampleHMaterial.culling=!1,n.downSampleVMaterial=ng.create(a,{shader:{vertex:a5,fragment:a9,glslVersion:t.GLSLVersion.GLSL1}}),n.downSampleVMaterial.blending=!1,n.downSampleVMaterial.depthTest=!1,n.downSampleVMaterial.culling=!1,n.upSampleMaterial=ng.create(a,{shader:{vertex:a5,fragment:a7,glslVersion:t.GLSLVersion.GLSL1}}),n.upSampleMaterial.blending=!1,n.upSampleMaterial.depthTest=!1,n.upSampleMaterial.culling=!1,n.priority=5e3,n.name="BloomPass",n}iB(i,e);var r=i.prototype;return r.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture=this.mainTexture},r.execute=function(e){var i,r,n,a=e.getWidth(),o=e.getHeight(),s=null!=(n=null==(r=e.renderingData.currentFrame.globalVolume)?void 0:null==(i=r.bloom)?void 0:i.threshold)?n:1;this.thresholdRT=e.getTemporaryRT("_BloomThreshold",a,o,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),this.thresholdMaterial.setFloat("_Threshold",s),e.blit(this.mainTexture,this.thresholdRT,this.thresholdMaterial);for(var u=this.thresholdRT.getColorTextures()[0],h=0;h<this.iterationCount;h++){var l=Math.floor(a/Math.pow(2,h+1)),c=Math.floor(o/Math.pow(2,h+1)),f=e.getTemporaryRT("_BloomDownH"+h,l,c,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf);this.downSampleHMaterial.setVector2("_TextureSize",os(u)),e.blit(u,f,this.downSampleHMaterial);var d=e.getTemporaryRT("_BloomDownV"+h,l,c,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf);this.downSampleVMaterial.setVector2("_TextureSize",os(f.getColorTextures()[0])),e.blit(f.getColorTextures()[0],d,this.downSampleVMaterial),e.releaseTemporaryRT(f),this.tempRTs.push(d),u=d.getColorTextures()[0]}e.releaseTemporaryRT(this.thresholdRT);for(var p=this.iterationCount-1;p>0;p--){var m=Math.floor(a/Math.pow(2,p-1)),v=Math.floor(o/Math.pow(2,p-1)),y=e.getTemporaryRT("_BloomUp"+p,m,v,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),g=this.tempRTs[p-1].getColorTextures()[0];this.upSampleMaterial.setTexture("_GaussianDownTex",g),this.upSampleMaterial.setVector2("_GaussianDownTextureSize",os(g)),e.blit(u,y,this.upSampleMaterial),u=y.getColorTextures()[0],this.tempRTs.push(y)}e.setFramebuffer(this.tempRTs[this.tempRTs.length-1])},r.onCameraCleanup=function(t){for(var e=0;e<this.tempRTs.length;e++)t.releaseTemporaryRT(this.tempRTs[e]);this.tempRTs=[]},r.dispose=function(t){this.thresholdMaterial.dispose(),this.downSampleHMaterial.dispose(),this.downSampleVMaterial.dispose(),this.upSampleMaterial.dispose(),e.prototype.dispose.call(this,t)},i}(aY),on=function(e){function i(i,r){n=e.call(this,i)||this;var n,a="PostProcess",o=n.renderer.engine;n.sceneTextureHandle=r||new aX(o);var s=aK.create(o,{name:a,mode:rV.TRIANGLE_STRIP,attributes:{aPos:{type:rV.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4}),u=ng.create(o,{name:a,shader:{vertex:a5,fragment:a6,glslVersion:t.GLSLVersion.GLSL1}});return u.blending=!1,u.depthTest=!1,u.culling=!1,n.screenMesh=a$.create(o,{name:a,geometry:s,material:u,priority:0}),n.priority=5e3,n.name="ToneMappingPass",n}iB(i,e);var r=i.prototype;return r.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture||(this.sceneTextureHandle.texture=this.mainTexture),t.setFramebuffer(null)},r.execute=function(e){e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear});var i=e.renderingData.currentFrame.globalVolume,r=i7({threshold:0,intensity:0,active:!1},null==i?void 0:i.bloom),n=i7({intensity:0,smoothness:0,roundness:0,active:!1},null==i?void 0:i.vignette),a=i7({brightness:0,saturation:0,contrast:0,active:!1},null==i?void 0:i.colorAdjustments),o=i7({active:!1},null==i?void 0:i.tonemapping);this.screenMesh.material.setTexture("_SceneTex",this.sceneTextureHandle.texture),this.screenMesh.material.setFloat("_Brightness",Math.pow(2,a.brightness)),this.screenMesh.material.setFloat("_Saturation",.01*a.saturation+1),this.screenMesh.material.setFloat("_Contrast",.01*a.contrast+1),this.screenMesh.material.setInt("_UseBloom",Number(r.active)),r.active&&(this.screenMesh.material.setTexture("_GaussianTex",this.mainTexture),this.screenMesh.material.setFloat("_BloomIntensity",r.intensity)),n.intensity>0&&(this.screenMesh.material.setFloat("_VignetteIntensity",n.intensity),this.screenMesh.material.setFloat("_VignetteSmoothness",n.smoothness),this.screenMesh.material.setFloat("_VignetteRoundness",n.roundness),this.screenMesh.material.setVector2("_VignetteCenter",new e2(.5,.5)),this.screenMesh.material.setVector3("_VignetteColor",new e3(0,0,0))),this.screenMesh.material.setInt("_UseToneMapping",Number(o.active)),e.renderMeshes([this.screenMesh])},i}(aY),oa=1,oo=function(){function e(t){this.disposed=!1,this.postProcessingEnabled=!1,this.enableHDR=!0;var e=t.camera,i=t.renderer,r=t.editorTransform,n=t.globalVolume,a=t.postProcessingEnabled,o=void 0!==a&&a,s=i.engine;if(n&&(this.globalVolume=n),this.postProcessingEnabled=o,this.globalUniforms=new ou,this.renderer=i,o&&this.enableHDR&&!this.renderer.engine.gpuCapability.detail.halfFloatTexture)throw Error("Half float texture is not supported.");this.drawObjectPass=new aZ(i);var u=[this.drawObjectPass];if(this.setRenderPasses(u),o){var h=new aX(s),l=new or(i,7);l.sceneTextureHandle=h,this.addRenderPass(l);var c=new on(i,h);this.addRenderPass(c)}this.name="RenderFrame"+oa++,this.camera=e,this.editorTransform=e4.fromArray(void 0===r?[1,1,0,0]:r)}var i=e.prototype;return i.setup=function(){this.drawObjectPass.setup(this.postProcessingEnabled)},i.addMeshToDefaultRenderPass=function(t){this.drawObjectPass.addMesh(t)},i.removeMeshFromDefaultRenderPass=function(t){this.drawObjectPass.removeMesh(t)},i.dispose=function(e){var i=(null==e?void 0:e.passes)?e.passes:void 0;i!==t.DestroyOptions.keep&&this.renderPasses.forEach(function(t){t.dispose(i)}),this.renderPasses.length=0,this.disposed=!0},i.setRenderPasses=function(t){this.renderPasses=t.slice()},i.addRenderPass=function(t){this.renderPasses.push(t)},i.removeRenderPass=function(t){eq(this.renderPasses,t)},rI(e,[{key:"isDisposed",get:function(){return this.disposed}}]),e}();function os(t){return t?new e2(t.getWidth(),t.getHeight()):new e2}var ou=function(){this.floats={},this.ints={},this.vector3s={},this.vector4s={},this.matrices={},this.samplers=[],this.uniforms=[]},oh=function(){function t(t){this.size=[0,0],this.multiSample=1,this.destroyed=!1;var e=t.storageType,i=t.format,r=t.attachment;this.storageType=e,this.format=i,this.attachment=r}return rI(t,[{key:"isDestroyed",get:function(){return this.destroyed}}]),t}(),ol=function(){function e(t){this.engine=t,this.temporaryRTs=[],this.currentFrame=0,this.maxUnusedFrames=4}var i=e.prototype;return i.flush=function(t,e){void 0===t&&(t=!1),void 0===e&&(e=-1),this.currentFrame++;for(var i=e>=0?e:this.maxUnusedFrames,r=0;r<this.temporaryRTs.length;r++){var n=this.temporaryRTs[r];!n.isOccupied&&(t||this.currentFrame-n.lastFrameReleased>i)&&(n.RT.dispose(),this.temporaryRTs.splice(r--,1))}},i.get=function(e,i,r,n,a,o){void 0===n&&(n=0),void 0===a&&(a=t.FilterMode.Linear),void 0===o&&(o=t.RenderTextureFormat.RGBA32);for(var s,u,h,l=i+"_"+r+"_"+n+"_"+a+"_"+o,c=ij(this.temporaryRTs);!(h=c()).done;){var f=h.value;if(!f.isOccupied&&f.descriptionHash===l)return f.isOccupied=!0,f.RT.name=e,f.RT}var d=t.RenderPassAttachmentStorageType.none;a===t.FilterMode.Linear?s=rV.LINEAR:a===t.FilterMode.Nearest&&(s=rV.NEAREST),o===t.RenderTextureFormat.RGBA32?u=rV.UNSIGNED_BYTE:o===t.RenderTextureFormat.RGBAHalf&&(u=rV.HALF_FLOAT),0===n?d=t.RenderPassAttachmentStorageType.none:16===n?d=t.RenderPassAttachmentStorageType.depth_stencil_opaque:24===n&&(d=t.RenderPassAttachmentStorageType.depth_24_stencil_8_texture);var p=r7.create(this.engine,{sourceType:t.TextureSourceType.framebuffer,minFilter:s,magFilter:s,internalFormat:rV.RGBA,format:rV.RGBA,type:u}),m={RT:aj.create({name:e,storeAction:{},viewport:[0,0,i,r],attachments:[p],depthStencilAttachment:{storageType:d}},this.engine.renderer),lastFrameReleased:0,descriptionHash:l,isOccupied:!0};return this.temporaryRTs.push(m),m.RT},i.release=function(t){for(var e,i=ij(this.temporaryRTs);!(e=i()).done;){var r=e.value;if(r.RT===t){r.isOccupied=!1,r.lastFrameReleased=this.currentFrame;break}}},i.dispose=function(){for(var t,e=ij(this.temporaryRTs);!(t=e()).done;)t.value.RT.dispose()},e}(),oc="function"==typeof WebGL2RenderingContext,of=function(){function t(t){this.setupCapability(t)}var e=t.prototype;return e.isCompressedFormatSupported=function(t){return!!this.compressTextureCapabilityList.get(t)},e.setupCapability=function(t){var e,i,r=oc&&eU(t,WebGL2RenderingContext)?2:1,n=2===r,a=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),o=t.getExtension("WEBGL_depth_texture"),s=!!t.getExtension("OES_texture_half_float_linear"),u=!!t.getExtension("OES_texture_float_linear");this.level=r,this.type=n?"webgl2":"webgl",this.vaoExt=t.getExtension("OES_vertex_array_object"),this.glAsyncCompileExt=t.getExtension("KHR_parallel_shader_compile"),this.UNSIGNED_INT_24_8=t.UNSIGNED_INT_24_8,this.drawBufferExtension=t.getExtension("WEBGL_draw_buffers"),o&&(this.UNSIGNED_INT_24_8=o.UNSIGNED_INT_24_8_WEBGL),n&&!s&&(s=od(t,t.HALF_FLOAT)),n&&!u&&(u=od(t,t.FLOAT)),this.internalFormatDepth16=n?t.DEPTH_COMPONENT16:t.DEPTH_COMPONENT,this.internalFormatDepth24_stencil8=n?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL;var h=n||t.getExtension("OES_texture_float")?t.FLOAT:0,l=n?WebGL2RenderingContext.HALF_FLOAT:(null==(i=t.getExtension("OES_texture_half_float"))?void 0:i.HALF_FLOAT_OES)||0;this.compressTextureCapabilityList=new Map([["WEBGL_compressed_texture_astc",!!t.getExtension("WEBGL_compressed_texture_astc")],["WEBKIT_WEBGL_compressed_texture_astc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_astc")],["WEBGL_compressed_texture_etc",!!t.getExtension("WEBGL_compressed_texture_etc")],["WEBKIT_WEBGL_compressed_texture_etc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_etc")],["WEBGL_compressed_texture_etc1",!!t.getExtension("WEBGL_compressed_texture_etc1")],["WEBGL_compressed_texture_pvrtc",!!t.getExtension("WEBGL_compressed_texture_pvrtc")||!!t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")],["WEBKIT_WEBGL_compressed_texture_pvrtc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")],["EXT_sRGB",!!t.getExtension("EXT_sRGB")]]);var c={floatTexture:h,halfFloatTexture:l,maxSample:n?t.getParameter(t.MAX_SAMPLES):1,maxVertexUniforms:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxVertexTextures:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxFragmentUniforms:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxFragmentTextures:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),floatColorAttachment:n?!!t.getExtension("EXT_color_buffer_float"):h>0&&!!t.getExtension("WEBGL_color_buffer_float"),halfFloatColorAttachment:n?!!t.getExtension("EXT_color_buffer_float"):l>0&&!!t.getExtension("EXT_color_buffer_half_float"),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxShaderTexCount:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),halfFloatLinear:s,floatLinear:u,maxTextureAnisotropy:a?t.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,shaderTextureLod:n||!!t.getExtension("EXT_shader_texture_lod"),instanceDraw:n||!!t.getExtension("ANGLE_instanced_arrays"),ktx2Support:!!((e=this.compressTextureCapabilityList).get("WEBGL_compressed_texture_astc")||e.get("WEBKIT_WEBGL_compressed_texture_astc")),drawBuffers:n||!!this.drawBufferExtension,asyncShaderCompile:!!this.glAsyncCompileExt,intIndexElementBuffer:!!t.getExtension("OES_element_index_uint"),standardDerivatives:n||!!t.getExtension("OES_standard_derivatives"),readableDepthStencilTextures:n||!!o,writableFragDepth:n||!!t.getExtension("EXT_frag_depth")};this.detail=c,a&&(this.textureMaxAnisotropyExt=a.TEXTURE_MAX_ANISOTROPY_EXT)},e.framebufferTexture2D=function(t,e,i,r,n){var a=this.drawBufferExtension;if(1===this.level&&!a&&i>0)throw Error("Draw multiple color buffers not available.");var o=a?a["COLOR_ATTACHMENT"+i+"_WEBGL"]:t["COLOR_ATTACHMENT"+i];o?t.framebufferTexture2D(e,o,r,n,0):console.error("Invalid color attachment index: "+i+".")},e.drawBuffers=function(t,e){var i=this.drawBufferExtension;if(1===this.level&&!i){if(!(e.length>1))return;throw Error("Draw buffers not available.")}var r=e.map(function(e,r){return e?i?i["COLOR_ATTACHMENT"+r+"_WEBGL"]:t["COLOR_ATTACHMENT"+r]:t.NONE});i?i.drawBuffersWEBGL(r):t.drawBuffers(r)},e.setTextureAnisotropic=function(t,e,i){var r=this.detail.maxTextureAnisotropy;r&&t.texParameterf(e,this.textureMaxAnisotropyExt,Math.min(r,i||4))},rI(t,[{key:"isWebGL2",get:function(){return 2===this.level}}]),t}();function od(t,e){var i=t.createTexture(),r=!1;return t.getError(),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.R16F,1,1,0,t.RED,e,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.getError()||(r=!0),t.deleteTexture(i),r}t.CompressTextureCapabilityType=void 0,(tw=t.CompressTextureCapabilityType||(t.CompressTextureCapabilityType={})).astc="WEBGL_compressed_texture_astc",tw.astc_webkit="WEBKIT_WEBGL_compressed_texture_astc",tw.etc="WEBGL_compressed_texture_etc",tw.etc_webkit="WEBKIT_WEBGL_compressed_texture_etc",tw.etc1="WEBGL_compressed_texture_etc1",tw.pvrtc="WEBGL_compressed_texture_pvrtc",tw.pvrtc_webkit="WEBKIT_WEBGL_compressed_texture_pvrtc",tw.sRGB="EXT_sRGB";var op=function(){function t(t){this.engine=t,this.currentFramebuffer=null,this.disposed=!1,this.blitGeometry=null,this.blitMaterial=null}var e=t.prototype;return e.setGlobalFloat=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.floats[t]=e},e.setGlobalVector4=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.vector4s[t]=e},e.setGlobalInt=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.ints[t]=e},e.setGlobalMatrix=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.matrices[t]=e},e.setGlobalVector3=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.vector3s[t]=e},e.getFramebuffer=function(){return this.currentFramebuffer},e.setFramebuffer=function(t){t?(this.currentFramebuffer=t,this.currentFramebuffer.bind(),this.setViewport(t.viewport[0],t.viewport[1],t.viewport[2],t.viewport[3])):(this.currentFramebuffer=null,this.engine.bindSystemFramebuffer(),this.setViewport(0,0,this.getWidth(),this.getHeight()))},e.setViewport=function(t,e,i,r){this.engine.viewport(t,e,i,r)},e.clear=function(t){this.engine.clear(t)},e.getWidth=function(){return this.engine.getWidth()},e.getHeight=function(){return this.engine.getHeight()},e.getShaderLibrary=function(){return this.engine.getShaderLibrary()},e.renderRenderFrame=function(t){var e=t.renderPasses;if(this.disposed){console.error("Renderer is destroyed, target: GLRenderer.");return}null==(r=t.renderer.engine.getShaderLibrary())||r.compileAllShaders(),t.setup(),this.setFramebuffer(null);var i=t.camera;this.renderingData.currentFrame=t,this.renderingData.currentCamera=i,this.setGlobalMatrix("effects_MatrixInvV",i.getInverseViewMatrix()),this.setGlobalMatrix("effects_MatrixV",i.getViewMatrix()),this.setGlobalMatrix("effects_MatrixVP",i.getViewProjectionMatrix()),this.setGlobalMatrix("_MatrixP",i.getProjectionMatrix()),this.setGlobalVector3("effects_WorldSpaceCameraPos",i.position),ic(e);for(var r,n,a=ij(e);!(n=a()).done;){var o=n.value;this.renderRenderPass(o)}for(var s,u=ij(e);!(s=u()).done;)s.value.onCameraCleanup(this)},e.renderRenderPass=function(t){this.renderingData.currentPass=t,t.configure(this),t.execute(this)},e.renderMeshes=function(t){for(var e,i=ij(t);!(e=i()).done;)e.value.render(this)},e.drawGeometry=function(t,e,i,r){void 0===r&&(r=0),this.engine.drawGeometry(t,e,i,r)},e.getTemporaryRT=function(t,e,i,r,n,a){return this.engine.renderTargetPool.get(t,e,i,r,n,a)},e.releaseTemporaryRT=function(t){this.engine.renderTargetPool.release(t)},e.blit=function(t,e,i){this.blitGeometry||(this.blitGeometry=aK.create(this.engine,{mode:rV.TRIANGLE_STRIP,attributes:{aPos:{type:rV.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])}},drawCount:4})),this.blitMaterial||(this.blitMaterial=ng.create(this.engine,{shader:{vertex:"\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos, 0.0, 1.0);\n vTex = (aPos + vec2(1.0)) / 2.0;\n}",fragment:"\nprecision mediump float;\nvarying vec2 vTex;\nuniform sampler2D _MainTex;\nvoid main(){\n gl_FragColor = texture2D(_MainTex, vTex);\n}"}}),this.blitMaterial.blending=!1,this.blitMaterial.depthTest=!1,this.blitMaterial.culling=!1);var r=i||this.blitMaterial;r.setTexture("_MainTex",t);var n=this.currentFramebuffer;if(e){var a=e.viewport,o=a[0],s=a[1],u=a[2],h=a[3];this.setFramebuffer(e),this.setViewport(o,s,u,h)}else this.setFramebuffer(null),this.setViewport(0,0,this.getWidth(),this.getHeight());this.drawGeometry(this.blitGeometry,nu.IDENTITY,r),this.setFramebuffer(n)},e.dispose=function(){var t,e;this.disposed||(null==(t=this.blitGeometry)||t.dispose(),this.blitGeometry=null,null==(e=this.blitMaterial)||e.dispose(),this.blitMaterial=null,this.disposed=!0)},e.checkGlobalUniform=function(t){var e=this.renderingData.currentFrame.globalUniforms;e.uniforms.includes(t)||e.uniforms.push(t)},t.create=function(e){return new t(e)},rI(t,[{key:"renderingData",get:function(){return this.engine.renderingData}}]),t}(),om="lookup_texture",ov="offscreen_canvas",oy={},og=new(function(){function t(){this._maxCachedCount=16,this._canvasPool=Object.create(null),this._cachedCanvasAndContexts=[]}var e=t.prototype;return e.dispose=function(){this.clear()},e.clear=function(){for(var t,e=this,i=ij(Object.keys(this._canvasPool));!(t=i()).done;){var r=t.value;this._canvasPool[r].forEach(function(t){var i=t.canvas;return e.destroyCanvas(i)}),delete this._canvasPool[r]}this._cachedCanvasAndContexts.length=0},e.getCanvasAndContext=function(t,e){var i=this.getKey(t,e),r=this._canvasPool[i];if(r&&0!==r.length){var n=r.pop();return im(n),eq(this._cachedCanvasAndContexts,n),0===r.length&&delete this._canvasPool[i],n}return this.createCanvasAndContext(t,e)},e.releaseCanvasAndContext=function(t){var e=t.canvas,i=e.width,r=e.height,n=this.getKey(i,r);this.resetCanvasAndContext(t),this._canvasPool[n]||(this._canvasPool[n]=[]),eZ(this._canvasPool[n],t),eq(this._cachedCanvasAndContexts,t),this._cachedCanvasAndContexts.push(t),this.getCachedCount()>this._maxCachedCount&&this.cleanUnusedCachedCanvasPool()},e.createCanvasAndContext=function(t,e){var i,r=(void 0===t&&(t=1),void 0===e&&(e=1),i=oy[ov]?window._createOffscreenCanvas(10,10):document.createElement("canvas")).getContext("2d",{willReadFrequently:!0});return im(r),i.width=t,i.height=e,{canvas:i,context:r}},e.resetCanvasAndContext=function(t){var e=t.canvas,i=t.context;"resetTransform"in i&&"function"==typeof i.resetTransform?i.resetTransform():i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,e.width,e.height)},e.getKey=function(t,e){return(t<<17)+(e<<1)},e.getCachedCount=function(){return this._cachedCanvasAndContexts.length},e.cleanUnusedCachedCanvasPool=function(){for(var t=Math.max(1,Math.ceil(this._cachedCanvasAndContexts.length/2)),e=0;e<t;e++){var i=this._cachedCanvasAndContexts.shift();im(i);var r=i.canvas,n=r.width,a=r.height,o=this.getKey(n,a),s=this._canvasPool[o];s&&(eq(s,i),0===s.length&&delete this._canvasPool[o]),this.destroyCanvas(i.canvas)}},e.destroyCanvas=function(t){"remove"in t&&"function"==typeof t.remove&&t.remove()},t}()),ox=function(){function e(e,i,r,n,a){this.engine=e,this.scaledFontString=i,this.glyphs=new Map,this.currentX=0,this.currentY=0,this.full=!1,this.dirty=!0,this.canvas=document.createElement("canvas"),this.canvas.width=512,this.canvas.height=512;var o=this.canvas.getContext("2d",{willReadFrequently:!1});if(!o)throw Error("GlyphAtlas: failed to get 2d context");this.ctx=o,o.font=i,o.textBaseline="alphabetic",o.fillStyle="#ffffff",this.paddingPx=8,this.italicScale="italic"===a?2:1,this.baselinePx=this.paddingPx+r,this.cellHPx=Math.ceil(r+n+2*this.paddingPx),this.lineHeight=this.cellHPx/2,this.texture=r7.create(e,{sourceType:t.TextureSourceType.image,image:this.canvas,target:rV.TEXTURE_2D,flipY:!0,magFilter:rV.LINEAR,minFilter:rV.LINEAR,wrapS:rV.CLAMP_TO_EDGE,wrapT:rV.CLAMP_TO_EDGE}),this.texture.initialize()}var i=e.prototype;return i.ensureChar=function(t){var e=this.glyphs.get(t);if(e)return e;if(this.full)return null;var i=this.ctx;i.font=this.scaledFontString;var r=i.measureText(t).width,n=Math.max(1,Math.ceil(r*this.italicScale))+2*this.paddingPx,a=this.cellHPx;if(this.currentX+n>512&&(this.currentX=0,this.currentY+=a),this.currentY+a>512)return this.full=!0,console.warn('GlyphAtlas full, dropping char "'+t+'"'),null;var o=this.currentX,s=this.currentY;i.fillText(t,o+this.paddingPx,s+this.baselinePx),this.currentX+=n,this.dirty=!0;var u={px:o,py:s,pw:n,ph:a,advance:r/2,paddingLeft:this.paddingPx/2};return this.glyphs.set(t,u),u},i.uploadIfDirty=function(){this.dirty&&(this.texture.updateSource({sourceType:t.TextureSourceType.image,image:this.canvas,target:rV.TEXTURE_2D,flipY:!0,magFilter:rV.LINEAR,minFilter:rV.LINEAR,wrapS:rV.CLAMP_TO_EDGE,wrapT:rV.CLAMP_TO_EDGE}),this.dirty=!1)},i.dispose=function(){this.texture.dispose(),this.glyphs.clear()},e}(),ob=function(){function t(t){this.engine=t,this.atlases=new Map}var e=t.prototype;return e.getAtlas=function(t,e,i,r){var n=r+"|"+i+"|"+t+"|"+e,a=this.atlases.get(n);if(a)return a;var o=r+" "+i+" "+2*t+"px "+e,s=og.getCanvasAndContext(1,1),u=s.context,h=.8*t*2,l=.2*t*2;try{u.font=o;var c=u.measureText("|\xc9q\xc5M");h=c.actualBoundingBoxAscent||h,l=c.actualBoundingBoxDescent||l}finally{og.releaseCanvasAndContext(s)}var f=new ox(this.engine,o,h,l,r);return this.atlases.set(n,f),f},e.uploadDirty=function(){for(var t,e=ij(this.atlases.values());!(t=e()).done;)t.value.uploadIfDirty()},e.dispose=function(){for(var t,e=ij(this.atlases.values());!(t=e()).done;)t.value.dispose();this.atlases.clear()},t}(),oT={u0:0,v0:0,u1:1,v1:1},oC=function(){function t(t){this.engine=t,this.lineShape=new az,this.bezierShape=new az,this.triangleShape=new aI,this.rectangleShape=new aR,this.circleShape=new aD,this.buildPoints=[],this.vertices=[],this.colors=[],this.uvs=[],this.indices=[],this.lineStyle={width:1,alignment:.5,cap:eh.Butt,join:el.Miter,miterLimit:10},this.currentBatchType="colored",this.currentBatchTexture=null,this.transformStack=[],this.currentTransform=nl.fromIdentity(),this.geometry=aK.create(this.engine,{attributes:{aPos:{type:rV.FLOAT,size:2,data:new Float32Array([-.5,.5,-.5,-.5,.5,.5,.5,-.5])},aColor:{type:rV.FLOAT,size:4,data:new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1])},aUV:{size:2,offset:0,releasable:!0,type:rV.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])}},indices:{data:new Uint16Array([0,1,2,2,1,3]),releasable:!0},mode:rV.TRIANGLES,drawCount:6}),this.coloredMaterial=ng.create(this.engine,{shader:{vertex:"precision highp float;\n attribute vec2 aPos;\n attribute vec4 aColor;\n varying vec4 vColor;\n\n uniform mat4 effects_MatrixVP;\n void main() {\n vColor = aColor;\n gl_Position = effects_MatrixVP * vec4(aPos, 0.0, 1.0);\n }",fragment:"precision highp float;\n varying vec4 vColor;\n void main() {\n vec4 color = vColor;\n color.rgb *= color.a;\n gl_FragColor = color;\n }"}}),this.coloredMaterial.depthTest=!1,this.coloredMaterial.depthMask=!1,this.coloredMaterial.blending=!0,this.texturedMaterial=ng.create(this.engine,{shader:{vertex:"precision highp float;\n attribute vec2 aPos;\n attribute vec4 aColor;\n attribute vec2 aUV;\n varying vec4 vColor;\n varying vec2 vUV;\n\n uniform mat4 effects_MatrixVP;\n void main() {\n vColor = aColor;\n vUV = aUV;\n gl_Position = effects_MatrixVP * vec4(aPos, 0.0, 1.0);\n }",fragment:"precision highp float;\n varying vec4 vColor;\n varying vec2 vUV;\n uniform sampler2D uMainTexture;\n void main() {\n vec4 color = texture2D(uMainTexture, vUV) * vColor;\n color.rgb *= color.a;\n gl_FragColor = color;\n }"}}),this.texturedMaterial.depthTest=!1,this.texturedMaterial.depthMask=!1,this.texturedMaterial.blending=!0,this.textCache=new ob(t)}var e=t.prototype;return e.begin=function(){this.indices.length=0,this.vertices.length=0,this.colors.length=0,this.uvs.length=0,this.transformStack=[],this.currentTransform=nl.fromIdentity(),this.currentBatchType="colored",this.currentBatchTexture=null;var t=this.engine.canvas.getBoundingClientRect(),e=new nu(2/t.width,0,0,0,0,2/t.height,0,0,0,0,-1,0,-1,-1,0,1);this.coloredMaterial.setMatrix("effects_MatrixVP",e),this.texturedMaterial.setMatrix("effects_MatrixVP",e)},e.pushTransform=function(t){this.transformStack.push(this.currentTransform.clone()),this.currentTransform=this.currentTransform.premultiply(t)},e.popTransform=function(){var t=this.transformStack.pop();if(!t){console.warn("Render2D: 变换栈为空,无法弹出");return}this.currentTransform=t},e.end=function(){this.flushBatch()},e.ensureBatch=function(t,e){void 0===e&&(e=null),!(this.currentBatchType===t&&("textured"!==t||this.currentBatchTexture===e))&&this.currentVertexCount>0&&this.flushBatch(),this.currentBatchType=t,this.currentBatchTexture=e},e.flushBatch=function(){if(0!==this.currentVertexCount&&0!==this.currentIndexCount){this.textCache.uploadDirty();var t=new Float32Array(this.vertices),e=new Float32Array(this.colors),i=new Float32Array(this.uvs),r=new Uint16Array(this.indices);if(this.geometry.setAttributeData("aPos",t),this.geometry.setAttributeData("aColor",e),this.geometry.setAttributeData("aUV",i),this.geometry.setIndexData(r),this.geometry.setDrawCount(this.currentIndexCount),"textured"===this.currentBatchType){n=this.texturedMaterial;var n,a,o=null!=(a=this.currentBatchTexture)?a:this.engine.whiteTexture;n.setTexture("uMainTexture",o)}else n=this.coloredMaterial;this.engine.renderer.drawGeometry(this.geometry,nu.IDENTITY,n),this.indices.length=0,this.vertices.length=0,this.colors.length=0,this.uvs.length=0}},e.drawLines=function(t,e,i){if(void 0===e&&(e=e5.WHITE),void 0===i&&(i=1),!t||t.length<4||t.length%2!=0){console.warn("drawLines: 至少需要2个点(4个数值),且数组长度必须为偶数");return}var r=t.length/2,n=t[0]===t[t.length-2]&&t[1]===t[t.length-1],a=n?r-1:r,o=this.lineShape.points;o.length=0;for(var s=0;s<a;s++)o.push(t[2*s],t[2*s+1]);this.ensureBatch("colored"),this.buildShapeLine(this.lineShape,e,i,n)},e.drawLine=function(t,e,i,r,n,a){void 0===n&&(n=e5.WHITE),void 0===a&&(a=1);var o=this.lineShape.points;o.length=0,o.push(t,e,i,r),this.ensureBatch("colored"),this.buildShapeLine(this.lineShape,n,a,!1)},e.drawBezier=function(t,e,i,r,n,a,o,s,u,h){void 0===u&&(u=e5.WHITE),void 0===h&&(h=1);var l=this.bezierShape.points;l.length=0,l.push(t,e),aO(l,t,e,i,r,n,a,o,s),this.ensureBatch("colored"),this.buildShapeLine(this.bezierShape,u,h,!1)},e.drawTriangle=function(t,e,i,r,n,a,o,s){void 0===o&&(o=e5.WHITE),void 0===s&&(s=1),this.setTriangleShape(t,e,i,r,n,a),this.ensureBatch("colored"),this.buildShapeLine(this.triangleShape,o,s,!0)},e.drawRectangle=function(t,e,i,r,n,a){void 0===n&&(n=e5.WHITE),void 0===a&&(a=1),this.setRectangleShape(t,e,i,r,0),this.ensureBatch("colored"),this.buildShapeLine(this.rectangleShape,n,a,!0)},e.drawCircle=function(t,e,i,r,n){void 0===r&&(r=e5.WHITE),void 0===n&&(n=1),this.setCircleShape(t,e,i),this.ensureBatch("colored"),this.buildShapeLine(this.circleShape,r,n,!0)},e.fillTriangle=function(t,e,i,r,n,a,o){void 0===o&&(o=e5.WHITE),this.setTriangleShape(t,e,i,r,n,a),this.ensureBatch("colored"),this.buildShape(this.triangleShape,o)},e.fillRectangle=function(t,e,i,r,n){void 0===n&&(n=e5.WHITE),this.ensureBatch("colored"),this.pushQuad(t,e,i,r,n)},e.fillCircle=function(t,e,i,r){void 0===r&&(r=e5.WHITE),this.setCircleShape(t,e,i),this.ensureBatch("colored"),this.buildShape(this.circleShape,r)},e.drawTexture=function(t,e,i,r,n,a,o){void 0===a&&(a=oT),void 0===o&&(o=e5.WHITE),this.ensureBatch("textured",n),this.pushQuad(t,e,i,r,o,a)},e.drawText=function(t,e,i,r,n,a,o,s){if(void 0===n&&(n=e5.WHITE),void 0===a&&(a="sans-serif"),void 0===o&&(o="normal"),void 0===s&&(s="normal"),i){var u=this.textCache.getAtlas(r,a,o,s);this.ensureBatch("textured",u.texture);for(var h=u.lineHeight,l=t,c=0;c<i.length;c++){var f=u.ensureChar(i[c]);if(f){var d=f.px/512,p=(f.px+f.pw)/512,m=1-(f.py+f.ph)/512,v=1-f.py/512;this.pushQuad(l-f.paddingLeft,e,f.pw/2,h,n,{u0:d,v0:m,u1:p,v1:v}),l+=f.advance}}}},e.dispose=function(){this.geometry.dispose(),this.coloredMaterial.dispose(),this.texturedMaterial.dispose(),this.textCache.dispose()},e.buildShape=function(t,e){var i=this.buildPoints,r=this.indices.length,n=this.vertices.length/2;i.length=0,t.build(i),t.triangulate(i,this.vertices,n,this.indices,r),this.applyTransformAndColor(n,this.vertices.length/2-n,e)},e.buildShapeLine=function(t,e,i,r){void 0===r&&(r=!1);var n=this.buildPoints;this.indices.length;var a=this.vertices.length/2;n.length=0,t.build(n),this.lineStyle.width=i,aM(n,this.lineStyle,!1,r,this.vertices,2,a,this.indices),this.applyTransformAndColor(a,this.vertices.length/2-a,e)},e.setTriangleShape=function(t,e,i,r,n,a){this.triangleShape.x=t,this.triangleShape.y=e,this.triangleShape.x2=i,this.triangleShape.y2=r,this.triangleShape.x3=n,this.triangleShape.y3=a},e.setRectangleShape=function(t,e,i,r,n){this.rectangleShape.x=t,this.rectangleShape.y=e,this.rectangleShape.width=i,this.rectangleShape.height=r,this.rectangleShape.roundness=n},e.setCircleShape=function(t,e,i){this.circleShape.x=t,this.circleShape.y=e,this.circleShape.radius=i},e.applyTransformAndColor=function(t,e,i){for(var r=0;r<e;r++){var n=(t+r)*2,a=(t+r)*4;this.applyTransform(this.vertices[n],this.vertices[n+1],this.vertices,n),this.colors[a]=i.r,this.colors[a+1]=i.g,this.colors[a+2]=i.b,this.colors[a+3]=i.a,this.uvs[n]=0,this.uvs[n+1]=0}},e.pushQuad=function(t,e,i,r,n,a){for(var o=this.vertices.length/2,s=[[t,e],[t+i,e],[t,e+r],[t+i,e+r]],u=a?a.u0:0,h=a?a.v0:0,l=a?a.u1:0,c=a?a.v1:0,f=[[u,h],[l,h],[u,c],[l,c]],d=0;d<4;d++){var p=(o+d)*2,m=(o+d)*4;this.applyTransform(s[d][0],s[d][1],this.vertices,p),this.colors[m]=n.r,this.colors[m+1]=n.g,this.colors[m+2]=n.b,this.colors[m+3]=n.a,this.uvs[p]=f[d][0],this.uvs[p+1]=f[d][1]}this.indices.push(o,o+1,o+2,o+2,o+1,o+3)},e.applyTransform=function(t,e,i,r){void 0===r&&(r=0);var n=this.currentTransform.elements;i[r]=n[0]*t+n[3]*e+n[6],i[r+1]=n[1]*t+n[4]*e+n[7]},rI(t,[{key:"currentVertexCount",get:function(){return this.vertices.length/2}},{key:"currentIndexCount",get:function(){return this.indices.length}}]),t}(),oE=function(t){function e(e){(i=t.call(this,e)||this).visible=!0,i._color=new e5(1,1,1,1),i.getHitTestParams=function(t){var e=nu.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix()),r=i.interaction;if(t||r){i.boundingBoxInfo.setGeometry(i.geometry,e);var n,a=i.boundingBoxInfo.getRawBoundingBoxTriangle();if(a)return{behavior:(null==(n=i.interaction)?void 0:n.behavior)||0,type:a.type,triangles:a.area,backfaceCulling:i.renderer.side===tB.FRONT,clipMasks:i.frameClipMasks}}},i.renderer={renderMode:tY.MESH,blending:tz.ALPHA,texture:i.engine.whiteTexture,occlusion:!1,transparentOcclusion:!1,side:tB.DOUBLE,mask:0},i.defaultGeometry=aK.create(i.engine,{attributes:{aPos:{type:rV.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},aUV:{size:2,offset:0,type:rV.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])}},indices:{data:new Uint16Array([0,1,2,2,1,3]),releasable:!0},mode:rV.TRIANGLES,drawCount:6}),i.geometry=i.defaultGeometry;var i,r=ng.create(i.engine,{shader:{fragment:a1,vertex:a0,shared:!0}});return i.material=r,i.material.setColor("_Color",new e5(1,1,1,1)),i.configureMaterial(i.renderer),i}iB(e,t);var i=e.prototype;return i.setVisible=function(t){this.visible=t},i.getVisible=function(){return this.visible},i.setColor=function(t){eU(t,e5)?this._color.copyFrom(t):this._color.setFromArray(t),this.material.setColor("_Color",this._color)},i.setTexture=function(t){var e=this;return eB(function(){var i;return eW(this,function(r){switch(r.label){case 0:if("string"!=typeof t)return[3,2];return[4,r7.fromImage(t,e.item.engine)];case 1:return i=r.sent(),[3,3];case 2:i=t,r.label=3;case 3:return e.renderer.texture=i,e.material.setTexture("_MainTex",i),[2]}})})()},i.onUpdate=function(t){for(var e=0;e<this.materials.length;e++){var i=this.materials[e];i.setVector2("_Size",this.transform.size),(this.renderer.renderMode===tY.BILLBOARD||this.renderer.renderMode===tY.VERTICAL_BILLBOARD||this.renderer.renderMode===tY.HORIZONTAL_BILLBOARD)&&i.setVector3("_Scale",this.transform.scale)}},i.render=function(t){this.getVisible()&&(this.maskManager.drawStencilMask(t,this),this.draw(t))},i.drawStencilMask=function(t){if(this.isActiveAndEnabled)for(var e=0;e<this.materials.length;e++)this.maskManager.drawGeometryMask(this.engine.renderer,this.geometry,this.transform.getWorldMatrix(),this.materials[e],t,e)},i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.boundingBoxInfo.setGeometry(this.geometry,t),this.boundingBoxInfo.getBoundingBoxTriangle(this.transform.size)},i.getBoundingBoxInfo=function(){var t=this.geometry.getAttributeData("aPos");if(t){var e=nH(t,0,t.length/3);e.minimum.x*=this.transform.size.x,e.minimum.y*=this.transform.size.y,e.maximum.x*=this.transform.size.x,e.maximum.y*=this.transform.size.y,this.boundingBoxInfo.reConstruct(e.minimum,e.maximum,this.transform.getWorldMatrix())}return this.boundingBoxInfo},i.configureMaterial=function(t){var e=t.side,i=t.occlusion,r=t.blending,n=t.texture,a=this.material;a.blending=!0,a.depthTest=!0,a.depthMask=i,rB(a,r),rU(a,e),a.shader.shaderData.properties='_MainTex("_MainTex",2D) = "white" {}',a.setVector4("_TexOffset",new e4(0,0,1,1)),a.setTexture("_MainTex",n);var o=rz(r),s=new e4;return s.x=t.occlusion?+t.transparentOcclusion:1,s.y=o,s.z=t.renderMode,a.setVector4("_TexParams",s),0===s.x||this.maskManager.alphaMaskEnabled?a.enableMacro("ALPHA_CLIP"):a.disableMacro("ALPHA_CLIP"),a},i.draw=function(t){for(var e=0;e<this.materials.length;e++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.materials[e],e)},i.fromData=function(e){t.prototype.fromData.call(this,e);var i,r,n,a,o=null!=(i=e.renderer)?i:{},s=e.mask;s&&this.maskManager.setMaskOptions(this.engine,s),this.renderer={renderMode:null!=(r=o.renderMode)?r:tY.MESH,blending:null!=(n=o.blending)?n:tz.ALPHA,texture:o.texture?this.engine.findObject(o.texture):this.engine.whiteTexture,occlusion:!!o.occlusion,transparentOcclusion:!!o.transparentOcclusion||this.maskManager.isMask,side:null!=(a=o.side)?a:tB.DOUBLE,mask:1},this.configureMaterial(this.renderer)},rI(e,[{key:"color",get:function(){return this._color},set:function(t){this.setColor(t)}}]),e}(n_);function o_(t,e,i){var r=t.elements;r[0]*=e,r[1]*=e,r[2]*=e,r[3]*=e,r[4]*=i,r[5]*=i,r[6]*=i,r[7]*=i}t.Fake3DComponent=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.loop=!1,t.amountOfMotion=1,t.animationLength=2,t.mode=1,t.startPositionX=0,t.startPositionY=0,t.startPositionZ=0,t.endPositionX=0,t.endPositionY=0,t.endPositionZ=0,t.amplitudeX=0,t.amplitudeY=0,t.amplitudeZ=0,t.phaseX=0,t.phaseY=0,t.phaseZ=0,t}iB(i,e);var r=i.prototype;return r.onStart=function(){this.effectComponent=this.item.getComponent(t.EffectComponent)},r.onUpdate=function(t){this.updateFake3D()},r.updateFake3D=function(){if(this.effectComponent){var t=this.item.time%this.animationLength/this.animationLength,e=0,i=0,r=0;switch(this.mode){case 0:var n=Math.PI;e=Math.sin(2*n*(t+this.phaseX))*this.amplitudeX,i=Math.sin(2*n*(t+this.phaseY))*this.amplitudeY,r=Math.sin(2*n*(t+this.phaseZ))*this.amplitudeZ;break;case 1:var a=t;this.loop&&(a>.5&&(a=1-a),a*=2),e=this.startPositionX*(1-a)+a*this.endPositionX,i=this.startPositionY*(1-a)+a*this.endPositionY,r=this.startPositionZ*(1-a)+a*this.endPositionZ}var o=this.effectComponent.material;o.setFloat("_PosX",e*this.amountOfMotion),o.setFloat("_PosY",i*this.amountOfMotion),o.setFloat("_PosZ",r*this.amountOfMotion)}},i}(rO),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"loop",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"amountOfMotion",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"animationLength",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"mode",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionX",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionY",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionZ",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionX",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionY",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionZ",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeX",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeY",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeZ",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"phaseX",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"phaseY",void 0),eG([iK(void 0,void 0)],t.Fake3DComponent.prototype,"phaseZ",void 0),t.Fake3DComponent=eG([iZ("Fake3DComponent")],t.Fake3DComponent),t.Fake3DAnimationMode=void 0,(tS=t.Fake3DAnimationMode||(t.Fake3DAnimationMode={}))[tS.Circular=0]="Circular",tS[tS.Linear=1]="Linear",t.FrameComponent=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.color=new e5(1,1,1,1),e.worldMatrix=new nu,e.getHitTestParams=function(t){var i=nu.fromScale(e.transform.size.x,e.transform.size.y,1).premultiply(e.transform.getWorldMatrix());if(t){e.boundingBoxInfo.setGeometry(e.clipGeometry,i);var r=e.boundingBoxInfo.getRawBoundingBoxTriangle();if(r)return{type:r.type,triangles:r.area,clipMasks:e.frameClipMasks}}},e}iB(e,t);var i=e.prototype;return i.onAwake=function(){this.clipGeometry=aK.create(this.engine,{attributes:{aPos:{type:rV.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},aUV:{size:2,offset:0,releasable:!0,type:rV.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])}},indices:{data:new Uint16Array([0,1,2,2,1,3]),releasable:!0},mode:rV.TRIANGLES,drawCount:6});var t=ng.create(this.engine,{shader:{fragment:"\n precision mediump float;\n\n uniform vec4 _Color;\n\n void main() {\n gl_FragColor = _Color;\n }\n ",vertex:"\n precision highp float;\n attribute vec3 aPos;\n uniform mat4 effects_ObjectToWorld;\n uniform mat4 effects_MatrixVP;\n void main() {\n gl_Position = effects_MatrixVP * effects_ObjectToWorld * vec4(aPos, 1.0);\n }\n ",shared:!0}});t.depthTest=!0,t.depthMask=!1,t.setColor("_Color",this.color),this.material=t},i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.onPreRender=function(){this.setClipRectangle(),this.material.setColor("_Color",this.color)},i.render=function(t){this.maskManager.drawStencilMask(t,this),this.worldMatrix.copyFrom(this.transform.getWorldMatrix()),o_(this.worldMatrix,this.transform.size.x,this.transform.size.y),t.drawGeometry(this.clipGeometry,this.worldMatrix,this.material)},i.onDestroy=function(){this.clipGeometry.dispose(),this.material.dispose()},i.drawStencilMask=function(t){this.isActiveAndEnabled&&(this.worldMatrix.copyFrom(this.transform.getWorldMatrix()),o_(this.worldMatrix,this.transform.size.x,this.transform.size.y),this.maskManager.drawGeometryMask(this.engine.renderer,this.clipGeometry,this.worldMatrix,this.material,t))},i.fromData=function(e){t.prototype.fromData.call(this,e),e.color&&this.color.copyFrom(e.color)},i.setClipRectangle=function(){this.setClipRectangleRecursive(this.item)},i.setClipRectangleRecursive=function(t){for(var e,i=ij(t.children);!(e=i()).done;){var r=e.value,n=r.getComponent(n_);n&&eZ(n.frameClipMasks,this),this.setClipRectangleRecursive(r)}},e}(n_),t.FrameComponent=eG([iZ("FrameComponent")],t.FrameComponent);var ow=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.canvasItems=[],e.layer=0,e}iB(e,t);var i=e.prototype;return i.addCanvasItem=function(t){this.canvasItems.includes(t)||this.canvasItems.push(t)},i.removeCanvasItem=function(t){eq(this.canvasItems,t)},i.onEnable=function(){var t,e=null==(t=this.item.composition)?void 0:t.canvasLayers;e&&!e.includes(this)&&e.push(this)},i.onDisable=function(){this.removeFromComposition(),this.refreshCanvasItemsLayer()},i.removeFromComposition=function(){var t,e=null==(t=this.item.composition)?void 0:t.canvasLayers;e&&eq(e,this)},i.refreshCanvasItemsLayer=function(){var t=this.canvasItems.slice();this.canvasItems.length=0;for(var e,i=ij(t);!(e=i()).done;)e.value.updateCanvasLayer()},i.draw=function(){for(var t,e=ij(this.canvasItems);!(t=e()).done;){var i=t.value;i.item.isActive&&i.drawInternal()}},e}(rO),oS=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.parent=null,e.children=[],e.canvasLayerNode=null,e}iB(e,t);var i=e.prototype;return i.onEnable=function(){this.updateCanvasLayer(),this.updateParentItem()},i.onDisable=function(){},i.onParentChanged=function(){this.updateCanvasLayer(),this.updateParentItem()},i.onDestroy=function(){this.removeFromParent(),this.removeFromCanvasLayer(),this.enabled=!1,this.updateChildrenParentItems()},i.updateCanvasLayer=function(){if(!this.item){this.removeFromCanvasLayer();return}var t=this.getCanvasLayerNode();t!==this.canvasLayerNode&&(null===this.parent&&this.canvasLayerNode&&this.canvasLayerNode.removeCanvasItem(this),this.canvasLayerNode=t,null===this.parent&&t&&t.addCanvasItem(this))},i.updateParentItem=function(){if(!this.item){this.removeFromParent();return}var t=this.getParentItem();if(t!==this.parent){var e=null===this.parent;this.removeFromParent(),t?(this.parent=t,t.children.push(this),e&&this.canvasLayerNode&&this.canvasLayerNode.removeCanvasItem(this)):!e&&this.canvasLayerNode&&this.canvasLayerNode.addCanvasItem(this)}},i.draw=function(){},i.drawLine=function(t,e,i,r,n,a){this.engine.graphics.drawLine(t,e,i,r,n,a)},i.drawPolyline=function(t,e,i){this.engine.graphics.drawLines(t,e,i)},i.drawBezier=function(t,e,i,r,n,a,o,s,u,h){this.engine.graphics.drawBezier(t,e,i,r,n,a,o,s,u,h)},i.drawTriangle=function(t,e,i,r,n,a,o,s){this.engine.graphics.drawTriangle(t,e,i,r,n,a,o,s)},i.drawRect=function(t,e,i,r,n,a){this.engine.graphics.drawRectangle(t,e,i,r,n,a)},i.drawCircle=function(t,e,i,r,n){this.engine.graphics.drawCircle(t,e,i,r,n)},i.fillTriangle=function(t,e,i,r,n,a,o){this.engine.graphics.fillTriangle(t,e,i,r,n,a,o)},i.fillRect=function(t,e,i,r,n){this.engine.graphics.fillRectangle(t,e,i,r,n)},i.fillCircle=function(t,e,i,r){this.engine.graphics.fillCircle(t,e,i,r)},i.drawTexture=function(t,e,i,r,n,a,o){this.engine.graphics.drawTexture(t,e,i,r,n,a,o)},i.drawText=function(t,e,i,r,n,a,o,s){this.engine.graphics.drawText(t,e,i,r,n,a,o,s)},i.drawInternal=function(){var t=this.engine.graphics,e=this.transform.getMatrix2D();t.pushTransform(e),this.enabled&&this.draw();for(var i,r=ij(this.children);!(i=r()).done;){var n=i.value;n.item.isActive&&n.drawInternal()}t.popTransform()},i.removeFromCanvasLayer=function(){this.canvasLayerNode&&(null===this.parent&&this.canvasLayerNode.removeCanvasItem(this),this.canvasLayerNode=null)},i.removeFromParent=function(){this.parent&&(eq(this.parent.children,this),this.parent=null)},i.updateChildrenParentItems=function(){if(0!==this.children.length)for(var t,e=this.children.slice(),i=ij(e);!(t=i()).done;)t.value.updateParentItem()},i.getCanvasLayerNode=function(){for(var t=this.item;t;){var e,i=function(t){for(var e,i=ij(t.components);!(e=i()).done;){var r=e.value;if(eU(r,ow)&&r.isActiveAndEnabled)return r}return null}(t);if(i)return i;t=null!=(e=t.parent)?e:null}return null},i.getParentItem=function(){for(var t=null!=(i=null==(e=this.item)?void 0:e.parent)?i:null;t;){var e,i,r,n=function(t){for(var e,i=ij(t.components);!(e=i()).done;){var r=e.value;if(eU(r,oS))return r}return null}(t);if(n)return n;t=null!=(r=t.parent)?r:null}return null},rI(e,[{key:"canvasLayer",get:function(){return this.canvasLayerNode}}]),e}(rO),oM={topLeft:[0,1,0,1],topRight:[1,1,1,1],bottomLeft:[0,0,0,0],bottomRight:[1,0,1,0],centerLeft:[0,.5,0,.5],centerTop:[.5,1,.5,1],centerRight:[1,.5,1,.5],centerBottom:[.5,0,.5,0],center:[.5,.5,.5,.5],leftWide:[0,0,0,1],topWide:[0,1,1,1],rightWide:[1,0,1,1],bottomWide:[0,0,1,0],vcenterWide:[.5,0,.5,1],hcenterWide:[0,.5,1,.5],fullRect:[0,0,1,1]},oA=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.anchorMin=new e2(0,0),e.anchorMax=new e2(0,0),e.offsetMin=new e2(0,0),e.offsetMax=new e2(0,0),e.pivot=new e2(.5,.5),e}iB(e,t);var i=e.prototype;return i.fromData=function(e){t.prototype.fromData.call(this,e),0!==this.size.x&&0!==this.size.y&&this.pivot.set(this.anchor.x/this.size.x,this.anchor.y/this.size.y),e.anchorMin&&this.setAnchorMin(e.anchorMin.x,e.anchorMin.y),e.anchorMax&&this.setAnchorMax(e.anchorMax.x,e.anchorMax.y),e.offsetMin&&this.setOffsetMin(e.offsetMin.x,e.offsetMin.y),e.offsetMax&&this.setOffsetMax(e.offsetMax.x,e.offsetMax.y)},i.setAnchorMin=function(t,e){(this.anchorMin.x!==t||this.anchorMin.y!==e)&&(this.anchorMin.x=t,this.anchorMin.y=e,this.sizeChanged())},i.setAnchorMax=function(t,e){(this.anchorMax.x!==t||this.anchorMax.y!==e)&&(this.anchorMax.x=t,this.anchorMax.y=e,this.sizeChanged())},i.setOffsetMin=function(t,e){(this.offsetMin.x!==t||this.offsetMin.y!==e)&&(this.offsetMin.x=t,this.offsetMin.y=e,this.sizeChanged())},i.setOffsetMax=function(t,e){(this.offsetMax.x!==t||this.offsetMax.y!==e)&&(this.offsetMax.x=t,this.offsetMax.y=e,this.sizeChanged())},i.setPivot=function(t,e){(this.pivot.x!==t||this.pivot.y!==e)&&(this.pivot.x=t,this.pivot.y=e,this.anchor.set(this.pivot.x*this.size.x,this.pivot.y*this.size.y,this.anchor.z))},i.setPosition=function(i,r,n,a){if(void 0===a&&(a=!1),!eU(this.parentTransform,e)){t.prototype.setPosition.call(this,i,r,n),this.sizeChanged();return}var o={position:new e2(0,0),size:this.parentTransform.size.clone()},s={position:new e2(i,r),size:this.size.clone()};a?this.computeAnchors(s,o):this.computeOffsets(s,o),this.sizeChanged(),this.position.z!==n&&t.prototype.setPosition.call(this,this.position.x,this.position.y,n)},i.setSize=function(i,r){if(this.size.x!==i||this.size.y!==r){if(!eU(this.parentTransform,e)){t.prototype.setSize.call(this,i,r),this.sizeChanged();return}var n=i-this.size.x,a=r-this.size.y;this.offsetMin.set(this.offsetMin.x-this.pivot.x*n,this.offsetMin.y-this.pivot.y*a),this.offsetMax.set(this.offsetMax.x+(1-this.pivot.x)*n,this.offsetMax.y+(1-this.pivot.y)*a),this.sizeChanged()}},i.getRect=function(){return{position:new e2(this.position.x,this.position.y),size:this.size.clone()}},i.onParentTransformChanged=function(t,i){eU(t,e)&&this.engine.off("resize",this.onCanvasResize.bind(this)),eU(i,e)||(this.onCanvasResize(),this.engine.on("resize",this.onCanvasResize.bind(this))),this.sizeChanged()},i.onCanvasResize=function(){var t=this.engine.canvas.getBoundingClientRect();this.setSize(t.width,t.height)},i.sizeChanged=function(){if(eU(this.parentTransform,e)){var i=this.parentTransform.size,r=this.offsetMin.x+this.anchorMin.x*i.x,n=this.offsetMin.y+this.anchorMin.y*i.y,a=this.offsetMax.x+this.anchorMax.x*i.x,o=this.offsetMax.y+this.anchorMax.y*i.y;t.prototype.setPosition.call(this,r,n,this.position.z),t.prototype.setSize.call(this,a-r,o-n)}this.anchor.set(this.pivot.x*this.size.x,this.pivot.y*this.size.y,this.anchor.z);for(var s,u=ij(this.children);!(s=u()).done;){var h=s.value;eU(h,e)&&h.sizeChanged()}},i.computeOffsets=function(t,e){this.offsetMin.set(t.position.x-e.position.x-this.anchorMin.x*e.size.x,t.position.y-e.position.y-this.anchorMin.y*e.size.y),this.offsetMax.set(t.position.x+t.size.x-e.position.x-this.anchorMax.x*e.size.x,t.position.y+t.size.y-e.position.y-this.anchorMax.y*e.size.y)},i.computeAnchors=function(t,e){if(0!==e.size.x){var i=(t.position.x-e.position.x-this.offsetMin.x)/e.size.x,r=(t.position.x+t.size.x-e.position.x-this.offsetMax.x)/e.size.x;this.anchorMin.x=i,this.anchorMax.x=r}if(0!==e.size.y){var n=(t.position.y-e.position.y-this.offsetMin.y)/e.size.y,a=(t.position.y+t.size.y-e.position.y-this.offsetMax.y)/e.size.y;this.anchorMin.y=n,this.anchorMax.y=a}},i.setAnchorsPreset=function(t,i){void 0===i&&(i=!0);var r=oM[t],n=r[0],a=r[1],o=r[2],s=r[3];if(i)this.anchorMin.set(n,a),this.anchorMax.set(o,s);else if(eU(this.parentTransform,e)){var u={position:new e2(0,0),size:this.parentTransform.size.clone()},h=this.getRect();this.anchorMin.set(n,a),this.anchorMax.set(o,s),this.computeOffsets(h,u)}else this.anchorMin.set(n,a),this.anchorMax.set(o,s);this.sizeChanged()},i.setOffsetsPreset=function(t,i){if(void 0===i&&(i=0),eU(this.parentTransform,e)){var r=this.size.x,n=this.size.y,a=this.anchorMin,o=this.anchorMax,s=this.parentTransform.size.x,u=this.parentTransform.size.y,h=0,l=0,c=0,f=0;switch(t){case"topLeft":case"bottomLeft":case"centerLeft":case"topWide":case"bottomWide":case"leftWide":case"hcenterWide":case"fullRect":h=i-a.x*s,l=i+r-o.x*s;break;case"centerTop":case"centerBottom":case"center":case"vcenterWide":h=.5*s-r/2-a.x*s,l=.5*s+r/2-o.x*s;break;case"topRight":case"bottomRight":case"centerRight":case"rightWide":h=s-i-r-a.x*s,l=s-i-o.x*s}switch(t){case"bottomLeft":case"bottomRight":case"centerBottom":case"leftWide":case"rightWide":case"bottomWide":case"vcenterWide":case"fullRect":c=i-a.y*u,f=i+n-o.y*u;break;case"centerLeft":case"centerRight":case"center":case"hcenterWide":c=.5*u-n/2-a.y*u,f=.5*u+n/2-o.y*u;break;case"topLeft":case"topRight":case"centerTop":case"topWide":c=u-i-n-a.y*u,f=u-i-o.y*u}this.offsetMin.set(h,c),this.offsetMax.set(l,f),this.sizeChanged()}},i.setAnchorsAndOffsetsPreset=function(t,e){void 0===e&&(e=0),this.setAnchorsPreset(t,!1),this.setOffsetsPreset(t,e)},e.fromTransform=function(t){if(eU(t,e))return t;var i=new e;return i.engine=t.engine,i.name=t.name,i.position.copyFrom(t.position),i.quat.copyFrom(t.quat),i.rotation.copyFrom(t.rotation),i.scale.copyFrom(t.scale),i.size.copyFrom(t.size),i.anchor.set(i.pivot.x*i.size.x,i.pivot.y*i.size.y,t.anchor.z),t.parentTransform&&(i.parentTransform=t.parentTransform),i},e}(nO),oP=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.onAwake=function(){var t=this.item;eU(t.transform,oA)||(t.transform=oA.fromTransform(t.transform))},e}(oS);function oR(t){return(oR=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oI(t){var e="function"==typeof Map?new Map:void 0;return(oI=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return ad(t,arguments,oR(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),iz(i,t)})(t)}t.CameraController=function(t){function e(e,i){var r;return r=t.call(this,e)||this,i&&r.fromData(i),r}iB(e,t);var i=e.prototype;return i.onUpdate=function(){if(this.item.composition&&this.item.transform.getValid()){var t=this.item.composition.camera;t.near=this.options.near,t.far=this.options.far,t.fov=this.options.fov,t.clipMode=this.options.clipMode,t.transform.parentTransform=this.transform.parentTransform,t.position=this.transform.position,t.setQuat(this.transform.getQuaternion().clone().conjugate())}},i.fromData=function(e){t.prototype.fromData.call(this,e),this.options=e.options},e}(rO),t.CameraController=eG([iZ(em.CameraController)],t.CameraController);var oO=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(oI(iD)),oL="click",oF="touchstart",oV="touchmove",oN="touchend";t.PointerEventType=void 0,(tM=t.PointerEventType||(t.PointerEventType={}))[tM.PointerDown=0]="PointerDown",tM[tM.PointerUp=1]="PointerUp",tM[tM.PointerMove=2]="PointerMove";var ok=function(){function t(t,e){void 0===e&&(e=!1),this.engine=t,this.allowPropagation=e,this.enabled=!0,this.skipPointerMovePicking=!0,this.handlers={},this.nativeHandlers={},this.target=null}var e=t.prototype;return e.bindListeners=function(t){var e,i,r,n,a,o,s=this;this.target=t,a=function(t){return t};var u="mousedown",h="mousemove",l="mouseup",c="mouseleave",f=function(t,e,i,r,a){void 0===r&&(r=0),void 0===a&&(a=0);var o=0,u=0,h=performance.now();if(!s.target)return ix.warn("Trigger TouchEvent after EventSystem is disposed."),{x:e,y:i,vx:0,vy:u,dx:r,dy:a,ts:h,width:0,height:0,origin:t};var l=s.target,c=l.width,f=l.height;if(n){var d=h-n.ts;o=(r-n.dx)/d||0,u=(a-n.dy)/d||0,n={dx:r,dy:a,ts:h}}return{x:e,y:i,vx:o,vy:u,dx:r,dy:a,ts:h,width:c,height:f,origin:t}};is()&&(a=function(t){var e=t.touches,i=t.changedTouches;return e[0]||i[0]},u="touchstart",h="touchmove",l="touchend",c="touchcancel"),this.nativeHandlers=((o={})[u]=function(t){if(s.enabled){var o=a(t),u=oD(o);e=u.x,i=u.y,n=r={clientX:o.clientX,clientY:o.clientY,ts:performance.now(),x:e,y:i},s.dispatchEvent(oF,f(t,e,i))}},o[h]=function(t){if(r&&s.enabled){var n=oD(a(t));e=n.x,i=n.y,s.dispatchEvent(oV,f(t,e,i,e-r.x,i-r.y))}},o[l]=function(t){if(r&&s.enabled){!s.allowPropagation&&t.cancelable&&(t.preventDefault(),t.stopPropagation());var n=a(t),o=oD(n),u=Math.abs(r.clientX-n.clientX)+Math.abs(r.clientY-n.clientY);e=o.x,i=o.y,u<4&&s.dispatchEvent(oL,f(t,e,i)),s.dispatchEvent(oN,f(t,e,i,e-r.x,i-r.y))}r=0},o),this.nativeHandlers[c]=this.nativeHandlers[l],Object.keys(this.nativeHandlers).forEach(function(t){var e;null==(e=s.target)||e.addEventListener(String(t),s.nativeHandlers[t])}),this.addEventListener(oL,this.onClick.bind(this)),this.addEventListener(oF,this.onPointerDown.bind(this)),this.addEventListener(oN,this.onPointerUp.bind(this)),this.addEventListener(oV,this.onPointerMove.bind(this))},e.dispatchEvent=function(t,e){var i=this.handlers[t];null==i||i.forEach(function(t){return t(e)})},e.addEventListener=function(t,e){var i=this.handlers[t];return i||(i=this.handlers[t]=[]),eZ(i,e),function(){eq(i,e)}},e.removeEventListener=function(t,e){var i=this.handlers[t];i&&eq(i,e)},e.onClick=function(t){for(var e,i=t.x,r=t.y,n=[],a=ij(this.engine.compositions);!(e=a()).done;){var o=e.value;n.push.apply(n,[].concat(o.hitTest(i,r)))}for(var s,u=ij(n);!(s=u()).done;){var h=s.value,l=h.item.composition;if(l){var c=i7({},h,{compositionId:l.id,compositionName:l.name});h.item.emit("click",h),l.emit("click",c),this.engine.emit("click",c)}}},e.onPointerDown=function(t){this.handlePointerEvent(t,0)},e.onPointerUp=function(t){this.handlePointerEvent(t,1)},e.onPointerMove=function(t){this.handlePointerEvent(t,2)},e.handlePointerEvent=function(t,e){var i=null,r=t.x,n=t.y,a=t.width,o=t.height;if(!(2===e&&this.skipPointerMovePicking))for(var s,u=ij(this.engine.compositions);!(s=u()).done;){var h=s.value.hitTest(r,n);h.length>0&&(i=h[h.length-1])}var l=new nb;l.position.x=(r+1)/2*a,l.position.y=(n+1)/2*o,l.delta.x=t.vx*a,l.delta.y=t.vy*o;var c=l.pointerCurrentRaycast;i&&(c.point=i.position,c.item=i.item);var f="pointerdown";switch(e){case 0:f="pointerdown";break;case 1:f="pointerup";break;case 2:f="pointermove"}if(i){var d=i.item,p=d.composition;d.emit(f,l),p.emit(f,l),this.engine.emit(f,l)}},e.dispose=function(){var t=this;this.target&&(this.handlers={},Object.keys(this.nativeHandlers).forEach(function(e){var i;null==(i=t.target)||i.removeEventListener(String(e),t.nativeHandlers[e])}),this.nativeHandlers={})},t}();function oD(t){var e=t.target,i=t.clientX,r=t.clientY,n=e.getBoundingClientRect(),a=n.left,o=n.top;return{x:(i-a)/n.width*2-1,y:1-(r-o)/n.height*2}}var oz=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(oI(iD)),oB=1,oU=function(){function e(t,e,i){this.transform=e,this.engine=i,this.color=t.options.previewColor;var r=this.createMaterial(),n=this.createGeometry();this.mesh=this.createMesh(n,r),this.updateMesh()}var i=e.prototype;return i.updateMesh=function(){var t=this.mesh.material,e=t.getVector2("uSize").clone(),i=t.getVector4("uPos").clone(),r=new e3,n=new ri,a=this.transform.scale.clone();this.transform.assignWorldTRS(r,n,a),e.x=a.x,e.y=a.y,i.x=r.x,i.y=r.y,i.z=r.z,t.setVector2("uSize",e),t.setVector4("uPos",i),t.setQuaternion("uQuat",n)},i.createMaterial=function(){var e=[["ENV_EDITOR",this.engine.env===nw]],i=aT(this.color).getValue(0),r={shader:{vertex:"\nprecision highp float;\n\nattribute vec2 aPoint;\nuniform vec4 uPos;\nuniform vec2 uSize;\nuniform vec4 uQuat;\nuniform vec4 uColor;\nuniform mat4 effects_ObjectToWorld;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_MatrixVP;\nvarying vec4 vColor;\n\nvec3 rotateByQuat(vec3 a, vec4 quat){\n vec3 qvec = quat.xyz;\n vec3 uv = cross(qvec, a);\n vec3 uuv = cross(qvec, uv) * 2.;\n return a +(uv * 2. * quat.w + uuv);\n}\n\nvoid main() {\n vec4 _pos = uPos;\n vec3 point = rotateByQuat(vec3(aPoint.xy * uSize, 0.),uQuat);\n vec4 pos = vec4(_pos.xyz, 1.0);\n pos = effects_ObjectToWorld * pos;\n pos.xyz += effects_MatrixInvV[0].xyz * point.x+ effects_MatrixInvV[1].xyz * point.y;\n gl_Position = effects_MatrixVP * pos;\n vColor = uColor;\n}\n",fragment:"\nprecision highp float;\n\n#define fragColor gl_FragColor\n\nvarying vec4 vColor;\nvoid main() {\n gl_FragColor = vColor*vColor.a;\n}\n",glslVersion:t.GLSLVersion.GLSL1,macros:e}},n=ng.create(this.engine,r);return n.blending=!0,n.depthTest=!1,n.setVector4("uPos",new e4(0,0,0,0)),n.setVector2("uSize",new e2(1,1)),n.setVector4("uColor",new e4(i[0]/255,i[1]/255,i[2]/255,i[3])),n.setQuaternion("uQuat",new ri(0,0,0,0)),n},i.createGeometry=function(){var t=new Uint8Array([0,1,1,2,2,3,3,0]);return aK.create(this.engine,{attributes:{aPoint:{size:2,offset:0,stride:2*Float32Array.BYTES_PER_ELEMENT,data:new Float32Array([-.5,.5,.5,.5,.5,-.5,-.5,-.5])}},drawCount:t.length,indices:{data:t},mode:rV.LINES,maxVertex:4})},i.createMesh=function(t,e){return a$.create(this.engine,{name:"Interact_preview"+oB++,priority:0,worldMatrix:nu.fromIdentity(),geometry:t,material:e})},e}();function oG(t,e){var i=1e-5*(e||1);return t&&Math.abs(t.vx||0)<i&&Math.abs(t.vy||0)<i}t.InteractComponent=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.downgrade=.95,t.speed=25,t.dragRatio=[1,1],t.dragRange={dxRange:[0,0],dyRange:[0,0]},t.invalidBorderRange=0,t.invalidByBorderRange=!1,t.duringPlay=!1,t._interactive=!0,t.lastTime=-1,t.getHitTestParams=function(e){if(t.clickable){var i=t.item.props.content.options.behavior,r=t.getBoundingBox();if(r)return{type:r.type,triangles:r.area,behavior:i,clipMasks:t.frameClipMasks}}},t}iB(i,e);var r=i.prototype;return r.getDragRangeX=function(){return this.dragRange.dxRange},r.setDragRangeX=function(t,e){this.dragRange.dxRange=[t,e]},r.getDragRangeY=function(){return this.dragRange.dyRange},r.setDragRangeY=function(t,e){this.dragRange.dyRange=[t,e]},r.onStart=function(){var t=this.item.engine.env,e=this.interactData.options,i=e.type,r=e.showPreview;i===tj.CLICK&&(this.clickable=!0,r&&t===nw&&(this.previewContent=new oU(this.item.props.content,this.transform,this.engine))),this.previewContent&&(this.previewContent.mesh.item=this.item,this.materials=this.previewContent.mesh.materials),this.item.getHitTestParams=this.getHitTestParams},r.onDisable=function(){e.prototype.onDisable.call(this),this.item&&this.item.composition&&(this.duringPlay&&!this.item.transform.getValid()&&this.item.composition.getSpeed()>0&&(this.item.composition.removeInteractiveItem(this.item,this.item.props.content.options.type),this.duringPlay=!1),this.clickable=!1,this.endDragTarget())},r.onEnable=function(){e.prototype.onEnable.call(this);var t=this.interactData.options.type,i=this.item.engine.env;if(t===tj.CLICK)this.clickable=!0;else if(t===tj.DRAG){var r=this.interactData.options,n=r.enableInEditor;if(i!==nw||n){var a,o=(null!=(a=this.item.composition)?a:{}).event;o&&this.beginDragTarget(r,o)}}},r.onUpdate=function(t){var e;if(this.duringPlay=!0,this.lastTime<=this.item.time){if(this.item.time>=0&&this.lastTime<0){var i,r=this.item.props.content.options;null==(i=this.item.composition)||i.addInteractiveItem(this.item,r.type)}}else if(this.item.time>=0&&t>0){var n,a=this.item.props.content.options;null==(n=this.item.composition)||n.addInteractiveItem(this.item,a.type)}this.lastTime=this.item.time,null==(e=this.previewContent)||e.updateMesh(),this.dragEvent&&this.bouncingArg&&(this.bouncingArg.vx*=this.downgrade,this.bouncingArg.vy*=this.downgrade,this.bouncingArg.dy+=this.bouncingArg.vy,this.bouncingArg.dx+=this.bouncingArg.vx,oG(this.bouncingArg)?(this.dragEvent=null,this.bouncingArg=null):this.handleDragMove(this.dragEvent,this.bouncingArg))},r.render=function(t){this.previewContent&&this.previewContent.mesh.render(t)},r.onDestroy=function(){var t;null==(t=this.previewContent)||t.mesh.dispose()},r.endDragTarget=function(){},r.handleDragMove=function(t,e){if((null==t?void 0:t.cameraParam)&&this.canInteract()&&this.item.composition){var i,r,n=t.cameraParam,a=n.position,o=n.fov,s=e.dy,u=e.dx*e.width/e.height,h=a[2],l=Math.tan(o*Math.PI/180/2)*Math.abs(h),c=this.dragRange,f=c.dxRange,d=c.dyRange,p=a[0]-this.dragRatio[0]*(u*l),m=a[1]-this.dragRatio[1]*(s*l),v=f[0],y=f[1],g=d[0],x=d[1];p=e1(p,v,y),m=e1(m,g,x),p!==v&&p!==y&&v!==y&&(null==(i=e.origin)||i.preventDefault()),m!==g&&m!==x&&g!==x&&(null==(r=e.origin)||r.preventDefault()),this.item.composition.camera.position=new e3(p,m,h)}},r.beginDragTarget=function(t,e){var r,n=this;if("camera"===t.target){var a={touchstart:function(t){if(n.canInteract()&&(n.invalidByBorderRange=n.checkInvalidBorderRange({x:t.x,y:t.y}),!n.invalidByBorderRange)){n.dragEvent=null,n.bouncingArg=null;var e,i=null==(e=n.item.composition)?void 0:e.camera;r={x:t.x,y:t.y,cameraParam:{position:(null==i?void 0:i.position.toArray())||[0,0,8],fov:(null==i?void 0:i.fov)||60}}}},touchmove:function(t){n.invalidByBorderRange||(n.handleDragMove(r,t),n.bouncingArg=t)},touchend:function(t){if(n.canInteract()){var e=n.bouncingArg;!oG(e,3)&&e&&(e.vx*=n.speed,e.vy*=n.speed,n.dragEvent=i7({},r)),r=null}}};Object.keys(a).forEach(function(t){e.addEventListener(t,a[t])}),a.touchmove({dx:0,dy:0,width:1,height:1}),this.item.getComponent(i).endDragTarget=function(){Object.keys(a).forEach(function(t){e.removeEventListener(t,a[t])})}}},r.getBoundingBox=function(){var e=this.transform.getWorldMatrix(),i=nW(e3.ZERO,.5*this.transform.size.x,.5*this.transform.size.y);return i.forEach(function(t){e.transformPoint(t.p0),e.transformPoint(t.p1),e.transformPoint(t.p2)}),{type:t.HitTestType.triangle,area:i}},r.fromData=function(t){if(e.prototype.fromData.call(this,t),this.interactData=t,t.options.type===tj.DRAG){var i=t.options;i.dxRange&&(this.dragRange.dxRange=i.dxRange),i.dyRange&&(this.dragRange.dyRange=i.dyRange)}},r.canInteract=function(){var t;return!!(null==(t=this.item.composition)?void 0:t.interactive)&&this._interactive},r.checkInvalidBorderRange=function(t){var e=this.invalidBorderRange;if(e){var i,r,n,a,o=0,s=0,u=0,h=0;if("number"==typeof e?(o=e,s=e,u=e,h=e):iC(e)&&(o=void 0===(i=e[0])?0:i,s=void 0===(r=e[1])?0:r,u=void 0===(n=e[2])?0:n,h=void 0===(a=e[3])?0:a),t.x<h-1||t.x>1-s||t.y<o-1||t.y>1-u)return!0}return!1},rI(i,[{key:"interactive",get:function(){return this._interactive},set:function(t){this._interactive=t,t||(this.bouncingArg=null)}}]),i}(n_),t.InteractComponent=eG([iZ(em.InteractComponent)],t.InteractComponent);var oW=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="sprite",e}return iB(e,t),e}(oI(iD));t.SpriteRotation=void 0,(tA=t.SpriteRotation||(t.SpriteRotation={}))[tA.None=0]="None",tA[tA.Rotate90=1]="Rotate90",t.Sprite=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).rect=[0,0,1,1],r.rotation=0,i&&r.fromData(i),r}return iB(e,t),e.prototype.fromData=function(e){var i,r;t.prototype.fromData.call(this,e),this.texture=e.texture?this.engine.findObject(e.texture):this.engine.whiteTexture,this.rect=null!=(i=e.rect)?i:[0,0,1,1],this.rotation=null!=(r=e.rotation)?r:0},e}(iQ),t.Sprite=eG([iZ("Sprite")],t.Sprite);var oj=function(){function t(){this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1,this.duration=0,this.destroyed=!1,this.playState=0,this.time=0}var e=t.prototype;return e.play=function(){switch(this.playState){case 0:break;case 1:this.playState=0,this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1}},e.pause=function(){0===this.playState&&(this.playState=1,this.onPlayablePauseFlag=!0,this.onPlayablePlayFlag=!1)},e.setTime=function(t){this.time=t},e.getTime=function(){return this.time},e.setDuration=function(t){this.duration=t},e.getDuration=function(){return this.duration},e.getPlayState=function(){return this.playState},e.prepareFrame=function(t){},e.processFrame=function(t){},e.onPlayableDestroy=function(){},e.dispose=function(){this.destroyed||(this.onPlayableDestroy(),this.destroyed=!0)},t}(),oX=function(){function t(){this.context={deltaTime:0,output:this}}var e=t.prototype;return e.setUserData=function(t){this.userData=t},e.getUserData=function(){return this.userData},e.prepareFrame=function(){},e.processFrame=function(){},t}(),oH=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(iQ);t.PlayState=void 0,(tP=t.PlayState||(t.PlayState={}))[tP.Playing=0]="Playing",tP[tP.Paused=1]="Paused",tP[tP.Stopped=2]="Stopped";var oY=[1,1,1,1],oZ=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.renderColor=[1,1,1,1],t}iB(i,e);var r=i.prototype;return r.processFrame=function(e){var i,r,n,a=e.output.getUserData();if(eU(a,t.VFXItem)){if(this.activeComponent||(this.activeComponent=this.getActiveComponent(a)),!this.activeMaterial){this.activeMaterial=null==(o=this.activeComponent)?void 0:o.material;var o,s,u=null==(s=this.activeMaterial)?void 0:s.getColor("_Color");u&&(this.startColor=u.toArray())}var h=nz(oY,1),l=this.time/this.getDuration(),c=this.opacityOverLifetime,f=this.colorOverLifetime;f&&(h=e8(f,l,!0),i=!0),c&&(h[3]*=c.getValue(l),i=!0),i&&(nB(this.renderColor,h,this.startColor),null==(n=this.activeMaterial)||null==(r=n.getColor("_Color"))||r.setFromArray(this.renderColor))}},r.create=function(t){this.clipData=t;var e,i=t.colorOverLifetime;return i&&(this.opacityOverLifetime=aT(null!=(e=i.opacity)?e:1),i.color&&i.color[0]===tJ.GRADIENT_COLOR&&(this.colorOverLifetime=e9(i.color[1]))),this},r.getActiveComponent=function(t){return t.getComponent(oE)},i}(oj),oq=function(){function t(){}return t.prototype.onEvent=function(t,e){},t}(),oK=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.onEvent=function(t,e){t.emit("animationevent",e)},e}(oI(oq));t.AnimationClip=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.positionCurves=[],e.rotationCurves=[],e.eulerCurves=[],e.scaleCurves=[],e.floatCurves=[],e.colorCurves=[],e.events=[],e}iB(e,t);var i=e.prototype;return i.sampleAnimation=function(t,e){for(var i,r=e1(e,0,this.duration),n=ij(this.positionCurves);!(i=n()).done;){var a=i.value,o=a.keyFrames.getValue(r),s=this.findTarget(t,a.path);null==s||s.transform.setPosition(o.x,o.y,o.z)}for(var u,h=ij(this.rotationCurves);!(u=h()).done;){var l=u.value,c=l.keyFrames.getValue(r),f=this.findTarget(t,l.path);null==f||f.transform.setQuaternion(c.x,c.y,c.z,c.w)}for(var d,p=ij(this.eulerCurves);!(d=p()).done;){var m=d.value,v=m.keyFrames.getValue(r),y=this.findTarget(t,m.path);null==y||y.transform.setRotation(v.x,v.y,v.z)}for(var g,x=ij(this.scaleCurves);!(g=x()).done;){var b=g.value,T=b.keyFrames.getValue(r),C=this.findTarget(t,b.path);null==C||C.transform.setScale(T.x,T.y,T.z)}},i.fromData=function(t){this.positionCurves.length=0,this.scaleCurves.length=0,this.rotationCurves.length=0,this.eulerCurves.length=0,this.floatCurves.length=0,this.colorCurves.length=0;var e=0;if(t.positionCurves)for(var i,r=ij(t.positionCurves);!(i=r()).done;){var n=i.value,a={path:n.path,keyFrames:aT(n.keyFrames)};e=Math.max(e,a.keyFrames.getMaxTime()),this.positionCurves.push(a)}if(t.rotationCurves)for(var o,s=ij(t.rotationCurves);!(o=s()).done;){var u=o.value,h={path:u.path,keyFrames:aT(u.keyFrames)};e=Math.max(e,h.keyFrames.getMaxTime()),this.rotationCurves.push(h)}if(t.eulerCurves)for(var l,c=ij(t.eulerCurves);!(l=c()).done;){var f=l.value,d={path:f.path,keyFrames:aT(f.keyFrames)};e=Math.max(e,d.keyFrames.getMaxTime()),this.eulerCurves.push(d)}if(t.scaleCurves)for(var p,m=ij(t.scaleCurves);!(p=m()).done;){var v=p.value,y={path:v.path,keyFrames:aT(v.keyFrames)};e=Math.max(e,y.keyFrames.getMaxTime()),this.scaleCurves.push(y)}if(t.floatCurves)for(var g,x=ij(t.floatCurves);!(g=x()).done;){var b=g.value,T={path:b.path,keyFrames:aT(b.keyFrames),property:b.property,className:b.className};e=Math.max(e,T.keyFrames.getMaxTime()),this.floatCurves.push(T)}if(t.colorCurves)for(var C,E=ij(t.colorCurves);!(C=E()).done;){var _=C.value,w={path:_.path,keyFrames:aT(_.keyFrames),property:_.property,className:_.className};e=Math.max(e,w.keyFrames.getMaxTime()),this.colorCurves.push(w)}if(void 0!==t.duration?this.duration=t.duration:this.duration=e,t.events)for(var S,M=ij(t.events);!(S=M()).done;){var A,P=S.value,R={name:P.name,startTime:P.startTime,duration:null!=(A=P.duration)?A:0,event:new oK};this.events.push(R)}},i.findTarget=function(t,e){for(var i,r=t,n=e.split("."),a=ij(n);!(i=a()).done;){for(var o,s=i.value,u=!1,h=ij(r.children);!(o=h()).done;){var l=o.value;if(l.name===s){r=l,u=!0;break}}if(!u)return}return r},e}(iQ),t.AnimationClip=eG([iZ(em.AnimationClip)],t.AnimationClip);var oQ=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.clipPlayables=[],e.clipWeights=[],e}iB(e,t);var i=e.prototype;return i.processFrame=function(t){for(var e,i=ij(this.clipPlayables);!(e=i()).done;)e.value.processFrame(t);this.evaluate(t)},i.setClipWeight=function(t,e){if(eU(t,oj)){for(var i=0;i<this.clipPlayables.length;i++)if(this.clipPlayables[i]===t){this.clipWeights[i]=e;return}}else this.clipWeights.length<t+1&&(this.clipWeights.length=t+1),this.clipWeights[t]=e},i.getClipWeight=function(t){return this.clipWeights[t]},i.getClipPlayable=function(t){return this.clipPlayables[t]},i.evaluate=function(t){},e}(oj),oJ=function(e){function i(){return e.apply(this,arguments)}return iB(i,e),i.prototype.evaluate=function(e){var i=e.output.getUserData();if(eU(i,t.VFXItem)){for(var r=!1,n=0;n<this.clipPlayables.length;n++)if(this.getClipWeight(n)>0){r=!0;break}r?(i.transform.setValid(!0),i.setActive(!0)):(i.transform.setValid(!1),i.setActive(!1))}},i}(oQ),o$=function(e){function i(){return e.apply(this,arguments)}return iB(i,e),i.prototype.processFrame=function(e){var i=e.output.getUserData();eU(i,t.VFXItem)&&(i.time=this.time)},i}(oj),o0=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.processFrame=function(t){this.value=this.curve.getValue(this.time/this.getDuration())},e}(oj),o1=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.propertyPath="",e.propertyName="",e}iB(e,t);var i=e.prototype;return i.evaluate=function(t){var e=t.output.getUserData();if(e){this.directTarget||this.preparePath(e);var i=!1;if(this.propertyValue=this.directTarget[this.propertyName],void 0!==this.propertyValue&&null!==this.propertyValue){this.resetPropertyValue();for(var r=0;r<this.clipPlayables.length;r++){var n=this.getClipWeight(r);if(n>0){var a=this.getClipPlayable(r);if(!eU(a,o0)){console.error("PropertyTrack added non-PropertyPlayableAsset");continue}var o=a.value;this.addWeightedValue(o,n),i=!0}}i&&(this.directTarget[this.propertyName]=this.propertyValue,eU(e,rO)&&e.onApplyAnimationProperties())}}},i.preparePath=function(t){for(var e=this.propertyPath.split("."),i=t,r=0;r<e.length-1;r++){var n=i[e[r]];void 0===n&&console.error("The "+e[r]+" property of "+t+" was not found"),i=n}e.length>0&&(this.propertyName=e[e.length-1]),this.directTarget=i},e}(oQ),o2=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.setZero()},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.r+=t.r*e,i.g+=t.g*e,i.b+=t.b*e,i.a+=t.a*e},e}(o1),o3=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue=0},i.addWeightedValue=function(t,e){this.propertyValue+=t*e},e}(o1),o4=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.evaluate=function(t){},e}(oQ),o5=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.evaluate=function(t){},e}(oQ),o6=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.evaluate=function(t){var e=t.output.getUserData();if(e){for(var i=0;i<this.clipPlayables.length;i++)if(this.getClipWeight(i)>0){var r=this.getClipPlayable(i);eU(r,o0)&&r.value&&(e.sprite=r.value);break}}},e}(oQ),o8=function(e){function i(){return e.apply(this,arguments)}return iB(i,e),i.prototype.processFrame=function(e){var i=e.output.getUserData();eU(i,t.CompositionComponent)&&i.tick(this.getTime()-i.getTime())},i}(oj),o9=function(e){function i(){return e.apply(this,arguments)}return iB(i,e),i.prototype.evaluate=function(e){var i=e.output.getUserData();if(eU(i,t.CompositionComponent)){for(var r=!1,n=0;n<this.clipPlayables.length;n++)if(this.getClipWeight(n)>0){r=!0;break}r?i.item.setActive(!0):i.item.setActive(!1)}},i}(oQ),o7=function(){function t(){this.hasContribution=!1,this.hasPosition=!1,this.hasRotation=!1,this.hasScale=!1,this.appliedPosition=!1,this.appliedRotation=!1,this.appliedScale=!1,this.outPos=new e3,this.outRot=new nh,this.outScale=new e3(1,1,1),this.weightedRot=new nh}var e=t.prototype;return e.captureBasePose=function(t){this.ensureBasePose(t)},e.getBasePosition=function(){var t;return null==(t=this.basePose)?void 0:t.position},e.resetFrame=function(){this.hasContribution=!1,this.hasPosition=!1,this.hasRotation=!1,this.hasScale=!1},e.addContribution=function(t,e,i){if(!(i<=0)){if(this.ensureBasePose(t),!this.hasContribution){var r=this.basePose;this.outPos.copyFrom(r.position),this.outRot.copyFrom(r.rotation),this.outScale.copyFrom(r.scale),this.hasContribution=!0}e.hasPosition&&(this.hasPosition=!0,this.outPos.x+=e.position.x*i,this.outPos.y+=e.position.y*i,this.outPos.z+=e.position.z*i),e.hasRotation&&(this.hasRotation=!0,this.weightedRot.set(e.rotation.x*i,e.rotation.y*i,e.rotation.z*i,e.rotation.order),this.outRot.addEulers(this.outRot,this.weightedRot)),e.hasScale&&(this.hasScale=!0,this.outScale.x*=Math.pow(e.scale.x,i),this.outScale.y*=Math.pow(e.scale.y,i),this.outScale.z*=Math.pow(e.scale.z,i))}},e.flush=function(t){var e=this.basePose;e&&(this.hasContribution||this.appliedPosition||this.appliedRotation||this.appliedScale)&&(this.hasPosition?(t.transform.setPosition(this.outPos.x,this.outPos.y,this.outPos.z),this.appliedPosition=!0):this.appliedPosition&&(t.transform.setPosition(e.position.x,e.position.y,e.position.z),this.appliedPosition=!1),this.hasRotation?(t.transform.setRotation(this.outRot.x,this.outRot.y,this.outRot.z),this.appliedRotation=!0):this.appliedRotation&&(t.transform.setRotation(e.rotation.x,e.rotation.y,e.rotation.z),this.appliedRotation=!1),this.hasScale?(t.transform.setScale(this.outScale.x,this.outScale.y,this.outScale.z),this.appliedScale=!0):this.appliedScale&&(t.transform.setScale(e.scale.x,e.scale.y,e.scale.z),this.appliedScale=!1))},e.dispose=function(){this.basePose=void 0,this.boundInstanceId=void 0,this.appliedPosition=!1,this.appliedRotation=!1,this.appliedScale=!1,this.resetFrame()},e.ensureBasePose=function(t){if(!this.basePose||this.boundInstanceId!==t.getInstanceId()){var e=t.transform.scale;this.basePose={position:t.transform.position.clone(),rotation:t.transform.getRotation().clone(),scale:new e3(e.x,e.y,e.x)},this.boundInstanceId=t.getInstanceId(),this.appliedPosition=!1,this.appliedRotation=!1,this.appliedScale=!1}},t}(),st=new nh,se=new e3,si=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.started=!1,t.contribution={hasPosition:!1,position:new e3,hasRotation:!1,rotation:new nh,hasScale:!1,scale:new e3(1,1,1)},t}iB(i,e);var r=i.prototype;return r.start=function(){var t,e=this.data.positionOverLifetime,i=this.data.rotationOverLifetime,r=this.data.sizeOverLifetime;if(e&&0!==Object.keys(e).length){this.positionOverLifetime=e,e.path&&(this.pathGetter=aT(e.path));var n=e.linearX||e.linearY||e.linearZ;n&&(this.linearVelOverLifetime={x:e.linearX&&aT(e.linearX),y:e.linearY&&aT(e.linearY),z:e.linearZ&&aT(e.linearZ),asMovement:e.asMovement,enabled:!!n});var a=e.orbitalX||e.orbitalY||e.orbitalZ;a&&(this.orbitalVelOverLifetime={x:e.orbitalX&&aT(e.orbitalX),y:e.orbitalY&&aT(e.orbitalY),z:e.orbitalZ&&aT(e.orbitalZ),center:nD(e.orbCenter),asRotation:e.asRotation,enabled:!!a}),this.speedOverLifetime=e.speedOverLifetime&&aT(e.speedOverLifetime)}if(r&&(r.separateAxes?(this.sizeSeparateAxes=!0,this.sizeXOverLifetime=aT(r.x||1),this.sizeYOverLifetime=aT(r.y||1),this.sizeZOverLifetime=aT(r.z||1)):this.sizeXOverLifetime=aT(r.size||1)),i&&(this.rotationOverLifetime={asRotation:i.asRotation,separateAxes:i.separateAxes,z:aT(i.z||0)},i.separateAxes)){var o=this.rotationOverLifetime;o.x=aT(i.x||0),o.y=aT(i.y||0)}this.gravity=e3.fromArray((null==e?void 0:e.gravity)||[]),this.gravityModifier=aT(null!=(t=null==e?void 0:e.gravityOverLifetime)?t:0),this.direction=(null==e?void 0:e.direction)?e3.fromArray(e.direction).normalize():new e3,this.startSpeed=(null==e?void 0:e.startSpeed)||0,this.velocity=this.direction.clone(),this.velocity.multiply(this.startSpeed)},r.processFrame=function(e){this.ensureStarted();var i=e.output.getUserData();!this.originalTransform&&eU(i,t.VFXItem)&&this.captureOriginalTransform(i)},r.getContribution=function(t){return this.ensureStarted(),this.sampleAnimation(t),this.contribution},r.ensureStarted=function(){this.started||(this.start(),this.started=!0)},r.sampleAnimation=function(t){var e,i=this,r=this.contribution;r.hasPosition=!1,r.hasRotation=!1,r.hasScale=!1;var n=this.getDuration();if(!(n<=0)){var a=this.time/n;if(a=a<0?0:a,this.sizeXOverLifetime?(r.hasScale=!0,r.scale.x=this.sizeXOverLifetime.getValue(a),this.sizeSeparateAxes?(r.scale.y=this.sizeYOverLifetime.getValue(a),r.scale.z=this.sizeZOverLifetime.getValue(a)):r.scale.z=r.scale.y=r.scale.x):r.hasScale=!1,this.rotationOverLifetime){r.hasRotation=!0;var o=function(t){return i.rotationOverLifetime.asRotation?t.getValue(a):t.getIntegrateValue(0,a,n)},s=o(this.rotationOverLifetime.z),u=this.rotationOverLifetime.separateAxes;st.x=u?o(this.rotationOverLifetime.x):0,st.y=u?o(this.rotationOverLifetime.y):0,st.z=s,r.rotation.copyFrom(st)}else r.hasRotation=!1;this.positionOverLifetime?(r.hasPosition=!0,(null==(e=this.orbitalVelOverLifetime)?void 0:e.enabled)&&t?(nk(r.position,this,this.gravity,this.time,n,t,this.velocity),this.pathGetter&&r.position.add(this.pathGetter.getValue(a)),r.position.subtract(t)):(se.set(0,0,0),nk(r.position,this,this.gravity,this.time,n,se,this.velocity),this.pathGetter&&r.position.add(this.pathGetter.getValue(a)))):r.hasPosition=!1}},r.captureOriginalTransform=function(t){var e=t.transform.scale;this.originalTransform={position:t.transform.position.clone(),rotation:t.transform.getRotation().clone(),scale:new e3(e.x,e.y,e.x)},this.pathGetter&&(this.originalTransform.path=this.pathGetter)},i}(oj);t.TransformPlayableAsset=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.createPlayable=function(){var t=new si;return t.data=this.transformAnimationData,t},i.fromData=function(t){this.transformAnimationData=t},e}(oH),t.TransformPlayableAsset=eG([iZ(em.TransformPlayableAsset)],t.TransformPlayableAsset);var sr=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.clipMixer=new o7,t}iB(i,e);var r=i.prototype;return r.dispose=function(){this.clipMixer.dispose(),e.prototype.dispose.call(this)},r.evaluate=function(e){var i=e.output.getUserData();if(eU(i,t.VFXItem)){this.clipMixer.captureBasePose(i),this.clipMixer.resetFrame();for(var r=0;r<this.clipPlayables.length;r++){var n=this.clipWeights[r];if(n&&!(n<=0)){var a=this.clipPlayables[r];eU(a,si)&&this.clipMixer.addContribution(i,a.getContribution(this.clipMixer.getBasePosition()),n)}}this.clipMixer.flush(i)}},i}(oQ),sn=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0,this.propertyValue.z=0,this.propertyValue.w=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e,i.z+=t.z*e,i.w+=t.w*e},e}(o1),sa=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0,this.propertyValue.z=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e,i.z+=t.z*e},e}(o1),so=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e},e}(o1),ss=function(){function t(){this.start=0,this.duration=0}return t.prototype.toLocalTime=function(t){var e=t-this.start,i=this.duration;return e-i>0&&(this.endBehavior===t0.restart?e%=i:this.endBehavior===t0.freeze&&(e=Math.min(i,e))),e},t}();t.TrackAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.trackType=0,e.clipSeed=0,e.clips=[],e.children=[],e}iB(e,t);var i=e.prototype;return i.updateAnimatedObject=function(t){return t},i.createTrackMixer=function(){return new oQ},i.createOutput=function(){return new oX},i.createPlayableGraph=function(t){return this.createMixerPlayableGraph(t)},i.createMixerPlayableGraph=function(t){for(var e,i=[],r=ij(this.clips);!(e=r()).done;){var n=e.value;i.push(n)}return this.compileClips(i,t)},i.compileClips=function(t,e){for(var i,r=this.createTrackMixer(),n=ij(t);!(i=n()).done;){var a=i.value,o=this.createClipPlayable(a);o.setDuration(a.duration);var s=new su(a,o,r);e.push(s),r.clipPlayables.push(o),r.setClipWeight(o,0)}return r},i.createPlayable=function(){return new oj},i.getChildTracks=function(){return this.children},i.addChild=function(t){this.children.push(t),t.parent=this},i.createClip=function(t,e){var i=new ss;return i.asset=new t(this.engine),i.name=e||"TimelineClip"+i.id,this.addClip(i),i},i.getClips=function(){return this.clips},i.findClip=function(t){for(var e,i=ij(this.clips);!(e=i()).done;){var r=e.value;if(r.name===t)return r}},i.addClip=function(t){t.id=(this.clipSeed++).toString(),this.clips.push(t)},i.createClipPlayable=function(t){return t.asset.createPlayable()},i.fromData=function(e){t.prototype.fromData.call(this,e);for(var i,r=ij(this.children);!(i=r()).done;)i.value.parent=this},e}(oH),eG([iK(ss,void 0)],t.TrackAsset.prototype,"clips",void 0),eG([iK(void 0,void 0)],t.TrackAsset.prototype,"children",void 0),t.TrackAsset=eG([iZ(em.TrackAsset)],t.TrackAsset),t.TrackType=void 0,(tR=t.TrackType||(t.TrackType={}))[tR.MasterTrack=0]="MasterTrack",tR[tR.ObjectTrack=1]="ObjectTrack";var su=function(){function e(t,e,i){this.clip=t,this.playable=e,this.parentMixer=i}return e.prototype.evaluateAt=function(e){var i=this.clip,r=1,n=!1,a=!1;e>=i.start+i.duration&&i.endBehavior===t0.destroy?(r=0,n=!0):e-this.clip.start>=0?(r=1,a=!0):e<i.start&&(r=0),a&&this.playable.getPlayState()!==t.PlayState.Playing&&this.playable.play(),this.parentMixer.setClipWeight(this.playable,r);var o=i.toLocalTime(e);this.playable.setTime(o),n&&this.playable.getPlayState()===t.PlayState.Playing&&this.playable.pause()},rI(e,[{key:"enable",set:function(t){t?this.playable.play():(this.parentMixer.setClipWeight(this.playable,0),this.playable.pause())}}]),e}();t.ActivationTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){return new oJ},e}(t.TrackAsset),t.ActivationTrack=eG([iZ(em.ActivationTrack)],t.ActivationTrack);var sh=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.propertyNames=[],e.path="",e}return iB(e,t),e.prototype.fromData=function(e){t.prototype.fromData.call(this,e);var i=this.path.split(".");this.propertyNames=i},e}(t.TrackAsset);eG([iK(void 0,void 0)],sh.prototype,"path",void 0),t.FloatPropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){var t=new o3;return t.propertyPath=this.path,t},e}(sh),t.FloatPropertyTrack=eG([iZ(em.FloatPropertyTrack)],t.FloatPropertyTrack),t.SpriteColorTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){return new o5},e}(t.TrackAsset),t.SpriteColorTrack=eG([iZ(em.SpriteColorTrack)],t.SpriteColorTrack),t.SubCompositionTrack=function(e){function i(){return e.apply(this,arguments)}iB(i,e);var r=i.prototype;return r.updateAnimatedObject=function(e){if(!eU(e,t.VFXItem))throw Error("SubCompositionTrack needs to be set under the VFXItem track.");return e.getComponent(t.CompositionComponent)},r.createTrackMixer=function(){return new o9},i}(t.TrackAsset),t.SubCompositionTrack=eG([iZ(em.SubCompositionTrack)],t.SubCompositionTrack),t.TransformTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){return new sr},e}(t.TrackAsset),t.TransformTrack=eG([iZ(em.TransformTrack)],t.TransformTrack),t.MaterialTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.updateAnimatedObject=function(t){if(!eU(t,n_))throw Error("MaterialTrack: expected a RendererComponent bound object.");var e=t.materials;if(this.index>=e.length)throw Error("MaterialTrack: material index "+this.index+" out of bounds (length="+e.length+").");return e[this.index]},e}(t.TrackAsset),eG([iK(void 0,void 0)],t.MaterialTrack.prototype,"index",void 0),t.MaterialTrack=eG([iZ("MaterialTrack")],t.MaterialTrack);var sl=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){return new o4},e}(t.TrackAsset);t.Vector4PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){var t=new sn;return t.propertyPath=this.path,t},e}(sh),t.Vector4PropertyTrack=eG([iZ(em.Vector4PropertyTrack)],t.Vector4PropertyTrack),t.Vector3PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){var t=new sa;return t.propertyPath=this.path,t},e}(sh),t.Vector3PropertyTrack=eG([iZ(em.Vector3PropertyTrack)],t.Vector3PropertyTrack),t.Vector2PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){var t=new so;return t.propertyPath=this.path,t},e}(sh),t.Vector2PropertyTrack=eG([iZ(em.Vector2PropertyTrack)],t.Vector2PropertyTrack),t.ColorPropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){var t=new o2;return t.propertyPath=this.path,t},e}(sh),t.ColorPropertyTrack=eG([iZ(em.ColorPropertyTrack)],t.ColorPropertyTrack),t.SpritePropertyTrack=function(e){function i(){return e.apply(this,arguments)}iB(i,e);var r=i.prototype;return r.createTrackMixer=function(){return new o6},r.updateAnimatedObject=function(e){return e.getComponent(t.SpriteComponent)},i}(sh),t.SpritePropertyTrack=eG([iZ("SpritePropertyTrack")],t.SpritePropertyTrack);var sc=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=sf(this.arc,this.arcMode,t)*eQ,i=new e3(Math.cos(e)*this.radius,Math.sin(e)*this.radius,0),r=Math.tan(this.angle*eQ),n=i.clone().multiply(r);return n.z+=1,{position:i.multiply(iM(0,1)),direction:n.normalize()}},t}();function sf(t,e,i){if(e===t2.RANDOM)t=iM(0,t);else if(e===t2.UNIDIRECTIONAL_CYCLE){var r=i.index%(i.total+1);t=t/i.total*r}else if(e===t2.BIDIRECTIONAL_CYCLE){var n=i.index/(i.total+1),a=n-Math.floor(n);t*=Math.floor(n)%2?1-a:a}else e===t2.UNIFORM_BURST&&(t=t*i.burstIndex/i.burstCount);return t}var sd=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=sf(this.arc,this.arcMode,t)*eQ,i=new e3(Math.cos(e),Math.sin(e),0),r=this.radius;return{direction:i,position:i.clone().multiply(r)}},t}(),sp=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2}return t.prototype.generate=function(t){var e=iM(-this._d,this._d),i=iM(-this._h,this._h);return{direction:new e3(0,0,1),position:new e3(e,i,0)}},t}(),sm=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2,this.arcMode=t.arcMode,this.arc=t.arc}return t.prototype.generate=function(t){var e=sf(this.arc,this.arcMode,t)*eQ,i=new e3(Math.cos(e),Math.sin(e),0),r=this._d,n=this._h,a=Math.atan2(n,r),o=Math.tan(e),s=new e3;return e<a?s.set(r,r*o,0):e>=a&&e<Math.PI-a?s.set(n/o,n,0):e<Math.PI+a?s.set(-r,-r*o,0):e<2*Math.PI-a?s.set(-n/o,-n,0):s.set(r,r*o,0),{direction:i,position:s}},t}(),sv=function(){function t(t){this._d=t.width||1,this.arcMode=t.arcMode}return t.prototype.generate=function(t){var e=this.arcMode===t2.UNIFORM_BURST?t.burstIndex%t.burstCount/(t.burstCount-1):iM(0,1);return{direction:new e3(0,1,0),position:new e3(this._d*(e-.5),0,0)}},t}(),sy=new nu,sg=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=this.donutRadius,i=this.radius-e,r=iM(0,2*Math.PI),n=sf(this.arc,this.arcMode,t)*eQ,a=sy.setFromRotationZ(n),o=new e3(Math.cos(r),Math.sin(r),0),s=new e3(i+Math.cos(r)*e,0,Math.sin(r)*e);return{direction:a.transformNormal(o),position:a.transformPoint(s)}},t}(),sx=new nu,sb=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}var e=t.prototype;return e.getHorizontalAngle=function(){return iM(-90,90)},e.generate=function(t){var e=sf(this.arc,this.arcMode,t)*eQ,i=this.getHorizontalAngle()*eQ,r=this.radius,n=new e3(Math.cos(i),0,Math.sin(i)),a=sx.setFromRotationZ(e).transformNormal(n);return{position:a.clone().multiply(r),direction:a}},t}(),sT=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.getHorizontalAngle=function(){return iM(0,90)},e}(sb),sC=function(){function t(t){var e=t.detail||{anchors:[.5,.5],block:[0,0]};this.anchors=new Float32Array(e.anchors),this.width=t.width||1,this.height=t.height||1,this.block=e.block,this.arcMode=t.arcMode,this.random=e1(t.random||0,0,1)}return t.prototype.generate=function(t){var e=this.anchors,i=Math.floor(sf(e.length/2-1,this.arcMode,t)),r=(e[2*i]+this.block[0]*this.random*Math.random())%1-.5,n=(e[2*i+1]+this.block[1]*this.random*Math.random())%1-.5,a=new e3(r,n,0);return{position:new e3(r*this.width,n*this.height,0),direction:a.normalize()}},t}(),sE=function(){function t(){}return t.prototype.generate=function(){return{position:new e3,direction:new e3}},t}(),s_=((eP={})[tG.NONE]=sE,eP[tG.CONE]=sc,eP[tG.SPHERE]=sb,eP[tG.HEMISPHERE]=sT,eP[tG.CIRCLE]=sd,eP[tG.DONUT]=sg,eP[tG.RECTANGLE]=sp,eP[tG.EDGE]=sv,eP[tG.RECTANGLE_EDGE]=sm,eP[tG.TEXTURE]=sC,eP);function sw(t){if(!t)return new sE;var e=i7({radius:1,arc:360,angle:0,arcMode:t2.RANDOM},t),i=t.type,r=s_[i];if(!r)throw Error("Invalid shape: "+i+".");var n=new r(e);if(i!==tG.NONE){var a=t.alignSpeedDirection,o=t.upDirection;n.alignSpeedDirection=a,n.upDirection=e3.fromArray(void 0===o?[0,0,1]:o).normalize()}return n}function sS(t,e,i,r,n){var a,o;if(n===function(t,e,i,r){for(var n=0,a=e,o=i-r;a<i;a+=r)n+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return n}(t,e,i,r)>0)for(a=e;a<i;a+=r)o=sD(a,t[a],t[a+1],o);else for(a=i-r;a>=e;a-=r)o=sD(a,t[a],t[a+1],o);return o&&sO(o,o.next)&&(sz(o),o=o.next),o}function sM(t,e){if(!t)return t;e||(e=t);var i,r=t;do if(i=!1,!r.steiner&&(sO(r,r.next)||0===sI(r.prev,r,r.next))){if(sz(r),(r=e=r.prev)===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}function sA(t,e){return t.x-e.x}function sP(t,e,i,r,n){return(t=((t=((t=((t=((t=32767*(t-i)*n)|t<<8)&16711935)|t<<4)&252645135)|t<<2)&858993459)|t<<1)&1431655765)|(e=((e=((e=((e=((e=32767*(e-r)*n)|e<<8)&16711935)|e<<4)&252645135)|e<<2)&858993459)|e<<1)&1431655765)<<1}function sR(t,e,i,r,n,a,o,s){return(n-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(r-s)-(i-o)*(e-s)>=0&&(i-o)*(a-s)-(n-o)*(r-s)>=0}function sI(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function sO(t,e){return t.x===e.x&&t.y===e.y}function sL(t,e,i,r){var n=sV(sI(t,e,i)),a=sV(sI(t,e,r)),o=sV(sI(i,r,t)),s=sV(sI(i,r,e));return!!(n!==a&&o!==s||0===n&&sF(t,i,e)||0===a&&sF(t,r,e)||0===o&&sF(i,t,r)||0===s&&sF(i,e,r))}function sF(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function sV(t){return t>0?1:t<0?-1:0}function sN(t,e){return 0>sI(t.prev,t,t.next)?sI(t,e,t.next)>=0&&sI(t,t.prev,e)>=0:0>sI(t,e,t.prev)||0>sI(t,t.next,e)}function sk(t,e){var i=new sB(t.i,t.x,t.y),r=new sB(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function sD(t,e,i,r){var n=new sB(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function sz(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function sB(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var sU=0;function sG(t,e,i,r){i=i||2,sU=r||0;var n,a,o,s,u,h,l,c=e&&e.length,f=c?e[0]*i:t.length,d=sS(t,0,f,i,!0),p=[];if(!d||d.next===d.prev)return p;if(c&&(d=function(t,e,i,r){var n,a,o,s,u,h=[];for(n=0,a=e.length;n<a;n++)o=e[n]*r,s=n<a-1?e[n+1]*r:t.length,(u=sS(t,o,s,r,!1))===u.next&&(u.steiner=!0),h.push(function(t){var e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}(u));for(h.sort(sA),n=0;n<h.length;n++)(function(t,e){if(e=function(t,e){var i,r,n,a=e,o=t.x,s=t.y,u=-1/0;do{if(s<=a.y&&s>=a.next.y&&a.next.y!==a.y){var h=a.x+(s-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(h<=o&&h>u){if(u=h,h===o){if(s===a.y)return a;if(s===a.next.y)return a.next}n=a.x<a.next.x?a:a.next}}a=a.next}while(a!==e);if(!n)return null;if(o===u)return n;var l,c=n,f=n.x,d=n.y,p=1/0;a=n;do o>=a.x&&a.x>=f&&o!==a.x&&sR(s<d?o:u,s,f,d,s<d?u:o,s,a.x,a.y)&&(l=Math.abs(s-a.y)/(o-a.x),sN(a,t)&&(l<p||l===p&&(a.x>n.x||a.x===n.x&&(i=n,r=a,0>sI(i.prev,i,r.prev)&&0>sI(r.next,i,i.next))))&&(n=a,p=l)),a=a.next;while(a!==c);return n}(t,e)){var i=sk(e,t);sM(e,e.next),sM(i,i.next)}})(h[n],i),i=sM(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=o=t[0],a=s=t[1];for(var m=i;m<f;m+=i)u=t[m],h=t[m+1],u<n&&(n=u),h<a&&(a=h),u>o&&(o=u),h>s&&(s=h);l=0!==(l=Math.max(o-n,s-a))?1/l:0}return function t(e,i,r,n,a,o,s){if(e){!s&&o&&function(t,e,i,r){var n=t;do null===n.z&&(n.z=sP(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,a,o,s,u,h=1;do{for(i=t,t=null,a=null,o=0;i;){for(o++,r=i,s=0,e=0;e<h&&(s++,r=r.nextZ);e++);for(u=h;s>0||u>0&&r;)0!==s&&(0===u||!r||i.z<=r.z)?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,u--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=r}a.nextZ=null,h*=2}while(o>1)}(n)}(e,n,a,o);for(var u,h,l=e;e.prev!==e.next;){if(u=e.prev,h=e.next,o?function(t,e,i,r){var n=t.prev,a=t.next;if(sI(n,t,a)>=0)return!1;for(var o=n.x<t.x?n.x<a.x?n.x:a.x:t.x<a.x?t.x:a.x,s=n.y<t.y?n.y<a.y?n.y:a.y:t.y<a.y?t.y:a.y,u=n.x>t.x?n.x>a.x?n.x:a.x:t.x>a.x?t.x:a.x,h=n.y>t.y?n.y>a.y?n.y:a.y:t.y>a.y?t.y:a.y,l=sP(o,s,e,i,r),c=sP(u,h,e,i,r),f=t.prevZ,d=t.nextZ;f&&f.z>=l&&d&&d.z<=c;){if(f!==t.prev&&f!==t.next&&sR(n.x,n.y,t.x,t.y,a.x,a.y,f.x,f.y)&&sI(f.prev,f,f.next)>=0||(f=f.prevZ,d!==t.prev&&d!==t.next&&sR(n.x,n.y,t.x,t.y,a.x,a.y,d.x,d.y)&&sI(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&sR(n.x,n.y,t.x,t.y,a.x,a.y,f.x,f.y)&&sI(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=c;){if(d!==t.prev&&d!==t.next&&sR(n.x,n.y,t.x,t.y,a.x,a.y,d.x,d.y)&&sI(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}(e,n,a,o):function(t){var e=t.prev,i=t.next;if(sI(e,t,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(sR(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&sI(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}(e)){i.push(u.i/r+sU),i.push(e.i/r+sU),i.push(h.i/r+sU),sz(e),e=h.next,l=h.next;continue}if((e=h)===l){s?1===s?t(e=function(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!sO(n,a)&&sL(n,r,r.next,a)&&sN(n,a)&&sN(a,n)&&(e.push(n.i/i+sU),e.push(r.i/i+sU),e.push(a.i/i+sU),sz(r),sz(r.next),r=t=a),r=r.next}while(r!==t);return sM(r)}(sM(e),i,r),i,r,n,a,o,2):2===s&&function(e,i,r,n,a,o){var s=e;do{for(var u,h,l=s.next.next;l!==s.prev;){if(s.i!==l.i&&(u=s,h=l,u.next.i!==h.i&&u.prev.i!==h.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&sL(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(u,h)&&(sN(u,h)&&sN(h,u)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t);return r}(u,h)&&(sI(u.prev,u,h.prev)||sI(u,h.prev,h))||sO(u,h)&&sI(u.prev,u,u.next)>0&&sI(h.prev,h,h.next)>0))){var c=sk(s,l);s=sM(s,s.next),c=sM(c,c.next),t(s,i,r,n,a,o),t(c,i,r,n,a,o);return}l=l.next}s=s.next}while(s!==e)}(e,i,r,n,a,o):t(sM(e),i,r,n,a,o,1);break}}}}(d,p,i,n,a,l),p}function sW(t,e){for(var i,r,n=t.s,a=t.p,o=n[1],s=a[1],u=0,h=0;h<o.length;h++)u+=o[h].length-1;var l,c=new Float32Array(6*u),f=e.indexBase,d=e.uvTransform,p=0,m=0,v=0,y=1,g=1;d&&(m=d[0],v=d[1],y=(l=d[4])?d[3]:d[2],g=l?d[2]:d[3]);for(var x=[0,0],b=0===l?0:-Math.PI/2,T=0;T<o.length;T++)for(var C=o[T],E=s[T],_=s[T+1]||s[0],w=[0,0],S=0;S<C.length-1;S++)(function(t,e,i,r,n,a,o,s){var u=1-e,h=u*u*u,l=3*e*u*u,c=3*e*e*u,f=e*e*e;t[0]=h*i[0]+l*n+c*o+f*r[0],t[1]=h*i[1]+l*a+c*s+f*r[1]})(w,C[S],E,_,E[4],E[5],_[2],_[3]),i=w[0],r=w[1],c[p++]=i/2,c[p++]=r/2,d?(x[0]=i,x[1]=r,sX(x,x,b),c[p++]=m+(x[0]+1)/2*y,c[p++]=v+(x[1]+1)/2*g):(c[p++]=(i+1)/2,c[p++]=(r+1)/2),p+=2;var M=sG(Array.from(c),null,6,void 0===f?0:f);return{aPoint:c,index:new Uint16Array(M)}}function sj(t,e){for(var i,r=[],n=(i=[],("gs"in t)?t.gs.forEach(function(t){i.push({p:[tJ.SHAPE_POINTS,t.p],s:[tJ.SHAPE_SPLITS,t.s]})}):("g"in t)?i.push({p:[tJ.SHAPE_POINTS,t.g.p],s:[tJ.SHAPE_SPLITS,t.g.s]}):i.push(t),i),a=0,o=0,s=0,u=0;u<n.length;u++){var h=sW(n[u],{indexBase:a,uvTransform:e});a+=h.aPoint.length/5,r.push(h),o+=h.aPoint.length,s+=h.index.length}if(1===r.length)return r[0];for(var l=new Float32Array(o),c=new Uint16Array(s),f=0,d=0,p=0;f<r[f];f++){var m=r[f];l.set(m.aPoint,d),d+=m.aPoint.length,c.set(m.index,p),p+=m.index.length}return{aPoint:l,index:c}}function sX(t,e,i){var r=Math.cos(i),n=Math.sin(i),a=e[0],o=e[1];return t[0]=r*a+n*o,t[1]=-n*a+r*o,t}var sH=function(){function t(t){var e=t.time,i=t.interval,r=t.count,n=t.cycles,a=t.probability;this.time=+e||0,this.interval=+i||1,this.count=eU(r,n8)?r:aT(r),this.cycles=+n||1/0,this.probability=isNaN(a)?1:+a,this.reset()}var e=t.prototype;return e.getGeneratorOptions=function(t,e){if(t-this.time-this.now>this.interval*this.index&&this.internalCycles>0)return this.internalCycles--,this.index++,Math.random()<=this.probability?{index:this.index,total:1/this.interval,count:this.count.getValue(e),cycleIndex:this.cycles-this.internalCycles-1}:null},e.reset=function(){this.internalCycles=this.cycles,this.index=0,this.now=0},e.clone=function(){return new t({time:this.time,interval:this.interval,count:this.count,cycles:this.cycles,probability:this.probability})},t}(),sY=function(t){this.content=t},sZ=function(){function t(t){this.sort=t,this.length=0}var e=t.prototype;return e.findNodeByContent=function(t){var e=this.first;if(e)do if(t(e.content))return e;while(e=e.next)},e.insertNode=function(t,e){var i=t.next;t.next=e,e.pre=t,e.next=i,i&&(i.pre=e)},e.shiftNode=function(t){var e=new sY(t);if(this.length++,1===this.length)return this.first=this.last=e;for(var i=this.first;i;){if(!(0>=this.sort(i.content,e.content)))return i.pre?this.insertNode(i.pre,e):(this.first=e,e.next=i,i.pre=e),e;if(!i.next)return this.insertNode(i,e),this.last=e;i=i.next}},e.pushNode=function(t){var e=new sY(t);if(this.length++,1===this.length)return this.last=this.first=e;for(var i=this.last;i;){if(!(0>=this.sort(e.content,i.content)))return this.insertNode(i,e),i===this.last&&(this.last=e),e;if(this.first===i)return i.pre=e,e.next=i,this.first=e;i=i.pre}},e.removeNode=function(t){var e=this.first;if(this.length--,e===t){var i=this.first=e.next;i&&(i.pre=null)}else if((e=this.last)===t){var r=this.last=e.pre;r&&(r.next=null)}else if(t){var n=t.pre,a=t.next;n.next=a,a&&(a.pre=n)}t.pre=null,t.next=null},e.forEach=function(t,e){var i=this.first,r=0;if(i)do t.call(e||this,i.content,r++);while(i=i.next)},e.forEachReverse=function(t,e){var i=this.last,r=this.length-1;if(i)do t.call(e||this,i.content,r--);while(i=i.pre)},e.getNodeByIndex=function(t){var e=0,i=this.first;if(!i||t>=this.length||t<0)return null;for(;e<t;)i=i.next,e++;return i},t}(),sq=new e3,sK=new e3,sQ=function(){function e(e,i){this.pointStart=[];var r=i.colorOverLifetime,n=i.colorOverTrail,a=i.maxTrailCount,o=i.opacityOverLifetime,s=void 0===o?aT(1):o,u=i.widthOverTrail,h=i.name,l=i.occlusion,c=i.blending,f=i.texture,d=i.transparentOcclusion,p=i.minimumVertexDistance,m=i.lifetime,v=i.matrix,y=e.gpuCapability,g=y.detail,x=y.level,b=Math.max(i.pointCountPerTrail,2),T=ac(),C=g.maxVertexTextures>0,E=(null!=e?e:{}).env,_={},w=[["ENABLE_VERTEX_TEXTURE",C],["LOOKUP_TEXTURE_CURVE",0],["ENV_EDITOR",E===nw]],S=a>64,M=0;r&&(w.push(["COLOR_OVER_LIFETIME",!0]),M|=1,_.uColorOverLifetime=r7.createWithData(e,il(r))),n&&(w.push(["COLOR_OVER_TRAIL",!0]),M|=4,_.uColorOverTrail=r7.createWithData(e,il(n))),S?(w.push(["ATTR_TRAIL_START",1]),M|=8):_.uTrailStart=new Float32Array(a),_.uOpacityOverLifetimeValue=s.toUniform(T);var A=u.toUniform(T);w.push(["VERT_CURVE_VALUE_COUNT",T.index],["VERT_MAX_KEY_FRAME_COUNT",T.max]),_.uVCurveValues=n8.getAllData(T);var P={shader:{vertex:a4,fragment:a2,macros:w,glslVersion:1===x?t.GLSLVersion.GLSL1:t.GLSLVersion.GLSL3,shared:!0,name:"trail#"+h,cacheId:"-t:+"+M+"+"+T.index+"+"+T.max}},R=b*a*2,I=(b-1)*a,O=Float32Array.BYTES_PER_ELEMENT,L=12*O,F={attributes:{aColor:{size:4,stride:L,data:new Float32Array(12*R)},aSeed:{size:1,stride:L,offset:4*O,dataSource:"aColor"},aInfo:{size:3,stride:L,offset:5*O,dataSource:"aColor"},aPos:{size:4,stride:L,offset:8*O,dataSource:"aColor"},aTime:{size:1,data:new Float32Array(R)},aDir:{size:3,data:new Float32Array(3*R)}},indices:{data:new Uint16Array(6*R)},drawCount:6*I,name:"trail#"+h,bufferUsage:rV.DYNAMIC_DRAW};if(S)F.attributes.aTrailStart={size:1,data:new Float32Array(R)};else{var V=new Float32Array(R);F.attributes.aTrailStartIndex={size:1,data:V};for(var N=0;N<a;N++)for(var k=2*b,D=N*k,z=0;z<k;z++)V[D+z]=N}var B=rz(c),U=ng.create(e,P);U.blending=!0,U.depthMask=l,U.depthTest=!0,rB(U,c);var G=this.mesh=a$.create(e,{name:"MTrail_"+h,material:U,geometry:aK.create(e,F)}),W=null!=f?f:r7.createWithData(e);Object.keys(_).map(function(t){var e=_[t];if(eU(e,r7))U.setTexture(t,e);else if("uTrailStart"===t)U.setFloats("uTrailStart",e);else if("uVCurveValues"===t){for(var i=[],r=0;r<e.length;r+=4){var n=new e4(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}U.setVector4Array(t,i)}else U.setVector4(t,e4.fromArray(e))}),U.setFloat("uTime",0),U.setVector4("uWidthOverTrail",e4.fromArray(A)),U.setVector2("uTexOffset",new e2(0,0)),U.setVector4("uTextureMap",new e4(0,0,1,1)),U.setVector4("uParams",new e4(0,b-1,0,0)),U.setTexture("uMaskTex",W),U.setVector4("uColorParams",new e4(f?1:0,+B,0,+(l&&!d))),this.maxTrailCount=a,this.pointCountPerTrail=b,this.checkVertexDistance=p>0,this.minimumVertexDistance=Math.pow(p||.001,2),this.useAttributeTrailStart=S,this.lifetime=m,v&&(this.mesh.worldMatrix=v),this.geometry=G.firstGeometry(),this.trailCursors=new Uint16Array(a)}var i=e.prototype;return i.addPoint=function(t,e,i){i=i||{};var r=this.trailCursors[t],n=this.pointCountPerTrail,a=this.geometry,o=n-1,s=r%n,u=(r-1)%n,h=(r-2)%n,l=this.getTrailPosition(t,u,sq);if(!(l&&this.checkVertexDistance&&(null==l?void 0:l.distanceSquared(e))<this.minimumVertexDistance)){var c=t*n+s,f=s1(l,e),d=i.time||this.time,p=[Math.random(),i.lifetime||this.lifetime,r],m=i.size||1,v=new Float32Array(6);v.set(f,0),v.set(f,3),a.setAttributeSubData("aDir",6*c,v),a.setAttributeSubData("aTime",2*c,new Float32Array([d,d]));var y=i.color||[1,1,1,1],g=new Float32Array(24),x=e.toArray();if(g.set(y,0),g.set(p,4),g[7]=0,g.set(x,8),g[11]=.5*m,g.set(y,12),g.set(p,16),g[19]=1,g.set(x,20),g[23]=-.5*m,a.setAttributeSubData("aColor",24*c,g),u>=0){var b=new Float32Array(s1(this.getTrailPosition(t,h,sK),l,e)),T=(t*n+u)*6;a.setAttributeSubData("aDir",T,b),a.setAttributeSubData("aDir",T+3,b);var C=t*n*2,E=new Uint16Array([2*u+C,2*u+1+C,2*s+C,2*s+C,2*u+1+C,2*s+1+C]),_=(t*o+(r-1)%o)*6;a.setIndexSubData(_,E)}r=++this.trailCursors[t];var w=this.mesh.material,S=w.getVector4("uParams"),M=p[2];if(this.useAttributeTrailStart){for(var A=2*n,P=new Float32Array(A),R=0;R<A;R++)P[R]=M;a.setAttributeSubData("aTrailStart",t*P.length,P)}else{var I=w.getFloats("uTrailStart");void 0!=I&&(I[t]=M,w.setFloats("uTrailStart",I))}S&&(S.y=Math.max(S.y,r-1)-Math.max(0,r-n),w.setVector4("uParams",S))}},i.getTrailPosition=function(t,e,i){var r=this.pointCountPerTrail;if(e>=0&&e<r){var n=(t*r+e)*24+8,a=this.geometry.getAttributeData("aColor");return im(a),i.x=a[n],i.y=a[1+n],i.z=a[2+n],i}},i.clearAllTrails=function(){var t=this.geometry.getIndexData();im(t),this.trailCursors=new Uint16Array(this.trailCursors.length),this.geometry.setIndexData(new Uint16Array(t.length))},i.minusTime=function(t){var e=this.geometry.getAttributeData("aTime");im(e);for(var i=0;i<e.length;i++)e[i]-=t;this.geometry.setAttributeData("aTime",e),this.time-=t},i.clearTrail=function(t){if(0!==this.trailCursors[t]){var e=(this.pointCountPerTrail-1)*6,i=this.geometry.getIndexData();im(i),i.set(new Uint16Array(e),t*e),this.geometry.setIndexData(i),this.trailCursors[t]=0}},i.getPointStartPos=function(t){return this.pointStart[t]},i.setPointStartPos=function(t,e){this.pointStart[t]=e},i.onUpdate=function(t){},rI(e,[{key:"time",get:function(){return this.mesh.material.getFloat("uTime")||0},set:function(t){this.mesh.material.setFloat("uTime",null!=t?t:0)}}]),e}(),sJ=new e3,s$=new e3,s0=new e3;function s1(t,e,i){return t||i?(t?i?(s$.subtractVectors(e,t).normalize(),s$.subtractVectors(i,e),s0.copyFrom(s$).normalize(),sJ.addVectors(s$,s0)):sJ.subtractVectors(e,t):sJ.subtractVectors(i,e),sJ.normalize().toArray()):[0,0,0]}var s2=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.particleSystem=null,t}iB(i,e);var r=i.prototype;return r.getParticleSystem=function(e){if(this.particleSystem)return this.particleSystem;var i=e.output.getUserData();return eU(i,t.VFXItem)?(this.particleSystem=i.getComponent(t.ParticleSystem),this.particleSystem):null},r.processFrame=function(t){var e=this.getParticleSystem(t);if(e){for(this.time>=0&&this.time<e.time&&e.reset();e.time+.016<this.time;)e.simulate(.016);e.simulate(this.time-e.time)}},i}(oj),s3=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){return new s2},e}(oH),s4={uSprite:"vec4",uParams:"vec4",uAcceleration:"vec4",uGravityModifierValue:"vec4",uOpacityOverLifetimeValue:"vec4",uRXByLifeTimeValue:"vec4",uRYByLifeTimeValue:"vec4",uRZByLifeTimeValue:"vec4",uLinearXByLifetimeValue:"vec4",uLinearYByLifetimeValue:"vec4",uLinearZByLifetimeValue:"vec4",uSpeedLifetimeValue:"vec4",uOrbXByLifetimeValue:"vec4",uOrbYByLifetimeValue:"vec4",uOrbZByLifetimeValue:"vec4",uSizeByLifetimeValue:"vec4",uSizeYByLifetimeValue:"vec4",uColorParams:"vec4",uFSprite:"vec4",uPreviewColor:"vec4",uVCurveValues:"vec4Array",uFCurveValues:"vec4",uFinalTarget:"vec3",uForceCurve:"vec4",uOrbCenter:"vec3",uTexOffset:"vec2",uPeriodValue:"vec4",uMovementValue:"vec4",uStrengthValue:"vec4",uWaveParams:"vec4"},s5=function(){function e(e,i){this.particleCount=0,this.cachedRotationVector3=new e3,this.cachedRotationMatrix=new nl,this.cachedLinearMove=new e3,this.tempMatrix3=new nl,this.VERT_MAX_KEY_FRAME_COUNT=0;var r,n,a,o,s,u,h,l,c=(null!=e?e:{}).env,f=i.speedOverLifetime,d=i.colorOverLifetime,p=i.linearVelOverLifetime,m=i.orbitalVelOverLifetime,v=i.sizeOverLifetime,y=i.rotationOverLifetime,g=i.sprite,x=i.gravityModifier,b=i.maxCount,T=i.textureFlip,C=i.useSprite,E=i.name,_=i.gravity,w=i.forceTarget,S=i.side,M=i.occlusion,A=i.anchor,P=i.blending,R=i.transparentOcclusion,I=i.renderMode,O=void 0===I?0:I,L=i.diffuse,F=void 0===L?r7.createWithData(e):L,V=e.gpuCapability.detail,N=V.halfFloatTexture,k=V.maxVertexUniforms,D=[["RENDER_MODE",+O],["ENV_EDITOR",c===nw]],z=e.gpuCapability.level,B=ac(),U=ac(),G=k>0,W={},j=0,X=0;if(this.useSprite=C,G&&D.push(["ENABLE_VERTEX_TEXTURE",!0]),f&&(D.push(["SPEED_OVER_LIFETIME",!0]),X|=2,W.uSpeedLifetimeValue=f.toUniform(B)),(null==g?void 0:g.animate)&&(D.push(["USE_SPRITE",!0]),X|=4,W.uFSprite=W.uSprite=new Float32Array([g.col,g.row,g.total,g.blend?1:0]),this.useSprite=!0),(null==d?void 0:d.color)&&(D.push(["COLOR_OVER_LIFETIME",!0]),X|=16,W.uColorOverLifetime=eU(d.color,r7)?d.color:r7.createWithData(e,il(d.color))),(null==d?void 0:d.opacity)?W.uOpacityOverLifetimeValue=d.opacity.toUniform(B):W.uOpacityOverLifetimeValue=aT(1).toUniform(B),["x","y","z"].forEach(function(t,e){var i=0,r=0;(null==p?void 0:p[t])&&(W["uLinear"+t.toUpperCase()+"ByLifetimeValue"]=p[t].toUniform(B),i=1,X|=1<<7+e,p.enabled=!0),D.push(["LINEAR_VEL_"+t.toUpperCase(),i]),(null==m?void 0:m[t])&&(W["uOrb"+t.toUpperCase()+"ByLifetimeValue"]=m[t].toUniform(B),r=1,X|=1<<10+e,h=!0,m.enabled=!0),D.push(["ORB_VEL_"+t.toUpperCase(),r])}),(null==p?void 0:p.asMovement)&&(D.push(["AS_LINEAR_MOVEMENT",!0]),X|=32),h&&((null==m?void 0:m.asRotation)&&(D.push(["AS_ORBITAL_MOVEMENT",!0]),X|=64),W.uOrbCenter=new Float32Array((null==m?void 0:m.center)||[0,0,0])),W.uSizeByLifetimeValue=null==v?void 0:v.x.toUniform(B),(null==v?void 0:v.separateAxes)&&(D.push(["SIZE_Y_BY_LIFE",1]),X|=16384,W.uSizeYByLifetimeValue=null==v?void 0:null==(l=v.y)?void 0:l.toUniform(B)),(null==y?void 0:y.z)&&(W.uRZByLifeTimeValue=y.z.toUniform(B),X|=32768,D.push(["ROT_Z_LIFETIME",1])),(null==y?void 0:y.x)&&(W.uRXByLifeTimeValue=y.x.toUniform(B),X|=65536,D.push(["ROT_X_LIFETIME",1])),(null==y?void 0:y.y)&&(W.uRYByLifeTimeValue=y.y.toUniform(B),X|=131072,D.push(["ROT_Y_LIFETIME",1])),(null==y?void 0:y.asRotation)&&(D.push(["ROT_LIFETIME_AS_MOVEMENT",1]),X|=262144),W.uGravityModifierValue=x.toUniform(B),w&&(D.push(["FINAL_TARGET",!0]),X|=524288,W.uFinalTarget=new Float32Array(w.target||[0,0,0]),W.uForceCurve=w.curve.toUniform(B)),N&&U.max?(X|=1048576,W.uFCurveValueTexture=nt(e,n8.getAllData(U,!0),U.index,1)):W.uFCurveValues=n8.getAllData(U),B.max+B.curves.length-32>k&&N&&G){var H=nt(e,n8.getAllData(B,!0),B.index,1);W.uVCurveValueTexture=H,j=1}else W.uVCurveValues=n8.getAllData(B);var Y=["-p:",O,X,B.index,B.max,U.index,U.max].join("+");D.push(["VERT_CURVE_VALUE_COUNT",B.index],["FRAG_CURVE_VALUE_COUNT",U.index],["VERT_MAX_KEY_FRAME_COUNT",B.max],["FRAG_MAX_KEY_FRAME_COUNT",U.max]),this.VERT_MAX_KEY_FRAME_COUNT=B.max;var Z={fragment:a2,vertex:"#define LOOKUP_TEXTURE_CURVE "+j+"\n"+a3,glslVersion:1===z?t.GLSLVersion.GLSL1:t.GLSLVersion.GLSL3,shared:!0,cacheId:Y,macros:D,name:"particle#"+E},q=rz(P);W.uTexOffset=new Float32Array(F?[1/F.getWidth(),1/F.getHeight()]:[0,0]),W.uMaskTex=F,W.uColorParams=new Float32Array([F?1:0,+q,0,+(!!M&&!R)]),W.uParams=[0,0,0,0],W.uAcceleration=[(null==_?void 0:_[0])||0,(null==_?void 0:_[1])||0,(null==_?void 0:_[2])||0,0];var K=ng.create(e,{shader:Z});K.blending=!0,K.depthTest=!0,K.depthMask=!!M,rB(K,P),rU(K,S),Object.keys(W).map(function(t){var e=W[t];if(eU(e,r7)){K.setTexture(t,e);return}var i=[];switch(s4[t]){case"vec4":K.setVector4(t,e4.fromArray(e));break;case"vec3":K.setVector3(t,e3.fromArray(e));break;case"vec2":K.setVector2(t,e2.fromArray(e));break;case"vec4Array":for(var r=0;r<e.length;r+=4){var n=new e4(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}K.setVector4Array(t,i),i.length=0;break;default:console.warn("Uniform "+t+"'s type not in typeMap.")}}),K.setVector3("emissionColor",new e3(0,0,0)),K.setFloat("emissionIntensity",0);var Q=aK.create(e,(r=4*b,n=this.useSprite,a="particle#"+E,u={aPos:{size:3,offset:0,stride:s=12*(o=Float32Array.BYTES_PER_ELEMENT),data:new Float32Array(0)},aVel:{size:3,offset:3*o,stride:s,dataSource:"aPos"},aDirX:{size:3,offset:6*o,stride:s,dataSource:"aPos"},aDirY:{size:3,offset:9*o,stride:s,dataSource:"aPos"},aRot:{size:3,offset:0,stride:8*o,data:new Float32Array(0)},aSeed:{size:1,offset:3*o,stride:8*o,dataSource:"aRot"},aColor:{size:4,offset:4*o,stride:8*o,dataSource:"aRot"},aOffset:{size:4,stride:4*o,data:new Float32Array(0)},aTranslation:{size:3,data:new Float32Array(0)},aLinearMove:{size:3,data:new Float32Array(0)},aRotation0:{size:3,offset:0,stride:9*o,data:new Float32Array(0)},aRotation1:{size:3,offset:3*o,stride:9*o,dataSource:"aRotation0"},aRotation2:{size:3,offset:6*o,stride:9*o,dataSource:"aRotation0"}},n&&(u.aSprite={size:3,stride:3*o,data:new Float32Array(0)}),{attributes:u,indices:{data:new Uint16Array(0)},name:a,maxVertex:r})),J=a$.create(e,{name:"MParticle_"+E,material:K,geometry:Q});this.anchor=A,this.mesh=J,this.geometry=J.firstGeometry(),this.forceTarget=w,this.sizeOverLifetime=v,this.speedOverLifetime=f,this.linearVelOverLifetime=p,this.orbitalVelOverLifetime=m,this.orbitalVelOverLifetime=m,this.gravityModifier=x,this.rotationOverLifetime=y,this.maxCount=b,this.textureOffsets=T?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],this.time=0}var i=e.prototype;return i.getPointColor=function(t){var e=this.geometry.getAttributeData("aRot"),i=32*t+4;return im(e),[e[i],e[i+1],e[i+2],e[i+3]]},i.clearPoints=function(){this.resetGeometryData(this.geometry),this.particleCount=0,this.geometry.setDrawCount(0),this.maxParticleBufferCount=0},i.resetGeometryData=function(t){for(var e=t.getAttributeNames(),i=t.getIndexData(),r=0;r<e.length;r++){var n=e[r],a=t.getAttributeData(n);a&&t.setAttributeData(n,new a.constructor(0))}t.setIndexData(new i.constructor(0))},i.onUpdate=function(t){var e=Math.ceil(this.geometry.getAttributeData("aPos").length/12);this.applyTranslation(e,t),this.applyRotation(e,t),this.applyLinearMove(e,t)},i.minusTime=function(t){for(var e=this.geometry.getAttributeData("aOffset"),i=0;i<e.length;i+=4)e[i+2]-=t;this.geometry.setAttributeData("aOffset",e),this.time-=t},i.removePoint=function(t){t<this.particleCount&&this.geometry.setAttributeSubData("aOffset",16*t,new Float32Array(16))},i.setPoint=function(t,e){var i=this.maxCount;if(t<i){var r,n=t+1,a=4*n,o=this.geometry,s=n>this.maxParticleBufferCount,u=1;this.particleCount>300?u=(this.particleCount+100)/this.particleCount:this.particleCount>100?u=1.4:this.particleCount>0&&(u=2);var h={aPos:new Float32Array(48),aRot:new Float32Array(32),aOffset:new Float32Array(16),aTranslation:new Float32Array(12),aLinearMove:new Float32Array(12),aRotation0:new Float32Array(36)},l=this.useSprite;l&&(h.aSprite=new Float32Array(12));var c=new e3,f=new ri,d=new e3(1,1,1);e.transform.assignWorldTRS(c,f,d);var p=nO.getRotation(f,new nh),m=c.toArray(),v=p.toArray(),y=this.textureOffsets,g=[0,0,e.delay,e.lifetime],x=[0,0,1,1],b=e.vel,T=e.color,C=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],E=Math.random();l&&(r=e.sprite);for(var _=0;_<4;_++){var w=2*_,S=3*_,M=4*_,A=12*_,P=8*_;h.aPos.set(m,A),b.fill(h.aPos,A+3),h.aRot.set(v,P),h.aRot[P+3]=E,h.aRot.set(T,P+4),l&&h.aSprite.set(r,S);var R=e.uv||x;if(R){var I=l?1-y[w+1]:y[w+1];g[0]=R[0]+y[w]*R[2],g[1]=R[1]+I*R[3]}h.aOffset.set(g,M);for(var O=_+_,L=(C[O]-this.anchor.x)*d.x,F=(C[O+1]-this.anchor.y)*d.y,V=0;V<3;V++)h.aPos[A+6+V]=e.dirX.getElement(V)*L,h.aPos[A+9+V]=e.dirY.getElement(V)*F}var N=new Uint16Array([0,1,2,2,1,3].map(function(e){return e+4*t}));if(s){var k=eK(o.getIndexData(),6*n,6*i,u);k.set(N,6*t),o.setIndexData(k),this.maxParticleBufferCount=k.length/6}else o.setIndexSubData(6*t,N);Object.keys(h).forEach(function(e){var r=h[e],n=o.getAttributeStride(e)/Float32Array.BYTES_PER_ELEMENT;if(s){var l=o.getAttributeData(e);im(l);var c=eK(l,a*n,4*i*n,u);c.set(r,r.length*t),o.setAttributeData(e,c)}else o.setAttributeSubData(e,r.length*t,r)}),this.particleCount=Math.max(n,this.particleCount),o.setDrawCount(6*this.particleCount)}},i.applyTranslation=function(t,e){var i=this.time,r=this.geometry.getAttributeData("aTranslation"),n=this.geometry.getAttributeData("aVel"),a=this.geometry.getAttributeData("aOffset");r.length<3*t&&(r=this.expandArray(r,3*t));for(var o=0,s=0,u=0,h=this.mesh.material.getVector4("uAcceleration"),l=this.mesh.material.getVector4("uGravityModifierValue"),c=0;c<t;c+=4){var f=12*c+3;o=n[f],s=n[f+1],u=n[f+2];var d=i-a[4*c+2],p=a[4*c+3];if(h&&l){var m=this.gravityModifier.getIntegrateValue(0,d,p),v=h.x*m,y=h.y*m,g=h.z*m;if(this.speedOverLifetime){var x=this.speedOverLifetime.getValue(d/p);o=o*x+v,s=s*x+y,u=u*x+g}else o+=v,s+=y,u+=g}var b=3*c;if(a[4*c+2]<i){var T=e/1e3*o,C=e/1e3*s,E=e/1e3*u;r[b]+=T,r[b+1]+=C,r[b+2]+=E,r[b+3]+=T,r[b+4]+=C,r[b+5]+=E,r[b+6]+=T,r[b+7]+=C,r[b+8]+=E,r[b+9]+=T,r[b+10]+=C,r[b+11]+=E}}this.geometry.setAttributeData("aTranslation",r)},i.applyRotation=function(t,e){var i=this.geometry.getAttributeData("aRotation0"),r=this.geometry.getAttributeData("aOffset"),n=this.geometry.getAttributeData("aRot"),a=this.geometry.getAttributeData("aSeed"),o=this.time,s=this.cachedRotationMatrix;i.length<9*t&&(i=this.expandArray(i,9*t));for(var u=0;u<t;u+=4){var h=e1((o-r[4*u+2])/r[4*u+3],0,1),l=8*u,c=this.cachedRotationVector3.set(n[l],n[l+1],n[l+2]),f=a[8*u+3];this.rotationOverLifetime?(this.rotationOverLifetime.x&&(eU(this.rotationOverLifetime.x,at)?c.x+=this.rotationOverLifetime.x.getValue(h,f):c.x+=this.rotationOverLifetime.x.getValue(h)),this.rotationOverLifetime.y&&(eU(this.rotationOverLifetime.y,at)?c.y+=this.rotationOverLifetime.y.getValue(h,f):c.y+=this.rotationOverLifetime.y.getValue(h)),this.rotationOverLifetime.z&&(eU(this.rotationOverLifetime.z,at)?c.z+=this.rotationOverLifetime.z.getValue(h,f):c.z+=this.rotationOverLifetime.z.getValue(h))):s.setZero(),0===c.dot(c)&&s.identity();var d=Math.PI/180,p=c.x*d,m=c.y*d,v=c.z*d,y=Math.sin(p),g=Math.sin(m),x=Math.sin(v),b=Math.cos(p),T=Math.cos(m),C=Math.cos(v);s.set(C,-x,0,x,C,0,0,0,1),s.multiply(this.tempMatrix3.set(T,0,g,0,1,0,-g,0,T)),s.multiply(this.tempMatrix3.set(1,0,0,0,b,-y,0,y,b));var E=9*u,_=s.elements;i.set(_,E),u+4<=t&&(i.set(_,E+9),i.set(_,E+18),i.set(_,E+27))}this.geometry.setAttributeData("aRotation0",i)},i.applyLinearMove=function(t,e){var i=this.geometry.getAttributeData("aLinearMove"),r=this.geometry.getAttributeData("aOffset"),n=this.geometry.getAttributeData("aSeed"),a=this.time;i.length<3*t&&(i=this.expandArray(i,3*t));var o=this.cachedLinearMove;if(this.linearVelOverLifetime&&this.linearVelOverLifetime.enabled)for(var s=0;s<t;s+=4){var u=a-r[4*s+2],h=r[4*s+3],l=u/h,c=n[8*s+3];o.setZero(),this.linearVelOverLifetime.asMovement?(this.linearVelOverLifetime.x&&(eU(this.linearVelOverLifetime.x,at)?o.x=this.linearVelOverLifetime.x.getValue(l,c):o.x=this.linearVelOverLifetime.x.getValue(l)),this.linearVelOverLifetime.y&&(eU(this.linearVelOverLifetime.y,at)?o.y=this.linearVelOverLifetime.y.getValue(l,c):o.y=this.linearVelOverLifetime.y.getValue(l)),this.linearVelOverLifetime.z&&(eU(this.linearVelOverLifetime.z,at)?o.z=this.linearVelOverLifetime.z.getValue(l,c):o.z=this.linearVelOverLifetime.z.getValue(l))):(this.linearVelOverLifetime.x&&(eU(this.linearVelOverLifetime.x,at)?o.x=this.linearVelOverLifetime.x.getIntegrateValue(0,u,c):o.x=this.linearVelOverLifetime.x.getIntegrateValue(0,u,h)),this.linearVelOverLifetime.y&&(eU(this.linearVelOverLifetime.y,at)?o.y=this.linearVelOverLifetime.y.getIntegrateValue(0,u,c):o.y=this.linearVelOverLifetime.y.getIntegrateValue(0,u,h)),this.linearVelOverLifetime.z&&(eU(this.linearVelOverLifetime.z,at)?o.z=this.linearVelOverLifetime.z.getIntegrateValue(0,u,c):o.z=this.linearVelOverLifetime.z.getIntegrateValue(0,u,h)));var f=3*s;i[f]=o.x,i[f+1]=o.y,i[f+2]=o.z,i[f+3]=o.x,i[f+4]=o.y,i[f+5]=o.z,i[f+6]=o.x,i[f+7]=o.y,i[f+8]=o.z,i[f+9]=o.x,i[f+10]=o.y,i[f+11]=o.z}this.geometry.setAttributeData("aLinearMove",i)},i.expandArray=function(t,e){var i=new Float32Array(e);return i.set(t),i},e}(),s6=function(t){function e(e){var i;return(i=t.call(this,e)||this).name="ParticleSystemRenderer",i}iB(e,t);var i=e.prototype;return i.onStart=function(){this._priority=this.item.renderOrder},i.onUpdate=function(t){var e,i=this.particleMesh.time,r=null!=(e=this.particleMesh.mesh.material.getVector4("uParams"))?e:new e4;this.particleMesh.mesh.material.setVector4("uParams",r.set(i,this.item.duration,0,0))},i.render=function(t){this.maskManager.drawStencilMask(t,this);for(var e,i=ij(this.meshes);!(e=i()).done;)e.value.render(t)},i.setup=function(t,e){void 0===e&&(e=null),this.meshes=[],this.materials=[],this.particleMesh=new s5(this.engine,t),e&&(this.trailMesh=new sQ(this.engine,e)),this.meshes.push(this.particleMesh.mesh),this.materials.push(this.particleMesh.mesh.material),this.trailMesh&&(this.meshes.push(this.trailMesh.mesh),this.materials.push(this.trailMesh.mesh.material))},i.reset=function(){var t;this.particleMesh.clearPoints(),null==(t=this.trailMesh)||t.clearAllTrails()},i.updateTime=function(t,e){this.particleMesh.time=t,this.particleMesh.onUpdate(e),this.trailMesh&&(this.trailMesh.time=t,this.trailMesh.onUpdate(e))},i.minusTimeForLoop=function(t){var e;this.particleMesh.minusTime(t),null==(e=this.trailMesh)||e.minusTime(t)},i.updateWorldMatrix=function(t){this.particleMesh.mesh.worldMatrix=t,this.trailMesh&&(this.trailMesh.mesh.worldMatrix=t)},i.setVisible=function(t){var e;this.particleMesh.mesh.setVisible(t),null==(e=this.trailMesh)||e.mesh.setVisible(t)},i.getTextures=function(){var t=[],e=this.particleMesh.mesh.material.textures;if(Object.keys(e).forEach(function(i){t.push(e[i])}),this.trailMesh){var i=this.trailMesh.mesh.material.textures;Object.keys(i).forEach(function(e){t.push(i[e])})}return t},i.setParticlePoint=function(t,e){this.particleMesh.setPoint(t,e)},i.removeParticlePoint=function(t){this.particleMesh.removePoint(t)},i.getParticlePointColor=function(t){return this.particleMesh.getPointColor(t)},i.hasTrail=function(){return void 0!==this.trailMesh},i.clearTrail=function(t){var e;null==(e=this.trailMesh)||e.clearTrail(t)},i.addTrailPoint=function(t,e,i){var r;null==(r=this.trailMesh)||r.addPoint(t,e,i)},i.setTrailStartPosition=function(t,e){var i;null==(i=this.trailMesh)||i.setPointStartPos(t,e)},i.getTrailStartPosition=function(t){return this.trailMesh.getPointStartPos(t)},e}(n_);t.ParticleSystem=function(e){function i(i,r){var n;return(n=e.call(this,i)||this).particleMeshProps=null,n.trailMeshProps=null,n.getHitTestParams=function(e){var i=n.interaction;if(e||i)return{type:t.HitTestType.custom,clipMasks:n.renderer.frameClipMasks,collect:function(t){return n.raycast({radius:(null==i?void 0:i.radius)||.4,multiple:!!(null==i?void 0:i.multiple),removeParticle:(null==i?void 0:i.behavior)===t1.removeParticle,ray:t})}}},n.maskManager=new nx,r&&n.fromData(r),n}iB(i,e);var r=i.prototype;return r.isFrozen=function(){return this.frozen},r.isEnded=function(){return this.ended},r.initEmitterTransform=function(){var t,e=this.item.transform.position.clone(),i=this.item.transform.rotation.clone(),r=this.props.emitterTransform&&this.props.emitterTransform.path;r&&(r[0]===tJ.CONSTANT_VEC3?e.add(r[1]):t=aT(r)),this.basicTransform={position:e,rotation:i,path:t};var n=e.clone();if(t&&n.add(t.getValue(0)),this.transform.setPosition(n.x,n.y,n.z),this.options.particleFollowParent){var a=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(a)}},r.updateEmitterTransform=function(t){var e=this.basicTransform,i=e.path,r=e.position.clone();if(i){var n=this.item.duration;r.add(i.getValue(t/n))}if(this.transform.setPosition(r.x,r.y,r.z),this.options.particleFollowParent){var a=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(a)}},r.addParticle=function(t,e){var i,r=this.particleLink,n=[t.delay+t.lifetime,0,t.delay,t];if(r.length<e)i=n[1]=r.length;else{var a=r.first;r.removeNode(a),i=n[1]=a.content[1]}r.pushNode(n),this.renderer.setParticlePoint(i,t),this.clearPointTrail(i),this.transform.parentTransform&&this.renderer.setTrailStartPosition(i,this.transform.parentTransform.position.clone())},r.setVisible=function(t){this.renderer.setVisible(t)},r.getTextures=function(){return this.renderer.getTextures()},r.startEmit=function(){(!this.started||this.ended)&&(this.reset(),this.started=!0,this.ended=!1)},r.stop=function(){this.ended=!0,this.started=!1},r.reset=function(){this.renderer.reset(),this.time=0,this.loopStartTime=0,this.lastEmitTime=-1/this.emission.rateOverTime.getValue(0),this.generatedCount=0,this.particleLink=new sZ(function(t,e){return t[0]-e[0]}),this.emission.bursts.forEach(function(t){return t.reset()}),this.frozen=!1,this.ended=!1},r.onStart=function(){var t=this;this.particleMeshProps&&(this.renderer=this.item.addComponent(s6),this.renderer.setup(this.particleMeshProps,this.trailMeshProps),this.renderer.maskManager=this.maskManager,this.meshes=this.renderer.meshes,this.startEmit(),this.initEmitterTransform(),this.item.on("click",function(){var e;if((null==(e=t.interaction)?void 0:e.behavior)===t1.removeParticle){var i=t.clickedPoint.content[1];t.renderer.removeParticlePoint(i),t.clearPointTrail(i),t.clickedPoint.content=[0]}}))},r.onUpdate=function(t){this.frozen||this.update(t)},r.simulate=function(t){this.update(1e3*t),this.frozen=!0},r.update=function(t){var e=this;if(this.started){var i=this.time+t/1e3,r=this.options,n=this.loopStartTime,a=this.emission;this.time=i,this.upDirectionWorld=null,this.renderer.updateTime(i,t);var o=this.particleLink,s=(i-n)/this.item.duration,u=this.timePassed,h=!1,l=function(){e.trails&&!h&&(h=!0,o.forEach(function(t){var i=t[0],r=t[1],n=t[2],a=t[3];i<u?e.clearPointTrail(r):u>n&&e.updatePointTrail(r,s,a,n)}))};if(!this.ended){var c=this.item.duration,f=this.lifetime;if(u<c){var d=1/a.rateOverTime.getValue(f),p=Math.floor((u-this.lastEmitTime)/d),m=d/p,v=r.maxCount;this.updateEmitterTransform(u);for(var y=function(){var t=o.first;return e.emissionStopped||o.length===v&&t&&t.content[0]-n>u},g=0;g<p&&g<v&&!y();g++){var x=this.createPoint(f);x.delay+=i+g*m,this.addParticle(x,v),this.lastEmitTime=u}for(var b=a.bursts,T=(null==b?void 0:b.length)-1,C=0;T>=0&&C<v&&!y();T--){var E=b[T],_=!E.disabled&&E.getGeneratorOptions(u,f);if(_){var w=[0,0,0],S=a.burstOffsets[T],M=S&&S[_.cycleIndex]||w;E.once&&this.removeBurst(T);for(var A=0;A<_.count&&C<v&&!y();A++){var P,R=this.initPoint(this.shape.generate({total:_.total,index:_.index,burstIndex:A,burstCount:_.count}));R.delay+=i,C++,(P=R.transform).translate.apply(P,[].concat(M)),this.addParticle(R,v)}}}}else this.options.looping?(l(),this.loopStartTime=i-c,this.lastEmitTime-=c,this.time-=c,a.bursts.forEach(function(t){return t.reset()}),this.particleLink.forEach(function(t){t[0]-=c,t[2]-=c,t[3]&&(t[3].delay-=c)}),this.renderer.minusTimeForLoop(c)):(this.ended=!0,this.item.endBehavior===t0.freeze&&(this.frozen=!0))}l()}},r.drawStencilMask=function(t){if(this.isActiveAndEnabled)for(var e,i=ij(this.renderer.meshes);!(e=i()).done;){var r=e.value;this.maskManager.drawGeometryMask(this.engine.renderer,r.geometry,r.worldMatrix,r.material,t)}},r.onDestroy=function(){this.item&&this.item.composition&&this.meshes.forEach(function(t){return t.dispose()})},r.getParticleBoxes=function(){var t=this.particleLink,e=this.renderer,i=[],r=this.particleCount,n=0;if(!(t&&e))return i;for(var a=t.last,o=!1;!o;){var s=a.content[0],u=a.content[3];if(s>this.timePassed){var h=this.getPointPosition(u);i.push({center:h,size:u.transform.scale}),a.pre?a=a.pre:o=!0}++n>r&&(o=!0)}return i},r.raycast=function(t){var e=this.particleLink,i=this.renderer;if(e&&i){var r=e.last,n=[],a=new e3,o=!1;if(r&&r.content)do{var s=r.content,u=s[0];s[2];var h=s[3];if(u>this.timePassed){var l=this.getPointPosition(h),c=t.ray,f=!1;c&&(f=!!c.intersectSphere({center:l,radius:t.radius},a)),f&&(this.clickedPoint=r,n.push(l),t.multiple||(o=!0))}}while((r=r.pre)&&!o);return n}},r.clearPointTrail=function(t){this.trails&&this.trails.dieWithParticles&&this.renderer.clearTrail(t)},r.updatePointTrail=function(t,e,i,r){var n=this.renderer;if(n.hasTrail()){var a=this.trails,o=this.getPointPosition(i),s=a.inheritParticleColor?n.getParticlePointColor(t):[1,1,1,1],u=i.transform.getWorldScale().toArray(),h=1,l=a.lifetime.getValue(e);if(a.sizeAffectsWidth&&(h*=u[0]),a.sizeAffectsLifetime&&(l*=u[0]),a.parentAffectsPosition&&this.transform.parentTransform){o.add(this.transform.parentTransform.position);var c=n.getTrailStartPosition(t);c&&o.subtract(c)}n.addTrailPoint(t,o,{color:s,lifetime:l,size:h,time:r})}},r.getPointPositionByIndex=function(t){var e=this.particleLink.getNodeByIndex(t);return e?this.getPointPosition(e.content[3]):(console.error("Get point error."),null)},r.getPointPosition=function(t){var e=t.transform,i=t.vel,r=t.lifetime,n=t.delay,a=t.gravity,o=this.options.forceTarget,s=this.time-n,u=new e3,h=e3.fromArray(void 0===a?[]:a);e.assignWorldTRS(u);var l=nk(new e3,this.options,h,s,r,u,i);if(o){var c=o.target||[0,0,0],f=o.curve.getValue(s/r),d=1-f;l.x=l.x*d+c[0]*f,l.y=l.y*d+c[1]*f,l.z=l.z*d+c[2]*f}return l},r.initPoint=function(t){var e,i,r,n,a=this.options,o=this.lifetime,s=this.shape,u=a.startSpeed.getValue(o),h=a.particleFollowParent?nu.IDENTITY:this.transform.getWorldMatrix(),l=t.position,c=new nO({position:h.transformPoint(l,new e3),valid:!0}),f=t.direction;if(f=h.transformNormal(f,s8).normalize(),a.startTurbulence&&a.turbulence){for(var d=0;d<3;d++)ui.setElement(d,a.turbulence[d].getValue(o));ur.setFromVector3(ui.negate()),ua.setFromEuler(ur).transformNormal(f).normalize()}s.alignSpeedDirection?(ue.copyFrom(f),this.upDirectionWorld||(s.upDirection?this.upDirectionWorld=s.upDirection.clone():this.upDirectionWorld=e3.Z.clone(),h.transformNormal(this.upDirectionWorld)),ut.crossVectors(ue,this.upDirectionWorld).normalize(),ut.isZero()&&ut.set(1,0,0)):(ut.set(1,0,0),ue.set(0,1,0));var p=this.textureSheetAnimation;p&&p.animate&&((n=un)[0]=p.animationDelay.getValue(o),n[1]=p.animationDuration.getValue(o),n[2]=p.cycles.getValue(o)),a.start3DRotation?s7.set(a.startRotationX.getValue(o),a.startRotationY.getValue(o),a.startRotationZ.getValue(o)):a.startRotation?s7.set(0,0,a.startRotation.getValue(o)):s7.set(0,0,0),c.setRotation(s7.x,s7.y,s7.z);var m=a.startColor.getValue(o);if(3===m.length&&(m[3]=1),a.start3DSize)s9.x=a.startSizeX.getValue(o),s9.y=a.startSizeY.getValue(o);else{var v=a.startSize.getValue(o),y=a.sizeAspect.getValue(o);s9.x=v,s9.y=0===y?0:v/y}var g=f.clone();if(g.multiply(u),!a.particleFollowParent){var x=new e3;this.transform.assignWorldTRS(void 0,void 0,x),s9.x*=x.x,s9.y*=x.y}return c.setScale(s9.x,s9.y,1),{size:s9,vel:g,color:m,delay:a.startDelay.getValue(o),lifetime:a.startLifetime.getValue(o),uv:(i=Math.floor(Math.random()*(e=this.uvs).length),r=e[i],r),gravity:a.gravity,sprite:n,dirY:ue,dirX:ut,transform:c}},r.addBurst=function(t,e){var i=!1;if(this.emission.bursts.includes(t)||(this.emission.bursts.push(t),i=!0),i&&eU(e,Array)){var r=this.emission.bursts.indexOf(t);return this.emission.burstOffsets[r]=e,r}return -1},r.removeBurst=function(t){t<this.emission.bursts.length&&(this.emission.burstOffsets[t]=null,this.emission.bursts.splice(t,1))},r.createPoint=function(t){var e={total:this.emission.rateOverTime.getValue(t),index:this.generatedCount,burstIndex:0,burstCount:0};return this.generatedCount++,this.initPoint(this.shape.generate(e))},r.stopParticleEmission=function(){this.emissionStopped=!0},r.resumeParticleEmission=function(){this.emissionStopped=!1},r.getBoundingBox=function(){var e=this.getParticleBoxes();return{type:t.HitTestType.sphere,area:e}},r.fromData=function(t){e.prototype.fromData.call(this,t),this.props=t;var i,r,n,a,o,s,u,h,l,c,f,d,p,m,v=t.options,y=t.positionOverLifetime,g=void 0===y?{}:y,x=t.shape,b=null==g?void 0:g.gravityOverLifetime,T=nD(null==g?void 0:g.gravity),C=t.textureSheetAnimation,E=C?{animationDelay:aT(C.animationDelay||0),animationDuration:aT(C.animationDuration||1),cycles:aT(C.cycles||1),animate:C.animate,col:C.col,row:C.row,total:C.total||C.col*C.row}:void 0,_=!!(x&&x.turbulenceX||(null==x?void 0:x.turbulenceY)||(null==x?void 0:x.turbulenceZ));_&&(n=[aT(null!=(a=x.turbulenceX)?a:0),aT(null!=(o=x.turbulenceY)?o:0),aT(null!=(s=x.turbulenceZ)?s:0)]),this.name="ParticleSystem",this.shape=sw(x),this.emission={rateOverTime:aT(t.emission.rateOverTime),burstOffsets:(i=null!=(u=t.emission.burstOffsets)?u:[],r={},Array.isArray(i)&&i.forEach(function(t){var e=eU(t,Array),i=e?t[0]:t.index,n=r[i];n||(n=r[i]=[]),e?n.push(t.slice(1,4)):n.push([+t.x,+t.y,+t.z])}),r),bursts:(t.emission.bursts||[]).map(function(t){return new sH(t)})},this.textureSheetAnimation=E;var w=t.renderer||{},S=t.rotationOverLifetime;S&&((h={}).asRotation=!!S.asRotation,h.z=S.z?aT(S.z):aT(0),S.separateAxes&&(h.x=S.x&&aT(S.x),h.y=S.y&&aT(S.y))),(null==g?void 0:g.forceTarget)&&(l={target:g.target||[0,0,0],curve:aT(g.forceCurve||[tJ.LINE,[[0,0],[1,1]]])});var M={x:g.linearX&&aT(g.linearX||0),y:g.linearY&&aT(g.linearY||0),z:g.linearZ&&aT(g.linearZ||0),asMovement:g.asMovement},A={x:g.orbitalX&&aT(g.orbitalX),y:g.orbitalY&&aT(g.orbitalY),z:g.orbitalZ&&aT(g.orbitalZ),center:g.orbCenter,asRotation:g.asRotation},P=t.sizeOverLifetime||{},R=t.colorOverLifetime,I=(null==P?void 0:P.separateAxes)?{separateAxes:!0,x:aT(P.x),y:aT(P.y)}:{separateAxes:!1,x:aT(("size"in P?P.size:P.x)||1)};w.anchor=w.anchor||[0,0];var O=e2.fromArray(w.anchor);this.options={particleFollowParent:!!v.particleFollowParent,startLifetime:aT(v.startLifetime),startDelay:aT(v.startDelay||0),startSpeed:aT(g.startSpeed||0),startColor:aT(v.startColor),looping:null!=(c=v.looping)&&c,maxCount:null!=(f=v.maxCount)?f:0,gravityModifier:aT(b||0),gravity:T,start3DSize:!!v.start3DSize,startTurbulence:_,turbulence:n,speedOverLifetime:g.speedOverLifetime&&aT(g.speedOverLifetime),linearVelOverLifetime:M,orbitalVelOverLifetime:A,forceTarget:l},v.startRotationZ&&(this.options.startRotation=aT(v.startRotationZ||0)),(v.startRotationX||v.startRotationY)&&(this.options.start3DRotation=!0,this.options.startRotationX=aT(v.startRotationX||0),this.options.startRotationY=aT(v.startRotationY||0),this.options.startRotationZ=aT(v.startRotationZ||0)),v.start3DSize?(this.options.startSizeX=aT(v.startSizeX),this.options.startSizeY=aT(v.startSizeY)):(this.options.startSize=aT(v.startSize),this.options.sizeAspect=aT(v.sizeAspect||1)),t.mask&&this.maskManager.setMaskOptions(this.engine,t.mask);var L={name:this.name,matrix:nu.IDENTITY,shaderCachePrefix:"",renderMode:w.renderMode||tY.BILLBOARD,side:w.side||tB.DOUBLE,gravity:T,blending:w.blending||tz.ALPHA,rotationOverLifetime:h,gravityModifier:this.options.gravityModifier,linearVelOverLifetime:this.options.linearVelOverLifetime,orbitalVelOverLifetime:this.options.orbitalVelOverLifetime,speedOverLifetime:this.options.speedOverLifetime,sprite:E,occlusion:!!w.occlusion,transparentOcclusion:!!w.transparentOcclusion,maxCount:v.maxCount,forceTarget:l,diffuse:w.texture?this.engine.findObject(w.texture):void 0,sizeOverLifetime:I,anchor:O};if(R){var F=R.color,V=R.opacity;L.colorOverLifetime={},V&&(L.colorOverLifetime.opacity=aT(R.opacity)),F&&(F[0]===tJ.GRADIENT_COLOR?L.colorOverLifetime.color=R.color[1]:F[0]===tJ.RGBA_COLOR?L.colorOverLifetime.color=r7.createWithData(this.engine,{data:new Uint8Array(F[1]),width:1,height:1}):eU(F,r7)&&(L.colorOverLifetime.color=F))}var N=[],k=[0,0,1,1];if(t.splits){var D=t.splits[0];k=(d=D[4])?[D[0],D[1],D[3],D[2]]:[D[0],D[1],D[2],D[3]]}if(E&&!E.animate)for(var z=d?E.row:E.col,B=d?E.col:E.row,U=E.total||z*B,G=0,W=0;W<z;W++)for(var j=0;j<B&&G<U;j++,G++)N.push([W*k[2]/z+k[0],j*k[3]/B+k[1],k[2]/z,k[3]/B]);else N.push(k);this.uvs=N,L.textureFlip=d;var X=t.trails;X&&(this.trails={lifetime:aT(X.lifetime),dieWithParticles:!1!==X.dieWithParticles,sizeAffectsWidth:!!X.sizeAffectsWidth,sizeAffectsLifetime:!!X.sizeAffectsLifetime,inheritParticleColor:!!X.inheritParticleColor,parentAffectsPosition:!!X.parentAffectsPosition},p={name:"Trail",matrix:nu.IDENTITY,minimumVertexDistance:X.minimumVertexDistance||.02,maxTrailCount:v.maxCount,pointCountPerTrail:Math.round(X.maxPointPerTrail)||32,blending:X.blending,texture:X.texture?this.engine.findObject(X.texture):void 0,opacityOverLifetime:aT(X.opacityOverLifetime||1),widthOverTrail:aT(X.widthOverTrail||1),shaderCachePrefix:"",lifetime:this.trails.lifetime,occlusion:!!X.occlusion,transparentOcclusion:!!X.transparentOcclusion},X.colorOverLifetime&&X.colorOverLifetime[0]===tJ.GRADIENT_COLOR&&(p.colorOverLifetime=X.colorOverLifetime[1]),X.colorOverTrail&&X.colorOverTrail[0]===tJ.GRADIENT_COLOR&&(p.colorOverTrail=X.colorOverTrail[1])),this.particleMeshProps=L,p&&(this.trailMeshProps=p);var H=t.interaction;H&&(this.interaction={multiple:H.multiple,radius:null!=(m=H.radius)?m:.4,behavior:H.behavior}),this.item.getHitTestParams=this.getHitTestParams},rI(i,[{key:"timePassed",get:function(){return this.time-this.loopStartTime}},{key:"lifetime",get:function(){return this.timePassed/this.item.duration}},{key:"particleCount",get:function(){return this.particleLink.length}},{key:"maxParticles",get:function(){return this.options.maxCount},set:function(t){var e;this.options.maxCount=t,(null==(e=this.renderer)?void 0:e.particleMesh)&&(this.renderer.particleMesh.maxCount=t)}}]),i}(rO),t.ParticleSystem=eG([iZ(em.ParticleSystem)],t.ParticleSystem);var s8=new e3,s9=new e2,s7=new nh,ut=new e3,ue=new e3,ui=new e3,ur=new nh,un=[0,0,0],ua=new nu;t.ObjectBindingTrack=function(e){function i(){return e.apply(this,arguments)}return iB(i,e),i.prototype.create=function(e,i){var r=i[this.getInstanceId()];if(eU(r,t.VFXItem))for(var n,a=ij(this.getChildTracks());!(n=a()).done;){var o=n.value;if(eU(o,t.ActivationTrack)){if(r.getComponent(t.ParticleSystem))for(var s,u=e.createTrack(sl,this,"ParticleTrack"),h=ij(o.getClips());!(s=h()).done;){var l=s.value,c=u.createClip(s3);c.start=l.start,c.duration=l.duration,c.endBehavior=l.endBehavior}if(r.getComponent(t.SpriteComponent))for(var f,d=e.createTrack(ul,this,"SpriteComponentTimeTrack"),p=ij(o.getClips());!(f=p()).done;){var m=f.value,v=d.createClip(uf);v.start=m.start,v.duration=m.duration,v.endBehavior=m.endBehavior}if(r.getComponent(t.EffectComponent))for(var y,g=e.createTrack(uc,this,"EffectComponentTimeTrack"),x=ij(o.getClips());!(y=x()).done;){var b=y.value,T=g.createClip(uf);T.start=b.start,T.duration=b.duration,T.endBehavior=b.endBehavior}break}}},i}(t.TrackAsset),t.ObjectBindingTrack=eG([iZ(em.ObjectBindingTrack)],t.ObjectBindingTrack),t.ActivationPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){return new o$},e}(oH),t.ActivationPlayableAsset=eG([iZ(em.ActivationPlayableAsset)],t.ActivationPlayableAsset),t.ColorPropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){var t=new o0;return t.curve=aT(this.curveData),t.value=t.curve.getValue(0),t},e}(oH),eG([iK(void 0,void 0)],t.ColorPropertyPlayableAsset.prototype,"curveData",void 0),t.ColorPropertyPlayableAsset=eG([iZ(em.ColorPropertyPlayableAsset)],t.ColorPropertyPlayableAsset),t.FloatPropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){var t=new o0;return t.curve=aT(this.curveData),t.value=t.curve.getValue(0),t},e}(oH),eG([iK(void 0,void 0)],t.FloatPropertyPlayableAsset.prototype,"curveData",void 0),t.FloatPropertyPlayableAsset=eG([iZ(em.FloatPropertyPlayableAsset)],t.FloatPropertyPlayableAsset),t.SpritePropertyPlayableAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.curveData=[28,[]],e}iB(e,t);var i=e.prototype;return i.fromData=function(e){t.prototype.fromData.call(this,e);for(var i=e.curveData[1],r=[],n=0;n<i.length;n++){var a=i[n],o=a[0],s=a[1];r.push([o,this.engine.findObject(s)])}this.curveData[1]=r},i.createPlayable=function(){var t=new o0;return t.curve=aT(this.curveData),t.value=t.curve.getValue(0),t},e}(oH),t.SpritePropertyPlayableAsset=eG([iZ("SpritePropertyPlayableAsset")],t.SpritePropertyPlayableAsset),t.SubCompositionPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){return new o8},e}(oH),t.SubCompositionPlayableAsset=eG([iZ(em.SubCompositionPlayableAsset)],t.SubCompositionPlayableAsset),t.Vector4PropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){var t=new o0;return t.curve=aT(this.curveData),t.value=t.curve.getValue(0),t},e}(oH),eG([iK(void 0,void 0)],t.Vector4PropertyPlayableAsset.prototype,"curveData",void 0),t.Vector4PropertyPlayableAsset=eG([iZ(em.Vector4PropertyPlayableAsset)],t.Vector4PropertyPlayableAsset),t.Vector3ropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){var t=new o0;return t.curve=aT(this.curveData),t.value=t.curve.getValue(0),t},e}(oH),eG([iK(void 0,void 0)],t.Vector3ropertyPlayableAsset.prototype,"curveData",void 0),t.Vector3ropertyPlayableAsset=eG([iZ(em.Vector3PropertyPlayableAsset)],t.Vector3ropertyPlayableAsset),t.Vector2PropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){var t=new o0;return t.curve=aT(this.curveData),t.value=t.curve.getValue(0),t},e}(oH),eG([iK(void 0,void 0)],t.Vector2PropertyPlayableAsset.prototype,"curveData",void 0),t.Vector2PropertyPlayableAsset=eG([iZ(em.Vector2PropertyPlayableAsset)],t.Vector2PropertyPlayableAsset);var uo=function(){function t(t,e,i){this.children=[],this.trackAsset=t,this.mixer=e,this.output=i,this.mixer.trackInstance=this}return t.prototype.addChild=function(t){this.children.push(t)},t}();t.TimelineAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.tracks=[],e.cacheFlattenedTracks=null,e}iB(e,t);var i=e.prototype;return i.createTrack=function(t,e,i){var r=new t(this.engine);return r.name=i||t.name,e.addChild(r),this.invalidate(),r},i.invalidate=function(){this.cacheFlattenedTracks=null},i.addSubTracksRecursive=function(t,e){for(var i,r=ij(t.getChildTracks());!(i=r()).done;){var n=i.value;e.push(n)}for(var a,o=ij(t.getChildTracks());!(a=o()).done;){var s=a.value;this.addSubTracksRecursive(s,e)}},rI(e,[{key:"flattenedTracks",get:function(){if(!this.cacheFlattenedTracks){this.cacheFlattenedTracks=[];for(var t,e=ij(this.tracks);!(t=e()).done;){var i=t.value;this.cacheFlattenedTracks.push(i),this.addSubTracksRecursive(i,this.cacheFlattenedTracks)}}return this.cacheFlattenedTracks}}]),e}(iQ),eG([iK(void 0,void 0)],t.TimelineAsset.prototype,"tracks",void 0),t.TimelineAsset=eG([iZ(em.TimelineAsset)],t.TimelineAsset);var us=function(){function e(e,i){this.masterTrackInstances=[],this.clips=[];for(var r,n={},a=ij(i);!(r=a()).done;){var o=r.value;n[o.key.getInstanceId()]=o.value}for(var s,u=ij(e.tracks);!(s=u()).done;){var h=s.value;eU(h,t.ObjectBindingTrack)&&h.create(e,n)}this.compileTracks(e.flattenedTracks,i)}var i=e.prototype;return i.evaluate=function(t,e){for(var i,r=ij(this.clips);!(i=r()).done;)i.value.evaluateAt(t);for(var n,a=ij(this.masterTrackInstances);!(n=a()).done;){var o=n.value;this.tickTrack(o,e)}},i.compileTracks=function(t,e){for(var i,r={},n=ij(t);!(i=n()).done;){var a=i.value,o=a.createPlayableGraph(this.clips),s=a.createOutput(),u=new uo(a,o,s);r[a.getInstanceId()]=u,a.parent||this.masterTrackInstances.push(u)}for(var h,l=ij(t);!(h=l()).done;)for(var c,f=h.value,d=r[f.getInstanceId()],p=ij(f.getChildTracks());!(c=p()).done;){var m=r[c.value.getInstanceId()];d.addChild(m)}for(var v,y=ij(e);!(v=y()).done;){var g=v.value;r[g.key.getInstanceId()].boundObject=g.value}for(var x,b=ij(this.masterTrackInstances);!(x=b()).done;){var T=x.value;this.updateTrackAnimatedObject(T)}},i.tickTrack=function(e,i){var r=e.output.context;r.deltaTime=i,e.output.setUserData(e.boundObject);for(var n,a=ij(e.mixer.clipPlayables);!(n=a()).done;){var o=n.value;o.getPlayState()===t.PlayState.Playing&&o.processFrame(r)}e.mixer.evaluate(r);for(var s,u=ij(e.children);!(s=u()).done;){var h=s.value;this.tickTrack(h,i)}},i.updateTrackAnimatedObject=function(t){for(var e,i=ij(t.children);!(e=i()).done;){var r=e.value;if(!r.boundObject){var n=r.trackAsset.updateAnimatedObject(t.boundObject);r.boundObject=n}this.updateTrackAnimatedObject(r)}},e}(),uu=0;t.SpriteColorPlayableAsset=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.createPlayable=function(){var t=new oZ;return t.create(this.data),t},i.fromData=function(t){this.data=t},e}(oH),t.SpriteColorPlayableAsset=eG([iZ(em.SpriteColorPlayableAsset)],t.SpriteColorPlayableAsset);var uh=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createTrackMixer=function(){return new oQ},e}(t.TrackAsset),ul=function(e){function i(){return e.apply(this,arguments)}return iB(i,e),i.prototype.updateAnimatedObject=function(e){return e.getComponent(t.SpriteComponent)},i}(uh),uc=function(e){function i(){return e.apply(this,arguments)}return iB(i,e),i.prototype.updateAnimatedObject=function(e){return e.getComponent(t.EffectComponent)},i}(uh),uf=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.createPlayable=function(){return new ud},e}(oH),ud=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.processFrame=function(t){var e=t.output.getUserData();"time"in e&&(e.time=this.time)},e}(oj);t.SpriteComponent=function(e){function i(t,i){var r;return(r=e.call(this,t)||this).time=0,r.duration=1,r.name="MSprite"+uu++,i&&r.fromData(i),r}iB(i,e);var r=i.prototype;return r.onUpdate=function(i){var r=this;e.prototype.onUpdate.call(this,i);var n=this.time,a=this.duration,o=this.textureSheetAnimation,s=null==(l=null==o?void 0:o.loop)||l;n>a&&s&&(n%=a);var u=Math.min(Math.max(n/a,0),1),h=this.renderer.texture.source.video;if(h&&(0===n?h.pause():h.play().catch(function(t){r.engine.renderErrors.add(t)}),this.renderer.texture.uploadCurrentVideoFrame()),o){var l,c,f,d,p,m=o.total||o.row*o.col,v=this.sprite,y=null!=(f=null==v?void 0:v.rect)?f:[0,0,1,1],g=(null!=(d=null==v?void 0:v.rotation)?d:t.SpriteRotation.None)===t.SpriteRotation.Rotate90,x=y[0],b=y[1],T=g?y[3]:y[2],C=g?y[2]:y[3],E=g?1/o.row*T:1/o.col*T,_=g?1/o.col*C:1/o.row*C;if(o.animate){var w=Math.round(u*(m-1)),S=Math.floor(w/o.col),M=w-S*o.col;p=g?[E*S,_*(o.col-M)]:[E*M,_*(1+S)]}else p=[0,_];null==(c=this.material.getVector4("_TexOffset"))||c.setFromArray([x+p[0],C+b-p[1],E,_])}this.time=n+i/1e3},r.onDisable=function(){e.prototype.onDisable.call(this),this.time=0},r.onDestroy=function(){var e=this.renderer.texture.source;e.sourceType===t.TextureSourceType.video&&(null==e?void 0:e.video)&&(e.video.pause(),e.video.src="",e.video.load())},r.updateGeometry=function(e){var i=this.sprite,r=null!=(_=null==i?void 0:i.rotation)?_:t.SpriteRotation.None,n=null!=(w=null==i?void 0:i.rect)?w:[0,0,1,1],a=this.textureSheetAnimation?[0,0,1,1]:[n[0],n[1],n[2],n[3]],o=a[0],s=a[1],u=a[2],h=a[3],l=r===t.SpriteRotation.Rotate90,c=l?h:u,f=l?u:h,d=l?-Math.PI/2:0,p=e.getAttributeData("aUV"),m=e.getAttributeData("aPos"),v=e.getIndexData(),y=[0,0];if(p&&m&&v){for(var g=p.length/2,x=0;x<g;x++){var b=3*x,T=2*x,C=m[b],E=m[b+1];y[0]=C,y[1]=E,sX(y,y,d),p[T]=(y[0]+.5)*c+o,p[T+1]=(y[1]+.5)*f+s}this.geometry.setAttributeData("aPos",m.slice()),this.geometry.setAttributeData("aUV",p.slice()),this.geometry.setIndexData(v.slice()),this.geometry.setDrawCount(v.length)}this.geometry.subMeshes.length=0;for(var _,w,S,M=ij(e.subMeshes);!(S=M()).done;){var A=S.value;this.geometry.subMeshes.push({offset:A.offset,indexCount:A.indexCount,vertexCount:A.vertexCount})}},r.fromData=function(t){if(e.prototype.fromData.call(this,t),t.sprite){var i,r=this.engine.findObject(t.sprite);r&&this.applySpriteToRenderer(r)}this.textureSheetAnimation=t.textureSheetAnimation;var n=t.geometry?this.engine.findObject(t.geometry):this.defaultGeometry,a=t.splits;a&&a.length>1?this.updateGeometryFromMultiSplit(a):this.updateGeometry(n),this.interaction=t.interaction;var o=t.options.startColor||[1,1,1,1];this.material.setColor("_Color",new e5().setFromArray(o)),this.duration=null!=(i=t.duration)?i:this.item.duration},r.applySpriteToRenderer=function(t){this._sprite=t,this.renderer.texture=t.texture,this.material.setTexture("_MainTex",t.texture)},r.updateGeometryFromMultiSplit=function(t){for(var e=this.defaultGeometry,i=[],r=[],n=[],a=0;a<2;a++)for(var o=0;o<2;o++){var s=(2*o+a)*4,u=t[2*o+a],h=u[4]?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],l=((a+a+1)/2-1)/2,c=((o+o+1)/2-1)/2,f=u[0],d=u[1],p=u[4]?u[3]:u[2],m=u[4]?u[2]:u[3],v=[-.25+l,.25+c,-.25+l,-.25+c,.25+l,.25+c,.25+l,-.25+c];i.push(h[0]*p+f,h[1]*m+d,h[2]*p+f,h[3]*m+d,h[4]*p+f,h[5]*m+d,h[6]*p+f,h[7]*m+d),n.push(1*v[0],1*v[1],0,1*v[2],1*v[3],0,1*v[4],1*v[5],0,1*v[6],1*v[7],0),r.push(s,1+s,2+s,2+s,1+s,3+s)}e.setAttributeData("aPos",new Float32Array(n)),e.setIndexData(new Uint16Array(r)),e.setAttributeData("aUV",new Float32Array(i)),e.setDrawCount(r.length)},rI(i,[{key:"sprite",get:function(){return this._sprite},set:function(t){this.applySpriteToRenderer(t),this.updateGeometry(this.geometry)}}]),i}(oE),t.SpriteComponent=eG([iZ(em.SpriteComponent)],t.SpriteComponent);var up=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(oI(iD));function um(t){return" "===t||" "===t||"\xa0"===t}function uv(t){var e,i=null!=(e=t.codePointAt(0))?e:0;return i>=13312&&i<=19903||i>=19968&&i<=40959||i>=63744&&i<=64255||i>=131072&&i<=195103||i>=12352&&i<=12447||i>=12448&&i<=12543||i>=12784&&i<=12799||i>=44032&&i<=55215}function uy(t){return um(t)?"swallow":!!uv(t)&&"keep"}var ug=function(){function t(t){this.width=0,this.height=0,this.autoResize=et.fixed,this.keepWordIntact=!0,this.update(t)}var e=t.prototype;return e.update=function(t){var e=t.textHeight,i=t.textWidth,r=t.textOverflow,n=void 0===r?t7.clip:r,a=t.textVerticalAlign,o=void 0===a?er.top:a,s=t.textAlign,u=void 0===s?ei.left:s,h=t.letterSpace,l=t.fontSize,c=t.lineHeight,f=t.autoResize,d=void 0===f?et.fixed:f,p=t.keepWordIntact;this.letterSpace=void 0===h?0:h,this.overflow=n,this.textVerticalAlign=o,this.textAlign=u,this.width=void 0===i?100:i,this.height=void 0===e?100:e,this.autoResize=d,this.keepWordIntact=void 0===p||p,this.lineHeight=void 0===c?l:c},e.getOffsetY=function(t,e,i,r,n){var a=(i-r)/3,o=void 0!==n?n:i*(e-1),s=0;switch(this.textVerticalAlign){case er.top:s=r+a;break;case er.middle:s=(this.height-o+r)/2;break;case er.bottom:s=this.height-o-a}return s},e.getOffsetX=function(t,e){var i=0;switch(this.textAlign){case ei.left:i=0;break;case ei.middle:i=(this.width-e)/2;break;case ei.right:i=this.width-e}return i},e.setSize=function(t,e){this.width=t,this.height=e},t}(),ux=function(){function t(t){this.isUnderline=!1,this.underlineHeight=1,this.isOutlined=!1,this.outlineWidth=0,this.hasShadow=!1,this.fontDesc="",this.fontScale=2,this.fontOffset=0,this.update(t)}return t.prototype.update=function(t){var e,i,r,n,a,o,s,u=t.textColor,h=t.fontSize,l=t.outline,c=t.shadow,f=t.fontWeight,d=t.fontStyle,p=t.fontFamily;this.textColor=[].concat(void 0===u?[1,1,1,1]:u),this.textWeight=void 0===f?"normal":f,this.fontStyle=void 0===d?"normal":d,this.fontFamily=void 0===p?"sans-serif":p,this.fontSize=void 0===h?40:h,this.isOutlined=!1,this.outlineColor=[1,1,1,1],this.outlineWidth=0,l&&(null!=(e=l.outlineWidth)?e:0)>0&&(this.isOutlined=!0,this.outlineColor=[].concat(null!=(i=l.outlineColor)?i:[1,1,1,1]),this.outlineWidth=null!=(r=l.outlineWidth)?r:0),this.hasShadow=!1,this.shadowBlur=2,this.shadowColor=[0,0,0,1],this.shadowOffsetX=0,this.shadowOffsetY=0,c&&(this.hasShadow=!0,this.shadowBlur=null!=(n=c.shadowBlur)?n:2,this.shadowColor=[].concat(null!=(a=c.shadowColor)?a:[0,0,0,1]),this.shadowOffsetX=null!=(o=c.shadowOffsetX)?o:0,this.shadowOffsetY=null!=(s=c.shadowOffsetY)?s:0),this.fontOffset=0,this.fontStyle!==ea.normal&&(this.fontOffset+=this.fontSize*Math.tan(.20943951))},t}(),ub=function(){function t(){this.isDirty=!0,this.maxLineWidth=0,this.ALPHA_FIX_VALUE=1/255}var e=t.prototype;return e.setText=function(t){this.text!==t&&(this.text=t.toString(),this.isDirty=!0)},e.setTextAlign=function(t){this.textLayout.textAlign!==t&&(this.textLayout.textAlign=t,this.isDirty=!0)},e.setTextVerticalAlign=function(t){this.textLayout.textVerticalAlign!==t&&(this.textLayout.textVerticalAlign=t,this.isDirty=!0)},e.setTextBaseline=function(t){console.warn("setTextBaseline 已废弃,请改用 setTextVerticalAlign。本次调用将转调用 setTextVerticalAlign。"),this.setTextVerticalAlign(t)},e.setTextColor=function(t){this.textStyle.textColor!==t&&(this.textStyle.textColor=t,this.isDirty=!0)},e.setFontFamily=function(t){if(!iv(t)){console.warn("Risky font family, ignored:",t);return}this.textStyle.fontFamily!==t&&(this.textStyle.fontFamily=t,this.isDirty=!0)},e.setFontWeight=function(t){this.textStyle.textWeight!==t&&(this.textStyle.textWeight=t,this.isDirty=!0)},e.setFontStyle=function(t){this.textStyle.fontStyle!==t&&(this.textStyle.fontStyle=t,this.isDirty=!0)},e.setOutlineColor=function(t){this.textStyle.outlineColor!==t&&(this.textStyle.outlineColor=t,this.isDirty=!0)},e.setOutlineEnabled=function(t){this.textStyle.isOutlined!==t&&(this.textStyle.isOutlined=t,this.isDirty=!0)},e.setFontScale=function(t){this.textStyle.fontScale!==t&&(this.textStyle.fontScale=t,this.isDirty=!0)},e.setOverflow=function(t){this.textLayout.overflow=t,this.isDirty=!0},e.getFontDesc=function(t){var e=this.textStyle,i=e.fontSize,r=e.fontFamily,n=e.textWeight,a=e.fontStyle,o=""+(t||i).toString()+"px ";return["serif","sans-serif","monospace","courier"].includes(r)?o+=r:o+='"'+r+'"',n!==en.normal&&(o=n+" "+o),a!==ea.normal&&(o=a+" "+o),o},e.setupOutline=function(t){void 0===t&&(t=1);var e=this.context,i=this.textStyle,r=i.outlineColor,n=i.outlineWidth,a=r[0],o=r[1],s=r[2],u=r[3];e&&(e.strokeStyle="rgba("+255*a+", "+255*o+", "+255*s+", "+u+")",e.lineWidth=2*n/t)},e.setupShadow=function(){var t=this.context,e=this.textStyle,i=e.shadowColor,r=e.shadowBlur,n=e.shadowOffsetX,a=e.shadowOffsetY,o=e.fontScale,s=i[0],u=i[1],h=i[2],l=i[3];t&&(t.shadowColor="rgba("+255*s+", "+255*u+", "+255*h+", "+l+")",t.shadowBlur=r*o,t.shadowOffsetX=n*o,t.shadowOffsetY=-a*o)},e.disposeTextTexture=function(){var t=this.renderer.texture;t&&t!==this.engine.whiteTexture&&t.dispose()},e.releaseTextCanvas=function(){this.canvas&&this.context&&(og.releaseCanvasAndContext({canvas:this.canvas,context:this.context}),this.canvas=void 0,this.context=null)},e.renderToTexture=function(t,e,i,r,n){if(void 0===n&&(n={}),this.context&&this.canvas){var a=this.context;a.save(),this.canvas.width=t,this.canvas.height=e,a.setTransform(1,0,0,1,0,0),i||(a.translate(0,e),a.scale(1,-1)),a.clearRect(0,0,t,e),a.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",r(a),a.restore();var o=a.getImageData(0,0,t,e),s=r7.createWithData(this.engine,{data:new Uint8Array(o.data),width:o.width,height:o.height},{flipY:i,magFilter:rV.LINEAR,minFilter:rV.LINEAR,wrapS:rV.CLAMP_TO_EDGE,wrapT:rV.CLAMP_TO_EDGE});!1!==n.disposeOld&&this.disposeTextTexture(),this.renderer.texture=s,this.material.setTexture("_MainTex",s)}},e.initTextBase=function(t){this.engine=t;var e=og.getCanvasAndContext(1,1);this.canvas=e.canvas,this.context=e.context},t}(),uT=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,uC=0;t.TextComponent=function(t){function e(e){(i=t.call(this,e)||this).isDirty=!0,i.lineCount=0,i.effectScaleX=1,i.effectScaleY=1,i.maxLineWidth=0,i.name="MText"+uC++;var i,r=og.getCanvasAndContext(1,1);i.canvas=r.canvas,i.context=r.context;var n=i.getDefaultProps().options;return i.updateWithOptions(n),i}iB(e,t);var i=e.prototype;return i.onUpdate=function(e){t.prototype.onUpdate.call(this,e),this.updateTexture();for(var i,r=ij(this.materials);!(i=r()).done;){var n=i.value,a=this.transform.size.x,o=this.transform.size.y,s=this.getTextureExpandScale(),u=s[0],h=s[1];a*=u,o*=h,n.setVector2("_Size",new e2(a,o))}},i.render=function(t){this.maskManager.drawStencilMask(t,this),t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.material)},i.onDestroy=function(){t.prototype.onDestroy.call(this),this.disposeTextTexture(),this.releaseTextCanvas()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.interaction,r=e.options;this.interaction=i,this.resetState(),this.updateWithOptions(r),this.renderText(r),this.material.setColor("_Color",new e5(1,1,1,1))},i.resetState=function(){this.disposeTextTexture(),this.isDirty=!0,this.lineCount=0,this.maxLineWidth=0},i.updateWithOptions=function(t){this.textStyle?this.textStyle.update(t):this.textStyle=new ux(t),this.textLayout?this.textLayout.update(t):this.textLayout=new ug(t),this.text=t.text.toString()},i.getLineCount=function(t){var e=this.context,i=this.textLayout,r=i.letterSpace,n=i.overflow;this.maxLineWidth=0;var a=this.textLayout.width+this.textStyle.fontOffset,o=1,s=0,u=0,h=Array.from(t);if(e&&(e.font=this.getFontDesc(this.textStyle.fontSize)),n===t7.display){for(var l,c=ij(h);!(l=c()).done;){var f,d,p=l.value,m=null!=(d=null==e?void 0:null==(f=e.measureText(p))?void 0:f.width)?d:0;"\n"===p?(o++,s=0,u=0):(u>0&&(s+=r),s+=m,u++,this.maxLineWidth=Math.max(this.maxLineWidth,s))}return o}if(this.textLayout.keepWordIntact)for(var v,y=0,g=0,x=ij(h);!(v=x()).done;){var b,T,C=v.value,E=null!=(T=null==e?void 0:null==(b=e.measureText(C))?void 0:b.width)?T:0;if("\n"===C){o++,this.maxLineWidth=Math.max(this.maxLineWidth,s),s=0,u=0,y=0,g=0;continue}s+(u>0?r:0)+E>a&&u>0&&(o++,g>1?(this.maxLineWidth=Math.max(this.maxLineWidth,y),s-=y,u-=g):(this.maxLineWidth=Math.max(this.maxLineWidth,s),s=0,u=0),y=0,g=0),u>0&&(s+=r),s+=E,u++,!1!==uy(C)&&(y=s,g=u)}else for(var _=0;_<h.length;_++){var w,S,M=h[_],A=null!=(S=null==e?void 0:null==(w=e.measureText(M))?void 0:w.width)?S:0;u>0&&(s+=r),(s+A>a&&_>0||"\n"===M)&&(o++,this.maxLineWidth=Math.max(this.maxLineWidth,s),s=0,u=0),"\n"!==M&&(s+=A,u++)}return this.maxLineWidth=Math.max(this.maxLineWidth,s),o},i.setLineHeight=function(t){var e=Math.max(this.textStyle.fontSize,t);this.textLayout.lineHeight!==e&&(this.textLayout.lineHeight=e,this.isDirty=!0)},i.updateTexture=function(t){var e=this;if(void 0===t&&(t=!0),this.isDirty&&this.context&&this.canvas){var i=this.textStyle,r=this.textLayout,n=i.fontScale;r.autoResize===et.autoWidth?(r.width=this.getTextWidth(),this.lineCount=this.getLineCount(this.text),r.height=r.lineHeight*this.lineCount):r.autoResize===et.autoHeight?(this.lineCount=this.getLineCount(this.text),r.height=r.lineHeight*this.lineCount):this.lineCount=this.getLineCount(this.text);var a=r.width+i.fontOffset,o=r.height,s=i.fontSize,u=r.lineHeight;i.fontDesc=this.getFontDesc(s);var h=Array.from(this.text||""),l=this.getEffectPadding(),c=l.padL,f=l.padR,d=l.padT,p=l.padB,m=(c|f|d|p)!=0,v=this.engine.gpuCapability.detail.maxTextureSize/2,y=m?a+c+f:a,g=m?o+d+p:o;n=Math.min(n,v/Math.max(y,g,1));var x=Math.ceil(y*n),b=Math.ceil(g*n),T=m?c:0,C=m?t?d:p:0;this.effectScaleX=a>0?x/(a*n):1,this.effectScaleY=o>0?b/(o*n):1,this.transform.setSize(.0123044998279225*a,.0123044998279225*o),this.renderToTexture(x,b,t,function(t){t.scale(n,n),e.maxLineWidth>a&&r.overflow===t7.display?t.font=e.getFontDesc(s*a/e.maxLineWidth):t.font=i.fontDesc;var o=i.textColor,l=o[0],c=o[1],f=o[2],d=o[3];t.fillStyle="rgba("+255*l+", "+255*c+", "+255*f+", "+d+")";var p=[],m=0,v=r.getOffsetY(i,e.lineCount,u,s),y=[],g=[];if(r.keepWordIntact)for(var x=-1,b=!1,E=0;E<h.length;E++){var _=h[E],w=t.measureText(_);if("\n"===_){p.push({y:v,width:m,chars:y,charOffsetX:g}),m=0,v+=u,y=[],g=[],x=-1,b=!1;continue}if(m+(y.length>0?r.letterSpace:0)+w.width>a&&y.length>0){if(x>0){var S=b?x:x+1,M=y.slice(0,S),A=g.slice(0,S),P=M.length>0?A[A.length-1]+t.measureText(M[M.length-1]).width:0;p.push({y:v,width:P,chars:M,charOffsetX:A}),v+=u,y=y.slice(x+1),m=0,g=[];for(var R=0;R<y.length;R++)R>0&&(m+=r.letterSpace),g.push(m),m+=t.measureText(y[R]).width;x=-1,b=!1}else p.push({y:v,width:m,chars:y,charOffsetX:g}),m=0,v+=u,y=[],g=[],x=-1,b=!1}y.length>0&&(m+=r.letterSpace),g.push(m),y.push(_),m+=w.width;var I=uy(_);!1!==I&&(x=y.length-1,b="swallow"===I)}else for(var O=0;O<h.length;O++){var L=h[O],F=t.measureText(L);y.length>0&&(m+=r.letterSpace),(m+F.width>a&&O>0||"\n"===L)&&(p.push({y:v,width:m,chars:y,charOffsetX:g}),m=0,v+=u,y=[],g=[]),"\n"!==L&&(y.push(L),g.push(m),m+=F.width)}y.length>0&&p.push({y:v,width:m,chars:y,charOffsetX:g});var V=i.isOutlined&&i.outlineWidth>0;V&&(i.hasShadow&&e.setupShadow(),e.setupOutline(n),p.forEach(function(e){var n=C+e.y,a=e.chars.join("");if(a.length>0&&uT.test(a)){var o=t.measureText(a).width,s=r.getOffsetX(i,o);t.save(),t.direction="rtl",t.strokeText(a,T+s+o,n),t.restore()}else for(var u=r.getOffsetX(i,e.width),h=0;h<e.chars.length;h++){var l=e.chars[h],c=T+u+e.charOffsetX[h];t.strokeText(l,c,n)}}),i.hasShadow&&(t.shadowColor="transparent")),!V&&i.hasShadow&&e.setupShadow(),p.forEach(function(e){var n=C+e.y,a=e.chars.join("");if(a.length>0&&uT.test(a)){var o=t.measureText(a).width,s=r.getOffsetX(i,o);t.save(),t.direction="rtl",t.fillText(a,T+s+o,n),t.restore()}else for(var u=r.getOffsetX(i,e.width),h=0;h<e.chars.length;h++){var l=e.chars[h],c=T+u+e.charOffsetX[h];t.fillText(l,c,n)}}),i.hasShadow&&(t.shadowColor="transparent")}),this.isDirty=!1}},i.renderText=function(t){this.updateTexture()},i.getTextureExpandScale=function(){return[this.effectScaleX,this.effectScaleY]},i.getEffectPadding=function(){var t=this.textStyle,e=(t.isOutlined&&t.outlineWidth>0?Math.ceil(2*t.outlineWidth):0)+(t.hasShadow&&(t.shadowBlur>0||0!==t.shadowOffsetX||0!==t.shadowOffsetY)?Math.ceil(Math.abs(t.shadowOffsetX)+Math.abs(t.shadowOffsetY)+t.shadowBlur):0);return{padL:e,padR:e,padT:e,padB:e}},i.setAutoResize=function(t){this.textLayout.autoResize!==t&&(this.textLayout.autoResize=t,this.isDirty=!0)},i.setTextWidth=function(t){var e=Math.max(0,Number(t)||0),i=this.textLayout;i.width!==e&&(i.autoResize===et.autoWidth&&(i.autoResize=et.autoHeight),i.width=e,this.isDirty=!0)},i.setTextHeight=function(t){var e=Math.max(0,Number(t)||0);if(0!==e){var i=this.textLayout;i.height!==e&&(i.height=e,this.isDirty=!0)}},i.setFontSize=function(t){var e=Math.max(1,Number(t)||1);this.textStyle.fontSize!==e&&(this.textStyle.fontSize=e,this.isDirty=!0)},i.setOutlineWidth=function(t){var e=Math.max(0,Number(t)||0);this.textStyle.outlineWidth!==e&&(this.textStyle.outlineWidth=e,this.isDirty=!0)},i.setOutlineEnabled=function(t){this.textStyle.isOutlined!==t&&(this.textStyle.isOutlined=t,this.isDirty=!0)},i.setShadowBlur=function(t){var e=Math.max(0,Number(t)||0);this.textStyle.shadowBlur!==e&&(this.textStyle.shadowBlur=e,this.isDirty=!0)},i.setShadowColor=function(t){var e=null!=t?t:[0,0,0,1];this.textStyle.shadowColor!==e&&(this.textStyle.shadowColor=e,this.isDirty=!0)},i.setShadowOffsetX=function(t){var e=Number(t)||0;this.textStyle.shadowOffsetX!==e&&(this.textStyle.shadowOffsetX=e,this.isDirty=!0)},i.setShadowOffsetY=function(t){var e=Number(t)||0;this.textStyle.shadowOffsetY!==e&&(this.textStyle.shadowOffsetY=e,this.isDirty=!0)},i.getTextWidth=function(){var t,e,i,r=this.context;if(!r)return null!=(e=null==(t=this.textLayout)?void 0:t.width)?e:0;var n=(null!=(i=this.text)?i:"").toString(),a=this.textLayout,o=this.textStyle;r.font=this.getFontDesc(o.fontSize);for(var s=0,u=0,h=0;h<n.length;h++){var l=n[h];if("\n"===l){s=Math.max(s,u),u=0;continue}u+=(a.letterSpace||0)+r.measureText(l).width}return Math.max(0,Math.ceil((s=Math.max(s,u))-(o.fontOffset||0)-1e-4)+2)},i.getDefaultProps=function(){return{id:"default-id-"+Math.random().toString(36).substr(2,9),item:{id:"default-item-"+Math.random().toString(36).substr(2,9)},dataType:em.TextComponent,options:{text:"默认文本",fontFamily:"AlibabaSans-BoldItalic",fontSize:40,textColor:[1,1,1,1],fontWeight:en.normal,letterSpace:0,textAlign:ei.middle,fontStyle:ea.normal,textWidth:200,textHeight:42,lineHeight:40.148},renderer:{renderMode:1,anchor:[.5,.5]}}},e}(oE),t.TextComponent=eG([iZ(em.TextComponent)],t.TextComponent),iI(t.TextComponent,[ub]);var uE=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(oI(iD));function u_(t,e,i){return Math.max(e,Math.min(i,t))}function uw(t,e){return t.x===e.x&&t.y===e.y}function uS(t){return new e2(t.x,t.y)}function uM(t,e){var i=Math.hypot(t,e);return i<=Number.EPSILON?new e2(1,0):new e2(t/i,e/i)}function uA(t,e){var i=1-e,r=i*i,n=e*e,a=r*i,o=3*r*e,s=3*i*n,u=n*e;return new e2(a*t[0].x+o*t[1].x+s*t[2].x+u*t[3].x,a*t[0].y+o*t[1].y+s*t[2].y+u*t[3].y)}function uP(t,e){var i,r,n,a,o,s,u,h,l,c,f,d,p=new e2((i=t[0].x)+(t[1].x-i)*e,(r=t[0].y)+(t[1].y-r)*e),m=new e2((n=t[1].x)+(t[2].x-n)*e,(a=t[1].y)+(t[2].y-a)*e),v=new e2((o=t[2].x)+(t[3].x-o)*e,(s=t[2].y)+(t[3].y-s)*e),y=new e2((u=p.x)+(m.x-u)*e,(h=p.y)+(m.y-h)*e),g=new e2((l=m.x)+(v.x-l)*e,(c=m.y)+(v.y-c)*e),x=new e2((f=y.x)+(g.x-f)*e,(d=y.y)+(g.y-d)*e);return[[uS(t[0]),p,y,x],[x,g,v,uS(t[3])]]}function uR(t,e){t.push({action:"moveTo",data:[e]})}function uI(t,e){t.push({action:"lineTo",data:[e]})}function uO(t){t.push({action:"closePath",data:[]})}var uL=new e3;function uF(t,e,i,r){if(0===t.length)return t.push(uS(i)),r;var n=t[t.length-1],a=Math.hypot(i.x-n.x,i.y-n.y);if(a<=Number.EPSILON)return r;var o=t.length-1;return t.push(uS(i)),r+=a,e.push({distance:r,pointIndex:o,tValue:1,type:"line"}),r}function uV(t,e,i,r){return 0===e.length||t.length<2||i<=Number.EPSILON?null:{points:t,segments:e,closePath:r}}function uN(t,e){for(var i=t[e].pointIndex,r=e+1;r<t.length&&t[r].pointIndex===i;)r++;return r}function uk(t,e){return[t[e],t[e+1]]}function uD(t,e){return[t[e],t[e+1],t[e+2],t[e+3]]}var uz=function(){function t(t,e,i,r){this.segments=t,this.points=e,this.contourLength=i,this.contourClosed=r}var e=t.prototype;return e.length=function(){return this.contourLength},e.isClosed=function(){return this.contourClosed},e.getPosTan=function(t){if(0===this.segments.length)return{pos:new e2,tan:new e2(1,0)};var e,i,r,n,a,o,s=u_(t,0,this.contourLength),u=this.findSegment(s),h=this.segments[u],l=u>0?this.segments[u-1].distance:0,c=h.distance-l,f=c<=Number.EPSILON?0:(s-l)/c;if("line"===h.type)return{pos:[new e2((i=(e=uk(this.points,h.pointIndex))[0].x)+(e[1].x-i)*f,(r=e[0].y)+(e[1].y-r)*f),new e2((n=e[0].x)+(e[1].x-n)*f,(a=e[0].y)+(e[1].y-a)*f)][0],tan:uM(e[1].x-e[0].x,e[1].y-e[0].y)};var d=u>0?this.segments[u-1]:void 0,p=(o=d&&d.pointIndex===h.pointIndex?d.tValue:0)+(h.tValue-o)*f;return function(t,e){if(e<=0){var i=uw(t[0],t[1])?uw(t[1],t[2])?t[3]:t[2]:t[1];return{pos:new e2(t[0].x,t[0].y),tan:uM(i.x-t[0].x,i.y-t[0].y)}}if(e>=1){var r=uw(t[3],t[2])?uw(t[2],t[1])?t[0]:t[1]:t[2];return{pos:new e2(t[3].x,t[3].y),tan:uM(t[3].x-r.x,t[3].y-r.y)}}var n=uA(t,Math.max(0,e-1e-4)),a=uA(t,Math.min(1,e+1e-4));return{pos:uA(t,e),tan:uM(a.x-n.x,a.y-n.y)}}(uD(this.points,h.pointIndex),p)},e.getSegment=function(t,e,i,r){var n=u_(t,0,this.contourLength),a=u_(e,0,this.contourLength);if(!(n>=a)&&0!==this.segments.length){var o=this.findSegment(n),s=this.findSegment(a),u=this.segments[o],h=this.segments[s],l=this.computeT(o,n),c=this.computeT(s,a);if(1-l<Number.EPSILON&&o<s&&(o++,u=this.segments[o],l=0),u.pointIndex===h.pointIndex){this.extractSegment(o,l,c,i,r);return}this.extractSegment(o,l,1,i,r);for(var f=uN(this.segments,o);f<this.segments.length&&this.segments[f].pointIndex!==h.pointIndex;)this.extractWholeSegment(f,i),f=uN(this.segments,f);this.extractSegment(s,0,c,i,!1)}},e.warp=function(t){var e=this.getPosTan(t.x);return new e2(e.pos.x-e.tan.y*t.y,e.pos.y+e.tan.x*t.y)},e.dump=function(){console.log("ContourMeasure",{length:this.contourLength,points:this.points.length,segments:this.segments.length,isClosed:this.contourClosed})},e.findSegment=function(t){for(var e=0,i=this.segments.length-1;e<i;){var r=e+i>>1;this.segments[r].distance<t?e=r+1:i=r}return e},e.computeT=function(t,e){var i=this.segments[t],r=t>0?this.segments[t-1]:void 0,n=r?r.distance:0,a=r&&r.pointIndex===i.pointIndex?r.tValue:0,o=i.distance<=n?0:(e-n)/(i.distance-n);return u_(a+(i.tValue-a)*o,a,i.tValue)},e.extractWholeSegment=function(t,e){var i=this.segments[t];if("line"===i.type){var r=uk(this.points,i.pointIndex)[1];e.lineTo(r.x,r.y);return}var n=uD(this.points,i.pointIndex),a=n[1],o=n[2],s=n[3];e.bezierCurveTo(a.x,a.y,o.x,o.y,s.x,s.y,i.smoothness,i.scale)},e.extractSegment=function(t,e,i,r,n){var a=this.segments[t];if("line"===a.type){var o,s,u,h,l=uk(this.points,a.pointIndex),c=l[0],f=l[1],d=new e2((o=c.x)+(f.x-o)*e,(s=c.y)+(f.y-s)*e),p=new e2((u=c.x)+(f.x-u)*i,(h=c.y)+(f.y-h)*i);n&&r.moveTo(d.x,d.y),r.lineTo(p.x,p.y);return}var m=function(t,e,i){if(e<=0&&i>=1)return t.map(uS);var r=u_(e,0,1),n=u_(i,r,1),a=t.map(uS);return r>0&&(a=uP(a,r)[1]),n<1&&(a=uP(a,r>=1?0:(n-r)/(1-r))[0]),a}(uD(this.points,a.pointIndex),e,i);n&&r.moveTo(m[0].x,m[0].y),r.bezierCurveTo(m[1].x,m[1].y,m[2].x,m[2].y,m[3].x,m[3].y,a.smoothness,a.scale)},t}(),uB=function(){function t(t,e){void 0===e&&(e=1),this.contourPath=[],this.cursor=0,this.screenScale=1,this.rewind(t,e)}var e=t.prototype;return e.rewind=function(t,e){var i,r;void 0===e&&(e=1),this.contourPath=(i=e,null!=(r=function(t){for(var e,i=[],r=ij(t.instructions);!(e=r()).done;){var n=e.value,a=n.data;switch(n.action){case"moveTo":uR(i,new e2(a[0],a[1]));break;case"lineTo":uI(i,new e2(a[0],a[1]));break;case"bezierCurveTo":!function(t,e,i,r,n,a){t.push({action:"bezierCurveTo",data:[e,i,r],smoothness:n,scale:a})}(i,new e2(a[0],a[1]),new e2(a[2],a[3]),new e2(a[4],a[5]),a[6],a[7]);break;case"closePath":uO(i);break;default:return null}}return i}(t))?r:function(t,e){for(var i,r=[],n=ij(t.shapePrimitives);!(i=n()).done;)!function(){var t,n=i.value,a=n.shape,o=n.transform;!function(t,e,i){if(!(e.length<2)){uR(t,new e2(e[0],e[1]));for(var r=2;r<e.length;r+=2)uI(t,new e2(e[r],e[r+1]));i&&uO(t)}}(r,function(t,e){if(!e)return t.slice();for(var i=Array(t.length),r=0;r<t.length;r+=2){uL.set(t[r],t[r+1],0);var n=e.transformPoint(uL,uL);i[r]=n.x,i[r+1]=n.y}return i}(eU(a,az)?a.points.slice():(t=[],a.build(t,e),t),o),!eU(a,az)||a.closePath)}();return r}(t.shapePath,i)),this.screenScale=e,this.cursor=0},e.tryNext=function(){var e=function(t,e,i,r){for(var n=[],a=[],o=0,s=null,u=!1,h=function(){if(0===n.length){var t=null!=s?s:new e2(0,0);n.push(uS(t)),s=uS(t)}},l=e;l<t.length;l++){var c=t[l];switch(c.action){case"moveTo":var f=uV(n,a,o,u);if(f)return{contour:f,nextIndex:l};n=[],a=[],o=0,s=uS(c.data[0]),u=!1,n.push(uS(s));break;case"lineTo":h(),o=uF(n,a,c.data[0],o);break;case"bezierCurveTo":h();var d,p=n[n.length-1],m=n.length-1,v=c.data,y=v[0],g=v[1],x=v[2],b=function(t,e,i,r,n,a,o,s){var u=[],h=[];aO(u,r[0].x,r[0].y,r[1].x,r[1].y,r[2].x,r[2].y,r[3].x,r[3].y,null!=o?o:a,null!=s?s:n,h);for(var l=[],c=r[0],f=0;f<h.length;f++){var d=h[f],p=2*f,m=d>=1?r[3]:new e2(u[p],u[p+1]),v=Math.hypot(m.x-c.x,m.y-c.y);v>Number.EPSILON&&(i+=v,l.push({distance:i,pointIndex:e,tValue:d,type:"cubic",smoothness:o,scale:s}),c=m)}return 0===l.length||t.push(uS(r[1]),uS(r[2]),uS(r[3])),{distance:i,segments:l}}(n,m,o,[uS(p),uS(y),uS(g),uS(x)],i,r,c.smoothness,c.scale);o=b.distance,(d=a).push.apply(d,[].concat(b.segments));break;case"closePath":n.length>0&&s&&(o=uF(n,a,s,o),u=!0);var T=uV(n,a,o,u);if(T)return{contour:T,nextIndex:l+1};n=[],a=[],o=0,s=null,u=!1}}return{contour:uV(n,a,o,u),nextIndex:t.length}}(this.contourPath,this.cursor,this.screenScale,t.defaultTolerance);this.cursor=e.nextIndex;var i=e.contour?function(t){if(t.points.length<2||0===t.segments.length)return null;var e=t.segments[t.segments.length-1].distance;return e<=Number.EPSILON?null:{points:t.points,segments:t.segments,contourLength:e,contourClosed:t.closePath}}(e.contour):null;return i?new uz(i.segments,i.points,i.contourLength,i.contourClosed):null},e.next=function(){for(;this.cursor<this.contourPath.length;){var t=this.tryNext();if(t)return t}return null},e.toArray=function(){for(var t,e=this.cursor,i=[];t=this.next();)i.push(t);return this.cursor=e,i},t}();uB.defaultTolerance=.5;var uU=function(){function t(t){this.graphicsPath=t,this.currentPoly=null,this.shapePrimitives=[]}var e=t.prototype;return e.buildPath=function(){this.currentPoly=null,this.shapePrimitives.length=0;for(var t,e=this.graphicsPath,i=ij(e.instructions);!(t=i()).done;){var r=t.value,n=r.action,a=r.data;switch(n){case"bezierCurveTo":this.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);break;case"moveTo":this.moveTo(a[0],a[1]);break;case"lineTo":this.lineTo(a[0],a[1]);break;case"ellipse":this.ellipse(a[0],a[1],a[2],a[3],a[4]);break;case"circle":this.circle(a[0],a[1],a[2],a[3]);break;case"polyStar":this.polyStar(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);break;case"rect":this.rect(a[0],a[1],a[2],a[3],a[4]);break;case"triangle":this.triangle(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);break;case"closePath":this.closePath()}}this.endPoly()},e.bezierCurveTo=function(t,e,i,r,n,a,o,s){this.ensurePoly();var u=this.currentPoly;return aO(u.points,u.lastX,u.lastY,t,e,i,r,n,a,o,s),this},e.moveTo=function(t,e){return this.startPoly(t,e),this},e.lineTo=function(t,e){this.ensurePoly();var i=this.currentPoly.points,r=i[i.length-2],n=i[i.length-1];return(r!==t||n!==e)&&i.push(t,e),this},e.closePath=function(){return this.endPoly(!0),this},e.ellipse=function(t,e,i,r,n){return this.drawShape(new aP(t,e,i,r),n),this},e.circle=function(t,e,i,r){return this.drawShape(new aD(t,e,i),r),this},e.polyStar=function(t,e,i,r,n,a,o){return this.drawShape(new ak(t,e,i,r,n,a),o),this},e.rect=function(t,e,i,r,n,a){return this.drawShape(new aR(t,e,i,r,n),a),this},e.triangle=function(t,e,i,r,n,a,o){return this.drawShape(new aI(t,e,i,r,n,a),o),this},e.drawShape=function(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this},e.startPoly=function(t,e){var i=this.currentPoly;return i&&this.endPoly(),(i=new az).points.push(t,e),this.currentPoly=i,this},e.endPoly=function(t){void 0===t&&(t=!1);var e=this.currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this.currentPoly=null,this},e.ensurePoly=function(t){this.currentPoly||(this.currentPoly=new az,this.currentPoly.points.push(0,0))},t}(),uG=function(){function t(){this.instructions=[],this.dirty=!1}var e=t.prototype;return e.bezierCurveTo=function(t,e,i,r,n,a,o,s){return this.instructions.push({action:"bezierCurveTo",data:[t,e,i,r,n,a,o,s]}),this.dirty=!0,this},e.lineTo=function(t,e){return this.instructions.push({action:"lineTo",data:[t,e]}),this.dirty=!0,this},e.moveTo=function(t,e){return this.instructions.push({action:"moveTo",data:[t,e]}),this.dirty=!0,this},e.closePath=function(){return this.instructions.push({action:"closePath",data:[]}),this.dirty=!0,this},e.ellipse=function(t,e,i,r,n){return this.instructions.push({action:"ellipse",data:[t,e,i,r,n]}),this.dirty=!0,this},e.circle=function(t,e,i,r){return this.instructions.push({action:"circle",data:[t,e,i,r]}),this.dirty=!0,this},e.rect=function(t,e,i,r,n,a){return this.instructions.push({action:"rect",data:[t,e,i,r,n,a]}),this.dirty=!0,this},e.triangle=function(t,e,i,r,n,a,o){return this.instructions.push({action:"triangle",data:[t,e,i,r,n,a,o]}),this.dirty=!0,this},e.polyStar=function(t,e,i,r,n,a,o){return this.instructions.push({action:"polyStar",data:[t,e,i,r,n,a,o]}),this.dirty=!0,this},e.clear=function(){return this.instructions.length=0,this.dirty=!0,this},rI(t,[{key:"shapePath",get:function(){return this._shapePath||(this._shapePath=new uU(this)),this.dirty&&(this.dirty=!1,this._shapePath.buildPath()),this._shapePath}}]),t}();t.TrimPathMode=void 0,(tI=t.TrimPathMode||(t.TrimPathMode={}))[tI.Synchronized=0]="Synchronized",tI[tI.Sequential=1]="Sequential";var uW=function(){function t(){this.start=0,this.end=1,this.offset=0,this.mode=0,this.trimmedGraphicsPath=new uG}var e=t.prototype;return e.clone=function(){var e=new t;return e.start=this.start,e.end=this.end,e.offset=this.offset,e.mode=this.mode,e},e.createTrimmedPath=function(t,e){if(this.isIdentity())return t;var i=new uB(t,e).toArray();return this.trimmedGraphicsPath.clear(),0===i.length||(1===this.mode?this.applySequentialTrimPath(i,this.trimmedGraphicsPath):this.applySynchronizedTrimPath(i,this.trimmedGraphicsPath)),this.trimmedGraphicsPath},e.isIdentity=function(){return 0===this.start&&1===this.end},e.fromData=function(t){this.start=t.start,this.end=t.end,this.offset=t.offset,this.mode=t.mode},e.normalizeTrimOffset=function(){return(this.offset%1+1)%1},e.applySequentialTrimPath=function(t,e){for(var i,r=0,n=ij(t);!(i=n()).done;)r+=i.value.length();if(!(r<=0)){var a=this.normalizeTrimOffset(),o=r*(this.start+a),s=r*(this.end+a);if(s<o){var u=o;o=s,s=u}o>r&&(o-=r,s-=r);for(var h=[],l=0;s>0;){var c=l%t.length,f=t[c].length();o<f?(h.push({contourIndex:c,startLength:o,endLength:s}),s-=f,o=0):(o-=f,s-=f),l++}for(var d=-1,p=0;p<h.length;p++){var m=h[p],v=t[m.contourIndex],y=v.length();v.getSegment(m.startLength,m.endLength,e,d!==m.contourIndex||!v.isClosed()),0===m.startLength&&m.endLength-m.startLength>=y&&v.isClosed()&&e.closePath(),d=m.contourIndex}}},e.applySynchronizedTrimPath=function(t,e){for(var i,r=this.normalizeTrimOffset(),n=ij(t);!(i=n()).done;){var a=i.value,o=a.length(),s=o*(this.start+r),u=o*(this.end+r);if(u<s){var h=s;s=u,u=h}for(s>=o&&(s-=o,u-=o),a.getSegment(s,u,e,!0);u>o;)s=0,u-=o,a.getSegment(s,u,e,!a.isClosed());0===this.start&&1===this.end&&a.isClosed()&&e.closePath()}},t}();t.TexturePaintScaleMode=void 0,(tO=t.TexturePaintScaleMode||(t.TexturePaintScaleMode={}))[tO.Fill=0]="Fill",tO[tO.Fit=1]="Fit",tO[tO.Crop=2]="Crop",tO[tO.Tile=3]="Tile",t.ShapeComponent=function(e){function i(t){(i=e.call(this,t)||this).shapeDirty=!0,i.materialDirty=!0,i.graphicsPath=new uG,i.fills=[],i.strokeAttributes={width:1,alignment:.5,cap:eh.Butt,join:el.Miter,miterLimit:10},i.strokeWidth=1,i.strokeCap=eh.Butt,i.strokeJoin=el.Miter,i.strokes=[],i._strokeTrimPath=null,i._fillTrimPath=null,i.fillMaterials=[],i.strokeMaterials=[],i.getHitTestParams=function(t){var e=nu.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix());if(t){i.boundingBoxInfo.setGeometry(i.geometry,e);var r=i.boundingBoxInfo.getRawBoundingBoxTriangle();if(r)return{behavior:0,type:r.type,triangles:r.area,backfaceCulling:i.rendererOptions.side===tB.FRONT,clipMasks:i.frameClipMasks}}},i.rendererOptions={renderMode:tY.MESH,blending:tz.ALPHA,texture:i.engine.whiteTexture,occlusion:!1,transparentOcclusion:!1,side:tB.DOUBLE,mask:0};var i,r={type:eo.Solid,color:new e5(1,1,1,1)};i.strokes.push(r);var n={type:eo.Solid,color:new e5(1,1,1,1)};return i.fills.push(n),i.shapeAttributes={type:eu.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},i.geometry=aK.create(i.engine,{attributes:{aPos:{type:rV.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},aUV:{size:2,offset:0,releasable:!0,type:rV.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])}},indices:{data:new Uint16Array([0,1,2,2,1,3]),releasable:!0},mode:rV.TRIANGLES,drawCount:6}),i.geometry.subMeshes.push({offset:0,indexCount:0,vertexCount:0},{offset:0,indexCount:0,vertexCount:0}),i}iB(i,e);var r=i.prototype;return r.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},r.onUpdate=function(t){if(this.shapeDirty){var e,i,r,n,a=this.computeScreenScale();this.buildPath(this.shapeAttributes,a);var o=null!=(r=null==(e=this._fillTrimPath)?void 0:e.createTrimmedPath(this.graphicsPath,a))?r:this.graphicsPath,s=null!=(n=null==(i=this._strokeTrimPath)?void 0:i.createTrimmedPath(this.graphicsPath,a))?n:this.graphicsPath;this.buildGeometryFromPath(o.shapePath,s.shapePath,a),this.shapeDirty=!1}this.materialDirty&&(this.updateMaterials(),this.materialDirty=!1)},r.render=function(t){this.maskManager.drawStencilMask(t,this),this.draw(t)},r.drawStencilMask=function(t){if(this.isActiveAndEnabled){for(var e=0;e<this.fillMaterials.length;e++)this.maskManager.drawGeometryMask(this.engine.renderer,this.geometry,this.transform.getWorldMatrix(),this.fillMaterials[e],t,0);for(var i=0;i<this.strokeMaterials.length;i++)this.maskManager.drawGeometryMask(this.engine.renderer,this.geometry,this.transform.getWorldMatrix(),this.strokeMaterials[i],t,1)}},r.draw=function(t){for(var e=0;e<this.fillMaterials.length;e++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.fillMaterials[e],0);for(var i=0;i<this.strokeMaterials.length;i++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.strokeMaterials[i],1)},r.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.boundingBoxInfo.setGeometry(this.geometry,t),this.boundingBoxInfo.getBoundingBoxTriangle()},r.getBoundingBoxInfo=function(){var t=this.geometry.getAttributeData("aPos");if(t){var e=nH(t,0,t.length/3);e.minimum.x*=this.transform.size.x,e.minimum.y*=this.transform.size.y,e.maximum.x*=this.transform.size.x,e.maximum.y*=this.transform.size.y,this.boundingBoxInfo.reConstruct(e.minimum,e.maximum,this.transform.getWorldMatrix())}return this.boundingBoxInfo},r.buildGeometryFromPath=function(t,e,i){var r=[],n=[];if(this.fills.length>0)for(var a,o=ij(t.shapePrimitives);!(a=o()).done;){var s=a.value.shape,u=[],h=n.length,l=r.length/2;s.build(u,i),s.triangulate(u,r,l,n,h)}var c=n.length;if(this.strokes.length>0)for(var f,d=ij(e.shapePrimitives);!(f=d()).done;){var p=f.value.shape,m=[];n.length;var v=r.length/2,y=this.strokeAttributes;y.cap=this.strokeCap,y.join=this.strokeJoin,y.width=this.strokeWidth;var g=!0;this._strokeTrimPath&&!this._strokeTrimPath.isIdentity()?g=!1:eU(p,az)&&(g=p.closePath),p.build(m,i),aM(m,y,!1,g,r,2,v,n)}var x=n.length-c,b=r.length/2,T=this.geometry.getAttributeData("aPos"),C=this.geometry.getAttributeData("aUV"),E=this.geometry.getIndexData();(!T||T.length<3*b)&&(T=new Float32Array(3*b)),(!C||C.length<2*b)&&(C=new Float32Array(2*b)),(!E||E.length<n.length)&&(E=new Uint16Array(n.length));for(var _=Number.MAX_VALUE,w=Number.MAX_VALUE,S=Number.MIN_VALUE,M=Number.MIN_VALUE,A=0;A<b;A++){var P=3*A,R=2*A,I=r[R],O=r[R+1];T[P]=I,T[P+1]=O,T[P+2]=0,_=Math.min(_,I),w=Math.min(w,O),S=Math.max(S,I),M=Math.max(M,O)}for(var L=S-_,F=M-w,V=0;V<b;V++){var N=3*V,k=2*V;C[k]=(T[N]-_)/L,C[k+1]=(T[N+1]-w)/F}E.set(n),this.geometry.setAttributeData("aPos",T),this.geometry.setAttributeData("aUV",C),this.geometry.setIndexData(E),this.geometry.setDrawCount(n.length);var D=this.geometry.subMeshes[0],z=this.geometry.subMeshes[1];D.indexCount=c,z.offset=2*c,z.indexCount=x},r.computeScreenScale=function(){var t=this.item.composition;if(!t)return 1;var e=t.camera;if(!e)return 1;var r=e.getModelViewProjection(i.tempMVP,this.transform.getWorldMatrix()).elements,n=Math.abs(r[15])||1,a=Math.sqrt(r[0]*r[0]+r[1]*r[1])/n,o=Math.sqrt(r[4]*r[4]+r[5]*r[5])/n,s=this.engine.canvas.getBoundingClientRect();return Math.max(1,Math.min(2e3,Math.max(s.width,s.height)/2*Math.max(a,o)*this.engine.pixelRatio))},r.buildPath=function(e,i){void 0===i&&(i=1),this.graphicsPath.clear();var r=i;switch(e.type){case eu.Custom:for(var n,a=this.shapeAttributes,o=a.points,s=a.easingIns,u=a.easingOuts,h=ij(a.shapes);!(n=h()).done;){var l=n.value,c=l.indexes,f=o[c[0].point];this.graphicsPath.moveTo(f.x,f.y);for(var d=1;d<c.length;d++){var p=c[d],m=c[d-1],v=o[p.point],y=o[m.point],g=u[m.easingOut],x=s[p.easingIn];this.graphicsPath.bezierCurveTo(g.x+y.x,g.y+y.y,x.x+v.x,x.y+v.y,v.x,v.y,void 0,r)}if(l.close){var b=c[0],T=c[c.length-1],C=o[b.point],E=o[T.point],_=u[T.easingOut],w=s[b.easingIn];this.graphicsPath.bezierCurveTo(_.x+E.x,_.y+E.y,w.x+C.x,w.y+C.y,C.x,C.y,void 0,r),this.graphicsPath.closePath()}}break;case eu.Ellipse:this.graphicsPath.ellipse(0,0,e.xRadius,e.yRadius);break;case eu.Rectangle:this.graphicsPath.rect(-e.width/2,-e.height/2,e.width,e.height,e.roundness);break;case eu.Star:this.graphicsPath.polyStar(e.pointCount,e.outerRadius,e.innerRadius,e.outerRoundness,e.innerRoundness,t.StarType.Star);break;case eu.Polygon:this.graphicsPath.polyStar(e.pointCount,e.radius,e.radius,e.roundness,e.roundness,t.StarType.Polygon)}},r.updateMaterials=function(){for(var t=0;t<this.fills.length;t++)this.updatePaintMaterial(this.fillMaterials[t],this.fills[t]);for(var e=0;e<this.strokes.length;e++)this.updatePaintMaterial(this.strokeMaterials[e],this.strokes[e])},r.updatePaintMaterial=function(t,e){if(t.setFloat("_FillType",e.type),e.type===eo.Solid)t.color=e.color;else if(e.type===eo.GradientLinear||e.type===eo.GradientAngular||e.type===eo.GradientRadial)this.updateGradientMaterial(t,e.gradientStops,e.startPoint,e.endPoint);else if(e.type===eo.Texture){t.setInt("_ImageScaleMode",e.scaleMode),t.setVector2("_ImageSize",new e2(e.texture.getWidth(),e.texture.getHeight()));var i=this.getBoundingBox(),r=i.area[0].p1,n=i.area[1].p2;t.setVector2("_DestSize",new e2(r.x-n.x,r.y-n.y)),t.setFloat("_ImageOpacity",e.opacity),t.setFloat("_ImageScalingFactor",e.scalingFactor),t.setTexture("_ImageTex",e.texture);var a=e.textureTransform;t.setMatrix3("_TextureTransform",new nl().scale(a.scale.x,a.scale.y).rotate(a.rotation).translate(a.offset.x,a.offset.y).invert())}},r.updateGradientMaterial=function(t,e,i,r){for(var n,a=[],o=[],s=ij(e.stops);!(n=s()).done;){var u=n.value,h=u.color;a.push(new e4(h.r,h.g,h.b,h.a)),o.push(u.time)}t.setVector4Array("_Colors",a),t.setFloats("_Stops",o),t.setInt("_StopsCount",o.length),t.setVector2("_StartPoint",i),t.setVector2("_EndPoint",r)},r.createMaterialFromRendererOptions=function(e){var i={shader:{vertex:"precision highp float;attribute vec3 aPos;attribute vec2 aUV;varying vec2 uv0;uniform mat4 effects_MatrixVP;uniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;void main(){vec4 pos=vec4(aPos.xyz,1.0);uv0=aUV;gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}",fragment:"precision highp float;\n#define _MAX_STOPS 8\n#define PI 3.14159265359\nuniform vec4 _Color;uniform vec4 _Colors[_MAX_STOPS];uniform float _Stops[_MAX_STOPS];uniform int _StopsCount;uniform float _FillType;uniform vec2 _StartPoint;uniform vec2 _EndPoint;uniform sampler2D _ImageTex;uniform vec2 _ImageSize;uniform vec2 _DestSize;uniform int _ImageScaleMode;uniform mat3 _TextureTransform;uniform float _ImageScalingFactor;uniform float _ImageOpacity;varying vec2 uv0;float calculateAngleRatio(vec2 v1,vec2 v2){float angle=atan(v2.y,v2.x)-atan(v1.y,v1.x);if(angle<0.0)angle+=2.0*PI;return angle/(2.0*PI);}vec2 applyTransform(mat3 m,vec2 uv){uv=uv-vec2(0.5,0.5);vec3 p=m*vec3(uv,1.0);p.xy=p.xy+vec2(0.5,0.5);return p.xy;}void main(){vec4 finalColor=vec4(1.0);if(_FillType==0.0){finalColor=_Color;}else if(_FillType==1.0||_FillType==2.0||_FillType==3.0){float t=0.0;if(_FillType==1.0){vec2 gradientVector=_EndPoint-_StartPoint;vec2 pixelVector=uv0-_StartPoint;float denom=max(dot(gradientVector,gradientVector),1e-6);t=clamp(dot(pixelVector,gradientVector)/denom,0.0,1.0);}else if(_FillType==2.0){float maxRadius=max(distance(_EndPoint,_StartPoint),0.001);t=clamp(distance(uv0,_StartPoint)/maxRadius,0.0,1.0);}else{vec2 center=_StartPoint;vec2 referenceVector=_EndPoint-center;vec2 targetVector=uv0-center;if(length(targetVector)>0.001){t=calculateAngleRatio(referenceVector,targetVector);}}if(_StopsCount>0){finalColor=_Colors[0];for(int i=1;i<_MAX_STOPS;i++){if(i>=_StopsCount)break;float localT=smoothstep(_Stops[i-1],_Stops[i],t);finalColor=mix(finalColor,_Colors[i],localT);}}}else if(_FillType==4.0){vec2 uv=uv0;float rSrc=_ImageSize.x/max(_ImageSize.y,1.0);float rDst=_DestSize.x/max(_DestSize.y,1.0);bool maskOutside=false;if(_ImageScaleMode==0){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(1.0,rSrc/rDst);}else{scale=vec2(rDst/rSrc,1.0);}uv=(uv-0.5)*scale+0.5;uv=clamp(uv,0.0,1.0);}else if(_ImageScaleMode==1){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(rSrc/rDst,1.0);}else{scale=vec2(1.0,rSrc/rDst);}uv=(uv-0.5)*scale+0.5;maskOutside=true;}else if(_ImageScaleMode==2){uv=applyTransform(_TextureTransform,uv0);maskOutside=true;}else if(_ImageScaleMode==3){float aspectFix=rDst/max(rSrc,1e-6);vec2 uvTile=(uv0-0.5)*vec2(aspectFix,1.0)+0.5;float s=max(abs(_ImageScalingFactor),1e-6);uv=fract(uvTile*s);}vec4 img=texture2D(_ImageTex,uv);if(maskOutside){if(uv.x<0.0||uv.x>1.0||uv.y<0.0||uv.y>1.0){img.a=0.0;}}img.a*=_ImageOpacity;finalColor=img;}finalColor.rgb*=finalColor.a;gl_FragColor=finalColor;}",glslVersion:t.GLSLVersion.GLSL1}},r=ng.create(this.engine,i),n=e.side,a=e.occlusion,o=e.blending,s=e.texture;r.blending=!0,r.depthTest=!0,r.depthMask=a,rB(r,o),rU(r,n),r.shader.shaderData.properties='_ImageTex("_ImageTex",2D) = "white" {}',r.setVector4("_TexOffset",new e4(0,0,1,1)),r.setTexture("_ImageTex",s);var u=rz(o),h=new e4;return h.x=e.occlusion?+e.transparentOcclusion:1,h.y=u,h.z=e.renderMode,r.setVector4("_TexParams",h),0===h.x||this.maskManager.alphaMaskEnabled?r.enableMacro("ALPHA_CLIP"):r.disableMacro("ALPHA_CLIP"),r},r.fromData=function(t){e.prototype.fromData.call(this,t),this.shapeDirty=!0,t.mask&&this.maskManager.setMaskOptions(this.engine,t.mask);var i=null!=(r=t.renderer)?r:{};this.rendererOptions={renderMode:tY.MESH,blending:null!=(n=i.blending)?n:tz.ALPHA,texture:i.texture?this.engine.findObject(i.texture):this.engine.whiteTexture,occlusion:!!i.occlusion,transparentOcclusion:!!i.transparentOcclusion||this.maskManager.isMask,side:null!=(a=i.side)?a:tB.DOUBLE,mask:1},this.strokeCap=null!=(o=t.strokeCap)?o:eh.Butt,this.strokeWidth=null!=(s=t.strokeWidth)?s:1,this.strokeJoin=null!=(u=t.strokeJoin)?u:el.Miter,this._strokeTrimPath=null,this._fillTrimPath=null,t.strokeTrimPath&&(this._strokeTrimPath=new uW,this._strokeTrimPath.fromData(t.strokeTrimPath)),t.fillTrimPath&&(this._fillTrimPath=new uW,this._fillTrimPath.fromData(t.fillTrimPath)),this.fills.length=0,this.fillMaterials.length=0;for(var r,n,a,o,s,u,h,l=ij(t.fills);!(h=l()).done;){var c=h.value;this.fills.push(this.createPaint(c)),this.fillMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions))}this.strokes.length=0,this.strokeMaterials.length=0;for(var f,d=ij(t.strokes);!(f=d()).done;){var p=f.value;this.strokes.push(this.createPaint(p)),this.strokeMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions))}switch(this.materials=[].concat(this.fillMaterials,this.strokeMaterials),t.type){case eu.Custom:for(var m,v={type:eu.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},y=ij(t.points);!(m=y()).done;){var g=m.value;v.points.push(new e2(g.x,g.y))}for(var x,b=ij(t.easingIns);!(x=b()).done;){var T=x.value;v.easingIns.push(new e2(T.x,T.y))}for(var C,E=ij(t.easingOuts);!(C=E()).done;){var _=C.value;v.easingOuts.push(new e2(_.x,_.y))}v.shapes=t.shapes,this.shapeAttributes=v;break;case eu.Ellipse:var w={type:eu.Ellipse,xRadius:t.xRadius,yRadius:t.yRadius};this.shapeAttributes=w;break;case eu.Rectangle:var S={type:eu.Rectangle,width:t.width,height:t.height,roundness:t.roundness};this.shapeAttributes=S;break;case eu.Star:var M={type:eu.Star,pointCount:t.pointCount,innerRadius:t.innerRadius,outerRadius:t.outerRadius,innerRoundness:t.innerRoundness,outerRoundness:t.outerRoundness};this.shapeAttributes=M;break;case eu.Polygon:var A={type:eu.Polygon,pointCount:t.pointCount,radius:t.radius,roundness:t.roundness};this.shapeAttributes=A}},r.createPaint=function(t){var e;switch(t.type){case eo.Solid:e={type:t.type,color:new e5().copyFrom(t.color)};break;case eo.GradientLinear:case eo.GradientAngular:case eo.GradientRadial:e={type:t.type,gradientStops:aT(t.gradientStops),startPoint:new e2().copyFrom(t.startPoint),endPoint:new e2().copyFrom(t.endPoint)};break;case eo.Texture:var i,r,n,a=i7({offset:{x:0,y:0},rotation:0,scale:{x:1,y:1}},null!=(i=t.textureTransform)?i:{});e={type:t.type,texture:this.engine.findObject(t.texture),scaleMode:t.scaleMode,scalingFactor:null!=(r=t.scalingFactor)?r:1,opacity:null!=(n=t.opacity)?n:1,textureTransform:{offset:new e2().copyFrom(a.offset),rotation:a.rotation,scale:new e2().copyFrom(a.scale)}}}return e},r.onApplyAnimationProperties=function(){this.shapeDirty=!0,this.materialDirty=!0},rI(i,[{key:"shape",get:function(){return this.shapeAttributes}},{key:"strokeTrimPath",get:function(){return this._strokeTrimPath}},{key:"fillTrimPath",get:function(){return this._fillTrimPath}}]),i}(n_),t.ShapeComponent.tempMVP=nu.fromIdentity(),t.ShapeComponent=eG([iZ("ShapeComponent")],t.ShapeComponent);var uj=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(iQ);t.BinaryAsset=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e}(iQ),eG([iK(void 0,void 0)],t.BinaryAsset.prototype,"buffer",void 0),t.BinaryAsset=eG([iZ(em.BinaryAsset)],t.BinaryAsset);var uX=function(){function t(){}return t.serialize=function(e,i){e.toData(),i||(i={});var r=iq(e);if(r)for(var n,a=ij(Object.keys(r));!(n=a()).done;){var o=n.value,s=e[o];"number"==typeof s||"string"==typeof s||"boolean"==typeof s||t.checkTypedArray(s)?i[o]=s:iC(s)?(i[o]||(i[o]=[]),t.serializeArrayProperty(s,i[o],0)):iQ.is(s)?i[o]={id:s.getInstanceId()}:i_(s)&&(i[o]||(i[o]={}),t.serializeObjectProperty(s,i[o],0))}for(var u,h=ij(Object.keys(e.definition));!(u=h()).done;){var l=u.value,c=e.definition[l];"number"==typeof c||"string"==typeof c||"boolean"==typeof c||t.checkTypedArray(c)?i[l]=c:iC(c)?(i[l]||(i[l]=[]),t.serializeArrayProperty(c,i[l],0)):iQ.is(c)?i[l]={id:c.getInstanceId()}:i_(c)&&(i[l]||(i[l]={}),t.serializeObjectProperty(c,i[l],0))}return i},t.deserialize=function(e,i){i.definition=e;var r=iq(i),n=i.engine;if(r)for(var a,o=ij(Object.keys(r));!(a=o()).done;){var s=a.value,u=e[s];if(void 0!==u){var h=r[s].type;i[s]=t.deserializeProperty(u,n,0,h)}}i.fromData(i.definition)},t.checkTypedArray=function(t){return eU(t,Int8Array)||eU(t,Uint8Array)||eU(t,Uint8ClampedArray)||eU(t,Int16Array)||eU(t,Uint16Array)||eU(t,Int32Array)||eU(t,Uint32Array)||eU(t,Float32Array)||eU(t,Float64Array)||eU(t,ArrayBuffer)},t.checkDataPath=function(t){return!!(i_(t)&&1===Object.keys(t).length&&"id"in t&&iT(t.id))},t.checkGLTFNode=function(t){return i_(t)&&void 0!==t.nodeIndex&&void 0!==t.isJoint},t.checkImageSource=function(t){return iS(t)||eU(t,HTMLImageElement)},t.deserializeProperty=function(e,i,r,n,a){if(void 0===a&&(a=!0),r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}if(iC(e)){for(var o,s=[],u=ij(e);!(o=u()).done;){var h=o.value;s.push(t.deserializeProperty(h,i,r+1,n,a))}return s}if(t.checkDataPath(e)){var l=i.findObject(e);return a?l:e}if(!iw(e))return e;c=n?new n:{};for(var c,f,d=ij(Object.keys(e));!(f=d()).done;){var p=f.value;c[p]=t.deserializeProperty(e[p],i,r+1,void 0,a)}return c},t.serializeObjectProperty=function(e,i,r){if(r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}i||(i={});for(var n,a=ij(Object.keys(e));!(n=a()).done;){var o=n.value,s=e[o];"number"==typeof s||"string"==typeof s||"boolean"==typeof s||t.checkTypedArray(e)?i[o]=s:iC(s)?(i[o]||(i[o]=[]),t.serializeArrayProperty(s,i[o],r+1)):iQ.is(s)?i[o]={id:s.getInstanceId()}:i_(s)&&(i[o]||(i[o]={}),t.serializeObjectProperty(s,i[o],r+1))}},t.serializeArrayProperty=function(e,i,r){if(r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}i||(i=[]);for(var n=0;n<e.length;n++){var a=e[n];"number"==typeof a||"string"==typeof a||"boolean"==typeof a||t.checkTypedArray(e)?i[n]=a:iC(a)?(i[n]||(i[n]=[]),t.serializeArrayProperty(a,i[n],r+1)):iQ.is(a)?i[n]={id:a.getInstanceId()}:i_(a)&&(i[n]||(i[n]={}),t.serializeObjectProperty(a,i[n],r+1))}},t}(),uH=function(){function t(t){this.engine=t}var e=t.prototype;return e.loadGUID=function(t){if(!t)return null;var e,i=t.id,r=this.findData(i);if(!r){console.warn("Object data with uuid: "+i+" not found.");return}switch(r.dataType){case em.Material:e=ng.create(this.engine);break;case em.Geometry:e=aK.create(this.engine);break;case em.Texture:e=r7.create(this.engine);break;default:var n=iY[r.dataType];n&&(e=new n(this.engine))}if(!e){console.warn("Constructor for DataType: "+r.dataType+" not found.");return}return e.setInstanceId(r.id),this.engine.addInstance(e),uX.deserialize(r,e),e},e.findData=function(t){return this.engine.jsonSceneData[t]},t}(),uY=function(){function t(){}return t.prototype.loadGUID=function(t){return eB(function(){return eW(this,function(t){return[2,void 0]})})()},t}();function uZ(t,e){if(!t.includes(e))return t.push(e),!0}function uq(t){if(Number.isFinite(t))return[tJ.CONSTANT,t];if(t){var e=t[0],i=t[1];if(Array.isArray(e))return;if("static"===e||e===tJ.CONSTANT)return[tJ.CONSTANT,t[1]];if("lines"===e)return[tJ.LINE,t[1]];if(e===tJ.LINE){var r=i.map(function(t){return[t$.LINE,t]});return[tJ.BEZIER_CURVE,r]}return"curve"===e||e===tJ.CURVE?[tJ.BEZIER_CURVE,hi(i)]:t}}function uK(t,e){return Array.isArray(t)&&"random"===t[0]?[tJ.CONSTANT,t[1][e]]:uq(t)}function uQ(t){return t&&"color"===t[0]?u0(t[1],!0):[1,1,1,1]}function uJ(t){return t&&"random"===t[0]?[tJ.RANDOM,t[1]]:uq(t)}function u$(t,e){if(t){var i=[];return Object.getOwnPropertyNames(t).forEach(function(r){var n,a=(n=/^(-)?([\d+.]+)%$/.exec(r))?+n[2]/100*(n[1]?-1:1):+r,o=u0(t[r],e);i.push([a,o[0],o[1],o[2],o[3]])}),i=i.sort(function(t,e){return t[0]-e[0]}),[tJ.GRADIENT_COLOR,i]}}function u0(t,e){var i;if("string"==typeof t){t=t.replace(/[\s\t\r\n]/g,"");var r=/rgba?\(([.\d]+),([.\d]+),([.\d]+),?([.\d]+)?\)/.exec(t);if(r){var n=+r[4];i=[+r[1],+r[2],+r[3],isNaN(n)?255:Math.round(255*n)]}else/^#[a-f\d]{3}$/i.test(t)?i=[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))&&(i=[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),255])}else eU(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:Math.round(255*t[3])]);return e&&(i=u1(i)),i}function u1(t){if(Array.isArray(t))return t.map(function(t){return Number.isFinite(t/255)?Number((t/255).toFixed(6)):0})}function u2(t,e){return Array.isArray(t)?t[0]===tJ.GRADIENT_COLOR?t:("gradient"===t[0]||"color"===t[0])&&u$(t[1],e):u$(t,e)}function u3(t){if(t){if(3===t.length)return[tJ.CONSTANT_VEC3,t];var e=t[0];if("path"===e||"bezier"===e||e===tJ.BEZIER_PATH||e===tJ.LINEAR_PATH){var i=t[1],r=i[0],n=i[1],a=i[2],o=hi(r);if(!a){a=[];for(var s=0;s<n.length;s++){var u=n[s].slice();0===s||s<n.length-1&&a.push(u),a.push(u)}}return[tJ.BEZIER_CURVE_PATH,[o,n,a]]}return t}}function u4(t){for(var e,i=ij(Object.keys(t));!(e=i()).done;){var r=e.value;t[r]=Number(t[r])}return t}function u5(t){for(var e,i=ij(Object.keys(t));!(e=i()).done;){var r=e.value;void 0===t[r]&&delete t[r]}return t}var u6=Math.cos,u8=Math.sin,u9=Math.PI/180,u7=180/Math.PI;function ht(t,e){return t?[t[0]-.5,.5-t[1]]:e?he[e]:[0,0]}var he=((eR={})[tZ.PARTICLE_ORIGIN_CENTER]=[0,0],eR[tZ.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],eR[tZ.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],eR[tZ.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],eR[tZ.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],eR[tZ.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],eR[tZ.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],eR[tZ.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],eR[tZ.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],eR);function hi(t){for(var e=-1e6,i=1e6,r=0;r<t.length;r++)e=Math.max(e,t[r][1]),i=Math.min(i,t[r][1]);for(var n=[[t[0][0],t[0][1]]],a=0;a<t.length-1;a++){var o=t[a][3]*(e-i),s=t[a+1][2]*(e-i),u=[t[a][0],t[a][1]],h=[t[a+1][0],t[a+1][1]];if(u[0]!=h[0]){var l=function(t,e,i,r){var n=i[0],a=i[1],o=r[0],s=r[1],u=o-n;return[[n+(o-n)/3,a+(t*=u)/3],[o-(o-n)/3,s-(e*=u)/3]]}(o,s,u,h),c=l[0],f=l[1];n[n.length-1].push(c[0]),n[n.length-1].push(c[1]),n.push([f[0],f[1],h[0],h[1]])}else n[n.length-1].push(h[0]),n[n.length-1].push(h[1])}return n.map(function(t,e){return 0===e?[t$.EASE_OUT,t]:e===n.length-1?[t$.EASE_IN,t]:[t$.EASE,t]})}var hr=new Map,hn=new Map;function ha(t){return t.compositions.forEach(function(t){t.items.forEach(function(t){t.type===tH.null&&t.endBehavior===t0.destroy&&(t.endBehavior=t0.freeze)})}),t.version=tk["2_1"],t}function ho(t){for(var e,i=i7({},t,{items:[],compositions:[],components:[],materials:[],shaders:[],geometries:[],animations:[],miscs:[]}),r=ij(i.images);!(e=r()).done;)e.value.id=iP();if(null!=i.textures||(i.textures=[]),i.textures.forEach(function(t){var e;t.id=iP(),t.dataType=em.Texture,t.source={id:null==(e=i.images[t.source])?void 0:e.id}}),i.textures.length<i.images.length)for(var n=i.textures.length;n<i.images.length;n++)i.textures.push({id:iP(),dataType:em.Texture,source:{id:i.images[n].id},flipY:!0});t.bins&&(a=t.bins,i.bins=a.map(function(t){return{url:t.url,dataType:"BinaryAsset",id:iP()}}));for(var a,o,s={},u={},h=ij(t.compositions);!(o=h()).done;)!function(){var t=o.value;(3===t.endBehavior||1===t.endBehavior)&&(t.endBehavior=t0.freeze),t.items=t.items.filter(function(t){return"8"!==t.type}),t.items.forEach(function(t){t.type===tH.particle&&t.content.filter&&delete t.content.filter});for(var e,r=ij(t.items);!(e=r()).done;){var n=e.value;s[n.id]=iP(),n.oldId=n.id,n.id=s[n.id],u[n.id]=n}t.items.forEach(function(e,r){if(e.parentId){if(e.parentId.includes("^")){var n=e.parentId.split("^")[0],a=e.parentId.split("^")[1];e.parentId=s[n]+"^"+a}else e.parentId=s[e.parentId]}i.items.push(e),t.items[r]={id:e.id}});var a=i7({},t,{timelineAsset:{id:""},sceneBindings:[]});i.compositions.push(a),function(t,e,i){for(var r,n=[],a=[],o=[],s={tracks:[],id:iP(),dataType:"TimelineAsset"},u=ij(t.items);!(r=u()).done;){var h=e[r.value.id],l=[],c={id:iP(),dataType:"ActivationPlayableAsset"};o.push(c);var f={id:iP(),dataType:"ActivationTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:c.id}}]};if(l.push({id:f.id}),a.push(f),h.type!==tH.particle){var d={id:iP(),dataType:"TransformPlayableAsset",sizeOverLifetime:h.content.sizeOverLifetime,rotationOverLifetime:h.content.rotationOverLifetime,positionOverLifetime:h.content.positionOverLifetime};o.push(d);var p={id:iP(),dataType:"TransformTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:d.id}}]};l.push({id:p.id}),a.push(p)}if(h.type===tH.sprite||h.type===tH.text){var m={id:iP(),dataType:"SpriteColorPlayableAsset",colorOverLifetime:h.content.colorOverLifetime};o.push(m);var v={id:iP(),dataType:"SpriteColorTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:m.id}}]};l.push({id:v.id}),a.push(v)}if(h.type===tH.composition){var y={id:iP(),dataType:"SubCompositionPlayableAsset"};o.push(y);var g={id:iP(),dataType:"SubCompositionTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:y.id}}]};l.push({id:g.id}),a.push(g)}var x={id:iP(),dataType:"ObjectBindingTrack",children:l,clips:[]};a.push(x),s.tracks.push({id:x.id}),n.push({key:{id:x.id},value:{id:h.id}})}for(var b,T=[],C=ij(a);!(b=C()).done;){var E=b.value;T.push({id:E.id})}t.timelineAsset={id:s.id},t.sceneBindings=n,i.miscs.push(s);for(var _,w=ij(a);!(_=w()).done;){var S=_.value;i.miscs.push(S)}for(var M,A=ij(o);!(M=A()).done;){var P=M.value;i.miscs.push(P)}}(a,u,i)}();for(var l,c=ij(i.items);!(l=c()).done;){var f=l.value;if(f.content){if(f.content.renderer&&void 0!==f.content.renderer.texture){var d=f.content.renderer.texture;f.content.renderer.texture={id:i.textures[d].id}}if(f.content.trails&&void 0!==f.content.trails.texture){var p=f.content.trails.texture;f.content.trails.texture={id:i.textures[p].id}}}if(f.transform){var m=[].concat(null!=(g=f.transform.position)?g:[0,0,0]),v=[].concat(null!=(x=f.transform.rotation)?x:[0,0,0]),y=[].concat(null!=(b=f.transform.scale)?b:[1,1,1]);if(Object.assign(f,{transform:{position:{x:m[0],y:m[1],z:m[2]},eulerHint:{x:v[0],y:v[1],z:v[2]},scale:{x:y[0],y:y[1],z:y[0]}}}),f.type===tH.sprite&&(f.transform.size={x:y[0],y:y[1]},f.transform.scale={x:1,y:1,z:1}),f.type===tH.sprite){var g,x,b,T,C,E,_,w=f.content;w.renderer||(w.renderer={});var S=w.renderer,M=ht(S.anchor,S.particleOrigin),A=f.transform.size;S.anchor||void 0===S.particleOrigin||(f.transform.position.x+=-M[0]*(null!=(T=null==A?void 0:A.x)?T:1),f.transform.position.y+=-M[1]*(null!=(C=null==A?void 0:A.y)?C:1)),f.transform.anchor={x:M[0]*(null!=(E=null==A?void 0:A.x)?E:1),y:M[1]*(null!=(_=null==A?void 0:A.y)?_:1)}}}if(f.type===tH.particle){var P=f.content;P.renderer||(P.renderer={});var R=P.renderer;P.renderer.anchor=ht(R.anchor,R.particleOrigin)}if(f.type===tH.camera&&f.content.positionOverLifetime&&0!==Object.keys(f.content.positionOverLifetime).length&&(f.content.positionOverLifetime.asMovement=!0),void 0!==f.pn){var I=f.pn,O=t.plugins,L=void 0===O?[]:O;void 0!==I&&Number.isInteger(I)&&(f.pluginName=L[I])}switch("editor-gizmo"===f.pluginName&&(f.type="editor-gizmo"),"orientation-transformer"===f.pluginName&&(f.type="orientation-transformer"),f.content.options.target&&"editor-gizmo"===f.pluginName&&(f.content.options.target=s[f.content.options.target]),f.type===tH.spine&&t.spines&&0!==t.spines.length&&function(t,e,i){e.resource={atlas:{bins:{id:i.bins[t.atlas[1][0]].id},source:t.atlas[1].slice(1)},skeleton:{bins:{id:i.bins[t.skeleton[1][0]].id},source:t.skeleton[1].slice(1)},skeletonType:t.skeletonType,images:t.images.map(function(t){return{id:i.textures[t].id}})}}(t.spines[f.content.options.spine],f.content,i),(f.type===tH.sprite||f.type===tH.particle||f.type===tH.mesh||f.type===tH.skybox||f.type===tH.light||"camera"===f.type||f.type===tH.tree||f.type===tH.interact||f.type===tH.camera||f.type===tH.text||f.type===tH.spine||"editor-gizmo"===f.type||"orientation-transformer"===f.type)&&(f.components=[],i.components.push(f.content),f.content.id=iP(),f.content.item={id:f.id},f.dataType=em.VFXItemData,f.components.push({id:f.content.id})),(f.type===tH.null||f.type===tH.composition)&&(f.components=[],f.dataType=em.VFXItemData),f.type){case tH.sprite:f.content.dataType=em.SpriteComponent;break;case tH.particle:f.content.dataType=em.ParticleSystem;break;case tH.mesh:f.content.dataType=em.MeshComponent;break;case tH.skybox:f.content.dataType=em.SkyboxComponent;break;case tH.light:f.content.dataType=em.LightComponent;break;case"camera":f.content.dataType=em.CameraComponent;break;case"editor-gizmo":f.content.dataType="GizmoComponent";break;case"orientation-transformer":f.content.dataType="OrientationComponent";break;case tH.tree:f.content.dataType=em.TreeComponent;break;case tH.interact:f.content.dataType=em.InteractComponent;break;case tH.camera:f.content.dataType=em.CameraController;break;case tH.text:f.content.dataType=em.TextComponent;break;case tH.spine:f.content.dataType=em.SpineComponent}}return i.version=tk["3_0"],i}function hs(t){for(var e,i=ij(t.components);!(e=i()).done;){var r=e.value;if(r.dataType===em.ShapeComponent&&r.type===eu.Custom){(null==(n=r.shapes)?void 0:n.length)>0&&r.shapes[0].fill&&(r.fill=r.shapes[0].fill);for(var n,a,o=Array(r.easingIns.length),s=Array(r.easingOuts.length).fill(!1),u=ij(r.shapes);!(a=u()).done;)for(var h,l=a.value,c=ij(l.indexes);!(h=c()).done;){var f=h.value,d=r.points[f.point],p=r.easingIns[f.easingIn],m=r.easingOuts[f.easingOut];o[f.easingIn]||(p.x-=d.x,p.y-=d.y,o[f.easingIn]=!0),s[f.easingOut]||(m.x-=d.x,m.y-=d.y,s[f.easingOut]=!0)}}}return t.version=tk["3_2"],t}function hu(e){hr.clear(),hn.clear();for(var i,r=e.compositions,n=e.items,a=e.components,o=ij(a);!(i=o()).done;){var s=i.value;hr.set(s.id,s)}for(var u,h=ij(n);!(u=h()).done;){var l=u.value;hn.set(l.id,l)}for(var c,f=ij(r);!(c=f()).done;)!function(e){for(var i,r=ij(e.items);!(i=r()).done;){var n=i.value,a=hn.get(n.id);if(!a)return;if(a.type===tH.sprite||a.type===tH.particle||a.type===tH.spine||a.type===tH.text||a.type===tH.richtext||a.type===tH.video||a.type===tH.shape){var o=hr.get(a.components[0].id);o&&function(e){var i=e.renderer,r=null==i?void 0:i.maskMode;r&&r!==t.MaskMode.NONE&&(r===t.MaskMode.MASK?(e.mask={isMask:!0},eI=e.id):(r===tU.OBSCURED||r===tU.REVERSE_OBSCURED)&&(e.mask={inverted:r===tU.REVERSE_OBSCURED,reference:{id:eI}}))}(o)}}}(c.value);return e.version=tk["3_3"],e}function hh(t){null==(e=t.plugins)||e.forEach(function(e,i){"richtext"===e&&(t.plugins[i]="rich-text")});for(var e,i,r=ij(t.items);!(i=r()).done;){var n=i.value;if(n.type===tH.sprite){var a=hr.get(n.components[0].id);if(a){var o,s=a.renderer.shape,u=void 0;u=Number.isInteger(s)?null==(o=t.shapes)?void 0:o[s]:s,a.renderer.shape=u}}}for(var h,l=t.compositionId,c={},f=ij(t.compositions);!(h=f()).done;){var d=h.value,p=iP();c[d.id]=p,d.id===l&&(t.compositionId=p),d.id=p;var m={id:iP(),dataType:"CompositionComponent",items:d.items,timelineAsset:d.timelineAsset,sceneBindings:d.sceneBindings,item:{id:d.id}};d.timelineAsset=void 0,d.sceneBindings=void 0,d.components=[{id:m.id}],t.components.push(m)}for(var v,y=ij(t.items);!(v=y()).done;){var g=v.value;if(g.content){var x=g.content.options;x&&void 0!==x.refId&&(x.refId=c[x.refId])}}return t.version=tk["3_4"],t}function hl(t){for(var e,i={},r=ij(t.components);!(e=r()).done;){var n=e.value;i[n.id]=n}for(var a,o=ij(t.compositions);!(a=o()).done;)for(var s,u=a.value,h=ij(u.components);!(s=h()).done;)i[s.value.id].item.id=u.id;for(var l,c=ij(t.components);!(l=c()).done;){var f=l.value;if(f.dataType===em.SpriteComponent){var d=f.renderer.shape;if(null!=d&&!("aPoint"in d&&"index"in d)){var p=function(t,e){void 0===e&&(e="形状");for(var i=sj(t),r=i.index,n=void 0===r?[]:r,a=i.aPoint,o=void 0===a?[]:a,s=new Float32Array(o),u=[],h=[],l=0;l<s.length;l+=6)h.push(o[l+2],o[l+3]),u.push(s[l],s[l+1],0);var c=u.length/3,f=n.length,d=4*u.length,p=d+4*h.length,m=2*n.length,v={mode:ev.TRIANGLES,vertexData:{vertexCount:c,channels:[]},name:e,indexFormat:eg.UInt16,indexOffset:p,buffer:"",id:iP(),dataType:em.Geometry,subMeshes:[]};v.vertexData.channels.push({semantic:ex.Position,offset:0,format:ey.Float32,dimension:3}),v.vertexData.channels.push({semantic:ex.Uv,offset:d,format:ey.Float32,dimension:2}),v.subMeshes.push({offset:0,indexCount:f,vertexCount:c});var y=new ArrayBuffer(p+m+(m%4==0?0:2)),g=new Float32Array(y);g.set(u,0),g.set(h,u.length),new Uint16Array(y,p).set(n,0);var x=new Uint8Array(y).slice(0,p+m);return v.binaryData=x,v}(d);f.geometry={id:p.id},t.geometries.push(p)}}if(f.dataType===em.ShapeComponent){if(f.fills=[],f.fill){var m={type:eo.Solid,color:f.fill.color};f.fills.push(m)}if(delete f.fill,f.strokes=[],f.stroke){var v={type:eo.Solid,color:f.stroke.color};f.strokes.push(v),f.strokeWidth=f.stroke.width,f.strokeCap=f.stroke.cap,f.strokeJoin=f.stroke.join,delete f.stroke}}}return t.version=tk["3_5"],t}function hc(t){if(t.components)for(var e,i=ij(t.components);!(e=i()).done;){var r,n=e.value;n.dataType===em.RichTextComponent&&n.options&&void 0===n.options.useLegacyRichText&&(void 0===n.options.lineGap?n.options.useLegacyRichText=!0:n.options.useLegacyRichText=!1),n.dataType!==em.TextComponent&&(n.dataType!==em.RichTextComponent||!n.options)||(r=n.options)&&void 0===r.TextVerticalAlign&&void 0===r.TextVerticalAlign&&(r.TextVerticalAlign=r.textBaseline),n.dataType===em.TextComponent&&function(t){if(t&&t.textColor){var e,i=t.textColor;t.textColor=[i[0]/255,i[1]/255,i[2]/255,null!=(e=i[3])?e:1]}}(n.options)}return t.version=tk["3_6"],t}function hf(t){for(var e,i,r=[],n=ij(t.items);!(i=n()).done;)!function(){var e=i.value;if(e.type===tH.text&&e.transform){for(var n,a,o,s=t.components.find(function(t){return e.components[0].id===t.id}),u=e.transform.scale.x/(null!=(a=null==(n=s.options)?void 0:n.textWidth)?a:1),h=u/.0123,l=e.transform.scale.x,c=e.transform.scale.y,f=e.transform.scale.z,d=ij(t.items);!(o=d()).done;){var p=o.value;p.parentId===e.id&&p.transform&&(p.transform.scale.x*=l/h,p.transform.scale.y*=c/h,p.transform.scale.z*=f/h)}e.transform.scale.x=h,e.transform.scale.y=h,e.transform.scale.z=h,r.push({item:e,scaleFactor:h,oldScaleX:l,oldScaleY:c,oldScaleZ:f})}}();r.length>0&&(null==(e=t.animations)?void 0:e.length)&&function(t,e){for(var i,r=new Map,n=new Map,a=ij(t.items);!(i=a()).done;){var o=i.value;if(r.set(o.id,o),o.parentId){var s=n.get(o.parentId);s||(s=[],n.set(o.parentId,s)),s.push(o)}}for(var u,h=new Map,l=new Map,c=ij(e);!(u=c()).done;){var f=u.value;h.set(f.item.id,f);var d=n.get(f.item.id);if(d)for(var p,m=ij(d);!(p=m()).done;){var v=p.value;l.set(v.id,f)}}for(var y,g=new Map,x=ij(t.components);!(y=x()).done;){var b=y.value;g.set(b.id,b)}for(var T,C=new Map,E=ij(t.animations);!(T=E()).done;){var _=T.value;C.set(_.id,_)}for(var w,S=ij(t.compositions);!(w=S()).done;){for(var M,A,P,R=w.value,I=void 0,O=void 0,L=ij(R.components);!(P=L()).done;){var F=P.value,V=g.get(F.id);if((null==V?void 0:V.dataType)===em.Animator?I=V:(null==V?void 0:V.dataType)===em.CompositionComponent&&(O=V),I&&O)break}if(I){var N=void 0;if(O){var k=O.items;if(k){N=[];for(var D,z=ij(k);!(D=z()).done;){var B=D.value,U=r.get(B.id);U&&!U.parentId&&N.push(U)}}}if((!N||0===N.length)&&R.children){N=[];for(var G,W=ij(R.children);!(G=W()).done;){var j=G.value,X=r.get(j.id);X&&N.push(X)}}if(N&&0!==N.length){var H=I,Y=C.get(null==(M=H.graphAsset)?void 0:M.id);if(null==Y?void 0:null==(A=Y.graphDataSet)?void 0:A.resources)for(var Z,q=ij(Y.graphDataSet.resources);!(Z=q()).done;){var K=Z.value,Q=C.get(K.id);if(null==Q?void 0:Q.scaleCurves)for(var J,$=ij(Q.scaleCurves);!(J=$()).done;){var tt=J.value,te=function(t,e,i){var r=function(t){var e;a=null==(e=i.get(a.id))?void 0:e.find(function(e){return e.name===n[t]})};if(e){for(var n=e.split("/"),a=t.find(function(t){return t.name===n[0]}),o=1;o<n.length&&a;o++)r(o);return a}}(N,tt.path,n);if(te){var ti=h.get(te.id);if(ti){hm(tt.keyFrames,ti.scaleFactor/ti.oldScaleX,ti.scaleFactor/ti.oldScaleY,ti.scaleFactor/ti.oldScaleZ);continue}var tr=l.get(te.id);tr&&hm(tt.keyFrames,tr.oldScaleX/tr.scaleFactor,tr.oldScaleY/tr.scaleFactor,tr.oldScaleZ/tr.scaleFactor)}}}}}}}(t,r);for(var a,o=new Map,s=new Map,u=new Map,h=ij(t.components);!(a=h()).done;){var l=a.value;u.set(l.id,l)}for(var c,f=ij(t.items);!(c=f()).done;){var d=c.value;d.children=[],o.set(d.id,d)}for(var p,m=ij(t.compositions);!(p=m()).done;){var v=p.value;v.children=[],eI=void 0;var y=v.items;Array.isArray(y)&&hp(y,o,u);for(var g,x=ij(v.components);!(g=x()).done;){var b=g.value,T=u.get(b.id);if(T.dataType===em.CompositionComponent){var C=null!=(E=T.items)?E:[];hp(C,o,u);for(var E,_,w=ij(C);!(_=w()).done;){var S=_.value,M=o.get(S.id);void 0===M.parentId&&v.children.push({id:M.id})}delete T.items}}s.set(v.id,v)}for(var A,P=ij(t.items);!(A=P()).done;){var R=A.value;if(R.parentId){var I=o.get(R.parentId);I&&I.children.push({id:R.id})}}return t.version=tk["3_7"],t}function hd(t){null!=t.miscs||(t.miscs=[]);for(var e,i=ij(t.components);!(e=i()).done;){var r,n,a=e.value;if(a.dataType===em.SpriteComponent&&!a.sprite){var o=a.splits;if(!o||!(o.length>1)){var s=null==o?void 0:o[0],u=s?[s[0],s[1],s[2],s[3]]:[0,0,1,1],h=null!=(n=null==s?void 0:s[4])?n:0,l={id:iP(),dataType:"Sprite",texture:null==(r=a.renderer)?void 0:r.texture,rect:u,rotation:h};t.miscs.push(l),a.sprite={id:l.id},delete a.splits,a.renderer&&delete a.renderer.texture}}}return t.version="3.8",t}function hp(t,e,i){for(var r,n=ij(t);!(r=n()).done;){var a=r.value,o=e.get(a.id);if(o&&(o.type===tH.sprite||o.type===tH.particle||o.type===tH.spine||o.type===tH.text||o.type===tH.richtext||o.type===tH.video||o.type===tH.shape||o.type===tH.mesh)){var s=i.get(o.components[0].id);s&&function(t){var e,i,r,n=t.mask;n&&!n.references&&n.reference&&(t.mask={isMask:null!=(e=n.isMask)&&e,alphaMaskEnabled:null!=(i=n.alphaMaskEnabled)&&i,references:[{mask:n.reference,inverted:null!=(r=n.inverted)&&r}]})}(s)}}}function hm(t,e,i,r){if(Array.isArray(t)&&t[0]===tJ.VECTOR3_CURVE){var n=t[1];Array.isArray(n)&&3===n.length&&(hv(n[0],e),hv(n[1],i),hv(n[2],r))}}function hv(t,e){if(Array.isArray(t)&&t[0]===tJ.BEZIER_CURVE&&Array.isArray(t[1]))for(var i,r=t[1],n=ij(r);!(i=n()).done;){var a=i.value;if(Array.isArray(a)&&!(a.length<2)&&Array.isArray(a[1]))for(var o=a[1],s=1;s<o.length;s+=2)o[s]*=e}}function hy(t,e){var i,r=t.options,n=t.velocityOverLifetime||{},a={path:u3(null==(i=t.transform)?void 0:i.path),gravity:r.gravity,gravityOverLifetime:uq(r.gravityModifier),direction:r.direction,startSpeed:r.startSpeed,asMovement:n.asMovement,linearX:uq(n.linearX),linearY:uq(n.linearY),linearZ:uq(n.linearZ),asRotation:n.asRotation,orbCenter:n.orbCenter,orbitalX:uq(n.orbitalX),orbitalY:uq(n.orbitalY),orbitalZ:uq(n.orbitalZ),speedOverLifetime:uq(n.speedOverLifetime)};u5(a);var o={options:{startColor:uQ(r.startColor)},positionOverLifetime:a};r.startSize&&(e.scale=[r.startSize,r.startSize/(r.sizeAspect||1),1]),r.startRotation&&(e.rotation?e.rotation[2]+=r.startRotation:e.rotation=[0,0,r.startRotation]);var s=t.rotationOverLifetime;if(s){var u=o.rotationOverLifetime={separateAxes:s.separateAxes,asRotation:s.asRotation};u.separateAxes?(u.x=uq(s.x),u.y=uq(s.y),u.z=uq(s.z)):u.z=uq(s.angularVelocity)}var h=t.colorOverLifetime;if(h){var l=o.colorOverLifetime={opacity:uq(h.opacity)};h.color&&(l.color=u2(h.color))}var c=t.sizeOverLifetime;return c&&(o.sizeOverLifetime={separateAxes:c.separateAxes,size:uq(c.size),x:uq(c.x),y:uq(c.y),z:uq(c.z)}),o}var hg="2.10.0-alpha.1",hx=/^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/,hb=/^(\d+)\.(\d+)$/,hT=!1;function hC(t){if(!t||"object"!=typeof t)throw Error("Invalid input: Expected a JSON object.");if(function(t){var e=(t.playerVersion||{}).web,i=void 0===e?"":e;if(i){var r,n,a=null!=(r=hx.exec(i))?r:[],o=null!=(n=hx.exec(hg))?n:[],s=a[1],u=a[2],h=o[1],l=o[2];return Number(h)<Number(s)||Number(h)===Number(s)&&Number(l)<Number(u)}return!1}(t)&&console.warn("The JSON need higher than "+(null==(d=t.playerVersion)?void 0:d.web)+" runtime version(current: "+hg+"). Some features may not work as expected."),!(f=null==(c=(l=t).version)?void 0:c.split("."))||Number(f[0])>2||2===Number(f[0])&&Number(f[1])>=2||l.compositions.forEach(function(t){t.items.forEach(function(t){(t.type===tH.mesh||t.type===tH.light)&&(t.endBehavior=1===t.endBehavior?t0.destroy:t.endBehavior)})}),hx.test(t.version)){var e,i,r,n,a,o,s,u;return hT=(null==(p=/^(\d+)/.exec(t.version))?void 0:p[0])==="0",hd(hf(hc(hl(hh(hu(hs(ho(ha((e=t,hE=tk["1_0"],n=e.plugins||[],(null==(i=e.bins)?void 0:i.length)&&(hE=tk["1_3"]),a=(e.requires||[]).slice(),o=e.images.map(function(t,i){return h_(t,i,e.imageTags||[])}),s=e.textures||o.map(function(t,e){return{source:e,flipY:!0}}),u={plugins:n,shapes:e.shapes||[],type:"ge",version:hE,playerVersion:null!=(r=e.playerVersion)?r:{web:"",native:""},compositionId:e.compositionId+"",compositions:e.compositions.map(function(t){return hw(t,{plugins:n,requires:a})}),images:o,imgUsage:e._imgs,binUsage:e.binUsage,spines:e.spines,requires:e.requires,textures:s,bins:(e.bins||[]).slice()},e._textures&&(u._textures=e._textures),u))))))))))}hT=!1;var h,l,c,f,d,p,m=hb.exec(t.version)||[],v=Number(m[1]),y=Number(m[2]);if(v)return(v<2||2===v&&y<4)&&((h=t).compositions.map(function(t){for(var e,i=ij(t.items);!(e=i()).done;)(function t(e){if(e)for(var i,r=ij(Object.keys(e));!(i=r()).done;){var n=i.value,a=e[n],o=Array.isArray(a);o&&2===a.length&&Array.isArray(a[1])?"path"===n?e[n]=u3(a):e[n]=uq(a):o||"object"!=typeof a||t(a)}})(e.value.content)}),t=h),v<3&&(t=ho(ha(t))),v=Number((m=hb.exec(t.version)||[])[1]),y=Number(m[2]),v<4&&(y<2&&(t=hs(t)),y<3&&(t=hu(t)),y<4&&(t=hh(t)),y<5&&(t=hl(t)),y<6&&(t=hc(t)),y<7&&(t=hf(t)),y<8&&(t=hd(t))),t;throw Error("Invalid JSON version: "+t.version+".")}var hE=tk["1_0"];function h_(t,e,i){var r=i[e];if("string"==typeof t)return{id:iP(),renderLevel:r,url:t};if(t.template)return{id:iP(),url:t.url,template:t.template,webp:t.webp,renderLevel:r};if(t.compressed)return{id:iP(),url:t.url,compressed:{astc:t.compressed.android,pvrtc:t.compressed.iOS},webp:t.webp,renderLevel:r};if(t.url)return{id:iP(),url:t.url,webp:t.webp,renderLevel:r};if(t&&t.sourceType)return t;throw Error("Invalid image type.")}function hw(t,e){void 0===e&&(e={});var i,r={id:t.id+"",camera:i7({clipMode:0},t.camera),duration:t.duration,endBehavior:t.endBehavior,items:t.items.map(function(t){return hM(t,e)}),name:t.name},n=t.startTime||t.st;n&&(r.startTime=n);var a=null==(i=t.meta)?void 0:i.previewSize;return a&&a[0]===a[1]&&0===a[0]&&(a=void 0),a&&(r.previewSize=a),r}var hS=[0,0,0,1];function hM(t,e){void 0===e&&(e={});var i=tH.base,r=t.endBehavior,n=NaN;if(t.content?(i=t.type||tH.plugin,m=t.pn,p=t.pluginName,f=t.content,c=t.content,isNaN(m)&&!p&&(p=f.options.type),t.duration&&(n=t.duration),l=t.transform||b(c.transform)):t.particle?(i=tH.particle,l=b((c=t.particle).transform,hT,!0),f=function(t){var e=t.options,i=t.transform,r={type:tG.NONE};if(t.shape){var n,a=null==(n=t.shape.shape)?void 0:n.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,"");if(r=i7({},t.shape,{type:tG[a]}),t.shape.upDirection){var o=t.shape.upDirection,s=o[0],u=o[1],h=o[2];0===s&&0===u&&0===h&&delete r.upDirection}}e.startTurbulence&&(r.turbulenceX=uJ(e.turbulenceX),r.turbulenceY=uJ(e.turbulenceY),r.turbulenceZ=uJ(e.turbulenceZ));var l=t.emission;l.bursts&&l.bursts.length>0&&(l.bursts=l.bursts.map(function(t){return u4(t)})),l.burstOffsets&&l.burstOffsets.length>0&&(l.burstOffsets=l.burstOffsets.map(function(t){return u4(t)})),l.rateOverTime&&(l.rateOverTime=uJ(l.rateOverTime));var c={renderer:t.renderer,shape:r,splits:t.splits,emission:l,options:{startLifetime:uJ(e.startLifetime),start3DSize:!!e.start3DSize,startSize:uJ(e.startSize),startSizeX:uJ(e.startSizeX),startSizeY:uJ(e.startSizeY),sizeAspect:uJ(e.sizeAspect),maxCount:e.maxCount,startDelay:uJ(e.startDelay),startColor:function(t,e){if(t)return"colors"===t[0]?[tJ.COLORS,t[1].map(function(t){return u0(t,e)})]:"gradient"===t[0]?u$(t[1],e):"color"===t[0]?[tJ.RGBA_COLOR,u0(t[1],e)]:t}(e.startColor,!0),startRotationZ:uJ(e.startRotation||e.startRotationZ),particleFollowParent:e.particleFollowParent}};e.start3DRotation&&(c.options.startRotationX=uJ(e.startRotationX),c.options.startRotationY=uJ(e.startRotationY)),i&&i.path&&(c.emitterTransform={path:u3(i.path)});var f=t.sizeOverLifetime;f&&(f.separateAxes?c.sizeOverLifetime={separateAxes:!0,x:uJ(f.x),y:uJ(f.y)}:c.sizeOverLifetime={size:uJ(f.size)});var d=t.velocityOverLifetime||{},p=d.speedOverLifetime;p=p?uq(p):void 0,c.positionOverLifetime={gravity:e.gravity,gravityOverLifetime:uq(e.gravityModifier),startSpeed:uJ(e.startSpeed),speedOverLifetime:p,asMovement:d.asMovement,linearX:uJ(d.linearX),linearY:uJ(d.linearY),linearZ:uJ(d.linearZ),asRotation:d.asRotation,orbCenter:d.orbCenter,orbitalX:uJ(d.orbitalX),orbitalY:uJ(d.orbitalY),orbitalZ:uJ(d.orbitalZ),forceTarget:d.forceTarget,target:d.target,forceCurve:uq(d.forceCurve)},u5(c.positionOverLifetime);var m=t.rotationOverLifetime;m&&(c.rotationOverLifetime={separateAxes:m.separateAxes,asRotation:m.asRotation,z:uJ(m.separateAxes?m.z:m.angularVelocity)},m.separateAxes&&(c.rotationOverLifetime.y=uq(m.y),c.rotationOverLifetime.x=uq(m.x)));var v=t.colorOverLifetime;if(v){var y=c.colorOverLifetime={opacity:uq(v.opacity)};v.color&&(y.color=u2(v.color))}var g=t.textureSheetAnimation;g&&(c.textureSheetAnimation={row:g.row,col:g.col,total:g.total,animate:g.animate,cycles:uq(g.cycles),animationDelay:uK(g.animationDelay,0),animationDuration:uK(g.animationDuration,0)});var x=t.trails;x&&(c.trails={lifetime:uJ(x.lifetime),dieWithParticles:x.dieWithParticles,maxPointPerTrail:x.maxPointPerTrail,minimumVertexDistance:x.minimumVertexDistance,widthOverTrail:uq(x.widthOverTrail),colorOverTrail:x.colorOverTrail&&u2(x.colorOverTrail,!1),blending:x.blending,colorOverLifetime:x.colorOverLifetime&&u2(x.colorOverLifetime,!1),inheritParticleColor:x.inheritParticleColor,occlusion:x.occlusion,transparentOcclusion:x.transparentOcclusion,orderOffset:x.orderOffset,sizeAffectsLifetime:x.sizeAffectsLifetime,sizeAffectsWidth:x.sizeAffectsWidth,texture:x.texture,parentAffectsPosition:x.parentAffectsPosition,opacityOverLifetime:uJ(x.opacityOverLifetime)}),c.trails&&u5(c.trails);var b=t.interaction;return b&&(c.interaction={behavior:b.behavior,radius:b.radius,multiple:b.multiple}),c}(c)):t.sprite?(i=tH.sprite,l=b((c=t.sprite).transform,!1,!0),s=hy(o=c,l),(u=o.textureSheetAnimation)&&(s.textureSheetAnimation={row:u.row,col:u.col,total:u.total||void 0,animate:u.animate}),s.renderer=o.renderer,o.splits&&(s.splits=o.splits),o.interaction&&(s.interaction=o.interaction),f=s):t.cal?(i=tH.null,l=b((c=t.cal).transform,!1,!0),f=hy(c,l)):t.ui?(i=tH.interact,l=b((c=t.ui).transform),f=function(t){var e,i=t.options;switch(i.type){case"click":e={type:tj.CLICK,showPreview:i.showPreview,previewColor:i.previewColor&&uQ(i.previewColor),behavior:i.behavior||tX.NOTIFY};break;case"drag":e={type:tj.DRAG,enableInEditor:!!i.enableInEditor,dxRange:i.dxRange,dyRange:i.dyRange,target:i.target};break;case"message":e={type:tj.MESSAGE}}return{options:e}}(c),l.scale=[c.options.width||1,c.options.height||1,1]):t.model&&(c=t.model,1===t.model.options.type&&(i=tH.camera,l=b(c.transform),f=function(t){var e=t.options,i={options:{fov:e.fov,far:e.far,near:e.near,clipMode:e.clipMode}},r=t.velocityOverLifetime;if(r||(null==(n=t.transform)?void 0:n.path)){var n,a,o={path:u3(null==(a=t.transform)?void 0:a.path),linearX:uq(null==r?void 0:r.translateX),linearY:uq(null==r?void 0:r.translateY),linearZ:uq(null==r?void 0:r.translateZ)};u5(o),i.positionOverLifetime=o}var s=t.rotationOverLifetime;if(s){var u={separateAxes:s.separateAxes,x:uq(null==s?void 0:s.rotateX),y:uq(null==s?void 0:s.rotateY),z:s.separateAxes?uq(null==s?void 0:s.rotateZ):uq(s.rotation)};u5(u),i.rotationOverLifetime=u}return i}(c))),null==(h=f.renderer)?void 0:h.anchor){var a=new Float32Array(f.renderer.anchor);.5==a[0]&&.5==a[1]?delete f.renderer.anchor:e.requires&&uZ(e.requires,"anchor")}if(c){var o,s,u,h,l,c,f,d,p,m,v,y,g=null==(v=c.options)?void 0:v.looping;r=g?Array.isArray(g)?g[1]?t0.restart:t0.destroy:t0.restart:r||(null==c?void 0:null==(y=c.options)?void 0:y.endBehavior)||t0.destroy,c.options.renderLevel&&(d=c.options.renderLevel),isNaN(n)&&(n=c.options.duration)}var x={type:i,name:t.name,delay:t.delay,duration:n,id:t.id+"",transform:l,endBehavior:r,renderLevel:d,content:f};return p?e.plugins?(uZ(e.plugins,p),x.pn=e.plugins.indexOf(p)):x.pluginName=p:Number.isInteger(m)&&(x.pn=m),t.parentId&&(x.parentId=t.parentId+""),x;function b(t,e,i){if(t){var r={},n=t.rotation;if(n&&(e?r.rotation=[-n[0],-n[1],-n[2]]:r.rotation=[n[0],n[1],n[2]],i)){var a,o,s,u,h,l,c,f,d,p,m,v,y,g,x,b,T,C,E,_,w,S,M,A,P=(a=r.rotation[0],o=r.rotation[1],s=r.rotation[2],u=u6(a*u9/2),h=u6(o*u9/2),l=u6(s*u9/2),c=u8(a*u9/2),f=u8(o*u9/2),d=u8(s*u9/2),hS[0]=c*h*l+u*f*d,hS[1]=u*f*l-c*h*d,hS[2]=u*h*d+c*f*l,hS[3]=u*h*l-c*f*d,hS);r.rotation=(p=[],m=P[0],v=P[1],y=P[2],g=P[3],x=m+m,b=v+v,T=y+y,C=m*x,E=v*x,_=v*b,w=y*T,S=g*T,M=y*x-g*b,p[1]=Math.asin((A=-M)>1?1:A<-1?-1:A)*u7,.9999999>Math.abs(M)?(p[0]=Math.atan2(y*b+g*x,1-C-_)*u7,p[2]=Math.atan2(E+S,1-_-w)*u7):(p[0]=0,p[2]=Math.atan2(-(E-S),1-C-w)*u7),p)}return t.position&&(r.position=t.position),Array.isArray(t.scale)&&(r.scale=[t.scale[0]||1,t.scale[1]||1,t.scale[2]||1]),r}return{}}}var hA=((eO={})[tD.S]=[tD.S,tD.BPlus,tD.APlus],eO[tD.A]=[tD.A,tD.BPlus,tD.APlus],eO[tD.B]=[tD.B,tD.BPlus],eO);function hP(t,e){if(!t||!e)return!0;var i=hA[e];return!!i&&i.includes(t)}function hR(t,e){var i,r,n=null!=(r=null==t?void 0:t.background)?r:{},a=n.name,o=n.url;return a&&(e&&e[a]?i=e[a]:o&&(i=o)),i}function hI(t,e,i){return hO.apply(this,arguments)}function hO(){return(hO=eB(function(t,e,i){var r,n;return eW(this,function(a){switch(a.label){case 0:if("string"!=typeof t)return[3,2];return[4,rq(t)];case 1:return r=a.sent(),[3,3];case 2:r=t,a.label=3;case 3:if(!r)throw Error("Image not provided.");if(!e)return[2,r];if(n=hR(e,i)){if(iT(n)&&n!==r.src)return[2,rq(n)];if(eU(n,HTMLImageElement))return[2,n]}return[2,r]}})})).apply(this,arguments)}t.Scene=void 0,(tL=t.Scene||(t.Scene={})).isJSONObject=function(t){return i_(t)&&"jsonScene"in t},tL.isURL=function(t){return i_(t)&&"url"in t},tL.isWithOptions=function(t){return i_(t)&&"options"in t};var hL=function(t,e){void 0===e&&(e={}),this.scene=t,this.options=e},hF=1,hV=function(){function e(t,e){void 0===t&&(t={}),void 0===e&&(e=new rG),this.options=t,this.downloader=e,this.assets={},this.sourceFrom={},this.id=hF++,this.timers=[],this.updateOptions(t)}var i=e.prototype;return i.updateOptions=function(t){void 0===t&&(t={}),this.options=i7({},t,{useCompressedTexture:null==(e=t.useCompressedTexture)||e,useHevcVideo:null==(i=t.useHevcVideo)||i}),this.options.pluginData||(this.options.pluginData={});var e,i,r=this.options.timeout;this.timeout=void 0===r?10:r},i.loadScene=function(e,i){var r=this;return eB(function(){var n,a,o,s,u,h,l,c,f,d,p,m;return eW(this,function(v){return a=iT(e)?e:r.id,o=performance.now(),s=[],l=null!=(h=null==(u=null==i?void 0:i.engine.gpuCapability)?void 0:u.detail.ktx2Support)&&h,c={},d=!1,p=new Promise(function(t,e){f=window.setTimeout(function(){d=!0,r.removeTimer(f),e(Error("Load time out: totalTime: "+(performance.now()-o).toFixed(4)+"ms "+s.join(" ")+", url: "+a+"."))},1e3*r.timeout),r.timers.push(f)}),m=eB(function(t,e){var i,r,n;return eW(this,function(a){switch(a.label){case 0:if(d)return[3,4];i=performance.now(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e()];case 2:return r=a.sent(),n=performance.now()-i,s.push("["+t+": "+n.toFixed(2)+"]"),c[t]=n,[2,r];case 3:throw Error("Load error in "+t+", "+a.sent()+".");case 4:throw Error("Load canceled.")}})}),[2,Promise.race([p,eB(function(){var i,u,h,d,p,v,y,g,x,b,T,C,E,_,w;return eW(this,function(S){switch(S.label){case 0:if(!iT(e))return[3,2];return u=new URL(e,location.href).href,r.baseUrl=u,[4,m("loadJSON",function(){return r.loadJSON(u)})];case 1:return iT(n=S.sent())&&(n=JSON.parse(n)),[3,3];case 2:n=e,r.baseUrl=location.href,S.label=3;case 3:if(!t.Scene.isJSONObject(n))return[3,4];return i=i7({},n),[3,9];case 4:return[4,m("processJSON",function(){return r.processJSON(n)})];case 5:return i={timeInfos:c,url:e,storage:{},jsonScene:v=S.sent().jsonScene,bins:[],textureOptions:[],images:[],assets:r.assets},[4,m("plugin:onAssetsLoadStart",function(){return r.onPluginSceneLoadStart(i)})];case 6:return S.sent(),g=void 0===(y=v.bins)?[]:y,x=v.images,b=v.fonts,[4,Promise.all([m("processBins",function(){return r.processBins(g)}),m("processImages",function(){return r.processImages(x,l)}),m("processFontURL",function(){return r.processFontURL(b)})])];case 7:return C=(T=S.sent())[0],E=T[1],[4,m("processTextures",function(){return r.processTextures(E,C,v)})];case 8:_=S.sent(),(h=i.bins).push.apply(h,[].concat(C)),(d=i.textureOptions).push.apply(d,[].concat(_)),(p=i.images).push.apply(p,[].concat(E)),i.renderLevel=r.options.renderLevel,S.label=9;case 9:return w=performance.now()-o,ix.info("Load asset: totalTime: "+w.toFixed(4)+"ms "+s.join(" ")+", url: "+a+"."),window.clearTimeout(f),r.removeTimer(f),i.totalTime=w,i.startTime=o,i.timeInfos=c,[2,i]}})})()])]})})()},i.getAssets=function(){return this.assets},i.processJSON=function(t){return eB(function(){var e,i,r,n,a;return eW(this,function(o){for(r=ij(void 0===(i=(e=hC(t)).plugins)?[]:i);!(n=r()).done;)if(!iO[a=n.value])throw Error("The plugin '"+a+"' not found."+ik(a));return[2,{jsonScene:e}]})})()},i.processBins=function(t){var e=this;return eB(function(){var i,r;return eW(this,function(n){return i=e.options.renderLevel,r=e.baseUrl,[2,Promise.all(t.map(function(n){if(eU(n,ArrayBuffer))return n;if(hP(n.renderLevel,i))return e.loadBins(new URL(n.url,r).href);throw Error("Invalid bins source: "+JSON.stringify(t)+".")}))]})})()},i.processFontURL=function(t){var i=this;return eB(function(){return eW(this,function(r){return[2,e.loadFontFamily(t,i.baseUrl)]})})()},i.processImages=function(e,i){void 0===i&&(i=!1);var r=this;return eB(function(){var n,a,o,s,u,h,l,c,f;return eW(this,function(d){switch(d.label){case 0:return a=(n=r.options).useCompressedTexture,o=n.variables,s=n.disableWebP,u=n.disableAVIF,h=!!iO.ktx2,l=a&&i&&h,c=r.baseUrl,a&&i&&!h&&e.some(function(t){return"ktx2"in t&&t.ktx2})&&ix.warn("The plugin 'ktx2' is not found, unable to use compressed textures."+ik("ktx2")),[4,Promise.all(e.map(eB(function(e,i){var n,a,h,f,d,p,m,v,y,g,x,b,T,C,E,_,w,S,M,A;return eW(this,function(i){switch(i.label){case 0:if(n=e.url,a=e.webp,h=e.avif,f=e.ktx2,d=new URL(n,c).href,p=!s&&a?new URL(a,c).href:void 0,m=!u&&h?new URL(h,c).href:void 0,v=f&&l?new URL(f,c).href:void 0,y=e.id,!("template"in e))return[3,8];if(!(x=(g=e.template).background))return[3,7];b=hR(g,o),T=x.type===ef.video,C=x&&T?r0:rq,i.label=1;case 1:return i.trys.push([1,6,,7]),[4,r2(b,C)];case 2:if(!eU(E=i.sent(),HTMLVideoElement))return[3,3];return r.sourceFrom[y]={url:E.src,type:t.TextureSourceType.video},[2,E];case 3:return x&&Array.isArray(b)&&o&&(o[x.name]=E.src),r.sourceFrom[y]={url:E.src,type:t.TextureSourceType.image},[4,hI(E,g,o)];case 4:return[2,i.sent()];case 5:return[3,7];case 6:throw _=i.sent(),Error("Failed to load. Check the template or if the URL is "+(T?"video":"image")+" type, URL: "+b+", Error: "+(_.message||_)+".");case 7:return[3,9];case 8:if("ktx2"in e&&v)return r.sourceFrom[y]={url:v,type:t.TextureSourceType.compressed},[2,r.loadBins(v)];if(eU(e,HTMLImageElement)||eU(e,HTMLCanvasElement)||eU(e,HTMLVideoElement)||eU(e,r7))return[2,e];i.label=9;case 9:if(!m)return[3,11];return[4,rY(d,m)];case 10:return A=i.sent(),[3,13];case 11:return[4,rX(d,p)];case 12:A=i.sent(),i.label=13;case 13:return S=(w=A).url,M=w.image,r.sourceFrom[y]={url:S,type:t.TextureSourceType.image},[2,M]}})})))];case 1:return f=d.sent(),r.assignImagesToAssets(e,f),[2,f]}})})()},i.onPluginSceneLoadStart=function(t){var e=this;return eB(function(){return eW(this,function(i){switch(i.label){case 0:return[4,iV.notifyAssetsLoadStart(t,e.options)];case 1:return i.sent(),[2]}})})()},i.processTextures=function(e,i,r){var n=this;return eB(function(){var a;return eW(this,function(o){return[2,Promise.all((null!=(a=r.textures)?a:e.map(function(t,e){return{source:e}})).map(eB(function(e,a){var o,s,u,h,l;return eW(this,function(c){switch(c.label){case 0:if(eU(e,r7))return[2,e];if(!("mipmaps"in e))return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r4(e,i,n.assets,r.bins)];case 2:return[2,c.sent()];case 3:throw Error("Load texture "+a+" fails, error message: "+c.sent()+".");case 4:if(o=e.source,s=e.id,h="",!i_(o))return[3,5];return u=n.assets[o.id],h=o.id,[3,7];case 5:if("string"!=typeof o)return[3,7];return[4,rq(iR(o))];case 6:u=c.sent(),c.label=7;case 7:if(!u)return[3,9];return[4,function(t,e,i){return hN.apply(this,arguments)}(u,n.sourceFrom[h],s)];case 8:return[2,(l=c.sent()).sourceType===t.TextureSourceType.compressed?l:i7({},l,e)];case 9:throw Error("Invalid texture source: "+o+".")}})})))]})})()},i.loadJSON=function(t){var e=this;return eB(function(){return eW(this,function(i){return[2,new Promise(function(i,r){e.downloader.downloadJSON(t,i,function(e,i){r("Couldn't load JSON "+JSON.stringify(t)+": status "+e+", "+i)})})]})})()},i.loadBins=function(t){var e=this;return eB(function(){return eW(this,function(i){return[2,new Promise(function(i,r){e.downloader.downloadBinary(t,i,function(e,i){r("Couldn't load bins "+JSON.stringify(t)+": status "+e+", "+i)})})]})})()},i.assignImagesToAssets=function(t,e){for(var i=0;i<t.length;i++)this.assets[t[i].id]=e[i]},i.removeTimer=function(t){var e=this.timers.indexOf(t);-1!==e&&this.timers.splice(e,1)},i.dispose=function(){this.timers.length&&this.timers.map(function(t){return window.clearTimeout(t)}),this.assets={},this.sourceFrom={},this.timers=[]},e.loadFontFamily=function(t,i){return void 0===i&&(i=location.href),eB(function(){return eW(this,function(r){return t?[2,Promise.all(t.map(eB(function(t){var r,n,a;return eW(this,function(o){switch(o.label){case 0:if(!(t.fontURL&&!e.fontCache.has(t.fontFamily)))return[3,4];iv(t.fontFamily)||console.warn("Risky font family: "+t.fontFamily+"."),o.label=1;case 1:return o.trys.push([1,3,,4]),r=new URL(t.fontURL,i).href,[4,(a=new FontFace(null!=(n=t.fontFamily)?n:"","url("+r+")")).load()];case 2:return o.sent(),document.fonts.add(a),e.fontCache.add(t.fontFamily),[3,4];case 3:return o.sent(),ix.warn("Invalid font family or font source: "+JSON.stringify(t.fontURL)+"."),[3,4];case 4:return[2]}})})))]:[2]})})()},e.loadPrecomposition=function(t,i){return eB(function(){return eW(this,function(r){switch(r.label){case 0:return[4,new e(i).loadScene(t)];case 1:return[2,new hL(r.sent(),i)]}})})()},e}();function hN(){return(hN=eB(function(e,i,r){var n,a,o,s,u;return eW(this,function(h){switch(h.label){case 0:if(n={id:r,dataType:em.Texture},!eU(e,r7))return[3,1];return[2,i7({},e.source,n)];case 1:if(!(eU(e,HTMLImageElement)||iS(e)))return[3,2];return[2,i7({image:e,sourceType:t.TextureSourceType.image,sourceFrom:i,keepImageSource:!0,minFilter:rV.LINEAR,magFilter:rV.LINEAR},n)];case 2:if(!eU(e,HTMLVideoElement))return[3,3];return[2,i7({sourceType:t.TextureSourceType.video,video:e,minFilter:rV.LINEAR,magFilter:rV.LINEAR},n)];case 3:if(!eU(e,ArrayBuffer))return[3,10];if(!(a=nn.getLoader("ktx2")))return[3,8];h.label=4;case 4:return h.trys.push([4,6,,7]),[4,a.loadFromBuffer(e)];case 5:return o=h.sent(),ix.info("Loading KTX2 texture."),[2,i7({sourceType:o.sourceType,type:o.type,target:o.target,internalFormat:o.internalFormat,format:o.format,mipmaps:o.mipmaps,minFilter:rV.LINEAR,magFilter:rV.LINEAR,sourceFrom:i},n)];case 6:throw s=h.sent(),Error("Failed to parse KTX2 from "+(null!=(u=null==i?void 0:i.url)?u:"buffer")+": "+(s.message||s));case 7:return[3,9];case 8:throw Error("KTX2 loader not found. Please register it first.");case 9:return[3,11];case 10:if("width"in e&&"height"in e&&"data"in e)return[2,i7({sourceType:t.TextureSourceType.data,data:e,wrapS:rV.CLAMP_TO_EDGE,wrapT:rV.CLAMP_TO_EDGE,minFilter:rV.NEAREST,magFilter:rV.NEAREST},n)];h.label=11;case 11:throw Error("Invalid texture options.")}})})).apply(this,arguments)}hV.fontCache=new Set;var hk=function(){function e(t){this.engine=t,this.builtinObjects=[],this.builtinObjects.push(t.whiteTexture),this.builtinObjects.push(t.transparentTexture)}var i=e.prototype;return i.assembleSceneLoadOptions=function(e,i){void 0===i&&(i={});var r=e;return t.Scene.isURL(e)&&(t.Scene.isJSONObject(e)||(r=e.url),t.Scene.isWithOptions(e)&&(i=i7({},i,e.options))),{source:r,options:i}},i.updateTextVariables=function(t,e){var i=this;void 0===e&&(e={}),t.jsonScene.items.forEach(function(t){if(t.type===tH.text||t.type===tH.richtext){var r=e[t.name];null!=r&&t.components.forEach(function(t){var e=t.id,n=i.engine.findEffectsObjectData(e);((null==n?void 0:n.dataType)===em.TextComponent||(null==n?void 0:n.dataType)===em.RichTextComponent)&&(n.options.text=r)})}})},i.prepareAssets=function(t,e){for(var i,r=ij(Object.keys(e));!(i=r()).done;){var n=i.value,a=e[n],o=new uj(this.engine);o.data=a,o.setInstanceId(n)}this.engine.addPackageDatas(t);for(var s,u=ij(this.builtinObjects);!(s=u()).done;){var h=s.value;this.engine.addInstance(h)}},i.createShaderVariant=function(){for(var t,e=ij(Object.keys(this.engine.objectInstance));!(t=e()).done;){var i=t.value,r=this.engine.objectInstance[i];eU(r,ng)&&r.createShaderVariant()}},i.destroyBuiltinObjects=function(){for(var t,e=ij(this.builtinObjects);!(t=e()).done;)t.value.dispose();this.builtinObjects.length=0},i.dispose=function(){this.destroyBuiltinObjects()},e}(),hD=new e3(1,1,1),hz=function(){function t(t,e){void 0===e&&(e={}),this.name=t,this.transform=new nO,this.viewportMatrix=nu.fromIdentity(),this.viewMatrix=nu.fromIdentity(),this.projectionMatrix=nu.fromIdentity(),this.viewProjectionMatrix=nu.fromIdentity(),this.inverseViewMatrix=nu.fromIdentity(),this.dirty=!0;var i=e.near,r=e.far,n=e.fov,a=e.aspect,o=e.clipMode,s=void 0===o?tQ.portrait:o,u=e.position,h=void 0===u?[0,0,8]:u,l=e.rotation,c=void 0===l?[0,0,0]:l,f=new nh(c[0],c[1],c[2]),d=new ri().setFromEuler(f);this.options={near:void 0===i?.1:i,far:void 0===r?20:r,fov:void 0===n?60:n,aspect:void 0===a?1:a,clipMode:s},this.transform.setPosition(h[0],h[1],h[2]),this.transform.setQuaternion(d.x,d.y,d.z,d.w),this.dirty=!0,this.updateMatrix()}var e=t.prototype;return e.setTransform=function(t){this.transform.parentTransform=t.parentTransform,this.transform.cloneFromMatrix(t.getMatrix()),this.dirty=!0},e.setViewportMatrix=function(t){this.viewportMatrix=t.clone(),this.dirty=!0},e.getViewportMatrix=function(){return this.viewportMatrix},e.getViewMatrix=function(){return this.updateMatrix(),this.viewMatrix.clone()},e.getInverseViewMatrix=function(){return this.updateMatrix(),this.inverseViewMatrix.clone()},e.getProjectionMatrix=function(){return this.updateMatrix(),this.projectionMatrix.clone()},e.getInverseProjectionMatrix=function(){var t;return this.updateMatrix(),null==(t=this.inverseProjectionMatrix)?void 0:t.clone()},e.getViewProjectionMatrix=function(){return this.updateMatrix(),this.viewProjectionMatrix.clone()},e.getInverseViewProjectionMatrix=function(){return this.updateMatrix(),this.inverseViewProjectionMatrix||(this.inverseViewProjectionMatrix=this.viewProjectionMatrix.clone(),this.inverseViewProjectionMatrix.invert()),this.inverseViewProjectionMatrix.clone()},e.getModelViewProjection=function(t,e){return t.multiplyMatrices(this.viewProjectionMatrix,e)},e.getInverseVPRatio=function(t){var e=new e3(this.position.x,this.position.y,t),i=this.getViewProjectionMatrix(),r=this.getInverseViewProjectionMatrix();if(!this.viewportMatrix.isIdentity()){var n=this.viewportMatrix.clone();r.premultiply(n),i.multiply(n.invert())}var a=i.projectPoint(e).z,o=r.projectPoint(new e3(1,1,a)),s=o.x,u=o.y,h=r.projectPoint(new e3(-1,-1,a));return new e3((s-h.x)/2,(u-h.y)/2,0)},e.setQuat=function(t){this.transform.getQuaternion().equals(t)||(this.transform.setQuaternion(t.x,t.y,t.z,t.w),this.dirty=!0)},e.getQuat=function(){return this.transform.quat.clone()},e.getOptions=function(){return i7({},this.options,{position:this.position.clone(),rotation:this.rotation.clone()})},e.copy=function(t){var e=t.near,i=t.far,r=t.fov,n=t.clipMode,a=t.aspect,o=t.position,s=t.rotation;this.near=e,this.far=i,this.fov=r,this.clipMode=n,this.aspect=a,this.position=o,this.rotation=s,this.updateMatrix()},e.updateMatrix=function(){if(this.dirty){var t,e=this.options,i=e.fov,r=e.aspect,n=e.near,a=e.far,o=e.clipMode;this.projectionMatrix.perspective(i*eQ,r,n,a,o===tQ.portrait),this.projectionMatrix.premultiply(this.viewportMatrix),this.inverseViewMatrix.compose(this.position,this.getQuat(),hD),this.inverseViewMatrix.premultiply(null!=(t=this.transform.getParentMatrix())?t:nu.IDENTITY),this.viewMatrix.copyFrom(this.inverseViewMatrix).invert(),this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix,this.viewMatrix),this.inverseViewProjectionMatrix=null,this.dirty=!1}},e.worldToScreenPoint=function(t,e){this.updateMatrix();var i=null!=e?e:new e3,r=this.getViewProjectionMatrix();i.set(t.x,t.y,t.z),r.projectPoint(i,i);var n=this.engine.canvas.getBoundingClientRect(),a=n.width,o=n.height;return i.x=(i.x+1)*.5*a,i.y=(i.y+1)*.5*o,i.z=(i.z+1)*.5,i},e.screenToWorldPoint=function(t,e){this.updateMatrix();var i=null!=e?e:new e3,r=this.getInverseViewProjectionMatrix(),n=this.engine.canvas.getBoundingClientRect(),a=n.width,o=n.height,s=t.x/a*2-1,u=t.y/o*2-1,h=2*t.z-1;return i.set(s,u,h),r.projectPoint(i,i),i},rI(t,[{key:"near",get:function(){return this.options.near},set:function(t){this.options.near!==t&&(this.options.near=t,this.dirty=!0)}},{key:"far",get:function(){return this.options.far},set:function(t){this.options.far!==t&&(this.options.far=t,this.dirty=!0)}},{key:"fov",get:function(){return this.options.fov},set:function(t){this.options.fov!==t&&(this.options.fov=t,this.dirty=!0)}},{key:"aspect",get:function(){return this.options.aspect},set:function(t){this.options.aspect!==t&&(this.options.aspect=t,this.dirty=!0)}},{key:"clipMode",get:function(){return this.options.clipMode},set:function(t){void 0!==t&&this.options.clipMode!==t&&(this.options.clipMode=t,this.dirty=!0)}},{key:"position",get:function(){return this.transform.position.clone()},set:function(t){this.transform.position.equals(t)||(this.transform.setPosition(t.x,t.y,t.z),this.dirty=!0)}},{key:"worldPosition",get:function(){return this.transform.getWorldPosition()}},{key:"rotation",get:function(){return this.transform.rotation.clone()},set:function(t){this.transform.rotation.equals(t)||(this.transform.setRotation(t.x,t.y,t.z),this.dirty=!0)}}]),t}();function hB(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var hU=function(){function t(){this.update=new hW,this.lateUpdate=new hj,this.preRender=new hX}var e=t.prototype;return e.addComponent=function(t){t.onUpdate!==rO.prototype.onUpdate&&this.update.addComponent(t),t.onLateUpdate!==rO.prototype.onLateUpdate&&this.lateUpdate.addComponent(t),t.onPreRender!==rO.prototype.onPreRender&&this.preRender.addComponent(t)},e.removeComponent=function(t){t.onUpdate!==rO.prototype.onUpdate&&this.update.removeComponent(t),t.onLateUpdate!==rO.prototype.onLateUpdate&&this.lateUpdate.removeComponent(t),t.onPreRender!==rO.prototype.onPreRender&&this.preRender.removeComponent(t)},e.clear=function(){this.update.clear(),this.lateUpdate.clear()},t}(),hG=function(){function t(){this.components=[],this.ticks=[]}var e=t.prototype;return e.tick=function(t){this.tickComponents(this.components,t);for(var e=0;e<this.ticks.length;e++)this.ticks[e](t)},e.tickComponents=function(t,e){},e.addComponent=function(t){this.components.includes(t)||this.components.push(t)},e.removeComponent=function(t){var e=this.components.indexOf(t);e>-1&&this.components.splice(e,1)},e.addTick=function(t,e){var i=t.bind(e);this.ticks.includes(i)||this.ticks.push(i)},e.clear=function(){this.components=[]},t}(),hW=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=ij(t);!(i=r()).done;)i.value.onUpdate(e)},e}(hG),hj=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=ij(t);!(i=r()).done;)i.value.onLateUpdate(e)},e}(hG),hX=function(t){function e(){return t.apply(this,arguments)}return iB(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=ij(t);!(i=r()).done;)i.value.onPreRender()},e}(hG),hH=function(e){function i(i,r,n){(b=e.call(this)||this).engine=i,b.sceneTicking=new hU,b.speed=1,b.isEnded=!1,b.loaderData={},b.startTime=0,b.videos=[],b.postProcessingEnabled=!1,b.canvasLayers=[],b.destroyed=!1,b.paused=!0,b.isEndCalled=!1,b._textures=[];var a,o,s,u,h,l,c,f=null!=r?r:{},d=f.reusable,p=void 0!==d&&d,m=f.speed,v=f.baseRenderOrder,y=f.event,g=f.onItemMessage;b.engine.addComposition(hB(b));var x=null;if(n){b.createTexturesFromData(n.textureOptions);for(var b,T,C,E=ij(Object.keys(n.assets));!(C=E()).done;){var _=C.value,w=n.assets[_];eU(w,HTMLVideoElement)&&b.videos.push(w)}b.postProcessingEnabled=null!=(S=null==(T=n.jsonScene.renderSettings)?void 0:T.postProcessingEnabled)&&S,b.engine.renderLevel=n.renderLevel,p&&(n.consumed=!0),x=n.jsonScene.compositions[0];for(var S,M,A=ij(n.jsonScene.compositions);!(M=A()).done;){var P=M.value;P.id===n.jsonScene.compositionId&&(x=P)}im(x)}return b.root=new t.VFXItem(b.engine),b.root.name="root",b.root.composition=hB(b),b.pluginRoot=new t.VFXItem(b.engine),b.pluginRoot.name="pluginRoot",b.pluginRoot.setParent(b.root),b.pluginRoot.addComponent(ow),b.sceneRoot=new t.VFXItem(b.engine),b.sceneRoot.setParent(b.root),x&&(b.sceneRoot.setInstanceId(x.id),b.sceneRoot.instantiatePreComposition(x,!1)),b.sceneRoot.name="sceneRoot",b.rootComposition=null!=(a=b.sceneRoot.getComponent(t.CompositionComponent))?a:b.sceneRoot.addComponent(t.CompositionComponent),b.rootComposition.updateMode=t.UpdateModes.Manual,b.rootComposition.play(),b.sceneRoot.on("animationevent",function(t){b.emit("animationevent",t)}),b.sceneRoot.setParent(b.root),b.renderOrder=void 0===v?0:v,b.id=null!=(o=null==x?void 0:x.id)?o:iP(),b.startTime=null!=(s=null==x?void 0:x.startTime)?s:0,b.event=y,b.statistic={loadStart:null!=(u=null==n?void 0:n.startTime)?u:0,loadTime:null!=(h=null==n?void 0:n.totalTime)?h:0,compileTime:0,firstFrameTime:0},b.reusable=p,b.speed=void 0===m?1:m,b.name=null!=(l=null==x?void 0:x.name)?l:"New Composition",b.camera=new hz(b.name,i7({},null==x?void 0:x.camera,{aspect:b.width/b.height})),b.camera.engine=b.engine,b.url=null!=(c=null==n?void 0:n.url)?c:"",b.interactive=!0,g&&(b.onItemMessage=g),b.createRenderFrame(),iV.notifyCompositionCreated(hB(b),n),b}iB(i,e);var r=i.prototype;return r.getDuration=function(){return this.sceneRoot.duration},r.restart=function(){this.reset(),this.forwardTime(this.startTime)},r.setIndex=function(t){this.renderOrder=t},r.getIndex=function(){return this.renderOrder},r.setSpeed=function(t){this.speed=t},r.setVisible=function(t){this.sceneRoot.setVisible(t)},r.getSpeed=function(){return this.speed},r.play=function(){this.isEnded&&this.reusable&&this.restart(),this.rootComposition.isStartCalled?this.setTime(this.time-this.startTime):this.setTime(0),this.resume()},r.pause=function(){this.paused=!0,this.emit("pause")},r.getPaused=function(){return this.paused},r.resume=function(){this.paused=!1,this.isEnded&&this.reusable&&this.restart();var t=this.time;this.emit("play",{time:t})},r.gotoAndPlay=function(t){this.setTime(t),this.emit("goto",{time:t}),this.resume()},r.gotoAndStop=function(t){this.setTime(t),this.emit("goto",{time:t}),this.pause()},r.createRenderFrame=function(){this.renderFrame=new oo({camera:this.camera,renderer:this.renderer,globalVolume:this.globalVolume,postProcessingEnabled:this.postProcessingEnabled})},r.setTime=function(t){var e=this.speed,i=this.getPaused();i&&this.resume(),this.setSpeed(1),this.forwardTime(t+this.startTime),this.setSpeed(e),i&&(this.paused=!0)},r.addItem=function(t){t.setParent(this.sceneRoot)},r.getComponent=function(t){return this.sceneRoot.getComponent(t)},r.forwardTime=function(t){var e=1e3*t-1e3*this.time;this.update(e)},r.reset=function(){this.isEnded=!1,this.isEndCalled=!1,this.rootComposition.setTime(0)},r.render=function(){this.renderer.renderRenderFrame(this.renderFrame),this.renderCanvasLayers()},r.update=function(t){if(!this.getPaused()){this.root.isDuringPlay||(this.root.awake(),this.root.beginPlay());var e=this.time;this.updateCompositionTime(t*this.speed/1e3);var i=(this.time-e)*1e3;this.rootComposition.setChildrenRenderOrder(0),this.sceneTicking.update.tick(i),this.sceneTicking.lateUpdate.tick(i),this.updateCamera(),this.isEnded&&!this.isEndCalled&&(this.isEndCalled=!0,this.emit("end",{composition:this})),this.shouldDispose()&&this.dispose()}},r.shouldDispose=function(){return this.isEnded&&this.sceneRoot.endBehavior===t0.destroy&&!this.reusable},r.updateCamera=function(){this.camera.updateMatrix()},r.updateCompositionTime=function(e){if(this.rootComposition.state===t.PlayState.Playing&&this.rootComposition.isActiveAndEnabled){var i=this.time+e-this.startTime;e<0&&i<0&&(i=0);var r=this.sceneRoot.duration,n=this.sceneRoot.endBehavior,a=!1;if(i>=r)switch(a=!0,n){case t0.restart:i%=r,this.restart();break;case t0.freeze:i=Math.min(r,i);case t0.forward:case t0.destroy:}this.rootComposition.tick(i+this.startTime-this.rootComposition.getTime()),this.isEnded!==a&&(a?this.isEnded=!0:(this.isEnded=!1,this.isEndCalled=!1))}},r.renderCanvasLayers=function(){this.engine.graphics.begin(),this.canvasLayers.sort(function(t,e){return t.layer-e.layer});for(var t,e=ij(this.canvasLayers);!(t=e()).done;)t.value.draw();this.engine.graphics.end()},r.createTexturesFromData=function(t){for(var e,i=ij(t);!(e=i()).done;){var r=e.value,n=this.engine.findObject({id:r.id});n.initialize(),this._textures.push(n)}},r.getItemByName=function(t){return this.sceneRoot.find(t)},r.getHitTestRay=function(t,e){var i=this.renderFrame.editorTransform,r=i.x,n=i.y;return nG((t-i.z)/r,(e-i.w)/n,this.camera)},r.getEngine=function(){var t;return null==(t=this.renderer)?void 0:t.engine},r.hitTest=function(t,e,i,r){if(this.isDestroyed||!this.interactive)return[];var n=[],a=this.getHitTestRay(t,e);return this.sceneRoot.hitTest(a,t,e,n,[],i,r),n},r.addInteractiveItem=function(t,e){if(e===tj.MESSAGE)return null==this.onItemMessage||this.onItemMessage.call(this,{name:t.name,phrase:2,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:2,id:t.id}),t.id},r.removeInteractiveItem=function(t,e){e===tj.MESSAGE&&(null==this.onItemMessage||this.onItemMessage.call(this,{name:t.name,phrase:1,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:1,id:t.id}))},r.destroyItem=function(t){},r.lost=function(t){},r.restore=function(){},r.dispose=function(){var e=this;if(!this.destroyed){this.destroyed=!0;for(var i,r=ij(this.textures);!(i=r()).done;)i.value.dispose();this._textures=[];for(var n,a=ij(this.videos);!(n=a()).done;){var o=n.value;o.pause(),o.removeAttribute("src"),o.load()}this.videos=[],this.sceneRoot.dispose(),this.pluginRoot.dispose(),this.root.dispose(),this.renderFrame.dispose(),iV.notifyCompositionDestroy(this),this.update=function(){ix.error("Update disposed composition: "+e.name+".")},this.dispose=ib,this.renderer.engine.removeComposition(this),this.engine.env!==nw&&this.renderer.clear({stencilAction:t.TextureLoadAction.clear,clearStencil:0,depthAction:t.TextureLoadAction.clear,clearDepth:1,colorAction:t.TextureLoadAction.clear,clearColor:[0,0,0,0]})}},r.setEditorTransform=function(t,e,i){this.renderFrame.editorTransform.set(t,t,e,i)},r.translateByPixel=function(t,e){if(!this.renderer){console.warn("Renderer not assigned. Operation aborted.");return}this.sceneRoot.translateByPixel(t,e)},r.setPositionByPixel=function(t,e){if(!this.renderer){console.warn("Renderer not assigned. Operation aborted.");return}this.sceneRoot.setPositionByPixel(t,e)},r.translate=function(t,e,i){this.sceneRoot.translate(t,e,i)},r.setPosition=function(t,e,i){this.sceneRoot.setPosition(t,e,i)},r.rotate=function(t,e,i){this.sceneRoot.rotate(t,e,i)},r.setRotation=function(t,e,i){this.sceneRoot.setRotation(t,e,i)},r.scale=function(t,e,i){this.sceneRoot.scale(t,e,i)},r.setScale=function(t,e,i){this.sceneRoot.setScale(t,e,i)},r.offloadTexture=function(){this.textureOffloaded||(this.textures.forEach(function(t){return t&&t.offloadData()}),this.textureOffloaded=!0)},r.reloadTexture=function(){var t=this;return eB(function(){return eW(this,function(e){switch(e.label){case 0:if(!t.textureOffloaded)return[3,2];return[4,Promise.all(t.textures.map(function(t){return null==t?void 0:t.reloadData()}))];case 1:e.sent(),t.textureOffloaded=!1,e.label=2;case 2:return[2]}})})()},rI(i,[{key:"width",get:function(){return this.engine.canvas.width}},{key:"height",get:function(){return this.engine.canvas.height}},{key:"renderer",get:function(){return this.engine.renderer}},{key:"rootItem",get:function(){return this.sceneRoot}},{key:"transform",get:function(){return this.sceneRoot.transform}},{key:"textures",get:function(){return this._textures}},{key:"items",get:function(){return this.sceneRoot.getDescendants()}},{key:"time",get:function(){return this.rootComposition.getTime()}},{key:"isDestroyed",get:function(){return this.destroyed}},{key:"viewportMatrix",get:function(){return this.camera.getViewportMatrix()},set:function(t){this.camera.setViewportMatrix(t)}}]),i}(nM),hY=new Int32Array(2),hZ=new Float32Array(hY.buffer),hq=new Float64Array(hY.buffer),hK=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];(tF=eL||(eL={}))[tF.UTF8_BYTES=1]="UTF8_BYTES",tF[tF.UTF16_STRING=2]="UTF16_STRING";var hQ=function(){function t(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}var e=t.prototype;return e.clear=function(){this.position_=0},e.bytes=function(){return this.bytes_},e.position=function(){return this.position_},e.setPosition=function(t){this.position_=t},e.capacity=function(){return this.bytes_.length},e.readInt8=function(t){return this.readUint8(t)<<24>>24},e.readUint8=function(t){return this.bytes_[t]},e.readInt16=function(t){return this.readUint16(t)<<16>>16},e.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},e.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},e.readUint32=function(t){return this.readInt32(t)>>>0},e.readInt64=function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))},e.readUint64=function(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))},e.readFloat32=function(t){return hY[0]=this.readInt32(t),hZ[0]},e.readFloat64=function(t){return hY[hK?0:1]=this.readInt32(t),hY[hK?1:0]=this.readInt32(t+4),hq[0]},e.writeInt8=function(t,e){this.bytes_[t]=e},e.writeUint8=function(t,e){this.bytes_[t]=e},e.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},e.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},e.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},e.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},e.writeInt64=function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))},e.writeUint64=function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))},e.writeFloat32=function(t,e){hZ[0]=e,this.writeInt32(t,hY[0])},e.writeFloat64=function(t,e){hq[0]=e,this.writeInt32(t,hY[hK?0:1]),this.writeInt32(t+4,hY[hK?1:0])},e.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+4+4)throw Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<4;e++)t+=String.fromCharCode(this.readInt8(this.position_+4+e));return t},e.__offset=function(t,e){var i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0},e.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},e.__string=function(t,e){t+=this.readInt32(t);var i=this.readInt32(t);t+=4;var r=this.bytes_.subarray(t,t+i);return e===eL.UTF8_BYTES?r:this.text_decoder_.decode(r)},e.__union_with_string=function(t,e){return"string"==typeof t?this.__string(e):this.__union(t,e)},e.__indirect=function(t){return t+this.readInt32(t)},e.__vector=function(t){return t+this.readInt32(t)+4},e.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},e.__has_identifier=function(t){if(4!=t.length)throw Error("FlatBuffers: file identifier must be length 4");for(var e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0},e.createScalarList=function(t,e){for(var i=[],r=0;r<e;++r){var n=t(r);null!==n&&i.push(n)}return i},e.createObjList=function(t,e){for(var i=[],r=0;r<e;++r){var n=t(r);null!==n&&i.push(n.unpack())}return i},t.allocate=function(e){return new t(new Uint8Array(e))},t}(),hJ=function(){function t(t){var e;this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder,e=t||1024,this.bb=hQ.allocate(e),this.space=e}var e=t.prototype;return e.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null},e.forceDefaults=function(t){this.force_defaults=t},e.dataBuffer=function(){return this.bb},e.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},e.prep=function(e,i){e>this.minalign&&(this.minalign=e);for(var r=~(this.bb.capacity()-this.space+i)+1&e-1;this.space<r+e+i;){var n=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},e.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},e.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},e.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},e.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},e.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},e.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},e.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},e.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},e.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},e.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},e.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},e.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},e.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},e.addFieldInt8=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))},e.addFieldInt16=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))},e.addFieldInt32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))},e.addFieldInt64=function(t,e,i){(this.force_defaults||e!==i)&&(this.addInt64(e),this.slot(t))},e.addFieldFloat32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))},e.addFieldFloat64=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))},e.addFieldOffset=function(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))},e.addFieldStruct=function(t,e,i){e!=i&&(this.nested(e),this.slot(t))},e.nested=function(t){if(t!=this.offset())throw TypeError("FlatBuffers: struct must be serialized inline.")},e.notNested=function(){if(this.isNested)throw TypeError("FlatBuffers: object serialization must not be nested.")},e.slot=function(t){null!==this.vtable&&(this.vtable[t]=this.offset())},e.offset=function(){return this.bb.capacity()-this.space},e.addOffset=function(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)},e.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},e.endObject=function(){if(null==this.vtable||!this.isNested)throw Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var r=(i+2)*2;this.addInt16(r);var n=0,a=this.space;e:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(o)){for(var s=2;s<r;s+=2)if(this.bb.readInt16(a+s)!=this.bb.readInt16(o+s))continue e;n=this.vtables[e];break}}return n?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,n-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},e.finish=function(t,e,i){var r=i?4:0;if(e){if(this.prep(this.minalign,8+r),4!=e.length)throw TypeError("FlatBuffers: file identifier must be length 4");for(var n=3;n>=0;n--)this.writeInt8(e.charCodeAt(n))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},e.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},e.requiredField=function(t,e){var i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(e<this.bb.readInt16(r)&&0!=this.bb.readInt16(r+e)))throw TypeError("FlatBuffers: field "+e+" must be set")},e.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(i,t*e)},e.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},e.createSharedString=function(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);var e=this.createString(t);return this.string_maps.set(t,e),e},e.createString=function(t){var e;return null==t?0:(eU(t,Uint8Array)?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())},e.createByteVector=function(t){return null==t?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())},e.createObjectOffset=function(t){return null===t?0:"string"==typeof t?this.createString(t):t.pack(this)},e.createObjectOffsetList=function(t){for(var e=[],i=0;i<t.length;++i){var r=t[i];if(null!==r)e.push(this.createObjectOffset(r));else throw TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e},e.createStructOffsetList=function(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()},t.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,r=hQ.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r},t}(),h$=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.dataType=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.data=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.dataLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.dataArray=function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.unpack=function(){return new h0(this.dataType(),this.bb.createScalarList(this.data.bind(this),this.dataLength()))},e.unpackTo=function(t){t.dataType=this.dataType(),t.data=this.bb.createScalarList(this.data.bind(this),this.dataLength())},t.getRootAsFBEffectsObjectData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBEffectsObjectData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBEffectsObjectData=function(t){t.startObject(2)},t.addDataType=function(t,e){t.addFieldOffset(0,e,0)},t.addData=function(t,e){t.addFieldOffset(1,e,0)},t.createDataVector=function(t,e){t.startVector(1,e.length,1);for(var i=e.length-1;i>=0;i--)t.addInt8(e[i]);return t.endVector()},t.startDataVector=function(t,e){t.startVector(1,e,1)},t.endFBEffectsObjectData=function(t){return t.endObject()},t.createFBEffectsObjectData=function(e,i,r){return t.startFBEffectsObjectData(e),t.addDataType(e,i),t.addData(e,r),t.endFBEffectsObjectData(e)},t}(),h0=function(){function t(t,e){void 0===t&&(t=null),void 0===e&&(e=[]),this.dataType=t,this.data=e}return t.prototype.pack=function(t){var e=null!==this.dataType?t.createString(this.dataType):0,i=h$.createDataVector(t,this.data);return h$.createFBEffectsObjectData(t,e,i)},t}(),h1=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.exportObjects=function(t,e){var i=this.bb.__offset(this.bb_pos,4);return i?(e||new h$).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.exportObjectsLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},e.unpack=function(){return new h2(this.bb.createObjList(this.exportObjects.bind(this),this.exportObjectsLength()))},e.unpackTo=function(t){t.exportObjects=this.bb.createObjList(this.exportObjects.bind(this),this.exportObjectsLength())},t.getRootAsFBEffectsPackageData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBEffectsPackageData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBEffectsPackageData=function(t){t.startObject(1)},t.addExportObjects=function(t,e){t.addFieldOffset(0,e,0)},t.createExportObjectsVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startExportObjectsVector=function(t,e){t.startVector(4,e,4)},t.endFBEffectsPackageData=function(t){return t.endObject()},t.finishFBEffectsPackageDataBuffer=function(t,e){t.finish(e)},t.finishSizePrefixedFBEffectsPackageDataBuffer=function(t,e){t.finish(e,void 0,!0)},t.createFBEffectsPackageData=function(e,i){return t.startFBEffectsPackageData(e),t.addExportObjects(e,i),t.endFBEffectsPackageData(e)},t}(),h2=function(){function t(t){void 0===t&&(t=[]),this.exportObjects=t}return t.prototype.pack=function(t){var e=h1.createExportObjectsVector(t,t.createObjectOffsetList(this.exportObjects));return h1.createFBEffectsPackageData(t,e)},t}(),h3=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.offset=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0},e.indexCount=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0},e.vertexCount=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):0},e.unpack=function(){return new h4(this.offset(),this.indexCount(),this.vertexCount())},e.unpackTo=function(t){t.offset=this.offset(),t.indexCount=this.indexCount(),t.vertexCount=this.vertexCount()},t.getRootAsFBSubMesh=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBSubMesh=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBSubMesh=function(t){t.startObject(3)},t.addOffset=function(t,e){t.addFieldInt32(0,e,0)},t.addIndexCount=function(t,e){t.addFieldInt32(1,e,0)},t.addVertexCount=function(t,e){t.addFieldInt32(2,e,0)},t.endFBSubMesh=function(t){return t.endObject()},t.createFBSubMesh=function(e,i,r,n){return t.startFBSubMesh(e),t.addOffset(e,i),t.addIndexCount(e,r),t.addVertexCount(e,n),t.endFBSubMesh(e)},t}(),h4=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.offset=t,this.indexCount=e,this.vertexCount=i}return t.prototype.pack=function(t){return h3.createFBSubMesh(t,this.offset,this.indexCount,this.vertexCount)},t}(),h5=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.semantic=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.offset=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0},e.format=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):0},e.dimension=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.normalize=function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)},e.unpack=function(){return new h6(this.semantic(),this.offset(),this.format(),this.dimension(),this.normalize())},e.unpackTo=function(t){t.semantic=this.semantic(),t.offset=this.offset(),t.format=this.format(),t.dimension=this.dimension(),t.normalize=this.normalize()},t.getRootAsFBVertexChannel=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBVertexChannel=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBVertexChannel=function(t){t.startObject(5)},t.addSemantic=function(t,e){t.addFieldOffset(0,e,0)},t.addOffset=function(t,e){t.addFieldInt32(1,e,0)},t.addFormat=function(t,e){t.addFieldInt32(2,e,0)},t.addDimension=function(t,e){t.addFieldInt32(3,e,0)},t.addNormalize=function(t,e){t.addFieldInt8(4,+e,0)},t.endFBVertexChannel=function(t){return t.endObject()},t.createFBVertexChannel=function(e,i,r,n,a,o){return t.startFBVertexChannel(e),t.addSemantic(e,i),t.addOffset(e,r),t.addFormat(e,n),t.addDimension(e,a),t.addNormalize(e,o),t.endFBVertexChannel(e)},t}(),h6=function(){function t(t,e,i,r,n){void 0===t&&(t=null),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=!1),this.semantic=t,this.offset=e,this.format=i,this.dimension=r,this.normalize=n}return t.prototype.pack=function(t){var e=null!==this.semantic?t.createString(this.semantic):0;return h5.createFBVertexChannel(t,e,this.offset,this.format,this.dimension,this.normalize)},t}(),h8=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.vertexCount=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0},e.channels=function(t,e){var i=this.bb.__offset(this.bb_pos,6);return i?(e||new h5).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.channelsLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.unpack=function(){return new h9(this.vertexCount(),this.bb.createObjList(this.channels.bind(this),this.channelsLength()))},e.unpackTo=function(t){t.vertexCount=this.vertexCount(),t.channels=this.bb.createObjList(this.channels.bind(this),this.channelsLength())},t.getRootAsFBVertexData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBVertexData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBVertexData=function(t){t.startObject(2)},t.addVertexCount=function(t,e){t.addFieldInt32(0,e,0)},t.addChannels=function(t,e){t.addFieldOffset(1,e,0)},t.createChannelsVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startChannelsVector=function(t,e){t.startVector(4,e,4)},t.endFBVertexData=function(t){return t.endObject()},t.createFBVertexData=function(e,i,r){return t.startFBVertexData(e),t.addVertexCount(e,i),t.addChannels(e,r),t.endFBVertexData(e)},t}(),h9=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=[]),this.vertexCount=t,this.channels=e}return t.prototype.pack=function(t){var e=h8.createChannelsVector(t,t.createObjectOffsetList(this.channels));return h8.createFBVertexData(t,this.vertexCount,e)},t}(),h7=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.id=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.name=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.vertexData=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?(t||new h8).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},e.indexFormat=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.indexOffset=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):0},e.subMeshes=function(t,e){var i=this.bb.__offset(this.bb_pos,14);return i?(e||new h3).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.subMeshesLength=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0},e.mode=function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):0},e.buffer=function(t){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null},e.binaryData=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.binaryDataLength=function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0},e.binaryDataArray=function(){var t=this.bb.__offset(this.bb_pos,20);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.boneNames=function(t,e){var i=this.bb.__offset(this.bb_pos,22);return i?this.bb.__string(this.bb.__vector(this.bb_pos+i)+4*t,e):null},e.boneNamesLength=function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0},e.rootBoneName=function(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null},e.inverseBindMatrices=function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},e.inverseBindMatricesLength=function(){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0},e.inverseBindMatricesArray=function(){var t=this.bb.__offset(this.bb_pos,26);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.unpack=function(){return new lt(this.id(),this.name(),null!==this.vertexData()?this.vertexData().unpack():null,this.indexFormat(),this.indexOffset(),this.bb.createObjList(this.subMeshes.bind(this),this.subMeshesLength()),this.mode(),this.buffer(),this.bb.createScalarList(this.binaryData.bind(this),this.binaryDataLength()),this.bb.createScalarList(this.boneNames.bind(this),this.boneNamesLength()),this.rootBoneName(),this.bb.createScalarList(this.inverseBindMatrices.bind(this),this.inverseBindMatricesLength()))},e.unpackTo=function(t){t.id=this.id(),t.name=this.name(),t.vertexData=null!==this.vertexData()?this.vertexData().unpack():null,t.indexFormat=this.indexFormat(),t.indexOffset=this.indexOffset(),t.subMeshes=this.bb.createObjList(this.subMeshes.bind(this),this.subMeshesLength()),t.mode=this.mode(),t.buffer=this.buffer(),t.binaryData=this.bb.createScalarList(this.binaryData.bind(this),this.binaryDataLength()),t.boneNames=this.bb.createScalarList(this.boneNames.bind(this),this.boneNamesLength()),t.rootBoneName=this.rootBoneName(),t.inverseBindMatrices=this.bb.createScalarList(this.inverseBindMatrices.bind(this),this.inverseBindMatricesLength())},t.getRootAsFBGeometryData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBGeometryData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBGeometryData=function(t){t.startObject(12)},t.addId=function(t,e){t.addFieldOffset(0,e,0)},t.addName=function(t,e){t.addFieldOffset(1,e,0)},t.addVertexData=function(t,e){t.addFieldOffset(2,e,0)},t.addIndexFormat=function(t,e){t.addFieldInt32(3,e,0)},t.addIndexOffset=function(t,e){t.addFieldInt32(4,e,0)},t.addSubMeshes=function(t,e){t.addFieldOffset(5,e,0)},t.createSubMeshesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startSubMeshesVector=function(t,e){t.startVector(4,e,4)},t.addMode=function(t,e){t.addFieldInt32(6,e,0)},t.addBuffer=function(t,e){t.addFieldOffset(7,e,0)},t.addBinaryData=function(t,e){t.addFieldOffset(8,e,0)},t.createBinaryDataVector=function(t,e){t.startVector(1,e.length,1);for(var i=e.length-1;i>=0;i--)t.addInt8(e[i]);return t.endVector()},t.startBinaryDataVector=function(t,e){t.startVector(1,e,1)},t.addBoneNames=function(t,e){t.addFieldOffset(9,e,0)},t.createBoneNamesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startBoneNamesVector=function(t,e){t.startVector(4,e,4)},t.addRootBoneName=function(t,e){t.addFieldOffset(10,e,0)},t.addInverseBindMatrices=function(t,e){t.addFieldOffset(11,e,0)},t.createInverseBindMatricesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addFloat32(e[i]);return t.endVector()},t.startInverseBindMatricesVector=function(t,e){t.startVector(4,e,4)},t.endFBGeometryData=function(t){return t.endObject()},t}(),lt=function(){function t(t,e,i,r,n,a,o,s,u,h,l,c){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=[]),void 0===o&&(o=0),void 0===s&&(s=null),void 0===u&&(u=[]),void 0===h&&(h=[]),void 0===l&&(l=null),void 0===c&&(c=[]),this.id=t,this.name=e,this.vertexData=i,this.indexFormat=r,this.indexOffset=n,this.subMeshes=a,this.mode=o,this.buffer=s,this.binaryData=u,this.boneNames=h,this.rootBoneName=l,this.inverseBindMatrices=c}return t.prototype.pack=function(t){var e=null!==this.id?t.createString(this.id):0,i=null!==this.name?t.createString(this.name):0,r=null!==this.vertexData?this.vertexData.pack(t):0,n=h7.createSubMeshesVector(t,t.createObjectOffsetList(this.subMeshes)),a=null!==this.buffer?t.createString(this.buffer):0,o=h7.createBinaryDataVector(t,this.binaryData),s=h7.createBoneNamesVector(t,t.createObjectOffsetList(this.boneNames)),u=null!==this.rootBoneName?t.createString(this.rootBoneName):0,h=h7.createInverseBindMatricesVector(t,this.inverseBindMatrices);return h7.startFBGeometryData(t),h7.addId(t,e),h7.addName(t,i),h7.addVertexData(t,r),h7.addIndexFormat(t,this.indexFormat),h7.addIndexOffset(t,this.indexOffset),h7.addSubMeshes(t,n),h7.addMode(t,this.mode),h7.addBuffer(t,a),h7.addBinaryData(t,o),h7.addBoneNames(t,s),h7.addRootBoneName(t,u),h7.addInverseBindMatrices(t,h),h7.endFBGeometryData(t)},t}(),le=function(){function t(){this.exportObjectDatas=[]}var e=t.prototype;return e.addData=function(t){this.exportObjectDatas.push(t)},e.serializeToBinary=function(){for(var t,e=new hJ(1),i=new h2,r=[],n=ij(this.exportObjectDatas);!(t=n()).done;){var a=t.value,o=void 0;a.dataType===em.Geometry&&(o=new h0("Geometry",this.geometryDataToBinary(a))),o&&r.push(o)}return i.exportObjects=r,h1.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.deserializeFromBinary=function(t){for(var e=new hQ(t),i=h1.getRootAsFBEffectsPackageData(e),r=0;r<i.exportObjectsLength();r++){var n=i.exportObjects(r);if(n){var a=n.dataArray(),o=n.dataType();if(a){var s=void 0;o===em.Geometry&&(s=this.binaryToGeometryData(a)),s&&this.exportObjectDatas.push(s)}}}},e.geometryDataToBinary=function(t){var e=new hJ(1),i=new lt,r=t.indexFormat,n=t.indexOffset,a=t.mode,o=t.id,s=t.vertexData,u=t.boneNames,h=t.rootBoneName,l=t.inverseBindMatrices,c=t.binaryData;i.indexFormat=r,i.indexOffset=n,i.mode=a,i.id=o,i.boneNames=void 0===u?[]:u,i.rootBoneName=void 0===h?"":h,i.inverseBindMatrices=void 0===l?[]:l,i.binaryData=void 0===c?[]:c;var f=new h9;f.vertexCount=s.vertexCount,f.channels=[];for(var d,p=ij(s.channels);!(d=p()).done;){var m=d.value,v=new h6(m.semantic,m.offset,m.format,m.dimension,m.normalize);f.channels.push(v)}i.vertexData=f;for(var y,g=[],x=ij(t.subMeshes);!(y=x()).done;){var b=y.value,T=new h4(b.offset,b.indexCount,b.vertexCount);g.push(T)}return i.subMeshes=g,h1.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.binaryToGeometryData=function(t){var e,i,r,n,a=new hQ(t),o=h7.getRootAsFBGeometryData(a),s={vertexCount:0,channels:[]},u=o.vertexData();if(u){s.vertexCount=u.vertexCount();for(var h=0;h<u.channelsLength();h++){var l,c=u.channels(h);if(c){var f={semantic:null!=(l=c.semantic())?l:"",offset:c.offset(),format:c.format(),dimension:c.dimension(),normalize:c.normalize()};s.channels.push(f)}}}for(var d=[],p=0;p<o.subMeshesLength();p++){var m=o.subMeshes(p);if(m){var v={offset:m.offset(),vertexCount:m.vertexCount(),indexCount:m.indexCount()};d.push(v)}}for(var y=[],g=0;g<o.boneNamesLength();g++){var x=o.boneNames(g);y.push(x)}var b=o.inverseBindMatricesArray();return{vertexData:s,indexFormat:o.indexFormat(),indexOffset:o.indexOffset(),subMeshes:d,mode:o.mode(),buffer:null!=(e=o.buffer())?e:"",boneNames:y,rootBoneName:null!=(i=o.rootBoneName())?i:"",inverseBindMatrices:b?Array.from(b):void 0,binaryData:null!=(r=o.binaryDataArray())?r:void 0,id:null!=(n=o.id())?n:"",dataType:em.Geometry}},t}(),li=function(){function t(t){void 0===t&&(t=60),this.paused=!0,this.lastTime=0,this.dt=0,this.setFPS(t),this.tickers=[]}var e=t.prototype;return e.getFPS=function(){return this.targetFPS},e.setFPS=function(t){this.targetFPS=e1(t,1,120),this.interval=Math.floor(1e3/t)-2},e.getPaused=function(){return this.paused},e.start=function(){var t=this;if(this.paused=!1,this.dt=0,!this.intervalId){this.lastTime=performance.now();var e=requestAnimationFrame||function(t){return window.setTimeout(t,16.7)},i=function(){t.intervalId=e(i),t.paused||t.tick()};i()}},e.stop=function(){(cancelAnimationFrame||window.clearTimeout)(this.intervalId),this.intervalId=0,this.lastTime=0,this.paused=!0,this.dt=0,this.tickers=[]},e.pause=function(){this.paused=!0,this.dt=0},e.resume=function(){this.paused=!1,this.dt=0},e.tick=function(){if(!this.paused){var t=performance.now();if(this.dt=t-this.lastTime,this.dt>=this.interval){this.lastTime=t,this.resetTickers&&(this.tickers=this.tickers.filter(function(t){return t}),this.resetTickers=!1);for(var e,i=ij(this.tickers);!(e=i()).done;)(0,e.value)(this.dt)}}},e.add=function(t){if("function"!=typeof t)throw Error("The tick object must implement the tick method.");this.tickers.push(t)},rI(t,[{key:"deltaTime",get:function(){return this.dt}}]),t}(),lr=function(e){function i(i,r){var n,a,o,s,u,h,l;return(n=e.call(this)||this).name="NewEngine",n.speed=1,n.displayScale=1,n.offscreenMode=!1,n.renderErrors=new Set,n.compositions=[],n.assetManagers=[],n.env="",n.ticker=null,n.doNotHandleContextLost=!0,n.contextWasLost=!1,n._disposed=!1,n.textures=[],n.materials=[],n.geometries=[],n.meshes=[],n.renderPasses=[],n.framebuffers=[],n.renderbuffers=[],n.clearAction={stencilAction:t.TextureLoadAction.clear,clearStencil:0,depthAction:t.TextureLoadAction.clear,clearDepth:1,colorAction:t.TextureLoadAction.clear,clearColor:[0,0,0,0]},n.canvas=i,n.env=null!=(a=null==r?void 0:r.env)?a:"",n.doNotHandleContextLost=null==(o=null==r?void 0:r.doNotHandleContextLost)||o,n.name=null!=(s=null==r?void 0:r.name)?s:n.name,n.pixelRatio=null!=(u=null==r?void 0:r.pixelRatio)?u:ie(),n.jsonSceneData={},n.objectInstance={},n.whiteTexture=ni(hB(n)),n.transparentTexture=nr(hB(n)),(null==r?void 0:r.manualRender)||(n.ticker=new li(null==r?void 0:r.fps),n.runRenderLoop(n.mainLoop.bind(hB(n)))),n.eventSystem=new ok(hB(n),null!=(h=null==r?void 0:r.notifyTouch)&&h),n.eventSystem.enabled=null!=(l=null==r?void 0:r.interactive)&&l,n.eventSystem.bindListeners(n.canvas),n.assetLoader=new uH(hB(n)),n.assetService=new hk(hB(n)),n.renderTargetPool=new ol(hB(n)),n.graphics=new oC(hB(n)),n.renderingData={currentFrame:{}},iV.notifyEngineCreated(hB(n)),n}iB(i,e);var r=i.prototype;return r.clearResources=function(){this.jsonSceneData={},this.objectInstance={}},r.addEffectsObjectData=function(t){this.jsonSceneData[t.id]=t},r.findEffectsObjectData=function(t){return this.jsonSceneData[t]},r.addInstance=function(t){this.objectInstance[t.getInstanceId()]=t},r.findObject=function(t){return iw(t)?this.objectInstance[t.id]?this.objectInstance[t.id]:this.assetLoader.loadGUID(t):t},r.removeInstance=function(t){delete this.objectInstance[t]},r.addPackageDatas=function(t){for(var e,i=t.jsonScene,r=t.textureOptions,n=i.items,a=i.materials,o=i.shaders,s=i.geometries,u=i.components,h=i.animations,l=i.bins,c=void 0===l?[]:l,f=i.miscs,d=i.compositions,p=ij(d);!(e=p()).done;){var m=e.value;this.addEffectsObjectData(m)}for(var v,y=ij(void 0===n?[]:n);!(v=y()).done;){var g=v.value;hP(g.renderLevel,t.renderLevel)||(g.components=[],g.type=tH.null),this.addEffectsObjectData(g)}for(var x,b=ij(void 0===a?[]:a);!(x=b()).done;){var T=x.value;this.addEffectsObjectData(T)}for(var C,E=ij(void 0===o?[]:o);!(C=E()).done;){var _=C.value;this.addEffectsObjectData(_)}for(var w,S=ij(void 0===s?[]:s);!(w=S()).done;){var M=w.value;this.addEffectsObjectData(M)}for(var A,P=ij(void 0===u?[]:u);!(A=P()).done;){var R=A.value;this.addEffectsObjectData(R)}for(var I,O=ij(void 0===h?[]:h);!(I=O()).done;){var L=I.value;this.addEffectsObjectData(L)}for(var F,V=ij(void 0===f?[]:f);!(F=V()).done;){var N=F.value;this.addEffectsObjectData(N)}for(var k=0;k<c.length;k++){var D=c[k],z=t.bins[k];if(D.dataType===em.BinaryAsset)D.buffer=z,D.id&&this.addEffectsObjectData(D);else{var B=new le;B.deserializeFromBinary(new Uint8Array(z));for(var U,G=ij(B.exportObjectDatas);!(U=G()).done;){var W=U.value;this.addEffectsObjectData(W)}}}for(var j,X=ij(void 0===r?[]:r);!(j=X()).done;){var H=j.value;this.addEffectsObjectData(H)}},r.runRenderLoop=function(t){var e;null==(e=this.ticker)||e.add(t)},r.mainLoop=function(t){if(!this.contextWasLost){var e=this.renderErrors;if(e.size>0){this.emit("rendererror",e.values().next().value),null==(r=this.ticker)||r.pause();return}t=Math.min(t,33)*this.speed;var i=this.compositions;i.sort(function(t,e){return t.getIndex()-e.getIndex()});for(var r,n,a=!1,o=ij(i);!(n=o()).done;){var s=n.value;if(s.textureOffloaded){a=!0,ix.error("Composition "+s.name+" texture offloaded, skip render.");continue}s.update(t)}if(a){this.emit("rendererror",Error("Play when texture offloaded.")),null==(u=this.ticker)||u.pause();return}for(var u,h,l=ij(i);!(h=l()).done;)h.value.sceneTicking.preRender.tick(0);this.renderer.setFramebuffer(null),this.renderer.clear(this.clearAction);for(var c,f=ij(i);!(c=f()).done;)c.value.render();this.renderTargetPool.flush()}},r.resize=function(){var t,e,i,r,n=this.canvas.parentElement;if(n){var a=this.getTargetSize(n);t=a[0],e=a[1],i=a[2],r=a[3]}else t=i=this.canvas.width,e=r=this.canvas.height;var o=t/e;if(t&&e){var s=document.documentElement.clientWidth;i>2*s&&ix.error("DPI overflowed, width "+i+" is more than 2x document width "+s+", see "+nS["DPI overflowed"]+".");var u=this.env?this.gpuCapability.detail.maxTextureSize:2048;(i>u||r>u)&&(ix.error("Container size overflowed "+i+"x"+r+", see "+nS["Container size overflowed"]+"."),o>1?(i=Math.round(u),r=Math.round(u/o)):(r=Math.round(u),i=Math.round(u*o))),this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",ix.info("Resize engine "+this.name+" ["+i+","+r+","+t+","+e+"]."),this.setSize(i,r)}},r.setSize=function(t,e){var i;(this.getWidth()!==t||this.getHeight()!==e)&&(this.canvas.width=t,this.canvas.height=e,this.viewport(0,0,t,e)),null==(i=this.compositions)||i.forEach(function(i){i.camera.aspect=t/e}),this.emit("resize",this)},r.getTargetSize=function(t){if(null==t)throw Error("Container is not an HTMLElement, see "+nS["Container is not an HTMLElement"]+".");var e,i,r=this.displayAspect,n=null==window.getComputedStyle?void 0:window.getComputedStyle.call(window,t),a=0,o=0;n?(a=parseInt(n.width,10),o=parseInt(n.height,10)):(a=t.clientWidth,o=t.clientHeight),r?a/o>r?e=(i=o*this.displayScale)*r:i=(e=a*this.displayScale)/r:(e=a,i=o);var s=this.pixelRatio,u=e,h=i;if(e=Math.round(e*s),i=Math.round(i*s),e<1||i<1){if(this.offscreenMode)e=i=u=h=1;else throw Error("Invalid container size "+e+"x"+i+", see "+nS["Invalid container size"]+".")}return[u,h,e,i]},r.addTexture=function(t){this.disposed||eZ(this.textures,t)},r.removeTexture=function(t){this.disposed||eq(this.textures,t)},r.addMaterial=function(t){this.disposed||eZ(this.materials,t)},r.removeMaterial=function(t){this.disposed||eq(this.materials,t)},r.addGeometry=function(t){this.disposed||eZ(this.geometries,t)},r.removeGeometry=function(t){this.disposed||eq(this.geometries,t)},r.addMesh=function(t){this.disposed||eZ(this.meshes,t)},r.removeMesh=function(t){this.disposed||eq(this.meshes,t)},r.addRenderPass=function(t){this.disposed||eZ(this.renderPasses,t)},r.removeRenderPass=function(t){this.disposed||eq(this.renderPasses,t)},r.addFramebuffer=function(t){this.disposed||eZ(this.framebuffers,t)},r.removeFramebuffer=function(t){this.disposed||eq(this.framebuffers,t)},r.addRenderbuffer=function(t){this.disposed||eZ(this.renderbuffers,t)},r.removeRenderbuffer=function(t){this.disposed||eq(this.renderbuffers,t)},r.addComposition=function(t){this.disposed||eZ(this.compositions,t)},r.removeComposition=function(t){this.disposed||eq(this.compositions,t)},r.getWidth=function(){return 0},r.getHeight=function(){return 0},r.getShaderLibrary=function(){return null},r.bindSystemFramebuffer=function(){},r.viewport=function(t,e,i,r){},r.clear=function(t){},r.drawGeometry=function(t,e,i,r){},r.setSampleAlphaToCoverage=function(t){},r.setBlending=function(t){},r.setDepthTest=function(t){},r.setStencilTest=function(t){},r.setCulling=function(t){},r.setPolygonOffsetFill=function(t){},r.blendColor=function(t,e,i,r){},r.blendFuncSeparate=function(t,e,i,r){},r.blendEquationSeparate=function(t,e){},r.colorMask=function(t,e,i,r){},r.depthMask=function(t){},r.depthFunc=function(t){},r.depthRange=function(t,e){},r.polygonOffset=function(t,e){},r.cullFace=function(t){},r.frontFace=function(t){},r.stencilMaskSeparate=function(t,e){},r.stencilFuncSeparate=function(t,e,i,r){},r.stencilOpSeparate=function(t,e,i,r){},r.dispose=function(){if(!this.disposed){this._disposed=!0,iV.notifyEngineDestroy(this);var t,e,i,r=[];this.renderPasses.length>0&&r.push("Pass "+this.renderPasses.length),this.meshes.length>0&&r.push("Mesh "+this.meshes.length),this.geometries.length>0&&r.push("Geom "+this.geometries.length),this.textures.length>0&&r.push("Tex "+this.textures.length),r.length>0&&ix.warn("Release GPU memory: "+r.join(", ")+"."),null==(t=this.ticker)||t.stop(),null==(e=this.eventSystem)||e.dispose(),null==(i=this.assetService)||i.dispose(),this.graphics.dispose(),this.renderPasses.forEach(function(t){return t.dispose()}),this.meshes.forEach(function(t){return t.dispose()}),this.geometries.forEach(function(t){return t.dispose()}),this.materials.forEach(function(t){return t.dispose()}),this.textures.forEach(function(t){return t.dispose()}),this.assetManagers.forEach(function(t){return t.dispose()}),this.compositions.forEach(function(t){return t.dispose()}),this.textures=[],this.materials=[],this.geometries=[],this.meshes=[],this.renderPasses=[],this.compositions=[]}},rI(i,[{key:"disposed",get:function(){return this._disposed}}]),i}(nM),ln={format:rV.RGBA,type:rV.UNSIGNED_BYTE,minFilter:rV.LINEAR,magFilter:rV.LINEAR,wrapS:rV.CLAMP_TO_EDGE,wrapT:rV.CLAMP_TO_EDGE},la=Symbol("dispose"),lo=function(){function e(t){this.textureCache={},this.textureRef={},this.engine=t}var i=e.prototype;return i.requestColorAttachmentTexture=function(e){var i=this,r=e.width,n=e.height,a=e.name,o={sourceType:t.TextureSourceType.framebuffer,data:{width:r,height:n},name:a},s=[a];Object.getOwnPropertyNames(ln).forEach(function(t){var i,r=null!=(i=e[t])?i:ln[t];o[t]=r,s.push(t,r)});var u=s.join(":"),h=this.textureCache[u];if(h)this.textureRef[u]++;else{var l=this.engine;im(l),h=r7.create(l,o),this.textureCache[u]=h,this.textureRef[u]=1,h[la]=h.dispose,h.dispose=function(){return i.removeTexture(u)}}return h},i.removeTexture=function(t){var e=this.textureRef[t];if(e<=1){e<0&&console.error("Ref count < 0.");var i=this.textureCache[t];i&&(i[la](),i.dispose=i[la]),delete this.textureCache[t],delete this.textureRef[t]}else this.textureRef[t]=e-1},i.dispose=function(){var t=this;Object.keys(this.textureCache).forEach(function(e){var i=t.textureCache[e];i[la](),i.dispose=i[la]}),this.textureCache={},this.textureRef={},this.engine=void 0},e}(),ls=function(){function t(){}return t.load=function(t,e,i){void 0===i&&(i={});var r=this;return eB(function(){var n,a,o,s,u,h,l,c,f,d,p,m,v;return eW(this,function(y){switch(y.label){case 0:return s=performance.now(),u=null==(a=e.gpuCapability)?void 0:null==(n=a.detail)?void 0:n.asyncShaderCompile,h=e.compositions.length,l=new hV(i),e.assetManagers.push(l),[4,l.loadScene(t,e.renderer)];case 1:return c=y.sent(),e.clearResources(),iV.notifyAssetsLoadFinish(c,l.options,e),e.assetService.prepareAssets(c,c.assets),e.assetService.updateTextVariables(c,i.variables),(f=r.createComposition(c,e,i)).setIndex(h),d=performance.now(),[4,new Promise(function(t){var i;null==(i=e.getShaderLibrary())||i.compileAllShaders(function(){return t(null)})})];case 2:return y.sent(),p=performance.now()-d,null==(o=e.ticker)||o.start(),m=f.name,v=performance.now()-s,f.statistic.compileTime=p,f.statistic.firstFrameTime=v,ix.info("First frame ["+m+"]: "+v.toFixed(4)+"ms."),ix.info("Shader "+(u?"async":"sync")+" compile ["+m+"]: "+p.toFixed(4)+"ms."),[2,f]}})})()},t.createComposition=function(t,e,i){void 0===i&&(i={});var r=new hH(e,i7({},i,{event:e.eventSystem}),t);return e.env!==nw&&e.assetService.createShaderVariant(),r},t}(),lu=function(){function e(){}return e.instantiate=function(e,i){var r,n=e.scene,a=e.scene.jsonScene,o=e.options,s=i.engine;s.clearResources(),iV.notifyAssetsLoadFinish(n,o,s),s.assetService.prepareAssets(n,n.assets),s.assetService.updateTextVariables(n,o.variables),i.createTexturesFromData(n.textureOptions);for(var u,h=ij(Object.keys(n.assets));!(u=h()).done;){var l=u.value,c=n.assets[l];eU(c,HTMLVideoElement)&&i.videos.push(c)}var f=a.compositionId,d=a.compositions.find(function(t){return t.id===f});if(!d)throw Error('Composition with id "'+f+'" not found in JSONScene.');var p=new t.VFXItem(s);return p.instantiatePreComposition(d),p.getComponent(t.CompositionComponent).playOnStart=null==(r=o.autoplay)||r,p.getComponent(t.CompositionComponent).endBehavior=0,i.addItem(p),p},e}();iF("camera",oO),iF("text",uE),iF("sprite",oW),iF("particle",up),iF("interact",oz),ix.info("Core version: 2.10.0-alpha.1.");var lh=((eF={})[rV.ONE]=eD.OneFactor,eF[rV.ZERO]=eD.ZeroFactor,eF[rV.SRC_COLOR]=eD.SrcColorFactor,eF[rV.SRC_ALPHA]=eD.SrcAlphaFactor,eF[rV.ONE_MINUS_SRC_COLOR]=eD.OneMinusSrcColorFactor,eF[rV.ONE_MINUS_SRC_ALPHA]=eD.OneMinusSrcAlphaFactor,eF[rV.DST_COLOR]=eD.DstColorFactor,eF[rV.DST_ALPHA]=eD.DstAlphaFactor,eF[rV.ONE_MINUS_DST_COLOR]=eD.OneMinusDstColorFactor,eF[rV.ONE_MINUS_DST_ALPHA]=eD.OneMinusDstAlphaFactor,eF),ll=((eV={})[rV.NEVER]=eD.NeverStencilFunc,eV[rV.EQUAL]=eD.EqualStencilFunc,eV[rV.LESS]=eD.LessStencilFunc,eV[rV.LEQUAL]=eD.LessEqualStencilFunc,eV[rV.ALWAYS]=eD.AlwaysStencilFunc,eV[rV.NOTEQUAL]=eD.NotEqualStencilFunc,eV[rV.GREATER]=eD.GreaterStencilFunc,eV[rV.GEQUAL]=eD.GreaterEqualStencilFunc,eV),lc=((eN={})[rV.KEEP]=eD.KeepStencilOp,eN[rV.ZERO]=eD.ZeroStencilOp,eN[rV.REPLACE]=eD.ReplaceStencilOp,eN[rV.INCR]=eD.IncrementStencilOp,eN[rV.DECR]=eD.DecrementStencilOp,eN[rV.INCR_WRAP]=eD.IncrementWrapStencilOp,eN[rV.DECR_WRAP]=eD.IncrementWrapStencilOp,eN[rV.INVERT]=eD.InvertStencilOp,eN),lf=((ek={})[rV.NEVER]=eD.NeverDepth,ek[rV.ALWAYS]=eD.AlwaysDepth,ek[rV.EQUAL]=eD.EqualDepth,ek[rV.LESS]=eD.LessDepth,ek[rV.LEQUAL]=eD.LessEqualDepth,ek[rV.GREATER]=eD.GreaterDepth,ek[rV.GEQUAL]=eD.GreaterEqualDepth,ek[rV.NOTEQUAL]=eD.NotEqualDepth,ek),ld=["uMaskTex","_MainTex","uColorOverLifetime","uColorOverTrail"],lp=function(e){function i(i,r){(n=e.call(this,i,r)||this).textures={},n.material=new eD.RawShaderMaterial,n.threeUniforms={},n.macrosDirty=!0;var n,a,o,s,u,h,l,c=null==r?void 0:r.shader,f=null!=(o=null==(a=i.gpuCapability)?void 0:a.level)?o:1;return n.shader=new t.Shader(i),n.shader.shaderData=i7({},c,{id:iP(),dataType:em.Shader,vertex:null!=(s=null==c?void 0:c.vertex)?s:"",fragment:null!=(u=null==c?void 0:c.fragment)?u:""}),n.threeUniforms._MainTex=new eD.Uniform(null),n.threeUniforms.effects_ObjectToWorld=new eD.Uniform(new eD.Matrix4().identity()),n.threeUniforms.effects_MatrixInvV=new eD.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,8,1]),n.threeUniforms.effects_MatrixVP=new eD.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-8,1]),n.threeUniforms.effects_MatrixV=new eD.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,8,1]),n.material=new eD.RawShaderMaterial({vertexShader:oi.genFinalShaderCode({level:f,shaderType:t.ShaderType.vertex,shader:null!=(h=null==c?void 0:c.vertex)?h:"",macros:null==c?void 0:c.macros,removeVersion:!0}),fragmentShader:oi.genFinalShaderCode({level:f,shaderType:t.ShaderType.fragment,shader:null!=(l=null==c?void 0:c.fragment)?l:"",macros:null==c?void 0:c.macros,removeVersion:!0}),alphaToCoverage:!1,depthFunc:eD.LessDepth,polygonOffsetFactor:eD.ZeroFactor,polygonOffsetUnits:eD.ZeroFactor,polygonOffset:!1,uniforms:n.threeUniforms}),1===f?n.material.glslVersion=eD.GLSL1:n.material.glslVersion=eD.GLSL3,n}iB(i,e);var r=i.prototype;return r.onSetUniformValue=function(t,e){var i;ld.includes(t)&&(i=e.texture),this.material.uniforms[t]?this.material.uniforms[t].value=i||e:this.material.uniforms[t]=new eD.Uniform(i||e)},r.use=function(t,e){var i=this.engine,r=i.composition,n=i.threeCamera;if(n){var a=new eD.Matrix4().multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse);this.setMatrix("effects_MatrixVP",a)}else{var o=r.camera;this.setMatrix("effects_MatrixVP",o.getViewProjectionMatrix()),this.setMatrix("effects_MatrixV",o.getViewMatrix())}},r.onRemoveUniformValue=function(t){this.material.uniforms[t]&&(this.material.uniforms[t].value=null)},r.getTexture=function(t){return this.textures[t]},r.setTexture=function(t,e){this.setUniform(t,e.texture),this.textures[t]=e},r.getVector4Array=function(t){return this.threeUniforms[t].value},r.setVector4Array=function(t,e){for(var i,r=[],n=ij(e);!(i=n()).done;){var a=i.value;r=r.concat(a.toArray())}this.setUniform(t,r)},r.getMatrixArray=function(t){return this.threeUniforms[t].value},r.setMatrixArray=function(t,e){for(var i,r=[],n=ij(e);!(i=n()).done;){var a=i.value;r=r.concat(a.elements)}this.setUniform(t,r)},r.setMatrixNumberArray=function(t,e){this.setUniform(t,e)},r.getMatrix=function(t){return this.threeUniforms[t].value},r.setMatrix=function(t,e){this.setUniform(t,e)},r.setMatrix3=function(t,e){this.setUniform(t,e)},r.getVector2=function(t){return this.threeUniforms[t].value},r.setVector2=function(t,e){this.setUniform(t,e)},r.getVector3=function(t){return this.threeUniforms[t].value},r.setVector3=function(t,e){this.setUniform(t,e)},r.getVector4=function(t){return this.threeUniforms[t].value},r.setVector4=function(t,e){this.setUniform(t,e)},r.getColor=function(t){var e=this.threeUniforms[t].value;return new e5(e.x,e.y,e.z,e.w)},r.setColor=function(t,e){this.setUniform(t,new eD.Vector4(e.r,e.g,e.b,e.a))},r.getQuaternion=function(t){return this.threeUniforms[t].value},r.setQuaternion=function(t,e){this.setUniform(t,e)},r.getFloat=function(t){return this.threeUniforms[t].value},r.setFloat=function(t,e){this.setUniform(t,e)},r.getFloats=function(t){return this.threeUniforms[t].value},r.setFloats=function(t,e){this.setUniform(t,e)},r.getInt=function(t){return this.threeUniforms[t].value},r.setInt=function(t,e){this.setUniform(t,e)},r.hasUniform=function(t){return!!this.threeUniforms[t]},r.setUniform=function(t,e){var i=new eD.Uniform(e);this.threeUniforms[t]=this.material.uniforms[t]=i},r.enableMacro=function(t,e){this.isMacroEnabled(t)&&this.enabledMacros[t]===e||(this.enabledMacros[t]=null==e||e,this.macrosDirty=!0)},r.disableMacro=function(t){this.isMacroEnabled(t)&&(delete this.enabledMacros[t],this.macrosDirty=!0)},r.isMacroEnabled=function(t){return void 0!==this.enabledMacros[t]},r.clone=function(t){throw Error("Method not implemented.")},r.cloneUniforms=function(t){throw Error("Method not implemented.")},r.fromData=function(t){throw Error("Method not implemented.")},r.dispose=function(){this.destroyed||(this.material.dispose(),this.destroyed=!0,e.prototype.dispose.call(this))},rI(i,[{key:"blending",get:function(){return this.material.blending!==eD.NoBlending},set:function(t){this.material.blending=t?eD.CustomBlending:eD.NoBlending}},{key:"blendFunction",get:function(){var t=this.material,e=t.blendSrc,i=t.blendDst;return[e,i,t.blendSrcAlpha||e,t.blendDstAlpha||i]},set:function(t){if(t){var e=t[0],i=t[1],r=t[2],n=t[3];this.material.blendSrc=lh[e],this.material.blendDst=lh[i],this.material.blendSrcAlpha=lh[r],this.material.blendDstAlpha=lh[n]}}},{key:"blendEquation",get:function(){var t=this.material,e=t.blendEquation;return[e,t.blendEquationAlpha||e]},set:function(t){if(t){var e=t[0],i=t[1];this.material.blendEquation=e,this.material.blendEquationAlpha=i}}},{key:"depthTest",get:function(){return this.material.depthTest},set:function(t){this.material.depthTest=!!t}},{key:"depthMask",get:function(){return this.material.depthWrite},set:function(t){this.material.depthWrite=!!t}},{key:"depthFunc",get:function(){return this.material.depthFunc},set:function(t){void 0!==t&&(this.material.depthFunc=lf[t])}},{key:"polygonOffsetFill",get:function(){return this.material.polygonOffset},set:function(t){this.material.polygonOffset=!!t}},{key:"polygonOffset",get:function(){return[this.material.polygonOffsetFactor,this.material.polygonOffsetUnits]},set:function(t){if(t){var e=t[0],i=t[1];this.material.polygonOffsetFactor=e,this.material.polygonOffsetUnits=i}}},{key:"sampleAlphaToCoverage",get:function(){return this.material.alphaToCoverage},set:function(t){this.material.alphaToCoverage=!!t}},{key:"stencilTest",get:function(){return this.material.stencilWrite},set:function(t){this.material.stencilWrite=!!t}},{key:"stencilMask",get:function(){return[this.material.stencilWriteMask,this.material.stencilWriteMask]},set:function(t){t&&(this.material.stencilWriteMask=t[0])}},{key:"stencilRef",get:function(){return[this.material.stencilRef,this.material.stencilRef]},set:function(t){t&&(this.material.stencilRef=t[0])}},{key:"stencilFunc",get:function(){return[this.material.stencilFunc,this.material.stencilFunc]},set:function(t){t&&(this.material.stencilFunc=ll[t[0]])}},{key:"stencilOpFail",get:function(){return[this.material.stencilFail,this.material.stencilZFail]},set:function(t){t&&(this.material.stencilFail=lc[t[0]])}},{key:"stencilOpZFail",get:function(){return[this.material.stencilZFail,this.material.stencilZFail]},set:function(t){t&&(this.material.stencilZFail=lc[t[0]])}},{key:"stencilOpZPass",get:function(){return[this.material.stencilZPass,this.material.stencilZPass]},set:function(t){t&&(this.material.stencilZPass=lc[t[0]])}},{key:"culling",get:function(){return this.material.side!==eD.DoubleSide},set:function(t){this.material.side=t?eD.FrontSide:eD.DoubleSide}},{key:"cullFace",get:function(){return this.material.side},set:function(t){t===tB.FRONT?this.material.side=eD.FrontSide:t===tB.BACK&&(this.material.side=eD.BackSide)}},{key:"colorMask",get:function(){return this.material.colorWrite},set:function(t){this.material.colorWrite=t}}]),i}(ng);function lm(t,e){return e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:hB(t)}var lv=1,ly=function(t){function e(e,i){if((r=t.call(this,e)||this).attributes={},r.destroyed=!1,r.attributesName=[],!i)return lm(r);var r,n=i.drawStart,a=i.drawCount,o=i.indices,s=i.mode,u=i.name,h=void 0===u?"effectsGeometry:"+lv++:u;r.name=h,r.mode=null!=s?s:rV.TRIANGLES;var l=[],c={},f=new eD.BufferGeometry;return Object.keys(i.attributes).forEach(function(t){var e=i.attributes[t];if("dataSource"in e){var n=e.dataSource;if(n){void 0===c[n]&&r.setAttributeType(n,e,f,c,i.maxVertex);var a=e.size,o=e.offset,s=e.normalize,u=c[n],h=u.buffer,d=u.dataLength,p=new eD.InterleavedBufferAttribute(h,a,(null!=o?o:0)/d,s);f.setAttribute(t,p),c[t]={buffer:h,attribute:p,type:u.type,dataLength:d}}}else r.setAttributeType(t,e,f,c,i.maxVertex);l.push(t)}),o&&o.data&&f.setIndex(new eD.BufferAttribute(o.data,1)),r.geometry=f,r.attributes=c,r.attributesName=l,r.drawStart=void 0===n?0:n,r.drawCount=null!=a?a:0,r}iB(e,t);var i=e.prototype;return i.getAttributeData=function(t){if(void 0!=this.attributes[t])return this.attributes[t].buffer.array},i.setAttributeData=function(t,e){if(void 0!=this.attributes[t]){var i=this.attributes[t].buffer;if(e.length>i.array.length){var r=new eD.InterleavedBuffer(e,i.stride);i=this.attributes[t].attribute.data=r,this.attributes[t].buffer=r,this.geometry.setAttribute(t,this.attributes[t].attribute)}else i.set(e,0),i.updateRange.count=e.length,i.updateRange.offset=0;this.geometry.attributes[t].needsUpdate=!0}},i.setAttributeSubData=function(t,e,i){void 0!=this.attributes[t]&&(this.attributes[t].buffer.set(i,e),this.geometry.attributes[t].needsUpdate=!0)},i.getAttributeStride=function(t){var e=this.attributes[t];return e.buffer.stride*aq[e.type]},i.getAttributeNames=function(){return this.attributesName},i.getIndexData=function(){var t=this.geometry.getIndex();return null===t?void 0:t.array},i.setIndexData=function(t){t&&(this.geometry.setIndex(new eD.BufferAttribute(t,1)),this.geometry.index.needsUpdate=!0)},i.setIndexSubData=function(t,e){var i=this.geometry.getIndex();if(null!==i){var r=t+e.length;if(i.count<r){var n=new e.constructor(end);n.set(i.array),i.array=n}i.array.set(e,t),this.geometry.index.needsUpdate=!0}},i.setDrawStart=function(t){this.drawStart=t},i.getDrawStart=function(){return this.drawStart},i.setDrawCount=function(t){this.drawCount=t},i.getDrawCount=function(){return this.drawCount},i.getSkinProps=function(){return{}},i.dispose=function(){this.destroyed||(this.geometry.dispose(),this.destroyed=!0,t.prototype.dispose.call(this))},i.setAttributeType=function(t,e,i,r,n){var a=e.stride,o=e.size,s=e.offset,u=e.normalize,h=e.type,l=void 0===h?rV.FLOAT:h,c=e.data;if(l&&!c&&(c=aQ(l)),c){var f=eU(c,Float32Array)?Float32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,d=(void 0===a?0:a)/f,p=(n=(null!=n?n:0)*d)||o*f;p&&0===c.length&&(c=eU(c,Float32Array)?new Float32Array(p):new Uint16Array(p));var m=new eD.InterleavedBuffer(c,d),v=new eD.InterleavedBufferAttribute(m,o,(null!=s?s:0)/f,u);i.setAttribute(t,v),r[t]={buffer:m,attribute:v,type:l,dataLength:f}}},rI(e,[{key:"drawCount",get:function(){return this.geometry.drawRange.count},set:function(t){this.geometry.drawRange.count=t}},{key:"drawStart",get:function(){return this.geometry.drawRange.start},set:function(t){this.geometry.drawRange.start=t}}]),e}(aK),lg=function(t){function e(e,i){if(!i)return lm(r);var r,n=i.material,a=i.geometry,o=i.priority;return(r=t.call(this,e,i)||this).geometry=a,r.material=n,a.mode===rV.LINES?r.mesh=new eD.LineSegments(a.geometry,n.material):r.mesh=new eD.Mesh(a.geometry,n.material),r.priority=void 0===o?0:o,r}iB(e,t);var i=e.prototype;return i.setVisible=function(t){this.mesh.visible=t},i.getVisible=function(){return this.mesh.visible},i.firstGeometry=function(){return this.geometry},i.setMaterial=function(t){this.material.dispose(),this.material=t,this.mesh.material=t.material},i.onStart=function(){t.prototype.onStart.call(this),this.engine.threeGroup.add(this.mesh)},i.restore=function(){},i.render=function(t){!this.isDestroyed&&this.getVisible()&&(this.material.setMatrix("effects_ObjectToWorld",this.worldMatrix),this.material.use(t,t.renderingData.currentFrame.globalUniforms))},i.dispose=function(e){this.destroyed||(this.mesh.clear(),this.destroyed=!0),t.prototype.dispose.call(this)},rI(e,[{key:"priority",get:function(){return this.mesh.renderOrder},set:function(t){this.mesh&&(this.mesh.renderOrder=t)}}]),e}(a$),lx=function(e){function i(i,r,n){if(void 0===n&&(n={}),a=e.call(this,i)||this,r){var a,o=r.width,s=r.height;a.texture=a.createTextureByType(i7({},n,{sourceType:t.TextureSourceType.data,data:r})),a.width=void 0===o?1:o,a.height=void 0===s?1:s}else a.texture=a.createTextureByType(n);return a.texture.needsUpdate=!0,a.source={},a}iB(i,e);var r=i.prototype;return r.updateSource=function(t){this.texture.dispose(),this.texture=this.createTextureByType(t),this.texture.needsUpdate=!0},r.assembleOptions=function(e){var r=e.target,n=void 0===r?rV.TEXTURE_2D:r;return e.sourceType||("image"in e?e.sourceType=t.TextureSourceType.image:"data"in e?e.sourceType=t.TextureSourceType.data:"video"in e?e.sourceType=t.TextureSourceType.video:e.sourceType=t.TextureSourceType.none),i7({},e,{target:n,format:eD.RGBAFormat,type:eD.UnsignedByteType,minFilter:i.toThreeJsTextureFilter(e.minFilter),magFilter:i.toThreeJsTextureFilter(e.magFilter),wrapS:i.toThreeJsTextureWrap(e.wrapS),wrapT:i.toThreeJsTextureWrap(e.wrapT)})},r.dispose=function(){this.texture.dispose(),e.prototype.dispose.call(this)},r.fromData=function(t){e.prototype.fromData.call(this,t),this.texture=this.createTextureByType(t),this.texture.needsUpdate=!0},r.createTextureByType=function(e){var i=this.assembleOptions(e),r=i.flipY,n=i.type,a=i.wrapS,o=i.wrapT,s=i.minFilter,u=i.magFilter,h=i.sourceType,l=eD.UVMapping,c=i.format,f=void 0;if(this.sourceType=h,h===t.TextureSourceType.data){var d=e.data;f=new eD.DataTexture(d.data,d.width,d.height,c,n,l,a,o,u,s),this.width=d.width,this.height=d.height}else if(h===t.TextureSourceType.image){var p=e.image;f=new eD.Texture(p,l,a,o,u,s,c,n),this.width=p.width,this.height=p.height}else if(h===t.TextureSourceType.compressed){var m=0,v=0,y=e.mipmaps.map(function(t){var e=t.data,i=t.width,r=t.height;return m=m<i?i:m,v=v<r?r:v,{data:e,width:i,height:r,colorSpace:"srgb"}});c=eD.RGBA_ASTC_4x4_Format,f=new eD.CompressedTexture(y,m,v,c,n,l,a,o,u,s),this.width=m,this.height=v}else if(h===t.TextureSourceType.video)f=new eD.VideoTexture(e.video,l,a,o,u,s,c,n);else if(h===t.TextureSourceType.framebuffer){var g=e.data;if(g){var x,b,T=null!=(x=g.width)?x:0,C=null!=(b=g.height)?b:0;f=new eD.FramebufferTexture(T,C,c),this.width=T,this.height=C}}else h===t.TextureSourceType.none&&((f=new eD.DataTexture(new Uint8Array(4).fill(255),1,1)).wrapS=eD.MirroredRepeatWrapping,f.wrapT=eD.MirroredRepeatWrapping,this.width=this.height=1);if(this.source=e,f)return f.flipY=!!r,f;throw Error("Create a texture using an unknown data type.")},i.toThreeJsTextureFilter=function(t){return t===rV.LINEAR?eD.LinearFilter:eD.NearestFilter},i.toThreeJsTextureWrap=function(t){switch(t){case rV.MIRRORED_REPEAT:return eD.MirroredRepeatWrapping;case rV.REPEAT:return eD.RepeatWrapping;default:return eD.ClampToEdgeWrapping}},i}(r7),lb=function(t){function e(e,i,r){return t.call(this,e,i,r)}return iB(e,t),e.prototype.render=function(){var t=this.renderer;this.renderFrame.renderPasses[0].meshes.length=0;for(var e,i=this.sceneRoot.getDescendants(),r=ij(i);!(e=r()).done;)for(var n,a=e.value.getComponents(n_),o=ij(a);!(n=o()).done;){var s=n.value;s.isActiveAndEnabled&&s.render(t)}},e}(hH);lb.shape={};var lT=function(t){function e(e){return t.call(this,e)}iB(e,t);var i=e.prototype;return i.getWidth=function(){return this.engine.canvas.width},i.getHeight=function(){return this.engine.canvas.height},e}(op),lC=function(t){function e(e,i){var r;return(r=t.call(this,e.canvas,i)||this).renderer=new lT(hB(r)),r.gpuCapability=new of(e),r}return iB(e,t),e.prototype.setOptions=function(t){var e=t.threeCamera,i=t.threeGroup,r=t.composition;this.threeCamera=e,this.threeGroup=i,this.composition=r},e}(lr),lE=function(t){function e(e,i){(r=t.call(this)||this).compositions=[],r.env="",r.baseCompositionIndex=0;var r,n=i.width,a=i.height,o=i.camera;return r.engine=new lC(e),r.assetService=new hk(r.engine),r.width=n,r.height=a,r.camera=o,r}iB(e,t);var i=e.prototype;return i.loadScene=function(t,e){var i=this;return eB(function(){var r,n,a,o,s,u,h,l,c,f,d,p;return eW(this,function(m){switch(m.label){case 0:return im(i.renderer,"Renderer is not exist, maybe the Player has been disabled or in gl 'debug-disable' mode."),r=performance.now(),n=[],a=[],s=null==(o=null==e?void 0:e.autoplay)||o,u=i.baseCompositionIndex,iC(t)?(h=n).push.apply(h,[].concat(t)):n.push(t),[4,Promise.all(n.map(eB(function(t,r){var n,o,h,l,c,f,d;return eW(this,function(p){switch(p.label){case 0:return o=(n=i.assetService.assembleSceneLoadOptions(t,i7({autoplay:s},e))).source,[4,(l=new hV(h=n.options)).loadScene(o,i.renderer)];case 1:return c=p.sent(),(f=i.engine).clearResources(),iV.notifyAssetsLoadFinish(c,l.options,f),i.assetService.prepareAssets(c,l.getAssets()),i.assetService.updateTextVariables(c,l.options.variables),d=i.createComposition(c,h),i.baseCompositionIndex+=1,d.setIndex(u+r),a[r]=d,[2]}})})))];case 1:for(m.sent(),l=0;l<a.length;l++)s?a[l].play():a[l].pause();for(c=a.map(function(t){return t.name}),f=performance.now()-r,d=ij(a);!(p=d()).done;)p.value.statistic.firstFrameTime=f;return ix.info("First frame ["+c+"]: "+f.toFixed(4)+"ms."),[2,iC(t)?a:a[0]]}})})()},i.createComposition=function(t,e){var i=this;void 0===e&&(e={});var r=new lb(this.engine,i7({},e,{onItemMessage:function(t){i.dispatchEvent({type:"message",message:t})}}),t);return r.on("end",function(){i.dispatchEvent({type:"end",composition:r})}),this.renderer.engine.setOptions({threeCamera:this.camera,threeGroup:this,composition:r}),this.compositions.push(r),r},i.pause=function(){this.dispatchEvent({type:"pause"}),this.compositions.forEach(function(t){t.pause()})},i.resume=function(){this.dispatchEvent({type:"resume"}),this.compositions.forEach(function(t){t.resume()})},i.update=function(t){this.compositions.forEach(function(e){e.update(t),e.render()})},rI(e,[{key:"renderer",get:function(){return this.engine.renderer}},{key:"currentComposition",get:function(){return this.compositions[0]}}]),e}(eD.Group);t.ThreeSpriteComponent=function(t){function e(){return t.apply(this,arguments)}iB(e,t);var i=e.prototype;return i.setVisible=function(t){this.threeMesh.visible=t},i.getVisible=function(){return this.threeMesh.visible},i.dispose=function(){this.isActiveAndEnabled||this.threeMesh.clear(),t.prototype.dispose.call(this)},i.fromData=function(e){t.prototype.fromData.call(this,e),this.threeMesh||(this.geometry.mode===rV.LINES?this.threeMesh=new eD.LineSegments(this.geometry.geometry,this.material.material):this.threeMesh=new eD.Mesh(this.geometry.geometry,this.material.material))},i.onStart=function(){t.prototype.onStart.call(this),this.engine.threeGroup.add(this.threeMesh)},i.render=function(t){this.isActiveAndEnabled&&(this.material.setVector2("_Size",this.transform.size),this.material.setMatrix("effects_ObjectToWorld",this.transform.getWorldMatrix()),this.material.use(t,t.renderingData.currentFrame.globalUniforms))},i.onDestroy=function(){this.threeMesh.clear()},rI(e,[{key:"priority",get:function(){return this.threeMesh.renderOrder},set:function(t){this.threeMesh&&(this.threeMesh.renderOrder=t)}},{key:"enabled",get:function(){return this.threeMesh.visible},set:function(t){this.threeMesh.visible=t,t&&this.onEnable()}}]),e}(t.SpriteComponent),t.ThreeSpriteComponent=eG([iZ(em.SpriteComponent)],t.ThreeSpriteComponent),t.ThreeTextComponent=function(t){function e(e,i){(r=t.call(this,e,i)||this).isDirty=!0;var r,n=og.getCanvasAndContext(1,1);if(r.canvas=n.canvas,r.context=n.context,!i)return lm(r);var a=i.options;return r.updateWithOptions(a),r.updateTexture(),r}iB(e,t);var i=e.prototype;return i.onUpdate=function(e){t.prototype.onUpdate.call(this,e),this.updateTexture()},i.onDestroy=function(){t.prototype.onDestroy.call(this),this.disposeTextTexture(),this.releaseTextCanvas()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.options;this.updateWithOptions(i),this.updateTexture(),this.material.setColor("_Color",new e5(1,1,1,1))},i.updateWithOptions=function(t){},i.updateTexture=function(t){},e}(t.ThreeSpriteComponent),t.ThreeTextComponent=eG([iZ(em.TextComponent)],t.ThreeTextComponent),iI(t.ThreeTextComponent,[ub]),r7.create=function(t,e){return new lx(t,void 0,e)},r7.createWithData=function(t,e,i){return new lx(t,e,i)},ng.create=function(t,e){return new lp(t,e)},aK.create=function(t,e){return new ly(t,e)},a$.create=function(t,e){return new lg(t,e)};var l_="2.10.0-alpha.1";ix.info("THREEJS plugin version: "+l_+"."),t.ATLAS_SIZE=512,t.ActivationMixerPlayable=oJ,t.ActivationPlayable=o$,t.AndNode=rd,t.Animatable=re,t.AnimationClipNode=rt,t.AnimationEvent=oq,t.ApplyAdditiveNode=rc,t.Asset=uj,t.AssetLoader=uH,t.AssetManager=hV,t.AssetService=hk,t.BYTES_TYPE_MAP=aq,t.Behaviour=rL,t.BezierCurve=ay,t.BezierCurvePath=ao,t.BezierCurveQuat=as,t.BezierDataMap=nK,t.BezierEasing=n2,t.BezierLengthData=nZ,t.BezierMap=nq,t.BezierPath=n0,t.BezierQuat=n1,t.BlendNode=rf,t.BoolValueNode=i6,t.BoundingBoxInfo=nE,t.CONSTANT_MAP_BLEND=lh,t.CONSTANT_MAP_DEPTH=lf,t.CONSTANT_MAP_STENCIL_FUNC=ll,t.CONSTANT_MAP_STENCIL_OP=lc,t.COPY_FRAGMENT_SHADER="precision mediump float;\nvarying vec2 vTex;\n\n#ifdef DEPTH_TEXTURE\nuniform sampler2D uDepth;\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main(){\n #ifdef DEPTH_TEXTURE\n gl_FragDepthEXT = texture2D(uDepth,vTex).r;\n #endif\n}\n",t.COPY_MESH_SHADER_ID="effects-internal-copy-mesh",t.COPY_VERTEX_SHADER="\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos,0.,1.0);\n vTex = (aPos + vec2(1.0))/2.;\n}",t.Camera=hz,t.CameraVFXItemLoader=oO,t.CanvasItem=oS,t.CanvasLayer=ow,t.Circle=aD,t.ColorCurve=aC,t.ColorPlayable=oZ,t.ColorPropertyMixerPlayable=o2,t.Component=rO,t.ComponentTimePlayable=ud,t.ComponentTimePlayableAsset=uf,t.ComponentTimeTrack=uh,t.Composition=hH,t.ConstBoolNode=ry,t.ConstFloatNode=rv,t.ConstraintTarget=aW,t.Control=oP,t.ControlParameterBoolNode=rx,t.ControlParameterFloatNode=rg,t.ControlParameterTriggerNode=rb,t.DEFAULT_FONTS=["serif","sans-serif","monospace","courier"],t.DEFAULT_FPS=60,t.Database=uY,t.Deferred=function(){var t=this;this.promise=new Promise(function(e,i){t.resolve=e,t.reject=i})},t.Downloader=rG,t.DrawObjectPass=aZ,t.EFFECTS_COPY_MESH_NAME="effects-internal-copy",t.EVENT_TYPE_CLICK=oL,t.EVENT_TYPE_TOUCH_END=oN,t.EVENT_TYPE_TOUCH_MOVE=oV,t.EVENT_TYPE_TOUCH_START=oF,t.EffectComponentTimeTrack=uc,t.EffectsObject=iQ,t.EffectsPackage=le,t.Ellipse=aP,t.Engine=lr,t.EventEmitter=nM,t.EventSystem=ok,t.FONT_SCALE=2,t.Float16ArrayWrapper=nF,t.FloatComparisonNode=r_,t.FloatComparisonNodeData=rE,t.FloatPropertyMixerPlayable=o3,t.FloatValueNode=i5,t.Framebuffer=aj,t.GPUCapability=of,t.Geometry=aK,t.GlobalUniforms=ou,t.GlyphAtlas=ox,t.GradientValue=ar,t.GraphInstance=rP,t.GraphNode=i1,t.GraphNodeData=i2,t.Graphics=oC,t.HELP_LINK=nS,t.InteractLoader=oz,t.InteractMesh=oU,t.InvalidIndex=-1,t.LayerBlendNode=rT,t.LineSegments=an,t.LinearValue=ai,t.MaskProcessor=nx,t.MaskableGraphic=oE,t.Material=ng,t.MaterialDataBlock=no,t.MaterialState=nv,t.Mesh=a$,t.NodeTransform=ru,t.NotNode=rm,t.NotifyEvent=oK,t.OrNode=rp,t.PLAYER_OPTIONS_ENV_EDITOR=nw,t.POST_PROCESS_SETTINGS="post_process_settings",t.ParticleBehaviourPlayable=s2,t.ParticleBehaviourPlayableAsset=s3,t.ParticleLoader=up,t.ParticleMesh=s5,t.ParticleMixerPlayable=o4,t.ParticleSystemRenderer=s6,t.ParticleTrack=sl,t.PassTextureCache=lo,t.PathSegments=aa,t.Playable=oj,t.PlayableAsset=oH,t.PlayableOutput=oX,t.Plugin=iD,t.PluginSystem=iV,t.PointerEventData=nb,t.PolyStar=ak,t.Polygon=az,t.Pose=rh,t.PoseNode=i3,t.Precomposition=hL,t.PrecompositionManager=lu,t.PropertyClipPlayable=o0,t.PropertyTrack=sh,t.REFERENCE_CURVE=28,t.RENDER_PREFER_LOOKUP_TEXTURE=om,t.RUNTIME_ENV="runtime_env",t.RandomSetValue=n7,t.RandomValue=at,t.RandomVectorValue=ae,t.RaycastResult=nT,t.RectTransform=oA,t.Rectangle=aR,t.ReferenceCurve=ax,t.RenderFrame=oo,t.RenderPass=aY,t.RenderPassPriorityNormal=1e3,t.RenderPassPriorityPostprocess=3e3,t.RenderPassPriorityPrepare=0,t.RenderTargetHandle=aX,t.RenderTargetPool=ol,t.Renderbuffer=oh,t.Renderer=op,t.RendererComponent=n_,t.RuntimeClip=su,t.SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0="PRE_MAIN_COLOR_0",t.SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0="PRE_MAIN_COLOR_SIZE_0",t.SEMANTIC_PRE_COLOR_ATTACHMENT_0="PRE_COLOR_0",t.SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0="PRE_COLOR_SIZE_0",t.SPRITE_VERTEX_STRIDE=6,t.SceneLoader=ls,t.SerializationHelper=uX,t.ShaderFactory=oi,t.ShaderVariant=nm,t.SpriteColorMixerPlayable=o5,t.SpriteComponentTimeTrack=ul,t.SpriteLoader=oW,t.SpritePropertyMixerPlayable=o6,t.StateMachineNode=rw,t.StateNode=rS,t.StaticValue=n9,t.SubCompositionClipPlayable=o8,t.SubCompositionMixerPlayable=o9,t.TEMPLATE_USE_OFFSCREEN_CANVAS=ov,t.TEXTURE_UNIFORM_MAP=ld,t.TextCache=ob,t.TextComponentBase=ub,t.TextLayout=ug,t.TextLoader=uE,t.TextStyle=ux,t.Texture=r7,t.TextureFactory=na,t.ThreeComposition=lb,t.ThreeDisplayObject=lE,t.ThreeEngine=lC,t.ThreeMaterial=lp,t.ThreeTexture=lx,t.Ticker=li,t.TimelineClip=ss,t.TimelineInstance=us,t.TrackMixerPlayable=oQ,t.Transform=nO,t.TransformMixerPlayable=sr,t.TransformPlayable=si,t.TransitionNode=rM,t.Triangle=aI,t.TrimPath=uW,t.ValueGetter=n8,t.ValueNode=i4,t.Vector2Curve=av,t.Vector2PropertyMixerPlayable=so,t.Vector3Curve=am,t.Vector3PropertyMixerPlayable=sa,t.Vector4Curve=ap,t.Vector4PropertyMixerPlayable=sn,t.addByOrder=id,t.addItem=eZ,t.addItemWithOrder=function(t,e,i,r){if(void 0===r&&(r=!1),!t.includes(e)&&(t.push(e),1!==t.length)){var n=t.length-1;if(n){var a=t[n];if(r)for(;t[n-1][i]<a[i]&&(t[n]=t[n-1],0!=--n););else for(;t[n-1][i]>a[i]&&(t[n]=t[n-1],0!=--n););t[n]=a}}},t.applyMixins=iI,t.assertExist=im,t.asserts=function(t,e){if(void 0===e&&(e="asserts failed"),!t)throw Error(e)},t.base64ToFile=iR,t.breakOpportunityAfter=uy,t.buildBezierData=n$,t.buildEasingCurve=n3,t.buildLine=aM,t.calculateTranslation=nk,t.canUseBOM=ii,t.canvasPool=og,t.closePointEps=1e-4,t.colorGradingFrag=a6,t.colorStopsFromGradient=e9,t.colorToArr=e6,t.combineImageTemplate=hI,t.createGLContext=function(t,e,i){var r;if(void 0===e&&(e="webgl"),"webgl2"!==e||(r=t.getContext("webgl2",i))||console.debug("WebGL2 context retrieval failed, falling back to WebGL context."),r&&"webgl"!==e||(r=t.getContext("webgl",i)),!r)throw Error("This browser does not support WebGL or the WebGL version is incorrect. Please check your WebGL version.");return r},t.createKeyFrameMeta=ac,t.createShape=sw,t.createValueGetter=aT,t.curveEps=1e-4,t.decimalEqual=nj,t.deserializeMipmapTexture=r4,t.earcut=sG,t.effectsClass=iZ,t.effectsClassStore=iY,t.enlargeBuffer=eK,t.ensureFixedNumber=uq,t.ensureVec3=nD,t.extractMinAndMax=nH,t.gaussianDownHFrag=a8,t.gaussianDownVFrag=a9,t.gaussianUpFrag=a7,t.generateEmptyTexture=nr,t.generateEmptyTypedArray=aQ,t.generateGUID=iP,t.generateHalfFloatTexture=nt,t.generateWhiteTexture=ni,t.getBackgroundImage=hR,t.getClass=function(t){return iY[t]},t.getColorFromGradientStops=e8,t.getConfig=function(t){return oy[t]},t.getControlPoints=n4,t.getDefaultTextureFactory=function(){return e_||(e_=new na),e_},t.getGeometryByShape=sj,t.getGeometryTriangles=sW,t.getKeyFrameMetaByRawValue=al,t.getMergedStore=iq,t.getNodeDataClass=function(t){return i$[t]},t.getParticleMeshShader=function(t,e,i){void 0===i&&(i="");var r,n,a,o=t.content,s=+((null==(r=o.renderer)?void 0:r.renderMode)||0),u=[["RENDER_MODE",s],["ENV_EDITOR",i===nw]],h=e.detail,l=ac(),c=ac(),f=h.maxVertexUniforms>0,d=(null!=(n=o.positionOverLifetime)?n:{}).speedOverLifetime,p=0,m=0;f&&u.push(["ENABLE_VERTEX_TEXTURE",!0]),d&&(u.push(["SPEED_OVER_LIFETIME",!0]),m|=2,al(l,d));var v=o.textureSheetAnimation;v&&v.animate&&(u.push(["USE_SPRITE",!0]),m|=4);var y=o.colorOverLifetime;y&&y.color&&(u.push(["COLOR_OVER_LIFETIME",!0]),m|=16);var g=y&&y.opacity;g&&al(l,g);var x=o.positionOverLifetime;if(["x","y","z"].forEach(function(t,e){var i=0,r="linear"+t.toUpperCase(),n="orbital"+t.toUpperCase();(null==x?void 0:x[r])&&(al(l,x[r]),i=1,m|=1<<7+e),u.push(["LINEAR_VEL_"+t.toUpperCase(),i]);var o=0;(null==x?void 0:x[n])&&(al(l,x[n]),o=1,m|=1<<10+e,a=!0),u.push(["ORB_VEL_"+t.toUpperCase(),o])}),(null==x?void 0:x.asMovement)&&(u.push(["AS_LINEAR_MOVEMENT",!0]),m|=32),a&&(null==x?void 0:x.asRotation)&&(u.push(["AS_ORBITAL_MOVEMENT",!0]),m|=64),o.sizeOverLifetime){var b=o.sizeOverLifetime;b.separateAxes?(al(l,b.x),u.push(["SIZE_Y_BY_LIFE",1]),m|=16384,al(l,b.y)):al(l,b.size)}if(o.rotationOverLifetime){var T=o.rotationOverLifetime;T.z&&(al(l,null==T?void 0:T.z),m|=32768,u.push(["ROT_Z_LIFETIME",1])),T.separateAxes&&(T.x&&(al(l,T.x),m|=65536,u.push(["ROT_X_LIFETIME",1])),T.y&&(al(l,T.y),m|=131072,u.push(["ROT_Y_LIFETIME",1]))),(null==T?void 0:T.asRotation)&&(u.push(["ROT_LIFETIME_AS_MOVEMENT",1]),m|=262144)}al(l,null==x?void 0:x.gravityOverLifetime),(null==x?void 0:x.forceTarget)&&(u.push(["FINAL_TARGET",!0]),m|=524288,al(l,x.forceCurve));var C=h.halfFloatTexture;C&&c.max&&(m|=1048576);var E=h.maxVertexUniforms,_=l.max+l.curves.length-32>E;oy[om]&&(_=!0),_&&C&&f&&(p=1);var w={fragment:a2,vertex:"#define LOOKUP_TEXTURE_CURVE "+p+"\n"+a3,shared:!0,cacheId:["-p:",s,m,l.index,l.max,c.index,c.max].join("+"),macros:u,name:"particle#"+t.name};return u.push(["VERT_CURVE_VALUE_COUNT",l.index],["FRAG_CURVE_VALUE_COUNT",c.index],["VERT_MAX_KEY_FRAME_COUNT",l.max],["FRAG_MAX_KEY_FRAME_COUNT",c.max]),{shader:w,vertex:l.index,fragment:c.index}},t.getPixelRatio=ie,t.getPluginUsageInfo=ik,t.getPreMultiAlpha=rz,t.getStandardComposition=hw,t.getStandardImage=h_,t.getStandardItem=hM,t.getStandardJSON=hC,t.getTextureSize=os,t.glContext=rV,t.glType2VertexFormatType=function(t){switch(t){case WebGLRenderingContext.FLOAT:return ey.Float32;case WebGLRenderingContext.SHORT:return ey.Int16;case WebGLRenderingContext.BYTE:return ey.Int8;case WebGLRenderingContext.UNSIGNED_SHORT:return ey.UInt16;case WebGLRenderingContext.UNSIGNED_BYTE:return ey.UInt8;default:return ey.Float32}},t.gpuTimer=function(t){var e=t.getExtension("EXT_disjoint_timer_query_webgl2");if(e){var i=t.createQuery(),r=eB(function(){return eW(this,function(n){return[2,new Promise(function(n,a){if(i){var o=t.getQueryParameter(i,t.QUERY_RESULT_AVAILABLE),s=t.getParameter(e.GPU_DISJOINT_EXT);o&&!s&&n(t.getQueryParameter(i,t.QUERY_RESULT)/1e3/1e3),(o||s)&&(t.deleteQuery(i),i=null),null!==o&&i&&window.setTimeout(function(){r().then(n).catch},1)}})]})});if(!i)return;return{begin:function(){i&&t.beginQuery(e.TIME_ELAPSED_EXT,i)},end:function(){t.endQuery(e.TIME_ELAPSED_EXT)},getTime:r}}},t.imageDataFromColor=function(t){iT(t)&&(t=e6(t));for(var e=t,i={width:1,height:1,data:new Uint8Array(4)},r=i.data,n=0;n<4;n++)r[n]=e[n];return i},t.imageDataFromGradient=il,t.initErrors=rF,t.initGLContext=rk,t.integrate="float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4){float movement=0.0;float h=(t-p1.x)*0.05;for(int i=0;i<=20;i++){float t=float(i)*h;float nt=binarySearchT(t,p1.x,p2.x,p3.x,p4.x);float y=cubicBezier(nt,p1.y,p2.y,p3.y,p4.y);float weight=(i==0||i==20)? 1.0 :(mod(float(i),2.)!=0.)? 4.0 : 2.0;movement+=weight*y;}movement*=h/3.;return movement;}float integrateFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i+=2){vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return ret;}vec2 p1=vec2(k0.x,k0.y);vec2 p2=vec2(k0.z,k0.w);vec2 p3=vec2(k1.z,k1.w);vec2 p4=vec2(k1.x,k1.y);if(time>=k1.x){ret+=calculateMovement(k1.x,p1,p2,p3,p4);}if(time>=k0.x&&time<k1.x){return ret+calculateMovement(time,p1,p2,p3,p4);}}return ret;}float integrateByTimeLineSeg(float t,vec2 p0,vec2 p1){float t0=p0.x;float t1=p1.x;float y0=p0.y;float y1=p1.y;vec4 tSqr=vec4(t,t,t0,t0);tSqr=tSqr*tSqr;vec4 a=vec4(2.*t,3.,-t0,3.)*tSqr;float t1y0=t1*y0;vec4 b=vec4(y0-y1,t0*y1-t1y0,2.*y0+y1,t1y0);float r=dot(a,b);return r/(t0-t1)*0.16666667;}float integrateLineSeg(float time,vec2 p0,vec2 p1){float h=time-p0.x;float y0=p0.y;return(y0+y0+(p1.y-y0)*h/(p1.x-p0.x))*h/2.;}float integrateFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateLineSeg(time,k0,k1);}ret+=integrateLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateLineSeg(time,k1,k2);}ret+=integrateLineSeg(k2.x,k1,k2);}return ret;}float integrateByTimeFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateByTimeLineSeg(time,k0,k1);}ret+=integrateByTimeLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateByTimeLineSeg(time,k1,k2);}ret+=integrateByTimeLineSeg(k2.x,k1,k2);}return ret;}float getIntegrateFromTime0(float t1,vec4 value){float type=value.x;if(type==0.){return value.y*t1;}if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateLineSeg(t1,p0,p1);}if(type==3.){return integrateFromLineSeg(t1,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*t1;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w);}return 0.;}float getIntegrateByTimeFromTime(float t0,float t1,vec4 value){float type=value.x;if(type==0.){return value.y*(t1*t1-t0*t0)/2.;}else if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateByTimeLineSeg(t1,p0,p1)-integrateByTimeLineSeg(t0,p0,p1);}if(type==3.){return integrateByTimeFromLineSeg(t1,value.y,value.z)-integrateByTimeFromLineSeg(t0,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*(t1*t1-t0*t0)/2.;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w)-integrateFromBezierCurveFrames(t0,value.z,value.w);}return 0.;}",t.interpolateColor=e7,t.isAlipayMiniApp=iu,t.isAndroid=ia,t.isArray=iC,t.isBreakChar=um,t.isCJKLike=uv,t.isCanvas=iS,t.isFunction=iE,t.isIOS=ir,t.isIOSByUA=function(){var t=navigator.userAgent.toLowerCase().match(/cpu (iphone )?os (.*?) like mac os/);return t?parseInt(t[2],10):0},t.isMiniProgram=function(){return iu()||ih()},t.isObject=i_,t.isOpenHarmony=io,t.isPlainObject=iw,t.isPowerOfTwo=function(t){return(t&t-1)==0&&0!==t},t.isSafeFontFamily=iy,t.isSimulatorCellPhone=is,t.isString=iT,t.isUniformStruct=ns,t.isUniformStructArray=function(t){return t&&void 0!==t.length&&ns(t[0])},t.isValidFontFamily=iv,t.isWebGL2=function(t){return"undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name},t.isWechatMiniApp=ih,t.itemFrag=a1,t.itemVert=a0,t.loadAVIFOptional=rY,t.loadBinary=rQ,t.loadBlob=function(t){return r$.apply(this,arguments)},t.loadImage=rq,t.loadMedia=r2,t.loadVideo=r0,t.loadWebPOptional=rX,t.logger=ix,t.math=np,t.modifyMaxKeyframeShader=function(t,e,i){var r,n=null==(r=t.cacheId)?void 0:r.split("+");if(n[3]=e,n[5]=i,t.cacheId=n.join("+"),t.macros)for(var a=0;a<t.macros.length;a++){var o=t.macros[a];if("VERT_CURVE_VALUE_COUNT"===o[0])o[1]=e;else if("FRAG_CURVE_VALUE_COUNT"===o[0]){o[1]=i;break}}},t.nearestPowerOfTwo=function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},t.nodeDataClass=i0,t.noop=ib,t.normalizeColor=u1,t.numberToFix=nX,t.oldBezierKeyFramesToNew=ag,t.parsePercent=it,t.particleFrag=a2,t.particleOriginTranslateMap=nU,t.particleUniformTypeMap=s4,t.particleVert=a3,t.passRenderLevel=hP,t.pluginLoaderMap=iO,t.randomInRange=iM,t.registerPlugin=iF,t.removeItem=eq,t.rotateVec2=sX,t.screenMeshVert=a5,t.serialize=function(t,e){return iK(t,e)},t.setBlendMode=rB,t.setConfig=function(t,e){return oy[t]=e},t.setDefaultTextureFactory=function(t){e_=t},t.setMaskMode=function(e,i){switch(i){case void 0:e.stencilTest=!1;break;case t.MaskMode.MASK:e.stencilTest=!0,e.stencilFunc=[rV.ALWAYS,rV.ALWAYS],e.stencilOpZPass=[rV.REPLACE,rV.REPLACE];break;case t.MaskMode.OBSCURED:e.stencilTest=!0,e.stencilFunc=[rV.EQUAL,rV.EQUAL];break;case t.MaskMode.REVERSE_OBSCURED:e.stencilTest=!0,e.stencilFunc=[rV.NOTEQUAL,rV.NOTEQUAL];break;case t.MaskMode.NONE:e.stencilTest=!1;break;default:console.warn("MaskMode "+i+" not in specification, please set stencil params seperately.")}},t.setRayFromCamera=nG,t.setSideMode=rU,t.setUniformValue=function(t,e,i){t[e]?t[e].value=i:t[e]=new eD.Uniform(i)},t.sortByOrder=ic,t.spec=iG,t.textureLoaderRegistry=nn,t.thresholdFrag=ot,t.throwDestroyedError=iA,t.trailVert=a4,t.translatePoint=function(t,e){for(var i=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],r=0;r<8;r+=2)i[r]+=t,i[r+1]+=e;return i},t.trianglesFromRect=nW,t.unregisterPlugin=function(t){delete iO[t];var e=iL.findIndex(function(e){return e.name===t});-1!==e&&iL.splice(e,1)},t.valIfUndefined=function(t,e){return null==t?e:t},t.value="#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}",t.valueDefine="#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n",t.vecFill=nz,t.vecMulCombine=nB,t.version=l_,t.vertexFormatType2GLType=function(t){switch(t){case ey.Float32:return WebGLRenderingContext.FLOAT;case ey.Int16:return WebGLRenderingContext.SHORT;case ey.Int8:return WebGLRenderingContext.BYTE;case ey.UInt16:return WebGLRenderingContext.UNSIGNED_SHORT;case ey.UInt8:return WebGLRenderingContext.UNSIGNED_BYTE;default:return WebGLRenderingContext.FLOAT}},Object.defineProperty(t,"__esModule",{value:!0})});
|
|
6
|
+
* Version: v2.10.0-alpha.2
|
|
7
|
+
*/function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.three={}),t.THREE)}(this,function(t,e){"use strict";var i,r,n,a,s,o,u,h,l,c,f,d,p,m,v,y,g,x,b,T,E,C,S,_,w,M,A,P,I,R,O,V,L,N,F,D,k,z,B,U,G,j,W,X,H,Y,Z,q,K,Q,J,$,tt,te,ti,tr,tn,ta,ts,to,tu,th,tl,tc,tf,td,tp,tm,tv,ty,tg,tx,tb,tT,tE,tC,tS,t_,tw,tM,tA,tP,tI,tR,tO,tV,tL,tN,tF,tD,tk,tz,tB,tU,tG,tj,tW,tX,tH,tY,tZ,tq,tK,tQ,tJ,t$,t0,t1,t2,t3,t4,t5,t6,t8,t9,t7,et,ee,ei,er,en,ea,es,eo,eu,eh,el,ec,ef,ed,ep,em,ev,ey,eg,ex,eb,eT,eE,eC,eS,e_,ew,eM,eA,eP,eI,eR,eO,eV,eL,eN,eF,eD,ek,ez,eB=function(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach(function(i){if("default"!==i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}}),e.default=t,Object.freeze(e)}(e);function eU(t,e,i,r,n,a,s){try{var o=t[a](s),u=o.value}catch(t){i(t);return}o.done?e(u):Promise.resolve(u).then(r,n)}function eG(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var a=t.apply(e,i);function s(t){eU(a,r,n,s,o,"next",t)}function o(t){eU(a,r,n,s,o,"throw",t)}s(void 0)})}}function ej(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):ej(t,e)}function eW(t,e,i,r){var n,a=arguments.length,s=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(s=(a<3?n(s):a>3?n(e,i,s):n(e,i))||s);return a>3&&s&&Object.defineProperty(e,i,s),s}function eX(t,e){var i,r,n,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(i)throw TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&o[0]?r.return:o[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,o[1])).done)return n;switch(r=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=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(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){a.label=o[1];break}if(6===o[0]&&a.label<n[1]){a.label=n[1],n=o;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(o);break}n[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{i=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}"function"==typeof SuppressedError&&SuppressedError;for(var eH=new Uint8Array(16),eY=[],eZ=0;eZ<256;++eZ)eY.push((eZ+256).toString(16).slice(1));var eq={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eK(t,e){return t.includes(e)||t.push(e),t}function eQ(t,e){var i=t.indexOf(e);return i>-1&&t.splice(i,1),t}function eJ(t,e,i,r){if(void 0===r&&(r=1),t.buffer.byteLength<t.BYTES_PER_ELEMENT*e){var n=Math.ceil(e*r);Number.isNaN(i)||(n=Math.min(n,i));var a=new ArrayBuffer(t.BYTES_PER_ELEMENT*n),s=new t.constructor(a);return s.set(t),s}return t}var e$=Math.PI/180,e0=180/Math.PI;function e1(t,e){return 1e-6>Math.abs(t-e)||t===1/0&&e===1/0||t===-1/0&&e===-1/0}var e2=function(t,e,i){return(1-i)*t+i*e};function e3(t,e,i){var r=isNaN(e)?-1/0:e,n=isNaN(i)?1/0:i;return Math.min(Math.max(t,Math.min(r,n)),Math.max(r,n))}var e4=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}var e=t.prototype;return e.set=function(t,e){return this.x=t,this.y=e,this},e.setZero=function(){return this.x=0,this.y=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this},e.setFromArray=function(t,e){var i,r;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this},e.clone=function(){return new t(this.x,this.y)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t):ej(t,Array)?(this.x+=t[0],this.y+=t[1]):(this.x+=t.x,this.y+=t.y),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t):ej(t,Array)?(this.x-=t[0],this.y-=t[1]):(this.x-=t.x,this.y-=t.y),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t):ej(t,Array)?(this.x*=t[0],this.y*=t[1]):(this.x*=t.x,this.y*=t.y),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t):ej(t,Array)?(this.x/=t[0],this.y/=t[1]):(this.x/=t.x,this.y/=t.y),this},e.scale=function(t){return this.x*=t,this.y*=t,this},e.sum=function(){return this.x+this.y},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.cross=function(t){return this.x*t.y-this.y*t.x},e.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},e.distanceSquared=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},e.equals=function(t){return this.x===t.x&&this.y===t.y},e.isZero=function(){var t=this.x,e=this.y;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)},e.toArray=function(){return[this.x,this.y]},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y},e.angle=function(){return Math.atan2(-this.y,-this.x)+Math.PI},e.rotateAround=function(t,e){var i=Math.cos(e),r=Math.sin(e),n=this.x-t.x,a=this.y-t.y;return this.x=n*i-a*r+t.x,this.y=n*r+a*i+t.y,this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e4.ONE=new e4(1,1),e4.ZERO=new e4(0,0);var e5=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=i}var e=t.prototype;return e.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},e.setZero=function(){return this.x=0,this.y=0,this.z=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this.z=t,this},e.setFromArray=function(t,e){var i,r,n;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this.z=null!=(n=t[e+2])?n:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},e.clone=function(){return new t(this.x,this.y,this.z)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t,this.z+=t):ej(t,Array)?(this.x+=t[0],this.y+=t[1],this.z+=t[2]):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t,this.z-=t):ej(t,Array)?(this.x-=t[0],this.y-=t[1],this.z-=t[2]):(this.x-=t.x,this.y-=t.y,this.z-=t.z),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t,this.z*=t):ej(t,Array)?(this.x*=t[0],this.y*=t[1],this.z*=t[2]):(this.x*=t.x,this.y*=t.y,this.z*=t.z),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t,this.z/=t):ej(t,Array)?(this.x/=t[0],this.y/=t[1],this.z/=t[2]):(this.x/=t.x,this.y/=t.y,this.z/=t.z),this},e.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.sum=function(){return this.x+this.y+this.z},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t),this.z=Math.min(this.z,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t),this.z=Math.max(this.z,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.cross=function(t){return this.crossVectors(this,t)},e.crossVectors=function(t,e){var i=t.x,r=t.y,n=t.z,a=e.x,s=e.y,o=e.z;return this.x=r*o-n*s,this.y=n*a-i*o,this.z=i*s-r*a,this},e.reflect=function(t){return this.subtract(t.clone().multiply(2*this.dot(t)))},e.distance=function(t){return Math.sqrt(this.distanceSquared(t))},e.distanceSquared=function(t){var e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},e.isZero=function(){var t=this.x,e=this.y,i=this.z;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)&&1e-6>=Math.abs(i)},e.toArray=function(){return[this.x,this.y,this.z]},e.toVector2=function(){return new e4(this.x,this.y)},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},e.applyEuler=function(t,e){return t.rotateVector3(this,e)},e.applyQuaternion=function(t,e){return t.rotateVector3(this,e)},e.applyMatrix=function(t,e){return t.transformPoint(this,e)},e.applyNormalMatrix=function(t,e){return t.transformNormal(this,e)},e.applyProjectionMatrix=function(t,e){return t.projectPoint(this,e)},e.setFromMatrixPosition=function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},e.setFromMatrixColumn=function(t,e){return this.setFromArray(t.elements,4*e)},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e5.X=new e5(1,0,0),e5.Y=new e5(0,1,0),e5.Z=new e5(0,0,1),e5.ONE=new e5(1,1,1),e5.ZERO=new e5(0,0,0);var e6=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.z=i,this.w=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},e.setZero=function(){return this.x=0,this.y=0,this.z=0,this.w=0,this},e.setFromNumber=function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},e.setFromArray=function(t,e){var i,r,n,a;return void 0===e&&(e=0),this.x=null!=(i=t[e])?i:0,this.y=null!=(r=t[e+1])?r:0,this.z=null!=(n=t[e+2])?n:0,this.w=null!=(a=t[e+3])?a:0,this},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.setElement=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.x+=t,this.y+=t,this.z+=t,this.w+=t):ej(t,Array)?(this.x+=t[0],this.y+=t[1],this.z+=t[2],this.w+=t[3]):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w),this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},e.subtract=function(t){return"number"==typeof t?(this.x-=t,this.y-=t,this.z-=t,this.w-=t):ej(t,Array)?(this.x-=t[0],this.y-=t[1],this.z-=t[2],this.w-=t[3]):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w),this},e.subtractVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.multiply=function(t){return"number"==typeof t?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):ej(t,Array)?(this.x*=t[0],this.y*=t[1],this.z*=t[2],this.w*=t[3]):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w),this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this.w=t.w*e.w,this},e.divide=function(t){return"number"==typeof t?(this.x/=t,this.y/=t,this.z/=t,this.w/=t):ej(t,Array)?(this.x/=t[0],this.y/=t[1],this.z/=t[2],this.w/=t[3]):(this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w),this},e.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.sum=function(){return this.x+this.y+this.z+this.w},e.min=function(t){return"number"==typeof t?(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t),this.z=Math.min(this.z,t),this.w=Math.min(this.w,t)):(this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w)),this},e.max=function(t){return"number"==typeof t?(this.x=Math.max(this.x,t),this.y=Math.max(this.y,t),this.z=Math.max(this.z,t),this.w=Math.max(this.w,t)):(this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.floor=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},e.ceil=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},e.round=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},e.abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this.z=Math.abs(this.z),this.w=Math.abs(this.w),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.normalize=function(){return this.divide(this.length()||1)},e.setLength=function(t){return this.normalize().multiply(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},e.lerpVectors=function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.isZero=function(){var t=this.x,e=this.y,i=this.z,r=this.w;return 1e-6>=Math.abs(t)&&1e-6>=Math.abs(e)&&1e-6>=Math.abs(i)&&1e-6>=Math.abs(r)},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector3=function(){return new e5(this.x,this.y,this.z)},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this},e.applyMatrix=function(t,e){return t.transformVector4(this,e)},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t}();e6.ONE=new e6(1,1,1,1),e6.ZERO=new e6(0,0,0,0);var e8=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=i,this.a=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.r=t,this.g=e,this.b=i,this.a=r,this},e.setZero=function(){return this.r=0,this.g=0,this.b=0,this.a=0,this},e.setFromNumber=function(t){return this.r=t,this.g=t,this.b=t,this.a=t,this},e.setFromVector4=function(t){return this.r=t.x,this.g=t.y,this.b=t.z,this.a=t.w,this},e.setFromArray=function(t,e){var i,r,n,a;return void 0===e&&(e=0),this.r=null!=(i=t[e])?i:0,this.g=null!=(r=t[e+1])?r:0,this.b=null!=(n=t[e+2])?n:0,this.a=null!=(a=t[e+3])?a:0,this},e.setFromHSV=function(t,e,i,r){void 0===r&&(r=1);var n=i*e,a=t/60,s=n*(1-Math.abs(a%2-1)),o=0,u=0,h=0;a>=0&&a<=1?(o=n,u=s):a>=1&&a<=2?(o=s,u=n):a>=2&&a<=3?(u=n,h=s):a>=3&&a<=4?(u=s,h=n):a>=4&&a<=5?(o=s,h=n):a>=5&&a<=6&&(o=n,h=s);var l=i-n;return this.set(o+l,u+l,h+l,r)},e.setFromHexString=function(t){if("#"!==t.substring(0,1)||9!==t.length&&7!==t.length)return this;var e=parseInt(t.substring(1,3),16)/255,i=parseInt(t.substring(3,5),16)/255,r=parseInt(t.substring(5,7),16)/255,n=9===t.length?parseInt(t.substring(7,9),16)/255:1;return this.set(e,i,r,n)},e.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},e.clone=function(){return new t(this.r,this.g,this.b,this.a)},e.setElement=function(t,e){switch(t){case 0:this.r=e;break;case 1:this.g=e;break;case 2:this.b=e;break;case 3:this.a=e;break;default:console.error("index is out of range: "+t)}return this},e.getElement=function(t){switch(t){case 0:return this.r;case 1:return this.g;case 2:return this.b;case 3:return this.a;default:console.error("index is out of range: "+t)}return 0},e.add=function(t){return"number"==typeof t?(this.r+=t,this.g+=t,this.b+=t,this.a+=t):ej(t,Array)?(this.r+=t[0],this.g+=t[1],this.b+=t[2],this.a+=t[3]):(this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a),this},e.subtract=function(t){return"number"==typeof t?(this.r-=t,this.g-=t,this.b-=t,this.a-=t):ej(t,Array)?(this.r-=t[0],this.g-=t[1],this.b-=t[2],this.a-=t[3]):(this.r-=t.r,this.g-=t.g,this.b-=t.b,this.a-=t.a),this},e.multiply=function(t){return"number"==typeof t?(this.r*=t,this.g*=t,this.b*=t,this.a*=t):ej(t,Array)?(this.r*=t[0],this.g*=t[1],this.b*=t[2],this.a*=t[3]):(this.r*=t.r,this.g*=t.g,this.b*=t.b,this.a*=t.a),this},e.divide=function(t){return"number"==typeof t?(this.r/=t,this.g/=t,this.b/=t,this.a/=t):ej(t,Array)?(this.r/=t[0],this.g/=t[1],this.b/=t[2],this.a/=t[3]):(this.r/=t.r,this.g/=t.g,this.b/=t.b,this.a/=t.a),this},e.scale=function(t){return this.r*=t,this.g*=t,this.b*=t,this.a*=t,this},e.min=function(t){return"number"==typeof t?(this.r=Math.min(this.r,t),this.g=Math.min(this.g,t),this.b=Math.min(this.b,t),this.a=Math.min(this.a,t)):(this.r=Math.min(this.r,t.r),this.g=Math.min(this.g,t.g),this.b=Math.min(this.b,t.b),this.a=Math.min(this.a,t.a)),this},e.max=function(t){return"number"==typeof t?(this.r=Math.max(this.r,t),this.g=Math.max(this.g,t),this.b=Math.max(this.b,t),this.a=Math.max(this.a,t)):(this.r=Math.max(this.r,t.r),this.g=Math.max(this.g,t.g),this.b=Math.max(this.b,t.b),this.a=Math.max(this.a,t.a)),this},e.clamp=function(t,e){return this.max(t).min(e)},e.lerp=function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this.a+=(t.a-this.a)*e,this},e.luminance=function(){return .3*this.r+.59*this.g+.11*this.b},e.equals=function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a},e.toLinear=function(){return this.r=t.gammaToLinear(this.r),this.g=t.gammaToLinear(this.g),this.b=t.gammaToLinear(this.b),this},e.toGamma=function(){return this.r=t.linearToGamma(this.r),this.g=t.linearToGamma(this.g),this.b=t.linearToGamma(this.b),this},e.toArray=function(){return[this.r,this.g,this.b,this.a]},e.toVector4=function(){return new e6(this.r,this.g,this.b,this.a)},e.toHSV=function(){var e=this.r,i=this.g,r=this.b,n=this.a,a=Math.max(e,i,r),s=Math.min(e,i,r),o=a-s,u=0,h=0;return 0!==a&&(h=o/a),a!=s&&(a==e?(u=(i-r)/o,i<r&&(u+=6)):a==i?u=(r-e)/o+2:a==r&&(u=(e-i)/o+4),u*=60),new t(u,h,a,n)},e.toHexString=function(e){void 0===e&&(e=!0);var i=t.ToHex(Math.round(255*this.r)),r=t.ToHex(Math.round(255*this.g)),n=t.ToHex(Math.round(255*this.b)),a=t.ToHex(Math.round(255*this.a));return e?"#"+i+r+n+a:"#"+i+r+n},e.fill=function(t,e){void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a},t.fromNumber=function(e){return new t().setFromNumber(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromHexString=function(e){return new t().setFromHexString(e)},t.fromHSV=function(e,i,r,n){return void 0===n&&(n=1),new t().setFromHSV(e,i,r,n)},t.gammaToLinear=function(t){return t<=0?0:t<=.04045?t/12.92:t<1?Math.pow((t+.055)/1.055,2.4):Math.pow(t,2.4)},t.linearToGamma=function(t){return t<=0?0:t<.0031308?12.92*t:t<1?1.055*Math.pow(t,.41666)-.055:Math.pow(t,.41666)},t.ToHex=function(t){var e=t.toString(16);return t<=15?("0"+e).toUpperCase():e.toUpperCase()},t}();function e9(t,e){var i=[0,0,0,0];if(iC(t)){t=t.replace(/[\s\t\r\n]/g,"");var r=/rgba?\(([.\d]+),([.\d]+),([.\d]+),?([.\d]+)?\)/.exec(t);if(r){var n=+r[4];i=[+r[1],+r[2],+r[3],isNaN(n)?255:255*n]}else/^#[a-f\d]{3}$/i.test(t)?i=[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))&&(i=[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),255])}else ej(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:t[3]]);if(e)for(var a=0;a<4;a++)i[a]/=255;return i}function e7(t,e,i){if(0===t.length)return[0,0,0,0];if(e<=t[0].time)r=t[0].color.toArray();else if(e>=t[t.length-1].time)r=t[t.length-1].color.toArray();else{r=t[t.length-1].color.toArray();for(var r,n=1;n<=t.length-1;n++){var a=t[n-1],s=t[n];if(a.time<=e&&e<=s.time){r=ie(a.color.toArray(),s.color.toArray(),(e-a.time)/(s.time-a.time));break}}}return i?r.map(function(t){return t/255}):r}function it(t){var e=[];return ej(t,Array)?t.forEach(function(t){var i=t[0],r=t[1],n=t[2],a=t[3],s=t[4];e.push({time:ii(i),color:new e8(r,n,a,s)})}):Object.keys(t).forEach(function(i){var r=t[i],n=new e8().setFromArray(e9(r));e.push({time:ii(i),color:n})}),e=e.sort(function(t,e){return t.time-e.time})}function ie(t,e,i,r){var n=[],a=1-i;if(r)for(var s=0;s<4;s++)n[s]=t[s]*a+e[s]*i;else{for(var o=0;o<3;o++)n[o]=Math.round(Math.sqrt(t[o]*t[o]*a+e[o]*e[o]*i));n[3]=Math.round(t[3]*a+e[3]*i)}return n}function ii(t){var e=/^(-)?([\d+.]+)%$/.exec(t);return e?+e[2]/100*(e[1]?-1:1):+t}function ir(){return"object"==typeof window?Math.min(2,window.devicePixelRatio||1):1}e8.BLACK=new e8(0,0,0,1),e8.BLUE=new e8(0,0,1,1),e8.CLEAR=new e8(0,0,0,0),e8.CYAN=new e8(0,1,1,1),e8.GRAY=new e8(.5,.5,.5,1),e8.GREEN=new e8(0,1,0,1),e8.MAGENTA=new e8(1,0,1,1),e8.RED=new e8(1,0,0,1),e8.WHITE=new e8(1,1,1,1),e8.YELLOW=new e8(1,.92,.016,1);var ia="undefined"!=typeof window;function is(){return!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)}function io(){return/\b[Aa]ndroid\b/.test(navigator.userAgent)}function iu(){return/\bOpenHarmony\b/.test(navigator.userAgent)}function ih(){return io()||iu()||/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)}function il(){var t;return"undefined"!=typeof my&&(null==(t=my)?void 0:t.renderTarget)==="web"}function ic(){return"miniprogram"===window.__wxjs_environment}function id(t){var e={width:128,height:1,data:new Uint8Array(512)},i=e.data,r=it(t);if(r.length)for(var n=0;n<128;n++){var a=n/127;if(a<=r[0].time)i.set(r[0].color.toArray(),4*n);else if(a>=r[r.length-1].time)i.set(r[r.length-1].color.toArray(),4*n);else for(var s=0;s<r.length-1;s++){var o=r[s],u=r[s+1];if(o.time<=a&&u.time>a){var h=ie(o.color.toArray(),u.color.toArray(),(a-o.time)/(u.time-o.time));i.set(h,4*n);break}}}return e}function ip(t,e){void 0===e&&(e=2);var i=t.length;if(i<=1||1===e)return t;if(!(i<=30))return function t(e,i,r,n){if(void 0===r&&(r=0),void 0===n&&(n=e.length-1),r>=n)return e;for(var a,s,o=e[r],u=r,h=n;u<h;){if(2===i){for(;e[h].priority>o.priority&&h>=u;)h--;for(;e[u].priority<=o.priority&&u<h;)u++}else{for(;e[h].priority<o.priority&&h>=u;)h--;for(;e[u].priority>=o.priority&&u<h;)u++}a=[e[h],e[u]],e[u]=a[0],e[h]=a[1]}return s=[e[u],e[r]],e[r]=s[0],e[u]=s[1],t(e,i,r,u-1),t(e,i,h+1,n),e}(t,e);for(var r=1;r<i;r++)iv(t,r,e);return t}function im(t,e,i){return void 0===i&&(i=2),t.includes(e)||(t.push(e),1===t.length||1!==i&&iv(t,t.length-1,i)),t}function iv(t,e,i){var r=t[e];if(2!==i)for(;e>=1&&t[e-1].priority<r.priority&&(t[e]=t[e-1],0!=--e););else for(;e>=1&&t[e-1].priority>r.priority&&(t[e]=t[e-1],0!=--e););t[e]=r}function iy(t,e){if(void 0===e&&(e="item doesn't exist"),null==t)throw Error(e)}function ig(t){return ix(t)||!ih()}function ix(t){return/^[^\d.][\w-]*$/.test(t)}function ib(t){return["%c[Galacean Effects]","color: #AA0100",""+t]}t.OrderType=void 0,(i=t.OrderType||(t.OrderType={}))[i.none=1]="none",i[i.ascending=2]="ascending",i[i.descending=3]="descending";var iT={error:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).error.apply(e,[].concat(ib(t),[r])),null==tk||tk("error",t,r)},info:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).debug.apply(e,[].concat(ib(t))),null==tk||tk("info",t,r)},warn:function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=console).warn.apply(e,[].concat(ib(t))),null==tk||tk("warn",t,r)},register:function(t){t&&i_(t)&&(tk=t)}};function iE(){}function iC(t){return"string"==typeof t}t.DestroyOptions=void 0,(r=t.DestroyOptions||(t.DestroyOptions={}))[r.destroy=0]="destroy",r[r.keep=1]="keep",r[r.force=0]="force";var iS=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i_(t){return"[object Function]"===Object.prototype.toString.call(t)}function iw(t){return"[object Object]"===Object.prototype.toString.call(t)}function iM(t){if(null===t||"object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return"function"==typeof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)}function iA(t){var e;return"object"==typeof t&&null!==t&&(null==(e=t.tagName)?void 0:e.toUpperCase())==="CANVAS"}function iP(t,e){return t+Math.random()*(e-t)}function iI(){throw Error("Destroyed item cannot be used again.")}function iR(){return(function(t,e,i){if(eq.randomUUID&&!t)return eq.randomUUID();var r,n=(t=t||{}).random||(t.rng||function(){if(!tD&&!(tD="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tD(eH)})();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,void 0===r&&(r=0),eY[n[r+0]]+eY[n[r+1]]+eY[n[r+2]]+eY[n[r+3]]+"-"+eY[n[r+4]]+eY[n[r+5]]+"-"+eY[n[r+6]]+eY[n[r+7]]+"-"+eY[n[r+8]]+eY[n[r+9]]+"-"+eY[n[r+10]]+eY[n[r+11]]+eY[n[r+12]]+eY[n[r+13]]+eY[n[r+14]]+eY[n[r+15]]})().replace(/-/g,"")}function iO(t,e,i){void 0===e&&(e="base64File"),void 0===i&&(i="");for(var r=atob(t.split(",")[1]||t),n=[],a=0;a<r.length;a+=512){for(var s=r.slice(a,a+512),o=Array(s.length),u=0;u<s.length;u++)o[u]=s.charCodeAt(u);var h=new Uint8Array(o);n.push(h)}return new File([new Blob(n,{type:i})],e,{type:i})}function iV(t,e){e.forEach(function(e){Object.getOwnPropertyNames(e.prototype).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e.prototype,i);if(!r)throw Error("Cannot find property descriptor of class "+e);Object.defineProperty(t.prototype,i,r)})})}var iL={},iN=[];function iF(t,e){iL[t]&&iT.error("Duplicate registration for plugin "+t+"."),iL[t]=e;var i=new e;i.name=t,iN.push(i),iN.sort(function(t,e){return t.order-e.order})}var iD=function(){function t(){}return t.getPlugins=function(){return iN},t.notifyCompositionCreated=function(t,e){iN.forEach(function(i){return i.onCompositionCreated(t,e)})},t.notifyCompositionDestroy=function(t){iN.forEach(function(e){return e.onCompositionDestroy(t)})},t.notifyEngineCreated=function(t){iN.forEach(function(e){return e.onEngineCreated(t)})},t.notifyEngineDestroy=function(t){iN.forEach(function(e){return e.onEngineDestroy(t)})},t.notifyAssetsLoadStart=function(t,e){return eG(function(){return eX(this,function(i){return[2,Promise.all(iN.map(function(i){return i.onAssetsLoadStart(t,e)}))]})})()},t.notifyAssetsLoadFinish=function(t,e,i){iN.forEach(function(r){return r.onAssetsLoadFinish(t,e,i)})},t}(),ik={"alipay-downgrade":"@galacean/effects-plugin-alipay-downgrade",downgrade:"@galacean/effects-plugin-downgrade","editor-gizmo":"@galacean/effects-plugin-editor-gizmo",ffd:"@galacean/effects-plugin-ffd",ktx2:"@galacean/effects-plugin-ktx2",model:"@galacean/effects-plugin-model",video:"@galacean/effects-plugin-multimedia",audio:"@galacean/effects-plugin-multimedia","orientation-transformer":"@galacean/effects-plugin-orientation-transformer","rich-text":"@galacean/effects-plugin-rich-text",spine:"@galacean/effects-plugin-spine"};function iz(t){var e=ik[t];return e?"\n请按如下命令进行操作(Please follow the commands below to proceed):\n1、使用 npm 安装插件(Install Plugin):npm i "+e+"@latest --save\n2、导入插件(Import Plugin):import '"+e+"'":""}var iB=function(){function t(){this.order=100,this.name="Plugin"}var e=t.prototype;return e.onAssetsLoadStart=function(t,e){return eG(function(){return eX(this,function(t){return[2]})})()},e.onAssetsLoadFinish=function(t,e,i){},e.onCompositionCreated=function(t,e){},e.onCompositionDestroy=function(t){},e.onEngineCreated=function(t){},e.onEngineDestroy=function(t){},t}();function iU(t,e){return(iU=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function iG(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&iU(t,e)}(n=tz||(tz={}))["1_0"]="1.0",n["1_1"]="1.1",n["1_2"]="1.2",n["1_3"]="1.3",n["1_5"]="1.5",n["1_8"]="1.8",n["2_0"]="2.0",n["2_1"]="2.1",n["2_2"]="2.2",n["2_3"]="2.3",n["2_4"]="2.4",n["3_0"]="3.0",n["3_1"]="3.1",n["3_2"]="3.2",n["3_3"]="3.3",n["3_4"]="3.4",n["3_5"]="3.5",n["3_6"]="3.6",n["3_7"]="3.7",n.LATEST="3.7",(a=tB||(tB={})).S="S",a.APlus="A+",a.A="A",a.BPlus="B+",a.B="B",(s=tU||(tU={}))[s.ALPHA=0]="ALPHA",s[s.ADD=1]="ADD",s[s.MULTIPLY=2]="MULTIPLY",s[s.BRIGHTNESS=3]="BRIGHTNESS",s[s.SUBTRACTION=4]="SUBTRACTION",s[s.STRONG_LIGHT=5]="STRONG_LIGHT",s[s.WEAK_LIGHT=6]="WEAK_LIGHT",s[s.SUPERPOSITION=7]="SUPERPOSITION",(o=tG||(tG={}))[o.DOUBLE=1032]="DOUBLE",o[o.FRONT=1028]="FRONT",o[o.BACK=1029]="BACK",(u=tj||(tj={}))[u.OBSCURED=2]="OBSCURED",u[u.REVERSE_OBSCURED=3]="REVERSE_OBSCURED",(h=tW||(tW={}))[h.NONE=0]="NONE",h[h.SPHERE=1]="SPHERE",h[h.CONE=2]="CONE",h[h.HEMISPHERE=3]="HEMISPHERE",h[h.CIRCLE=4]="CIRCLE",h[h.DONUT=5]="DONUT",h[h.RECTANGLE=6]="RECTANGLE",h[h.RECTANGLE_EDGE=7]="RECTANGLE_EDGE",h[h.EDGE=8]="EDGE",h[h.TEXTURE=9]="TEXTURE",(l=tX||(tX={}))[l.GYROSCOPE=0]="GYROSCOPE",l[l.SPINE=1]="SPINE",(c=tH||(tH={}))[c.CLICK=0]="CLICK",c[c.MESSAGE=1]="MESSAGE",c[c.DRAG=2]="DRAG",(f=tY||(tY={}))[f.NONE=0]="NONE",f[f.NOTIFY=1]="NOTIFY",f[f.RESUME_PLAYER=2]="RESUME_PLAYER",f[f.REMOVE=3]="REMOVE",f[f.PAUSE=4]="PAUSE",(d=tZ||(tZ={})).base="0",d.sprite="1",d.particle="2",d.null="3",d.interact="4",d.plugin="5",d.camera="6",d.composition="7",d.spine="spine",d.mesh="mesh",d.tree="tree",d.text="text",d.light="light",d.skybox="skybox",d.effect="effect",d.shape="shape",d.postProcessVolume="postProcessVolume",d.node="node",d.video="video",d.audio="audio",d.richtext="richtext",(p=tq||(tq={}))[p.BILLBOARD=0]="BILLBOARD",p[p.MESH=1]="MESH",p[p.VERTICAL_BILLBOARD=2]="VERTICAL_BILLBOARD",p[p.HORIZONTAL_BILLBOARD=3]="HORIZONTAL_BILLBOARD",(m=tK||(tK={}))[m.PARTICLE_ORIGIN_CENTER=0]="PARTICLE_ORIGIN_CENTER",m[m.PARTICLE_ORIGIN_LEFT_TOP=1]="PARTICLE_ORIGIN_LEFT_TOP",m[m.PARTICLE_ORIGIN_LEFT_CENTER=2]="PARTICLE_ORIGIN_LEFT_CENTER",m[m.PARTICLE_ORIGIN_LEFT_BOTTOM=3]="PARTICLE_ORIGIN_LEFT_BOTTOM",m[m.PARTICLE_ORIGIN_CENTER_TOP=4]="PARTICLE_ORIGIN_CENTER_TOP",m[m.PARTICLE_ORIGIN_CENTER_BOTTOM=5]="PARTICLE_ORIGIN_CENTER_BOTTOM",m[m.PARTICLE_ORIGIN_RIGHT_TOP=6]="PARTICLE_ORIGIN_RIGHT_TOP",m[m.PARTICLE_ORIGIN_RIGHT_CENTER=7]="PARTICLE_ORIGIN_RIGHT_CENTER",m[m.PARTICLE_ORIGIN_RIGHT_BOTTOM=8]="PARTICLE_ORIGIN_RIGHT_BOTTOM",(v=tQ||(tQ={})).Opaque="Opaque",v.Transparent="Transparent",(y=tJ||(tJ={})).Both="Both",y.Back="Back",y.Front="Front",(g=t$||(t$={}))[g.portrait=1]="portrait",g[g.landscape=0]="landscape",(x=t0||(t0={}))[x.CONSTANT=0]="CONSTANT",x[x.CONSTANT_VEC2=1]="CONSTANT_VEC2",x[x.CONSTANT_VEC3=2]="CONSTANT_VEC3",x[x.CONSTANT_VEC4=3]="CONSTANT_VEC4",x[x.RANDOM=4]="RANDOM",x[x.LINE=5]="LINE",x[x.CURVE=6]="CURVE",x[x.BEZIER_PATH=7]="BEZIER_PATH",x[x.RGBA_COLOR=8]="RGBA_COLOR",x[x.GRADIENT_COLOR=9]="GRADIENT_COLOR",x[x.SHAPE_POINTS=10]="SHAPE_POINTS",x[x.SHAPE_SPLITS=11]="SHAPE_SPLITS",x[x.LINEAR_PATH=12]="LINEAR_PATH",x[x.COLORS=13]="COLORS",x[x.BINARY=20]="BINARY",x[x.BEZIER_CURVE=21]="BEZIER_CURVE",x[x.BEZIER_CURVE_PATH=22]="BEZIER_CURVE_PATH",x[x.BEZIER_CURVE_QUAT=23]="BEZIER_CURVE_QUAT",x[x.COLOR_CURVE=24]="COLOR_CURVE",x[x.VECTOR4_CURVE=25]="VECTOR4_CURVE",x[x.VECTOR2_CURVE=26]="VECTOR2_CURVE",x[x.VECTOR3_CURVE=27]="VECTOR3_CURVE",(b=t1||(t1={}))[b.AUTO=0]="AUTO",b[b.EASE=1]="EASE",b[b.EASE_IN=2]="EASE_IN",b[b.EASE_OUT=3]="EASE_OUT",b[b.LINE=4]="LINE",b[b.HOLD=5]="HOLD",b[b.LINE_OUT=6]="LINE_OUT",(T=t2||(t2={}))[T.destroy=0]="destroy",T[T.restart=5]="restart",T[T.forward=2]="forward",T[T.freeze=4]="freeze",(E=t3||(t3={}))[E.none=0]="none",E[E.removeParticle=1]="removeParticle",(C=t4||(t4={}))[C.RANDOM=0]="RANDOM",C[C.UNIDIRECTIONAL_CYCLE=1]="UNIDIRECTIONAL_CYCLE",C[C.BIDIRECTIONAL_CYCLE=2]="BIDIRECTIONAL_CYCLE",C[C.UNIFORM_BURST=3]="UNIFORM_BURST",(S=t5||(t5={})).point="point",S.spot="spot",S.directional="directional",S.ambient="ambient",(_=t6||(t6={}))[_.box=2]="box",_[_.sphere=3]="sphere",(w=t8||(t8={})).orthographic="orthographic",w.perspective="perspective",(M=t9||(t9={})).unlit="unlit",M.pbr="pbr",M.hair="hair",(A=t7||(t7={}))[A.opaque=100]="opaque",A[A.masked=101]="masked",A[A.translucent=102]="translucent",A[A.additive=103]="additive",(P=et||(et={})).none="none",P.uv="uv",P.normal="normal",P.basecolor="basecolor",P.alpha="alpha",P.metallic="metallic",P.roughness="roughness",P.ao="ao",P.emissive="emissive",P.diffuse="diffuse",(I=ee||(ee={}))[I.visible=0]="visible",I[I.display=1]="display",I[I.clip=2]="clip",I[I.ellipsis=3]="ellipsis",(R=ei||(ei={}))[R.autoWidth=0]="autoWidth",R[R.autoHeight=1]="autoHeight",R[R.fixed=2]="fixed",(O=er||(er={}))[O.top=0]="top",O[O.middle=1]="middle",O[O.bottom=2]="bottom",(V=en||(en={}))[V.left=0]="left",V[V.middle=1]="middle",V[V.right=2]="right",(L=ea||(ea={}))[L.top=0]="top",L[L.middle=1]="middle",L[L.bottom=2]="bottom",(N=es||(es={})).normal="normal",N.bold="bold",N.lighter="lighter",(F=eo||(eo={})).normal="normal",F.italic="italic",F.oblique="oblique";var ij={WhiteTexture:"whitetexture00000000000000000000",EmptyTexture:"emptyTexture00000000000000000000",PBRShader:"pbr00000000000000000000000000000",UnlitShader:"unlit000000000000000000000000000"};(D=eu||(eu={}))[D.Solid=0]="Solid",D[D.GradientLinear=1]="GradientLinear",D[D.GradientRadial=2]="GradientRadial",D[D.GradientAngular=3]="GradientAngular",D[D.Texture=4]="Texture",(k=eh||(eh={}))[k.Fill=0]="Fill",k[k.Fit=1]="Fit",k[k.Crop=2]="Crop",k[k.Tile=3]="Tile",(z=el||(el={}))[z.Custom=0]="Custom",z[z.Rectangle=1]="Rectangle",z[z.Ellipse=2]="Ellipse",z[z.Polygon=3]="Polygon",z[z.Star=4]="Star",(B=ec||(ec={}))[B.Butt=0]="Butt",B[B.Round=1]="Round",B[B.Square=2]="Square",(U=ef||(ef={}))[U.Round=0]="Round",U[U.Bevel=1]="Bevel",U[U.Miter=2]="Miter",(G=ed||(ed={})).AnimationClipNodeData="AnimationClipNodeData",G.BlendNodeData="BlendNodeData",G.ApplyAdditiveNodeData="ApplyAdditiveNodeData",G.LayerBlendNodeData="LayerBlendNodeData",G.StateMachineNodeData="StateMachineNodeData",G.TransitionNodeData="TransitionNodeData",G.StateNodeData="StateNodeData",G.ConstFloatNodeData="ConstFloatNodeData",G.ConstBoolNodeData="ConstBoolNodeData",G.ControlParameterBoolNodeData="ControlParameterBoolNodeData",G.ControlParameterFloatNodeData="ControlParameterFloatNodeData",G.ControlParameterTriggerNodeData="ControlParameterTriggerNodeData",G.NotNodeData="NotNodeData",G.AndNodeData="AndNodeData",G.OrNodeData="OrNodeData",G.EqualNodeData="EqualNodeData",G.GreaterNodeData="GreaterNodeData",G.LessNodeData="LessNodeData",(j=ep||(ep={})).video="video",j.image="image",(W=em||(em={})).video="video",W.audio="audio",(X=ev||(ev={})).L30="hev1.1.0.L30.B0",X.L60="hev1.1.0.L60.B0",X.L63="hev1.1.0.L63.B0",X.L90="hev1.1.0.L90.B0",X.L93="hev1.1.0.L93.B0",X.L120="hev1.1.0.L120.B0",X.L150="hev1.1.0.L150.B0",X.L180="hev1.1.0.L180.B0",(H=ey||(ey={})).VFXItemData="VFXItemData",H.Material="Material",H.Shader="Shader",H.Geometry="Geometry",H.Texture="Texture",H.Image="Image",H.AnimationClip="AnimationClip",H.BinaryAsset="BinaryAsset",H.TrackAsset="TrackAsset",H.TimelineAsset="TimelineAsset",H.ObjectBindingTrack="ObjectBindingTrack",H.TransformTrack="TransformTrack",H.SpriteColorTrack="SpriteColorTrack",H.ActivationTrack="ActivationTrack",H.SubCompositionTrack="SubCompositionTrack",H.FloatPropertyTrack="FloatPropertyTrack",H.ColorPropertyTrack="ColorPropertyTrack",H.Vector2PropertyTrack="Vector2PropertyTrack",H.Vector3PropertyTrack="Vector3PropertyTrack",H.Vector4PropertyTrack="Vector4PropertyTrack",H.TransformPlayableAsset="TransformPlayableAsset",H.SpriteColorPlayableAsset="SpriteColorPlayableAsset",H.ActivationPlayableAsset="ActivationPlayableAsset",H.SubCompositionPlayableAsset="SubCompositionPlayableAsset",H.FloatPropertyPlayableAsset="FloatPropertyPlayableAsset",H.ColorPropertyPlayableAsset="ColorPropertyPlayableAsset",H.Vector2PropertyPlayableAsset="Vector2PropertyPlayableAsset",H.Vector3PropertyPlayableAsset="Vector3PropertyPlayableAsset",H.Vector4PropertyPlayableAsset="Vector4PropertyPlayableAsset",H.MeshComponent="MeshComponent",H.SkyboxComponent="SkyboxComponent",H.LightComponent="LightComponent",H.CameraComponent="CameraComponent",H.ModelPluginComponent="ModelPluginComponent",H.TreeComponent="TreeComponent",H.AnimationComponent="AnimationComponent",H.SpineComponent="SpineComponent",H.VideoComponent="VideoComponent",H.AudioComponent="AudioComponent",H.RichTextComponent="RichTextComponent",H.OrientationComponent="OrientationComponent",H.ShapeComponent="ShapeComponent",H.SpriteComponent="SpriteComponent",H.ParticleSystem="ParticleSystem",H.InteractComponent="InteractComponent",H.CameraController="CameraController",H.PostProcessVolume="PostProcessVolume",H.EffectComponent="EffectComponent",H.TextComponent="TextComponent",H.AnimationGraphAsset="AnimationGraphAsset",H.CompositionComponent="CompositionComponent",H.FFDComponent="FFDComponent",H.FrameComponent="FrameComponent",H.Animator="Animator",H.TimelineClip="TimelineClip",(Y=eg||(eg={}))[Y.POINTS=0]="POINTS",Y[Y.LINES=1]="LINES",Y[Y.LINE_LOOP=2]="LINE_LOOP",Y[Y.LINE_STRIP=3]="LINE_STRIP",Y[Y.TRIANGLES=4]="TRIANGLES",Y[Y.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",Y[Y.TRIANGLE_FAN=6]="TRIANGLE_FAN",(Z=ex||(ex={}))[Z.Float16=0]="Float16",Z[Z.Float32=1]="Float32",Z[Z.Int8=2]="Int8",Z[Z.Int16=3]="Int16",Z[Z.Int32=4]="Int32",Z[Z.UInt8=5]="UInt8",Z[Z.UInt16=6]="UInt16",Z[Z.UInt32=7]="UInt32",(q=eb||(eb={}))[q.None=-1]="None",q[q.UInt8=0]="UInt8",q[q.UInt16=1]="UInt16",q[q.UInt32=2]="UInt32",(K=eT||(eT={})).Position="POSITION",K.Uv="TEXCOORD0",K.Uv2="TEXCOORD1",K.Normal="NORMAL",K.Tangent="TANGENT",K.Color="COLOR",K.Joints="JOINTS",K.Weights="WEIGHTS",K.PositionBS0="POSITION_BS0",K.PositionBS1="POSITION_BS1",K.PositionBS2="POSITION_BS2",K.PositionBS3="POSITION_BS3",K.PositionBS4="POSITION_BS4",K.PositionBS5="POSITION_BS5",K.PositionBS6="POSITION_BS6",K.PositionBS7="POSITION_BS7",K.NormalBS0="NORMAL_BS0",K.NormalBS1="NORMAL_BS1",K.NormalBS2="NORMAL_BS2",K.NormalBS3="NORMAL_BS3",K.TangentBS0="TANGENT_BS0",K.TangentBS1="TANGENT_BS1",K.TangentBS2="TANGENT_BS2",K.TangentBS3="TANGENT_BS3";var iW=Object.freeze({__proto__:null,LATEST_VERSION:tz.LATEST,get RenderLevel(){return tB},get BlendingMode(){return tU},get SideMode(){return tG},get ObscuredMode(){return tj},get ParticleEmitterShapeType(){return tW},get PluginType(){return tX},get InteractType(){return tH},get InteractBehavior(){return tY},get ItemType(){return tZ},get RenderMode(){return tq},get ParticleOrigin(){return tK},get RenderType(){return tQ},get RenderFace(){return tJ},get CameraClipMode(){return t$},END_BEHAVIOR_DESTROY:0,END_BEHAVIOR_PAUSE:1,END_BEHAVIOR_FORWARD:2,END_BEHAVIOR_PAUSE_AND_DESTROY:3,END_BEHAVIOR_FREEZE:4,END_BEHAVIOR_RESTART:5,END_BEHAVIOR_DESTROY_CHILDREN:6,CAMERA_CLIP_MODE_VERTICAL:1,CAMERA_CLIP_MODE_NORMAL:0,MESSAGE_ITEM_PHRASE_BEGIN:2,MESSAGE_ITEM_PHRASE_END:1,get ValueType(){return t0},get BezierKeyframeType(){return t1},get JSONSceneVersion(){return tz},get EndBehavior(){return t2},get ParticleInteractionBehavior(){return t3},get ShapeArcMode(){return t4},get LightType(){return t5},get ModelBoundingType(){return t6},get CameraType(){return t8},get MaterialType(){return t9},get MaterialBlending(){return t7},get RenderMode3D(){return et},get TextOverflow(){return ee},get TextSizeMode(){return ei},get TextBaseline(){return er},get TextAlignment(){return en},get TextVerticalAlign(){return ea},get TextWeight(){return es},get FontStyle(){return eo},BuiltinObjectGUID:ij,get FillType(){return eu},get TexturePaintScaleMode(){return eh},get ShapePrimitiveType(){return el},get LineCap(){return ec},get LineJoin(){return ef},get NodeDataType(){return ed},get BackgroundType(){return ep},get MultimediaType(){return em},get HevcVideoCodec(){return ev},get DataType(){return ey},get GeometryType(){return eg},get VertexFormatType(){return ex},get IndexFormatType(){return eb},get VertexBufferSemantic(){return eT}});function iX(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function iH(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return iX(t,void 0);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return iX(t,void 0)}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var iY=new Map,iZ=new Map,iq={};function iK(t){return function(e,i){iq[t]&&console.warn("Class "+t+" is already registered."),iq[t]=e}}function iQ(t){var e=t.constructor;if(iZ.get(e))return iZ.get(e);var i={};iZ.set(e,i);for(var r=t,n=e;n;){var a=iY.get(n);for(var s in a)i[s]=a[s];var o=Object.getPrototypeOf(r);if((n=Object.getPrototypeOf(o).constructor)===Object)break;r=o}return i}function iJ(t,e){return function(i,r){var n,a=(n=i.constructor,iY.get(n)||iY.set(n,{}),iY.get(n));a&&(a[r]||(a[r]={type:t,sourceName:e}))}}var i$=function(){function t(t){this.engine=t,this.guid=iR(),this.definition={},this.engine.addInstance(this)}var e=t.prototype;return e.getInstanceId=function(){return this.guid},e.setInstanceId=function(t){this.engine.removeInstance(this.guid),this.guid=t,this.engine.addInstance(this)},e.toData=function(){},e.fromData=function(t){void 0!==t.id&&this.setInstanceId(t.id)},e.dispose=function(){this.engine.removeInstance(this.guid)},t.is=function(e){return ej(e,t)&&"guid"in e},t}(),i0=function(){function t(){this.resources=[]}return t.prototype.getResource=function(t){return this.resources[t]},t}(),i1={};function i2(t){return function(e,i){i1[t]&&console.warn("NodeData Class "+t+" is already registered."),i1[t]=e}}var i3=function(){function t(){this.initializationCount=0,this.lastUpdateID=-1}var e=t.prototype;return e.getNodeData=function(){return this.asset},e.isValid=function(){return!0},e.isInitialized=function(){return this.initializationCount>0},e.initialize=function(t){this.isInitialized()?this.initializationCount++:this.initializeInternal(t)},e.shutdown=function(t){if(!this.isInitialized())throw Error("Node not initialized!");0==--this.initializationCount&&this.shutdownInternal(t)},e.isNodeActive=function(t){return this.lastUpdateID===t},e.isUpdated=function(t){return this.isNodeActive(t.updateID)},e.markNodeActive=function(t){this.lastUpdateID=t.updateID},e.initializeInternal=function(t){this.initializationCount++},e.shutdownInternal=function(t){if(this.isInitialized())throw Error("Node still initialized!");this.lastUpdateID=-1},t}(),i4=function(){function t(){}var e=t.prototype;return e.load=function(t){this.index=t.index},e.createNode=function(t,e){var i=new t;return e.nodes[this.index]=i,i.asset=this,i},t}(),i5=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.previousTime=0,e.currentTime=0,e}iG(e,t);var i=e.prototype;return i.getCurrentTime=function(){return this.currentTime},i.getPreviousTime=function(){return this.previousTime},i.getDuration=function(){return this.duration},i.getDebugInfo=function(){return{duration:this.duration,currentTime:this.currentTime,previousTime:this.previousTime}},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.previousTime=0,this.currentTime=this.previousTime,this.duration=0},e}(i3),i6=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.setValue=function(t){},e}(i3),i8=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(i6),i9=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(i6);t.AnimationGraphAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.nodeDatas=[],e.graphDataSet=new i0,e.controlParameterIDs=[],e.parameterLookupMap=new Map,e.rootNodeIndex=-1,e}return iG(e,t),e.prototype.fromData=function(t){var i=t.nodeDatas;this.rootNodeIndex=t.rootNodeIndex,this.controlParameterIDs=t.controlParameterIDs;for(var r=t.controlParameterIDs.length,n=0;n<r;n++)this.parameterLookupMap.set(t.controlParameterIDs[n],n);this.nodeDatas=[];for(var a=0;a<i.length;a++)this.nodeDatas[a]=e.createNodeData(i[a].type),this.nodeDatas[a].load(i[a]);this.graphDataSet=new i0,this.graphDataSet.resources=[];for(var s,o=iH(t.graphDataSet.resources);!(s=o()).done;){var u=s.value,h=this.engine.findObject(u);this.graphDataSet.resources.push(h)}},e.createNodeData=function(t){var e=i1[t];if(e)return new e;throw Error("Unknown node type: "+t+".")},e}(i$),t.AnimationGraphAsset=eW([iK("AnimationGraphAsset")],t.AnimationGraphAsset),(Q=eE||(eE={}))[Q.Active=0]="Active",Q[Q.Inactive=1]="Inactive";var i7=function(){function t(){this.deltaTime=0,this.updateID=0,this.branchState=0}return t.prototype.update=function(t){this.deltaTime=t,this.updateID++,this.branchState=0},t}(),rt=function(){function t(){this.nodeDatas=[],this.nodes=[]}return t.prototype.getNode=function(t){return this.nodes[t]?this.nodes[t]:this.nodeDatas[t]?(this.nodeDatas[t].instantiate(this),this.nodes[t]):null},t}();function re(){return(re=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}t.AnimationClipNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.playRate=1,e.loopAnimation=!0,e.dataSlotIndex=-1,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(ri,t).animation=t.dataSet.getResource(this.dataSlotIndex)},i.load=function(e){t.prototype.load.call(this,e);var i=re({playRate:1,loopAnimation:!0},e);this.dataSlotIndex=e.dataSlotIndex,this.playRate=i.playRate,this.loopAnimation=i.loopAnimation},e}(i4),t.AnimationClipNodeData=eW([i2(ed.AnimationClipNodeData)],t.AnimationClipNodeData);var ri=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.animation=null,e.animatable=null,e}iG(e,t);var i=e.prototype;return i.evaluate=function(t,e){if(!this.animatable)return e;this.markNodeActive(t);var i=this.getNodeData();this.previousTime=this.currentTime,this.currentTime=this.previousTime+t.deltaTime/this.duration*i.playRate,i.loopAnimation?this.currentTime>1&&(this.currentTime=this.currentTime%1):this.currentTime=e3(this.currentTime,0,1),this.sampleEvents(t);var r=this.currentTime*this.duration;return this.animatable.getPose(r,e.pose),e},i.sampleEvents=function(t){if(this.animatable&&0!==this.animatable.events.length)for(var e,i=this.previousTime*this.duration,r=this.currentTime*this.duration,n=iH(this.animatable.events);!(e=n()).done;){var a=e.value,s=a.data.startTime;(this.previousTime<=this.currentTime?i<s&&s<=r:s>i||s<=r)&&(a.currentTime=r,a.deltaTime=t.deltaTime,t.activeEvents.push(a))}},i.initializeInternal=function(e){var i,r;t.prototype.initializeInternal.call(this,e),this.duration=null!=(r=null==(i=this.animation)?void 0:i.duration)?r:0,this.previousTime=this.currentTime=0,this.animation&&(this.animatable=new rr(e.skeleton,this.animation))},e}(i5);(J=eC||(eC={}))[J.Position=0]="Position",J[J.Scale=1]="Scale",J[J.Rotation=2]="Rotation",J[J.Euler=3]="Euler";var rr=function(){function t(t,e){this.skeleton=t,this.animationClip=e,this.events=[],this.transformCurveInfos=[],this.floatCurveInfos=[],this.colorCurveInfos=[];for(var i,r=iH(e.positionCurves);!(i=r()).done;){var n=i.value;this.addTransformCurveInfo(n,0)}for(var a,s=iH(e.scaleCurves);!(a=s()).done;){var o=a.value;this.addTransformCurveInfo(o,1)}for(var u,h=iH(e.rotationCurves);!(u=h()).done;){var l=u.value;this.addTransformCurveInfo(l,2)}for(var c,f=iH(e.eulerCurves);!(c=f()).done;){var d=c.value;this.addTransformCurveInfo(d,3)}for(var p,m=iH(e.floatCurves);!(p=m()).done;){var v=p.value;this.addFloatCurveInfo(v)}for(var y,g=iH(e.colorCurves);!(y=g()).done;){var x=y.value;this.addColorCurveInfo(x)}for(var b,T=iH(this.animationClip.events);!(b=T()).done;){var E=b.value;this.events.push({data:E,currentTime:0,deltaTime:0})}}var e=t.prototype;return e.getPose=function(t,e){for(var i,r=e3(t,0,this.animationClip.duration),n=iH(this.transformCurveInfos);!(i=n()).done;){var a=i.value,s=a.curve.keyFrames.getValue(r),o=e.parentSpaceTransforms[a.boneIndex];switch(a.type){case 0:o.position.copyFrom(s);break;case 1:o.scale.copyFrom(s);break;case 2:o.rotation.copyFrom(s);break;case 3:o.euler.copyFrom(s)}}for(var u,h=iH(this.floatCurveInfos);!(u=h()).done;){var l=u.value,c=l.curve.keyFrames.getValue(r);e.floatPropertyValues[l.animatedObjectIndex]=c}for(var f,d=iH(this.colorCurveInfos);!(f=d()).done;){var p=f.value,m=p.curve.keyFrames.getValue(r);e.colorPropertyValues[p.animatedObjectIndex]=m}},e.addTransformCurveInfo=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t.path);void 0!==i&&this.transformCurveInfos.push({curve:t,boneIndex:i,type:e})},e.addFloatCurveInfo=function(t){var e=this.skeleton.pathToObjectIndex.get(t.path+t.className+t.property);void 0!==e&&this.floatCurveInfos.push({curve:t,animatedObjectIndex:e})},e.addColorCurveInfo=function(t){var e=this.skeleton.pathToObjectIndex.get(t.path+t.className+t.property);void 0!==e&&this.colorCurveInfos.push({curve:t,animatedObjectIndex:e})},t}(),rn=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),this.x=t,this.y=e,this.z=i,this.w=r}var e=t.prototype;return e.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},e.setFromEuler=function(t){return t.toQuaternion(this),this},e.setFromAxisAngle=function(e,i){var r=i/2,n=Math.sin(r),a=t.tempVec0;return a.copyFrom(e).normalize(),this.x=a.x*n,this.y=a.y*n,this.z=a.z*n,this.w=Math.cos(r),this},e.setFromVector4=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.setFromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},e.setFromRotationMatrix=function(t){var e=t.elements,i=e[0],r=e[4],n=e[8],a=e[1],s=e[5],o=e[9],u=e[2],h=e[6],l=e[10],c=i+s+l;if(c>0){var f=.5/Math.sqrt(c+1);this.w=.25/f,this.x=(h-o)*f,this.y=(n-u)*f,this.z=(a-r)*f}else if(i>s&&i>l){var d=2*Math.sqrt(1+i-s-l);this.w=(h-o)/d,this.x=.25*d,this.y=(r+a)/d,this.z=(n+u)/d,this.negate()}else if(s>l){var p=2*Math.sqrt(1+s-i-l);this.w=(n-u)/p,this.x=(r+a)/p,this.y=.25*p,this.z=(o+h)/p,this.negate()}else{var m=2*Math.sqrt(1+l-i-s);this.w=(a-r)/m,this.x=(n+u)/m,this.y=(o+h)/m,this.z=.25*m,this.negate()}return this},e.setFromUnitVectors=function(t,e){var i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this.x=-t.y,this.y=t.x,this.z=0):(this.x=0,this.y=-t.z,this.z=t.y)):(this.x=t.y*e.z-t.z*e.y,this.y=t.z*e.x-t.x*e.z,this.z=t.x*e.y-t.y*e.x),this.w=i,this.normalize()},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},e.clone=function(){return new t(this.x,this.y,this.z,this.w)},e.angleTo=function(t){return 2*Math.acos(Math.abs(e3(this.dot(t),-1,1)))},e.rotateTowards=function(t,e){var i=this.angleTo(t);return 0===i||this.slerp(t,Math.min(1,e/i)),this},e.identity=function(){return this.set(0,0,0,1)},e.invert=function(){return this.conjugate()},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.conjugate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.normalize=function(){var t=this.length();return 0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x=this.x*t,this.y=this.y*t,this.z=this.z*t,this.w=this.w*t),this},e.multiply=function(t){return this.multiplyQuaternions(this,t)},e.premultiply=function(t){return this.multiplyQuaternions(t,this)},e.multiplyQuaternions=function(t,e){var i=t.x,r=t.y,n=t.z,a=t.w,s=e.x,o=e.y,u=e.z,h=e.w;return this.x=i*h+a*s+r*u-n*o,this.y=r*h+a*o+n*s-i*u,this.z=n*h+a*u+i*o-r*s,this.w=a*h-i*s-r*o-n*u,this},e.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copyFrom(t);var i=this.x,r=this.y,n=this.z,a=this.w,s=a*t.w+i*t.x+r*t.y+n*t.z;if(s<0?(this.w=-t.w,this.x=-t.x,this.y=-t.y,this.z=-t.z,s=-s):this.copyFrom(t),s>=1)return this.w=a,this.x=i,this.y=r,this.z=n,this;var o=1-s*s;if(o<=Number.EPSILON){var u=1-e;return this.w=u*a+e*this.w,this.x=u*i+e*this.x,this.y=u*r+e*this.y,this.z=u*n+e*this.z,this.normalize(),this}var h=Math.sqrt(o),l=Math.atan2(h,s),c=Math.sin((1-e)*l)/h,f=Math.sin(e*l)/h;return this.w=a*c+this.w*f,this.x=i*c+this.x*f,this.y=r*c+this.y*f,this.z=n*c+this.z*f,this},e.slerpQuaternions=function(t,e,i){return this.copyFrom(t).slerp(e,i)},e.rotateVector3=function(t,e){var i=this.x,r=this.y,n=this.z,a=this.w,s=t.x,o=t.y,u=t.z,h=a*s+r*u-n*o,l=a*o+n*s-i*u,c=a*u+i*o-r*s,f=-i*s-r*o-n*u,d=null!=e?e:t;return d.x=h*a+-(f*i)+-(l*n)- -(c*r),d.y=l*a+-(f*r)+-(c*i)- -(h*n),d.z=c*a+-(f*n)+-(h*r)- -(l*i),d},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.toArray=function(){return[this.x,this.y,this.z,this.w]},e.toVector4=function(t){return t.set(this.x,this.y,this.z,this.w)},e.toEuler=function(t){return t.setFromQuaternion(this)},e.toMatrix4=function(t){return t.compose(e5.ZERO,this,e5.ONE)},t.fromEuler=function(e){return new t().setFromEuler(e)},t.fromAxisAngle=function(e,i){return new t().setFromAxisAngle(e,i)},t.fromVector4=function(e){return new t().setFromVector4(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromRotationMatrix=function(e){return new t().setFromRotationMatrix(e)},t.fromUnitVectors=function(e,i){return new t().setFromUnitVectors(e,i)},t}();rn.tempVec0=new e5;var ra=new rn,rs=function(){},ro=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.blendVector3=function(t,e,i,r){r.x=t.x+(e.x-t.x)*i,r.y=t.y+(e.y-t.y)*i,r.z=t.z+(e.z-t.z)*i},i.blendQuaternion=function(t,e,i,r){r.copyFrom(t).slerp(e,i)},i.blendEuler=function(t,e,i,r){this.lerpEuler(t,e,i,r)},i.blendFloat=function(t,e,i){return t+(e-t)*i},i.blendColor=function(t,e,i,r){r.r=t.r+(e.r-t.r)*i,r.g=t.g+(e.g-t.g)*i,r.b=t.b+(e.b-t.b)*i,r.a=t.a+(e.a-t.a)*i},i.lerpEuler=function(t,e,i,r){r.x=this.lerpAngle(t.x,e.x,i),r.y=this.lerpAngle(t.y,e.y,i),r.z=this.lerpAngle(t.z,e.z,i)},i.normalizeAngle=function(t){return(t%360+360)%360},i.shortestAngleDiff=function(t,e){var i=this.normalizeAngle(e)-this.normalizeAngle(t);return i>180&&(i-=360),i<-180&&(i+=360),i},i.lerpAngle=function(t,e,i){var r=this.shortestAngleDiff(t,e);return this.normalizeAngle(t+r*i)},e}(rs),ru=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.blendVector3=function(t,e,i,r){r.x=t.x+e.x*i,r.y=t.y+e.y*i,r.z=t.z+e.z*i},i.blendQuaternion=function(t,e,i,r){var n=ra.copyFrom(t).multiply(e);r.copyFrom(t).slerp(n,i)},i.blendEuler=function(t,e,i,r){this.blendVector3(t,e,i,r)},i.blendFloat=function(t,e,i){return t+e*i},i.blendColor=function(t,e,i,r){r.r=t.r+e.r*i,r.g=t.g+e.g*i,r.b=t.b+e.b*i,r.a=t.a+e.a*i},e}(rs),rh=function(){function t(){}return t.localBlend=function(e,i,r,n){t.localBlendInternal(e,i,r,n,t.normalBlendFunction)},t.additiveBlend=function(e,i,r,n){t.localBlendInternal(e,i,r,n,t.additiveBlendFunction)},t.localBlendInternal=function(t,e,i,r,n){for(var a=0;a<t.parentSpaceTransforms.length;a++){var s=t.parentSpaceTransforms[a],o=e.parentSpaceTransforms[a],u=r.parentSpaceTransforms[a],h=s.position,l=o.position,c=u.position;n.blendVector3(h,l,i,c);var f=s.rotation,d=o.rotation,p=u.rotation;n.blendQuaternion(f,d,i,p);var m=s.scale,v=o.scale,y=u.scale;n.blendVector3(m,v,i,y);var g=s.euler,x=o.euler,b=u.euler;n.blendEuler(g,x,i,b)}for(var T=0;T<t.floatPropertyValues.length;T++){var E=t.floatPropertyValues[T],C=e.floatPropertyValues[T];r.floatPropertyValues[T]=n.blendFloat(E,C,i)}for(var S=0;S<t.colorPropertyValues.length;S++){var _=t.colorPropertyValues[S],w=e.colorPropertyValues[S],M=r.colorPropertyValues[S];n.blendColor(_,w,i,M)}},t}();rh.normalBlendFunction=new ro,rh.additiveBlendFunction=new ru;var rl=function(){function t(t){this.position=new e5,this.rotation=new rn,this.scale=new e5,this.euler=new e5,t&&(this.position.copyFrom(t.position),this.rotation.copyFrom(t.quat),this.scale.copyFrom(t.scale),this.euler.copyFrom(t.rotation))}return t.prototype.copyFrom=function(t){return this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scale.copyFrom(t.scale),this.euler.copyFrom(t.euler),this},t}(),rc=function(){function t(t){this.skeleton=t,this.parentSpaceTransforms=[],this.floatPropertyValues=[],this.colorPropertyValues=[];for(var e,i=iH(t.parentSpaceTransforms);!(e=i()).done;){var r=e.value;this.parentSpaceTransforms.push(new rl().copyFrom(r))}for(var n,a=iH(t.defaultFloatPropertyValues);!(n=a()).done;){var s=n.value;this.floatPropertyValues.push(s)}for(var o,u=iH(t.defaultColorPropertyValues);!(o=u()).done;){var h=o.value;this.colorPropertyValues.push(new e8().copyFrom(h))}}var e=t.prototype;return e.setPosition=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].position.copyFrom(e)},e.setRotation=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].rotation.copyFrom(e)},e.setEuler=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].euler.copyFrom(e)},e.setScale=function(t,e){var i=this.skeleton.pathToBoneIndex.get(t);void 0!==i&&this.parentSpaceTransforms[i].scale.copyFrom(e)},e.setFloat=function(t,e){var i=this.skeleton.pathToObjectIndex.get(t);void 0!==i&&(this.floatPropertyValues[i]=e)},e.copyFrom=function(t){for(var e=0;e<this.parentSpaceTransforms.length;e++)this.parentSpaceTransforms[e].copyFrom(t.parentSpaceTransforms[e]);for(var i=0;i<this.colorPropertyValues.length;i++)this.colorPropertyValues[i].copyFrom(t.colorPropertyValues[i]);for(var r=0;r<this.floatPropertyValues.length;r++)this.floatPropertyValues[r]=t.floatPropertyValues[r]},t}(),rf=function(t){this.pose=new rc(t)};t.ApplyAdditiveNodeData=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rd,t);e.baseNode=t.getNode(this.baseNodeIndex),e.additiveNode=t.getNode(this.additiveNodeIndex),e.inputParameterValueNode=t.getNode(this.inputParameterValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.baseNodeIndex=e.baseNodeIndex,this.additiveNodeIndex=e.additiveNodeIndex,this.inputParameterValueNodeIndex=e.inputParameterValueNodeIndex},e}(i4),t.ApplyAdditiveNodeData=eW([i2(ed.ApplyAdditiveNodeData)],t.ApplyAdditiveNodeData);var rd=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseNode=null,e.additiveNode=null,e.inputParameterValueNode=null,e}iG(e,t);var i=e.prototype;return i.initializeInternal=function(e){var i,r,n;t.prototype.initializeInternal.call(this,e),this.baseNodeResult=new rf(e.skeleton),this.additiveNodeResult=new rf(e.skeleton),null==(i=this.baseNode)||i.initialize(e),null==(r=this.additiveNode)||r.initialize(e),null==(n=this.inputParameterValueNode)||n.initialize(e)},i.shutdownInternal=function(e){var i,r,n;null==(i=this.baseNode)||i.shutdown(e),null==(r=this.additiveNode)||r.shutdown(e),null==(n=this.inputParameterValueNode)||n.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){if(!this.inputParameterValueNode)return e;this.markNodeActive(t);var i=this.inputParameterValueNode.getValue(t);return this.baseNode&&!this.additiveNode?(this.baseNode.evaluate(t,this.baseNodeResult),this.applyAdditive(this.baseNodeResult.pose,this.additiveNodeResult.pose,i,e.pose)):this.baseNode&&this.additiveNode&&(this.baseNode.evaluate(t,this.baseNodeResult),this.additiveNode.evaluate(t,this.additiveNodeResult),this.applyAdditive(this.baseNodeResult.pose,this.additiveNodeResult.pose,i,e.pose)),e},i.applyAdditive=function(t,e,i,r){rh.additiveBlend(t,e,i,r)},e}(i5);t.BlendNodeData=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rp,t);e.source0=t.getNode(this.sourceNodeIndex0),e.source1=t.getNode(this.sourceNodeIndex1),e.inputParameterValueNode=t.getNode(this.inputParameterValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.sourceNodeIndex0=e.sourceNodeIndex0,this.sourceNodeIndex1=e.sourceNodeIndex1,this.inputParameterValueNodeIndex=e.inputParameterValueNodeIndex},e}(i4),t.BlendNodeData=eW([i2(ed.BlendNodeData)],t.BlendNodeData);var rp=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.source0=null,e.source1=null,e.inputParameterValueNode=null,e}iG(e,t);var i=e.prototype;return i.initializeInternal=function(e){var i,r,n;t.prototype.initializeInternal.call(this,e),this.source0Result=new rf(e.skeleton),this.source1Result=new rf(e.skeleton),null==(i=this.source0)||i.initialize(e),null==(r=this.source1)||r.initialize(e),null==(n=this.inputParameterValueNode)||n.initialize(e)},i.shutdownInternal=function(e){var i,r,n;null==(i=this.source0)||i.shutdown(e),null==(r=this.source1)||r.shutdown(e),null==(n=this.inputParameterValueNode)||n.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){if(!this.inputParameterValueNode)return e;this.markNodeActive(t);var i=this.inputParameterValueNode.getValue(t);return this.source0&&!this.source1?(this.source0.evaluate(t,this.source0Result),this.localBlend(this.source0Result.pose,this.source1Result.pose,i,e.pose)):this.source0&&this.source1&&(this.source0.evaluate(t,this.source0Result),this.source1.evaluate(t,this.source1Result),this.localBlend(this.source0Result.pose,this.source1Result.pose,i,e.pose)),e},i.localBlend=function(t,e,i,r){rh.localBlend(t,e,i,r)},e}(i5);t.AndNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodeIndices=[],e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rm,t),r=iH(this.conditionNodeIndices);!(e=r()).done;){var n=e.value;i.conditionNodes.push(t.getNode(n))}},i.load=function(e){t.prototype.load.call(this,e),this.conditionNodeIndices=e.conditionNodeIndices},e}(i4),t.AndNodeData=eW([i2(ed.AndNodeData)],t.AndNodeData);var rm=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodes=[],e.result=!1,e}iG(e,t);var i=e.prototype;return i.getValue=function(t){if(!this.isUpdated(t)){this.markNodeActive(t),this.result=!0;for(var e,i=iH(this.conditionNodes);!(e=i()).done;)if(!e.value.getValue(t)){this.result=!1;break}}return this.result},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e);for(var i,r=iH(this.conditionNodes);!(i=r()).done;)i.value.initialize(e);this.result=!1},i.shutdownInternal=function(e){for(var i,r=iH(this.conditionNodes);!(i=r()).done;)i.value.shutdown(e);t.prototype.shutdownInternal.call(this,e)},e}(i9);t.OrNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodeIndices=[],e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rv,t),r=iH(this.conditionNodeIndices);!(e=r()).done;){var n=e.value;i.conditionNodes.push(t.getNode(n))}},i.load=function(e){t.prototype.load.call(this,e),this.conditionNodeIndices=e.conditionNodeIndices},e}(i4),t.OrNodeData=eW([i2(ed.OrNodeData)],t.OrNodeData);var rv=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.conditionNodes=[],e.result=!1,e}iG(e,t);var i=e.prototype;return i.getValue=function(t){if(!this.isUpdated(t)){this.markNodeActive(t),this.result=!1;for(var e,i=iH(this.conditionNodes);!(e=i()).done;)if(e.value.getValue(t)){this.result=!0;break}}return this.result},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e);for(var i,r=iH(this.conditionNodes);!(i=r()).done;)i.value.initialize(e);this.result=!1},i.shutdownInternal=function(e){for(var i,r=iH(this.conditionNodes);!(i=r()).done;)i.value.shutdown(e);t.prototype.shutdownInternal.call(this,e)},e}(i9);t.NotNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(ry,t).inputValueNode=t.getNode(this.inputValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex},e}(i4),t.NotNodeData=eW([i2(ed.NotNodeData)],t.NotNodeData);var ry=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.result=!1,e}iG(e,t);var i=e.prototype;return i.getValue=function(t){return!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&(this.result=!this.inputValueNode.getValue(t))),this.result},i.initializeInternal=function(e){var i;t.prototype.initializeInternal.call(this,e),null==(i=this.inputValueNode)||i.initialize(e),this.result=!1},i.shutdownInternal=function(e){var i;null==(i=this.inputValueNode)||i.shutdown(e),t.prototype.shutdownInternal.call(this,e)},e}(i9);t.ConstFloatNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rg,t).value=this.value},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(i4),t.ConstFloatNodeData=eW([i2(ed.ConstFloatNodeData)],t.ConstFloatNodeData);var rg=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}return iG(e,t),e.prototype.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},e}(i8);t.ConstBoolNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!0,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rx,t).value=this.value},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(i4),t.ConstBoolNodeData=eW([i2(ed.ConstBoolNodeData)],t.ConstBoolNodeData);var rx=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!0,e}return iG(e,t),e.prototype.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},e}(i9);t.ControlParameterFloatNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rb,t).setValue(this.value)},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(i4),t.ControlParameterFloatNodeData=eW([i2(ed.ControlParameterFloatNodeData)],t.ControlParameterFloatNodeData);var rb=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=0,e}iG(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i8);t.ControlParameterBoolNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rT,t).setValue(this.value)},i.load=function(e){t.prototype.load.call(this,e),this.value=e.value},e}(i4),t.ControlParameterBoolNodeData=eW([i2(ed.ControlParameterBoolNodeData)],t.ControlParameterBoolNodeData);var rT=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iG(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i9);t.ControlParameterTriggerNodeData=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rE,t)},i.load=function(e){t.prototype.load.call(this,e)},e}(i4),t.ControlParameterTriggerNodeData=eW([i2(ed.ControlParameterTriggerNodeData)],t.ControlParameterTriggerNodeData);var rE=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=!1,e}iG(e,t);var i=e.prototype;return i.getValue=function(t){return this.isUpdated(t)||this.markNodeActive(t),this.value},i.setValue=function(t){this.value=t},e}(i9);t.LayerBlendNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseNodeIndex=-1,e.layerDatas=[],e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rC,t);e.baseLayerNode=t.getNode(this.baseNodeIndex);for(var i,r=iH(this.layerDatas);!(i=r()).done;){var n=i.value;e.layers.push({inputNode:t.getNode(n.inputNodeIndex),weightValueNode:t.getNode(n.weightValueNodeIndex),weight:0})}},i.load=function(e){if(t.prototype.load.call(this,e),this.baseNodeIndex=null!=(i=e.baseNodeIndex)?i:-1,e.layerDatas)for(var i,r,n=iH(e.layerDatas);!(r=n()).done;){var a=r.value;this.layerDatas.push(re({inputNodeIndex:-1,weightValueNodeIndex:-1},a))}},e}(i4),t.LayerBlendNodeData=eW([i2(ed.LayerBlendNodeData)],t.LayerBlendNodeData);var rC=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.baseLayerNode=null,e.layers=[],e}iG(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.layerNodeResult=new rf(e.skeleton),null==(i=this.baseLayerNode)||i.initialize(e);for(var i,r,n=iH(this.layers);!(r=n()).done;){var a,s,o=r.value;null==(a=o.inputNode)||a.initialize(e),null==(s=o.weightValueNode)||s.initialize(e)}},i.shutdownInternal=function(e){null==(i=this.baseLayerNode)||i.shutdown(e);for(var i,r,n=iH(this.layers);!(r=n()).done;){var a,s,o=r.value;null==(a=o.inputNode)||a.shutdown(e),null==(s=o.weightValueNode)||s.shutdown(e)}t.prototype.shutdownInternal.call(this,e)},i.evaluate=function(t,e){return this.baseLayerNode&&this.baseLayerNode.isValid()&&(this.markNodeActive(t),this.previousTime=this.baseLayerNode.getCurrentTime(),e=this.baseLayerNode.evaluate(t,e),this.currentTime=this.baseLayerNode.getCurrentTime(),this.duration=this.baseLayerNode.getDuration(),this.updateLayers(t,e)),e},i.updateLayers=function(t,e){for(var i,r=iH(this.layers);!(i=r()).done;){var n=i.value;if(n.inputNode&&n.weightValueNode){this.layerNodeResult.pose.copyFrom(e.pose),n.inputNode.evaluate(t,this.layerNodeResult);var a=n.weightValueNode.getValue(t);rh.localBlend(e.pose,this.layerNodeResult.pose,a,e.pose)}}return e},e}(i5);t.EqualNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e.comparandValueNodeIndex=-1,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rS,t);e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex,this.comparandValueNodeIndex=e.comparandValueNodeIndex},e}(i4),t.EqualNodeData=eW([i2(ed.EqualNodeData)],t.EqualNodeData);var rS=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.comparandValueNode=null,e.result=!1,e}iG(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.inputValueNode&&this.inputValueNode.initialize(e),this.comparandValueNode&&this.comparandValueNode.initialize(e)},i.shutdownInternal=function(e){this.inputValueNode&&this.inputValueNode.shutdown(e),this.comparandValueNode&&this.comparandValueNode.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.getValue=function(t){if(!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&this.comparandValueNode)){var e=this.inputValueNode.getValue(t),i=this.comparandValueNode.getValue(t);this.result=e===i}return this.result},e}(i9),r_=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNodeIndex=-1,e.comparandValueNodeIndex=-1,e}return iG(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.inputValueNodeIndex=e.inputValueNodeIndex,this.comparandValueNodeIndex=e.comparandValueNodeIndex},e}(i4);($=eS||(eS={}))[$.GreaterThan=0]="GreaterThan",$[$.LessThan=1]="LessThan";var rw=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.inputValueNode=null,e.comparandValueNode=null,e.comparison=0,e.result=!1,e}iG(e,t);var i=e.prototype;return i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.inputValueNode&&this.inputValueNode.initialize(e),this.comparandValueNode&&this.comparandValueNode.initialize(e)},i.shutdownInternal=function(e){this.inputValueNode&&this.inputValueNode.shutdown(e),this.comparandValueNode&&this.comparandValueNode.shutdown(e),t.prototype.shutdownInternal.call(this,e)},i.getValue=function(t){if(!this.isUpdated(t)&&(this.markNodeActive(t),this.inputValueNode&&this.comparandValueNode)){var e=this.inputValueNode.getValue(t),i=this.comparandValueNode.getValue(t);switch(this.comparison){case 0:this.result=e>i;break;case 1:this.result=e<i}}return this.result},e}(i9);t.GreaterNodeData=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.instantiate=function(t){var e=this.createNode(rw,t);e.comparison=0,e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},e}(r_),t.GreaterNodeData=eW([i2(ed.GreaterNodeData)],t.GreaterNodeData),t.LessNodeData=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.instantiate=function(t){var e=this.createNode(rw,t);e.comparison=1,e.inputValueNode=t.getNode(this.inputValueNodeIndex),e.comparandValueNode=t.getNode(this.comparandValueNodeIndex)},e}(r_),t.LessNodeData=eW([i2(ed.LessNodeData)],t.LessNodeData),t.StateMachineNodeData=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.instantiate=function(t){for(var e,i=this.createNode(rM,t),r=iH(this.stateDatas);!(e=r()).done;){var n=e.value,a={stateNode:t.getNode(n.stateNodeIndex),transitions:[]};i.states.push(a);for(var s,o=iH(n.transitionDatas);!(s=o()).done;){var u=s.value,h={transitionNode:t.getNode(u.transitionNodeIndex),conditionNode:t.getNode(u.conditionNodeIndex),targetStateIndex:u.targetStateIndex};a.transitions.push(h)}}},i.load=function(e){t.prototype.load.call(this,e),this.stateDatas=e.stateDatas,this.defaultStateIndex=e.defaultStateIndex,this.machineName=e.machineName},e}(i4),t.StateMachineNodeData=eW([i2(ed.StateMachineNodeData)],t.StateMachineNodeData);var rM=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.states=[],e.activeTransition=null,e.activeStateIndex=-1,e}iG(e,t);var i=e.prototype;return i.getCurrentStateName=function(){return this.states[this.activeStateIndex].stateNode.getNodeData().stateName},i.evaluate=function(t,e){if(this.markNodeActive(t),null!==this.activeTransition&&this.activeTransition.isComplete(t)&&(this.activeTransition.shutdown(t),this.activeTransition=null),null===this.activeTransition){var i=this.states[this.activeStateIndex].stateNode;e=i.evaluate(t,e),this.duration=i.getDuration(),this.previousTime=i.getPreviousTime(),this.currentTime=i.getCurrentTime()}else e=this.activeTransition.evaluate(t,e),this.duration=this.activeTransition.getDuration(),this.previousTime=this.activeTransition.getPreviousTime(),this.currentTime=this.activeTransition.getCurrentTime();return t.branchState===eE.Active&&this.evaluateTransitions(t,e),e},i.evaluateTransitions=function(t,e){for(var i=this.states[this.activeStateIndex],r=-1,n=i.transitions.length,a=0;a<n;a++){var s=i.transitions[a];if(-1===s.targetStateIndex)throw Error("Invalid target state index.");if(!this.states[s.targetStateIndex].stateNode.isTransitioning()){var o=!1;if(s.transitionNode.hasExitTime){var u=i.stateNode;u.getElapsedTimeInState()/u.getDuration()>s.transitionNode.exitTime&&(o=!0)}else null!==s.conditionNode&&s.conditionNode.getValue(t)&&(o=!0);if(o){r=a;break}}}if(-1!==r){var h=i.transitions[r];h.transitionNode.initialize(t),e=null!==this.activeTransition?h.transitionNode.startTransitionFromTransition(t,e,this.activeTransition,e):h.transitionNode.startTransitionFromState(t,e,this.states[this.activeStateIndex].stateNode,e),this.activeTransition=h.transitionNode,this.shutdownTransitionConditions(t),this.activeStateIndex=h.targetStateIndex,this.initializeTransitionConditions(t),this.duration=this.states[this.activeStateIndex].stateNode.getDuration(),this.previousTime=this.states[this.activeStateIndex].stateNode.getPreviousTime(),this.currentTime=this.states[this.activeStateIndex].stateNode.getCurrentTime()}},i.selectDefaultState=function(t){return this.getNodeData().defaultStateIndex},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.activeStateIndex=this.selectDefaultState(e);var i=this.states[this.activeStateIndex].stateNode;i.initialize(e),this.duration=i.getDuration(),this.previousTime=i.getPreviousTime(),this.currentTime=i.getCurrentTime(),this.initializeTransitionConditions(e)},i.shutdownInternal=function(e){null!==this.activeTransition&&this.activeTransition.shutdown(e),this.shutdownTransitionConditions(e),this.states[this.activeStateIndex].stateNode.shutdown(e),this.activeStateIndex=-1,this.activeTransition=null,t.prototype.shutdownInternal.call(this,e)},i.initializeTransitionConditions=function(t){for(var e,i=iH(this.states[this.activeStateIndex].transitions);!(e=i()).done;){var r=e.value;null!==r.conditionNode&&r.conditionNode.initialize(t)}},i.shutdownTransitionConditions=function(t){for(var e,i=iH(this.states[this.activeStateIndex].transitions);!(e=i()).done;){var r=e.value;null!==r.conditionNode&&r.conditionNode.shutdown(t)}},e}(i5);t.TransitionState=void 0,(tt=t.TransitionState||(t.TransitionState={}))[tt.None=0]="None",tt[tt.TransitioningIn=1]="TransitioningIn",tt[tt.TransitioningOut=2]="TransitioningOut",t.StateNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.childNodeIndex=-1,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){this.createNode(rA,t).childNode=t.getNode(this.childNodeIndex)},i.load=function(e){t.prototype.load.call(this,e),this.childNodeIndex=e.childNodeIndex,this.stateName=e.stateName},e}(i4),t.StateNodeData=eW([i2(ed.StateNodeData)],t.StateNodeData);var rA=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.childNode=null,e.transitionState=0,e.elapsedTimeInState=0,e.isFirstStateUpdate=!1,e}iG(e,t);var i=e.prototype;return i.isTransitioning=function(){return 0!==this.transitionState},i.isTransitioningIn=function(){return 1===this.transitionState},i.isTransitioningOut=function(){return 2===this.transitionState},i.startTransitionIn=function(t){this.transitionState=1},i.startTransitionOut=function(t){this.transitionState=2},i.setTransitioningState=function(t){this.transitionState=t},i.getElapsedTimeInState=function(){return this.elapsedTimeInState},i.evaluate=function(t,e){return this.markNodeActive(t),null!==this.childNode&&this.childNode.isValid()&&(e=this.childNode.evaluate(t,e),this.duration=this.childNode.getDuration(),this.previousTime=this.childNode.getPreviousTime(),this.currentTime=this.childNode.getCurrentTime()),this.elapsedTimeInState+=t.deltaTime,this.isFirstStateUpdate=!1,e},i.initializeInternal=function(e){t.prototype.initializeInternal.call(this,e),this.transitionState=0,this.elapsedTimeInState=0,this.previousTime=this.currentTime=0,this.duration=0,null!==this.childNode&&(this.childNode.initialize(e),this.childNode.isValid()&&(this.duration=this.childNode.getDuration(),this.previousTime=this.childNode.getPreviousTime(),this.currentTime=this.childNode.getCurrentTime())),this.isFirstStateUpdate=!0},i.shutdownInternal=function(e){null!==this.childNode&&this.childNode.shutdown(e),this.transitionState=0,t.prototype.shutdownInternal.call(this,e)},e}(i5);t.SourceType=void 0,(te=t.SourceType||(t.SourceType={}))[te.State=0]="State",te[te.Transition=1]="Transition",te[te.CachedPose=2]="CachedPose",t.TransitionNodeData=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.hasExitTime=!1,e.exitTime=.75,e.targetStateNodeIndex=-1,e}iG(e,t);var i=e.prototype;return i.instantiate=function(t){var e=this.createNode(rP,t);e.targetNode=t.getNode(this.targetStateNodeIndex),e.hasExitTime=this.hasExitTime,e.exitTime=this.exitTime},i.load=function(e){t.prototype.load.call(this,e),this.duration=e.duration,this.hasExitTime=e.hasExitTime,this.exitTime=e.exitTime,this.targetStateNodeIndex=e.targetStateNodeIndex},e}(i4),t.TransitionNodeData=eW([i2(ed.TransitionNodeData)],t.TransitionNodeData);var rP=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.hasExitTime=!1,t.exitTime=.75,t.transitionLength=0,t.transitionProgress=0,t.blendWeight=0,t.sourceNode=null,t.sourceType=0,t.blendedDuration=0,t}iG(i,e);var r=i.prototype;return r.evaluate=function(t,e){iy(this.sourceNode),this.markNodeActive(t),this.isSourceATransition()&&this.getSourceTransitionNode().isComplete(t)&&this.endSourceTransition(t),this.transitionProgress=this.transitionProgress+t.deltaTime/this.transitionLength,this.transitionProgress=e3(this.transitionProgress,0,1),this.calculateBlendWeight();var i=this.sourceNodeResult,r=t.branchState;t.branchState=eE.Inactive,i=this.sourceNode.evaluate(t,i),t.branchState=r;var n=this.targetNode.evaluate(t,this.targetNodeResult);if(this.registerPoseTasksAndUpdateRootMotion(i,n,e),this.blendedDuration=e2(this.sourceNode.getDuration(),this.targetNode.getDuration(),this.blendWeight),this.blendedDuration>0){var a=t.deltaTime/this.blendedDuration;this.previousTime=this.currentTime,this.currentTime=(this.currentTime+a)%1}else this.previousTime=this.currentTime=1;return this.duration=this.targetNode.getDuration(),e},r.isComplete=function(t){return this.transitionLength<=0||this.transitionProgress+t.deltaTime/this.transitionLength>=1},r.getProgressPercentage=function(){return this.transitionProgress},r.getSourceType=function(){return this.sourceType},r.isSourceATransition=function(){return 1===this.sourceType},r.isSourceAState=function(){return 0===this.sourceType},r.startTransitionFromState=function(t,e,i,r){return this.sourceNode=i,this.sourceType=0,this.initializeTargetStateAndUpdateTransition(t,e,r)},r.startTransitionFromTransition=function(t,e,i,r){return this.sourceNode=i,this.sourceType=1,this.initializeTargetStateAndUpdateTransition(t,e,r)},r.getSourceStateNode=function(){return this.sourceNode},r.getSourceTransitionNode=function(){return this.sourceNode},r.notifyNewTransitionStarting=function(t,e){if(this.isSourceATransition()){var i=this.getSourceTransitionNode().targetNode;i===e&&(this.sourceType=2,i.shutdown(t),this.sourceNode=null)}else this.isSourceAState()&&this.sourceNode===e&&(this.sourceType=2,this.sourceNode.shutdown(t),this.sourceNode=null);this.isSourceATransition()&&this.getSourceTransitionNode().notifyNewTransitionStarting(t,e)},r.initializeInternal=function(t){e.prototype.initializeInternal.call(this,t),this.sourceNodeResult=new rf(t.skeleton),this.targetNodeResult=new rf(t.skeleton),this.transitionLength=this.getNodeData().duration,this.transitionProgress=0,this.blendWeight=0},r.shutdownInternal=function(i){this.targetNode.setTransitioningState(t.TransitionState.None),this.currentTime=1,this.sourceNode&&(this.isSourceATransition()&&this.endSourceTransition(i),this.sourceNode.shutdown(i),this.sourceNode=null),e.prototype.shutdownInternal.call(this,i)},r.endSourceTransition=function(e){var i,r=this.getSourceTransitionNode().targetNode;null==(i=this.sourceNode)||i.shutdown(e),this.sourceNode=r,this.sourceType=0,this.getSourceStateNode().setTransitioningState(t.TransitionState.TransitioningOut)},r.initializeTargetStateAndUpdateTransition=function(t,e,i){this.markNodeActive(t);var r=this.targetNodeResult;return 0===this.sourceType&&this.getSourceStateNode().startTransitionOut(t),this.targetNode.initialize(t),this.targetNode.startTransitionIn(t),r=this.targetNode.evaluate(t,r),this.calculateBlendWeight(),this.registerPoseTasksAndUpdateRootMotion(e,r,i),this.previousTime=0,this.currentTime=0,this.blendedDuration=e2(this.sourceNode.getDuration(),this.targetNode.getDuration(),this.blendWeight),this.duration=this.targetNode.getDuration(),i},r.calculateBlendWeight=function(){0===this.transitionLength?this.blendWeight=1:(this.blendWeight=this.transitionProgress,this.blendWeight=e3(this.blendWeight,0,1))},r.registerPoseTasksAndUpdateRootMotion=function(t,e,i){var r=this.blendWeight;rh.localBlend(t.pose,e.pose,r,i.pose)},i}(i5);(ti=e_||(e_={}))[ti.Float=0]="Float",ti[ti.Color=1]="Color";var rI=function(){function t(t,e){this.rootBone=t,this.useEuler=!1,this.pathToObjectIndex=new Map,this.floatAnimatedObjects=[],this.defaultFloatPropertyValues=[],this.colorAnimatedObjects=[],this.defaultColorPropertyValues=[],this.animatedTransforms=[],this.parentSpaceTransforms=[],this.pathToBoneIndex=new Map;for(var i,r=iH(e.position);!(i=r()).done;){var n=i.value;this.addReferenceTransform(n)}for(var a,s=iH(e.rotation);!(a=s()).done;){var o=a.value;this.addReferenceTransform(o)}for(var u,h=iH(e.scale);!(u=h()).done;){var l=u.value;this.addReferenceTransform(l)}for(var c,f=iH(e.euler);!(c=f()).done;){var d=c.value;this.addReferenceTransform(d),this.useEuler=!0}for(var p=0;p<e.floats.length;p++){var m=e.floats[p];this.addRecordedProperty(m.path,m.className,m.property,0)}for(var v=0;v<e.colors.length;v++){var y=e.colors[v];this.addRecordedProperty(y.path,y.className,y.property,1)}}var e=t.prototype;return e.addReferenceTransform=function(t){if(!this.pathToBoneIndex.get(t)){var e=this.findTarget(t);e&&(this.parentSpaceTransforms.push(new rl(e.transform)),this.animatedTransforms.push(e.transform),this.pathToBoneIndex.set(t,this.parentSpaceTransforms.length-1))}},e.addRecordedProperty=function(t,e,i,r){var n,a=t+e+i;if(void 0===this.pathToObjectIndex.get(a)){var s=this.findTarget(t);if(s){(n="VFXItem"===e?s:s.getComponent(iq[e]))||console.error("The "+e+" Component was not found.");for(var o=i.split("."),u=o[o.length-1],h=n,l=0;l<o.length-1;l++){var c=h[o[l]];void 0===c&&console.error("The "+o[l]+" property of "+h+" was not found."),h=c}var f={target:n,propertyPath:i,directTarget:h,propertyName:u};switch(r){case 0:this.floatAnimatedObjects.push(f),this.defaultFloatPropertyValues.push(h[u]),this.pathToObjectIndex.set(a,this.floatAnimatedObjects.length-1);break;case 1:this.colorAnimatedObjects.push(f),this.defaultColorPropertyValues.push(new e8().copyFrom(h[u])),this.pathToObjectIndex.set(a,this.colorAnimatedObjects.length-1)}}}},e.findTarget=function(t){if(""===t)return this.rootBone;for(var e,i=t.split("/"),r=this.rootBone,n=iH(i);!(e=n()).done;){var a=e.value,s=r.find(a);if(!s)return null;r=s}return r},t}(),rR=function(){function t(t,e){this.graphAsset=t,this.nodes=[],this.activeEvents=[],this.context=new i7;for(var i,r={position:[],scale:[],rotation:[],euler:[],floats:[],colors:[]},n=iH(t.graphDataSet.resources);!(i=n()).done;){var a=i.value;if(a){for(var s,o=iH(a.positionCurves);!(s=o()).done;){var u=s.value;r.position.push(u.path)}for(var h,l=iH(a.rotationCurves);!(h=l()).done;){var c=h.value;r.rotation.push(c.path)}for(var f,d=iH(a.scaleCurves);!(f=d()).done;){var p=f.value;r.scale.push(p.path)}for(var m,v=iH(a.eulerCurves);!(m=v()).done;){var y=m.value;r.euler.push(y.path)}for(var g,x=iH(a.floatCurves);!(g=x()).done;){var b=g.value;r.floats.push(b)}for(var T,E=iH(a.colorCurves);!(T=E()).done;){var C=T.value;r.colors.push(C)}}}this.skeleton=new rI(e,r),this.result=new rf(this.skeleton),this.context.skeleton=this.skeleton,this.context.activeEvents=this.activeEvents;var S=new rt;S.nodes=this.nodes,S.nodeDatas=t.nodeDatas,S.dataSet=t.graphDataSet;for(var _=0;_<t.nodeDatas.length;_++)S.nodes[_]||t.nodeDatas[_].instantiate(S);this.rootNode=this.nodes[t.rootNodeIndex]}var e=t.prototype;return e.evaluateGraph=function(t){this.activeEvents.length=0,this.context.update(t),this.rootNode.isInitialized()||this.resetGraphState(),this.rootNode&&(this.result=this.rootNode.evaluate(this.context,this.result));for(var e=0;e<this.getNumControlParameters();e++){var i=this.nodes[e];ej(i,rE)&&i.setValue(!1)}return this.result},e.isInitialized=function(){return this.rootNode&&this.rootNode.isInitialized()},e.isNodeActive=function(t){return this.isControlParameter(t)||this.nodes[t].isNodeActive(this.context.updateID)},e.getStateMachineNode=function(t){for(var e,i=null,r=iH(this.nodes);!(e=r()).done;){var n=e.value;ej(n,rM)&&n.getNodeData().machineName===t&&(i=n)}return i},e.resetGraphState=function(){this.rootNode.isInitialized()&&this.rootNode.shutdown(this.context),this.context.updateID++,this.rootNode.initialize(this.context)},e.getNumControlParameters=function(){return this.graphAsset.controlParameterIDs.length},e.getControlParameterIndex=function(t){var e=this.graphAsset.parameterLookupMap.get(t);return void 0!==e?e:(console.warn("Parameter '"+t+"' does not exist."),-1)},e.getControlParameterID=function(t){return this.graphAsset.controlParameterIDs[t]},e.setBool=function(t,e){this.setControlParameterValue(t,e)},e.setFloat=function(t,e){this.setControlParameterValue(t,e)},e.setTrigger=function(t){this.setControlParameterValue(t,!0)},e.resetTrigger=function(t){this.setControlParameterValue(t,!1)},e.getPoseNodeDebugInfo=function(t){return this.nodes[t].getDebugInfo()},e.getRuntimeNodeDebugValue=function(t){return this.nodes[t].getValue(this.context)},e.getNodeDebugInstance=function(t){return this.nodes[t]},e.isControlParameter=function(t){return t<this.getNumControlParameters()},e.setControlParameterValue=function(t,e){var i=this.getControlParameterIndex(t);-1!==i&&this.nodes[i].setValue(e)},t}();function rO(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rV(t,e,i){return e&&rO(t.prototype,e),i&&rO(t,i),t}var rL=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.isAwakeCalled=!1,e.isStartCalled=!1,e.isEnableCalled=!1,e._enabled=!0,e}iG(e,t);var i=e.prototype;return i.onAwake=function(){},i.onEnable=function(){},i.onDisable=function(){},i.onStart=function(){},i.onUpdate=function(t){},i.onLateUpdate=function(t){},i.onPreRender=function(){},i.onDestroy=function(){},i.onApplyAnimationProperties=function(){},i.onParentChanged=function(){},i.enable=function(){this.item.composition&&(this.item.composition.sceneTicking.addComponent(this),this.isEnableCalled=!0),this.onEnable()},i.disable=function(){this.onDisable(),this.item.composition&&(this.isEnableCalled=!1,this.item.composition.sceneTicking.removeComponent(this))},i.setVFXItem=function(t){this.item=t,t.isDuringPlay&&(this.isAwakeCalled||(this.onAwake(),this.isAwakeCalled=!0),t.isActive&&this.enabled&&(this.start(),this.enable()))},i.fromData=function(e){t.prototype.fromData.call(this,e)},i.dispose=function(){this.isEnableCalled&&this.disable(),this.isAwakeCalled&&(this.isAwakeCalled=!1,this.onDestroy()),this.item&&eQ(this.item.components,this),t.prototype.dispose.call(this)},i.start=function(){this.isStartCalled||(this.isStartCalled=!0,this.onStart())},rV(e,[{key:"transform",get:function(){return this.item.transform}},{key:"isActiveAndEnabled",get:function(){return this.item.isActive&&this.enabled}},{key:"enabled",get:function(){return this._enabled},set:function(t){if(this.enabled!==t){var e;this._enabled=t,(null==(e=this.item)?void 0:e.isDuringPlay)&&this.item.isActive&&(t?this.isEnableCalled||(this.enable(),this.isStartCalled||(this.onStart(),this.isStartCalled=!0)):this.isEnableCalled&&this.disable())}}}]),e}(i$);eW([iJ(void 0,void 0)],rL.prototype,"item",void 0),eW([iJ(void 0,void 0)],rL.prototype,"_enabled",void 0);var rN=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.setVFXItem=function(e){t.prototype.setVFXItem.call(this,e)},i.dispose=function(){t.prototype.dispose.call(this)},e}(rL);t.Animator=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.graphInstance=null,e.graphAsset=null,e}iG(e,t);var i=e.prototype;return i.setBool=function(t,e){this.graphInstance&&this.graphInstance.setBool(t,e)},i.setFloat=function(t,e){this.graphInstance&&this.graphInstance.setFloat(t,e)},i.setTrigger=function(t){this.graphInstance&&this.graphInstance.setTrigger(t)},i.resetTrigger=function(t){this.graphInstance&&this.graphInstance.resetTrigger(t)},i.getStateMachineNode=function(t){var e=null;return this.graphInstance&&(e=this.graphInstance.getStateMachineNode(t)),e},i.onStart=function(){this.graphAsset&&(this.graphInstance=new rR(this.graphAsset,this.item))},i.onUpdate=function(t){if(this.graphInstance){for(var e=this.graphInstance.evaluateGraph(t/1e3),i=this.graphInstance.skeleton.animatedTransforms,r=0;r<i.length;r++){var n=e.pose.parentSpaceTransforms[r].position,a=e.pose.parentSpaceTransforms[r].rotation,s=e.pose.parentSpaceTransforms[r].scale,o=e.pose.parentSpaceTransforms[r].euler;i[r].setPosition(n.x,n.y,n.z),i[r].setScale(s.x,s.y,s.z),this.graphInstance.skeleton.useEuler?i[r].setRotation(o.x,o.y,o.z):i[r].setQuaternion(a.x,a.y,a.z,a.w)}for(var u=this.graphInstance.skeleton.floatAnimatedObjects,h=0;h<u.length;h++){var l=u[h],c=l.propertyName;l.directTarget[c]=e.pose.floatPropertyValues[h],ej(l.target,rL)&&l.target.onApplyAnimationProperties()}for(var f=this.graphInstance.skeleton.colorAnimatedObjects,d=0;d<f.length;d++){var p=f[d],m=p.propertyName;p.directTarget[m]=e.pose.colorPropertyValues[d],ej(p.target,rL)&&p.target.onApplyAnimationProperties()}for(var v,y=iH(this.graphInstance.activeEvents);!(v=y()).done;){var g=v.value;g.data.event.onEvent(this.item,g)}}},i.fromData=function(t){this.graphAsset=this.engine.findObject(t.graphAsset)},e}(rL),t.Animator=eW([iK("Animator")],t.Animator),t.ShaderType=void 0,(tr=t.ShaderType||(t.ShaderType={}))[tr.vertex=0]="vertex",tr[tr.fragment=1]="fragment",t.MaskMode=void 0,(tn=t.MaskMode||(t.MaskMode={}))[tn.NONE=0]="NONE",tn[tn.MASK=1]="MASK",tn[tn.OBSCURED=2]="OBSCURED",tn[tn.REVERSE_OBSCURED=3]="REVERSE_OBSCURED";var rF=[],rD={},rk="WebGL Constants not in global, please check your environment";function rz(){"function"==typeof WebGL2RenderingContext?rB(WebGL2RenderingContext):"undefined"!=typeof WebGLRenderingContext?(rB(WebGLRenderingContext),rB(WebGLRenderingContext.prototype)):ia?rF.push(is()?"iOS16 lockdown mode, WebGL Constants not in global":rk):rF.push(rk),rF.length||"HALF_FLOAT"in rD||(rD.HALF_FLOAT=5131)}function rB(t){for(var e in t)/^[A-Z_]/.test(e)&&(rD[e]=t[e])}function rU(t){switch(t){case tU.ALPHA:case tU.ADD:case tU.SUBTRACTION:case tU.STRONG_LIGHT:case tU.WEAK_LIGHT:return 1;case tU.SUPERPOSITION:return 2;case tU.BRIGHTNESS:return 3;case tU.MULTIPLY:return 0;default:return 1}}function rG(t,e){switch(e){case void 0:case tU.ALPHA:t.blendFunction=[rD.ONE,rD.ONE_MINUS_SRC_ALPHA,rD.ONE,rD.ONE_MINUS_SRC_ALPHA];break;case tU.ADD:t.blendFunction=[rD.ONE,rD.ONE,rD.ONE,rD.ONE];break;case tU.SUBTRACTION:t.blendFunction=[rD.ONE,rD.ONE,rD.ZERO,rD.ONE],t.blendEquation=[rD.FUNC_REVERSE_SUBTRACT,rD.FUNC_REVERSE_SUBTRACT];break;case tU.SUPERPOSITION:t.blendFunction=[rD.ONE,rD.ONE,rD.ONE,rD.ONE];break;case tU.MULTIPLY:t.blendFunction=[rD.DST_COLOR,rD.ONE_MINUS_SRC_ALPHA,rD.DST_COLOR,rD.ONE_MINUS_SRC_ALPHA];break;case tU.BRIGHTNESS:t.blendFunction=[rD.ONE,rD.ONE_MINUS_SRC_ALPHA,rD.ONE,rD.ONE_MINUS_SRC_ALPHA];break;case tU.STRONG_LIGHT:t.blendFunction=[rD.DST_COLOR,rD.DST_ALPHA,rD.ZERO,rD.ONE];break;case tU.WEAK_LIGHT:t.blendFunction=[rD.DST_COLOR,rD.ZERO,rD.ZERO,rD.ONE];break;default:console.warn("BlendMode "+e+" not in specification, please set blend params separately.")}}function rj(t,e){e===tG.DOUBLE?t.culling=!1:(t.culling=!0,t.frontFace=rD.CW,t.cullFace=e===tG.BACK?rD.BACK:rD.FRONT)}rF.length||rz(),t.TextureLoadAction=void 0,(ta=t.TextureLoadAction||(t.TextureLoadAction={}))[ta.whatever=0]="whatever",ta[ta.clear=2]="clear",t.TextureSourceType=void 0,(ts=t.TextureSourceType||(t.TextureSourceType={}))[ts.none=0]="none",ts[ts.data=1]="data",ts[ts.image=2]="image",ts[ts.compressed=3]="compressed",ts[ts.video=4]="video",ts[ts.canvas=5]="canvas",ts[ts.framebuffer=6]="framebuffer",ts[ts.mipmaps=7]="mipmaps";var rW=function(){function t(){this.callbacks={}}var e=t.prototype;return e.downloadJSON=function(t,e,i){this.download(t,"json",e,i)},e.downloadBinary=function(t,e,i){this.download(t,"arraybuffer",e,i)},e.downloadBlob=function(t,e,i){this.download(t,"blob",e,i)},e.downloadText=function(t,e,i){this.download(t,"text",e,i)},e.download=function(e,i,r,n){var a=this;if(void 0===i&&(i="json"),!this.start(e,r,n)){var s=new XMLHttpRequest,o=function(){a.finish(e,s.status,s.response)};s.responseType=i,s.addEventListener("load",function(){200==s.status||0==s.status&&t.trustXHRStatusZero?a.finish(e,200,s.response):o()}),s.addEventListener("error",o),s.open("GET",e,!0),s.send()}},e.start=function(t,e,i){var r=this.callbacks[t];try{if(r)return!0;this.callbacks[t]=r=[]}finally{r.push(e,i)}},e.finish=function(e,i,r){var n=this.callbacks[e];delete this.callbacks[e];for(var a=200==i||0==i&&t.trustXHRStatusZero?[r]:[i,r],s=a.length-1,o=n.length;s<o;s+=2)n[s].apply(null,a)},t}();rW.trustXHRStatusZero=!1;var rX=!1,rH=!1;function rY(t,e){return rZ.apply(this,arguments)}function rZ(){return(rZ=eG(function(t,e){return eX(this,function(i){switch(i.label){case 0:if(!(rX||!e))return[3,2];return[4,rQ(t)];case 1:case 5:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,rQ(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),rX=!0,[4,rQ(t)];case 6:return[2]}})})).apply(this,arguments)}function rq(t,e){return rK.apply(this,arguments)}function rK(){return(rK=eG(function(t,e){return eX(this,function(i){switch(i.label){case 0:if(!(rH||!e))return[3,2];return[4,rQ(t)];case 1:case 5:return[2,{image:i.sent(),url:t}];case 2:return i.trys.push([2,4,,6]),[4,rQ(e)];case 3:return[2,{image:i.sent(),url:e}];case 4:return i.sent(),rH=!0,[4,rQ(t)];case 6:return[2]}})})).apply(this,arguments)}function rQ(t){return rJ.apply(this,arguments)}function rJ(){return(rJ=eG(function(t){var e,i;return eX(this,function(r){if(e="",ej(t,HTMLImageElement)){if(t.complete)return[2,t];e=t.src}else ej(t,Blob)?(e=URL.createObjectURL(t),i=!0):"string"==typeof t&&(e=t);if(!e)throw Error("Invalid url type: "+JSON.stringify(t)+".");return[2,new Promise(function(t,r){var n=new Image;/^data:/.test(e)||(n.crossOrigin="*"),n.onload=function(){return n.onload=null,i&&URL.revokeObjectURL(e),t(n)},n.onerror=function(t){return n.onerror=null,i&&URL.revokeObjectURL(e),r("Load image fail: "+e+", reason: "+JSON.stringify(t))},n.src=e})]})})).apply(this,arguments)}function r$(t){return r0.apply(this,arguments)}function r0(){return(r0=eG(function(t){return eX(this,function(e){return[2,new Promise(function(e,i){new rW().downloadBinary(t,e,function(e,r){i("Couldn't load bins "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function r1(){return(r1=eG(function(t){return eX(this,function(e){return[2,new Promise(function(e,i){new rW().downloadBlob(t,e,function(e,r){i("Couldn't load blob "+t+": status "+e+", "+r)})})]})})).apply(this,arguments)}function r2(t){return r3.apply(this,arguments)}function r3(){return(r3=eG(function(t){var e;return eX(this,function(i){return e=document.createElement("video"),"string"==typeof t?e.src=t:e.srcObject=t,e.crossOrigin="anonymous",e.muted=!0,e.autoplay=!1,io()&&e.setAttribute("renderer","standard"),e.setAttribute("playsinline","playsinline"),[2,new Promise(function(t,i){var r=!1,n=function(){r||(r=!0,s(),t(e))},a=function(){r||(r=!0,s(),i("Load video fail."))},s=function(){e.removeEventListener("loadeddata",n),e.removeEventListener("canplay",n),e.removeEventListener("error",a)};e.addEventListener("loadeddata",n),e.addEventListener("canplay",n),e.addEventListener("error",a),e.play().catch(function(t){console.warn("Autoplay blocked:",t)})})]})})).apply(this,arguments)}function r4(t,e){return r5.apply(this,arguments)}function r5(){return(r5=eG(function(t,e){return eX(this,function(i){switch(i.label){case 0:if(!Array.isArray(t))return[3,5];i.label=1;case 1:return i.trys.push([1,3,,5]),[4,e(t[0])];case 2:case 4:return[2,i.sent()];case 3:return i.sent(),[4,e(t[1])];case 5:return[2,e(t)]}})})).apply(this,arguments)}function r6(t,e,i){return r8.apply(this,arguments)}function r8(){return(r8=eG(function(e,i,r,n){var a,s,o,u,h,l,c;return eX(this,function(f){switch(f.label){case 0:if(void 0===n&&(n=[]),34067!==e.target)return[3,2];return a=e.mipmaps,s=e.target,[4,Promise.all(a.map(function(t){return Promise.all(t.map(function(t){return t.id?r[t.id]:r9(t,i)}))}))];case 1:return o=f.sent(),[2,re({keepImageSource:!1},e,{mipmaps:o,sourceFrom:{target:s,type:t.TextureSourceType.mipmaps}})];case 2:return u=e.mipmaps,h=e.target,[4,Promise.all(u.map(function(t){return r9(t,i)}))];case 3:return l=f.sent(),c=n[u[0][1][0]].url,[2,re({keepImageSource:!1},e,{mipmaps:l,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{target:h,bin:c,type:t.TextureSourceType.mipmaps,mipmaps:u.map(function(t){return[t[1][1],t[1][2]]})}})];case 4:return[2]}})})).apply(this,arguments)}function r9(t,e){return r7.apply(this,arguments)}function r7(){return(r7=eG(function(t,e){var i,r,n,a,s;return eX(this,function(o){if(r=(i=t[1])[0],n=i[1],a=i[2],!(s=e[r]))throw Error("Invalid bin pointer: "+JSON.stringify(t)+".");return[2,rQ(new Blob([new Uint8Array(s,n,a)]))]})})).apply(this,arguments)}var nt=1,ne=function(e){function i(t){var i;return(i=e.call(this,t)||this).destroyed=!1,i.id="Tex"+nt++,i}iG(i,e);var r=i.prototype;return r.getWidth=function(){return this.width||0},r.getHeight=function(){return this.height||0},r.uploadCurrentVideoFrame=function(){},r.offloadData=function(){},r.reloadData=function(){},r.initialize=function(){},r.assembleOptions=function(e){var i=e.target,r=void 0===i?rD.TEXTURE_2D:i,n=e.format,a=void 0===n?rD.RGBA:n;return e.sourceType||("image"in e?e.sourceType=t.TextureSourceType.image:"data"in e?e.sourceType=t.TextureSourceType.data:"video"in e?e.sourceType=t.TextureSourceType.video:e.sourceType=0),re({minFilter:rD.NEAREST,magFilter:rD.NEAREST,wrapS:rD.CLAMP_TO_EDGE,wrapT:rD.CLAMP_TO_EDGE,target:r,format:rD.RGBA,internalFormat:a,type:rD.UNSIGNED_BYTE},e)},i.fromImage=function(e,r,n){return eG(function(){var a,s;return eX(this,function(o){switch(o.label){case 0:return[4,rQ(e)];case 1:return a=o.sent(),(s=i.create(r,re({sourceType:t.TextureSourceType.image,image:a,target:rD.TEXTURE_2D,id:iR(),flipY:!0},n))).initialize(),[2,s]}})})()},i.fromVideo=function(e,r,n){return eG(function(){var a,s;return eX(this,function(o){switch(o.label){case 0:return[4,r2(e)];case 1:return a=o.sent(),(s=i.create(r,re({sourceType:t.TextureSourceType.video,video:a,id:iR(),flipY:!0},n))).initialize(),[2,s]}})})()},rV(i,[{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(i$);function ni(t,e,i,r){var n,a,s=e.length/i/r;return a=n=4===s||0===s?rD.RGBA:3===s?rD.RGB:2===s?rD.LUMINANCE_ALPHA:rD.LUMINANCE,ne.createWithData(t,{data:e,width:i,height:r},{type:rD.HALF_FLOAT,format:n,internalFormat:a,wrapS:rD.CLAMP_TO_EDGE,wrapT:rD.CLAMP_TO_EDGE})}var nr={type:rD.UNSIGNED_BYTE,format:rD.RGBA,internalFormat:rD.RGBA,wrapS:rD.MIRRORED_REPEAT,wrapT:rD.MIRRORED_REPEAT,minFilter:rD.NEAREST,magFilter:rD.NEAREST};function nn(e){return ne.create(e,re({id:ij.WhiteTexture,data:{width:1,height:1,data:new Uint8Array([255,255,255,255])},sourceType:t.TextureSourceType.data},nr))}function na(e){return ne.create(e,re({id:ij.EmptyTexture,data:{width:1,height:1,data:new Uint8Array([0,0,0,0])},sourceType:t.TextureSourceType.data},nr))}var ns=new(function(){function t(){this.loaders=new Map,this.instances=new Map}var e=t.prototype;return e.register=function(t,e){if(this.loaders.has(t)){console.warn('TextureLoader for type "'+t+'" is already registered, skipping.');return}this.loaders.set(t,e)},e.unregister=function(t){var e=this.instances.get(t);e&&(e.dispose(),this.instances.delete(t)),this.loaders.delete(t)},e.getLoader=function(t){if(this.instances.has(t))return this.instances.get(t);var e=this.loaders.get(t);if(!e)return console.error('TextureLoader for type "'+t+'" is not registered.'),null;var i=e();return this.instances.set(t,i),i},e.has=function(t){return this.loaders.has(t)},e.getRegisteredTypes=function(){return Array.from(this.loaders.keys())},e.dispose=function(){this.instances.forEach(function(t){return t.dispose()}),this.instances.clear(),this.loaders.clear()},t}()),no=function(){function e(){this.reloadPending={}}var i=e.prototype;return i.reload=function(t){var e=this;return eG(function(){var i,r;return eX(this,function(n){switch(n.label){case 0:if(i=t.id,e.reloadPending[i])return[2];if(!t.sourceFrom)return[3,2];return e.reloadPending[i]=!0,[4,e.loadSource(t.sourceFrom)];case 1:return r=n.sent(),t.updateSource(r),e.reloadPending[i]=!1,[3,3];case 2:throw Error("No source from.");case 3:return[2]}})})()},i.canOffloadTexture=function(e){if(e){var i=e.type;if(i===t.TextureSourceType.compressed||i===t.TextureSourceType.image){var r=e.target,n=e.map,a=e.url;return r===rD.TEXTURE_CUBE_MAP?"object"==typeof n&&!!n:iC(a)&&a.length>0}if(i===t.TextureSourceType.mipmaps){var s=e.bin,o=e.mipmaps,u=e.target,h=e.maps,l=e.urls;return s?o.length>0:u===rD.TEXTURE_CUBE_MAP?h.every(function(t){return"object"==typeof t&&t}):l.every(function(t){return iC(t)&&t.length>0})}}return!1},i.loadSource=function(e,i){var r=this;return eG(function(){var n,a,s,o,u,h,l,c,f,d,p,m,v,y,g,x,b,T,E,C,S,_;return eX(this,function(w){switch(w.label){case 0:if(n=e.type,a=e.target,s=e.map,o=e.url,u=e.bin,h=e.mipmaps,l=e.urls,c=e.maps,!(a===rD.TEXTURE_CUBE_MAP&&n!==t.TextureSourceType.mipmaps))return[3,2];return[4,r.loadCubeMap(s)];case 1:return f=w.sent(),[2,re({},i,{cube:f,target:rD.TEXTURE_CUBE_MAP,sourceType:t.TextureSourceType.image,sourceFrom:{type:t.TextureSourceType.image,map:re({},s),target:rD.TEXTURE_CUBE_MAP}})];case 2:if(n!==t.TextureSourceType.image)return[3,4];return[4,rQ(o)];case 3:return d=w.sent(),[2,re({},i,{image:d,sourceType:t.TextureSourceType.image,sourceFrom:{type:n,url:o,target:rD.TEXTURE_2D}})];case 4:if(n!==t.TextureSourceType.video)return[3,6];return[4,r2(o)];case 5:return p=w.sent(),[2,re({},i,{video:p,sourceType:t.TextureSourceType.video})];case 6:if(n!==t.TextureSourceType.compressed)return[3,14];return[4,r$(o)];case 7:if(m=w.sent(),!(v=ns.getLoader("ktx2")))return[3,12];w.label=8;case 8:return w.trys.push([8,10,,11]),[4,v.loadFromBuffer(m)];case 9:if((y=w.sent()).sourceType===t.TextureSourceType.compressed)return[2,re({sourceType:y.sourceType,type:y.type,target:y.target,internalFormat:y.internalFormat,format:y.format,mipmaps:y.mipmaps,minFilter:rD.LINEAR,magFilter:rD.LINEAR,sourceFrom:e},i)];return[3,11];case 10:throw g=w.sent(),Error("Failed to parse KTX2 from "+(null!=(x=null==e?void 0:e.url)?x:"buffer")+": "+(g.message||g));case 11:return[3,13];case 12:throw Error("KTX2 loader not found. Please register it first.");case 13:return[3,23];case 14:if(n!==t.TextureSourceType.mipmaps)return[3,23];if(!u)return[3,19];return[4,r$(u)];case 15:if(b=w.sent(),E=(T=null!=a?a:rD.TEXTURE_2D)===rD.TEXTURE_2D?h.slice():h.map(function(t){return t.slice()}),a!==rD.TEXTURE_CUBE_MAP)return[3,17];return[4,Promise.all(h.map(function(t){return r.loadMipmapImages(t,b)}))];case 16:return C=w.sent(),[3,18];case 17:C=r.loadMipmapImages(h,b),w.label=18;case 18:return[2,re({},i,{mipmaps:C,target:T,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{bin:u,mipmaps:E,target:T,type:t.TextureSourceType.mipmaps}})];case 19:if(!(a===rD.TEXTURE_2D||!a))return[3,21];return[4,Promise.all(l.map(function(t){return rQ(t)}))];case 20:return S=w.sent(),[2,re({},i,{mipmaps:S,target:rD.TEXTURE_2D,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{type:n,urls:l.slice(),target:rD.TEXTURE_2D}})];case 21:if(a!==rD.TEXTURE_CUBE_MAP)return[3,23];return[4,Promise.all(c.map(function(t){return r.loadCubeMap(t)}))];case 22:return _=w.sent(),[2,re({},i,{mipmaps:_,target:rD.TEXTURE_CUBE_MAP,sourceType:t.TextureSourceType.mipmaps,sourceFrom:{type:n,maps:c.map(function(t){return re({},t)}),target:rD.TEXTURE_CUBE_MAP}})];case 23:throw Error("Invalid resource type: "+n+".")}})})()},i.loadMipmapImages=function(t,e){return eG(function(){return eX(this,function(i){return[2,Promise.all(t.map(function(t){return rQ(new Blob([new Uint8Array(e,t[0],t[1])]))}))]})})()},i.loadCubeMap=function(t){return eG(function(){return eX(this,function(e){return[2,Promise.all(t.map(function(t){return rQ(t)}))]})})()},e}(),nu=function(){function t(t){this.destroyed=!1;var e=t.name;this.name=void 0===e?"defaultDataBlock":e}var e=t.prototype;return e.setUniformValues=function(t){var e=this;Object.keys(t).forEach(function(i){e.setUniformValue(i,t[i])})},e.invalidAllFlags=function(){},e.updateUniformSubData=function(t,e,i){},t}();function nh(t){return"object"==typeof t&&t&&void 0===t.length&&ej(t,ne)}var nl=function(){function t(t,e,i,r,n,a,s,o,u,h,l,c,f,d,p,m){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=1),void 0===s&&(s=0),void 0===o&&(o=0),void 0===u&&(u=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===c&&(c=0),void 0===f&&(f=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===m&&(m=1),this.elements=[t,e,i,r,n,a,s,o,u,h,l,c,f,d,p,m]}var e=t.prototype;return e.set=function(t,e,i,r,n,a,s,o,u,h,l,c,f,d,p,m){var v=this.elements;return v[0]=t,v[1]=e,v[2]=i,v[3]=r,v[4]=n,v[5]=a,v[6]=s,v[7]=o,v[8]=u,v[9]=h,v[10]=l,v[11]=c,v[12]=f,v[13]=d,v[14]=p,v[15]=m,this},e.setFromRowMajorData=function(t,e,i,r,n,a,s,o,u,h,l,c,f,d,p,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=i,v[12]=r,v[1]=n,v[5]=a,v[9]=s,v[13]=o,v[2]=u,v[6]=h,v[10]=l,v[14]=c,v[3]=f,v[7]=d,v[11]=p,v[15]=m,this},e.setFromColumnVectors=function(t,e,i,r){return this.set(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,i.x,i.y,i.z,i.w,r.x,r.y,r.z,r.w)},e.setFromMatrix3=function(t){var e=t.elements;return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1),this},e.setFromArray=function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[e+i];return this},e.setFromScale=function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)},e.setFromTranslation=function(t,e,i){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1)},e.setFromRotationX=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1)},e.setFromRotationY=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1)},e.setFromRotationZ=function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1)},e.setFromRotationAxis=function(e,i){var r=t.tempVec0;r.copyFrom(e).normalize();var n=Math.cos(i),a=Math.sin(i),s=1-n,o=r.x,u=r.y,h=r.z,l=s*o,c=s*u;return this.set(l*o+n,l*u+a*h,l*h-a*u,0,l*u-a*h,c*u+n,c*h+a*o,0,l*h+a*u,c*h-a*o,s*h*h+n,0,0,0,0,1)},e.setFromEuler=function(t){return t.toMatrix4(this),this},e.setFromQuaternion=function(t){return this.compose(e5.ZERO,t,e5.ONE)},e.setFromShear=function(t,e,i){return this.set(1,t,t,0,e,1,e,0,i,i,1,0,0,0,0,1)},e.setFromBasis=function(t,e,i){return this.set(t.x,t.y,t.z,0,e.x,e.y,e.z,0,i.x,i.y,i.z,0,0,0,0,1)},e.setZero=function(){for(var t=0;t<16;t++)this.elements[t]=0;return this},e.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},e.isIdentity=function(){var t=this.elements;return 1===t[0]&&0===t[4]&&0===t[8]&&0===t[12]&&0===t[1]&&1===t[5]&&0===t[9]&&0===t[13]&&0===t[2]&&0===t[6]&&1===t[10]&&0===t[14]&&0===t[3]&&0===t[7]&&0===t[11]&&1===t[15]},e.clone=function(){var e=this.elements;return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},e.copyFrom=function(t){return this.elements=[].concat(t.elements),this},e.getColumnVector=function(t,e){return e.set(this.elements[4*t],this.elements[4*t+1],this.elements[4*t+2],this.elements[4*t+3])},e.lookAt=function(e,i,r){var n=t.tempVec0,a=t.tempVec1,s=t.tempVec2;s.subtractVectors(e,i),s.normalize(),n.crossVectors(r,s),n.normalize(),a.crossVectors(s,n);var o=this.elements;return o[0]=n.x,o[1]=a.x,o[2]=s.x,o[3]=0,o[4]=n.y,o[5]=a.y,o[6]=s.y,o[7]=0,o[8]=n.z,o[9]=a.z,o[10]=s.z,o[11]=0,o[12]=-n.dot(e),o[13]=-a.dot(e),o[14]=-s.dot(e),o[15]=1,this},e.addScaledMatrix=function(t,e){for(var i=this.elements,r=t.elements,n=0;n<16;n++)i[n]+=r[n]*e;return this},e.multiply=function(t){if("number"!=typeof t)return this.multiplyMatrices(this,t);for(var e=0;e<16;e++)this.elements[e]*=t;return this},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],s=i[4],o=i[8],u=i[12],h=i[1],l=i[5],c=i[9],f=i[13],d=i[2],p=i[6],m=i[10],v=i[14],y=i[3],g=i[7],x=i[11],b=i[15],T=r[0],E=r[4],C=r[8],S=r[12],_=r[1],w=r[5],M=r[9],A=r[13],P=r[2],I=r[6],R=r[10],O=r[14],V=r[3],L=r[7],N=r[11],F=r[15];return n[0]=a*T+s*_+o*P+u*V,n[4]=a*E+s*w+o*I+u*L,n[8]=a*C+s*M+o*R+u*N,n[12]=a*S+s*A+o*O+u*F,n[1]=h*T+l*_+c*P+f*V,n[5]=h*E+l*w+c*I+f*L,n[9]=h*C+l*M+c*R+f*N,n[13]=h*S+l*A+c*O+f*F,n[2]=d*T+p*_+m*P+v*V,n[6]=d*E+p*w+m*I+v*L,n[10]=d*C+p*M+m*R+v*N,n[14]=d*S+p*A+m*O+v*F,n[3]=y*T+g*_+x*P+b*V,n[7]=y*E+g*w+x*I+b*L,n[11]=y*C+g*M+x*R+b*N,n[15]=y*S+g*A+x*O+b*F,this},e.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[4],r=t[8],n=t[12],a=t[1],s=t[5],o=t[9],u=t[13],h=t[2],l=t[6],c=t[10],f=t[14];return t[3]*(+n*o*l-r*u*l-n*s*c+i*u*c+r*s*f-i*o*f)+t[7]*(+e*o*f-e*u*c+n*a*c-r*a*f+r*u*h-n*o*h)+t[11]*(+e*u*l-e*s*f-n*a*l+i*a*f+n*s*h-i*u*h)+t[15]*(-r*s*h-e*o*l+e*s*c+r*a*l-i*a*c+i*o*h)},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.invert=function(){var t=this.elements,e=t[0],i=t[1],r=t[2],n=t[3],a=t[4],s=t[5],o=t[6],u=t[7],h=t[8],l=t[9],c=t[10],f=t[11],d=t[12],p=t[13],m=t[14],v=t[15],y=l*m*u-p*c*u+p*o*f-s*m*f-l*o*v+s*c*v,g=d*c*u-h*m*u-d*o*f+a*m*f+h*o*v-a*c*v,x=h*p*u-d*l*u+d*s*f-a*p*f-h*s*v+a*l*v,b=d*l*o-h*p*o-d*s*c+a*p*c+h*s*m-a*l*m,T=e*y+i*g+r*x+n*b;if(0===T)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var E=1/T;return t[0]=y*E,t[1]=(p*c*n-l*m*n-p*r*f+i*m*f+l*r*v-i*c*v)*E,t[2]=(s*m*n-p*o*n+p*r*u-i*m*u-s*r*v+i*o*v)*E,t[3]=(l*o*n-s*c*n-l*r*u+i*c*u+s*r*f-i*o*f)*E,t[4]=g*E,t[5]=(h*m*n-d*c*n+d*r*f-e*m*f-h*r*v+e*c*v)*E,t[6]=(d*o*n-a*m*n-d*r*u+e*m*u+a*r*v-e*o*v)*E,t[7]=(a*c*n-h*o*n+h*r*u-e*c*u-a*r*f+e*o*f)*E,t[8]=x*E,t[9]=(d*l*n-h*p*n-d*i*f+e*p*f+h*i*v-e*l*v)*E,t[10]=(a*p*n-d*s*n+d*i*u-e*p*u-a*i*v+e*s*v)*E,t[11]=(h*s*n-a*l*n-h*i*u+e*l*u+a*i*f-e*s*f)*E,t[12]=b*E,t[13]=(h*p*r-d*l*r+d*i*c-e*p*c-h*i*m+e*l*m)*E,t[14]=(d*s*r-a*p*r-d*i*o+e*p*o+a*i*m-e*s*m)*E,t[15]=(a*l*r-h*s*r+h*i*o-e*l*o-a*i*c+e*s*c)*E,this},e.extractBasis=function(t,e,i){var r=this.elements;return t.set(r[0],r[1],r[2]),e.set(r[4],r[5],r[6]),i.set(r[8],r[9],r[10]),this},e.compose=function(t,e,i,r){void 0===r&&(r=e5.ZERO);var n=this.elements,a=e.x,s=e.y,o=e.z,u=e.w,h=-r.x,l=-r.y,c=-r.z,f=a+a,d=s+s,p=o+o,m=a*f,v=a*d,y=a*p,g=s*d,x=s*p,b=o*p,T=u*f,E=u*d,C=u*p,S=i.x,_=i.y,w=i.z;return n[0]=(1-(g+b))*S,n[1]=(v+C)*S,n[2]=(y-E)*S,n[3]=0,n[4]=(v-C)*_,n[5]=(1-(m+b))*_,n[6]=(x+T)*_,n[7]=0,n[8]=(y+E)*w,n[9]=(x-T)*w,n[10]=(1-(m+g))*w,n[11]=0,n[12]=h*n[0]+l*n[4]+c*n[8]-h+t.x,n[13]=h*n[1]+l*n[5]+c*n[9]-l+t.y,n[14]=h*n[2]+l*n[6]+c*n[10]-c+t.z,this},e.decompose=function(e,i,r){var n=t.tempVec0,a=this.elements,s=n.set(a[0],a[1],a[2]).length(),o=n.set(a[4],a[5],a[6]).length(),u=n.set(a[8],a[9],a[10]).length();if(0>this.determinant()&&(s=-s),e.x=a[12],e.y=a[13],e.z=a[14],r.x=s,r.y=o,r.z=u,1e-8>Math.abs(s)||1e-8>Math.abs(o)||1e-8>Math.abs(u))return i.set(0,0,0,1),this;var h=t.tempMat0;h.copyFrom(this);var l=1/s,c=1/o,f=1/u;return h.elements[0]*=l,h.elements[1]*=l,h.elements[2]*=l,h.elements[4]*=c,h.elements[5]*=c,h.elements[6]*=c,h.elements[8]*=f,h.elements[9]*=f,h.elements[10]*=f,i.setFromRotationMatrix(h),this},e.getTranslation=function(t){var e=this.elements;return t.set(e[12],e[13],e[14])},e.getScale=function(t){var e=this.elements;return t.set(Math.hypot(e[0],e[1],e[2]),Math.hypot(e[4],e[5],e[6]),Math.hypot(e[8],e[9],e[10]))},e.extractRotation=function(e){var i=t.tempVec0,r=e.elements,n=this.elements,a=1/i.set(r[0],r[1],r[2]).length(),s=1/i.set(r[4],r[5],r[6]).length(),o=1/i.set(r[8],r[9],r[10]).length();return n[0]=r[0]*a,n[1]=r[1]*a,n[2]=r[2]*a,n[3]=0,n[4]=r[4]*s,n[5]=r[5]*s,n[6]=r[6]*s,n[7]=0,n[8]=r[8]*o,n[9]=r[9]*o,n[10]=r[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},e.setPosition=function(t){return this.elements[12]=t.x,this.elements[13]=t.y,this.elements[14]=t.z,this},e.getTransform=function(){var t=new e5,e=new rn,i=new e5;return this.decompose(t,e,i),{translation:t,rotation:e,scale:i}},e.orthographic=function(t,e,i,r,n,a){var s=1/(e-t),o=1/(i-r),u=1/(a-n),h=-(e+t)*s,l=-(i+r)*o,c=-(a+n)*u;s*=2,o*=2,u*=-2;var f=this.elements;return f[0]=s,f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[5]=o,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[10]=u,f[11]=0,f[12]=h,f[13]=l,f[14]=c,f[15]=1,this},e.perspective=function(t,e,i,r,n){var a=1/Math.tan(.5*t),s=1/(i-r),o=this.elements;return o[0]=n?a:a/e,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=n?a*e:a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=(r+i)*s,o[11]=-1,o[12]=0,o[13]=0,o[14]=2*r*i*s,o[15]=0,(null===r||r===1/0)&&(o[10]=-1,o[14]=-2*i),this},e.projectPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,s=null!=e?e:t;s.x=a[0]*i+a[4]*r+a[8]*n+a[12],s.y=a[1]*i+a[5]*r+a[9]*n+a[13],s.z=a[2]*i+a[6]*r+a[10]*n+a[14];var o=a[3]*i+a[7]*r+a[11]*n+a[15];return s.multiply(1/o)},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,s=null!=e?e:t;return s.x=a[0]*i+a[4]*r+a[8]*n+a[12],s.y=a[1]*i+a[5]*r+a[9]*n+a[13],s.z=a[2]*i+a[6]*r+a[10]*n+a[14],s},e.transformNormal=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,s=null!=e?e:t;return s.x=a[0]*i+a[4]*r+a[8]*n,s.y=a[1]*i+a[5]*r+a[9]*n,s.z=a[2]*i+a[6]*r+a[10]*n,s.normalize()},e.transformVector4=function(t,e){var i=t.x,r=t.y,n=t.z,a=t.w,s=this.elements,o=null!=e?e:t;return o.x=s[0]*i+s[4]*r+s[8]*n+s[12]*a,o.y=s[1]*i+s[5]*r+s[9]*n+s[13]*a,o.z=s[2]*i+s[6]*r+s[10]*n+s[14]*a,o.w=s[3]*i+s[7]*r+s[11]*n+s[15]*a,o},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<16;r++)if(!e1(e[r],i[r]))return!1;return!0},e.toArray=function(){return[].concat(this.elements)},e.fill=function(t,e){void 0===e&&(e=0);var i=this.elements;t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15]},t.fromIdentity=function(){return new t(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},t.fromLookAt=function(e,i,r){return new t().lookAt(e,i,r)},t.fromPerspective=function(e,i,r,n,a){return new t().perspective(e,i,r,n,a)},t.fromColumnVectors=function(e,i,r,n){return new t().setFromColumnVectors(e,i,r,n)},t.fromMatrix3=function(e){return new t().setFromMatrix3(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromScale=function(e,i,r){return new t().setFromScale(e,i,r)},t.fromTranslation=function(e,i,r){return new t().setFromTranslation(e,i,r)},t.fromRotationX=function(e){return new t().setFromRotationX(e)},t.fromRotationY=function(e){return new t().setFromRotationY(e)},t.fromRotationZ=function(e){return new t().setFromRotationZ(e)},t.fromRotationAxis=function(e,i){return new t().setFromRotationAxis(e,i)},t.fromEuler=function(e){return new t().setFromEuler(e)},t.fromQuaternion=function(e){return new t().setFromQuaternion(e)},t.fromShear=function(e,i,r){return new t().setFromShear(e,i,r)},t.fromBasis=function(e,i,r){return new t().setFromBasis(e,i,r)},t.fromRowMajorData=function(e,i,r,n,a,s,o,u,h,l,c,f,d,p,m,v){return new t(e,a,h,d,i,s,l,p,r,o,c,m,n,u,f,v)},t}();nl.IDENTITY=new nl(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),nl.ZERO=new nl(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),nl.tempVec0=new e5,nl.tempVec1=new e5,nl.tempVec2=new e5,nl.tempMat0=new nl,(to=eM||(eM={}))[to.XYZ=0]="XYZ",to[to.XZY=1]="XZY",to[to.YXZ=2]="YXZ",to[to.YZX=3]="YZX",to[to.ZXY=4]="ZXY",to[to.ZYX=5]="ZYX";var nc=function(){function t(e,i,r,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=t.DEFAULT_ORDER),this.x=e,this.y=i,this.z=r,this.order=n}var e=t.prototype;return e.set=function(t,e,i,r){return void 0===r&&(r=this.order),this.x=t,this.y=e,this.z=i,this.order=r,this},e.setZero=function(t){return void 0===t&&(t=this.order),this.set(0,0,0,t)},e.setFromRotationMatrix4=function(t,e){void 0===e&&(e=this.order);var i=t.elements,r=i[0],n=i[4],a=i[8],s=i[1],o=i[5],u=i[9],h=i[2],l=i[6],c=i[10];switch(e){case eM.XYZ:this.y=Math.asin(e3(a,-1,1)),.9999999>Math.abs(a)?(this.x=Math.atan2(-u,c),this.z=Math.atan2(-n,r)):(this.x=Math.atan2(l,o),this.z=0);break;case eM.YXZ:this.x=Math.asin(-e3(u,-1,1)),.9999999>Math.abs(u)?(this.y=Math.atan2(a,c),this.z=Math.atan2(s,o)):(this.y=Math.atan2(-h,r),this.z=0);break;case eM.ZXY:this.x=Math.asin(e3(l,-1,1)),.9999999>Math.abs(l)?(this.y=Math.atan2(-h,c),this.z=Math.atan2(-n,o)):(this.y=0,this.z=Math.atan2(s,r));break;case eM.ZYX:this.y=Math.asin(-e3(h,-1,1)),.9999999>Math.abs(h)?(this.x=Math.atan2(l,c),this.z=Math.atan2(s,r)):(this.x=0,this.z=Math.atan2(-n,o));break;case eM.YZX:this.z=Math.asin(e3(s,-1,1)),.9999999>Math.abs(s)?(this.x=Math.atan2(-u,o),this.y=Math.atan2(-h,r)):(this.x=0,this.y=Math.atan2(a,c));break;case eM.XZY:this.z=Math.asin(-e3(n,-1,1)),.9999999>Math.abs(n)?(this.x=Math.atan2(l,o),this.y=Math.atan2(a,r)):(this.x=Math.atan2(-u,c),this.y=0);break;default:console.error("setFromRotationMatrix: unknown order: "+e)}return this.x*=e0,this.y*=e0,this.z*=e0,this.order=e,this},e.setFromQuaternion=function(e,i){void 0===i&&(i=this.order);var r=t.tempMat0;return r.setFromQuaternion(e),this.setFromRotationMatrix4(r,i)},e.setFromVector3=function(t,e){return void 0===e&&(e=this.order),this.set(t.x,t.y,t.z,e)},e.setFromArray=function(t,e,i){var r,n,a,s;return void 0===e&&(e=0),void 0===i&&(i=this.order),this.x=null!=(r=t[e])?r:0,this.y=null!=(n=t[e+1])?n:0,this.z=null!=(a=t[e+2])?a:0,this.order=null!=(s=t[e+3])?s:i,this},e.clone=function(){return new t(this.x,this.y,this.z,this.order)},e.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.order=t.order,this},e.add=function(t){return this.order!=t.order?console.error("add euler with different order"):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this},e.addEulers=function(t,e){return t.order!=e.order?console.error("add euler with different order"):(this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.order=t.order),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.reorder=function(t){var e=new rn;return e.setFromEuler(this),this.setFromQuaternion(e,t)},e.rotateVector3=function(e,i){return t.tempQuat0.setFromEuler(this).rotateVector3(e,i)},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.order===this.order},e.toVector3=function(t){return t.set(this.x,this.y,this.z)},e.toArray=function(){return[this.x,this.y,this.z]},e.toQuaternion=function(t){var e=this.x,i=this.y,r=this.z,n=this.order,a=Math.cos(e*e$*.5),s=Math.cos(i*e$*.5),o=Math.cos(r*e$*.5),u=Math.sin(e*e$*.5),h=Math.sin(i*e$*.5),l=Math.sin(r*e$*.5);switch(n){case eM.XYZ:t.set(u*s*o+a*h*l,a*h*o-u*s*l,a*s*l+u*h*o,a*s*o-u*h*l);break;case eM.YXZ:t.set(u*s*o+a*h*l,a*h*o-u*s*l,a*s*l-u*h*o,a*s*o+u*h*l);break;case eM.ZXY:t.set(u*s*o-a*h*l,a*h*o+u*s*l,a*s*l+u*h*o,a*s*o-u*h*l);break;case eM.ZYX:t.set(u*s*o-a*h*l,a*h*o+u*s*l,a*s*l-u*h*o,a*s*o+u*h*l);break;case eM.YZX:t.set(u*s*o+a*h*l,a*h*o+u*s*l,a*s*l-u*h*o,a*s*o-u*h*l);break;case eM.XZY:t.set(u*s*o-a*h*l,a*h*o-u*s*l,a*s*l+u*h*o,a*s*o+u*h*l);break;default:console.error("unknown euler order: "+n)}return t},e.toMatrix4=function(t){var e=t.elements,i=this.x,r=this.y,n=this.z,a=this.order,s=Math.cos(i*e$),o=Math.sin(i*e$),u=Math.cos(r*e$),h=Math.sin(r*e$),l=Math.cos(n*e$),c=Math.sin(n*e$);if(a===eM.XYZ){var f=s*l,d=s*c,p=o*l,m=o*c;e[0]=u*l,e[4]=-u*c,e[8]=h,e[1]=d+p*h,e[5]=f-m*h,e[9]=-o*u,e[2]=m-f*h,e[6]=p+d*h,e[10]=s*u}else if(a===eM.YXZ){var v=u*l,y=u*c,g=h*l,x=h*c;e[0]=v+x*o,e[4]=g*o-y,e[8]=s*h,e[1]=s*c,e[5]=s*l,e[9]=-o,e[2]=y*o-g,e[6]=x+v*o,e[10]=s*u}else if(a===eM.ZXY){var b=u*l,T=u*c,E=h*l,C=h*c;e[0]=b-C*o,e[4]=-s*c,e[8]=E+T*o,e[1]=T+E*o,e[5]=s*l,e[9]=C-b*o,e[2]=-s*h,e[6]=o,e[10]=s*u}else if(a===eM.ZYX){var S=s*l,_=s*c,w=o*l,M=o*c;e[0]=u*l,e[4]=w*h-_,e[8]=S*h+M,e[1]=u*c,e[5]=M*h+S,e[9]=_*h-w,e[2]=-h,e[6]=o*u,e[10]=s*u}else if(a===eM.YZX){var A=s*u,P=s*h,I=o*u,R=o*h;e[0]=u*l,e[4]=R-A*c,e[8]=I*c+P,e[1]=c,e[5]=s*l,e[9]=-o*l,e[2]=-h*l,e[6]=P*c+I,e[10]=A-R*c}else if(a===eM.XZY){var O=s*u,V=s*h,L=o*u,N=o*h;e[0]=u*l,e[4]=-c,e[8]=h*l,e[1]=O*c+N,e[5]=s*l,e[9]=V*c-L,e[2]=L*c-V,e[6]=o*l,e[10]=N*c+O}else console.error("toMatrix4: Invalid order "+a);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,t},t.fromRotationMatrix4=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromRotationMatrix4(e,i)},t.fromQuaternion=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromQuaternion(e,i)},t.fromVector3=function(e,i){return void 0===i&&(i=t.DEFAULT_ORDER),new t().setFromVector3(e,i)},t.fromArray=function(e,i,r){return void 0===i&&(i=0),void 0===r&&(r=t.DEFAULT_ORDER),new t().setFromArray(e,i,r)},t}();nc.DEFAULT_ORDER=eM.ZYX,nc.tempQuat0=new rn,nc.tempMat0=new nl;var nf=function(){function t(t,e,i,r,n,a,s,o,u){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===a&&(a=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===u&&(u=1),this.elements=[t,e,i,r,n,a,s,o,u]}var e=t.prototype;return e.set=function(t,e,i,r,n,a,s,o,u){var h=this.elements;return h[0]=t,h[3]=r,h[6]=s,h[1]=e,h[4]=n,h[7]=o,h[2]=i,h[5]=a,h[8]=u,this},e.setFromRowMajorData=function(t,e,i,r,n,a,s,o,u){var h=this.elements;return h[0]=t,h[3]=e,h[6]=i,h[1]=r,h[4]=n,h[7]=a,h[2]=s,h[5]=o,h[8]=u,this},e.setFromColumnVectors=function(t,e,i){return this.set(t.x,t.y,t.z,e.x,e.y,e.z,i.x,i.y,i.z)},e.setFromMatrix4=function(t){var e=t.elements;return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])},e.setFromArray=function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[e+i];return this},e.setFromQuaternion=function(t){var e=t.x,i=t.y,r=t.z,n=t.w,a=e+e,s=i+i,o=r+r,u=e*a,h=e*s,l=e*o,c=i*s,f=i*o,d=r*o,p=n*a,m=n*s,v=n*o,y=this.elements;return y[0]=1-(c+d),y[1]=h+v,y[2]=l-m,y[3]=h-v,y[4]=1-(u+d),y[5]=f+p,y[6]=l+m,y[7]=f-p,y[8]=1-(u+c),this},e.setZero=function(){for(var t=0;t<9;t++)this.elements[t]=0;return this},e.identity=function(){return this.set(1,0,0,0,1,0,0,0,1)},e.clone=function(){var e=this.elements;return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},e.copyFrom=function(t){return this.elements=[].concat(t.elements),this},e.getColumnVector=function(t,e){return e.set(this.elements[3*t],this.elements[3*t+1],this.elements[3*t+2])},e.scale=function(t,e){var i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},e.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.elements,n=r[0],a=r[3],s=r[6],o=r[1],u=r[4],h=r[7];return r[0]=e*n+i*o,r[3]=e*a+i*u,r[6]=e*s+i*h,r[1]=-i*n+e*o,r[4]=-i*a+e*u,r[7]=-i*s+e*h,this},e.translate=function(t,e){var i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},e.multiply=function(t){if("number"!=typeof t)return this.multiplyMatrices(this,t);for(var e=0;e<9;e++)this.elements[e]*=t;return this},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],s=i[3],o=i[6],u=i[1],h=i[4],l=i[7],c=i[2],f=i[5],d=i[8],p=r[0],m=r[3],v=r[6],y=r[1],g=r[4],x=r[7],b=r[2],T=r[5],E=r[8];return n[0]=a*p+s*y+o*b,n[3]=a*m+s*g+o*T,n[6]=a*v+s*x+o*E,n[1]=u*p+h*y+l*b,n[4]=u*m+h*g+l*T,n[7]=u*v+h*x+l*E,n[2]=c*p+f*y+d*b,n[5]=c*m+f*g+d*T,n[8]=c*v+f*x+d*E,this},e.determinant=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],a=t[4],s=t[7],o=t[2],u=t[5],h=t[8];return e*(a*h-u*s)+n*(u*r-i*h)+o*(i*s-a*r)},e.invert=function(){var t=this.elements,e=t[0],i=t[3],r=t[6],n=t[1],a=t[4],s=t[7],o=t[2],u=t[5],h=t[8],l=h*a-u*s,c=u*r-h*i,f=s*i-a*r,d=e*l+n*c+o*f;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var p=1/d;return t[0]=l*p,t[1]=(o*s-h*n)*p,t[2]=(u*n-o*a)*p,t[3]=c*p,t[4]=(h*e-o*r)*p,t[5]=(o*i-u*e)*p,t[6]=f*p,t[7]=(n*r-s*e)*p,t[8]=(a*e-n*i)*p,this},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.transformPoint=function(t,e){var i=t.x,r=t.y,n=t.z,a=this.elements,s=null!=e?e:t;return s.x=a[0]*i+a[3]*r+a[6]*n,s.y=a[1]*i+a[4]*r+a[7]*n,s.z=a[2]*i+a[5]*r+a[8]*n,s},e.transformNormal=function(t,e){return this.transformPoint(t,e).normalize()},e.equals=function(t){for(var e=this.elements,i=t.elements,r=0;r<9;r++)if(!e1(e[r],i[r]))return!1;return!0},e.toArray=function(){return[].concat(this.elements)},e.fill=function(t,e){void 0===e&&(e=0);var i=this.elements;t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8]},t.fromIdentity=function(){return new t(1,0,0,0,1,0,0,0,1)},t.fromColumnVectors=function(e,i,r){return new t().setFromColumnVectors(e,i,r)},t.fromMatrix4=function(e){return new t().setFromMatrix4(e)},t.fromArray=function(e,i){return void 0===i&&(i=0),new t().setFromArray(e,i)},t.fromQuaternion=function(e){return new t().setFromQuaternion(e)},t.fromRowMajorData=function(e,i,r,n,a,s,o,u,h){return new t(e,n,o,i,a,u,r,s,h)},t}(),nd=function(){function t(t,e){void 0===t&&(t=e5.ZERO),void 0===e&&(e=e5.X),this.origin=new e5,this.direction=new e5,this.origin.copyFrom(t),this.direction.copyFrom(e).normalize()}var e=t.prototype;return e.set=function(t,e){return this.origin.copyFrom(t),this.direction.copyFrom(e).normalize(),this},e.clone=function(){return new t(this.origin,this.direction)},e.copyFrom=function(t){return this.set(t.origin,t.direction)},e.recast=function(e){return this.origin.copyFrom(this.at(e,t.tempVec0)),this},e.at=function(t,e){var i=e||new e5;return i.copyFrom(this.origin),i.addScaledVector(this.direction,t)},e.equals=function(t){return this.origin.equals(t.origin)&&this.direction.equals(t.direction)},e.distanceToPlane=function(t){var e=t.normal,i=e.dot(this.direction);if(0===i)return e.dot(this.origin)+t.distance===0?0:null;var r=-(this.origin.dot(e)+t.distance)/i;return r>=0?r:null},e.applyMatrix=function(t){return this.origin.applyProjectionMatrix(t),this.direction.applyNormalMatrix(t),this},e.intersectBox=function(t,e){var i,r,n,a,s,o,u=this.origin,h=u.x,l=u.y,c=u.z,f=this.direction,d=f.x,p=f.y,m=f.z,v=t.min,y=v.x,g=v.y,x=v.z,b=t.max,T=b.x,E=b.y,C=b.z,S=1/d,_=1/p,w=1/m;if(S>=0?(i=(y-h)*S,r=(T-h)*S):(i=(T-h)*S,r=(y-h)*S),_>=0?(n=(g-l)*_,a=(E-l)*_):(n=(E-l)*_,a=(g-l)*_),!(i>a)&&!(n>r)&&((n>i||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),(n>i||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),w>=0?(s=(x-c)*w,o=(C-c)*w):(s=(C-c)*w,o=(x-c)*w),!(i>o)&&!(s>r))&&((s>i||i!=i)&&(i=s),(o<r||r!=r)&&(r=o),!(r<0)))return i>=0?this.at(i,e):this.at(r,e)},e.intersectPlane=function(t,e){var i=t.normal,r=t.distance,n=i.dot(this.direction);if(0===n)return 0===i.dot(this.origin)+r?(e||new e5).copyFrom(this.origin):void 0;var a=-(this.origin.dot(i)+r)/n;return a>=0?this.at(a,e):void 0},e.intersectSphere=function(e,i){var r=e.center,n=t.tempVec0.subtractVectors(r,this.origin),a=n.dot(this.direction),s=n.dot(n)-a*a,o=e.radius*e.radius;if(!(s>o)){var u=Math.sqrt(o-s),h=a-u,l=a+u;if(!(l<0))return h>=0?this.at(h,i):this.at(l,i)}},e.intersectTriangle=function(e,i,r){var n,a=e.p0,s=e.p1,o=e.p2,u=t.tempVec0.subtractVectors(s,a),h=t.tempVec1.subtractVectors(o,a),l=t.tempVec2.subtractVectors(this.origin,a),c=t.tempVec3.crossVectors(u,h),f=this.direction.dot(c);if(f>0){if(r)return;n=1}else{if(!(f<0))return;n=-1,f=-f}h.crossVectors(l,h);var d=n*this.direction.dot(h);if(!(d<0)){u.cross(l);var p=n*this.direction.dot(u);if(!(p<0)&&!(d+p>f)){var m=-n*l.dot(c);if(!(m<0))return this.at(m/f,i)}}},t}();nd.tempVec0=new e5,nd.tempVec1=new e5,nd.tempVec2=new e5,nd.tempVec3=new e5;var np=function(){function t(t,e){void 0===t&&(t=new e5(1/0,1/0,1/0)),void 0===e&&(e=new e5(-1/0,-1/0,-1/0)),this.min=t.clone(),this.max=e.clone()}var e=t.prototype;return e.set=function(t,e){return this.min.copyFrom(t),this.max.copyFrom(e),this},e.setFromArray=function(t){for(var e=Number(1/0),i=Number(1/0),r=Number(1/0),n=-1/0,a=-1/0,s=-1/0,o=0,u=t.length;o<u;o+=3){var h=t[o],l=t[o+1],c=t[o+2];h<e&&(e=h),l<i&&(i=l),c<r&&(r=c),h>n&&(n=h),l>a&&(a=l),c>s&&(s=c)}return this.min.set(e,i,r),this.max.set(n,a,s),this},e.setFromPoints=function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},e.setFromCenterAndSize=function(t,e){var i=e.clone().multiply(.5);return this.min.copyFrom(t).subtract(i),this.max.copyFrom(t).add(i),this},e.setFromObject=function(t){return this.makeEmpty(),this.expandByObject(t)},e.clone=function(){return new t().copyFrom(this)},e.copyFrom=function(t){return this.min.copyFrom(t.min),this.max.copyFrom(t.max),this},e.makeEmpty=function(){return this.min.x=this.min.y=this.min.z=Number(1/0),this.max.x=this.max.y=this.max.z=-1/0,this},e.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},e.getCenter=function(t){return void 0===t&&(t=new e5),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiply(.5)},e.getSize=function(t){return void 0===t&&(t=new e5),this.isEmpty()?t.set(0,0,0):t.subtractVectors(this.max,this.min)},e.expandByPoint=function(t){return this.min.min(t),this.max.max(t),this},e.expandByVector=function(t){return this.min.subtract(t),this.max.add(t),this},e.expandByScalar=function(t){return this.min.add(-t),this.max.add(t),this},e.expandByBox=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.expandByObject=function(e){e.updateWorldMatrix(!1,!1);var i=e.geometry;if(void 0!==i){null===i.boundingBox&&i.computeBoundingBox();var r=new t;r.copyFrom(i.boundingBox),r.applyMatrix4(e.matrixWorld),this.union(r)}for(var n=e.children,a=0,s=n.length;a<s;a++)this.expandByObject(n[a]);return this},e.containsPoint=function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},e.containsBox=function(t){return this.min.x<=t.min.x&&this.max.x>=t.max.x&&this.min.y<=t.min.y&&this.max.y>=t.max.y&&this.min.z<=t.min.z&&this.max.z>=t.max.z},e.getParameter=function(t,e){return void 0===e&&(e=new e5),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},e.intersectsBox=function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},e.intersectsSphere=function(t){var e=new e5;return this.clampPoint(t.center,e),e.distanceSquared(t.center)<=t.radius*t.radius},e.clampPoint=function(t,e){return void 0===e&&(e=new e5),e.copyFrom(t).clamp(this.min,this.max)},e.distanceToPoint=function(t){return t.clone().clamp(this.min,this.max).subtract(t).length()},e.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},e.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.applyMatrix4=function(t,e){if(void 0===e&&(e=new e5),this.isEmpty())return this;var i=this.getOBBPoints(t,e);return this.setFromPoints(i),this},e.getOBBPoints=function(t,e){if(void 0===e&&(e=new e5),this.isEmpty())return[];var i=[];return i[0]=new e5(this.min.x,this.min.y,this.min.z),i[1]=new e5(this.min.x,this.min.y,this.max.z),i[2]=new e5(this.min.x,this.max.y,this.min.z),i[3]=new e5(this.min.x,this.max.y,this.max.z),i[4]=new e5(this.max.x,this.min.y,this.min.z),i[5]=new e5(this.max.x,this.min.y,this.max.z),i[6]=new e5(this.max.x,this.max.y,this.min.z),i[7]=new e5(this.max.x,this.max.y,this.max.z),i.forEach(function(i){i.subtract(e),i.applyMatrix(t),i.add(e)}),i},e.getBoundingSphere=function(t){this.getCenter(t.center);var e=new e5;return t.radius=.5*this.getSize(e).length(),t},e.translate=function(t){return this.min.add(t),this.max.add(t),this},e.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},t}(),nm=function(){function t(t,e){void 0===t&&(t=e5.ZERO),void 0===e&&(e=-1),this.center=t.clone(),this.radius=e}var e=t.prototype;return e.set=function(t,e){return this.center.copyFrom(t),this.radius=e,this},e.setFromPoints=function(t,e){var i=this.center;if(void 0!==e){i.copyFrom(e);for(var r=0,n=0;n<t.length;n++)r=Math.max(r,i.distanceSquared(t[n]));this.radius=Math.sqrt(r)}else{var a=new np().setFromPoints(t);a.getCenter(i),this.radius=a.getSize().length()/2}return this},e.copyFrom=function(t){return this.center.copyFrom(t.center),this.radius=t.radius,this},e.isEmpty=function(){return this.radius<0},e.makeEmpty=function(){return this.center.set(0,0,0),this.radius=-1,this},e.containsPoint=function(t){return t.distanceSquared(this.center)<=this.radius*this.radius},e.distanceToPoint=function(t){return t.distance(this.center)-this.radius},e.intersectsSphere=function(t){var e=this.radius+t.radius;return t.center.distanceSquared(this.center)<=e*e},e.intersectsBox=function(t){return t.intersectsSphere(this)},e.clampPoint=function(t,e){var i=this.center.distanceSquared(t);return void 0===e&&(e=new e5),e.copyFrom(t),i>this.radius*this.radius&&(e.subtract(this.center).normalize(),e.multiply(this.radius).add(this.center)),e},e.getBoundingBox=function(t){return(void 0===t&&(t=new np),this.isEmpty())?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t},e.applyMatrix4=function(t){var e=t.elements,i=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return this.center.applyMatrix(t),this.radius=this.radius*Math.sqrt(Math.max(i,r,n)),this},e.translate=function(t){return this.center.add(t),this},e.expandByPoint=function(t){var e=new e5().subtractVectors(t,this.center),i=e.lengthSquared();if(i>this.radius*this.radius){var r=Math.sqrt(i),n=(r-this.radius)*.5;this.center.add(e.multiply(n/r)),this.radius+=n}return this},e.union=function(t){var e=new e5,i=new e5;return i.subtractVectors(t.center,this.center).normalize().multiply(t.radius),this.expandByPoint(e.copyFrom(t.center).add(i)),this.expandByPoint(e.copyFrom(t.center).subtract(i)),this},e.intersect=function(t){var e=new e5().subtractVectors(this.center,t.center),i=e.length();return i>this.radius+t.radius?this.makeEmpty():(this.center=this.center.add(e.normalize().multiply(i/2)),this.radius=this.radius+t.radius-i,this)},e.equals=function(t){return t.center.equals(this.center)&&t.radius===this.radius},e.clone=function(){return new t().copyFrom(this)},t}(),nv=Object.freeze({__proto__:null,get EulerOrder(){return eM},Euler:nc,Quaternion:rn,Vector2:e4,Vector3:e5,Vector4:e6,Matrix3:nf,Matrix4:nl,Ray:nd,PI2:2*Math.PI,DEG2RAD:e$,RAD2DEG:e0,NumberEpsilon:1e-6,isZero:function(t){return isNaN(t)||1e-6>Math.abs(t)},isEqual:e1,damp:function(t,e,i,r){return e2(t,e,1-Math.exp(-i*r))},lerp:e2,degToRad:function(t){return t*e$},radToDeg:function(t){return t*e0},clamp:e3,Color:e8,Box3:np,Sphere:nm});t.ShaderCompileResultStatus=void 0,(tu=t.ShaderCompileResultStatus||(t.ShaderCompileResultStatus={}))[tu.noShader=0]="noShader",tu[tu.success=1]="success",tu[tu.fail=2]="fail",tu[tu.compiling=3]="compiling",t.GLSLVersion=void 0,(th=t.GLSLVersion||(t.GLSLVersion={})).GLSL1="100",th.GLSL3="300 es";var ny=function(t){function e(e,i,r){var n;return(n=t.call(this,e)||this).source=i,n.key=r,n}return iG(e,t),e.prototype.initialize=function(){},e}(i$);t.Shader=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.createVariant=function(t){var e=[];if(t)for(var i,r=iH(Object.keys(t));!(i=r()).done;){var n=i.value;e.push([n,t[n]])}var a=this.engine.getShaderLibrary().createShader(this.shaderData,e);return a.shader=this,a},i.fromData=function(e){t.prototype.fromData.call(this,e),this.shaderData=e},e}(i$),t.Shader=eW([iK(ey.Shader)],t.Shader);var ng=function(){function t(){this.reset()}var e=t.prototype;return e.setBlendColor=function(t){var e=t[0],i=t[1],r=t[2],n=t[3];(this.blendColor[0]!==e||this.blendColor[1]!==i||this.blendColor[2]!==r||this.blendColor[3]!==n)&&(this.blendColor[0]=e,this.blendColor[1]=i,this.blendColor[2]=r,this.blendColor[3]=n)},e.setBlending=function(t){this.blending!==t&&(this.blending=t)},e.setBlendFunctionParameters=function(t){var e=t[0],i=t[1],r=t[2],n=t[3];(this.blendFunctionParameters[0]!==e||this.blendFunctionParameters[1]!==i||this.blendFunctionParameters[2]!==r||this.blendFunctionParameters[3]!==n)&&(this.blendFunctionParameters[0]=e,this.blendFunctionParameters[1]=i,this.blendFunctionParameters[2]=r,this.blendFunctionParameters[3]=n)},e.setBlendEquationParameters=function(t){var e=t[0],i=t[1];(this.blendEquationParameters[0]!==e||this.blendEquationParameters[1]!==i)&&(this.blendEquationParameters[0]=e,this.blendEquationParameters[1]=i)},e.setDepthTest=function(t){this.depthTest!==t&&(this.depthTest=t)},e.setDepthMask=function(t){this.depthMask!==t&&(this.depthMask=t)},e.setDepthRange=function(t){(this.depthRange[0]!==t[0]||this.depthRange[1]!==t[1])&&(this.depthRange[0]=t[0],this.depthRange[1]=t[1])},e.setDepthFunc=function(t){this.depthFunc!==t&&(this.depthFunc=t)},e.setPolygonOffsetFill=function(t){this.polygonOffsetFill!==t&&(this.polygonOffsetFill=t)},e.setPolygonOffset=function(t){(this.polygonOffset[0]!==t[0]||this.polygonOffset[1]!==t[1])&&(this.polygonOffset[0]=t[0],this.polygonOffset[1]=t[1])},e.setSampleAlphaToCoverage=function(t){this.sampleAlphaToCoverage!==t&&(this.sampleAlphaToCoverage=t)},e.setColorMask=function(t){this.colorMask[0]=t,this.colorMask[1]=t,this.colorMask[2]=t,this.colorMask[3]=t},e.setStencilTest=function(t){this.stencilTest!==t&&(this.stencilTest=t)},e.setStencilMask=function(t){(this.stencilMask[0]!==t[0]||this.stencilMask[1]!==t[1])&&(this.stencilMask[0]=t[0],this.stencilMask[1]=t[1])},e.setStencilRef=function(t){(this.stencilRef[0]!==t[0]||this.stencilRef[1]!==t[1])&&(this.stencilRef[0]=t[0],this.stencilRef[1]=t[1])},e.setStencilFunc=function(t){(this.stencilFunc[0]!==t[0]||this.stencilFunc[1]!==t[1])&&(this.stencilFunc[0]=t[0],this.stencilFunc[1]=t[1])},e.setStencilOpFail=function(t){(this.stencilOpFail[0]!==t[0]||this.stencilOpFail[1]!==t[1])&&(this.stencilOpFail[0]=t[0],this.stencilOpFail[1]=t[1])},e.setStencilOpZFail=function(t){(this.stencilOpZFail[0]!==t[0]||this.stencilOpZFail[1]!==t[1])&&(this.stencilOpZFail[0]=t[0],this.stencilOpZFail[1]=t[1])},e.setStencilOpZPass=function(t){(this.stencilOpZPass[0]!==t[0]||this.stencilOpZPass[1]!==t[1])&&(this.stencilOpZPass[0]=t[0],this.stencilOpZPass[1]=t[1])},e.setCulling=function(t){this.culling!==t&&(this.culling=t)},e.setFrontFace=function(t){this.frontFace!==t&&(this.frontFace=t)},e.setCullFace=function(t){this.cullFace!==t&&(this.cullFace=t)},e.reset=function(){this.blending=!1,this.blendColor=[0,0,0,0],this.blendFunctionParameters=[rD.ONE,rD.ONE_MINUS_SRC_ALPHA,rD.ONE,rD.ONE_MINUS_SRC_ALPHA],this.blendEquationParameters=[rD.FUNC_ADD,rD.FUNC_ADD],this.depthTest=!0,this.depthMask=!0,this.depthRange=[0,1],this.depthFunc=rD.LESS,this.polygonOffset=[0,0],this.polygonOffsetFill=!1,this.sampleAlphaToCoverage=!1,this.colorMask=[!0,!0,!0,!0],this.stencilTest=!1,this.stencilMask=[255,255],this.stencilRef=[0,0],this.stencilFunc=[rD.ALWAYS,rD.ALWAYS],this.stencilOpFail=[rD.KEEP,rD.KEEP],this.stencilOpZFail=[rD.KEEP,rD.KEEP],this.stencilOpZPass=[rD.KEEP,rD.KEEP],this.culling=!1,this.frontFace=rD.CCW,this.cullFace=rD.FRONT},e.apply=function(t){if(t.setSampleAlphaToCoverage(this.sampleAlphaToCoverage),t.setBlending(this.blending),t.setDepthTest(this.depthTest),t.setStencilTest(this.stencilTest),t.setCulling(this.culling),t.setPolygonOffsetFill(this.polygonOffsetFill),this.stencilTest&&(t.stencilMaskSeparate(rD.BACK,this.stencilMask[1]),t.stencilMaskSeparate(rD.FRONT,this.stencilMask[0]),t.stencilFuncSeparate(rD.BACK,this.stencilFunc[0],this.stencilRef[0],this.stencilMask[0]),t.stencilFuncSeparate(rD.FRONT,this.stencilFunc[1],this.stencilRef[1],this.stencilMask[1]),t.stencilOpSeparate(rD.BACK,this.stencilOpFail[0],this.stencilOpZFail[0],this.stencilOpZPass[0]),t.stencilOpSeparate(rD.FRONT,this.stencilOpFail[1],this.stencilOpZFail[1],this.stencilOpZPass[1])),this.blending){var e=this.blendColor,i=this.blendEquationParameters,r=this.blendFunctionParameters;t.blendColor(e[0],e[1],e[2],e[3]),t.blendEquationSeparate(i[0],i[1]),t.blendFuncSeparate(r[0],r[1],r[2],r[3])}t.colorMask(this.colorMask[0],this.colorMask[1],this.colorMask[2],this.colorMask[3]),this.depthTest&&(t.depthMask(this.depthMask),t.depthFunc(this.depthFunc),t.depthRange(this.depthRange[0],this.depthRange[1])),this.culling&&(t.cullFace(this.cullFace),t.frontFace(this.frontFace)),this.polygonOffsetFill&&t.polygonOffset(this.polygonOffset[0],this.polygonOffset[1])},t}();t.MaterialRenderType=void 0,(tl=t.MaterialRenderType||(t.MaterialRenderType={}))[tl.normal=0]="normal",tl[tl.transformFeedback=1]="transformFeedback";var nx=1,nb=function(e){function i(i,r){var n;if((n=e.call(this,i)||this).stringTags={},n.enabledMacros={},n.destroyed=!1,n.initialized=!1,n.shaderDirty=!0,n.floats={},n.ints={},n.vector2s={},n.vector3s={},n.vector4s={},n.colors={},n.quaternions={},n.matrices={},n.matrice3s={},n.textures={},n.floatArrays={},n.vector4Arrays={},n.matrixArrays={},n.samplers=[],n.uniforms=[],n.uniformDirty=!0,n.macrosDirty=!0,n.materialState=new ng,r){var a=r.name,s=void 0===a?"Material"+nx++:a,o=r.renderType,u=r.shader;n.name=s,n.renderType=void 0===o?0:o,n.shaderSource=u,n.props=r,n._shader=new t.Shader(i),n._shader.shaderData=re({},r.shader,{id:iR(),dataType:ey.Shader})}else n.name="Material"+nx++,n.renderType=0;return n}iG(i,e);var r=i.prototype;return r.enableMacro=function(t,e){this.isMacroEnabled(t)&&this.enabledMacros[t]===e||(this.enabledMacros[t]=null==e||e,this.macrosDirty=!0)},r.disableMacro=function(t){this.isMacroEnabled(t)&&(delete this.enabledMacros[t],this.macrosDirty=!0)},r.isMacroEnabled=function(t){return void 0!==this.enabledMacros[t]},r.initialize=function(){var t=this,e=this.engine;this.createShaderVariant(),this.shaderVariant.initialize(),this.initialized||(e.addMaterial(this),Object.keys(this.textures).forEach(function(e){var i=t.textures[e];if(!i_(i.initialize)){iT.error("Failed to initialize texture: "+JSON.stringify(i)+". Ensure the texture conforms to the expected format.");return}i.initialize()}),this.initialized=!0)},r.createShaderVariant=function(){(this.shaderDirty||this.macrosDirty)&&(this.shaderVariant=this._shader.createVariant(this.enabledMacros),this.macrosDirty=!1,this.shaderDirty=!1,this.uniformDirty=!0)},r.setupStates=function(t){this.materialState.apply(t)},r.use=function(t,e){var i=t.engine,r=this.shaderVariant;if(r.bind(),this.setupStates(i),e){for(var n,a,s=iH(e.uniforms);!(a=s()).done;)n=a.value,this.checkUniform(n);for(var o,u=iH(e.samplers);!(o=u()).done;)n=o.value,this.samplers.includes(n)||(this.samplers.push(n),this.uniformDirty=!0)}if(this.uniformDirty&&(r.fillShaderInformation(this.uniforms,this.samplers),this.uniformDirty=!1),e){for(n in e.floats)r.setFloat(n,e.floats[n]);for(n in e.ints)r.setInt(n,e.ints[n]);for(n in e.vector4s)r.setVector4(n,e.vector4s[n]);for(n in e.vector3s)r.setVector3(n,e.vector3s[n]);for(n in e.matrices)r.setMatrix(n,e.matrices[n])}for(n in this.textures)this.textures[n].initialize();for(n in this.floats)r.setFloat(n,this.floats[n]);for(n in this.ints)r.setInt(n,this.ints[n]);for(n in this.floatArrays)r.setFloats(n,this.floatArrays[n]);for(n in this.textures)r.setTexture(n,this.textures[n]);for(n in this.vector2s)r.setVector2(n,this.vector2s[n]);for(n in this.vector3s)r.setVector3(n,this.vector3s[n]);for(n in this.vector4s)r.setVector4(n,this.vector4s[n]);for(n in this.colors)r.setColor(n,this.colors[n]);for(n in this.quaternions)r.setQuaternion(n,this.quaternions[n]);for(n in this.matrices)r.setMatrix(n,this.matrices[n]);for(n in this.matrice3s)r.setMatrix3(n,this.matrice3s[n]);for(n in this.vector4Arrays)r.setVector4Array(n,this.vector4Arrays[n]);for(n in this.matrixArrays)r.setMatrixArray(n,this.matrixArrays[n])},r.getFloat=function(t){return this.floats[t]},r.setFloat=function(t,e){this.checkUniform(t),this.floats[t]=e},r.getInt=function(t){return this.ints[t]},r.setInt=function(t,e){this.checkUniform(t),this.ints[t]=e},r.getFloats=function(t){return this.floatArrays[t]},r.setFloats=function(t,e){this.checkUniform(t),this.floatArrays[t]=e},r.getVector2=function(t){return this.vector2s[t]},r.setVector2=function(t,e){this.checkUniform(t),this.vector2s[t]=e},r.getVector3=function(t){return this.vector3s[t]},r.setVector3=function(t,e){this.checkUniform(t),this.vector3s[t]=e},r.getVector4=function(t){return this.vector4s[t]},r.setVector4=function(t,e){this.checkUniform(t),this.vector4s[t]=e},r.getColor=function(t){return this.colors[t]},r.setColor=function(t,e){this.checkUniform(t),this.colors[t]=e},r.getQuaternion=function(t){return this.quaternions[t]},r.setQuaternion=function(t,e){this.checkUniform(t),this.quaternions[t]=e},r.getMatrix=function(t){return this.matrices[t]},r.setMatrix=function(t,e){this.checkUniform(t),this.matrices[t]=e},r.setMatrix3=function(t,e){this.checkUniform(t),this.matrice3s[t]=e},r.getVector4Array=function(t){return this.vector4Arrays[t]},r.setVector4Array=function(t,e){this.checkUniform(t),this.vector4Arrays[t]=[];for(var i,r=iH(e);!(i=r()).done;){var n=i.value;this.vector4Arrays[t].push(n.x,n.y,n.z,n.w)}},r.getMatrixArray=function(t){return this.matrixArrays[t]},r.setMatrixArray=function(t,e){this.checkUniform(t),this.matrixArrays[t]=[];for(var i,r=iH(e);!(i=r()).done;)for(var n=i.value,a=0;a<16;a++)this.matrixArrays[t].push(n.elements[a])},r.setMatrixNumberArray=function(t,e){this.checkUniform(t),this.matrixArrays[t]=e},r.getTexture=function(t){return this.textures[t]},r.setTexture=function(t,e){this.samplers.includes(t)||(this.samplers.push(t),this.uniformDirty=!0),this.textures[t]=e},r.hasUniform=function(t){return this.uniforms.includes(t)||this.samplers.includes(t)},r.clone=function(t){var e=t||this.props,r=this.engine;iy(r);var n=i.create(r,e);return n.materialState=Object.assign(new ng,n.materialState),n.floats=this.floats,n.ints=this.ints,n.vector2s=this.vector2s,n.vector3s=this.vector3s,n.vector4s=this.vector4s,n.colors=this.colors,n.quaternions=this.quaternions,n.matrices=this.matrices,n.textures=this.textures,n.floatArrays=this.floatArrays,n.vector4Arrays=this.vector4Arrays,n.matrixArrays=this.matrixArrays,n.samplers=this.samplers,n.uniforms=this.uniforms,n.uniformDirty=!0,n},r.cloneUniforms=function(t){var e;for(e in t.floats)this.setFloat(e,t.floats[e]);for(e in t.ints)this.setInt(e,t.ints[e]);for(e in t.floatArrays)this.setFloats(e,t.floatArrays[e]);for(e in t.textures)this.setTexture(e,t.textures[e]);for(e in t.vector2s)this.setVector2(e,t.vector2s[e]);for(e in t.vector3s)this.setVector3(e,t.vector3s[e]);for(e in t.vector4s)this.setVector4(e,t.vector4s[e]);for(e in t.colors)this.setColor(e,t.colors[e]);for(e in t.quaternions)this.setQuaternion(e,t.quaternions[e]);for(e in t.matrices)this.setMatrix(e,t.matrices[e]);for(e in t.vector4Arrays){for(var i=[],r=0;r<t.vector4Arrays[e].length;r+=4)i.push(new e6(t.vector4Arrays[e][r],t.vector4Arrays[e][r+1],t.vector4Arrays[e][r+2],t.vector4Arrays[e][r+3]));this.setVector4Array(e,i)}for(e in t.matrixArrays){for(var n=[],a=0;a<t.matrixArrays[e].length;a+=16){for(var s=nl.fromIdentity(),o=0;o<16;o++)s.elements[o]=t.matrixArrays[e][a+o];n.push(s)}this.setMatrixArray(e,n)}},r.fromData=function(t){e.prototype.fromData.call(this,t),this.uniforms=[],this.samplers=[],this.textures={},this.floats={},this.ints={},this.floatArrays={},this.vector4s={};var i,r,n=re({},t);void 0!==t.stringTags.RenderType&&(this.blending=t.stringTags.RenderType===tQ.Transparent),void 0!==t.floats.ZTest&&(this.depthTest=0!==t.floats.ZTest),void 0!==t.floats.ZWrite&&(this.depthMask=0!==t.floats.ZWrite);var a=t.stringTags.RenderFace;for(i in a===tJ.Front?(this.culling=!0,this.cullFace=rD.BACK):a===tJ.Back?(this.culling=!0,this.cullFace=rD.FRONT):this.culling=!1,n.floats)this.setFloat(i,n.floats[i]);for(i in n.ints)this.setInt(i,n.ints[i]);for(i in n.vector4s){var s=n.vector4s[i];this.setVector4(i,new e6(s.x,s.y,s.z,s.w))}for(i in n.colors){var o=n.colors[i];this.setColor(i,new e8(o.r,o.g,o.b,o.a))}for(i in n.textures){var u=n.textures[i],h=this.engine.findObject(u.texture);this.setTexture(i,h);var l=u.offset,c=u.scale;l&&c&&this.setVector4(i+"_ST",new e6(c.x,c.y,l.x,l.y))}if(t.shader){var f=this.engine.findObject(t.shader);f&&(this.shader=f,this.shaderSource=f.shaderData)}this.stringTags=null!=(r=t.stringTags)?r:{},this.initialized=!1},r.toData=function(){var t=this.definition;for(var e in this._shader&&(t.shader=this._shader),t.floats={},t.ints={},t.vector4s={},t.colors={},t.textures={},t.dataType=ey.Material,t.stringTags=this.stringTags,this.floats)t.floats[e]=this.floats[e];for(var i in this.ints)t.ints[i]=this.ints[i];for(var r in this.vector4s)t.vector4s[r]=this.vector4s[r];for(var n in this.colors)t.colors[n]=this.colors[n];for(var a in this.textures){t.textures[a]||(t.textures[a]={texture:this.textures[a]});var s=t.textures[a],o=this.getVector4(a+"_ST");o&&(s.scale={x:o.x,y:o.y},s.offset={x:o.z,y:o.w},delete t.vector4s[a+"_ST"])}return t},r.checkUniform=function(t){this.uniforms.includes(t)||(this.uniforms.push(t),this.uniformDirty=!0)},r.dispose=function(){var t;this.destroyed||(null==(t=this.shaderVariant)||t.dispose(),this.textures={},this.shaderSource=null,this.floats={},this.ints={},this.vector2s={},this.vector3s={},this.vector4s={},this.quaternions={},this.matrices={},this.matrice3s={},this.textures={},this.floatArrays={},this.vector4Arrays={},this.matrixArrays={},this.samplers=[],this.uniforms=[],this.initialize=iI,this.destroyed=!0,void 0!==this.engine&&this.engine.removeMaterial(this),e.prototype.dispose.call(this))},rV(i,[{key:"shader",get:function(){return this._shader},set:function(t){this._shader!==t&&(this._shader=t,this.shaderDirty=!0)}},{key:"mainTexture",get:function(){return this.getTexture("_MainTex")},set:function(t){this.setTexture("_MainTex",t)}},{key:"color",get:function(){return this.getColor("_Color")},set:function(t){this.setColor("_Color",t)}},{key:"blending",get:function(){return this.materialState.blending},set:function(t){void 0!==t&&this.materialState.setBlending(t)}},{key:"blendColor",get:function(){return this.materialState.blendColor},set:function(t){t&&this.materialState.setBlendColor(t)}},{key:"blendFunction",get:function(){return this.materialState.blendFunctionParameters},set:function(t){t&&this.materialState.setBlendFunctionParameters(t)}},{key:"blendEquation",get:function(){return this.materialState.blendEquationParameters},set:function(t){t&&this.materialState.setBlendEquationParameters(t)}},{key:"depthTest",get:function(){return this.materialState.depthTest},set:function(t){void 0!==t&&this.materialState.setDepthTest(t)}},{key:"depthMask",get:function(){return this.materialState.depthMask},set:function(t){void 0!==t&&this.materialState.setDepthMask(t)}},{key:"depthRange",get:function(){return this.materialState.depthRange},set:function(t){t&&this.materialState.setDepthRange(t)}},{key:"depthFunc",get:function(){return this.materialState.depthFunc},set:function(t){void 0!==t&&this.materialState.setDepthFunc(t)}},{key:"polygonOffsetFill",get:function(){return this.materialState.polygonOffsetFill},set:function(t){void 0!==t&&this.materialState.setPolygonOffsetFill(t)}},{key:"polygonOffset",get:function(){return this.materialState.polygonOffset},set:function(t){t&&this.materialState.setPolygonOffset(t)}},{key:"sampleAlphaToCoverage",get:function(){return this.materialState.sampleAlphaToCoverage},set:function(t){void 0!==t&&this.materialState.setSampleAlphaToCoverage(t)}},{key:"colorMask",get:function(){return this.materialState.colorMask[0]},set:function(t){this.materialState.setColorMask(t)}},{key:"stencilTest",get:function(){return this.materialState.stencilTest},set:function(t){void 0!==t&&this.materialState.setStencilTest(t)}},{key:"stencilMask",get:function(){return this.materialState.stencilMask},set:function(t){t&&this.materialState.setStencilMask(t)}},{key:"stencilRef",get:function(){return this.materialState.stencilRef},set:function(t){t&&this.materialState.setStencilRef(t)}},{key:"stencilFunc",get:function(){return this.materialState.stencilFunc},set:function(t){t&&this.materialState.setStencilFunc(t)}},{key:"stencilOpFail",get:function(){return this.materialState.stencilOpFail},set:function(t){t&&this.materialState.setStencilOpFail(t)}},{key:"stencilOpZFail",get:function(){return this.materialState.stencilOpZFail},set:function(t){t&&this.materialState.setStencilOpZFail(t)}},{key:"stencilOpZPass",get:function(){return this.materialState.stencilOpZPass},set:function(t){t&&this.materialState.setStencilOpZPass(t)}},{key:"culling",get:function(){return this.materialState.culling},set:function(t){void 0!==t&&this.materialState.setCulling(t)}},{key:"frontFace",get:function(){return this.materialState.frontFace},set:function(t){void 0!==t&&this.materialState.setFrontFace(t)}},{key:"cullFace",get:function(){return this.materialState.cullFace},set:function(t){void 0!==t&&this.materialState.setCullFace(t)}},{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(i$);nb.create=function(t,e){return new nb(t,e)};var nT=function(){function e(){this.alphaMaskEnabled=!1,this.isMask=!1,this.maskReferences=[],this.expectedStencilValue=0,this.prevStencilFunc=[0,0],this.prevStencilOpFail=[0,0],this.prevStencilOpZFail=[0,0],this.prevStencilOpZPass=[0,0],this.prevStencilRef=[0,0],this.prevStencilMask=[0,0],this.stencilClearAction={stencilAction:t.TextureLoadAction.clear}}var i=e.prototype;return i.setMaskOptions=function(t,e){var i=e.isMask,r=void 0!==i&&i,n=e.references,a=void 0===n?[]:n,s=e.alphaMaskEnabled;if(this.alphaMaskEnabled=void 0!==s&&s,this.isMask=r,this.maskReferences=[],!r&&0!==a.length)for(var o,u=new Map,h=iH(a);!(o=h()).done;){var l,c=o.value,f=c.mask;if(f){var d=t.findObject(f);if(!d){console.warn("Mask reference not found: "+JSON.stringify(f)+". Skipping.");continue}var p=null!=(l=c.inverted)&&l,m=u.get(d);if(void 0!==m){m!==p&&console.warn("Same maskable referenced with conflicting inverted flags; keeping the first occurrence.");continue}if(this.maskReferences.length>=254){console.warn("Maximum of 254 mask references exceeded. Additional masks will be ignored.");break}u.set(d,p),this.maskReferences.push({maskable:d,inverted:p})}}},i.addMaskReference=function(t,e){if(void 0===e&&(e=!1),!this.maskReferences.some(function(e){return e.maskable===t})){if(this.maskReferences.length>=254){console.warn("Maximum of 254 mask references exceeded. Additional masks will be ignored.");return}this.maskReferences.push({maskable:t,inverted:e})}},i.removeMaskReference=function(t){var e=this.maskReferences.findIndex(function(e){return e.maskable===t});-1!==e&&this.maskReferences.splice(e,1)},i.clearMaskReferences=function(){this.maskReferences=[]},i.getMaskReferences=function(){return this.maskReferences.slice()},i.drawStencilMask=function(t,e){for(var i,r=e.frameClipMasks,n=[],a=iH(r);!(i=a()).done;){var s=i.value,o=this.maskReferences.length;this.addMaskReference(s,!1),this.maskReferences.length>o&&n.push(s)}if(this.maskReferences.length>0){t.clear(this.stencilClearAction);for(var u,h=[],l=[],c=iH(this.maskReferences);!(u=c()).done;){var f=u.value;f.inverted?l.push(f):h.push(f)}for(var d=0;d<h.length;d++)h[d].maskable.drawStencilMask(d);for(var p,m=h.length,v=iH(l);!(p=v()).done;)p.value.maskable.drawStencilMask(m);this.expectedStencilValue=m}for(var y,g=iH(e.materials);!(y=g()).done;){var x=y.value;this.setupMaskedMaterial(x)}for(var b,T=iH(n);!(b=T()).done;){var E=b.value;this.removeMaskReference(E)}},i.drawGeometryMask=function(t,e,i,r,n,a){void 0===a&&(a=0);var s=r.colorMask,o=r.stencilTest;this.copyStencilArrayValue(this.prevStencilFunc,r.stencilFunc),this.copyStencilArrayValue(this.prevStencilOpFail,r.stencilOpFail),this.copyStencilArrayValue(this.prevStencilOpZFail,r.stencilOpZFail),this.copyStencilArrayValue(this.prevStencilOpZPass,r.stencilOpZPass),this.copyStencilArrayValue(this.prevStencilRef,r.stencilRef),this.copyStencilArrayValue(this.prevStencilMask,r.stencilMask),this.setupMaskMaterial(r,n),t.drawGeometry(e,i,r,a),r.colorMask=s,r.stencilTest=o,r.stencilFunc=this.prevStencilFunc,r.stencilOpFail=this.prevStencilOpFail,r.stencilOpZFail=this.prevStencilOpZFail,r.stencilOpZPass=this.prevStencilOpZPass,r.stencilRef=this.prevStencilRef,r.stencilMask=this.prevStencilMask},i.setupMaskMaterial=function(t,e){t.stencilTest=!0,t.stencilFunc=[rD.EQUAL,rD.EQUAL],t.stencilRef=[e,e],t.stencilMask=[255,255],t.stencilOpFail=[rD.KEEP,rD.KEEP],t.stencilOpZFail=[rD.KEEP,rD.KEEP],t.stencilOpZPass=[rD.INCR,rD.INCR],t.colorMask=!1},i.setupMaskedMaterial=function(t){this.maskReferences.length>0?(t.stencilTest=!0,t.stencilRef=[this.expectedStencilValue,this.expectedStencilValue],t.stencilMask=[255,255],t.stencilFunc=[rD.EQUAL,rD.EQUAL],t.stencilOpZPass=[rD.KEEP,rD.KEEP]):t.stencilTest=!1},i.copyStencilArrayValue=function(t,e){e&&(t[0]=e[0],t[1]=e[1])},rV(e,[{key:"maskable",get:function(){return this.maskReferences.length>0?this.maskReferences[0].maskable:null},set:function(t){this.maskReferences=[],t&&this.maskReferences.push({maskable:t,inverted:!1})}}]),e}();t.BufferUsage=void 0,(tc=t.BufferUsage||(t.BufferUsage={}))[tc.Stream=35040]="Stream",tc[tc.Static=35044]="Static",tc[tc.Dynamic=35048]="Dynamic",t.BufferDataType=void 0,(tf=t.BufferDataType||(t.BufferDataType={}))[tf.Byte=5120]="Byte",tf[tf.UnsignedByte=5121]="UnsignedByte",tf[tf.Short=5122]="Short",tf[tf.UnsignedShort=5123]="UnsignedShort",tf[tf.Int=5124]="Int",tf[tf.UnsignedInt=5125]="UnsignedInt",tf[tf.Float=5126]="Float";var nE=function(){function t(){this.references=0,this.capacity=0,this.is32Bits=!1}return rV(t,[{key:"underlyingResource",get:function(){return null}}]),t}();function nC(t){switch(t){case 5120:case 5121:return 1;case 5122:case 5123:return 2;case 5124:case 5125:case 5126:return 4;default:return 0}}function nS(t){return ej(t,Int8Array)?5120:ej(t,Uint8Array)?5121:ej(t,Int16Array)?5122:ej(t,Uint16Array)?5123:ej(t,Int32Array)?5124:ej(t,Uint32Array)?5125:5126}function n_(t){return Array.isArray(t)?t.length*Float32Array.BYTES_PER_ELEMENT:t.byteLength}function nw(t,e){switch(t){case 5120:return new Int8Array(e);case 5121:return new Uint8Array(e);case 5122:return new Int16Array(e);case 5123:return new Uint16Array(e);case 5124:return new Int32Array(e);case 5125:return new Uint32Array(e);default:return new Float32Array(e)}}var nM=function(){function e(t,e,i,r,n,a,s,o,u){void 0===r&&(r=0),void 0===n&&(n=!1),void 0===a&&(a=!1),void 0===s&&(s=!1),this.engine=t,this.isAlreadyOwned=!1,this._isDisposed=!1,this.updatable=i,this.instanced=a,this.divisor=o||1,this.label=u,this.byteStride=s?r:r*Float32Array.BYTES_PER_ELEMENT,ej(e,nE)?this.buffer=e:this.data=e,n||this.create()}var i=e.prototype;return i.isUpdatable=function(){return this.updatable},i.getData=function(){return this.data},i.getBuffer=function(){return this.buffer},i.getStrideSize=function(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT},i.createVertexBuffer=function(t,e,i,r,n,a,s){void 0===a&&(a=!1);var o=a?e:e*Float32Array.BYTES_PER_ELEMENT,u=r?a?r:r*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new nA(this.engine,this,t,{size:i,stride:u,offset:o,instanced:void 0===n?this.instanced:n,useBytes:!0,divisor:null!=s?s:this.divisor})},i.create=function(t){if((t||!this.buffer)&&(t=null!=t?t:this.data)){var e=this.getDataBufferOptions(t);this.buffer?this.updatable&&(this.engine.updateDynamicVertexBuffer(this.buffer,t),this.data=t):(this.buffer=this.updatable?this.engine.createDynamicVertexBuffer(t,e):this.engine.createVertexBuffer(t,e),this.updatable&&(this.data=t))}},i.update=function(t){this.create(t)},i.updateDirectly=function(t,e,i,r){void 0===r&&(r=!1),this.buffer&&this.updatable&&(this.engine.updateDynamicVertexBuffer(this.buffer,t,r?e:e*Float32Array.BYTES_PER_ELEMENT,i?i*this.byteStride:void 0),0===e&&void 0===i?this.data=t:this.data=void 0)},i.rebuild=function(){if(!this.data){if(!this.buffer)return;var t=this.buffer.capacity;if(t>0){var e=this.getDataBufferOptions();this.buffer=this.updatable?this.engine.createDynamicVertexBuffer(t,e):this.engine.createVertexBuffer(t,e)}else this.buffer=void 0;return}this.buffer=void 0,this.create(this.data)},i.increaseReferences=function(){if(this.buffer){if(!this.isAlreadyOwned){this.isAlreadyOwned=!0;return}this.buffer.references++}},i.dispose=function(){this.buffer&&this.engine.releaseBuffer(this.buffer)&&(this.data=void 0,this.buffer=void 0,this._isDisposed=!0)},i.getDataBufferOptions=function(e){return{usage:this.updatable?t.BufferUsage.Dynamic:t.BufferUsage.Static,type:e?nS(e):t.BufferDataType.Float,byteStride:this.byteStride,instanceDivisor:this.instanced?this.divisor:0,label:this.label}},rV(e,[{key:"isDisposed",get:function(){return this._isDisposed}},{key:"capacity",get:function(){var t,e;return null!=(e=null==(t=this.buffer)?void 0:t.capacity)?e:this.data?n_(this.data):0}}]),e}(),nA=function(){function t(e,i,r,n){void 0===n&&(n={}),this._isDisposed=!1,this.engine=e,this.kind=r,ej(i,nM)?(this.buffer=i,this.ownsBuffer=null!=(a=n.takeBufferOwnership)&&a):(this.buffer=new nM(e,i,null!=(s=n.updatable)&&s,null!=(o=n.stride)?o:0,null!=(u=n.postponeInternalCreation)&&u,null!=(h=n.instanced)&&h,null!=(l=n.useBytes)&&l,n.divisor,n.label),this.ownsBuffer=!0);var a,s,o,u,h,l,c,f,d,p,m,v,y,g=this.getData();this.type=null!=(c=n.type)?c:g?nS(g):t.FLOAT;var x=nC(this.type),b=null!=(f=n.useBytes)&&f,T=null!=(d=n.stride)?d:0,E=null!=(p=n.offset)?p:0;b?(this.size=n.size||(T?T/x:0),this.byteStride=T||this.buffer.byteStride||this.size*x,this.byteOffset=E):(this.size=n.size||T,this.byteStride=T?T*x:this.buffer.byteStride||this.size*x,this.byteOffset=E*x),this.normalized=null!=(m=n.normalized)&&m,this.instanced=null!=(v=n.instanced)&&v,this._instanceDivisor=this.instanced?null!=(y=n.divisor)?y:1:0}var e=t.prototype;return e.getKind=function(){return this.kind},e.isUpdatable=function(){return this.buffer.isUpdatable()},e.getData=function(){return this.buffer.getData()},e.getBuffer=function(){return this.buffer.getBuffer()},e.getWrapperBuffer=function(){return this.buffer},e.getStrideSize=function(){return this.byteStride/nC(this.type)},e.getOffset=function(){return this.byteOffset/nC(this.type)},e.getSize=function(t){return void 0===t&&(t=!1),t?this.size*nC(this.type):this.size},e.getIsInstanced=function(){return this.instanced},e.getInstanceDivisor=function(){return this._instanceDivisor},e.create=function(t){this.buffer.create(t)},e.update=function(t){this.buffer.update(t)},e.updateDirectly=function(t,e,i){void 0===i&&(i=!1),this.buffer.updateDirectly(t,e,void 0,i)},e.rebuild=function(){this.buffer.rebuild()},e.dispose=function(){this.ownsBuffer&&this.buffer.dispose(),this._isDisposed=!0},rV(t,[{key:"isDisposed",get:function(){return this._isDisposed}},{key:"instanceDivisor",get:function(){return this._instanceDivisor},set:function(t){this._instanceDivisor=t,this.instanced=0!==t}}]),t}();nA.PositionKind="aPos",nA.NormalKind="aNormal",nA.TangentKind="aTangent",nA.UVKind="aUV",nA.UV2Kind="aUV2",nA.UV3Kind="aUV3",nA.UV4Kind="aUV4",nA.UV5Kind="aUV5",nA.UV6Kind="aUV6",nA.ColorKind="aColor",nA.JointsKind="aJoints",nA.WeightsKind="aWeights",nA.BYTE=t.BufferDataType.Byte,nA.UNSIGNED_BYTE=t.BufferDataType.UnsignedByte,nA.SHORT=t.BufferDataType.Short,nA.UNSIGNED_SHORT=t.BufferDataType.UnsignedShort,nA.INT=t.BufferDataType.Int,nA.UNSIGNED_INT=t.BufferDataType.UnsignedInt,nA.FLOAT=t.BufferDataType.Float,t.HitTestType=void 0,(td=t.HitTestType||(t.HitTestType={}))[td.triangle=1]="triangle",td[td.box=2]="box",td[td.sphere=3]="sphere",td[td.custom=4]="custom";var nP=function(){this.position=new e4,this.delta=new e4,this.pointerCurrentRaycast=new nI},nI=function(){this.point=null,this.item=null},nR=function(){function t(t,e,i){this.vectors=[],this.vectorsWorld=[],this.directions=[];for(var r=0;r<8;r++)this.vectors.push(new e5),this.vectorsWorld.push(new e5);for(var n=0;n<3;n++)this.directions.push(new e5);this.minimum=new e5,this.maximum=new e5,this.minimumWorld=new e5,this.maximumWorld=new e5,this.center=new e5,this.centerWorld=new e5,this.extendSize=new e5,this.extendSizeWorld=new e5,this.worldMatrix=i||nl.fromIdentity(),this.reConstruct(t,e,i)}var e=t.prototype;return e.reConstruct=function(e,i,r){var n=e.x,a=e.y,s=e.z,o=i.x,u=i.y,h=i.z;this.minimum.set(n,a,s),this.maximum.set(o,u,h),this.vectors[0].set(n,a,s),this.vectors[1].set(o,u,h),this.vectors[2].set(o,a,s),this.vectors[3].set(n,u,s),this.vectors[4].set(n,a,h),this.vectors[5].set(o,u,s),this.vectors[6].set(n,u,h),this.vectors[7].set(o,a,h);var l=t.tempVector0,c=t.tempVector1;l.copyFrom(i).add(e),this.center.copyFrom(l).scale(.5),c.copyFrom(i).subtract(e),this.extendSize.copyFrom(c).scale(.5),this.worldMatrix=r||nl.fromIdentity(),this.update(this.worldMatrix)},e.update=function(e){var i=this.minimumWorld,r=this.maximumWorld,n=this.vectorsWorld,a=this.vectors;if(e.isIdentity()){i.copyFrom(this.minimum),r.copyFrom(this.maximum);for(var s=0;s<8;s++)n[s].copyFrom(a[s]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{i.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(var o=0;o<8;o++){e.transformPoint(a[o],n[o]);var u=n[o];i.x=Math.min(i.x,u.x),i.y=Math.min(i.y,u.y),i.z=Math.min(i.z,u.z),r.x=Math.max(r.x,u.x),r.y=Math.max(r.y,u.y),r.z=Math.max(r.z,u.z)}var h=t.tempVector0,l=t.tempVector1;h.copyFrom(r).subtract(i),this.extendSizeWorld.copyFrom(h).scale(.5),l.copyFrom(r).add(i),this.centerWorld.copyFrom(l).scale(.5)}var c=e.elements;this.directions[0].set(c[0],c[1],c[2]),this.directions[1].set(c[4],c[5],c[6]),this.directions[2].set(c[8],c[9],c[10]),this.worldMatrix=e},e.scale=function(e){var i=t.tempVector0;i.copyFrom(this.maximum).subtract(this.minimum);var r=i.length();i.scale(1/r),i.scale(r*e*.5);var n=t.tempVector1,a=t.tempVector2;return n.copyFrom(this.center).subtract(i),a.copyFrom(this.center).add(i),this.reConstruct(n,a,this.worldMatrix),this},e.getWorldMatrix=function(){return this.worldMatrix},e.intersectsPoint=function(t){var e=this.minimumWorld,i=this.maximumWorld;return!(i.x-t.x<-.000001)&&!(-.000001>t.x-e.x)&&!(i.y-t.y<-.000001)&&!(-.000001>t.y-e.y)&&!(i.z-t.z<-.000001)&&!(-.000001>t.z-e.z)},e.intersectsBox=function(t){return this.intersectsMinMax(t.minimumWorld,t.maximumWorld)},e.intersectsMinMax=function(t,e){var i=this.minimumWorld,r=this.maximumWorld;return!(r.x<t.x)&&!(i.x>e.x)&&!(r.y<t.y)&&!(i.y>e.y)&&!(r.z<t.z)&&!(i.z>e.z)},t.intersects=function(t,e){return t.intersectsMinMax(e.minimumWorld,e.maximumWorld)},t}();nR.tempVector0=new e5,nR.tempVector1=new e5,nR.tempVector2=new e5;var nO=function(){function e(){this.boundingBox=new nR(new e5,new e5),this.triangles=[],this.worldMatrix=new nl,this.assemblyTriangles=function(t,e,i,r,n){for(var a=i;a<r;a+=3){var s=3*e[a],o=3*e[a+1],u=3*e[a+2],h={x:t[s],y:t[s+1],z:t[s+2]},l={x:t[o],y:t[o+1],z:t[o+2]},c={x:t[u],y:t[u+1],z:t[u+2]};n.push({p0:h,p1:l,p2:c})}}}var i=e.prototype;return i.reConstruct=function(t,e,i){this.boundingBox.reConstruct(t,e,i)},i.getRawBoundingBoxTriangle=function(){return this.applyWorldMatrix(this.boundingBoxTriangle.area),this.boundingBoxTriangle},i.getBoundingBoxTriangle=function(e){for(var i,r=-Number.MAX_VALUE,n=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=Number.MAX_VALUE,o=iH(this.boundingBoxTriangle.area);!(i=o()).done;){var u=i.value;r=Math.max(u.p0.x,u.p1.x,u.p2.x,r),n=Math.max(u.p0.y,u.p1.y,u.p2.y,n),a=Math.min(u.p0.x,u.p1.x,u.p2.x,a),s=Math.min(u.p0.y,u.p1.y,u.p2.y,s)}var h=[],l=new e5(a,n,0),c=new e5(r,n,0),f=new e5(r,s,0),d=new e5(a,s,0);return h.push({p0:l,p1:c,p2:f}),h.push({p0:l,p1:f,p2:d}),this.applyWorldMatrix(h),{type:t.HitTestType.triangle,area:h}},i.setGeometry=function(e,i){this.triangles=this.geometryToTriangles(e);for(var r,n=[],a=iH(this.triangles);!(r=a()).done;){var s=r.value;n.push({p0:s.p0,p1:s.p1,p2:s.p2})}i&&this.worldMatrix.copyFrom(i),this.boundingBoxTriangle={type:t.HitTestType.triangle,area:n}},i.geometryToTriangles=function(t){var e=t.getIndexData(),i=t.getAttributeData(nA.PositionKind),r=[];if(!e||!i)return r;if(0===t.subMeshes.length)this.assemblyTriangles(i,e,0,e.length,r);else for(var n,a=iH(t.subMeshes);!(n=a()).done;){var s=n.value;if(void 0!==s.indexCount){var o=e.BYTES_PER_ELEMENT,u=s.offset/o,h=u+s.indexCount;this.assemblyTriangles(i,e,u,h,r)}}return r},i.applyWorldMatrix=function(t){var e=this;return t.forEach(function(t){t.p0=e.worldMatrix.transformPoint(t.p0,new e5),t.p1=e.worldMatrix.transformPoint(t.p1,new e5),t.p2=e.worldMatrix.transformPoint(t.p2,new e5)}),t},e}(),nV=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.materials=[],e.frameClipMasks=[],e.maskManager=new nT,e._priority=0,e.boundingBoxInfo=new nO,e}iG(e,t);var i=e.prototype;return i.onEnable=function(){var t;null==(t=this.item.composition)||t.renderFrame.addMeshToDefaultRenderPass(this)},i.onDisable=function(){var t;null==(t=this.item.composition)||t.renderFrame.removeMeshFromDefaultRenderPass(this)},i.onParentChanged=function(){this.frameClipMasks=[]},i.getBoundingBoxInfo=function(){return this.boundingBoxInfo},i.render=function(t){},rV(e,[{key:"priority",get:function(){return this._priority},set:function(t){this._priority=t}},{key:"material",get:function(){return this.materials[0]},set:function(t){0===this.materials.length?this.materials.push(t):this.materials[0]=t}}]),e}(rL);eW([iJ(void 0,void 0)],nV.prototype,"materials",void 0),eW([iJ(void 0,void 0)],nV.prototype,"_priority",void 0);var nL="editor",nN={"Item duration can't be less than 0":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#AOnQS","ValueType: 21/22 is not supported":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#smO1b","Container size overflowed":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#MvjnY","Container is not an HTMLElement":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#WZaWg","Invalid container size":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#lLlSW","DPI overflowed":"https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#ulfNT"},nF=function(){var t=this,e=this;this.listeners={},this.off=function(e,i){t.listeners[e]&&(t.listeners[e]=t.listeners[e].filter(function(t){return t.listener!==i}))},this.on=function(e,i,r){return t.listeners[e]=t.listeners[e]||[],t.listeners[e].push({listener:i,options:r}),function(){return t.off(e,i)}},this.once=function(e,i){t.on(e,i,{once:!0})},this.emit=function(t){for(var i,r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];null==(i=e.listeners[t])||i.forEach(function(i){var r=i.listener,a=i.options;r.apply(void 0,[].concat(n)),(null==a?void 0:a.once)&&e.off(t,r)})},this.getListeners=function(e){var i;return(null==(i=t.listeners[e])?void 0:i.map(function(t){return t.listener}))||[]}},nD=new rn,nk=new e5,nz=new e5,nB=1,nU=function(){function t(t,e){void 0===t&&(t={}),this.taggedProperties={},this.position=new e5(0,0,0),this.quat=new rn(0,0,0,1),this.rotation=new nc(0,0,0),this.scale=new e5(1,1,1),this.anchor=new e5(0,0,0),this.size=new e4(1,1),this.children=[],this.worldMatrix=nl.fromIdentity(),this.localMatrix=nl.fromIdentity(),this.localMatrix2D=nf.fromIdentity(),this.valid=!0,this.dirtyFlags={localData:!1,localMatrix2D:!1,worldMatrix:!1,worldTRS:!1},this.worldTRSCache={position:new e5(0,0,0),quat:new rn(0,0,0,1),scale:new e5(1,1,1)},this.name="transform_"+nB++,t&&this.setTransform(t),e&&(this.parentTransform=e),void 0!==t.valid&&this.setValid(t.valid)}var e=t.prototype;return e.onParentTransformChanged=function(t,e){},e.setPosition=function(t,e,i){(this.position.x!==t||this.position.y!==e||this.position.z!==i)&&(this.position.x=t,this.position.y=e,this.position.z=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.translate=function(t,e,i){(0!==t||0!==e||0!==i)&&(this.position.x+=t,this.position.y+=e,this.position.z+=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setRotation=function(t,e,i){(this.rotation.x!==t||this.rotation.y!==e||this.rotation.z!==i)&&(this.rotation.x=t,this.rotation.y=e,this.rotation.z=i,this.quat.setFromEuler(this.rotation),this.quat.conjugate(),this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setQuaternion=function(t,e,i,r){(this.quat.x!==t||this.quat.y!==e||this.quat.z!==i||this.quat.w!==r)&&(this.quat.x=t,this.quat.y=e,this.quat.z=i,this.quat.w=r,this.rotation.setFromQuaternion(this.quat),this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setScale=function(t,e,i){(this.scale.x!==t||this.scale.y!==e||this.scale.z!==i)&&(this.scale.x=t,this.scale.y=e,this.scale.z=i,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setSize=function(t,e){(this.size.x!==t||this.size.y!==e)&&(this.size.x=t,this.size.y=e,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.rotateByQuat=function(t){this.quat.multiply(t),this.rotation.setFromQuaternion(this.quat),this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.scaleBy=function(t,e,i){this.scale.x*=t,this.scale.y*=e,this.scale.z*=i,this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.setAnchor=function(t,e){(this.anchor.x!==t||this.anchor.y!==e)&&(this.anchor.x=t,this.anchor.y=e,this.dirtyFlags.localData=!0,this.dispatchValueChange())},e.setTransform=function(t,e){var i=t.position,r=t.rotation,n=t.scale,a=t.size,s=t.quat,o=t.name,u=t.anchor;if(o&&(this.name=o),i&&(ej(i,e5)?this.setPosition(i.x,i.y,i.z):this.setPosition(i[0],i[1],i[2])),s)ej(s,rn)?this.setQuaternion(s.x,s.y,s.z,s.w):this.setQuaternion(s[0],s[1],s[2],s[3]);else if(r){var h=e?-1:1;ej(r,nc)?this.setRotation(r.x*h,r.y*h,r.z*h):this.setRotation(r[0]*h,r[1]*h,r[2]*h)}n&&(ej(n,e5)?this.setScale(n.x,n.y,n.z):this.setScale(n[0],n[1],n[2])),a&&this.setSize(a.x,a.y),u&&(ej(u,e4)?this.setAnchor(u.x,u.y):this.setAnchor(u[0],u[1]))},e.addChild=function(t){eK(this.children,t)},e.removeChild=function(t){eQ(this.children,t)},e.getRotation=function(){return t.getRotation(this.quat,new nc)},e.getQuaternion=function(){return this.quat},e.updateLocalMatrix=function(){this.valid?(this.dirtyFlags.localData&&(this.localMatrix.compose(this.position,this.quat,this.scale,this.anchor),this.dirtyFlags.worldMatrix=!0,this.dirtyFlags.localMatrix2D=!0),this.dirtyFlags.localData=!1):this.localMatrix.isIdentity()||(this.localMatrix.identity(),this.dirtyFlags.worldMatrix=!0,this.dirtyFlags.localMatrix2D=!0)},e.getMatrix=function(){return this.updateLocalMatrix(),this.localMatrix},e.getMatrix2D=function(){var t,e,i;return this.updateLocalMatrix(),this.dirtyFlags.localMatrix2D&&(t=this.localMatrix2D,e=this.localMatrix.elements,(i=t.elements)[0]=e[0],i[1]=e[1],i[2]=0,i[3]=e[4],i[4]=e[5],i[5]=0,i[6]=e[12],i[7]=e[13],i[8]=1,this.dirtyFlags.localMatrix2D=!1),this.localMatrix2D},e.getParentMatrix=function(){return this.parent&&(this.parentMatrix=this.parent.getWorldMatrix()),this.parentMatrix},e.getWorldMatrix=function(){var t=this.getMatrix(),e=this.getParentMatrix();return this.dirtyFlags.worldMatrix&&(e?this.worldMatrix.multiplyMatrices(e,t):this.worldMatrix.copyFrom(t),this.dirtyFlags.worldTRS=!0,this.dirtyFlags.worldMatrix=!1),this.worldMatrix},e.getWorldScale=function(){return this.updateTRSCache(),this.worldTRSCache.scale.clone()},e.getWorldPosition=function(){return this.updateTRSCache(),this.worldTRSCache.position.clone()},e.setWorldPosition=function(t,e,i){var r=this.getParentMatrix();r?(nk.set(0,0,0),nD.set(0,0,0,1),nz.set(1,1,1),r.decompose(nk,nD,nz),nk.set(t-nk.x,e-nk.y,i-nk.z),nD.invert(),nk.applyQuaternion(nD),nk.x=0!==nz.x?nk.x/nz.x:0,nk.y=0!==nz.y?nk.y/nz.y:0,nk.z=0!==nz.z?nk.z/nz.z:0,this.setPosition(nk.x,nk.y,nk.z)):this.setPosition(t,e,i)},e.getWorldRotation=function(){return this.updateTRSCache(),t.getRotation(this.worldTRSCache.quat,new nc)},e.assignWorldTRS=function(t,e,i){this.updateTRSCache(),t&&t.copyFrom(this.worldTRSCache.position),e&&e.copyFrom(this.worldTRSCache.quat),i&&i.copyFrom(this.worldTRSCache.scale)},e.cloneFromMatrix=function(t,e){t.decompose(this.position,this.quat,this.scale),this.rotation.setFromQuaternion(this.quat.clone().conjugate()),e&&e.copyFrom(this.scale),this.dirtyFlags.localData=!0,this.dispatchValueChange()},e.setValid=function(t){this.valid!==t&&(this.valid=t,t?this.dirtyFlags.localData=!0:(this.localMatrix.identity(),this.dirtyFlags.worldMatrix=!0,this.dirtyFlags.localMatrix2D=!0),this.dispatchValueChange())},e.getValid=function(){return this.valid},e.toData=function(){var t=this.taggedProperties;return t.position=this.position.clone(),t.eulerHint={x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},t.scale=this.scale.clone(),t},e.fromData=function(t){var e={};e.position=new e5().copyFrom(t.position),t.quat?e.quat=new rn(t.quat.x,t.quat.y,t.quat.z,t.quat.w):e.rotation=new nc(t.eulerHint.x,t.eulerHint.y,t.eulerHint.z),e.scale=new e5().copyFrom(t.scale),t.size&&(e.size=new e4().copyFrom(t.size)),t.anchor&&(e.anchor=new e4().copyFrom(t.anchor)),this.setTransform(e)},e.dispose=function(){},e.updateTRSCache=function(){var t=this.getWorldMatrix();if(this.dirtyFlags.worldTRS){var e=this.worldTRSCache;t.decompose(e.position,e.quat,e.scale),this.dirtyFlags.worldTRS=!1}},e.dispatchValueChange=function(){this.children.forEach(function(t){t.worldMatrixDirty=!0})},t.getRotation=function(t,e){var i=nD.copyFrom(t);return i.conjugate(),e.setFromQuaternion(i)},rV(t,[{key:"parentTransform",get:function(){return this.parent},set:function(t){if(t&&this.parent!==t&&this!==t){var e=this.parent;this.parent&&this.parent.removeChild(this),t.addChild(this),this.parent=t,this.worldMatrixDirty=!0,this.onParentTransformChanged(e,t)}}},{key:"worldMatrixDirty",get:function(){return this.dirtyFlags.worldMatrix},set:function(t){this.dirtyFlags.worldMatrix!==t&&(this.dirtyFlags.worldMatrix=t,this.dispatchValueChange())}}]),t}();t.VFXItem=function(e){function i(t,i){var r;return(r=e.call(this,t)||this).children=[],r.transform=new nU,r.time=-1,r.duration=0,r.endBehavior=t2.forward,r.type=tZ.base,r.components=[],r.isDuringPlay=!1,r.isManuallySetRenderOrder=!1,r.active=!0,r.visible=!0,r.listIndex=0,r.isEnabled=!1,r.eventProcessor=new nF,r.name="VFXItem",r.transform.name=r.name,r.transform.engine=t,i&&r.fromData(i),r}iG(i,e);var r=i.prototype;return r.on=function(t,e,i){this.eventProcessor.on(t,e,i)},r.off=function(t,e){this.eventProcessor.off(t,e)},r.once=function(t,e){this.eventProcessor.once(t,e)},r.emit=function(t){for(var e,i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];(e=this.eventProcessor).emit.apply(e,[].concat([t],r))},r.getListeners=function(t){return this.eventProcessor.getListeners(t)},r.addComponent=function(t){var e=new t(this.engine);return this.components.push(e),e.setVFXItem(this),e},r.getComponent=function(t){for(var e,i,r=iH(this.components);!(i=r()).done;){var n=i.value;if(ej(n,t)){e=n;break}}return e},r.getComponents=function(t){for(var e,i=[],r=iH(this.components);!(e=r()).done;){var n=e.value;ej(n,t)&&i.push(n)}return i},r.getDescendants=function(t,e){var i=[];return this.getDescendantsInternal(i,t,e),i},r.setParent=function(t){(t!==this||t)&&(this.parent&&eQ(this.parent.children,this),this.parent=t,this.transform.parentTransform=t.transform,t.children.push(this),!this.composition&&t.composition&&(this.composition=t.composition),this.onParentChanged(),!this.isDuringPlay&&t.isDuringPlay&&(this.awake(),this.beginPlay()))},r.setColor=function(t,e,i,r){},r.setOpacity=function(t){},r.setActive=function(t){!!t!==this.active&&(this.active=!!t,this.onActiveChanged())},r.setVisible=function(t){for(var e,i=iH(this.components);!(e=i()).done;)e.value.enabled=t;this.visible=t},r.getVisible=function(){return this.visible},r.getWorldTransform=function(t){var e=null!=t?t:new nU({valid:!0});return e.cloneFromMatrix(this.transform.getWorldMatrix()),e},r.translate=function(t,e,i){this.transform.translate(t,e,i)},r.rotate=function(t,e,i){var r=new nc(t,e,i),n=rn.fromEuler(r);n.conjugate(),this.transform.rotateByQuat(n)},r.scale=function(t,e,i){this.transform.scaleBy(t,e,i)},r.setPosition=function(t,e,i){this.transform.setPosition(t,e,i)},r.setRotation=function(t,e,i){this.transform.setRotation(t,e,i)},r.setScale=function(t,e,i){this.transform.setScale(t,e,i)},r.setWorldPosition=function(t,e,i){this.transform.setWorldPosition(t,e,i)},r.setPositionByPixel=function(t,e){if(this.composition){var i=this.transform.getWorldPosition().z,r=this.composition.camera.getInverseVPRatio(i),n=r.x,a=r.y,s=this.composition.engine.canvas.getBoundingClientRect(),o=s.width,u=s.height;this.transform.setPosition((2*t/o-1)*n,(1-2*e/u)*a,i)}},r.translateByPixel=function(t,e){if(this.composition){var i=this.composition.engine.canvas.getBoundingClientRect(),r=i.width,n=i.height,a=this.transform.getWorldPosition().z,s=this.composition.camera.getInverseVPRatio(a),o=s.x,u=s.y;this.transform.translate(2*t*o/r,-2*e*u/n,0)}},r.getBoundingBox=function(){},r.getHitTestParams=function(t){},r.hitTest=function(e,r,n,a,s,o,u){if(!this.isActive)return!1;var h=!1,l=null==u?void 0:u.maxCount,c=this.getHitTestParams(o);if(c){var f=c.clipMasks,d=!0;if(f.length>0&&!function(t,e){for(var i,r=iH(e);!(i=r()).done;){var n=i.value.item;if(n.isActive&&n.transform.getValid()){var a=n.transform,s=a.getWorldMatrix(),o=a.size.x,u=a.size.y,h=new e5(-.5*o,.5*u,0).applyMatrix(s),l=new e5(-.5*o,-.5*u,0).applyMatrix(s),c=new e5(.5*o,.5*u,0).applyMatrix(s),f=new e5(.5*o,-.5*u,0).applyMatrix(s),d={p0:h,p1:l,p2:c},p={p0:c,p1:l,p2:f};if(!t.intersectTriangle(d)&&!t.intersectTriangle(p))return!1}}return!0}(e,f)&&(d=!1),d){var p=!1,m=new e5;if(c.type===t.HitTestType.triangle){for(var v=c.triangles,y=c.backfaceCulling,g=0;g<v.length;g++)if(e.intersectTriangle(v[g],m,y)){p=!0,s.push(m);break}}else if(c.type===t.HitTestType.box){var x=c.center,b=c.size,T=x.clone().addScaledVector(b,.5),E=x.clone().addScaledVector(b,-.5);e.intersectBox({min:T,max:E},m)&&(p=!0,s.push(m))}else if(c.type===t.HitTestType.sphere){var C=c.center,S=c.radius;e.intersectSphere({center:C,radius:S},m)&&(p=!0,s.push(m))}else if(c.type===t.HitTestType.custom){var _=c.collect(e,new e4(r,n));_&&_.length>0&&(_.forEach(function(t){s.push(t)}),p=!0)}if(p){var w,M,A={id:this.getInstanceId(),name:this.name,position:s[s.length-1],parentId:this.parentId,hitPositions:s,behavior:c.behavior,item:this,composition:this.composition};if(a.push(A),h=!0,null==u?void 0:null==(M=u.stop)?void 0:M.call(u,A))return!0}}}for(var P,I=iH(this.children);!(P=I()).done;){var R,O=P.value;if(void 0!==l&&a.length>=l)break;(null==u||null==(R=u.skip)||!R.call(u,O))&&O.hitTest(e,r,n,a,s,o,u)&&(h=!0)}return i.isComposition(this)&&h&&this!==(null==(w=this.composition)?void 0:w.sceneRoot)&&a.push({id:this.getInstanceId(),name:this.name,position:s[s.length-1],parentId:this.parentId,hitPositions:s,behavior:tY.NONE,item:this,composition:this.composition}),h},r.getCurrentPosition=function(){var t=new e5;return this.transform.assignWorldTRS(t),t},r.find=function(t){if(this.name===t)return this;var e=[];e.push.apply(e,[].concat(this.children));for(var i=0;i<e.length;){var r=e[i];if(i++,r.name===t)return r;e.push.apply(e,[].concat(r.children))}},r.duplicate=function(){var t=new Map;this.gatherPreviousObjectID(t),this.refreshGUIDRecursive();var e=this.engine.findObject({id:this.definition.id});return e.refreshGUIDRecursive(),this.refreshGUIDRecursive(t),this.composition&&e.setParent(this.composition.sceneRoot),e},r.beginPlay=function(){this.isDuringPlay=!0,this.composition&&this.active&&!this.isEnabled&&this.onEnable();for(var t,e=iH(this.children);!(t=e()).done;){var i=t.value;i.isDuringPlay||i.beginPlay()}},r.awake=function(){for(var t,e=iH(this.components);!(t=e()).done;){var i=t.value;i.isAwakeCalled||(i.onAwake(),i.isAwakeCalled=!0)}for(var r,n=iH(this.children);!(r=n()).done;)r.value.awake()},r.onActiveChanged=function(){this.isDuringPlay&&this.composition&&(this.active?this.isEnabled||this.onEnable():this.isEnabled&&this.onDisable())},r.onEnable=function(){this.isEnabled=!0;for(var t,e=iH(this.components);!(t=e()).done;){var i=t.value;i.enabled&&!i.isStartCalled&&(i.onStart(),i.isStartCalled=!0)}for(var r,n=iH(this.components);!(r=n()).done;){var a=r.value;a.enabled&&!a.isEnableCalled&&a.enable()}},r.onDisable=function(){this.isEnabled=!1;for(var t,e=iH(this.components);!(t=e()).done;){var i=t.value;i.enabled&&i.isEnableCalled&&i.disable()}},r.onParentChanged=function(){for(var t,e=iH(this.components);!(t=e()).done;)t.value.onParentChanged();for(var i,r=iH(this.children);!(i=r()).done;)i.value.onParentChanged()},r.setRendererComponentOrder=function(t){for(var e,i=iH(this.components);!(e=i()).done;){var r=e.value;ej(r,nV)&&(r.priority=t)}},r.fromData=function(t){e.prototype.fromData.call(this,t);var r=t.id,n=t.name,a=t.parentId,s=t.endBehavior,o=t.transform,u=t.duration,h=void 0===u?0:u,l=t.visible;if(this.type=t.type,this.props=t,this.id=r.toString(),this.parentId=a,this.components.length=0,i.isComposition(this)){var c=this.definition.content.options.refId,f=this.engine.findEffectsObjectData(c);if(!f)throw Error("Referenced precomposition with Id: "+c+" does not exist.");this.instantiatePreComposition(f)}if(this.name=n,this.duration=h,this.endBehavior=s,o&&this.transform.fromData(o),this.transform.name=this.name,this.transform.engine=this.engine,t.content||(t.content={options:{}}),h<0)throw Error("Item duration can't be less than 0, see "+nN["Item duration can't be less than 0"]+".");if(t.components)for(var d,p=iH(t.components);!(d=p()).done;){var m=d.value,v=this.engine.findObject(m);this.components.push(v)}for(var y,g,x=iH(null!=(y=t.children)?y:[]);!(g=x()).done;){var b=g.value;this.engine.findObject(b).setParent(this)}this.setVisible(void 0===l||l)},r.toData=function(){if(this.definition.id=this.guid,this.definition.transform=this.transform.toData(),this.definition.dataType=ey.VFXItemData,(null==(e=this.parent)?void 0:e.name)!=="sceneRoot"&&(this.definition.parentId=null==(i=this.parent)?void 0:i.guid),!this.definition.components){this.definition.components=[];for(var e,i,r,n=iH(this.components);!(r=n()).done;){var a=r.value;ej(a,t.EffectComponent)&&this.definition.components.push(a)}}this.definition.content={}},r.dispose=function(){if(this.composition){this.composition.destroyItem(this);for(var t,i=iH(this.components.slice());!(t=i()).done;)t.value.dispose();this.components=[],this._composition=null,this.transform.setValid(!1)}this.resetChildrenParent(),e.prototype.dispose.call(this)},r.resetChildrenParent=function(){for(var t,e,i=iH(this.children);!(e=i()).done;){var r=e.value;this.parent&&r.setParent(this.parent)}this.parent&&eQ(null==(t=this.parent)?void 0:t.children,this)},r.instantiatePreComposition=function(t,e){void 0===e&&(e=!0),this.name=t.name,this.duration=t.duration,this.endBehavior=t.endBehavior;var i=this.getInstanceId();this.setInstanceId(t.id);for(var r,n=iH(t.components);!(r=n()).done;){var a=r.value,s=this.engine.findObject(a);s.item=this,this.components.push(s)}for(var o,u,h=iH(null!=(o=t.children)?o:[]);!(u=h()).done;){var l=u.value;this.engine.findObject(l).setParent(this)}if(e){for(var c,f=iH(this.components);!(c=f()).done;)c.value.setInstanceId(iR());for(var d,p=iH(this.children);!(d=p()).done;)d.value.refreshGUIDRecursive()}this.setInstanceId(i)},r.refreshGUIDRecursive=function(t){var e=null!=(i=null==t?void 0:t.get(this))?i:iR();this.setInstanceId(e);for(var i,r,n=iH(this.components);!(r=n()).done;){var a,s=r.value,o=null!=(a=null==t?void 0:t.get(s))?a:iR();s.setInstanceId(o)}for(var u,h=iH(this.children);!(u=h()).done;)u.value.refreshGUIDRecursive(t)},r.gatherPreviousObjectID=function(t){t.set(this,this.getInstanceId());for(var e,i=iH(this.components);!(e=i()).done;){var r=e.value;t.set(r,r.getInstanceId())}for(var n,a=iH(this.children);!(n=a()).done;)n.value.gatherPreviousObjectID(t)},r.getDescendantsInternal=function(t,e,i){if(void 0===e&&(e=!1),this.children)for(var r=0;r<this.children.length;r++){var n=this.children[r];(!i||i(n))&&t.push(n),e||n.getDescendantsInternal(t,!1,i)}},i.isComposition=function(t){return t.type===tZ.composition},i.isSprite=function(t){return t.type===tZ.sprite},i.isParticle=function(t){return t.type===tZ.particle},i.isNull=function(t){return t.type===tZ.null},i.isTree=function(t){return t.type===tZ.tree},i.isCamera=function(t){return t.type===tZ.camera},i.isAncestor=function(t,e){for(var i=e.parent;i;){if(i===t)return!0;i=i.parent}return!1},rV(i,[{key:"composition",get:function(){return this._composition},set:function(t){this._composition=t;for(var e,i=iH(this.children);!(e=i()).done;){var r=e.value;r.composition||(r.composition=t)}}},{key:"compositionReusable",get:function(){var t,e;return null!=(e=null==(t=this.composition)?void 0:t.reusable)&&e}},{key:"renderOrder",get:function(){return this.listIndex},set:function(t){this.listIndex=t,this.isManuallySetRenderOrder=!0,this.setRendererComponentOrder(t)}},{key:"isActive",get:function(){return this.active},set:function(t){this.setActive(t)}},{key:"isVisible",get:function(){return this.visible}}]),i}(i$),t.VFXItem=eW([iK(ey.VFXItemData)],t.VFXItem),t.Item=void 0,(tp=t.Item||(t.Item={})).is=function(t,e){return t.type===e},tp.isComposition=function(t){return t.type===tZ.composition},tp.isParticle=function(t){return t.type===tZ.particle},tp.isNull=function(t){return t.type===tZ.null};var nG=(tv=new Int32Array((tm=new Float32Array(1)).buffer),function(t){tm[0]=t;var e=tv[0],i=e>>16&32768,r=e>>12&2047,n=e>>23&255;return n<103?i:n>142?(i|=31744,i|=(255==n?0:1)&&8388607&e):n<113?(r|=2048,i|=(r>>114-n)+(r>>113-n&1)):(i|=n-112<<10|r>>1,i+=1&r)}),nj=function(){function t(t){if(Number.isInteger(t))this.data=new Uint16Array(t);else if(t&&"object"==typeof t&&Number.isInteger(t.length))for(var e=this.data=new Uint16Array(t.length),i=0;i<e.length;i++)e[i]=nG(t[i])}return t.prototype.set=function(t,e){for(var i=0;i<t.length;i++)this.data[i+e]=nG(t[i])},t}(),nW=new nc,nX=new nl;function nH(t,e,i,r,n,a,s){var o=r/n,u=r,h=e.speedOverLifetime;h&&(u=h.getIntegrateValue(0,r,n));var l=e.gravityModifier?e.gravityModifier.getIntegrateByTime(0,r):0;t.copyFrom(a),t.addScaledVector(s,u),t.addScaledVector(i,l);var c=e.linearVelOverLifetime||{},f=e.orbitalVelOverLifetime||{};if(f.enabled){var d=new e5;f.center&&d.setFromArray(f.center);var p=t.clone().subtract(d),m=f.asRotation,v=["x","y","z"].map(function(t){var e=f[t];return e?m?e.getValue(o):e.getIntegrateValue(0,r,n):0});nW.setFromArray(v).negate(),nX.setFromEuler(nW);var y=nX.transformPoint(p);t.addVectors(d,y)}if(c.enabled){var g=c.asMovement,x=c.x,b=c.y,T=c.z;if(x){var E=g?x.getValue(o):x.getIntegrateValue(0,r,n);t.x=t.x+E}if(b){var C=g?b.getValue(o):b.getIntegrateValue(0,r,n);t.y=t.y+C}if(T){var S=g?T.getValue(o):T.getIntegrateValue(0,r,n);t.z=t.z+S}}return t}function nY(t){return Array.isArray(t)?[t[0],t[1],t[2]]:[0,0,0]}function nZ(t,e){for(var i=0,r=t.length;i<r;i++)t[i]=e;return t}function nq(t,e,i){if(e&&i)for(var r=0,n=e.length;r<n;r++)t[r]=e[r]*i[r];else if(e){if(t!==e)for(var a=0;a<e.length;a++)t[a]=e[a]}else if(i&&t!==i)for(var s=0;s<i.length;s++)t[s]=i[s];return t}var nK=((eA={})[tK.PARTICLE_ORIGIN_CENTER]=[0,0],eA[tK.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],eA[tK.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],eA[tK.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],eA[tK.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],eA[tK.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],eA[tK.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],eA[tK.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],eA[tK.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],eA);function nQ(t,e,i){var r=i.position,n=new e5(t,e,0),a=new e5;return i.getInverseViewProjectionMatrix().projectPoint(n,a),a.subtract(r),new nd(r,a)}function nJ(t,e,i){var r=t.x,n=t.y,a=t.z,s=new e5(r-e,n+i,a),o=new e5(r-e,n-i,a),u=new e5(r+e,n-i,a),h=new e5(r+e,n+i,a);return[{p0:s,p1:o,p2:u},{p0:s.clone(),p1:u.clone(),p2:h}]}function n$(t,e,i){return void 0===i&&(i=1e-6),Math.abs(t-e)<i}function n0(t,e){void 0===e&&(e=2);var i=Math.pow(10,e);return Math.floor(t*i)/i}function n1(t,e,i,r,n){void 0===r&&(r=null);var a=new e5(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new e5(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);n||(n=3);for(var o=e,u=e*n;o<e+i;o++,u+=n){var h=t[u],l=t[u+1],c=t[u+2];a.x=Math.min(a.x,h),a.y=Math.min(a.y,l),a.z=Math.min(a.z,c),s.x=Math.max(s.x,h),s.y=Math.max(s.y,l),s.z=Math.max(s.z,c)}return r&&(a.x-=a.x*r.x+r.y,a.y-=a.y*r.x+r.y,a.z-=a.z*r.x+r.y,s.x+=s.x*r.x+r.y,s.y+=s.y*r.x+r.y,s.z+=s.z*r.x+r.y),{minimum:a,maximum:s}}var n2={pointIndexCache:{xIndex:0,yIndex:0},getPointInCurve:function(t){t[0];var e=t[1],i=this.getPointIndexInCurve(t,this.pointIndexCache),r=i.xIndex,n=i.yIndex;return new e4(e[r],e[n])},getPointIndexInCurve:function(t,e){var i=t[0],r=t[2],n=i===t1.LINE?0:i===t1.EASE_OUT?0:i===t1.EASE_IN?2:i===t1.EASE?2:i===t1.HOLD&&r===t1.EASE_IN?2:0;return e?(e.xIndex=n,e.yIndex=n+1,e):{xIndex:n,yIndex:n+1}},isLeftSideEase:function(t){var e=t[0];t[1];var i=t[2];return!!(e===t1.HOLD&&this.isKeyframeTypeLeftSideEase(i))||this.isKeyframeTypeLeftSideEase(e)},isRightSideEase:function(t){var e=t[0];t[1];var i=t[2];return!!(e===t1.HOLD&&this.isKeyframeTypeRightSideEase(i))||this.isKeyframeTypeRightSideEase(e)},isKeyframeTypeLeftSideEase:function(t){return[t1.EASE,t1.EASE_IN,t1.AUTO].includes(t)},isKeyframeTypeRightSideEase:function(t){return[t1.EASE,t1.EASE_OUT,t1.AUTO].includes(t)},isHoldInKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===t1.HOLD&&[t1.HOLD,t1.LINE_OUT,t1.EASE_OUT].includes(i)},isHoldOutKeyframe:function(t){var e=t[0];t[1];var i=t[2];return e===t1.HOLD&&[t1.HOLD,t1.LINE,t1.EASE_IN].includes(i)}},n3=function(t,e){this.points=t,this.totalLength=e},n4={},n5={};function n6(t,e,i){return(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t}function n8(t,e,i){return 3*(1-3*i+3*e)*t*t+2*(3*i-6*e)*t+3*e}function n9(t,e,i,r){var n=n0(e.x-t.x,3)+"_"+n0(e.y-t.y,3)+"_"+n0(e.z-t.z,3)+"&"+(n0(i.x-t.x,3)+"_"+n0(i.y-t.y,3))+"_"+n0(i.z-t.z,3)+"&"+(n0(r.x-t.x,3)+"_"+n0(r.y-t.y,3))+"_"+n0(r.z-t.z,3);if(n5[n])return{data:n5[n],interval:t};for(var a=[],s=null,o=0,u=0,h=0;h<300;h+=1){var l=new e5,c=h/299;u=0,l.x=3*Math.pow(1-c,2)*c*(i.x-t.x)+3*(1-c)*Math.pow(c,2)*(r.x-t.x)+Math.pow(c,3)*(e.x-t.x),l.y=3*Math.pow(1-c,2)*c*(i.y-t.y)+3*(1-c)*Math.pow(c,2)*(r.y-t.y)+Math.pow(c,3)*(e.y-t.y),l.z=3*Math.pow(1-c,2)*c*(i.z-t.z)+3*(1-c)*Math.pow(c,2)*(r.z-t.z)+Math.pow(c,3)*(e.z-t.z),null!==s&&(u+=Math.pow(l.x-s.x,2)+Math.pow(l.y-s.y,2)+Math.pow(l.z-s.z,2)),s=l,o+=u=Math.sqrt(u),a[h]={partialLength:u,point:l}}var f=new n3(a,o);return n5[n]=f,{data:f,interval:new e5(t.x,t.y,t.z)}}var n7=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.catching={lastPoint:0,lastAddedLength:0};var n=n9(t,e,i,r),a=n.data,s=n.interval;this.lengthData=a,this.interval=s,this.totalLength=a.totalLength}return t.prototype.getPointInPercent=function(t){var e=this.lengthData;if(0===t)return e.points[0].point.clone().add(this.interval);if(n$(1-t,0))return e.points[299].point.clone().add(this.interval);if(n$(e.totalLength,0))return this.p1.clone();var i=new e5,r=n0(e.totalLength*t,4),n=this.catching.lastAddedLength,a=this.catching.lastPoint;if(n$(n,r))return e.points[a].point.clone().add(this.interval);var s=!0,o=1;for(r<n&&(o=-1);s;){if(r>=n){if(299===a){i.x=e.points[a].point.x,i.y=e.points[a].point.y,i.z=e.points[a].point.z;break}if(r<n+e.points[a+1].partialLength){var u=(r-n)/e.points[a+1].partialLength;i.x=e.points[a].point.x+(e.points[a+1].point.x-e.points[a].point.x)*u,i.y=e.points[a].point.y+(e.points[a+1].point.y-e.points[a].point.y)*u,i.z=e.points[a].point.z+(e.points[a+1].point.z-e.points[a].point.z)*u;break}}o>0&&a<299?(a+=o,n+=n0(e.points[a].partialLength,5)):o<0&&a>0?(n-=n0(e.points[a].partialLength,5),a+=o):s=!1}return this.catching.lastPoint=a,this.catching.lastAddedLength=n,i.add(this.interval),i},t}(),at=function(){function t(t,e,i,r){this.p1=t,this.p2=e,this.p3=i,this.p4=r,this.temp=new rn,this.totalLength=0}return t.prototype.getPointInPercent=function(t){return 0===t?this.temp.copyFrom(this.p1):n$(1-t,0)?this.temp.copyFrom(this.p2):(an.slerpFlat(this.temp,this.p1,this.p2,t),this.temp)},t}(),ae=function(){function t(t,e,i,r){this.precomputed=!1,this.control1=new e4,this.control2=new e4,this.weighted=!1,this.isConstant=!1,this.mSampleValues=Array(11),void 0!==t&&void 0!==e&&void 0!==i&&void 0!==r?(this.control1.x=t,this.control1.y=e,this.control2.x=i,this.control2.y=r,this.weighted=!0):void 0!==t&&void 0!==e?(this.control1.x=1/3,this.control1.y=t,this.control2.x=2/3,this.control2.y=e):this.isConstant=!0}var e=t.prototype;return e.getValue=function(t){return this.isConstant?0:this.control1.x===this.control1.y&&this.control2.x===this.control2.y||0===t||1===t?t:this.weighted?(this.precomputed||this.precompute(),n6(this.getTForX(t),this.control1.y,this.control2.y)):this.bezierInterpolate(0,this.control1.y,this.control2.y,1,t)},e.bezierInterpolate=function(t,e,i,r,n){var a=1-n,s=a*a,o=n*n;return s*a*t+e*s*n*3+i*a*o*3+o*n*r},e.calcSampleValues=function(){for(var t=0;t<11;++t)this.mSampleValues[t]=n6(.1*t,this.control1.x,this.control2.x)},e.getTForX=function(t){for(var e=this.mSampleValues,i=0,r=1;10!==r&&e[r]<=t;++r)i+=.1;var n=i+(t-e[--r])/(e[r+1]-e[r])*.1,a=n8(n,this.control1.x,this.control2.x);return a>=.001?function(t,e,i,r){for(var n=0;n<4;++n){var a=n8(e,i,r);if(0===a)break;var s=n6(e,i,r)-t;e-=s/a}return e}(t,n,this.control1.x,this.control2.x):0===a?n:function(t,e,i,r,n){var a,s,o=0;do(a=n6(s=e+(i-e)/2,r,n)-t)>0?i=s:e=s;while(Math.abs(a)>1e-7&&++o<10);return s}(t,i,i+.1,this.control1.x,this.control2.x)},e.precompute=function(){this.precomputed=!0,(this.control1.x!==this.control1.y||this.control2.x!==this.control2.y)&&this.calcSampleValues()},t}();function ai(t,e){var i,r,n,a=ar(t,e,!0),s=a.p0,o=a.p1,u=a.p2,h=a.p3;iy(u),iy(h);var l=h.x-s.x,c=h.y-s.y,f=n0((o.x-s.x)/l,5),d=n0((u.x-s.x)/l,5);n$(c,0)?i=r=NaN:(i=n0((o.y-s.y)/c,5),r=n0((u.y-s.y)/c,5)),f<0&&(f=0),d<0&&(d=0),f>1&&(f=1),d>1&&(d=1);var p=("bez_"+f+"_"+i+"_"+d+"_"+r).replace(/\./g,"p");return n4[p]?n=n4[p]:(n=n$(c,0)?new ae:new ae(f,i,d,r),n4[p]=n),{points:[s,o,u,h],timeInterval:l,valueInterval:c,curve:n}}function ar(t,e,i){var r=t[1],n=n2.isHoldOutKeyframe(t),a=n2.isHoldInKeyframe(e),s=!a&&n2.isRightSideEase(t),o=!n&&n2.isLeftSideEase(e);if(s&&!o&&!a){var u=new e4(r[r.length-4],r[r.length-3]),h=new e4(r[r.length-2],r[r.length-1]),l=n2.getPointInCurve(e),c=new e4(l.x,l.y),f=new e4(c.x-(c.x-u.x)/10,c.y);return{type:"ease",p0:u,p1:h,p2:f,p3:c}}if(!s&&o&&!n){var d=e[1],p=n2.getPointInCurve(t),m=new e4(p.x,p.y),v=new e4(d[0],d[1]),y=new e4(d[2],d[3]),g=new e4(m.x+(y.x-m.x)/10,m.y);return{type:"ease",p0:m,p1:g,p2:v,p3:y}}if(s&&o){var x=e[1];return{type:"ease",p0:new e4(r[r.length-4],r[r.length-3]),p1:new e4(r[r.length-2],r[r.length-1]),p2:new e4(x[0],x[1]),p3:new e4(x[2],x[3])}}var b=n2.getPointInCurve(t),T=n2.getPointInCurve(e);if(n?T.y=b.y:a&&(b.y=T.y),!i)return{type:"line",p0:b,p1:T,isHold:n||a,leftHoldLine:n,rightHoldLine:a};var E=new e4((T.x-b.x)/3+b.x,(T.y-b.y)/3+b.y),C=new e4((T.x-b.x)/3*2+b.x,(T.y-b.y)/3*2+b.y);return{type:"line",p0:b,p1:E,p2:C,p3:T,isHold:n||a,leftHoldLine:n,rightHoldLine:a}}var an=function(){function t(){}return t.slerpFlat=function(t,e,i,r){var n=e.x,a=e.y,s=e.z,o=e.w,u=i.x,h=i.y,l=i.z,c=i.w;if(0===r){t.x=n,t.y=a,t.z=s,t.w=o;return}if(1===r){t.x=u,t.y=h,t.z=l,t.w=c;return}if(o!==c||n!==u||a!==h||s!==l){var f=1-r,d=n*u+a*h+s*l+o*c,p=d>=0?1:-1,m=1-d*d;if(m>Number.EPSILON){var v=Math.sqrt(m),y=Math.atan2(v,d*p);f=Math.sin(f*y)/v,r=Math.sin(r*y)/v}var g=r*p;if(n=n*f+u*g,a=a*f+h*g,s=s*f+l*g,o=o*f+c*g,f===1-r){var x=1/Math.sqrt(n*n+a*a+s*s+o*o);n*=x,a*=x,s*=x,o*=x}}t.x=n,t.y=a,t.z=s,t.w=o},t}(),aa="not_implement",as=function(){function t(t){this.onCreate(t)}var e=t.prototype;return e.onCreate=function(t){throw Error(aa)},e.getIntegrateValue=function(t,e,i){throw Error(aa)},e.getIntegrateByTime=function(t,e){throw Error(aa)},e.getValue=function(t){throw Error(aa)},e.getMaxTime=function(){throw Error(aa)},e.toUniform=function(t){throw Error(aa)},e.map=function(t){throw Error(aa)},e.scaleXCoord=function(t){return this},e.toData=function(){throw Error(aa)},t.getAllData=function(t,e){for(var i=new(e?nj:Float32Array)(4*t.index),r=0,n=0,a=t.curves;r<a.length;r++){var s=a[r].toData();i.set(s,n),n+=s.length}return e?i.data:i},t}(),ao=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.value=t},i.getIntegrateValue=function(t,e,i){return this.value*(e-t)},i.getIntegrateByTime=function(t,e){return .5*this.value*(e*e-t*t)},i.getValue=function(t){return this.value},i.toUniform=function(){return new Float32Array([0,this.value,0,0])},i.map=function(t){var e=this.value;return this.value=t(e),this},i.getMaxTime=function(){return 0},e}(as),au=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.items=t},i.getValue=function(t){var e=this.items;return e[Math.floor(Math.random()*e.length)]},i.map=function(t){return this.items=this.items.map(t),this},e}(as),ah=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t,e){return this.min+(null!=e?e:Math.random())*(this.max-this.min)},i.getIntegrateValue=function(t,e,i){return(this.min+(null!=i?i:1)*(this.max-this.min))*(e-t)},i.toUniform=function(){return new Float32Array([4,this.min,this.max,0])},i.map=function(t){return this.min=t(this.min),this.max=t(this.max),this},e}(as),al=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1]},i.getValue=function(t){for(var e=this.min,i=this.max,r=[],n=0;n<e.length;n++){var a=Math.random();r[n]=e[n]*(1-a)+i[n]*a}return r},i.map=function(t){return this.min=this.min.map(t),this.max=this.max.map(t),this},e}(as),ac=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.min=t[0],this.max=t[1],this.xCoord=1},i.getValue=function(t){return t/=this.xCoord,this.min*(1-t)+this.max*t},i.toUniform=function(){return new Float32Array([1,this.min,this.max,this.xCoord])},i.getIntegrateValue=function(t,e,i){void 0===i&&(i=1);var r=this.min,n=this.max,a=this.xCoord*i;return((r+e/a*(n-r)+r)*e-(r+t/a*(n-r)+r)*t)/2},i.getIntegrateByTime=function(t,e){return ag(e,0,this.xCoord,this.min,this.max)-ag(t,0,this.xCoord,this.min,this.max)},i.map=function(t){return this.min=t(this.min),this.max=t(this.max),this},i.scaleXCoord=function(t){return this.xCoord=t,this},e}(as),af=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.stops=it(t)},i.getStops=function(){return this.stops},i.getValue=function(t){var e=this.stops;if(0===e.length)return[0,0,0,0];if(t<=e[0].time)return e[0].color.toArray();var i=e.length-1;if(t>=e[i].time)return e[i].color.toArray();for(var r=0;r<i;r++){var n=e[r],a=e[r+1];if(n.time<=t&&a.time>t){var s=(t-n.time)/(a.time-n.time);return ie(n.color.toArray(),a.color.toArray(),s,!0)}}return e[i].color.toArray()},e}(as),ad=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.keys=t.map(function(t){return t.slice?t.slice(0,2):[t.time,t.value]}).sort(function(t,e){return t[0]-e[0]});var e=this.keys[this.keys.length-1];e[0]<1&&this.keys.push([1,e[1]]);var i=this.keys[0];i[0]>0&&this.keys.unshift([0,i[1]]),this.isLineSeg=!0},i.getValue=function(t){var e=this.keys;if(t<e[0][0])return e[0][1];for(var i=e.length-1,r=0;r<i;r++){var n=e[r],a=e[r+1],s=n[0],o=a[0];if(t>=s&&t<=o){var u=(t-s)/(o-s),h=n[1];return h+u*(a[1]-h)}}return e[i][1]},i.getIntegrateValue=function(t,e,i){return void 0===i&&(i=1),(this.integrate(e,!1)-this.integrate(t,!1))*i},i.getIntegrateByTime=function(t,e){return this.integrate(e,!0)-this.integrate(t,!0)},i.integrate=function(t,e){var i=this.keys;if(t<=i[0][0])return 0;for(var r=0,n=i.length-1,a=e?ag:ay,s=0;s<n;s++){var o=i[s],u=i[s+1],h=o[0],l=u[0];if(t>h&&t<=l)return r+a(t,h,l,o[1],u[1]);r+=a(l,h,l,o[1],u[1])}return r},i.toData=function(){for(var t=this.keys,e=new Float32Array(4*Math.ceil(t.length/2)),i=0,r=0;i<t.length;i++,r+=2)e.set(t[i],r);return e.set(t[t.length-1],e.length-2),e},i.toUniform=function(t){var e=t.index,i=Math.ceil(this.keys.length/2);return t.lineSegCount+=i,t.curves.push(this),t.index+=i,t.max=Math.max(t.max,i),new Float32Array([3,e,i,0])},i.map=function(t){return this.keys.forEach(function(e){return e[1]=t(e[1])}),this},i.scaleXCoord=function(t){return this.keys.forEach(function(e){return e[0]=t*e[0]}),this},e}(as),ap=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.keys=t[0],this.values=t[1]},i.getValue=function(t){for(var e=this.keys,i=this.values,r=0;r<e.length-1;r++){var n=e[r],a=e[r+1];if(n[0]<=t&&a[0]>=t){var s=a[1]-n[1],o=void 0;return o=0===s?(t-n[0])/(a[0]-n[0]):(function(t,e,i){var r=i[0]-e[0],n=e[3]*r,a=i[2]*r,s=(t-e[0])/r,o=s*s,u=o*s;return(2*u-3*o+1)*e[1]+(u-2*o+s)*n+(u-o)*a+(-2*u+3*o)*i[1]}(t,n,a)-n[1])/s,this.calculateVec(r,o)}}return t<=e[0][0]?i[0].slice():i[i.length-1].slice()},i.calculateVec=function(t,e){for(var i=this.values[t],r=this.values[t+1],n=[0,0,0],a=0;a<i.length;a++)n[a]=i[a]*(1-e)+r[a]*e;return n},e}(as),am=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){var e=t[0],i=t[1],r=t[2];if(this.curveSegments={},r.length){for(var n=0;n<e.length-1;n++){var a=e[n],s=e[n+1],o=new e5(i[n][0],i[n][1],i[n][2]),u=new e5(i[n+1][0],i[n+1][1],i[n+1][2]),h=new e5(r[2*n][0],r[2*n][1],r[2*n][2]),l=new e5(r[2*n+1][0],r[2*n+1][1],r[2*n+1][2]),c=ai(a,s),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new n7(o,u,h,l);this.curveSegments[v.x+"&"+y.x]={points:f,timeInterval:p,valueInterval:m,easingCurve:d,pathCurve:g,timeStart:Number(v.x),timeEnd:Number(y.x)}}this.keyTimeData=Object.keys(this.curveSegments)}},i.getValue=function(t){var e=n0(t,5),i=0,r=new e5,n=this.keyTimeData;if(!n.length)return r;var a=this.curveSegments[n[0]].timeStart,s=this.curveSegments[n[n.length-1]].timeEnd;if(e<=a)return this.curveSegments[n[0]].pathCurve.getPointInPercent(0);if(e>=s)return this.curveSegments[n[n.length-1]].pathCurve.getPointInPercent(1);for(var o=0;o<n.length;o++){var u=this.curveSegments[n[o]].timeStart,h=this.curveSegments[n[o]].timeEnd;if(e>=Number(u)&&e<Number(h)){var l=this.curveSegments[n[o]].pathCurve;i=this.getPercValue(n[o],e),r=l.getPointInPercent(i)}}return r},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,a=n0((e-r.x)/n,4);return e3(i.easingCurve.getValue(a),0,1)},i.getMaxTime=function(){var t=this.keyTimeData;return this.curveSegments[t[t.length-1]].timeEnd},e}(as),av=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){var e=t[0],i=t[1],r=t[2];if(this.curveSegments={},r.length)for(var n=0;n<e.length-1;n++){var a=e[n],s=e[n+1],o=rn.fromArray(i[n]),u=rn.fromArray(i[n+1]),h=rn.fromArray(r[2*n]),l=rn.fromArray(r[2*n+1]),c=ai(a,s),f=c.points,d=c.curve,p=c.timeInterval,m=c.valueInterval,v=f[0],y=f[f.length-1],g=new at(o,u,h,l);this.curveSegments[v.x+"&"+y.x]={points:f,timeInterval:p,valueInterval:m,easingCurve:d,pathCurve:g}}},i.getValue=function(t){var e=0,i=n0(t,5),r=Object.keys(this.curveSegments),n=Number(r[0].split("&")[0]),a=Number(r[r.length-1].split("&")[1]);if(i<=n)return this.curveSegments[r[0]].pathCurve.getPointInPercent(0);if(i>=a)return this.curveSegments[r[r.length-1]].pathCurve.getPointInPercent(1);for(var s=0;s<r.length;s++){var o=r[s].split("&"),u=o[0],h=o[1];if(i>=Number(u)&&i<Number(h)){var l=this.curveSegments[r[s]].pathCurve;return e=this.getPercValue(r[s],i),l.getPointInPercent(e)}}return this.curveSegments[r[0]].pathCurve.getPointInPercent(0)},i.getPercValue=function(t,e){var i=this.curveSegments[t],r=i.points[0],n=i.timeInterval,a=n0((e-r.x)/n,4);return e3(i.easingCurve.getValue(a),0,1)},i.getMaxTime=function(){var t=Object.keys(this.curveSegments);return Number(t[t.length-1].split("&")[1])},e}(as);function ay(t,e,i,r,n){var a=t-e;return(r+r+(n-r)*a/(i-e))*a/2}function ag(t,e,i,r,n){var a=t*t,s=e*e;return(a*t*2*(r-n)+3*a*(e*n-i*r)-s*e*(2*r+n)+3*s*i*r)/(6*(e-i))}function ax(t,e){if(e){var i=e[0],r=e[1];if(i===t0.CURVE){t.curves.push(r);var n=r.length;r[0][0]>0&&n++,r[r.length-1][0]<1&&n++,t.index+=n,t.max=Math.max(t.max,n),t.curveCount+=n}else if(i===t0.LINE){var a=r.length;if(2===a&&0===r[0][0]&&1===r[1][0])return;r[0][0]>0&&a++,r[r.length-1][0]<1&&a++;var s=Math.ceil(a/2);t.lineSegCount+=s,t.curves.push(r),t.index+=s,t.max=Math.max(t.max,s)}else if(i===t0.BEZIER_CURVE){var o=r.length-1;t.index+=2*o,t.curves.push(r),t.max=Math.max(t.max,2*o),t.curveCount+=2*o}}}function ab(){return{curves:[],index:0,max:0,lineSegCount:0,curveCount:0}}function aT(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(aT=function(){return!!t})()}function aE(t,e,i){return(aE=aT()?Reflect.construct:function(t,e,i){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return i&&iU(n,i.prototype),n}).apply(null,arguments)}var aC=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e6,e}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aI(t[0]),this.yCurve=aI(t[1]),this.zCurve=aI(t[2]),this.wCurve=aI(t[3])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t),r=this.zCurve.getValue(t),n=this.wCurve.getValue(t);return this.value.set(e,i,r,n),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime(),this.zCurve.getMaxTime(),this.wCurve.getMaxTime())},e}(as),aS=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e5,e}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aI(t[0]),this.yCurve=aI(t[1]),this.zCurve=aI(t[2])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t),r=this.zCurve.getValue(t);return this.value.set(e,i,r),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime(),this.zCurve.getMaxTime())},e}(as),a_=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e4,e}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.xCurve=aI(t[0]),this.yCurve=aI(t[1])},i.getValue=function(t){var e=this.xCurve.getValue(t),i=this.yCurve.getValue(t);return this.value.set(e,i),this.value},i.getMaxTime=function(){return Math.max(this.xCurve.getMaxTime(),this.yCurve.getMaxTime())},e}(as);t.TangentMode=void 0,(ty=t.TangentMode||(t.TangentMode={}))[ty.Cubic=0]="Cubic",ty[ty.Linear=1]="Linear",ty[ty.Constant=2]="Constant",t.WeightedMode=void 0,(tg=t.WeightedMode||(t.WeightedMode={}))[tg.None=0]="None",tg[tg.In=1]="In",tg[tg.Out=2]="Out",tg[tg.Both=3]="Both";var aw=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.keyFrames=aM(t);var e=this.keyFrames;this.curveMap={},this.keys=[],this.curveInfos=[];for(var i=0;i<e.length-1;i++){var r=function(t,e){var i,r,n,a=new e4(t.time,t.value),s=new e4,o=new e4,u=new e4,h=2===t.weightedMode||3===t.weightedMode||1===e.weightedMode||3===e.weightedMode,l=2===t.tangentMode,c=(h?t.outWeight:1)*(e.time-t.time)/3;s.x=t.time+c,s.y=t.value+c*(l?0:t.outSlope);var f=(h?e.inWeight:1)*(e.time-t.time)/3;o.x=e.time-f,o.y=e.value-f*(l?0:e.inSlope),u.x=e.time,u.y=l?t.value:e.value,iy(o),iy(u);var d=u.x-a.x,p=u.y-a.y,m=n0((s.x-a.x)/d,5),v=n0((o.x-a.x)/d,5);n$(p,0)?i=r=NaN:(i=n0((s.y-a.y)/p,5),r=n0((o.y-a.y)/p,5)),m<0&&(m=0),v<0&&(v=0),m>1&&(m=1),v>1&&(v=1);var y=("bez_"+m+"_"+i+"_"+v+"_"+r).replace(/\./g,"p");return n4[y]?n=n4[y]:(n=n$(p,0)?new ae:h?new ae(m,i,v,r):new ae(i,r),n4[y]=n),{points:[a,s,o,u],timeInterval:d,valueInterval:p,curve:n}}(e[i],e[i+1]),n=r.points,a=r.curve,s=r.timeInterval,o=r.valueInterval,u=n[0],h=n[n.length-1];this.keys.push([].concat(u.toArray(),n[1].toArray())),this.keys.push([].concat(h.toArray(),n[2].toArray()));var l={points:n,timeInterval:s,valueInterval:o,curve:a,timeStart:Number(u.x),timeEnd:Number(h.x)};this.curveMap[u.x+"&"+h.x]=l,this.curveInfos.push(l)}},i.getValue=function(t){var e=0,i=this.keyFrames.length;if(t<=this.keyFrames[0].time)e=this.keyFrames[0].value;else if(t<this.keyFrames[i-1].time)for(var r=0;r<this.keyFrames.length-1;r++){var n=this.keyFrames[r].time,a=this.keyFrames[r+1].time;if(t>=n&&t<a){var s=this.curveInfos[r],o=s.points[0],u=s.timeInterval,h=s.valueInterval,l=(t-o.x)/u,c=0;c=1===this.keyFrames[r].tangentMode?l:s.curve.getValue(l),e=o.y+h*c;break}}else t>=this.keyFrames[i-1].time&&(e=this.keyFrames[i-1].value);return e},i.getIntegrateValue=function(t,e,i){void 0===i&&(i=1);var r=(e-t)/i,n=0,a=Object.keys(this.curveMap);if(r<=this.curveMap[a[0]].timeStart)return 0;for(var s=0;s<a.length;s++){var o=this.curveMap[a[s]].timeStart,u=this.curveMap[a[s]].timeEnd;if(r>=Number(u)&&(n+=i*this.getCurveIntegrateValue(a[s],Number(u))),r>=Number(o)&&r<Number(u)){n+=i*this.getCurveIntegrateValue(a[s],r);break}}return n},i.getIntegrateByTime=function(t,e){return this.getIntegrateValue(0,e)-this.getIntegrateValue(0,t)},i.getCurveIntegrateValue=function(t,e){for(var i=this.curveMap[t],r=i.points[0],n=i.timeInterval,a=i.valueInterval,s=0,o=(e-r.x)/20,u=0;u<=20;u++){var h=u*o/n,l=r.y+a*i.curve.getValue(h);0===u||20===u?s+=l:u%2==1?s+=4*l:s+=2*l}return o/3*s},i.toUniform=function(t){var e=t.index,i=this.keys.length;return t.curves.push(this),t.index=e+i,t.max=Math.max(t.max,i),t.curveCount+=i,new Float32Array([5,e+1/i,e,i])},i.toData=function(){for(var t=this.keys,e=new Float32Array(4*t.length),i=0,r=0;i<t.length;i++,r+=4)e.set(t[i],r);return e},i.getMaxTime=function(){return this.keyFrames[this.keyFrames.length-1].time},e}(as);function aM(t){for(var e=[],i=[],r={x:0,y:0},n=0;n<t.length;n++){var a=t[n],s=ar(a,n+1<t.length?t[n+1]:t[n],!0),o=s.p0,u=s.p1,h=s.p2,l=s.p3,c=s.type;iy(h),iy(l);var f={leftControl:r,value:o,rightControl:u,tangentMode:"line"===c?1:0};a[0]===t1.HOLD&&(f.tangentMode=2),i.push(f),r=h}for(var d=function(t,e){return(e.y-t.y)/(e.x-t.x+1e-6)},p=0;p<i.length;p++){var m=i[p].leftControl,v=i[p].value,y=i[p].rightControl,g=0,x=0;p>0&&(g=d(m,v)),p<i.length-1&&(x=d(v,y));var b={time:v.x,value:v.y,inSlope:g,outSlope:x,inWeight:0,outWeight:0,tangentMode:i[p].tangentMode,weightedMode:3};e.push(b),p>0&&(b.inWeight=(v.x-m.x)/((v.x-i[p-1].value.x)/3)),p+1<i.length&&(b.outWeight=(y.x-v.x)/((i[p+1].value.x-v.x)/3))}return e}var aA=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.keyframes=t},i.getValue=function(t){var e=this.keyframes;if(0!==e.length){for(var i=e[0][1],r=0;r<e.length;r++)if(e[r][0]<=(null!=t?t:0))i=e[r][1];else break;return i}},e}(as),aP=((eP={})[t0.RANDOM]=function(t){return ej(t[0],Array)?new al(t):new ah(t)},eP[t0.CONSTANT]=function(t){return new ao(t)},eP[t0.CONSTANT_VEC2]=function(t){return new ao(t)},eP[t0.CONSTANT_VEC3]=function(t){return new ao(t)},eP[t0.CONSTANT_VEC4]=function(t){return new ao(t)},eP[t0.RGBA_COLOR]=function(t){return new ao(t)},eP[t0.COLORS]=function(t){return new au(t.map(function(t){return e9(t,!1)}))},eP[t0.LINE]=function(t){return 2===t.length&&0===t[0][0]&&1===t[1][0]?new ac([t[0][1],t[1][1]]):new ad(t)},eP[t0.GRADIENT_COLOR]=function(t){return new af(t)},eP[t0.LINEAR_PATH]=function(t){return new ap(t)},eP[t0.BEZIER_CURVE]=function(t){return 1===t.length?new ao(t[0][1][1]):new aw(t)},eP[t0.BEZIER_CURVE_PATH]=function(t){return 1===t[0].length?new ao(aE(e5,[].concat(t[1][0]))):new am(t)},eP[t0.BEZIER_CURVE_QUAT]=function(t){return 1===t[0].length?new ao(aE(rn,[].concat(t[1][0]))):new av(t)},eP[t0.COLOR_CURVE]=function(t){return new aR(t)},eP[t0.VECTOR4_CURVE]=function(t){return new aC(t)},eP[t0.VECTOR2_CURVE]=function(t){return new a_(t)},eP[27]=function(t){return new aS(t)},eP[28]=function(t){return new aA(t)},eP);function aI(t){if(!t||!isNaN(+t))return new ao(t||0);if(ej(t,as))return t;if(i_(aP[t[0]]))return aP[t[0]](t[1]);throw Error("ValueType: "+t[0]+" is not supported, see "+nN["ValueType: 21/22 is not supported"]+".")}var aR=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.value=new e8,e}iG(e,t);var i=e.prototype;return i.onCreate=function(t){this.rCurve=aI(t[0]),this.gCurve=aI(t[1]),this.bCurve=aI(t[2]),this.aCurve=aI(t[3])},i.getValue=function(t){var e=this.rCurve.getValue(t),i=this.gCurve.getValue(t),r=this.bCurve.getValue(t),n=this.aCurve.getValue(t);return this.value.set(e,i,r,n),this.value},i.getMaxTime=function(){return Math.max(this.rCurve.getMaxTime(),this.gCurve.getMaxTime(),this.bCurve.getMaxTime(),this.aCurve.getMaxTime())},e}(as),aO=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){return this.set(t.x,t.y),this},e.copyTo=function(t){return t.set(this.x,this.y),t},e.equals=function(t){return t.x===this.x&&t.y===this.y},e.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},rV(t,null,[{key:"shared",get:function(){return aV.x=0,aV.y=0,aV}}]),t}(),aV=new aO;function aL(t,e,i,r,n,a,s,o){s?(u=r,h=-i):(u=-r,h=i);var u,h,l=t-i*n+u,c=e-r*n+h,f=t+i*a+u,d=e+r*a+h;return o.push(l,c),o.push(f,d),2}function aN(t,e,i,r,n,a,s,o){var u=i-t,h=r-e,l=Math.atan2(u,h),c=Math.atan2(n-t,a-e);o&&l<c?l+=2*Math.PI:!o&&l>c&&(c+=2*Math.PI);var f=l,d=c-l,p=Math.sqrt(u*u+h*h),m=(15*Math.abs(d)*Math.sqrt(p)/Math.PI>>0)+1,v=d/m;if(f+=v,o){s.push(t,e),s.push(i,r);for(var y=1,g=f;y<m;y++,g+=v)s.push(t,e),s.push(t+Math.sin(g)*p,e+Math.cos(g)*p);s.push(t,e),s.push(n,a)}else{s.push(i,r),s.push(t,e);for(var x=1,b=f;x<m;x++,b+=v)s.push(t+Math.sin(b)*p,e+Math.cos(b)*p),s.push(t,e);s.push(n,a),s.push(t,e)}return 2*m}function aF(t,e,i,r,n,a,s,o,u){if(0!==t.length){var h=e.alignment;if(.5!==e.alignment){var l=function(t){var e=t.length;if(e<6)return 1;for(var i=0,r=0,n=t[e-2],a=t[e-1];r<e;r+=2){var s=t[r],o=t[r+1];i+=(s-n)*(o+a),n=s,a=o}return i<0?-1:1}(t);i&&(l*=-1),h=(h-.5)*l+.5}var c=new aO(t[0],t[1]),f=new aO(t[t.length-2],t[t.length-1]),d=1e-4>Math.abs(c.x-f.x)&&1e-4>Math.abs(c.y-f.y);if(r){t=t.slice(),d&&(t.pop(),t.pop(),f.set(t[t.length-2],t[t.length-1]));var p=(c.x+f.x)*.5,m=(f.y+c.y)*.5;t.unshift(p,m),t.push(p,m)}var v=t.length/2,y=t.length,g=n.length/2,x=e.width/2,b=x*x,T=e.miterLimit*e.miterLimit,E=t[0],C=t[1],S=t[2],_=t[3],w=0,M=0,A=-(C-_),P=E-S,I=0,R=0,O=Math.sqrt(A*A+P*P)+1e-6;A/=O,P/=O,A*=x,P*=x;var V=h,L=(1-V)*2,N=2*V;r||(e.cap===ec.Round?y+=aN(E-A*(L-N)*.5,C-P*(L-N)*.5,E-A*L,C-P*L,E+A*N,C+P*N,n,!0)+2:e.cap===ec.Square&&(y+=aL(E,C,A,P,L,N,!0,n))),n.push(E-A*L,C-P*L),n.push(E+A*N,C+P*N);for(var F=1;F<v-1;++F){E=t[(F-1)*2],C=t[(F-1)*2+1],S=t[2*F],_=t[2*F+1],w=t[(F+1)*2],M=t[(F+1)*2+1],O=Math.sqrt((A=-(C-_))*A+(P=E-S)*P)+1e-6,A/=O,P/=O,A*=x,P*=x,O=Math.sqrt((I=-(_-M))*I+(R=S-w)*R)+1e-6,I/=O,R/=O,I*=x,R*=x;var D=S-E,k=C-_,z=S-w,B=M-_,U=D*z+k*B,G=k*z-B*D,j=G<0;if(Math.abs(G)<.001*Math.abs(U)){n.push(S-A*L,_-P*L),n.push(S+A*N,_+P*N),U>=0&&(e.join===ef.Round?y+=aN(S,_,S-A*L,_-P*L,S-I*L,_-R*L,n,!1)+4:y+=2,n.push(S-I*N,_-R*N),n.push(S+I*L,_+R*L));continue}var W=(-A+E)*(-P+_)-(-A+S)*(-P+C),X=(-I+w)*(-R+_)-(-I+S)*(-R+M),H=(D*X-z*W)/G,Y=(B*W-k*X)/G,Z=(H-S)*(H-S)+(Y-_)*(Y-_),q=S+(H-S)*L,K=_+(Y-_)*L,Q=S-(H-S)*N,J=_-(Y-_)*N,$=j?L:N;Z<=Math.min(D*D+k*k,z*z+B*B)+$*$*b?e.join===ef.Bevel||Z/b>T?(j?(n.push(q,K),n.push(S+A*N,_+P*N),n.push(q,K),n.push(S+I*N,_+R*N)):(n.push(S-A*L,_-P*L),n.push(Q,J),n.push(S-I*L,_-R*L),n.push(Q,J)),y+=2):e.join===ef.Round?j?(n.push(q,K),n.push(S+A*N,_+P*N),y+=aN(S,_,S+A*N,_+P*N,S+I*N,_+R*N,n,!0)+4,n.push(q,K),n.push(S+I*N,_+R*N)):(n.push(S-A*L,_-P*L),n.push(Q,J),y+=aN(S,_,S-A*L,_-P*L,S-I*L,_-R*L,n,!1)+4,n.push(S-I*L,_-R*L),n.push(Q,J)):(n.push(q,K),n.push(Q,J)):(n.push(S-A*L,_-P*L),n.push(S+A*N,_+P*N),e.join===ef.Round?j?y+=aN(S,_,S+A*N,_+P*N,S+I*N,_+R*N,n,!0)+2:y+=aN(S,_,S-A*L,_-P*L,S-I*L,_-R*L,n,!1)+2:e.join===ef.Miter&&Z/b<=T&&(j?(n.push(Q,J),n.push(Q,J)):(n.push(q,K),n.push(q,K)),y+=2),n.push(S-I*L,_-R*L),n.push(S+I*N,_+R*N),y+=2)}E=t[(v-2)*2],C=t[(v-2)*2+1],S=t[(v-1)*2],O=Math.sqrt((A=-(C-(_=t[(v-1)*2+1])))*A+(P=E-S)*P)+1e-6,A/=O,P/=O,A*=x,P*=x,n.push(S-A*L,_-P*L),n.push(S+A*N,_+P*N),r||(e.cap===ec.Round?y+=aN(S-A*(L-N)*.5,_-P*(L-N)*.5,S-A*L,_-P*L,S+A*N,_+P*N,n,!1)+2:e.cap===ec.Square&&(y+=aL(S,_,A,P,L,N,!1,n)));for(var tt=g;tt<y+g-2;++tt)E=n[2*tt],C=n[2*tt+1],S=n[(tt+1)*2],_=n[(tt+1)*2+1],w=n[(tt+2)*2],1e-8>Math.abs(E*(_-(M=n[(tt+2)*2+1]))+S*(M-C)+w*(C-_))||o.push(tt,tt+1,tt+2)}}var aD=function(){},ak=function(t){function e(e,i,r,n){var a;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),(a=t.call(this)||this).type="ellipse",a.x=e,a.y=i,a.halfWidth=r,a.halfHeight=n,a}iG(e,t);var i=e.prototype;return i.clone=function(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)},i.contains=function(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;var i=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1},i.strokeContains=function(t,e,i){var r=this.halfWidth,n=this.halfHeight;if(r<=0||n<=0)return!1;var a=i/2,s=r-a,o=n-a,u=r+a,h=n+a,l=t-this.x,c=e-this.y;return l*l/(s*s)+c*c/(o*o)>1&&l*l/(u*u)+c*c/(h*h)<=1},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getX=function(){return this.x},i.getY=function(){return this.y},i.build=function(t,e){var i=this.x,r=this.y,n=this.halfWidth,a=this.halfHeight;if(!(n>=0&&a>=0))return t;var s=Math.ceil(Math.sqrt((null!=e?e:1)*(n+a))),o=8*s+0+0;if(0===o)return t;if(0===s)return t[0]=t[6]=i+0,t[1]=t[3]=r+0,t[2]=t[4]=i-0,t[5]=t[7]=r-0,t;var u=0,h=4*s+0+2,l=h,c=o,f=0+n,d=0,p=i+f,m=i-f,v=r+0;t[u++]=p,t[u++]=v,t[--h]=v,t[--h]=m;for(var y=1;y<s;y++){var g=Math.PI/2*(y/s),x=0+Math.cos(g)*n,b=0+Math.sin(g)*a,T=i+x,E=i-x,C=r+b,S=r-b;t[u++]=T,t[u++]=C,t[--h]=C,t[--h]=E,t[l++]=E,t[l++]=S,t[--c]=S,t[--c]=T}f=0,d=0+a,p=i+f,m=i-f,v=r+d;var _=r-d;return t[u++]=p,t[u++]=v,t[--c]=_,t[--c]=p,t},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,s=0,o=0;o<t.length;o+=2)a+=t[o],s+=t[o+1];a/=t.length/2,s/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=s;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(aD),az=function(t){function e(e,i,r,n,a){var s;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=20),(s=t.call(this)||this).x=e,s.y=i,s.width=r,s.height=n,s.roundness=a,s}iG(e,t);var i=e.prototype;return i.getBounds=function(t){return(t=t||new e).x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.clone=function(){return new e(this.x,this.y,this.width,this.height,this.roundness)},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.roundness=t.roundness,this},i.copyTo=function(t){return t.copyFrom(this),t},i.build=function(t,e){var i,r=this.width/2,n=this.height/2,a=this.x+r,s=this.y+n,o=i=Math.max(0,Math.min(this.roundness/100,1)*Math.min(r,n)),u=r-o,h=n-i;if(o>=0&&i>=0&&u>=0&&h>=0){var l=Math.ceil(Math.sqrt((null!=e?e:1)*(o+i))),c=8*l+(u?4:0)+(h?4:0);if(0!==c){if(0===l){t[0]=t[6]=a+u,t[1]=t[3]=s+h,t[2]=t[4]=a-u,t[5]=t[7]=s-h;return}var f=0,d=4*l+(u?2:0)+2,p=d,m=c,v=u+o,y=h,g=a+v,x=a-v,b=s+y;if(t[f++]=g,t[f++]=b,t[--d]=b,t[--d]=x,h){var T=s-y;t[p++]=x,t[p++]=T,t[--m]=T,t[--m]=g}for(var E=1;E<l;E++){var C=Math.PI/2*(E/l),S=u+Math.cos(C)*o,_=h+Math.sin(C)*i,w=a+S,M=a-S,A=s+_,P=s-_;t[f++]=w,t[f++]=A,t[--d]=A,t[--d]=M,t[p++]=M,t[p++]=P,t[--m]=P,t[--m]=w}v=u,y=h+i,g=a+v,x=a-v,b=s+y;var I=s-y;t[f++]=g,t[f++]=b,t[--m]=I,t[--m]=g,u&&(t[f++]=x,t[f++]=b,t[--m]=I,t[--m]=x)}}},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,s=0,o=0;o<t.length;o+=2)a+=t[o],s+=t[o+1];a/=t.length/2,s/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=s;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(aD),aB=function(t){function e(e,i,r,n,a,s){var o;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===s&&(s=0),(o=t.call(this)||this).x=e,o.y=i,o.x2=r,o.y2=n,o.x3=a,o.y3=s,o}iG(e,t);var i=e.prototype;return i.contains=function(t,e){var i=(this.x-this.x3)*(e-this.y3)-(this.y-this.y3)*(t-this.x3),r=(this.x2-this.x)*(e-this.y)-(this.y2-this.y)*(t-this.x);if(i<0!=r<0&&0!==i&&0!==r)return!1;var n=(this.x3-this.x2)*(e-this.y2)-(this.y3-this.y2)*(t-this.x2);return 0===n||n<0==i+r<=0},i.clone=function(){return new e(this.x,this.y,this.x2,this.y2,this.x3,this.y3)},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.x2=t.x2,this.y2=t.y2,this.x3=t.x3,this.y3=t.y3,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getBounds=function(t){t=t||new az;var e=Math.min(this.x,this.x2,this.x3),i=Math.max(this.x,this.x2,this.x3),r=Math.min(this.y,this.y2,this.y3),n=Math.max(this.y,this.y2,this.y3);return t.x=e,t.y=r,t.width=i-e,t.height=n-r,t},i.getX=function(){return this.x},i.getY=function(){return this.y},i.build=function(t,e){t[0]=this.x,t[1]=this.y,t[2]=this.x2,t[3]=this.y2,t[4]=this.x3,t[5]=this.y3},i.triangulate=function(t,e,i,r,n){var a=0;e[(i*=2)+0]=t[0],e[i+a+1]=t[1],e[i+(a+=2)]=t[2],e[i+a+1]=t[3],e[i+(a+=2)]=t[4],e[i+a+1]=t[5];var s=i/2;r[n++]=s,r[n++]=s+1,r[n++]=s+2},e}(aD);function aU(t,e,i,r,n,a,s,o,u,h,l,c){var f=(1-Math.min(.99,Math.max(0,null!=h?h:.5)))/(null!=l?l:1);return function t(e,i,r,n,a,s,o,u,h,l,c,f,d,p){if(void 0===d&&(d=0),void 0===p&&(p=1),!(c>8)){var m=(e+r)/2,v=(i+n)/2,y=(r+a)/2,g=(n+s)/2,x=(a+o)/2,b=(s+u)/2,T=(m+y)/2,E=(v+g)/2,C=(y+x)/2,S=(g+b)/2,_=(T+C)/2,w=(E+S)/2,M=(d+p)/2;if(c>0){var A=o-e,P=u-i,I=Math.abs((r-o)*P-(n-u)*A),R=Math.abs((a-o)*P-(s-u)*A);if(I>11920929e-14&&R>11920929e-14){if((I+R)*(I+R)<=l*(A*A+P*P)){h.push(_,w),null==f||f.push(M);return}}else if(I>11920929e-14){if(I*I<=l*(A*A+P*P)){h.push(_,w),null==f||f.push(M);return}}else if(R>11920929e-14){if(R*R<=l*(A*A+P*P)){h.push(_,w),null==f||f.push(M);return}}else if((A=_-(e+o)/2)*A+(P=w-(i+u)/2)*P<=l){h.push(_,w),null==f||f.push(M);return}}t(e,i,m,v,T,E,_,w,h,l,c+1,f,d,M),t(_,w,C,S,x,b,o,u,h,l,c+1,f,M,p)}}(e,i,r,n,a,s,o,u,t,f*=f,0,c),t.push(o,u),null==c||c.push(1),t}var aG="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},aj={exports:{}};!function(t){function e(t,e){return t.b===e.b&&t.a===e.a}function i(t,e){return t.b<e.b||t.b===e.b&&t.a<=e.a}function r(t,e,i){var r=e.b-t.b,n=i.b-e.b;return 0<r+n?r<n?e.a-t.a+r/(r+n)*(t.a-i.a):e.a-i.a+n/(r+n)*(i.a-t.a):0}function n(t,e,i){var r=e.b-t.b,n=i.b-e.b;return 0<r+n?(e.a-i.a)*r+(e.a-t.a)*n:0}function a(t,e){return t.a<e.a||t.a===e.a&&t.b<=e.b}function s(t,e,i){var r=e.a-t.a,n=i.a-e.a;return 0<r+n?r<n?e.b-t.b+r/(r+n)*(t.b-i.b):e.b-i.b+n/(r+n)*(i.b-t.b):0}function o(t,e,i){var r=e.a-t.a,n=i.a-e.a;return 0<r+n?(e.b-i.b)*r+(e.b-t.b)*n:0}function u(t,e,i,r){return(t=0>t?0:t)<=(i=0>i?0:i)?0===i?(e+r)/2:e+t/(t+i)*(r-e):r+i/(t+i)*(e-r)}function h(t){var e=p(t.b);return v(e,t.c),v(e.b,t.c),y(e,t.a),e}function l(t,e){var i=!1,r=!1;t!==e&&(e.a!==t.a&&(r=!0,x(e.a,t.a)),e.d!==t.d&&(i=!0,b(e.d,t.d)),m(e,t),r||(v(e,t.a),t.a.c=t),i||(y(e,t.d),t.d.a=t))}function c(t){var e=t.b,i=!1;t.d!==t.b.d&&(i=!0,b(t.d,t.b.d)),t.c===t?x(t.a,null):(t.b.d.a=K(t),t.a.c=t.c,m(t,K(t)),i||y(t,t.d)),e.c===e?(x(e.a,null),b(e.d,null)):(t.d.a=K(e),e.a.c=e.c,m(e,K(e))),g(t)}function f(t){var e=p(t),i=e.b;return m(e,t.e),e.a=t.b.a,v(i,e.a),e.d=i.d=t.d,e=e.b,m(t.b,K(t.b)),m(t.b,e),t.b.a=e.a,e.b.a.c=e.b,e.b.d=t.b.d,e.f=t.f,e.b.f=t.b.f,e}function d(t,e){var i=!1,r=p(t),n=r.b;return e.d!==t.d&&(i=!0,b(e.d,t.d)),m(r,t.e),m(n,e),r.a=t.b.a,n.a=e.a,r.d=n.d=t.d,t.d.a=n,i||y(r,t.d),r}function p(t){var e=new q,i=new q,r=t.b.h;return i.h=r,r.b.h=e,e.h=t,t.b.h=i,e.b=i,e.c=e,e.e=i,i.b=e,i.c=i,i.e=e}function m(t,e){var i=t.c,r=e.c;i.b.e=e,r.b.e=t,t.c=r,e.c=i}function v(t,e){var i=e.f,r=new J(e,i);i.e=r,e.f=r,i=r.c=t;do i.a=r,i=i.c;while(i!==t)}function y(t,e){var i=e.d,r=new Z(e,i);i.b=r,e.d=r,r.a=t,r.c=e.c,i=t;do i.d=r,i=i.e;while(i!==t)}function g(t){var e=t.h;t=t.b.h,e.b.h=t,t.b.h=e}function x(t,e){var i=t.c,r=i;do r.a=e,r=r.c;while(r!==i);i=t.f,(r=t.e).f=i,i.e=r}function b(t,e){var i=t.a,r=i;do r.d=e,r=r.e;while(r!==i);i=t.d,(r=t.b).d=i,i.b=r}function T(t){var e=0;return Math.abs(t[1])>Math.abs(t[0])&&(e=1),Math.abs(t[2])>Math.abs(t[e])&&(e=2),e}var E,C=4*1e150;function S(t,e){t.f+=e.f,t.b.f+=e.b.f}function _(t,e,a){return(t=t.a,e=e.a,a=a.a,e.b.a===t)?a.b.a===t?i(e.a,a.a)?0>=n(a.b.a,e.a,a.a):0<=n(e.b.a,a.a,e.a):0>=n(a.b.a,t,a.a):a.b.a===t?0<=n(e.b.a,t,e.a):(e=r(e.b.a,t,e.a))>=(t=r(a.b.a,t,a.a))}function w(t){t.a.i=null;var e=t.e;e.a.c=e.c,e.c.a=e.a,t.e=null}function M(t,e){c(t.a),t.c=!1,t.a=e,e.i=t}function A(t){var e=t.a.a;do t=tl(t);while(t.a.a===e);return t.c&&(e=d(th(t).a.b,t.a.e),M(t,e),t=tl(t)),t}function P(t,e,i){var r=new tu;return r.a=i,r.e=G(t.f,e.e,r),i.i=r}function I(t,e){switch(t.s){case 100130:return 0!=(1&e);case 100131:return 0!==e;case 100132:return 0<e;case 100133:return 0>e;case 100134:return 2<=e||-2>=e}return!1}function R(t){var e=t.a,i=e.d;i.c=t.d,i.a=e,w(t)}function O(t,e,i){for(t=e,e=e.a;t!==i;){t.c=!1;var r=th(t),n=r.a;if(n.a!==e.a){if(!r.c){R(t);break}M(r,n=d(e.c.b,n.b))}e.c!==n&&(l(K(n),n),l(e,n)),R(t),e=r.a,t=r}return e}function V(t,e,i,r,n,a){var s=!0;do P(t,e,i.b),i=i.c;while(i!==r);for(null===n&&(n=th(e).a.b.c);(i=(r=th(e)).a.b).a===n.a;)i.c!==n&&(l(K(i),i),l(K(n),i)),r.f=e.f-i.f,r.d=I(t,r.f),e.b=!0,!s&&D(t,e)&&(S(i,n),w(e),c(n)),s=!1,e=r,n=i;e.b=!0,a&&z(t,e)}function L(t,e,i,r,n){var a=[e.g[0],e.g[1],e.g[2]];e.d=null,e.d=t.o&&t.o(a,i,r,t.c)||null,null===e.d&&(n?t.n||(Y(t,100156),t.n=!0):e.d=i[0])}function N(t,e,i){var r=[null,null,null,null];r[0]=e.a.d,r[1]=i.a.d,L(t,e.a,r,[.5,.5,0,0],!1),l(e,i)}function F(t,e,i,r,n){var a=Math.abs(e.b-t.b)+Math.abs(e.a-t.a),s=Math.abs(i.b-t.b)+Math.abs(i.a-t.a),o=n+1;r[n]=.5*s/(a+s),r[o]=.5*a/(a+s),t.g[0]+=r[n]*e.g[0]+r[o]*i.g[0],t.g[1]+=r[n]*e.g[1]+r[o]*i.g[1],t.g[2]+=r[n]*e.g[2]+r[o]*i.g[2]}function D(t,r){var a=th(r),s=r.a,o=a.a;if(i(s.a,o.a)){if(0<n(o.b.a,s.a,o.a))return!1;if(e(s.a,o.a)){if(s.a!==o.a){var a=t.e,u=s.a.h;if(0<=u){var a=a.b,h=a.d,c=a.e,d=a.c,p=d[u];h[p]=h[a.a],d[h[p]]=p,p<=--a.a&&(1>=p?ts(a,p):i(c[h[p>>1]],c[h[p]])?ts(a,p):to(a,p)),c[u]=null,d[u]=a.b,a.b=u}else for(a.c[-(u+1)]=null;0<a.a&&null===a.c[a.d[a.a-1]];)--a.a;N(t,K(o),s)}}else f(o.b),l(s,K(o)),r.b=a.b=!0}else{if(0>n(s.b.a,o.a,s.a))return!1;tl(r).b=r.b=!0,f(s.b),l(K(o),s)}return!0}function k(t,h){var c=th(h),d=h.a,p=c.a,m=d.a,v=p.a,y=d.b.a,g=p.b.a,x=new J;if(n(y,t.a,m),n(g,t.a,v),m===v||Math.min(m.a,y.a)>Math.max(v.a,g.a))return!1;if(i(m,v)){if(0<n(g,m,v))return!1}else if(0>n(y,v,m))return!1;var b,T,E=y,C=m,S=g,_=v;if(i(E,C)||(b=E,E=C,C=b),i(S,_)||(b=S,S=_,_=b),i(E,S)||(b=E,E=S,S=b,b=C,C=_,_=b),i(S,C)?i(C,_)?(0>(b=r(E,S,C))+(T=r(S,C,_))&&(b=-b,T=-T),x.b=u(b,S.b,T,C.b)):(0>(b=n(E,S,C))+(T=-n(E,_,C))&&(b=-b,T=-T),x.b=u(b,S.b,T,_.b)):x.b=(S.b+C.b)/2,a(E,C)||(b=E,E=C,C=b),a(S,_)||(b=S,S=_,_=b),a(E,S)||(b=E,E=S,S=b,b=C,C=_,_=b),a(S,C)?a(C,_)?(0>(b=s(E,S,C))+(T=s(S,C,_))&&(b=-b,T=-T),x.a=u(b,S.a,T,C.a)):(0>(b=o(E,S,C))+(T=-o(E,_,C))&&(b=-b,T=-T),x.a=u(b,S.a,T,_.a)):x.a=(S.a+C.a)/2,i(x,t.a)&&(x.b=t.a.b,x.a=t.a.a),E=i(m,v)?m:v,i(E,x)&&(x.b=E.b,x.a=E.a),e(x,m)||e(x,v))return D(t,h),!1;if(!e(y,t.a)&&0<=n(y,t.a,x)||!e(g,t.a)&&0>=n(g,t.a,x)){if(g===t.a)return f(d.b),l(p.b,d),d=th(h=A(h)).a,O(t,th(h),c),V(t,h,K(d),d,d,!0),!0;if(y===t.a){f(p.b),l(d.e,K(p)),v=(m=c=h).a.b.a;do m=tl(m);while(m.a.b.a===v);return m=th(h=m).a.b.c,c.a=K(p),p=O(t,c,null),V(t,h,p.c,d.b.c,m,!0),!0}return 0<=n(y,t.a,x)&&(tl(h).b=h.b=!0,f(d.b),d.a.b=t.a.b,d.a.a=t.a.a),0>=n(g,t.a,x)&&(h.b=c.b=!0,f(p.b),p.a.b=t.a.b,p.a.a=t.a.a),!1}return f(d.b),f(p.b),l(K(p),d),d.a.b=x.b,d.a.a=x.a,d.a.h=tt(t.e,d.a),d=d.a,p=[0,0,0,0],x=[m.d,y.d,v.d,g.d],d.g[0]=d.g[1]=d.g[2]=0,F(d,m,y,p,0),F(d,v,g,p,2),L(t,d,x,p,!0),tl(h).b=h.b=c.b=!0,!1}function z(t,e){for(var r=th(e);;){for(;r.b;)e=r,r=th(r);if(!e.b&&(r=e,null===(e=tl(e))||!e.b))break;e.b=!1;var a,s=e.a,o=r.a;if(a=s.b.a!==o.b.a)t:{var u=th(a=e),h=a.a,d=u.a,p=void 0;if(i(h.b.a,d.b.a)){if(0>n(h.b.a,d.b.a,h.a)){a=!1;break t}tl(a).b=a.b=!0,p=f(h),l(d.b,p),p.d.c=a.d}else{if(0<n(d.b.a,h.b.a,d.a)){a=!1;break t}a.b=u.b=!0,p=f(d),l(h.e,d.b),p.b.d.c=a.d}a=!0}if(a&&(r.c?(w(r),c(o),o=(r=th(e)).a):e.c&&(w(e),c(s),s=(e=tl(r)).a)),s.a!==o.a){if(s.b.a===o.b.a||e.c||r.c||s.b.a!==t.a&&o.b.a!==t.a)D(t,e);else if(k(t,e))break}s.a===o.a&&s.b.a===o.b.a&&(S(o,s),w(e),c(s),e=tl(r))}}function B(t,e){var i=new tu,r=h(t.b);r.a.b=C,r.a.a=e,r.b.a.b=-C,r.b.a.a=e,t.a=r.b.a,i.a=r,i.f=0,i.d=!1,i.c=!1,i.h=!0,i.b=!1,r=G(r=t.f,r.a,i),i.e=r}function U(t){this.a=new j,this.b=t,this.c=_}function G(t,e,i){do e=e.c;while(null!==e.b&&!t.c(t.b,e.b,i));return t=new j(i,e.a,e),e.a.c=t,e.a=t}function j(t,e,i){this.b=t||null,this.a=e||this,this.c=i||this}function W(){this.d=X,this.p=this.b=this.q=null,this.j=[0,0,0],this.s=100130,this.n=!1,this.o=this.a=this.e=this.f=null,this.m=!1,this.c=this.r=this.i=this.k=this.l=this.h=null}var X=0;function H(t,e){if(t.d!==e)for(;t.d!==e;)if(t.d<e)switch(t.d){case X:Y(t,100151),t.u(null);break;case 1:Y(t,100152),t.t()}else switch(t.d){case 2:Y(t,100154),t.v();break;case 1:Y(t,100153),t.w()}}function Y(t,e){t.p&&t.p(e,t.c)}function Z(t,e){this.b=t||this,this.d=e||this,this.a=null,this.c=!1}function q(){this.h=this,this.i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function K(t){return t.b.e}function Q(){this.c=new J,this.a=new Z,this.b=new q,this.d=new q,this.b.b=this.d,this.d.b=this.b}function J(t,e){this.e=t||this,this.f=e||this,this.d=this.c=null,this.g=[0,0,0],this.h=this.a=this.b=0}function $(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new ti}function tt(t,e){if(t.e){var i,r=t.b,n=++r.a;return 2*n>r.f&&(r.f*=2,r.c=tr(r.c,r.f+1)),0===r.b?i=n:(i=r.b,r.b=r.c[r.b]),r.e[i]=e,r.c[i]=n,r.d[n]=i,r.h&&to(r,n),i}return r=t.a++,t.c[r]=e,-(r+1)}function te(t){if(0===t.a)return ta(t.b);var e=t.c[t.d[t.a-1]];if(0!==t.b.a&&i(tn(t.b),e))return ta(t.b);do--t.a;while(0<t.a&&null===t.c[t.d[t.a-1]]);return e}function ti(){this.d=tr([0],33),this.e=[null,null],this.c=[0,0],this.a=0,this.f=32,this.b=0,this.h=!1,this.d[1]=1}function tr(t,e){for(var i=Array(e),r=0;r<t.length;r++)i[r]=t[r];for(;r<e;r++)i[r]=0;return i}function tn(t){return t.e[t.d[1]]}function ta(t){var e=t.d,i=t.e,r=t.c,n=e[1],a=i[n];return 0<t.a&&(e[1]=e[t.a],r[e[1]]=1,i[n]=null,r[n]=t.b,t.b=n,0<--t.a&&ts(t,1)),a}function ts(t,e){for(var r=t.d,n=t.e,a=t.c,s=e,o=r[s];;){var u=s<<1;u<t.a&&i(n[r[u+1]],n[r[u]])&&(u+=1);var h=r[u];if(u>t.a||i(n[o],n[h])){r[s]=o,a[o]=s;break}r[s]=h,a[h]=s,s=u}}function to(t,e){for(var r=t.d,n=t.e,a=t.c,s=e,o=r[s];;){var u=s>>1,h=r[u];if(0===u||i(n[h],n[o])){r[s]=o,a[o]=s;break}r[s]=h,a[h]=s,s=u}}function tu(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function th(t){return t.e.c.b}function tl(t){return t.e.a.b}(E=W.prototype).x=function(){H(this,X)},E.B=function(t,e){switch(t){case 100142:return;case 100140:switch(e){case 100130:case 100131:case 100132:case 100133:case 100134:this.s=e;return}break;case 100141:this.m=!!e;return;default:Y(this,100900);return}Y(this,100901)},E.y=function(t){switch(t){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Y(this,100900)}return!1},E.A=function(t,e,i){this.j[0]=t,this.j[1]=e,this.j[2]=i},E.z=function(t,e){var i=e||null;switch(t){case 100100:case 100106:this.h=i;break;case 100104:case 100110:this.l=i;break;case 100101:case 100107:this.k=i;break;case 100102:case 100108:this.i=i;break;case 100103:case 100109:this.p=i;break;case 100105:case 100111:this.o=i;break;case 100112:this.r=i;break;default:Y(this,100900)}},E.C=function(t,e){var i=!1,r=[0,0,0];H(this,2);for(var n=0;3>n;++n){var a=t[n];-1e150>a&&(a=-1e150,i=!0),1e150<a&&(a=1e150,i=!0),r[n]=a}i&&Y(this,100155),null===(i=this.q)?l(i=h(this.b),i.b):(f(i),i=i.e),i.a.d=e,i.a.g[0]=r[0],i.a.g[1]=r[1],i.a.g[2]=r[2],i.f=1,i.b.f=-1,this.q=i},E.u=function(t){H(this,X),this.d=1,this.b=new Q,this.c=t},E.t=function(){H(this,1),this.d=2,this.q=null},E.v=function(){H(this,2),this.d=1},E.w=function(){H(this,1),this.d=X;var t,r,a=this.j[0],s=this.j[1],o=this.j[2],u=!1,h=[a,s,o];if(0===a&&0===s&&0===o){for(var s=[-2*1e150,-2*1e150,-2*1e150],p=[2*1e150,2*1e150,2*1e150],o=[],v=[],u=this.b.c,a=u.e;a!==u;a=a.e)for(var y=0;3>y;++y){var b=a.g[y];b<p[y]&&(p[y]=b,v[y]=a),b>s[y]&&(s[y]=b,o[y]=a)}if(a=0,s[1]-p[1]>s[0]-p[0]&&(a=1),s[2]-p[2]>s[a]-p[a]&&(a=2),p[a]>=s[a])h[0]=0,h[1]=0,h[2]=1;else{for(s=0,p=v[a],o=o[a],v=[0,0,0],p=[p.g[0]-o.g[0],p.g[1]-o.g[1],p.g[2]-o.g[2]],y=[0,0,0],a=u.e;a!==u;a=a.e)y[0]=a.g[0]-o.g[0],y[1]=a.g[1]-o.g[1],y[2]=a.g[2]-o.g[2],v[0]=p[1]*y[2]-p[2]*y[1],v[1]=p[2]*y[0]-p[0]*y[2],v[2]=p[0]*y[1]-p[1]*y[0],(b=v[0]*v[0]+v[1]*v[1]+v[2]*v[2])>s&&(s=b,h[0]=v[0],h[1]=v[1],h[2]=v[2]);0>=s&&(h[0]=h[1]=h[2]=0,h[T(p)]=1)}u=!0}for(v=T(h),a=this.b.c,s=(v+1)%3,o=(v+2)%3,v=0<h[v]?1:-1,h=a.e;h!==a;h=h.e)h.b=h.g[s],h.a=v*h.g[o];if(u){for(h=0,a=(u=this.b.a).b;a!==u;a=a.b)if(!(0>=(s=a.a).f))do h+=(s.a.b-s.b.a.b)*(s.a.a+s.b.a.a),s=s.e;while(s!==a.a);if(0>h)for(u=(h=this.b.c).e;u!==h;u=u.e)u.a=-u.a}for(this.n=!1,a=(h=this.b.b).h;a!==h;a=u)u=a.h,s=a.e,e(a.a,a.b.a)&&a.e.e!==a&&(N(this,s,a),c(a),s=(a=s).e),s.e===a&&(s!==a&&((s===u||s===u.b)&&(u=u.h),c(s)),(a===u||a===u.b)&&(u=u.h),c(a));for(this.e=h=new $,a=(u=this.b.c).e;a!==u;a=a.e)a.h=tt(h,a);for(function(t){t.d=[];for(var e,r=0;r<t.a;r++)t.d[r]=r;t.d.sort((e=t.c,function(t,r){return i(e[t],e[r])?1:-1})),t.e=!0,function(t){for(var e=t.a;1<=e;--e)ts(t,e);t.h=!0}(t.b)}(h),this.f=new U(this),B(this,-C),B(this,C);null!==(h=te(this.e));){for(;;){t:if(0===(a=this.e).a)u=tn(a.b);else if(u=a.c[a.d[a.a-1]],0!==a.b.a&&i(a=tn(a.b),u)){u=a;break t}if(null===u||!e(u,h))break;u=te(this.e),N(this,h.c,u.c)}!function t(r,a){r.a=a;for(var s=a.c;null===s.i;)if((s=s.c)===a.c){var s=r,o=a,u=new tu;u.a=o.c.b;var h=s.f,p=h.a;do p=p.a;while(null!==p.b&&!h.c(h.b,u,p.b));var h=p.b,m=th(h),u=h.a,p=m.a;if(0===n(u.b.a,o,u.a))e((u=h.a).a,o)||e(u.b.a,o)||(f(u.b),h.c&&(c(u.c),h.c=!1),l(o.c,u),t(s,o));else{var v=i(p.b.a,u.b.a)?h:m,m=void 0;h.d||v.c?(m=v===h?d(o.c.b,u.e):d(p.b.c.b,o.c).b,v.c?M(v,m):(u=s,(h=P(s,h,m)).f=tl(h).f+h.a.f,h.d=I(u,h.f)),t(s,o)):V(s,h,o.c,o.c,null,!0)}return}if(h=(u=th(s=A(s.i))).a,(u=O(r,u,null)).c===h){var h=u,u=h.c,p=th(s),m=s.a,v=p.a,y=!1;m.b.a!==v.b.a&&k(r,s),e(m.a,r.a)&&(l(K(u),m),u=th(s=A(s)).a,O(r,th(s),p),y=!0),e(v.a,r.a)&&(l(h,K(v)),h=O(r,p,null),y=!0),y?V(r,s,h.c,u,u,!0):(o=i(v.a,m.a)?K(v):m,V(r,s,o=d(h.c.b,o),o.c,o.c,!1),o.b.i.c=!0,z(r,s))}else V(r,s,u.c,h,h,!0)}(this,h)}for(h=0,this.a=this.f.a.a.b.a.a;null!==(u=this.f.a.a.b);)u.h||++h,w(u);for(this.f=null,(h=this.e).b=null,h.d=null,this.e=h.c=null,a=(h=this.b).a.b;a!==h.a;a=u)u=a.b,(a=a.a).e.e===a&&(S(a.c,a),c(a));if(!this.n){if(h=this.b,this.m)for(a=h.b.h;a!==h.b;a=u)u=a.h,a.b.d.c!==a.d.c?a.f=a.d.c?1:-1:c(a);else for(a=h.a.b;a!==h.a;a=u)if(u=a.b,a.c){for(a=a.a;i(a.b.a,a.a);a=a.c.b);for(;i(a.a,a.b.a);a=a.e);for(s=a.c.b,o=void 0;a.e!==s;)if(i(a.b.a,s.a)){for(;s.e!==a&&(i((t=s.e).b.a,t.a)||0>=n(s.a,s.b.a,s.e.b.a));)s=(o=d(s.e,s)).b;s=s.c.b}else{for(;s.e!==a&&(i((r=a.c.b).a,r.b.a)||0<=n(a.b.a,a.a,a.c.b.a));)a=(o=d(a,a.c.b)).b;a=a.e}for(;s.e.e!==a;)s=(o=d(s.e,s)).b}if(this.h||this.i||this.k||this.l){if(this.m){for(u=(h=this.b).a.b;u!==h.a;u=u.b)if(u.c){this.h&&this.h(2,this.c),a=u.a;do this.k&&this.k(a.a.d,this.c),a=a.e;while(a!==u.a);this.i&&this.i(this.c)}}else{for(h=this.b,u=!!this.l,a=!1,s=-1,o=h.a.d;o!==h.a;o=o.d)if(o.c){a||(this.h&&this.h(4,this.c),a=!0),v=o.a;do u&&s!==(p=v.b.d.c?0:1)&&(s=p,this.l&&this.l(!!s,this.c)),this.k&&this.k(v.a.d,this.c),v=v.e;while(v!==o.a)}a&&this.i&&this.i(this.c)}}if(this.r){for(a=(h=this.b).a.b;a!==h.a;a=u)if(u=a.b,!a.c){o=(s=a.a).e,v=void 0;do o=(v=o).e,v.d=null,null===v.b.d&&(v.c===v?x(v.a,null):(v.a.c=v.c,m(v,K(v))),(p=v.b).c===p?x(p.a,null):(p.a.c=p.c,m(p,K(p))),g(v));while(v!==s);s=a.d,(a=a.b).d=s,s.b=a}this.r(this.b),this.c=this.b=null;return}}this.b=this.c=null},aG.libtess={GluTesselator:W,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}},W.prototype.gluDeleteTess=W.prototype.x,W.prototype.gluTessProperty=W.prototype.B,W.prototype.gluGetTessProperty=W.prototype.y,W.prototype.gluTessNormal=W.prototype.A,W.prototype.gluTessCallback=W.prototype.z,W.prototype.gluTessVertex=W.prototype.C,W.prototype.gluTessBeginPolygon=W.prototype.u,W.prototype.gluTessBeginContour=W.prototype.t,W.prototype.gluTessEndContour=W.prototype.v,W.prototype.gluTessEndPolygon=W.prototype.w,t.exports=aG.libtess}(aj);var aW=((tx=new aj.exports.GluTesselator).gluTessCallback(aj.exports.gluEnum.GLU_TESS_VERTEX_DATA,function(t,e){e[e.length]=t[0],e[e.length]=t[1]}),tx.gluTessCallback(aj.exports.gluEnum.GLU_TESS_BEGIN,function(t){t!==aj.exports.primitiveType.GL_TRIANGLES&&console.info("expected TRIANGLES but got type: "+t)}),tx.gluTessCallback(aj.exports.gluEnum.GLU_TESS_ERROR,function(t){console.error("error callback, error number: "+t)}),tx.gluTessCallback(aj.exports.gluEnum.GLU_TESS_COMBINE,function(t,e,i){return[t[0],t[1],t[2]]}),tx.gluTessCallback(aj.exports.gluEnum.GLU_TESS_EDGE_FLAG,function(t){}),tx);function aX(t){aW.gluTessNormal(0,0,1);var e=[];aW.gluTessBeginPolygon(e);for(var i=0;i<t.length;i++){aW.gluTessBeginContour();for(var r=t[i],n=0;n<r.length;n+=2){var a=[r[n],r[n+1],0];aW.gluTessVertex(a,a)}aW.gluTessEndContour()}return aW.gluTessEndPolygon(),e}t.StarType=void 0,(tb=t.StarType||(t.StarType={}))[tb.Star=0]="Star",tb[tb.Polygon=1]="Polygon";var aH=function(t){function e(e,i,r,n,a,s){var o;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=0),void 0===s&&(s=0),(o=t.call(this)||this).pointCount=e,o.outerRadius=i,o.innerRadius=r,o.outerRoundness=n,o.innerRoundness=a,o.starType=s,o.v=[],o.in=[],o.out=[],o}iG(e,t);var i=e.prototype;return i.clone=function(){return new e(this.pointCount,this.outerRadius,this.innerRadius,this.outerRoundness,this.innerRoundness,this.starType)},i.copyFrom=function(t){this.pointCount=t.pointCount,this.outerRadius=t.outerRadius,this.innerRadius=t.innerRadius,this.outerRoundness=t.outerRoundness,this.innerRoundness=t.innerRoundness,this.starType=t.starType},i.copyTo=function(t){t.copyFrom(this)},i.build=function(t,e){switch(this.starType){case 0:this.buildStarPath();break;case 1:this.buildPolygonPath()}for(var i=null!=e?e:1,r=0;r<this.v.length-2;r+=2)aU(t,this.v[r],this.v[r+1],this.out[r],this.out[r+1],this.in[r+2],this.in[r+3],this.v[r+2],this.v[r+3],void 0,i);var n=this.v.length-1;aU(t,this.v[n-1],this.v[n],this.out[n-1],this.out[n],this.in[0],this.in[1],this.v[0],this.v[1],void 0,i)},i.triangulate=function(t,e,i,r,n){for(var a=aX([t]),s=e.length/2,o=0;o<a.length;o++)e[2*i+o]=a[o];for(var u=a.length/2,h=0;h<u;h++)r[n+h]=s+h},i.buildStarPath=function(){this.v=[],this.in=[],this.out=[];var t,e,i,r,n=2*Math.floor(this.pointCount),a=2*Math.PI/n,s=!0,o=this.outerRadius,u=this.innerRadius,h=this.outerRoundness/100,l=this.innerRoundness/100,c=2*Math.PI*o/(2*n),f=2*Math.PI*u/(2*n),d=-Math.PI/2;for(t=0;t<n;t++){e=s?o:u,i=s?h:l,r=s?c:f;var p=e*Math.cos(d),m=e*Math.sin(d),v=0===p&&0===m?0:m/Math.sqrt(p*p+m*m),y=0===p&&0===m?0:-p/Math.sqrt(p*p+m*m),g=2*t;this.v[g]=p,this.v[g+1]=m,this.in[g]=p+v*r*i*1,this.in[g+1]=m+y*r*i*1,this.out[g]=p-v*r*i*1,this.out[g+1]=m-y*r*i*1,s=!s,d+=1*a}},i.buildPolygonPath=function(){this.v=[],this.in=[],this.out=[];var t,e=Math.floor(this.pointCount),i=2*Math.PI/e,r=this.outerRadius,n=this.outerRoundness/100,a=2*Math.PI*r/(4*e),s=-(.5*Math.PI);for(t=0;t<e;t++){var o=r*Math.cos(s),u=r*Math.sin(s),h=0===o&&0===u?0:u/Math.sqrt(o*o+u*u),l=0===o&&0===u?0:-o/Math.sqrt(o*o+u*u),c=2*t;this.v[c]=o,this.v[c+1]=u,this.in[c]=o+h*a*n*1,this.in[c+1]=u+l*a*n*1,this.out[c]=o-h*a*n*1,this.out[c+1]=u-l*a*n*1,s+=1*i}},e}(aD),aY=function(t){function e(e,i,r){var n;return void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),(n=t.call(this)||this).x=e,n.y=i,n.radius=r,n}iG(e,t);var i=e.prototype;return i.clone=function(){return new e(this.x,this.y,this.radius)},i.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=i},i.strokeContains=function(t,e,i,r){if(void 0===r&&(r=.5),0===this.radius)return!1;var n=this.x-t,a=this.y-e,s=this.radius,o=(1-r)*i,u=Math.sqrt(n*n+a*a);return u<=s+o&&u>s-(i-o)},i.getBounds=function(t){return t||(t=new az),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=2*this.radius,t.height=2*this.radius,t},i.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this},i.copyTo=function(t){return t.copyFrom(this),t},i.build=function(t,e){var i=this.x,r=this.y,n=this.radius,a=this.radius;if(!(n<=0)){var s=Math.ceil(Math.sqrt((null!=e?e:1)*(n+a))),o=8*s+0+0;if(0!==o){if(0===s){t[0]=t[6]=i+0,t[1]=t[3]=r+0,t[2]=t[4]=i-0,t[5]=t[7]=r-0;return}var u=0,h=4*s+0+2,l=h,c=o,f=0+n,d=0,p=i+f,m=i-f,v=r+0;t[u++]=p,t[u++]=v,t[--h]=v,t[--h]=m;for(var y=1;y<s;y++){var g=Math.PI/2*(y/s),x=0+Math.cos(g)*n,b=0+Math.sin(g)*a,T=i+x,E=i-x,C=r+b,S=r-b;t[u++]=T,t[u++]=C,t[--h]=C,t[--h]=E,t[l++]=E,t[l++]=S,t[--c]=S,t[--c]=T}f=0,d=0+a,p=i+f,m=i-f,v=r+d;var _=r-d;t[u++]=p,t[u++]=v,t[--c]=_,t[--c]=p}}},i.triangulate=function(t,e,i,r,n){if(0!==t.length){for(var a=0,s=0,o=0;o<t.length;o+=2)a+=t[o],s+=t[o+1];a/=t.length/2,s/=t.length/2;var u=i;e[2*u]=a,e[2*u+1]=s;for(var h=u++,l=0;l<t.length;l+=2)e[2*u]=t[l],e[2*u+1]=t[l+1],l>0&&(r[n++]=u,r[n++]=h,r[n++]=u-1),u++;r[n++]=h+1,r[n++]=h,r[n++]=u-1}},e}(aD),aZ=function(t){function e(){for(var e,i=arguments.length,r=Array(i),n=0;n<i;n++)r[n]=arguments[n];(e=t.call(this)||this).points=[],e.closePath=!1;var a=Array.isArray(r[0])?r[0]:r;if("number"!=typeof a[0]){for(var s=[],o=0,u=a.length;o<u;o++)s.push(a[o].x,a[o].y);a=s}return e.points=a,e.closePath=!0,e}iG(e,t);var i=e.prototype;return i.clone=function(){var t=new e(this.points.slice());return t.closePath=this.closePath,t},i.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,a=r-1;n<r;a=n++){var s=this.points[2*n],o=this.points[2*n+1],u=this.points[2*a],h=this.points[2*a+1];o>e!=h>e&&t<(e-o)/(h-o)*(u-s)+s&&(i=!i)}return i},i.copyFrom=function(t){return this.points=t.points.slice(),this.closePath=t.closePath,this},i.copyTo=function(t){return t.copyFrom(this),t},i.getX=function(){return this.points[this.points.length-2]},i.getY=function(){return this.points[this.points.length-1]},i.build=function(t,e){for(var i=0;i<this.points.length;i++)t[i]=this.points[i]},i.triangulate=function(t,e,i,r,n){var a=aX([t]),s=e.length/2;0===a.length&&this.getLineEndPointsTriangle(t,a);for(var o=0;o<a.length;o++)e[2*i+o]=a[o];for(var u=a.length/2,h=0;h<u;h++)r[n+h]=s+h},i.getLineEndPointsTriangle=function(t,e){if(!t||t.length<2||t.length%2!=0)throw Error("Invalid points array");if(2===t.length){e.push(t[0],t[1],t[0],t[1],t[0],t[1]);return}var i=t[2]-t[0],r=t[3]-t[1],n=t[0],a=t[1],s=t[0],o=t[1];if(Math.abs(i)>=Math.abs(r))for(var u=0;u<t.length;u+=2){var h=t[u],l=t[u+1];h<n&&(n=h,a=l),h>s&&(s=h,o=l)}else for(var c=0;c<t.length;c+=2){var f=t[c],d=t[c+1];d<a&&(n=f,a=d),d>o&&(s=f,o=d)}e.push(n,a,s,o,s,o)},rV(e,[{key:"lastX",get:function(){return this.points[this.points.length-2]}},{key:"lastY",get:function(){return this.points[this.points.length-1]}}]),e}(aD);t.UpdateModes=void 0,(tT=t.UpdateModes||(t.UpdateModes={}))[tT.EveryUpdate=0]="EveryUpdate",tT[tT.Manual=1]="Manual",t.CompositionComponent=function(e){function i(){var i;return i=e.apply(this,arguments)||this,i.items=[],i.state=t.PlayState.Stopped,i.updateMode=0,i.playOnStart=!1,i.endBehavior=t2.forward,i.time=0,i.lastTime=0,i.sceneBindings=[],i.timelineAsset=null,i._timelineInstance=null,i.nestedCompositions=[],i}iG(i,e);var r=i.prototype;return r.onStart=function(){this.playOnStart&&this.play()},r.pause=function(){this.state=t.PlayState.Paused;for(var e,i=iH(this.nestedCompositions);!(e=i()).done;)e.value.pause()},r.play=function(){this.state=t.PlayState.Playing;for(var e,i=iH(this.nestedCompositions);!(e=i()).done;)e.value.play()},r.stop=function(){this.state=t.PlayState.Stopped,this.time=0,this.lastTime=0;for(var e,i=iH(this.nestedCompositions);!(e=i()).done;)e.value.stop()},r.getTime=function(){return this.time},r.setTime=function(t){this.time=t},r.onUpdate=function(e){this.state===t.PlayState.Playing&&0===this.updateMode&&this.tick(e/1e3)},r.tick=function(t){if(this.timelineInstance){var e=this.time;if(n$(this.lastTime,this.time)&&(e+=t),e>this.item.duration)switch(this.endBehavior){case t2.forward:break;case t2.freeze:e=this.item.duration;break;case t2.restart:e%=this.item.duration;break;case t2.destroy:this.item.dispose();return}this.timelineInstance.evaluate(e,t),this.lastTime=this.time=e}},r.onEnable=function(){this.item.getDescendants(!1,function(t){return t.setActive(!0),!1})},r.onDisable=function(){this.item.getDescendants(!1,function(t){return t.setActive(!1),!1})},r.onDestroy=function(){this.item.getDescendants().forEach(function(t){return t.dispose()})},r.setChildrenRenderOrder=function(e){if(!this.timelineInstance)return e;var r=[];this.collectChildren(this.item,r);for(var n,a=new Set,s=iH(this.timelineInstance.masterTrackInstances);!(n=s()).done;){var o=n.value;ej(o.boundObject,t.VFXItem)&&a.add(o.boundObject)}for(var u=[],h=0;h<r.length;h++)a.has(r[h])&&u.push(h);for(var l,c=[],f=iH(this.timelineInstance.masterTrackInstances);!(l=f()).done;){var d=l.value;ej(d.boundObject,t.VFXItem)&&c.push(d.boundObject)}for(var p=0;p<u.length&&p<c.length;p++)r[u[p]]=c[p];for(var m,v=iH(r);!(m=v()).done;){var y=m.value,g=e++;y.isManuallySetRenderOrder||y.setRendererComponentOrder(g);var x=y.getComponent(i);x&&(e=x.setChildrenRenderOrder(e))}return e},r.collectChildren=function(e,i){for(var r,n=iH(e.children);!(r=n()).done;){var a=r.value;i.push(a),t.VFXItem.isComposition(a)||this.collectChildren(a,i)}},r.fromData=function(t){e.prototype.fromData.call(this,t),this._timelineInstance=null},rV(i,[{key:"timelineInstance",get:function(){if(!this._timelineInstance&&this.timelineAsset){this._timelineInstance=new u_(this.timelineAsset,this.sceneBindings),this.nestedCompositions=[];for(var e,r=iH(this._timelineInstance.masterTrackInstances);!(e=r()).done;){var n=e.value.boundObject;if(ej(n,t.VFXItem)&&t.VFXItem.isComposition(n)){var a=n.getComponent(i);a.updateMode=1,this.nestedCompositions.push(a)}}}return this._timelineInstance}}]),i}(rL),eW([iJ(void 0,void 0)],t.CompositionComponent.prototype,"items",void 0),eW([iJ(void 0,void 0)],t.CompositionComponent.prototype,"sceneBindings",void 0),eW([iJ(void 0,void 0)],t.CompositionComponent.prototype,"timelineAsset",void 0),t.CompositionComponent=eW([iK("CompositionComponent")],t.CompositionComponent),t.FilterMode=void 0,(tE=t.FilterMode||(t.FilterMode={}))[tE.Nearest=0]="Nearest",tE[tE.Linear=1]="Linear",t.RenderTextureFormat=void 0,(tC=t.RenderTextureFormat||(t.RenderTextureFormat={}))[tC.RGBA32=0]="RGBA32",tC[tC.RGBAHalf=1]="RGBAHalf";var aq=function(){function t(){}var e=t.prototype;return e.resize=function(t,e,i,r){},e.resetColorTextures=function(t){},e.unbind=function(){},e.bind=function(){},e.getDepthTexture=function(){},e.getStencilTexture=function(){},e.getColorTextures=function(){return[]},e.dispose=function(t){},rV(t,[{key:"stencilStorage",get:function(){}},{key:"depthStorage",get:function(){}}]),t}();t.RenderPassAttachmentStorageType=void 0,(tS=t.RenderPassAttachmentStorageType||(t.RenderPassAttachmentStorageType={}))[tS.none=0]="none",tS[tS.color=1]="color",tS[tS.stencil_8_opaque=2]="stencil_8_opaque",tS[tS.depth_16_opaque=3]="depth_16_opaque",tS[tS.depth_stencil_opaque=4]="depth_stencil_opaque",tS[tS.depth_16_texture=5]="depth_16_texture",tS[tS.depth_24_stencil_8_texture=6]="depth_24_stencil_8_texture",t.TextureStoreAction=void 0,(t_=t.TextureStoreAction||(t.TextureStoreAction={}))[t_.store=0]="store",t_[t_.clear=2]="clear";var aK=function(){function e(e,i){if(this.destroyed=!1,i){var r=i.texture,n=i.size;if(ej(r,ne))this.texture=r,this.externalTexture=!0;else if(r){var a=r.wrapT,s=r.wrapS,o=r.minFilter,u=r.magFilter,h=r.internalFormat,l=r.format,c=void 0===l?rD.RGBA:l,f=r.type,d=void 0===f?rD.UNSIGNED_BYTE:f;this.externalTexture=!1,this.textureOptions={size:n,format:c,type:d,internalFormat:h||c,wrapT:a,wrapS:s,minFilter:o,magFilter:u,name:i.name},this.texture=ne.create(e,re({},this.textureOptions,{sourceType:t.TextureSourceType.framebuffer,data:{width:n[0],height:n[1]}}))}}}return e.prototype.dispose=function(){this.destroyed||(this.texture.dispose(),this.destroyed=!0)},rV(e,[{key:"isDestroyed",get:function(){return this.destroyed}},{key:"storageType",get:function(){return 1}},{key:"size",get:function(){var t=this.texture;return t?[t.getWidth(),t.getHeight()]:[0,0]}},{key:"width",get:function(){return this.texture.getWidth()||0}},{key:"height",get:function(){return this.texture.getHeight()||0}}]),e}();t.RenderPassDestroyAttachmentType=void 0,(tw=t.RenderPassDestroyAttachmentType||(t.RenderPassDestroyAttachmentType={}))[tw.force=0]="force",tw[tw.keep=1]="keep",tw[tw.keepExternal=2]="keepExternal",tw[tw.destroy=0]="destroy";var aQ=1,aJ=function(){function e(t){this.priority=0,this.name="RenderPass"+aQ++,this.meshes=[],this.disposed=!1,this.framebuffer=null,this.renderer=t}var i=e.prototype;return i.addMesh=function(t){im(this.meshes,t)},i.removeMesh=function(t){eQ(this.meshes,t)},i.configure=function(t){},i.execute=function(t){},i.onCameraCleanup=function(t){},i.getViewport=function(){var t,e=null==(t=this.framebuffer)?void 0:t.viewport;if(e)return e;var i=this.renderer;return i?[0,0,i.getWidth(),i.getHeight()]:[0,0,0,0]},i.dispose=function(e){if(!this.disposed){var i=(null==e?void 0:e.meshes)||void 0;i!==t.DestroyOptions.keep&&this.meshes.forEach(function(t){t.dispose(i)}),this.meshes.length=0,this.disposed=!0}},rV(e,[{key:"isDisposed",get:function(){return this.disposed}},{key:"viewport",get:function(){return this.getViewport()}}]),e}(),a$=function(e){function i(t){var i;return(i=e.call(this,t)||this).useRenderTarget=!1,i.priority=1e3,i.name="DrawObjectPass",i}iG(i,e);var r=i.prototype;return r.setup=function(t){this.useRenderTarget=t},r.configure=function(e){this.useRenderTarget&&(this.framebuffer=e.getTemporaryRT("DrawObjectPass",e.getWidth(),e.getHeight(),16,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),e.setFramebuffer(this.framebuffer))},r.execute=function(e){this.useRenderTarget&&e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear}),this.meshes.sort(function(t,e){return t.priority-e.priority}),e.renderMeshes(this.meshes)},r.onCameraCleanup=function(t){this.useRenderTarget&&this.framebuffer&&t.releaseTemporaryRT(this.framebuffer)},i}(aJ),a0=1,a1=function(e){function i(i,r){var n;return(n=e.call(this,i)||this).name="",n.subMeshes=[],n.mode=4,n.instanceCount=0,n.vertexBuffers={},n.indices=new Uint16Array(0),n.drawCount=0,n.drawStart=0,n.skin={},n.disposed=!1,n.initialized=!1,n.bufferUsage=t.BufferUsage.Static,a3(i)&&(n.vertexArrayObjects={}),r&&n.processProps(r),n}iG(i,e);var r=i.prototype;return r.isDisposed=function(){return this.disposed},r.getOptions=function(){return this.options?re({},this.options):void 0},r.getVertexBuffer=function(t){return this.vertexBuffers[t]},r.getVertexBuffers=function(){return this.vertexBuffers},r.setVerticesBuffer=function(t,e){void 0===e&&(e=!0);var i=t.getKind(),r=this.vertexBuffers[i];r&&e&&r.dispose(),t.ownsBuffer&&t.buffer.increaseReferences(),this.vertexBuffers[i]=t,this.disposeVertexArrayObjects()},r.getAttributeBuffer=function(t){var e;return null==(e=this.vertexBuffers[t])?void 0:e.getWrapperBuffer()},r.getAttributeData=function(t){var e;return null==(e=this.vertexBuffers[t])?void 0:e.getData()},r.setAttributeData=function(t,e){var i=this.vertexBuffers[t];i&&(i.update(e),this.disposeVertexArrayObjects())},r.setAttributeSubData=function(t,e,i){var r=this.vertexBuffers[t];if(r){var n=r.getWrapperBuffer(),a=n.byteStride>0?Math.ceil(i.byteLength/n.byteStride):0;n.updateDirectly(i,e,a),this.disposeVertexArrayObjects()}},r.getAttributeStride=function(t){var e,i;return null!=(i=null==(e=this.vertexBuffers[t])?void 0:e.byteStride)?i:0},r.getAttributeNames=function(){return Object.keys(this.vertexBuffers)},r.getIndexBuffer=function(){return this.indexBuffer},r.getIndexData=function(){return this.indices},r.getIndexType=function(){var e;return(null==(e=this.indexBuffer)?void 0:e.is32Bits)||a5(this.indices)?t.BufferDataType.UnsignedInt:t.BufferDataType.UnsignedShort},r.setIndexData=function(t){if(!a4(t))throw TypeError("Index data must use a supported integer array.");this.indices=Array.isArray(t)?a5(t)?new Uint32Array(t):new Uint16Array(t):t,this.releaseIndexBuffer(),this.disposeVertexArrayObjects(),this.initialized&&this.createIndexBuffer()},r.setIndexSubData=function(t,e){var i=this.indices;if(t<0||t+e.length>i.length)throw RangeError("Buffer '"+this.name+"##index' update is out of range.");if(i.set(e,t),this.indexBuffer){var r=i.slice(t,t+e.length);this.engine.updateDynamicIndexBuffer(this.indexBuffer,r,t*(this.indexBuffer.is32Bits?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT)),this.disposeVertexArrayObjects()}},r.setDrawStart=function(t){this.drawStart=t},r.getDrawStart=function(){return this.drawStart},r.setDrawCount=function(t){this.drawCount=t},r.getDrawCount=function(){return this.drawCount},r.getSkinProps=function(){return this.skin},r.bind=function(t){var e=this.vertexArrayObjects,i=this.engine;if(!e||!a3(i)){i.bindBuffers(this.vertexBuffers,this.indexBuffer,t);return}var r=e[t.key];!r&&(r=i.recordVertexArrayObject(this.vertexBuffers,this.indexBuffer,t))&&(e[t.key]=r),r?i.bindVertexArrayObject(r,this.indexBuffer):i.bindBuffers(this.vertexBuffers,this.indexBuffer,t)},r.releaseVertexArrayObject=function(t){var e=this.vertexArrayObjects;if(e){var i=e[t];i&&a2(this.engine)&&this.engine.releaseVertexArrayObject(i),delete e[t]}},r.initialize=function(){this.initialized||this.disposed||(this.forEachVertexBuffer(function(t){t.create()}),this.createIndexBuffer(),this.engine.addGeometry(this),this.initialized=!0,this.options=void 0)},r.flush=function(){this.disposed||(this.initialize(),this.forEachVertexBuffer(function(t){return t.create()}))},r.restore=function(){this.initialized&&!this.disposed&&(this.vertexArrayObjects&&(this.vertexArrayObjects={}),this.forEachVertexBuffer(function(t){return t.rebuild()}),this.indices.length>0&&(this.indexBuffer=void 0,this.createIndexBuffer()))},r.fromData=function(t){if(e.prototype.fromData.call(this,t),this.subMeshes=t.subMeshes,t.buffer?n=new Uint8Array(function(t){for(var e=atob(t),i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i.buffer}(t.buffer)):t.binaryData&&(n=t.binaryData),n){var i=t.vertexData.vertexCount,r={name:t.name,mode:4,attributes:{}};if(t.vertexData.channels.some(function(t){return!!t.semantic}))t.vertexData.channels.forEach(function(t){var e,a=null!=(e=a7[t.semantic])?e:t.semantic;r.attributes[a]={type:a9(t.format),size:t.dimension,data:a8(t,n,i),normalize:t.normalize}});else{var n,a,s=t.vertexData.channels[0],o=t.vertexData.channels[1],u=t.vertexData.channels[2];r.attributes=((a={})[nA.PositionKind]=a6(s,n,i,3),a[nA.UVKind]=a6(o,n,i,2),a[nA.NormalKind]=a6(u,n,i,3),a)}if(t.indexFormat!==eb.None){var h=function(t,e,i){var r=e.buffer,n=e.byteOffset+i,a=e.byteLength-i;switch(t){case eb.UInt16:return new Uint16Array(r,n,a/Uint16Array.BYTES_PER_ELEMENT);case eb.UInt32:return new Uint32Array(r,n,a/Uint32Array.BYTES_PER_ELEMENT);default:throw Error("Unsupported index format: "+t+".")}}(t.indexFormat,n,t.indexOffset);r.indices={data:h},r.drawCount=h.length}else r.drawCount=i;this.processProps(r),this.skin={boneNames:t.boneNames,rootBoneName:t.rootBoneName,inverseBindMatrices:t.inverseBindMatrices}}},r.dispose=function(){var t=this;this.disposed||(this.disposeVertexArrayObjects(),Object.keys(this.vertexBuffers).forEach(function(e){return t.vertexBuffers[e].dispose()}),this.releaseIndexBuffer(),this.vertexBuffers={},this.indices=new Uint16Array(0),this.options=void 0,this.drawStart=0,this.drawCount=0,this.initialized&&this.engine.removeGeometry(this),this.initialized=!1,this.disposed=!0,e.prototype.dispose.call(this))},r.processProps=function(e){var i,r,n,a,s,o,u=this;this.releaseCurrentBuffers();var h=null!=(i=e.bufferUsage)?i:t.BufferUsage.Static,l={},c={},f={};if(Object.keys(e.attributes).forEach(function(t){var i,r,n=e.attributes[t],a="dataSource"in n?n.dataSource:t;c[a]=Math.max(null!=(i=c[a])?i:0,null!=(r=n.instanceDivisor)?r:0)}),Object.keys(e.attributes).forEach(function(i){var r,n,a=e.attributes[i];if(!("dataSource"in a)){var s,o=ArrayBuffer.isView(s=a.data)&&!ej(s,DataView)?a.data:void 0,d=null!=(r=a.type)?r:o?nS(o):t.BufferDataType.Float,p=nC(d),m=a.stride||a.size*p,v=null!=o?o:nw(d,0);if(0===v.length&&e.maxVertex&&e.maxVertex>0){var y=m/p;v=nw(d,Math.ceil(e.maxVertex*y))}var g=null!=(n=c[i])?n:0;f[i]=d,l[i]=new nM(u.engine,v,h!==t.BufferUsage.Static,m,!1,g>0,!0,g,i)}}),Object.keys(e.attributes).forEach(function(i){var r,n,a,s,o,h=e.attributes[i],c="dataSource"in h?h.dataSource:i,d=l[c];if(!d)throw Error("Attribute '"+i+"' references missing data source '"+c+"'.");var p=null!=(n=null!=(r=h.type)?r:f[c])?n:t.BufferDataType.Float,m=h.stride||d.byteStride,v=null!=(a=h.instanceDivisor)?a:0,y=new nA(u.engine,d,i,{size:h.size,type:p,stride:m,offset:null!=(s=h.offset)?s:0,normalized:null!=(o=h.normalize)&&o,instanced:v>0,divisor:v,useBytes:!0,takeBufferOwnership:!0});u.setVerticesBuffer(y)}),this.name=null!=(r=e.name)?r:"effectsGeometry:"+a0++,this.drawStart=null!=(n=e.drawStart)?n:0,this.drawCount=null!=(a=e.drawCount)?a:0,this.mode=null!=(s=e.mode)?s:4,this.instanceCount=null!=(o=e.instanceCount)?o:0,this.bufferUsage=h,this.options=e,e.indices){var d=e.indices.data;if(!a4(d))throw TypeError("Index data must use a supported integer array.");this.indices=Array.isArray(d)?a5(d)?new Uint32Array(d):new Uint16Array(d):d}this.disposeVertexArrayObjects()},r.releaseCurrentBuffers=function(){var t=this,e=this.initialized;this.disposeVertexArrayObjects(),Object.keys(this.vertexBuffers).forEach(function(e){return t.vertexBuffers[e].dispose()}),this.releaseIndexBuffer(),this.vertexBuffers={},this.indices=new Uint16Array(0),e&&(this.engine.removeGeometry(this),this.initialized=!1)},r.disposeVertexArrayObjects=function(){var t=this,e=this.vertexArrayObjects;e&&(Object.keys(e).forEach(function(i){var r=e[i];r&&a2(t.engine)&&t.engine.releaseVertexArrayObject(r)}),this.vertexArrayObjects={})},r.createIndexBuffer=function(){var t=this.indices;0===t.length||this.indexBuffer||(this.indexBuffer=this.engine.createIndexBuffer(t,{usage:this.bufferUsage,type:this.getIndexType(),byteStride:0,instanceDivisor:0,label:""+this.name+"##index"}))},r.releaseIndexBuffer=function(){this.indexBuffer&&(this.engine.releaseBuffer(this.indexBuffer),this.indexBuffer=void 0)},r.forEachVertexBuffer=function(t){var e=this,i=new Set;Object.keys(this.vertexBuffers).forEach(function(r){var n=e.vertexBuffers[r].getWrapperBuffer();i.has(n)||(i.add(n),t(n))})},rV(i,[{key:"isInitialized",get:function(){return this.initialized}}]),i}(i$);function a2(t){return"function"==typeof t.recordVertexArrayObject&&"function"==typeof t.bindVertexArrayObject&&"function"==typeof t.releaseVertexArrayObject}function a3(t){var e;return(null==(e=t.gpuCapability)?void 0:e.detail.vertexArrayObject)===!0&&a2(t)}function a4(t){return Array.isArray(t)||ej(t,Int32Array)||ej(t,Uint16Array)||ej(t,Uint32Array)}function a5(t){if(ej(t,Uint32Array))return!0;if(ej(t,Uint16Array))return!1;for(var e=0;e<t.length;e++)if(t[e]>=65535)return!0;return!1}function a6(t,e,i,r){return{type:a9(t.format),size:r,data:a8(t,e,i),normalize:t.normalize}}function a8(t,e,i){var r=e.buffer,n=e.byteOffset+t.offset,a=t.dimension*i;switch(t.format){case ex.Float32:return new Float32Array(r,n,a);case ex.Int16:return new Int16Array(r,n,a);case ex.Int8:return new Int8Array(r,n,a);case ex.UInt16:return new Uint16Array(r,n,a);case ex.UInt8:return new Uint8Array(r,n,a);default:throw Error("Unsupported vertex format: "+t.format+".")}}function a9(e){switch(e){case ex.Float32:return t.BufferDataType.Float;case ex.Int16:return t.BufferDataType.Short;case ex.Int8:return t.BufferDataType.Byte;case ex.UInt16:return t.BufferDataType.UnsignedShort;case ex.UInt8:return t.BufferDataType.UnsignedByte;default:throw Error("Unsupported vertex format: "+e+".")}}a1.create=function(t,e){return new a1(t,e)};var a7={POSITION:nA.PositionKind,TEXCOORD0:nA.UVKind,TEXCOORD_0:nA.UVKind,TEXCOORD1:nA.UV2Kind,NORMAL:nA.NormalKind,TANGENT:nA.TangentKind,COLOR:nA.ColorKind,JOINTS:nA.JointsKind,JOINTS_0:nA.JointsKind,WEIGHTS:nA.WeightsKind,WEIGHTS_0:nA.WeightsKind,POSITION_BS0:"aTargetPosition0",POSITION_BS1:"aTargetPosition1",POSITION_BS2:"aTargetPosition2",POSITION_BS3:"aTargetPosition3",POSITION_BS4:"aTargetPosition4",POSITION_BS5:"aTargetPosition5",POSITION_BS6:"aTargetPosition6",POSITION_BS7:"aTargetPosition7",NORMAL_BS0:"aTargetNormal0",NORMAL_BS1:"aTargetNormal1",NORMAL_BS2:"aTargetNormal2",NORMAL_BS3:"aTargetNormal3",TANGENT_BS0:"aTargetTangent0",TANGENT_BS1:"aTargetTangent1",TANGENT_BS2:"aTargetTangent2",TANGENT_BS3:"aTargetTangent3"},st=((eI={})[t.BufferDataType.Float]=4,eI[t.BufferDataType.Int]=4,eI[t.BufferDataType.UnsignedInt]=4,eI[t.BufferDataType.Short]=2,eI[t.BufferDataType.UnsignedShort]=2,eI[t.BufferDataType.Byte]=1,eI[t.BufferDataType.UnsignedByte]=1,eI),se=1,si=function(e){function i(t,i){var r;if((r=e.call(this,t)||this).destroyed=!1,r.visible=!0,i){var n=i.material,a=i.geometry,s=i.name,o=i.priority,u=i.worldMatrix,h=void 0===u?nl.fromIdentity():u;r.id="Mesh"+se++,r.name=void 0===s?"<unnamed>":s,r.geometry=a,r.material=n,r.priority=void 0===o?0:o,r.worldMatrix=h}else r.id="Mesh"+se++,r.name="<unnamed>",r.worldMatrix=nl.fromIdentity(),r._priority=0;return r}iG(i,e);var r=i.prototype;return r.setVisible=function(t){this.visible=t},r.getVisible=function(){return this.visible},r.render=function(t){!this.isDestroyed&&this.getVisible()&&t.drawGeometry(this.geometry,this.worldMatrix,this.material)},r.firstGeometry=function(){return this.geometry},r.setMaterial=function(e,i){i!==t.DestroyOptions.keep&&this.material.dispose(),this.material=e},r.restore=function(){},r.dispose=function(i){this.destroyed||((null==i?void 0:i.geometries)!==t.DestroyOptions.keep&&this.geometry.dispose(),(null==i?void 0:i.material)!==t.DestroyOptions.keep&&this.material.dispose(),this.destroyed=!0,void 0!==this.engine&&this.engine.removeMesh(this),e.prototype.dispose.call(this))},rV(i,[{key:"isDestroyed",get:function(){return this.destroyed}}]),i}(nV),sr="precision highp float;attribute vec2 aUV;attribute vec3 aPos;varying vec2 vTexCoord;varying vec3 vParams;varying vec4 vColor;uniform vec2 _Size;uniform vec3 _Scale;uniform vec4 _Color;uniform vec4 _TexParams;uniform vec4 _TexOffset;uniform mat4 effects_MatrixVP;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;void main(){vec4 texParams=_TexParams;vTexCoord=vec2(aUV.xy*_TexOffset.zw+_TexOffset.xy);vColor=_Color;vParams=vec3(texParams.w,texParams.y,texParams.x);if(texParams.z==1.0){vec4 pos=vec4(aPos.xy*_Size,aPos.z,1.0);gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}else{mat4 view=effects_MatrixV;vec3 camRight=vec3(view[0][0],view[1][0],view[2][0]);vec3 camUp=vec3(view[0][1],view[1][1],view[2][1]);vec3 worldPosition=vec3(effects_ObjectToWorld*vec4(0.0,0.0,0.0,1.0));vec3 vertexPosition=worldPosition+camRight*aPos.x*_Size.x*_Scale.x+camUp*aPos.y*_Size.y*_Scale.y;gl_Position=effects_MatrixVP*vec4(vertexPosition,1.0);}}",sn="precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D _MainTex;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);\n#ifdef TRANSPARENT_VIDEO\nfloat halfX=vTexCoord.x*0.5;vec2 uv_rgb=vec2(halfX,vTexCoord.y);vec2 uv_alpha=vec2(halfX+0.5,vTexCoord.y);vec3 rgb=texture2D(_MainTex,uv_rgb).rgb;float alpha=max(texture2D(_MainTex,uv_alpha).r,1e-5);vec4 texColor=vec4(rgb/alpha,alpha);\n#else\nvec4 texColor=texture2D(_MainTex,vTexCoord.xy);\n#endif\ncolor=blendColor(texColor,vColor,floor(0.5+vParams.y));\n#ifdef ALPHA_CLIP\nif(color.a<0.04){discard;}\n#endif\ncolor.a=clamp(color.a,0.0,1.0);gl_FragColor=color;}",sa="#version 100\nprecision mediump float;\n#define PATICLE_SHADER 1\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;uniform vec3 emissionColor;uniform float emissionIntensity;uniform sampler2D uMaskTex;uniform vec4 uColorParams;uniform vec2 uTexOffset;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\n#ifdef USE_SPRITE\nvarying vec4 vTexCoordBlend;\n#endif\nvarying float vSeed;\n#ifdef PREVIEW_BORDER\nuniform vec4 uPreviewColor;\n#endif\n#ifdef USE_SPRITE\nvec4 getTextureColor(sampler2D tex,vec2 texCoord){if(vTexCoordBlend.w>0.){return mix(texture2D(tex,texCoord),texture2D(tex,vTexCoordBlend.xy+texCoord),vTexCoordBlend.z);}return texture2D(tex,texCoord);}\n#else\n#define getTextureColor texture2D\n#endif\n#ifndef WEBGL2\n#define round(a) floor(0.5+a)\n#endif\nvec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}\n#ifdef PREVIEW_BORDER\nvoid main(){gl_FragColor=uPreviewColor;}\n#else\nvoid main(){vec4 color=vec4(1.0);vec4 tempColor=vColor;vec2 texOffset=uTexOffset;if(vLife<0.){discard;}if(uColorParams.x>0.0){color=getTextureColor(uMaskTex,vTexCoord);}\n#ifdef COLOR_OVER_LIFETIME\n#ifndef ENABLE_VERTEX_TEXTURE\ntempColor*=texture2D(uColorOverLifetime,vec2(vLife,0.));\n#endif\n#endif\ncolor=blendColor(color,tempColor,round(uColorParams.y));if(color.a<=0.01&&uColorParams.w>0.){float _at=texture2D(uMaskTex,vTexCoord+texOffset).a+texture2D(uMaskTex,vTexCoord+texOffset*-1.).a;if(_at<=0.02){discard;}}vec3 emission=emissionColor*pow(2.0,emissionIntensity);color=vec4(pow(pow(color.rgb,vec3(2.2))+emission,vec3(1.0/2.2)),color.a);gl_FragColor=color;}\n#endif\n",ss="#version 100\nprecision mediump float;\n#define SHADER_VERTEX 1\n#define PATICLE_SHADER 1\n#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4){float movement=0.0;float h=(t-p1.x)*0.05;for(int i=0;i<=20;i++){float t=float(i)*h;float nt=binarySearchT(t,p1.x,p2.x,p3.x,p4.x);float y=cubicBezier(nt,p1.y,p2.y,p3.y,p4.y);float weight=(i==0||i==20)? 1.0 :(mod(float(i),2.)!=0.)? 4.0 : 2.0;movement+=weight*y;}movement*=h/3.;return movement;}float integrateFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i+=2){vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return ret;}vec2 p1=vec2(k0.x,k0.y);vec2 p2=vec2(k0.z,k0.w);vec2 p3=vec2(k1.z,k1.w);vec2 p4=vec2(k1.x,k1.y);if(time>=k1.x){ret+=calculateMovement(k1.x,p1,p2,p3,p4);}if(time>=k0.x&&time<k1.x){return ret+calculateMovement(time,p1,p2,p3,p4);}}return ret;}float integrateByTimeLineSeg(float t,vec2 p0,vec2 p1){float t0=p0.x;float t1=p1.x;float y0=p0.y;float y1=p1.y;vec4 tSqr=vec4(t,t,t0,t0);tSqr=tSqr*tSqr;vec4 a=vec4(2.*t,3.,-t0,3.)*tSqr;float t1y0=t1*y0;vec4 b=vec4(y0-y1,t0*y1-t1y0,2.*y0+y1,t1y0);float r=dot(a,b);return r/(t0-t1)*0.16666667;}float integrateLineSeg(float time,vec2 p0,vec2 p1){float h=time-p0.x;float y0=p0.y;return(y0+y0+(p1.y-y0)*h/(p1.x-p0.x))*h/2.;}float integrateFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateLineSeg(time,k0,k1);}ret+=integrateLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateLineSeg(time,k1,k2);}ret+=integrateLineSeg(k2.x,k1,k2);}return ret;}float integrateByTimeFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateByTimeLineSeg(time,k0,k1);}ret+=integrateByTimeLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateByTimeLineSeg(time,k1,k2);}ret+=integrateByTimeLineSeg(k2.x,k1,k2);}return ret;}float getIntegrateFromTime0(float t1,vec4 value){float type=value.x;if(type==0.){return value.y*t1;}if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateLineSeg(t1,p0,p1);}if(type==3.){return integrateFromLineSeg(t1,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*t1;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w);}return 0.;}float getIntegrateByTimeFromTime(float t0,float t1,vec4 value){float type=value.x;if(type==0.){return value.y*(t1*t1-t0*t0)/2.;}else if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateByTimeLineSeg(t1,p0,p1)-integrateByTimeLineSeg(t0,p0,p1);}if(type==3.){return integrateByTimeFromLineSeg(t1,value.y,value.z)-integrateByTimeFromLineSeg(t0,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*(t1*t1-t0*t0)/2.;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w)-integrateFromBezierCurveFrames(t0,value.z,value.w);}return 0.;}const float d2r=3.141592653589793/180.;attribute vec3 aPos;attribute vec4 aOffset;attribute vec4 aColor;attribute vec3 aDirX;attribute vec3 aDirY;attribute vec3 aTranslation;attribute vec3 aRotation0;attribute vec3 aRotation1;attribute vec3 aRotation2;attribute vec3 aLinearMove;\n#ifdef USE_SPRITE\nattribute vec3 aSprite;uniform vec4 uSprite;struct UVDetail{vec2 uv0;vec3 uv1;};UVDetail getSpriteUV(vec2 uv,float lifeTime);varying vec4 vTexCoordBlend;\n#endif\n#ifdef FINAL_TARGET\nuniform vec3 uFinalTarget;uniform vec4 uForceCurve;\n#endif\nuniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;uniform mat4 effects_MatrixVP;uniform vec4 uParams;uniform vec4 uOpacityOverLifetimeValue;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\nuniform vec4 uOrbXByLifetimeValue;uniform vec4 uOrbYByLifetimeValue;uniform vec4 uOrbZByLifetimeValue;uniform vec3 uOrbCenter;uniform vec4 uSizeByLifetimeValue;\n#ifdef SIZE_Y_BY_LIFE\nuniform vec4 uSizeYByLifetimeValue;\n#endif\nvarying float vLife;varying vec4 vColor;varying vec2 vTexCoord;vec3 calOrbitalMov(float _life,float _dur){vec3 orb=vec3(0.0);\n#ifdef AS_ORBITAL_MOVEMENT\n#define FUNC(a) getValueFromTime(_life,a)\n#else\n#define FUNC(a) getIntegrateFromTime0(_life,a) * _dur\n#endif\n#if ORB_VEL_X\norb.x=FUNC(uOrbXByLifetimeValue);\n#endif\n#if ORB_VEL_Y\norb.y=FUNC(uOrbYByLifetimeValue);\n#endif\n#if ORB_VEL_Z\norb.z=FUNC(uOrbZByLifetimeValue);\n#endif\n#undef FUNC\nreturn orb;}mat3 mat3FromRotation(vec3 rotation){vec3 sinR=sin(rotation*d2r);vec3 cosR=cos(rotation*d2r);return mat3(cosR.z,-sinR.z,0.,sinR.z,cosR.z,0.,0.,0.,1.)*mat3(cosR.y,0.,sinR.y,0.,1.,0.,-sinR.y,0,cosR.y)*mat3(1.,0.,0.,0,cosR.x,-sinR.x,0.,sinR.x,cosR.x);}\n#ifdef USE_SPRITE\nUVDetail getSpriteUV(vec2 uv,float lifeTime){float t=fract(clamp((lifeTime-aSprite.x)/aSprite.y,0.0,1.)*aSprite.z);float frame=uSprite.z*t;float frameIndex=max(ceil(frame)-1.,0.);float row=floor((frameIndex+0.1)/uSprite.x);float col=frameIndex-row*uSprite.x;vec2 retUV=(vec2(col,row)+uv)/uSprite.xy;UVDetail ret;if(uSprite.w>0.){float blend=frame-frameIndex;float frameIndex1=min(ceil(frame),uSprite.z-1.);float row1=floor((frameIndex1+0.1)/uSprite.x);float col1=frameIndex1-row1*uSprite.x;vec2 coord=(vec2(col1,row1)+uv)/uSprite.xy-retUV;ret.uv1=vec3(coord.x,1.-coord.y,blend);}ret.uv0=vec2(retUV.x,1.-retUV.y);return ret;}\n#endif\nvoid main(){float time=uParams.x-aOffset.z;float dur=aOffset.w;if(time<0.||time>dur){gl_Position=vec4(-3.,-3.,-3.,1.);}else{float life=clamp(time/dur,0.0,1.0);vLife=life;\n#ifdef USE_SPRITE\nUVDetail uvD=getSpriteUV(aOffset.xy,time);vTexCoord=uvD.uv0;vTexCoordBlend=vec4(uvD.uv1,uSprite.w);\n#else\nvTexCoord=aOffset.xy;\n#endif\nvColor=aColor;\n#ifdef COLOR_OVER_LIFETIME\n#ifdef ENABLE_VERTEX_TEXTURE\nvColor*=texture2D(uColorOverLifetime,vec2(life,0.));\n#endif\n#endif\nvColor.a*=clamp(getValueFromTime(life,uOpacityOverLifetimeValue),0.,1.);vec3 size=vec3(vec2(getValueFromTime(life,uSizeByLifetimeValue)),1.0);\n#ifdef SIZE_Y_BY_LIFE\nsize.y=getValueFromTime(life,uSizeYByLifetimeValue);\n#endif\nmat3 aRotation=mat3(aRotation0,aRotation1,aRotation2);vec3 point=aRotation*(aDirX*size.x+aDirY*size.y);vec3 _pos=aPos+aTranslation;\n#if ORB_VEL_X + ORB_VEL_Y + ORB_VEL_Z\n_pos=mat3FromRotation(calOrbitalMov(life,dur))*(_pos-uOrbCenter);_pos+=uOrbCenter;\n#endif\n_pos.xyz+=aLinearMove;\n#ifdef FINAL_TARGET\nfloat force=getValueFromTime(life,uForceCurve);vec4 pos=vec4(mix(_pos,uFinalTarget,force),1.);\n#else\nvec4 pos=vec4(_pos,1.0);\n#endif\n#if RENDER_MODE == 1\npos.xyz+=point;pos=effects_ObjectToWorld*pos;\n#elif RENDER_MODE == 3\npos=effects_ObjectToWorld*pos;pos.xyz+=effects_MatrixV[0].xyz*point.x+effects_MatrixV[2].xyz*point.y;\n#elif RENDER_MODE == 2\npos=effects_ObjectToWorld*pos;pos.xy+=point.xy;\n#elif RENDER_MODE == 0\npos=effects_ObjectToWorld*pos;pos.xyz+=effects_MatrixV[0].xyz*point.x+effects_MatrixV[1].xyz*point.y;\n#endif\ngl_Position=effects_MatrixVP*pos;vSeed=aSeed;gl_PointSize=6.0;}}",so="#version 100\nprecision mediump float;\n#define SHADER_VERTEX 1\n#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}attribute vec4 aPos;attribute vec3 aDir;attribute vec3 aInfo;attribute vec4 aColor;attribute float aTime;\n#ifdef ATTR_TRAIL_START\nattribute float aTrailStart;\n#else\nuniform float uTrailStart[64];attribute float aTrailStartIndex;\n#endif\nuniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixVP;uniform vec4 uTextureMap;uniform float uTime;uniform vec4 uParams;uniform vec4 uColorParams;uniform vec4 uOpacityOverLifetimeValue;uniform vec4 uWidthOverTrail;\n#ifdef COLOR_OVER_TRAIL\nuniform sampler2D uColorOverTrail;\n#endif\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;void main(){vec4 _pa=effects_MatrixVP*vec4(aPos.xyz,1.);vec4 _pb=effects_MatrixVP*vec4(aPos.xyz+aDir,1.);vec2 dir=normalize(_pb.xy/_pb.w-_pa.xy/_pa.w);vec2 screen_xy=vec2(-dir.y,dir.x);vec4 pos=effects_ObjectToWorld*vec4(aPos.xyz,1.);\n#ifdef ATTR_TRAIL_START\nfloat ts=aTrailStart;\n#else\nfloat ts=uTrailStart[int(aTrailStartIndex)];\n#endif\nfloat trail=(ts-aInfo.y)/uParams.y;float width=aPos.w*getValueFromTime(trail,uWidthOverTrail)/max(abs(screen_xy.x),abs(screen_xy.y));pos.xyz+=(effects_MatrixInvV[0].xyz*screen_xy.x+effects_MatrixInvV[1].xyz*screen_xy.y)*width;float time=min((uTime-aTime)/aInfo.x,1.0);gl_Position=effects_MatrixVP*pos;vColor=aColor;\n#ifdef COLOR_OVER_LIFETIME\n#ifdef ENABLE_VERTEX_TEXTURE\nvColor*=texture2D(uColorOverLifetime,vec2(time,0.));\n#endif\n#endif\n#ifdef COLOR_OVER_TRAIL\nvColor*=texture2D(uColorOverTrail,vec2(trail,0.));\n#endif\nvColor.a*=clamp(getValueFromTime(time,uOpacityOverLifetimeValue),0.,1.);vLife=time;vTexCoord=uTextureMap.xy+vec2(trail,aInfo.z)*uTextureMap.zw;vSeed=aSeed;}",su="precision highp float;attribute vec2 aPos;varying vec2 uv;void main(){gl_Position=vec4(aPos,0.,1.0);uv=(aPos+vec2(1.0))/2.;}",sh="precision highp float;\n#define HALF_MAX 60000.0\n#define ACEScc_MIDGRAY 0.4135884\nvarying vec2 uv;uniform sampler2D _GaussianTex;uniform sampler2D _SceneTex;uniform float _BloomIntensity;uniform float _Brightness;uniform float _Saturation;uniform float _Contrast;uniform bool _UseBloom;uniform bool _UseToneMapping;uniform vec3 _VignetteColor;uniform vec2 _VignetteCenter;uniform float _VignetteIntensity;uniform float _VignetteSmoothness;uniform float _VignetteRoundness;mat3 LinearToACES=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);mat3 ACESToLinear=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);float log10(float x){return log(x)/log(10.0);}vec3 log10(vec3 v){return vec3(log10(v.x),log10(v.y),log10(v.z));}vec3 LinearToLogC(vec3 x){return 0.244161*log10(5.555556*x+0.047996)+0.386036;}vec3 LogCToLinear(vec3 x){return(pow(vec3(10.0),(x-0.386036)/0.244161)-0.047996)/5.555556;}vec3 rrt_and_odt_fit(vec3 col){vec3 a=col*(col+0.0245786)-0.000090537;vec3 b=col*(0.983729*col+0.4329510)+0.238081;return a/b;}vec3 ACESToneMapping(vec3 col){vec3 aces=LinearToACES*col;aces=rrt_and_odt_fit(aces);col=ACESToLinear*aces;return col;}vec3 LinearToSrgb(vec3 c){return mix(1.055*pow(c,vec3(1./2.4))-0.055,12.92*c,step(c,vec3(0.0031308)));}vec3 GammaCorrection(vec3 c){return pow(c,vec3(1.0/2.2));}vec3 ApplyVignette(vec3 inputColor,vec2 uv,vec2 center,float intensity,float roundness,float smoothness,vec3 color){vec2 dist=abs(uv-center)*intensity;dist.x*=roundness;float vfactor=pow(clamp((1.0-dot(dist,dist)),0.0,1.0),smoothness);return inputColor*mix(color,vec3(1.0),vfactor);}void main(){vec4 hdrColor=texture2D(_SceneTex,uv);hdrColor.rgb=pow(hdrColor.rgb,vec3(2.2));vec3 finalColor=hdrColor.rgb;if(_UseBloom){vec4 bloomColor=texture2D(_GaussianTex,uv);bloomColor.rgb*=_BloomIntensity;finalColor+=bloomColor.rgb;}if(_VignetteIntensity>0.0){finalColor=ApplyVignette(finalColor,uv,_VignetteCenter,_VignetteIntensity,_VignetteRoundness,_VignetteSmoothness,_VignetteColor);}finalColor=finalColor*_Brightness;vec3 colorLog=LinearToLogC(finalColor);colorLog=(colorLog-ACEScc_MIDGRAY)*_Contrast+ACEScc_MIDGRAY;finalColor=LogCToLinear(colorLog);finalColor=max(finalColor,0.0);float luminance=0.2125*finalColor.r+0.7154*finalColor.g+0.0721*finalColor.b;vec3 luminanceColor=vec3(luminance,luminance,luminance);finalColor=(finalColor-luminanceColor)*_Saturation+luminanceColor;finalColor=max(finalColor,0.0);if(_UseToneMapping){finalColor=max(vec3(0.0),ACESToneMapping(finalColor));}float alpha=min(hdrColor.a,1.0);gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),alpha);}",sl="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;vec3 GaussH(sampler2D tex,vec2 uv){vec3 color=vec3(0.0);float offsets[9];offsets[0]=-4.0;offsets[1]=-3.0;offsets[2]=-2.0;offsets[3]=-1.0;offsets[4]=0.0;offsets[5]=1.0;offsets[6]=2.0;offsets[7]=3.0;offsets[8]=4.0;float weights[9];weights[0]=0.01621622;weights[1]=0.05405405;weights[2]=0.12162162;weights[3]=0.19459459;weights[4]=0.22702703;weights[5]=0.19459459;weights[6]=0.12162162;weights[7]=0.05405405;weights[8]=0.01621622;for(int i=0;i<9;i++){vec2 offset=vec2(offsets[i]*2.0*(1.0/_TextureSize.x),0);color+=texture2D(tex,uv+offset).rgb*weights[i];}return color;}void main(){vec3 color=GaussH(_MainTex,uv);gl_FragColor=vec4(color,1.0);}",sc="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;vec3 GaussV(sampler2D tex,vec2 uv){vec3 color=vec3(0.0);float offsets[5];offsets[0]=-3.23076923;offsets[1]=-1.38461538;offsets[2]=0.0;offsets[3]=1.38461538;offsets[4]=3.23076923;float weights[5];weights[0]=0.07027027;weights[1]=0.31621622;weights[2]=0.22702703;weights[3]=0.31621622;weights[4]=0.07027027;for(int i=0;i<5;i++){vec2 offset=vec2(0,offsets[i]*(1.0/_TextureSize.y));color+=texture2D(tex,uv+offset).rgb*weights[i];}return color;}void main(){vec3 color=GaussV(_MainTex,uv);gl_FragColor=vec4(color,1.0);}",sf="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform sampler2D _GaussianDownTex;uniform vec2 _GaussianDownTextureSize;float GaussWeight2D(float x,float y,float sigma){float PI=3.14159265358;float E=2.71828182846;float sigma_2=pow(sigma,2.0);float a=-(x*x+y*y)/(2.0*sigma_2);return pow(E,a)/(2.0*PI*sigma_2);}vec3 GaussNxN(sampler2D tex,vec2 uv,vec2 stride,float sigma){vec3 color=vec3(0.,0.,0.);const int r=1;float weight=0.0;for(int i=-r;i<=r;i++){for(int j=-r;j<=r;j++){float w=GaussWeight2D(float(i),float(j),sigma);vec2 coord=uv+vec2(i,j)*stride;color+=texture2D(tex,coord).rgb*w;weight+=w;}}color/=weight;return color;}void main(){vec3 lowResColor=GaussNxN(_MainTex,uv,0.5/_GaussianDownTextureSize,1.0);vec3 highResColor=GaussNxN(_GaussianDownTex,uv,1.0/_GaussianDownTextureSize,1.0);vec3 color=mix(highResColor,lowResColor,0.7);gl_FragColor=vec4(color,1.0);}",sd="precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform float _Threshold;void main(){vec4 mainTex=texture2D(_MainTex,uv);mainTex.rgb=pow(mainTex.rgb,vec3(2.2));float brightness=max(mainTex.r,max(mainTex.g,mainTex.b));float w=max(0.0,brightness-_Threshold)/max(brightness,0.00001);mainTex.rgb*=w;mainTex.rgb*=mainTex.a;gl_FragColor=vec4(mainTex.rgb,1.0);}",sp={},sm=function(){function e(){}return e.registerInclude=function(t,e){sp[t]&&iT.warn('The "'+t+'" shader include already exist.'),sp[t]=e},e.unRegisterInclude=function(t){delete sp[t]},e.unRegisterAllIncludes=function(){Object.keys(sp).forEach(function(t){e.unRegisterInclude(t)})},e.genFinalShaderCode=function(i){var r=i.level,n=i.shaderType,a=i.shader,s=i.macros,o=i.removeVersion,u=e.genMacroString(r,s),h=e.genShaderVersion(r),l=e.parseIncludes(a),c=e.isVersion300(l);return(l=e.removeWebGLVersion(l),2!==r||c||(l=e.convertTo300(l,n===t.ShaderType.fragment)),o)?u+l:h+u+l},e.convertTo300=function(t,i){if(t=(t=(t=t.replace(/\bvarying\b/g,i?"in":"out")).replace(/\btexture(2D|Cube)\b/g,"texture")).replace(/#extension.+(GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,""),i){if(t=(t=(t=t.replace(/\btexture(2D|Cube)LodEXT\b/g,"textureLod")).replace(/\btexture(2D|Cube)GradEXT\b/g,"textureGrad")).replace(/\bgl_FragDepthEXT\b/g,"gl_FragDepth"),!e.has300Output(t)){if(/\bgl_FragData\[.+?\]/g.test(t)){var r=(t=t.replace(/\bgl_FragColor\b/g,"gl_FragData[0]")).match(/\bgl_FragData\[.+?\]/g);r&&(t=e.replaceMRTShader(t,r))}else t=(t=t.replace(/void\s+?main\s*\(/g,"out vec4 glFragColor;\nvoid main(")).replace(/\bgl_FragColor\b/g,"glFragColor")}}else t=t.replace(/\battribute\b/g,"in");return t},e.parseIncludes=function(t,e){for(void 0===e&&(e=/#include <(.+)>/gm);null!==(i=e.exec(t));){var i,r=i[1],n=sp[r];if(void 0===n)throw Error("Can't find include shader name "+r);t=t.replace(i[0],n)}return t},e.genMacroString=function(t,e,i){void 0===i&&(i=!0);var r=[],n="WEBGL"+t;return(r.push("#ifndef "+n),r.push("#define "+n),r.push("#endif"),i&&r.push("#define GE_RUNTIME"),e&&e.length&&e.forEach(function(t){var e=t[0],i=t[1];!0===i?r.push("#define "+e):Number.isFinite(i)&&r.push("#define "+e+" "+i)}),r.length)?r.join("\n")+"\n":""},e.genShaderVersion=function(t){return 1===t?"#version 100\n":"#version 300 es\n"},e.isVersion300=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return(e?e[0]:"").includes("300")},e.removeWebGLVersion=function(t){var e=t.match(/#version\s+\b\d{3}\b\s*(es)?/);return e?t.replace(e[0],""):t},e.has300Output=function(t){return/\bout\s+(?:\w+\s+)?(?:vec4)\s+(?:\w+)\s*;/.test(t)},e.replaceMRTShader=function(t,e){for(var i=new Set,r="",n=0;n<e.length;n++){var a=e[n].match(/\bgl_FragData\[(.+?)\]/);a&&i.add(a[1])}return i.forEach(function(t){r+="layout(location="+t+") out vec4 fragOutColor"+t+";\n"}),r+="void main(",t=(t=t.replace(/\bgl_FragData\[(.+?)\]/g,"fragOutColor$1")).replace(/void\s+?main\s*\(/g,r)},e}(),sv=function(e){function i(i,r){void 0===r&&(r=4),(n=e.call(this,i)||this).tempRTs=[],n.iterationCount=r;var n,a=n.renderer.engine;return n.thresholdMaterial=nb.create(a,{shader:{vertex:su,fragment:sd,glslVersion:t.GLSLVersion.GLSL1}}),n.thresholdMaterial.blending=!1,n.thresholdMaterial.depthTest=!1,n.thresholdMaterial.culling=!1,n.downSampleHMaterial=nb.create(a,{shader:{vertex:su,fragment:sl,glslVersion:t.GLSLVersion.GLSL1}}),n.downSampleHMaterial.blending=!1,n.downSampleHMaterial.depthTest=!1,n.downSampleHMaterial.culling=!1,n.downSampleVMaterial=nb.create(a,{shader:{vertex:su,fragment:sc,glslVersion:t.GLSLVersion.GLSL1}}),n.downSampleVMaterial.blending=!1,n.downSampleVMaterial.depthTest=!1,n.downSampleVMaterial.culling=!1,n.upSampleMaterial=nb.create(a,{shader:{vertex:su,fragment:sf,glslVersion:t.GLSLVersion.GLSL1}}),n.upSampleMaterial.blending=!1,n.upSampleMaterial.depthTest=!1,n.upSampleMaterial.culling=!1,n.priority=5e3,n.name="BloomPass",n}iG(i,e);var r=i.prototype;return r.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture=this.mainTexture},r.execute=function(e){var i,r,n,a=e.getWidth(),s=e.getHeight(),o=null!=(n=null==(r=e.renderingData.currentFrame.globalVolume)?void 0:null==(i=r.bloom)?void 0:i.threshold)?n:1;this.thresholdRT=e.getTemporaryRT("_BloomThreshold",a,s,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),this.thresholdMaterial.setFloat("_Threshold",o),e.blit(this.mainTexture,this.thresholdRT,this.thresholdMaterial);for(var u=this.thresholdRT.getColorTextures()[0],h=0;h<this.iterationCount;h++){var l=Math.floor(a/Math.pow(2,h+1)),c=Math.floor(s/Math.pow(2,h+1)),f=e.getTemporaryRT("_BloomDownH"+h,l,c,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf);this.downSampleHMaterial.setVector2("_TextureSize",sb(u)),e.blit(u,f,this.downSampleHMaterial);var d=e.getTemporaryRT("_BloomDownV"+h,l,c,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf);this.downSampleVMaterial.setVector2("_TextureSize",sb(f.getColorTextures()[0])),e.blit(f.getColorTextures()[0],d,this.downSampleVMaterial),e.releaseTemporaryRT(f),this.tempRTs.push(d),u=d.getColorTextures()[0]}e.releaseTemporaryRT(this.thresholdRT);for(var p=this.iterationCount-1;p>0;p--){var m=Math.floor(a/Math.pow(2,p-1)),v=Math.floor(s/Math.pow(2,p-1)),y=e.getTemporaryRT("_BloomUp"+p,m,v,0,t.FilterMode.Linear,t.RenderTextureFormat.RGBAHalf),g=this.tempRTs[p-1].getColorTextures()[0];this.upSampleMaterial.setTexture("_GaussianDownTex",g),this.upSampleMaterial.setVector2("_GaussianDownTextureSize",sb(g)),e.blit(u,y,this.upSampleMaterial),u=y.getColorTextures()[0],this.tempRTs.push(y)}e.setFramebuffer(this.tempRTs[this.tempRTs.length-1])},r.onCameraCleanup=function(t){for(var e=0;e<this.tempRTs.length;e++)t.releaseTemporaryRT(this.tempRTs[e]);this.tempRTs=[]},r.dispose=function(t){this.thresholdMaterial.dispose(),this.downSampleHMaterial.dispose(),this.downSampleVMaterial.dispose(),this.upSampleMaterial.dispose(),e.prototype.dispose.call(this,t)},i}(aJ),sy=function(e){function i(i,r){n=e.call(this,i)||this;var n,a,s="PostProcess",o=n.renderer.engine;n.sceneTextureHandle=r||new aK(o);var u=a1.create(o,{name:s,mode:rD.TRIANGLE_STRIP,attributes:((a={})[nA.PositionKind]={type:rD.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])},a),drawCount:4}),h=nb.create(o,{name:s,shader:{vertex:su,fragment:sh,glslVersion:t.GLSLVersion.GLSL1}});return h.blending=!1,h.depthTest=!1,h.culling=!1,n.screenMesh=si.create(o,{name:s,geometry:u,material:h,priority:0}),n.priority=5e3,n.name="ToneMappingPass",n}iG(i,e);var r=i.prototype;return r.configure=function(t){this.mainTexture=t.getFramebuffer().getColorTextures()[0],this.sceneTextureHandle.texture||(this.sceneTextureHandle.texture=this.mainTexture),t.setFramebuffer(null)},r.execute=function(e){e.clear({colorAction:t.TextureLoadAction.clear,depthAction:t.TextureLoadAction.clear,stencilAction:t.TextureLoadAction.clear});var i=e.renderingData.currentFrame.globalVolume,r=re({threshold:0,intensity:0,active:!1},null==i?void 0:i.bloom),n=re({intensity:0,smoothness:0,roundness:0,active:!1},null==i?void 0:i.vignette),a=re({brightness:0,saturation:0,contrast:0,active:!1},null==i?void 0:i.colorAdjustments),s=re({active:!1},null==i?void 0:i.tonemapping);this.screenMesh.material.setTexture("_SceneTex",this.sceneTextureHandle.texture),this.screenMesh.material.setFloat("_Brightness",Math.pow(2,a.brightness)),this.screenMesh.material.setFloat("_Saturation",.01*a.saturation+1),this.screenMesh.material.setFloat("_Contrast",.01*a.contrast+1),this.screenMesh.material.setInt("_UseBloom",Number(r.active)),r.active&&(this.screenMesh.material.setTexture("_GaussianTex",this.mainTexture),this.screenMesh.material.setFloat("_BloomIntensity",r.intensity)),n.intensity>0&&(this.screenMesh.material.setFloat("_VignetteIntensity",n.intensity),this.screenMesh.material.setFloat("_VignetteSmoothness",n.smoothness),this.screenMesh.material.setFloat("_VignetteRoundness",n.roundness),this.screenMesh.material.setVector2("_VignetteCenter",new e4(.5,.5)),this.screenMesh.material.setVector3("_VignetteColor",new e5(0,0,0))),this.screenMesh.material.setInt("_UseToneMapping",Number(s.active)),e.renderMeshes([this.screenMesh])},i}(aJ),sg=1,sx=function(){function e(t){this.disposed=!1,this.postProcessingEnabled=!1,this.enableHDR=!0;var e=t.camera,i=t.renderer,r=t.editorTransform,n=t.globalVolume,a=t.postProcessingEnabled,s=void 0!==a&&a,o=i.engine;if(n&&(this.globalVolume=n),this.postProcessingEnabled=s,this.globalUniforms=new sT,this.renderer=i,s&&this.enableHDR&&!this.renderer.engine.gpuCapability.detail.halfFloatTexture)throw Error("Half float texture is not supported.");this.drawObjectPass=new a$(i);var u=[this.drawObjectPass];if(this.setRenderPasses(u),s){var h=new aK(o),l=new sv(i,7);l.sceneTextureHandle=h,this.addRenderPass(l);var c=new sy(i,h);this.addRenderPass(c)}this.name="RenderFrame"+sg++,this.camera=e,this.editorTransform=e6.fromArray(void 0===r?[1,1,0,0]:r)}var i=e.prototype;return i.setup=function(){this.drawObjectPass.setup(this.postProcessingEnabled)},i.addMeshToDefaultRenderPass=function(t){this.drawObjectPass.addMesh(t)},i.removeMeshFromDefaultRenderPass=function(t){this.drawObjectPass.removeMesh(t)},i.dispose=function(e){var i=(null==e?void 0:e.passes)?e.passes:void 0;i!==t.DestroyOptions.keep&&this.renderPasses.forEach(function(t){t.dispose(i)}),this.renderPasses.length=0,this.disposed=!0},i.setRenderPasses=function(t){this.renderPasses=t.slice()},i.addRenderPass=function(t){this.renderPasses.push(t)},i.removeRenderPass=function(t){eQ(this.renderPasses,t)},rV(e,[{key:"isDisposed",get:function(){return this.disposed}}]),e}();function sb(t){return t?new e4(t.getWidth(),t.getHeight()):new e4}var sT=function(){this.floats={},this.ints={},this.vector3s={},this.vector4s={},this.matrices={},this.samplers=[],this.uniforms=[]},sE=function(){function t(t){this.size=[0,0],this.multiSample=1,this.destroyed=!1;var e=t.storageType,i=t.format,r=t.attachment;this.storageType=e,this.format=i,this.attachment=r}return rV(t,[{key:"isDestroyed",get:function(){return this.destroyed}}]),t}(),sC=function(){function e(t){this.engine=t,this.temporaryRTs=[],this.currentFrame=0,this.maxUnusedFrames=4}var i=e.prototype;return i.flush=function(t,e){void 0===t&&(t=!1),void 0===e&&(e=-1),this.currentFrame++;for(var i=e>=0?e:this.maxUnusedFrames,r=0;r<this.temporaryRTs.length;r++){var n=this.temporaryRTs[r];!n.isOccupied&&(t||this.currentFrame-n.lastFrameReleased>i)&&(n.RT.dispose(),this.temporaryRTs.splice(r--,1))}},i.get=function(e,i,r,n,a,s){void 0===n&&(n=0),void 0===a&&(a=t.FilterMode.Linear),void 0===s&&(s=t.RenderTextureFormat.RGBA32);for(var o,u,h,l=i+"_"+r+"_"+n+"_"+a+"_"+s,c=iH(this.temporaryRTs);!(h=c()).done;){var f=h.value;if(!f.isOccupied&&f.descriptionHash===l)return f.isOccupied=!0,f.RT.name=e,f.RT}var d=t.RenderPassAttachmentStorageType.none;a===t.FilterMode.Linear?o=rD.LINEAR:a===t.FilterMode.Nearest&&(o=rD.NEAREST),s===t.RenderTextureFormat.RGBA32?u=rD.UNSIGNED_BYTE:s===t.RenderTextureFormat.RGBAHalf&&(u=rD.HALF_FLOAT),0===n?d=t.RenderPassAttachmentStorageType.none:16===n?d=t.RenderPassAttachmentStorageType.depth_stencil_opaque:24===n&&(d=t.RenderPassAttachmentStorageType.depth_24_stencil_8_texture);var p=ne.create(this.engine,{sourceType:t.TextureSourceType.framebuffer,minFilter:o,magFilter:o,internalFormat:rD.RGBA,format:rD.RGBA,type:u}),m={RT:aq.create({name:e,storeAction:{},viewport:[0,0,i,r],attachments:[p],depthStencilAttachment:{storageType:d}},this.engine.renderer),lastFrameReleased:0,descriptionHash:l,isOccupied:!0};return this.temporaryRTs.push(m),m.RT},i.release=function(t){for(var e,i=iH(this.temporaryRTs);!(e=i()).done;){var r=e.value;if(r.RT===t){r.isOccupied=!1,r.lastFrameReleased=this.currentFrame;break}}},i.dispose=function(){for(var t,e=iH(this.temporaryRTs);!(t=e()).done;)t.value.RT.dispose()},e}(),sS="function"==typeof WebGL2RenderingContext,s_=function(){function t(t){this.setupCapability(t)}var e=t.prototype;return e.isCompressedFormatSupported=function(t){return!!this.compressTextureCapabilityList.get(t)},e.setupCapability=function(t){var e,i,r=sS&&ej(t,WebGL2RenderingContext)?2:1,n=2===r,a=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),s=t.getExtension("WEBGL_depth_texture"),o=!!t.getExtension("OES_texture_half_float_linear"),u=!!t.getExtension("OES_texture_float_linear");this.level=r,this.type=n?"webgl2":"webgl",this.vaoExt=t.getExtension("OES_vertex_array_object"),this.glAsyncCompileExt=t.getExtension("KHR_parallel_shader_compile"),this.UNSIGNED_INT_24_8=t.UNSIGNED_INT_24_8,this.drawBufferExtension=t.getExtension("WEBGL_draw_buffers"),s&&(this.UNSIGNED_INT_24_8=s.UNSIGNED_INT_24_8_WEBGL),n&&!o&&(o=sw(t,t.HALF_FLOAT)),n&&!u&&(u=sw(t,t.FLOAT)),this.internalFormatDepth16=n?t.DEPTH_COMPONENT16:t.DEPTH_COMPONENT,this.internalFormatDepth24_stencil8=n?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL;var h=n||t.getExtension("OES_texture_float")?t.FLOAT:0,l=n?WebGL2RenderingContext.HALF_FLOAT:(null==(i=t.getExtension("OES_texture_half_float"))?void 0:i.HALF_FLOAT_OES)||0;this.compressTextureCapabilityList=new Map([["WEBGL_compressed_texture_astc",!!t.getExtension("WEBGL_compressed_texture_astc")],["WEBKIT_WEBGL_compressed_texture_astc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_astc")],["WEBGL_compressed_texture_etc",!!t.getExtension("WEBGL_compressed_texture_etc")],["WEBKIT_WEBGL_compressed_texture_etc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_etc")],["WEBGL_compressed_texture_etc1",!!t.getExtension("WEBGL_compressed_texture_etc1")],["WEBGL_compressed_texture_pvrtc",!!t.getExtension("WEBGL_compressed_texture_pvrtc")||!!t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")],["WEBKIT_WEBGL_compressed_texture_pvrtc",!!t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc")],["EXT_sRGB",!!t.getExtension("EXT_sRGB")]]);var c={floatTexture:h,halfFloatTexture:l,maxSample:n?t.getParameter(t.MAX_SAMPLES):1,maxVertexUniforms:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxVertexTextures:t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxFragmentUniforms:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),maxFragmentTextures:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),floatColorAttachment:n?!!t.getExtension("EXT_color_buffer_float"):h>0&&!!t.getExtension("WEBGL_color_buffer_float"),halfFloatColorAttachment:n?!!t.getExtension("EXT_color_buffer_float"):l>0&&!!t.getExtension("EXT_color_buffer_half_float"),maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxShaderTexCount:t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),halfFloatLinear:o,floatLinear:u,maxTextureAnisotropy:a?t.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,shaderTextureLod:n||!!t.getExtension("EXT_shader_texture_lod"),instanceDraw:n||!!t.getExtension("ANGLE_instanced_arrays"),vertexArrayObject:n||!!this.vaoExt,ktx2Support:!!((e=this.compressTextureCapabilityList).get("WEBGL_compressed_texture_astc")||e.get("WEBKIT_WEBGL_compressed_texture_astc")),drawBuffers:n||!!this.drawBufferExtension,asyncShaderCompile:!!this.glAsyncCompileExt,intIndexElementBuffer:!!t.getExtension("OES_element_index_uint"),standardDerivatives:n||!!t.getExtension("OES_standard_derivatives"),readableDepthStencilTextures:n||!!s,writableFragDepth:n||!!t.getExtension("EXT_frag_depth")};this.detail=c,a&&(this.textureMaxAnisotropyExt=a.TEXTURE_MAX_ANISOTROPY_EXT)},e.framebufferTexture2D=function(t,e,i,r,n){var a=this.drawBufferExtension;if(1===this.level&&!a&&i>0)throw Error("Draw multiple color buffers not available.");var s=a?a["COLOR_ATTACHMENT"+i+"_WEBGL"]:t["COLOR_ATTACHMENT"+i];s?t.framebufferTexture2D(e,s,r,n,0):console.error("Invalid color attachment index: "+i+".")},e.drawBuffers=function(t,e){var i=this.drawBufferExtension;if(1===this.level&&!i){if(!(e.length>1))return;throw Error("Draw buffers not available.")}var r=e.map(function(e,r){return e?i?i["COLOR_ATTACHMENT"+r+"_WEBGL"]:t["COLOR_ATTACHMENT"+r]:t.NONE});i?i.drawBuffersWEBGL(r):t.drawBuffers(r)},e.setTextureAnisotropic=function(t,e,i){var r=this.detail.maxTextureAnisotropy;r&&t.texParameterf(e,this.textureMaxAnisotropyExt,Math.min(r,i||4))},rV(t,[{key:"isWebGL2",get:function(){return 2===this.level}}]),t}();function sw(t,e){var i=t.createTexture(),r=!1;return t.getError(),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.R16F,1,1,0,t.RED,e,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.getError()||(r=!0),t.deleteTexture(i),r}t.CompressTextureCapabilityType=void 0,(tM=t.CompressTextureCapabilityType||(t.CompressTextureCapabilityType={})).astc="WEBGL_compressed_texture_astc",tM.astc_webkit="WEBKIT_WEBGL_compressed_texture_astc",tM.etc="WEBGL_compressed_texture_etc",tM.etc_webkit="WEBKIT_WEBGL_compressed_texture_etc",tM.etc1="WEBGL_compressed_texture_etc1",tM.pvrtc="WEBGL_compressed_texture_pvrtc",tM.pvrtc_webkit="WEBKIT_WEBGL_compressed_texture_pvrtc",tM.sRGB="EXT_sRGB";var sM=function(){function t(t){this.engine=t,this.currentFramebuffer=null,this.disposed=!1,this.blitGeometry=null,this.blitMaterial=null}var e=t.prototype;return e.setGlobalFloat=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.floats[t]=e},e.setGlobalVector4=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.vector4s[t]=e},e.setGlobalInt=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.ints[t]=e},e.setGlobalMatrix=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.matrices[t]=e},e.setGlobalVector3=function(t,e){this.checkGlobalUniform(t),this.renderingData.currentFrame.globalUniforms.vector3s[t]=e},e.getFramebuffer=function(){return this.currentFramebuffer},e.setFramebuffer=function(t){t?(this.currentFramebuffer=t,this.currentFramebuffer.bind(),this.setViewport(t.viewport[0],t.viewport[1],t.viewport[2],t.viewport[3])):(this.currentFramebuffer=null,this.engine.bindSystemFramebuffer(),this.setViewport(0,0,this.getWidth(),this.getHeight()))},e.setViewport=function(t,e,i,r){this.engine.viewport(t,e,i,r)},e.clear=function(t){this.engine.clear(t)},e.getWidth=function(){return this.engine.getWidth()},e.getHeight=function(){return this.engine.getHeight()},e.getShaderLibrary=function(){return this.engine.getShaderLibrary()},e.renderRenderFrame=function(t){var e=t.renderPasses;if(this.disposed){console.error("Renderer is destroyed, target: GLRenderer.");return}null==(r=t.renderer.engine.getShaderLibrary())||r.compileAllShaders(),t.setup(),this.setFramebuffer(null);var i=t.camera;this.renderingData.currentFrame=t,this.renderingData.currentCamera=i,this.setGlobalMatrix("effects_MatrixInvV",i.getInverseViewMatrix()),this.setGlobalMatrix("effects_MatrixV",i.getViewMatrix()),this.setGlobalMatrix("effects_MatrixVP",i.getViewProjectionMatrix()),this.setGlobalMatrix("_MatrixP",i.getProjectionMatrix()),this.setGlobalVector3("effects_WorldSpaceCameraPos",i.position),ip(e);for(var r,n,a=iH(e);!(n=a()).done;){var s=n.value;this.renderRenderPass(s)}for(var o,u=iH(e);!(o=u()).done;)o.value.onCameraCleanup(this)},e.renderRenderPass=function(t){this.renderingData.currentPass=t,t.configure(this),t.execute(this)},e.renderMeshes=function(t){for(var e,i=iH(t);!(e=i()).done;)e.value.render(this)},e.drawGeometry=function(t,e,i,r){void 0===r&&(r=0),this.engine.drawGeometry(t,e,i,r)},e.getTemporaryRT=function(t,e,i,r,n,a){return this.engine.renderTargetPool.get(t,e,i,r,n,a)},e.releaseTemporaryRT=function(t){this.engine.renderTargetPool.release(t)},e.blit=function(t,e,i){if(!this.blitGeometry){var r;this.blitGeometry=a1.create(this.engine,{mode:rD.TRIANGLE_STRIP,attributes:((r={})[nA.PositionKind]={type:rD.FLOAT,size:2,data:new Float32Array([-1,1,-1,-1,1,1,1,-1])},r),drawCount:4})}this.blitMaterial||(this.blitMaterial=nb.create(this.engine,{shader:{vertex:"\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos, 0.0, 1.0);\n vTex = (aPos + vec2(1.0)) / 2.0;\n}",fragment:"\nprecision mediump float;\nvarying vec2 vTex;\nuniform sampler2D _MainTex;\nvoid main(){\n gl_FragColor = texture2D(_MainTex, vTex);\n}"}}),this.blitMaterial.blending=!1,this.blitMaterial.depthTest=!1,this.blitMaterial.culling=!1);var n=i||this.blitMaterial;n.setTexture("_MainTex",t);var a=this.currentFramebuffer;if(e){var s=e.viewport,o=s[0],u=s[1],h=s[2],l=s[3];this.setFramebuffer(e),this.setViewport(o,u,h,l)}else this.setFramebuffer(null),this.setViewport(0,0,this.getWidth(),this.getHeight());this.drawGeometry(this.blitGeometry,nl.IDENTITY,n),this.setFramebuffer(a)},e.dispose=function(){var t,e;this.disposed||(null==(t=this.blitGeometry)||t.dispose(),this.blitGeometry=null,null==(e=this.blitMaterial)||e.dispose(),this.blitMaterial=null,this.disposed=!0)},e.checkGlobalUniform=function(t){var e=this.renderingData.currentFrame.globalUniforms;e.uniforms.includes(t)||e.uniforms.push(t)},t.create=function(e){return new t(e)},rV(t,[{key:"renderingData",get:function(){return this.engine.renderingData}}]),t}(),sA="lookup_texture",sP="offscreen_canvas",sI={},sR=new(function(){function t(){this._maxCachedCount=16,this._canvasPool=Object.create(null),this._cachedCanvasAndContexts=[]}var e=t.prototype;return e.dispose=function(){this.clear()},e.clear=function(){for(var t,e=this,i=iH(Object.keys(this._canvasPool));!(t=i()).done;){var r=t.value;this._canvasPool[r].forEach(function(t){var i=t.canvas;return e.destroyCanvas(i)}),delete this._canvasPool[r]}this._cachedCanvasAndContexts.length=0},e.getCanvasAndContext=function(t,e){var i=this.getKey(t,e),r=this._canvasPool[i];if(r&&0!==r.length){var n=r.pop();return iy(n),eQ(this._cachedCanvasAndContexts,n),0===r.length&&delete this._canvasPool[i],n}return this.createCanvasAndContext(t,e)},e.releaseCanvasAndContext=function(t){var e=t.canvas,i=e.width,r=e.height,n=this.getKey(i,r);this.resetCanvasAndContext(t),this._canvasPool[n]||(this._canvasPool[n]=[]),eK(this._canvasPool[n],t),eQ(this._cachedCanvasAndContexts,t),this._cachedCanvasAndContexts.push(t),this.getCachedCount()>this._maxCachedCount&&this.cleanUnusedCachedCanvasPool()},e.createCanvasAndContext=function(t,e){var i,r=(void 0===t&&(t=1),void 0===e&&(e=1),i=sI[sP]?window._createOffscreenCanvas(10,10):document.createElement("canvas")).getContext("2d",{willReadFrequently:!0});return iy(r),i.width=t,i.height=e,{canvas:i,context:r}},e.resetCanvasAndContext=function(t){var e=t.canvas,i=t.context;"resetTransform"in i&&"function"==typeof i.resetTransform?i.resetTransform():i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,e.width,e.height)},e.getKey=function(t,e){return(t<<17)+(e<<1)},e.getCachedCount=function(){return this._cachedCanvasAndContexts.length},e.cleanUnusedCachedCanvasPool=function(){for(var t=Math.max(1,Math.ceil(this._cachedCanvasAndContexts.length/2)),e=0;e<t;e++){var i=this._cachedCanvasAndContexts.shift();iy(i);var r=i.canvas,n=r.width,a=r.height,s=this.getKey(n,a),o=this._canvasPool[s];o&&(eQ(o,i),0===o.length&&delete this._canvasPool[s]),this.destroyCanvas(i.canvas)}},e.destroyCanvas=function(t){"remove"in t&&"function"==typeof t.remove&&t.remove()},t}()),sO=function(){function e(e,i,r,n,a){this.engine=e,this.scaledFontString=i,this.glyphs=new Map,this.currentX=0,this.currentY=0,this.full=!1,this.dirty=!0,this.canvas=document.createElement("canvas"),this.canvas.width=512,this.canvas.height=512;var s=this.canvas.getContext("2d",{willReadFrequently:!1});if(!s)throw Error("GlyphAtlas: failed to get 2d context");this.ctx=s,s.font=i,s.textBaseline="alphabetic",s.fillStyle="#ffffff",this.paddingPx=8,this.italicScale="italic"===a?2:1,this.baselinePx=this.paddingPx+r,this.cellHPx=Math.ceil(r+n+2*this.paddingPx),this.lineHeight=this.cellHPx/2,this.texture=ne.create(e,{sourceType:t.TextureSourceType.image,image:this.canvas,target:rD.TEXTURE_2D,flipY:!0,magFilter:rD.LINEAR,minFilter:rD.LINEAR,wrapS:rD.CLAMP_TO_EDGE,wrapT:rD.CLAMP_TO_EDGE}),this.texture.initialize()}var i=e.prototype;return i.ensureChar=function(t){var e=this.glyphs.get(t);if(e)return e;if(this.full)return null;var i=this.ctx;i.font=this.scaledFontString;var r=i.measureText(t).width,n=Math.max(1,Math.ceil(r*this.italicScale))+2*this.paddingPx,a=this.cellHPx;if(this.currentX+n>512&&(this.currentX=0,this.currentY+=a),this.currentY+a>512)return this.full=!0,console.warn('GlyphAtlas full, dropping char "'+t+'"'),null;var s=this.currentX,o=this.currentY;i.fillText(t,s+this.paddingPx,o+this.baselinePx),this.currentX+=n,this.dirty=!0;var u={px:s,py:o,pw:n,ph:a,advance:r/2,paddingLeft:this.paddingPx/2};return this.glyphs.set(t,u),u},i.uploadIfDirty=function(){this.dirty&&(this.texture.updateSource({sourceType:t.TextureSourceType.image,image:this.canvas,target:rD.TEXTURE_2D,flipY:!0,magFilter:rD.LINEAR,minFilter:rD.LINEAR,wrapS:rD.CLAMP_TO_EDGE,wrapT:rD.CLAMP_TO_EDGE}),this.dirty=!1)},i.dispose=function(){this.texture.dispose(),this.glyphs.clear()},e}(),sV=function(){function t(t){this.engine=t,this.atlases=new Map}var e=t.prototype;return e.getAtlas=function(t,e,i,r){var n=r+"|"+i+"|"+t+"|"+e,a=this.atlases.get(n);if(a)return a;var s=r+" "+i+" "+2*t+"px "+e,o=sR.getCanvasAndContext(1,1),u=o.context,h=.8*t*2,l=.2*t*2;try{u.font=s;var c=u.measureText("|\xc9q\xc5M");h=c.actualBoundingBoxAscent||h,l=c.actualBoundingBoxDescent||l}finally{sR.releaseCanvasAndContext(o)}var f=new sO(this.engine,s,h,l,r);return this.atlases.set(n,f),f},e.uploadDirty=function(){for(var t,e=iH(this.atlases.values());!(t=e()).done;)t.value.uploadIfDirty()},e.dispose=function(){for(var t,e=iH(this.atlases.values());!(t=e()).done;)t.value.dispose();this.atlases.clear()},t}(),sL={u0:0,v0:0,u1:1,v1:1},sN=function(){function t(t){var e;this.engine=t,this.lineShape=new aZ,this.bezierShape=new aZ,this.triangleShape=new aB,this.rectangleShape=new az,this.circleShape=new aY,this.buildPoints=[],this.vertices=[],this.colors=[],this.uvs=[],this.indices=[],this.lineStyle={width:1,alignment:.5,cap:ec.Butt,join:ef.Miter,miterLimit:10},this.currentBatchType="colored",this.currentBatchTexture=null,this.transformStack=[],this.currentTransform=nf.fromIdentity(),this.geometry=a1.create(this.engine,{attributes:((e={})[nA.PositionKind]={type:rD.FLOAT,size:2,data:new Float32Array([-.5,.5,-.5,-.5,.5,.5,.5,-.5])},e[nA.ColorKind]={type:rD.FLOAT,size:4,data:new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1])},e[nA.UVKind]={size:2,offset:0,type:rD.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])},e),indices:{data:new Uint16Array([0,1,2,2,1,3])},mode:rD.TRIANGLES,drawCount:6,bufferUsage:rD.DYNAMIC_DRAW}),this.coloredMaterial=nb.create(this.engine,{shader:{vertex:"precision highp float;\n attribute vec2 aPos;\n attribute vec4 aColor;\n varying vec4 vColor;\n\n uniform mat4 effects_MatrixVP;\n void main() {\n vColor = aColor;\n gl_Position = effects_MatrixVP * vec4(aPos, 0.0, 1.0);\n }",fragment:"precision highp float;\n varying vec4 vColor;\n void main() {\n vec4 color = vColor;\n color.rgb *= color.a;\n gl_FragColor = color;\n }"}}),this.coloredMaterial.depthTest=!1,this.coloredMaterial.depthMask=!1,this.coloredMaterial.blending=!0,this.texturedMaterial=nb.create(this.engine,{shader:{vertex:"precision highp float;\n attribute vec2 aPos;\n attribute vec4 aColor;\n attribute vec2 aUV;\n varying vec4 vColor;\n varying vec2 vUV;\n\n uniform mat4 effects_MatrixVP;\n void main() {\n vColor = aColor;\n vUV = aUV;\n gl_Position = effects_MatrixVP * vec4(aPos, 0.0, 1.0);\n }",fragment:"precision highp float;\n varying vec4 vColor;\n varying vec2 vUV;\n uniform sampler2D uMainTexture;\n void main() {\n vec4 color = texture2D(uMainTexture, vUV) * vColor;\n color.rgb *= color.a;\n gl_FragColor = color;\n }"}}),this.texturedMaterial.depthTest=!1,this.texturedMaterial.depthMask=!1,this.texturedMaterial.blending=!0,this.textCache=new sV(t)}var e=t.prototype;return e.begin=function(){this.indices.length=0,this.vertices.length=0,this.colors.length=0,this.uvs.length=0,this.transformStack=[],this.currentTransform=nf.fromIdentity(),this.currentBatchType="colored",this.currentBatchTexture=null;var t=this.engine.canvas.getBoundingClientRect(),e=new nl(2/t.width,0,0,0,0,2/t.height,0,0,0,0,-1,0,-1,-1,0,1);this.coloredMaterial.setMatrix("effects_MatrixVP",e),this.texturedMaterial.setMatrix("effects_MatrixVP",e)},e.pushTransform=function(t){this.transformStack.push(this.currentTransform.clone()),this.currentTransform=this.currentTransform.premultiply(t)},e.popTransform=function(){var t=this.transformStack.pop();if(!t){console.warn("Render2D: 变换栈为空,无法弹出");return}this.currentTransform=t},e.end=function(){this.flushBatch()},e.ensureBatch=function(t,e){void 0===e&&(e=null),!(this.currentBatchType===t&&("textured"!==t||this.currentBatchTexture===e))&&this.currentVertexCount>0&&this.flushBatch(),this.currentBatchType=t,this.currentBatchTexture=e},e.flushBatch=function(){if(0!==this.currentVertexCount&&0!==this.currentIndexCount){this.textCache.uploadDirty();var t=new Float32Array(this.vertices),e=new Float32Array(this.colors),i=new Float32Array(this.uvs),r=new Uint16Array(this.indices);if(this.updateAttributeData(nA.PositionKind,t,2),this.updateAttributeData(nA.ColorKind,e,4),this.updateAttributeData(nA.UVKind,i,2),this.geometry.setIndexData(r),this.geometry.setDrawCount(this.currentIndexCount),"textured"===this.currentBatchType){n=this.texturedMaterial;var n,a,s=null!=(a=this.currentBatchTexture)?a:this.engine.whiteTexture;n.setTexture("uMainTexture",s)}else n=this.coloredMaterial;this.engine.renderer.drawGeometry(this.geometry,nl.IDENTITY,n),this.indices.length=0,this.vertices.length=0,this.colors.length=0,this.uvs.length=0}},e.updateAttributeData=function(t,e,i){var r,n=null==(r=this.geometry.getVertexBuffer(t))?void 0:r.getBuffer();if(n&&e.byteLength>n.capacity){this.geometry.setVerticesBuffer(new nA(this.engine,e,t,{updatable:!0,size:i}));return}this.geometry.setAttributeData(t,e)},e.drawLines=function(t,e,i){if(void 0===e&&(e=e8.WHITE),void 0===i&&(i=1),!t||t.length<4||t.length%2!=0){console.warn("drawLines: 至少需要2个点(4个数值),且数组长度必须为偶数");return}var r=t.length/2,n=t[0]===t[t.length-2]&&t[1]===t[t.length-1],a=n?r-1:r,s=this.lineShape.points;s.length=0;for(var o=0;o<a;o++)s.push(t[2*o],t[2*o+1]);this.ensureBatch("colored"),this.buildShapeLine(this.lineShape,e,i,n)},e.drawLine=function(t,e,i,r,n,a){void 0===n&&(n=e8.WHITE),void 0===a&&(a=1);var s=this.lineShape.points;s.length=0,s.push(t,e,i,r),this.ensureBatch("colored"),this.buildShapeLine(this.lineShape,n,a,!1)},e.drawBezier=function(t,e,i,r,n,a,s,o,u,h){void 0===u&&(u=e8.WHITE),void 0===h&&(h=1);var l=this.bezierShape.points;l.length=0,l.push(t,e),aU(l,t,e,i,r,n,a,s,o),this.ensureBatch("colored"),this.buildShapeLine(this.bezierShape,u,h,!1)},e.drawTriangle=function(t,e,i,r,n,a,s,o){void 0===s&&(s=e8.WHITE),void 0===o&&(o=1),this.setTriangleShape(t,e,i,r,n,a),this.ensureBatch("colored"),this.buildShapeLine(this.triangleShape,s,o,!0)},e.drawRectangle=function(t,e,i,r,n,a){void 0===n&&(n=e8.WHITE),void 0===a&&(a=1),this.setRectangleShape(t,e,i,r,0),this.ensureBatch("colored"),this.buildShapeLine(this.rectangleShape,n,a,!0)},e.drawCircle=function(t,e,i,r,n){void 0===r&&(r=e8.WHITE),void 0===n&&(n=1),this.setCircleShape(t,e,i),this.ensureBatch("colored"),this.buildShapeLine(this.circleShape,r,n,!0)},e.fillTriangle=function(t,e,i,r,n,a,s){void 0===s&&(s=e8.WHITE),this.setTriangleShape(t,e,i,r,n,a),this.ensureBatch("colored"),this.buildShape(this.triangleShape,s)},e.fillRectangle=function(t,e,i,r,n){void 0===n&&(n=e8.WHITE),this.ensureBatch("colored"),this.pushQuad(t,e,i,r,n)},e.fillCircle=function(t,e,i,r){void 0===r&&(r=e8.WHITE),this.setCircleShape(t,e,i),this.ensureBatch("colored"),this.buildShape(this.circleShape,r)},e.drawTexture=function(t,e,i,r,n,a,s){void 0===a&&(a=sL),void 0===s&&(s=e8.WHITE),this.ensureBatch("textured",n),this.pushQuad(t,e,i,r,s,a)},e.drawText=function(t,e,i,r,n,a,s,o){if(void 0===n&&(n=e8.WHITE),void 0===a&&(a="sans-serif"),void 0===s&&(s="normal"),void 0===o&&(o="normal"),i){var u=this.textCache.getAtlas(r,a,s,o);this.ensureBatch("textured",u.texture);for(var h=u.lineHeight,l=t,c=0;c<i.length;c++){var f=u.ensureChar(i[c]);if(f){var d=f.px/512,p=(f.px+f.pw)/512,m=1-(f.py+f.ph)/512,v=1-f.py/512;this.pushQuad(l-f.paddingLeft,e,f.pw/2,h,n,{u0:d,v0:m,u1:p,v1:v}),l+=f.advance}}}},e.dispose=function(){this.geometry.dispose(),this.coloredMaterial.dispose(),this.texturedMaterial.dispose(),this.textCache.dispose()},e.buildShape=function(t,e){var i=this.buildPoints,r=this.indices.length,n=this.vertices.length/2;i.length=0,t.build(i),t.triangulate(i,this.vertices,n,this.indices,r),this.applyTransformAndColor(n,this.vertices.length/2-n,e)},e.buildShapeLine=function(t,e,i,r){void 0===r&&(r=!1);var n=this.buildPoints;this.indices.length;var a=this.vertices.length/2;n.length=0,t.build(n),this.lineStyle.width=i,aF(n,this.lineStyle,!1,r,this.vertices,2,a,this.indices),this.applyTransformAndColor(a,this.vertices.length/2-a,e)},e.setTriangleShape=function(t,e,i,r,n,a){this.triangleShape.x=t,this.triangleShape.y=e,this.triangleShape.x2=i,this.triangleShape.y2=r,this.triangleShape.x3=n,this.triangleShape.y3=a},e.setRectangleShape=function(t,e,i,r,n){this.rectangleShape.x=t,this.rectangleShape.y=e,this.rectangleShape.width=i,this.rectangleShape.height=r,this.rectangleShape.roundness=n},e.setCircleShape=function(t,e,i){this.circleShape.x=t,this.circleShape.y=e,this.circleShape.radius=i},e.applyTransformAndColor=function(t,e,i){for(var r=0;r<e;r++){var n=(t+r)*2,a=(t+r)*4;this.applyTransform(this.vertices[n],this.vertices[n+1],this.vertices,n),this.colors[a]=i.r,this.colors[a+1]=i.g,this.colors[a+2]=i.b,this.colors[a+3]=i.a,this.uvs[n]=0,this.uvs[n+1]=0}},e.pushQuad=function(t,e,i,r,n,a){for(var s=this.vertices.length/2,o=[[t,e],[t+i,e],[t,e+r],[t+i,e+r]],u=a?a.u0:0,h=a?a.v0:0,l=a?a.u1:0,c=a?a.v1:0,f=[[u,h],[l,h],[u,c],[l,c]],d=0;d<4;d++){var p=(s+d)*2,m=(s+d)*4;this.applyTransform(o[d][0],o[d][1],this.vertices,p),this.colors[m]=n.r,this.colors[m+1]=n.g,this.colors[m+2]=n.b,this.colors[m+3]=n.a,this.uvs[p]=f[d][0],this.uvs[p+1]=f[d][1]}this.indices.push(s,s+1,s+2,s+2,s+1,s+3)},e.applyTransform=function(t,e,i,r){void 0===r&&(r=0);var n=this.currentTransform.elements;i[r]=n[0]*t+n[3]*e+n[6],i[r+1]=n[1]*t+n[4]*e+n[7]},rV(t,[{key:"currentVertexCount",get:function(){return this.vertices.length/2}},{key:"currentIndexCount",get:function(){return this.indices.length}}]),t}(),sF=function(t){function e(e){var i;return(i=t.call(this,e)||this).getHitTestParams=function(t){var e=i.transform.getWorldMatrix();i.boundingBoxInfo.setGeometry(i.geometry,e);var r=i.boundingBoxInfo.getRawBoundingBoxTriangle();if(r)return{type:r.type,triangles:r.area,clipMasks:i.frameClipMasks}},i}iG(e,t);var i=e.prototype;return i.render=function(t){this.maskManager.drawStencilMask(t,this);for(var e=0;e<this.materials.length;e++){var i=this.materials[e];t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),i,e)}},i.drawStencilMask=function(t){if(this.isActiveAndEnabled)for(var e=0;e<this.materials.length;e++){var i=this.materials[e];this.maskManager.drawGeometryMask(this.engine.renderer,this.geometry,this.transform.getWorldMatrix(),i,t,e)}},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.boundingBoxInfo.setGeometry(this.geometry,t),this.boundingBoxInfo.getBoundingBoxTriangle()},i.getBoundingBoxInfo=function(){var t=this.geometry.getAttributeData(nA.PositionKind);if(t){var e=n1(t,0,t.length/3);e.minimum.x*=this.transform.size.x,e.minimum.y*=this.transform.size.y,e.maximum.x*=this.transform.size.x,e.maximum.y*=this.transform.size.y,this.boundingBoxInfo.reConstruct(e.minimum,e.maximum,this.transform.getWorldMatrix())}return this.boundingBoxInfo},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.mask;i&&this.maskManager.setMaskOptions(this.engine,i)},e}(nV);eW([iJ(void 0,void 0)],sF.prototype,"geometry",void 0),t.EffectComponent=function(t){function e(e){var i;return(i=t.call(this,e)||this).time=0,i.name="EffectComponent",i}iG(e,t);var i=e.prototype;return i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.onUpdate=function(t){var e,i=this.time,r=null!=(e=this.material.getVector4("_Time"))?e:new e6;this.material.setVector4("_Time",r.set(i/20,i,2*i,3*i)),this.time+=t/1e3},i.fromData=function(e){t.prototype.fromData.call(this,e),this.material=this.materials[0]},e}(sF),t.EffectComponent=eW([iK(ey.EffectComponent)],t.EffectComponent);var sD=new e5(0,0,0),sk=new e5(0,0,0),sz=function(){this.target=null,this.weight=1};t.PositionConstraint=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.positionAtRest=new e5(0,0,0),e.positionOffset=new e5(0,0,0),e.weight=1,e.constrainX=!0,e.constrainY=!0,e.constrainZ=!0,e.targets=[],e}iG(e,t);var i=e.prototype;return i.onStart=function(){var t=this.item.transform.getWorldPosition();this.positionAtRest.copyFrom(t)},i.onUpdate=function(t){if(0!==this.targets.length){sD.set(0,0,0);for(var e,i=0,r=iH(this.targets);!(e=r()).done;){var n=e.value;if(n.target){var a=n.target.transform.getWorldPosition(),s=n.weight;sD.x+=a.x*s,sD.y+=a.y*s,sD.z+=a.z*s,i+=s}}i>0&&(sD.x/=i,sD.y/=i,sD.z/=i),sD.x+=this.positionOffset.x,sD.y+=this.positionOffset.y,sD.z+=this.positionOffset.z,sk.set(this.lerp(this.positionAtRest.x,sD.x,this.weight),this.lerp(this.positionAtRest.y,sD.y,this.weight),this.lerp(this.positionAtRest.z,sD.z,this.weight)),sD.copyFrom(this.item.transform.getWorldPosition());var o=this.constrainX?sk.x:sD.x,u=this.constrainY?sk.y:sD.y,h=this.constrainZ?sk.z:sD.z;this.item.transform.setWorldPosition(o,u,h)}},i.addTarget=function(t,e){void 0===e&&(e=1);var i=new sz;i.target=t,i.weight=Math.max(0,Math.min(1,e)),this.targets.push(i)},i.removeTarget=function(t){var e=this.targets.findIndex(function(e){return e.target===t});-1!==e&&this.targets.splice(e,1)},i.clearTargets=function(){this.targets=[]},i.setPositionOffset=function(t,e,i){this.positionOffset.set(t,e,i)},i.setWeight=function(t){this.weight=Math.max(0,Math.min(1,t))},i.lerp=function(t,e,i){return t+(e-t)*i},i.fromData=function(e){t.prototype.fromData.call(this,e),this.positionAtRest.copyFrom(e.positionAtRest),this.positionOffset.copyFrom(e.positionOffset),this.weight=e.weight,this.constrainX=e.constrainX,this.constrainY=e.constrainY,this.constrainZ=e.constrainZ,this.targets=[];for(var i,r=iH(e.targets);!(i=r()).done;){var n=i.value,a=new sz;a.target=this.engine.findObject(n.target),a.weight=n.weight,this.targets.push(a)}},e}(rL),t.PositionConstraint=eW([iK("PositionConstraint")],t.PositionConstraint),t.PostProcessVolume=function(t){function e(e){var i;return(i=t.call(this,e)||this).bloom={threshold:0,intensity:0,active:!1},i.vignette={intensity:0,smoothness:0,roundness:0,active:!1},i.tonemapping={active:!1},i.colorAdjustments={brightness:0,saturation:0,contrast:0,active:!1},i}return iG(e,t),e.prototype.onStart=function(){var t=this.item.composition;t&&(t.renderFrame.globalVolume=this)},e}(rL),eW([iJ(void 0,void 0)],t.PostProcessVolume.prototype,"bloom",void 0),eW([iJ(void 0,void 0)],t.PostProcessVolume.prototype,"vignette",void 0),eW([iJ(void 0,void 0)],t.PostProcessVolume.prototype,"tonemapping",void 0),eW([iJ(void 0,void 0)],t.PostProcessVolume.prototype,"colorAdjustments",void 0),t.PostProcessVolume=eW([iK(ey.PostProcessVolume)],t.PostProcessVolume);var sB=function(t){function e(e){(i=t.call(this,e)||this).visible=!0,i._color=new e8(1,1,1,1),i.getHitTestParams=function(t){var e=nl.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix()),r=i.interaction;if(t||r){i.boundingBoxInfo.setGeometry(i.geometry,e);var n,a=i.boundingBoxInfo.getRawBoundingBoxTriangle();if(a)return{behavior:(null==(n=i.interaction)?void 0:n.behavior)||0,type:a.type,triangles:a.area,backfaceCulling:i.renderer.side===tG.FRONT,clipMasks:i.frameClipMasks}}},i.renderer={renderMode:tq.MESH,blending:tU.ALPHA,texture:i.engine.whiteTexture,occlusion:!1,transparentOcclusion:!1,side:tG.DOUBLE,mask:0},i.defaultGeometry=a1.create(i.engine,{attributes:((r={})[nA.PositionKind]={type:rD.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},r[nA.UVKind]={size:2,offset:0,type:rD.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])},r),indices:{data:new Uint16Array([0,1,2,2,1,3])},mode:rD.TRIANGLES,drawCount:6,bufferUsage:rD.DYNAMIC_DRAW}),i.geometry=i.defaultGeometry;var i,r,n=nb.create(i.engine,{shader:{fragment:sn,vertex:sr,shared:!0}});return i.material=n,i.material.setColor("_Color",new e8(1,1,1,1)),i.configureMaterial(i.renderer),i}iG(e,t);var i=e.prototype;return i.setVisible=function(t){this.visible=t},i.getVisible=function(){return this.visible},i.setColor=function(t){ej(t,e8)?this._color.copyFrom(t):this._color.setFromArray(t),this.material.setColor("_Color",this._color)},i.setTexture=function(t){var e=this;return eG(function(){var i;return eX(this,function(r){switch(r.label){case 0:if("string"!=typeof t)return[3,2];return[4,ne.fromImage(t,e.item.engine)];case 1:return i=r.sent(),[3,3];case 2:i=t,r.label=3;case 3:return e.renderer.texture=i,e.material.setTexture("_MainTex",i),[2]}})})()},i.onUpdate=function(t){for(var e=0;e<this.materials.length;e++){var i=this.materials[e];i.setVector2("_Size",this.transform.size),(this.renderer.renderMode===tq.BILLBOARD||this.renderer.renderMode===tq.VERTICAL_BILLBOARD||this.renderer.renderMode===tq.HORIZONTAL_BILLBOARD)&&i.setVector3("_Scale",this.transform.scale)}},i.render=function(t){this.getVisible()&&(this.maskManager.drawStencilMask(t,this),this.draw(t))},i.drawStencilMask=function(t){if(this.isActiveAndEnabled)for(var e=0;e<this.materials.length;e++)this.maskManager.drawGeometryMask(this.engine.renderer,this.geometry,this.transform.getWorldMatrix(),this.materials[e],t,e)},i.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},i.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.boundingBoxInfo.setGeometry(this.geometry,t),this.boundingBoxInfo.getBoundingBoxTriangle(this.transform.size)},i.getBoundingBoxInfo=function(){var t=this.geometry.getAttributeData(nA.PositionKind);if(t){var e=n1(t,0,t.length/3);e.minimum.x*=this.transform.size.x,e.minimum.y*=this.transform.size.y,e.maximum.x*=this.transform.size.x,e.maximum.y*=this.transform.size.y,this.boundingBoxInfo.reConstruct(e.minimum,e.maximum,this.transform.getWorldMatrix())}return this.boundingBoxInfo},i.configureMaterial=function(t){var e=t.side,i=t.occlusion,r=t.blending,n=t.texture,a=this.material;a.blending=!0,a.depthTest=!0,a.depthMask=i,rG(a,r),rj(a,e),a.shader.shaderData.properties='_MainTex("_MainTex",2D) = "white" {}',a.setVector4("_TexOffset",new e6(0,0,1,1)),a.setTexture("_MainTex",n);var s=rU(r),o=new e6;return o.x=t.occlusion?+t.transparentOcclusion:1,o.y=s,o.z=t.renderMode,a.setVector4("_TexParams",o),0===o.x||this.maskManager.alphaMaskEnabled?a.enableMacro("ALPHA_CLIP"):a.disableMacro("ALPHA_CLIP"),a},i.draw=function(t){for(var e=0;e<this.materials.length;e++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.materials[e],e)},i.fromData=function(e){t.prototype.fromData.call(this,e);var i,r,n,a,s=null!=(i=e.renderer)?i:{},o=e.mask;o&&this.maskManager.setMaskOptions(this.engine,o),this.renderer={renderMode:null!=(r=s.renderMode)?r:tq.MESH,blending:null!=(n=s.blending)?n:tU.ALPHA,texture:s.texture?this.engine.findObject(s.texture):this.engine.whiteTexture,occlusion:!!s.occlusion,transparentOcclusion:!!s.transparentOcclusion||this.maskManager.isMask,side:null!=(a=s.side)?a:tG.DOUBLE,mask:1},this.configureMaterial(this.renderer)},rV(e,[{key:"color",get:function(){return this._color},set:function(t){this.setColor(t)}}]),e}(nV);function sU(t,e,i){var r=t.elements;r[0]*=e,r[1]*=e,r[2]*=e,r[3]*=e,r[4]*=i,r[5]*=i,r[6]*=i,r[7]*=i}t.Fake3DComponent=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.loop=!1,t.amountOfMotion=1,t.animationLength=2,t.mode=1,t.startPositionX=0,t.startPositionY=0,t.startPositionZ=0,t.endPositionX=0,t.endPositionY=0,t.endPositionZ=0,t.amplitudeX=0,t.amplitudeY=0,t.amplitudeZ=0,t.phaseX=0,t.phaseY=0,t.phaseZ=0,t}iG(i,e);var r=i.prototype;return r.onStart=function(){this.effectComponent=this.item.getComponent(t.EffectComponent)},r.onUpdate=function(t){this.updateFake3D()},r.updateFake3D=function(){if(this.effectComponent){var t=this.item.time%this.animationLength/this.animationLength,e=0,i=0,r=0;switch(this.mode){case 0:var n=Math.PI;e=Math.sin(2*n*(t+this.phaseX))*this.amplitudeX,i=Math.sin(2*n*(t+this.phaseY))*this.amplitudeY,r=Math.sin(2*n*(t+this.phaseZ))*this.amplitudeZ;break;case 1:var a=t;this.loop&&(a>.5&&(a=1-a),a*=2),e=this.startPositionX*(1-a)+a*this.endPositionX,i=this.startPositionY*(1-a)+a*this.endPositionY,r=this.startPositionZ*(1-a)+a*this.endPositionZ}var s=this.effectComponent.material;s.setFloat("_PosX",e*this.amountOfMotion),s.setFloat("_PosY",i*this.amountOfMotion),s.setFloat("_PosZ",r*this.amountOfMotion)}},i}(rL),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"loop",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"amountOfMotion",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"animationLength",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"mode",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionX",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionY",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"startPositionZ",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionX",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionY",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"endPositionZ",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeX",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeY",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"amplitudeZ",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"phaseX",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"phaseY",void 0),eW([iJ(void 0,void 0)],t.Fake3DComponent.prototype,"phaseZ",void 0),t.Fake3DComponent=eW([iK("Fake3DComponent")],t.Fake3DComponent),t.Fake3DAnimationMode=void 0,(tA=t.Fake3DAnimationMode||(t.Fake3DAnimationMode={}))[tA.Circular=0]="Circular",tA[tA.Linear=1]="Linear",t.FrameComponent=function(e){function i(){var i;return i=e.apply(this,arguments)||this,i.color=new e8(1,1,1,1),i.worldMatrix=new nl,i.getHitTestParams=function(e){if(e){var r=nl.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix()),n=function(t,e){return r.transformPoint(new e5(t,e,0),new e5)},a=n(-.5,.5),s=n(.5,.5),o=n(.5,-.5),u=n(-.5,-.5),h=i.getBorderWorldThickness(a,s),l=i.getBorderTriangles(a,s,o,u,h);return{type:t.HitTestType.triangle,triangles:l,clipMasks:i.frameClipMasks}}},i}iG(i,e);var r=i.prototype;return r.onAwake=function(){this.clipGeometry=a1.create(this.engine,{attributes:((t={})[nA.PositionKind]={type:rD.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},t[nA.UVKind]={size:2,offset:0,type:rD.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])},t),indices:{data:new Uint16Array([0,1,2,2,1,3])},mode:rD.TRIANGLES,drawCount:6});var t,e=nb.create(this.engine,{shader:{fragment:"\n precision mediump float;\n\n uniform vec4 _Color;\n\n void main() {\n gl_FragColor = _Color;\n }\n ",vertex:"\n precision highp float;\n attribute vec3 aPos;\n uniform mat4 effects_ObjectToWorld;\n uniform mat4 effects_MatrixVP;\n void main() {\n gl_Position = effects_MatrixVP * effects_ObjectToWorld * vec4(aPos, 1.0);\n }\n ",shared:!0}});e.depthTest=!0,e.depthMask=!1,e.setColor("_Color",this.color),this.material=e},r.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},r.onPreRender=function(){this.setClipRectangle(),this.material.setColor("_Color",this.color)},r.render=function(t){this.maskManager.drawStencilMask(t,this),this.worldMatrix.copyFrom(this.transform.getWorldMatrix()),sU(this.worldMatrix,this.transform.size.x,this.transform.size.y),t.drawGeometry(this.clipGeometry,this.worldMatrix,this.material)},r.onDestroy=function(){this.clipGeometry.dispose(),this.material.dispose()},r.drawStencilMask=function(t){this.isActiveAndEnabled&&(this.worldMatrix.copyFrom(this.transform.getWorldMatrix()),sU(this.worldMatrix,this.transform.size.x,this.transform.size.y),this.maskManager.drawGeometryMask(this.engine.renderer,this.clipGeometry,this.worldMatrix,this.material,t))},r.fromData=function(t){e.prototype.fromData.call(this,t),t.color&&this.color.copyFrom(t.color)},r.getBorderWorldThickness=function(t,e){var i,r=null==(i=this.item.composition)?void 0:i.camera;if(!r)return .05;var n=r.worldToScreenPoint(t),a=r.worldToScreenPoint(e),s=Math.hypot(a.x-n.x,a.y-n.y)/(Math.hypot(e.x-t.x,e.y-t.y)||1);return s>0?13.6/s:.05},r.getBorderTriangles=function(t,e,i,r,n){var a=e.clone().subtract(t).normalize(),s=t.clone().subtract(r).normalize(),o=function(t,e,i){return t.clone().addScaledVector(a,e).addScaledVector(s,i)},u=n/2,h=o(t,-u,u),l=o(e,u,u),c=o(i,u,-u),f=o(r,-u,-u),d=o(t,u,-u),p=o(e,-u,-u),m=o(i,-u,u),v=o(r,u,u),y=function(t,e,i,r){return[{p0:t,p1:e,p2:i},{p0:t,p1:i,p2:r}]};return[].concat(y(h,l,p,d),y(l,c,m,p),y(c,f,v,m),y(f,h,d,v))},r.setClipRectangle=function(){this.setClipRectangleRecursive(this.item)},r.setClipRectangleRecursive=function(t){for(var e,i=iH(t.children);!(e=i()).done;){var r=e.value,n=r.getComponent(nV);n&&eK(n.frameClipMasks,this),this.setClipRectangleRecursive(r)}},i}(nV),t.FrameComponent=eW([iK("FrameComponent")],t.FrameComponent);var sG=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.canvasItems=[],e.layer=0,e}iG(e,t);var i=e.prototype;return i.addCanvasItem=function(t){this.canvasItems.includes(t)||this.canvasItems.push(t)},i.removeCanvasItem=function(t){eQ(this.canvasItems,t)},i.onEnable=function(){var t,e=null==(t=this.item.composition)?void 0:t.canvasLayers;e&&!e.includes(this)&&e.push(this)},i.onDisable=function(){this.removeFromComposition(),this.refreshCanvasItemsLayer()},i.removeFromComposition=function(){var t,e=null==(t=this.item.composition)?void 0:t.canvasLayers;e&&eQ(e,this)},i.refreshCanvasItemsLayer=function(){var t=this.canvasItems.slice();this.canvasItems.length=0;for(var e,i=iH(t);!(e=i()).done;)e.value.updateCanvasLayer()},i.draw=function(){for(var t,e=iH(this.canvasItems);!(t=e()).done;){var i=t.value;i.item.isActive&&i.drawInternal()}},e}(rL),sj=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.parent=null,e.children=[],e.canvasLayerNode=null,e}iG(e,t);var i=e.prototype;return i.onEnable=function(){this.updateCanvasLayer(),this.updateParentItem()},i.onDisable=function(){},i.onParentChanged=function(){this.updateCanvasLayer(),this.updateParentItem()},i.onDestroy=function(){this.removeFromParent(),this.removeFromCanvasLayer(),this.enabled=!1,this.updateChildrenParentItems()},i.updateCanvasLayer=function(){if(!this.item){this.removeFromCanvasLayer();return}var t=this.getCanvasLayerNode();t!==this.canvasLayerNode&&(null===this.parent&&this.canvasLayerNode&&this.canvasLayerNode.removeCanvasItem(this),this.canvasLayerNode=t,null===this.parent&&t&&t.addCanvasItem(this))},i.updateParentItem=function(){if(!this.item){this.removeFromParent();return}var t=this.getParentItem();if(t!==this.parent){var e=null===this.parent;this.removeFromParent(),t?(this.parent=t,t.children.push(this),e&&this.canvasLayerNode&&this.canvasLayerNode.removeCanvasItem(this)):!e&&this.canvasLayerNode&&this.canvasLayerNode.addCanvasItem(this)}},i.draw=function(){},i.drawLine=function(t,e,i,r,n,a){this.engine.graphics.drawLine(t,e,i,r,n,a)},i.drawPolyline=function(t,e,i){this.engine.graphics.drawLines(t,e,i)},i.drawBezier=function(t,e,i,r,n,a,s,o,u,h){this.engine.graphics.drawBezier(t,e,i,r,n,a,s,o,u,h)},i.drawTriangle=function(t,e,i,r,n,a,s,o){this.engine.graphics.drawTriangle(t,e,i,r,n,a,s,o)},i.drawRect=function(t,e,i,r,n,a){this.engine.graphics.drawRectangle(t,e,i,r,n,a)},i.drawCircle=function(t,e,i,r,n){this.engine.graphics.drawCircle(t,e,i,r,n)},i.fillTriangle=function(t,e,i,r,n,a,s){this.engine.graphics.fillTriangle(t,e,i,r,n,a,s)},i.fillRect=function(t,e,i,r,n){this.engine.graphics.fillRectangle(t,e,i,r,n)},i.fillCircle=function(t,e,i,r){this.engine.graphics.fillCircle(t,e,i,r)},i.drawTexture=function(t,e,i,r,n,a,s){this.engine.graphics.drawTexture(t,e,i,r,n,a,s)},i.drawText=function(t,e,i,r,n,a,s,o){this.engine.graphics.drawText(t,e,i,r,n,a,s,o)},i.drawInternal=function(){var t=this.engine.graphics,e=this.transform.getMatrix2D();t.pushTransform(e),this.enabled&&this.draw();for(var i,r=iH(this.children);!(i=r()).done;){var n=i.value;n.item.isActive&&n.drawInternal()}t.popTransform()},i.removeFromCanvasLayer=function(){this.canvasLayerNode&&(null===this.parent&&this.canvasLayerNode.removeCanvasItem(this),this.canvasLayerNode=null)},i.removeFromParent=function(){this.parent&&(eQ(this.parent.children,this),this.parent=null)},i.updateChildrenParentItems=function(){if(0!==this.children.length)for(var t,e=this.children.slice(),i=iH(e);!(t=i()).done;)t.value.updateParentItem()},i.getCanvasLayerNode=function(){for(var t=this.item;t;){var e,i=function(t){for(var e,i=iH(t.components);!(e=i()).done;){var r=e.value;if(ej(r,sG)&&r.isActiveAndEnabled)return r}return null}(t);if(i)return i;t=null!=(e=t.parent)?e:null}return null},i.getParentItem=function(){for(var t=null!=(i=null==(e=this.item)?void 0:e.parent)?i:null;t;){var e,i,r,n=function(t){for(var e,i=iH(t.components);!(e=i()).done;){var r=e.value;if(ej(r,sj))return r}return null}(t);if(n)return n;t=null!=(r=t.parent)?r:null}return null},rV(e,[{key:"canvasLayer",get:function(){return this.canvasLayerNode}}]),e}(rL),sW={topLeft:[0,1,0,1],topRight:[1,1,1,1],bottomLeft:[0,0,0,0],bottomRight:[1,0,1,0],centerLeft:[0,.5,0,.5],centerTop:[.5,1,.5,1],centerRight:[1,.5,1,.5],centerBottom:[.5,0,.5,0],center:[.5,.5,.5,.5],leftWide:[0,0,0,1],topWide:[0,1,1,1],rightWide:[1,0,1,1],bottomWide:[0,0,1,0],vcenterWide:[.5,0,.5,1],hcenterWide:[0,.5,1,.5],fullRect:[0,0,1,1]},sX=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.anchorMin=new e4(0,0),e.anchorMax=new e4(0,0),e.offsetMin=new e4(0,0),e.offsetMax=new e4(0,0),e.pivot=new e4(.5,.5),e}iG(e,t);var i=e.prototype;return i.fromData=function(e){t.prototype.fromData.call(this,e),0!==this.size.x&&0!==this.size.y&&this.pivot.set(this.anchor.x/this.size.x,this.anchor.y/this.size.y),e.anchorMin&&this.setAnchorMin(e.anchorMin.x,e.anchorMin.y),e.anchorMax&&this.setAnchorMax(e.anchorMax.x,e.anchorMax.y),e.offsetMin&&this.setOffsetMin(e.offsetMin.x,e.offsetMin.y),e.offsetMax&&this.setOffsetMax(e.offsetMax.x,e.offsetMax.y)},i.setAnchorMin=function(t,e){(this.anchorMin.x!==t||this.anchorMin.y!==e)&&(this.anchorMin.x=t,this.anchorMin.y=e,this.sizeChanged())},i.setAnchorMax=function(t,e){(this.anchorMax.x!==t||this.anchorMax.y!==e)&&(this.anchorMax.x=t,this.anchorMax.y=e,this.sizeChanged())},i.setOffsetMin=function(t,e){(this.offsetMin.x!==t||this.offsetMin.y!==e)&&(this.offsetMin.x=t,this.offsetMin.y=e,this.sizeChanged())},i.setOffsetMax=function(t,e){(this.offsetMax.x!==t||this.offsetMax.y!==e)&&(this.offsetMax.x=t,this.offsetMax.y=e,this.sizeChanged())},i.setPivot=function(t,e){(this.pivot.x!==t||this.pivot.y!==e)&&(this.pivot.x=t,this.pivot.y=e,this.anchor.set(this.pivot.x*this.size.x,this.pivot.y*this.size.y,this.anchor.z))},i.setPosition=function(i,r,n,a){if(void 0===a&&(a=!1),!ej(this.parentTransform,e)){t.prototype.setPosition.call(this,i,r,n),this.sizeChanged();return}var s={position:new e4(0,0),size:this.parentTransform.size.clone()},o={position:new e4(i,r),size:this.size.clone()};a?this.computeAnchors(o,s):this.computeOffsets(o,s),this.sizeChanged(),this.position.z!==n&&t.prototype.setPosition.call(this,this.position.x,this.position.y,n)},i.setSize=function(i,r){if(this.size.x!==i||this.size.y!==r){if(!ej(this.parentTransform,e)){t.prototype.setSize.call(this,i,r),this.sizeChanged();return}var n=i-this.size.x,a=r-this.size.y;this.offsetMin.set(this.offsetMin.x-this.pivot.x*n,this.offsetMin.y-this.pivot.y*a),this.offsetMax.set(this.offsetMax.x+(1-this.pivot.x)*n,this.offsetMax.y+(1-this.pivot.y)*a),this.sizeChanged()}},i.getRect=function(){return{position:new e4(this.position.x,this.position.y),size:this.size.clone()}},i.onParentTransformChanged=function(t,i){ej(t,e)&&this.engine.off("resize",this.onCanvasResize.bind(this)),ej(i,e)||(this.onCanvasResize(),this.engine.on("resize",this.onCanvasResize.bind(this))),this.sizeChanged()},i.onCanvasResize=function(){var t=this.engine.canvas.getBoundingClientRect();this.setSize(t.width,t.height)},i.sizeChanged=function(){if(ej(this.parentTransform,e)){var i=this.parentTransform.size,r=this.offsetMin.x+this.anchorMin.x*i.x,n=this.offsetMin.y+this.anchorMin.y*i.y,a=this.offsetMax.x+this.anchorMax.x*i.x,s=this.offsetMax.y+this.anchorMax.y*i.y;t.prototype.setPosition.call(this,r,n,this.position.z),t.prototype.setSize.call(this,a-r,s-n)}this.anchor.set(this.pivot.x*this.size.x,this.pivot.y*this.size.y,this.anchor.z);for(var o,u=iH(this.children);!(o=u()).done;){var h=o.value;ej(h,e)&&h.sizeChanged()}},i.computeOffsets=function(t,e){this.offsetMin.set(t.position.x-e.position.x-this.anchorMin.x*e.size.x,t.position.y-e.position.y-this.anchorMin.y*e.size.y),this.offsetMax.set(t.position.x+t.size.x-e.position.x-this.anchorMax.x*e.size.x,t.position.y+t.size.y-e.position.y-this.anchorMax.y*e.size.y)},i.computeAnchors=function(t,e){if(0!==e.size.x){var i=(t.position.x-e.position.x-this.offsetMin.x)/e.size.x,r=(t.position.x+t.size.x-e.position.x-this.offsetMax.x)/e.size.x;this.anchorMin.x=i,this.anchorMax.x=r}if(0!==e.size.y){var n=(t.position.y-e.position.y-this.offsetMin.y)/e.size.y,a=(t.position.y+t.size.y-e.position.y-this.offsetMax.y)/e.size.y;this.anchorMin.y=n,this.anchorMax.y=a}},i.setAnchorsPreset=function(t,i){void 0===i&&(i=!0);var r=sW[t],n=r[0],a=r[1],s=r[2],o=r[3];if(i)this.anchorMin.set(n,a),this.anchorMax.set(s,o);else if(ej(this.parentTransform,e)){var u={position:new e4(0,0),size:this.parentTransform.size.clone()},h=this.getRect();this.anchorMin.set(n,a),this.anchorMax.set(s,o),this.computeOffsets(h,u)}else this.anchorMin.set(n,a),this.anchorMax.set(s,o);this.sizeChanged()},i.setOffsetsPreset=function(t,i){if(void 0===i&&(i=0),ej(this.parentTransform,e)){var r=this.size.x,n=this.size.y,a=this.anchorMin,s=this.anchorMax,o=this.parentTransform.size.x,u=this.parentTransform.size.y,h=0,l=0,c=0,f=0;switch(t){case"topLeft":case"bottomLeft":case"centerLeft":case"topWide":case"bottomWide":case"leftWide":case"hcenterWide":case"fullRect":h=i-a.x*o,l=i+r-s.x*o;break;case"centerTop":case"centerBottom":case"center":case"vcenterWide":h=.5*o-r/2-a.x*o,l=.5*o+r/2-s.x*o;break;case"topRight":case"bottomRight":case"centerRight":case"rightWide":h=o-i-r-a.x*o,l=o-i-s.x*o}switch(t){case"bottomLeft":case"bottomRight":case"centerBottom":case"leftWide":case"rightWide":case"bottomWide":case"vcenterWide":case"fullRect":c=i-a.y*u,f=i+n-s.y*u;break;case"centerLeft":case"centerRight":case"center":case"hcenterWide":c=.5*u-n/2-a.y*u,f=.5*u+n/2-s.y*u;break;case"topLeft":case"topRight":case"centerTop":case"topWide":c=u-i-n-a.y*u,f=u-i-s.y*u}this.offsetMin.set(h,c),this.offsetMax.set(l,f),this.sizeChanged()}},i.setAnchorsAndOffsetsPreset=function(t,e){void 0===e&&(e=0),this.setAnchorsPreset(t,!1),this.setOffsetsPreset(t,e)},e.fromTransform=function(t){if(ej(t,e))return t;var i=new e;return i.engine=t.engine,i.name=t.name,i.position.copyFrom(t.position),i.quat.copyFrom(t.quat),i.rotation.copyFrom(t.rotation),i.scale.copyFrom(t.scale),i.size.copyFrom(t.size),i.anchor.set(i.pivot.x*i.size.x,i.pivot.y*i.size.y,t.anchor.z),t.parentTransform&&(i.parentTransform=t.parentTransform),i},e}(nU),sH=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.onAwake=function(){var t=this.item;ej(t.transform,sX)||(t.transform=sX.fromTransform(t.transform))},e}(sj);function sY(t){return(sY=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function sZ(t){var e="function"==typeof Map?new Map:void 0;return(sZ=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return aE(t,arguments,sY(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),iU(i,t)})(t)}t.CameraController=function(t){function e(e,i){var r;return r=t.call(this,e)||this,i&&r.fromData(i),r}iG(e,t);var i=e.prototype;return i.onUpdate=function(){if(this.item.composition&&this.item.transform.getValid()){var t=this.item.composition.camera;t.near=this.options.near,t.far=this.options.far,t.fov=this.options.fov,t.clipMode=this.options.clipMode,t.transform.parentTransform=this.transform.parentTransform,t.position=this.transform.position,t.setQuat(this.transform.getQuaternion().clone().conjugate())}},i.fromData=function(e){t.prototype.fromData.call(this,e),this.options=e.options},e}(rL),t.CameraController=eW([iK(ey.CameraController)],t.CameraController);var sq=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(sZ(iB)),sK="click",sQ="touchstart",sJ="touchmove",s$="touchend";t.PointerEventType=void 0,(tP=t.PointerEventType||(t.PointerEventType={}))[tP.PointerDown=0]="PointerDown",tP[tP.PointerUp=1]="PointerUp",tP[tP.PointerMove=2]="PointerMove";var s0=function(){function t(t,e){void 0===e&&(e=!1),this.engine=t,this.allowPropagation=e,this.enabled=!0,this.skipPointerMovePicking=!0,this.handlers={},this.nativeHandlers={},this.target=null}var e=t.prototype;return e.bindListeners=function(t){var e,i,r,n,a,s,o=this;this.target=t,a=function(t){return t};var u="mousedown",h="mousemove",l="mouseup",c="mouseleave",f=function(t,e,i,r,a){void 0===r&&(r=0),void 0===a&&(a=0);var s=0,u=0,h=performance.now();if(!o.target)return iT.warn("Trigger TouchEvent after EventSystem is disposed."),{x:e,y:i,vx:0,vy:u,dx:r,dy:a,ts:h,width:0,height:0,origin:t};var l=o.target,c=l.width,f=l.height;if(n){var d=h-n.ts;s=(r-n.dx)/d||0,u=(a-n.dy)/d||0,n={dx:r,dy:a,ts:h}}return{x:e,y:i,vx:s,vy:u,dx:r,dy:a,ts:h,width:c,height:f,origin:t}};ih()&&(a=function(t){var e=t.touches,i=t.changedTouches;return e[0]||i[0]},u="touchstart",h="touchmove",l="touchend",c="touchcancel"),this.nativeHandlers=((s={})[u]=function(t){if(o.enabled){var s=a(t),u=s1(s);e=u.x,i=u.y,n=r={clientX:s.clientX,clientY:s.clientY,ts:performance.now(),x:e,y:i},o.dispatchEvent(sQ,f(t,e,i))}},s[h]=function(t){if(r&&o.enabled){var n=s1(a(t));e=n.x,i=n.y,o.dispatchEvent(sJ,f(t,e,i,e-r.x,i-r.y))}},s[l]=function(t){if(r&&o.enabled){!o.allowPropagation&&t.cancelable&&(t.preventDefault(),t.stopPropagation());var n=a(t),s=s1(n),u=Math.abs(r.clientX-n.clientX)+Math.abs(r.clientY-n.clientY);e=s.x,i=s.y,u<4&&o.dispatchEvent(sK,f(t,e,i)),o.dispatchEvent(s$,f(t,e,i,e-r.x,i-r.y))}r=0},s),this.nativeHandlers[c]=this.nativeHandlers[l],Object.keys(this.nativeHandlers).forEach(function(t){var e;null==(e=o.target)||e.addEventListener(String(t),o.nativeHandlers[t])}),this.addEventListener(sK,this.onClick.bind(this)),this.addEventListener(sQ,this.onPointerDown.bind(this)),this.addEventListener(s$,this.onPointerUp.bind(this)),this.addEventListener(sJ,this.onPointerMove.bind(this))},e.dispatchEvent=function(t,e){var i=this.handlers[t];null==i||i.forEach(function(t){return t(e)})},e.addEventListener=function(t,e){var i=this.handlers[t];return i||(i=this.handlers[t]=[]),eK(i,e),function(){eQ(i,e)}},e.removeEventListener=function(t,e){var i=this.handlers[t];i&&eQ(i,e)},e.onClick=function(t){for(var e,i=t.x,r=t.y,n=[],a=iH(this.engine.compositions);!(e=a()).done;){var s=e.value;n.push.apply(n,[].concat(s.hitTest(i,r)))}for(var o,u=iH(n);!(o=u()).done;){var h=o.value,l=h.item.composition;if(l){var c=re({},h,{compositionId:l.id,compositionName:l.name});h.item.emit("click",h),l.emit("click",c),this.engine.emit("click",c)}}},e.onPointerDown=function(t){this.handlePointerEvent(t,0)},e.onPointerUp=function(t){this.handlePointerEvent(t,1)},e.onPointerMove=function(t){this.handlePointerEvent(t,2)},e.handlePointerEvent=function(t,e){var i=null,r=t.x,n=t.y,a=t.width,s=t.height;if(!(2===e&&this.skipPointerMovePicking))for(var o,u=iH(this.engine.compositions);!(o=u()).done;){var h=o.value.hitTest(r,n);h.length>0&&(i=h[h.length-1])}var l=new nP;l.position.x=(r+1)/2*a,l.position.y=(n+1)/2*s,l.delta.x=t.vx*a,l.delta.y=t.vy*s;var c=l.pointerCurrentRaycast;i&&(c.point=i.position,c.item=i.item);var f="pointerdown";switch(e){case 0:f="pointerdown";break;case 1:f="pointerup";break;case 2:f="pointermove"}if(i){var d=i.item,p=d.composition;d.emit(f,l),p.emit(f,l),this.engine.emit(f,l)}},e.dispose=function(){var t=this;this.target&&(this.handlers={},Object.keys(this.nativeHandlers).forEach(function(e){var i;null==(i=t.target)||i.removeEventListener(String(e),t.nativeHandlers[e])}),this.nativeHandlers={})},t}();function s1(t){var e=t.target,i=t.clientX,r=t.clientY,n=e.getBoundingClientRect(),a=n.left,s=n.top;return{x:(i-a)/n.width*2-1,y:1-(r-s)/n.height*2}}var s2=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(sZ(iB)),s3=1,s4=function(){function e(t,e,i){this.transform=e,this.engine=i,this.color=t.options.previewColor;var r=this.createMaterial(),n=this.createGeometry();this.mesh=this.createMesh(n,r),this.updateMesh()}var i=e.prototype;return i.updateMesh=function(){var t=this.mesh.material,e=t.getVector2("uSize").clone(),i=t.getVector4("uPos").clone(),r=new e5,n=new rn,a=this.transform.scale.clone();this.transform.assignWorldTRS(r,n,a),e.x=a.x,e.y=a.y,i.x=r.x,i.y=r.y,i.z=r.z,t.setVector2("uSize",e),t.setVector4("uPos",i),t.setQuaternion("uQuat",n)},i.createMaterial=function(){var e=[["ENV_EDITOR",this.engine.env===nL]],i=aI(this.color).getValue(0),r={shader:{vertex:"\nprecision highp float;\n\nattribute vec2 aPos;\nuniform vec4 uPos;\nuniform vec2 uSize;\nuniform vec4 uQuat;\nuniform vec4 uColor;\nuniform mat4 effects_ObjectToWorld;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_MatrixVP;\nvarying vec4 vColor;\n\nvec3 rotateByQuat(vec3 a, vec4 quat){\n vec3 qvec = quat.xyz;\n vec3 uv = cross(qvec, a);\n vec3 uuv = cross(qvec, uv) * 2.;\n return a +(uv * 2. * quat.w + uuv);\n}\n\nvoid main() {\n vec4 _pos = uPos;\n vec3 point = rotateByQuat(vec3(aPos.xy * uSize, 0.),uQuat);\n vec4 pos = vec4(_pos.xyz, 1.0);\n pos = effects_ObjectToWorld * pos;\n pos.xyz += effects_MatrixInvV[0].xyz * point.x+ effects_MatrixInvV[1].xyz * point.y;\n gl_Position = effects_MatrixVP * pos;\n vColor = uColor;\n}\n",fragment:"\nprecision highp float;\n\n#define fragColor gl_FragColor\n\nvarying vec4 vColor;\nvoid main() {\n gl_FragColor = vColor*vColor.a;\n}\n",glslVersion:t.GLSLVersion.GLSL1,macros:e}},n=nb.create(this.engine,r);return n.blending=!0,n.depthTest=!1,n.setVector4("uPos",new e6(0,0,0,0)),n.setVector2("uSize",new e4(1,1)),n.setVector4("uColor",new e6(i[0]/255,i[1]/255,i[2]/255,i[3])),n.setQuaternion("uQuat",new rn(0,0,0,0)),n},i.createGeometry=function(){var t,e=new Uint16Array([0,1,1,2,2,3,3,0]);return a1.create(this.engine,{attributes:((t={})[nA.PositionKind]={size:2,offset:0,stride:2*Float32Array.BYTES_PER_ELEMENT,data:new Float32Array([-.5,.5,.5,.5,.5,-.5,-.5,-.5])},t),drawCount:e.length,indices:{data:e},mode:rD.LINES,maxVertex:4})},i.createMesh=function(t,e){return si.create(this.engine,{name:"Interact_preview"+s3++,priority:0,worldMatrix:nl.fromIdentity(),geometry:t,material:e})},e}();function s5(t,e){var i=1e-5*(e||1);return t&&Math.abs(t.vx||0)<i&&Math.abs(t.vy||0)<i}t.InteractComponent=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.downgrade=.95,t.speed=25,t.dragRatio=[1,1],t.dragRange={dxRange:[0,0],dyRange:[0,0]},t.invalidBorderRange=0,t.invalidByBorderRange=!1,t.duringPlay=!1,t._interactive=!0,t.lastTime=-1,t.getHitTestParams=function(e){if(t.clickable){var i=t.item.props.content.options.behavior,r=t.getBoundingBox();if(r)return{type:r.type,triangles:r.area,behavior:i,clipMasks:t.frameClipMasks}}},t}iG(i,e);var r=i.prototype;return r.getDragRangeX=function(){return this.dragRange.dxRange},r.setDragRangeX=function(t,e){this.dragRange.dxRange=[t,e]},r.getDragRangeY=function(){return this.dragRange.dyRange},r.setDragRangeY=function(t,e){this.dragRange.dyRange=[t,e]},r.onStart=function(){var t=this.item.engine.env,e=this.interactData.options,i=e.type,r=e.showPreview;i===tH.CLICK&&(this.clickable=!0,r&&t===nL&&(this.previewContent=new s4(this.item.props.content,this.transform,this.engine))),this.previewContent&&(this.previewContent.mesh.item=this.item,this.materials=this.previewContent.mesh.materials),this.item.getHitTestParams=this.getHitTestParams},r.onDisable=function(){e.prototype.onDisable.call(this),this.item&&this.item.composition&&(this.duringPlay&&!this.item.transform.getValid()&&this.item.composition.getSpeed()>0&&(this.item.composition.removeInteractiveItem(this.item,this.item.props.content.options.type),this.duringPlay=!1),this.clickable=!1,this.endDragTarget())},r.onEnable=function(){e.prototype.onEnable.call(this);var t=this.interactData.options.type,i=this.item.engine.env;if(t===tH.CLICK)this.clickable=!0;else if(t===tH.DRAG){var r=this.interactData.options,n=r.enableInEditor;if(i!==nL||n){var a,s=(null!=(a=this.item.composition)?a:{}).event;s&&this.beginDragTarget(r,s)}}},r.onUpdate=function(t){var e;if(this.duringPlay=!0,this.lastTime<=this.item.time){if(this.item.time>=0&&this.lastTime<0){var i,r=this.item.props.content.options;null==(i=this.item.composition)||i.addInteractiveItem(this.item,r.type)}}else if(this.item.time>=0&&t>0){var n,a=this.item.props.content.options;null==(n=this.item.composition)||n.addInteractiveItem(this.item,a.type)}this.lastTime=this.item.time,null==(e=this.previewContent)||e.updateMesh(),this.dragEvent&&this.bouncingArg&&(this.bouncingArg.vx*=this.downgrade,this.bouncingArg.vy*=this.downgrade,this.bouncingArg.dy+=this.bouncingArg.vy,this.bouncingArg.dx+=this.bouncingArg.vx,s5(this.bouncingArg)?(this.dragEvent=null,this.bouncingArg=null):this.handleDragMove(this.dragEvent,this.bouncingArg))},r.render=function(t){this.previewContent&&this.previewContent.mesh.render(t)},r.onDestroy=function(){var t;null==(t=this.previewContent)||t.mesh.dispose()},r.endDragTarget=function(){},r.handleDragMove=function(t,e){if((null==t?void 0:t.cameraParam)&&this.canInteract()&&this.item.composition){var i,r,n=t.cameraParam,a=n.position,s=n.fov,o=e.dy,u=e.dx*e.width/e.height,h=a[2],l=Math.tan(s*Math.PI/180/2)*Math.abs(h),c=this.dragRange,f=c.dxRange,d=c.dyRange,p=a[0]-this.dragRatio[0]*(u*l),m=a[1]-this.dragRatio[1]*(o*l),v=f[0],y=f[1],g=d[0],x=d[1];p=e3(p,v,y),m=e3(m,g,x),p!==v&&p!==y&&v!==y&&(null==(i=e.origin)||i.preventDefault()),m!==g&&m!==x&&g!==x&&(null==(r=e.origin)||r.preventDefault()),this.item.composition.camera.position=new e5(p,m,h)}},r.beginDragTarget=function(t,e){var r,n=this;if("camera"===t.target){var a={touchstart:function(t){if(n.canInteract()&&(n.invalidByBorderRange=n.checkInvalidBorderRange({x:t.x,y:t.y}),!n.invalidByBorderRange)){n.dragEvent=null,n.bouncingArg=null;var e,i=null==(e=n.item.composition)?void 0:e.camera;r={x:t.x,y:t.y,cameraParam:{position:(null==i?void 0:i.position.toArray())||[0,0,8],fov:(null==i?void 0:i.fov)||60}}}},touchmove:function(t){n.invalidByBorderRange||(n.handleDragMove(r,t),n.bouncingArg=t)},touchend:function(t){if(n.canInteract()){var e=n.bouncingArg;!s5(e,3)&&e&&(e.vx*=n.speed,e.vy*=n.speed,n.dragEvent=re({},r)),r=null}}};Object.keys(a).forEach(function(t){e.addEventListener(t,a[t])}),a.touchmove({dx:0,dy:0,width:1,height:1}),this.item.getComponent(i).endDragTarget=function(){Object.keys(a).forEach(function(t){e.removeEventListener(t,a[t])})}}},r.getBoundingBox=function(){var e=this.transform.getWorldMatrix(),i=nJ(e5.ZERO,.5*this.transform.size.x,.5*this.transform.size.y);return i.forEach(function(t){e.transformPoint(t.p0),e.transformPoint(t.p1),e.transformPoint(t.p2)}),{type:t.HitTestType.triangle,area:i}},r.fromData=function(t){if(e.prototype.fromData.call(this,t),this.interactData=t,t.options.type===tH.DRAG){var i=t.options;i.dxRange&&(this.dragRange.dxRange=i.dxRange),i.dyRange&&(this.dragRange.dyRange=i.dyRange)}},r.canInteract=function(){var t;return!!(null==(t=this.item.composition)?void 0:t.interactive)&&this._interactive},r.checkInvalidBorderRange=function(t){var e=this.invalidBorderRange;if(e){var i,r,n,a,s=0,o=0,u=0,h=0;if("number"==typeof e?(s=e,o=e,u=e,h=e):iS(e)&&(s=void 0===(i=e[0])?0:i,o=void 0===(r=e[1])?0:r,u=void 0===(n=e[2])?0:n,h=void 0===(a=e[3])?0:a),t.x<h-1||t.x>1-o||t.y<s-1||t.y>1-u)return!0}return!1},rV(i,[{key:"interactive",get:function(){return this._interactive},set:function(t){this._interactive=t,t||(this.bouncingArg=null)}}]),i}(nV),t.InteractComponent=eW([iK(ey.InteractComponent)],t.InteractComponent);var s6=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.name="sprite",e}return iG(e,t),e}(sZ(iB));t.SpriteRotation=void 0,(tI=t.SpriteRotation||(t.SpriteRotation={}))[tI.None=0]="None",tI[tI.Rotate90=1]="Rotate90",t.Sprite=function(t){function e(e,i){var r;return(r=t.call(this,e)||this).rect=[0,0,1,1],r.rotation=0,i&&r.fromData(i),r}return iG(e,t),e.prototype.fromData=function(e){var i,r;t.prototype.fromData.call(this,e),this.texture=e.texture?this.engine.findObject(e.texture):this.engine.whiteTexture,this.rect=null!=(i=e.rect)?i:[0,0,1,1],this.rotation=null!=(r=e.rotation)?r:0},e}(i$),t.Sprite=eW([iK("Sprite")],t.Sprite);var s8=function(){function t(){this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1,this.duration=0,this.destroyed=!1,this.playState=0,this.time=0}var e=t.prototype;return e.play=function(){switch(this.playState){case 0:break;case 1:this.playState=0,this.onPlayablePlayFlag=!0,this.onPlayablePauseFlag=!1}},e.pause=function(){0===this.playState&&(this.playState=1,this.onPlayablePauseFlag=!0,this.onPlayablePlayFlag=!1)},e.setTime=function(t){this.time=t},e.getTime=function(){return this.time},e.setDuration=function(t){this.duration=t},e.getDuration=function(){return this.duration},e.getPlayState=function(){return this.playState},e.prepareFrame=function(t){},e.processFrame=function(t){},e.onPlayableDestroy=function(){},e.dispose=function(){this.destroyed||(this.onPlayableDestroy(),this.destroyed=!0)},t}(),s9=function(){function t(){this.context={deltaTime:0,output:this}}var e=t.prototype;return e.setUserData=function(t){this.userData=t},e.getUserData=function(){return this.userData},e.prepareFrame=function(){},e.processFrame=function(){},t}(),s7=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(i$);t.PlayState=void 0,(tR=t.PlayState||(t.PlayState={}))[tR.Playing=0]="Playing",tR[tR.Paused=1]="Paused",tR[tR.Stopped=2]="Stopped";var ot=[1,1,1,1],oe=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.renderColor=[1,1,1,1],t}iG(i,e);var r=i.prototype;return r.processFrame=function(e){var i,r,n,a=e.output.getUserData();if(ej(a,t.VFXItem)){if(this.activeComponent||(this.activeComponent=this.getActiveComponent(a)),!this.activeMaterial){this.activeMaterial=null==(s=this.activeComponent)?void 0:s.material;var s,o,u=null==(o=this.activeMaterial)?void 0:o.getColor("_Color");u&&(this.startColor=u.toArray())}var h=nZ(ot,1),l=this.time/this.getDuration(),c=this.opacityOverLifetime,f=this.colorOverLifetime;f&&(h=e7(f,l,!0),i=!0),c&&(h[3]*=c.getValue(l),i=!0),i&&(nq(this.renderColor,h,this.startColor),null==(n=this.activeMaterial)||null==(r=n.getColor("_Color"))||r.setFromArray(this.renderColor))}},r.create=function(t){this.clipData=t;var e,i=t.colorOverLifetime;return i&&(this.opacityOverLifetime=aI(null!=(e=i.opacity)?e:1),i.color&&i.color[0]===t0.GRADIENT_COLOR&&(this.colorOverLifetime=it(i.color[1]))),this},r.getActiveComponent=function(t){return t.getComponent(sB)},i}(s8),oi=function(){function t(){}return t.prototype.onEvent=function(t,e){},t}(),or=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.onEvent=function(t,e){t.emit("animationevent",e)},e}(sZ(oi));t.AnimationClip=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.duration=0,e.positionCurves=[],e.rotationCurves=[],e.eulerCurves=[],e.scaleCurves=[],e.floatCurves=[],e.colorCurves=[],e.events=[],e}iG(e,t);var i=e.prototype;return i.sampleAnimation=function(t,e){for(var i,r=e3(e,0,this.duration),n=iH(this.positionCurves);!(i=n()).done;){var a=i.value,s=a.keyFrames.getValue(r),o=this.findTarget(t,a.path);null==o||o.transform.setPosition(s.x,s.y,s.z)}for(var u,h=iH(this.rotationCurves);!(u=h()).done;){var l=u.value,c=l.keyFrames.getValue(r),f=this.findTarget(t,l.path);null==f||f.transform.setQuaternion(c.x,c.y,c.z,c.w)}for(var d,p=iH(this.eulerCurves);!(d=p()).done;){var m=d.value,v=m.keyFrames.getValue(r),y=this.findTarget(t,m.path);null==y||y.transform.setRotation(v.x,v.y,v.z)}for(var g,x=iH(this.scaleCurves);!(g=x()).done;){var b=g.value,T=b.keyFrames.getValue(r),E=this.findTarget(t,b.path);null==E||E.transform.setScale(T.x,T.y,T.z)}},i.fromData=function(t){this.positionCurves.length=0,this.scaleCurves.length=0,this.rotationCurves.length=0,this.eulerCurves.length=0,this.floatCurves.length=0,this.colorCurves.length=0;var e=0;if(t.positionCurves)for(var i,r=iH(t.positionCurves);!(i=r()).done;){var n=i.value,a={path:n.path,keyFrames:aI(n.keyFrames)};e=Math.max(e,a.keyFrames.getMaxTime()),this.positionCurves.push(a)}if(t.rotationCurves)for(var s,o=iH(t.rotationCurves);!(s=o()).done;){var u=s.value,h={path:u.path,keyFrames:aI(u.keyFrames)};e=Math.max(e,h.keyFrames.getMaxTime()),this.rotationCurves.push(h)}if(t.eulerCurves)for(var l,c=iH(t.eulerCurves);!(l=c()).done;){var f=l.value,d={path:f.path,keyFrames:aI(f.keyFrames)};e=Math.max(e,d.keyFrames.getMaxTime()),this.eulerCurves.push(d)}if(t.scaleCurves)for(var p,m=iH(t.scaleCurves);!(p=m()).done;){var v=p.value,y={path:v.path,keyFrames:aI(v.keyFrames)};e=Math.max(e,y.keyFrames.getMaxTime()),this.scaleCurves.push(y)}if(t.floatCurves)for(var g,x=iH(t.floatCurves);!(g=x()).done;){var b=g.value,T={path:b.path,keyFrames:aI(b.keyFrames),property:b.property,className:b.className};e=Math.max(e,T.keyFrames.getMaxTime()),this.floatCurves.push(T)}if(t.colorCurves)for(var E,C=iH(t.colorCurves);!(E=C()).done;){var S=E.value,_={path:S.path,keyFrames:aI(S.keyFrames),property:S.property,className:S.className};e=Math.max(e,_.keyFrames.getMaxTime()),this.colorCurves.push(_)}if(void 0!==t.duration?this.duration=t.duration:this.duration=e,t.events)for(var w,M=iH(t.events);!(w=M()).done;){var A,P=w.value,I={name:P.name,startTime:P.startTime,duration:null!=(A=P.duration)?A:0,event:new or};this.events.push(I)}},i.findTarget=function(t,e){for(var i,r=t,n=e.split("."),a=iH(n);!(i=a()).done;){for(var s,o=i.value,u=!1,h=iH(r.children);!(s=h()).done;){var l=s.value;if(l.name===o){r=l,u=!0;break}}if(!u)return}return r},e}(i$),t.AnimationClip=eW([iK(ey.AnimationClip)],t.AnimationClip);var on=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.clipPlayables=[],e.clipWeights=[],e}iG(e,t);var i=e.prototype;return i.processFrame=function(t){for(var e,i=iH(this.clipPlayables);!(e=i()).done;)e.value.processFrame(t);this.evaluate(t)},i.setClipWeight=function(t,e){if(ej(t,s8)){for(var i=0;i<this.clipPlayables.length;i++)if(this.clipPlayables[i]===t){this.clipWeights[i]=e;return}}else this.clipWeights.length<t+1&&(this.clipWeights.length=t+1),this.clipWeights[t]=e},i.getClipWeight=function(t){return this.clipWeights[t]},i.getClipPlayable=function(t){return this.clipPlayables[t]},i.evaluate=function(t){},e}(s8),oa=function(e){function i(){return e.apply(this,arguments)}return iG(i,e),i.prototype.evaluate=function(e){var i=e.output.getUserData();if(ej(i,t.VFXItem)){for(var r=!1,n=0;n<this.clipPlayables.length;n++)if(this.getClipWeight(n)>0){r=!0;break}r?(i.transform.setValid(!0),i.setActive(!0)):(i.transform.setValid(!1),i.setActive(!1))}},i}(on),os=function(e){function i(){return e.apply(this,arguments)}return iG(i,e),i.prototype.processFrame=function(e){var i=e.output.getUserData();ej(i,t.VFXItem)&&(i.time=this.time)},i}(s8),oo=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.processFrame=function(t){this.value=this.curve.getValue(this.time/this.getDuration())},e}(s8),ou=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.propertyPath="",e.propertyName="",e}iG(e,t);var i=e.prototype;return i.evaluate=function(t){var e=t.output.getUserData();if(e){this.directTarget||this.preparePath(e);var i=!1;if(this.propertyValue=this.directTarget[this.propertyName],void 0!==this.propertyValue&&null!==this.propertyValue){this.resetPropertyValue();for(var r=0;r<this.clipPlayables.length;r++){var n=this.getClipWeight(r);if(n>0){var a=this.getClipPlayable(r);if(!ej(a,oo)){console.error("PropertyTrack added non-PropertyPlayableAsset");continue}var s=a.value;this.addWeightedValue(s,n),i=!0}}i&&(this.directTarget[this.propertyName]=this.propertyValue,ej(e,rL)&&e.onApplyAnimationProperties())}}},i.preparePath=function(t){for(var e=this.propertyPath.split("."),i=t,r=0;r<e.length-1;r++){var n=i[e[r]];void 0===n&&console.error("The "+e[r]+" property of "+t+" was not found"),i=n}e.length>0&&(this.propertyName=e[e.length-1]),this.directTarget=i},e}(on),oh=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.setZero()},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.r+=t.r*e,i.g+=t.g*e,i.b+=t.b*e,i.a+=t.a*e},e}(ou),ol=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue=0},i.addWeightedValue=function(t,e){this.propertyValue+=t*e},e}(ou),oc=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.evaluate=function(t){},e}(on),of=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.evaluate=function(t){},e}(on),od=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.evaluate=function(t){var e=t.output.getUserData();if(e){for(var i=0;i<this.clipPlayables.length;i++)if(this.getClipWeight(i)>0){var r=this.getClipPlayable(i);ej(r,oo)&&r.value&&(e.sprite=r.value);break}}},e}(on),op=function(e){function i(){return e.apply(this,arguments)}return iG(i,e),i.prototype.processFrame=function(e){var i=e.output.getUserData();ej(i,t.CompositionComponent)&&i.tick(this.getTime()-i.getTime())},i}(s8),om=function(e){function i(){return e.apply(this,arguments)}return iG(i,e),i.prototype.evaluate=function(e){var i=e.output.getUserData();if(ej(i,t.CompositionComponent)){for(var r=!1,n=0;n<this.clipPlayables.length;n++)if(this.getClipWeight(n)>0){r=!0;break}r?i.item.setActive(!0):i.item.setActive(!1)}},i}(on),ov=function(){function t(){this.hasContribution=!1,this.hasPosition=!1,this.hasRotation=!1,this.hasScale=!1,this.appliedPosition=!1,this.appliedRotation=!1,this.appliedScale=!1,this.outPos=new e5,this.outRot=new nc,this.outScale=new e5(1,1,1),this.weightedRot=new nc}var e=t.prototype;return e.captureBasePose=function(t){this.ensureBasePose(t)},e.getBasePosition=function(){var t;return null==(t=this.basePose)?void 0:t.position},e.resetFrame=function(){this.hasContribution=!1,this.hasPosition=!1,this.hasRotation=!1,this.hasScale=!1},e.addContribution=function(t,e,i){if(!(i<=0)){if(this.ensureBasePose(t),!this.hasContribution){var r=this.basePose;this.outPos.copyFrom(r.position),this.outRot.copyFrom(r.rotation),this.outScale.copyFrom(r.scale),this.hasContribution=!0}e.hasPosition&&(this.hasPosition=!0,this.outPos.x+=e.position.x*i,this.outPos.y+=e.position.y*i,this.outPos.z+=e.position.z*i),e.hasRotation&&(this.hasRotation=!0,this.weightedRot.set(e.rotation.x*i,e.rotation.y*i,e.rotation.z*i,e.rotation.order),this.outRot.addEulers(this.outRot,this.weightedRot)),e.hasScale&&(this.hasScale=!0,this.outScale.x*=Math.pow(e.scale.x,i),this.outScale.y*=Math.pow(e.scale.y,i),this.outScale.z*=Math.pow(e.scale.z,i))}},e.flush=function(t){var e=this.basePose;e&&(this.hasContribution||this.appliedPosition||this.appliedRotation||this.appliedScale)&&(this.hasPosition?(t.transform.setPosition(this.outPos.x,this.outPos.y,this.outPos.z),this.appliedPosition=!0):this.appliedPosition&&(t.transform.setPosition(e.position.x,e.position.y,e.position.z),this.appliedPosition=!1),this.hasRotation?(t.transform.setRotation(this.outRot.x,this.outRot.y,this.outRot.z),this.appliedRotation=!0):this.appliedRotation&&(t.transform.setRotation(e.rotation.x,e.rotation.y,e.rotation.z),this.appliedRotation=!1),this.hasScale?(t.transform.setScale(this.outScale.x,this.outScale.y,this.outScale.z),this.appliedScale=!0):this.appliedScale&&(t.transform.setScale(e.scale.x,e.scale.y,e.scale.z),this.appliedScale=!1))},e.dispose=function(){this.basePose=void 0,this.boundInstanceId=void 0,this.appliedPosition=!1,this.appliedRotation=!1,this.appliedScale=!1,this.resetFrame()},e.ensureBasePose=function(t){if(!this.basePose||this.boundInstanceId!==t.getInstanceId()){var e=t.transform.scale;this.basePose={position:t.transform.position.clone(),rotation:t.transform.getRotation().clone(),scale:new e5(e.x,e.y,e.x)},this.boundInstanceId=t.getInstanceId(),this.appliedPosition=!1,this.appliedRotation=!1,this.appliedScale=!1}},t}(),oy=new nc,og=new e5,ox=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.started=!1,t.contribution={hasPosition:!1,position:new e5,hasRotation:!1,rotation:new nc,hasScale:!1,scale:new e5(1,1,1)},t}iG(i,e);var r=i.prototype;return r.start=function(){var t,e=this.data.positionOverLifetime,i=this.data.rotationOverLifetime,r=this.data.sizeOverLifetime;if(e&&0!==Object.keys(e).length){this.positionOverLifetime=e,e.path&&(this.pathGetter=aI(e.path));var n=e.linearX||e.linearY||e.linearZ;n&&(this.linearVelOverLifetime={x:e.linearX&&aI(e.linearX),y:e.linearY&&aI(e.linearY),z:e.linearZ&&aI(e.linearZ),asMovement:e.asMovement,enabled:!!n});var a=e.orbitalX||e.orbitalY||e.orbitalZ;a&&(this.orbitalVelOverLifetime={x:e.orbitalX&&aI(e.orbitalX),y:e.orbitalY&&aI(e.orbitalY),z:e.orbitalZ&&aI(e.orbitalZ),center:nY(e.orbCenter),asRotation:e.asRotation,enabled:!!a}),this.speedOverLifetime=e.speedOverLifetime&&aI(e.speedOverLifetime)}if(r&&(r.separateAxes?(this.sizeSeparateAxes=!0,this.sizeXOverLifetime=aI(r.x||1),this.sizeYOverLifetime=aI(r.y||1),this.sizeZOverLifetime=aI(r.z||1)):this.sizeXOverLifetime=aI(r.size||1)),i&&(this.rotationOverLifetime={asRotation:i.asRotation,separateAxes:i.separateAxes,z:aI(i.z||0)},i.separateAxes)){var s=this.rotationOverLifetime;s.x=aI(i.x||0),s.y=aI(i.y||0)}this.gravity=e5.fromArray((null==e?void 0:e.gravity)||[]),this.gravityModifier=aI(null!=(t=null==e?void 0:e.gravityOverLifetime)?t:0),this.direction=(null==e?void 0:e.direction)?e5.fromArray(e.direction).normalize():new e5,this.startSpeed=(null==e?void 0:e.startSpeed)||0,this.velocity=this.direction.clone(),this.velocity.multiply(this.startSpeed)},r.processFrame=function(e){this.ensureStarted();var i=e.output.getUserData();!this.originalTransform&&ej(i,t.VFXItem)&&this.captureOriginalTransform(i)},r.getContribution=function(t){return this.ensureStarted(),this.sampleAnimation(t),this.contribution},r.ensureStarted=function(){this.started||(this.start(),this.started=!0)},r.sampleAnimation=function(t){var e,i=this,r=this.contribution;r.hasPosition=!1,r.hasRotation=!1,r.hasScale=!1;var n=this.getDuration();if(!(n<=0)){var a=this.time/n;if(a=a<0?0:a,this.sizeXOverLifetime?(r.hasScale=!0,r.scale.x=this.sizeXOverLifetime.getValue(a),this.sizeSeparateAxes?(r.scale.y=this.sizeYOverLifetime.getValue(a),r.scale.z=this.sizeZOverLifetime.getValue(a)):r.scale.z=r.scale.y=r.scale.x):r.hasScale=!1,this.rotationOverLifetime){r.hasRotation=!0;var s=function(t){return i.rotationOverLifetime.asRotation?t.getValue(a):t.getIntegrateValue(0,a,n)},o=s(this.rotationOverLifetime.z),u=this.rotationOverLifetime.separateAxes;oy.x=u?s(this.rotationOverLifetime.x):0,oy.y=u?s(this.rotationOverLifetime.y):0,oy.z=o,r.rotation.copyFrom(oy)}else r.hasRotation=!1;this.positionOverLifetime?(r.hasPosition=!0,(null==(e=this.orbitalVelOverLifetime)?void 0:e.enabled)&&t?(nH(r.position,this,this.gravity,this.time,n,t,this.velocity),this.pathGetter&&r.position.add(this.pathGetter.getValue(a)),r.position.subtract(t)):(og.set(0,0,0),nH(r.position,this,this.gravity,this.time,n,og,this.velocity),this.pathGetter&&r.position.add(this.pathGetter.getValue(a)))):r.hasPosition=!1}},r.captureOriginalTransform=function(t){var e=t.transform.scale;this.originalTransform={position:t.transform.position.clone(),rotation:t.transform.getRotation().clone(),scale:new e5(e.x,e.y,e.x)},this.pathGetter&&(this.originalTransform.path=this.pathGetter)},i}(s8);t.TransformPlayableAsset=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.createPlayable=function(){var t=new ox;return t.data=this.transformAnimationData,t},i.fromData=function(t){this.transformAnimationData=t},e}(s7),t.TransformPlayableAsset=eW([iK(ey.TransformPlayableAsset)],t.TransformPlayableAsset);var ob=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.clipMixer=new ov,t}iG(i,e);var r=i.prototype;return r.dispose=function(){this.clipMixer.dispose(),e.prototype.dispose.call(this)},r.evaluate=function(e){var i=e.output.getUserData();if(ej(i,t.VFXItem)){this.clipMixer.captureBasePose(i),this.clipMixer.resetFrame();for(var r=0;r<this.clipPlayables.length;r++){var n=this.clipWeights[r];if(n&&!(n<=0)){var a=this.clipPlayables[r];ej(a,ox)&&this.clipMixer.addContribution(i,a.getContribution(this.clipMixer.getBasePosition()),n)}}this.clipMixer.flush(i)}},i}(on),oT=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0,this.propertyValue.z=0,this.propertyValue.w=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e,i.z+=t.z*e,i.w+=t.w*e},e}(ou),oE=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0,this.propertyValue.z=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e,i.z+=t.z*e},e}(ou),oC=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.resetPropertyValue=function(){this.propertyValue.x=0,this.propertyValue.y=0},i.addWeightedValue=function(t,e){var i=this.propertyValue;i.x+=t.x*e,i.y+=t.y*e},e}(ou),oS=function(){function t(){this.start=0,this.duration=0}return t.prototype.toLocalTime=function(t){var e=t-this.start,i=this.duration;return e-i>0&&(this.endBehavior===t2.restart?e%=i:this.endBehavior===t2.freeze&&(e=Math.min(i,e))),e},t}();t.TrackAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.trackType=0,e.clipSeed=0,e.clips=[],e.children=[],e}iG(e,t);var i=e.prototype;return i.updateAnimatedObject=function(t){return t},i.createTrackMixer=function(){return new on},i.createOutput=function(){return new s9},i.createPlayableGraph=function(t){return this.createMixerPlayableGraph(t)},i.createMixerPlayableGraph=function(t){for(var e,i=[],r=iH(this.clips);!(e=r()).done;){var n=e.value;i.push(n)}return this.compileClips(i,t)},i.compileClips=function(t,e){for(var i,r=this.createTrackMixer(),n=iH(t);!(i=n()).done;){var a=i.value,s=this.createClipPlayable(a);s.setDuration(a.duration);var o=new o_(a,s,r);e.push(o),r.clipPlayables.push(s),r.setClipWeight(s,0)}return r},i.createPlayable=function(){return new s8},i.getChildTracks=function(){return this.children},i.addChild=function(t){this.children.push(t),t.parent=this},i.createClip=function(t,e){var i=new oS;return i.asset=new t(this.engine),i.name=e||"TimelineClip"+i.id,this.addClip(i),i},i.getClips=function(){return this.clips},i.findClip=function(t){for(var e,i=iH(this.clips);!(e=i()).done;){var r=e.value;if(r.name===t)return r}},i.addClip=function(t){t.id=(this.clipSeed++).toString(),this.clips.push(t)},i.createClipPlayable=function(t){return t.asset.createPlayable()},i.fromData=function(e){t.prototype.fromData.call(this,e);for(var i,r=iH(this.children);!(i=r()).done;)i.value.parent=this},e}(s7),eW([iJ(oS,void 0)],t.TrackAsset.prototype,"clips",void 0),eW([iJ(void 0,void 0)],t.TrackAsset.prototype,"children",void 0),t.TrackAsset=eW([iK(ey.TrackAsset)],t.TrackAsset),t.TrackType=void 0,(tO=t.TrackType||(t.TrackType={}))[tO.MasterTrack=0]="MasterTrack",tO[tO.ObjectTrack=1]="ObjectTrack";var o_=function(){function e(t,e,i){this.clip=t,this.playable=e,this.parentMixer=i}return e.prototype.evaluateAt=function(e){var i=this.clip,r=1,n=!1,a=!1;e>=i.start+i.duration&&i.endBehavior===t2.destroy?(r=0,n=!0):e-this.clip.start>=0?(r=1,a=!0):e<i.start&&(r=0),a&&this.playable.getPlayState()!==t.PlayState.Playing&&this.playable.play(),this.parentMixer.setClipWeight(this.playable,r);var s=i.toLocalTime(e);this.playable.setTime(s),n&&this.playable.getPlayState()===t.PlayState.Playing&&this.playable.pause()},rV(e,[{key:"enable",set:function(t){t?this.playable.play():(this.parentMixer.setClipWeight(this.playable,0),this.playable.pause())}}]),e}();t.ActivationTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){return new oa},e}(t.TrackAsset),t.ActivationTrack=eW([iK(ey.ActivationTrack)],t.ActivationTrack);var ow=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.propertyNames=[],e.path="",e}return iG(e,t),e.prototype.fromData=function(e){t.prototype.fromData.call(this,e);var i=this.path.split(".");this.propertyNames=i},e}(t.TrackAsset);eW([iJ(void 0,void 0)],ow.prototype,"path",void 0),t.FloatPropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){var t=new ol;return t.propertyPath=this.path,t},e}(ow),t.FloatPropertyTrack=eW([iK(ey.FloatPropertyTrack)],t.FloatPropertyTrack),t.SpriteColorTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){return new of},e}(t.TrackAsset),t.SpriteColorTrack=eW([iK(ey.SpriteColorTrack)],t.SpriteColorTrack),t.SubCompositionTrack=function(e){function i(){return e.apply(this,arguments)}iG(i,e);var r=i.prototype;return r.updateAnimatedObject=function(e){if(!ej(e,t.VFXItem))throw Error("SubCompositionTrack needs to be set under the VFXItem track.");return e.getComponent(t.CompositionComponent)},r.createTrackMixer=function(){return new om},i}(t.TrackAsset),t.SubCompositionTrack=eW([iK(ey.SubCompositionTrack)],t.SubCompositionTrack),t.TransformTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){return new ob},e}(t.TrackAsset),t.TransformTrack=eW([iK(ey.TransformTrack)],t.TransformTrack),t.MaterialTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.updateAnimatedObject=function(t){if(!ej(t,nV))throw Error("MaterialTrack: expected a RendererComponent bound object.");var e=t.materials;if(this.index>=e.length)throw Error("MaterialTrack: material index "+this.index+" out of bounds (length="+e.length+").");return e[this.index]},e}(t.TrackAsset),eW([iJ(void 0,void 0)],t.MaterialTrack.prototype,"index",void 0),t.MaterialTrack=eW([iK("MaterialTrack")],t.MaterialTrack);var oM=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){return new oc},e}(t.TrackAsset);function oA(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}t.Vector4PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){var t=new oT;return t.propertyPath=this.path,t},e}(ow),t.Vector4PropertyTrack=eW([iK(ey.Vector4PropertyTrack)],t.Vector4PropertyTrack),t.Vector3PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){var t=new oE;return t.propertyPath=this.path,t},e}(ow),t.Vector3PropertyTrack=eW([iK(ey.Vector3PropertyTrack)],t.Vector3PropertyTrack),t.Vector2PropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){var t=new oC;return t.propertyPath=this.path,t},e}(ow),t.Vector2PropertyTrack=eW([iK(ey.Vector2PropertyTrack)],t.Vector2PropertyTrack),t.ColorPropertyTrack=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){var t=new oh;return t.propertyPath=this.path,t},e}(ow),t.ColorPropertyTrack=eW([iK(ey.ColorPropertyTrack)],t.ColorPropertyTrack),t.SpritePropertyTrack=function(e){function i(){return e.apply(this,arguments)}iG(i,e);var r=i.prototype;return r.createTrackMixer=function(){return new od},r.updateAnimatedObject=function(e){return e.getComponent(t.SpriteComponent)},i}(ow),t.SpritePropertyTrack=eW([iK("SpritePropertyTrack")],t.SpritePropertyTrack);var oP=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=oI(this.arc,this.arcMode,t)*e$,i=new e5(Math.cos(e)*this.radius,Math.sin(e)*this.radius,0),r=Math.tan(this.angle*e$),n=i.clone().multiply(r);return n.z+=1,{position:i.multiply(iP(0,1)),direction:n.normalize()}},t}();function oI(t,e,i){if(e===t4.RANDOM)t=iP(0,t);else if(e===t4.UNIDIRECTIONAL_CYCLE){var r=i.index%(i.total+1);t=t/i.total*r}else if(e===t4.BIDIRECTIONAL_CYCLE){var n=i.index/(i.total+1),a=n-Math.floor(n);t*=Math.floor(n)%2?1-a:a}else e===t4.UNIFORM_BURST&&(t=t*i.burstIndex/i.burstCount);return t}var oR=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=oI(this.arc,this.arcMode,t)*e$,i=new e5(Math.cos(e),Math.sin(e),0),r=this.radius;return{direction:i,position:i.clone().multiply(r)}},t}(),oO=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2}return t.prototype.generate=function(t){var e=iP(-this._d,this._d),i=iP(-this._h,this._h);return{direction:new e5(0,0,1),position:new e5(e,i,0)}},t}(),oV=function(){function t(t){this._d=(t.width||1)/2,this._h=(t.height||1)/2,this.arcMode=t.arcMode,this.arc=t.arc}return t.prototype.generate=function(t){var e=oI(this.arc,this.arcMode,t)*e$,i=new e5(Math.cos(e),Math.sin(e),0),r=this._d,n=this._h,a=Math.atan2(n,r),s=Math.tan(e),o=new e5;return e<a?o.set(r,r*s,0):e>=a&&e<Math.PI-a?o.set(n/s,n,0):e<Math.PI+a?o.set(-r,-r*s,0):e<2*Math.PI-a?o.set(-n/s,-n,0):o.set(r,r*s,0),{direction:i,position:o}},t}(),oL=function(){function t(t){this._d=t.width||1,this.arcMode=t.arcMode}return t.prototype.generate=function(t){var e=this.arcMode===t4.UNIFORM_BURST?t.burstIndex%t.burstCount/(t.burstCount-1):iP(0,1);return{direction:new e5(0,1,0),position:new e5(this._d*(e-.5),0,0)}},t}(),oN=new nl,oF=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}return t.prototype.generate=function(t){var e=this.donutRadius,i=this.radius-e,r=iP(0,2*Math.PI),n=oI(this.arc,this.arcMode,t)*e$,a=oN.setFromRotationZ(n),s=new e5(Math.cos(r),Math.sin(r),0),o=new e5(i+Math.cos(r)*e,0,Math.sin(r)*e);return{direction:a.transformNormal(s),position:a.transformPoint(o)}},t}(),oD=new nl,ok=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]})}var e=t.prototype;return e.getHorizontalAngle=function(){return iP(-90,90)},e.generate=function(t){var e=oI(this.arc,this.arcMode,t)*e$,i=this.getHorizontalAngle()*e$,r=this.radius,n=new e5(Math.cos(i),0,Math.sin(i)),a=oD.setFromRotationZ(e).transformNormal(n);return{position:a.clone().multiply(r),direction:a}},t}(),oz=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.getHorizontalAngle=function(){return iP(0,90)},e}(ok),oB=function(){function t(t){var e=t.detail||{anchors:[.5,.5],block:[0,0]};this.anchors=new Float32Array(e.anchors),this.width=t.width||1,this.height=t.height||1,this.block=e.block,this.arcMode=t.arcMode,this.random=e3(t.random||0,0,1)}return t.prototype.generate=function(t){var e=this.anchors,i=Math.floor(oI(e.length/2-1,this.arcMode,t)),r=(e[2*i]+this.block[0]*this.random*Math.random())%1-.5,n=(e[2*i+1]+this.block[1]*this.random*Math.random())%1-.5,a=new e5(r,n,0);return{position:new e5(r*this.width,n*this.height,0),direction:a.normalize()}},t}(),oU=function(){function t(){}return t.prototype.generate=function(){return{position:new e5,direction:new e5}},t}(),oG=((eR={})[tW.NONE]=oU,eR[tW.CONE]=oP,eR[tW.SPHERE]=ok,eR[tW.HEMISPHERE]=oz,eR[tW.CIRCLE]=oR,eR[tW.DONUT]=oF,eR[tW.RECTANGLE]=oO,eR[tW.EDGE]=oL,eR[tW.RECTANGLE_EDGE]=oV,eR[tW.TEXTURE]=oB,eR);function oj(t){if(!t)return new oU;var e=re({radius:1,arc:360,angle:0,arcMode:t4.RANDOM},t),i=t.type,r=oG[i];if(!r)throw Error("Invalid shape: "+i+".");var n=new r(e);if(i!==tW.NONE){var a=t.alignSpeedDirection,s=t.upDirection;n.alignSpeedDirection=a,n.upDirection=e5.fromArray(void 0===s?[0,0,1]:s).normalize()}return n}function oW(t,e,i,r,n){var a,s;if(n===function(t,e,i,r){for(var n=0,a=e,s=i-r;a<i;a+=r)n+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return n}(t,e,i,r)>0)for(a=e;a<i;a+=r)s=o2(a,t[a],t[a+1],s);else for(a=i-r;a>=e;a-=r)s=o2(a,t[a],t[a+1],s);return s&&oK(s,s.next)&&(o3(s),s=s.next),s}function oX(t,e){if(!t)return t;e||(e=t);var i,r=t;do if(i=!1,!r.steiner&&(oK(r,r.next)||0===oq(r.prev,r,r.next))){if(o3(r),(r=e=r.prev)===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}function oH(t,e){return t.x-e.x}function oY(t,e,i,r,n){return(t=((t=((t=((t=((t=32767*(t-i)*n)|t<<8)&16711935)|t<<4)&252645135)|t<<2)&858993459)|t<<1)&1431655765)|(e=((e=((e=((e=((e=32767*(e-r)*n)|e<<8)&16711935)|e<<4)&252645135)|e<<2)&858993459)|e<<1)&1431655765)<<1}function oZ(t,e,i,r,n,a,s,o){return(n-s)*(e-o)-(t-s)*(a-o)>=0&&(t-s)*(r-o)-(i-s)*(e-o)>=0&&(i-s)*(a-o)-(n-s)*(r-o)>=0}function oq(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function oK(t,e){return t.x===e.x&&t.y===e.y}function oQ(t,e,i,r){var n=o$(oq(t,e,i)),a=o$(oq(t,e,r)),s=o$(oq(i,r,t)),o=o$(oq(i,r,e));return!!(n!==a&&s!==o||0===n&&oJ(t,i,e)||0===a&&oJ(t,r,e)||0===s&&oJ(i,t,r)||0===o&&oJ(i,e,r))}function oJ(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function o$(t){return t>0?1:t<0?-1:0}function o0(t,e){return 0>oq(t.prev,t,t.next)?oq(t,e,t.next)>=0&&oq(t,t.prev,e)>=0:0>oq(t,e,t.prev)||0>oq(t,t.next,e)}function o1(t,e){var i=new o4(t.i,t.x,t.y),r=new o4(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function o2(t,e,i,r){var n=new o4(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function o3(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function o4(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var o5=0;function o6(t,e,i,r){i=i||2,o5=r||0;var n,a,s,o,u,h,l,c=e&&e.length,f=c?e[0]*i:t.length,d=oW(t,0,f,i,!0),p=[];if(!d||d.next===d.prev)return p;if(c&&(d=function(t,e,i,r){var n,a,s,o,u,h=[];for(n=0,a=e.length;n<a;n++)s=e[n]*r,o=n<a-1?e[n+1]*r:t.length,(u=oW(t,s,o,r,!1))===u.next&&(u.steiner=!0),h.push(function(t){var e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}(u));for(h.sort(oH),n=0;n<h.length;n++)(function(t,e){if(e=function(t,e){var i,r,n,a=e,s=t.x,o=t.y,u=-1/0;do{if(o<=a.y&&o>=a.next.y&&a.next.y!==a.y){var h=a.x+(o-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(h<=s&&h>u){if(u=h,h===s){if(o===a.y)return a;if(o===a.next.y)return a.next}n=a.x<a.next.x?a:a.next}}a=a.next}while(a!==e);if(!n)return null;if(s===u)return n;var l,c=n,f=n.x,d=n.y,p=1/0;a=n;do s>=a.x&&a.x>=f&&s!==a.x&&oZ(o<d?s:u,o,f,d,o<d?u:s,o,a.x,a.y)&&(l=Math.abs(o-a.y)/(s-a.x),o0(a,t)&&(l<p||l===p&&(a.x>n.x||a.x===n.x&&(i=n,r=a,0>oq(i.prev,i,r.prev)&&0>oq(r.next,i,i.next))))&&(n=a,p=l)),a=a.next;while(a!==c);return n}(t,e)){var i=o1(e,t);oX(e,e.next),oX(i,i.next)}})(h[n],i),i=oX(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=s=t[0],a=o=t[1];for(var m=i;m<f;m+=i)u=t[m],h=t[m+1],u<n&&(n=u),h<a&&(a=h),u>s&&(s=u),h>o&&(o=h);l=0!==(l=Math.max(s-n,o-a))?1/l:0}return function t(e,i,r,n,a,s,o){if(e){!o&&s&&function(t,e,i,r){var n=t;do null===n.z&&(n.z=oY(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,a,s,o,u,h=1;do{for(i=t,t=null,a=null,s=0;i;){for(s++,r=i,o=0,e=0;e<h&&(o++,r=r.nextZ);e++);for(u=h;o>0||u>0&&r;)0!==o&&(0===u||!r||i.z<=r.z)?(n=i,i=i.nextZ,o--):(n=r,r=r.nextZ,u--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;i=r}a.nextZ=null,h*=2}while(s>1)}(n)}(e,n,a,s);for(var u,h,l=e;e.prev!==e.next;){if(u=e.prev,h=e.next,s?function(t,e,i,r){var n=t.prev,a=t.next;if(oq(n,t,a)>=0)return!1;for(var s=n.x<t.x?n.x<a.x?n.x:a.x:t.x<a.x?t.x:a.x,o=n.y<t.y?n.y<a.y?n.y:a.y:t.y<a.y?t.y:a.y,u=n.x>t.x?n.x>a.x?n.x:a.x:t.x>a.x?t.x:a.x,h=n.y>t.y?n.y>a.y?n.y:a.y:t.y>a.y?t.y:a.y,l=oY(s,o,e,i,r),c=oY(u,h,e,i,r),f=t.prevZ,d=t.nextZ;f&&f.z>=l&&d&&d.z<=c;){if(f!==t.prev&&f!==t.next&&oZ(n.x,n.y,t.x,t.y,a.x,a.y,f.x,f.y)&&oq(f.prev,f,f.next)>=0||(f=f.prevZ,d!==t.prev&&d!==t.next&&oZ(n.x,n.y,t.x,t.y,a.x,a.y,d.x,d.y)&&oq(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&oZ(n.x,n.y,t.x,t.y,a.x,a.y,f.x,f.y)&&oq(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=c;){if(d!==t.prev&&d!==t.next&&oZ(n.x,n.y,t.x,t.y,a.x,a.y,d.x,d.y)&&oq(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}(e,n,a,s):function(t){var e=t.prev,i=t.next;if(oq(e,t,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(oZ(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&oq(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}(e)){i.push(u.i/r+o5),i.push(e.i/r+o5),i.push(h.i/r+o5),o3(e),e=h.next,l=h.next;continue}if((e=h)===l){o?1===o?t(e=function(t,e,i){var r=t;do{var n=r.prev,a=r.next.next;!oK(n,a)&&oQ(n,r,r.next,a)&&o0(n,a)&&o0(a,n)&&(e.push(n.i/i+o5),e.push(r.i/i+o5),e.push(a.i/i+o5),o3(r),o3(r.next),r=t=a),r=r.next}while(r!==t);return oX(r)}(oX(e),i,r),i,r,n,a,s,2):2===o&&function(e,i,r,n,a,s){var o=e;do{for(var u,h,l=o.next.next;l!==o.prev;){if(o.i!==l.i&&(u=o,h=l,u.next.i!==h.i&&u.prev.i!==h.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&oQ(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(u,h)&&(o0(u,h)&&o0(h,u)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t);return r}(u,h)&&(oq(u.prev,u,h.prev)||oq(u,h.prev,h))||oK(u,h)&&oq(u.prev,u,u.next)>0&&oq(h.prev,h,h.next)>0))){var c=o1(o,l);o=oX(o,o.next),c=oX(c,c.next),t(o,i,r,n,a,s),t(c,i,r,n,a,s);return}l=l.next}o=o.next}while(o!==e)}(e,i,r,n,a,s):t(oX(e),i,r,n,a,s,1);break}}}}(d,p,i,n,a,l),p}function o8(t,e){for(var i,r,n=t.s,a=t.p,s=n[1],o=a[1],u=0,h=0;h<s.length;h++)u+=s[h].length-1;var l,c=new Float32Array(6*u),f=e.indexBase,d=e.uvTransform,p=0,m=0,v=0,y=1,g=1;d&&(m=d[0],v=d[1],y=(l=d[4])?d[3]:d[2],g=l?d[2]:d[3]);for(var x=[0,0],b=0===l?0:-Math.PI/2,T=0;T<s.length;T++)for(var E=s[T],C=o[T],S=o[T+1]||o[0],_=[0,0],w=0;w<E.length-1;w++)(function(t,e,i,r,n,a,s,o){var u=1-e,h=u*u*u,l=3*e*u*u,c=3*e*e*u,f=e*e*e;t[0]=h*i[0]+l*n+c*s+f*r[0],t[1]=h*i[1]+l*a+c*o+f*r[1]})(_,E[w],C,S,C[4],C[5],S[2],S[3]),i=_[0],r=_[1],c[p++]=i/2,c[p++]=r/2,d?(x[0]=i,x[1]=r,o7(x,x,b),c[p++]=m+(x[0]+1)/2*y,c[p++]=v+(x[1]+1)/2*g):(c[p++]=(i+1)/2,c[p++]=(r+1)/2),p+=2;var M=o6(Array.from(c),null,6,void 0===f?0:f);return{aPoint:c,index:new Uint16Array(M)}}function o9(t,e){for(var i,r=[],n=(i=[],("gs"in t)?t.gs.forEach(function(t){i.push({p:[t0.SHAPE_POINTS,t.p],s:[t0.SHAPE_SPLITS,t.s]})}):("g"in t)?i.push({p:[t0.SHAPE_POINTS,t.g.p],s:[t0.SHAPE_SPLITS,t.g.s]}):i.push(t),i),a=0,s=0,o=0,u=0;u<n.length;u++){var h=o8(n[u],{indexBase:a,uvTransform:e});a+=h.aPoint.length/5,r.push(h),s+=h.aPoint.length,o+=h.index.length}if(1===r.length)return r[0];for(var l=new Float32Array(s),c=new Uint16Array(o),f=0,d=0,p=0;f<r[f];f++){var m=r[f];l.set(m.aPoint,d),d+=m.aPoint.length,c.set(m.index,p),p+=m.index.length}return{aPoint:l,index:c}}function o7(t,e,i){var r=Math.cos(i),n=Math.sin(i),a=e[0],s=e[1];return t[0]=r*a+n*s,t[1]=-n*a+r*s,t}var ut=function(){function t(t){var e=t.time,i=t.interval,r=t.count,n=t.cycles,a=t.probability;this.time=+e||0,this.interval=+i||1,this.count=ej(r,as)?r:aI(r),this.cycles=+n||1/0,this.probability=isNaN(a)?1:+a,this.reset()}var e=t.prototype;return e.getGeneratorOptions=function(t,e){if(t-this.time-this.now>this.interval*this.index&&this.internalCycles>0)return this.internalCycles--,this.index++,Math.random()<=this.probability?{index:this.index,total:1/this.interval,count:this.count.getValue(e),cycleIndex:this.cycles-this.internalCycles-1}:null},e.reset=function(){this.internalCycles=this.cycles,this.index=0,this.now=0},e.clone=function(){return new t({time:this.time,interval:this.interval,count:this.count,cycles:this.cycles,probability:this.probability})},t}(),ue=function(t){this.content=t},ui=function(){function t(t){this.sort=t,this.length=0}var e=t.prototype;return e.findNodeByContent=function(t){var e=this.first;if(e)do if(t(e.content))return e;while(e=e.next)},e.insertNode=function(t,e){var i=t.next;t.next=e,e.pre=t,e.next=i,i&&(i.pre=e)},e.shiftNode=function(t){var e=new ue(t);if(this.length++,1===this.length)return this.first=this.last=e;for(var i=this.first;i;){if(!(0>=this.sort(i.content,e.content)))return i.pre?this.insertNode(i.pre,e):(this.first=e,e.next=i,i.pre=e),e;if(!i.next)return this.insertNode(i,e),this.last=e;i=i.next}},e.pushNode=function(t){var e=new ue(t);if(this.length++,1===this.length)return this.last=this.first=e;for(var i=this.last;i;){if(!(0>=this.sort(e.content,i.content)))return this.insertNode(i,e),i===this.last&&(this.last=e),e;if(this.first===i)return i.pre=e,e.next=i,this.first=e;i=i.pre}},e.removeNode=function(t){var e=this.first;if(this.length--,e===t){var i=this.first=e.next;i&&(i.pre=null)}else if((e=this.last)===t){var r=this.last=e.pre;r&&(r.next=null)}else if(t){var n=t.pre,a=t.next;n.next=a,a&&(a.pre=n)}t.pre=null,t.next=null},e.forEach=function(t,e){var i=this.first,r=0;if(i)do t.call(e||this,i.content,r++);while(i=i.next)},e.forEachReverse=function(t,e){var i=this.last,r=this.length-1;if(i)do t.call(e||this,i.content,r--);while(i=i.pre)},e.getNodeByIndex=function(t){var e=0,i=this.first;if(!i||t>=this.length||t<0)return null;for(;e<t;)i=i.next,e++;return i},t}(),ur=new e5,un=new e5,ua=function(){function e(e,i){var r,n=this;this.pointStart=[],this.attributeData=new Map;var a=i.colorOverLifetime,s=i.colorOverTrail,o=i.maxTrailCount,u=i.opacityOverLifetime,h=void 0===u?aI(1):u,l=i.widthOverTrail,c=i.name,f=i.occlusion,d=i.blending,p=i.texture,m=i.transparentOcclusion,v=i.minimumVertexDistance,y=i.lifetime,g=i.matrix,x=e.gpuCapability,b=x.detail,T=x.level,E=Math.max(i.pointCountPerTrail,2),C=ab(),S=b.maxVertexTextures>0,_=(null!=e?e:{}).env,w={},M=[["ENABLE_VERTEX_TEXTURE",S],["LOOKUP_TEXTURE_CURVE",0],["ENV_EDITOR",_===nL]],A=o>64,P=0;a&&(M.push(["COLOR_OVER_LIFETIME",!0]),P|=1,w.uColorOverLifetime=ne.createWithData(e,id(a))),s&&(M.push(["COLOR_OVER_TRAIL",!0]),P|=4,w.uColorOverTrail=ne.createWithData(e,id(s))),A?(M.push(["ATTR_TRAIL_START",1]),P|=8):w.uTrailStart=new Float32Array(o),w.uOpacityOverLifetimeValue=h.toUniform(C);var I=l.toUniform(C);M.push(["VERT_CURVE_VALUE_COUNT",C.index],["VERT_MAX_KEY_FRAME_COUNT",C.max]),w.uVCurveValues=as.getAllData(C);var R={shader:{vertex:so,fragment:sa,macros:M,glslVersion:1===T?t.GLSLVersion.GLSL1:t.GLSLVersion.GLSL3,shared:!0,name:"trail#"+c,cacheId:"-t:+"+P+"+"+C.index+"+"+C.max}},O=E*o*2,V=(E-1)*o,L=Float32Array.BYTES_PER_ELEMENT,N=12*L,F={attributes:((r={})[nA.ColorKind]={size:4,stride:N,data:new Float32Array(12*O)},r.aSeed={size:1,stride:N,offset:4*L,dataSource:nA.ColorKind},r.aInfo={size:3,stride:N,offset:5*L,dataSource:nA.ColorKind},r[nA.PositionKind]={size:4,stride:N,offset:8*L,dataSource:nA.ColorKind},r.aTime={size:1,data:new Float32Array(O)},r.aDir={size:3,data:new Float32Array(3*O)},r),indices:{data:new Uint16Array(6*O)},drawCount:6*V,name:"trail#"+c,bufferUsage:rD.DYNAMIC_DRAW};if(A)F.attributes.aTrailStart={size:1,data:new Float32Array(O)};else{var D=new Float32Array(O);F.attributes.aTrailStartIndex={size:1,data:D};for(var k=0;k<o;k++)for(var z=2*E,B=k*z,U=0;U<z;U++)D[B+U]=k}var G=rU(d),j=nb.create(e,R);j.blending=!0,j.depthMask=f,j.depthTest=!0,rG(j,d);var W=this.mesh=si.create(e,{name:"MTrail_"+c,material:j,geometry:a1.create(e,F)}),X=null!=p?p:ne.createWithData(e);Object.keys(w).map(function(t){var e=w[t];if(ej(e,ne))j.setTexture(t,e);else if("uTrailStart"===t)j.setFloats("uTrailStart",e);else if("uVCurveValues"===t){for(var i=[],r=0;r<e.length;r+=4){var n=new e6(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}j.setVector4Array(t,i)}else j.setVector4(t,e6.fromArray(e))}),j.setFloat("uTime",0),j.setVector4("uWidthOverTrail",e6.fromArray(I)),j.setVector2("uTexOffset",new e4(0,0)),j.setVector4("uTextureMap",new e6(0,0,1,1)),j.setVector4("uParams",new e6(0,E-1,0,0)),j.setTexture("uMaskTex",X),j.setVector4("uColorParams",new e6(p?1:0,+G,0,+(f&&!m))),this.maxTrailCount=o,this.pointCountPerTrail=E,this.checkVertexDistance=v>0,this.minimumVertexDistance=Math.pow(v||.001,2),this.useAttributeTrailStart=A,this.lifetime=y,g&&(this.mesh.worldMatrix=g),this.geometry=W.firstGeometry(),this.geometry.getAttributeNames().forEach(function(t){var e=n.geometry.getVertexBuffer(t),i=n.geometry.getAttributeData(t);e&&ej(i,Float32Array)&&n.attributeData.set(e.getWrapperBuffer(),i)}),this.trailCursors=new Uint16Array(o)}var i=e.prototype;return i.addPoint=function(t,e,i){i=i||{};var r=this.trailCursors[t],n=this.pointCountPerTrail,a=this.geometry,s=n-1,o=r%n,u=(r-1)%n,h=(r-2)%n,l=this.getTrailPosition(t,u,ur);if(!(l&&this.checkVertexDistance&&(null==l?void 0:l.distanceSquared(e))<this.minimumVertexDistance)){var c=t*n+o,f=uh(l,e),d=i.time||this.time,p=[Math.random(),i.lifetime||this.lifetime,r],m=i.size||1,v=new Float32Array(6);v.set(f,0),v.set(f,3),this.setAttributeSubData("aDir",6*c,v),this.setAttributeSubData("aTime",2*c,new Float32Array([d,d]));var y=i.color||[1,1,1,1],g=new Float32Array(24),x=e.toArray();if(g.set(y,0),g.set(p,4),g[7]=0,g.set(x,8),g[11]=.5*m,g.set(y,12),g.set(p,16),g[19]=1,g.set(x,20),g[23]=-.5*m,this.setAttributeSubData(nA.ColorKind,24*c,g),u>=0){var b=new Float32Array(uh(this.getTrailPosition(t,h,un),l,e)),T=(t*n+u)*6;this.setAttributeSubData("aDir",T,b),this.setAttributeSubData("aDir",T+3,b);var E=t*n*2,C=new Uint16Array([2*u+E,2*u+1+E,2*o+E,2*o+E,2*u+1+E,2*o+1+E]),S=(t*s+(r-1)%s)*6;a.setIndexSubData(S,C)}r=++this.trailCursors[t];var _=this.mesh.material,w=_.getVector4("uParams"),M=p[2];if(this.useAttributeTrailStart){for(var A=2*n,P=new Float32Array(A),I=0;I<A;I++)P[I]=M;this.setAttributeSubData("aTrailStart",t*P.length,P)}else{var R=_.getFloats("uTrailStart");void 0!=R&&(R[t]=M,_.setFloats("uTrailStart",R))}w&&(w.y=Math.max(w.y,r-1)-Math.max(0,r-n),_.setVector4("uParams",w))}},i.getTrailPosition=function(t,e,i){var r=this.pointCountPerTrail;if(e>=0&&e<r){var n=(t*r+e)*24+8,a=this.getAttributeData(nA.ColorKind);return i.x=a[n],i.y=a[1+n],i.z=a[2+n],i}},i.clearAllTrails=function(){var t=this.geometry.getIndexData();iy(t),this.trailCursors=new Uint16Array(this.trailCursors.length),this.geometry.setIndexData(new Uint16Array(t.length))},i.minusTime=function(t){for(var e=this.getAttributeData("aTime"),i=0;i<e.length;i++)e[i]-=t;this.setAttributeData("aTime",e),this.time-=t},i.clearTrail=function(t){if(0!==this.trailCursors[t]){var e=(this.pointCountPerTrail-1)*6,i=this.geometry.getIndexData();iy(i),i.set(new Uint16Array(e),t*e),this.geometry.setIndexData(i),this.trailCursors[t]=0}},i.getPointStartPos=function(t){return this.pointStart[t]},i.setPointStartPos=function(t,e){this.pointStart[t]=e},i.onUpdate=function(t){},i.getAttributeData=function(t){var e=this.geometry.getVertexBuffer(t),i=e&&this.attributeData.get(e.getWrapperBuffer());return iy(i),i},i.setAttributeData=function(t,e){var i=this.geometry.getVertexBuffer(t);iy(i),this.attributeData.set(i.getWrapperBuffer(),e),this.geometry.setAttributeData(t,e)},i.setAttributeSubData=function(t,e,i){this.getAttributeData(t).set(i,e),this.geometry.setAttributeSubData(t,e,i)},i.rebuild=function(){!this.geometry.isInitialized||this.geometry.isDisposed()||this.attributeData.forEach(function(t,e){e.getData()||e.update(t)})},rV(e,[{key:"time",get:function(){return this.mesh.material.getFloat("uTime")||0},set:function(t){this.mesh.material.setFloat("uTime",null!=t?t:0)}}]),e}(),us=new e5,uo=new e5,uu=new e5;function uh(t,e,i){return t||i?(t?i?(uo.subtractVectors(e,t).normalize(),uo.subtractVectors(i,e),uu.copyFrom(uo).normalize(),us.addVectors(uo,uu)):us.subtractVectors(e,t):us.subtractVectors(i,e),us.normalize().toArray()):[0,0,0]}var ul=function(e){function i(){var t;return t=e.apply(this,arguments)||this,t.particleSystem=null,t}iG(i,e);var r=i.prototype;return r.getParticleSystem=function(e){if(this.particleSystem)return this.particleSystem;var i=e.output.getUserData();return ej(i,t.VFXItem)?(this.particleSystem=i.getComponent(t.ParticleSystem),this.particleSystem):null},r.processFrame=function(t){var e=this.getParticleSystem(t);if(e){for(this.time>=0&&this.time<e.time&&e.reset();e.time+.016<this.time;)e.simulate(.016);e.simulate(this.time-e.time)}},i}(s8),uc=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){return new ul},e}(s7),uf={uSprite:"vec4",uParams:"vec4",uAcceleration:"vec4",uGravityModifierValue:"vec4",uOpacityOverLifetimeValue:"vec4",uRXByLifeTimeValue:"vec4",uRYByLifeTimeValue:"vec4",uRZByLifeTimeValue:"vec4",uLinearXByLifetimeValue:"vec4",uLinearYByLifetimeValue:"vec4",uLinearZByLifetimeValue:"vec4",uSpeedLifetimeValue:"vec4",uOrbXByLifetimeValue:"vec4",uOrbYByLifetimeValue:"vec4",uOrbZByLifetimeValue:"vec4",uSizeByLifetimeValue:"vec4",uSizeYByLifetimeValue:"vec4",uColorParams:"vec4",uFSprite:"vec4",uPreviewColor:"vec4",uVCurveValues:"vec4Array",uFCurveValues:"vec4",uFinalTarget:"vec3",uForceCurve:"vec4",uOrbCenter:"vec3",uTexOffset:"vec2",uPeriodValue:"vec4",uMovementValue:"vec4",uStrengthValue:"vec4",uWaveParams:"vec4"},ud=function(){function e(e,i){var r,n,a,s,o,u,h,l,c,f=this;this.particleCount=0,this.cachedRotationVector3=new e5,this.cachedRotationMatrix=new nf,this.cachedLinearMove=new e5,this.tempMatrix3=new nf,this.attributeData=new Map,this.VERT_MAX_KEY_FRAME_COUNT=0;var d=(null!=e?e:{}).env,p=i.speedOverLifetime,m=i.colorOverLifetime,v=i.linearVelOverLifetime,y=i.orbitalVelOverLifetime,g=i.sizeOverLifetime,x=i.rotationOverLifetime,b=i.sprite,T=i.gravityModifier,E=i.maxCount,C=i.textureFlip,S=i.useSprite,_=i.name,w=i.gravity,M=i.forceTarget,A=i.side,P=i.occlusion,I=i.anchor,R=i.blending,O=i.transparentOcclusion,V=i.renderMode,L=void 0===V?0:V,N=i.diffuse,F=void 0===N?ne.createWithData(e):N,D=e.gpuCapability.detail,k=D.halfFloatTexture,z=D.maxVertexUniforms,B=[["RENDER_MODE",+L],["ENV_EDITOR",d===nL]],U=e.gpuCapability.level,G=ab(),j=ab(),W=z>0,X={},H=0,Y=0;if(this.useSprite=S,W&&B.push(["ENABLE_VERTEX_TEXTURE",!0]),p&&(B.push(["SPEED_OVER_LIFETIME",!0]),Y|=2,X.uSpeedLifetimeValue=p.toUniform(G)),(null==b?void 0:b.animate)&&(B.push(["USE_SPRITE",!0]),Y|=4,X.uFSprite=X.uSprite=new Float32Array([b.col,b.row,b.total,b.blend?1:0]),this.useSprite=!0),(null==m?void 0:m.color)&&(B.push(["COLOR_OVER_LIFETIME",!0]),Y|=16,X.uColorOverLifetime=ej(m.color,ne)?m.color:ne.createWithData(e,id(m.color))),(null==m?void 0:m.opacity)?X.uOpacityOverLifetimeValue=m.opacity.toUniform(G):X.uOpacityOverLifetimeValue=aI(1).toUniform(G),["x","y","z"].forEach(function(t,e){var i=0,r=0;(null==v?void 0:v[t])&&(X["uLinear"+t.toUpperCase()+"ByLifetimeValue"]=v[t].toUniform(G),i=1,Y|=1<<7+e,v.enabled=!0),B.push(["LINEAR_VEL_"+t.toUpperCase(),i]),(null==y?void 0:y[t])&&(X["uOrb"+t.toUpperCase()+"ByLifetimeValue"]=y[t].toUniform(G),r=1,Y|=1<<10+e,l=!0,y.enabled=!0),B.push(["ORB_VEL_"+t.toUpperCase(),r])}),(null==v?void 0:v.asMovement)&&(B.push(["AS_LINEAR_MOVEMENT",!0]),Y|=32),l&&((null==y?void 0:y.asRotation)&&(B.push(["AS_ORBITAL_MOVEMENT",!0]),Y|=64),X.uOrbCenter=new Float32Array((null==y?void 0:y.center)||[0,0,0])),X.uSizeByLifetimeValue=null==g?void 0:g.x.toUniform(G),(null==g?void 0:g.separateAxes)&&(B.push(["SIZE_Y_BY_LIFE",1]),Y|=16384,X.uSizeYByLifetimeValue=null==g?void 0:null==(c=g.y)?void 0:c.toUniform(G)),(null==x?void 0:x.z)&&(X.uRZByLifeTimeValue=x.z.toUniform(G),Y|=32768,B.push(["ROT_Z_LIFETIME",1])),(null==x?void 0:x.x)&&(X.uRXByLifeTimeValue=x.x.toUniform(G),Y|=65536,B.push(["ROT_X_LIFETIME",1])),(null==x?void 0:x.y)&&(X.uRYByLifeTimeValue=x.y.toUniform(G),Y|=131072,B.push(["ROT_Y_LIFETIME",1])),(null==x?void 0:x.asRotation)&&(B.push(["ROT_LIFETIME_AS_MOVEMENT",1]),Y|=262144),X.uGravityModifierValue=T.toUniform(G),M&&(B.push(["FINAL_TARGET",!0]),Y|=524288,X.uFinalTarget=new Float32Array(M.target||[0,0,0]),X.uForceCurve=M.curve.toUniform(G)),k&&j.max?(Y|=1048576,X.uFCurveValueTexture=ni(e,as.getAllData(j,!0),j.index,1)):X.uFCurveValues=as.getAllData(j),G.max+G.curves.length-32>z&&k&&W){var Z=ni(e,as.getAllData(G,!0),G.index,1);X.uVCurveValueTexture=Z,H=1}else X.uVCurveValues=as.getAllData(G);var q=["-p:",L,Y,G.index,G.max,j.index,j.max].join("+");B.push(["VERT_CURVE_VALUE_COUNT",G.index],["FRAG_CURVE_VALUE_COUNT",j.index],["VERT_MAX_KEY_FRAME_COUNT",G.max],["FRAG_MAX_KEY_FRAME_COUNT",j.max]),this.VERT_MAX_KEY_FRAME_COUNT=G.max;var K={fragment:sa,vertex:"#define LOOKUP_TEXTURE_CURVE "+H+"\n"+ss,glslVersion:1===U?t.GLSLVersion.GLSL1:t.GLSLVersion.GLSL3,shared:!0,cacheId:q,macros:B,name:"particle#"+_},Q=rU(R);X.uTexOffset=new Float32Array(F?[1/F.getWidth(),1/F.getHeight()]:[0,0]),X.uMaskTex=F,X.uColorParams=new Float32Array([F?1:0,+Q,0,+(!!P&&!O)]),X.uParams=[0,0,0,0],X.uAcceleration=[(null==w?void 0:w[0])||0,(null==w?void 0:w[1])||0,(null==w?void 0:w[2])||0,0];var J=nb.create(e,{shader:K});J.blending=!0,J.depthTest=!0,J.depthMask=!!P,rG(J,R),rj(J,A),Object.keys(X).map(function(t){var e=X[t];if(ej(e,ne)){J.setTexture(t,e);return}var i=[];switch(uf[t]){case"vec4":J.setVector4(t,e6.fromArray(e));break;case"vec3":J.setVector3(t,e5.fromArray(e));break;case"vec2":J.setVector2(t,e4.fromArray(e));break;case"vec4Array":for(var r=0;r<e.length;r+=4){var n=new e6(e[r],e[r+1],e[r+2],e[r+3]);i.push(n)}J.setVector4Array(t,i),i.length=0;break;default:console.warn("Uniform "+t+"'s type not in typeMap.")}}),J.setVector3("emissionColor",new e5(0,0,0)),J.setFloat("emissionIntensity",0);var $=a1.create(e,(r=4*E,n=this.useSprite,a="particle#"+_,u=12*(o=Float32Array.BYTES_PER_ELEMENT),(s={})[nA.PositionKind]={size:3,offset:0,stride:u,data:new Float32Array(0)},s.aVel={size:3,offset:3*o,stride:u,dataSource:nA.PositionKind},s.aDirX={size:3,offset:6*o,stride:u,dataSource:nA.PositionKind},s.aDirY={size:3,offset:9*o,stride:u,dataSource:nA.PositionKind},s.aRot={size:3,offset:0,stride:8*o,data:new Float32Array(0)},s.aSeed={size:1,offset:3*o,stride:8*o,dataSource:"aRot"},s[nA.ColorKind]={size:4,offset:4*o,stride:8*o,dataSource:"aRot"},s.aOffset={size:4,stride:4*o,data:new Float32Array(0)},s.aTranslation={size:3,data:new Float32Array(0)},s.aLinearMove={size:3,data:new Float32Array(0)},s.aRotation0={size:3,offset:0,stride:9*o,data:new Float32Array(0)},s.aRotation1={size:3,offset:3*o,stride:9*o,dataSource:"aRotation0"},s.aRotation2={size:3,offset:6*o,stride:9*o,dataSource:"aRotation0"},h=s,n&&(h.aSprite={size:3,stride:3*o,data:new Float32Array(0)}),{attributes:h,indices:{data:new Uint16Array(r/4*6)},name:a,maxVertex:r,bufferUsage:t.BufferUsage.Dynamic})),tt=si.create(e,{name:"MParticle_"+_,material:J,geometry:$});this.anchor=I,this.mesh=tt,this.geometry=tt.firstGeometry(),this.geometry.getAttributeNames().forEach(function(t){var e=f.geometry.getVertexBuffer(t),i=f.geometry.getAttributeData(t);e&&ej(i,Float32Array)&&f.attributeData.set(e.getWrapperBuffer(),i)}),this.forceTarget=M,this.sizeOverLifetime=g,this.speedOverLifetime=p,this.linearVelOverLifetime=v,this.orbitalVelOverLifetime=y,this.orbitalVelOverLifetime=y,this.gravityModifier=T,this.rotationOverLifetime=x,this.maxCount=E,this.maxParticleBufferCount=E,this.textureOffsets=C?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],this.time=0}var i=e.prototype;return i.getPointColor=function(t){var e=this.getAttributeData("aRot"),i=32*t+4;return[e[i],e[i+1],e[i+2],e[i+3]]},i.clearPoints=function(){this.particleCount=0,this.geometry.setDrawCount(0)},i.onUpdate=function(t){var e=Math.ceil(this.getAttributeData(nA.PositionKind).length/12);this.applyTranslation(e,t),this.applyRotation(e,t),this.applyLinearMove(e,t)},i.minusTime=function(t){for(var e=this.getAttributeData("aOffset"),i=0;i<e.length;i+=4)e[i+2]-=t;this.setAttributeData("aOffset",e),this.time-=t},i.removePoint=function(t){t<this.particleCount&&this.setAttributeSubData("aOffset",16*t,new Float32Array(16))},i.setPoint=function(t,e){var i=this,r=this.maxCount;if(t<r){var n,a=t+1,s=4*a,o=this.geometry,u=a>this.maxParticleBufferCount,h=1;this.particleCount>300?h=(this.particleCount+100)/this.particleCount:this.particleCount>100?h=1.4:this.particleCount>0&&(h=2);var l={aPos:new Float32Array(48),aRot:new Float32Array(32),aOffset:new Float32Array(16),aTranslation:new Float32Array(12),aLinearMove:new Float32Array(12),aRotation0:new Float32Array(36)},c=this.useSprite;c&&(l.aSprite=new Float32Array(12));var f=new e5,d=new rn,p=new e5(1,1,1);e.transform.assignWorldTRS(f,d,p);var m=nU.getRotation(d,new nc),v=f.toArray(),y=m.toArray(),g=this.textureOffsets,x=[0,0,e.delay,e.lifetime],b=[0,0,1,1],T=e.vel,E=e.color,C=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],S=Math.random();c&&(n=e.sprite);for(var _=0;_<4;_++){var w=2*_,M=3*_,A=4*_,P=12*_,I=8*_;l.aPos.set(v,P),T.fill(l.aPos,P+3),l.aRot.set(y,I),l.aRot[I+3]=S,l.aRot.set(E,I+4),c&&l.aSprite.set(n,M);var R=e.uv||b;if(R){var O=c?1-g[w+1]:g[w+1];x[0]=R[0]+g[w]*R[2],x[1]=R[1]+O*R[3]}l.aOffset.set(x,A);for(var V=_+_,L=(C[V]-this.anchor.x)*p.x,N=(C[V+1]-this.anchor.y)*p.y,F=0;F<3;F++)l.aPos[P+6+F]=e.dirX.getElement(F)*L,l.aPos[P+9+F]=e.dirY.getElement(F)*N}var D=new Uint16Array([0,1,2,2,1,3].map(function(e){return e+4*t}));if(u){var k=eJ(o.getIndexData(),6*a,6*r,h);k.set(D,6*t),o.setIndexData(k),this.maxParticleBufferCount=k.length/6}else o.setIndexSubData(6*t,D);Object.keys(l).forEach(function(e){var n=l[e],a=o.getAttributeStride(e)/Float32Array.BYTES_PER_ELEMENT;if(u){var c=eJ(i.getAttributeData(e),s*a,4*r*a,h);c.set(n,n.length*t),i.setAttributeData(e,c)}else i.setAttributeSubData(e,n.length*t,n)}),this.particleCount=Math.max(a,this.particleCount),o.setDrawCount(6*this.particleCount)}},i.applyTranslation=function(t,e){var i=this.time,r=this.getAttributeData("aTranslation"),n=this.getAttributeData("aVel"),a=this.getAttributeData("aOffset");r.length<3*t&&(r=this.expandArray(r,3*t));for(var s=0,o=0,u=0,h=this.mesh.material.getVector4("uAcceleration"),l=this.mesh.material.getVector4("uGravityModifierValue"),c=0;c<t;c+=4){var f=12*c+3;s=n[f],o=n[f+1],u=n[f+2];var d=i-a[4*c+2],p=a[4*c+3];if(h&&l){var m=this.gravityModifier.getIntegrateValue(0,d,p),v=h.x*m,y=h.y*m,g=h.z*m;if(this.speedOverLifetime){var x=this.speedOverLifetime.getValue(d/p);s=s*x+v,o=o*x+y,u=u*x+g}else s+=v,o+=y,u+=g}var b=3*c;if(a[4*c+2]<i){var T=e/1e3*s,E=e/1e3*o,C=e/1e3*u;r[b]+=T,r[b+1]+=E,r[b+2]+=C,r[b+3]+=T,r[b+4]+=E,r[b+5]+=C,r[b+6]+=T,r[b+7]+=E,r[b+8]+=C,r[b+9]+=T,r[b+10]+=E,r[b+11]+=C}}this.setAttributeData("aTranslation",r)},i.applyRotation=function(t,e){var i=this.getAttributeData("aRotation0"),r=this.getAttributeData("aOffset"),n=this.getAttributeData("aRot"),a=this.getAttributeData("aSeed"),s=this.time,o=this.cachedRotationMatrix;i.length<9*t&&(i=this.expandArray(i,9*t));for(var u=0;u<t;u+=4){var h=e3((s-r[4*u+2])/r[4*u+3],0,1),l=8*u,c=this.cachedRotationVector3.set(n[l],n[l+1],n[l+2]),f=a[8*u+3];this.rotationOverLifetime?(this.rotationOverLifetime.x&&(ej(this.rotationOverLifetime.x,ah)?c.x+=this.rotationOverLifetime.x.getValue(h,f):c.x+=this.rotationOverLifetime.x.getValue(h)),this.rotationOverLifetime.y&&(ej(this.rotationOverLifetime.y,ah)?c.y+=this.rotationOverLifetime.y.getValue(h,f):c.y+=this.rotationOverLifetime.y.getValue(h)),this.rotationOverLifetime.z&&(ej(this.rotationOverLifetime.z,ah)?c.z+=this.rotationOverLifetime.z.getValue(h,f):c.z+=this.rotationOverLifetime.z.getValue(h))):o.setZero(),0===c.dot(c)&&o.identity();var d=Math.PI/180,p=c.x*d,m=c.y*d,v=c.z*d,y=Math.sin(p),g=Math.sin(m),x=Math.sin(v),b=Math.cos(p),T=Math.cos(m),E=Math.cos(v);o.set(E,-x,0,x,E,0,0,0,1),o.multiply(this.tempMatrix3.set(T,0,g,0,1,0,-g,0,T)),o.multiply(this.tempMatrix3.set(1,0,0,0,b,-y,0,y,b));var C=9*u,S=o.elements;i.set(S,C),u+4<=t&&(i.set(S,C+9),i.set(S,C+18),i.set(S,C+27))}this.setAttributeData("aRotation0",i)},i.applyLinearMove=function(t,e){var i=this.getAttributeData("aLinearMove"),r=this.getAttributeData("aOffset"),n=this.getAttributeData("aSeed"),a=this.time;i.length<3*t&&(i=this.expandArray(i,3*t));var s=this.cachedLinearMove;if(this.linearVelOverLifetime&&this.linearVelOverLifetime.enabled)for(var o=0;o<t;o+=4){var u=a-r[4*o+2],h=r[4*o+3],l=u/h,c=n[8*o+3];s.setZero(),this.linearVelOverLifetime.asMovement?(this.linearVelOverLifetime.x&&(ej(this.linearVelOverLifetime.x,ah)?s.x=this.linearVelOverLifetime.x.getValue(l,c):s.x=this.linearVelOverLifetime.x.getValue(l)),this.linearVelOverLifetime.y&&(ej(this.linearVelOverLifetime.y,ah)?s.y=this.linearVelOverLifetime.y.getValue(l,c):s.y=this.linearVelOverLifetime.y.getValue(l)),this.linearVelOverLifetime.z&&(ej(this.linearVelOverLifetime.z,ah)?s.z=this.linearVelOverLifetime.z.getValue(l,c):s.z=this.linearVelOverLifetime.z.getValue(l))):(this.linearVelOverLifetime.x&&(ej(this.linearVelOverLifetime.x,ah)?s.x=this.linearVelOverLifetime.x.getIntegrateValue(0,u,c):s.x=this.linearVelOverLifetime.x.getIntegrateValue(0,u,h)),this.linearVelOverLifetime.y&&(ej(this.linearVelOverLifetime.y,ah)?s.y=this.linearVelOverLifetime.y.getIntegrateValue(0,u,c):s.y=this.linearVelOverLifetime.y.getIntegrateValue(0,u,h)),this.linearVelOverLifetime.z&&(ej(this.linearVelOverLifetime.z,ah)?s.z=this.linearVelOverLifetime.z.getIntegrateValue(0,u,c):s.z=this.linearVelOverLifetime.z.getIntegrateValue(0,u,h)));var f=3*o;i[f]=s.x,i[f+1]=s.y,i[f+2]=s.z,i[f+3]=s.x,i[f+4]=s.y,i[f+5]=s.z,i[f+6]=s.x,i[f+7]=s.y,i[f+8]=s.z,i[f+9]=s.x,i[f+10]=s.y,i[f+11]=s.z}this.setAttributeData("aLinearMove",i)},i.getAttributeData=function(t){var e=this.geometry.getVertexBuffer(t),i=e&&this.attributeData.get(e.getWrapperBuffer());return iy(i),i},i.setAttributeData=function(t,e){var i=this.geometry.getVertexBuffer(t);iy(i),this.attributeData.set(i.getWrapperBuffer(),e),this.geometry.setAttributeData(t,e)},i.setAttributeSubData=function(t,e,i){this.getAttributeData(t).set(i,e),this.geometry.setAttributeSubData(t,e,i)},i.rebuild=function(){!this.geometry.isInitialized||this.geometry.isDisposed()||this.attributeData.forEach(function(t,e){e.getData()||e.update(t)})},i.expandArray=function(t,e){var i=new Float32Array(e);return i.set(t),i},e}(),up=function(t){function e(e){var i;return(i=t.call(this,e)||this).name="ParticleSystemRenderer",i}iG(e,t);var i=e.prototype;return i.onStart=function(){this._priority=this.item.renderOrder},i.onUpdate=function(t){var e,i=this.particleMesh.time,r=null!=(e=this.particleMesh.mesh.material.getVector4("uParams"))?e:new e6;this.particleMesh.mesh.material.setVector4("uParams",r.set(i,this.item.duration,0,0))},i.render=function(t){this.maskManager.drawStencilMask(t,this);for(var e,i=iH(this.meshes);!(e=i()).done;)e.value.render(t)},i.setup=function(t,e){void 0===e&&(e=null),this.meshes=[],this.materials=[],this.particleMesh=new ud(this.engine,t),e&&(this.trailMesh=new ua(this.engine,e)),this.meshes.push(this.particleMesh.mesh),this.materials.push(this.particleMesh.mesh.material),this.trailMesh&&(this.meshes.push(this.trailMesh.mesh),this.materials.push(this.trailMesh.mesh.material))},i.rebuild=function(){var t;this.particleMesh.rebuild(),null==(t=this.trailMesh)||t.rebuild()},i.reset=function(){var t;this.particleMesh.clearPoints(),null==(t=this.trailMesh)||t.clearAllTrails()},i.updateTime=function(t,e){this.particleMesh.time=t,this.particleMesh.onUpdate(e),this.trailMesh&&(this.trailMesh.time=t,this.trailMesh.onUpdate(e))},i.minusTimeForLoop=function(t){var e;this.particleMesh.minusTime(t),null==(e=this.trailMesh)||e.minusTime(t)},i.updateWorldMatrix=function(t){this.particleMesh.mesh.worldMatrix=t,this.trailMesh&&(this.trailMesh.mesh.worldMatrix=t)},i.setVisible=function(t){var e;this.particleMesh.mesh.setVisible(t),null==(e=this.trailMesh)||e.mesh.setVisible(t)},i.getTextures=function(){var t=[],e=this.particleMesh.mesh.material.textures;if(Object.keys(e).forEach(function(i){t.push(e[i])}),this.trailMesh){var i=this.trailMesh.mesh.material.textures;Object.keys(i).forEach(function(e){t.push(i[e])})}return t},i.setParticlePoint=function(t,e){this.particleMesh.setPoint(t,e)},i.removeParticlePoint=function(t){this.particleMesh.removePoint(t)},i.getParticlePointColor=function(t){return this.particleMesh.getPointColor(t)},i.hasTrail=function(){return void 0!==this.trailMesh},i.clearTrail=function(t){var e;null==(e=this.trailMesh)||e.clearTrail(t)},i.addTrailPoint=function(t,e,i){var r;null==(r=this.trailMesh)||r.addPoint(t,e,i)},i.setTrailStartPosition=function(t,e){var i;null==(i=this.trailMesh)||i.setPointStartPos(t,e)},i.getTrailStartPosition=function(t){return this.trailMesh.getPointStartPos(t)},e}(nV);t.ParticleSystem=function(e){function i(i,r){var n;return(n=e.call(this,i)||this).particleMeshProps=null,n.trailMeshProps=null,n.getHitTestParams=function(e){var i=n.interaction;if(e||i)return{type:t.HitTestType.custom,clipMasks:n.renderer.frameClipMasks,collect:function(t){return n.raycast({radius:(null==i?void 0:i.radius)||.4,multiple:!!(null==i?void 0:i.multiple),removeParticle:(null==i?void 0:i.behavior)===t3.removeParticle,ray:t})}}},i.addParticleSystem(oA(n)),n.maskManager=new nT,r&&n.fromData(r),n}iG(i,e);var r=i.prototype;return r.isFrozen=function(){return this.frozen},r.isEnded=function(){return this.ended},r.initEmitterTransform=function(){var t,e=this.item.transform.position.clone(),i=this.item.transform.rotation.clone(),r=this.props.emitterTransform&&this.props.emitterTransform.path;r&&(r[0]===t0.CONSTANT_VEC3?e.add(r[1]):t=aI(r)),this.basicTransform={position:e,rotation:i,path:t};var n=e.clone();if(t&&n.add(t.getValue(0)),this.transform.setPosition(n.x,n.y,n.z),this.options.particleFollowParent){var a=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(a)}},r.updateEmitterTransform=function(t){var e=this.basicTransform,i=e.path,r=e.position.clone();if(i){var n=this.item.duration;r.add(i.getValue(t/n))}if(this.transform.setPosition(r.x,r.y,r.z),this.options.particleFollowParent){var a=this.transform.getWorldMatrix();this.renderer.updateWorldMatrix(a)}},r.addParticle=function(t,e){var i,r=this.particleLink,n=[t.delay+t.lifetime,0,t.delay,t];if(r.length<e)i=n[1]=r.length;else{var a=r.first;r.removeNode(a),i=n[1]=a.content[1]}r.pushNode(n),this.renderer.setParticlePoint(i,t),this.clearPointTrail(i),this.transform.parentTransform&&this.renderer.setTrailStartPosition(i,this.transform.parentTransform.position.clone())},r.setVisible=function(t){this.renderer.setVisible(t)},r.getTextures=function(){return this.renderer.getTextures()},r.startEmit=function(){(!this.started||this.ended)&&(this.reset(),this.started=!0,this.ended=!1)},r.stop=function(){this.ended=!0,this.started=!1},r.reset=function(){this.renderer.reset(),this.time=0,this.loopStartTime=0,this.lastEmitTime=-1/this.emission.rateOverTime.getValue(0),this.generatedCount=0,this.particleLink=new ui(function(t,e){return t[0]-e[0]}),this.emission.bursts.forEach(function(t){return t.reset()}),this.frozen=!1,this.ended=!1},r.onStart=function(){var t=this;this.particleMeshProps&&(this.renderer=this.item.addComponent(up),this.renderer.setup(this.particleMeshProps,this.trailMeshProps),this.renderer.maskManager=this.maskManager,this.meshes=this.renderer.meshes,this.startEmit(),this.initEmitterTransform(),this.item.on("click",function(){var e;if((null==(e=t.interaction)?void 0:e.behavior)===t3.removeParticle){var i=t.clickedPoint.content[1];t.renderer.removeParticlePoint(i),t.clearPointTrail(i),t.clickedPoint.content=[0]}}))},r.onUpdate=function(t){this.frozen||this.update(t)},r.simulate=function(t){this.update(1e3*t),this.frozen=!0},r.update=function(t){var e=this;if(this.started){var i=this.time+t/1e3,r=this.options,n=this.loopStartTime,a=this.emission;this.time=i,this.upDirectionWorld=null,this.renderer.updateTime(i,t);var s=this.particleLink,o=(i-n)/this.item.duration,u=this.timePassed,h=!1,l=function(){e.trails&&!h&&(h=!0,s.forEach(function(t){var i=t[0],r=t[1],n=t[2],a=t[3];i<u?e.clearPointTrail(r):u>n&&e.updatePointTrail(r,o,a,n)}))};if(!this.ended){var c=this.item.duration,f=this.lifetime;if(u<c){var d=1/a.rateOverTime.getValue(f),p=Math.floor((u-this.lastEmitTime)/d),m=d/p,v=r.maxCount;this.updateEmitterTransform(u);for(var y=function(){var t=s.first;return e.emissionStopped||s.length===v&&t&&t.content[0]-n>u},g=0;g<p&&g<v&&!y();g++){var x=this.createPoint(f);x.delay+=i+g*m,this.addParticle(x,v),this.lastEmitTime=u}for(var b=a.bursts,T=(null==b?void 0:b.length)-1,E=0;T>=0&&E<v&&!y();T--){var C=b[T],S=!C.disabled&&C.getGeneratorOptions(u,f);if(S){var _=[0,0,0],w=a.burstOffsets[T],M=w&&w[S.cycleIndex]||_;C.once&&this.removeBurst(T);for(var A=0;A<S.count&&E<v&&!y();A++){var P,I=this.initPoint(this.shape.generate({total:S.total,index:S.index,burstIndex:A,burstCount:S.count}));I.delay+=i,E++,(P=I.transform).translate.apply(P,[].concat(M)),this.addParticle(I,v)}}}}else this.options.looping?(l(),this.loopStartTime=i-c,this.lastEmitTime-=c,this.time-=c,a.bursts.forEach(function(t){return t.reset()}),this.particleLink.forEach(function(t){t[0]-=c,t[2]-=c,t[3]&&(t[3].delay-=c)}),this.renderer.minusTimeForLoop(c)):(this.ended=!0,this.item.endBehavior===t2.freeze&&(this.frozen=!0))}l()}},r.drawStencilMask=function(t){if(this.isActiveAndEnabled)for(var e,i=iH(this.renderer.meshes);!(e=i()).done;){var r=e.value;this.maskManager.drawGeometryMask(this.engine.renderer,r.geometry,r.worldMatrix,r.material,t)}},r.onDestroy=function(){this.item&&this.item.composition&&this.meshes.forEach(function(t){return t.dispose()})},r.rebuild=function(){var t;null==(t=this.renderer)||t.rebuild()},r.dispose=function(){this.engine.removeParticleSystem(this),e.prototype.dispose.call(this)},r.getParticleBoxes=function(){var t=this.particleLink,e=this.renderer,i=[],r=this.particleCount,n=0;if(!(t&&e))return i;for(var a=t.last,s=!1;!s;){var o=a.content[0],u=a.content[3];if(o>this.timePassed){var h=this.getPointPosition(u);i.push({center:h,size:u.transform.scale}),a.pre?a=a.pre:s=!0}++n>r&&(s=!0)}return i},r.raycast=function(t){var e=this.particleLink,i=this.renderer;if(e&&i){var r=e.last,n=[],a=new e5,s=!1;if(r&&r.content)do{var o=r.content,u=o[0];o[2];var h=o[3];if(u>this.timePassed){var l=this.getPointPosition(h),c=t.ray,f=!1;c&&(f=!!c.intersectSphere({center:l,radius:t.radius},a)),f&&(this.clickedPoint=r,n.push(l),t.multiple||(s=!0))}}while((r=r.pre)&&!s);return n}},r.clearPointTrail=function(t){this.trails&&this.trails.dieWithParticles&&this.renderer.clearTrail(t)},r.updatePointTrail=function(t,e,i,r){var n=this.renderer;if(n.hasTrail()){var a=this.trails,s=this.getPointPosition(i),o=a.inheritParticleColor?n.getParticlePointColor(t):[1,1,1,1],u=i.transform.getWorldScale().toArray(),h=1,l=a.lifetime.getValue(e);if(a.sizeAffectsWidth&&(h*=u[0]),a.sizeAffectsLifetime&&(l*=u[0]),a.parentAffectsPosition&&this.transform.parentTransform){s.add(this.transform.parentTransform.position);var c=n.getTrailStartPosition(t);c&&s.subtract(c)}n.addTrailPoint(t,s,{color:o,lifetime:l,size:h,time:r})}},r.getPointPositionByIndex=function(t){var e=this.particleLink.getNodeByIndex(t);return e?this.getPointPosition(e.content[3]):(console.error("Get point error."),null)},r.getPointPosition=function(t){var e=t.transform,i=t.vel,r=t.lifetime,n=t.delay,a=t.gravity,s=this.options.forceTarget,o=this.time-n,u=new e5,h=e5.fromArray(void 0===a?[]:a);e.assignWorldTRS(u);var l=nH(new e5,this.options,h,o,r,u,i);if(s){var c=s.target||[0,0,0],f=s.curve.getValue(o/r),d=1-f;l.x=l.x*d+c[0]*f,l.y=l.y*d+c[1]*f,l.z=l.z*d+c[2]*f}return l},r.initPoint=function(t){var e,i,r,n,a=this.options,s=this.lifetime,o=this.shape,u=a.startSpeed.getValue(s),h=a.particleFollowParent?nl.IDENTITY:this.transform.getWorldMatrix(),l=t.position,c=new nU({position:h.transformPoint(l,new e5),valid:!0}),f=t.direction;if(f=h.transformNormal(f,um).normalize(),a.startTurbulence&&a.turbulence){for(var d=0;d<3;d++)ub.setElement(d,a.turbulence[d].getValue(s));uT.setFromVector3(ub.negate()),uC.setFromEuler(uT).transformNormal(f).normalize()}o.alignSpeedDirection?(ux.copyFrom(f),this.upDirectionWorld||(o.upDirection?this.upDirectionWorld=o.upDirection.clone():this.upDirectionWorld=e5.Z.clone(),h.transformNormal(this.upDirectionWorld)),ug.crossVectors(ux,this.upDirectionWorld).normalize(),ug.isZero()&&ug.set(1,0,0)):(ug.set(1,0,0),ux.set(0,1,0));var p=this.textureSheetAnimation;p&&p.animate&&((n=uE)[0]=p.animationDelay.getValue(s),n[1]=p.animationDuration.getValue(s),n[2]=p.cycles.getValue(s)),a.start3DRotation?uy.set(a.startRotationX.getValue(s),a.startRotationY.getValue(s),a.startRotationZ.getValue(s)):a.startRotation?uy.set(0,0,a.startRotation.getValue(s)):uy.set(0,0,0),c.setRotation(uy.x,uy.y,uy.z);var m=a.startColor.getValue(s);if(3===m.length&&(m[3]=1),a.start3DSize)uv.x=a.startSizeX.getValue(s),uv.y=a.startSizeY.getValue(s);else{var v=a.startSize.getValue(s),y=a.sizeAspect.getValue(s);uv.x=v,uv.y=0===y?0:v/y}var g=f.clone();if(g.multiply(u),!a.particleFollowParent){var x=new e5;this.transform.assignWorldTRS(void 0,void 0,x),uv.x*=x.x,uv.y*=x.y}return c.setScale(uv.x,uv.y,1),{size:uv,vel:g,color:m,delay:a.startDelay.getValue(s),lifetime:a.startLifetime.getValue(s),uv:(i=Math.floor(Math.random()*(e=this.uvs).length),r=e[i],r),gravity:a.gravity,sprite:n,dirY:ux,dirX:ug,transform:c}},r.addBurst=function(t,e){var i=!1;if(this.emission.bursts.includes(t)||(this.emission.bursts.push(t),i=!0),i&&ej(e,Array)){var r=this.emission.bursts.indexOf(t);return this.emission.burstOffsets[r]=e,r}return -1},r.removeBurst=function(t){t<this.emission.bursts.length&&(this.emission.burstOffsets[t]=null,this.emission.bursts.splice(t,1))},r.createPoint=function(t){var e={total:this.emission.rateOverTime.getValue(t),index:this.generatedCount,burstIndex:0,burstCount:0};return this.generatedCount++,this.initPoint(this.shape.generate(e))},r.stopParticleEmission=function(){this.emissionStopped=!0},r.resumeParticleEmission=function(){this.emissionStopped=!1},r.getBoundingBox=function(){var e=this.getParticleBoxes();return{type:t.HitTestType.sphere,area:e}},r.fromData=function(t){e.prototype.fromData.call(this,t),this.props=t;var i,r,n,a,s,o,u,h,l,c,f,d,p,m,v=t.options,y=t.positionOverLifetime,g=void 0===y?{}:y,x=t.shape,b=null==g?void 0:g.gravityOverLifetime,T=nY(null==g?void 0:g.gravity),E=t.textureSheetAnimation,C=E?{animationDelay:aI(E.animationDelay||0),animationDuration:aI(E.animationDuration||1),cycles:aI(E.cycles||1),animate:E.animate,col:E.col,row:E.row,total:E.total||E.col*E.row}:void 0,S=!!(x&&x.turbulenceX||(null==x?void 0:x.turbulenceY)||(null==x?void 0:x.turbulenceZ));S&&(n=[aI(null!=(a=x.turbulenceX)?a:0),aI(null!=(s=x.turbulenceY)?s:0),aI(null!=(o=x.turbulenceZ)?o:0)]),this.name="ParticleSystem",this.shape=oj(x),this.emission={rateOverTime:aI(t.emission.rateOverTime),burstOffsets:(i=null!=(u=t.emission.burstOffsets)?u:[],r={},Array.isArray(i)&&i.forEach(function(t){var e=ej(t,Array),i=e?t[0]:t.index,n=r[i];n||(n=r[i]=[]),e?n.push(t.slice(1,4)):n.push([+t.x,+t.y,+t.z])}),r),bursts:(t.emission.bursts||[]).map(function(t){return new ut(t)})},this.textureSheetAnimation=C;var _=t.renderer||{},w=t.rotationOverLifetime;w&&((h={}).asRotation=!!w.asRotation,h.z=w.z?aI(w.z):aI(0),w.separateAxes&&(h.x=w.x&&aI(w.x),h.y=w.y&&aI(w.y))),(null==g?void 0:g.forceTarget)&&(l={target:g.target||[0,0,0],curve:aI(g.forceCurve||[t0.LINE,[[0,0],[1,1]]])});var M={x:g.linearX&&aI(g.linearX||0),y:g.linearY&&aI(g.linearY||0),z:g.linearZ&&aI(g.linearZ||0),asMovement:g.asMovement},A={x:g.orbitalX&&aI(g.orbitalX),y:g.orbitalY&&aI(g.orbitalY),z:g.orbitalZ&&aI(g.orbitalZ),center:g.orbCenter,asRotation:g.asRotation},P=t.sizeOverLifetime||{},I=t.colorOverLifetime,R=(null==P?void 0:P.separateAxes)?{separateAxes:!0,x:aI(P.x),y:aI(P.y)}:{separateAxes:!1,x:aI(("size"in P?P.size:P.x)||1)};_.anchor=_.anchor||[0,0];var O=e4.fromArray(_.anchor);this.options={particleFollowParent:!!v.particleFollowParent,startLifetime:aI(v.startLifetime),startDelay:aI(v.startDelay||0),startSpeed:aI(g.startSpeed||0),startColor:aI(v.startColor),looping:null!=(c=v.looping)&&c,maxCount:null!=(f=v.maxCount)?f:0,gravityModifier:aI(b||0),gravity:T,start3DSize:!!v.start3DSize,startTurbulence:S,turbulence:n,speedOverLifetime:g.speedOverLifetime&&aI(g.speedOverLifetime),linearVelOverLifetime:M,orbitalVelOverLifetime:A,forceTarget:l},v.startRotationZ&&(this.options.startRotation=aI(v.startRotationZ||0)),(v.startRotationX||v.startRotationY)&&(this.options.start3DRotation=!0,this.options.startRotationX=aI(v.startRotationX||0),this.options.startRotationY=aI(v.startRotationY||0),this.options.startRotationZ=aI(v.startRotationZ||0)),v.start3DSize?(this.options.startSizeX=aI(v.startSizeX),this.options.startSizeY=aI(v.startSizeY)):(this.options.startSize=aI(v.startSize),this.options.sizeAspect=aI(v.sizeAspect||1)),t.mask&&this.maskManager.setMaskOptions(this.engine,t.mask);var V={name:this.name,matrix:nl.IDENTITY,shaderCachePrefix:"",renderMode:_.renderMode||tq.BILLBOARD,side:_.side||tG.DOUBLE,gravity:T,blending:_.blending||tU.ALPHA,rotationOverLifetime:h,gravityModifier:this.options.gravityModifier,linearVelOverLifetime:this.options.linearVelOverLifetime,orbitalVelOverLifetime:this.options.orbitalVelOverLifetime,speedOverLifetime:this.options.speedOverLifetime,sprite:C,occlusion:!!_.occlusion,transparentOcclusion:!!_.transparentOcclusion,maxCount:v.maxCount,forceTarget:l,diffuse:_.texture?this.engine.findObject(_.texture):void 0,sizeOverLifetime:R,anchor:O};if(I){var L=I.color,N=I.opacity;V.colorOverLifetime={},N&&(V.colorOverLifetime.opacity=aI(I.opacity)),L&&(L[0]===t0.GRADIENT_COLOR?V.colorOverLifetime.color=I.color[1]:L[0]===t0.RGBA_COLOR?V.colorOverLifetime.color=ne.createWithData(this.engine,{data:new Uint8Array(L[1]),width:1,height:1}):ej(L,ne)&&(V.colorOverLifetime.color=L))}var F=[],D=[0,0,1,1];if(t.splits){var k=t.splits[0];D=(d=k[4])?[k[0],k[1],k[3],k[2]]:[k[0],k[1],k[2],k[3]]}if(C&&!C.animate)for(var z=d?C.row:C.col,B=d?C.col:C.row,U=C.total||z*B,G=0,j=0;j<z;j++)for(var W=0;W<B&&G<U;W++,G++)F.push([j*D[2]/z+D[0],W*D[3]/B+D[1],D[2]/z,D[3]/B]);else F.push(D);this.uvs=F,V.textureFlip=d;var X=t.trails;X&&(this.trails={lifetime:aI(X.lifetime),dieWithParticles:!1!==X.dieWithParticles,sizeAffectsWidth:!!X.sizeAffectsWidth,sizeAffectsLifetime:!!X.sizeAffectsLifetime,inheritParticleColor:!!X.inheritParticleColor,parentAffectsPosition:!!X.parentAffectsPosition},p={name:"Trail",matrix:nl.IDENTITY,minimumVertexDistance:X.minimumVertexDistance||.02,maxTrailCount:v.maxCount,pointCountPerTrail:Math.round(X.maxPointPerTrail)||32,blending:X.blending,texture:X.texture?this.engine.findObject(X.texture):void 0,opacityOverLifetime:aI(X.opacityOverLifetime||1),widthOverTrail:aI(X.widthOverTrail||1),shaderCachePrefix:"",lifetime:this.trails.lifetime,occlusion:!!X.occlusion,transparentOcclusion:!!X.transparentOcclusion},X.colorOverLifetime&&X.colorOverLifetime[0]===t0.GRADIENT_COLOR&&(p.colorOverLifetime=X.colorOverLifetime[1]),X.colorOverTrail&&X.colorOverTrail[0]===t0.GRADIENT_COLOR&&(p.colorOverTrail=X.colorOverTrail[1])),this.particleMeshProps=V,p&&(this.trailMeshProps=p);var H=t.interaction;H&&(this.interaction={multiple:H.multiple,radius:null!=(m=H.radius)?m:.4,behavior:H.behavior}),this.item.getHitTestParams=this.getHitTestParams},rV(i,[{key:"timePassed",get:function(){return this.time-this.loopStartTime}},{key:"lifetime",get:function(){return this.timePassed/this.item.duration}},{key:"particleCount",get:function(){return this.particleLink.length}},{key:"maxParticles",get:function(){return this.options.maxCount},set:function(t){var e;this.options.maxCount=t,(null==(e=this.renderer)?void 0:e.particleMesh)&&(this.renderer.particleMesh.maxCount=t)}}]),i}(rL),t.ParticleSystem=eW([iK(ey.ParticleSystem)],t.ParticleSystem);var um=new e5,uv=new e4,uy=new nc,ug=new e5,ux=new e5,ub=new e5,uT=new nc,uE=[0,0,0],uC=new nl;t.ObjectBindingTrack=function(e){function i(){return e.apply(this,arguments)}return iG(i,e),i.prototype.create=function(e,i){var r=i[this.getInstanceId()];if(ej(r,t.VFXItem))for(var n,a=iH(this.getChildTracks());!(n=a()).done;){var s=n.value;if(ej(s,t.ActivationTrack)){if(r.getComponent(t.ParticleSystem))for(var o,u=e.createTrack(oM,this,"ParticleTrack"),h=iH(s.getClips());!(o=h()).done;){var l=o.value,c=u.createClip(uc);c.start=l.start,c.duration=l.duration,c.endBehavior=l.endBehavior}if(r.getComponent(t.SpriteComponent))for(var f,d=e.createTrack(uA,this,"SpriteComponentTimeTrack"),p=iH(s.getClips());!(f=p()).done;){var m=f.value,v=d.createClip(uI);v.start=m.start,v.duration=m.duration,v.endBehavior=m.endBehavior}if(r.getComponent(t.EffectComponent))for(var y,g=e.createTrack(uP,this,"EffectComponentTimeTrack"),x=iH(s.getClips());!(y=x()).done;){var b=y.value,T=g.createClip(uI);T.start=b.start,T.duration=b.duration,T.endBehavior=b.endBehavior}break}}},i}(t.TrackAsset),t.ObjectBindingTrack=eW([iK(ey.ObjectBindingTrack)],t.ObjectBindingTrack),t.ActivationPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){return new os},e}(s7),t.ActivationPlayableAsset=eW([iK(ey.ActivationPlayableAsset)],t.ActivationPlayableAsset),t.ColorPropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){var t=new oo;return t.curve=aI(this.curveData),t.value=t.curve.getValue(0),t},e}(s7),eW([iJ(void 0,void 0)],t.ColorPropertyPlayableAsset.prototype,"curveData",void 0),t.ColorPropertyPlayableAsset=eW([iK(ey.ColorPropertyPlayableAsset)],t.ColorPropertyPlayableAsset),t.FloatPropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){var t=new oo;return t.curve=aI(this.curveData),t.value=t.curve.getValue(0),t},e}(s7),eW([iJ(void 0,void 0)],t.FloatPropertyPlayableAsset.prototype,"curveData",void 0),t.FloatPropertyPlayableAsset=eW([iK(ey.FloatPropertyPlayableAsset)],t.FloatPropertyPlayableAsset),t.SpritePropertyPlayableAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.curveData=[28,[]],e}iG(e,t);var i=e.prototype;return i.fromData=function(e){t.prototype.fromData.call(this,e);for(var i=e.curveData[1],r=[],n=0;n<i.length;n++){var a=i[n],s=a[0],o=a[1];r.push([s,this.engine.findObject(o)])}this.curveData[1]=r},i.createPlayable=function(){var t=new oo;return t.curve=aI(this.curveData),t.value=t.curve.getValue(0),t},e}(s7),t.SpritePropertyPlayableAsset=eW([iK("SpritePropertyPlayableAsset")],t.SpritePropertyPlayableAsset),t.SubCompositionPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){return new op},e}(s7),t.SubCompositionPlayableAsset=eW([iK(ey.SubCompositionPlayableAsset)],t.SubCompositionPlayableAsset),t.Vector4PropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){var t=new oo;return t.curve=aI(this.curveData),t.value=t.curve.getValue(0),t},e}(s7),eW([iJ(void 0,void 0)],t.Vector4PropertyPlayableAsset.prototype,"curveData",void 0),t.Vector4PropertyPlayableAsset=eW([iK(ey.Vector4PropertyPlayableAsset)],t.Vector4PropertyPlayableAsset),t.Vector3ropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){var t=new oo;return t.curve=aI(this.curveData),t.value=t.curve.getValue(0),t},e}(s7),eW([iJ(void 0,void 0)],t.Vector3ropertyPlayableAsset.prototype,"curveData",void 0),t.Vector3ropertyPlayableAsset=eW([iK(ey.Vector3PropertyPlayableAsset)],t.Vector3ropertyPlayableAsset),t.Vector2PropertyPlayableAsset=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){var t=new oo;return t.curve=aI(this.curveData),t.value=t.curve.getValue(0),t},e}(s7),eW([iJ(void 0,void 0)],t.Vector2PropertyPlayableAsset.prototype,"curveData",void 0),t.Vector2PropertyPlayableAsset=eW([iK(ey.Vector2PropertyPlayableAsset)],t.Vector2PropertyPlayableAsset);var uS=function(){function t(t,e,i){this.children=[],this.trackAsset=t,this.mixer=e,this.output=i,this.mixer.trackInstance=this}return t.prototype.addChild=function(t){this.children.push(t)},t}();t.TimelineAsset=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.tracks=[],e.cacheFlattenedTracks=null,e}iG(e,t);var i=e.prototype;return i.createTrack=function(t,e,i){var r=new t(this.engine);return r.name=i||t.name,e.addChild(r),this.invalidate(),r},i.invalidate=function(){this.cacheFlattenedTracks=null},i.addSubTracksRecursive=function(t,e){for(var i,r=iH(t.getChildTracks());!(i=r()).done;){var n=i.value;e.push(n)}for(var a,s=iH(t.getChildTracks());!(a=s()).done;){var o=a.value;this.addSubTracksRecursive(o,e)}},rV(e,[{key:"flattenedTracks",get:function(){if(!this.cacheFlattenedTracks){this.cacheFlattenedTracks=[];for(var t,e=iH(this.tracks);!(t=e()).done;){var i=t.value;this.cacheFlattenedTracks.push(i),this.addSubTracksRecursive(i,this.cacheFlattenedTracks)}}return this.cacheFlattenedTracks}}]),e}(i$),eW([iJ(void 0,void 0)],t.TimelineAsset.prototype,"tracks",void 0),t.TimelineAsset=eW([iK(ey.TimelineAsset)],t.TimelineAsset);var u_=function(){function e(e,i){this.masterTrackInstances=[],this.clips=[];for(var r,n={},a=iH(i);!(r=a()).done;){var s=r.value;n[s.key.getInstanceId()]=s.value}for(var o,u=iH(e.tracks);!(o=u()).done;){var h=o.value;ej(h,t.ObjectBindingTrack)&&h.create(e,n)}this.compileTracks(e.flattenedTracks,i)}var i=e.prototype;return i.evaluate=function(t,e){for(var i,r=iH(this.clips);!(i=r()).done;)i.value.evaluateAt(t);for(var n,a=iH(this.masterTrackInstances);!(n=a()).done;){var s=n.value;this.tickTrack(s,e)}},i.compileTracks=function(t,e){for(var i,r={},n=iH(t);!(i=n()).done;){var a=i.value,s=a.createPlayableGraph(this.clips),o=a.createOutput(),u=new uS(a,s,o);r[a.getInstanceId()]=u,a.parent||this.masterTrackInstances.push(u)}for(var h,l=iH(t);!(h=l()).done;)for(var c,f=h.value,d=r[f.getInstanceId()],p=iH(f.getChildTracks());!(c=p()).done;){var m=r[c.value.getInstanceId()];d.addChild(m)}for(var v,y=iH(e);!(v=y()).done;){var g=v.value;r[g.key.getInstanceId()].boundObject=g.value}for(var x,b=iH(this.masterTrackInstances);!(x=b()).done;){var T=x.value;this.updateTrackAnimatedObject(T)}},i.tickTrack=function(e,i){var r=e.output.context;r.deltaTime=i,e.output.setUserData(e.boundObject);for(var n,a=iH(e.mixer.clipPlayables);!(n=a()).done;){var s=n.value;s.getPlayState()===t.PlayState.Playing&&s.processFrame(r)}e.mixer.evaluate(r);for(var o,u=iH(e.children);!(o=u()).done;){var h=o.value;this.tickTrack(h,i)}},i.updateTrackAnimatedObject=function(t){for(var e,i=iH(t.children);!(e=i()).done;){var r=e.value;if(!r.boundObject){var n=r.trackAsset.updateAnimatedObject(t.boundObject);r.boundObject=n}this.updateTrackAnimatedObject(r)}},e}(),uw=0;t.SpriteColorPlayableAsset=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.createPlayable=function(){var t=new oe;return t.create(this.data),t},i.fromData=function(t){this.data=t},e}(s7),t.SpriteColorPlayableAsset=eW([iK(ey.SpriteColorPlayableAsset)],t.SpriteColorPlayableAsset);var uM=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createTrackMixer=function(){return new on},e}(t.TrackAsset),uA=function(e){function i(){return e.apply(this,arguments)}return iG(i,e),i.prototype.updateAnimatedObject=function(e){return e.getComponent(t.SpriteComponent)},i}(uM),uP=function(e){function i(){return e.apply(this,arguments)}return iG(i,e),i.prototype.updateAnimatedObject=function(e){return e.getComponent(t.EffectComponent)},i}(uM),uI=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.createPlayable=function(){return new uR},e}(s7),uR=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.processFrame=function(t){var e=t.output.getUserData();"time"in e&&(e.time=this.time)},e}(s8);t.SpriteComponent=function(e){function i(t,i){var r;return(r=e.call(this,t)||this).time=0,r.duration=1,r.name="MSprite"+uw++,i&&r.fromData(i),r}iG(i,e);var r=i.prototype;return r.onUpdate=function(i){var r=this;e.prototype.onUpdate.call(this,i);var n=this.time,a=this.duration,s=this.textureSheetAnimation,o=null==(l=null==s?void 0:s.loop)||l;n>a&&o&&(n%=a);var u=Math.min(Math.max(n/a,0),1),h=this.renderer.texture.source.video;if(h&&(0===n?h.pause():h.play().catch(function(t){r.engine.renderErrors.add(t)}),this.renderer.texture.uploadCurrentVideoFrame()),s){var l,c,f,d,p,m=s.total||s.row*s.col,v=this.sprite,y=null!=(f=null==v?void 0:v.rect)?f:[0,0,1,1],g=(null!=(d=null==v?void 0:v.rotation)?d:t.SpriteRotation.None)===t.SpriteRotation.Rotate90,x=y[0],b=y[1],T=g?y[3]:y[2],E=g?y[2]:y[3],C=g?1/s.row*T:1/s.col*T,S=g?1/s.col*E:1/s.row*E;if(s.animate){var _=Math.round(u*(m-1)),w=Math.floor(_/s.col),M=_-w*s.col;p=g?[C*w,S*(s.col-M)]:[C*M,S*(1+w)]}else p=[0,S];null==(c=this.material.getVector4("_TexOffset"))||c.setFromArray([x+p[0],E+b-p[1],C,S])}this.time=n+i/1e3},r.onDisable=function(){e.prototype.onDisable.call(this),this.time=0},r.onDestroy=function(){var e=this.renderer.texture.source;e.sourceType===t.TextureSourceType.video&&(null==e?void 0:e.video)&&(e.video.pause(),e.video.src="",e.video.load())},r.updateGeometry=function(e){var i=this.sprite,r=null!=(S=null==i?void 0:i.rotation)?S:t.SpriteRotation.None,n=null!=(_=null==i?void 0:i.rect)?_:[0,0,1,1],a=this.textureSheetAnimation?[0,0,1,1]:[n[0],n[1],n[2],n[3]],s=a[0],o=a[1],u=a[2],h=a[3],l=r===t.SpriteRotation.Rotate90,c=l?h:u,f=l?u:h,d=l?-Math.PI/2:0,p=e.getAttributeData(nA.UVKind),m=e.getAttributeData(nA.PositionKind),v=e.getIndexData(),y=[0,0];if(p&&m&&v){for(var g=p.length/2,x=0;x<g;x++){var b=3*x,T=2*x,E=m[b],C=m[b+1];y[0]=E,y[1]=C,o7(y,y,d),p[T]=(y[0]+.5)*c+s,p[T+1]=(y[1]+.5)*f+o}this.updateAttributeData(nA.PositionKind,m.slice(),3),this.updateAttributeData(nA.UVKind,p.slice(),2),this.geometry.setIndexData(v.slice()),this.geometry.setDrawCount(v.length)}this.geometry.subMeshes.length=0;for(var S,_,w,M=iH(e.subMeshes);!(w=M()).done;){var A=w.value;this.geometry.subMeshes.push({offset:A.offset,indexCount:A.indexCount,vertexCount:A.vertexCount})}},r.fromData=function(t){if(e.prototype.fromData.call(this,t),t.sprite){var i,r=this.engine.findObject(t.sprite);r&&this.applySpriteToRenderer(r)}this.textureSheetAnimation=t.textureSheetAnimation;var n=t.geometry?this.engine.findObject(t.geometry):this.defaultGeometry,a=t.splits;a&&a.length>1?this.updateGeometryFromMultiSplit(a):this.updateGeometry(n),this.interaction=t.interaction;var s=t.options.startColor||[1,1,1,1];this.material.setColor("_Color",new e8().setFromArray(s)),this.duration=null!=(i=t.duration)?i:this.item.duration},r.applySpriteToRenderer=function(t){this._sprite=t,this.renderer.texture=t.texture,this.material.setTexture("_MainTex",t.texture)},r.updateGeometryFromMultiSplit=function(t){for(var e=this.defaultGeometry,i=[],r=[],n=[],a=0;a<2;a++)for(var s=0;s<2;s++){var o=(2*s+a)*4,u=t[2*s+a],h=u[4]?[0,0,1,0,0,1,1,1]:[0,1,0,0,1,1,1,0],l=((a+a+1)/2-1)/2,c=((s+s+1)/2-1)/2,f=u[0],d=u[1],p=u[4]?u[3]:u[2],m=u[4]?u[2]:u[3],v=[-.25+l,.25+c,-.25+l,-.25+c,.25+l,.25+c,.25+l,-.25+c];i.push(h[0]*p+f,h[1]*m+d,h[2]*p+f,h[3]*m+d,h[4]*p+f,h[5]*m+d,h[6]*p+f,h[7]*m+d),n.push(1*v[0],1*v[1],0,1*v[2],1*v[3],0,1*v[4],1*v[5],0,1*v[6],1*v[7],0),r.push(o,1+o,2+o,2+o,1+o,3+o)}this.updateAttributeData(nA.PositionKind,new Float32Array(n),3),e.setIndexData(new Uint16Array(r)),this.updateAttributeData(nA.UVKind,new Float32Array(i),2),e.setDrawCount(r.length)},r.updateAttributeData=function(t,e,i){var r=this.geometry.getVertexBuffer(t),n=null==r?void 0:r.getBuffer();if(!r||n&&e.byteLength>n.capacity){this.geometry.setVerticesBuffer(new nA(this.engine,e,t,{updatable:!0,size:i}));return}this.geometry.setAttributeData(t,e)},rV(i,[{key:"sprite",get:function(){return this._sprite},set:function(t){this.applySpriteToRenderer(t),this.updateGeometry(this.geometry)}}]),i}(sB),t.SpriteComponent=eW([iK(ey.SpriteComponent)],t.SpriteComponent);var uO=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(sZ(iB));function uV(t){return" "===t||" "===t||"\xa0"===t}function uL(t){var e,i=null!=(e=t.codePointAt(0))?e:0;return i>=13312&&i<=19903||i>=19968&&i<=40959||i>=63744&&i<=64255||i>=131072&&i<=195103||i>=12352&&i<=12447||i>=12448&&i<=12543||i>=12784&&i<=12799||i>=44032&&i<=55215}function uN(t){return uV(t)?"swallow":!!uL(t)&&"keep"}var uF=function(){function t(t){this.width=0,this.height=0,this.autoResize=ei.fixed,this.keepWordIntact=!0,this.update(t)}var e=t.prototype;return e.update=function(t){var e=t.textHeight,i=t.textWidth,r=t.textOverflow,n=void 0===r?ee.clip:r,a=t.textVerticalAlign,s=void 0===a?ea.top:a,o=t.textAlign,u=void 0===o?en.left:o,h=t.letterSpace,l=t.fontSize,c=t.lineHeight,f=t.autoResize,d=void 0===f?ei.fixed:f,p=t.keepWordIntact;this.letterSpace=void 0===h?0:h,this.overflow=n,this.textVerticalAlign=s,this.textAlign=u,this.width=void 0===i?100:i,this.height=void 0===e?100:e,this.autoResize=d,this.keepWordIntact=void 0===p||p,this.lineHeight=void 0===c?l:c},e.getOffsetY=function(t,e,i,r,n){var a=(i-r)/3,s=void 0!==n?n:i*(e-1),o=0;switch(this.textVerticalAlign){case ea.top:o=r+a;break;case ea.middle:o=(this.height-s+r)/2;break;case ea.bottom:o=this.height-s-a}return o},e.getOffsetX=function(t,e){var i=0;switch(this.textAlign){case en.left:i=0;break;case en.middle:i=(this.width-e)/2;break;case en.right:i=this.width-e}return i},e.setSize=function(t,e){this.width=t,this.height=e},t}(),uD=function(){function t(t){this.isUnderline=!1,this.underlineHeight=1,this.isOutlined=!1,this.outlineWidth=0,this.hasShadow=!1,this.fontDesc="",this.fontScale=2,this.fontOffset=0,this.update(t)}return t.prototype.update=function(t){var e,i,r,n,a,s,o,u=t.textColor,h=t.fontSize,l=t.outline,c=t.shadow,f=t.fontWeight,d=t.fontStyle,p=t.fontFamily;this.textColor=[].concat(void 0===u?[1,1,1,1]:u),this.textWeight=void 0===f?"normal":f,this.fontStyle=void 0===d?"normal":d,this.fontFamily=void 0===p?"sans-serif":p,this.fontSize=void 0===h?40:h,this.isOutlined=!1,this.outlineColor=[1,1,1,1],this.outlineWidth=0,l&&(null!=(e=l.outlineWidth)?e:0)>0&&(this.isOutlined=!0,this.outlineColor=[].concat(null!=(i=l.outlineColor)?i:[1,1,1,1]),this.outlineWidth=null!=(r=l.outlineWidth)?r:0),this.hasShadow=!1,this.shadowBlur=2,this.shadowColor=[0,0,0,1],this.shadowOffsetX=0,this.shadowOffsetY=0,c&&(this.hasShadow=!0,this.shadowBlur=null!=(n=c.shadowBlur)?n:2,this.shadowColor=[].concat(null!=(a=c.shadowColor)?a:[0,0,0,1]),this.shadowOffsetX=null!=(s=c.shadowOffsetX)?s:0,this.shadowOffsetY=null!=(o=c.shadowOffsetY)?o:0),this.fontOffset=0,this.fontStyle!==eo.normal&&(this.fontOffset+=this.fontSize*Math.tan(.20943951))},t}(),uk=function(){function t(){this.isDirty=!0,this.maxLineWidth=0,this.ALPHA_FIX_VALUE=1/255}var e=t.prototype;return e.setText=function(t){this.text!==t&&(this.text=t.toString(),this.isDirty=!0)},e.setTextAlign=function(t){this.textLayout.textAlign!==t&&(this.textLayout.textAlign=t,this.isDirty=!0)},e.setTextVerticalAlign=function(t){this.textLayout.textVerticalAlign!==t&&(this.textLayout.textVerticalAlign=t,this.isDirty=!0)},e.setTextBaseline=function(t){console.warn("setTextBaseline 已废弃,请改用 setTextVerticalAlign。本次调用将转调用 setTextVerticalAlign。"),this.setTextVerticalAlign(t)},e.setTextColor=function(t){this.textStyle.textColor!==t&&(this.textStyle.textColor=t,this.isDirty=!0)},e.setFontFamily=function(t){if(!ig(t)){console.warn("Risky font family, ignored:",t);return}this.textStyle.fontFamily!==t&&(this.textStyle.fontFamily=t,this.isDirty=!0)},e.setFontWeight=function(t){this.textStyle.textWeight!==t&&(this.textStyle.textWeight=t,this.isDirty=!0)},e.setFontStyle=function(t){this.textStyle.fontStyle!==t&&(this.textStyle.fontStyle=t,this.isDirty=!0)},e.setOutlineColor=function(t){this.textStyle.outlineColor!==t&&(this.textStyle.outlineColor=t,this.isDirty=!0)},e.setOutlineEnabled=function(t){this.textStyle.isOutlined!==t&&(this.textStyle.isOutlined=t,this.isDirty=!0)},e.setFontScale=function(t){this.textStyle.fontScale!==t&&(this.textStyle.fontScale=t,this.isDirty=!0)},e.setOverflow=function(t){this.textLayout.overflow=t,this.isDirty=!0},e.getFontDesc=function(t){var e=this.textStyle,i=e.fontSize,r=e.fontFamily,n=e.textWeight,a=e.fontStyle,s=""+(t||i).toString()+"px ";return["serif","sans-serif","monospace","courier"].includes(r)?s+=r:s+='"'+r+'"',n!==es.normal&&(s=n+" "+s),a!==eo.normal&&(s=a+" "+s),s},e.setupOutline=function(t){void 0===t&&(t=1);var e=this.context,i=this.textStyle,r=i.outlineColor,n=i.outlineWidth,a=r[0],s=r[1],o=r[2],u=r[3];e&&(e.strokeStyle="rgba("+255*a+", "+255*s+", "+255*o+", "+u+")",e.lineWidth=2*n/t)},e.setupShadow=function(){var t=this.context,e=this.textStyle,i=e.shadowColor,r=e.shadowBlur,n=e.shadowOffsetX,a=e.shadowOffsetY,s=e.fontScale,o=i[0],u=i[1],h=i[2],l=i[3];t&&(t.shadowColor="rgba("+255*o+", "+255*u+", "+255*h+", "+l+")",t.shadowBlur=r*s,t.shadowOffsetX=n*s,t.shadowOffsetY=-a*s)},e.disposeTextTexture=function(){var t=this.renderer.texture;t&&t!==this.engine.whiteTexture&&t.dispose()},e.releaseTextCanvas=function(){this.canvas&&this.context&&(sR.releaseCanvasAndContext({canvas:this.canvas,context:this.context}),this.canvas=void 0,this.context=null)},e.renderToTexture=function(t,e,i,r,n){if(void 0===n&&(n={}),this.context&&this.canvas){var a=this.context,s=Math.max(1,t),o=Math.max(1,e);a.save(),this.canvas.width=s,this.canvas.height=o,a.setTransform(1,0,0,1,0,0),i||(a.translate(0,o),a.scale(1,-1)),a.clearRect(0,0,s,o),a.fillStyle="rgba(255, 255, 255, "+this.ALPHA_FIX_VALUE+")",r(a),a.restore();var u=a.getImageData(0,0,s,o),h=ne.createWithData(this.engine,{data:new Uint8Array(u.data),width:u.width,height:u.height},{flipY:i,magFilter:rD.LINEAR,minFilter:rD.LINEAR,wrapS:rD.CLAMP_TO_EDGE,wrapT:rD.CLAMP_TO_EDGE});!1!==n.disposeOld&&this.disposeTextTexture(),this.renderer.texture=h,this.material.setTexture("_MainTex",h)}},e.initTextBase=function(t){this.engine=t;var e=sR.getCanvasAndContext(1,1);this.canvas=e.canvas,this.context=e.context},t}(),uz=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,uB=0;t.TextComponent=function(t){function e(e){(i=t.call(this,e)||this).isDirty=!0,i.lineCount=0,i.effectScaleX=1,i.effectScaleY=1,i.maxLineWidth=0,i.name="MText"+uB++;var i,r=sR.getCanvasAndContext(1,1);i.canvas=r.canvas,i.context=r.context;var n=i.getDefaultProps().options;return i.updateWithOptions(n),i}iG(e,t);var i=e.prototype;return i.onUpdate=function(e){t.prototype.onUpdate.call(this,e),this.updateTexture();for(var i,r=iH(this.materials);!(i=r()).done;){var n=i.value,a=this.transform.size.x,s=this.transform.size.y,o=this.getTextureExpandScale(),u=o[0],h=o[1];a*=u,s*=h,n.setVector2("_Size",new e4(a,s))}},i.render=function(t){this.maskManager.drawStencilMask(t,this),t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.material)},i.onDestroy=function(){t.prototype.onDestroy.call(this),this.disposeTextTexture(),this.releaseTextCanvas()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.interaction,r=e.options;this.interaction=i,this.resetState(),this.updateWithOptions(r),this.renderText(r),this.material.setColor("_Color",new e8(1,1,1,1))},i.resetState=function(){this.disposeTextTexture(),this.isDirty=!0,this.lineCount=0,this.maxLineWidth=0},i.updateWithOptions=function(t){this.textStyle?this.textStyle.update(t):this.textStyle=new uD(t),this.textLayout?this.textLayout.update(t):this.textLayout=new uF(t),this.text=t.text.toString()},i.getLineCount=function(t){var e=this.context,i=this.textLayout,r=i.letterSpace,n=i.overflow;this.maxLineWidth=0;var a=this.textLayout.width+this.textStyle.fontOffset,s=1,o=0,u=0,h=Array.from(t);if(e&&(e.font=this.getFontDesc(this.textStyle.fontSize)),n===ee.display){for(var l,c=iH(h);!(l=c()).done;){var f,d,p=l.value,m=null!=(d=null==e?void 0:null==(f=e.measureText(p))?void 0:f.width)?d:0;"\n"===p?(s++,o=0,u=0):(u>0&&(o+=r),o+=m,u++,this.maxLineWidth=Math.max(this.maxLineWidth,o))}return s}if(this.textLayout.keepWordIntact)for(var v,y=0,g=0,x=iH(h);!(v=x()).done;){var b,T,E=v.value,C=null!=(T=null==e?void 0:null==(b=e.measureText(E))?void 0:b.width)?T:0;if("\n"===E){s++,this.maxLineWidth=Math.max(this.maxLineWidth,o),o=0,u=0,y=0,g=0;continue}o+(u>0?r:0)+C>a&&u>0&&(s++,g>1?(this.maxLineWidth=Math.max(this.maxLineWidth,y),o-=y,u-=g):(this.maxLineWidth=Math.max(this.maxLineWidth,o),o=0,u=0),y=0,g=0),u>0&&(o+=r),o+=C,u++,!1!==uN(E)&&(y=o,g=u)}else for(var S=0;S<h.length;S++){var _,w,M=h[S],A=null!=(w=null==e?void 0:null==(_=e.measureText(M))?void 0:_.width)?w:0;u>0&&(o+=r),(o+A>a&&S>0||"\n"===M)&&(s++,this.maxLineWidth=Math.max(this.maxLineWidth,o),o=0,u=0),"\n"!==M&&(o+=A,u++)}return this.maxLineWidth=Math.max(this.maxLineWidth,o),s},i.setLineHeight=function(t){var e=Math.max(this.textStyle.fontSize,t);this.textLayout.lineHeight!==e&&(this.textLayout.lineHeight=e,this.isDirty=!0)},i.updateTexture=function(t){var e=this;if(void 0===t&&(t=!0),this.isDirty&&this.context&&this.canvas){var i=this.textStyle,r=this.textLayout,n=i.fontScale;r.autoResize===ei.autoWidth?(r.width=this.getTextWidth(),this.lineCount=this.getLineCount(this.text),r.height=r.lineHeight*this.lineCount):r.autoResize===ei.autoHeight?(this.lineCount=this.getLineCount(this.text),r.height=r.lineHeight*this.lineCount):this.lineCount=this.getLineCount(this.text);var a=r.width+i.fontOffset,s=r.height,o=i.fontSize,u=r.lineHeight;i.fontDesc=this.getFontDesc(o);var h=Array.from(this.text||""),l=this.getEffectPadding(),c=l.padL,f=l.padR,d=l.padT,p=l.padB,m=(c|f|d|p)!=0,v=this.engine.gpuCapability.detail.maxTextureSize/2,y=m?a+c+f:a,g=m?s+d+p:s;n=Math.min(n,v/Math.max(y,g,1));var x=Math.ceil(y*n),b=Math.ceil(g*n),T=m?c:0,E=m?t?d:p:0;this.effectScaleX=a>0?x/(a*n):1,this.effectScaleY=s>0?b/(s*n):1,this.transform.setSize(.0123044998279225*a,.0123044998279225*s),this.renderToTexture(x,b,t,function(t){t.scale(n,n),e.maxLineWidth>a&&r.overflow===ee.display?t.font=e.getFontDesc(o*a/e.maxLineWidth):t.font=i.fontDesc;var s=i.textColor,l=s[0],c=s[1],f=s[2],d=s[3];t.fillStyle="rgba("+255*l+", "+255*c+", "+255*f+", "+d+")";var p=[],m=0,v=r.getOffsetY(i,e.lineCount,u,o),y=[],g=[];if(r.keepWordIntact)for(var x=-1,b=!1,C=0;C<h.length;C++){var S=h[C],_=t.measureText(S);if("\n"===S){p.push({y:v,width:m,chars:y,charOffsetX:g}),m=0,v+=u,y=[],g=[],x=-1,b=!1;continue}if(m+(y.length>0?r.letterSpace:0)+_.width>a&&y.length>0){if(x>0){var w=b?x:x+1,M=y.slice(0,w),A=g.slice(0,w),P=M.length>0?A[A.length-1]+t.measureText(M[M.length-1]).width:0;p.push({y:v,width:P,chars:M,charOffsetX:A}),v+=u,y=y.slice(x+1),m=0,g=[];for(var I=0;I<y.length;I++)I>0&&(m+=r.letterSpace),g.push(m),m+=t.measureText(y[I]).width;x=-1,b=!1}else p.push({y:v,width:m,chars:y,charOffsetX:g}),m=0,v+=u,y=[],g=[],x=-1,b=!1}y.length>0&&(m+=r.letterSpace),g.push(m),y.push(S),m+=_.width;var R=uN(S);!1!==R&&(x=y.length-1,b="swallow"===R)}else for(var O=0;O<h.length;O++){var V=h[O],L=t.measureText(V);y.length>0&&(m+=r.letterSpace),(m+L.width>a&&O>0||"\n"===V)&&(p.push({y:v,width:m,chars:y,charOffsetX:g}),m=0,v+=u,y=[],g=[]),"\n"!==V&&(y.push(V),g.push(m),m+=L.width)}y.length>0&&p.push({y:v,width:m,chars:y,charOffsetX:g});var N=i.isOutlined&&i.outlineWidth>0;N&&(i.hasShadow&&e.setupShadow(),e.setupOutline(n),p.forEach(function(e){var n=E+e.y,a=e.chars.join("");if(a.length>0&&uz.test(a)){var s=t.measureText(a).width,o=r.getOffsetX(i,s);t.save(),t.direction="rtl",t.strokeText(a,T+o+s,n),t.restore()}else for(var u=r.getOffsetX(i,e.width),h=0;h<e.chars.length;h++){var l=e.chars[h],c=T+u+e.charOffsetX[h];t.strokeText(l,c,n)}}),i.hasShadow&&(t.shadowColor="transparent")),!N&&i.hasShadow&&e.setupShadow(),p.forEach(function(e){var n=E+e.y,a=e.chars.join("");if(a.length>0&&uz.test(a)){var s=t.measureText(a).width,o=r.getOffsetX(i,s);t.save(),t.direction="rtl",t.fillText(a,T+o+s,n),t.restore()}else for(var u=r.getOffsetX(i,e.width),h=0;h<e.chars.length;h++){var l=e.chars[h],c=T+u+e.charOffsetX[h];t.fillText(l,c,n)}}),i.hasShadow&&(t.shadowColor="transparent")}),this.isDirty=!1}},i.renderText=function(t){this.updateTexture()},i.getTextureExpandScale=function(){return[this.effectScaleX,this.effectScaleY]},i.getEffectPadding=function(){var t=this.textStyle,e=(t.isOutlined&&t.outlineWidth>0?Math.ceil(2*t.outlineWidth):0)+(t.hasShadow&&(t.shadowBlur>0||0!==t.shadowOffsetX||0!==t.shadowOffsetY)?Math.ceil(Math.abs(t.shadowOffsetX)+Math.abs(t.shadowOffsetY)+t.shadowBlur):0);return{padL:e,padR:e,padT:e,padB:e}},i.setAutoResize=function(t){this.textLayout.autoResize!==t&&(this.textLayout.autoResize=t,this.isDirty=!0)},i.setTextWidth=function(t){var e=Math.max(0,Number(t)||0),i=this.textLayout;i.width!==e&&(i.autoResize===ei.autoWidth&&(i.autoResize=ei.autoHeight),i.width=e,this.isDirty=!0)},i.setTextHeight=function(t){var e=Math.max(0,Number(t)||0);if(0!==e){var i=this.textLayout;i.height!==e&&(i.height=e,this.isDirty=!0)}},i.setFontSize=function(t){var e=Math.max(1,Number(t)||1);this.textStyle.fontSize!==e&&(this.textStyle.fontSize=e,this.isDirty=!0)},i.setOutlineWidth=function(t){var e=Math.max(0,Number(t)||0);this.textStyle.outlineWidth!==e&&(this.textStyle.outlineWidth=e,this.isDirty=!0)},i.setOutlineEnabled=function(t){this.textStyle.isOutlined!==t&&(this.textStyle.isOutlined=t,this.isDirty=!0)},i.setShadowBlur=function(t){var e=Math.max(0,Number(t)||0);this.textStyle.shadowBlur!==e&&(this.textStyle.shadowBlur=e,this.isDirty=!0)},i.setShadowColor=function(t){var e=null!=t?t:[0,0,0,1];this.textStyle.shadowColor!==e&&(this.textStyle.shadowColor=e,this.isDirty=!0)},i.setShadowOffsetX=function(t){var e=Number(t)||0;this.textStyle.shadowOffsetX!==e&&(this.textStyle.shadowOffsetX=e,this.isDirty=!0)},i.setShadowOffsetY=function(t){var e=Number(t)||0;this.textStyle.shadowOffsetY!==e&&(this.textStyle.shadowOffsetY=e,this.isDirty=!0)},i.getTextWidth=function(){var t,e,i,r=this.context;if(!r)return null!=(e=null==(t=this.textLayout)?void 0:t.width)?e:0;var n=(null!=(i=this.text)?i:"").toString(),a=this.textLayout,s=this.textStyle;r.font=this.getFontDesc(s.fontSize);for(var o=0,u=0,h=0;h<n.length;h++){var l=n[h];if("\n"===l){o=Math.max(o,u),u=0;continue}u+=(a.letterSpace||0)+r.measureText(l).width}return Math.max(0,Math.ceil((o=Math.max(o,u))-(s.fontOffset||0)-1e-4)+2)},i.getDefaultProps=function(){return{id:"default-id-"+Math.random().toString(36).substr(2,9),item:{id:"default-item-"+Math.random().toString(36).substr(2,9)},dataType:ey.TextComponent,options:{text:"默认文本",fontFamily:"AlibabaSans-BoldItalic",fontSize:40,textColor:[1,1,1,1],fontWeight:es.normal,letterSpace:0,textAlign:en.middle,fontStyle:eo.normal,textWidth:200,textHeight:42,lineHeight:40.148},renderer:{renderMode:1,anchor:[.5,.5]}}},e}(sB),t.TextComponent=eW([iK(ey.TextComponent)],t.TextComponent),iV(t.TextComponent,[uk]);var uU=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(sZ(iB));function uG(t,e,i){return Math.max(e,Math.min(i,t))}function uj(t,e){return t.x===e.x&&t.y===e.y}function uW(t){return new e4(t.x,t.y)}function uX(t,e){var i=Math.hypot(t,e);return i<=Number.EPSILON?new e4(1,0):new e4(t/i,e/i)}function uH(t,e){var i=1-e,r=i*i,n=e*e,a=r*i,s=3*r*e,o=3*i*n,u=n*e;return new e4(a*t[0].x+s*t[1].x+o*t[2].x+u*t[3].x,a*t[0].y+s*t[1].y+o*t[2].y+u*t[3].y)}function uY(t,e){var i,r,n,a,s,o,u,h,l,c,f,d,p=new e4((i=t[0].x)+(t[1].x-i)*e,(r=t[0].y)+(t[1].y-r)*e),m=new e4((n=t[1].x)+(t[2].x-n)*e,(a=t[1].y)+(t[2].y-a)*e),v=new e4((s=t[2].x)+(t[3].x-s)*e,(o=t[2].y)+(t[3].y-o)*e),y=new e4((u=p.x)+(m.x-u)*e,(h=p.y)+(m.y-h)*e),g=new e4((l=m.x)+(v.x-l)*e,(c=m.y)+(v.y-c)*e),x=new e4((f=y.x)+(g.x-f)*e,(d=y.y)+(g.y-d)*e);return[[uW(t[0]),p,y,x],[x,g,v,uW(t[3])]]}function uZ(t,e){t.push({action:"moveTo",data:[e]})}function uq(t,e){t.push({action:"lineTo",data:[e]})}function uK(t){t.push({action:"closePath",data:[]})}var uQ=new e5;function uJ(t,e,i,r){if(0===t.length)return t.push(uW(i)),r;var n=t[t.length-1],a=Math.hypot(i.x-n.x,i.y-n.y);if(a<=Number.EPSILON)return r;var s=t.length-1;return t.push(uW(i)),r+=a,e.push({distance:r,pointIndex:s,tValue:1,type:"line"}),r}function u$(t,e,i,r){return 0===e.length||t.length<2||i<=Number.EPSILON?null:{points:t,segments:e,closePath:r}}function u0(t,e){for(var i=t[e].pointIndex,r=e+1;r<t.length&&t[r].pointIndex===i;)r++;return r}function u1(t,e){return[t[e],t[e+1]]}function u2(t,e){return[t[e],t[e+1],t[e+2],t[e+3]]}var u3=function(){function t(t,e,i,r){this.segments=t,this.points=e,this.contourLength=i,this.contourClosed=r}var e=t.prototype;return e.length=function(){return this.contourLength},e.isClosed=function(){return this.contourClosed},e.getPosTan=function(t){if(0===this.segments.length)return{pos:new e4,tan:new e4(1,0)};var e,i,r,n,a,s,o=uG(t,0,this.contourLength),u=this.findSegment(o),h=this.segments[u],l=u>0?this.segments[u-1].distance:0,c=h.distance-l,f=c<=Number.EPSILON?0:(o-l)/c;if("line"===h.type)return{pos:[new e4((i=(e=u1(this.points,h.pointIndex))[0].x)+(e[1].x-i)*f,(r=e[0].y)+(e[1].y-r)*f),new e4((n=e[0].x)+(e[1].x-n)*f,(a=e[0].y)+(e[1].y-a)*f)][0],tan:uX(e[1].x-e[0].x,e[1].y-e[0].y)};var d=u>0?this.segments[u-1]:void 0,p=(s=d&&d.pointIndex===h.pointIndex?d.tValue:0)+(h.tValue-s)*f;return function(t,e){if(e<=0){var i=uj(t[0],t[1])?uj(t[1],t[2])?t[3]:t[2]:t[1];return{pos:new e4(t[0].x,t[0].y),tan:uX(i.x-t[0].x,i.y-t[0].y)}}if(e>=1){var r=uj(t[3],t[2])?uj(t[2],t[1])?t[0]:t[1]:t[2];return{pos:new e4(t[3].x,t[3].y),tan:uX(t[3].x-r.x,t[3].y-r.y)}}var n=uH(t,Math.max(0,e-1e-4)),a=uH(t,Math.min(1,e+1e-4));return{pos:uH(t,e),tan:uX(a.x-n.x,a.y-n.y)}}(u2(this.points,h.pointIndex),p)},e.getSegment=function(t,e,i,r){var n=uG(t,0,this.contourLength),a=uG(e,0,this.contourLength);if(!(n>=a)&&0!==this.segments.length){var s=this.findSegment(n),o=this.findSegment(a),u=this.segments[s],h=this.segments[o],l=this.computeT(s,n),c=this.computeT(o,a);if(1-l<Number.EPSILON&&s<o&&(s++,u=this.segments[s],l=0),u.pointIndex===h.pointIndex){this.extractSegment(s,l,c,i,r);return}this.extractSegment(s,l,1,i,r);for(var f=u0(this.segments,s);f<this.segments.length&&this.segments[f].pointIndex!==h.pointIndex;)this.extractWholeSegment(f,i),f=u0(this.segments,f);this.extractSegment(o,0,c,i,!1)}},e.warp=function(t){var e=this.getPosTan(t.x);return new e4(e.pos.x-e.tan.y*t.y,e.pos.y+e.tan.x*t.y)},e.dump=function(){console.log("ContourMeasure",{length:this.contourLength,points:this.points.length,segments:this.segments.length,isClosed:this.contourClosed})},e.findSegment=function(t){for(var e=0,i=this.segments.length-1;e<i;){var r=e+i>>1;this.segments[r].distance<t?e=r+1:i=r}return e},e.computeT=function(t,e){var i=this.segments[t],r=t>0?this.segments[t-1]:void 0,n=r?r.distance:0,a=r&&r.pointIndex===i.pointIndex?r.tValue:0,s=i.distance<=n?0:(e-n)/(i.distance-n);return uG(a+(i.tValue-a)*s,a,i.tValue)},e.extractWholeSegment=function(t,e){var i=this.segments[t];if("line"===i.type){var r=u1(this.points,i.pointIndex)[1];e.lineTo(r.x,r.y);return}var n=u2(this.points,i.pointIndex),a=n[1],s=n[2],o=n[3];e.bezierCurveTo(a.x,a.y,s.x,s.y,o.x,o.y,i.smoothness,i.scale)},e.extractSegment=function(t,e,i,r,n){var a=this.segments[t];if("line"===a.type){var s,o,u,h,l=u1(this.points,a.pointIndex),c=l[0],f=l[1],d=new e4((s=c.x)+(f.x-s)*e,(o=c.y)+(f.y-o)*e),p=new e4((u=c.x)+(f.x-u)*i,(h=c.y)+(f.y-h)*i);n&&r.moveTo(d.x,d.y),r.lineTo(p.x,p.y);return}var m=function(t,e,i){if(e<=0&&i>=1)return t.map(uW);var r=uG(e,0,1),n=uG(i,r,1),a=t.map(uW);return r>0&&(a=uY(a,r)[1]),n<1&&(a=uY(a,r>=1?0:(n-r)/(1-r))[0]),a}(u2(this.points,a.pointIndex),e,i);n&&r.moveTo(m[0].x,m[0].y),r.bezierCurveTo(m[1].x,m[1].y,m[2].x,m[2].y,m[3].x,m[3].y,a.smoothness,a.scale)},t}(),u4=function(){function t(t,e){void 0===e&&(e=1),this.contourPath=[],this.cursor=0,this.screenScale=1,this.rewind(t,e)}var e=t.prototype;return e.rewind=function(t,e){var i,r;void 0===e&&(e=1),this.contourPath=(i=e,null!=(r=function(t){for(var e,i=[],r=iH(t.instructions);!(e=r()).done;){var n=e.value,a=n.data;switch(n.action){case"moveTo":uZ(i,new e4(a[0],a[1]));break;case"lineTo":uq(i,new e4(a[0],a[1]));break;case"bezierCurveTo":!function(t,e,i,r,n,a){t.push({action:"bezierCurveTo",data:[e,i,r],smoothness:n,scale:a})}(i,new e4(a[0],a[1]),new e4(a[2],a[3]),new e4(a[4],a[5]),a[6],a[7]);break;case"closePath":uK(i);break;default:return null}}return i}(t))?r:function(t,e){for(var i,r=[],n=iH(t.shapePrimitives);!(i=n()).done;)!function(){var t,n=i.value,a=n.shape,s=n.transform;!function(t,e,i){if(!(e.length<2)){uZ(t,new e4(e[0],e[1]));for(var r=2;r<e.length;r+=2)uq(t,new e4(e[r],e[r+1]));i&&uK(t)}}(r,function(t,e){if(!e)return t.slice();for(var i=Array(t.length),r=0;r<t.length;r+=2){uQ.set(t[r],t[r+1],0);var n=e.transformPoint(uQ,uQ);i[r]=n.x,i[r+1]=n.y}return i}(ej(a,aZ)?a.points.slice():(t=[],a.build(t,e),t),s),!ej(a,aZ)||a.closePath)}();return r}(t.shapePath,i)),this.screenScale=e,this.cursor=0},e.tryNext=function(){var e=function(t,e,i,r){for(var n=[],a=[],s=0,o=null,u=!1,h=function(){if(0===n.length){var t=null!=o?o:new e4(0,0);n.push(uW(t)),o=uW(t)}},l=e;l<t.length;l++){var c=t[l];switch(c.action){case"moveTo":var f=u$(n,a,s,u);if(f)return{contour:f,nextIndex:l};n=[],a=[],s=0,o=uW(c.data[0]),u=!1,n.push(uW(o));break;case"lineTo":h(),s=uJ(n,a,c.data[0],s);break;case"bezierCurveTo":h();var d,p=n[n.length-1],m=n.length-1,v=c.data,y=v[0],g=v[1],x=v[2],b=function(t,e,i,r,n,a,s,o){var u=[],h=[];aU(u,r[0].x,r[0].y,r[1].x,r[1].y,r[2].x,r[2].y,r[3].x,r[3].y,null!=s?s:a,null!=o?o:n,h);for(var l=[],c=r[0],f=0;f<h.length;f++){var d=h[f],p=2*f,m=d>=1?r[3]:new e4(u[p],u[p+1]),v=Math.hypot(m.x-c.x,m.y-c.y);v>Number.EPSILON&&(i+=v,l.push({distance:i,pointIndex:e,tValue:d,type:"cubic",smoothness:s,scale:o}),c=m)}return 0===l.length||t.push(uW(r[1]),uW(r[2]),uW(r[3])),{distance:i,segments:l}}(n,m,s,[uW(p),uW(y),uW(g),uW(x)],i,r,c.smoothness,c.scale);s=b.distance,(d=a).push.apply(d,[].concat(b.segments));break;case"closePath":n.length>0&&o&&(s=uJ(n,a,o,s),u=!0);var T=u$(n,a,s,u);if(T)return{contour:T,nextIndex:l+1};n=[],a=[],s=0,o=null,u=!1}}return{contour:u$(n,a,s,u),nextIndex:t.length}}(this.contourPath,this.cursor,this.screenScale,t.defaultTolerance);this.cursor=e.nextIndex;var i=e.contour?function(t){if(t.points.length<2||0===t.segments.length)return null;var e=t.segments[t.segments.length-1].distance;return e<=Number.EPSILON?null:{points:t.points,segments:t.segments,contourLength:e,contourClosed:t.closePath}}(e.contour):null;return i?new u3(i.segments,i.points,i.contourLength,i.contourClosed):null},e.next=function(){for(;this.cursor<this.contourPath.length;){var t=this.tryNext();if(t)return t}return null},e.toArray=function(){for(var t,e=this.cursor,i=[];t=this.next();)i.push(t);return this.cursor=e,i},t}();u4.defaultTolerance=.5;var u5=function(){function t(t){this.graphicsPath=t,this.currentPoly=null,this.shapePrimitives=[]}var e=t.prototype;return e.buildPath=function(){this.currentPoly=null,this.shapePrimitives.length=0;for(var t,e=this.graphicsPath,i=iH(e.instructions);!(t=i()).done;){var r=t.value,n=r.action,a=r.data;switch(n){case"bezierCurveTo":this.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);break;case"moveTo":this.moveTo(a[0],a[1]);break;case"lineTo":this.lineTo(a[0],a[1]);break;case"ellipse":this.ellipse(a[0],a[1],a[2],a[3],a[4]);break;case"circle":this.circle(a[0],a[1],a[2],a[3]);break;case"polyStar":this.polyStar(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);break;case"rect":this.rect(a[0],a[1],a[2],a[3],a[4]);break;case"triangle":this.triangle(a[0],a[1],a[2],a[3],a[4],a[5],a[6]);break;case"closePath":this.closePath()}}this.endPoly()},e.bezierCurveTo=function(t,e,i,r,n,a,s,o){this.ensurePoly();var u=this.currentPoly;return aU(u.points,u.lastX,u.lastY,t,e,i,r,n,a,s,o),this},e.moveTo=function(t,e){return this.startPoly(t,e),this},e.lineTo=function(t,e){this.ensurePoly();var i=this.currentPoly.points,r=i[i.length-2],n=i[i.length-1];return(r!==t||n!==e)&&i.push(t,e),this},e.closePath=function(){return this.endPoly(!0),this},e.ellipse=function(t,e,i,r,n){return this.drawShape(new ak(t,e,i,r),n),this},e.circle=function(t,e,i,r){return this.drawShape(new aY(t,e,i),r),this},e.polyStar=function(t,e,i,r,n,a,s){return this.drawShape(new aH(t,e,i,r,n,a),s),this},e.rect=function(t,e,i,r,n,a){return this.drawShape(new az(t,e,i,r,n),a),this},e.triangle=function(t,e,i,r,n,a,s){return this.drawShape(new aB(t,e,i,r,n,a),s),this},e.drawShape=function(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this},e.startPoly=function(t,e){var i=this.currentPoly;return i&&this.endPoly(),(i=new aZ).points.push(t,e),this.currentPoly=i,this},e.endPoly=function(t){void 0===t&&(t=!1);var e=this.currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this.currentPoly=null,this},e.ensurePoly=function(t){this.currentPoly||(this.currentPoly=new aZ,this.currentPoly.points.push(0,0))},t}(),u6=function(){function t(){this.instructions=[],this.dirty=!1}var e=t.prototype;return e.bezierCurveTo=function(t,e,i,r,n,a,s,o){return this.instructions.push({action:"bezierCurveTo",data:[t,e,i,r,n,a,s,o]}),this.dirty=!0,this},e.lineTo=function(t,e){return this.instructions.push({action:"lineTo",data:[t,e]}),this.dirty=!0,this},e.moveTo=function(t,e){return this.instructions.push({action:"moveTo",data:[t,e]}),this.dirty=!0,this},e.closePath=function(){return this.instructions.push({action:"closePath",data:[]}),this.dirty=!0,this},e.ellipse=function(t,e,i,r,n){return this.instructions.push({action:"ellipse",data:[t,e,i,r,n]}),this.dirty=!0,this},e.circle=function(t,e,i,r){return this.instructions.push({action:"circle",data:[t,e,i,r]}),this.dirty=!0,this},e.rect=function(t,e,i,r,n,a){return this.instructions.push({action:"rect",data:[t,e,i,r,n,a]}),this.dirty=!0,this},e.triangle=function(t,e,i,r,n,a,s){return this.instructions.push({action:"triangle",data:[t,e,i,r,n,a,s]}),this.dirty=!0,this},e.polyStar=function(t,e,i,r,n,a,s){return this.instructions.push({action:"polyStar",data:[t,e,i,r,n,a,s]}),this.dirty=!0,this},e.clear=function(){return this.instructions.length=0,this.dirty=!0,this},rV(t,[{key:"shapePath",get:function(){return this._shapePath||(this._shapePath=new u5(this)),this.dirty&&(this.dirty=!1,this._shapePath.buildPath()),this._shapePath}}]),t}();t.TrimPathMode=void 0,(tV=t.TrimPathMode||(t.TrimPathMode={}))[tV.Synchronized=0]="Synchronized",tV[tV.Sequential=1]="Sequential";var u8=function(){function t(){this.start=0,this.end=1,this.offset=0,this.mode=0,this.trimmedGraphicsPath=new u6}var e=t.prototype;return e.clone=function(){var e=new t;return e.start=this.start,e.end=this.end,e.offset=this.offset,e.mode=this.mode,e},e.createTrimmedPath=function(t,e){if(this.isIdentity())return t;var i=new u4(t,e).toArray();return this.trimmedGraphicsPath.clear(),0===i.length||(1===this.mode?this.applySequentialTrimPath(i,this.trimmedGraphicsPath):this.applySynchronizedTrimPath(i,this.trimmedGraphicsPath)),this.trimmedGraphicsPath},e.isIdentity=function(){return 0===this.start&&1===this.end},e.fromData=function(t){this.start=t.start,this.end=t.end,this.offset=t.offset,this.mode=t.mode},e.normalizeTrimOffset=function(){return(this.offset%1+1)%1},e.applySequentialTrimPath=function(t,e){for(var i,r=0,n=iH(t);!(i=n()).done;)r+=i.value.length();if(!(r<=0)){var a=this.normalizeTrimOffset(),s=r*(this.start+a),o=r*(this.end+a);if(o<s){var u=s;s=o,o=u}s>r&&(s-=r,o-=r);for(var h=[],l=0;o>0;){var c=l%t.length,f=t[c].length();s<f?(h.push({contourIndex:c,startLength:s,endLength:o}),o-=f,s=0):(s-=f,o-=f),l++}for(var d=-1,p=0;p<h.length;p++){var m=h[p],v=t[m.contourIndex],y=v.length();v.getSegment(m.startLength,m.endLength,e,d!==m.contourIndex||!v.isClosed()),0===m.startLength&&m.endLength-m.startLength>=y&&v.isClosed()&&e.closePath(),d=m.contourIndex}}},e.applySynchronizedTrimPath=function(t,e){for(var i,r=this.normalizeTrimOffset(),n=iH(t);!(i=n()).done;){var a=i.value,s=a.length(),o=s*(this.start+r),u=s*(this.end+r);if(u<o){var h=o;o=u,u=h}for(o>=s&&(o-=s,u-=s),a.getSegment(o,u,e,!0);u>s;)o=0,u-=s,a.getSegment(o,u,e,!a.isClosed());0===this.start&&1===this.end&&a.isClosed()&&e.closePath()}},t}();t.TexturePaintScaleMode=void 0,(tL=t.TexturePaintScaleMode||(t.TexturePaintScaleMode={}))[tL.Fill=0]="Fill",tL[tL.Fit=1]="Fit",tL[tL.Crop=2]="Crop",tL[tL.Tile=3]="Tile",t.ShapeComponent=function(e){function i(t){(i=e.call(this,t)||this).shapeDirty=!0,i.materialDirty=!0,i.graphicsPath=new u6,i.fills=[],i.strokeAttributes={width:1,alignment:.5,cap:ec.Butt,join:ef.Miter,miterLimit:10},i.strokeWidth=1,i.strokeCap=ec.Butt,i.strokeJoin=ef.Miter,i.strokes=[],i._strokeTrimPath=null,i._fillTrimPath=null,i.fillMaterials=[],i.strokeMaterials=[],i.getHitTestParams=function(t){var e=nl.fromScale(i.transform.size.x,i.transform.size.y,1).premultiply(i.transform.getWorldMatrix());if(t){i.boundingBoxInfo.setGeometry(i.geometry,e);var r=i.boundingBoxInfo.getRawBoundingBoxTriangle();if(r)return{behavior:0,type:r.type,triangles:r.area,backfaceCulling:i.rendererOptions.side===tG.FRONT,clipMasks:i.frameClipMasks}}},i.rendererOptions={renderMode:tq.MESH,blending:tU.ALPHA,texture:i.engine.whiteTexture,occlusion:!1,transparentOcclusion:!1,side:tG.DOUBLE,mask:0};var i,r,n={type:eu.Solid,color:new e8(1,1,1,1)};i.strokes.push(n);var a={type:eu.Solid,color:new e8(1,1,1,1)};return i.fills.push(a),i.shapeAttributes={type:el.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},i.geometry=a1.create(i.engine,{attributes:((r={})[nA.PositionKind]={type:rD.FLOAT,size:3,data:new Float32Array([-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,-.5,0])},r[nA.UVKind]={size:2,offset:0,type:rD.FLOAT,data:new Float32Array([0,1,0,0,1,1,1,0])},r),indices:{data:new Uint16Array([0,1,2,2,1,3])},mode:rD.TRIANGLES,drawCount:6,bufferUsage:rD.DYNAMIC_DRAW}),i.geometry.subMeshes.push({offset:0,indexCount:0,vertexCount:0},{offset:0,indexCount:0,vertexCount:0}),i}iG(i,e);var r=i.prototype;return r.onStart=function(){this.item.getHitTestParams=this.getHitTestParams},r.onUpdate=function(t){if(this.shapeDirty){var e,i,r,n,a=this.computeScreenScale();this.buildPath(this.shapeAttributes,a);var s=null!=(r=null==(e=this._fillTrimPath)?void 0:e.createTrimmedPath(this.graphicsPath,a))?r:this.graphicsPath,o=null!=(n=null==(i=this._strokeTrimPath)?void 0:i.createTrimmedPath(this.graphicsPath,a))?n:this.graphicsPath;this.buildGeometryFromPath(s.shapePath,o.shapePath,a),this.shapeDirty=!1}this.materialDirty&&(this.updateMaterials(),this.materialDirty=!1)},r.render=function(t){this.maskManager.drawStencilMask(t,this),this.draw(t)},r.drawStencilMask=function(t){if(this.isActiveAndEnabled){for(var e=0;e<this.fillMaterials.length;e++)this.maskManager.drawGeometryMask(this.engine.renderer,this.geometry,this.transform.getWorldMatrix(),this.fillMaterials[e],t,0);for(var i=0;i<this.strokeMaterials.length;i++)this.maskManager.drawGeometryMask(this.engine.renderer,this.geometry,this.transform.getWorldMatrix(),this.strokeMaterials[i],t,1)}},r.draw=function(t){for(var e=0;e<this.fillMaterials.length;e++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.fillMaterials[e],0);for(var i=0;i<this.strokeMaterials.length;i++)t.drawGeometry(this.geometry,this.transform.getWorldMatrix(),this.strokeMaterials[i],1)},r.getBoundingBox=function(){var t=this.transform.getWorldMatrix();return this.boundingBoxInfo.setGeometry(this.geometry,t),this.boundingBoxInfo.getBoundingBoxTriangle()},r.getBoundingBoxInfo=function(){var t=this.geometry.getAttributeData(nA.PositionKind);if(t){var e=n1(t,0,t.length/3);e.minimum.x*=this.transform.size.x,e.minimum.y*=this.transform.size.y,e.maximum.x*=this.transform.size.x,e.maximum.y*=this.transform.size.y,this.boundingBoxInfo.reConstruct(e.minimum,e.maximum,this.transform.getWorldMatrix())}return this.boundingBoxInfo},r.buildGeometryFromPath=function(t,e,i){var r=[],n=[];if(this.fills.length>0)for(var a,s=iH(t.shapePrimitives);!(a=s()).done;){var o=a.value.shape,u=[],h=n.length,l=r.length/2;o.build(u,i),o.triangulate(u,r,l,n,h)}var c=n.length;if(this.strokes.length>0)for(var f,d=iH(e.shapePrimitives);!(f=d()).done;){var p=f.value.shape,m=[];n.length;var v=r.length/2,y=this.strokeAttributes;y.cap=this.strokeCap,y.join=this.strokeJoin,y.width=this.strokeWidth;var g=!0;this._strokeTrimPath&&!this._strokeTrimPath.isIdentity()?g=!1:ej(p,aZ)&&(g=p.closePath),p.build(m,i),aF(m,y,!1,g,r,2,v,n)}var x=n.length-c,b=r.length/2,T=this.geometry.getAttributeData(nA.PositionKind),E=this.geometry.getAttributeData(nA.UVKind),C=this.geometry.getIndexData();(!T||T.length<3*b)&&(T=new Float32Array(3*b)),(!E||E.length<2*b)&&(E=new Float32Array(2*b)),(!C||C.length<n.length)&&(C=new Uint16Array(n.length));for(var S=Number.MAX_VALUE,_=Number.MAX_VALUE,w=Number.MIN_VALUE,M=Number.MIN_VALUE,A=0;A<b;A++){var P=3*A,I=2*A,R=r[I],O=r[I+1];T[P]=R,T[P+1]=O,T[P+2]=0,S=Math.min(S,R),_=Math.min(_,O),w=Math.max(w,R),M=Math.max(M,O)}for(var V=w-S,L=M-_,N=0;N<b;N++){var F=3*N,D=2*N;E[D]=(T[F]-S)/V,E[D+1]=(T[F+1]-_)/L}C.set(n),this.updateAttributeData(nA.PositionKind,T,3),this.updateAttributeData(nA.UVKind,E,2),this.geometry.setIndexData(C),this.geometry.setDrawCount(n.length);var k=this.geometry.subMeshes[0],z=this.geometry.subMeshes[1];k.indexCount=c,z.offset=2*c,z.indexCount=x},r.updateAttributeData=function(t,e,i){var r,n=null==(r=this.geometry.getVertexBuffer(t))?void 0:r.getBuffer();if(n&&e.byteLength>n.capacity){this.geometry.setVerticesBuffer(new nA(this.engine,e,t,{updatable:!0,size:i}));return}this.geometry.setAttributeData(t,e)},r.computeScreenScale=function(){var t=this.item.composition;if(!t)return 1;var e=t.camera;if(!e)return 1;var r=e.getModelViewProjection(i.tempMVP,this.transform.getWorldMatrix()).elements,n=Math.abs(r[15])||1,a=Math.sqrt(r[0]*r[0]+r[1]*r[1])/n,s=Math.sqrt(r[4]*r[4]+r[5]*r[5])/n,o=this.engine.canvas.getBoundingClientRect();return Math.max(1,Math.min(2e3,Math.max(o.width,o.height)/2*Math.max(a,s)*this.engine.pixelRatio))},r.buildPath=function(e,i){void 0===i&&(i=1),this.graphicsPath.clear();var r=i;switch(e.type){case el.Custom:for(var n,a=this.shapeAttributes,s=a.points,o=a.easingIns,u=a.easingOuts,h=iH(a.shapes);!(n=h()).done;){var l=n.value,c=l.indexes,f=s[c[0].point];this.graphicsPath.moveTo(f.x,f.y);for(var d=1;d<c.length;d++){var p=c[d],m=c[d-1],v=s[p.point],y=s[m.point],g=u[m.easingOut],x=o[p.easingIn];this.graphicsPath.bezierCurveTo(g.x+y.x,g.y+y.y,x.x+v.x,x.y+v.y,v.x,v.y,void 0,r)}if(l.close){var b=c[0],T=c[c.length-1],E=s[b.point],C=s[T.point],S=u[T.easingOut],_=o[b.easingIn];this.graphicsPath.bezierCurveTo(S.x+C.x,S.y+C.y,_.x+E.x,_.y+E.y,E.x,E.y,void 0,r),this.graphicsPath.closePath()}}break;case el.Ellipse:this.graphicsPath.ellipse(0,0,e.xRadius,e.yRadius);break;case el.Rectangle:this.graphicsPath.rect(-e.width/2,-e.height/2,e.width,e.height,e.roundness);break;case el.Star:this.graphicsPath.polyStar(e.pointCount,e.outerRadius,e.innerRadius,e.outerRoundness,e.innerRoundness,t.StarType.Star);break;case el.Polygon:this.graphicsPath.polyStar(e.pointCount,e.radius,e.radius,e.roundness,e.roundness,t.StarType.Polygon)}},r.updateMaterials=function(){for(var t=0;t<this.fills.length;t++)this.updatePaintMaterial(this.fillMaterials[t],this.fills[t]);for(var e=0;e<this.strokes.length;e++)this.updatePaintMaterial(this.strokeMaterials[e],this.strokes[e])},r.updatePaintMaterial=function(t,e){if(t.setFloat("_FillType",e.type),e.type===eu.Solid)t.color=e.color;else if(e.type===eu.GradientLinear||e.type===eu.GradientAngular||e.type===eu.GradientRadial)this.updateGradientMaterial(t,e.gradientStops,e.startPoint,e.endPoint);else if(e.type===eu.Texture){t.setInt("_ImageScaleMode",e.scaleMode),t.setVector2("_ImageSize",new e4(e.texture.getWidth(),e.texture.getHeight()));var i=this.getBoundingBox(),r=i.area[0].p1,n=i.area[1].p2;t.setVector2("_DestSize",new e4(r.x-n.x,r.y-n.y)),t.setFloat("_ImageOpacity",e.opacity),t.setFloat("_ImageScalingFactor",e.scalingFactor),t.setTexture("_ImageTex",e.texture);var a=e.textureTransform;t.setMatrix3("_TextureTransform",new nf().scale(a.scale.x,a.scale.y).rotate(a.rotation).translate(a.offset.x,a.offset.y).invert())}},r.updateGradientMaterial=function(t,e,i,r){for(var n,a=[],s=[],o=iH(e.stops);!(n=o()).done;){var u=n.value,h=u.color;a.push(new e6(h.r,h.g,h.b,h.a)),s.push(u.time)}t.setVector4Array("_Colors",a),t.setFloats("_Stops",s),t.setInt("_StopsCount",s.length),t.setVector2("_StartPoint",i),t.setVector2("_EndPoint",r)},r.createMaterialFromRendererOptions=function(e){var i={shader:{vertex:"precision highp float;attribute vec3 aPos;attribute vec2 aUV;varying vec2 uv0;uniform mat4 effects_MatrixVP;uniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;void main(){vec4 pos=vec4(aPos.xyz,1.0);uv0=aUV;gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}",fragment:"precision highp float;\n#define _MAX_STOPS 8\n#define PI 3.14159265359\nuniform vec4 _Color;uniform vec4 _Colors[_MAX_STOPS];uniform float _Stops[_MAX_STOPS];uniform int _StopsCount;uniform float _FillType;uniform vec2 _StartPoint;uniform vec2 _EndPoint;uniform sampler2D _ImageTex;uniform vec2 _ImageSize;uniform vec2 _DestSize;uniform int _ImageScaleMode;uniform mat3 _TextureTransform;uniform float _ImageScalingFactor;uniform float _ImageOpacity;varying vec2 uv0;float calculateAngleRatio(vec2 v1,vec2 v2){float angle=atan(v2.y,v2.x)-atan(v1.y,v1.x);if(angle<0.0)angle+=2.0*PI;return angle/(2.0*PI);}vec2 applyTransform(mat3 m,vec2 uv){uv=uv-vec2(0.5,0.5);vec3 p=m*vec3(uv,1.0);p.xy=p.xy+vec2(0.5,0.5);return p.xy;}void main(){vec4 finalColor=vec4(1.0);if(_FillType==0.0){finalColor=_Color;}else if(_FillType==1.0||_FillType==2.0||_FillType==3.0){float t=0.0;if(_FillType==1.0){vec2 gradientVector=_EndPoint-_StartPoint;vec2 pixelVector=uv0-_StartPoint;float denom=max(dot(gradientVector,gradientVector),1e-6);t=clamp(dot(pixelVector,gradientVector)/denom,0.0,1.0);}else if(_FillType==2.0){float maxRadius=max(distance(_EndPoint,_StartPoint),0.001);t=clamp(distance(uv0,_StartPoint)/maxRadius,0.0,1.0);}else{vec2 center=_StartPoint;vec2 referenceVector=_EndPoint-center;vec2 targetVector=uv0-center;if(length(targetVector)>0.001){t=calculateAngleRatio(referenceVector,targetVector);}}if(_StopsCount>0){finalColor=_Colors[0];for(int i=1;i<_MAX_STOPS;i++){if(i>=_StopsCount)break;float localT=smoothstep(_Stops[i-1],_Stops[i],t);finalColor=mix(finalColor,_Colors[i],localT);}}}else if(_FillType==4.0){vec2 uv=uv0;float rSrc=_ImageSize.x/max(_ImageSize.y,1.0);float rDst=_DestSize.x/max(_DestSize.y,1.0);bool maskOutside=false;if(_ImageScaleMode==0){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(1.0,rSrc/rDst);}else{scale=vec2(rDst/rSrc,1.0);}uv=(uv-0.5)*scale+0.5;uv=clamp(uv,0.0,1.0);}else if(_ImageScaleMode==1){vec2 scale=vec2(1.0);if(rDst>rSrc){scale=vec2(rSrc/rDst,1.0);}else{scale=vec2(1.0,rSrc/rDst);}uv=(uv-0.5)*scale+0.5;maskOutside=true;}else if(_ImageScaleMode==2){uv=applyTransform(_TextureTransform,uv0);maskOutside=true;}else if(_ImageScaleMode==3){float aspectFix=rDst/max(rSrc,1e-6);vec2 uvTile=(uv0-0.5)*vec2(aspectFix,1.0)+0.5;float s=max(abs(_ImageScalingFactor),1e-6);uv=fract(uvTile*s);}vec4 img=texture2D(_ImageTex,uv);if(maskOutside){if(uv.x<0.0||uv.x>1.0||uv.y<0.0||uv.y>1.0){img.a=0.0;}}img.a*=_ImageOpacity;finalColor=img;}finalColor.rgb*=finalColor.a;gl_FragColor=finalColor;}",glslVersion:t.GLSLVersion.GLSL1}},r=nb.create(this.engine,i),n=e.side,a=e.occlusion,s=e.blending,o=e.texture;r.blending=!0,r.depthTest=!0,r.depthMask=a,rG(r,s),rj(r,n),r.shader.shaderData.properties='_ImageTex("_ImageTex",2D) = "white" {}',r.setVector4("_TexOffset",new e6(0,0,1,1)),r.setTexture("_ImageTex",o);var u=rU(s),h=new e6;return h.x=e.occlusion?+e.transparentOcclusion:1,h.y=u,h.z=e.renderMode,r.setVector4("_TexParams",h),0===h.x||this.maskManager.alphaMaskEnabled?r.enableMacro("ALPHA_CLIP"):r.disableMacro("ALPHA_CLIP"),r},r.fromData=function(t){e.prototype.fromData.call(this,t),this.shapeDirty=!0,t.mask&&this.maskManager.setMaskOptions(this.engine,t.mask);var i=null!=(r=t.renderer)?r:{};this.rendererOptions={renderMode:tq.MESH,blending:null!=(n=i.blending)?n:tU.ALPHA,texture:i.texture?this.engine.findObject(i.texture):this.engine.whiteTexture,occlusion:!!i.occlusion,transparentOcclusion:!!i.transparentOcclusion||this.maskManager.isMask,side:null!=(a=i.side)?a:tG.DOUBLE,mask:1},this.strokeCap=null!=(s=t.strokeCap)?s:ec.Butt,this.strokeWidth=null!=(o=t.strokeWidth)?o:1,this.strokeJoin=null!=(u=t.strokeJoin)?u:ef.Miter,this._strokeTrimPath=null,this._fillTrimPath=null,t.strokeTrimPath&&(this._strokeTrimPath=new u8,this._strokeTrimPath.fromData(t.strokeTrimPath)),t.fillTrimPath&&(this._fillTrimPath=new u8,this._fillTrimPath.fromData(t.fillTrimPath)),this.fills.length=0,this.fillMaterials.length=0;for(var r,n,a,s,o,u,h,l=iH(t.fills);!(h=l()).done;){var c=h.value;this.fills.push(this.createPaint(c)),this.fillMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions))}this.strokes.length=0,this.strokeMaterials.length=0;for(var f,d=iH(t.strokes);!(f=d()).done;){var p=f.value;this.strokes.push(this.createPaint(p)),this.strokeMaterials.push(this.createMaterialFromRendererOptions(this.rendererOptions))}switch(this.materials=[].concat(this.fillMaterials,this.strokeMaterials),t.type){case el.Custom:for(var m,v={type:el.Custom,points:[],easingIns:[],easingOuts:[],shapes:[]},y=iH(t.points);!(m=y()).done;){var g=m.value;v.points.push(new e4(g.x,g.y))}for(var x,b=iH(t.easingIns);!(x=b()).done;){var T=x.value;v.easingIns.push(new e4(T.x,T.y))}for(var E,C=iH(t.easingOuts);!(E=C()).done;){var S=E.value;v.easingOuts.push(new e4(S.x,S.y))}v.shapes=t.shapes,this.shapeAttributes=v;break;case el.Ellipse:var _={type:el.Ellipse,xRadius:t.xRadius,yRadius:t.yRadius};this.shapeAttributes=_;break;case el.Rectangle:var w={type:el.Rectangle,width:t.width,height:t.height,roundness:t.roundness};this.shapeAttributes=w;break;case el.Star:var M={type:el.Star,pointCount:t.pointCount,innerRadius:t.innerRadius,outerRadius:t.outerRadius,innerRoundness:t.innerRoundness,outerRoundness:t.outerRoundness};this.shapeAttributes=M;break;case el.Polygon:var A={type:el.Polygon,pointCount:t.pointCount,radius:t.radius,roundness:t.roundness};this.shapeAttributes=A}},r.createPaint=function(t){var e;switch(t.type){case eu.Solid:e={type:t.type,color:new e8().copyFrom(t.color)};break;case eu.GradientLinear:case eu.GradientAngular:case eu.GradientRadial:e={type:t.type,gradientStops:aI(t.gradientStops),startPoint:new e4().copyFrom(t.startPoint),endPoint:new e4().copyFrom(t.endPoint)};break;case eu.Texture:var i,r,n,a=re({offset:{x:0,y:0},rotation:0,scale:{x:1,y:1}},null!=(i=t.textureTransform)?i:{});e={type:t.type,texture:this.engine.findObject(t.texture),scaleMode:t.scaleMode,scalingFactor:null!=(r=t.scalingFactor)?r:1,opacity:null!=(n=t.opacity)?n:1,textureTransform:{offset:new e4().copyFrom(a.offset),rotation:a.rotation,scale:new e4().copyFrom(a.scale)}}}return e},r.onApplyAnimationProperties=function(){this.shapeDirty=!0,this.materialDirty=!0},rV(i,[{key:"shape",get:function(){return this.shapeAttributes}},{key:"strokeTrimPath",get:function(){return this._strokeTrimPath}},{key:"fillTrimPath",get:function(){return this._fillTrimPath}}]),i}(nV),t.ShapeComponent.tempMVP=nl.fromIdentity(),t.ShapeComponent=eW([iK("ShapeComponent")],t.ShapeComponent);var u9=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(i$);t.BinaryAsset=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e}(i$),eW([iJ(void 0,void 0)],t.BinaryAsset.prototype,"buffer",void 0),t.BinaryAsset=eW([iK(ey.BinaryAsset)],t.BinaryAsset);var u7=function(){function t(){}return t.serialize=function(e,i){e.toData(),i||(i={});var r=iQ(e);if(r)for(var n,a=iH(Object.keys(r));!(n=a()).done;){var s=n.value,o=e[s];"number"==typeof o||"string"==typeof o||"boolean"==typeof o||t.checkTypedArray(o)?i[s]=o:iS(o)?(i[s]||(i[s]=[]),t.serializeArrayProperty(o,i[s],0)):i$.is(o)?i[s]={id:o.getInstanceId()}:iw(o)&&(i[s]||(i[s]={}),t.serializeObjectProperty(o,i[s],0))}for(var u,h=iH(Object.keys(e.definition));!(u=h()).done;){var l=u.value,c=e.definition[l];"number"==typeof c||"string"==typeof c||"boolean"==typeof c||t.checkTypedArray(c)?i[l]=c:iS(c)?(i[l]||(i[l]=[]),t.serializeArrayProperty(c,i[l],0)):i$.is(c)?i[l]={id:c.getInstanceId()}:iw(c)&&(i[l]||(i[l]={}),t.serializeObjectProperty(c,i[l],0))}return i},t.deserialize=function(e,i){i.definition=e;var r=iQ(i),n=i.engine;if(r)for(var a,s=iH(Object.keys(r));!(a=s()).done;){var o=a.value,u=e[o];if(void 0!==u){var h=r[o].type;i[o]=t.deserializeProperty(u,n,0,h)}}i.fromData(i.definition)},t.checkTypedArray=function(t){return ej(t,Int8Array)||ej(t,Uint8Array)||ej(t,Uint8ClampedArray)||ej(t,Int16Array)||ej(t,Uint16Array)||ej(t,Int32Array)||ej(t,Uint32Array)||ej(t,Float32Array)||ej(t,Float64Array)||ej(t,ArrayBuffer)},t.checkDataPath=function(t){return!!(iw(t)&&1===Object.keys(t).length&&"id"in t&&iC(t.id))},t.checkGLTFNode=function(t){return iw(t)&&void 0!==t.nodeIndex&&void 0!==t.isJoint},t.checkImageSource=function(t){return iA(t)||ej(t,HTMLImageElement)},t.deserializeProperty=function(e,i,r,n,a){if(void 0===a&&(a=!0),r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}if(iS(e)){for(var s,o=[],u=iH(e);!(s=u()).done;){var h=s.value;o.push(t.deserializeProperty(h,i,r+1,n,a))}return o}if(t.checkDataPath(e)){var l=i.findObject(e);return a?l:e}if(!iM(e))return e;c=n?new n:{};for(var c,f,d=iH(Object.keys(e));!(f=d()).done;){var p=f.value;c[p]=t.deserializeProperty(e[p],i,r+1,void 0,a)}return c},t.serializeObjectProperty=function(e,i,r){if(r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}i||(i={});for(var n,a=iH(Object.keys(e));!(n=a()).done;){var s=n.value,o=e[s];"number"==typeof o||"string"==typeof o||"boolean"==typeof o||t.checkTypedArray(e)?i[s]=o:iS(o)?(i[s]||(i[s]=[]),t.serializeArrayProperty(o,i[s],r+1)):i$.is(o)?i[s]={id:o.getInstanceId()}:iw(o)&&(i[s]||(i[s]={}),t.serializeObjectProperty(o,i[s],r+1))}},t.serializeArrayProperty=function(e,i,r){if(r>14){console.error("The nested object layers of the serialized data exceed the maximum limit.");return}i||(i=[]);for(var n=0;n<e.length;n++){var a=e[n];"number"==typeof a||"string"==typeof a||"boolean"==typeof a||t.checkTypedArray(e)?i[n]=a:iS(a)?(i[n]||(i[n]=[]),t.serializeArrayProperty(a,i[n],r+1)):i$.is(a)?i[n]={id:a.getInstanceId()}:iw(a)&&(i[n]||(i[n]={}),t.serializeObjectProperty(a,i[n],r+1))}},t}(),ht=function(){function t(t){this.engine=t}var e=t.prototype;return e.loadGUID=function(t){if(!t)return null;var e,i=t.id,r=this.findData(i);if(!r){console.warn("Object data with uuid: "+i+" not found.");return}switch(r.dataType){case ey.Material:e=nb.create(this.engine);break;case ey.Geometry:e=a1.create(this.engine);break;case ey.Texture:e=ne.create(this.engine);break;default:var n=iq[r.dataType];n&&(e=new n(this.engine))}if(!e){console.warn("Constructor for DataType: "+r.dataType+" not found.");return}return e.setInstanceId(r.id),this.engine.addInstance(e),u7.deserialize(r,e),e},e.findData=function(t){return this.engine.jsonSceneData[t]},t}(),he=function(){function t(){}return t.prototype.loadGUID=function(t){return eG(function(){return eX(this,function(t){return[2,void 0]})})()},t}();function hi(t,e){if(!t.includes(e))return t.push(e),!0}function hr(t){if(Number.isFinite(t))return[t0.CONSTANT,t];if(t){var e=t[0],i=t[1];if(Array.isArray(e))return;if("static"===e||e===t0.CONSTANT)return[t0.CONSTANT,t[1]];if("lines"===e)return[t0.LINE,t[1]];if(e===t0.LINE){var r=i.map(function(t){return[t1.LINE,t]});return[t0.BEZIER_CURVE,r]}return"curve"===e||e===t0.CURVE?[t0.BEZIER_CURVE,hb(i)]:t}}function hn(t,e){return Array.isArray(t)&&"random"===t[0]?[t0.CONSTANT,t[1][e]]:hr(t)}function ha(t){return t&&"color"===t[0]?hu(t[1],!0):[1,1,1,1]}function hs(t){return t&&"random"===t[0]?[t0.RANDOM,t[1]]:hr(t)}function ho(t,e){if(t){var i=[];return Object.getOwnPropertyNames(t).forEach(function(r){var n,a=(n=/^(-)?([\d+.]+)%$/.exec(r))?+n[2]/100*(n[1]?-1:1):+r,s=hu(t[r],e);i.push([a,s[0],s[1],s[2],s[3]])}),i=i.sort(function(t,e){return t[0]-e[0]}),[t0.GRADIENT_COLOR,i]}}function hu(t,e){var i;if("string"==typeof t){t=t.replace(/[\s\t\r\n]/g,"");var r=/rgba?\(([.\d]+),([.\d]+),([.\d]+),?([.\d]+)?\)/.exec(t);if(r){var n=+r[4];i=[+r[1],+r[2],+r[3],isNaN(n)?255:Math.round(255*n)]}else/^#[a-f\d]{3}$/i.test(t)?i=[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),255]:(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))&&(i=[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),255])}else ej(t,Array)&&(i=[t[0],t[1],t[2],isNaN(t[3])?255:Math.round(255*t[3])]);return e&&(i=hh(i)),i}function hh(t){if(Array.isArray(t))return t.map(function(t){return Number.isFinite(t/255)?Number((t/255).toFixed(6)):0})}function hl(t,e){return Array.isArray(t)?t[0]===t0.GRADIENT_COLOR?t:("gradient"===t[0]||"color"===t[0])&&ho(t[1],e):ho(t,e)}function hc(t){if(t){if(3===t.length)return[t0.CONSTANT_VEC3,t];var e=t[0];if("path"===e||"bezier"===e||e===t0.BEZIER_PATH||e===t0.LINEAR_PATH){var i=t[1],r=i[0],n=i[1],a=i[2],s=hb(r);if(!a){a=[];for(var o=0;o<n.length;o++){var u=n[o].slice();0===o||o<n.length-1&&a.push(u),a.push(u)}}return[t0.BEZIER_CURVE_PATH,[s,n,a]]}return t}}function hf(t){for(var e,i=iH(Object.keys(t));!(e=i()).done;){var r=e.value;t[r]=Number(t[r])}return t}function hd(t){for(var e,i=iH(Object.keys(t));!(e=i()).done;){var r=e.value;void 0===t[r]&&delete t[r]}return t}var hp=Math.cos,hm=Math.sin,hv=Math.PI/180,hy=180/Math.PI;function hg(t,e){return t?[t[0]-.5,.5-t[1]]:e?hx[e]:[0,0]}var hx=((eO={})[tK.PARTICLE_ORIGIN_CENTER]=[0,0],eO[tK.PARTICLE_ORIGIN_CENTER_BOTTOM]=[0,-.5],eO[tK.PARTICLE_ORIGIN_CENTER_TOP]=[0,.5],eO[tK.PARTICLE_ORIGIN_LEFT_TOP]=[-.5,.5],eO[tK.PARTICLE_ORIGIN_LEFT_CENTER]=[-.5,0],eO[tK.PARTICLE_ORIGIN_LEFT_BOTTOM]=[-.5,-.5],eO[tK.PARTICLE_ORIGIN_RIGHT_CENTER]=[.5,0],eO[tK.PARTICLE_ORIGIN_RIGHT_BOTTOM]=[.5,-.5],eO[tK.PARTICLE_ORIGIN_RIGHT_TOP]=[.5,.5],eO);function hb(t){for(var e=-1e6,i=1e6,r=0;r<t.length;r++)e=Math.max(e,t[r][1]),i=Math.min(i,t[r][1]);for(var n=[[t[0][0],t[0][1]]],a=0;a<t.length-1;a++){var s=t[a][3]*(e-i),o=t[a+1][2]*(e-i),u=[t[a][0],t[a][1]],h=[t[a+1][0],t[a+1][1]];if(u[0]!=h[0]){var l=function(t,e,i,r){var n=i[0],a=i[1],s=r[0],o=r[1],u=s-n;return[[n+(s-n)/3,a+(t*=u)/3],[s-(s-n)/3,o-(e*=u)/3]]}(s,o,u,h),c=l[0],f=l[1];n[n.length-1].push(c[0]),n[n.length-1].push(c[1]),n.push([f[0],f[1],h[0],h[1]])}else n[n.length-1].push(h[0]),n[n.length-1].push(h[1])}return n.map(function(t,e){return 0===e?[t1.EASE_OUT,t]:e===n.length-1?[t1.EASE_IN,t]:[t1.EASE,t]})}var hT=new Map,hE=new Map;function hC(t){return t.compositions.forEach(function(t){t.items.forEach(function(t){t.type===tZ.null&&t.endBehavior===t2.destroy&&(t.endBehavior=t2.freeze)})}),t.version=tz["2_1"],t}function hS(t){for(var e,i=re({},t,{items:[],compositions:[],components:[],materials:[],shaders:[],geometries:[],animations:[],miscs:[]}),r=iH(i.images);!(e=r()).done;)e.value.id=iR();if(null!=i.textures||(i.textures=[]),i.textures.forEach(function(t){var e;t.id=iR(),t.dataType=ey.Texture,t.source={id:null==(e=i.images[t.source])?void 0:e.id}}),i.textures.length<i.images.length)for(var n=i.textures.length;n<i.images.length;n++)i.textures.push({id:iR(),dataType:ey.Texture,source:{id:i.images[n].id},flipY:!0});t.bins&&(a=t.bins,i.bins=a.map(function(t){return{url:t.url,dataType:"BinaryAsset",id:iR()}}));for(var a,s,o={},u={},h=iH(t.compositions);!(s=h()).done;)!function(){var t=s.value;(3===t.endBehavior||1===t.endBehavior)&&(t.endBehavior=t2.freeze),t.items=t.items.filter(function(t){return"8"!==t.type}),t.items.forEach(function(t){t.type===tZ.particle&&t.content.filter&&delete t.content.filter});for(var e,r=iH(t.items);!(e=r()).done;){var n=e.value;o[n.id]=iR(),n.oldId=n.id,n.id=o[n.id],u[n.id]=n}t.items.forEach(function(e,r){if(e.parentId){if(e.parentId.includes("^")){var n=e.parentId.split("^")[0],a=e.parentId.split("^")[1];e.parentId=o[n]+"^"+a}else e.parentId=o[e.parentId]}i.items.push(e),t.items[r]={id:e.id}});var a=re({},t,{timelineAsset:{id:""},sceneBindings:[]});i.compositions.push(a),function(t,e,i){for(var r,n=[],a=[],s=[],o={tracks:[],id:iR(),dataType:"TimelineAsset"},u=iH(t.items);!(r=u()).done;){var h=e[r.value.id],l=[],c={id:iR(),dataType:"ActivationPlayableAsset"};s.push(c);var f={id:iR(),dataType:"ActivationTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:c.id}}]};if(l.push({id:f.id}),a.push(f),h.type!==tZ.particle){var d={id:iR(),dataType:"TransformPlayableAsset",sizeOverLifetime:h.content.sizeOverLifetime,rotationOverLifetime:h.content.rotationOverLifetime,positionOverLifetime:h.content.positionOverLifetime};s.push(d);var p={id:iR(),dataType:"TransformTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:d.id}}]};l.push({id:p.id}),a.push(p)}if(h.type===tZ.sprite||h.type===tZ.text){var m={id:iR(),dataType:"SpriteColorPlayableAsset",colorOverLifetime:h.content.colorOverLifetime};s.push(m);var v={id:iR(),dataType:"SpriteColorTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:m.id}}]};l.push({id:v.id}),a.push(v)}if(h.type===tZ.composition){var y={id:iR(),dataType:"SubCompositionPlayableAsset"};s.push(y);var g={id:iR(),dataType:"SubCompositionTrack",children:[],clips:[{start:h.delay,duration:h.duration,endBehavior:h.endBehavior,asset:{id:y.id}}]};l.push({id:g.id}),a.push(g)}var x={id:iR(),dataType:"ObjectBindingTrack",children:l,clips:[]};a.push(x),o.tracks.push({id:x.id}),n.push({key:{id:x.id},value:{id:h.id}})}for(var b,T=[],E=iH(a);!(b=E()).done;){var C=b.value;T.push({id:C.id})}t.timelineAsset={id:o.id},t.sceneBindings=n,i.miscs.push(o);for(var S,_=iH(a);!(S=_()).done;){var w=S.value;i.miscs.push(w)}for(var M,A=iH(s);!(M=A()).done;){var P=M.value;i.miscs.push(P)}}(a,u,i)}();for(var l,c=iH(i.items);!(l=c()).done;){var f=l.value;if(f.content){if(f.content.renderer&&void 0!==f.content.renderer.texture){var d=f.content.renderer.texture;f.content.renderer.texture={id:i.textures[d].id}}if(f.content.trails&&void 0!==f.content.trails.texture){var p=f.content.trails.texture;f.content.trails.texture={id:i.textures[p].id}}}if(f.transform){var m=[].concat(null!=(g=f.transform.position)?g:[0,0,0]),v=[].concat(null!=(x=f.transform.rotation)?x:[0,0,0]),y=[].concat(null!=(b=f.transform.scale)?b:[1,1,1]);if(Object.assign(f,{transform:{position:{x:m[0],y:m[1],z:m[2]},eulerHint:{x:v[0],y:v[1],z:v[2]},scale:{x:y[0],y:y[1],z:y[0]}}}),f.type===tZ.sprite&&(f.transform.size={x:y[0],y:y[1]},f.transform.scale={x:1,y:1,z:1}),f.type===tZ.sprite){var g,x,b,T,E,C,S,_=f.content;_.renderer||(_.renderer={});var w=_.renderer,M=hg(w.anchor,w.particleOrigin),A=f.transform.size;w.anchor||void 0===w.particleOrigin||(f.transform.position.x+=-M[0]*(null!=(T=null==A?void 0:A.x)?T:1),f.transform.position.y+=-M[1]*(null!=(E=null==A?void 0:A.y)?E:1)),f.transform.anchor={x:M[0]*(null!=(C=null==A?void 0:A.x)?C:1),y:M[1]*(null!=(S=null==A?void 0:A.y)?S:1)}}}if(f.type===tZ.particle){var P=f.content;P.renderer||(P.renderer={});var I=P.renderer;P.renderer.anchor=hg(I.anchor,I.particleOrigin)}if(f.type===tZ.camera&&f.content.positionOverLifetime&&0!==Object.keys(f.content.positionOverLifetime).length&&(f.content.positionOverLifetime.asMovement=!0),void 0!==f.pn){var R=f.pn,O=t.plugins,V=void 0===O?[]:O;void 0!==R&&Number.isInteger(R)&&(f.pluginName=V[R])}switch("editor-gizmo"===f.pluginName&&(f.type="editor-gizmo"),"orientation-transformer"===f.pluginName&&(f.type="orientation-transformer"),f.content.options.target&&"editor-gizmo"===f.pluginName&&(f.content.options.target=o[f.content.options.target]),f.type===tZ.spine&&t.spines&&0!==t.spines.length&&function(t,e,i){e.resource={atlas:{bins:{id:i.bins[t.atlas[1][0]].id},source:t.atlas[1].slice(1)},skeleton:{bins:{id:i.bins[t.skeleton[1][0]].id},source:t.skeleton[1].slice(1)},skeletonType:t.skeletonType,images:t.images.map(function(t){return{id:i.textures[t].id}})}}(t.spines[f.content.options.spine],f.content,i),(f.type===tZ.sprite||f.type===tZ.particle||f.type===tZ.mesh||f.type===tZ.skybox||f.type===tZ.light||"camera"===f.type||f.type===tZ.tree||f.type===tZ.interact||f.type===tZ.camera||f.type===tZ.text||f.type===tZ.spine||"editor-gizmo"===f.type||"orientation-transformer"===f.type)&&(f.components=[],i.components.push(f.content),f.content.id=iR(),f.content.item={id:f.id},f.dataType=ey.VFXItemData,f.components.push({id:f.content.id})),(f.type===tZ.null||f.type===tZ.composition)&&(f.components=[],f.dataType=ey.VFXItemData),f.type){case tZ.sprite:f.content.dataType=ey.SpriteComponent;break;case tZ.particle:f.content.dataType=ey.ParticleSystem;break;case tZ.mesh:f.content.dataType=ey.MeshComponent;break;case tZ.skybox:f.content.dataType=ey.SkyboxComponent;break;case tZ.light:f.content.dataType=ey.LightComponent;break;case"camera":f.content.dataType=ey.CameraComponent;break;case"editor-gizmo":f.content.dataType="GizmoComponent";break;case"orientation-transformer":f.content.dataType="OrientationComponent";break;case tZ.tree:f.content.dataType=ey.TreeComponent;break;case tZ.interact:f.content.dataType=ey.InteractComponent;break;case tZ.camera:f.content.dataType=ey.CameraController;break;case tZ.text:f.content.dataType=ey.TextComponent;break;case tZ.spine:f.content.dataType=ey.SpineComponent}}return i.version=tz["3_0"],i}function h_(t){for(var e,i=iH(t.components);!(e=i()).done;){var r=e.value;if(r.dataType===ey.ShapeComponent&&r.type===el.Custom){(null==(n=r.shapes)?void 0:n.length)>0&&r.shapes[0].fill&&(r.fill=r.shapes[0].fill);for(var n,a,s=Array(r.easingIns.length),o=Array(r.easingOuts.length).fill(!1),u=iH(r.shapes);!(a=u()).done;)for(var h,l=a.value,c=iH(l.indexes);!(h=c()).done;){var f=h.value,d=r.points[f.point],p=r.easingIns[f.easingIn],m=r.easingOuts[f.easingOut];s[f.easingIn]||(p.x-=d.x,p.y-=d.y,s[f.easingIn]=!0),o[f.easingOut]||(m.x-=d.x,m.y-=d.y,o[f.easingOut]=!0)}}}return t.version=tz["3_2"],t}function hw(e){hT.clear(),hE.clear();for(var i,r=e.compositions,n=e.items,a=e.components,s=iH(a);!(i=s()).done;){var o=i.value;hT.set(o.id,o)}for(var u,h=iH(n);!(u=h()).done;){var l=u.value;hE.set(l.id,l)}for(var c,f=iH(r);!(c=f()).done;)!function(e){for(var i,r=iH(e.items);!(i=r()).done;){var n=i.value,a=hE.get(n.id);if(!a)return;if(a.type===tZ.sprite||a.type===tZ.particle||a.type===tZ.spine||a.type===tZ.text||a.type===tZ.richtext||a.type===tZ.video||a.type===tZ.shape){var s=hT.get(a.components[0].id);s&&function(e){var i=e.renderer,r=null==i?void 0:i.maskMode;r&&r!==t.MaskMode.NONE&&(r===t.MaskMode.MASK?(e.mask={isMask:!0},eV=e.id):(r===tj.OBSCURED||r===tj.REVERSE_OBSCURED)&&(e.mask={inverted:r===tj.REVERSE_OBSCURED,reference:{id:eV}}))}(s)}}}(c.value);return e.version=tz["3_3"],e}function hM(t){null==(e=t.plugins)||e.forEach(function(e,i){"richtext"===e&&(t.plugins[i]="rich-text")});for(var e,i,r=iH(t.items);!(i=r()).done;){var n=i.value;if(n.type===tZ.sprite){var a=hT.get(n.components[0].id);if(a){var s,o=a.renderer.shape,u=void 0;u=Number.isInteger(o)?null==(s=t.shapes)?void 0:s[o]:o,a.renderer.shape=u}}}for(var h,l=t.compositionId,c={},f=iH(t.compositions);!(h=f()).done;){var d=h.value,p=iR();c[d.id]=p,d.id===l&&(t.compositionId=p),d.id=p;var m={id:iR(),dataType:"CompositionComponent",items:d.items,timelineAsset:d.timelineAsset,sceneBindings:d.sceneBindings,item:{id:d.id}};d.timelineAsset=void 0,d.sceneBindings=void 0,d.components=[{id:m.id}],t.components.push(m)}for(var v,y=iH(t.items);!(v=y()).done;){var g=v.value;if(g.content){var x=g.content.options;x&&void 0!==x.refId&&(x.refId=c[x.refId])}}return t.version=tz["3_4"],t}function hA(t){for(var e,i={},r=iH(t.components);!(e=r()).done;){var n=e.value;i[n.id]=n}for(var a,s=iH(t.compositions);!(a=s()).done;)for(var o,u=a.value,h=iH(u.components);!(o=h()).done;)i[o.value.id].item.id=u.id;for(var l,c=iH(t.components);!(l=c()).done;){var f=l.value;if(f.dataType===ey.SpriteComponent){var d=f.renderer.shape;if(null!=d&&!("aPoint"in d&&"index"in d)){var p=function(t,e){void 0===e&&(e="形状");for(var i=o9(t),r=i.index,n=void 0===r?[]:r,a=i.aPoint,s=void 0===a?[]:a,o=new Float32Array(s),u=[],h=[],l=0;l<o.length;l+=6)h.push(s[l+2],s[l+3]),u.push(o[l],o[l+1],0);var c=u.length/3,f=n.length,d=4*u.length,p=d+4*h.length,m=2*n.length,v={mode:eg.TRIANGLES,vertexData:{vertexCount:c,channels:[]},name:e,indexFormat:eb.UInt16,indexOffset:p,buffer:"",id:iR(),dataType:ey.Geometry,subMeshes:[]};v.vertexData.channels.push({semantic:eT.Position,offset:0,format:ex.Float32,dimension:3}),v.vertexData.channels.push({semantic:eT.Uv,offset:d,format:ex.Float32,dimension:2}),v.subMeshes.push({offset:0,indexCount:f,vertexCount:c});var y=new ArrayBuffer(p+m+(m%4==0?0:2)),g=new Float32Array(y);g.set(u,0),g.set(h,u.length),new Uint16Array(y,p).set(n,0);var x=new Uint8Array(y).slice(0,p+m);return v.binaryData=x,v}(d);f.geometry={id:p.id},t.geometries.push(p)}}if(f.dataType===ey.ShapeComponent){if(f.fills=[],f.fill){var m={type:eu.Solid,color:f.fill.color};f.fills.push(m)}if(delete f.fill,f.strokes=[],f.stroke){var v={type:eu.Solid,color:f.stroke.color};f.strokes.push(v),f.strokeWidth=f.stroke.width,f.strokeCap=f.stroke.cap,f.strokeJoin=f.stroke.join,delete f.stroke}}}return t.version=tz["3_5"],t}function hP(t){if(t.components)for(var e,i=iH(t.components);!(e=i()).done;){var r,n=e.value;n.dataType===ey.RichTextComponent&&n.options&&void 0===n.options.useLegacyRichText&&(void 0===n.options.lineGap?n.options.useLegacyRichText=!0:n.options.useLegacyRichText=!1),n.dataType!==ey.TextComponent&&(n.dataType!==ey.RichTextComponent||!n.options)||(r=n.options)&&void 0===r.TextVerticalAlign&&void 0===r.TextVerticalAlign&&(r.TextVerticalAlign=r.textBaseline),n.dataType===ey.TextComponent&&function(t){if(t&&t.textColor){var e,i=t.textColor;t.textColor=[i[0]/255,i[1]/255,i[2]/255,null!=(e=i[3])?e:1]}}(n.options)}return t.version=tz["3_6"],t}function hI(t){for(var e,i,r=[],n=iH(t.items);!(i=n()).done;)!function(){var e=i.value;if(e.type===tZ.text&&e.transform){for(var n,a,s,o=t.components.find(function(t){return e.components[0].id===t.id}),u=e.transform.scale.x/(null!=(a=null==(n=o.options)?void 0:n.textWidth)?a:1),h=u/.0123,l=e.transform.scale.x,c=e.transform.scale.y,f=e.transform.scale.z,d=iH(t.items);!(s=d()).done;){var p=s.value;p.parentId===e.id&&p.transform&&(p.transform.scale.x*=l/h,p.transform.scale.y*=c/h,p.transform.scale.z*=f/h)}e.transform.scale.x=h,e.transform.scale.y=h,e.transform.scale.z=h,r.push({item:e,scaleFactor:h,oldScaleX:l,oldScaleY:c,oldScaleZ:f})}}();r.length>0&&(null==(e=t.animations)?void 0:e.length)&&function(t,e){for(var i,r=new Map,n=new Map,a=iH(t.items);!(i=a()).done;){var s=i.value;if(r.set(s.id,s),s.parentId){var o=n.get(s.parentId);o||(o=[],n.set(s.parentId,o)),o.push(s)}}for(var u,h=new Map,l=new Map,c=iH(e);!(u=c()).done;){var f=u.value;h.set(f.item.id,f);var d=n.get(f.item.id);if(d)for(var p,m=iH(d);!(p=m()).done;){var v=p.value;l.set(v.id,f)}}for(var y,g=new Map,x=iH(t.components);!(y=x()).done;){var b=y.value;g.set(b.id,b)}for(var T,E=new Map,C=iH(t.animations);!(T=C()).done;){var S=T.value;E.set(S.id,S)}for(var _,w=iH(t.compositions);!(_=w()).done;){for(var M,A,P,I=_.value,R=void 0,O=void 0,V=iH(I.components);!(P=V()).done;){var L=P.value,N=g.get(L.id);if((null==N?void 0:N.dataType)===ey.Animator?R=N:(null==N?void 0:N.dataType)===ey.CompositionComponent&&(O=N),R&&O)break}if(R){var F=void 0;if(O){var D=O.items;if(D){F=[];for(var k,z=iH(D);!(k=z()).done;){var B=k.value,U=r.get(B.id);U&&!U.parentId&&F.push(U)}}}if((!F||0===F.length)&&I.children){F=[];for(var G,j=iH(I.children);!(G=j()).done;){var W=G.value,X=r.get(W.id);X&&F.push(X)}}if(F&&0!==F.length){var H=R,Y=E.get(null==(M=H.graphAsset)?void 0:M.id);if(null==Y?void 0:null==(A=Y.graphDataSet)?void 0:A.resources)for(var Z,q=iH(Y.graphDataSet.resources);!(Z=q()).done;){var K=Z.value,Q=E.get(K.id);if(null==Q?void 0:Q.scaleCurves)for(var J,$=iH(Q.scaleCurves);!(J=$()).done;){var tt=J.value,te=function(t,e,i){var r=function(t){var e;a=null==(e=i.get(a.id))?void 0:e.find(function(e){return e.name===n[t]})};if(e){for(var n=e.split("/"),a=t.find(function(t){return t.name===n[0]}),s=1;s<n.length&&a;s++)r(s);return a}}(F,tt.path,n);if(te){var ti=h.get(te.id);if(ti){hV(tt.keyFrames,ti.scaleFactor/ti.oldScaleX,ti.scaleFactor/ti.oldScaleY,ti.scaleFactor/ti.oldScaleZ);continue}var tr=l.get(te.id);tr&&hV(tt.keyFrames,tr.oldScaleX/tr.scaleFactor,tr.oldScaleY/tr.scaleFactor,tr.oldScaleZ/tr.scaleFactor)}}}}}}}(t,r);for(var a,s=new Map,o=new Map,u=new Map,h=iH(t.components);!(a=h()).done;){var l=a.value;u.set(l.id,l)}for(var c,f=iH(t.items);!(c=f()).done;){var d=c.value;d.children=[],s.set(d.id,d)}for(var p,m=iH(t.compositions);!(p=m()).done;){var v=p.value;v.children=[],eV=void 0;var y=v.items;Array.isArray(y)&&hO(y,s,u);for(var g,x=iH(v.components);!(g=x()).done;){var b=g.value,T=u.get(b.id);if(T.dataType===ey.CompositionComponent){var E=null!=(C=T.items)?C:[];hO(E,s,u);for(var C,S,_=iH(E);!(S=_()).done;){var w=S.value,M=s.get(w.id);void 0===M.parentId&&v.children.push({id:M.id})}delete T.items}}o.set(v.id,v)}for(var A,P=iH(t.items);!(A=P()).done;){var I=A.value;if(I.parentId){var R=s.get(I.parentId);R&&R.children.push({id:I.id})}}return t.version=tz["3_7"],t}function hR(t){null!=t.miscs||(t.miscs=[]);for(var e,i=iH(t.components);!(e=i()).done;){var r,n,a=e.value;if(a.dataType===ey.SpriteComponent&&!a.sprite){var s=a.splits;if(!s||!(s.length>1)){var o=null==s?void 0:s[0],u=o?[o[0],o[1],o[2],o[3]]:[0,0,1,1],h=null!=(n=null==o?void 0:o[4])?n:0,l={id:iR(),dataType:"Sprite",texture:null==(r=a.renderer)?void 0:r.texture,rect:u,rotation:h};t.miscs.push(l),a.sprite={id:l.id},delete a.splits,a.renderer&&delete a.renderer.texture}}}return t.version="3.8",t}function hO(t,e,i){for(var r,n=iH(t);!(r=n()).done;){var a=r.value,s=e.get(a.id);if(s&&(s.type===tZ.sprite||s.type===tZ.particle||s.type===tZ.spine||s.type===tZ.text||s.type===tZ.richtext||s.type===tZ.video||s.type===tZ.shape||s.type===tZ.mesh)){var o=i.get(s.components[0].id);o&&function(t){var e,i,r,n=t.mask;n&&!n.references&&n.reference&&(t.mask={isMask:null!=(e=n.isMask)&&e,alphaMaskEnabled:null!=(i=n.alphaMaskEnabled)&&i,references:[{mask:n.reference,inverted:null!=(r=n.inverted)&&r}]})}(o)}}}function hV(t,e,i,r){if(Array.isArray(t)&&t[0]===t0.VECTOR3_CURVE){var n=t[1];Array.isArray(n)&&3===n.length&&(hL(n[0],e),hL(n[1],i),hL(n[2],r))}}function hL(t,e){if(Array.isArray(t)&&t[0]===t0.BEZIER_CURVE&&Array.isArray(t[1]))for(var i,r=t[1],n=iH(r);!(i=n()).done;){var a=i.value;if(Array.isArray(a)&&!(a.length<2)&&Array.isArray(a[1]))for(var s=a[1],o=1;o<s.length;o+=2)s[o]*=e}}function hN(t,e){var i,r=t.options,n=t.velocityOverLifetime||{},a={path:hc(null==(i=t.transform)?void 0:i.path),gravity:r.gravity,gravityOverLifetime:hr(r.gravityModifier),direction:r.direction,startSpeed:r.startSpeed,asMovement:n.asMovement,linearX:hr(n.linearX),linearY:hr(n.linearY),linearZ:hr(n.linearZ),asRotation:n.asRotation,orbCenter:n.orbCenter,orbitalX:hr(n.orbitalX),orbitalY:hr(n.orbitalY),orbitalZ:hr(n.orbitalZ),speedOverLifetime:hr(n.speedOverLifetime)};hd(a);var s={options:{startColor:ha(r.startColor)},positionOverLifetime:a};r.startSize&&(e.scale=[r.startSize,r.startSize/(r.sizeAspect||1),1]),r.startRotation&&(e.rotation?e.rotation[2]+=r.startRotation:e.rotation=[0,0,r.startRotation]);var o=t.rotationOverLifetime;if(o){var u=s.rotationOverLifetime={separateAxes:o.separateAxes,asRotation:o.asRotation};u.separateAxes?(u.x=hr(o.x),u.y=hr(o.y),u.z=hr(o.z)):u.z=hr(o.angularVelocity)}var h=t.colorOverLifetime;if(h){var l=s.colorOverLifetime={opacity:hr(h.opacity)};h.color&&(l.color=hl(h.color))}var c=t.sizeOverLifetime;return c&&(s.sizeOverLifetime={separateAxes:c.separateAxes,size:hr(c.size),x:hr(c.x),y:hr(c.y),z:hr(c.z)}),s}var hF="2.10.0-alpha.2",hD=/^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/,hk=/^(\d+)\.(\d+)$/,hz=!1;function hB(t){if(!t||"object"!=typeof t)throw Error("Invalid input: Expected a JSON object.");if(function(t){var e=(t.playerVersion||{}).web,i=void 0===e?"":e;if(i){var r,n,a=null!=(r=hD.exec(i))?r:[],s=null!=(n=hD.exec(hF))?n:[],o=a[1],u=a[2],h=s[1],l=s[2];return Number(h)<Number(o)||Number(h)===Number(o)&&Number(l)<Number(u)}return!1}(t)&&console.warn("The JSON need higher than "+(null==(d=t.playerVersion)?void 0:d.web)+" runtime version(current: "+hF+"). Some features may not work as expected."),!(f=null==(c=(l=t).version)?void 0:c.split("."))||Number(f[0])>2||2===Number(f[0])&&Number(f[1])>=2||l.compositions.forEach(function(t){t.items.forEach(function(t){(t.type===tZ.mesh||t.type===tZ.light)&&(t.endBehavior=1===t.endBehavior?t2.destroy:t.endBehavior)})}),hD.test(t.version)){var e,i,r,n,a,s,o,u;return hz=(null==(p=/^(\d+)/.exec(t.version))?void 0:p[0])==="0",hR(hI(hP(hA(hM(hw(h_(hS(hC((e=t,hU=tz["1_0"],n=e.plugins||[],(null==(i=e.bins)?void 0:i.length)&&(hU=tz["1_3"]),a=(e.requires||[]).slice(),s=e.images.map(function(t,i){return hG(t,i,e.imageTags||[])}),o=e.textures||s.map(function(t,e){return{source:e,flipY:!0}}),u={plugins:n,shapes:e.shapes||[],type:"ge",version:hU,playerVersion:null!=(r=e.playerVersion)?r:{web:"",native:""},compositionId:e.compositionId+"",compositions:e.compositions.map(function(t){return hj(t,{plugins:n,requires:a})}),images:s,imgUsage:e._imgs,binUsage:e.binUsage,spines:e.spines,requires:e.requires,textures:o,bins:(e.bins||[]).slice()},e._textures&&(u._textures=e._textures),u))))))))))}hz=!1;var h,l,c,f,d,p,m=hk.exec(t.version)||[],v=Number(m[1]),y=Number(m[2]);if(v)return(v<2||2===v&&y<4)&&((h=t).compositions.map(function(t){for(var e,i=iH(t.items);!(e=i()).done;)(function t(e){if(e)for(var i,r=iH(Object.keys(e));!(i=r()).done;){var n=i.value,a=e[n],s=Array.isArray(a);s&&2===a.length&&Array.isArray(a[1])?"path"===n?e[n]=hc(a):e[n]=hr(a):s||"object"!=typeof a||t(a)}})(e.value.content)}),t=h),v<3&&(t=hS(hC(t))),v=Number((m=hk.exec(t.version)||[])[1]),y=Number(m[2]),v<4&&(y<2&&(t=h_(t)),y<3&&(t=hw(t)),y<4&&(t=hM(t)),y<5&&(t=hA(t)),y<6&&(t=hP(t)),y<7&&(t=hI(t)),y<8&&(t=hR(t))),t;throw Error("Invalid JSON version: "+t.version+".")}var hU=tz["1_0"];function hG(t,e,i){var r=i[e];if("string"==typeof t)return{id:iR(),renderLevel:r,url:t};if(t.template)return{id:iR(),url:t.url,template:t.template,webp:t.webp,renderLevel:r};if(t.compressed)return{id:iR(),url:t.url,compressed:{astc:t.compressed.android,pvrtc:t.compressed.iOS},webp:t.webp,renderLevel:r};if(t.url)return{id:iR(),url:t.url,webp:t.webp,renderLevel:r};if(t&&t.sourceType)return t;throw Error("Invalid image type.")}function hj(t,e){void 0===e&&(e={});var i,r={id:t.id+"",camera:re({clipMode:0},t.camera),duration:t.duration,endBehavior:t.endBehavior,items:t.items.map(function(t){return hX(t,e)}),name:t.name},n=t.startTime||t.st;n&&(r.startTime=n);var a=null==(i=t.meta)?void 0:i.previewSize;return a&&a[0]===a[1]&&0===a[0]&&(a=void 0),a&&(r.previewSize=a),r}var hW=[0,0,0,1];function hX(t,e){void 0===e&&(e={});var i=tZ.base,r=t.endBehavior,n=NaN;if(t.content?(i=t.type||tZ.plugin,m=t.pn,p=t.pluginName,f=t.content,c=t.content,isNaN(m)&&!p&&(p=f.options.type),t.duration&&(n=t.duration),l=t.transform||b(c.transform)):t.particle?(i=tZ.particle,l=b((c=t.particle).transform,hz,!0),f=function(t){var e=t.options,i=t.transform,r={type:tW.NONE};if(t.shape){var n,a=null==(n=t.shape.shape)?void 0:n.replace(/([A-Z])/g,"_$1").toUpperCase().replace(/^_/,"");if(r=re({},t.shape,{type:tW[a]}),t.shape.upDirection){var s=t.shape.upDirection,o=s[0],u=s[1],h=s[2];0===o&&0===u&&0===h&&delete r.upDirection}}e.startTurbulence&&(r.turbulenceX=hs(e.turbulenceX),r.turbulenceY=hs(e.turbulenceY),r.turbulenceZ=hs(e.turbulenceZ));var l=t.emission;l.bursts&&l.bursts.length>0&&(l.bursts=l.bursts.map(function(t){return hf(t)})),l.burstOffsets&&l.burstOffsets.length>0&&(l.burstOffsets=l.burstOffsets.map(function(t){return hf(t)})),l.rateOverTime&&(l.rateOverTime=hs(l.rateOverTime));var c={renderer:t.renderer,shape:r,splits:t.splits,emission:l,options:{startLifetime:hs(e.startLifetime),start3DSize:!!e.start3DSize,startSize:hs(e.startSize),startSizeX:hs(e.startSizeX),startSizeY:hs(e.startSizeY),sizeAspect:hs(e.sizeAspect),maxCount:e.maxCount,startDelay:hs(e.startDelay),startColor:function(t,e){if(t)return"colors"===t[0]?[t0.COLORS,t[1].map(function(t){return hu(t,e)})]:"gradient"===t[0]?ho(t[1],e):"color"===t[0]?[t0.RGBA_COLOR,hu(t[1],e)]:t}(e.startColor,!0),startRotationZ:hs(e.startRotation||e.startRotationZ),particleFollowParent:e.particleFollowParent}};e.start3DRotation&&(c.options.startRotationX=hs(e.startRotationX),c.options.startRotationY=hs(e.startRotationY)),i&&i.path&&(c.emitterTransform={path:hc(i.path)});var f=t.sizeOverLifetime;f&&(f.separateAxes?c.sizeOverLifetime={separateAxes:!0,x:hs(f.x),y:hs(f.y)}:c.sizeOverLifetime={size:hs(f.size)});var d=t.velocityOverLifetime||{},p=d.speedOverLifetime;p=p?hr(p):void 0,c.positionOverLifetime={gravity:e.gravity,gravityOverLifetime:hr(e.gravityModifier),startSpeed:hs(e.startSpeed),speedOverLifetime:p,asMovement:d.asMovement,linearX:hs(d.linearX),linearY:hs(d.linearY),linearZ:hs(d.linearZ),asRotation:d.asRotation,orbCenter:d.orbCenter,orbitalX:hs(d.orbitalX),orbitalY:hs(d.orbitalY),orbitalZ:hs(d.orbitalZ),forceTarget:d.forceTarget,target:d.target,forceCurve:hr(d.forceCurve)},hd(c.positionOverLifetime);var m=t.rotationOverLifetime;m&&(c.rotationOverLifetime={separateAxes:m.separateAxes,asRotation:m.asRotation,z:hs(m.separateAxes?m.z:m.angularVelocity)},m.separateAxes&&(c.rotationOverLifetime.y=hr(m.y),c.rotationOverLifetime.x=hr(m.x)));var v=t.colorOverLifetime;if(v){var y=c.colorOverLifetime={opacity:hr(v.opacity)};v.color&&(y.color=hl(v.color))}var g=t.textureSheetAnimation;g&&(c.textureSheetAnimation={row:g.row,col:g.col,total:g.total,animate:g.animate,cycles:hr(g.cycles),animationDelay:hn(g.animationDelay,0),animationDuration:hn(g.animationDuration,0)});var x=t.trails;x&&(c.trails={lifetime:hs(x.lifetime),dieWithParticles:x.dieWithParticles,maxPointPerTrail:x.maxPointPerTrail,minimumVertexDistance:x.minimumVertexDistance,widthOverTrail:hr(x.widthOverTrail),colorOverTrail:x.colorOverTrail&&hl(x.colorOverTrail,!1),blending:x.blending,colorOverLifetime:x.colorOverLifetime&&hl(x.colorOverLifetime,!1),inheritParticleColor:x.inheritParticleColor,occlusion:x.occlusion,transparentOcclusion:x.transparentOcclusion,orderOffset:x.orderOffset,sizeAffectsLifetime:x.sizeAffectsLifetime,sizeAffectsWidth:x.sizeAffectsWidth,texture:x.texture,parentAffectsPosition:x.parentAffectsPosition,opacityOverLifetime:hs(x.opacityOverLifetime)}),c.trails&&hd(c.trails);var b=t.interaction;return b&&(c.interaction={behavior:b.behavior,radius:b.radius,multiple:b.multiple}),c}(c)):t.sprite?(i=tZ.sprite,l=b((c=t.sprite).transform,!1,!0),o=hN(s=c,l),(u=s.textureSheetAnimation)&&(o.textureSheetAnimation={row:u.row,col:u.col,total:u.total||void 0,animate:u.animate}),o.renderer=s.renderer,s.splits&&(o.splits=s.splits),s.interaction&&(o.interaction=s.interaction),f=o):t.cal?(i=tZ.null,l=b((c=t.cal).transform,!1,!0),f=hN(c,l)):t.ui?(i=tZ.interact,l=b((c=t.ui).transform),f=function(t){var e,i=t.options;switch(i.type){case"click":e={type:tH.CLICK,showPreview:i.showPreview,previewColor:i.previewColor&&ha(i.previewColor),behavior:i.behavior||tY.NOTIFY};break;case"drag":e={type:tH.DRAG,enableInEditor:!!i.enableInEditor,dxRange:i.dxRange,dyRange:i.dyRange,target:i.target};break;case"message":e={type:tH.MESSAGE}}return{options:e}}(c),l.scale=[c.options.width||1,c.options.height||1,1]):t.model&&(c=t.model,1===t.model.options.type&&(i=tZ.camera,l=b(c.transform),f=function(t){var e=t.options,i={options:{fov:e.fov,far:e.far,near:e.near,clipMode:e.clipMode}},r=t.velocityOverLifetime;if(r||(null==(n=t.transform)?void 0:n.path)){var n,a,s={path:hc(null==(a=t.transform)?void 0:a.path),linearX:hr(null==r?void 0:r.translateX),linearY:hr(null==r?void 0:r.translateY),linearZ:hr(null==r?void 0:r.translateZ)};hd(s),i.positionOverLifetime=s}var o=t.rotationOverLifetime;if(o){var u={separateAxes:o.separateAxes,x:hr(null==o?void 0:o.rotateX),y:hr(null==o?void 0:o.rotateY),z:o.separateAxes?hr(null==o?void 0:o.rotateZ):hr(o.rotation)};hd(u),i.rotationOverLifetime=u}return i}(c))),null==(h=f.renderer)?void 0:h.anchor){var a=new Float32Array(f.renderer.anchor);.5==a[0]&&.5==a[1]?delete f.renderer.anchor:e.requires&&hi(e.requires,"anchor")}if(c){var s,o,u,h,l,c,f,d,p,m,v,y,g=null==(v=c.options)?void 0:v.looping;r=g?Array.isArray(g)?g[1]?t2.restart:t2.destroy:t2.restart:r||(null==c?void 0:null==(y=c.options)?void 0:y.endBehavior)||t2.destroy,c.options.renderLevel&&(d=c.options.renderLevel),isNaN(n)&&(n=c.options.duration)}var x={type:i,name:t.name,delay:t.delay,duration:n,id:t.id+"",transform:l,endBehavior:r,renderLevel:d,content:f};return p?e.plugins?(hi(e.plugins,p),x.pn=e.plugins.indexOf(p)):x.pluginName=p:Number.isInteger(m)&&(x.pn=m),t.parentId&&(x.parentId=t.parentId+""),x;function b(t,e,i){if(t){var r={},n=t.rotation;if(n&&(e?r.rotation=[-n[0],-n[1],-n[2]]:r.rotation=[n[0],n[1],n[2]],i)){var a,s,o,u,h,l,c,f,d,p,m,v,y,g,x,b,T,E,C,S,_,w,M,A,P=(a=r.rotation[0],s=r.rotation[1],o=r.rotation[2],u=hp(a*hv/2),h=hp(s*hv/2),l=hp(o*hv/2),c=hm(a*hv/2),f=hm(s*hv/2),d=hm(o*hv/2),hW[0]=c*h*l+u*f*d,hW[1]=u*f*l-c*h*d,hW[2]=u*h*d+c*f*l,hW[3]=u*h*l-c*f*d,hW);r.rotation=(p=[],m=P[0],v=P[1],y=P[2],g=P[3],x=m+m,b=v+v,T=y+y,E=m*x,C=v*x,S=v*b,_=y*T,w=g*T,M=y*x-g*b,p[1]=Math.asin((A=-M)>1?1:A<-1?-1:A)*hy,.9999999>Math.abs(M)?(p[0]=Math.atan2(y*b+g*x,1-E-S)*hy,p[2]=Math.atan2(C+w,1-S-_)*hy):(p[0]=0,p[2]=Math.atan2(-(C-w),1-E-_)*hy),p)}return t.position&&(r.position=t.position),Array.isArray(t.scale)&&(r.scale=[t.scale[0]||1,t.scale[1]||1,t.scale[2]||1]),r}return{}}}var hH=((eL={})[tB.S]=[tB.S,tB.BPlus,tB.APlus],eL[tB.A]=[tB.A,tB.BPlus,tB.APlus],eL[tB.B]=[tB.B,tB.BPlus],eL);function hY(t,e){if(!t||!e)return!0;var i=hH[e];return!!i&&i.includes(t)}function hZ(t,e){var i,r,n=null!=(r=null==t?void 0:t.background)?r:{},a=n.name,s=n.url;return a&&(e&&e[a]?i=e[a]:s&&(i=s)),i}function hq(t,e,i){return hK.apply(this,arguments)}function hK(){return(hK=eG(function(t,e,i){var r,n;return eX(this,function(a){switch(a.label){case 0:if("string"!=typeof t)return[3,2];return[4,rQ(t)];case 1:return r=a.sent(),[3,3];case 2:r=t,a.label=3;case 3:if(!r)throw Error("Image not provided.");if(!e)return[2,r];if(n=hZ(e,i)){if(iC(n)&&n!==r.src)return[2,rQ(n)];if(ej(n,HTMLImageElement))return[2,n]}return[2,r]}})})).apply(this,arguments)}t.Scene=void 0,(tN=t.Scene||(t.Scene={})).isJSONObject=function(t){return iw(t)&&"jsonScene"in t},tN.isURL=function(t){return iw(t)&&"url"in t},tN.isWithOptions=function(t){return iw(t)&&"options"in t};var hQ=function(t,e){void 0===e&&(e={}),this.scene=t,this.options=e},hJ=1,h$=function(){function e(t,e){void 0===t&&(t={}),void 0===e&&(e=new rW),this.options=t,this.downloader=e,this.assets={},this.sourceFrom={},this.id=hJ++,this.timers=[],this.updateOptions(t)}var i=e.prototype;return i.updateOptions=function(t){void 0===t&&(t={}),this.options=re({},t,{useCompressedTexture:null==(e=t.useCompressedTexture)||e,useHevcVideo:null==(i=t.useHevcVideo)||i}),this.options.pluginData||(this.options.pluginData={});var e,i,r=this.options.timeout;this.timeout=void 0===r?10:r},i.loadScene=function(e,i){var r=this;return eG(function(){var n,a,s,o,u,h,l,c,f,d,p,m;return eX(this,function(v){return a=iC(e)?e:r.id,s=performance.now(),o=[],l=null!=(h=null==(u=null==i?void 0:i.engine.gpuCapability)?void 0:u.detail.ktx2Support)&&h,c={},d=!1,p=new Promise(function(t,e){f=window.setTimeout(function(){d=!0,r.removeTimer(f),e(Error("Load time out: totalTime: "+(performance.now()-s).toFixed(4)+"ms "+o.join(" ")+", url: "+a+"."))},1e3*r.timeout),r.timers.push(f)}),m=eG(function(t,e){var i,r,n;return eX(this,function(a){switch(a.label){case 0:if(d)return[3,4];i=performance.now(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e()];case 2:return r=a.sent(),n=performance.now()-i,o.push("["+t+": "+n.toFixed(2)+"]"),c[t]=n,[2,r];case 3:throw Error("Load error in "+t+", "+a.sent()+".");case 4:throw Error("Load canceled.")}})}),[2,Promise.race([p,eG(function(){var i,u,h,d,p,v,y,g,x,b,T,E,C,S,_;return eX(this,function(w){switch(w.label){case 0:if(!iC(e))return[3,2];return u=new URL(e,location.href).href,r.baseUrl=u,[4,m("loadJSON",function(){return r.loadJSON(u)})];case 1:return iC(n=w.sent())&&(n=JSON.parse(n)),[3,3];case 2:n=e,r.baseUrl=location.href,w.label=3;case 3:if(!t.Scene.isJSONObject(n))return[3,4];return i=re({},n),[3,9];case 4:return[4,m("processJSON",function(){return r.processJSON(n)})];case 5:return i={timeInfos:c,url:e,storage:{},jsonScene:v=w.sent().jsonScene,bins:[],textureOptions:[],images:[],assets:r.assets},[4,m("plugin:onAssetsLoadStart",function(){return r.onPluginSceneLoadStart(i)})];case 6:return w.sent(),g=void 0===(y=v.bins)?[]:y,x=v.images,b=v.fonts,[4,Promise.all([m("processBins",function(){return r.processBins(g)}),m("processImages",function(){return r.processImages(x,l)}),m("processFontURL",function(){return r.processFontURL(b)})])];case 7:return E=(T=w.sent())[0],C=T[1],[4,m("processTextures",function(){return r.processTextures(C,E,v)})];case 8:S=w.sent(),(h=i.bins).push.apply(h,[].concat(E)),(d=i.textureOptions).push.apply(d,[].concat(S)),(p=i.images).push.apply(p,[].concat(C)),i.renderLevel=r.options.renderLevel,w.label=9;case 9:return _=performance.now()-s,iT.info("Load asset: totalTime: "+_.toFixed(4)+"ms "+o.join(" ")+", url: "+a+"."),window.clearTimeout(f),r.removeTimer(f),i.totalTime=_,i.startTime=s,i.timeInfos=c,[2,i]}})})()])]})})()},i.getAssets=function(){return this.assets},i.processJSON=function(t){return eG(function(){var e,i,r,n,a;return eX(this,function(s){for(r=iH(void 0===(i=(e=hB(t)).plugins)?[]:i);!(n=r()).done;)if(!iL[a=n.value])throw Error("The plugin '"+a+"' not found."+iz(a));return[2,{jsonScene:e}]})})()},i.processBins=function(t){var e=this;return eG(function(){var i,r;return eX(this,function(n){return i=e.options.renderLevel,r=e.baseUrl,[2,Promise.all(t.map(function(n){if(ej(n,ArrayBuffer))return n;if(hY(n.renderLevel,i))return e.loadBins(new URL(n.url,r).href);throw Error("Invalid bins source: "+JSON.stringify(t)+".")}))]})})()},i.processFontURL=function(t){var i=this;return eG(function(){return eX(this,function(r){return[2,e.loadFontFamily(t,i.baseUrl)]})})()},i.processImages=function(e,i){void 0===i&&(i=!1);var r=this;return eG(function(){var n,a,s,o,u,h,l,c,f;return eX(this,function(d){switch(d.label){case 0:return a=(n=r.options).useCompressedTexture,s=n.variables,o=n.disableWebP,u=n.disableAVIF,h=!!iL.ktx2,l=a&&i&&h,c=r.baseUrl,a&&i&&!h&&e.some(function(t){return"ktx2"in t&&t.ktx2})&&iT.warn("The plugin 'ktx2' is not found, unable to use compressed textures."+iz("ktx2")),[4,Promise.all(e.map(eG(function(e,i){var n,a,h,f,d,p,m,v,y,g,x,b,T,E,C,S,_,w,M,A;return eX(this,function(i){switch(i.label){case 0:if(n=e.url,a=e.webp,h=e.avif,f=e.ktx2,d=new URL(n,c).href,p=!o&&a?new URL(a,c).href:void 0,m=!u&&h?new URL(h,c).href:void 0,v=f&&l?new URL(f,c).href:void 0,y=e.id,!("template"in e))return[3,8];if(!(x=(g=e.template).background))return[3,7];b=hZ(g,s),T=x.type===ep.video,E=x&&T?r2:rQ,i.label=1;case 1:return i.trys.push([1,6,,7]),[4,r4(b,E)];case 2:if(!ej(C=i.sent(),HTMLVideoElement))return[3,3];return r.sourceFrom[y]={url:C.src,type:t.TextureSourceType.video},[2,C];case 3:return x&&Array.isArray(b)&&s&&(s[x.name]=C.src),r.sourceFrom[y]={url:C.src,type:t.TextureSourceType.image},[4,hq(C,g,s)];case 4:return[2,i.sent()];case 5:return[3,7];case 6:throw S=i.sent(),Error("Failed to load. Check the template or if the URL is "+(T?"video":"image")+" type, URL: "+b+", Error: "+(S.message||S)+".");case 7:return[3,9];case 8:if("ktx2"in e&&v)return r.sourceFrom[y]={url:v,type:t.TextureSourceType.compressed},[2,r.loadBins(v)];if(ej(e,HTMLImageElement)||ej(e,HTMLCanvasElement)||ej(e,HTMLVideoElement)||ej(e,ne))return[2,e];i.label=9;case 9:if(!m)return[3,11];return[4,rq(d,m)];case 10:return A=i.sent(),[3,13];case 11:return[4,rY(d,p)];case 12:A=i.sent(),i.label=13;case 13:return w=(_=A).url,M=_.image,r.sourceFrom[y]={url:w,type:t.TextureSourceType.image},[2,M]}})})))];case 1:return f=d.sent(),r.assignImagesToAssets(e,f),[2,f]}})})()},i.onPluginSceneLoadStart=function(t){var e=this;return eG(function(){return eX(this,function(i){switch(i.label){case 0:return[4,iD.notifyAssetsLoadStart(t,e.options)];case 1:return i.sent(),[2]}})})()},i.processTextures=function(e,i,r){var n=this;return eG(function(){var a;return eX(this,function(s){return[2,Promise.all((null!=(a=r.textures)?a:e.map(function(t,e){return{source:e}})).map(eG(function(e,a){var s,o,u,h,l;return eX(this,function(c){switch(c.label){case 0:if(ej(e,ne))return[2,e];if(!("mipmaps"in e))return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r6(e,i,n.assets,r.bins)];case 2:return[2,c.sent()];case 3:throw Error("Load texture "+a+" fails, error message: "+c.sent()+".");case 4:if(s=e.source,o=e.id,h="",!iw(s))return[3,5];return u=n.assets[s.id],h=s.id,[3,7];case 5:if("string"!=typeof s)return[3,7];return[4,rQ(iO(s))];case 6:u=c.sent(),c.label=7;case 7:if(!u)return[3,9];return[4,function(t,e,i){return h0.apply(this,arguments)}(u,n.sourceFrom[h],o)];case 8:return[2,(l=c.sent()).sourceType===t.TextureSourceType.compressed?l:re({},l,e)];case 9:throw Error("Invalid texture source: "+s+".")}})})))]})})()},i.loadJSON=function(t){var e=this;return eG(function(){return eX(this,function(i){return[2,new Promise(function(i,r){e.downloader.downloadJSON(t,i,function(e,i){r("Couldn't load JSON "+JSON.stringify(t)+": status "+e+", "+i)})})]})})()},i.loadBins=function(t){var e=this;return eG(function(){return eX(this,function(i){return[2,new Promise(function(i,r){e.downloader.downloadBinary(t,i,function(e,i){r("Couldn't load bins "+JSON.stringify(t)+": status "+e+", "+i)})})]})})()},i.assignImagesToAssets=function(t,e){for(var i=0;i<t.length;i++)this.assets[t[i].id]=e[i]},i.removeTimer=function(t){var e=this.timers.indexOf(t);-1!==e&&this.timers.splice(e,1)},i.dispose=function(){this.timers.length&&this.timers.map(function(t){return window.clearTimeout(t)}),this.assets={},this.sourceFrom={},this.timers=[]},e.loadFontFamily=function(t,i){return void 0===i&&(i=location.href),eG(function(){return eX(this,function(r){return t?[2,Promise.all(t.map(eG(function(t){var r,n,a;return eX(this,function(s){switch(s.label){case 0:if(!(t.fontURL&&!e.fontCache.has(t.fontFamily)))return[3,4];ig(t.fontFamily)||console.warn("Risky font family: "+t.fontFamily+"."),s.label=1;case 1:return s.trys.push([1,3,,4]),r=new URL(t.fontURL,i).href,[4,(a=new FontFace(null!=(n=t.fontFamily)?n:"","url("+r+")")).load()];case 2:return s.sent(),document.fonts.add(a),e.fontCache.add(t.fontFamily),[3,4];case 3:return s.sent(),iT.warn("Invalid font family or font source: "+JSON.stringify(t.fontURL)+"."),[3,4];case 4:return[2]}})})))]:[2]})})()},e.loadPrecomposition=function(t,i){return eG(function(){return eX(this,function(r){switch(r.label){case 0:return[4,new e(i).loadScene(t)];case 1:return[2,new hQ(r.sent(),i)]}})})()},e}();function h0(){return(h0=eG(function(e,i,r){var n,a,s,o,u;return eX(this,function(h){switch(h.label){case 0:if(n={id:r,dataType:ey.Texture},!ej(e,ne))return[3,1];return[2,re({},e.source,n)];case 1:if(!(ej(e,HTMLImageElement)||iA(e)))return[3,2];return[2,re({image:e,sourceType:t.TextureSourceType.image,sourceFrom:i,keepImageSource:!0,minFilter:rD.LINEAR,magFilter:rD.LINEAR},n)];case 2:if(!ej(e,HTMLVideoElement))return[3,3];return[2,re({sourceType:t.TextureSourceType.video,video:e,minFilter:rD.LINEAR,magFilter:rD.LINEAR},n)];case 3:if(!ej(e,ArrayBuffer))return[3,10];if(!(a=ns.getLoader("ktx2")))return[3,8];h.label=4;case 4:return h.trys.push([4,6,,7]),[4,a.loadFromBuffer(e)];case 5:return s=h.sent(),iT.info("Loading KTX2 texture."),[2,re({sourceType:s.sourceType,type:s.type,target:s.target,internalFormat:s.internalFormat,format:s.format,mipmaps:s.mipmaps,minFilter:rD.LINEAR,magFilter:rD.LINEAR,sourceFrom:i},n)];case 6:throw o=h.sent(),Error("Failed to parse KTX2 from "+(null!=(u=null==i?void 0:i.url)?u:"buffer")+": "+(o.message||o));case 7:return[3,9];case 8:throw Error("KTX2 loader not found. Please register it first.");case 9:return[3,11];case 10:if("width"in e&&"height"in e&&"data"in e)return[2,re({sourceType:t.TextureSourceType.data,data:e,wrapS:rD.CLAMP_TO_EDGE,wrapT:rD.CLAMP_TO_EDGE,minFilter:rD.NEAREST,magFilter:rD.NEAREST},n)];h.label=11;case 11:throw Error("Invalid texture options.")}})})).apply(this,arguments)}h$.fontCache=new Set;var h1=function(){function e(t){this.engine=t,this.builtinObjects=[],this.builtinObjects.push(t.whiteTexture),this.builtinObjects.push(t.transparentTexture)}var i=e.prototype;return i.assembleSceneLoadOptions=function(e,i){void 0===i&&(i={});var r=e;return t.Scene.isURL(e)&&(t.Scene.isJSONObject(e)||(r=e.url),t.Scene.isWithOptions(e)&&(i=re({},i,e.options))),{source:r,options:i}},i.updateTextVariables=function(t,e){var i=this;void 0===e&&(e={}),t.jsonScene.items.forEach(function(t){if(t.type===tZ.text||t.type===tZ.richtext){var r=e[t.name];null!=r&&t.components.forEach(function(t){var e=t.id,n=i.engine.findEffectsObjectData(e);((null==n?void 0:n.dataType)===ey.TextComponent||(null==n?void 0:n.dataType)===ey.RichTextComponent)&&(n.options.text=r)})}})},i.prepareAssets=function(t,e){for(var i,r=iH(Object.keys(e));!(i=r()).done;){var n=i.value,a=e[n],s=new u9(this.engine);s.data=a,s.setInstanceId(n)}this.engine.addPackageDatas(t);for(var o,u=iH(this.builtinObjects);!(o=u()).done;){var h=o.value;this.engine.addInstance(h)}},i.createShaderVariant=function(){for(var t,e=iH(Object.keys(this.engine.objectInstance));!(t=e()).done;){var i=t.value,r=this.engine.objectInstance[i];ej(r,nb)&&r.createShaderVariant()}},i.destroyBuiltinObjects=function(){for(var t,e=iH(this.builtinObjects);!(t=e()).done;)t.value.dispose();this.builtinObjects.length=0},i.dispose=function(){this.destroyBuiltinObjects()},e}(),h2=new e5(1,1,1),h3=function(){function t(t,e){void 0===e&&(e={}),this.name=t,this.transform=new nU,this.viewportMatrix=nl.fromIdentity(),this.viewMatrix=nl.fromIdentity(),this.projectionMatrix=nl.fromIdentity(),this.viewProjectionMatrix=nl.fromIdentity(),this.inverseViewMatrix=nl.fromIdentity(),this.dirty=!0;var i=e.near,r=e.far,n=e.fov,a=e.aspect,s=e.clipMode,o=void 0===s?t$.portrait:s,u=e.position,h=void 0===u?[0,0,8]:u,l=e.rotation,c=void 0===l?[0,0,0]:l,f=new nc(c[0],c[1],c[2]),d=new rn().setFromEuler(f);this.options={near:void 0===i?.1:i,far:void 0===r?20:r,fov:void 0===n?60:n,aspect:void 0===a?1:a,clipMode:o},this.transform.setPosition(h[0],h[1],h[2]),this.transform.setQuaternion(d.x,d.y,d.z,d.w),this.dirty=!0,this.updateMatrix()}var e=t.prototype;return e.setTransform=function(t){this.transform.parentTransform=t.parentTransform,this.transform.cloneFromMatrix(t.getMatrix()),this.dirty=!0},e.setViewportMatrix=function(t){this.viewportMatrix=t.clone(),this.dirty=!0},e.getViewportMatrix=function(){return this.viewportMatrix},e.getViewMatrix=function(){return this.updateMatrix(),this.viewMatrix.clone()},e.getInverseViewMatrix=function(){return this.updateMatrix(),this.inverseViewMatrix.clone()},e.getProjectionMatrix=function(){return this.updateMatrix(),this.projectionMatrix.clone()},e.getInverseProjectionMatrix=function(){var t;return this.updateMatrix(),null==(t=this.inverseProjectionMatrix)?void 0:t.clone()},e.getViewProjectionMatrix=function(){return this.updateMatrix(),this.viewProjectionMatrix.clone()},e.getInverseViewProjectionMatrix=function(){return this.updateMatrix(),this.inverseViewProjectionMatrix||(this.inverseViewProjectionMatrix=this.viewProjectionMatrix.clone(),this.inverseViewProjectionMatrix.invert()),this.inverseViewProjectionMatrix.clone()},e.getModelViewProjection=function(t,e){return t.multiplyMatrices(this.viewProjectionMatrix,e)},e.getInverseVPRatio=function(t){var e=new e5(this.position.x,this.position.y,t),i=this.getViewProjectionMatrix(),r=this.getInverseViewProjectionMatrix();if(!this.viewportMatrix.isIdentity()){var n=this.viewportMatrix.clone();r.premultiply(n),i.multiply(n.invert())}var a=i.projectPoint(e).z,s=r.projectPoint(new e5(1,1,a)),o=s.x,u=s.y,h=r.projectPoint(new e5(-1,-1,a));return new e5((o-h.x)/2,(u-h.y)/2,0)},e.setQuat=function(t){this.transform.getQuaternion().equals(t)||(this.transform.setQuaternion(t.x,t.y,t.z,t.w),this.dirty=!0)},e.getQuat=function(){return this.transform.quat.clone()},e.getOptions=function(){return re({},this.options,{position:this.position.clone(),rotation:this.rotation.clone()})},e.copy=function(t){var e=t.near,i=t.far,r=t.fov,n=t.clipMode,a=t.aspect,s=t.position,o=t.rotation;this.near=e,this.far=i,this.fov=r,this.clipMode=n,this.aspect=a,this.position=s,this.rotation=o,this.updateMatrix()},e.updateMatrix=function(){if(this.dirty){var t,e=this.options,i=e.fov,r=e.aspect,n=e.near,a=e.far,s=e.clipMode;this.projectionMatrix.perspective(i*e$,r,n,a,s===t$.portrait),this.projectionMatrix.premultiply(this.viewportMatrix),this.inverseViewMatrix.compose(this.position,this.getQuat(),h2),this.inverseViewMatrix.premultiply(null!=(t=this.transform.getParentMatrix())?t:nl.IDENTITY),this.viewMatrix.copyFrom(this.inverseViewMatrix).invert(),this.viewProjectionMatrix.multiplyMatrices(this.projectionMatrix,this.viewMatrix),this.inverseViewProjectionMatrix=null,this.dirty=!1}},e.worldToScreenPoint=function(t,e){this.updateMatrix();var i=null!=e?e:new e5,r=this.getViewProjectionMatrix();i.set(t.x,t.y,t.z),r.projectPoint(i,i);var n=this.engine.canvas.getBoundingClientRect(),a=n.width,s=n.height;return i.x=(i.x+1)*.5*a,i.y=(i.y+1)*.5*s,i.z=(i.z+1)*.5,i},e.screenToWorldPoint=function(t,e){this.updateMatrix();var i=null!=e?e:new e5,r=this.getInverseViewProjectionMatrix(),n=this.engine.canvas.getBoundingClientRect(),a=n.width,s=n.height,o=t.x/a*2-1,u=t.y/s*2-1,h=2*t.z-1;return i.set(o,u,h),r.projectPoint(i,i),i},rV(t,[{key:"near",get:function(){return this.options.near},set:function(t){this.options.near!==t&&(this.options.near=t,this.dirty=!0)}},{key:"far",get:function(){return this.options.far},set:function(t){this.options.far!==t&&(this.options.far=t,this.dirty=!0)}},{key:"fov",get:function(){return this.options.fov},set:function(t){this.options.fov!==t&&(this.options.fov=t,this.dirty=!0)}},{key:"aspect",get:function(){return this.options.aspect},set:function(t){this.options.aspect!==t&&(this.options.aspect=t,this.dirty=!0)}},{key:"clipMode",get:function(){return this.options.clipMode},set:function(t){void 0!==t&&this.options.clipMode!==t&&(this.options.clipMode=t,this.dirty=!0)}},{key:"position",get:function(){return this.transform.position.clone()},set:function(t){this.transform.position.equals(t)||(this.transform.setPosition(t.x,t.y,t.z),this.dirty=!0)}},{key:"worldPosition",get:function(){return this.transform.getWorldPosition()}},{key:"rotation",get:function(){return this.transform.rotation.clone()},set:function(t){this.transform.rotation.equals(t)||(this.transform.setRotation(t.x,t.y,t.z),this.dirty=!0)}}]),t}(),h4=function(){function t(){this.update=new h6,this.lateUpdate=new h8,this.preRender=new h9}var e=t.prototype;return e.addComponent=function(t){t.onUpdate!==rL.prototype.onUpdate&&this.update.addComponent(t),t.onLateUpdate!==rL.prototype.onLateUpdate&&this.lateUpdate.addComponent(t),t.onPreRender!==rL.prototype.onPreRender&&this.preRender.addComponent(t)},e.removeComponent=function(t){t.onUpdate!==rL.prototype.onUpdate&&this.update.removeComponent(t),t.onLateUpdate!==rL.prototype.onLateUpdate&&this.lateUpdate.removeComponent(t),t.onPreRender!==rL.prototype.onPreRender&&this.preRender.removeComponent(t)},e.clear=function(){this.update.clear(),this.lateUpdate.clear()},t}(),h5=function(){function t(){this.components=[],this.ticks=[]}var e=t.prototype;return e.tick=function(t){this.tickComponents(this.components,t);for(var e=0;e<this.ticks.length;e++)this.ticks[e](t)},e.tickComponents=function(t,e){},e.addComponent=function(t){this.components.includes(t)||this.components.push(t)},e.removeComponent=function(t){var e=this.components.indexOf(t);e>-1&&this.components.splice(e,1)},e.addTick=function(t,e){var i=t.bind(e);this.ticks.includes(i)||this.ticks.push(i)},e.clear=function(){this.components=[]},t}(),h6=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=iH(t);!(i=r()).done;)i.value.onUpdate(e)},e}(h5),h8=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=iH(t);!(i=r()).done;)i.value.onLateUpdate(e)},e}(h5),h9=function(t){function e(){return t.apply(this,arguments)}return iG(e,t),e.prototype.tickComponents=function(t,e){for(var i,r=iH(t);!(i=r()).done;)i.value.onPreRender()},e}(h5),h7=function(e){function i(i,r,n){(x=e.call(this)||this).engine=i,x.sceneTicking=new h4,x.speed=1,x.isEnded=!1,x.loaderData={},x.startTime=0,x.videos=[],x.postProcessingEnabled=!1,x.canvasLayers=[],x.destroyed=!1,x.paused=!0,x.isEndCalled=!1,x._textures=[];var a,s,o,u,h,l,c,f=null!=r?r:{},d=f.reusable,p=void 0!==d&&d,m=f.speed,v=f.baseRenderOrder,y=f.onItemMessage;x.engine.addComposition(oA(x));var g=null;if(n){x.createTexturesFromData(n.textureOptions);for(var x,b,T,E=iH(Object.keys(n.assets));!(T=E()).done;){var C=T.value,S=n.assets[C];ej(S,HTMLVideoElement)&&x.videos.push(S)}x.postProcessingEnabled=null!=(_=null==(b=n.jsonScene.renderSettings)?void 0:b.postProcessingEnabled)&&_,x.engine.renderLevel=n.renderLevel,p&&(n.consumed=!0),g=n.jsonScene.compositions[0];for(var _,w,M=iH(n.jsonScene.compositions);!(w=M()).done;){var A=w.value;A.id===n.jsonScene.compositionId&&(g=A)}iy(g)}return x.root=new t.VFXItem(x.engine),x.root.name="root",x.root.composition=oA(x),x.pluginRoot=new t.VFXItem(x.engine),x.pluginRoot.name="pluginRoot",x.pluginRoot.setParent(x.root),x.pluginRoot.addComponent(sG),x.sceneRoot=new t.VFXItem(x.engine),x.sceneRoot.setParent(x.root),g&&(x.sceneRoot.setInstanceId(g.id),x.sceneRoot.instantiatePreComposition(g,!1)),x.sceneRoot.name="sceneRoot",x.rootComposition=null!=(a=x.sceneRoot.getComponent(t.CompositionComponent))?a:x.sceneRoot.addComponent(t.CompositionComponent),x.rootComposition.updateMode=t.UpdateModes.Manual,x.rootComposition.play(),x.sceneRoot.on("animationevent",function(t){x.emit("animationevent",t)}),x.sceneRoot.setParent(x.root),x.renderOrder=void 0===v?0:v,x.id=null!=(s=null==g?void 0:g.id)?s:iR(),x.startTime=null!=(o=null==g?void 0:g.startTime)?o:0,x.event=i.eventSystem,x.statistic={loadStart:null!=(u=null==n?void 0:n.startTime)?u:0,loadTime:null!=(h=null==n?void 0:n.totalTime)?h:0,compileTime:0,firstFrameTime:0},x.reusable=p,x.speed=void 0===m?1:m,x.name=null!=(l=null==g?void 0:g.name)?l:"New Composition",x.camera=new h3(x.name,re({},null==g?void 0:g.camera,{aspect:x.width/x.height})),x.camera.engine=x.engine,x.url=null!=(c=null==n?void 0:n.url)?c:"",x.interactive=!0,y&&(x.onItemMessage=y),x.createRenderFrame(),iD.notifyCompositionCreated(oA(x),n),x}iG(i,e);var r=i.prototype;return r.getDuration=function(){return this.sceneRoot.duration},r.restart=function(){this.reset(),this.forwardTime(this.startTime)},r.setIndex=function(t){this.renderOrder=t},r.getIndex=function(){return this.renderOrder},r.setSpeed=function(t){this.speed=t},r.setVisible=function(t){this.sceneRoot.setVisible(t)},r.getSpeed=function(){return this.speed},r.play=function(){this.isEnded&&this.reusable&&this.restart(),this.rootComposition.isStartCalled?this.setTime(this.time-this.startTime):this.setTime(0),this.resume()},r.pause=function(){this.paused=!0,this.emit("pause")},r.getPaused=function(){return this.paused},r.resume=function(){this.paused=!1,this.isEnded&&this.reusable&&this.restart();var t=this.time;this.emit("play",{time:t})},r.gotoAndPlay=function(t){this.setTime(t),this.emit("goto",{time:t}),this.resume()},r.gotoAndStop=function(t){this.setTime(t),this.emit("goto",{time:t}),this.pause()},r.createRenderFrame=function(){this.renderFrame=new sx({camera:this.camera,renderer:this.renderer,globalVolume:this.globalVolume,postProcessingEnabled:this.postProcessingEnabled})},r.setTime=function(t){var e=this.speed,i=this.getPaused();i&&this.resume(),this.setSpeed(1),this.forwardTime(t+this.startTime),this.setSpeed(e),i&&(this.paused=!0)},r.addItem=function(t){t.setParent(this.sceneRoot)},r.getComponent=function(t){return this.sceneRoot.getComponent(t)},r.forwardTime=function(t){var e=1e3*t-1e3*this.time;this.update(e)},r.reset=function(){this.isEnded=!1,this.isEndCalled=!1,this.rootComposition.setTime(0)},r.render=function(){this.renderer.renderRenderFrame(this.renderFrame),this.renderCanvasLayers()},r.update=function(t){if(!this.getPaused()){this.root.isDuringPlay||(this.root.awake(),this.root.beginPlay());var e=this.time;this.updateCompositionTime(t*this.speed/1e3);var i=(this.time-e)*1e3;this.rootComposition.setChildrenRenderOrder(0),this.sceneTicking.update.tick(i),this.sceneTicking.lateUpdate.tick(i),this.updateCamera(),this.isEnded&&!this.isEndCalled&&(this.isEndCalled=!0,this.emit("end",{composition:this})),this.shouldDispose()&&this.dispose()}},r.shouldDispose=function(){return this.isEnded&&this.sceneRoot.endBehavior===t2.destroy&&!this.reusable},r.updateCamera=function(){this.camera.updateMatrix()},r.updateCompositionTime=function(e){if(this.rootComposition.state===t.PlayState.Playing&&this.rootComposition.isActiveAndEnabled){var i=this.time+e-this.startTime;e<0&&i<0&&(i=0);var r=this.sceneRoot.duration,n=this.sceneRoot.endBehavior,a=!1;if(i>=r)switch(a=!0,n){case t2.restart:i%=r,this.restart();break;case t2.freeze:i=Math.min(r,i);case t2.forward:case t2.destroy:}this.rootComposition.tick(i+this.startTime-this.rootComposition.getTime()),this.isEnded!==a&&(a?this.isEnded=!0:(this.isEnded=!1,this.isEndCalled=!1))}},r.renderCanvasLayers=function(){this.engine.graphics.begin(),this.canvasLayers.sort(function(t,e){return t.layer-e.layer});for(var t,e=iH(this.canvasLayers);!(t=e()).done;)t.value.draw();this.engine.graphics.end()},r.createTexturesFromData=function(t){for(var e,i=iH(t);!(e=i()).done;){var r=e.value,n=this.engine.findObject({id:r.id});n.initialize(),this._textures.push(n)}},r.getItemByName=function(t){return this.sceneRoot.find(t)},r.getHitTestRay=function(t,e){var i=this.renderFrame.editorTransform,r=i.x,n=i.y;return nQ((t-i.z)/r,(e-i.w)/n,this.camera)},r.getEngine=function(){var t;return null==(t=this.renderer)?void 0:t.engine},r.hitTest=function(t,e,i,r){if(this.isDestroyed||!this.interactive)return[];var n=[],a=this.getHitTestRay(t,e);return this.sceneRoot.hitTest(a,t,e,n,[],i,r),n},r.addInteractiveItem=function(t,e){if(e===tH.MESSAGE)return null==this.onItemMessage||this.onItemMessage.call(this,{name:t.name,phrase:2,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:2,id:t.id}),t.id},r.removeInteractiveItem=function(t,e){e===tH.MESSAGE&&(null==this.onItemMessage||this.onItemMessage.call(this,{name:t.name,phrase:1,id:t.id,compositionId:this.id}),t.emit("message",{name:t.name,phrase:1,id:t.id}))},r.destroyItem=function(t){},r.lost=function(t){},r.restore=function(){},r.dispose=function(){var e=this;if(!this.destroyed){this.destroyed=!0;for(var i,r=iH(this.textures);!(i=r()).done;)i.value.dispose();this._textures=[];for(var n,a=iH(this.videos);!(n=a()).done;){var s=n.value;s.pause(),s.removeAttribute("src"),s.load()}this.videos=[],this.sceneRoot.dispose(),this.pluginRoot.dispose(),this.root.dispose(),this.renderFrame.dispose(),iD.notifyCompositionDestroy(this),this.update=function(){iT.error("Update disposed composition: "+e.name+".")},this.dispose=iE,this.renderer.engine.removeComposition(this),this.engine.env!==nL&&this.renderer.clear({stencilAction:t.TextureLoadAction.clear,clearStencil:0,depthAction:t.TextureLoadAction.clear,clearDepth:1,colorAction:t.TextureLoadAction.clear,clearColor:[0,0,0,0]})}},r.setEditorTransform=function(t,e,i){this.renderFrame.editorTransform.set(t,t,e,i)},r.translateByPixel=function(t,e){if(!this.renderer){console.warn("Renderer not assigned. Operation aborted.");return}this.sceneRoot.translateByPixel(t,e)},r.setPositionByPixel=function(t,e){if(!this.renderer){console.warn("Renderer not assigned. Operation aborted.");return}this.sceneRoot.setPositionByPixel(t,e)},r.translate=function(t,e,i){this.sceneRoot.translate(t,e,i)},r.setPosition=function(t,e,i){this.sceneRoot.setPosition(t,e,i)},r.rotate=function(t,e,i){this.sceneRoot.rotate(t,e,i)},r.setRotation=function(t,e,i){this.sceneRoot.setRotation(t,e,i)},r.scale=function(t,e,i){this.sceneRoot.scale(t,e,i)},r.setScale=function(t,e,i){this.sceneRoot.setScale(t,e,i)},r.offloadTexture=function(){this.textureOffloaded||(this.textures.forEach(function(t){return t&&t.offloadData()}),this.textureOffloaded=!0)},r.reloadTexture=function(){var t=this;return eG(function(){return eX(this,function(e){switch(e.label){case 0:if(!t.textureOffloaded)return[3,2];return[4,Promise.all(t.textures.map(function(t){return null==t?void 0:t.reloadData()}))];case 1:e.sent(),t.textureOffloaded=!1,e.label=2;case 2:return[2]}})})()},rV(i,[{key:"width",get:function(){return this.engine.canvas.width}},{key:"height",get:function(){return this.engine.canvas.height}},{key:"renderer",get:function(){return this.engine.renderer}},{key:"rootItem",get:function(){return this.sceneRoot}},{key:"transform",get:function(){return this.sceneRoot.transform}},{key:"textures",get:function(){return this._textures}},{key:"items",get:function(){return this.sceneRoot.getDescendants()}},{key:"time",get:function(){return this.rootComposition.getTime()}},{key:"isDestroyed",get:function(){return this.destroyed}},{key:"viewportMatrix",get:function(){return this.camera.getViewportMatrix()},set:function(t){this.camera.setViewportMatrix(t)}}]),i}(nF),lt=new Int32Array(2),le=new Float32Array(lt.buffer),li=new Float64Array(lt.buffer),lr=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];(tF=eN||(eN={}))[tF.UTF8_BYTES=1]="UTF8_BYTES",tF[tF.UTF16_STRING=2]="UTF16_STRING";var ln=function(){function t(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}var e=t.prototype;return e.clear=function(){this.position_=0},e.bytes=function(){return this.bytes_},e.position=function(){return this.position_},e.setPosition=function(t){this.position_=t},e.capacity=function(){return this.bytes_.length},e.readInt8=function(t){return this.readUint8(t)<<24>>24},e.readUint8=function(t){return this.bytes_[t]},e.readInt16=function(t){return this.readUint16(t)<<16>>16},e.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},e.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},e.readUint32=function(t){return this.readInt32(t)>>>0},e.readInt64=function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))},e.readUint64=function(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))},e.readFloat32=function(t){return lt[0]=this.readInt32(t),le[0]},e.readFloat64=function(t){return lt[lr?0:1]=this.readInt32(t),lt[lr?1:0]=this.readInt32(t+4),li[0]},e.writeInt8=function(t,e){this.bytes_[t]=e},e.writeUint8=function(t,e){this.bytes_[t]=e},e.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},e.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},e.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},e.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},e.writeInt64=function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))},e.writeUint64=function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))},e.writeFloat32=function(t,e){le[0]=e,this.writeInt32(t,lt[0])},e.writeFloat64=function(t,e){li[0]=e,this.writeInt32(t,lt[lr?0:1]),this.writeInt32(t+4,lt[lr?1:0])},e.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+4+4)throw Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<4;e++)t+=String.fromCharCode(this.readInt8(this.position_+4+e));return t},e.__offset=function(t,e){var i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0},e.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},e.__string=function(t,e){t+=this.readInt32(t);var i=this.readInt32(t);t+=4;var r=this.bytes_.subarray(t,t+i);return e===eN.UTF8_BYTES?r:this.text_decoder_.decode(r)},e.__union_with_string=function(t,e){return"string"==typeof t?this.__string(e):this.__union(t,e)},e.__indirect=function(t){return t+this.readInt32(t)},e.__vector=function(t){return t+this.readInt32(t)+4},e.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},e.__has_identifier=function(t){if(4!=t.length)throw Error("FlatBuffers: file identifier must be length 4");for(var e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0},e.createScalarList=function(t,e){for(var i=[],r=0;r<e;++r){var n=t(r);null!==n&&i.push(n)}return i},e.createObjList=function(t,e){for(var i=[],r=0;r<e;++r){var n=t(r);null!==n&&i.push(n.unpack())}return i},t.allocate=function(e){return new t(new Uint8Array(e))},t}(),la=function(){function t(t){var e;this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder,e=t||1024,this.bb=ln.allocate(e),this.space=e}var e=t.prototype;return e.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null},e.forceDefaults=function(t){this.force_defaults=t},e.dataBuffer=function(){return this.bb},e.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},e.prep=function(e,i){e>this.minalign&&(this.minalign=e);for(var r=~(this.bb.capacity()-this.space+i)+1&e-1;this.space<r+e+i;){var n=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},e.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},e.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},e.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},e.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},e.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},e.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},e.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},e.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},e.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},e.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},e.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},e.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},e.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},e.addFieldInt8=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))},e.addFieldInt16=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))},e.addFieldInt32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))},e.addFieldInt64=function(t,e,i){(this.force_defaults||e!==i)&&(this.addInt64(e),this.slot(t))},e.addFieldFloat32=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))},e.addFieldFloat64=function(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))},e.addFieldOffset=function(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))},e.addFieldStruct=function(t,e,i){e!=i&&(this.nested(e),this.slot(t))},e.nested=function(t){if(t!=this.offset())throw TypeError("FlatBuffers: struct must be serialized inline.")},e.notNested=function(){if(this.isNested)throw TypeError("FlatBuffers: object serialization must not be nested.")},e.slot=function(t){null!==this.vtable&&(this.vtable[t]=this.offset())},e.offset=function(){return this.bb.capacity()-this.space},e.addOffset=function(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)},e.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},e.endObject=function(){if(null==this.vtable||!this.isNested)throw Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var r=(i+2)*2;this.addInt16(r);var n=0,a=this.space;e:for(e=0;e<this.vtables.length;e++){var s=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(s)){for(var o=2;o<r;o+=2)if(this.bb.readInt16(a+o)!=this.bb.readInt16(s+o))continue e;n=this.vtables[e];break}}return n?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,n-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},e.finish=function(t,e,i){var r=i?4:0;if(e){if(this.prep(this.minalign,8+r),4!=e.length)throw TypeError("FlatBuffers: file identifier must be length 4");for(var n=3;n>=0;n--)this.writeInt8(e.charCodeAt(n))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},e.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},e.requiredField=function(t,e){var i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(e<this.bb.readInt16(r)&&0!=this.bb.readInt16(r+e)))throw TypeError("FlatBuffers: field "+e+" must be set")},e.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(i,t*e)},e.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},e.createSharedString=function(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);var e=this.createString(t);return this.string_maps.set(t,e),e},e.createString=function(t){var e;return null==t?0:(ej(t,Uint8Array)?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())},e.createByteVector=function(t){return null==t?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())},e.createObjectOffset=function(t){return null===t?0:"string"==typeof t?this.createString(t):t.pack(this)},e.createObjectOffsetList=function(t){for(var e=[],i=0;i<t.length;++i){var r=t[i];if(null!==r)e.push(this.createObjectOffset(r));else throw TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e},e.createStructOffsetList=function(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()},t.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,r=ln.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r},t}(),ls=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.dataType=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.data=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.dataLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.dataArray=function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.unpack=function(){return new lo(this.dataType(),this.bb.createScalarList(this.data.bind(this),this.dataLength()))},e.unpackTo=function(t){t.dataType=this.dataType(),t.data=this.bb.createScalarList(this.data.bind(this),this.dataLength())},t.getRootAsFBEffectsObjectData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBEffectsObjectData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBEffectsObjectData=function(t){t.startObject(2)},t.addDataType=function(t,e){t.addFieldOffset(0,e,0)},t.addData=function(t,e){t.addFieldOffset(1,e,0)},t.createDataVector=function(t,e){t.startVector(1,e.length,1);for(var i=e.length-1;i>=0;i--)t.addInt8(e[i]);return t.endVector()},t.startDataVector=function(t,e){t.startVector(1,e,1)},t.endFBEffectsObjectData=function(t){return t.endObject()},t.createFBEffectsObjectData=function(e,i,r){return t.startFBEffectsObjectData(e),t.addDataType(e,i),t.addData(e,r),t.endFBEffectsObjectData(e)},t}(),lo=function(){function t(t,e){void 0===t&&(t=null),void 0===e&&(e=[]),this.dataType=t,this.data=e}return t.prototype.pack=function(t){var e=null!==this.dataType?t.createString(this.dataType):0,i=ls.createDataVector(t,this.data);return ls.createFBEffectsObjectData(t,e,i)},t}(),lu=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.exportObjects=function(t,e){var i=this.bb.__offset(this.bb_pos,4);return i?(e||new ls).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.exportObjectsLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},e.unpack=function(){return new lh(this.bb.createObjList(this.exportObjects.bind(this),this.exportObjectsLength()))},e.unpackTo=function(t){t.exportObjects=this.bb.createObjList(this.exportObjects.bind(this),this.exportObjectsLength())},t.getRootAsFBEffectsPackageData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBEffectsPackageData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBEffectsPackageData=function(t){t.startObject(1)},t.addExportObjects=function(t,e){t.addFieldOffset(0,e,0)},t.createExportObjectsVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startExportObjectsVector=function(t,e){t.startVector(4,e,4)},t.endFBEffectsPackageData=function(t){return t.endObject()},t.finishFBEffectsPackageDataBuffer=function(t,e){t.finish(e)},t.finishSizePrefixedFBEffectsPackageDataBuffer=function(t,e){t.finish(e,void 0,!0)},t.createFBEffectsPackageData=function(e,i){return t.startFBEffectsPackageData(e),t.addExportObjects(e,i),t.endFBEffectsPackageData(e)},t}(),lh=function(){function t(t){void 0===t&&(t=[]),this.exportObjects=t}return t.prototype.pack=function(t){var e=lu.createExportObjectsVector(t,t.createObjectOffsetList(this.exportObjects));return lu.createFBEffectsPackageData(t,e)},t}(),ll=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.offset=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0},e.indexCount=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0},e.vertexCount=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):0},e.unpack=function(){return new lc(this.offset(),this.indexCount(),this.vertexCount())},e.unpackTo=function(t){t.offset=this.offset(),t.indexCount=this.indexCount(),t.vertexCount=this.vertexCount()},t.getRootAsFBSubMesh=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBSubMesh=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBSubMesh=function(t){t.startObject(3)},t.addOffset=function(t,e){t.addFieldInt32(0,e,0)},t.addIndexCount=function(t,e){t.addFieldInt32(1,e,0)},t.addVertexCount=function(t,e){t.addFieldInt32(2,e,0)},t.endFBSubMesh=function(t){return t.endObject()},t.createFBSubMesh=function(e,i,r,n){return t.startFBSubMesh(e),t.addOffset(e,i),t.addIndexCount(e,r),t.addVertexCount(e,n),t.endFBSubMesh(e)},t}(),lc=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.offset=t,this.indexCount=e,this.vertexCount=i}return t.prototype.pack=function(t){return ll.createFBSubMesh(t,this.offset,this.indexCount,this.vertexCount)},t}(),lf=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.semantic=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.offset=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0},e.format=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):0},e.dimension=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.normalize=function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)},e.unpack=function(){return new ld(this.semantic(),this.offset(),this.format(),this.dimension(),this.normalize())},e.unpackTo=function(t){t.semantic=this.semantic(),t.offset=this.offset(),t.format=this.format(),t.dimension=this.dimension(),t.normalize=this.normalize()},t.getRootAsFBVertexChannel=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBVertexChannel=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBVertexChannel=function(t){t.startObject(5)},t.addSemantic=function(t,e){t.addFieldOffset(0,e,0)},t.addOffset=function(t,e){t.addFieldInt32(1,e,0)},t.addFormat=function(t,e){t.addFieldInt32(2,e,0)},t.addDimension=function(t,e){t.addFieldInt32(3,e,0)},t.addNormalize=function(t,e){t.addFieldInt8(4,+e,0)},t.endFBVertexChannel=function(t){return t.endObject()},t.createFBVertexChannel=function(e,i,r,n,a,s){return t.startFBVertexChannel(e),t.addSemantic(e,i),t.addOffset(e,r),t.addFormat(e,n),t.addDimension(e,a),t.addNormalize(e,s),t.endFBVertexChannel(e)},t}(),ld=function(){function t(t,e,i,r,n){void 0===t&&(t=null),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=!1),this.semantic=t,this.offset=e,this.format=i,this.dimension=r,this.normalize=n}return t.prototype.pack=function(t){var e=null!==this.semantic?t.createString(this.semantic):0;return lf.createFBVertexChannel(t,e,this.offset,this.format,this.dimension,this.normalize)},t}(),lp=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.vertexCount=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0},e.channels=function(t,e){var i=this.bb.__offset(this.bb_pos,6);return i?(e||new lf).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.channelsLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.unpack=function(){return new lm(this.vertexCount(),this.bb.createObjList(this.channels.bind(this),this.channelsLength()))},e.unpackTo=function(t){t.vertexCount=this.vertexCount(),t.channels=this.bb.createObjList(this.channels.bind(this),this.channelsLength())},t.getRootAsFBVertexData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBVertexData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBVertexData=function(t){t.startObject(2)},t.addVertexCount=function(t,e){t.addFieldInt32(0,e,0)},t.addChannels=function(t,e){t.addFieldOffset(1,e,0)},t.createChannelsVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startChannelsVector=function(t,e){t.startVector(4,e,4)},t.endFBVertexData=function(t){return t.endObject()},t.createFBVertexData=function(e,i,r){return t.startFBVertexData(e),t.addVertexCount(e,i),t.addChannels(e,r),t.endFBVertexData(e)},t}(),lm=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=[]),this.vertexCount=t,this.channels=e}return t.prototype.pack=function(t){var e=lp.createChannelsVector(t,t.createObjectOffsetList(this.channels));return lp.createFBVertexData(t,this.vertexCount,e)},t}(),lv=function(){function t(){this.bb=null,this.bb_pos=0}var e=t.prototype;return e.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.id=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.name=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.vertexData=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?(t||new lp).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},e.indexFormat=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.indexOffset=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):0},e.subMeshes=function(t,e){var i=this.bb.__offset(this.bb_pos,14);return i?(e||new ll).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null},e.subMeshesLength=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0},e.mode=function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):0},e.buffer=function(t){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null},e.binaryData=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.binaryDataLength=function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0},e.binaryDataArray=function(){var t=this.bb.__offset(this.bb_pos,20);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.boneNames=function(t,e){var i=this.bb.__offset(this.bb_pos,22);return i?this.bb.__string(this.bb.__vector(this.bb_pos+i)+4*t,e):null},e.boneNamesLength=function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0},e.rootBoneName=function(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null},e.inverseBindMatrices=function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},e.inverseBindMatricesLength=function(){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0},e.inverseBindMatricesArray=function(){var t=this.bb.__offset(this.bb_pos,26);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.unpack=function(){return new ly(this.id(),this.name(),null!==this.vertexData()?this.vertexData().unpack():null,this.indexFormat(),this.indexOffset(),this.bb.createObjList(this.subMeshes.bind(this),this.subMeshesLength()),this.mode(),this.buffer(),this.bb.createScalarList(this.binaryData.bind(this),this.binaryDataLength()),this.bb.createScalarList(this.boneNames.bind(this),this.boneNamesLength()),this.rootBoneName(),this.bb.createScalarList(this.inverseBindMatrices.bind(this),this.inverseBindMatricesLength()))},e.unpackTo=function(t){t.id=this.id(),t.name=this.name(),t.vertexData=null!==this.vertexData()?this.vertexData().unpack():null,t.indexFormat=this.indexFormat(),t.indexOffset=this.indexOffset(),t.subMeshes=this.bb.createObjList(this.subMeshes.bind(this),this.subMeshesLength()),t.mode=this.mode(),t.buffer=this.buffer(),t.binaryData=this.bb.createScalarList(this.binaryData.bind(this),this.binaryDataLength()),t.boneNames=this.bb.createScalarList(this.boneNames.bind(this),this.boneNamesLength()),t.rootBoneName=this.rootBoneName(),t.inverseBindMatrices=this.bb.createScalarList(this.inverseBindMatrices.bind(this),this.inverseBindMatricesLength())},t.getRootAsFBGeometryData=function(e,i){return(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFBGeometryData=function(e,i){return e.setPosition(e.position()+4),(i||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startFBGeometryData=function(t){t.startObject(12)},t.addId=function(t,e){t.addFieldOffset(0,e,0)},t.addName=function(t,e){t.addFieldOffset(1,e,0)},t.addVertexData=function(t,e){t.addFieldOffset(2,e,0)},t.addIndexFormat=function(t,e){t.addFieldInt32(3,e,0)},t.addIndexOffset=function(t,e){t.addFieldInt32(4,e,0)},t.addSubMeshes=function(t,e){t.addFieldOffset(5,e,0)},t.createSubMeshesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startSubMeshesVector=function(t,e){t.startVector(4,e,4)},t.addMode=function(t,e){t.addFieldInt32(6,e,0)},t.addBuffer=function(t,e){t.addFieldOffset(7,e,0)},t.addBinaryData=function(t,e){t.addFieldOffset(8,e,0)},t.createBinaryDataVector=function(t,e){t.startVector(1,e.length,1);for(var i=e.length-1;i>=0;i--)t.addInt8(e[i]);return t.endVector()},t.startBinaryDataVector=function(t,e){t.startVector(1,e,1)},t.addBoneNames=function(t,e){t.addFieldOffset(9,e,0)},t.createBoneNamesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()},t.startBoneNamesVector=function(t,e){t.startVector(4,e,4)},t.addRootBoneName=function(t,e){t.addFieldOffset(10,e,0)},t.addInverseBindMatrices=function(t,e){t.addFieldOffset(11,e,0)},t.createInverseBindMatricesVector=function(t,e){t.startVector(4,e.length,4);for(var i=e.length-1;i>=0;i--)t.addFloat32(e[i]);return t.endVector()},t.startInverseBindMatricesVector=function(t,e){t.startVector(4,e,4)},t.endFBGeometryData=function(t){return t.endObject()},t}(),ly=function(){function t(t,e,i,r,n,a,s,o,u,h,l,c){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=0),void 0===n&&(n=0),void 0===a&&(a=[]),void 0===s&&(s=0),void 0===o&&(o=null),void 0===u&&(u=[]),void 0===h&&(h=[]),void 0===l&&(l=null),void 0===c&&(c=[]),this.id=t,this.name=e,this.vertexData=i,this.indexFormat=r,this.indexOffset=n,this.subMeshes=a,this.mode=s,this.buffer=o,this.binaryData=u,this.boneNames=h,this.rootBoneName=l,this.inverseBindMatrices=c}return t.prototype.pack=function(t){var e=null!==this.id?t.createString(this.id):0,i=null!==this.name?t.createString(this.name):0,r=null!==this.vertexData?this.vertexData.pack(t):0,n=lv.createSubMeshesVector(t,t.createObjectOffsetList(this.subMeshes)),a=null!==this.buffer?t.createString(this.buffer):0,s=lv.createBinaryDataVector(t,this.binaryData),o=lv.createBoneNamesVector(t,t.createObjectOffsetList(this.boneNames)),u=null!==this.rootBoneName?t.createString(this.rootBoneName):0,h=lv.createInverseBindMatricesVector(t,this.inverseBindMatrices);return lv.startFBGeometryData(t),lv.addId(t,e),lv.addName(t,i),lv.addVertexData(t,r),lv.addIndexFormat(t,this.indexFormat),lv.addIndexOffset(t,this.indexOffset),lv.addSubMeshes(t,n),lv.addMode(t,this.mode),lv.addBuffer(t,a),lv.addBinaryData(t,s),lv.addBoneNames(t,o),lv.addRootBoneName(t,u),lv.addInverseBindMatrices(t,h),lv.endFBGeometryData(t)},t}(),lg=function(){function t(){this.exportObjectDatas=[]}var e=t.prototype;return e.addData=function(t){this.exportObjectDatas.push(t)},e.serializeToBinary=function(){for(var t,e=new la(1),i=new lh,r=[],n=iH(this.exportObjectDatas);!(t=n()).done;){var a=t.value,s=void 0;a.dataType===ey.Geometry&&(s=new lo("Geometry",this.geometryDataToBinary(a))),s&&r.push(s)}return i.exportObjects=r,lu.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.deserializeFromBinary=function(t){for(var e=new ln(t),i=lu.getRootAsFBEffectsPackageData(e),r=0;r<i.exportObjectsLength();r++){var n=i.exportObjects(r);if(n){var a=n.dataArray(),s=n.dataType();if(a){var o=void 0;s===ey.Geometry&&(o=this.binaryToGeometryData(a)),o&&this.exportObjectDatas.push(o)}}}},e.geometryDataToBinary=function(t){var e=new la(1),i=new ly,r=t.indexFormat,n=t.indexOffset,a=t.mode,s=t.id,o=t.vertexData,u=t.boneNames,h=t.rootBoneName,l=t.inverseBindMatrices,c=t.binaryData;i.indexFormat=r,i.indexOffset=n,i.mode=a,i.id=s,i.boneNames=void 0===u?[]:u,i.rootBoneName=void 0===h?"":h,i.inverseBindMatrices=void 0===l?[]:l,i.binaryData=void 0===c?[]:c;var f=new lm;f.vertexCount=o.vertexCount,f.channels=[];for(var d,p=iH(o.channels);!(d=p()).done;){var m=d.value,v=new ld(m.semantic,m.offset,m.format,m.dimension,m.normalize);f.channels.push(v)}i.vertexData=f;for(var y,g=[],x=iH(t.subMeshes);!(y=x()).done;){var b=y.value,T=new lc(b.offset,b.indexCount,b.vertexCount);g.push(T)}return i.subMeshes=g,lu.finishFBEffectsPackageDataBuffer(e,i.pack(e)),e.asUint8Array()},e.binaryToGeometryData=function(t){var e,i,r,n,a=new ln(t),s=lv.getRootAsFBGeometryData(a),o={vertexCount:0,channels:[]},u=s.vertexData();if(u){o.vertexCount=u.vertexCount();for(var h=0;h<u.channelsLength();h++){var l,c=u.channels(h);if(c){var f={semantic:null!=(l=c.semantic())?l:"",offset:c.offset(),format:c.format(),dimension:c.dimension(),normalize:c.normalize()};o.channels.push(f)}}}for(var d=[],p=0;p<s.subMeshesLength();p++){var m=s.subMeshes(p);if(m){var v={offset:m.offset(),vertexCount:m.vertexCount(),indexCount:m.indexCount()};d.push(v)}}for(var y=[],g=0;g<s.boneNamesLength();g++){var x=s.boneNames(g);y.push(x)}var b=s.inverseBindMatricesArray();return{vertexData:o,indexFormat:s.indexFormat(),indexOffset:s.indexOffset(),subMeshes:d,mode:s.mode(),buffer:null!=(e=s.buffer())?e:"",boneNames:y,rootBoneName:null!=(i=s.rootBoneName())?i:"",inverseBindMatrices:b?Array.from(b):void 0,binaryData:null!=(r=s.binaryDataArray())?r:void 0,id:null!=(n=s.id())?n:"",dataType:ey.Geometry}},t}(),lx=function(){function t(t){void 0===t&&(t=60),this.paused=!0,this.lastTime=0,this.dt=0,this.setFPS(t),this.tickers=[]}var e=t.prototype;return e.getFPS=function(){return this.targetFPS},e.setFPS=function(t){this.targetFPS=e3(t,1,120),this.interval=Math.floor(1e3/t)-2},e.getPaused=function(){return this.paused},e.start=function(){var t=this;if(this.paused=!1,this.dt=0,!this.intervalId){this.lastTime=performance.now();var e=requestAnimationFrame||function(t){return window.setTimeout(t,16.7)},i=function(){t.intervalId=e(i),t.paused||t.tick()};i()}},e.stop=function(){(cancelAnimationFrame||window.clearTimeout)(this.intervalId),this.intervalId=0,this.lastTime=0,this.paused=!0,this.dt=0,this.tickers=[]},e.pause=function(){this.paused=!0,this.dt=0},e.resume=function(){this.paused=!1,this.dt=0},e.tick=function(){if(!this.paused){var t=performance.now();if(this.dt=t-this.lastTime,this.dt>=this.interval){this.lastTime=t,this.resetTickers&&(this.tickers=this.tickers.filter(function(t){return t}),this.resetTickers=!1);for(var e,i=iH(this.tickers);!(e=i()).done;)(0,e.value)(this.dt)}}},e.add=function(t){if("function"!=typeof t)throw Error("The tick object must implement the tick method.");this.tickers.push(t)},rV(t,[{key:"deltaTime",get:function(){return this.dt}}]),t}(),lb=function(e){function i(i,r){var n,a,s,o,u,h,l;return(n=e.call(this)||this).name="NewEngine",n.speed=1,n.displayScale=1,n.offscreenMode=!1,n.renderErrors=new Set,n.compositions=[],n.assetManagers=[],n.env="",n.ticker=null,n.doNotHandleContextLost=!0,n.contextWasLost=!1,n._disposed=!1,n.textures=[],n.materials=[],n.geometries=[],n.meshes=[],n.renderPasses=[],n.framebuffers=[],n.renderbuffers=[],n.particleSystems=[],n.clearAction={stencilAction:t.TextureLoadAction.clear,clearStencil:0,depthAction:t.TextureLoadAction.clear,clearDepth:1,colorAction:t.TextureLoadAction.clear,clearColor:[0,0,0,0]},n.canvas=i,n.env=null!=(a=null==r?void 0:r.env)?a:"",n.doNotHandleContextLost=null==(s=null==r?void 0:r.doNotHandleContextLost)||s,n.name=null!=(o=null==r?void 0:r.name)?o:n.name,n.pixelRatio=null!=(u=null==r?void 0:r.pixelRatio)?u:ir(),n.jsonSceneData={},n.objectInstance={},n.whiteTexture=nn(oA(n)),n.transparentTexture=na(oA(n)),(null==r?void 0:r.manualRender)||(n.ticker=new lx(null==r?void 0:r.fps),n.runRenderLoop(n.mainLoop.bind(oA(n)))),n.eventSystem=new s0(oA(n),null!=(h=null==r?void 0:r.notifyTouch)&&h),n.eventSystem.enabled=null!=(l=null==r?void 0:r.interactive)&&l,n.eventSystem.bindListeners(n.canvas),n.assetLoader=new ht(oA(n)),n.assetService=new h1(oA(n)),n.renderTargetPool=new sC(oA(n)),n.renderingData={currentFrame:{}},iD.notifyEngineCreated(oA(n)),n}iG(i,e);var r=i.prototype;return r.clearResources=function(){this.jsonSceneData={},this.objectInstance={}},r.addEffectsObjectData=function(t){this.jsonSceneData[t.id]=t},r.findEffectsObjectData=function(t){return this.jsonSceneData[t]},r.addInstance=function(t){this.objectInstance[t.getInstanceId()]=t},r.findObject=function(t){return iM(t)?this.objectInstance[t.id]?this.objectInstance[t.id]:this.assetLoader.loadGUID(t):t},r.removeInstance=function(t){delete this.objectInstance[t]},r.addPackageDatas=function(t){for(var e,i=t.jsonScene,r=t.textureOptions,n=i.items,a=i.materials,s=i.shaders,o=i.geometries,u=i.components,h=i.animations,l=i.bins,c=void 0===l?[]:l,f=i.miscs,d=i.compositions,p=iH(d);!(e=p()).done;){var m=e.value;this.addEffectsObjectData(m)}for(var v,y=iH(void 0===n?[]:n);!(v=y()).done;){var g=v.value;hY(g.renderLevel,t.renderLevel)||(g.components=[],g.type=tZ.null),this.addEffectsObjectData(g)}for(var x,b=iH(void 0===a?[]:a);!(x=b()).done;){var T=x.value;this.addEffectsObjectData(T)}for(var E,C=iH(void 0===s?[]:s);!(E=C()).done;){var S=E.value;this.addEffectsObjectData(S)}for(var _,w=iH(void 0===o?[]:o);!(_=w()).done;){var M=_.value;this.addEffectsObjectData(M)}for(var A,P=iH(void 0===u?[]:u);!(A=P()).done;){var I=A.value;this.addEffectsObjectData(I)}for(var R,O=iH(void 0===h?[]:h);!(R=O()).done;){var V=R.value;this.addEffectsObjectData(V)}for(var L,N=iH(void 0===f?[]:f);!(L=N()).done;){var F=L.value;this.addEffectsObjectData(F)}for(var D=0;D<c.length;D++){var k=c[D],z=t.bins[D];if(k.dataType===ey.BinaryAsset)k.buffer=z,k.id&&this.addEffectsObjectData(k);else{var B=new lg;B.deserializeFromBinary(new Uint8Array(z));for(var U,G=iH(B.exportObjectDatas);!(U=G()).done;){var j=U.value;this.addEffectsObjectData(j)}}}for(var W,X=iH(void 0===r?[]:r);!(W=X()).done;){var H=W.value;this.addEffectsObjectData(H)}},r.runRenderLoop=function(t){var e;null==(e=this.ticker)||e.add(t)},r.mainLoop=function(t){if(!this.contextWasLost){var e=this.renderErrors;if(e.size>0){this.emit("rendererror",e.values().next().value),null==(r=this.ticker)||r.pause();return}t=Math.min(t,33)*this.speed;var i=this.compositions;i.sort(function(t,e){return t.getIndex()-e.getIndex()});for(var r,n,a=!1,s=iH(i);!(n=s()).done;){var o=n.value;if(o.textureOffloaded){a=!0,iT.error("Composition "+o.name+" texture offloaded, skip render.");continue}o.update(t)}if(a){this.emit("rendererror",Error("Play when texture offloaded.")),null==(u=this.ticker)||u.pause();return}for(var u,h,l=iH(i);!(h=l()).done;)h.value.sceneTicking.preRender.tick(0);this.renderer.setFramebuffer(null),this.renderer.clear(this.clearAction);for(var c,f=iH(i);!(c=f()).done;)c.value.render();this.renderTargetPool.flush()}},r.resize=function(){var t,e,i,r,n=this.canvas.parentElement;if(n){var a=this.getTargetSize(n);t=a[0],e=a[1],i=a[2],r=a[3]}else t=i=this.canvas.width,e=r=this.canvas.height;var s=t/e;if(t&&e){var o=document.documentElement.clientWidth;i>2*o&&iT.error("DPI overflowed, width "+i+" is more than 2x document width "+o+", see "+nN["DPI overflowed"]+".");var u=this.env?this.gpuCapability.detail.maxTextureSize:2048;(i>u||r>u)&&(iT.error("Container size overflowed "+i+"x"+r+", see "+nN["Container size overflowed"]+"."),s>1?(i=Math.round(u),r=Math.round(u/s)):(r=Math.round(u),i=Math.round(u*s))),this.canvas.style.width=t+"px",this.canvas.style.height=e+"px",iT.info("Resize engine "+this.name+" ["+i+","+r+","+t+","+e+"]."),this.setSize(i,r)}},r.setSize=function(t,e){var i;(this.getWidth()!==t||this.getHeight()!==e)&&(this.canvas.width=t,this.canvas.height=e,this.viewport(0,0,t,e)),null==(i=this.compositions)||i.forEach(function(i){i.camera.aspect=t/e}),this.emit("resize",this)},r.createVertexBuffer=function(t,e){throw Error("The active rendering backend does not provide vertex buffers.")},r.createDynamicVertexBuffer=function(t,e){return this.createVertexBuffer(t,e)},r.createIndexBuffer=function(t,e){throw Error("The active rendering backend does not provide index buffers.")},r.updateDynamicVertexBuffer=function(t,e,i,r){throw Error("The active rendering backend cannot update vertex buffers.")},r.updateDynamicIndexBuffer=function(t,e,i){throw Error("The active rendering backend cannot update index buffers.")},r.releaseBuffer=function(t){return t.references--,0===t.references},r.bindBuffers=function(t,e,i){throw Error("The active rendering backend cannot bind geometry buffers.")},r.addTexture=function(t){this.disposed||eK(this.textures,t)},r.removeTexture=function(t){this.disposed||eQ(this.textures,t)},r.addMaterial=function(t){this.disposed||eK(this.materials,t)},r.removeMaterial=function(t){this.disposed||eQ(this.materials,t)},r.addGeometry=function(t){this.disposed||eK(this.geometries,t)},r.removeGeometry=function(t){this.disposed||eQ(this.geometries,t)},r.addParticleSystem=function(t){this.disposed||eK(this.particleSystems,t)},r.removeParticleSystem=function(t){this.disposed||eQ(this.particleSystems,t)},r.addMesh=function(t){this.disposed||eK(this.meshes,t)},r.removeMesh=function(t){this.disposed||eQ(this.meshes,t)},r.addRenderPass=function(t){this.disposed||eK(this.renderPasses,t)},r.removeRenderPass=function(t){this.disposed||eQ(this.renderPasses,t)},r.addFramebuffer=function(t){this.disposed||eK(this.framebuffers,t)},r.removeFramebuffer=function(t){this.disposed||eQ(this.framebuffers,t)},r.addRenderbuffer=function(t){this.disposed||eK(this.renderbuffers,t)},r.removeRenderbuffer=function(t){this.disposed||eQ(this.renderbuffers,t)},r.addComposition=function(t){this.disposed||eK(this.compositions,t)},r.removeComposition=function(t){this.disposed||eQ(this.compositions,t)},r.getWidth=function(){return 0},r.getHeight=function(){return 0},r.getShaderLibrary=function(){return null},r.bindSystemFramebuffer=function(){},r.viewport=function(t,e,i,r){},r.clear=function(t){},r.drawGeometry=function(t,e,i,r){},r.setSampleAlphaToCoverage=function(t){},r.setBlending=function(t){},r.setDepthTest=function(t){},r.setStencilTest=function(t){},r.setCulling=function(t){},r.setPolygonOffsetFill=function(t){},r.blendColor=function(t,e,i,r){},r.blendFuncSeparate=function(t,e,i,r){},r.blendEquationSeparate=function(t,e){},r.colorMask=function(t,e,i,r){},r.depthMask=function(t){},r.depthFunc=function(t){},r.depthRange=function(t,e){},r.polygonOffset=function(t,e){},r.cullFace=function(t){},r.frontFace=function(t){},r.stencilMaskSeparate=function(t,e){},r.stencilFuncSeparate=function(t,e,i,r){},r.stencilOpSeparate=function(t,e,i,r){},r.dispose=function(){if(!this.disposed){this._disposed=!0,iD.notifyEngineDestroy(this);var t,e,i,r,n=[];this.renderPasses.length>0&&n.push("Pass "+this.renderPasses.length),this.meshes.length>0&&n.push("Mesh "+this.meshes.length),this.geometries.length>0&&n.push("Geom "+this.geometries.length),this.textures.length>0&&n.push("Tex "+this.textures.length),n.length>0&&iT.warn("Release GPU memory: "+n.join(", ")+"."),null==(t=this.ticker)||t.stop(),null==(e=this.eventSystem)||e.dispose(),null==(i=this.assetService)||i.dispose(),null==(r=this._graphics)||r.dispose(),this.renderPasses.forEach(function(t){return t.dispose()}),this.meshes.forEach(function(t){return t.dispose()}),this.geometries.forEach(function(t){return t.dispose()}),this.materials.forEach(function(t){return t.dispose()}),this.textures.forEach(function(t){return t.dispose()}),this.assetManagers.forEach(function(t){return t.dispose()}),this.compositions.forEach(function(t){return t.dispose()}),this.textures=[],this.materials=[],this.geometries=[],this.meshes=[],this.renderPasses=[],this.compositions=[],this.particleSystems=[]}},r.getTargetSize=function(t){if(null==t)throw Error("Container is not an HTMLElement, see "+nN["Container is not an HTMLElement"]+".");var e,i,r=this.displayAspect,n=null==window.getComputedStyle?void 0:window.getComputedStyle.call(window,t),a=0,s=0;n?(a=parseInt(n.width,10),s=parseInt(n.height,10)):(a=t.clientWidth,s=t.clientHeight),r?a/s>r?e=(i=s*this.displayScale)*r:i=(e=a*this.displayScale)/r:(e=a,i=s);var o=this.pixelRatio,u=e,h=i;if(e=Math.round(e*o),i=Math.round(i*o),e<1||i<1){if(this.offscreenMode)e=i=u=h=1;else throw Error("Invalid container size "+e+"x"+i+", see "+nN["Invalid container size"]+".")}return[u,h,e,i]},rV(i,[{key:"graphics",get:function(){return this._graphics||(this._graphics=new sN(this)),this._graphics}},{key:"disposed",get:function(){return this._disposed}}]),i}(nF),lT={format:rD.RGBA,type:rD.UNSIGNED_BYTE,minFilter:rD.LINEAR,magFilter:rD.LINEAR,wrapS:rD.CLAMP_TO_EDGE,wrapT:rD.CLAMP_TO_EDGE},lE=Symbol("dispose"),lC=function(){function e(t){this.textureCache={},this.textureRef={},this.engine=t}var i=e.prototype;return i.requestColorAttachmentTexture=function(e){var i=this,r=e.width,n=e.height,a=e.name,s={sourceType:t.TextureSourceType.framebuffer,data:{width:r,height:n},name:a},o=[a];Object.getOwnPropertyNames(lT).forEach(function(t){var i,r=null!=(i=e[t])?i:lT[t];s[t]=r,o.push(t,r)});var u=o.join(":"),h=this.textureCache[u];if(h)this.textureRef[u]++;else{var l=this.engine;iy(l),h=ne.create(l,s),this.textureCache[u]=h,this.textureRef[u]=1,h[lE]=h.dispose,h.dispose=function(){return i.removeTexture(u)}}return h},i.removeTexture=function(t){var e=this.textureRef[t];if(e<=1){e<0&&console.error("Ref count < 0.");var i=this.textureCache[t];i&&(i[lE](),i.dispose=i[lE]),delete this.textureCache[t],delete this.textureRef[t]}else this.textureRef[t]=e-1},i.dispose=function(){var t=this;Object.keys(this.textureCache).forEach(function(e){var i=t.textureCache[e];i[lE](),i.dispose=i[lE]}),this.textureCache={},this.textureRef={},this.engine=void 0},e}(),lS=function(){function t(){}return t.load=function(t,e,i){void 0===i&&(i={});var r=this;return eG(function(){var n,a,s,o,u,h,l,c,f,d,p,m,v;return eX(this,function(y){switch(y.label){case 0:return o=performance.now(),u=null==(a=e.gpuCapability)?void 0:null==(n=a.detail)?void 0:n.asyncShaderCompile,h=e.compositions.length,l=new h$(i),e.assetManagers.push(l),[4,l.loadScene(t,e.renderer)];case 1:return c=y.sent(),e.clearResources(),iD.notifyAssetsLoadFinish(c,l.options,e),e.assetService.prepareAssets(c,c.assets),e.assetService.updateTextVariables(c,i.variables),(f=r.createComposition(c,e,i)).setIndex(h),d=performance.now(),[4,new Promise(function(t){var i;null==(i=e.getShaderLibrary())||i.compileAllShaders(function(){return t(null)})})];case 2:return y.sent(),p=performance.now()-d,null==(s=e.ticker)||s.start(),m=f.name,v=performance.now()-o,f.statistic.compileTime=p,f.statistic.firstFrameTime=v,iT.info("First frame ["+m+"]: "+v.toFixed(4)+"ms."),iT.info("Shader "+(u?"async":"sync")+" compile ["+m+"]: "+p.toFixed(4)+"ms."),[2,f]}})})()},t.createComposition=function(t,e,i){void 0===i&&(i={});var r=new h7(e,re({},i),t);return e.env!==nL&&e.assetService.createShaderVariant(),r},t}(),l_=function(){function e(){}return e.instantiate=function(e,i){var r,n=e.scene,a=e.scene.jsonScene,s=e.options,o=i.engine;o.clearResources(),iD.notifyAssetsLoadFinish(n,s,o),o.assetService.prepareAssets(n,n.assets),o.assetService.updateTextVariables(n,s.variables),i.createTexturesFromData(n.textureOptions);for(var u,h=iH(Object.keys(n.assets));!(u=h()).done;){var l=u.value,c=n.assets[l];ej(c,HTMLVideoElement)&&i.videos.push(c)}var f=a.compositionId,d=a.compositions.find(function(t){return t.id===f});if(!d)throw Error('Composition with id "'+f+'" not found in JSONScene.');var p=new t.VFXItem(o);return p.instantiatePreComposition(d),p.getComponent(t.CompositionComponent).playOnStart=null==(r=s.autoplay)||r,p.getComponent(t.CompositionComponent).endBehavior=p.endBehavior,i.addItem(p),p},e}();iF("camera",sq),iF("text",uU),iF("sprite",s6),iF("particle",uO),iF("interact",s2),iT.info("Core version: 2.10.0-alpha.2.");var lw=((eF={})[rD.ONE]=eB.OneFactor,eF[rD.ZERO]=eB.ZeroFactor,eF[rD.SRC_COLOR]=eB.SrcColorFactor,eF[rD.SRC_ALPHA]=eB.SrcAlphaFactor,eF[rD.ONE_MINUS_SRC_COLOR]=eB.OneMinusSrcColorFactor,eF[rD.ONE_MINUS_SRC_ALPHA]=eB.OneMinusSrcAlphaFactor,eF[rD.DST_COLOR]=eB.DstColorFactor,eF[rD.DST_ALPHA]=eB.DstAlphaFactor,eF[rD.ONE_MINUS_DST_COLOR]=eB.OneMinusDstColorFactor,eF[rD.ONE_MINUS_DST_ALPHA]=eB.OneMinusDstAlphaFactor,eF),lM=((eD={})[rD.NEVER]=eB.NeverStencilFunc,eD[rD.EQUAL]=eB.EqualStencilFunc,eD[rD.LESS]=eB.LessStencilFunc,eD[rD.LEQUAL]=eB.LessEqualStencilFunc,eD[rD.ALWAYS]=eB.AlwaysStencilFunc,eD[rD.NOTEQUAL]=eB.NotEqualStencilFunc,eD[rD.GREATER]=eB.GreaterStencilFunc,eD[rD.GEQUAL]=eB.GreaterEqualStencilFunc,eD),lA=((ek={})[rD.KEEP]=eB.KeepStencilOp,ek[rD.ZERO]=eB.ZeroStencilOp,ek[rD.REPLACE]=eB.ReplaceStencilOp,ek[rD.INCR]=eB.IncrementStencilOp,ek[rD.DECR]=eB.DecrementStencilOp,ek[rD.INCR_WRAP]=eB.IncrementWrapStencilOp,ek[rD.DECR_WRAP]=eB.IncrementWrapStencilOp,ek[rD.INVERT]=eB.InvertStencilOp,ek),lP=((ez={})[rD.NEVER]=eB.NeverDepth,ez[rD.ALWAYS]=eB.AlwaysDepth,ez[rD.EQUAL]=eB.EqualDepth,ez[rD.LESS]=eB.LessDepth,ez[rD.LEQUAL]=eB.LessEqualDepth,ez[rD.GREATER]=eB.GreaterDepth,ez[rD.GEQUAL]=eB.GreaterEqualDepth,ez[rD.NOTEQUAL]=eB.NotEqualDepth,ez),lI=["uMaskTex","_MainTex","uColorOverLifetime","uColorOverTrail"],lR=function(e){function i(i,r){(n=e.call(this,i,r)||this).textures={},n.material=new eB.RawShaderMaterial,n.threeUniforms={},n.macrosDirty=!0;var n,a,s,o,u,h,l,c=null==r?void 0:r.shader,f=null!=(s=null==(a=i.gpuCapability)?void 0:a.level)?s:1;return n.shader=new t.Shader(i),n.shader.shaderData=re({},c,{id:iR(),dataType:ey.Shader,vertex:null!=(o=null==c?void 0:c.vertex)?o:"",fragment:null!=(u=null==c?void 0:c.fragment)?u:""}),n.threeUniforms._MainTex=new eB.Uniform(null),n.threeUniforms.effects_ObjectToWorld=new eB.Uniform(new eB.Matrix4().identity()),n.threeUniforms.effects_MatrixInvV=new eB.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,8,1]),n.threeUniforms.effects_MatrixVP=new eB.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-8,1]),n.threeUniforms.effects_MatrixV=new eB.Uniform([1,0,0,0,0,1,0,0,0,0,1,0,0,0,8,1]),n.material=new eB.RawShaderMaterial({vertexShader:sm.genFinalShaderCode({level:f,shaderType:t.ShaderType.vertex,shader:null!=(h=null==c?void 0:c.vertex)?h:"",macros:null==c?void 0:c.macros,removeVersion:!0}),fragmentShader:sm.genFinalShaderCode({level:f,shaderType:t.ShaderType.fragment,shader:null!=(l=null==c?void 0:c.fragment)?l:"",macros:null==c?void 0:c.macros,removeVersion:!0}),alphaToCoverage:!1,depthFunc:eB.LessDepth,polygonOffsetFactor:eB.ZeroFactor,polygonOffsetUnits:eB.ZeroFactor,polygonOffset:!1,uniforms:n.threeUniforms}),1===f?n.material.glslVersion=eB.GLSL1:n.material.glslVersion=eB.GLSL3,n}iG(i,e);var r=i.prototype;return r.onSetUniformValue=function(t,e){var i;lI.includes(t)&&(i=e.texture),this.material.uniforms[t]?this.material.uniforms[t].value=i||e:this.material.uniforms[t]=new eB.Uniform(i||e)},r.use=function(t,e){var i=this.engine,r=i.composition,n=i.threeCamera;if(n){var a=new eB.Matrix4().multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse);this.setMatrix("effects_MatrixVP",a)}else{var s=r.camera;this.setMatrix("effects_MatrixVP",s.getViewProjectionMatrix()),this.setMatrix("effects_MatrixV",s.getViewMatrix())}},r.onRemoveUniformValue=function(t){this.material.uniforms[t]&&(this.material.uniforms[t].value=null)},r.getTexture=function(t){return this.textures[t]},r.setTexture=function(t,e){this.setUniform(t,e.texture),this.textures[t]=e},r.getVector4Array=function(t){return this.threeUniforms[t].value},r.setVector4Array=function(t,e){for(var i,r=[],n=iH(e);!(i=n()).done;){var a=i.value;r=r.concat(a.toArray())}this.setUniform(t,r)},r.getMatrixArray=function(t){return this.threeUniforms[t].value},r.setMatrixArray=function(t,e){for(var i,r=[],n=iH(e);!(i=n()).done;){var a=i.value;r=r.concat(a.elements)}this.setUniform(t,r)},r.setMatrixNumberArray=function(t,e){this.setUniform(t,e)},r.getMatrix=function(t){return this.threeUniforms[t].value},r.setMatrix=function(t,e){this.setUniform(t,e)},r.setMatrix3=function(t,e){this.setUniform(t,e)},r.getVector2=function(t){return this.threeUniforms[t].value},r.setVector2=function(t,e){this.setUniform(t,e)},r.getVector3=function(t){return this.threeUniforms[t].value},r.setVector3=function(t,e){this.setUniform(t,e)},r.getVector4=function(t){return this.threeUniforms[t].value},r.setVector4=function(t,e){this.setUniform(t,e)},r.getColor=function(t){var e=this.threeUniforms[t].value;return new e8(e.x,e.y,e.z,e.w)},r.setColor=function(t,e){this.setUniform(t,new eB.Vector4(e.r,e.g,e.b,e.a))},r.getQuaternion=function(t){return this.threeUniforms[t].value},r.setQuaternion=function(t,e){this.setUniform(t,e)},r.getFloat=function(t){return this.threeUniforms[t].value},r.setFloat=function(t,e){this.setUniform(t,e)},r.getFloats=function(t){return this.threeUniforms[t].value},r.setFloats=function(t,e){this.setUniform(t,e)},r.getInt=function(t){return this.threeUniforms[t].value},r.setInt=function(t,e){this.setUniform(t,e)},r.hasUniform=function(t){return!!this.threeUniforms[t]},r.setUniform=function(t,e){var i=new eB.Uniform(e);this.threeUniforms[t]=this.material.uniforms[t]=i},r.enableMacro=function(t,e){this.isMacroEnabled(t)&&this.enabledMacros[t]===e||(this.enabledMacros[t]=null==e||e,this.macrosDirty=!0)},r.disableMacro=function(t){this.isMacroEnabled(t)&&(delete this.enabledMacros[t],this.macrosDirty=!0)},r.isMacroEnabled=function(t){return void 0!==this.enabledMacros[t]},r.clone=function(t){throw Error("Method not implemented.")},r.cloneUniforms=function(t){throw Error("Method not implemented.")},r.fromData=function(t){throw Error("Method not implemented.")},r.dispose=function(){this.destroyed||(this.material.dispose(),this.destroyed=!0,e.prototype.dispose.call(this))},rV(i,[{key:"blending",get:function(){return this.material.blending!==eB.NoBlending},set:function(t){this.material.blending=t?eB.CustomBlending:eB.NoBlending}},{key:"blendFunction",get:function(){var t=this.material,e=t.blendSrc,i=t.blendDst;return[e,i,t.blendSrcAlpha||e,t.blendDstAlpha||i]},set:function(t){if(t){var e=t[0],i=t[1],r=t[2],n=t[3];this.material.blendSrc=lw[e],this.material.blendDst=lw[i],this.material.blendSrcAlpha=lw[r],this.material.blendDstAlpha=lw[n]}}},{key:"blendEquation",get:function(){var t=this.material,e=t.blendEquation;return[e,t.blendEquationAlpha||e]},set:function(t){if(t){var e=t[0],i=t[1];this.material.blendEquation=e,this.material.blendEquationAlpha=i}}},{key:"depthTest",get:function(){return this.material.depthTest},set:function(t){this.material.depthTest=!!t}},{key:"depthMask",get:function(){return this.material.depthWrite},set:function(t){this.material.depthWrite=!!t}},{key:"depthFunc",get:function(){return this.material.depthFunc},set:function(t){void 0!==t&&(this.material.depthFunc=lP[t])}},{key:"polygonOffsetFill",get:function(){return this.material.polygonOffset},set:function(t){this.material.polygonOffset=!!t}},{key:"polygonOffset",get:function(){return[this.material.polygonOffsetFactor,this.material.polygonOffsetUnits]},set:function(t){if(t){var e=t[0],i=t[1];this.material.polygonOffsetFactor=e,this.material.polygonOffsetUnits=i}}},{key:"sampleAlphaToCoverage",get:function(){return this.material.alphaToCoverage},set:function(t){this.material.alphaToCoverage=!!t}},{key:"stencilTest",get:function(){return this.material.stencilWrite},set:function(t){this.material.stencilWrite=!!t}},{key:"stencilMask",get:function(){return[this.material.stencilWriteMask,this.material.stencilWriteMask]},set:function(t){t&&(this.material.stencilWriteMask=t[0])}},{key:"stencilRef",get:function(){return[this.material.stencilRef,this.material.stencilRef]},set:function(t){t&&(this.material.stencilRef=t[0])}},{key:"stencilFunc",get:function(){return[this.material.stencilFunc,this.material.stencilFunc]},set:function(t){t&&(this.material.stencilFunc=lM[t[0]])}},{key:"stencilOpFail",get:function(){return[this.material.stencilFail,this.material.stencilZFail]},set:function(t){t&&(this.material.stencilFail=lA[t[0]])}},{key:"stencilOpZFail",get:function(){return[this.material.stencilZFail,this.material.stencilZFail]},set:function(t){t&&(this.material.stencilZFail=lA[t[0]])}},{key:"stencilOpZPass",get:function(){return[this.material.stencilZPass,this.material.stencilZPass]},set:function(t){t&&(this.material.stencilZPass=lA[t[0]])}},{key:"culling",get:function(){return this.material.side!==eB.DoubleSide},set:function(t){this.material.side=t?eB.FrontSide:eB.DoubleSide}},{key:"cullFace",get:function(){return this.material.side},set:function(t){t===tG.FRONT?this.material.side=eB.FrontSide:t===tG.BACK&&(this.material.side=eB.BackSide)}},{key:"colorMask",get:function(){return this.material.colorWrite},set:function(t){this.material.colorWrite=t}}]),i}(nb);function lO(t,e){return e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:oA(t)}var lV=new WeakMap;function lL(t){t.flush();var e,i=lV.get(t),r=t.getAttributeNames(),n=t.getIndexBuffer(),a=t.instanceCount>0;if(!i||!((e=i).indexBuffer===n&&e.instanced===a&&Object.keys(e.vertexBuffers).length===r.length&&r.every(function(i){return e.vertexBuffers[i]===t.getVertexBuffer(i)}))){null==i||i.resource.dispose();var s=a?new eB.InstancedBufferGeometry:new eB.BufferGeometry,o={};s.name=t.name,r.forEach(function(e){var i=t.getVertexBuffer(e),r=null==i?void 0:i.getBuffer(),n=null==r?void 0:r.resource;i&&ej(n,eB.InterleavedBuffer)&&(o[e]=i,s.setAttribute(e,new eB.InterleavedBufferAttribute(n,i.getSize(),i.byteOffset/n.array.BYTES_PER_ELEMENT,i.normalized)))});var u=null==n?void 0:n.resource;ej(u,eB.BufferAttribute)&&s.setIndex(u),i={vertexBuffers:o,indexBuffer:n,instanced:a,resource:s},lV.set(t,i)}ej(i.resource,eB.InstancedBufferGeometry)&&(i.resource.instanceCount=t.instanceCount);var h=t.getIndexBuffer()?t.getDrawStart()/nC(t.getIndexType()):t.getDrawStart();return i.resource.setDrawRange(h,t.getDrawCount()),i.resource}var lN=function(t){function e(e,i){if(!i)return lO(r);var r,n=i.material,a=i.geometry,s=i.priority;(r=t.call(this,e,i)||this).geometry=a,r.material=n;var o=lL(a);return a.mode===rD.LINES?r.mesh=new eB.LineSegments(o,n.material):r.mesh=new eB.Mesh(o,n.material),r.priority=void 0===s?0:s,r}iG(e,t);var i=e.prototype;return i.setVisible=function(t){this.mesh.visible=t},i.getVisible=function(){return this.mesh.visible},i.firstGeometry=function(){return this.geometry},i.setMaterial=function(t){this.material.dispose(),this.material=t,this.mesh.material=t.material},i.onStart=function(){t.prototype.onStart.call(this),this.engine.threeGroup.add(this.mesh)},i.restore=function(){},i.render=function(t){!this.isDestroyed&&this.getVisible()&&(this.mesh.geometry=lL(this.geometry),this.material.setMatrix("effects_ObjectToWorld",this.worldMatrix),this.material.use(t,t.renderingData.currentFrame.globalUniforms))},i.dispose=function(e){this.destroyed||(this.mesh.clear(),this.destroyed=!0),t.prototype.dispose.call(this)},rV(e,[{key:"priority",get:function(){return this.mesh.renderOrder},set:function(t){this.mesh&&(this.mesh.renderOrder=t)}}]),e}(si),lF=function(e){function i(i,r,n){if(void 0===n&&(n={}),a=e.call(this,i)||this,r){var a,s=r.width,o=r.height;a.texture=a.createTextureByType(re({},n,{sourceType:t.TextureSourceType.data,data:r})),a.width=void 0===s?1:s,a.height=void 0===o?1:o}else a.texture=a.createTextureByType(n);return a.texture.needsUpdate=!0,a.source={},a}iG(i,e);var r=i.prototype;return r.updateSource=function(t){this.texture.dispose(),this.texture=this.createTextureByType(t),this.texture.needsUpdate=!0},r.assembleOptions=function(e){var r=e.target,n=void 0===r?rD.TEXTURE_2D:r;return e.sourceType||("image"in e?e.sourceType=t.TextureSourceType.image:"data"in e?e.sourceType=t.TextureSourceType.data:"video"in e?e.sourceType=t.TextureSourceType.video:e.sourceType=t.TextureSourceType.none),re({},e,{target:n,format:eB.RGBAFormat,type:eB.UnsignedByteType,minFilter:i.toThreeJsTextureFilter(e.minFilter),magFilter:i.toThreeJsTextureFilter(e.magFilter),wrapS:i.toThreeJsTextureWrap(e.wrapS),wrapT:i.toThreeJsTextureWrap(e.wrapT)})},r.dispose=function(){this.texture.dispose(),e.prototype.dispose.call(this)},r.fromData=function(t){e.prototype.fromData.call(this,t),this.texture=this.createTextureByType(t),this.texture.needsUpdate=!0},r.createTextureByType=function(e){var i=this.assembleOptions(e),r=i.flipY,n=i.type,a=i.wrapS,s=i.wrapT,o=i.minFilter,u=i.magFilter,h=i.sourceType,l=eB.UVMapping,c=i.format,f=void 0;if(this.sourceType=h,h===t.TextureSourceType.data){var d=e.data;f=new eB.DataTexture(d.data,d.width,d.height,c,n,l,a,s,u,o),this.width=d.width,this.height=d.height}else if(h===t.TextureSourceType.image){var p=e.image;f=new eB.Texture(p,l,a,s,u,o,c,n),this.width=p.width,this.height=p.height}else if(h===t.TextureSourceType.compressed){var m=0,v=0,y=e.mipmaps.map(function(t){var e=t.data,i=t.width,r=t.height;return m=m<i?i:m,v=v<r?r:v,{data:e,width:i,height:r,colorSpace:"srgb"}});c=eB.RGBA_ASTC_4x4_Format,f=new eB.CompressedTexture(y,m,v,c,n,l,a,s,u,o),this.width=m,this.height=v}else if(h===t.TextureSourceType.video)f=new eB.VideoTexture(e.video,l,a,s,u,o,c,n);else if(h===t.TextureSourceType.framebuffer){var g=e.data;if(g){var x,b,T=null!=(x=g.width)?x:0,E=null!=(b=g.height)?b:0;f=new eB.FramebufferTexture(T,E,c),this.width=T,this.height=E}}else h===t.TextureSourceType.none&&((f=new eB.DataTexture(new Uint8Array(4).fill(255),1,1)).wrapS=eB.MirroredRepeatWrapping,f.wrapT=eB.MirroredRepeatWrapping,this.width=this.height=1);if(this.source=e,f)return f.flipY=!!r,f;throw Error("Create a texture using an unknown data type.")},i.toThreeJsTextureFilter=function(t){return t===rD.LINEAR?eB.LinearFilter:eB.NearestFilter},i.toThreeJsTextureWrap=function(t){switch(t){case rD.MIRRORED_REPEAT:return eB.MirroredRepeatWrapping;case rD.REPEAT:return eB.RepeatWrapping;default:return eB.ClampToEdgeWrapping}},i}(ne),lD=function(t){function e(e,i,r){return t.call(this,e,i,r)}return iG(e,t),e.prototype.render=function(){var t=this.renderer;this.renderFrame.renderPasses[0].meshes.length=0;for(var e,i=this.sceneRoot.getDescendants(),r=iH(i);!(e=r()).done;)for(var n,a=e.value.getComponents(nV),s=iH(a);!(n=s()).done;){var o=n.value;o.isActiveAndEnabled&&o.render(t)}},e}(h7);lD.shape={};var lk=function(t){function e(e){return t.call(this,e)}iG(e,t);var i=e.prototype;return i.getWidth=function(){return this.engine.canvas.width},i.getHeight=function(){return this.engine.canvas.height},e}(sM),lz=function(t){function e(e){var i;return(i=t.call(this)||this).resource=e,i}return iG(e,t),rV(e,[{key:"underlyingResource",get:function(){return this.resource}}]),e}(nE),lB=function(e){function i(t,i){var r;return(r=e.call(this,t.canvas,i)||this).renderer=new lk(oA(r)),r.gpuCapability=new s_(t),r}iG(i,e);var r=i.prototype;return r.setOptions=function(t){var e=t.threeCamera,i=t.threeGroup,r=t.composition;this.threeCamera=e,this.threeGroup=i,this.composition=r},r.createVertexBuffer=function(t,e){var i=lU(t,e.type),r=e.byteStride>0?e.byteStride/i.BYTES_PER_ELEMENT:1;return lG(e.instanceDivisor>0?new eB.InstancedInterleavedBuffer(i,r,e.instanceDivisor):new eB.InterleavedBuffer(i,r),i.byteLength)},r.createDynamicVertexBuffer=function(t,e){return this.createVertexBuffer(t,e)},r.createIndexBuffer=function(t){var e=function(t){if(ej(t,Uint16Array)||ej(t,Uint32Array))return t;for(var e=0;e<t.length;e++)if(t[e]>=65535)return new Uint32Array(t);return new Uint16Array(t)}(t),i=lG(new eB.BufferAttribute(e,1),e.byteLength);return i.is32Bits=ej(e,Uint32Array),i},r.updateDynamicVertexBuffer=function(e,i,r,n){void 0===r&&(r=0);var a=lU(i,t.BufferDataType.Float);void 0!==n&&n<a.byteLength&&(a=new Uint8Array(a.buffer,a.byteOffset,n));var s=e.resource;if(s){if(r<0||r+a.byteLength>e.capacity)throw RangeError("Buffer update is out of range.");var o=s.array,u=r/o.BYTES_PER_ELEMENT;if(!Number.isInteger(u))throw RangeError("Buffer update is not aligned.");o.set(a,u),s.updateRange.offset=u,s.updateRange.count=a.length,s.needsUpdate=!0}},r.updateDynamicIndexBuffer=function(t,e,i){void 0===i&&(i=0);var r=t.is32Bits?ej(e,Uint32Array)?e:new Uint32Array(e):ej(e,Uint16Array)?e:new Uint16Array(e),n=t.resource;if(n){if(i<0||i+r.byteLength>t.capacity)throw RangeError("Buffer update is out of range.");var a=n.array,s=i/a.BYTES_PER_ELEMENT;if(!Number.isInteger(s))throw RangeError("Buffer update is not aligned.");a.set(r,s),n.updateRange.offset=s,n.updateRange.count=r.length,n.needsUpdate=!0}},r.releaseBuffer=function(t){return t.references--,0===t.references&&(t.resource=void 0,t.capacity=0,!0)},r.removeGeometry=function(t){var i;null==(i=lV.get(t))||i.resource.dispose(),lV.delete(t),e.prototype.removeGeometry.call(this,t)},i}(lb);function lU(t,e){if("number"==typeof t)return nw(e,t/nC(e));if(Array.isArray(t)){var i=nw(e,t.length);return i.set(t),i}if(ej(t,ArrayBuffer)){var r=t.byteLength/nC(e),n=nw(e,r);return new Uint8Array(n.buffer).set(new Uint8Array(t)),n}return ej(t,DataView)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function lG(t,e){var i=new lz(t);return i.capacity=e,i.references=1,i}var lj=function(t){function e(e,i){(r=t.call(this)||this).compositions=[],r.env="",r.baseCompositionIndex=0;var r,n=i.width,a=i.height,s=i.camera;return r.engine=new lB(e),r.assetService=new h1(r.engine),r.width=n,r.height=a,r.camera=s,r}iG(e,t);var i=e.prototype;return i.loadScene=function(t,e){var i=this;return eG(function(){var r,n,a,s,o,u,h,l,c,f,d,p;return eX(this,function(m){switch(m.label){case 0:return iy(i.renderer,"Renderer is not exist, maybe the Player has been disabled or in gl 'debug-disable' mode."),r=performance.now(),n=[],a=[],o=null==(s=null==e?void 0:e.autoplay)||s,u=i.baseCompositionIndex,iS(t)?(h=n).push.apply(h,[].concat(t)):n.push(t),[4,Promise.all(n.map(eG(function(t,r){var n,s,h,l,c,f,d;return eX(this,function(p){switch(p.label){case 0:return s=(n=i.assetService.assembleSceneLoadOptions(t,re({autoplay:o},e))).source,[4,(l=new h$(h=n.options)).loadScene(s,i.renderer)];case 1:return c=p.sent(),(f=i.engine).clearResources(),iD.notifyAssetsLoadFinish(c,l.options,f),i.assetService.prepareAssets(c,l.getAssets()),i.assetService.updateTextVariables(c,l.options.variables),d=i.createComposition(c,h),i.baseCompositionIndex+=1,d.setIndex(u+r),a[r]=d,[2]}})})))];case 1:for(m.sent(),l=0;l<a.length;l++)o?a[l].play():a[l].pause();for(c=a.map(function(t){return t.name}),f=performance.now()-r,d=iH(a);!(p=d()).done;)p.value.statistic.firstFrameTime=f;return iT.info("First frame ["+c+"]: "+f.toFixed(4)+"ms."),[2,iS(t)?a:a[0]]}})})()},i.createComposition=function(t,e){var i=this;void 0===e&&(e={});var r=new lD(this.engine,re({},e,{onItemMessage:function(t){i.dispatchEvent({type:"message",message:t})}}),t);return r.on("end",function(){i.dispatchEvent({type:"end",composition:r})}),this.renderer.engine.setOptions({threeCamera:this.camera,threeGroup:this,composition:r}),this.compositions.push(r),r},i.pause=function(){this.dispatchEvent({type:"pause"}),this.compositions.forEach(function(t){t.pause()})},i.resume=function(){this.dispatchEvent({type:"resume"}),this.compositions.forEach(function(t){t.resume()})},i.update=function(t){this.compositions.forEach(function(e){e.update(t),e.render()})},rV(e,[{key:"renderer",get:function(){return this.engine.renderer}},{key:"currentComposition",get:function(){return this.compositions[0]}}]),e}(eB.Group);t.ThreeSpriteComponent=function(t){function e(){return t.apply(this,arguments)}iG(e,t);var i=e.prototype;return i.setVisible=function(t){this.threeMesh.visible=t},i.getVisible=function(){return this.threeMesh.visible},i.dispose=function(){this.isActiveAndEnabled||this.threeMesh.clear(),t.prototype.dispose.call(this)},i.fromData=function(e){if(t.prototype.fromData.call(this,e),!this.threeMesh){var i=lL(this.geometry);this.geometry.mode===rD.LINES?this.threeMesh=new eB.LineSegments(i,this.material.material):this.threeMesh=new eB.Mesh(i,this.material.material)}},i.onStart=function(){t.prototype.onStart.call(this),this.engine.threeGroup.add(this.threeMesh)},i.render=function(t){this.isActiveAndEnabled&&(this.threeMesh.geometry=lL(this.geometry),this.material.setVector2("_Size",this.transform.size),this.material.setMatrix("effects_ObjectToWorld",this.transform.getWorldMatrix()),this.material.use(t,t.renderingData.currentFrame.globalUniforms))},i.onDestroy=function(){this.threeMesh.clear()},rV(e,[{key:"priority",get:function(){return this.threeMesh.renderOrder},set:function(t){this.threeMesh&&(this.threeMesh.renderOrder=t)}},{key:"enabled",get:function(){return this.threeMesh.visible},set:function(t){this.threeMesh.visible=t,t&&this.onEnable()}}]),e}(t.SpriteComponent),t.ThreeSpriteComponent=eW([iK(ey.SpriteComponent)],t.ThreeSpriteComponent),t.ThreeTextComponent=function(t){function e(e,i){(r=t.call(this,e,i)||this).isDirty=!0;var r,n=sR.getCanvasAndContext(1,1);if(r.canvas=n.canvas,r.context=n.context,!i)return lO(r);var a=i.options;return r.updateWithOptions(a),r.updateTexture(),r}iG(e,t);var i=e.prototype;return i.onUpdate=function(e){t.prototype.onUpdate.call(this,e),this.updateTexture()},i.onDestroy=function(){t.prototype.onDestroy.call(this),this.disposeTextTexture(),this.releaseTextCanvas()},i.fromData=function(e){t.prototype.fromData.call(this,e);var i=e.options;this.updateWithOptions(i),this.updateTexture(),this.material.setColor("_Color",new e8(1,1,1,1))},i.updateWithOptions=function(t){},i.updateTexture=function(t){},e}(t.ThreeSpriteComponent),t.ThreeTextComponent=eW([iK(ey.TextComponent)],t.ThreeTextComponent),iV(t.ThreeTextComponent,[uk]),ne.create=function(t,e){return new lF(t,void 0,e)},ne.createWithData=function(t,e,i){return new lF(t,e,i)},nb.create=function(t,e){return new lR(t,e)},si.create=function(t,e){return new lN(t,e)};var lW="2.10.0-alpha.2";iT.info("THREEJS plugin version: "+lW+"."),t.ATLAS_SIZE=512,t.ActivationMixerPlayable=oa,t.ActivationPlayable=os,t.AndNode=rm,t.Animatable=rr,t.AnimationClipNode=ri,t.AnimationEvent=oi,t.ApplyAdditiveNode=rd,t.Asset=u9,t.AssetLoader=ht,t.AssetManager=h$,t.AssetService=h1,t.BYTES_TYPE_MAP=st,t.Behaviour=rN,t.BezierCurve=aw,t.BezierCurvePath=am,t.BezierCurveQuat=av,t.BezierDataMap=n5,t.BezierEasing=ae,t.BezierLengthData=n3,t.BezierMap=n4,t.BezierPath=n7,t.BezierQuat=at,t.BlendNode=rp,t.BoolValueNode=i9,t.BoundingBoxInfo=nO,t.Buffer=nM,t.CONSTANT_MAP_BLEND=lw,t.CONSTANT_MAP_DEPTH=lP,t.CONSTANT_MAP_STENCIL_FUNC=lM,t.CONSTANT_MAP_STENCIL_OP=lA,t.COPY_FRAGMENT_SHADER="precision mediump float;\nvarying vec2 vTex;\n\n#ifdef DEPTH_TEXTURE\nuniform sampler2D uDepth;\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main(){\n #ifdef DEPTH_TEXTURE\n gl_FragDepthEXT = texture2D(uDepth,vTex).r;\n #endif\n}\n",t.COPY_MESH_SHADER_ID="effects-internal-copy-mesh",t.COPY_VERTEX_SHADER="\nprecision highp float;\nattribute vec2 aPos;\nvarying vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos,0.,1.0);\n vTex = (aPos + vec2(1.0))/2.;\n}",t.Camera=h3,t.CameraVFXItemLoader=sq,t.CanvasItem=sj,t.CanvasLayer=sG,t.Circle=aY,t.ColorCurve=aR,t.ColorPlayable=oe,t.ColorPropertyMixerPlayable=oh,t.Component=rL,t.ComponentTimePlayable=uR,t.ComponentTimePlayableAsset=uI,t.ComponentTimeTrack=uM,t.Composition=h7,t.ConstBoolNode=rx,t.ConstFloatNode=rg,t.ConstraintTarget=sz,t.Control=sH,t.ControlParameterBoolNode=rT,t.ControlParameterFloatNode=rb,t.ControlParameterTriggerNode=rE,t.DEFAULT_FONTS=["serif","sans-serif","monospace","courier"],t.DEFAULT_FPS=60,t.DataBuffer=nE,t.Database=he,t.Deferred=function(){var t=this;this.promise=new Promise(function(e,i){t.resolve=e,t.reject=i})},t.Downloader=rW,t.DrawObjectPass=a$,t.EFFECTS_COPY_MESH_NAME="effects-internal-copy",t.EVENT_TYPE_CLICK=sK,t.EVENT_TYPE_TOUCH_END=s$,t.EVENT_TYPE_TOUCH_MOVE=sJ,t.EVENT_TYPE_TOUCH_START=sQ,t.EffectComponentTimeTrack=uP,t.EffectsObject=i$,t.EffectsPackage=lg,t.Ellipse=ak,t.Engine=lb,t.EventEmitter=nF,t.EventSystem=s0,t.FONT_SCALE=2,t.Float16ArrayWrapper=nj,t.FloatComparisonNode=rw,t.FloatComparisonNodeData=r_,t.FloatPropertyMixerPlayable=ol,t.FloatValueNode=i8,t.Framebuffer=aq,t.GPUCapability=s_,t.Geometry=a1,t.GlobalUniforms=sT,t.GlyphAtlas=sO,t.GradientValue=af,t.GraphInstance=rR,t.GraphNode=i3,t.GraphNodeData=i4,t.Graphics=sN,t.HELP_LINK=nN,t.InteractLoader=s2,t.InteractMesh=s4,t.InvalidIndex=-1,t.LayerBlendNode=rC,t.LineSegments=ad,t.LinearValue=ac,t.MaskProcessor=nT,t.MaskableGraphic=sB,t.Material=nb,t.MaterialDataBlock=nu,t.MaterialState=ng,t.Mesh=si,t.NodeTransform=rl,t.NotNode=ry,t.NotifyEvent=or,t.OrNode=rv,t.PLAYER_OPTIONS_ENV_EDITOR=nL,t.POST_PROCESS_SETTINGS="post_process_settings",t.ParticleBehaviourPlayable=ul,t.ParticleBehaviourPlayableAsset=uc,t.ParticleLoader=uO,t.ParticleMesh=ud,t.ParticleMixerPlayable=oc,t.ParticleSystemRenderer=up,t.ParticleTrack=oM,t.PassTextureCache=lC,t.PathSegments=ap,t.Playable=s8,t.PlayableAsset=s7,t.PlayableOutput=s9,t.Plugin=iB,t.PluginSystem=iD,t.PointerEventData=nP,t.PolyStar=aH,t.Polygon=aZ,t.Pose=rc,t.PoseNode=i5,t.Precomposition=hQ,t.PrecompositionManager=l_,t.PropertyClipPlayable=oo,t.PropertyTrack=ow,t.REFERENCE_CURVE=28,t.RENDER_PREFER_LOOKUP_TEXTURE=sA,t.RUNTIME_ENV="runtime_env",t.RandomSetValue=au,t.RandomValue=ah,t.RandomVectorValue=al,t.RaycastResult=nI,t.RectTransform=sX,t.Rectangle=az,t.ReferenceCurve=aA,t.RenderFrame=sx,t.RenderPass=aJ,t.RenderPassPriorityNormal=1e3,t.RenderPassPriorityPostprocess=3e3,t.RenderPassPriorityPrepare=0,t.RenderTargetHandle=aK,t.RenderTargetPool=sC,t.Renderbuffer=sE,t.Renderer=sM,t.RendererComponent=nV,t.RuntimeClip=o_,t.SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0="PRE_MAIN_COLOR_0",t.SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0="PRE_MAIN_COLOR_SIZE_0",t.SEMANTIC_PRE_COLOR_ATTACHMENT_0="PRE_COLOR_0",t.SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0="PRE_COLOR_SIZE_0",t.SPRITE_VERTEX_STRIDE=6,t.SceneLoader=lS,t.SerializationHelper=u7,t.ShaderFactory=sm,t.ShaderVariant=ny,t.SpriteColorMixerPlayable=of,t.SpriteComponentTimeTrack=uA,t.SpriteLoader=s6,t.SpritePropertyMixerPlayable=od,t.StateMachineNode=rM,t.StateNode=rA,t.StaticValue=ao,t.SubCompositionClipPlayable=op,t.SubCompositionMixerPlayable=om,t.TEMPLATE_USE_OFFSCREEN_CANVAS=sP,t.TEXTURE_UNIFORM_MAP=lI,t.TextCache=sV,t.TextComponentBase=uk,t.TextLayout=uF,t.TextLoader=uU,t.TextStyle=uD,t.Texture=ne,t.TextureFactory=no,t.ThreeComposition=lD,t.ThreeDisplayObject=lj,t.ThreeEngine=lB,t.ThreeMaterial=lR,t.ThreeTexture=lF,t.Ticker=lx,t.TimelineClip=oS,t.TimelineInstance=u_,t.TrackMixerPlayable=on,t.Transform=nU,t.TransformMixerPlayable=ob,t.TransformPlayable=ox,t.TransitionNode=rP,t.Triangle=aB,t.TrimPath=u8,t.ValueGetter=as,t.ValueNode=i6,t.Vector2Curve=a_,t.Vector2PropertyMixerPlayable=oC,t.Vector3Curve=aS,t.Vector3PropertyMixerPlayable=oE,t.Vector4Curve=aC,t.Vector4PropertyMixerPlayable=oT,t.VertexBuffer=nA,t.addByOrder=im,t.addItem=eK,t.addItemWithOrder=function(t,e,i,r){if(void 0===r&&(r=!1),!t.includes(e)&&(t.push(e),1!==t.length)){var n=t.length-1;if(n){var a=t[n];if(r)for(;t[n-1][i]<a[i]&&(t[n]=t[n-1],0!=--n););else for(;t[n-1][i]>a[i]&&(t[n]=t[n-1],0!=--n););t[n]=a}}},t.applyMixins=iV,t.assertExist=iy,t.asserts=function(t,e){if(void 0===e&&(e="asserts failed"),!t)throw Error(e)},t.base64ToFile=iO,t.breakOpportunityAfter=uN,t.buildBezierData=n9,t.buildEasingCurve=ai,t.buildLine=aF,t.calculateTranslation=nH,t.canUseBOM=ia,t.canvasPool=sR,t.closePointEps=1e-4,t.colorGradingFrag=sh,t.colorStopsFromGradient=it,t.colorToArr=e9,t.combineImageTemplate=hq,t.createGLContext=function(t,e,i){var r;if(void 0===e&&(e="webgl"),"webgl2"!==e||(r=t.getContext("webgl2",i))||console.debug("WebGL2 context retrieval failed, falling back to WebGL context."),r&&"webgl"!==e||(r=t.getContext("webgl",i)),!r)throw Error("This browser does not support WebGL or the WebGL version is incorrect. Please check your WebGL version.");return r},t.createKeyFrameMeta=ab,t.createShape=oj,t.createTypedArray=nw,t.createValueGetter=aI,t.curveEps=1e-4,t.decimalEqual=n$,t.deserializeMipmapTexture=r6,t.earcut=o6,t.effectsClass=iK,t.effectsClassStore=iq,t.enlargeBuffer=eJ,t.ensureFixedNumber=hr,t.ensureVec3=nY,t.extractMinAndMax=n1,t.gaussianDownHFrag=sl,t.gaussianDownVFrag=sc,t.gaussianUpFrag=sf,t.generateEmptyTexture=na,t.generateEmptyTypedArray=function(t){return nw(t,0)},t.generateGUID=iR,t.generateHalfFloatTexture=ni,t.generateWhiteTexture=nn,t.getBackgroundImage=hZ,t.getBytesPerElement=nC,t.getClass=function(t){return iq[t]},t.getColorFromGradientStops=e7,t.getConfig=function(t){return sI[t]},t.getControlPoints=ar,t.getDataByteLength=n_,t.getDataType=nS,t.getDefaultTextureFactory=function(){return ew||(ew=new no),ew},t.getGeometryByShape=o9,t.getGeometryTriangles=o8,t.getKeyFrameMetaByRawValue=ax,t.getMergedStore=iQ,t.getNodeDataClass=function(t){return i1[t]},t.getParticleMeshShader=function(t,e,i){void 0===i&&(i="");var r,n,a,s=t.content,o=+((null==(r=s.renderer)?void 0:r.renderMode)||0),u=[["RENDER_MODE",o],["ENV_EDITOR",i===nL]],h=e.detail,l=ab(),c=ab(),f=h.maxVertexUniforms>0,d=(null!=(n=s.positionOverLifetime)?n:{}).speedOverLifetime,p=0,m=0;f&&u.push(["ENABLE_VERTEX_TEXTURE",!0]),d&&(u.push(["SPEED_OVER_LIFETIME",!0]),m|=2,ax(l,d));var v=s.textureSheetAnimation;v&&v.animate&&(u.push(["USE_SPRITE",!0]),m|=4);var y=s.colorOverLifetime;y&&y.color&&(u.push(["COLOR_OVER_LIFETIME",!0]),m|=16);var g=y&&y.opacity;g&&ax(l,g);var x=s.positionOverLifetime;if(["x","y","z"].forEach(function(t,e){var i=0,r="linear"+t.toUpperCase(),n="orbital"+t.toUpperCase();(null==x?void 0:x[r])&&(ax(l,x[r]),i=1,m|=1<<7+e),u.push(["LINEAR_VEL_"+t.toUpperCase(),i]);var s=0;(null==x?void 0:x[n])&&(ax(l,x[n]),s=1,m|=1<<10+e,a=!0),u.push(["ORB_VEL_"+t.toUpperCase(),s])}),(null==x?void 0:x.asMovement)&&(u.push(["AS_LINEAR_MOVEMENT",!0]),m|=32),a&&(null==x?void 0:x.asRotation)&&(u.push(["AS_ORBITAL_MOVEMENT",!0]),m|=64),s.sizeOverLifetime){var b=s.sizeOverLifetime;b.separateAxes?(ax(l,b.x),u.push(["SIZE_Y_BY_LIFE",1]),m|=16384,ax(l,b.y)):ax(l,b.size)}if(s.rotationOverLifetime){var T=s.rotationOverLifetime;T.z&&(ax(l,null==T?void 0:T.z),m|=32768,u.push(["ROT_Z_LIFETIME",1])),T.separateAxes&&(T.x&&(ax(l,T.x),m|=65536,u.push(["ROT_X_LIFETIME",1])),T.y&&(ax(l,T.y),m|=131072,u.push(["ROT_Y_LIFETIME",1]))),(null==T?void 0:T.asRotation)&&(u.push(["ROT_LIFETIME_AS_MOVEMENT",1]),m|=262144)}ax(l,null==x?void 0:x.gravityOverLifetime),(null==x?void 0:x.forceTarget)&&(u.push(["FINAL_TARGET",!0]),m|=524288,ax(l,x.forceCurve));var E=h.halfFloatTexture;E&&c.max&&(m|=1048576);var C=h.maxVertexUniforms,S=l.max+l.curves.length-32>C;sI[sA]&&(S=!0),S&&E&&f&&(p=1);var _={fragment:sa,vertex:"#define LOOKUP_TEXTURE_CURVE "+p+"\n"+ss,shared:!0,cacheId:["-p:",o,m,l.index,l.max,c.index,c.max].join("+"),macros:u,name:"particle#"+t.name};return u.push(["VERT_CURVE_VALUE_COUNT",l.index],["FRAG_CURVE_VALUE_COUNT",c.index],["VERT_MAX_KEY_FRAME_COUNT",l.max],["FRAG_MAX_KEY_FRAME_COUNT",c.max]),{shader:_,vertex:l.index,fragment:c.index}},t.getPixelRatio=ir,t.getPluginUsageInfo=iz,t.getPreMultiAlpha=rU,t.getStandardComposition=hj,t.getStandardImage=hG,t.getStandardItem=hX,t.getStandardJSON=hB,t.getTextureSize=sb,t.glContext=rD,t.glType2VertexFormatType=function(t){switch(t){case WebGLRenderingContext.FLOAT:return ex.Float32;case WebGLRenderingContext.SHORT:return ex.Int16;case WebGLRenderingContext.BYTE:return ex.Int8;case WebGLRenderingContext.UNSIGNED_SHORT:return ex.UInt16;case WebGLRenderingContext.UNSIGNED_BYTE:return ex.UInt8;default:return ex.Float32}},t.gpuTimer=function(t){var e=t.getExtension("EXT_disjoint_timer_query_webgl2");if(e){var i=t.createQuery(),r=eG(function(){return eX(this,function(n){return[2,new Promise(function(n,a){if(i){var s=t.getQueryParameter(i,t.QUERY_RESULT_AVAILABLE),o=t.getParameter(e.GPU_DISJOINT_EXT);s&&!o&&n(t.getQueryParameter(i,t.QUERY_RESULT)/1e3/1e3),(s||o)&&(t.deleteQuery(i),i=null),null!==s&&i&&window.setTimeout(function(){r().then(n).catch},1)}})]})});if(!i)return;return{begin:function(){i&&t.beginQuery(e.TIME_ELAPSED_EXT,i)},end:function(){t.endQuery(e.TIME_ELAPSED_EXT)},getTime:r}}},t.imageDataFromColor=function(t){iC(t)&&(t=e9(t));for(var e=t,i={width:1,height:1,data:new Uint8Array(4)},r=i.data,n=0;n<4;n++)r[n]=e[n];return i},t.imageDataFromGradient=id,t.initErrors=rF,t.initGLContext=rz,t.integrate="float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4){float movement=0.0;float h=(t-p1.x)*0.05;for(int i=0;i<=20;i++){float t=float(i)*h;float nt=binarySearchT(t,p1.x,p2.x,p3.x,p4.x);float y=cubicBezier(nt,p1.y,p2.y,p3.y,p4.y);float weight=(i==0||i==20)? 1.0 :(mod(float(i),2.)!=0.)? 4.0 : 2.0;movement+=weight*y;}movement*=h/3.;return movement;}float integrateFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i+=2){vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return ret;}vec2 p1=vec2(k0.x,k0.y);vec2 p2=vec2(k0.z,k0.w);vec2 p3=vec2(k1.z,k1.w);vec2 p4=vec2(k1.x,k1.y);if(time>=k1.x){ret+=calculateMovement(k1.x,p1,p2,p3,p4);}if(time>=k0.x&&time<k1.x){return ret+calculateMovement(time,p1,p2,p3,p4);}}return ret;}float integrateByTimeLineSeg(float t,vec2 p0,vec2 p1){float t0=p0.x;float t1=p1.x;float y0=p0.y;float y1=p1.y;vec4 tSqr=vec4(t,t,t0,t0);tSqr=tSqr*tSqr;vec4 a=vec4(2.*t,3.,-t0,3.)*tSqr;float t1y0=t1*y0;vec4 b=vec4(y0-y1,t0*y1-t1y0,2.*y0+y1,t1y0);float r=dot(a,b);return r/(t0-t1)*0.16666667;}float integrateLineSeg(float time,vec2 p0,vec2 p1){float h=time-p0.x;float y0=p0.y;return(y0+y0+(p1.y-y0)*h/(p1.x-p0.x))*h/2.;}float integrateFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateLineSeg(time,k0,k1);}ret+=integrateLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateLineSeg(time,k1,k2);}ret+=integrateLineSeg(k2.x,k1,k2);}return ret;}float integrateByTimeFromLineSeg(float time,float frameStart,float frameCount){if(time==0.){return 0.;}int start=int(frameStart);int count=int(frameCount-1.);float ret=0.;for(int i=0;i<ITR_END;i++){if(i>count){return ret;}vec4 ks=lookup_curve(i+start);vec2 k0=ks.xy;vec2 k1=ks.zw;if(time>k0.x&&time<=k1.x){return ret+integrateByTimeLineSeg(time,k0,k1);}ret+=integrateByTimeLineSeg(k1.x,k0,k1);vec2 k2=lookup_curve(i+start+1).xy;if(time>k1.x&&time<=k2.x){return ret+integrateByTimeLineSeg(time,k1,k2);}ret+=integrateByTimeLineSeg(k2.x,k1,k2);}return ret;}float getIntegrateFromTime0(float t1,vec4 value){float type=value.x;if(type==0.){return value.y*t1;}if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateLineSeg(t1,p0,p1);}if(type==3.){return integrateFromLineSeg(t1,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*t1;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w);}return 0.;}float getIntegrateByTimeFromTime(float t0,float t1,vec4 value){float type=value.x;if(type==0.){return value.y*(t1*t1-t0*t0)/2.;}else if(type==1.){vec2 p0=vec2(0.,value.y);vec2 p1=vec2(value.w,value.z);return integrateByTimeLineSeg(t1,p0,p1)-integrateByTimeLineSeg(t0,p0,p1);}if(type==3.){return integrateByTimeFromLineSeg(t1,value.y,value.z)-integrateByTimeFromLineSeg(t0,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed)*(t1*t1-t0*t0)/2.;}if(type==5.){return integrateFromBezierCurveFrames(t1,value.z,value.w)-integrateFromBezierCurveFrames(t0,value.z,value.w);}return 0.;}",t.interpolateColor=ie,t.isAlipayMiniApp=il,t.isAndroid=io,t.isArray=iS,t.isBreakChar=uV,t.isCJKLike=uL,t.isCanvas=iA,t.isFunction=i_,t.isIOS=is,t.isIOSByUA=function(){var t=navigator.userAgent.toLowerCase().match(/cpu (iphone )?os (.*?) like mac os/);return t?parseInt(t[2],10):0},t.isMiniProgram=function(){return il()||ic()},t.isObject=iw,t.isOpenHarmony=iu,t.isPlainObject=iM,t.isPowerOfTwo=function(t){return(t&t-1)==0&&0!==t},t.isSafeFontFamily=ix,t.isSimulatorCellPhone=ih,t.isString=iC,t.isUniformStruct=nh,t.isUniformStructArray=function(t){return t&&void 0!==t.length&&nh(t[0])},t.isValidFontFamily=ig,t.isWebGL2=function(t){return"undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name},t.isWechatMiniApp=ic,t.itemFrag=sn,t.itemVert=sr,t.loadAVIFOptional=rq,t.loadBinary=r$,t.loadBlob=function(t){return r1.apply(this,arguments)},t.loadImage=rQ,t.loadMedia=r4,t.loadVideo=r2,t.loadWebPOptional=rY,t.logger=iT,t.math=nv,t.modifyMaxKeyframeShader=function(t,e,i){var r,n=null==(r=t.cacheId)?void 0:r.split("+");if(n[3]=e,n[5]=i,t.cacheId=n.join("+"),t.macros)for(var a=0;a<t.macros.length;a++){var s=t.macros[a];if("VERT_CURVE_VALUE_COUNT"===s[0])s[1]=e;else if("FRAG_CURVE_VALUE_COUNT"===s[0]){s[1]=i;break}}},t.nearestPowerOfTwo=function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},t.nodeDataClass=i2,t.noop=iE,t.normalizeColor=hh,t.numberToFix=n0,t.oldBezierKeyFramesToNew=aM,t.parsePercent=ii,t.particleFrag=sa,t.particleOriginTranslateMap=nK,t.particleUniformTypeMap=uf,t.particleVert=ss,t.passRenderLevel=hY,t.pluginLoaderMap=iL,t.randomInRange=iP,t.registerPlugin=iF,t.removeItem=eQ,t.rotateVec2=o7,t.screenMeshVert=su,t.serialize=function(t,e){return iJ(t,e)},t.setBlendMode=rG,t.setConfig=function(t,e){return sI[t]=e},t.setDefaultTextureFactory=function(t){ew=t},t.setMaskMode=function(e,i){switch(i){case void 0:e.stencilTest=!1;break;case t.MaskMode.MASK:e.stencilTest=!0,e.stencilFunc=[rD.ALWAYS,rD.ALWAYS],e.stencilOpZPass=[rD.REPLACE,rD.REPLACE];break;case t.MaskMode.OBSCURED:e.stencilTest=!0,e.stencilFunc=[rD.EQUAL,rD.EQUAL];break;case t.MaskMode.REVERSE_OBSCURED:e.stencilTest=!0,e.stencilFunc=[rD.NOTEQUAL,rD.NOTEQUAL];break;case t.MaskMode.NONE:e.stencilTest=!1;break;default:console.warn("MaskMode "+i+" not in specification, please set stencil params seperately.")}},t.setRayFromCamera=nQ,t.setSideMode=rj,t.setUniformValue=function(t,e,i){t[e]?t[e].value=i:t[e]=new eB.Uniform(i)},t.sortByOrder=ip,t.spec=iW,t.textureLoaderRegistry=ns,t.thresholdFrag=sd,t.throwDestroyedError=iI,t.toBufferView=function(t){return Array.isArray(t)?new Float32Array(t):ej(t,ArrayBuffer)?new Uint8Array(t):t},t.trailVert=so,t.translatePoint=function(t,e){for(var i=[-.5,.5,-.5,-.5,.5,.5,.5,-.5],r=0;r<8;r+=2)i[r]+=t,i[r+1]+=e;return i},t.trianglesFromRect=nJ,t.unregisterPlugin=function(t){delete iL[t];var e=iN.findIndex(function(e){return e.name===t});-1!==e&&iN.splice(e,1)},t.valIfUndefined=function(t,e){return null==t?e:t},t.value="#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n#define NONE_CONST_INDEX 1\n#ifdef SHADER_VERTEX\nattribute float aSeed;varying float vSeed;\n#endif\n#ifdef SHADER_VERTEX\n#define MAX_C VERT_MAX_KEY_FRAME_COUNT\n#else\n#define MAX_C FRAG_MAX_KEY_FRAME_COUNT\n#endif\nmat4 cubicBezierMatrix=mat4(1.0,-3.0,3.0,-1.0,0.0,3.0,-6.0,3.0,0.0,0.0,3.0,-3.0,0.0,0.0,0.0,1.0);float cubicBezier(float t,float y1,float y2,float y3,float y4){vec4 tVec=vec4(1.0,t,t*t,t*t*t);vec4 yVec=vec4(y1,y2,y3,y4);vec4 result=tVec*cubicBezierMatrix*yVec;return result.x+result.y+result.z+result.w;}float binarySearchT(float x,float x1,float x2,float x3,float x4){float left=0.0;float right=1.0;float mid=0.0;float computedX;for(int i=0;i<8;i++){mid=(left+right)*0.5;computedX=cubicBezier(mid,x1,x2,x3,x4);if(abs(computedX-x)<0.0001){break;}else if(computedX>x){right=mid;}else{left=mid;}}return mid;}float valueFromBezierCurveFrames(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);for(int i=0;i<ITR_END;i+=2){if(i>=count){break;}vec4 k0=lookup_curve(i+start);vec4 k1=lookup_curve(i+1+start);if(i==0&&time<k0.x){return k0.y;}if(i==int(frameCount-2.)&&time>=k1.x){return k1.y;}if(time>=k0.x&&time<=k1.x){float t=(time-k0.x)/(k1.x-k0.x);float nt=binarySearchT(time,k0.x,k0.z,k1.z,k1.x);return cubicBezier(nt,k0.y,k0.w,k1.w,k1.y);}}}float evaluteLineSeg(float t,vec2 p0,vec2 p1){return p0.y+(p1.y-p0.y)*(t-p0.x)/(p1.x-p0.x);}float valueFromLineSegs(float time,float frameStart,float frameCount){int start=int(frameStart);int count=int(frameCount-1.);int end=start+count;for(int i=0;i<ITR_END;i++){if(i>count){return lookup_curve(i).w;}vec4 seg=lookup_curve(i+start);vec2 p0=seg.xy;vec2 p1=seg.zw;if(time>=p0.x&&time<=p1.x){return evaluteLineSeg(time,p0,p1);}vec2 p2=lookup_curve(i+start+1).xy;if(time>p1.x&&time<=p2.x){return evaluteLineSeg(time,p1,p2);}}return lookup_curve(0).y;}float getValueFromTime(float time,vec4 value){float type=value.x;if(type==0.){return value.y;}if(type==1.){return mix(value.y,value.z,time/value.w);}if(type==3.){return valueFromLineSegs(time,value.y,value.z);}if(type==4.){return mix(value.y,value.z,aSeed);}if(type==5.){return valueFromBezierCurveFrames(time,value.z,value.w);}return 0.;}",t.valueDefine="#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValueTexture\n#define CURVE_VALUE_ARRAY uVCurveValues\n#define CURVE_VALUE_COUNT VERT_CURVE_VALUE_COUNT\n#define FRAG_CURVE_VALUE_COUNT 0\n#else\n#define CURVE_VALUE_TEXTURE uFCurveValueTexture\n#define CURVE_VALUE_ARRAY uFCurveValues\n#define CURVE_VALUE_COUNT FRAG_CURVE_VALUE_COUNT\n#define VERT_CURVE_VALUE_COUNT 0\n#endif\n#if CURVE_VALUE_COUNT > 0\n#if LOOKUP_TEXTURE_CURVE\nuniform sampler2D CURVE_VALUE_TEXTURE;const float uCurveCount=1./float(CURVE_VALUE_COUNT);\n#define lookup_curve(i) texture2D(CURVE_VALUE_TEXTURE,vec2(float(i) * uCurveCount,0.))\n#else\nuniform vec4 CURVE_VALUE_ARRAY[CURVE_VALUE_COUNT];\n#define lookup_curve(i) CURVE_VALUE_ARRAY[i]\n#endif\n#else\n#define lookup_curve(i) vec4(0.)\n#endif\n#ifdef WEBGL2\n#define ITR_END (count + 1)\n#else\n#define ITR_END MAX_C\n#endif\n",t.vecFill=nZ,t.vecMulCombine=nq,t.version=lW,t.vertexFormatType2GLType=function(t){switch(t){case ex.Float32:return WebGLRenderingContext.FLOAT;case ex.Int16:return WebGLRenderingContext.SHORT;case ex.Int8:return WebGLRenderingContext.BYTE;case ex.UInt16:return WebGLRenderingContext.UNSIGNED_SHORT;case ex.UInt8:return WebGLRenderingContext.UNSIGNED_BYTE;default:return WebGLRenderingContext.FLOAT}},Object.defineProperty(t,"__esModule",{value:!0})});
|
|
8
8
|
//# sourceMappingURL=index.min.js.map
|