System.register([],(function(e,t){"use strict";return{execute:function(){e({$:void 0,B:Ni,D:Ci,F:function(e,t,i){return(i-e)/(t-e)},G:Mi,H:function(e,t){return Math.abs(e)>Math.abs(t)?e:t},I:function(e,t){t.forEach((function(t){Object.defineProperty(e,t,{enumerable:!0})}))},W:void 0,X:void 0,Y:void 0,Z:void 0,_:void 0,a0:void 0,a1:void 0,a2:void 0,a3:void 0,a4:void 0,a5:void 0,a6:void 0,a7:void 0,a8:void 0,a9:void 0,aA:void 0,aB:void 0,aa:void 0,ab:void 0,ac:void 0,ad:void 0,ae:void 0,af:void 0,ag:void 0,ah:void 0,ai:void 0,aj:void 0,ak:void 0,al:void 0,am:void 0,an:void 0,ao:void 0,ap:void 0,aq:void 0,ar:void 0,as:void 0,at:void 0,au:void 0,av:void 0,aw:void 0,ax:void 0,ay:void 0,az:void 0,bC:ms,bD:gs,bE:vs,bF:Es,bG:Ts,bH:As,bI:Ss,bw:void 0,c:Ui,c$:void 0,c0:void 0,c1:void 0,cB:void 0,cQ:SN,cR:void 0,cX:void 0,ci:void 0,ck:void 0,cu:void 0,cv:void 0,cw:void 0,cx:void 0,cy:void 0,d$:Pe,d1:void 0,d5:vc,dB:void 0,dD:function(e,t,i,n,r,s){void 0===t&&(t=gn.R32F),void 0===i&&(i=0),void 0===n&&(n=e.byteLength-i),void 0===r&&(r=0),void 0===s&&(s=[]);var a=ls[t];r||(r=a.size);for(var o="get"+gF(a),u=a.size/a.count,h=Math.floor(n/r),c=ka.isLittleEndian,l=0;l=0&&e.length,e.length},fx:ye,g:Pi,g0:nt,g1:li,g5:function(){var e=new mf;return e.assignSorted([[0,{interpolationMode:Hu.CUBIC,value:1}],[1,{interpolationMode:Hu.CUBIC,value:1}]]),e},g6:n,gB:void 0,gG:fe,gH:Pf,gI:ft,gN:function(e){e>0&&(ue=e)},gO:function(e){for(var t,i=E(e);!(t=i()).done;)de(t.value)},gP:function(e){return le||(le="undefined"==typeof Proxy?{}:new Proxy(e,{get:function(e,t,i){return de(t),Reflect.get(e,t,i)}})),le},gQ:cN,gR:lN,gU:kl,gW:function(e){return e[uh]},gb:Dt,gc:Lt,ge:m,gl:fa,gm:void 0,gp:_a,gu:Ct,gw:void 0,h:function(e,t){return Math.abs(e-t)<=gi*Math.max(1,Math.abs(e),Math.abs(t))},h8:ee,h9:te,hA:void 0,hM:void 0,hU:GD,ha:void 0,hd:oD,i:vi,j:yi,k:Ei,l:Ti,m:$i,n:Si,p:wi,q:qi,r:ln,s:hn,t:Ai,u:function(e,t){return Math.floor(wi(e,t))},v:rn,w:Ri,x:Ii,y:function(e,t,i){return Math.floor(Ii(e,t,i))},z:Oi});var i=e("g8",2147483647);function n(e){return(e>0)-(e<0)}function r(e){var t,i;return t=(e>65535)<<4,t|=i=((e>>>=t)>255)<<3,t|=i=((e>>>=i)>15)<<2,(t|=i=((e>>>=i)>3)<<1)|(e>>>=i)>>1}function s(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24}function a(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}function o(e){return--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)}var u=new Array(256);function h(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(i=e[Symbol.iterator]()).next.bind(i)}function T(e,t,i,n){i&&Object.defineProperty(e,t,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(n):void 0})}function A(e,t,i,n,r){var s={};return Object.keys(n).forEach((function(e){s[e]=n[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=i.slice().reverse().reduce((function(i,n){return n(e,t,i)||i}),s),r&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(r):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s}function S(e,t){const i="undefined"==typeof window?global:window;return void 0===i[e]?i[e]=t:i[e]}!function(e){for(var t=0;t<256;++t){var i=t,n=t,r=7;for(i>>>=1;i;i>>>=1)n<<=1,n|=1&i,--r;e[t]=n<>31;return(e^t)-t},min:function(e,t){return t^(e^t)&-(e=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},popCount:s,countTrailingZeros:a,nextPow2:o,prevPow2:function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},parity:function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1},reverse:function(e){return u[255&e]<<24|u[e>>>8&255]<<16|u[e>>>16&255]<<8|u[e>>>24&255]},interleave2:function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},deinterleave2:function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},interleave3:function(e,t,i){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(i=1227133513&((i=3272356035&((i=251719695&((i=4278190335&((i&=1023)|i<<16))|i<<8))|i<<4))|i<<2))<<2},deinterleave3:function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},nextCombination:function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>a(e)+1}})),e("g2",!1),S("CC_WECHAT",!1),S("CC_BAIDU",!1),S("CC_XIAOMI",!1),S("CC_ALIPAY",!1),S("CC_BYTEDANCE",!1),S("CC_OPPO",!1),S("CC_VIVO",!1),S("CC_HUAWEI",!1),S("CC_COCOSPLAY",!1),S("CC_QTT",!1),S("CC_LINKSURE",!1);const b=e("g3",!1);S("CC_EDITOR",!1),S("CC_PREVIEW",!1),S("CC_BUILD",!0),S("CC_TEST",!1),S("CC_DEBUG",!1),S("CC_DEV",!1),e("gx",!1),S("CC_MINIGAME",!1),e("gz",!1),S("CC_RUNTIME_BASED",!1),S("CC_SUPPORT_JIT",!0),e("gy",!1),S("CC_JSB",!1);var w="undefined"==typeof window?global:window,R=e("cY",{_global:w});R.internal={};var I=e("gq","3.6.0");w.CocosEngine=R.ENGINE_VERSION=I,w.cc=R;var O="https://github.com/cocos-creator/engine/blob/develop/EngineErrorMap.md",N=null,C=console.log.bind(console),M=C,x=C,F=function(e,t){if(!e){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n2?i-2:0),r=2;rQ.ERROR){var t=function(e){if(R.game.canvas){if(!N){var t=document.createElement("Div");t.setAttribute("id","logInfoDiv"),t.setAttribute("width","200"),t.setAttribute("height",R.game.canvas.height);var i=t.style;i.zIndex="99999",i.position="absolute",i.top=i.left="0",(N=document.createElement("textarea")).setAttribute("rows","20"),N.setAttribute("cols","30"),N.setAttribute("disabled","true");var n=N.style;n.backgroundColor="transparent",n.borderBottom="1px solid #cccccc",n.borderTopWidth=n.borderLeftWidth=n.borderRightWidth="0px",n.borderTopStyle=n.borderLeftStyle=n.borderRightStyle="none",n.padding="0px",n.margin="0px",t.appendChild(N),R.game.canvas.parentNode.appendChild(t)}N.value=N.value+e+"\r\n",N.scrollTop=N.scrollHeight}};x=function(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r2?n-2:0),s=2;s1?i-1:0),r=1;r1?i-1:0),r=1;r1?t-1:0),n=1;n2?i-2:0),r=2;r1?t-1:0),n=1;n1?t-1:0),n=1;n1?n-1:0),s=1;s1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n2?i-2:0),r=2;r1?t-1:0),n=1;no.count&&(r("'%s' is deprecated, please use '%s' instead. "+a,e+"."+t,i+"."+n),o.count++)},ie=e("cX",(function(e,t,i){null!=e&&i.forEach((function(i){var n=he++;ce.set(n,{id:n,count:0,logTimes:void 0!==i.logTimes?i.logTimes:ue});var r=null!=i.target?i.target:e,s=null!=i.newName?i.newName:i.name,a=null!=i.targetName?i.targetName:t,o=r===e,u=i.suggest?"("+i.suggest+")":"";if(null!=i.customFunction)e[i.name]=function(){var e;return se(t,i.name,a,s,B,n,u),(e=i.customFunction).call.apply(e,[this].concat(Array.prototype.slice.call(arguments)))};else if(null!=i.customSetter||null!=i.customGetter){var h=null!=i.customSetter,c=null!=i.customGetter;h&&c?Object.defineProperty(e,i.name,{get:function(){return se(t,i.name,a,s,B,n,u),i.customGetter.call(this)},set:function(e){se(t,i.name,a,s,B,n,u),i.customSetter.call(this,e)},enumerable:!1}):h?Object.defineProperty(e,i.name,{set:function(e){se(t,i.name,a,s,B,n,u),i.customSetter.call(this,e)},enumerable:!1}):c&&Object.defineProperty(e,i.name,{get:function(){return se(t,i.name,a,s,B,n,u),i.customGetter.call(this)},enumerable:!1})}else Object.defineProperty(e,i.name,{get:function(){return se(t,i.name,a,s,B,n,u),o?this[s]:r[s]},set:function(e){se(t,i.name,a,s,B,n,u),o?this[s]=e:r[s]=e},enumerable:!1})}))})),oe=function(e,t,i,n,r){var s=ce.get(n);s&&s.logTimes>s.count&&(i("'%s' has been removed. "+r,e+"."+t),s.count++)},ne=e("c$",(function(e,t,i){null!=e&&i.forEach((function(i){var n=he++;ce.set(n,{id:n,count:0,logTimes:void 0!==i.logTimes?i.logTimes:ue});var r=i.suggest?"("+i.suggest+")":"";Object.defineProperty(e,i.name,{get:function(){return oe(t,i.name,U,n,r)},set:function(){oe(t,i.name,U,n,r)},enumerable:!1})}))})),ae=function(e,t,i,n,r){var s=ce.get(n);s&&s.logTimes>s.count&&(i("'%s' is deprecated. "+r,e+"."+t),s.count++)},re=e("d1",(function(e,t,i){null!=e&&i.forEach((function(i){var n=i.name,r=Object.getOwnPropertyDescriptor(e,n);if(r&&r.configurable){var s=he++;ce.set(s,{id:s,count:0,logTimes:void 0!==i.logTimes?i.logTimes:ue});var a=i.suggest?"("+i.suggest+")":"";if(void 0!==r.value)if("function"==typeof r.value){var o=r.value;e[n]=function(){return ae(t,n,B,s,a),o.call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}}else{var u=r.value;Object.defineProperty(e,n,{configurable:!0,get:function(){return ae(t,n,B,s,a),u}}),r.writable&&Object.defineProperty(e,n,{set:function(e){ae(t,n,B,s,a),u=e}})}else!function(t,i,n,r,s,a){if(t.get){var o=t.get;t.get=function(){return ae(i,n,r,s,a),o.call(this)}}if(t.set){var u=t.set;t.set=function(e){ae(i,n,r,s,a),u.call(this,e)}}Object.defineProperty(e,n,t)}(r,t,n,B,s,a);Object.defineProperty(e,n,{enumerable:!1})}}))}));var le,_e={};function fe(e){for(var t in e){var i=e[t];_e[t]=i}}function de(e){var t=_e[e];if(t){var i=t.newName,n=t.since;t.removed?i?K(16003,e,n,i):K(16002,e,n):i?Y(16001,e,n,i):Y(16e3,e,n)}}var pe=e("fI",function(){function e(e){this.i=0,this.array=e}var t=e.prototype;return t.remove=function(e){var t=this.array.indexOf(e);t>=0&&this.removeAt(t)},t.removeAt=function(e){this.array.splice(e,1),e<=this.i&&--this.i},t.fastRemove=function(e){var t=this.array.indexOf(e);t>=0&&this.fastRemoveAt(t)},t.fastRemoveAt=function(e){var t=this.array;t[e]=t[t.length-1],--t.length,e<=this.i&&--this.i},t.push=function(e){this.array.push(e)},c(e,[{key:"length",get:function(){return this.array.length},set:function(e){this.array.length=e,this.i>=e&&(this.i=e-1)}}]),e}());function me(e,t){e.splice(t,1)}function ge(e,t){var i=e.length;t<0||t>=i||(e[t]=e[i-1],e.length=i-1)}function ve(e,t){var i=e.indexOf(t);return i>=0&&(me(e,i),!0)}function ye(e,t){var i=e.findIndex(t);if(i>=0){var n=e[i];return me(e,i),n}}function Ee(e,t){return e.indexOf(t)>=0}var Te=Object.freeze({__proto__:null,removeAt:me,fastRemoveAt:ge,remove:ve,fastRemove:function(e,t){var i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],--e.length)},removeIf:ye,verifyType:function(e,t){if(e&&e.length>0)for(var i,n=E(e);!(i=n()).done;)if(!(i.value instanceof t))return j(1300),!1;return!0},removeArray:function(e,t){for(var i=0,n=t.length;i1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n0){--this.count;var e=this._pool[this.count];return this._pool[this.count]=null,e}return null},e.put=function(e){var t=this._pool;if(this.count=0&&(this._pool.length=e,this.count>e&&(this.count=e))},t}()),lt=e("fy",Te),_t=e("dC",{IDGenerator:Ae,Pool:ct,array:Te,isNumber:Re,isString:Ie,isEmptyObject:Oe,getPropertyDescriptor:He,addon:We,mixin:je,extend:Xe,getSuper:Ye,isChildClassOf:qe,clear:Ke,value:Ce,getset:Me,get:xe,set:Fe,unregisterClass:rt,getClassName:De,setClassName:it,setClassAlias:nt,getClassByName:ot,getClassById:at,get _registeredClassNames(){return l({},Je)},set _registeredClassNames(e){Ke(Je),Object.assign(Je,e)},get _registeredClassIds(){return l({},Ze)},set _registeredClassIds(e){Ke(Ze),Object.assign(Ze,e)},_getClassId:ut,getClassId:ht,_setClassId:et,_getClassById:st,obsolete:Le,obsoletes:Be,formatStr:ze,shiftArguments:ke,createMap:Pe});function ft(e){if("__bitmask__"in e)return e;Ce(e,"__bitmask__",null,!0);for(var t=-1,i=Object.keys(e),n=0;ni){var n=t;t=i,i=n}return e=0;n--){var r=i[n];r.hasOwnProperty("__attrs__")&&r.__attrs__||Ut(r,(t=i[n+1])&&t.__attrs__)}return Ut(e,(t=i[0])&&t.__attrs__),e.__attrs__}function zt(e,t){var i=kt(e),n=t+Bt,r={};for(var s in i)s.startsWith(n)&&(r[s.slice(n.length)]=i[s]);return r}function kt(e){return e.hasOwnProperty("__attrs__")&&e.__attrs__||Gt(e)}function Ht(e,t,i,n){kt(e)[t+Bt+i]=n}var Vt=function(){function e(e,t){this.name=void 0,this.default=void 0,this.name=e,this.default=t}return e.prototype.toString=function(){return this.name},e}(),Wt=e("g9",new Vt("Integer",0));R.Integer=Wt,R.CCInteger=Wt;var jt=e("f8",new Vt("Float",0));R.Float=jt,R.CCFloat=jt;var Xt=e("fc",new Vt("Boolean",!1));R.Boolean=Xt,R.CCBoolean=Xt;var Yt=e("fb",new Vt("String",""));function qt(e,t){return function(i,n){var r='"'+De(i)+"."+n+'"',s=zt(i,n),a=s.type;if(a===Wt||a===jt?a="Number":a!==Yt&&a!==Xt||(a=""+a),a===e){if(s.hasOwnProperty("default")){var o=s.default;if(void 0!==o&&!Array.isArray(o)&&!Ft(o)){var u=typeof o,h=e.toLowerCase();if(u===h)if("object"===h){if(!o||o instanceof s.ctor)return;Y(3605,r,De(s.ctor))}else"Number"!==e&&Y(3606,t,r,e);else{if("function"===u)return;e===Yt.default&&null==o?Y(3607,r):Y(3611,t,r,u)}delete s.type}}}else Y(3604,r)}}R.String=Yt,R.CCString=Yt;var Kt=Object.freeze({__proto__:null,DELIMETER:Bt,createAttrsSingle:Ut,createAttrs:Gt,attr:zt,getClassAttrs:kt,setClassAttr:Ht,PrimitiveType:Vt,CCInteger:Wt,CCFloat:jt,CCBoolean:Xt,CCString:Yt,getTypeChecker_ET:qt,getObjTypeChecker_ET:function(e){return function(t,i){qt("Object","type")(t,i);var n=kt(t)[i+Bt+"default"],r=R.Class.getDefault(n);if(!Array.isArray(r)&&qe(e,R.ValueType)){var s=De(e),a=ze('No need to specify the "type" of "%s.%s" because %s is a child class of ValueType.',De(t),i,s);n?L(a):Y(3612,a,s,De(t),i,s)}}}}),Qt={default:{},serializable:{},editorOnly:{},formerlySerializedAs:{}};function Zt(e,t,i,n){if(!e.get&&!e.set&&e.hasOwnProperty("default")){var r="_N$"+t;e.get=function(){return this[r]},e.set=function(e){var t=this[r];this[r]=e,i.call(this,t)};var s={};for(var a in n[r]=s,Qt){var o=Qt[a];e.hasOwnProperty(a)&&(s[a]=e[a],o.canUsedInGet||delete e[a])}}}function Jt(e,t,i,n){if(Array.isArray(t)){if(!(t.length>0))return K(5508,i,n);e.type=t=t[0]}"function"==typeof t&&(t===String?e.type=R.String:t===Boolean?e.type=R.Boolean:t===Number&&(e.type=R.Float))}function $t(e,t,i){var n=e?{_short:!0}:{_short:!0,default:t};return i&&(n.type=i),n}function ei(e,t){if(!e||e.constructor!==Object){if(Array.isArray(e)&&e.length>0)return $t(t,[],e);if("function"==typeof e){var i=e;return $t(t,qe(i,R.ValueType)?new i:null,i)}return $t(t,e instanceof Vt?e.default:e)}return null}var ti,ii=[];function ni(){return ii[ii.length-1]}R._RF={push:function(e,t,i,n){void 0===i&&(i=t,t=""),ii.push({uuid:t,script:i,module:e,exports:e.exports,beh:null,importMeta:n})},pop:function(){var e=ii.pop(),t=e.module,i=t.exports;if(i===e.exports){for(var n in i)return;t.exports=i=e.cls}},peek:ni},function(e){e[e.STANDALONE=1]="STANDALONE",e[e.IMPLICIT_VISIBLE=2]="IMPLICIT_VISIBLE",e[e.IMPLICIT_SERIALIZABLE=4]="IMPLICIT_SERIALIZABLE"}(ti||(ti={}));var ri=Bt,si="__ctors__",ai="Enum",oi="BitMask";function ui(e,t,i,n){!function(e,t){!function(e,t){e.indexOf(t)<0&&e.push(t)}(e.__props__,t)}(e,i),di(e,n,t,i)}function hi(e,t,i,n){var r=n.get;n.set,r&&(di(e,n,t,i),Ht(e,i,"serializable",!1))}function ci(e){return"function"==typeof e?e():e}function li(e){var t=e.name,i=e.extends,n=function(e,t,i){var n=R.Component,r=ni();if(r&&qe(t,n)){if(qe(r.cls,n))return K(3615),null;e=e||r.script}var s=function(e,t,i){var n=i.ctor;return Ce(n,si,!0,!0),n.prototype,t&&(n.$super=t),it(e,n),n}(e,t,i);if(r)if(qe(t,n)){var a=r.uuid;a&&et(a,s),r.cls=s}else qe(r.cls,n)||(r.cls=s);return s}(t,i,e);t||(t=R.js.getClassName(n)),n._sealed=!0,i&&(i._sealed=!1),function(e,t,i,n){if(e.__props__=[],n&&n.__props__&&(e.__props__=n.__props__.slice()),i)for(var r in function(e,t){for(var i in e){var n=e[i],r=ei(n,!1);if(r&&(n=e[i]=r),n){var s=n.notify;s&&Zt(n,i,s,e),"type"in n&&Jt(n,n.type,t,i)}}}(i,t),i){var s=i[r];s.get||s.set?hi(e,t,r,s):ui(e,t,r,s)}var a=kt(e);e.__values__=e.__props__.filter((function(e){return!1!==a[e+ri+"serializable"]}))}(n,t,e.properties,i);var r=e.editor;return r&&qe(i,R.Component)&&R.Component._registerEditorProps(n,r),n}function _i(e){var t;return null==e||null===(t=e.hasOwnProperty)||void 0===t?void 0:t.call(e,"__values__")}li._isCCClass=function(e){var t;return null==e||null===(t=e.hasOwnProperty)||void 0===t?void 0:t.call(e,si)},li.fastDefine=function(e,t,i){it(e,t);for(var n=t.__props__=t.__values__=Object.keys(i),r=kt(t),s=0;s=2&&((r||a())[s+"min"]=c[0],r[s+"max"]=c[1],c.length>2&&(r[s+"step"]=c[2])),h("min","number"),h("max","number"),h("step","number")}li.isArray=function(e){return e=ci(e),Array.isArray(e)},li.getDefault=ci,li.escapeForJS=function(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},li.IDENTIFIER_RE=/^[A-Za-z_$][0-9A-Za-z_$]*$/,li.getNewValueTypeCode=function(e){for(var t=De(e),i=e.constructor,n="new "+t+"(",r=0;ri){var n=t;t=i,i=n}return ei?i:e}function Ei(e){return e<0?0:e>1?1:e}function Ti(e,t,i){return e+(t-e)*i}function Ai(e){return e*pi}function Si(e){return e*mi}var bi=e("o",Math.random);function wi(e,t){return Math.random()*(t-e)+e}function Ri(e){return(e=(9301*e+49297)%233280)/233280}function Ii(e,t,i){return Ri(e)*(i-t)+t}function Oi(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}function Ni(e,t){return e-Math.floor(e/t)*t}function Ci(e,t){return e=Ni(e,2*t),t-Math.abs(e-t)}function Mi(e){return Math.abs(e.x)>Math.abs(e.y)?Math.abs(e.x)>Math.abs(e.z)?e.x:e.z:Math.abs(e.y)>Math.abs(e.z)?e.y:e.z}var xi=1/255,Fi=e("C",function(e){function t(t,i,n,r){var s;return(s=e.call(this)||this)._val=0,"string"==typeof t?s.fromHEX(t):void 0!==i?s.set(t,i,n,r):s.set(t),s}_(t,e),t.clone=function(e){var i=new t;return e._val?i._val=e._val:i._val=(e.a<<24>>>0)+(e.b<<16)+(e.g<<8)+e.r,i},t.copy=function(e,t){return e.r=t.r,e.g=t.g,e.b=t.b,e.a=t.a,e},t.set=function(e,t,i,n,r){return e.r=t,e.g=i,e.b=n,e.a=r,e},t.fromHEX=function(e,t){t=0===t.indexOf("#")?t.substring(1):t,e.r=parseInt(t.substr(0,2),16)||0,e.g=parseInt(t.substr(2,2),16)||0,e.b=parseInt(t.substr(4,2),16)||0;var i=parseInt(t.substr(6,2),16);return e.a=Number.isNaN(i)?255:i,e._val=(e.a<<24>>>0)+(e.b<<16)+(e.g<<8)+e.r,e},t.add=function(e,t,i){return e.r=t.r+i.r,e.g=t.g+i.g,e.b=t.b+i.b,e.a=t.a+i.a,e},t.subtract=function(e,t,i){return e.r=t.r-i.r,e.g=t.g-i.g,e.b=t.b-i.b,e.a=t.a-i.a,e},t.multiply=function(e,t,i){return e.r=t.r*i.r,e.g=t.g*i.g,e.b=t.b*i.b,e.a=t.a*i.a,e},t.divide=function(e,t,i){return e.r=t.r/i.r,e.g=t.g/i.g,e.b=t.b/i.b,e.a=t.a/i.a,e},t.scale=function(e,t,i){return e.r=t.r*i,e.g=t.g*i,e.b=t.b*i,e.a=t.a*i,e},t.lerp=function(e,t,i,n){var r=t.r,s=t.g,a=t.b,o=t.a;return r+=(i.r-r)*n,s+=(i.g-s)*n,a+=(i.b-a)*n,o+=(i.a-o)*n,e._val=Math.floor((o<<24>>>0)+(a<<16)+(s<<8)+r),e},t.toArray=function(e,i,n){void 0===n&&(n=0);var r=i instanceof t||i.a>1?1/255:1;return e[n+0]=i.r*r,e[n+1]=i.g*r,e[n+2]=i.b*r,e[n+3]=i.a*r,e},t.fromArray=function(e,t,i){return void 0===i&&(i=0),t.r=255*e[i+0],t.g=255*e[i+1],t.b=255*e[i+2],t.a=255*e[i+3],t},t.strictEquals=function(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a},t.equals=function(e,t,i){return void 0===i&&(i=gi),Math.abs(e.r-t.r)<=i*Math.max(1,Math.abs(e.r),Math.abs(t.r))&&Math.abs(e.g-t.g)<=i*Math.max(1,Math.abs(e.g),Math.abs(t.g))&&Math.abs(e.b-t.b)<=i*Math.max(1,Math.abs(e.b),Math.abs(t.b))&&Math.abs(e.a-t.a)<=i*Math.max(1,Math.abs(e.a),Math.abs(t.a))},t.hex=function(e){return(255*e.r<<24|255*e.g<<16|255*e.b<<8|255*e.a)>>>0};var i=t.prototype;return i.clone=function(){var e=new t;return e._val=this._val,e},i.equals=function(e){return e&&this._val===e._val},i.lerp=function(e,t){var i=this.r,n=this.g,r=this.b,s=this.a;return i+=(e.r-i)*t,n+=(e.g-n)*t,r+=(e.b-r)*t,s+=(e.a-s)*t,this._val=Math.floor((s<<24>>>0)+(r<<16)+(n<<8)+i),this},i.toString=function(){return"rgba("+this.r.toFixed()+", "+this.g.toFixed()+", "+this.b.toFixed()+", "+this.a.toFixed()+")"},i.toCSS=function(e){return void 0===e&&(e="rgba"),"rgba"===e?"rgba("+this.r+","+this.g+","+this.b+","+(this.a*xi).toFixed(2)+")":"rgb"===e?"rgb("+this.r+","+this.g+","+this.b+")":"#"+this.toHEX(e)},i.fromHEX=function(e){e=0===e.indexOf("#")?e.substring(1):e;var t=parseInt(e.substr(0,2),16)||0,i=parseInt(e.substr(2,2),16)||0,n=parseInt(e.substr(4,2),16)||0,r=parseInt(e.substr(6,2),16);return r=Number.isNaN(r)?255:r,this._val=(r<<24>>>0)+(n<<16)+(i<<8)+(0|t),this},i.toHEX=function(e){void 0===e&&(e="#rrggbb");var t="0",i=[(this.r<16?t:"")+this.r.toString(16),(this.g<16?t:"")+this.g.toString(16),(this.b<16?t:"")+this.b.toString(16)];return"#rgb"===e?(i[0]=i[0][0],i[1]=i[1][0],i[2]=i[2][0]):"#rrggbbaa"===e&&i.push((this.a<16?t:"")+this.a.toString(16)),i.join("")},i.toRGBValue=function(){return 16777215&this._val},i.fromHSV=function(e,t,i){var n=0,r=0,s=0;if(0===t)n=r=s=i;else if(0===i)n=r=s=0;else{1===e&&(e=0),e*=6;var a=Math.floor(e),o=e-a,u=i*(1-t),h=i*(1-t*o),c=i*(1-t*(1-o));switch(a){case 0:n=i,r=c,s=u;break;case 1:n=h,r=i,s=u;break;case 2:n=u,r=i,s=c;break;case 3:n=u,r=h,s=i;break;case 4:n=c,r=u,s=i;break;case 5:n=i,r=u,s=h}}return n*=255,r*=255,s*=255,this._val=(this.a<<24>>>0)+(s<<16)+(r<<8)+(0|n),this},i.toHSV=function(){var e=this.r*xi,t=this.g*xi,i=this.b*xi,n={h:0,s:0,v:0},r=Math.max(e,t,i),s=Math.min(e,t,i),a=0;return n.v=r,n.s=r?(r-s)/r:0,n.s?(a=r-s,n.h=e===r?(t-i)/a:t===r?2+(i-e)/a:4+(e-t)/a,n.h/=6,n.h<0&&(n.h+=1)):n.h=0,n},i.set=function(e,t,i,n){return"object"==typeof e?null!=e._val?this._val=e._val:(t=e.g||0,i=e.b||0,n="number"==typeof e.a?e.a:255,e=e.r||0,this._val=(n<<24>>>0)+(i<<16)+(t<<8)+(0|e)):(e=e||0,t=t||0,i=i||0,n="number"==typeof n?n:255,this._val=(n<<24>>>0)+(i<<16)+(t<<8)+(0|e)),this},i.multiply=function(e){var t=(255&this._val)*e.r>>8,i=(65280&this._val)*e.g>>8,n=(16711680&this._val)*e.b>>8,r=((4278190080&this._val)>>>8)*e.a;return this._val=4278190080&r|16711680&n|65280&i|255&t,this},i._set_r_unsafe=function(e){return this._val=(4294967040&this._val|e)>>>0,this},i._set_g_unsafe=function(e){return this._val=(4294902015&this._val|e<<8)>>>0,this},i._set_b_unsafe=function(e){return this._val=(4278255615&this._val|e<<16)>>>0,this},i._set_a_unsafe=function(e){return this._val=(16777215&this._val|e<<24)>>>0,this},c(t,[{key:"r",get:function(){return 255&this._val},set:function(e){e=~~yi(e,0,255),this._val=(4294967040&this._val|e)>>>0}},{key:"g",get:function(){return(65280&this._val)>>8},set:function(e){e=~~yi(e,0,255),this._val=(4294902015&this._val|e<<8)>>>0}},{key:"b",get:function(){return(16711680&this._val)>>16},set:function(e){e=~~yi(e,0,255),this._val=(4278255615&this._val|e<<16)>>>0}},{key:"a",get:function(){return(4278190080&this._val)>>>24},set:function(e){e=~~yi(e,0,255),this._val=(16777215&this._val|e<<24)>>>0}},{key:"x",get:function(){return this.r*xi},set:function(e){this.r=255*e}},{key:"y",get:function(){return this.g*xi},set:function(e){this.g=255*e}},{key:"z",get:function(){return this.b*xi},set:function(e){this.b=255*e}},{key:"w",get:function(){return this.a*xi},set:function(e){this.a=255*e}}]),t}(yt));function Pi(e,t,i,n){return new Fi(e,t,i,n)}Fi.WHITE=Object.freeze(new Fi(255,255,255,255)),Fi.GRAY=Object.freeze(new Fi(127,127,127,255)),Fi.BLACK=Object.freeze(new Fi(0,0,0,255)),Fi.TRANSPARENT=Object.freeze(new Fi(0,0,0,0)),Fi.RED=Object.freeze(new Fi(255,0,0,255)),Fi.GREEN=Object.freeze(new Fi(0,255,0,255)),Fi.BLUE=Object.freeze(new Fi(0,0,255,255)),Fi.CYAN=Object.freeze(new Fi(0,255,255,255)),Fi.MAGENTA=Object.freeze(new Fi(255,0,255,255)),Fi.YELLOW=Object.freeze(new Fi(255,255,0,255)),li.fastDefine("cc.Color",Fi,{r:0,g:0,b:0,a:255}),R.Color=Fi,R.color=Pi;var Di=e("a",function(e){function t(t,i,n){var r;return r=e.call(this)||this,t&&"object"==typeof t?(r.x=t.x,r.y=t.y,r.z=t.z):(r.x=t||0,r.y=i||0,r.z=n||0),r}_(t,e),t.zero=function(e){return e.x=0,e.y=0,e.z=0,e},t.clone=function(e){return new t(e.x,e.y,e.z)},t.copy=function(e,t){return e.x=t.x,e.y=t.y,e.z=t.z,e},t.set=function(e,t,i,n){return e.x=t,e.y=i,e.z=n,e},t.add=function(e,t,i){return e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e},t.subtract=function(e,t,i){return e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e},t.multiply=function(e,t,i){return e.x=t.x*i.x,e.y=t.y*i.y,e.z=t.z*i.z,e},t.divide=function(e,t,i){return e.x=t.x/i.x,e.y=t.y/i.y,e.z=t.z/i.z,e},t.ceil=function(e,t){return e.x=Math.ceil(t.x),e.y=Math.ceil(t.y),e.z=Math.ceil(t.z),e},t.floor=function(e,t){return e.x=Math.floor(t.x),e.y=Math.floor(t.y),e.z=Math.floor(t.z),e},t.min=function(e,t,i){return e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e.z=Math.min(t.z,i.z),e},t.max=function(e,t,i){return e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e.z=Math.max(t.z,i.z),e},t.round=function(e,t){return e.x=Math.round(t.x),e.y=Math.round(t.y),e.z=Math.round(t.z),e},t.multiplyScalar=function(e,t,i){return e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e},t.scaleAndAdd=function(e,t,i,n){return e.x=t.x+i.x*n,e.y=t.y+i.y*n,e.z=t.z+i.z*n,e},t.distance=function(e,t){var i=t.x-e.x,n=t.y-e.y,r=t.z-e.z;return Math.sqrt(i*i+n*n+r*r)},t.squaredDistance=function(e,t){var i=t.x-e.x,n=t.y-e.y,r=t.z-e.z;return i*i+n*n+r*r},t.len=function(e){var t=e.x,i=e.y,n=e.z;return Math.sqrt(t*t+i*i+n*n)},t.lengthSqr=function(e){var t=e.x,i=e.y,n=e.z;return t*t+i*i+n*n},t.negate=function(e,t){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},t.invert=function(e,t){return e.x=1/t.x,e.y=1/t.y,e.z=1/t.z,e},t.invertSafe=function(e,t){var i=t.x,n=t.y,r=t.z;return Math.abs(i)0&&(s=1/Math.sqrt(s),e.x=i*s,e.y=n*s,e.z=r*s),e},t.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},t.cross=function(e,t,i){var n=t.x,r=t.y,s=t.z,a=i.x,o=i.y,u=i.z;return e.x=r*u-s*o,e.y=s*a-n*u,e.z=n*o-r*a,e},t.lerp=function(e,t,i,n){return e.x=t.x+n*(i.x-t.x),e.y=t.y+n*(i.y-t.y),e.z=t.z+n*(i.z-t.z),e},t.random=function(e,t){t=t||1;var i=2*bi()*Math.PI,n=2*bi()-1,r=Math.sqrt(1-n*n);return e.x=r*Math.cos(i)*t,e.y=r*Math.sin(i)*t,e.z=n*t,e},t.transformMat4=function(e,t,i){var n=t.x,r=t.y,s=t.z,a=i.m03*n+i.m07*r+i.m11*s+i.m15;return a=a?Math.abs(1/a):1,e.x=(i.m00*n+i.m04*r+i.m08*s+i.m12)*a,e.y=(i.m01*n+i.m05*r+i.m09*s+i.m13)*a,e.z=(i.m02*n+i.m06*r+i.m10*s+i.m14)*a,e},t.transformMat4Normal=function(e,t,i){var n=t.x,r=t.y,s=t.z,a=i.m03*n+i.m07*r+i.m11*s;return a=a?Math.abs(1/a):1,e.x=(i.m00*n+i.m04*r+i.m08*s)*a,e.y=(i.m01*n+i.m05*r+i.m09*s)*a,e.z=(i.m02*n+i.m06*r+i.m10*s)*a,e},t.transformMat3=function(e,t,i){var n=t.x,r=t.y,s=t.z;return e.x=n*i.m00+r*i.m03+s*i.m06,e.y=n*i.m01+r*i.m04+s*i.m07,e.z=n*i.m02+r*i.m05+s*i.m08,e},t.transformAffine=function(e,t,i){var n=t.x,r=t.y,s=t.z;return e.x=i.m00*n+i.m04*r+i.m08*s+i.m12,e.y=i.m01*n+i.m05*r+i.m09*s+i.m13,e.z=i.m02*n+i.m06*r+i.m10*s+i.m14,e},t.transformQuat=function(e,t,i){var n=i.w*t.x+i.y*t.z-i.z*t.y,r=i.w*t.y+i.z*t.x-i.x*t.z,s=i.w*t.z+i.x*t.y-i.y*t.x,a=-i.x*t.x-i.y*t.y-i.z*t.z;return e.x=n*i.w+a*-i.x+r*-i.z-s*-i.y,e.y=r*i.w+a*-i.y+s*-i.x-n*-i.z,e.z=s*i.w+a*-i.z+n*-i.y-r*-i.x,e},t.transformRTS=function(e,t,i,n,r){var s=t.x*r.x,a=t.y*r.y,o=t.z*r.z,u=i.w*s+i.y*o-i.z*a,h=i.w*a+i.z*s-i.x*o,c=i.w*o+i.x*a-i.y*s,l=-i.x*s-i.y*a-i.z*o;return e.x=u*i.w+l*-i.x+h*-i.z-c*-i.y+n.x,e.y=h*i.w+l*-i.y+c*-i.x-u*-i.z+n.y,e.z=c*i.w+l*-i.z+u*-i.y-h*-i.x+n.z,e},t.transformInverseRTS=function(e,t,i,n,r){var s=t.x-n.x,a=t.y-n.y,o=t.z-n.z,u=i.w*s-i.y*o+i.z*a,h=i.w*a-i.z*s+i.x*o,c=i.w*o-i.x*a+i.y*s,l=i.x*s+i.y*a+i.z*o;return e.x=(u*i.w+l*i.x+h*i.z-c*i.y)/r.x,e.y=(h*i.w+l*i.y+c*i.x-u*i.z)/r.y,e.z=(c*i.w+l*i.z+u*i.y-h*i.x)/r.z,e},t.rotateX=function(e,t,i,n){var r=t.x-i.x,s=t.y-i.y,a=t.z-i.z,o=Math.cos(n),u=Math.sin(n),h=r,c=s*o-a*u,l=s*u+a*o;return e.x=h+i.x,e.y=c+i.y,e.z=l+i.z,e},t.rotateY=function(e,t,i,n){var r=t.x-i.x,s=t.y-i.y,a=t.z-i.z,o=Math.cos(n),u=Math.sin(n),h=a*u+r*o,c=s,l=a*o-r*u;return e.x=h+i.x,e.y=c+i.y,e.z=l+i.z,e},t.rotateZ=function(e,t,i,n){var r=t.x-i.x,s=t.y-i.y,a=t.z-i.z,o=Math.cos(n),u=Math.sin(n),h=r*o-s*u,c=r*u+s*o,l=a;return e.x=h+i.x,e.y=c+i.y,e.z=l+i.z,e},t.toArray=function(e,t,i){return void 0===i&&(i=0),e[i+0]=t.x,e[i+1]=t.y,e[i+2]=t.z,e},t.fromArray=function(e,t,i){return void 0===i&&(i=0),e.x=t[i+0],e.y=t[i+1],e.z=t[i+2],e},t.strictEquals=function(e,t){return e.x===t.x&&e.y===t.y&&e.z===t.z},t.equals=function(e,t,i){void 0===i&&(i=gi);var n=e.x,r=e.y,s=e.z,a=t.x,o=t.y,u=t.z;return Math.abs(n-a)<=i*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=i*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-u)<=i*Math.max(1,Math.abs(s),Math.abs(u))},t.angle=function(e,i){t.normalize(Li,e),t.normalize(Bi,i);var n=t.dot(Li,Bi);return n>1?0:n<-1?Math.PI:Math.acos(n)},t.projectOnPlane=function(e,i,n){return t.subtract(e,i,t.project(e,i,n))},t.project=function(e,i,n){var r=t.lengthSqr(n);return r<1e-6?t.set(e,0,0,0):t.multiplyScalar(e,n,t.dot(i,n)/r)};var i=t.prototype;return i.clone=function(){return new t(this.x,this.y,this.z)},i.set=function(e,t,i){return e&&"object"==typeof e?(this.x=e.x,this.y=e.y,this.z=e.z):(this.x=e||0,this.y=t||0,this.z=i||0),this},i.equals=function(e,t){return void 0===t&&(t=gi),Math.abs(this.x-e.x)<=t*Math.max(1,Math.abs(this.x),Math.abs(e.x))&&Math.abs(this.y-e.y)<=t*Math.max(1,Math.abs(this.y),Math.abs(e.y))&&Math.abs(this.z-e.z)<=t*Math.max(1,Math.abs(this.z),Math.abs(e.z))},i.equals3f=function(e,t,i,n){return void 0===n&&(n=gi),Math.abs(this.x-e)<=n*Math.max(1,Math.abs(this.x),Math.abs(e))&&Math.abs(this.y-t)<=n*Math.max(1,Math.abs(this.y),Math.abs(t))&&Math.abs(this.z-i)<=n*Math.max(1,Math.abs(this.z),Math.abs(i))},i.strictEquals=function(e){return this.x===e.x&&this.y===e.y&&this.z===e.z},i.strictEquals3f=function(e,t,i){return this.x===e&&this.y===t&&this.z===i},i.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.z.toFixed(2)+")"},i.lerp=function(e,t){return this.x+=t*(e.x-this.x),this.y+=t*(e.y-this.y),this.z+=t*(e.z-this.z),this},i.add=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},i.add3f=function(e,t,i){return this.x+=e,this.y+=t,this.z+=i,this},i.subtract=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this},i.subtract3f=function(e,t,i){return this.x-=e,this.y-=t,this.z-=i,this},i.multiplyScalar=function(e){return"object"==typeof e&&console.warn("should use Vec3.multiply for vector * vector operation"),this.x*=e,this.y*=e,this.z*=e,this},i.multiply=function(e){return"object"!=typeof e&&console.warn("should use Vec3.scale for vector * scalar operation"),this.x*=e.x,this.y*=e.y,this.z*=e.z,this},i.multiply3f=function(e,t,i){return this.x*=e,this.y*=t,this.z*=i,this},i.divide=function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},i.divide3f=function(e,t,i){return this.x/=e,this.y/=t,this.z/=i,this},i.negative=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},i.clampf=function(e,t){return this.x=yi(this.x,e.x,t.x),this.y=yi(this.y,e.y,t.y),this.z=yi(this.z,e.z,t.z),this},i.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},i.cross=function(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,a=e.z;return this.x=i*a-n*s,this.y=n*r-t*a,this.z=t*s-i*r,this},i.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},i.lengthSqr=function(){return this.x*this.x+this.y*this.y+this.z*this.z},i.normalize=function(){var e=this.x,t=this.y,i=this.z,n=e*e+t*t+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=e*n,this.y=t*n,this.z=i*n),this},i.transformMat4=function(e){var t=this.x,i=this.y,n=this.z,r=e.m03*t+e.m07*i+e.m11*n+e.m15;return r=r?1/r:1,this.x=(e.m00*t+e.m04*i+e.m08*n+e.m12)*r,this.y=(e.m01*t+e.m05*i+e.m09*n+e.m13)*r,this.z=(e.m02*t+e.m06*i+e.m10*n+e.m14)*r,this},t}(yt));Di.UNIT_X=Object.freeze(new Di(1,0,0)),Di.UNIT_Y=Object.freeze(new Di(0,1,0)),Di.UNIT_Z=Object.freeze(new Di(0,0,1)),Di.RIGHT=Object.freeze(new Di(1,0,0)),Di.UP=Object.freeze(new Di(0,1,0)),Di.FORWARD=Object.freeze(new Di(0,0,-1)),Di.ZERO=Object.freeze(new Di(0,0,0)),Di.ONE=Object.freeze(new Di(1,1,1)),Di.NEG_ONE=Object.freeze(new Di(-1,-1,-1));var Li=new Di,Bi=new Di;function Ui(e,t,i){return new Di(e,t,i)}li.fastDefine("cc.Vec3",Di,{x:0,y:0,z:0}),R.Vec3=Di,R.v3=Ui;var Gi=e("M",function(e){function t(t,i,n,r,s,a,o,u,h){var c;return void 0===t&&(t=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1),void 0===a&&(a=0),void 0===o&&(o=0),void 0===u&&(u=0),void 0===h&&(h=1),c=e.call(this)||this,"object"==typeof t?(c.m00=t.m00,c.m01=t.m01,c.m02=t.m02,c.m03=t.m03,c.m04=t.m04,c.m05=t.m05,c.m06=t.m06,c.m07=t.m07,c.m08=t.m08):(c.m00=t,c.m01=i,c.m02=n,c.m03=r,c.m04=s,c.m05=a,c.m06=o,c.m07=u,c.m08=h),c}_(t,e),t.clone=function(e){return new t(e.m00,e.m01,e.m02,e.m03,e.m04,e.m05,e.m06,e.m07,e.m08)},t.copy=function(e,t){return e.m00=t.m00,e.m01=t.m01,e.m02=t.m02,e.m03=t.m03,e.m04=t.m04,e.m05=t.m05,e.m06=t.m06,e.m07=t.m07,e.m08=t.m08,e},t.set=function(e,t,i,n,r,s,a,o,u,h){return e.m00=t,e.m01=i,e.m02=n,e.m03=r,e.m04=s,e.m05=a,e.m06=o,e.m07=u,e.m08=h,e},t.identity=function(e){return e.m00=1,e.m01=0,e.m02=0,e.m03=0,e.m04=1,e.m05=0,e.m06=0,e.m07=0,e.m08=1,e},t.transpose=function(e,t){if(e===t){var i=t.m01,n=t.m02,r=t.m05;e.m01=t.m03,e.m02=t.m06,e.m03=i,e.m05=t.m07,e.m06=n,e.m07=r}else e.m00=t.m00,e.m01=t.m03,e.m02=t.m06,e.m03=t.m01,e.m04=t.m04,e.m05=t.m07,e.m06=t.m02,e.m07=t.m05,e.m08=t.m08;return e},t.invert=function(e,t){var i=t.m00,n=t.m01,r=t.m02,s=t.m03,a=t.m04,o=t.m05,u=t.m06,h=t.m07,c=t.m08,l=c*a-o*h,_=-c*s+o*u,f=h*s-a*u,d=i*l+n*_+r*f;return 0===d?(e.m00=0,e.m01=0,e.m02=0,e.m03=0,e.m04=0,e.m05=0,e.m06=0,e.m07=0,e.m08=0,e):(d=1/d,e.m00=l*d,e.m01=(-c*n+r*h)*d,e.m02=(o*n-r*a)*d,e.m03=_*d,e.m04=(c*i-r*u)*d,e.m05=(-o*i+r*s)*d,e.m06=f*d,e.m07=(-h*i+n*u)*d,e.m08=(a*i-n*s)*d,e)},t.determinant=function(e){var t=e.m00,i=e.m01,n=e.m02,r=e.m03,s=e.m04,a=e.m05,o=e.m06,u=e.m07,h=e.m08;return t*(h*s-a*u)+i*(-h*r+a*o)+n*(u*r-s*o)},t.multiply=function(e,t,i){var n=t.m00,r=t.m01,s=t.m02,a=t.m03,o=t.m04,u=t.m05,h=t.m06,c=t.m07,l=t.m08,_=i.m00,f=i.m01,d=i.m02,p=i.m03,m=i.m04,g=i.m05,v=i.m06,y=i.m07,E=i.m08;return e.m00=_*n+f*a+d*h,e.m01=_*r+f*o+d*c,e.m02=_*s+f*u+d*l,e.m03=p*n+m*a+g*h,e.m04=p*r+m*o+g*c,e.m05=p*s+m*u+g*l,e.m06=v*n+y*a+E*h,e.m07=v*r+y*o+E*c,e.m08=v*s+y*u+E*l,e},t.multiplyMat4=function(e,t,i){var n=t.m00,r=t.m01,s=t.m02,a=t.m03,o=t.m04,u=t.m05,h=t.m06,c=t.m07,l=t.m08,_=i.m00,f=i.m01,d=i.m02,p=i.m04,m=i.m05,g=i.m06,v=i.m08,y=i.m09,E=i.m10;return e.m00=_*n+f*a+d*h,e.m01=_*r+f*o+d*c,e.m02=_*s+f*u+d*l,e.m03=p*n+m*a+g*h,e.m04=p*r+m*o+g*c,e.m05=p*s+m*u+g*l,e.m06=v*n+y*a+E*h,e.m07=v*r+y*o+E*c,e.m08=v*s+y*u+E*l,e},t.transform=function(e,t,i){var n=t.m00,r=t.m01,s=t.m02,a=t.m03,o=t.m04,u=t.m05,h=t.m06,c=t.m07,l=t.m08,_=i.x,f=i.y;return e.m00=n,e.m01=r,e.m02=s,e.m03=a,e.m04=o,e.m05=u,e.m06=_*n+f*a+h,e.m07=_*r+f*o+c,e.m08=_*s+f*u+l,e},t.scale=function(e,t,i){var n=i.x,r=i.y;return e.m00=n*t.m00,e.m01=n*t.m01,e.m02=n*t.m02,e.m03=r*t.m03,e.m04=r*t.m04,e.m05=r*t.m05,e.m06=t.m06,e.m07=t.m07,e.m08=t.m08,e},t.rotate=function(e,t,i){var n=t.m00,r=t.m01,s=t.m02,a=t.m03,o=t.m04,u=t.m05,h=t.m06,c=t.m07,l=t.m08,_=Math.sin(i),f=Math.cos(i);return e.m00=f*n+_*a,e.m01=f*r+_*o,e.m02=f*s+_*u,e.m03=f*a-_*n,e.m04=f*o-_*r,e.m05=f*u-_*s,e.m06=h,e.m07=c,e.m08=l,e},t.fromMat4=function(e,t){return e.m00=t.m00,e.m01=t.m01,e.m02=t.m02,e.m03=t.m04,e.m04=t.m05,e.m05=t.m06,e.m06=t.m08,e.m07=t.m09,e.m08=t.m10,e},t.fromViewUp=function(e,i,n){return Di.lengthSqr(i).999999?(e.x=0,e.y=0,e.z=0,e.w=1,e):(Di.cross(ji,i,n),e.x=ji.x,e.y=ji.y,e.z=ji.z,e.w=1+r,t.normalize(e,e))},t.getAxisAngle=function(e,t){var i=2*Math.acos(t.w),n=Math.sin(i/2);return 0!==n?(e.x=t.x/n,e.y=t.y/n,e.z=t.z/n):(e.x=1,e.y=0,e.z=0),i},t.multiply=function(e,t,i){var n=t.x*i.w+t.w*i.x+t.y*i.z-t.z*i.y,r=t.y*i.w+t.w*i.y+t.z*i.x-t.x*i.z,s=t.z*i.w+t.w*i.z+t.x*i.y-t.y*i.x,a=t.w*i.w-t.x*i.x-t.y*i.y-t.z*i.z;return e.x=n,e.y=r,e.z=s,e.w=a,e},t.multiplyScalar=function(e,t,i){return e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},t.scaleAndAdd=function(e,t,i,n){return e.x=t.x+i.x*n,e.y=t.y+i.y*n,e.z=t.z+i.z*n,e.w=t.w+i.w*n,e},t.rotateX=function(e,t,i){i*=.5;var n=Math.sin(i),r=Math.cos(i),s=t.x,a=t.y,o=t.z,u=t.w;return e.x=s*r+u*n,e.y=a*r+o*n,e.z=o*r-a*n,e.w=u*r-s*n,e},t.rotateY=function(e,t,i){i*=.5;var n=Math.sin(i),r=Math.cos(i),s=t.x,a=t.y,o=t.z,u=t.w;return e.x=s*r-o*n,e.y=a*r+u*n,e.z=o*r+s*n,e.w=u*r-a*n,e},t.rotateZ=function(e,t,i){i*=.5;var n=Math.sin(i),r=Math.cos(i),s=t.x,a=t.y,o=t.z,u=t.w;return e.x=s*r+a*n,e.y=a*r-s*n,e.z=o*r+u*n,e.w=u*r-o*n,e},t.rotateAround=function(e,i,n,r){return t.invert(Vi,i),Di.transformQuat(ji,n,Vi),t.fromAxisAngle(Vi,ji,r),t.multiply(e,i,Vi),e},t.rotateAroundLocal=function(e,i,n,r){return t.fromAxisAngle(Vi,n,r),t.multiply(e,i,Vi),e},t.calculateW=function(e,t){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=Math.sqrt(Math.abs(1-t.x*t.x-t.y*t.y-t.z*t.z)),e},t.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},t.lerp=function(e,t,i,n){return e.x=t.x+n*(i.x-t.x),e.y=t.y+n*(i.y-t.y),e.z=t.z+n*(i.z-t.z),e.w=t.w+n*(i.w-t.w),e},t.slerp=function(e,t,i,n){var r=0,s=0,a=i.x,o=i.y,u=i.z,h=i.w,c=t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w;if(c<0&&(c=-c,a=-a,o=-o,u=-u,h=-h),1-c>1e-6){var l=Math.acos(c),_=Math.sin(l);r=Math.sin((1-n)*l)/_,s=Math.sin(n*l)/_}else r=1-n,s=n;return e.x=r*t.x+s*a,e.y=r*t.y+s*o,e.z=r*t.z+s*u,e.w=r*t.w+s*h,e},t.sqlerp=function(e,i,n,r,s,a){return t.slerp(Vi,i,s,a),t.slerp(Wi,n,r,a),t.slerp(e,Vi,Wi,2*a*(1-a)),e},t.invert=function(e,t){var i=t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w,n=i?1/i:0;return e.x=-t.x*n,e.y=-t.y*n,e.z=-t.z*n,e.w=t.w*n,e},t.conjugate=function(e,t){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=t.w,e},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w)},t.lengthSqr=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},t.normalize=function(e,t){var i=t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w;return i>0&&(i=1/Math.sqrt(i),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i),e},t.fromAxes=function(e,i,n,r){return Gi.set(Xi,i.x,i.y,i.z,n.x,n.y,n.z,r.x,r.y,r.z),t.normalize(e,t.fromMat3(e,Xi))},t.fromViewUp=function(e,i,n){return Gi.fromViewUp(Xi,i,n),t.normalize(e,t.fromMat3(e,Xi))},t.fromAxisAngle=function(e,t,i){i*=.5;var n=Math.sin(i);return e.x=n*t.x,e.y=n*t.y,e.z=n*t.z,e.w=Math.cos(i),e},t.fromMat3=function(e,t){var i=t.m00,n=t.m03,r=t.m06,s=t.m01,a=t.m04,o=t.m07,u=t.m02,h=t.m05,c=t.m08,l=i+a+c;if(l>0){var _=.5/Math.sqrt(l+1);e.w=.25/_,e.x=(h-o)*_,e.y=(r-u)*_,e.z=(s-n)*_}else if(i>a&&i>c){var f=2*Math.sqrt(1+i-a-c);e.w=(h-o)/f,e.x=.25*f,e.y=(n+s)/f,e.z=(r+u)/f}else if(a>c){var d=2*Math.sqrt(1+a-i-c);e.w=(r-u)/d,e.x=(n+s)/d,e.y=.25*d,e.z=(o+h)/d}else{var p=2*Math.sqrt(1+c-i-a);e.w=(s-n)/p,e.x=(r+u)/p,e.y=(o+h)/p,e.z=.25*p}return e},t.fromEuler=function(e,t,i,n){t*=Yi,i*=Yi,n*=Yi;var r=Math.sin(t),s=Math.cos(t),a=Math.sin(i),o=Math.cos(i),u=Math.sin(n),h=Math.cos(n);return e.x=r*o*h+s*a*u,e.y=s*a*h+r*o*u,e.z=s*o*u-r*a*h,e.w=s*o*h-r*a*u,e},t.fromAngleZ=function(e,t){return t*=Yi,e.x=e.y=0,e.z=Math.sin(t),e.w=Math.cos(t),e},t.toAxisX=function(e,t){var i=2*t.y,n=2*t.z;return e.x=1-i*t.y-n*t.z,e.y=i*t.x+n*t.w,e.z=n*t.x+i*t.w,e},t.toAxisY=function(e,t){var i=2*t.x,n=2*t.y,r=2*t.z;return e.x=n*t.x-r*t.w,e.y=1-i*t.x-r*t.z,e.z=r*t.y+i*t.w,e},t.toAxisZ=function(e,t){var i=2*t.x,n=2*t.y,r=2*t.z;return e.x=r*t.x-n*t.w,e.y=r*t.y-i*t.w,e.z=1-i*t.x-n*t.y,e},t.toEuler=function(e,t,i){var n=t.x,r=t.y,s=t.z,a=t.w,o=0,u=0,h=0,c=n*r+s*a;if(c>.499999)o=0,u=Si(2*Math.atan2(n,a)),h=90;else if(c<-.499999)o=0,u=-Si(2*Math.atan2(n,a)),h=-90;else{var l=n*n,_=r*r,f=s*s;o=Si(Math.atan2(2*n*a-2*r*s,1-2*l-2*f)),u=Si(Math.atan2(2*r*a-2*n*s,1-2*_-2*f)),h=Si(Math.asin(2*c)),i&&(o=-180*Math.sign(o+1e-6)+o,u=-180*Math.sign(u+1e-6)+u,h=180*Math.sign(h+1e-6)-h)}return e.x=o,e.y=u,e.z=h,e},t.toArray=function(e,t,i){return void 0===i&&(i=0),e[i+0]=t.x,e[i+1]=t.y,e[i+2]=t.z,e[i+3]=t.w,e},t.fromArray=function(e,t,i){return void 0===i&&(i=0),e.x=t[i+0],e.y=t[i+1],e.z=t[i+2],e.w=t[i+3],e},t.strictEquals=function(e,t){return e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},t.equals=function(e,t,i){return void 0===i&&(i=gi),Math.abs(e.x-t.x)<=i*Math.max(1,Math.abs(e.x),Math.abs(t.x))&&Math.abs(e.y-t.y)<=i*Math.max(1,Math.abs(e.y),Math.abs(t.y))&&Math.abs(e.z-t.z)<=i*Math.max(1,Math.abs(e.z),Math.abs(t.z))&&Math.abs(e.w-t.w)<=i*Math.max(1,Math.abs(e.w),Math.abs(t.w))};var i=t.prototype;return i.clone=function(){return new t(this.x,this.y,this.z,this.w)},i.set=function(e,t,i,n){return e&&"object"==typeof e?(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w):(this.x=e||0,this.y=t||0,this.z=i||0,this.w=null!=n?n:1),this},i.equals=function(e,t){return void 0===t&&(t=gi),Math.abs(this.x-e.x)<=t*Math.max(1,Math.abs(this.x),Math.abs(e.x))&&Math.abs(this.y-e.y)<=t*Math.max(1,Math.abs(this.y),Math.abs(e.y))&&Math.abs(this.z-e.z)<=t*Math.max(1,Math.abs(this.z),Math.abs(e.z))&&Math.abs(this.w-e.w)<=t*Math.max(1,Math.abs(this.w),Math.abs(e.w))},i.strictEquals=function(e){return e&&this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},i.getEulerAngles=function(e){return t.toEuler(e,this)},i.lerp=function(e,t){return this.x+=t*(e.x-this.x),this.y+=t*(e.y-this.y),this.z+=t*(e.z-this.z),this.w+=t*(e.w-this.w),this},i.slerp=function(e,i){return t.slerp(this,this,e,i)},i.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},i.lengthSqr=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},t}(yt));Hi.IDENTITY=Object.freeze(new Hi);var Vi=new Hi,Wi=new Hi,ji=new Di,Xi=new Gi,Yi=.5*Math.PI/180;function qi(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=1),new Hi(e,t,i,n)}li.fastDefine("cc.Quat",Hi,{x:0,y:0,z:0,w:1}),R.Quat=Hi,R.quat=qi;var Ki=e("gj",Object.freeze([Object.freeze([1,0,0,1]),Object.freeze([0,1,-1,0]),Object.freeze([-1,0,0,-1]),Object.freeze([0,-1,1,0])])),Qi=e("f",function(e){function t(t,i,n,r,s,a,o,u,h,c,l,_,f,d,p,m){var g;return void 0===t&&(t=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=1),void 0===o&&(o=0),void 0===u&&(u=0),void 0===h&&(h=0),void 0===c&&(c=0),void 0===l&&(l=1),void 0===_&&(_=0),void 0===f&&(f=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===m&&(m=1),(g=e.call(this)||this).m00=void 0,g.m01=void 0,g.m02=void 0,g.m03=void 0,g.m04=void 0,g.m05=void 0,g.m06=void 0,g.m07=void 0,g.m08=void 0,g.m09=void 0,g.m10=void 0,g.m11=void 0,g.m12=void 0,g.m13=void 0,g.m14=void 0,g.m15=void 0,"object"==typeof t?(g.m00=t.m00,g.m01=t.m01,g.m02=t.m02,g.m03=t.m03,g.m04=t.m04,g.m05=t.m05,g.m06=t.m06,g.m07=t.m07,g.m08=t.m08,g.m09=t.m09,g.m10=t.m10,g.m11=t.m11,g.m12=t.m12,g.m13=t.m13,g.m14=t.m14,g.m15=t.m15):(g.m00=t,g.m01=i,g.m02=n,g.m03=r,g.m04=s,g.m05=a,g.m06=o,g.m07=u,g.m08=h,g.m09=c,g.m10=l,g.m11=_,g.m12=f,g.m13=d,g.m14=p,g.m15=m),g}_(t,e),t.clone=function(e){return new t(e.m00,e.m01,e.m02,e.m03,e.m04,e.m05,e.m06,e.m07,e.m08,e.m09,e.m10,e.m11,e.m12,e.m13,e.m14,e.m15)},t.copy=function(e,t){return e.m00=t.m00,e.m01=t.m01,e.m02=t.m02,e.m03=t.m03,e.m04=t.m04,e.m05=t.m05,e.m06=t.m06,e.m07=t.m07,e.m08=t.m08,e.m09=t.m09,e.m10=t.m10,e.m11=t.m11,e.m12=t.m12,e.m13=t.m13,e.m14=t.m14,e.m15=t.m15,e},t.set=function(e,t,i,n,r,s,a,o,u,h,c,l,_,f,d,p,m){return e.m00=t,e.m01=i,e.m02=n,e.m03=r,e.m04=s,e.m05=a,e.m06=o,e.m07=u,e.m08=h,e.m09=c,e.m10=l,e.m11=_,e.m12=f,e.m13=d,e.m14=p,e.m15=m,e},t.identity=function(e){return e.m00=1,e.m01=0,e.m02=0,e.m03=0,e.m04=0,e.m05=1,e.m06=0,e.m07=0,e.m08=0,e.m09=0,e.m10=1,e.m11=0,e.m12=0,e.m13=0,e.m14=0,e.m15=1,e},t.transpose=function(e,t){if(e===t){var i=t.m01,n=t.m02,r=t.m03,s=t.m06,a=t.m07,o=t.m11;e.m01=t.m04,e.m02=t.m08,e.m03=t.m12,e.m04=i,e.m06=t.m09,e.m07=t.m13,e.m08=n,e.m09=s,e.m11=t.m14,e.m12=r,e.m13=a,e.m14=o}else e.m00=t.m00,e.m01=t.m04,e.m02=t.m08,e.m03=t.m12,e.m04=t.m01,e.m05=t.m05,e.m06=t.m09,e.m07=t.m13,e.m08=t.m02,e.m09=t.m06,e.m10=t.m10,e.m11=t.m14,e.m12=t.m03,e.m13=t.m07,e.m14=t.m11,e.m15=t.m15;return e},t.invert=function(e,t){var i=t.m00,n=t.m01,r=t.m02,s=t.m03,a=t.m04,o=t.m05,u=t.m06,h=t.m07,c=t.m08,l=t.m09,_=t.m10,f=t.m11,d=t.m12,p=t.m13,m=t.m14,g=t.m15,v=i*o-n*a,y=i*u-r*a,E=i*h-s*a,T=n*u-r*o,A=n*h-s*o,S=r*h-s*u,b=c*p-l*d,w=c*m-_*d,R=c*g-f*d,I=l*m-_*p,O=l*g-f*p,N=_*g-f*m,C=v*N-y*O+E*I+T*R-A*w+S*b;return 0===C?(e.m00=0,e.m01=0,e.m02=0,e.m03=0,e.m04=0,e.m05=0,e.m06=0,e.m07=0,e.m08=0,e.m09=0,e.m10=0,e.m11=0,e.m12=0,e.m13=0,e.m14=0,e.m15=0,e):(C=1/C,e.m00=(o*N-u*O+h*I)*C,e.m01=(r*O-n*N-s*I)*C,e.m02=(p*S-m*A+g*T)*C,e.m03=(_*A-l*S-f*T)*C,e.m04=(u*R-a*N-h*w)*C,e.m05=(i*N-r*R+s*w)*C,e.m06=(m*E-d*S-g*y)*C,e.m07=(c*S-_*E+f*y)*C,e.m08=(a*O-o*R+h*b)*C,e.m09=(n*R-i*O-s*b)*C,e.m10=(d*A-p*E+g*v)*C,e.m11=(l*E-c*A-f*v)*C,e.m12=(o*w-a*I-u*b)*C,e.m13=(i*I-n*w+r*b)*C,e.m14=(p*y-d*T-m*v)*C,e.m15=(c*T-l*y+_*v)*C,e)},t.determinant=function(e){var t=e.m00,i=e.m01,n=e.m02,r=e.m03,s=e.m04,a=e.m05,o=e.m06,u=e.m07,h=e.m08,c=e.m09,l=e.m10,_=e.m11,f=e.m12,d=e.m13,p=e.m14,m=e.m15;return(t*a-i*s)*(l*m-_*p)-(t*o-n*s)*(c*m-_*d)+(t*u-r*s)*(c*p-l*d)+(i*o-n*a)*(h*m-_*f)-(i*u-r*a)*(h*p-l*f)+(n*u-r*o)*(h*d-c*f)},t.multiply=function(e,t,i){var n=t.m00,r=t.m01,s=t.m02,a=t.m03,o=t.m04,u=t.m05,h=t.m06,c=t.m07,l=t.m08,_=t.m09,f=t.m10,d=t.m11,p=t.m12,m=t.m13,g=t.m14,v=t.m15,y=i.m00,E=i.m01,T=i.m02,A=i.m03;return e.m00=y*n+E*o+T*l+A*p,e.m01=y*r+E*u+T*_+A*m,e.m02=y*s+E*h+T*f+A*g,e.m03=y*a+E*c+T*d+A*v,y=i.m04,E=i.m05,T=i.m06,A=i.m07,e.m04=y*n+E*o+T*l+A*p,e.m05=y*r+E*u+T*_+A*m,e.m06=y*s+E*h+T*f+A*g,e.m07=y*a+E*c+T*d+A*v,y=i.m08,E=i.m09,T=i.m10,A=i.m11,e.m08=y*n+E*o+T*l+A*p,e.m09=y*r+E*u+T*_+A*m,e.m10=y*s+E*h+T*f+A*g,e.m11=y*a+E*c+T*d+A*v,y=i.m12,E=i.m13,T=i.m14,A=i.m15,e.m12=y*n+E*o+T*l+A*p,e.m13=y*r+E*u+T*_+A*m,e.m14=y*s+E*h+T*f+A*g,e.m15=y*a+E*c+T*d+A*v,e},t.transform=function(e,t,i){var n=i.x,r=i.y,s=i.z;if(t===e)e.m12=t.m00*n+t.m04*r+t.m08*s+t.m12,e.m13=t.m01*n+t.m05*r+t.m09*s+t.m13,e.m14=t.m02*n+t.m06*r+t.m10*s+t.m14,e.m15=t.m03*n+t.m07*r+t.m11*s+t.m15;else{var a=t.m00,o=t.m01,u=t.m02,h=t.m03,c=t.m04,l=t.m05,_=t.m06,f=t.m07,d=t.m08,p=t.m09,m=t.m10,g=t.m11;t.m12,t.m13,t.m14,t.m15,e.m00=a,e.m01=o,e.m02=u,e.m03=h,e.m04=c,e.m05=l,e.m06=_,e.m07=f,e.m08=d,e.m09=p,e.m10=m,e.m11=g,e.m12=a*n+c*r+d*s+t.m12,e.m13=o*n+l*r+p*s+t.m13,e.m14=u*n+_*r+m*s+t.m14,e.m15=h*n+f*r+g*s+t.m15}return e},t.translate=function(e,t,i){return t===e?(e.m12+=i.x,e.m13+=i.y,e.m14+=i.z):(e.m00=t.m00,e.m01=t.m01,e.m02=t.m02,e.m03=t.m03,e.m04=t.m04,e.m05=t.m05,e.m06=t.m06,e.m07=t.m07,e.m08=t.m08,e.m09=t.m09,e.m10=t.m10,e.m11=t.m11,e.m12+=i.x,e.m13+=i.y,e.m14+=i.z,e.m15=t.m15),e},t.scale=function(e,t,i){var n=i.x,r=i.y,s=i.z;return e.m00=t.m00*n,e.m01=t.m01*n,e.m02=t.m02*n,e.m03=t.m03*n,e.m04=t.m04*r,e.m05=t.m05*r,e.m06=t.m06*r,e.m07=t.m07*r,e.m08=t.m08*s,e.m09=t.m09*s,e.m10=t.m10*s,e.m11=t.m11*s,e.m12=t.m12,e.m13=t.m13,e.m14=t.m14,e.m15=t.m15,e},t.rotate=function(e,t,i,n){var r=n.x,s=n.y,a=n.z,o=Math.sqrt(r*r+s*s+a*a);if(Math.abs(o)0?(n=2*Math.sqrt(i+1),e.w=.25*n,e.x=(t.m06-t.m09)/n,e.y=(t.m08-t.m02)/n,e.z=(t.m01-t.m04)/n):t.m00>t.m05&&t.m00>t.m10?(n=2*Math.sqrt(1+t.m00-t.m05-t.m10),e.w=(t.m06-t.m09)/n,e.x=.25*n,e.y=(t.m01+t.m04)/n,e.z=(t.m08+t.m02)/n):t.m05>t.m10?(n=2*Math.sqrt(1+t.m05-t.m00-t.m10),e.w=(t.m08-t.m02)/n,e.x=(t.m01+t.m04)/n,e.y=.25*n,e.z=(t.m06+t.m09)/n):(n=2*Math.sqrt(1+t.m10-t.m00-t.m05),e.w=(t.m01-t.m04)/n,e.x=(t.m08+t.m02)/n,e.y=(t.m06+t.m09)/n,e.z=.25*n),e},t.toRTS=function(e,t,i,n){n.x=Di.set(Zi,e.m00,e.m01,e.m02).length(),Ji.m00=e.m00/n.x,Ji.m01=e.m01/n.x,Ji.m02=e.m02/n.x,n.y=Di.set(Zi,e.m04,e.m05,e.m06).length(),Ji.m03=e.m04/n.y,Ji.m04=e.m05/n.y,Ji.m05=e.m06/n.y,n.z=Di.set(Zi,e.m08,e.m09,e.m10).length(),Ji.m06=e.m08/n.z,Ji.m07=e.m09/n.z,Ji.m08=e.m10/n.z,Gi.determinant(Ji)<0&&(n.x*=-1,Ji.m00*=-1,Ji.m01*=-1,Ji.m02*=-1),Hi.fromMat3(t,Ji),Di.set(i,e.m12,e.m13,e.m14)},t.fromRTS=function(e,t,i,n){var r=t.x,s=t.y,a=t.z,o=t.w,u=r+r,h=s+s,c=a+a,l=r*u,_=r*h,f=r*c,d=s*h,p=s*c,m=a*c,g=o*u,v=o*h,y=o*c,E=n.x,T=n.y,A=n.z;return e.m00=(1-(d+m))*E,e.m01=(_+y)*E,e.m02=(f-v)*E,e.m03=0,e.m04=(_-y)*T,e.m05=(1-(l+m))*T,e.m06=(p+g)*T,e.m07=0,e.m08=(f+v)*A,e.m09=(p-g)*A,e.m10=(1-(l+d))*A,e.m11=0,e.m12=i.x,e.m13=i.y,e.m14=i.z,e.m15=1,e},t.fromRTSOrigin=function(e,t,i,n,r){var s=t.x,a=t.y,o=t.z,u=t.w,h=s+s,c=a+a,l=o+o,_=s*h,f=s*c,d=s*l,p=a*c,m=a*l,g=o*l,v=u*h,y=u*c,E=u*l,T=n.x,A=n.y,S=n.z,b=r.x,w=r.y,R=r.z;return e.m00=(1-(p+g))*T,e.m01=(f+E)*T,e.m02=(d-y)*T,e.m03=0,e.m04=(f-E)*A,e.m05=(1-(_+g))*A,e.m06=(m+v)*A,e.m07=0,e.m08=(d+y)*S,e.m09=(m-v)*S,e.m10=(1-(_+p))*S,e.m11=0,e.m12=i.x+b-(e.m00*b+e.m04*w+e.m08*R),e.m13=i.y+w-(e.m01*b+e.m05*w+e.m09*R),e.m14=i.z+R-(e.m02*b+e.m06*w+e.m10*R),e.m15=1,e},t.fromQuat=function(e,t){var i=t.x,n=t.y,r=t.z,s=t.w,a=i+i,o=n+n,u=r+r,h=i*a,c=n*a,l=n*o,_=r*a,f=r*o,d=r*u,p=s*a,m=s*o,g=s*u;return e.m00=1-l-d,e.m01=c+g,e.m02=_-m,e.m03=0,e.m04=c-g,e.m05=1-h-d,e.m06=f+p,e.m07=0,e.m08=_+m,e.m09=f-p,e.m10=1-h-l,e.m11=0,e.m12=0,e.m13=0,e.m14=0,e.m15=1,e},t.frustum=function(e,t,i,n,r,s,a){var o=1/(i-t),u=1/(r-n),h=1/(s-a);return e.m00=2*s*o,e.m01=0,e.m02=0,e.m03=0,e.m04=0,e.m05=2*s*u,e.m06=0,e.m07=0,e.m08=(i+t)*o,e.m09=(r+n)*u,e.m10=(a+s)*h,e.m11=-1,e.m12=0,e.m13=0,e.m14=a*s*2*h,e.m15=0,e},t.perspective=function(e,t,i,n,r,s,a,o,u){void 0===s&&(s=!0),void 0===a&&(a=-1),void 0===o&&(o=1),void 0===u&&(u=0);var h=1/Math.tan(t/2),c=1/(n-r),l=s?h/i:h,_=(s?h:h*i)*o,f=Ki[u];return e.m00=l*f[0],e.m01=l*f[1],e.m02=0,e.m03=0,e.m04=_*f[2],e.m05=_*f[3],e.m06=0,e.m07=0,e.m08=0,e.m09=0,e.m10=(r-a*n)*c,e.m11=-1,e.m12=0,e.m13=0,e.m14=r*n*c*(1-a),e.m15=0,e},t.ortho=function(e,t,i,n,r,s,a,o,u,h){void 0===o&&(o=-1),void 0===u&&(u=1),void 0===h&&(h=0);var c=1/(t-i),l=1/(n-r)*u,_=1/(s-a),f=-2*c,d=-2*l,p=(t+i)*c,m=(r+n)*l,g=Ki[h];return e.m00=f*g[0],e.m01=f*g[1],e.m02=0,e.m03=0,e.m04=d*g[2],e.m05=d*g[3],e.m06=0,e.m07=0,e.m08=0,e.m09=0,e.m10=_*(1-o),e.m11=0,e.m12=p*g[0]+m*g[2],e.m13=p*g[1]+m*g[3],e.m14=(s-o*a)*_,e.m15=1,e},t.lookAt=function(e,t,i,n){var r=t.x,s=t.y,a=t.z,o=n.x,u=n.y,h=n.z,c=r-i.x,l=s-i.y,_=a-i.z,f=1/Math.sqrt(c*c+l*l+_*_),d=u*(_*=f)-h*(l*=f),p=h*(c*=f)-o*_,m=o*l-u*c,g=l*(m*=f=1/Math.sqrt(d*d+p*p+m*m))-_*(p*=f),v=_*(d*=f)-c*m,y=c*p-l*d;return e.m00=d,e.m01=g,e.m02=c,e.m03=0,e.m04=p,e.m05=v,e.m06=l,e.m07=0,e.m08=m,e.m09=y,e.m10=_,e.m11=0,e.m12=-(d*r+p*s+m*a),e.m13=-(g*r+v*s+y*a),e.m14=-(c*r+l*s+_*a),e.m15=1,e},t.inverseTranspose=function(e,t){var i=t.m00,n=t.m01,r=t.m02,s=t.m03,a=t.m04,o=t.m05,u=t.m06,h=t.m07,c=t.m08,l=t.m09,_=t.m10,f=t.m11,d=t.m12,p=t.m13,m=t.m14,g=t.m15,v=i*o-n*a,y=i*u-r*a,E=i*h-s*a,T=n*u-r*o,A=n*h-s*o,S=r*h-s*u,b=c*p-l*d,w=c*m-_*d,R=c*g-f*d,I=l*m-_*p,O=l*g-f*p,N=_*g-f*m,C=v*N-y*O+E*I+T*R-A*w+S*b;return C?(C=1/C,e.m00=(o*N-u*O+h*I)*C,e.m01=(u*R-a*N-h*w)*C,e.m02=(a*O-o*R+h*b)*C,e.m03=0,e.m04=(r*O-n*N-s*I)*C,e.m05=(i*N-r*R+s*w)*C,e.m06=(n*R-i*O-s*b)*C,e.m07=0,e.m08=(p*S-m*A+g*T)*C,e.m09=(m*E-d*S-g*y)*C,e.m10=(d*A-p*E+g*v)*C,e.m11=0,e.m12=0,e.m13=0,e.m14=0,e.m15=1,e):null},t.toArray=function(e,t,i){return void 0===i&&(i=0),e[i+0]=t.m00,e[i+1]=t.m01,e[i+2]=t.m02,e[i+3]=t.m03,e[i+4]=t.m04,e[i+5]=t.m05,e[i+6]=t.m06,e[i+7]=t.m07,e[i+8]=t.m08,e[i+9]=t.m09,e[i+10]=t.m10,e[i+11]=t.m11,e[i+12]=t.m12,e[i+13]=t.m13,e[i+14]=t.m14,e[i+15]=t.m15,e},t.fromArray=function(e,t,i){return void 0===i&&(i=0),e.m00=t[i+0],e.m01=t[i+1],e.m02=t[i+2],e.m03=t[i+3],e.m04=t[i+4],e.m05=t[i+5],e.m06=t[i+6],e.m07=t[i+7],e.m08=t[i+8],e.m09=t[i+9],e.m10=t[i+10],e.m11=t[i+11],e.m12=t[i+12],e.m13=t[i+13],e.m14=t[i+14],e.m15=t[i+15],e},t.add=function(e,t,i){return e.m00=t.m00+i.m00,e.m01=t.m01+i.m01,e.m02=t.m02+i.m02,e.m03=t.m03+i.m03,e.m04=t.m04+i.m04,e.m05=t.m05+i.m05,e.m06=t.m06+i.m06,e.m07=t.m07+i.m07,e.m08=t.m08+i.m08,e.m09=t.m09+i.m09,e.m10=t.m10+i.m10,e.m11=t.m11+i.m11,e.m12=t.m12+i.m12,e.m13=t.m13+i.m13,e.m14=t.m14+i.m14,e.m15=t.m15+i.m15,e},t.subtract=function(e,t,i){return e.m00=t.m00-i.m00,e.m01=t.m01-i.m01,e.m02=t.m02-i.m02,e.m03=t.m03-i.m03,e.m04=t.m04-i.m04,e.m05=t.m05-i.m05,e.m06=t.m06-i.m06,e.m07=t.m07-i.m07,e.m08=t.m08-i.m08,e.m09=t.m09-i.m09,e.m10=t.m10-i.m10,e.m11=t.m11-i.m11,e.m12=t.m12-i.m12,e.m13=t.m13-i.m13,e.m14=t.m14-i.m14,e.m15=t.m15-i.m15,e},t.multiplyScalar=function(e,t,i){return e.m00=t.m00*i,e.m01=t.m01*i,e.m02=t.m02*i,e.m03=t.m03*i,e.m04=t.m04*i,e.m05=t.m05*i,e.m06=t.m06*i,e.m07=t.m07*i,e.m08=t.m08*i,e.m09=t.m09*i,e.m10=t.m10*i,e.m11=t.m11*i,e.m12=t.m12*i,e.m13=t.m13*i,e.m14=t.m14*i,e.m15=t.m15*i,e},t.multiplyScalarAndAdd=function(e,t,i,n){return e.m00=t.m00+i.m00*n,e.m01=t.m01+i.m01*n,e.m02=t.m02+i.m02*n,e.m03=t.m03+i.m03*n,e.m04=t.m04+i.m04*n,e.m05=t.m05+i.m05*n,e.m06=t.m06+i.m06*n,e.m07=t.m07+i.m07*n,e.m08=t.m08+i.m08*n,e.m09=t.m09+i.m09*n,e.m10=t.m10+i.m10*n,e.m11=t.m11+i.m11*n,e.m12=t.m12+i.m12*n,e.m13=t.m13+i.m13*n,e.m14=t.m14+i.m14*n,e.m15=t.m15+i.m15*n,e},t.strictEquals=function(e,t){return e.m00===t.m00&&e.m01===t.m01&&e.m02===t.m02&&e.m03===t.m03&&e.m04===t.m04&&e.m05===t.m05&&e.m06===t.m06&&e.m07===t.m07&&e.m08===t.m08&&e.m09===t.m09&&e.m10===t.m10&&e.m11===t.m11&&e.m12===t.m12&&e.m13===t.m13&&e.m14===t.m14&&e.m15===t.m15},t.equals=function(e,t,i){return void 0===i&&(i=gi),Math.abs(e.m00-t.m00)<=i*Math.max(1,Math.abs(e.m00),Math.abs(t.m00))&&Math.abs(e.m01-t.m01)<=i*Math.max(1,Math.abs(e.m01),Math.abs(t.m01))&&Math.abs(e.m02-t.m02)<=i*Math.max(1,Math.abs(e.m02),Math.abs(t.m02))&&Math.abs(e.m03-t.m03)<=i*Math.max(1,Math.abs(e.m03),Math.abs(t.m03))&&Math.abs(e.m04-t.m04)<=i*Math.max(1,Math.abs(e.m04),Math.abs(t.m04))&&Math.abs(e.m05-t.m05)<=i*Math.max(1,Math.abs(e.m05),Math.abs(t.m05))&&Math.abs(e.m06-t.m06)<=i*Math.max(1,Math.abs(e.m06),Math.abs(t.m06))&&Math.abs(e.m07-t.m07)<=i*Math.max(1,Math.abs(e.m07),Math.abs(t.m07))&&Math.abs(e.m08-t.m08)<=i*Math.max(1,Math.abs(e.m08),Math.abs(t.m08))&&Math.abs(e.m09-t.m09)<=i*Math.max(1,Math.abs(e.m09),Math.abs(t.m09))&&Math.abs(e.m10-t.m10)<=i*Math.max(1,Math.abs(e.m10),Math.abs(t.m10))&&Math.abs(e.m11-t.m11)<=i*Math.max(1,Math.abs(e.m11),Math.abs(t.m11))&&Math.abs(e.m12-t.m12)<=i*Math.max(1,Math.abs(e.m12),Math.abs(t.m12))&&Math.abs(e.m13-t.m13)<=i*Math.max(1,Math.abs(e.m13),Math.abs(t.m13))&&Math.abs(e.m14-t.m14)<=i*Math.max(1,Math.abs(e.m14),Math.abs(t.m14))&&Math.abs(e.m15-t.m15)<=i*Math.max(1,Math.abs(e.m15),Math.abs(t.m15))};var i=t.prototype;return i.clone=function(){return new t(this.m00,this.m01,this.m02,this.m03,this.m04,this.m05,this.m06,this.m07,this.m08,this.m09,this.m10,this.m11,this.m12,this.m13,this.m14,this.m15)},i.set=function(e,t,i,n,r,s,a,o,u,h,c,l,_,f,d,p){return void 0===e&&(e=1),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1),void 0===a&&(a=0),void 0===o&&(o=0),void 0===u&&(u=0),void 0===h&&(h=0),void 0===c&&(c=1),void 0===l&&(l=0),void 0===_&&(_=0),void 0===f&&(f=0),void 0===d&&(d=0),void 0===p&&(p=1),"object"==typeof e?(this.m01=e.m01,this.m02=e.m02,this.m03=e.m03,this.m04=e.m04,this.m05=e.m05,this.m06=e.m06,this.m07=e.m07,this.m08=e.m08,this.m09=e.m09,this.m10=e.m10,this.m11=e.m11,this.m12=e.m12,this.m13=e.m13,this.m14=e.m14,this.m15=e.m15,this.m00=e.m00):(this.m01=t,this.m02=i,this.m03=n,this.m04=r,this.m05=s,this.m06=a,this.m07=o,this.m08=u,this.m09=h,this.m10=c,this.m11=l,this.m12=_,this.m13=f,this.m14=d,this.m15=p,this.m00=e),this},i.equals=function(e,t){return void 0===t&&(t=gi),Math.abs(this.m00-e.m00)<=t*Math.max(1,Math.abs(this.m00),Math.abs(e.m00))&&Math.abs(this.m01-e.m01)<=t*Math.max(1,Math.abs(this.m01),Math.abs(e.m01))&&Math.abs(this.m02-e.m02)<=t*Math.max(1,Math.abs(this.m02),Math.abs(e.m02))&&Math.abs(this.m03-e.m03)<=t*Math.max(1,Math.abs(this.m03),Math.abs(e.m03))&&Math.abs(this.m04-e.m04)<=t*Math.max(1,Math.abs(this.m04),Math.abs(e.m04))&&Math.abs(this.m05-e.m05)<=t*Math.max(1,Math.abs(this.m05),Math.abs(e.m05))&&Math.abs(this.m06-e.m06)<=t*Math.max(1,Math.abs(this.m06),Math.abs(e.m06))&&Math.abs(this.m07-e.m07)<=t*Math.max(1,Math.abs(this.m07),Math.abs(e.m07))&&Math.abs(this.m08-e.m08)<=t*Math.max(1,Math.abs(this.m08),Math.abs(e.m08))&&Math.abs(this.m09-e.m09)<=t*Math.max(1,Math.abs(this.m09),Math.abs(e.m09))&&Math.abs(this.m10-e.m10)<=t*Math.max(1,Math.abs(this.m10),Math.abs(e.m10))&&Math.abs(this.m11-e.m11)<=t*Math.max(1,Math.abs(this.m11),Math.abs(e.m11))&&Math.abs(this.m12-e.m12)<=t*Math.max(1,Math.abs(this.m12),Math.abs(e.m12))&&Math.abs(this.m13-e.m13)<=t*Math.max(1,Math.abs(this.m13),Math.abs(e.m13))&&Math.abs(this.m14-e.m14)<=t*Math.max(1,Math.abs(this.m14),Math.abs(e.m14))&&Math.abs(this.m15-e.m15)<=t*Math.max(1,Math.abs(this.m15),Math.abs(e.m15))},i.strictEquals=function(e){return this.m00===e.m00&&this.m01===e.m01&&this.m02===e.m02&&this.m03===e.m03&&this.m04===e.m04&&this.m05===e.m05&&this.m06===e.m06&&this.m07===e.m07&&this.m08===e.m08&&this.m09===e.m09&&this.m10===e.m10&&this.m11===e.m11&&this.m12===e.m12&&this.m13===e.m13&&this.m14===e.m14&&this.m15===e.m15},i.toString=function(){return"[\n"+this.m00+", "+this.m01+", "+this.m02+", "+this.m03+",\n"+this.m04+", "+this.m05+", "+this.m06+", "+this.m07+",\n"+this.m08+", "+this.m09+", "+this.m10+", "+this.m11+",\n"+this.m12+", "+this.m13+", "+this.m14+", "+this.m15+"\n]"},i.identity=function(){return this.m00=1,this.m01=0,this.m02=0,this.m03=0,this.m04=0,this.m05=1,this.m06=0,this.m07=0,this.m08=0,this.m09=0,this.m10=1,this.m11=0,this.m12=0,this.m13=0,this.m14=0,this.m15=1,this},i.zero=function(){return this.m00=0,this.m01=0,this.m02=0,this.m03=0,this.m04=0,this.m05=0,this.m06=0,this.m07=0,this.m08=0,this.m09=0,this.m10=0,this.m11=0,this.m12=0,this.m13=0,this.m14=0,this.m15=0,this},i.transpose=function(){var e=this.m01,t=this.m02,i=this.m03,n=this.m06,r=this.m07,s=this.m11;return this.m01=this.m04,this.m02=this.m08,this.m03=this.m12,this.m04=e,this.m06=this.m09,this.m07=this.m13,this.m08=t,this.m09=n,this.m11=this.m14,this.m12=i,this.m13=r,this.m14=s,this},i.invert=function(){var e=this.m00,t=this.m01,i=this.m02,n=this.m03,r=this.m04,s=this.m05,a=this.m06,o=this.m07,u=this.m08,h=this.m09,c=this.m10,l=this.m11,_=this.m12,f=this.m13,d=this.m14,p=this.m15,m=e*s-t*r,g=e*a-i*r,v=e*o-n*r,y=t*a-i*s,E=t*o-n*s,T=i*o-n*a,A=u*f-h*_,S=u*d-c*_,b=u*p-l*_,w=h*d-c*f,R=h*p-l*f,I=c*p-l*d,O=m*I-g*R+v*w+y*b-E*S+T*A;return 0===O?(this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),this):(O=1/O,this.m00=(s*I-a*R+o*w)*O,this.m01=(i*R-t*I-n*w)*O,this.m02=(f*T-d*E+p*y)*O,this.m03=(c*E-h*T-l*y)*O,this.m04=(a*b-r*I-o*S)*O,this.m05=(e*I-i*b+n*S)*O,this.m06=(d*v-_*T-p*g)*O,this.m07=(u*T-c*v+l*g)*O,this.m08=(r*R-s*b+o*A)*O,this.m09=(t*b-e*R-n*A)*O,this.m10=(_*E-f*v+p*m)*O,this.m11=(h*v-u*E-l*m)*O,this.m12=(s*S-r*w-a*A)*O,this.m13=(e*w-t*S+i*A)*O,this.m14=(f*g-_*y-d*m)*O,this.m15=(u*y-h*g+c*m)*O,this)},i.determinant=function(){var e=this.m00,t=this.m01,i=this.m02,n=this.m03,r=this.m04,s=this.m05,a=this.m06,o=this.m07,u=this.m08,h=this.m09,c=this.m10,l=this.m11,_=this.m12,f=this.m13,d=this.m14,p=this.m15;return(e*s-t*r)*(c*p-l*d)-(e*a-i*r)*(h*p-l*f)+(e*o-n*r)*(h*d-c*f)+(t*a-i*s)*(u*p-l*_)-(t*o-n*s)*(u*d-c*_)+(i*o-n*a)*(u*f-h*_)},i.add=function(e){return this.m00+=e.m00,this.m01+=e.m01,this.m02+=e.m02,this.m03+=e.m03,this.m04+=e.m04,this.m05+=e.m05,this.m06+=e.m06,this.m07+=e.m07,this.m08+=e.m08,this.m09+=e.m09,this.m10+=e.m10,this.m11+=e.m11,this.m12+=e.m12,this.m13+=e.m13,this.m14+=e.m14,this.m15+=e.m15,this},i.subtract=function(e){return this.m00-=e.m00,this.m01-=e.m01,this.m02-=e.m02,this.m03-=e.m03,this.m04-=e.m04,this.m05-=e.m05,this.m06-=e.m06,this.m07-=e.m07,this.m08-=e.m08,this.m09-=e.m09,this.m10-=e.m10,this.m11-=e.m11,this.m12-=e.m12,this.m13-=e.m13,this.m14-=e.m14,this.m15-=e.m15,this},i.multiply=function(e){var t=this.m00,i=this.m01,n=this.m02,r=this.m03,s=this.m04,a=this.m05,o=this.m06,u=this.m07,h=this.m08,c=this.m09,l=this.m10,_=this.m11,f=this.m12,d=this.m13,p=this.m14,m=this.m15,g=e.m00,v=e.m01,y=e.m02,E=e.m03;return this.m00=g*t+v*s+y*h+E*f,this.m01=g*i+v*a+y*c+E*d,this.m02=g*n+v*o+y*l+E*p,this.m03=g*r+v*u+y*_+E*m,g=e.m04,v=e.m05,y=e.m06,E=e.m07,this.m04=g*t+v*s+y*h+E*f,this.m05=g*i+v*a+y*c+E*d,this.m06=g*n+v*o+y*l+E*p,this.m07=g*r+v*u+y*_+E*m,g=e.m08,v=e.m09,y=e.m10,E=e.m11,this.m08=g*t+v*s+y*h+E*f,this.m09=g*i+v*a+y*c+E*d,this.m10=g*n+v*o+y*l+E*p,this.m11=g*r+v*u+y*_+E*m,g=e.m12,v=e.m13,y=e.m14,E=e.m15,this.m12=g*t+v*s+y*h+E*f,this.m13=g*i+v*a+y*c+E*d,this.m14=g*n+v*o+y*l+E*p,this.m15=g*r+v*u+y*_+E*m,this},i.multiplyScalar=function(e){return this.m00*=e,this.m01*=e,this.m02*=e,this.m03*=e,this.m04*=e,this.m05*=e,this.m06*=e,this.m07*=e,this.m08*=e,this.m09*=e,this.m10*=e,this.m11*=e,this.m12*=e,this.m13*=e,this.m14*=e,this.m15*=e,this},i.translate=function(e){return this.m12+=e.x,this.m13+=e.y,this.m14+=e.z,this},i.scale=function(e){var t=e.x,i=e.y,n=e.z;return this.m00*=t,this.m01*=t,this.m02*=t,this.m03*=t,this.m04*=i,this.m05*=i,this.m06*=i,this.m07*=i,this.m08*=n,this.m09*=n,this.m10*=n,this.m11*=n,this},i.rotate=function(e,t){var i=t.x,n=t.y,r=t.z,s=Math.sqrt(i*i+n*n+r*r);if(Math.abs(s)0?(i=2*Math.sqrt(t+1),e.w=.25*i,e.x=(this.m06-this.m09)/i,e.y=(this.m08-this.m02)/i,e.z=(this.m01-this.m04)/i):this.m00>this.m05&&this.m00>this.m10?(i=2*Math.sqrt(1+this.m00-this.m05-this.m10),e.w=(this.m06-this.m09)/i,e.x=.25*i,e.y=(this.m01+this.m04)/i,e.z=(this.m08+this.m02)/i):this.m05>this.m10?(i=2*Math.sqrt(1+this.m05-this.m00-this.m10),e.w=(this.m08-this.m02)/i,e.x=(this.m01+this.m04)/i,e.y=.25*i,e.z=(this.m06+this.m09)/i):(i=2*Math.sqrt(1+this.m10-this.m00-this.m05),e.w=(this.m01-this.m04)/i,e.x=(this.m08+this.m02)/i,e.y=(this.m06+this.m09)/i,e.z=.25*i),e},i.fromRTS=function(e,t,i){var n=e.x,r=e.y,s=e.z,a=e.w,o=n+n,u=r+r,h=s+s,c=n*o,l=n*u,_=n*h,f=r*u,d=r*h,p=s*h,m=a*o,g=a*u,v=a*h,y=i.x,E=i.y,T=i.z;return this.m00=(1-(f+p))*y,this.m01=(l+v)*y,this.m02=(_-g)*y,this.m03=0,this.m04=(l-v)*E,this.m05=(1-(c+p))*E,this.m06=(d+m)*E,this.m07=0,this.m08=(_+g)*T,this.m09=(d-m)*T,this.m10=(1-(c+f))*T,this.m11=0,this.m12=t.x,this.m13=t.y,this.m14=t.z,this.m15=1,this},i.fromQuat=function(e){var t=e.x,i=e.y,n=e.z,r=e.w,s=t+t,a=i+i,o=n+n,u=t*s,h=i*s,c=i*a,l=n*s,_=n*a,f=n*o,d=r*s,p=r*a,m=r*o;return this.m00=1-c-f,this.m01=h+m,this.m02=l-p,this.m03=0,this.m04=h-m,this.m05=1-u-f,this.m06=_+d,this.m07=0,this.m08=l+p,this.m09=_-d,this.m10=1-u-c,this.m11=0,this.m12=0,this.m13=0,this.m14=0,this.m15=1,this},t}(yt));Qi.IDENTITY=Object.freeze(new Qi);var Zi=new Di,Ji=new Gi;function $i(e,t,i,n,r,s,a,o,u,h,c,l,_,f,d,p){return new Qi(e,t,i,n,r,s,a,o,u,h,c,l,_,f,d,p)}li.fastDefine("cc.Mat4",Qi,{m00:1,m01:0,m02:0,m03:0,m04:0,m05:1,m06:0,m07:0,m08:0,m09:0,m10:1,m11:0,m12:0,m13:0,m14:0,m15:1}),R.Mat4=Qi,R.mat4=$i;var en=e("V",function(e){function t(t,i){var n;return n=e.call(this)||this,t&&"object"==typeof t?(n.x=t.x,n.y=t.y):(n.x=t||0,n.y=i||0),n}_(t,e),t.clone=function(e){return new t(e.x,e.y)},t.copy=function(e,t){return e.x=t.x,e.y=t.y,e},t.set=function(e,t,i){return e.x=t,e.y=i,e},t.add=function(e,t,i){return e.x=t.x+i.x,e.y=t.y+i.y,e},t.subtract=function(e,t,i){return e.x=t.x-i.x,e.y=t.y-i.y,e},t.multiply=function(e,t,i){return e.x=t.x*i.x,e.y=t.y*i.y,e},t.divide=function(e,t,i){return e.x=t.x/i.x,e.y=t.y/i.y,e},t.ceil=function(e,t){return e.x=Math.ceil(t.x),e.y=Math.ceil(t.y),e},t.floor=function(e,t){return e.x=Math.floor(t.x),e.y=Math.floor(t.y),e},t.min=function(e,t,i){return e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e},t.max=function(e,t,i){return e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e},t.round=function(e,t){return e.x=Math.round(t.x),e.y=Math.round(t.y),e},t.multiplyScalar=function(e,t,i){return e.x=t.x*i,e.y=t.y*i,e},t.scaleAndAdd=function(e,t,i,n){return e.x=t.x+i.x*n,e.y=t.y+i.y*n,e},t.distance=function(e,t){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},t.squaredDistance=function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},t.len=function(e){var t=e.x,i=e.y;return Math.sqrt(t*t+i*i)},t.lengthSqr=function(e){var t=e.x,i=e.y;return t*t+i*i},t.negate=function(e,t){return e.x=-t.x,e.y=-t.y,e},t.inverse=function(e,t){return e.x=1/t.x,e.y=1/t.y,e},t.inverseSafe=function(e,t){var i=t.x,n=t.y;return Math.abs(i)0&&(r=1/Math.sqrt(r),e.x=i*r,e.y=n*r),e},t.dot=function(e,t){return e.x*t.x+e.y*t.y},t.cross=function(e,t,i){return e instanceof Di?(e.x=e.y=0,e.z=t.x*i.y-t.y*i.x,e):e.x*t.y-e.y*t.x},t.lerp=function(e,t,i,n){var r=t.x,s=t.y;return e.x=r+n*(i.x-r),e.y=s+n*(i.y-s),e},t.random=function(e,t){t=t||1;var i=2*bi()*Math.PI;return e.x=Math.cos(i)*t,e.y=Math.sin(i)*t,e},t.transformMat3=function(e,t,i){var n=t.x,r=t.y;return e.x=i.m00*n+i.m03*r+i.m06,e.y=i.m01*n+i.m04*r+i.m07,e},t.transformMat4=function(e,t,i){var n=t.x,r=t.y;return e.x=i.m00*n+i.m04*r+i.m12,e.y=i.m01*n+i.m05*r+i.m13,e},t.str=function(e){return"Vec2("+e.x+", "+e.y+")"},t.toArray=function(e,t,i){return void 0===i&&(i=0),e[i+0]=t.x,e[i+1]=t.y,e},t.fromArray=function(e,t,i){return void 0===i&&(i=0),e.x=t[i+0],e.y=t[i+1],e},t.strictEquals=function(e,t){return e.x===t.x&&e.y===t.y},t.equals=function(e,t,i){return void 0===i&&(i=gi),Math.abs(e.x-t.x)<=i*Math.max(1,Math.abs(e.x),Math.abs(t.x))&&Math.abs(e.y-t.y)<=i*Math.max(1,Math.abs(e.y),Math.abs(t.y))},t.angle=function(e,i){t.normalize(tn,e),t.normalize(nn,i);var n=t.dot(tn,nn);return n>1?0:n<-1?Math.PI:Math.acos(n)};var i=t.prototype;return i.clone=function(){return new t(this.x,this.y)},i.set=function(e,t){return e&&"object"==typeof e?(this.x=e.x,this.y=e.y):(this.x=e||0,this.y=t||0),this},i.equals=function(e,t){return void 0===t&&(t=gi),Math.abs(this.x-e.x)<=t*Math.max(1,Math.abs(this.x),Math.abs(e.x))&&Math.abs(this.y-e.y)<=t*Math.max(1,Math.abs(this.y),Math.abs(e.y))},i.equals2f=function(e,t,i){return void 0===i&&(i=gi),Math.abs(this.x-e)<=i*Math.max(1,Math.abs(this.x),Math.abs(e))&&Math.abs(this.y-t)<=i*Math.max(1,Math.abs(this.y),Math.abs(t))},i.strictEquals=function(e){return e&&this.x===e.x&&this.y===e.y},i.strictEquals2f=function(e,t){return this.x===e&&this.y===t},i.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+")"},i.lerp=function(e,t){var i=this.x,n=this.y;return this.x=i+t*(e.x-i),this.y=n+t*(e.y-n),this},i.clampf=function(e,t){return this.x=yi(this.x,e.x,t.x),this.y=yi(this.y,e.y,t.y),this},i.add=function(e){return this.x+=e.x,this.y+=e.y,this},i.add2f=function(e,t){return this.x+=e,this.y+=t,this},i.subtract=function(e){return this.x-=e.x,this.y-=e.y,this},i.subtract2f=function(e,t){return this.x-=e,this.y-=t,this},i.multiplyScalar=function(e){return"object"==typeof e&&console.warn("should use Vec2.multiply for vector * vector operation"),this.x*=e,this.y*=e,this},i.multiply=function(e){return"object"!=typeof e&&console.warn("should use Vec2.scale for vector * scalar operation"),this.x*=e.x,this.y*=e.y,this},i.multiply2f=function(e,t){return this.x*=e,this.y*=t,this},i.divide=function(e){return this.x/=e.x,this.y/=e.y,this},i.divide2f=function(e,t){return this.x/=e,this.y/=t,this},i.negative=function(){return this.x=-this.x,this.y=-this.y,this},i.dot=function(e){return this.x*e.x+this.y*e.y},i.cross=function(e){return this.x*e.y-this.y*e.x},i.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},i.lengthSqr=function(){return this.x*this.x+this.y*this.y},i.normalize=function(){var e=this.x,t=this.y,i=e*e+t*t;return i>0&&(i=1/Math.sqrt(i),this.x*=i,this.y*=i),this},i.angle=function(e){var t=this.lengthSqr(),i=e.lengthSqr();if(0===t||0===i)return console.warn("Can't get angle between zero vector"),0;var n=this.dot(e)/Math.sqrt(t*i);return n=yi(n,-1,1),Math.acos(n)},i.signAngle=function(e){var t=this.angle(e);return this.cross(e)<0?-t:t},i.rotate=function(e){var t=this.x,i=this.y,n=Math.sin(e),r=Math.cos(e);return this.x=r*t-n*i,this.y=n*t+r*i,this},i.project=function(e){var t=this.dot(e)/e.dot(e);return this.x=e.x*t,this.y=e.y*t,this},i.transformMat4=function(e){var t=this.x,i=this.y;return this.x=e.m00*t+e.m04*i+e.m12,this.y=e.m01*t+e.m05*i+e.m13,this},t}(yt));en.ZERO=Object.freeze(new en(0,0)),en.ONE=Object.freeze(new en(1,1)),en.NEG_ONE=Object.freeze(new en(-1,-1)),en.UNIT_X=Object.freeze(new en(1,0)),en.UNIT_Y=Object.freeze(new en(0,1));var tn=new en,nn=new en;function rn(e,t){return new en(e,t)}li.fastDefine("cc.Vec2",en,{x:0,y:0}),R.Vec2=en,R.v2=rn;var sn=e("d",function(e){function t(t,i,n,r){var s;return s=e.call(this)||this,t&&"object"==typeof t?(s.x=t.x,s.y=t.y,s.z=t.z,s.w=t.w):(s.x=t||0,s.y=i||0,s.z=n||0,s.w=r||0),s}_(t,e),t.clone=function(e){return new t(e.x,e.y,e.z,e.w)},t.copy=function(e,t){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e},t.set=function(e,t,i,n,r){return e.x=t,e.y=i,e.z=n,e.w=r,e},t.add=function(e,t,i){return e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},t.subtract=function(e,t,i){return e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},t.multiply=function(e,t,i){return e.x=t.x*i.x,e.y=t.y*i.y,e.z=t.z*i.z,e.w=t.w*i.w,e},t.divide=function(e,t,i){return e.x=t.x/i.x,e.y=t.y/i.y,e.z=t.z/i.z,e.w=t.w/i.w,e},t.ceil=function(e,t){return e.x=Math.ceil(t.x),e.y=Math.ceil(t.y),e.z=Math.ceil(t.z),e.w=Math.ceil(t.w),e},t.floor=function(e,t){return e.x=Math.floor(t.x),e.y=Math.floor(t.y),e.z=Math.floor(t.z),e.w=Math.floor(t.w),e},t.min=function(e,t,i){return e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e.z=Math.min(t.z,i.z),e.w=Math.min(t.w,i.w),e},t.max=function(e,t,i){return e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e.z=Math.max(t.z,i.z),e.w=Math.max(t.w,i.w),e},t.round=function(e,t){return e.x=Math.round(t.x),e.y=Math.round(t.y),e.z=Math.round(t.z),e.w=Math.round(t.w),e},t.multiplyScalar=function(e,t,i){return e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},t.scaleAndAdd=function(e,t,i,n){return e.x=t.x+i.x*n,e.y=t.y+i.y*n,e.z=t.z+i.z*n,e.w=t.w+i.w*n,e},t.distance=function(e,t){var i=t.x-e.x,n=t.y-e.y,r=t.z-e.z,s=t.w-e.w;return Math.sqrt(i*i+n*n+r*r+s*s)},t.squaredDistance=function(e,t){var i=t.x-e.x,n=t.y-e.y,r=t.z-e.z,s=t.w-e.w;return i*i+n*n+r*r+s*s},t.len=function(e){var t=e.x,i=e.y,n=e.z,r=e.w;return Math.sqrt(t*t+i*i+n*n+r*r)},t.lengthSqr=function(e){var t=e.x,i=e.y,n=e.z,r=e.w;return t*t+i*i+n*n+r*r},t.negate=function(e,t){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},t.inverse=function(e,t){return e.x=1/t.x,e.y=1/t.y,e.z=1/t.z,e.w=1/t.w,e},t.inverseSafe=function(e,t){var i=t.x,n=t.y,r=t.z,s=t.w;return Math.abs(i)0&&(a=1/Math.sqrt(a),e.x=i*a,e.y=n*a,e.z=r*a,e.w=s*a),e},t.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},t.lerp=function(e,t,i,n){return e.x=t.x+n*(i.x-t.x),e.y=t.y+n*(i.y-t.y),e.z=t.z+n*(i.z-t.z),e.w=t.w+n*(i.w-t.w),e},t.random=function(e,t){t=t||1;var i=2*bi()*Math.PI,n=2*bi()-1,r=Math.sqrt(1-n*n);return e.x=r*Math.cos(i)*t,e.y=r*Math.sin(i)*t,e.z=n*t,e.w=0,e},t.transformMat4=function(e,t,i){var n=t.x,r=t.y,s=t.z,a=t.w;return e.x=i.m00*n+i.m04*r+i.m08*s+i.m12*a,e.y=i.m01*n+i.m05*r+i.m09*s+i.m13*a,e.z=i.m02*n+i.m06*r+i.m10*s+i.m14*a,e.w=i.m03*n+i.m07*r+i.m11*s+i.m15*a,e},t.transformAffine=function(e,t,i){var n=t.x,r=t.y,s=t.z,a=t.w;return e.x=i.m00*n+i.m04*r+i.m08*s+i.m12*a,e.y=i.m01*n+i.m05*r+i.m09*s+i.m13*a,e.z=i.m02*n+i.m06*r+i.m10*s+i.m14*a,e.w=t.w,e},t.transformQuat=function(e,t,i){var n=t.x,r=t.y,s=t.z,a=i.x,o=i.y,u=i.z,h=i.w,c=h*n+o*s-u*r,l=h*r+u*n-a*s,_=h*s+a*r-o*n,f=-a*n-o*r-u*s;return e.x=c*h+f*-a+l*-u-_*-o,e.y=l*h+f*-o+_*-a-c*-u,e.z=_*h+f*-u+c*-o-l*-a,e.w=t.w,e},t.toArray=function(e,t,i){return void 0===i&&(i=0),e[i+0]=t.x,e[i+1]=t.y,e[i+2]=t.z,e[i+3]=t.w,e},t.fromArray=function(e,t,i){return void 0===i&&(i=0),e.x=t[i+0],e.y=t[i+1],e.z=t[i+2],e.w=t[i+3],e},t.strictEquals=function(e,t){return e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},t.equals=function(e,t,i){return void 0===i&&(i=gi),Math.abs(e.x-t.x)<=i*Math.max(1,Math.abs(e.x),Math.abs(t.x))&&Math.abs(e.y-t.y)<=i*Math.max(1,Math.abs(e.y),Math.abs(t.y))&&Math.abs(e.z-t.z)<=i*Math.max(1,Math.abs(e.z),Math.abs(t.z))&&Math.abs(e.w-t.w)<=i*Math.max(1,Math.abs(e.w),Math.abs(t.w))};var i=t.prototype;return i.clone=function(){return new t(this.x,this.y,this.z,this.w)},i.set=function(e,t,i,n){return e&&"object"==typeof e?(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w):(this.x=e||0,this.y=t||0,this.z=i||0,this.w=n||0),this},i.equals=function(e,t){return void 0===t&&(t=gi),Math.abs(this.x-e.x)<=t*Math.max(1,Math.abs(this.x),Math.abs(e.x))&&Math.abs(this.y-e.y)<=t*Math.max(1,Math.abs(this.y),Math.abs(e.y))&&Math.abs(this.z-e.z)<=t*Math.max(1,Math.abs(this.z),Math.abs(e.z))&&Math.abs(this.w-e.w)<=t*Math.max(1,Math.abs(this.w),Math.abs(e.w))},i.equals4f=function(e,t,i,n,r){return void 0===r&&(r=gi),Math.abs(this.x-e)<=r*Math.max(1,Math.abs(this.x),Math.abs(e))&&Math.abs(this.y-t)<=r*Math.max(1,Math.abs(this.y),Math.abs(t))&&Math.abs(this.z-i)<=r*Math.max(1,Math.abs(this.z),Math.abs(i))&&Math.abs(this.w-n)<=r*Math.max(1,Math.abs(this.w),Math.abs(n))},i.strictEquals=function(e){return this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},i.strictEquals4f=function(e,t,i,n){return this.x===e&&this.y===t&&this.z===i&&this.w===n},i.lerp=function(e,t){var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+t*(e.x-i),this.y=n+t*(e.y-n),this.z=r+t*(e.z-r),this.w=s+t*(e.w-s),this},i.toString=function(){return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.z.toFixed(2)+", "+this.w.toFixed(2)+")"},i.clampf=function(e,t){return this.x=yi(this.x,e.x,t.x),this.y=yi(this.y,e.y,t.y),this.z=yi(this.z,e.z,t.z),this.w=yi(this.w,e.w,t.w),this},i.add=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},i.add4f=function(e,t,i,n){return this.x+=e,this.y+=t,this.z+=i,this.w+=n,this},i.subtract=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},i.subtract4f=function(e,t,i,n){return this.x-=e,this.y-=t,this.z-=i,this.w-=n,this},i.multiplyScalar=function(e){return"object"==typeof e&&console.warn("should use Vec4.multiply for vector * vector operation"),this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},i.multiply=function(e){return"object"!=typeof e&&console.warn("should use Vec4.scale for vector * scalar operation"),this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},i.multiply4f=function(e,t,i,n){return this.x*=e,this.y*=t,this.z*=i,this.w*=n,this},i.divide=function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this},i.divide4f=function(e,t,i,n){return this.x/=e,this.y/=t,this.z/=i,this.w/=n,this},i.negative=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},i.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},i.cross=function(e){var t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,a=e.z;return this.x=i*a-n*s,this.y=n*r-t*a,this.z=t*s-i*r,this},i.length=function(){var e=this.x,t=this.y,i=this.z,n=this.w;return Math.sqrt(e*e+t*t+i*i+n*n)},i.lengthSqr=function(){var e=this.x,t=this.y,i=this.z,n=this.w;return e*e+t*t+i*i+n*n},i.normalize=function(){var e=this.x,t=this.y,i=this.z,n=this.w,r=e*e+t*t+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=e*r,this.y=t*r,this.z=i*r,this.w=n*r),this},i.transformMat4=function(e){var t=this.x,i=this.y,n=this.z,r=this.w;return this.x=e.m00*t+e.m04*i+e.m08*n+e.m12*r,this.y=e.m01*t+e.m05*i+e.m09*n+e.m13*r,this.z=e.m02*t+e.m06*i+e.m10*n+e.m14*r,this.w=e.m03*t+e.m07*i+e.m11*n+e.m15*r,this},t}(yt));function an(e,t,i,n){return new sn(e,t,i,n)}sn.ZERO=Object.freeze(new sn(0,0,0,0)),sn.ONE=Object.freeze(new sn(1,1,1,1)),sn.NEG_ONE=Object.freeze(new sn(-1,-1,-1,-1)),li.fastDefine("cc.Vec4",sn,{x:0,y:0,z:0,w:0}),R.Vec4=sn,R.v4=an,ie(en,"Vec2",[{name:"sub",newName:"subtract",target:en,targetName:"Vec2"},{name:"mul",newName:"multiply",target:en,targetName:"Vec2"},{name:"div",newName:"divide",target:en,targetName:"Vec2"},{name:"dist",newName:"distance",target:en,targetName:"Vec2"},{name:"sqrDist",newName:"squaredDistance",target:en,targetName:"Vec2"},{name:"mag",newName:"len",target:en,targetName:"Vec2"},{name:"sqrMag",newName:"lengthSqr",target:en,targetName:"Vec2"},{name:"scale",newName:"multiplyScalar",target:en,targetName:"Vec2"},{name:"exactEquals",newName:"strictEquals",target:en,targetName:"Vec2"}]),ie(en.prototype,"Vec2",[{name:"mag",newName:"length",target:en.prototype,targetName:"Vec2"},{name:"magSqr",newName:"lengthSqr",target:en.prototype,targetName:"Vec2"},{name:"scale",newName:"multiplyScalar",target:en.prototype,targetName:"Vec2"},{name:"exactEquals",newName:"strictEquals",target:en.prototype,targetName:"Vec2"}]),ie(Di,"Vec3",[{name:"sub",newName:"subtract",target:Di,targetName:"Vec3"},{name:"mul",newName:"multiply",target:Di,targetName:"Vec3"},{name:"div",newName:"divide",target:Di,targetName:"Vec3"},{name:"dist",newName:"distance",target:Di,targetName:"Vec3"},{name:"sqrDist",newName:"squaredDistance",target:Di,targetName:"Vec3"},{name:"mag",newName:"len",target:Di,targetName:"Vec3"},{name:"sqrMag",newName:"lengthSqr",target:Di,targetName:"Vec3"},{name:"scale",newName:"multiplyScalar",target:Di,targetName:"Vec3"},{name:"exactEquals",newName:"strictEquals",target:Di,targetName:"Vec3"}]),ie(Di.prototype,"Vec3",[{name:"mag",newName:"length",target:Di.prototype,targetName:"Vec3"},{name:"magSqr",newName:"lengthSqr",target:Di.prototype,targetName:"Vec3"},{name:"scale",newName:"multiplyScalar",target:Di.prototype,targetName:"Vec3"},{name:"exactEquals",newName:"strictEquals",target:Di.prototype,targetName:"Vec3"}]),ie(sn,"Vec4",[{name:"sub",newName:"subtract",target:sn,targetName:"Vec4"},{name:"mul",newName:"multiply",target:sn,targetName:"Vec4"},{name:"div",newName:"divide",target:sn,targetName:"Vec4"},{name:"dist",newName:"distance",target:sn,targetName:"Vec4"},{name:"sqrDist",newName:"squaredDistance",target:sn,targetName:"Vec4"},{name:"mag",newName:"len",target:sn,targetName:"Vec4"},{name:"sqrMag",newName:"lengthSqr",target:sn,targetName:"Vec4"},{name:"scale",newName:"multiplyScalar",target:sn,targetName:"Vec4"},{name:"exactEquals",newName:"strictEquals",target:sn,targetName:"Vec4"}]),ie(sn.prototype,"Vec4",[{name:"mag",newName:"length",target:sn.prototype,targetName:"Vec4"},{name:"magSqr",newName:"lengthSqr",target:sn.prototype,targetName:"Vec4"},{name:"scale",newName:"multiplyScalar",target:sn.prototype,targetName:"Vec4"},{name:"exactEquals",newName:"strictEquals",target:sn.prototype,targetName:"Vec4"}]),ie(Hi,"Quat",[{name:"mag",newName:"len",target:Hi,targetName:"Quat"},{name:"mul",newName:"multiply",target:Hi,targetName:"Quat"},{name:"sqrMag",newName:"lengthSqr",target:Hi,targetName:"Quat"},{name:"scale",newName:"multiplyScalar",target:Hi,targetName:"Quat"},{name:"exactEquals",newName:"strictEquals",target:Hi,targetName:"Quat"}]),ie(Hi.prototype,"Quat",[{name:"scale",newName:"multiplyScalar",target:Hi.prototype,targetName:"Quat"},{name:"exactEquals",newName:"strictEquals",target:Hi.prototype,targetName:"Quat"}]),ie(Fi,"Color",[{name:"sub",newName:"subtract",target:Fi,targetName:"Color"},{name:"mul",newName:"multiply",target:Fi,targetName:"Color"},{name:"div",newName:"divide",target:Fi,targetName:"Color"},{name:"exactEquals",newName:"strictEquals",target:Fi,targetName:"Color"},{name:"fromHex",newName:"fromHEX",customFunction:function(){for(var e=arguments.length,t=new Array(e),i=0;i=e.x&&this.y<=e.y&&this.y+this.height>=e.y},i.containsRect=function(e){return this.x<=e.x&&this.x+this.width>=e.x+e.width&&this.y<=e.y&&this.y+this.height>=e.y+e.height},i.transformMat4=function(e){var t=this.x,i=this.y,n=t+this.width,r=i+this.height,s=e.m00*t+e.m04*i+e.m12,a=e.m01*t+e.m05*i+e.m13,o=e.m00*n+e.m04*i+e.m12,u=e.m01*n+e.m05*i+e.m13,h=e.m00*t+e.m04*r+e.m12,c=e.m01*t+e.m05*r+e.m13,l=e.m00*n+e.m04*r+e.m12,_=e.m01*n+e.m05*r+e.m13,f=Math.min(s,o,h,l),d=Math.max(s,o,h,l),p=Math.min(a,u,c,_),m=Math.max(a,u,c,_);return this.x=f,this.y=p,this.width=d-f,this.height=m-p,this},i.transformMat4ToPoints=function(e,t,i,n,r){var s=this.x,a=this.y,o=s+this.width,u=a+this.height;t.x=e.m00*s+e.m04*a+e.m12,t.y=e.m01*s+e.m05*a+e.m13,r.x=e.m00*o+e.m04*a+e.m12,r.y=e.m01*o+e.m05*a+e.m13,i.x=e.m00*s+e.m04*u+e.m12,i.y=e.m01*s+e.m05*u+e.m13,n.x=e.m00*o+e.m04*u+e.m12,n.y=e.m01*o+e.m05*u+e.m13},c(t,[{key:"xMin",get:function(){return this.x},set:function(e){this.width+=this.x-e,this.x=e}},{key:"yMin",get:function(){return this.y},set:function(e){this.height+=this.y-e,this.y=e}},{key:"xMax",get:function(){return this.x+this.width},set:function(e){this.width=e-this.x}},{key:"yMax",get:function(){return this.y+this.height},set:function(e){this.height=e-this.y}},{key:"center",get:function(){return new en(this.x+.5*this.width,this.y+.5*this.height)},set:function(e){this.x=e.x-.5*this.width,this.y=e.y-.5*this.height}},{key:"origin",get:function(){return new en(this.x,this.y)},set:function(e){this.x=e.x,this.y=e.y}},{key:"size",get:function(){return new un(this.width,this.height)},set:function(e){this.width=e.width,this.height=e.height}},{key:"z",get:function(){return this.width},set:function(e){this.width=e}},{key:"w",get:function(){return this.height},set:function(e){this.height=e}}]),t}(yt));function ln(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),new cn(e,t,i,n)}li.fastDefine("cc.Rect",cn,{x:0,y:0,width:0,height:0}),R.Rect=cn,R.rect=ln;var _n,fn,dn,pn,mn,gn,vn,yn,En,Tn,An,Sn,bn,wn,Rn,In,On,Nn,Cn,Mn,xn,Fn,Pn,Dn,Ln,Bn,Un,Gn,zn,kn,Hn,Vn,Wn,jn,Xn,Yn,qn,Kn,Qn,Zn,Jn,$n,er,tr,ir=e("J",Float64Array),nr=(e("K",function(e){function t(){return e.apply(this,arguments)||this}return _(t,e),t.createFloatArray=function(e){return new ir(e)},c(t,[{key:"array",get:function(){return this._array}}]),t}(yt)),new(function(){function e(){this._finalizationRegistry=null,this._gcObjects=new WeakMap}var t=e.prototype;return t.registerGCObject=function(e){return e},t.init=function(){},t.finalizationRegistryCallback=function(e){var t=this._gcObjects.get(e);t&&(this._gcObjects.delete(e),t.destroy()),this._finalizationRegistry.unregister(e)},t.destroy=function(){},e}())),rr=function(){function e(){return nr.registerGCObject(this)}return e.prototype.destroy=function(){},e}(),sr=function(e,t,i){for(var n=0;n0&&0==(e&e-1)}function gs(e,t,i,n){if(!ls[e].isCompressed)return t*i*n*ls[e].size;switch(e){case gn.BC1:case gn.BC1_ALPHA:case gn.BC1_SRGB:case gn.BC1_SRGB_ALPHA:return Math.ceil(t/4)*Math.ceil(i/4)*8*n;case gn.BC2:case gn.BC2_SRGB:case gn.BC3:case gn.BC3_SRGB:case gn.BC4:case gn.BC4_SNORM:case gn.BC6H_SF16:case gn.BC6H_UF16:case gn.BC7:case gn.BC7_SRGB:return Math.ceil(t/4)*Math.ceil(i/4)*16*n;case gn.BC5:case gn.BC5_SNORM:return Math.ceil(t/4)*Math.ceil(i/4)*32*n;case gn.ETC_RGB8:case gn.ETC2_RGB8:case gn.ETC2_SRGB8:case gn.ETC2_RGB8_A1:case gn.EAC_R11:case gn.EAC_R11SN:return Math.ceil(t/4)*Math.ceil(i/4)*8*n;case gn.ETC2_RGBA8:case gn.ETC2_SRGB8_A1:case gn.EAC_RG11:case gn.EAC_RG11SN:return Math.ceil(t/4)*Math.ceil(i/4)*16*n;case gn.PVRTC_RGB2:case gn.PVRTC_RGBA2:case gn.PVRTC2_2BPP:return Math.ceil(t/8)*Math.ceil(i/4)*8*n;case gn.PVRTC_RGB4:case gn.PVRTC_RGBA4:case gn.PVRTC2_4BPP:return Math.ceil(t/4)*Math.ceil(i/4)*8*n;case gn.ASTC_RGBA_4X4:case gn.ASTC_SRGBA_4X4:return Math.ceil(t/4)*Math.ceil(i/4)*16*n;case gn.ASTC_RGBA_5X4:case gn.ASTC_SRGBA_5X4:return Math.ceil(t/5)*Math.ceil(i/4)*16*n;case gn.ASTC_RGBA_5X5:case gn.ASTC_SRGBA_5X5:return Math.ceil(t/5)*Math.ceil(i/5)*16*n;case gn.ASTC_RGBA_6X5:case gn.ASTC_SRGBA_6X5:return Math.ceil(t/6)*Math.ceil(i/5)*16*n;case gn.ASTC_RGBA_6X6:case gn.ASTC_SRGBA_6X6:return Math.ceil(t/6)*Math.ceil(i/6)*16*n;case gn.ASTC_RGBA_8X5:case gn.ASTC_SRGBA_8X5:return Math.ceil(t/8)*Math.ceil(i/5)*16*n;case gn.ASTC_RGBA_8X6:case gn.ASTC_SRGBA_8X6:return Math.ceil(t/8)*Math.ceil(i/6)*16*n;case gn.ASTC_RGBA_8X8:case gn.ASTC_SRGBA_8X8:return Math.ceil(t/8)*Math.ceil(i/8)*16*n;case gn.ASTC_RGBA_10X5:case gn.ASTC_SRGBA_10X5:return Math.ceil(t/10)*Math.ceil(i/5)*16*n;case gn.ASTC_RGBA_10X6:case gn.ASTC_SRGBA_10X6:return Math.ceil(t/10)*Math.ceil(i/6)*16*n;case gn.ASTC_RGBA_10X8:case gn.ASTC_SRGBA_10X8:return Math.ceil(t/10)*Math.ceil(i/8)*16*n;case gn.ASTC_RGBA_10X10:case gn.ASTC_SRGBA_10X10:return Math.ceil(t/10)*Math.ceil(i/10)*16*n;case gn.ASTC_RGBA_12X10:case gn.ASTC_SRGBA_12X10:return Math.ceil(t/12)*Math.ceil(i/10)*16*n;case gn.ASTC_RGBA_12X12:case gn.ASTC_SRGBA_12X12:return Math.ceil(t/12)*Math.ceil(i/12)*16*n;default:return 0}}function vs(e,t,i,n,r){for(var s=0,a=0;a>1,1),i=Math.max(i>>1,1);return s}var ys=[0,4,8,12,16,4,8,12,16,4,8,12,16,4,8,12,16,16,24,32,24,36,48,32,48,64,4,4,4,4,4,4];function Es(e){return ys[e]||0}function Ts(e){if(e.isCompressed)return Uint8Array;var t=e.size/e.count;switch(e.type){case vn.UNORM:case vn.UINT:switch(t){case 1:return Uint8Array;case 2:return Uint16Array;case 4:return Uint32Array;default:return Uint8Array}case vn.SNORM:case vn.INT:switch(t){case 1:return Int8Array;case 2:return Int16Array;case 4:return Int32Array;default:return Int8Array}case vn.FLOAT:return Float32Array}return Float32Array}function As(e){switch(e){case gn.BC1:case gn.BC1_ALPHA:case gn.BC1_SRGB:case gn.BC1_SRGB_ALPHA:case gn.BC2:case gn.BC2_SRGB:case gn.BC3:case gn.BC3_SRGB:case gn.BC4:case gn.BC4_SNORM:case gn.BC6H_SF16:case gn.BC6H_UF16:case gn.BC7:case gn.BC7_SRGB:case gn.BC5:case gn.BC5_SNORM:case gn.ETC_RGB8:case gn.ETC2_RGB8:case gn.ETC2_SRGB8:case gn.ETC2_RGB8_A1:case gn.EAC_R11:case gn.EAC_R11SN:case gn.ETC2_RGBA8:case gn.ETC2_SRGB8_A1:case gn.EAC_RG11:case gn.EAC_RG11SN:return{width:4,height:4};case gn.PVRTC_RGB2:case gn.PVRTC_RGBA2:case gn.PVRTC2_2BPP:return{width:8,height:4};case gn.PVRTC_RGB4:case gn.PVRTC_RGBA4:case gn.PVRTC2_4BPP:return{width:4,height:4};case gn.ASTC_RGBA_4X4:case gn.ASTC_SRGBA_4X4:return{width:4,height:4};case gn.ASTC_RGBA_5X4:case gn.ASTC_SRGBA_5X4:return{width:5,height:4};case gn.ASTC_RGBA_5X5:case gn.ASTC_SRGBA_5X5:return{width:5,height:5};case gn.ASTC_RGBA_6X5:case gn.ASTC_SRGBA_6X5:return{width:6,height:5};case gn.ASTC_RGBA_6X6:case gn.ASTC_SRGBA_6X6:return{width:6,height:6};case gn.ASTC_RGBA_8X5:case gn.ASTC_SRGBA_8X5:return{width:8,height:5};case gn.ASTC_RGBA_8X6:case gn.ASTC_SRGBA_8X6:return{width:8,height:6};case gn.ASTC_RGBA_8X8:case gn.ASTC_SRGBA_8X8:return{width:8,height:8};case gn.ASTC_RGBA_10X5:case gn.ASTC_SRGBA_10X5:return{width:10,height:5};case gn.ASTC_RGBA_10X6:case gn.ASTC_SRGBA_10X6:return{width:10,height:6};case gn.ASTC_RGBA_10X8:case gn.ASTC_SRGBA_10X8:return{width:10,height:8};case gn.ASTC_RGBA_10X10:case gn.ASTC_SRGBA_10X10:return{width:10,height:10};case gn.ASTC_RGBA_12X10:case gn.ASTC_SRGBA_12X10:return{width:12,height:10};case gn.ASTC_RGBA_12X12:case gn.ASTC_SRGBA_12X12:return{width:12,height:12};default:return{width:1,height:1}}}function Ss(e,t){return Math.ceil(e/t)*t}var bs=Object.freeze({__proto__:null,get ObjectType(){return _n},get Status(){return fn},get API(){return dn},get SurfaceTransform(){return pn},get Feature(){return mn},get Format(){return gn},get FormatType(){return vn},get Type(){return yn},get BufferUsageBit(){return En},get BufferFlagBit(){return Tn},get MemoryAccessBit(){return An},get MemoryUsageBit(){return Sn},get TextureType(){return bn},get TextureUsageBit(){return wn},get TextureFlagBit(){return Rn},get FormatFeatureBit(){return In},get SampleCount(){return On},get VsyncMode(){return Nn},get Filter(){return Cn},get Address(){return Mn},get ComparisonFunc(){return xn},get StencilOp(){return Fn},get BlendFactor(){return Pn},get BlendOp(){return Dn},get ColorMask(){return Ln},get ShaderStageFlagBit(){return Bn},get LoadOp(){return Un},get StoreOp(){return Gn},get AccessFlagBit(){return zn},get ResolveMode(){return kn},get PipelineBindPoint(){return Hn},get PrimitiveMode(){return Vn},get PolygonMode(){return Wn},get ShadeModel(){return jn},get CullMode(){return Xn},get DynamicStateFlagBit(){return Yn},get StencilFace(){return qn},get DescriptorType(){return Kn},get QueueType(){return Qn},get QueryType(){return Zn},get CommandBufferType(){return Jn},get ClearFlagBit(){return $n},get BarrierType(){return er},get PassType(){return tr},Size:or,DeviceCaps:ur,DeviceOptions:hr,Offset:cr,Rect:lr,Extent:_r,TextureSubresLayers:fr,TextureSubresRange:dr,TextureCopy:pr,TextureBlit:mr,BufferTextureCopy:gr,Viewport:vr,Color:yr,BindingMappingInfo:Er,SwapchainInfo:Tr,DeviceInfo:Ar,BufferInfo:Sr,BufferViewInfo:br,DrawInfo:wr,DispatchInfo:Rr,IndirectBuffer:Ir,TextureInfo:Or,TextureViewInfo:Nr,SamplerInfo:Cr,Uniform:Mr,UniformBlock:xr,UniformSamplerTexture:Fr,UniformSampler:Pr,UniformTexture:Dr,UniformStorageImage:Lr,UniformStorageBuffer:Br,UniformInputAttachment:Ur,ShaderStage:Gr,Attribute:zr,ShaderInfo:kr,InputAssemblerInfo:Hr,ColorAttachment:Vr,DepthStencilAttachment:Wr,SubpassInfo:jr,SubpassDependency:Xr,RenderPassInfo:Yr,GeneralBarrierInfo:qr,TextureBarrierInfo:Kr,BufferBarrierInfo:Qr,FramebufferInfo:Zr,DescriptorSetLayoutBinding:Jr,DescriptorSetLayoutInfo:$r,DescriptorSetInfo:es,PipelineLayoutInfo:ts,InputState:is,CommandBufferInfo:ns,QueueInfo:rs,QueryPoolInfo:ss,FormatInfo:as,MemoryStatus:os,DynamicStencilStates:us,DynamicStates:hs,GFXObject:cs,get AttributeName(){return ar},FormatInfos:ls,DESCRIPTOR_BUFFER_TYPE:_s,DESCRIPTOR_SAMPLER_TYPE:fs,DESCRIPTOR_DYNAMIC_TYPE:ds,DRAW_INFO_SIZE:ps,IsPowerOf2:ms,FormatSize:gs,FormatSurfaceSize:vs,GetTypeSize:Es,getTypedArrayConstructor:Ts,formatAlignment:As,alignTo:Ss}),ws=e("T",function(e){function t(){var t;return(t=e.call(this,_n.BUFFER)||this)._usage=En.NONE,t._memUsage=Sn.NONE,t._size=0,t._stride=1,t._count=0,t._flags=Tn.NONE,t._isBufferView=!1,t}return _(t,e),c(t,[{key:"usage",get:function(){return this._usage}},{key:"memUsage",get:function(){return this._memUsage}},{key:"size",get:function(){return this._size}},{key:"stride",get:function(){return this._stride}},{key:"count",get:function(){return this._count}},{key:"flags",get:function(){return this._flags}}]),t}(cs)),Rs=e("U",function(e){function t(){var t;return(t=e.call(this,_n.COMMAND_BUFFER)||this)._queue=null,t._type=Jn.PRIMARY,t._numDrawCalls=0,t._numInstances=0,t._numTris=0,t}return _(t,e),c(t,[{key:"type",get:function(){return this._type}},{key:"queue",get:function(){return this._queue}},{key:"numDrawCalls",get:function(){return this._numDrawCalls}},{key:"numInstances",get:function(){return this._numInstances}},{key:"numTris",get:function(){return this._numTris}}]),t}(cs)),Is=e("bJ",function(){function e(){this._gfxAPI=dn.UNKNOWN,this._renderer="",this._vendor="",this._features=new Array(mn.COUNT),this._formatFeatures=new Array(gn.COUNT),this._queue=null,this._cmdBuff=null,this._numDrawCalls=0,this._numInstances=0,this._numTris=0,this._memoryStatus=new os,this._caps=new ur,this._bindingMappingInfo=new Er,this._samplers=new Map,this._generalBarrierss=new Map,this._textureBarriers=new Map,this._bufferBarriers=new Map}var t=e.prototype;return t.hasFeature=function(e){return this._features[e]},t.getFormatFeatures=function(e){return this._formatFeatures[e]},c(e,[{key:"gfxAPI",get:function(){return this._gfxAPI}},{key:"queue",get:function(){return this._queue}},{key:"commandBuffer",get:function(){return this._cmdBuff}},{key:"renderer",get:function(){return this._renderer}},{key:"vendor",get:function(){return this._vendor}},{key:"numDrawCalls",get:function(){return this._numDrawCalls}},{key:"numInstances",get:function(){return this._numInstances}},{key:"numTris",get:function(){return this._numTris}},{key:"memoryStatus",get:function(){return this._memoryStatus}},{key:"capabilities",get:function(){return this._caps}},{key:"bindingMappingInfo",get:function(){return this._bindingMappingInfo}}]),e}());Is.canvas=void 0;var Os=e("bK",function(e){function t(){var t;return(t=e.call(this,_n.SWAPCHAIN)||this)._transform=pn.IDENTITY,t._colorTexture=null,t._depthStencilTexture=null,t}return _(t,e),c(t,[{key:"colorTexture",get:function(){return this._colorTexture}},{key:"depthStencilTexture",get:function(){return this._depthStencilTexture}},{key:"surfaceTransform",get:function(){return this._transform}},{key:"width",get:function(){return this._colorTexture.width}},{key:"height",get:function(){return this._colorTexture.height}}]),t}(cs)),Ns=e("bL",function(e){function t(){var t;return(t=e.call(this,_n.FRAMEBUFFER)||this)._renderPass=null,t._colorTextures=[],t._depthStencilTexture=null,t}return _(t,e),c(t,[{key:"renderPass",get:function(){return this._renderPass}},{key:"colorTextures",get:function(){return this._colorTextures}},{key:"depthStencilTexture",get:function(){return this._depthStencilTexture}}]),t}(cs)),Cs=String.prototype.charCodeAt;function Ms(e){return this[e]}function xs(e,t){for(var i=e.length,n=t^i,r=0,s="string"==typeof e?Cs:Ms;i>=4;){var a=255&s.call(e,r)|(255&s.call(e,++r))<<8|(255&s.call(e,++r))<<16|(255&s.call(e,++r))<<24;a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),i-=4,++r}switch(i){case 3:n^=(255&s.call(e,r+2))<<16;case 2:n^=(255&s.call(e,r+1))<<8;case 1:n=1540483477*(65535&(n^=255&s.call(e,r)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}var Fs=e("bM",function(e){function t(){var t;return(t=e.call(this,_n.INPUT_ASSEMBLER)||this)._attributes=[],t._attributesHash=0,t._vertexBuffers=[],t._indexBuffer=null,t._indirectBuffer=null,t._drawInfo=new wr,t}_(t,e);var i=t.prototype;return i.getVertexBuffer=function(e){return void 0===e&&(e=0),e=0){var o=this._colorInfos[i.depthStencil];e+="ds,"+o.format+","+o.sampleCount}}else{e+="ca";for(var u=0;u>0,t.magFilter=(3&e)>>2,t.mipFilter=(3&e)>>4,t.addressU=(3&e)>>6,t.addressV=(3&e)>>8,t.addressW=(3&e)>>10,t.maxAnisotropy=(15&e)>>12,t.cmpFunc=(7&e)>>16,t},c(t,[{key:"info",get:function(){return this._info}},{key:"hash",get:function(){return this._hash}}]),t}(cs)),Xs=e("bY",function(e){function t(){var t;return(t=e.call(this,_n.SHADER)||this)._name="",t._stages=[],t._attributes=[],t._blocks=[],t._samplers=[],t}return _(t,e),c(t,[{key:"name",get:function(){return this._name}},{key:"attributes",get:function(){return this._attributes}},{key:"blocks",get:function(){return this._blocks}},{key:"samplers",get:function(){return this._samplers}}]),t}(cs)),Ys=e("bZ",function(e){function t(){var t;return(t=e.call(this,_n.TEXTURE)||this)._info=new Or,t._viewInfo=new Nr,t._isPowerOf2=!1,t._isTextureView=!1,t._size=0,t}return _(t,e),t.getLevelCount=function(e,t){return Math.floor(Math.log2(Math.max(e,t)))},c(t,[{key:"type",get:function(){return this._info.type}},{key:"usage",get:function(){return this._info.usage}},{key:"format",get:function(){return this._info.format}},{key:"width",get:function(){return this._info.width}},{key:"height",get:function(){return this._info.height}},{key:"depth",get:function(){return this._info.depth}},{key:"layerCount",get:function(){return this._info.layerCount}},{key:"levelCount",get:function(){return this._info.levelCount}},{key:"samples",get:function(){return this._info.samples}},{key:"flags",get:function(){return this._info.flags}},{key:"size",get:function(){return this._size}},{key:"info",get:function(){return this._info}},{key:"viewInfo",get:function(){return this._viewInfo}},{key:"isTextureView",get:function(){return this._isTextureView}}]),t}(cs)),qs=e("b_",function(e){function t(t,i){var n;return(n=e.call(this,_n.GLOBAL_BARRIER)||this)._info=new qr,n._hash=0,n._info.copy(t),n._hash=i,n}return _(t,e),t.computeHash=function(e){return xs(e.prevAccesses+" "+e.nextAccesses+" "+e.type,666)},c(t,[{key:"info",get:function(){return this._info}},{key:"hash",get:function(){return this._hash}}]),t}(cs)),Ks=e("b$",function(e){function t(t,i){var n;return(n=e.call(this,_n.TEXTURE_BARRIER)||this)._info=new Kr,n._hash=0,n._info.copy(t),n._hash=i,n}return _(t,e),t.computeHash=function(e){var t=e.prevAccesses+" "+e.nextAccesses;return t+=e.type,t+=e.baseMipLevel,t+=e.levelCount,t+=e.baseSlice,t+=e.sliceCount,t+=e.discardContents,t+=e.srcQueue?e.srcQueue.type:0,xs(t+=e.dstQueue?e.dstQueue.type:0,666)},c(t,[{key:"info",get:function(){return this._info}},{key:"hash",get:function(){return this._hash}}]),t}(cs)),Qs=e("g4",function(e){function t(t,i){var n;return(n=e.call(this,_n.BUFFER_BARRIER)||this)._info=new Qr,n._hash=0,n._info.copy(t),n._hash=i,n}return _(t,e),t.computeHash=function(e){var t=e.prevAccesses+" "+e.nextAccesses;return t+=e.type,t+=e.offset,t+=e.size,t+=e.discardContents,t+=e.srcQueue?e.srcQueue.type:0,xs(t+=e.dstQueue?e.dstQueue.type:0,666)},c(t,[{key:"info",get:function(){return this._info}},{key:"hash",get:function(){return this._hash}}]),t}(cs)),Zs={Device:Is,Swapchain:Os,Buffer:ws,Texture:Ys,Sampler:js,Shader:Xs,InputAssembler:Fs,RenderPass:Ws,Framebuffer:Ns,DescriptorSet:Ps,DescriptorSetLayout:Ds,PipelineLayout:Ls,PipelineState:Hs,CommandBuffer:Rs,Queue:Vs,GeneralBarrier:qs,TextureBarrier:Ks,BufferBarrier:Qs,RasterizerState:Bs,BlendState:zs,BlendTarget:Gs,DepthStencilState:Us,PipelineStateInfo:ks};Object.assign(Zs,bs),R.gfx=Zs;var Js={GFXDevice:!0,GFXBuffer:!0,GFXTexture:!0,GFXSampler:!0,GFXShader:!0,GFXInputAssembler:!0,GFXRenderPass:!0,GFXFramebuffer:!0,GFXPipelineState:!0,GFXCommandBuffer:!0,GFXQueue:!0,GFXObjectType:!0,GFXObject:!1,GFXAttributeName:!0,GFXType:!0,GFXFormat:!0,GFXBufferUsageBit:!0,GFXMemoryUsageBit:!0,GFXBufferFlagBit:!0,GFXBufferAccessBit:"MemoryAccessBit",GFXPrimitiveMode:!0,GFXPolygonMode:!0,GFXShadeModel:!0,GFXCullMode:!0,GFXComparisonFunc:!0,GFXStencilOp:!0,GFXBlendOp:!0,GFXBlendFactor:!0,GFXColorMask:!0,GFXFilter:!0,GFXAddress:!0,GFXTextureType:!0,GFXTextureUsageBit:!0,GFXSampleCount:!0,GFXTextureFlagBit:!0,GFXShaderStageFlagBit:!0,GFXDescriptorType:!0,GFXCommandBufferType:!0,GFXLoadOp:!0,GFXStoreOp:!0,GFXPipelineBindPoint:!0,GFXDynamicStateFlagBit:!0,GFXStencilFace:!0,GFXQueueType:!0,GFXRect:!0,GFXViewport:!0,GFXColor:!0,GFXClearFlag:!0,GFXOffset:!0,GFXExtent:!0,GFXTextureSubres:"TextureSubresLayers",GFXTextureCopy:!0,GFXBufferTextureCopy:!0,GFXFormatType:!0,GFXFormatInfo:!0,GFXMemoryStatus:!0,GFXFormatInfos:!0,GFXFormatSize:!0,GFXFormatSurfaceSize:!0,GFXGetTypeSize:!0,getTypedArrayConstructor:!1};for(var $s in Js){var ea=Js[$s];!0===ea?ea=$s.slice(3):!1===ea&&(ea=$s),ie(R,"cc",[{name:$s,newName:ea,target:R.gfx,targetName:"cc.gfx"}])}ne(R,"cc",[{name:"GFX_MAX_VERTEX_ATTRIBUTES"},{name:"GFX_MAX_TEXTURE_UNITS"},{name:"GFX_MAX_ATTACHMENTS"},{name:"GFX_MAX_BUFFER_BINDINGS"},{name:"GFXTextureLayout"}]),ne(mn,"Feature",[{name:"COLOR_FLOAT",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.R32F) & FormatFeatureBit.RENDER_TARGET;"},{name:"COLOR_HALF_FLOAT",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.R16F) & FormatFeatureBit.RENDER_TARGET;"},{name:"TEXTURE_FLOAT",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = (device.getFormatFeatures(Format.R32F) & (FormatFeatureBit.RENDER_TARGET | FormatFeatureBit.SAMPLED_TEXTURE)) === (FormatFeatureBit.RENDER_TARGET | FormatFeatureBit.SAMPLED_TEXTURE);"},{name:"TEXTURE_HALF_FLOAT",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = (device.getFormatFeatures(Format.R16F) & (FormatFeatureBit.RENDER_TARGET | FormatFeatureBit.SAMPLED_TEXTURE)) === (FormatFeatureBit.RENDER_TARGET | FormatFeatureBit.SAMPLED_TEXTURE);"},{name:"TEXTURE_FLOAT_LINEAR",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.R32F) & FormatFeatureBit.LINEAR_FILTER;"},{name:"TEXTURE_HALF_FLOAT_LINEAR",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.R16F) & FormatFeatureBit.LINEAR_FILTER;"},{name:"FORMAT_R11G11B10F",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.R11G11B10F) !== FormatFeatureBit.NONE;"},{name:"FORMAT_SRGB",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.SRGB8) !== FormatFeatureBit.NONE;"},{name:"FORMAT_ETC1",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.ETC_RGB8) !== FormatFeatureBit.NONE;"},{name:"FORMAT_ETC2",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.ETC2_RGB8) !== FormatFeatureBit.NONE;"},{name:"FORMAT_DXT",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.BC1) !== FormatFeatureBit.NONE;"},{name:"FORMAT_PVRTC",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.PVRTC_RGB2) !== FormatFeatureBit.NONE;"},{name:"FORMAT_ASTC",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.ASTC_RGBA_4x4) !== FormatFeatureBit.NONE;"},{name:"FORMAT_RGB8",suggest:"Please use device.getFormatFeatures() instead, like: \nlet isSupported = device.getFormatFeatures(Format.RGB8) !== FormatFeatureBit.NONE;"}]),ne(Vr.prototype,"ColorAttachment",[{name:"beginAccesses",suggest:"Please assign to ColorAttachment.barrier instead"},{name:"endAccesses",suggest:"Please assign to ColorAttachment.barrier instead"}]),ne(Wr.prototype,"DepthStencilAttachment",[{name:"beginAccesses",suggest:"Please assign to DepthStencilAttachment.barrier instead"},{name:"endAccesses",suggest:"Please assign to DepthStencilAttachment.barrier instead"}]),ie(Is.prototype,"Device",[{name:"getGlobalBarrier",newName:"getGeneralBarrier"}]);var ta,ia=new(function(){function e(){this._pools=[],this._lastShrinkPassed=0,this.shrinkTimeSpan=5}var t=e.prototype;return t.addContainer=function(e){-1===e._poolHandle&&(e._poolHandle=this._pools.length,this._pools.push(e))},t.removeContainer=function(e){-1!==e._poolHandle&&(this._pools[this._pools.length-1]._poolHandle=e._poolHandle,ge(this._pools,e._poolHandle),e._poolHandle=-1)},t.tryShrink=function(){for(var e=0;ethis.shrinkTimeSpan&&(this.tryShrink(),this._lastShrinkPassed-=this.shrinkTimeSpan)},e}()),na=function(){function e(){this._poolHandle=-1,ia.addContainer(this)}return e.prototype.destroy=function(){ia.removeContainer(this)},e}(),ra=e("P",function(e){function t(t,i,n){var r;(r=e.call(this)||this)._ctor=void 0,r._elementsPerBatch=void 0,r._nextAvail=void 0,r._freepool=[],r._dtor=void 0,r._ctor=t,r._dtor=n||null,r._elementsPerBatch=Math.max(i,1),r._nextAvail=r._elementsPerBatch-1;for(var s=0;s>1>this._elementsPerBatch){if(this._dtor)for(var e=this._nextAvail>>1;e<=this._nextAvail;e++)this._dtor(this._freepool[e]);this._freepool.length=this._nextAvail>>1,this._nextAvail=this._freepool.length-1}},i.destroy=function(){var t=arguments.length>0?arguments[0]:null;t&&Y(14100);var i=t||this._dtor;if(i)for(var n=0;n<=this._nextAvail;n++)i(this._freepool[n]);this._freepool.length=0,this._nextAvail=-1,e.prototype.destroy.call(this)},t}(na)),sa=e("L",function(e){function t(t,i,n){var r;(r=e.call(this)||this)._fn=void 0,r._dtor=null,r._count=0,r._data=void 0,r._initSize=0,r._fn=t,r._dtor=n||null,r._data=new Array(i),r._initSize=i;for(var s=0;sthis._data.length)for(var t=this._data.length;t=this._data.length&&this.resize(this._data.length<<1),this._data[this._count++]},i.destroy=function(){if(this._dtor)for(var t=0;t>2>this._count){var e=Math.max(this._initSize,this._data.length>>1);if(this._dtor)for(var t=e;t=this._count)){var t=this._count-1,i=this._data[e];this._data[e]=this._data[t],this._data[t]=i,this._count-=1}},c(t,[{key:"length",get:function(){return this._count}},{key:"data",get:function(){return this._data}}]),t}(na)),aa=e("N",function(e){function t(t,i){var n;return(n=e.call(this)||this).array=void 0,n.length=0,n._compareFn=void 0,n._initSize=0,n.array=new Array(t),n._initSize=t,n.length=0,n._compareFn=i,n}_(t,e);var i=t.prototype;return i.push=function(e){this.array[this.length++]=e},i.pop=function(){return this.array[--this.length]},i.get=function(e){return this.array[e]},i.clear=function(){this.length=0},i.destroy=function(){this.length=0,this.array.length=0,e.prototype.destroy.call(this)},i.tryShrink=function(){this.array.length>>2>this.length&&(this.array.length=Math.max(this._initSize,this.array.length>>1))},i.sort=function(){this.array.length=this.length,this.array.sort(this._compareFn)},i.concat=function(e){for(var t=0;t=this.length||e<0)){var t=--this.length;this.array[e]=this.array[t]}},i.indexOf=function(e){for(var t=0,i=this.length;t=0;--e)this.callbackInfos[e]||da(this.callbackInfos,e);this.containCanceled=!1},t.clear=function(){this.cancelAll(),this.callbackInfos.length=0,this.isInvoking=!1,this.containCanceled=!1},e}(),ya=new ra((function(){return new va}),16),Ea=function(){function e(){this._callbackTable=Pe(!0),this._offCallback=void 0}var t=e.prototype;return t.on=function(e,t,i,n){if(!this.hasEventListener(e,t,i)){var r=this._callbackTable[e];r||(r=this._callbackTable[e]=ya.alloc());var s=ga.alloc();s.set(t,i,n),r.callbackInfos.push(s)}return t},t.hasEventListener=function(e,t,i){var n=this._callbackTable&&this._callbackTable[e];if(!n)return!1;var r=n.callbackInfos;if(!t){if(n.isInvoking){for(var s=0;s0}for(var a=0;a1)&&(h=!0,c="",l=0);var f=Ra.UNKNOWN;-1!==s.appVersion.indexOf("Win")?f=Ra.WINDOWS:h?f=Ra.IOS:-1!==s.appVersion.indexOf("Mac")?f=Ra.OSX:-1!==s.appVersion.indexOf("X11")&&-1===s.appVersion.indexOf("Linux")?f=Ra.LINUX:u?f=Ra.ANDROID:-1===s.appVersion.indexOf("Linux")&&-1===a.indexOf("ubuntu")||(f=Ra.LINUX),n.os=f,n.osVersion=c,n.osMainVersion=l,n.browserType=Sa.UNKNOWN;var d=/wechat|weixin|micromessenger/i.exec(a)||/mqqbrowser|micromessenger|qqbrowser|sogou|qzone|liebao|maxthon|ucbs|360 aphone|360browser|baiduboxapp|baidubrowser|maxthon|mxbrowser|miuibrowser/i.exec(a)||/qq|qqbrowser|ucbrowser|ubrowser|edge|HuaweiBrowser/i.exec(a)||/chrome|safari|firefox|trident|opera|opr\/|oupeng/i.exec(a),p=d?d[0].toLowerCase():Ra.UNKNOWN;("safari"===p&&u||"qq"===p&&/android.*applewebkit/i.test(a))&&(p=Sa.ANDROID);var m={micromessenger:Sa.WECHAT,wechat:Sa.WECHAT,weixin:Sa.WECHAT,trident:Sa.IE,edge:Sa.EDGE,"360 aphone":Sa.BROWSER_360,mxbrowser:Sa.MAXTHON,"opr/":Sa.OPERA,ubrowser:Sa.UC,huaweibrowser:Sa.HUAWEI};n.browserType=m[p]||p,n.browserVersion="";var g=/(mqqbrowser|micromessenger|qqbrowser|sogou|qzone|liebao|maxthon|uc|ucbs|360 aphone|360|baiduboxapp|baidu|maxthon|mxbrowser|miui(?:.hybrid)?)(mobile)?(browser)?\/?([\d.]+)/i.exec(a);g||(g=/(qq|chrome|safari|firefox|trident|opera|opr\/|oupeng)(mobile)?(browser)?\/?([\d.]+)/i.exec(a)),n.browserVersion=g?g[4]:"";var v,y=document.createElement("canvas");y.getContext("2d");try{v=y.toDataURL("image/webp").startsWith("data:image/webp")}catch(e){v=!1}if(n.browserType===Sa.SAFARI){var E,T=null===(E=/ version\/(\d+)/.exec(a))||void 0===E?void 0:E[1];"string"==typeof T&&Number.parseInt(T)>=14&&(v=!0)}var A=!1;"undefined"!=typeof createImageBitmap&&"undefined"!=typeof Blob&&(y.width=y.height=2,createImageBitmap(y,{}).then((function(e){A=!0,null==e||e.close()})).catch((function(){})));var S=void 0!==document.documentElement.ontouchstart||void 0!==document.ontouchstart||b,w=void 0!==document.documentElement.onmouseup||b;return n._featureMap=((i={})[Oa.WEBP]=v,i[Oa.IMAGE_BITMAP]=A,i[Oa.WEB_VIEW]=!0,i[Oa.VIDEO_PLAYER]=!0,i[Oa.SAFE_AREA]=!1,i[Oa.INPUT_TOUCH]=S,i[Oa.EVENT_KEYBOARD]=void 0!==document.documentElement.onkeyup||b,i[Oa.EVENT_MOUSE]=w,i[Oa.EVENT_TOUCH]=S||w,i[Oa.EVENT_ACCELEROMETER]=void 0!==window.DeviceMotionEvent||void 0!==window.DeviceOrientationEvent,i),n._registerEvent(),n}_(t,e);var i=t.prototype;return i._registerEvent=function(){var e,t=this;e=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":"hidden";var i=!1,n=function(){i||(i=!0,t.emit("hide"))},r=function(e,n,r,s,a){i&&(i=!1,t.emit("show",e,n,r,s,a))};if(e)for(var s=["visibilitychange","mozvisibilitychange","msvisibilitychange","webkitvisibilitychange","qbrowserVisibilityChange"],a=0;a-1&&(window.onfocus=r),"onpageshow"in window&&"onpagehide"in window&&(window.addEventListener("pagehide",n),window.addEventListener("pageshow",r),document.addEventListener("pagehide",n),document.addEventListener("pageshow",r))},i.hasFeature=function(e){return this._featureMap[e]},i.getBatteryLevel=function(){return this._battery?this._battery.level:1},i.triggerGC=function(){},i.openURL=function(e){window.open(e)},i.now=function(){return Date.now?Date.now():+new Date},i.restartJSVM=function(){},i.close=function(){this.emit("close"),window.close()},t}(Aa),xa=e("fL",new Ma);!function(e){e[e.PORTRAIT=1]="PORTRAIT",e[e.PORTRAIT_UPSIDE_DOWN=2]="PORTRAIT_UPSIDE_DOWN",e[e.LANDSCAPE_LEFT=4]="LANDSCAPE_LEFT",e[e.LANDSCAPE_RIGHT=8]="LANDSCAPE_RIGHT",e[e.LANDSCAPE=12]="LANDSCAPE",e[e.AUTO=13]="AUTO"}(Ca||(Ca={}));var Fa,Pa={auto:Ca.AUTO,landscape:Ca.LANDSCAPE,portrait:Ca.PORTRAIT};!function(e){e[e.Unknown=0]="Unknown",e[e.SubFrame=1]="SubFrame",e[e.BrowserWindow=2]="BrowserWindow",e[e.Fullscreen=3]="Fullscreen"}(Fa||(Fa={}));var Da=function(e){function t(){var t,i,n,r,s,a;(t=e.call(this)||this).isFrameRotated=!1,t.handleResizeEvent=!0,t._gameFrame=void 0,t._gameContainer=void 0,t._gameCanvas=void 0,t._isProportionalToFrame=!1,t._cachedFrameStyle={width:"0px",height:"0px"},t._cachedContainerStyle={width:"0px",height:"0px"},t._cbToUpdateFrameBuffer=void 0,t._supportFullScreen=!1,t._touchEventName=void 0,t._onFullscreenChange=void 0,t._onFullscreenError=void 0,t._orientationChangeTimeoutId=-1,t._cachedFrameSize=new un(0,0),t._exactFitScreen=!1,t._fn={},t._fnGroup=[["requestFullscreen","exitFullscreen","fullscreenchange","fullscreenEnabled","fullscreenElement","fullscreenerror"],["requestFullScreen","exitFullScreen","fullScreenchange","fullScreenEnabled","fullScreenElement","fullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange","webkitIsFullScreen","webkitCurrentFullScreenElement","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozFullScreen","mozFullScreenElement","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","MSFullscreenChange","msFullscreenEnabled","msFullscreenElement","msfullscreenerror"]],t._resolutionScale=1,t._orientation=Ca.AUTO,t._gameFrame=document.getElementById("GameDiv"),t._gameContainer=document.getElementById("Cocos3dGameContainer"),t._gameCanvas=document.getElementById("GameCanvas"),t._gameFrame||(t._gameFrame=document.createElement("div"),t._gameFrame.setAttribute("id","GameDiv"),null===(i=t._gameCanvas)||void 0===i||null===(n=i.parentNode)||void 0===n||n.insertBefore(t._gameFrame,t._gameCanvas),t._gameFrame.appendChild(t._gameCanvas)),t._gameContainer||(t._gameContainer=document.createElement("div"),t._gameContainer.setAttribute("id","Cocos3dGameContainer"),null===(r=t._gameCanvas)||void 0===r||null===(s=r.parentNode)||void 0===s||s.insertBefore(t._gameContainer,t._gameCanvas),t._gameContainer.appendChild(t._gameCanvas));for(var o=t._fnGroup,u=0;uwindow.innerHeight;this.isFrameRotated=xa.isMobile&&(t&&e===Ca.PORTRAIT||!t&&e===Ca.LANDSCAPE)},i._updateContainer=function(){if(this._gameContainer){if(this.isProportionalToFrame){if(!this._gameFrame)return void Y(9201);var e,t,i=R.view.getDesignResolutionSize(),n=this._gameFrame,r=n.clientWidth,s=n.clientHeight,a=i.width,o=i.height,u=r/a,h=s/o,c=this._gameContainer.style;u0&&Y(1400,"screen.requestFullScreen(element, onFullScreenChange?, onFullScreenError?)","screen.requestFullScreen(): Promise"),La.requestFullScreen().then((function(){null==t||t()})).catch((function(e){console.error(e),null==i||i()}))},t.exitFullScreen=function(){return La.exitFullScreen()},t.autoFullScreen=function(e,t){var i;null===(i=this.requestFullScreen(e,t))||void 0===i||i.catch((function(){}))},t.disableAutoFullScreen=function(){},c(e,[{key:"devicePixelRatio",get:function(){return La.devicePixelRatio}},{key:"windowSize",get:function(){return La.windowSize},set:function(e){La.windowSize=e}},{key:"resolution",get:function(){return La.resolution}},{key:"supportsFullScreen",get:function(){return La.supportFullScreen}}]),e}(),Ua=e("eV",new Ba);R.screen=Ua;var Ga,za,ka=e("dW",{Feature:Oa,hasFeature:function(e){return xa.hasFeature(e)},NetworkType:wa,Language:ba,OS:Ra,Platform:Ia,BrowserType:Sa,isNative:xa.isNative,isBrowser:xa.isBrowser,isMobile:xa.isMobile,isLittleEndian:xa.isLittleEndian,platform:xa.platform,language:xa.language,languageCode:xa.nativeLanguage,os:xa.os,osVersion:xa.osVersion,osMainVersion:xa.osMainVersion,browserType:xa.browserType,browserVersion:xa.browserVersion,windowPixelResolution:Ua.windowSize,capabilities:{canvas:!0,opengl:!0,webp:xa.hasFeature(Oa.WEBP),imageBitmap:xa.hasFeature(Oa.IMAGE_BITMAP),touches:xa.hasFeature(Oa.INPUT_TOUCH),mouse:xa.hasFeature(Oa.EVENT_MOUSE),keyboard:xa.hasFeature(Oa.EVENT_KEYBOARD),accelerometer:xa.hasFeature(Oa.EVENT_ACCELEROMETER)},localStorage:{},getNetworkType:function(){return xa.networkType},getBatteryLevel:function(){return xa.getBatteryLevel()},garbageCollect:function(){xa.triggerGC()},isObjectValid:function(e){return null!=e},dump:function(){var e="";e+="isMobile : "+this.isMobile+"\r\n",e+="language : "+this.language+"\r\n",e+="browserType : "+this.browserType+"\r\n",e+="browserVersion : "+this.browserVersion+"\r\n",e+="capabilities : "+JSON.stringify(this.capabilities)+"\r\n",e+="os : "+this.os+"\r\n",e+="osVersion : "+this.osVersion+"\r\n",e+="platform : "+this.platform+"\r\n",L(e+="Using "+(R.game.renderType===R.game.RENDER_TYPE_WEBGL?"WEBGL":"CANVAS")+" renderer.\r\n")},openURL:function(e){xa.openURL(e)},init:function(){try{var e=ka.localStorage=window.localStorage;e.setItem("storage",""),e.removeItem("storage"),e=null}catch(e){var t=function(){Y(5200)};this.localStorage={getItem:t,setItem:t,clear:t,removeItem:t}}this.__isWebIOS14OrIPadOS14Env=(ka.os===Ra.IOS||ka.os===Ra.OSX)&&xa.isBrowser&&/(OS 14)|(Version\/14)/.test(window.navigator.userAgent)},now:function(){return xa.now()},restartVM:function(){xa.restartJSVM()},getSafeAreaRect:function(){var e=R.view,t=La.safeAreaEdge,i=La.windowSize,n=new en(t.left,t.bottom),r=new en(i.width-t.right,i.height-t.top);e._convertToUISpace(n),e._convertToUISpace(r);var s=n.x,a=n.y,o=r.x-n.x,u=r.y-n.y;return new cn(s,a,o,u)}});R.sys=ka,function(e){e[e.AUTO=0]="AUTO",e[e.CANVAS=1]="CANVAS",e[e.WEBGL=2]="WEBGL",e[e.HEADLESS=3]="HEADLESS"}(Ga||(Ga=e("c0",{}))),function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.CANVAS=0]="CANVAS",e[e.WEBGL=1]="WEBGL",e[e.OPENGL=2]="OPENGL",e[e.HEADLESS=3]="HEADLESS"}(za||(za=e("c1",{})));var Ha=e("c2",function(){function e(){this.initialized=!1,this._canvas=null,this._renderType=za.UNKNOWN}var t=e.prototype;return t.init=function(e,t){if(!this.initialized){var i=Tt.querySettings(Et.Category.RENDERING,"renderMode");if(this._canvas=e,this._renderType=this._determineRenderType(i),this._renderType===za.WEBGL){var n=new Ar(t),r=!!window.WebGL2RenderingContext,s=window.navigator.userAgent.toLowerCase();(-1!==s.indexOf("safari")&&-1===s.indexOf("chrome")||ka.browserType===Sa.UC)&&(r=!1);var a=[];r&&R.WebGL2Device&&a.push(R.WebGL2Device),R.WebGLDevice&&a.push(R.WebGLDevice),R.EmptyDevice&&a.push(R.EmptyDevice),Is.canvas=e;for(var o=0;oza.HEADLESS||eKa.x?Ka.x:e.x,e.y=e.y>Ka.y?Ka.y:e.y,e.z=e.z>Ka.z?Ka.z:e.z,e}function eo(e,t,i){Di.set(Wa,i.orientation.m00,i.orientation.m01,i.orientation.m02),Di.set(ja,i.orientation.m03,i.orientation.m04,i.orientation.m05),Di.set(Xa,i.orientation.m06,i.orientation.m07,i.orientation.m08),Qa[0]=Wa,Qa[1]=ja,Qa[2]=Xa,Za[0]=i.halfExtents.x,Za[1]=i.halfExtents.y,Za[2]=i.halfExtents.z,Di.subtract(Ya,t,i.center),Di.set(e,i.center.x,i.center.y,i.center.z);for(var n=0;n<3;n++){var r=Di.dot(Ya,Qa[n]);r>Za[n]&&(r=Za[n]),r<-Za[n]&&(r=-Za[n]),e.x+=r*Qa[n].x,e.y+=r*Qa[n].y,e.z+=r*Qa[n].z}return e}e("c4",Object.freeze({__proto__:null,point_plane:Ja,pt_point_plane:function(e,t,i){var n=Ja(t,i);return Di.subtract(e,t,Di.multiplyScalar(e,i.n,n))},pt_point_aabb:$a,pt_point_obb:eo,pt_point_line:function(e,t,i,n){Di.subtract(Wa,i,n);var r=Wa,s=Di.lengthSqr(r);if(0==s)Di.copy(e,i);else{Di.subtract(Wa,t,i);var a=Di.dot(Wa,r)/s;a<0?Di.copy(e,i):a>1?Di.copy(e,n):Di.scaleAndAdd(e,i,r,a)}}}));var to=e("c5",{SHAPE_RAY:1,SHAPE_LINE:2,SHAPE_SPHERE:4,SHAPE_AABB:8,SHAPE_OBB:16,SHAPE_PLANE:32,SHAPE_TRIANGLE:64,SHAPE_FRUSTUM:128,SHAPE_FRUSTUM_ACCURATE:256,SHAPE_CAPSULE:512,SHAPE_SPLINE:1024}),io=e("c7",function(){function e(e,t,i,n,r,s){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=-1),this.s=void 0,this.e=void 0,this._type=void 0,this._type=to.SHAPE_LINE,this.s=new Di(e,t,i),this.e=new Di(n,r,s)}return e.create=function(t,i,n,r,s,a){return new e(t,i,n,r,s,a)},e.clone=function(t){return new e(t.s.x,t.s.y,t.s.z,t.e.x,t.e.y,t.e.z)},e.copy=function(e,t){return Di.copy(e.s,t.s),Di.copy(e.e,t.e),e},e.fromPoints=function(e,t,i){return Di.copy(e.s,t),Di.copy(e.e,i),e},e.set=function(e,t,i,n,r,s,a){return e.s.x=t,e.s.y=i,e.s.z=n,e.e.x=r,e.e.y=s,e.e.z=a,e},e.len=function(e){return Di.distance(e.s,e.e)},e.prototype.length=function(){return Di.distance(this.s,this.e)},c(e,[{key:"type",get:function(){return this._type}}]),e}()),no=e("c9",function(){function e(e,t,i,n,r,s){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=-1),this.o=void 0,this.d=void 0,this._type=void 0,this._type=to.SHAPE_RAY,this.o=new Di(e,t,i),this.d=new Di(n,r,s)}return e.create=function(t,i,n,r,s,a){return void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=1),new e(t,i,n,r,s,a)},e.clone=function(t){return new e(t.o.x,t.o.y,t.o.z,t.d.x,t.d.y,t.d.z)},e.copy=function(e,t){return Di.copy(e.o,t.o),Di.copy(e.d,t.d),e},e.fromPoints=function(e,t,i){return Di.copy(e.o,t),Di.normalize(e.d,Di.subtract(e.d,i,t)),e},e.set=function(e,t,i,n,r,s,a){return e.o.x=t,e.o.y=i,e.o.z=n,e.d.x=r,e.d.y=s,e.d.z=a,e},e.prototype.computeHit=function(e,t){Di.normalize(e,this.d),Di.scaleAndAdd(e,this.o,e,t)},c(e,[{key:"type",get:function(){return this._type}}]),e}()),ro=new Di,so=new Di,ao=new Di,oo=new Di;function uo(e){return Math.max(Math.max(e.x,e.y),e.z)}var ho,co=e("cb",function(){function e(e,t,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=1),this._center=new Di(0,0,0),this._radius=0,this._type=void 0,this._type=to.SHAPE_SPHERE,this._center=new Di(e,t,i),this._radius=n}e.create=function(t,i,n,r){return new e(t,i,n,r)},e.clone=function(t){return new e(t.center.x,t.center.y,t.center.z,t.radius)},e.copy=function(e,t){return Di.copy(e.center,t.center),e.radius=t.radius,e},e.fromPoints=function(e,t,i){return Di.multiplyScalar(e.center,Di.add(ro,t,i),.5),e.radius=.5*Di.subtract(ro,i,t).length(),e},e.set=function(e,t,i,n,r){return e.center.x=t,e.center.y=i,e.center.z=n,e.radius=r,e};var t=e.prototype;return t.destroy=function(){},t.clone=function(){return e.clone(this)},t.copy=function(t){return e.copy(this,t)},t.getBoundary=function(e,t){Di.set(e,this.center.x-this.radius,this.center.y-this.radius,this.center.z-this.radius),Di.set(t,this.center.x+this.radius,this.center.y+this.radius,this.center.z+this.radius)},t.transform=function(e,t,i,n,r){Di.transformMat4(r.center,this.center,e),r.radius=this.radius*uo(n)},t.translateAndRotate=function(e,t,i){Di.transformMat4(i.center,this.center,e)},t.setScale=function(e,t){t.radius=this.radius*uo(e)},t.mergePoint=function(e){this.radius<0&&(this.center.set(e),this.radius=0),Di.subtract(so,e,this.center);var t=so.length();if(t>this.radius){var i=.5*(t-this.radius);this.radius+=i,Di.multiplyScalar(so,so,i/t),Di.add(this.center,this.center,so)}},t.mergePoints=function(e){var t=e.length;if(!(t<1)){this.radius=-1;for(var i=0;i-Number.EPSILON))return 0;var r=1/n;Di.subtract(go,e.o,t.a);var s=Di.dot(go,mo)*r;if(s<0||s>1)return 0;Di.cross(vo,go,fo);var a=Di.dot(e.d,vo)*r;if(a<0||s+a>1)return 0;var o=Di.dot(po,vo)*r;return o<0?0:o}),So=function(){var e=new Di(0,0,0);return function(t,i){var n=i.radius,r=i.center,s=t.o,a=t.d,o=n*n;Di.subtract(e,r,s);var u=e.lengthSqr(),h=Di.dot(e,a),c=o-(u-h*h);if(c<0)return 0;var l=Math.sqrt(c),_=up?0:d>0?d:p}var Ro,Io,Oo,No,Co=function(){var e=new Di,t=new Di,i=new Di,n=new Di,r=new Di,s=new Di,a=new Di,o=new Array(3),u=new Array(3),h=new Array(3),c=new Array(6);return function(l,_){o[0]=_.halfExtents.x,o[1]=_.halfExtents.y,o[2]=_.halfExtents.z,e=_.center,t=l.o,i=l.d,Di.set(n,_.orientation.m00,_.orientation.m01,_.orientation.m02),Di.set(r,_.orientation.m03,_.orientation.m04,_.orientation.m05),Di.set(s,_.orientation.m06,_.orientation.m07,_.orientation.m08),Di.subtract(a,e,t),u[0]=Di.dot(n,i),u[1]=Di.dot(r,i),u[2]=Di.dot(s,i),h[0]=Di.dot(n,a),h[1]=Di.dot(r,a),h[2]=Di.dot(s,a);for(var f=0;f<3;++f){if(0===u[f]){if(-h[f]-o[f]>0||-h[f]+o[f]<0)return 0;u[f]=1e-7}c[2*f+0]=(h[f]+o[f])/u[f],c[2*f+1]=(h[f]-o[f])/u[f]}var d=Math.max(Math.max(Math.min(c[0],c[1]),Math.min(c[2],c[3])),Math.min(c[4],c[5])),p=Math.min(Math.min(Math.max(c[0],c[1]),Math.max(c[2],c[3])),Math.max(c[4],c[5]));return p<0||d>p?0:d>0?d:p}}(),Mo=function(){var e=new Di,t=new Di,i=new Di,n=new Di,r=new Di,s=new Di,a=new Di,o=new co;return function(u,h){var c=h.radius*h.radius,l=Di.normalize(e,u.d),_=h.ellipseCenter0,f=h.ellipseCenter1,d=Di.subtract(t,f,_);if(d.equals(Di.ZERO))return o.radius=h.radius,o.center.set(h.ellipseCenter0),pu.raySphere(u,o);var p=u.o,m=Di.subtract(i,p,_),g=Di.cross(n,l,d),v=g.lengthSqr();if(0===v){o.radius=h.radius;var y=Di.subtract(r,f,p);return m.lengthSqr()=0&&O<=1?b:O<0?(o.radius=h.radius,o.center.set(h.ellipseCenter0),pu.raySphere(u,o)):O>1?(o.radius=h.radius,o.center.set(h.ellipseCenter1),pu.raySphere(u,o)):0}}(),xo=(Ro=lo.create(),Io={distance:1/0,doubleSided:!1,mode:ho.ANY},Oo=0,No=function(e,t,i,n,r,s){e===ho.CLOSEST?(Oo>t||0===Oo)&&(Oo=t,s&&(0===s.length?s.push({distance:t,vertexIndex0:i/3,vertexIndex1:n/3,vertexIndex2:r/3}):(s[0].distance=t,s[0].vertexIndex0=i/3,s[0].vertexIndex1=n/3,s[0].vertexIndex2=r/3))):(Oo=t,s&&s.push({distance:t,vertexIndex0:i/3,vertexIndex1:n/3,vertexIndex2:r/3}))},function(e,t,i){if(Oo=0,0===t.geometricInfo.positions.length)return Oo;var n=void 0===i?Io:i;if(wo(e,t.geometricInfo.boundingBox.min,t.geometricInfo.boundingBox.max)){var r=t.primitiveMode,s=t.geometricInfo;!function(e,t,i,n,r){if(i===Vn.TRIANGLE_LIST)for(var s=t.length,a=0;ar.distance)&&(No(r.mode,c,o,u,h,r.result),r.mode===ho.ANY))return c}else if(i===Vn.TRIANGLE_STRIP)for(var l=t.length-2,_=0,f=0;fr.distance)&&(No(r.mode,g,d,p,m,r.result),r.mode===ho.ANY))return g}else if(i===Vn.TRIANGLE_FAN){var v=t.length-1,y=3*t[0];Di.set(Ro.a,e[y],e[y+1],e[y+2]);for(var E=1;Er.distance)&&(No(r.mode,S,y,T,A,r.result),r.mode===ho.ANY))return S}}}(s.positions,s.indices,r,e,n)}return Oo}),Fo=function(){var e=0,t={distance:1/0,doubleSided:!1,mode:ho.ANY};return function(i,n,r){e=0;var s=void 0===r?t:r,a=n.renderingSubMeshes.length,o=n.struct.minPosition,u=n.struct.maxPosition;if(o&&u&&!wo(i,o,u))return e;for(var h=0;hl)&&(e=l,s.subIndices&&(s.subIndices[0]=h));else if(e=l,s.subIndices&&s.subIndices.push(h),s.mode===ho.ANY)return l}return e&&s.mode===ho.CLOSEST&&(s.result&&(s.result[0].distance=e,s.result.length=1),s.subIndices&&(s.subIndices.length=1)),e}}(),Po=function(){var e=0,t={distance:1/0,doubleSided:!1,mode:ho.ANY},i=new no,n=new Qi;return function(r,s,a){e=0;var o=void 0===a?t:a,u=s.worldBounds;if(u&&!bo(r,u))return e;no.copy(i,r),s.node&&(Qi.invert(n,s.node.getWorldMatrix(n)),Di.transformMat4(i.o,r.o,n),Di.transformMat4Normal(i.d,r.d,n));for(var h=s.subModels,c=0;c_)&&(e=_,o.subIndices&&(o.subIndices[0]=c));else if(e=_,o.subIndices&&o.subIndices.push(c),o.mode===ho.ANY)return _}return e&&o.mode===ho.CLOSEST&&(o.result&&(o.result[0].distance=e,o.result.length=1),o.subIndices&&(o.subIndices.length=1)),e}}(),Do=function(){var e=new Di(0,0,0);return function(t,i){Di.subtract(e,t.e,t.s);var n=(i.d-Di.dot(t.s,i.n))/Di.dot(e,i.n);return n<0||n>1?0:n}}(),Lo=function(){var e=new Di(0,0,0),t=new Di(0,0,0),i=new Di(0,0,0),n=new Di(0,0,0),r=new Di(0,0,0),s=new Di(0,0,0);return function(a,o,u){Di.subtract(e,o.b,o.a),Di.subtract(t,o.c,o.a),Di.subtract(i,a.s,a.e),Di.cross(r,e,t);var h=Di.dot(i,r);if(h<=0)return 0;Di.subtract(n,a.s,o.a);var c=Di.dot(n,r);if(c<0||c>h)return 0;Di.cross(s,i,n);var l=Di.dot(t,s);if(l<0||l>h)return 0;var _=-Di.dot(e,s);if(_<0||l+_>h)return 0;if(u){var f=1/h,d=1-(l*=f)-(_*=f);Di.set(u,o.a.x*d+o.b.x*l+o.c.x*_,o.a.y*d+o.b.y*l+o.c.y*_,o.a.z*d+o.b.z*l+o.c.z*_)}return 1}}(),Bo=new no;function Uo(e,t){Bo.o.set(e.s),Di.subtract(Bo.d,e.e,e.s),Bo.d.normalize();var i=bo(Bo,t);return i<=e.length()?i:0}function Go(e,t){Bo.o.set(e.s),Di.subtract(Bo.d,e.e,e.s),Bo.d.normalize();var i=Co(Bo,t);return i<=e.length()?i:0}function zo(e,t){Bo.o.set(e.s),Di.subtract(Bo.d,e.e,e.s),Bo.d.normalize();var i=So(Bo,t);return i<=e.length()?i:0}var ko,Ho,Vo,Wo,jo=(ko=new Di,Ho=new Di,Vo=new Di,Wo=new Di,function(e,t){return Di.subtract(ko,e.center,e.halfExtents),Di.add(Ho,e.center,e.halfExtents),Di.subtract(Vo,t.center,t.halfExtents),Di.add(Wo,t.center,t.halfExtents),ko.x<=Wo.x&&Ho.x>=Vo.x&&ko.y<=Wo.y&&Ho.y>=Vo.y&&ko.z<=Wo.z&&Ho.z>=Vo.z});function Xo(e,t,i,n,r,s){Di.set(s[0],e.x+i.x*t.x+n.x*t.y+r.x*t.z,e.y+i.y*t.x+n.y*t.y+r.y*t.z,e.z+i.z*t.x+n.z*t.y+r.z*t.z),Di.set(s[1],e.x-i.x*t.x+n.x*t.y+r.x*t.z,e.y-i.y*t.x+n.y*t.y+r.y*t.z,e.z-i.z*t.x+n.z*t.y+r.z*t.z),Di.set(s[2],e.x+i.x*t.x-n.x*t.y+r.x*t.z,e.y+i.y*t.x-n.y*t.y+r.y*t.z,e.z+i.z*t.x-n.z*t.y+r.z*t.z),Di.set(s[3],e.x+i.x*t.x+n.x*t.y-r.x*t.z,e.y+i.y*t.x+n.y*t.y-r.y*t.z,e.z+i.z*t.x+n.z*t.y-r.z*t.z),Di.set(s[4],e.x-i.x*t.x-n.x*t.y-r.x*t.z,e.y-i.y*t.x-n.y*t.y-r.y*t.z,e.z-i.z*t.x-n.z*t.y-r.z*t.z),Di.set(s[5],e.x+i.x*t.x-n.x*t.y-r.x*t.z,e.y+i.y*t.x-n.y*t.y-r.y*t.z,e.z+i.z*t.x-n.z*t.y-r.z*t.z),Di.set(s[6],e.x-i.x*t.x+n.x*t.y-r.x*t.z,e.y-i.y*t.x+n.y*t.y-r.y*t.z,e.z-i.z*t.x+n.z*t.y-r.z*t.z),Di.set(s[7],e.x-i.x*t.x-n.x*t.y+r.x*t.z,e.y-i.y*t.x-n.y*t.y+r.y*t.z,e.z-i.z*t.x-n.z*t.y+r.z*t.z)}function Yo(e,t){for(var i=Di.dot(t,e[0]),n=i,r=1;r<8;++r){var s=Di.dot(t,e[r]);i=sn?s:n}return[i,n]}var qo,Ko,Qo,Zo=function(){for(var e=new Array(15),t=0;t<15;t++)e[t]=new Di(0,0,0);for(var i=new Array(8),n=new Array(8),r=0;r<8;r++)i[r]=new Di(0,0,0),n[r]=new Di(0,0,0);var s=new Di,a=new Di;return function(t,r){Di.set(e[0],1,0,0),Di.set(e[1],0,1,0),Di.set(e[2],0,0,1),Di.set(e[3],r.orientation.m00,r.orientation.m01,r.orientation.m02),Di.set(e[4],r.orientation.m03,r.orientation.m04,r.orientation.m05),Di.set(e[5],r.orientation.m06,r.orientation.m07,r.orientation.m08);for(var o=0;o<3;++o)Di.cross(e[6+3*o],e[o],e[3]),Di.cross(e[7+3*o],e[o],e[4]),Di.cross(e[7+3*o],e[o],e[5]);Di.subtract(s,t.center,t.halfExtents),Di.add(a,t.center,t.halfExtents),function(e,t,i){Di.set(i[0],e.x,t.y,t.z),Di.set(i[1],e.x,t.y,e.z),Di.set(i[2],e.x,e.y,t.z),Di.set(i[3],e.x,e.y,e.z),Di.set(i[4],t.x,t.y,t.z),Di.set(i[5],t.x,t.y,e.z),Di.set(i[6],t.x,e.y,t.z),Di.set(i[7],t.x,e.y,e.z)}(s,a,i),Xo(r.center,r.halfExtents,e[3],e[4],e[5],n);for(var u=0;u<15;++u){var h=Yo(i,e[u]),c=Yo(n,e[u]);if(c[0]>h[1]||h[0]>c[1])return 0}return 1}}(),Jo=function(e,t){var i=e.halfExtents.x*Math.abs(t.n.x)+e.halfExtents.y*Math.abs(t.n.y)+e.halfExtents.z*Math.abs(t.n.z),n=Di.dot(t.n,e.center);return n+it.d?0:1},$o=function(e,t){for(var i=0;in.halfExtents.x?t++:e[h].x<-n.halfExtents.x&&i++;if(t===r.vertices.length||i===r.vertices.length)return 0;t=0,i=0;for(var c=0;cn.halfExtents.y?t++:e[c].y<-n.halfExtents.y&&i++;if(t===r.vertices.length||i===r.vertices.length)return 0;t=0,i=0;for(var l=0;ln.halfExtents.z?t++:e[l].z<-n.halfExtents.z&&i++;return t===r.vertices.length||i===r.vertices.length?0:1}}(),tu=(qo=new Di(0,0,0),Ko=new Gi,function(e,t){return Di.subtract(qo,t,e.center),Di.transformMat3(qo,qo,Gi.transpose(Ko,e.orientation)),i=qo,n=e.halfExtents,Math.abs(i.x)t.d?0:1}),nu=function(e,t){for(var i=0;ir.halfExtents.x?i++:t<-r.halfExtents.x&&n++;if(i===a.vertices.length||n===a.vertices.length)return 0;i=0,n=0;for(var _=0;_r.halfExtents.y?i++:t<-r.halfExtents.y&&n++;if(i===a.vertices.length||n===a.vertices.length)return 0;i=0,n=0;for(var f=0;fr.halfExtents.z?i++:t<-r.halfExtents.z&&n++;return i===a.vertices.length||n===a.vertices.length?0:1}}(),su=function(){for(var e=new Array(15),t=0;t<15;t++)e[t]=new Di(0,0,0);for(var i=new Array(8),n=new Array(8),r=0;r<8;r++)i[r]=new Di(0,0,0),n[r]=new Di(0,0,0);return function(t,r){Di.set(e[0],t.orientation.m00,t.orientation.m01,t.orientation.m02),Di.set(e[1],t.orientation.m03,t.orientation.m04,t.orientation.m05),Di.set(e[2],t.orientation.m06,t.orientation.m07,t.orientation.m08),Di.set(e[3],r.orientation.m00,r.orientation.m01,r.orientation.m02),Di.set(e[4],r.orientation.m03,r.orientation.m04,r.orientation.m05),Di.set(e[5],r.orientation.m06,r.orientation.m07,r.orientation.m08);for(var s=0;s<3;++s)Di.cross(e[6+3*s],e[s],e[3]),Di.cross(e[7+3*s],e[s],e[4]),Di.cross(e[8+3*s],e[s],e[5]);Xo(t.center,t.halfExtents,e[0],e[1],e[2],i),Xo(r.center,r.halfExtents,e[3],e[4],e[5],n);for(var a=0;a<15;++a){var o=Yo(i,e[a]),u=Yo(n,e[a]);if(u[0]>o[1]||o[0]>u[1])return 0}return 1}}(),au=function(){for(var e=new co,t=new Di,i=new Di,n=new Di,r=new Array(8),s=0;s<8;s++)r[s]=new Di;for(var a=new Array(8),o=0;o<8;o++)a[o]=new Di;return function(s,o){if(0===Di.squaredDistance(o.ellipseCenter0,o.ellipseCenter1))return e.radius=o.radius,e.center.set(o.ellipseCenter0),pu.sphereOBB(e,s);t.x=s.orientation.m00,t.y=s.orientation.m01,t.z=s.orientation.m02,i.x=s.orientation.m03,i.y=s.orientation.m04,i.z=s.orientation.m05,n.x=s.orientation.m06,n.y=s.orientation.m07,n.z=s.orientation.m08,Xo(s.center,s.halfExtents,t,i,n,r);var u=a,h=Di.copy(u[0],t),c=Di.copy(u[1],i),l=Di.copy(u[2],n);Di.subtract(u[3],o.center,s.center).normalize();var _=Di.subtract(u[4],o.ellipseCenter0,o.ellipseCenter1);_.normalize(),Di.cross(u[5],h,_),Di.cross(u[6],c,_),Di.cross(u[7],l,_);for(var f=0;f<8;++f){var d=Yo(r,u[f]),p=Di.dot(u[f],o.ellipseCenter0),m=Di.dot(u[f],o.ellipseCenter1),g=Math.max(p,m),v=Math.min(p,m)-o.radius,y=g+o.radius;if(v>d[1]||d[0]>y)return 0}return 1}}(),ou=function(e,t){var i=Di.dot(t.n,e.center),n=e.radius*t.n.length();return i+nt.d?0:1},uu=function(e,t){for(var i=0;ih)){Di.add(e,o,Di.multiplyScalar(e,u,a));for(var l=0;l<6;l++)if(l!==r&&l!==r+t[r]){var _=n.planes[l];if(Di.dot(_.n,e)<_.d)return 0}}}return 1}}(),cu=function(e,t){var i=e.radius+t.radius;return Di.squaredDistance(e.center,t.center)1?Di.squaredDistance(i.center,n.ellipseCenter1)y&&(u=y,h=g+d,E=p)),h<0?(h=0,-m<0?u=0:-m>f?u=y:(u=-m,y=f)):h>E&&(h=E,-m+d<0?u=0:-m+d>f?u=y:(u=-m+d,y=f));var T=Math.abs(u)0&&(e.d=t.d/i),e},e.prototype.transform=function(e){Qi.invert(vu,e),Qi.transpose(vu,vu),sn.set(yu,this.n.x,this.n.y,this.n.z,this.d),sn.transformMat4(yu,yu,vu),Di.set(this.n,yu.x,yu.y,yu.z),this.d=yu.w},c(e,[{key:"type",get:function(){return this._type}},{key:"x",get:function(){return this.n.x},set:function(e){this.n.x=e}},{key:"y",get:function(){return this.n.y},set:function(e){this.n.y=e}},{key:"z",get:function(){return this.n.z},set:function(e){this.n.z=e}},{key:"w",get:function(){return this.d},set:function(e){this.d=e}}]),e}()),Tu=new Di,Au=new Di,Su=new Di,bu=new Di,wu=new Gi,Ru=function(e,t,i){wu.m00=Math.abs(i.m00),wu.m01=Math.abs(i.m01),wu.m02=Math.abs(i.m02),wu.m03=Math.abs(i.m04),wu.m04=Math.abs(i.m05),wu.m05=Math.abs(i.m06),wu.m06=Math.abs(i.m08),wu.m07=Math.abs(i.m09),wu.m08=Math.abs(i.m10),Di.transformMat3(e,t,wu)},Iu=e("cc",function(){function e(e,t,i,n,r,s){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=1),void 0===s&&(s=1),this.center=void 0,this.halfExtents=void 0,this._type=void 0,this._type=to.SHAPE_AABB,this.center=new Di(e,t,i),this.halfExtents=new Di(n,r,s)}e.create=function(t,i,n,r,s,a){return new e(t,i,n,r,s,a)},e.clone=function(t){return new e(t.center.x,t.center.y,t.center.z,t.halfExtents.x,t.halfExtents.y,t.halfExtents.z)},e.copy=function(e,t){return Di.copy(e.center,t.center),Di.copy(e.halfExtents,t.halfExtents),e},e.fromPoints=function(e,t,i){return Di.add(Tu,i,t),Di.subtract(Au,i,t),Di.multiplyScalar(e.center,Tu,.5),Di.multiplyScalar(e.halfExtents,Au,.5),e},e.set=function(e,t,i,n,r,s,a){return e.center.set(t,i,n),e.halfExtents.set(r,s,a),e},e.merge=function(t,i,n){return Di.subtract(Tu,i.center,i.halfExtents),Di.subtract(Au,n.center,n.halfExtents),Di.add(Su,i.center,i.halfExtents),Di.add(bu,n.center,n.halfExtents),Di.max(bu,Su,bu),Di.min(Su,Tu,Au),e.fromPoints(t,Su,bu)},e.toBoundingSphere=function(e,t){return e.center.set(t.center),e.radius=t.halfExtents.length(),e},e.transform=function(e,t,i){return Di.transformMat4(e.center,t.center,i),Ru(e.halfExtents,t.halfExtents,i),e};var t=e.prototype;return t.getBoundary=function(e,t){Di.subtract(e,this.center,this.halfExtents),Di.add(t,this.center,this.halfExtents)},t.transform=function(e,t,i,n,r){Di.transformMat4(r.center,this.center,e),Ru(r.halfExtents,this.halfExtents,e)},t.clone=function(){return e.clone(this)},t.copy=function(t){return e.copy(this,t)},t.mergePoint=function(e){this.getBoundary(Tu,Au),e.xAu.x&&(Au.x=e.x),e.y>Au.y&&(Au.y=e.y),e.z>Au.z&&(Au.z=e.z),Di.add(Su,Tu,Au),this.center.set(Di.multiplyScalar(Su,Su,.5)),this.halfExtents.set(Au.x-Su.x,Au.y-Su.y,Au.z-Su.z)},t.mergePoints=function(e){if(!(e.length<1))for(var t=0;t>>1;n<=r;s=n+r>>>1){var a=e[s];if(a>t+i)r=s-1;else{if(!(a=e._times.length)return{done:!0,value:void 0};var i=[e._times[t],e._values[t]];return++t,{done:!1,value:i}}}},t.keyframes=function(){return this},t.times=function(){return this._times},t.values=function(){return this._values},t.getKeyframeTime=function(e){return this._times[e]},t.getKeyframeValue=function(e){return this._values[e]},t.addKeyFrame=function(e,t){return this._insertNewKeyframe(e,t)},t.removeKeyframe=function(e){this._times.splice(e,1),this._values.splice(e,1)},t.indexOfKeyframe=function(e){return ku(this._times,e)},t.updateTime=function(e,t){var i=this._values[e];this.removeKeyframe(e),this._insertNewKeyframe(t,i)},t.assignSorted=function(e,t){if(void 0!==t)this.setKeyframes(e.slice(),t.slice());else{var i=Array.from(e);this.setKeyframes(i.map((function(e){return e[0]})),i.map((function(e){return e[1]})))}},t.clear=function(){this._times.length=0,this._values.length=0},t.searchKeyframe=function(e){return ku(this._times,e)},t.setKeyframes=function(e,t){e.length,t.length,function(e){e.every((function(e,t,i){return 0===t||e>i[t-1]||vi(e,i[t-1],1e-6)}))}(e),this._times=e,this._values=t},t._insertNewKeyframe=function(e,t){var i=this._times,n=this._values,r=i.length,s=ku(i,e);if(s>=0)return s;var a=~s;return 0===a?(i.unshift(e),n.unshift(t)):a===r?(i.push(e),n.push(t)):(i.splice(a-1,0,e),n.splice(a-1,0,t)),a},c(e,[{key:"keyFramesCount",get:function(){return this._times.length}},{key:"rangeMin",get:function(){return this._times[0]}},{key:"rangeMax",get:function(){return this._times[this._values.length-1]}}]),e}();function Xu(e){return e>-1e-9&&e<1e-9}li.fastDefine("cc.KeyframeCurve",ju,{_times:[],_values:[]}),function(e){e[e.LINEAR=0]="LINEAR",e[e.CONSTANT=1]="CONSTANT",e[e.CUBIC=2]="CUBIC"}(Hu||(Hu=e("fF",{}))),function(e){e[e.LINEAR=0]="LINEAR",e[e.CLAMP=1]="CLAMP",e[e.LOOP=2]="LOOP",e[e.PING_PONG=3]="PING_PONG"}(Vu||(Vu=e("hM",{}))),function(e){e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.BOTH=3]="BOTH"}(Wu||(Wu=e("fG",{})));var Yu=function(){},qu=function(){return Yu},Ku=Qu((function(){}));function Qu(e){return function(t){return"function"==typeof t?e(t):function(i){return e(i,t)}}}function Zu(e){return function(t){return function(i){!function(e,t,i){var n=$u(e);if(n){var r=eh(n,"proto");eh(r,"editor")[t]=i}}(i,e,t)}}}var Ju="__ccclassCache__";function $u(e){return eh(e,Ju)}function eh(e,t){return e[t]||(e[t]={})}var th=e("dO",Qu((function(e,t){var i=_t.getSuper(e);i===Object&&(i=null);var n={name:t,extends:i,ctor:e},r=e[Ju];if(r){var s=r.proto;s&&_t.mixin(n,s),e[Ju]=void 0}return li(n)}))),ih=e("en",Zu("requireComponent")),nh=e("ec",Zu("executionOrder")),rh=e("e8",Ku);function sh(e,t,i){var n=null;function r(e,t,i){!function(e,t,i,n,r,s){var a,o=s&&(s.get||s.set);r&&(a=ei(r,o));var u=_t.mixin(t,a||r||{});o?(s.get&&(u.get=s.get),s.set&&(u.set=s.set)):oh(e,u,i,n,s)}(function(e){return $u(e.constructor)}(e),function(e,t){var i,n,r=eh($u(e.constructor),"proto"),s=eh(r,"properties");return null!==(n=s[i=t])&&void 0!==n?n:s[i]={}}(e,t),e.constructor,t,n,i)}return void 0===e?sh({type:void 0}):void 0===t?(n=e,r):void r(e,t,i)}function ah(e,t,i){var n,r,s=$u(e.constructor),a=eh(s,"proto"),o=eh(a,"properties"),u=null!==(r=o[n=t])&&void 0!==r?r:o[n]={};return u.__internalFlags|=ti.STANDALONE,i&&(i.get||i.set)?(i.get&&(u.get=i.get),i.set&&(u.set=i.set)):oh(s,u,e.constructor,t,i),u}function oh(e,t,i,n,r){if(r)r.initializer&&(t.default=function(e){var t;try{t=e()}catch(t){return e}return"object"!=typeof t||null===t?t:e}(r.initializer));else{var s=e.default||(e.default=function(e){var t;try{t=new e}catch(e){return{}}return t}(i));s.hasOwnProperty(n)&&(t.default=s[n])}}var uh=Symbol("cc:SerializationMetadata"),hh=e("dV",(function(e,t,i){_h(ah(e,t,i))}));function ch(e){return function(t,i,n){var r=ah(t,i,n);r.formerlySerializedAs=e,_h(r)}}var lh=e("gE",(function(e,t,i){var n=ah(e,t,i);n.editorOnly=!0,_h(n)}));function _h(e){e.__internalFlags|=ti.IMPLICIT_SERIALIZABLE}var fh=e("fo",Yu),dh=e("e9",Ku),ph=e("ed",qu),mh=e("gd",Ku),gh=qu,vh=qu,yh=e("eb",qu),Eh=e("e1",Yu),Th=e("eo",qu),Ah=e("gi",Yu),Sh=e("ep",qu),bh=e("ef",qu),wh=e("eN",qu),Rh=e("gs",qu),Ih=(e("gt",qu),e("ga",qu)),Oh=e("eQ",Yu),Nh=e("ee",qu),Ch=(e("g7",Yu),e("er",Yu),e("em",Yu)),Mh=Dh(Wt),xh=e("fq",Dh(jt)),Fh=Dh(Xt),Ph=e("e3",Dh(Yt));function Dh(e){return sh({type:e})}var Lh=e("e2",(function(e,t,i){ah(e,t,i).override=!0})),Bh=e("fj",(function(){})),Uh=Object.freeze({__proto__:null,uniquelyReferenced:fh,ccclass:th,property:sh,requireComponent:ih,executionOrder:nh,disallowMultiple:rh,allowReplicated:function(e){li.Attr.setClassAttr(e,"replicated","visible",!0)},executeInEditMode:dh,menu:ph,playOnFocus:mh,inspector:gh,icon:vh,help:yh,type:Dh,integer:Mh,float:xh,boolean:Fh,string:Ph});e("gT",Uh);var Gh=e("dp",function(){function e(e){this._map=null,this._count=0,e?(this._map=e,this._count=Object.keys(e).length):(this._map=_t.createMap(!0),this._count=0)}var t=e.prototype;return t.add=function(e,t){return e in this._map||this._count++,this._map[e]=t},t.get=function(e){return this._map[e]},t.has=function(e){return e in this._map},t.remove=function(e){var t=this._map[e];return e in this._map&&(delete this._map[e],this._count--),t},t.clear=function(){0!==this._count&&(this._map=_t.createMap(!0),this._count=0)},t.forEach=function(e){for(var t in this._map)e(this._map[t],t)},t.find=function(e){for(var t in this._map)if(e(this._map[t],t))return this._map[t];return null},t.destroy=function(){this._map=null},c(e,[{key:"count",get:function(){return this._count}}]),e}()),zh=function(){function e(t,i){this.id=e._pipelineId++,this.name="",this.pipes=[],this.name=t;for(var n=0,r=i.length;nthis.pipes.length?(Y(4921),this):(this.pipes.splice(t,0,e),this)},t.append=function(e){return this.pipes.push(e),this},t.remove=function(e){return this.pipes.splice(e,1),this},t.sync=function(e){var t=this.pipes;if(0===t.length)return null;e.isFinish=!1;for(var i=0,n=t.length;i>2],ec[tc[n++]]=Jh[(3&r)<<2|s>>4],ec[tc[n++]]=Jh[15&s]}return e.replace(t,ec.join(""))}var nc=/.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-@]{8,}).*/;function rc(e){var t=nc.exec(e);return t?t[1]:""}function sc(e,t){(t=t||Object.create(null)).__isNative__=t.isNative,t.nativeExt&&(t.ext=t.nativeExt);var i=jh.find((function(t){return!!t.getAssetInfo(e)}));return i&&(t.bundle=i.name),uc(e,t)}function ac(e){return!!e&&(e instanceof R.SceneAsset||e instanceof R.Scene)}function oc(e){return e&&(46===e.charCodeAt(0)&&47===e.charCodeAt(1)?e=e.slice(2):47===e.charCodeAt(0)&&(e=e.slice(1))),e}function uc(e,t){var i=Zh.create({input:e,options:t}),n=[];try{for(var r,s=E(qh.sync(i));!(r=s()).done;){var a=r.value,o=a.url;a.recycle(),n.push(o)}}catch(e){for(var u,h=E(i.output);!(u=h()).done;)u.value.recycle();U(e.message,e.stack)}return i.recycle(),n.length>1?n:n[0]}var hc,cc,lc,_c,fc=Object.freeze({__proto__:null,getUuidFromURL:rc,getUrlWithUuid:sc,isScene:ac,normalize:oc,transform:uc,decodeUuid:ic}),dc=/(\.[^\.\/\?\\]*)(\?.*)?$/,pc=/((.*)(\/|\\|\\\\))?(.*?\..*$)?/,mc=/[^\.\/]+\/\.\.\//;function gc(){for(var e="",t=arguments.length,i=new Array(t),n=0;n0&&(e=e.substring(0,i));var n=/(\/|\\)([^\/\\]+)$/g.exec(e.replace(/(\/|\\)$/,""));if(!n)return e;var r=n[2];return t&&e.substring(e.length-t.length).toLowerCase()===t.toLowerCase()?r.substring(0,r.length-t.length):r}function Tc(e){var t=pc.exec(e);return t?t[2]:""}function Ac(e,t){t=t||"";var i=e.indexOf("?"),n="";return i>0&&(n=e.substring(i),e=e.substring(0,i)),(i=e.lastIndexOf("."))<0?e+t+n:e.substring(0,i)+t+n}function Sc(e,t,i){if(0===t.indexOf("."))return Ac(e,t);var n=e.indexOf("?"),r="",s=i?vc(e):"";return n>0&&(r=e.substring(n),e=e.substring(0,n)),n=(n=e.lastIndexOf("/"))<=0?0:n+1,e.substring(0,n)+t+s+r}function bc(e){var t=e=String(e);do{t=e,e=e.replace(mc,"")}while(t.length!==e.length);return e}function wc(e){return e.replace(/[\/\\]$/,"")}function Rc(){return xa.os===Ra.WINDOWS?"\\":"/"}e("gL",Object.freeze({__proto__:null,join:gc,extname:vc,mainFileName:yc,basename:Ec,dirname:Tc,changeExtname:Ac,changeBasename:Sc,_normalize:bc,stripSep:wc,getSeperator:Rc}));var Ic,Oc,Nc,Cc=e("dl",th("cc.Asset")((_c=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r0&&this._ref--,e&&R.assetManager._releaseManager.tryRelease(this),this},i.onLoaded=function(){},i.initDefault=function(e){e&&(this._uuid=e),this.isDefault=!0},i.validate=function(){return!0},i.destroy=function(){return z($(12101,this._uuid)),e.prototype.destroy.call(this)},c(t,[{key:"nativeUrl",get:function(){if(!this._nativeUrl){if(!this._native)return"";var e=this._native;if(47===e.charCodeAt(0))return e.slice(1);46===e.charCodeAt(0)?this._nativeUrl=sc(this._uuid,{nativeExt:e,isNative:!0}):this._nativeUrl=sc(this._uuid,{__nativeName__:e,nativeExt:vc(e),isNative:!0})}return this._nativeUrl}},{key:"_nativeAsset",get:function(){return this._file},set:function(e){this._file=e}},{key:"_nativeDep",get:function(){if(this._native)return{__isNative__:!0,uuid:this._uuid,ext:this._native}}},{key:"refCount",get:function(){return this._ref}}]),t}(Ta(ca)),lc=A((cc=_c).prototype,"_native",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),A(cc.prototype,"_nativeAsset",[sh],Object.getOwnPropertyDescriptor(cc.prototype,"_nativeAsset"),cc.prototype),hc=cc))||hc);Cc.prototype.createNode=null,R.Asset=Cc;var Mc=e("h5",th("cc.Script")(Ic=function(e){function t(){return e.apply(this,arguments)||this}return _(t,e),t}(Cc))||Ic);R._Script=Mc;var xc=e("h6",th("cc.JavaScript")(Oc=function(e){function t(){return e.apply(this,arguments)||this}return _(t,e),t}(Mc))||Oc);R._JavaScript=xc;var Fc,Pc,Dc,Lc,Bc,Uc,Gc,zc,kc,Hc,Vc,Wc,jc,Xc=e("h7",th("cc.TypeScript")(Nc=function(e){function t(){return e.apply(this,arguments)||this}return _(t,e),t}(Mc))||Nc);R._TypeScript=Xc;var Yc,qc,Kc,Qc,Zc,Jc,$c,el,tl,il,nl,rl,sl,al,ol,ul=e("gr",(Fc=th("cc.ClickEvent"),Pc=bh(),Dc=bh(),Lc=bh(),Bc=bh(),Fc((jc=function(){function e(){T(this,"target",zc,this),T(this,"component",kc,this),T(this,"_componentId",Hc,this),T(this,"handler",Vc,this),T(this,"customEventData",Wc,this)}e.emitEvents=function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r=0,1620),i=Number.isNaN(i)?R.macro.REPEAT_FOREVER:i,n=n||0;var r=R.director.getScheduler(),s=r.isTargetPaused(this);r.schedule(e,this,t,i,n,s)},i.scheduleOnce=function(e,t){void 0===t&&(t=0),this.schedule(e,0,0,t)},i.unschedule=function(e){e&&R.director.getScheduler().unschedule(e,this)},i.unscheduleAllCallbacks=function(){R.director.getScheduler().unscheduleAllForTarget(this)},c(t,[{key:"name",get:function(){if(this._name)return this._name;var e=De(this),t=e.lastIndexOf(".");return t>=0&&(e=e.slice(t+1)),this.node?this.node.name+"<"+e+">":e},set:function(e){this._name=e}},{key:"uuid",get:function(){return this._id}},{key:"__scriptAsset",get:function(){return null}},{key:"enabled",get:function(){return this._enabled},set:function(e){if(this._enabled!==e&&(this._enabled=e,this.node.activeInHierarchy)){var t=R.director._compScheduler;e?t.enableComp(this):t.disableComp(this)}}},{key:"enabledInHierarchy",get:function(){return this._enabled&&this.node&&this.node.activeInHierarchy}},{key:"_isOnLoadCalled",get:function(){return this._objFlags&cl}}]),t}(ca),il.EventHandler=ul,il.system=null,A((Jc=nl).prototype,"__scriptAsset",[qc,Kc,Qc,Ch],Object.getOwnPropertyDescriptor(Jc.prototype,"__scriptAsset"),Jc.prototype),$c=A(Jc.prototype,"node",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),el=A(Jc.prototype,"_enabled",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),tl=A(Jc.prototype,"__prefab",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Zc=Jc))||Zc)),_l=ll.prototype;_l.update=null,_l.lateUpdate=null,_l.__preload=null,_l.onLoad=null,_l.start=null,_l.onEnable=null,_l.onDisable=null,_l.onDestroy=null,_l.onFocusInEditor=null,_l.onLostFocusInEditor=null,_l.resetInEditor=null,_l._getLocalBounds=null,_l.onRestore=null,ll._requireComponent=null,ll._executionOrder=0,Ce(ll,"_registerEditorProps",(function(e,t){var i=t.requireComponent;i&&(Array.isArray(i)&&(i=i.filter(Boolean)),e._requireComponent=i);var n=t.executionOrder;n&&"number"==typeof n&&(e._executionOrder=n)})),R.Component=ll;var fl=e("hL",th("cc.MissingScript")(rl=gh()((ol=function(e){function t(){var t;return T(t=e.call(this)||this,"_$erialized",al,v(t)),t}return _(t,e),t.safeFindClass=function(e){var t=at(e);if(t)return t;R.deserialize.reportMissingClass(e)},t.prototype.onLoad=function(){Y(4600,this.node.name)},t}(ll),al=A((sl=ol).prototype,"_$erialized",[hh,lh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),rl=sl))||rl)||rl);R._MissingScript=fl;try{var dl=fl.__values__;0!==dl.length&&"_$erialized"===dl[dl.length-1]||(U("The '_$erialized' prop in MissingScript is missing. Please contact jare."),U(" Error props: ['"+dl+"']"))}catch(Za){U("Error when checking MissingScript 5, "+Za)}var pl=e("g_",Symbol("[[Serialize]]")),ml=e("gZ",Symbol("[[Deserialize]]")),gl=function(){function e(e,t){this._document=void 0,this._chunks=void 0,this._document=e,this._chunks=t}return c(e,[{key:"document",get:function(){return this._document}},{key:"chunks",get:function(){return this._chunks}}]),e}();function vl(e){var t=e;return{chunks:t.chunks,document:t.document}}function yl(e){if(e.length<16)throw new El($(13102));var t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(1313817411!==t.getUint32(0,!0))throw new El($(13100));var i=t.getUint32(4,!0);if(1!==i)throw new El($(13101,i));if(t.getUint32(8,!0)!==t.byteLength)throw new El($(13102));var n=12,r=t.getUint32(n,!0);n+=4;var s=new Uint8Array(t.buffer,n+t.byteOffset,r);n+=r;var a,o=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);if("Buffer"in globalThis)return globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString();throw new Error($(13104))}(s);try{a=JSON.parse(o)}catch(e){throw new El(e)}for(var u=[];n0&&(e.chunks.length,this._mainBinChunk=e.chunks[0])):t=e,this._serializedData=t,this._context={fromCCON:i};var n=Array.isArray(t)?t[0]:t;return this.deserializedData=this._deserializeObject(n,0),this._serializedData=void 0,this._mainBinChunk=void 0,this._context=void 0,this.deserializedData},t._deserializeObject=function(e,t,i,n){switch(e.__type__){case"TypedArray":return this._deserializeTypedArrayView(e);case"TypedArrayRef":return this._deserializeTypedArrayViewRef(e);default:return e.__type__?this._deserializeTypeTaggedObject(e,t,i,n):Array.isArray(e)?this._deserializeArray(e):this._deserializePlainObject(e)}},t._deserializeTypedArrayView=function(e){return globalThis[e.ctor].from(e.array)},t._deserializeTypedArrayViewRef=function(e){var t=e.offset,i=e.length,n=e.ctor;return new globalThis[n](this._mainBinChunk.buffer,this._mainBinChunk.byteOffset+t,i)},t._deserializeArray=function(e){for(var t,i=new Array(e.length),n=0;n=0&&(r.deserializedList[t]=i),i}(a);return this._deserializeInto(e,o,a),o},t._deserializeInto=function(e,t,i,n){void 0===n&&(n=!1),n||!t[ml]?t._deserialize?t._deserialize(e.content,this):R.Class._isCCClass(i)?this._deserializeFireClass(t,e,i):this._deserializeFastDefinedObject(t,e,i):this._runCustomizedDeserialize(e,t,i)},t._runCustomizedDeserialize=function(e,t,i){var n=this,r={readProperty:function(t){var i=e[t];return"object"==typeof i&&i?n._deserializeObjectField(i):i},readThis:function(){n._deserializeInto(e,t,i,!0)},readSuper:function(){var r=Ye(i);r&&n._deserializeInto(e,t,r)}};t[ml](r,this._context)},t._deserializeFireClass=function(e,t,i){var n;if(i.hasOwnProperty("__deserialize__"))n=i.__deserialize__;else{n=function(e,t){for(var i=kt(t),n=t.__values__,r=["var prop;"],s=St.test(ht(t)),a=0;a=0?t[i]=e[5][n]:e[7][3*~n]=t}function Fl(e){return function(t,i,n,r){i[n]=r;for(var s=0;s=0){var l=o[h];t[a]=Ml(e,l,c)}else(0,Ll[h=~h])(e,t,a,c)}return r}(e);R.game._isCloning=!1,e[7]&&function(e,t,i){for(var n=e.length-1,r=0,s=3*e[n];r=0?a[i[u]]=o:a[~u]=o}for(;r=0?h[i[l]]=c:h[~l]=c}}(e[7],u,e[2]),function(e){for(var t=e[5],i=e[2],n=e[1],r=e[8],s=e[9],a=e[10],o=0;o=0?i[h]:~h,s[o]=h);var c=a[o];"number"==typeof c&&(a[o]=n[c])}}(e),n=u[h]}else n=function(e,t,i){var n,r=(i=i||{}).classFinder||at,s=i.createAssetRefs||ka.platform===Ia.EDITOR_CORE,a=i.customEnv,o=i.ignoreEditorOnly,u=null!==(n=i.reportMissingClass)&&void 0!==n?n:R.deserialize.reportMissingClass;t.init();var h=wl.pool.get(t,r,u,a,o);R.game._isCloning=!0;var c=h.deserialize(e);return R.game._isCloning=!1,wl.pool.put(h),s&&t.assignAssetsBy((function(e,t){return EditorExtends.serialize.asAsset(e,t.type)})),c}(e,t,i);return r&&Nl.pool.put(t),n}Ll[0]=function(e,t,i,n){t[i]=n},Ll[1]=xl,Ll[2]=Fl(xl),Ll[3]=Fl(Pl),Ll[4]=Dl,Ll[5]=function(e,t,i,n){Ol[n[0]](t[i],n)},Ll[6]=Pl,Ll[7]=function(e,t,i,n){t[i].set(n)},Ll[8]=function(e,t,i,n){var r=new Rl[n[0]];Ol[n[0]](r,n),t[i]=r},Ll[9]=Fl(Dl),Ll[10]=function(e,t,i,n){var r=e[3][n[0]];t[i]=Ml(e,r,n[1])},Ll[11]=function(e,t,i,n){var r=n[0];t[i]=r;for(var s=1;s>3},n=i.storageUnit,r=h_(i.elementType),s=new(c_(n))(e,this._byteOffset,this._unitCount),a=new Array(this._length),o=0;o=1?1:e*e*(3-2*e)}function j_(e){return e<=0?0:e>=1?1:e*e*e*(e*(6*e-15)+10)}R._decorator=Uh;var X_,Y_,q_=sf(d_,p_),K_=sf(g_,v_),Q_=sf(E_,T_),Z_=sf(S_,b_),J_=sf(R_,I_),$_=sf(N_,C_),ef=sf(x_,F_),tf=sf(D_,L_),nf=sf(U_,G_),rf=sf(k_,H_);function sf(e,t){return function(i){return i<.5?t(2*i)/2:e(2*i-1)/2+.5}}e("fz",Object.freeze({__proto__:null,constant:__,linear:f_,quadIn:d_,quadOut:p_,quadInOut:m_,cubicIn:g_,cubicOut:v_,cubicInOut:y_,quartIn:E_,quartOut:T_,quartInOut:A_,quintIn:S_,quintOut:b_,quintInOut:w_,sineIn:R_,sineOut:I_,sineInOut:O_,expoIn:N_,expoOut:C_,expoInOut:M_,circIn:x_,circOut:F_,circInOut:P_,elasticIn:D_,elasticOut:L_,elasticInOut:B_,backIn:U_,backOut:G_,backInOut:z_,bounceIn:k_,bounceOut:H_,bounceInOut:V_,smooth:W_,fade:j_,quadOutIn:q_,cubicOutIn:K_,quartOutIn:Q_,quintOutIn:Z_,sineOutIn:J_,expoOutIn:$_,circOutIn:ef,elasticOutIn:tf,backOutIn:nf,bounceOutIn:rf})),function(e){e[e.LINEAR=0]="LINEAR",e[e.CONSTANT=1]="CONSTANT",e[e.QUAD_IN=2]="QUAD_IN",e[e.QUAD_OUT=3]="QUAD_OUT",e[e.QUAD_IN_OUT=4]="QUAD_IN_OUT",e[e.QUAD_OUT_IN=5]="QUAD_OUT_IN",e[e.CUBIC_IN=6]="CUBIC_IN",e[e.CUBIC_OUT=7]="CUBIC_OUT",e[e.CUBIC_IN_OUT=8]="CUBIC_IN_OUT",e[e.CUBIC_OUT_IN=9]="CUBIC_OUT_IN",e[e.QUART_IN=10]="QUART_IN",e[e.QUART_OUT=11]="QUART_OUT",e[e.QUART_IN_OUT=12]="QUART_IN_OUT",e[e.QUART_OUT_IN=13]="QUART_OUT_IN",e[e.QUINT_IN=14]="QUINT_IN",e[e.QUINT_OUT=15]="QUINT_OUT",e[e.QUINT_IN_OUT=16]="QUINT_IN_OUT",e[e.QUINT_OUT_IN=17]="QUINT_OUT_IN",e[e.SINE_IN=18]="SINE_IN",e[e.SINE_OUT=19]="SINE_OUT",e[e.SINE_IN_OUT=20]="SINE_IN_OUT",e[e.SINE_OUT_IN=21]="SINE_OUT_IN",e[e.EXPO_IN=22]="EXPO_IN",e[e.EXPO_OUT=23]="EXPO_OUT",e[e.EXPO_IN_OUT=24]="EXPO_IN_OUT",e[e.EXPO_OUT_IN=25]="EXPO_OUT_IN",e[e.CIRC_IN=26]="CIRC_IN",e[e.CIRC_OUT=27]="CIRC_OUT",e[e.CIRC_IN_OUT=28]="CIRC_IN_OUT",e[e.CIRC_OUT_IN=29]="CIRC_OUT_IN",e[e.ELASTIC_IN=30]="ELASTIC_IN",e[e.ELASTIC_OUT=31]="ELASTIC_OUT",e[e.ELASTIC_IN_OUT=32]="ELASTIC_IN_OUT",e[e.ELASTIC_OUT_IN=33]="ELASTIC_OUT_IN",e[e.BACK_IN=34]="BACK_IN",e[e.BACK_OUT=35]="BACK_OUT",e[e.BACK_IN_OUT=36]="BACK_IN_OUT",e[e.BACK_OUT_IN=37]="BACK_OUT_IN",e[e.BOUNCE_IN=38]="BOUNCE_IN",e[e.BOUNCE_OUT=39]="BOUNCE_OUT",e[e.BOUNCE_IN_OUT=40]="BOUNCE_IN_OUT",e[e.BOUNCE_OUT_IN=41]="BOUNCE_OUT_IN",e[e.SMOOTH=42]="SMOOTH",e[e.FADE=43]="FADE"}(Y_||(Y_=e("fE",{})));var af,of=((X_={})[Y_.CONSTANT]=__,X_[Y_.LINEAR]=f_,X_[Y_.QUAD_IN]=d_,X_[Y_.QUAD_OUT]=p_,X_[Y_.QUAD_IN_OUT]=m_,X_[Y_.QUAD_OUT_IN]=q_,X_[Y_.CUBIC_IN]=g_,X_[Y_.CUBIC_OUT]=v_,X_[Y_.CUBIC_IN_OUT]=y_,X_[Y_.CUBIC_OUT_IN]=K_,X_[Y_.QUART_IN]=E_,X_[Y_.QUART_OUT]=T_,X_[Y_.QUART_IN_OUT]=A_,X_[Y_.QUART_OUT_IN]=Q_,X_[Y_.QUINT_IN]=S_,X_[Y_.QUINT_OUT]=b_,X_[Y_.QUINT_IN_OUT]=w_,X_[Y_.QUINT_OUT_IN]=Z_,X_[Y_.SINE_IN]=R_,X_[Y_.SINE_OUT]=I_,X_[Y_.SINE_IN_OUT]=O_,X_[Y_.SINE_OUT_IN]=J_,X_[Y_.EXPO_IN]=N_,X_[Y_.EXPO_OUT]=C_,X_[Y_.EXPO_IN_OUT]=M_,X_[Y_.EXPO_OUT_IN]=$_,X_[Y_.CIRC_IN]=x_,X_[Y_.CIRC_OUT]=F_,X_[Y_.CIRC_IN_OUT]=P_,X_[Y_.CIRC_OUT_IN]=ef,X_[Y_.ELASTIC_IN]=D_,X_[Y_.ELASTIC_OUT]=L_,X_[Y_.ELASTIC_IN_OUT]=B_,X_[Y_.ELASTIC_OUT_IN]=tf,X_[Y_.BACK_IN]=U_,X_[Y_.BACK_OUT]=G_,X_[Y_.BACK_IN_OUT]=z_,X_[Y_.BACK_OUT_IN]=nf,X_[Y_.BOUNCE_IN]=k_,X_[Y_.BOUNCE_OUT]=H_,X_[Y_.BOUNCE_IN_OUT]=V_,X_[Y_.BOUNCE_OUT_IN]=rf,X_[Y_.SMOOTH]=W_,X_[Y_.FADE]=j_,X_);function uf(e){return of[e]}s(255),s(65280);var hf,cf,lf,_f=Hu.LINEAR<<0|Wu.NONE<<8|Y_.LINEAR<<16,ff=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r>0},set:function(e){this._flags&=-256,this._flags|=e<<0}},{key:"tangentWeightMode",get:function(){return(65280&this._flags)>>8},set:function(e){this._flags&=-65281,this._flags|=e<<8}},{key:"easingMethod",get:function(){return(16711680&this._flags)>>16},set:function(e){this._flags&=-16711681,this._flags|=e<<16}}]),t}(Bh);function df(e){var t=new ff;if("number"==typeof e)t.value=e;else{var i=e.interpolationMode,n=e.tangentWeightMode,r=e.value,s=e.rightTangent,a=e.rightTangentWeight,o=e.leftTangent,u=e.leftTangentWeight,h=e.easingMethod,c=e[oa];t.value=null!=r?r:t.value,t.rightTangent=null!=s?s:t.rightTangent,t.rightTangentWeight=null!=a?a:t.rightTangentWeight,t.leftTangent=null!=o?o:t.leftTangent,t.leftTangentWeight=null!=u?u:t.leftTangentWeight,t.interpolationMode=null!=i?i:t.interpolationMode,t.tangentWeightMode=null!=n?n:t.tangentWeightMode,t.easingMethod=null!=h?h:t.easingMethod,c&&(t[oa]=c)}return t}li.fastDefine("cc.RealKeyframeValue",ff,((af={interpolationMode:Hu.LINEAR,tangentWeightMode:Wu.NONE,value:0,rightTangent:0,rightTangentWeight:0,leftTangent:0,leftTangentWeight:0,easingMethod:Y_.LINEAR})[oa]=void 0,af)),li.Attr.setClassAttr(ff,oa,"editorOnly",!0),(hf=ff,null!==(lf=(cf=hf)[uh])&&void 0!==lf?lf:cf[uh]={}).uniquelyReferenced=!0;var pf,mf=e("fp",function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;rs){var u=this.postExtrapolation,h=i[n-1];if(u===Vu.CLAMP||n<2)return h.value;switch(u){case Vu.LINEAR:return xf(s,h.value,t[n-2],i[n-2].value,e);case Vu.LOOP:e=Cf(e,r,s);break;case Vu.PING_PONG:e=Mf(e,r,s);break;default:return h.value}}var c=ku(t,e);if(c>=0)return i[c].value;var l=~c,_=l-1,f=t[_],d=i[_],p=t[l];return function(e,t,i,n,r){var s=i-e;switch(t.interpolationMode){default:case Hu.CONSTANT:return t.value;case Hu.LINEAR:var a=t.easingMethod===Y_.LINEAR?r:uf(t.easingMethod)(r);return Ti(t.value,n.value,a);case Hu.CUBIC:var o=1/3,u=t.rightTangent,h=t.rightTangentWeight,c=0!=(t.tangentWeightMode&Wu.RIGHT),l=n.leftTangent,_=n.leftTangentWeight,f=0!=(n.tangentWeightMode&Wu.LEFT);if(c||f){var d=0;if(c)d=h;else{var p=s,m=s*u;d=Math.sqrt(p*p+m*m)*o}var g=Math.atan(u),v=Math.cos(g)*d+e,y=Math.sin(g)*d+t.value,E=0;if(f)E=_;else{var T=s,A=s*l;E=Math.sqrt(T*T+A*A)*o}var S=Math.atan(l),b=(v-e)/s,w=(-Math.cos(S)*E+i-e)/s,R=y,I=-Math.sin(S)*E+n.value,O=[0,0,0],N=function(e,t,i,n,r){var s=i/n,a=t/n,o=s*s,u=1/3*(-1/3*o+a),h=.5*(2/27*s*o-1/3*s*a+e/n),c=u*u*u,l=h*h+c,_=0;if(Xu(l)){if(Xu(h))return r[0]=0,1;var f=Math.cbrt(-h);return r[0]=2*f,r[1]=-f,2}if(l<0){var d=1/3*Math.acos(-h/Math.sqrt(-c)),p=2*Math.sqrt(-u);r[0]=p*Math.cos(d),r[1]=-p*Math.cos(d+Math.PI/3),r[2]=-p*Math.cos(d-Math.PI/3),_=3}else{var m=Math.sqrt(l),g=Math.cbrt(m-h),v=-Math.cbrt(m+h);r[0]=g+v,_=1}for(var y=1/3*s,E=0;E<_;++E)r[E]-=y;return _}(0-r,3*b,3*w-6*b,3*(b-w)+1,O),C=function(e,t,i){var n=i;if(1===t)n=e[0];else{n=-1/0;for(var r=0;r=0&&s<=1&&s>n&&(n=s)}n===-1/0&&(n=0)}return n}(O,N,r);return Ff(t.value,R,I,n.value,C)}var M=t.value+o*u*s,x=n.value-o*l*s;return Ff(t.value,M,x,n.value,r)}}(f,d,p,i[l],(e-f)/(p-f))},i.addKeyFrame=function(t,i){return e.prototype.addKeyFrame.call(this,t,df(i))},i.assignSorted=function(e,t){if(void 0!==t)this.setKeyframes(e.slice(),t.map((function(e){return df(e)})));else{var i=Array.from(e);this.setKeyframes(i.map((function(e){return e[0]})),i.map((function(e){return df(e[1])})))}},i.isConstant=function(e){if(this._values.length<=1)return!0;var t=this._values[0].value;return this._values.every((function(i){return vi(i.value,t,e)}))},i[pl]=function(e,t){if(t.toCCON){var i=this._times,n=this._values,r=i.length,s=new DataView(new ArrayBuffer(0+gf+gf+vf+yf*r+If*r)),a=0;s.setUint8(a,this.preExtrapolation),a+=gf,s.setUint8(a,this.postExtrapolation),a+=gf,s.setUint32(a,r,!0),a+=vf,i.forEach((function(e,t){return s.setFloat32(a+yf*t,e,!0)})),a+=yf*r;for(var o,u=E(n);!(o=u()).done;){var h=o.value;a=Of(s,h,a)}var c=new Uint8Array(s.buffer,0,a);e.writeProperty("bytes",c);var l=n.map((function(e){return e[oa]}));l.some((function(e){return void 0!==e}))&&e.writeProperty("keyframeValueEditorExtras",l)}else e.writeThis()},i[ml]=function(e,t){if(t.fromCCON){var i=e.readProperty("bytes"),n=new DataView(i.buffer,i.byteOffset,i.byteLength),r=0;this.preExtrapolation=n.getUint8(r),r+=gf,this.postExtrapolation=n.getUint8(r),r+=gf;var s=n.getUint32(r,!0);r+=vf;var a=Array.from({length:s},(function(e,t){return n.getFloat32(r+yf*t,!0)}));r+=yf*s;for(var o=new Array(s),u=0;u>8;return t.easingMethod=s,n}function Cf(e,t,i){return t+Ni(e-t,i-t)}function Mf(e,t,i){return t+Ci(e-t,i-t)}function xf(e,t,i,n,r){return t+(n-t)/(i-e)*(r-e)}function Ff(e,t,i,n,r){var s=1-r;return s*s*s*e+3*s*s*r*t+3*s*r*r*i+r*r*r*n}function Pf(e,t,i,n,r){var s=1-r;return s*(s*(e+(3*t-e)*r)+3*i*r*r)+n*r*r*r}R.bezier=Pf;var Df,Lf,Bf,Uf,Gf,zf,kf,Hf,Vf,Wf,jf,Xf=Math.cos,Yf=Math.acos,qf=Math.max,Kf=2*Math.PI,Qf=Math.sqrt;function Zf(e){return e<0?-Math.pow(-e,1/3):Math.pow(e,1/3)}function Jf(e,t){var i=function(e,t){var i,n,r,s,a=t-0,o=t-e[0],u=3*a,h=3*o,c=3*(t-e[2]),l=1/(-a+h-c+(t-1)),_=1/3,f=(u-6*o+c)*l,d=f*_,p=(-u+h)*l,m=(3*p-f*f)*_,g=m*_,v=(2*f*f*f-9*f*p+a*l*27)/27,y=v/2,E=y*y+g*g*g;if(E<0){var T=-m*_,A=Qf(T*T*T),S=-v/(2*A),b=Yf(S<-1?-1:S>1?1:S),w=2*Zf(A);return n=w*Xf(b*_)-d,r=w*Xf((b+Kf)*_)-d,s=w*Xf((b+2*Kf)*_)-d,n>=0&&n<=1?r>=0&&r<=1?s>=0&&s<=1?qf(n,r,s):qf(n,r):s>=0&&s<=1?qf(n,s):n:r>=0&&r<=1?s>=0&&s<=1?qf(r,s):r:s}if(0===E)return r=-(i=y<0?Zf(-y):-Zf(y))-d,(n=2*i-d)>=0&&n<=1?r>=0&&r<=1?qf(n,r):n:r;var R=Qf(E);return(i=Zf(-y+R))-Zf(y+R)-d}(e,t),n=e[1];return((1-i)*(n+(e[3]-n)*i)*3+i*i)*i}R.bezierByTime=Jf,function(e){e[e.SLERP=0]="SLERP",e[e.CONSTANT=1]="CONSTANT"}(jf||(jf=e("fH",{})));var $f,ed=th("cc.QuatKeyframeValue")(Df=fh((Bf=A((Lf=function(e){var t=void 0===e?{}:e,i=t.value,n=t.interpolationMode,r=t.easingMethod;T(this,"interpolationMode",Bf,this),T(this,"value",Uf,this),T(this,"easingMethod",Gf,this),this.value=i?Hi.clone(i):this.value,this.interpolationMode=null!=n?n:this.interpolationMode,this.easingMethod=null!=r?r:this.easingMethod}).prototype,"interpolationMode",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return jf.SLERP}}),Uf=A(Lf.prototype,"value",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Hi.clone(Hi.IDENTITY)}}),Gf=A(Lf.prototype,"easingMethod",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Y_.LINEAR}}),Df=Lf))||Df)||Df;function td(e){return new ed(e)}e("fr",th("cc.QuatCurve")((Wf=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;rh){var l=r[o-1];switch(s){case Vu.LOOP:e=u+Ni(e-u,h-u);break;case Vu.PING_PONG:e=u+Ci(e-u,h-u);break;case Vu.CLAMP:default:return Hi.copy(t,l.value)}}var _=ku(n,e);if(_>=0)return Hi.copy(t,r[_].value);var f=~_,d=f-1,p=n[d],m=r[d],g=n[f],v=r[f],y=(e-p)/(g-p);switch(m.interpolationMode){default:case jf.CONSTANT:return Hi.copy(t,m.value);case jf.SLERP:var E=m.easingMethod,T=E===Y_.LINEAR?y:Array.isArray(E)?Jf(E,y):uf(E)(y);return Hi.slerp(t,m.value,v.value,T)}},i.addKeyFrame=function(t,i){var n=new ed(i);return e.prototype.addKeyFrame.call(this,t,n)},i.assignSorted=function(e,t){if(void 0!==t)this.setKeyframes(e.slice(),t.map((function(e){return td(e)})));else{var i=Array.from(e);this.setKeyframes(i.map((function(e){return e[0]})),i.map((function(e){return td(e[1])})))}},i[pl]=function(e,t){if(t.toCCON){var i=this._times,n=this._values,r=!0;n.forEach((function(e,t,i){var n=i[0];r&&e.interpolationMode!==n.interpolationMode&&(r=!1)}));var s=i.length,a=od*(r?1:s),o=n.reduce((function(e,t){var i=t.easingMethod;return e+(Array.isArray(i)?ud+4*cd:ud)}),0),u=0,h=new DataView(new ArrayBuffer(u+=nd+rd+sd*s+4*ad*s+o+a+0)),c=0,l=0;r&&(l|=$f.INTERPOLATION_MODE),h.setUint32(c,l,!0),c+=nd,h.setUint32(c,s,!0),c+=rd,i.forEach((function(e,t){return h.setFloat32(c+sd*t,e,!0)})),c+=sd*s,n.forEach((function(e,t){var i=e.value,n=i.x,r=i.y,s=i.z,a=i.w,o=c+4*ad*t;h.setFloat32(o+0*ad,n,!0),h.setFloat32(o+1*ad,r,!0),h.setFloat32(o+2*ad,s,!0),h.setFloat32(o+3*ad,a,!0)})),c+=4*ad*s,n.forEach((function(e){var t=e.easingMethod;Array.isArray(t)?(h.setUint8(c,hd),++c,h.setFloat32(c+0*cd,t[0],!0),h.setFloat32(c+1*cd,t[1],!0),h.setFloat32(c+2*cd,t[2],!0),h.setFloat32(c+3*cd,t[3],!0),c+=4*cd):(h.setUint8(c,t),++c)}));var _=c;c+=a;var f=_;n.forEach((function(e){var t=e.interpolationMode;h.setUint8(f,t),r||(f+=od)}));var d=new Uint8Array(h.buffer);e.writeProperty("bytes",d)}else e.writeThis()},i[ml]=function(e,t){if(t.fromCCON){var i=e.readProperty("bytes"),n=new DataView(i.buffer,i.byteOffset,i.byteLength),r=0,s=n.getUint32(r,!0);r+=nd;var a=s&$f.INTERPOLATION_MODE,o=n.getUint32(r,!0);r+=rd;var u=Array.from({length:o},(function(e,t){return n.getFloat32(r+sd*t,!0)})),h=r+=sd*o;r+=4*ad*o;var c=Array.from({length:o},(function(e,t){var i=h+4*ad*t,s=n.getFloat32(i+0*ad,!0),a=n.getFloat32(i+1*ad,!0),o=n.getFloat32(i+2*ad,!0),u=n.getFloat32(i+3*ad,!0),c=n.getUint8(r);++r;var l=td({value:{x:s,y:a,z:o,w:u}});return c!==hd?l.easingMethod=c:(l.easingMethod=[n.getFloat32(r+0*cd,!0),n.getFloat32(r+1*cd,!0),n.getFloat32(r+2*cd,!0),n.getFloat32(r+3*cd,!0)],r+=4*cd),l}));if(a){var l=n.getUint8(r);++r;for(var _=0;_=0)return this._values[t];var i=yi(~t-1,0,this._values.length-1);return this._values[i]},t}(ju))||id),e("cg",(function(){this.time=0,this.value=0,this.inTangent=0,this.outTangent=0})));li.fastDefine("cc.Keyframe",ld,{time:0,value:0,inTangent:0,outTangent:0});var _d,fd=function(){function e(){this.index=void 0,this.time=void 0,this.endTime=void 0,this.coefficient=void 0,this.index=-1,this.time=0,this.endTime=0,this.coefficient=new Float32Array(4)}return e.prototype.evaluate=function(e){return t=e-this.time,i=this.coefficient,t*(t*(t*i[0]+i[1])+i[2])+i[3];var t,i},e}(),dd=e("ch",function(){function e(e){if(void 0===e&&(e=null),this.cachedKey=void 0,e instanceof mf)this._curve=e;else{var t=new mf;this._curve=t,t.preExtrapolation=Vu.LOOP,t.postExtrapolation=Vu.CLAMP,e?t.assignSorted(e.map((function(e){return[e.time,{interpolationMode:Hu.CUBIC,value:e.value,leftTangent:e.inTangent,rightTangent:e.outTangent}]}))):t.assignSorted([[0,{interpolationMode:Hu.CUBIC,value:1}],[1,{interpolationMode:Hu.CUBIC,value:1}]])}this.cachedKey=new fd}var t=e.prototype;return t.addKey=function(e){e?this._curve.addKeyFrame(e.time,{interpolationMode:Hu.CUBIC,value:e.value,leftTangent:e.inTangent,rightTangent:e.outTangent}):this._curve.clear()},t.evaluate_slow=function(e){return this._curve.evaluate(e)},t.evaluate=function(e){var t=this.cachedKey,i=this._curve,n=i.keyFramesCount-1,r=e,s=e<0?i.preExtrapolation:i.postExtrapolation,a=i.getKeyframeTime(0),o=i.getKeyframeTime(n);switch(s){case Vu.LOOP:r=Ni(e-a,o-a)+a;break;case Vu.PING_PONG:r=Ci(e-a,o-a)+a;break;case Vu.CLAMP:default:r=yi(e,a,o)}if(r>=t.time&&ri.getKeyframeTime(r))for(var s=0;s<3;s++){var a=r+s;if(a+1t)return a}else for(var o=0;o<3;o++){var u=r-o;if(u>=0&&i.getKeyframeTime(u-1)<=t)return u-1}for(var h,c=0,l=n;l-c>1;)h=Math.floor((c+l)/2),i.getKeyframeTime(h)>=t?l=h:c=h;return c},c(e,[{key:"_internalCurve",get:function(){return this._curve}},{key:"keyFrames",get:function(){return Array.from(this._curve.keyframes()).map((function(e){var t=e[0],i=e[1],n=new ld;return n.time=t,n.value=i.value,n.inTangent=i.leftTangent,n.outTangent=i.rightTangent,n}))},set:function(e){this._curve.assignSorted(e.map((function(e){return[e.time,{interpolationMode:Hu.CUBIC,value:e.value,leftTangent:e.inTangent,rightTangent:e.outTangent}]})))}},{key:"preWrapMode",get:function(){return md(this._curve.preExtrapolation)},set:function(e){this._curve.preExtrapolation=pd(e)}},{key:"postWrapMode",get:function(){return md(this._curve.postExtrapolation)},set:function(e){this._curve.postExtrapolation=pd(e)}}]),e}());function pd(e){switch(e){default:case Pu.Default:case Pu.Normal:case Pu.Clamp:return Vu.CLAMP;case Pu.PingPong:return Vu.PING_PONG;case Pu.Loop:return Vu.LOOP}}function md(e){switch(e){default:case Vu.LINEAR:case Vu.CLAMP:return Pu.Clamp;case Vu.PING_PONG:return Pu.PingPong;case Vu.LOOP:return Pu.Loop}}dd.defaultKF=[{time:0,value:1,inTangent:0,outTangent:0},{time:1,value:1,inTangent:0,outTangent:0}],li.fastDefine("cc.AnimationCurve",dd,{_curve:null}),function(e){e[e.LINEAR=0]="LINEAR",e[e.BEZIER=1]="BEZIER",e[e.CATMULL_ROM=2]="CATMULL_ROM"}(_d||(_d=e("ci",{})));var gd=4294967295,vd=new Di,yd=new Di,Ed=new Di,Td=new Di;function Ad(e,t){console.warn(e+" is deprecated, please use "+t+" instead.")}e("cj",function(){function e(e,t){void 0===e&&(e=_d.CATMULL_ROM),void 0===t&&(t=[]),this._type=void 0,this._mode=_d.CATMULL_ROM,this._knots=[],this._type=to.SHAPE_SPLINE,this._mode=e;for(var i=0;i=this._knots.length?this._knots.push(i):this._knots.splice(e,0,i)},t.removeKnot=function(e){e>=0&&this._knots.length,this._knots.splice(e,1)},t.setKnot=function(e,t){e>=0&&this._knots.length,this._knots[e].set(t)},t.getKnot=function(e){return e>=0&&this._knots.length,this._knots[e]},t.getPoint=function(t,i){void 0===i&&(i=gd),t=yi(t,0,1);var n=this.getSegments();if(0==n)return new Di(0,0,0);if(i==gd){var r=1/n;i=Math.floor(t/r),t=t%r/r}if(i>=n)return new Di(this._knots[this._knots.length-1]);switch(this._mode){case _d.LINEAR:return e.calcLinear(this._knots[i],this._knots[i+1],t);case _d.BEZIER:return e.calcBezier(this._knots[4*i],this._knots[4*i+1],this._knots[4*i+2],this._knots[4*i+3],t);case _d.CATMULL_ROM:var s=i>0?this._knots[i-1]:this._knots[i],a=i+219||i<0)console.warn("maximum layers reached.");else{var n=1<19||t<0)console.warn("do not change buildin layers.");else{var i=1<31||t<0?(console.warn("Unable to access unknown layer."),""):e.Enum[1<>>26})),em=e("ey",(function(e){return(e&Qp)>>>20})),tm=e("ez",(function(e){return(e&Zp)>>>12})),im=e("eA",(function(e){return 4095&e})),nm=e("eB",(function(e,t){return 67108863&e|t<<26&Kp})),rm=e("eC",((Vp={})[yn.UNKNOWN]=function(){return console.warn("illegal uniform handle")},Vp[yn.INT]=function(e,t,i){return void 0===i&&(i=0),e[i]},Vp[yn.INT2]=function(e,t,i){return void 0===i&&(i=0),en.fromArray(t,e,i)},Vp[yn.INT3]=function(e,t,i){return void 0===i&&(i=0),Di.fromArray(t,e,i)},Vp[yn.INT4]=function(e,t,i){return void 0===i&&(i=0),sn.fromArray(t,e,i)},Vp[yn.FLOAT]=function(e,t,i){return void 0===i&&(i=0),e[i]},Vp[yn.FLOAT2]=function(e,t,i){return void 0===i&&(i=0),en.fromArray(t,e,i)},Vp[yn.FLOAT3]=function(e,t,i){return void 0===i&&(i=0),Di.fromArray(t,e,i)},Vp[yn.FLOAT4]=function(e,t,i){return void 0===i&&(i=0),sn.fromArray(t,e,i)},Vp[yn.MAT3]=function(e,t,i){return void 0===i&&(i=0),Gi.fromArray(t,e,i)},Vp[yn.MAT4]=function(e,t,i){return void 0===i&&(i=0),Qi.fromArray(t,e,i)},Vp)),sm=e("eD",((Wp={})[yn.UNKNOWN]=function(){return console.warn("illegal uniform handle")},Wp[yn.INT]=function(e,t,i){return void 0===i&&(i=0),e[i]=t},Wp[yn.INT2]=function(e,t,i){return void 0===i&&(i=0),en.toArray(e,t,i)},Wp[yn.INT3]=function(e,t,i){return void 0===i&&(i=0),Di.toArray(e,t,i)},Wp[yn.INT4]=function(e,t,i){return void 0===i&&(i=0),sn.toArray(e,t,i)},Wp[yn.FLOAT]=function(e,t,i){return void 0===i&&(i=0),e[i]=t},Wp[yn.FLOAT2]=function(e,t,i){return void 0===i&&(i=0),en.toArray(e,t,i)},Wp[yn.FLOAT3]=function(e,t,i){return void 0===i&&(i=0),Di.toArray(e,t,i)},Wp[yn.FLOAT4]=function(e,t,i){return void 0===i&&(i=0),sn.toArray(e,t,i)},Wp[yn.MAT3]=function(e,t,i){return void 0===i&&(i=0),Gi.toArray(e,t,i)},Wp[yn.MAT4]=function(e,t,i){return void 0===i&&(i=0),Qi.toArray(e,t,i)},Wp)),am=[Object.freeze([0]),Object.freeze([0,0]),Object.freeze([0,0,0,0]),Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])];function om(e){switch(e){case yn.BOOL:case yn.INT:case yn.UINT:case yn.FLOAT:return am[0];case yn.BOOL2:case yn.INT2:case yn.UINT2:case yn.FLOAT2:return am[1];case yn.BOOL4:case yn.INT4:case yn.UINT4:case yn.FLOAT4:return am[2];case yn.MAT4:return am[3];case yn.SAMPLER2D:return"default-texture";case yn.SAMPLER_CUBE:return"default-cube-texture"}return am[0]}function um(e,t){for(var i=Object.entries(t),n=!1,r=0;r31&&(i.uber=!0),i.constantMacros="",i.builtins.statistics)i.constantMacros+="#define "+a+" "+i.builtins.statistics[a]+"\n";if(this._templates[e.name]=i,!this._templateInfos[i.hash]){var o={};o.samplerStartBinding=i.blocks.length,o.shaderInfo=new kr,o.blockSizes=[],o.bindings=[];for(var u=0;u>2)*o.count}for(var u=0;u0&&this.shaders.length>0},t}(Cc),Sm._effects={},Sm._layoutValid=!0,ym=A((vm=bm).prototype,"techniques",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Em=A(vm.prototype,"shaders",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Tm=A(vm.prototype,"combinations",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Am=A(vm.prototype,"hideInEditor",[hh,lh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),gm=vm))||gm);R.EffectAsset=Im;var Om,Nm,Cm,Mm,xm,Fm,Pm,Dm,Lm,Bm,Um,Gm,zm,km,Hm;!function(e){e[e.RGB565=gn.R5G6B5]="RGB565",e[e.RGB5A1=gn.RGB5A1]="RGB5A1",e[e.RGBA4444=gn.RGBA4]="RGBA4444",e[e.RGB888=gn.RGB8]="RGB888",e[e.RGB32F=gn.RGB32F]="RGB32F",e[e.RGBA8888=gn.RGBA8]="RGBA8888",e[e.RGBA32F=gn.RGBA32F]="RGBA32F",e[e.A8=gn.A8]="A8",e[e.I8=gn.L8]="I8",e[e.AI8=gn.LA8]="AI8",e[e.RGB_PVRTC_2BPPV1=gn.PVRTC_RGB2]="RGB_PVRTC_2BPPV1",e[e.RGBA_PVRTC_2BPPV1=gn.PVRTC_RGBA2]="RGBA_PVRTC_2BPPV1",e[e.RGB_A_PVRTC_2BPPV1=1024]="RGB_A_PVRTC_2BPPV1",e[e.RGB_PVRTC_4BPPV1=gn.PVRTC_RGB4]="RGB_PVRTC_4BPPV1",e[e.RGBA_PVRTC_4BPPV1=gn.PVRTC_RGBA4]="RGBA_PVRTC_4BPPV1",e[e.RGB_A_PVRTC_4BPPV1=1025]="RGB_A_PVRTC_4BPPV1",e[e.RGB_ETC1=gn.ETC_RGB8]="RGB_ETC1",e[e.RGBA_ETC1=1026]="RGBA_ETC1",e[e.RGB_ETC2=gn.ETC2_RGB8]="RGB_ETC2",e[e.RGBA_ETC2=gn.ETC2_RGBA8]="RGBA_ETC2",e[e.RGBA_ASTC_4x4=gn.ASTC_RGBA_4X4]="RGBA_ASTC_4x4",e[e.RGBA_ASTC_5x4=gn.ASTC_RGBA_5X4]="RGBA_ASTC_5x4",e[e.RGBA_ASTC_5x5=gn.ASTC_RGBA_5X5]="RGBA_ASTC_5x5",e[e.RGBA_ASTC_6x5=gn.ASTC_RGBA_6X5]="RGBA_ASTC_6x5",e[e.RGBA_ASTC_6x6=gn.ASTC_RGBA_6X6]="RGBA_ASTC_6x6",e[e.RGBA_ASTC_8x5=gn.ASTC_RGBA_8X5]="RGBA_ASTC_8x5",e[e.RGBA_ASTC_8x6=gn.ASTC_RGBA_8X6]="RGBA_ASTC_8x6",e[e.RGBA_ASTC_8x8=gn.ASTC_RGBA_8X8]="RGBA_ASTC_8x8",e[e.RGBA_ASTC_10x5=gn.ASTC_RGBA_10X5]="RGBA_ASTC_10x5",e[e.RGBA_ASTC_10x6=gn.ASTC_RGBA_10X6]="RGBA_ASTC_10x6",e[e.RGBA_ASTC_10x8=gn.ASTC_RGBA_10X8]="RGBA_ASTC_10x8",e[e.RGBA_ASTC_10x10=gn.ASTC_RGBA_10X10]="RGBA_ASTC_10x10",e[e.RGBA_ASTC_12x10=gn.ASTC_RGBA_12X10]="RGBA_ASTC_12x10",e[e.RGBA_ASTC_12x12=gn.ASTC_RGBA_12X12]="RGBA_ASTC_12x12"}(Om||(Om=e("dz",{}))),function(e){e[e.REPEAT=Mn.WRAP]="REPEAT",e[e.CLAMP_TO_EDGE=Mn.CLAMP]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=Mn.MIRROR]="MIRRORED_REPEAT",e[e.CLAMP_TO_BORDER=Mn.BORDER]="CLAMP_TO_BORDER"}(Nm||(Nm=e("f0",{}))),function(e){e[e.NONE=Cn.NONE]="NONE",e[e.LINEAR=Cn.LINEAR]="LINEAR",e[e.NEAREST=Cn.POINT]="NEAREST"}(Cm||(Cm=e("dB",{}))),gt(gn);var Vm,Wm,jm,Xm,Ym=new Ae("Tex"),qm=e("eq",th("cc.TextureBase")((Hm=km=function(e){function t(){var t;return T(t=e.call(this)||this,"_format",Fm,v(t)),T(t,"_minFilter",Pm,v(t)),T(t,"_magFilter",Dm,v(t)),T(t,"_mipFilter",Lm,v(t)),T(t,"_wrapS",Bm,v(t)),T(t,"_wrapT",Um,v(t)),T(t,"_wrapR",Gm,v(t)),T(t,"_anisotropy",zm,v(t)),t._width=1,t._height=1,t._id=void 0,t._samplerInfo=new Cr,t._gfxSampler=null,t._gfxDevice=null,t._textureHash=0,t._id=Ym.getNewId(),t._gfxDevice=t._getGFXDevice(),t._textureHash=xs(t._id,666),t}_(t,e);var i=t.prototype;return i.getId=function(){return this._id},i.getPixelFormat=function(){return this._format},i.getAnisotropy=function(){return this._anisotropy},i.setWrapMode=function(e,t,i){void 0===i&&(i=e),this._wrapS=e,this._samplerInfo.addressU=e,this._wrapT=t,this._samplerInfo.addressV=t,this._wrapR=i,this._samplerInfo.addressW=i,this._gfxDevice&&(this._gfxSampler=this._gfxDevice.getSampler(this._samplerInfo))},i.setFilters=function(e,t){this._minFilter=e,this._samplerInfo.minFilter=e,this._magFilter=t,this._samplerInfo.magFilter=t,this._gfxDevice&&(this._gfxSampler=this._gfxDevice.getSampler(this._samplerInfo))},i.setMipFilter=function(e){this._mipFilter=e,this._samplerInfo.mipFilter=e,this._gfxDevice&&(this._gfxSampler=this._gfxDevice.getSampler(this._samplerInfo))},i.setAnisotropy=function(e){this._anisotropy=e,this._samplerInfo.maxAnisotropy=e,this._gfxDevice&&(this._gfxSampler=this._gfxDevice.getSampler(this._samplerInfo))},i.destroy=function(){var t,i=e.prototype.destroy.call(this);return i&&(null===(t=R.director.root)||void 0===t?void 0:t.batcher2D)&&R.director.root.batcher2D._releaseDescriptorSetCache(this._textureHash),i},i.getHash=function(){return this._textureHash},i.getGFXTexture=function(){return null},i.getSamplerInfo=function(){return this._samplerInfo},i.getGFXSampler=function(){return this._gfxSampler||(this._gfxDevice?this._gfxSampler=this._gfxDevice.getSampler(this._samplerInfo):K(9302)),this._gfxSampler},i._serialize=function(){return""},i._deserialize=function(e){var t=e.split(",");t.unshift(""),t.length>=5&&(this.setFilters(parseInt(t[1]),parseInt(t[2])),this.setWrapMode(parseInt(t[3]),parseInt(t[4]))),t.length>=7&&(this.setMipFilter(parseInt(t[5])),this.setAnisotropy(parseInt(t[6])))},i._getGFXDevice=function(){return Va.gfxDevice},i._getGFXFormat=function(){return this._getGFXPixelFormat(this._format)},i._setGFXFormat=function(e){this._format=void 0===e?Om.RGBA8888:e},i._getGFXPixelFormat=function(e){return e===Om.RGBA_ETC1?e=Om.RGB_ETC1:e===Om.RGB_A_PVRTC_4BPPV1?e=Om.RGB_PVRTC_4BPPV1:e===Om.RGB_A_PVRTC_2BPPV1&&(e=Om.RGB_PVRTC_2BPPV1),e},c(t,[{key:"isCompressed",get:function(){return this._format>=Om.RGB_ETC1&&this._format<=Om.RGBA_ASTC_12x12||this._format>=Om.RGB_A_PVRTC_2BPPV1&&this._format<=Om.RGBA_ETC1}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}}]),t}(Cc),km.PixelFormat=Om,km.WrapMode=Nm,km.Filter=Cm,Fm=A((xm=Hm).prototype,"_format",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Om.RGBA8888}}),Pm=A(xm.prototype,"_minFilter",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Cm.LINEAR}}),Dm=A(xm.prototype,"_magFilter",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Cm.LINEAR}}),Lm=A(xm.prototype,"_mipFilter",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Cm.NONE}}),Bm=A(xm.prototype,"_wrapS",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Nm.REPEAT}}),Um=A(xm.prototype,"_wrapT",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Nm.REPEAT}}),Gm=A(xm.prototype,"_wrapR",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Nm.REPEAT}}),zm=A(xm.prototype,"_anisotropy",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Mm=xm))||Mm);function Km(e){return!!(ka.hasFeature(ka.Feature.IMAGE_BITMAP)&&e instanceof ImageBitmap)}R.TextureBase=qm;var Qm=e("dG",th("cc.ImageAsset")((Xm=jm=function(e){function t(t){var i;return(i=e.call(this)||this)._nativeData=void 0,i._exportedExts=void 0,i._format=Om.RGBA8888,i._width=0,i._height=0,i._nativeData={_data:null,width:0,height:0,format:0,_compressed:!1},void 0!==t&&i.reset(t),i}_(t,e);var i=t.prototype;return i.reset=function(e){Km(e)||e instanceof HTMLElement?this._nativeData=e:(this._nativeData=e,this._format=e.format)},i.destroy=function(){return this.data&&this.data instanceof HTMLImageElement?(this.data.src="",this._setRawAsset("")):Km(this.data)&&this.data.close&&this.data.close(),e.prototype.destroy.call(this)},i._serialize=function(){},i._deserialize=function(e){var i="";"string"==typeof e?i=e:(this._width=e.w,this._height=e.h,i=e.fmt);for(var n,r=Va.gfxDevice,s=i.split("_"),a=Number.MAX_VALUE,o=this._format,u="",h=At.SUPPORT_TEXTURE_FORMATS,c=E(s);!(n=c()).done;){var l=n.value.split("@"),_=parseInt(l[0],void 0),f=t.extnames[_]||l[0],d=h.indexOf(f);if(-1!==d&&d=Om.RGB_ETC1&&this._format<=Om.RGBA_ASTC_12x12||this._format>=Om.RGB_A_PVRTC_2BPPV1&&this._format<=Om.RGBA_ETC1}},{key:"url",get:function(){return this.nativeUrl}}]),t}(Cc),jm.extnames=[".png",".jpg",".jpeg",".bmp",".webp",".pvr",".pkm",".astc"],jm._sharedPlaceHolderCanvas=null,A((Wm=Xm).prototype,"_nativeAsset",[Lh],Object.getOwnPropertyDescriptor(Wm.prototype,"_nativeAsset"),Wm.prototype),Vm=Wm))||Vm);R.ImageAsset=Qm;var Zm=new WeakMap,Jm=new WeakSet,$m=new WeakSet;function eg(e,t){var i;i=fl.safeFindClass;var n,r=Nl.pool.get();try{n=kl(e,r,{classFinder:i,customEnv:t})}catch(e){throw U(e),Nl.pool.put(r),e}n._uuid=t.__uuid__||"";for(var s=r.uuidList,a=r.uuidObjList,o=r.uuidPropList,u=r.uuidTypeList||[],h=[],c=0;c>t,r.texExtent.height=this._textureHeight>>t,r.texSubres.mipLevel=t,r.texSubres.baseArrayLayer=i,ArrayBuffer.isView(e)?n.copyBuffersToTexture([e],this._gfxTexture,rg):n.copyTexImagesToTexture([e],this._gfxTexture,rg)}}},i._assignImage=function(e,t,i){var n=e.data;if(n&&(this.uploadData(n,t,i),this._checkTextureLoaded(),At.CLEANUP_IMAGE_CACHE)){var r=ng.getDeps(this._uuid),s=r.indexOf(e._uuid);-1!==s&&(ge(r,s),e.decRef())}},i._checkTextureLoaded=function(){this._textureReady()},i._textureReady=function(){this.loaded=!0,this.emit("load")},i._setMipmapLevel=function(e){this._mipmapLevel=e<1?1:e},i._setMipRange=function(e,t){this._baseLevel=e<1?0:e,this._maxLevel=t<1?0:t},i.setMipRange=function(e,t){J(e<=t,3124),this._setMipRange(e,t);var i=this._getGFXDevice();if(i){var n=this._createTextureView(i);this._tryDestroyTextureView(),this._gfxTextureView=n}},i._getGfxTextureCreateInfo=function(){return null},i._getGfxTextureViewCreateInfo=function(){return null},i._tryReset=function(){if(this._tryDestroyTextureView(),this._tryDestroyTexture(),0!==this._mipmapLevel){var e=this._getGFXDevice();e&&(this._createTexture(e),this._gfxTextureView=this._createTextureView(e))}},i.isUsingOfflineMipmaps=function(){return!1},i._createTexture=function(e){if(0!==this._width&&0!==this._height){var t=Rn.NONE;this._mipFilter!==Cm.NONE&&function(e,t,i){return!(e.gfxAPI===dn.WEBGL)||sg(t)&&sg(i)}(e,this._width,this._height)&&(this._mipmapLevel=function(e,t){for(var i=Math.max(e,t),n=0;i;)i>>=1,n++;return n}(this._width,this._height),this.isUsingOfflineMipmaps()||(t=Rn.GEN_MIPMAP));var i=this._getGfxTextureCreateInfo({usage:wn.SAMPLED|wn.TRANSFER_DST,format:this._getGFXFormat(),levelCount:this._mipmapLevel,flags:t});if(i){var n=e.createTexture(i);this._textureWidth=i.width,this._textureHeight=i.height,this._gfxTexture=n}}},i._createTextureView=function(e){if(!this._gfxTexture)return null;var t=this._maxLevel=this._mipmaps.length))for(var i=Math.min(void 0===t?this._mipmaps.length:t,this._mipmaps.length-e),n=0;n"},i.releaseTexture=function(){this.destroy()},i._serialize=function(){return null},i._deserialize=function(t,i){var n=t;e.prototype._deserialize.call(this,n.base,i),this._mipmaps=new Array(n.mipmaps.length);for(var r=0;r0){var i=this._mipmaps[0];this.reset({width:i.width,height:i.height,format:i.format,mipmapLevel:this._mipmaps.length,baseLevel:this._baseLevel,maxLevel:this._maxLevel}),this._mipmaps.forEach((function(e,i){t._assignImage(e,i)}))}else this.reset({width:0,height:0,mipmapLevel:this._mipmaps.length,baseLevel:this._baseLevel,maxLevel:this._maxLevel})}},{key:"image",get:function(){return 0===this._mipmaps.length?null:this._mipmaps[0]},set:function(e){this.mipmaps=e?[e]:[]}}]),t}(_g),cg=A((hg=lg).prototype,"_mipmaps",[og],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),ug=hg))||ug));R.Texture2D=Sg,function(e){e[e.right=0]="right",e[e.left=1]="left",e[e.top=2]="top",e[e.bottom=3]="bottom",e[e.front=4]="front",e[e.back=5]="back"}(Tg||(Tg={})),function(e){e[e.NONE=0]="NONE",e[e.AUTO=1]="AUTO",e[e.BAKED_CONVOLUTION_MAP=2]="BAKED_CONVOLUTION_MAP"}(Ag||(Ag={}));var bg=e("h4",th("cc.TextureCube")((Eg=yg=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r=this._mipmaps.length))for(var n=Math.min(void 0===t?this._mipmaps.length:t,this._mipmaps.length-e),r=function(t){var n=e+t;wg(i._mipmaps[n],(function(e,t){i._assignImage(e,n,t)}))},s=0;s0){var i=this._mipmaps[0].front;this.reset({width:i.width,height:i.height,format:i.format,mipmapLevel:this._mipmaps.length,baseLevel:this._baseLevel,maxLevel:this._maxLevel}),this._mipmaps.forEach((function(e,i){wg(e,(function(e,n){t._assignImage(e,i,n)}))}))}else this.reset({width:0,height:0,mipmapLevel:this._mipmaps.length,baseLevel:this._baseLevel,maxLevel:this._maxLevel})}},{key:"mipmapAtlas",get:function(){return this._mipmapAtlas},set:function(e){var t=this;if(this._mipmapAtlas=e,this._mipmapAtlas){var i=this._mipmapAtlas.atlas.front;if(i.data){var n=this._mipmapAtlas.atlas,r=this._mipmapAtlas.layout,s=r[0],a=Object.assign(document.createElement("canvas"),{width:i.width,height:i.height}).getContext("2d");this.reset({width:s.width,height:s.height,format:i.format,mipmapLevel:r.length});for(var o=function(e){var s=r[e];wg(n,(function(e,n){a.clearRect(0,0,i.width,i.height);var r=e.data;a.drawImage(r,0,0);var o=a.getImageData(s.left,s.top,s.width,s.height),u=new Qm({_data:o.data,_compressed:e.isCompressed,width:o.width,height:o.height,format:e.format});t._assignImage(u,s.level,n)}))},u=0;ut.length)||47===e.charCodeAt(t.length)}(r,e)||!e)for(var s=0,a=i.length;s0&&function(e){var t=Object.create(null);if(t[e._uuid]=e.refCount,Cg(e,t,Mg,-1),Mg.length=0,0!==t[e._uuid])return t[e._uuid];for(var i in t)0!==t[i]&&Cg(Hh.get(i),t,Mg,1);return Mg.length=0,t[e._uuid]}(e)>0)){Hh.remove(i);for(var n=ng.getDeps(i),r=0,s=n.length;rthis._maxInterval?this._maxInterval:t;e-this._lastDate>1e3*i&&(this._totalNumThisPeriod=0,this._lastDate=e)},t._handleQueue=function(e,t){for(this._checkNextPeriod=!1,this._updateTime();this._queue.length>0&&this._totalNum0&&(xt(this._handleQueue.bind(this),e,t),this._checkNextPeriod=!0)},c(e,[{key:"remoteServerAddress",get:function(){return this._remoteServerAddress}}]),e}(),pv=e("d9",new dv),mv=e("h3",th("cc.JsonAsset")((ev=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r0){var a=Zh.create({input:s,progress:r,options:n,onProgress:e.onProgress,onError:Zh.prototype.recycle,onComplete:function(n){var r;n||((r=e.output).push.apply(r,a.output),a.recycle()),i&&Mv(e),t(n)}});Yh.async(a)}else i&&Mv(e),t()}))}function Mv(e){for(var t=e.output,i=0,n=t.length;i6||u<3||u>6||h<3||h>6)&&(o<4||7===o||9===o||11===o||o>12||u<4||7===u||9===u||11===u||u>12||1!==h))throw new Error("Invalid block number in ASTC header");var c=function(e,t){return 4===e?Om.RGBA_ASTC_4x4:5===e?4===t?Om.RGBA_ASTC_5x4:Om.RGBA_ASTC_5x5:6===e?5===t?Om.RGBA_ASTC_6x5:Om.RGBA_ASTC_6x6:8===e?5===t?Om.RGBA_ASTC_8x5:6===t?Om.RGBA_ASTC_8x6:Om.RGBA_ASTC_8x8:10===e?5===t?Om.RGBA_ASTC_10x5:6===t?Om.RGBA_ASTC_10x6:8===t?Om.RGBA_ASTC_10x8:Om.RGBA_ASTC_10x10:10===t?Om.RGBA_ASTC_12x10:Om.RGBA_ASTC_12x12}(o,u),l=a[7]+(a[8]<<8)+(a[9]<<16),_=a[10]+(a[11]<<8)+(a[12]<<16);a[13],a[14],a[15],r={_data:new Uint8Array(s,16),_compressed:!0,width:l,height:_,format:c}}catch(e){n=e}i(n,r)},t.parsePlist=function(e,t,i){var n=null,r=xv.parse(e);r||(n=new Error("parse failed")),i(n,r)},t.parseImport=function(e,t,i){if(e){var n=null,r=null;try{n=eg(e,t)}catch(e){r=e}i(r,n)}else i(new Error("The json file of asset "+t.__uuid__+" is empty or missing"))},t.init=function(){this._parsing.clear()},t.register=function(e,t){"object"==typeof e?_t.mixin(this._parsers,e):this._parsers[e]=t},t.parse=function(e,t,i,n,r){var s=this,a=Wh.get(e);if(a)r(null,a);else{var o=this._parsing.get(e);if(o)o.push(r);else{var u=this._parsers[i];u?(this._parsing.add(e,[r]),u(t,n,(function(t,i){t?Vh.remove(e):ac(i)||Wh.add(e,i);for(var n=s._parsing.remove(e),r=0,a=n.length;r=1024)&&c.lightingMap===a&&c.stride===r){if(c.count>=c.capacity){c.capacity<<=1;var l=c.stride*c.capacity,_=c.data;c.data=new Uint8Array(l),c.data.set(_),c.vb.resize(l)}return c.shader!==o&&(c.shader=o),c.descriptorSet!==u&&(c.descriptorSet=u),c.data.set(t.buffer,c.stride*c.count++),void(this.hasPendingModels=!0)}}for(var f=this._device.createBuffer(new Sr(En.VERTEX|En.TRANSFER_DST,Sn.HOST|Sn.DEVICE,32*r,r)),d=new Uint8Array(32*r),p=s.vertexBuffers.slice(),m=s.attributes.slice(),g=s.indexBuffer,v=0;vm.size&&(m.resize(r),_.vbDatas[d]=new Uint8Array(r),_.vbDatas[d].set(g)),_.vbDatas[d].set(p.buffer,_.vbCount*p.stride)}var v=_.vbIdxData;(s=4*(a+_.vbCount))>_.vbIdx.size&&(_.vbIdx.resize(s),_.vbIdxData=new Float32Array(s/Float32Array.BYTES_PER_ELEMENT),_.vbIdxData.set(v),v=_.vbIdxData);var y=_.vbCount,E=y+a,T=_.mergeCount;if(v[y]!==T||v[E-1]!==T)for(var A=y;A>2,a=this._getBlockView(r,n),o=e.getOffsetFromHandle(t),u=0;u>2)*a,l=0;l+h.length<=c;l+=h.length)o.set(h,s+l);this._rootBufferDirty=!0}},t.resetTexture=function(t,i){var n=this.getHandle(t);if(n){var r=e.getTypeFromHandle(n),s=e.getBindingFromHandle(n),a=this._properties[t],o=a&&a.value,u=o?o+"-texture":om(r),h=Kv.get(u),c=h&&h.getGFXTexture(),l=a&&void 0!==a.samplerHash?js.unpackFromHash(a.samplerHash):h&&h.getSamplerInfo(),_=this._device.getSampler(l);this._descriptorSet.bindSampler(s,_,i||0),this._descriptorSet.bindTexture(s,c,i||0)}},t.resetUBOs=function(){for(var e=0;e>2)*r.count,h=0;h+o.length<=u;h+=o.length)s.set(o,i+h);i+=u}this._rootBufferDirty=!0},t.resetTextures=function(){for(var e=0;e=this._passes.length)return void console.warn("illegal pass index: "+i+".");var u=this._passes[i];this._uploadProperty(u,e,t)&&(this._props[u.propertyIndex][e]=t,n=!0)}n||console.warn("illegal property name: "+e+".")},i.getProperty=function(e,t){if(void 0===t)for(var i=this._props,n=i.length,r=0;r=this._props.length)return console.warn("illegal pass index: "+t+"."),null;var a=this._props[this._passes[t].propertyIndex];if(e in a)return a[e]}return null},i.copy=function(e,t){this._techIdx=e._techIdx,this._props.length=e._props.length;for(var i=0;i0},c(t,[{key:"effectAsset",get:function(){return this._effectAsset}},{key:"effectName",get:function(){return this._effectAsset?this._effectAsset.name:""}},{key:"technique",get:function(){return this._techIdx}},{key:"passes",get:function(){return this._passes}},{key:"hash",get:function(){return this._hash}},{key:"parent",get:function(){return null}},{key:"owner",get:function(){return null}}]),t}(Cc),ly=A((cy=my).prototype,"_effectAsset",[uy],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),_y=A(cy.prototype,"_techIdx",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),fy=A(cy.prototype,"_defines",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),dy=A(cy.prototype,"_states",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),py=A(cy.prototype,"_props",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),hy=cy))||hy));function Ty(e,t){for(var i,n=E(t);!(i=n()).done;){var r=i.value;Array.isArray(r)?Ty(e,r):e.push(r)}}function Ay(e){var t=[];return Ty(t,e),t.join("")}R.Material=Ey,fe({replaceProperty:{since:"3.6.0",removed:!1},removeProperty:{since:"3.6.0",removed:!1},markAsWarning:{since:"3.6.0",removed:!1},setDefaultLogTimes:{since:"3.6.0",removed:!1}});var Sy=ca.Flags.Destroyed,by=ca.Flags.PersistentMask,wy=li.IDENTIFIER_RE,Ry="var ",Iy="o",Oy={"cc.ClickEvent":!1,"cc.PrefabInfo":!1},Ny=li.escapeForJS,Cy=function(){function e(e,t){this.varName=void 0,this.expression=void 0,this.varName=e,this.expression=t}return e.prototype.toString=function(){return Ry+this.varName+"="+this.expression+";"},e}();function My(e,t){return t instanceof Cy?new Cy(t.varName,e+t.expression):e+t}function xy(e,t,i){Array.isArray(i)?(i[0]=My(t,i[0]),e.push(i)):e.push(My(t,i)+";")}var Fy=function(){function e(e){this._exps=void 0,this._targetExp=void 0,this._exps=[],this._targetExp=e}var t=e.prototype;return t.append=function(e,t){this._exps.push([e,t])},t.writeCode=function(e){var t;if(this._exps.length>1)e.push("t="+this._targetExp+";"),t="t";else{if(1!==this._exps.length)return;t=this._targetExp}for(var i=0;i0&&(i=Ry+this.globalVariables.join(",")+";");var n=Ay(["return (function(R){",i||[],this.codeArray,"return o;","})"]);this.result=Function("O","F",n)(this.objs,this.funcs);for(var r=0,s=this.objsToClear_iN$t.length;r0&&(s=i._findChildComponent(r._children,t)))return s}return null},i._findChildComponents=function(e,t,n){for(var r=0;r0&&i._findChildComponents(s._children,t,n)}};var t=i.prototype;function i(t){var i;return T(i=e.call(this,t)||this,"_parent",zy,v(i)),T(i,"_children",ky,v(i)),T(i,"_active",Hy,v(i)),T(i,"_components",Vy,v(i)),T(i,"_prefab",Wy,v(i)),i._scene=null,i._activeInHierarchy=!1,i._id=Zy.getNewId(),i._name=void 0,i._eventProcessor=new R.NodeEventProcessor(v(i)),i._eventMask=0,i._siblingIndex=0,i._originalSceneId="",i._name=void 0!==t?t:"New Node",i}return t._updateScene=function(){null==this._parent?U("Node %s(%s) has not attached to a scene.",this.name,this.uuid):this._scene=this._parent._scene},t.attr=function(e){je(this,e)},t.getParent=function(){return this._parent},t.setParent=function(e,t){if(void 0===t&&(t=!1),this._parent!==e){var i=this._parent,n=e;if(this._parent=n,this._siblingIndex=0,this._onSetParent(i,t),this.emit&&this.emit(By.PARENT_CHANGED,i),i&&!(i._objFlags&qy)){var r=i._children.indexOf(this);i._children.splice(r,1),i._updateSiblingIndex(),i.emit&&i.emit(By.CHILD_REMOVED,this)}n&&(n._children.push(this),this._siblingIndex=n._children.length-1,n.emit&&n.emit(By.CHILD_ADDED,this)),this._onHierarchyChanged(i)}},t.getChildByUuid=function(e){if(!e)return L("Invalid uuid"),null;for(var t=this._children,i=0,n=t.length;i0?(u=s,r=s._children,a=0,o[n]=r[a],n++):(o[n]=s,n++,h=!0);o.length=0,i._stackId--},t.removeFromParent=function(){this._parent&&this._parent.removeChild(this)},t.removeChild=function(e){this._children.indexOf(e)>-1&&(e.parent=null)},t.removeAllChildren=function(){for(var e=this._children,t=e.length-1;t>=0;t--){var i=e[t];i&&(i.parent=null)}this._children.length=0},t.isChildOf=function(e){var t=this;do{if(t===e)return!0;t=t._parent}while(t);return!1},t.getComponent=function(e){var t=Jy(e);return t?i._findComponent(this,t):null},t.getComponents=function(e){var t=Jy(e),n=[];return t&&i._findComponents(this,t,n),n},t.getComponentInChildren=function(e){var t=Jy(e);return t?i._findChildComponent(this._children,t):null},t.getComponentsInChildren=function(e){var t=Jy(e),n=[];return t&&(i._findComponents(this,t,n),i._findChildComponents(this._children,t,n)),n},t.addComponent=function(e){var t;if("string"==typeof e){if(!(t=ot(e)))throw R._RF.peek()&&K(3808,e),TypeError($(3807,e))}else{if(!e)throw TypeError($(3804));t=e}if("function"!=typeof t)throw TypeError($(3809));if(!qe(t,R.Component))throw TypeError($(3810));var i=t._requireComponent;if(i)if(Array.isArray(i))for(var n=0;n0},set:function(e){e?this._objFlags|=Ky:this._objFlags&=~Ky}},{key:"name",get:function(){return this._name},set:function(e){this._name=e}},{key:"uuid",get:function(){return this._id}},{key:"children",get:function(){return this._children}},{key:"active",get:function(){return this._active},set:function(e){if(e=!!e,this._active!==e){this._active=e;var t=this._parent;t&&t._activeInHierarchy&&R.director._nodeActivator.activateNode(this,e)}}},{key:"activeInHierarchy",get:function(){return this._activeInHierarchy}},{key:"parent",get:function(){return this._parent},set:function(e){this.setParent(e)}},{key:"scene",get:function(){return this._scene}},{key:"eventProcessor",get:function(){return this._eventProcessor}}]),i}(ca),jy.idGenerator=Zy,jy._stacks=[[]],jy._stackId=0,A((Gy=Xy).prototype,"_persistNode",[sh],Object.getOwnPropertyDescriptor(Gy.prototype,"_persistNode"),Gy.prototype),A(Gy.prototype,"name",[Eh],Object.getOwnPropertyDescriptor(Gy.prototype,"name"),Gy.prototype),A(Gy.prototype,"children",[Eh],Object.getOwnPropertyDescriptor(Gy.prototype,"children"),Gy.prototype),A(Gy.prototype,"active",[Eh],Object.getOwnPropertyDescriptor(Gy.prototype,"active"),Gy.prototype),A(Gy.prototype,"activeInHierarchy",[Eh],Object.getOwnPropertyDescriptor(Gy.prototype,"activeInHierarchy"),Gy.prototype),A(Gy.prototype,"parent",[Eh],Object.getOwnPropertyDescriptor(Gy.prototype,"parent"),Gy.prototype),zy=A(Gy.prototype,"_parent",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),ky=A(Gy.prototype,"_children",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Hy=A(Gy.prototype,"_active",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Vy=A(Gy.prototype,"_components",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Wy=A(Gy.prototype,"_prefab",[hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Uy=Gy))||Uy);R._BaseNode=_E,function(e){e[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD"}($y||($y=e("hA",{}))),function(e){e[e.NONE=0]="NONE",e[e.POSITION=1]="POSITION",e[e.ROTATION=2]="ROTATION",e[e.SCALE=4]="SCALE",e[e.RS=e.ROTATION|e.SCALE]="RS",e[e.TRS=e.POSITION|e.ROTATION|e.SCALE]="TRS",e[e.TRS_MASK=~e.TRS]="TRS_MASK"}(eE||(eE=e("eW",{}))),R.internal.TransformBit=eE;var fE=new Di,dE=new Hi,pE=new Hi,mE=new Hi,gE=new Gi,vE=new Gi,yE=new Qi,EE=[],TE=Symbol("ReserveContentsForAllSyncablePrefab"),AE=0,SE=e("eO",(tE=th("cc.Node"),iE=Dh(Di),tE((lE=cE=function(e){function t(t){var i;return(i=e.call(this,t)||this)._uiProps=new Yy(v(i)),i._static=!1,T(i,"_lpos",sE,v(i)),T(i,"_lrot",aE,v(i)),T(i,"_lscale",oE,v(i)),T(i,"_layer",uE,v(i)),T(i,"_euler",hE,v(i)),i._dirtyFlags=eE.NONE,i._eulerDirty=!1,i._flagChangeVersion=0,i._hasChangedFlags=0,i._pos=new Di,i._rot=new Hi,i._scale=new Di(1,1,1),i._mat=new Qi,i}_(t,e),t.isNode=function(e){return e instanceof t&&(e.constructor===t||!(e instanceof R.Scene))};var i=t.prototype;return i._onPreDestroy=function(){return this._onPreDestroyBase()},i[pl]=function(e){e.writeThis()},i.setParent=function(t,i){void 0===i&&(i=!1),i&&this.updateWorldTransform(),e.prototype.setParent.call(this,t,i)},i._onSetParent=function(t,i){if(e.prototype._onSetParent.call(this,t,i),i){var n=this._parent;n?(n.updateWorldTransform(),vi(Qi.determinant(n._mat),0,gi)?(Y(14300),this._dirtyFlags|=eE.TRS,this.updateWorldTransform()):(Qi.multiply(yE,Qi.invert(yE,n._mat),this._mat),Qi.toRTS(yE,this._lrot,this._lpos,this._lscale))):(Di.copy(this._lpos,this._pos),Hi.copy(this._lrot,this._rot),Di.copy(this._lscale,this._scale)),this._eulerDirty=!0}this.invalidateChildren(eE.TRS)},i._onHierarchyChanged=function(t){this.eventProcessor.reattach(),e.prototype._onHierarchyChangedBase.call(this,t)},i._onBatchCreated=function(e){this.hasChangedFlags=eE.TRS,this._dirtyFlags|=eE.TRS;for(var t=this._children.length,i=0;i=0;){if(a=(t=EE[n--]).hasChangedFlags,t.isValid&&(t._dirtyFlags&a&e)!==e)for(t._dirtyFlags|=e,t.hasChangedFlags=a|e,s=(i=t._children).length,r=0;r=0;)Di.transformInverseRTS(e,e,i._lrot,i._lpos,i._lscale),i=EE[--n];return e},i.setWorldPosition=function(e,t,i){void 0===t||void 0===i?Di.copy(this._pos,e):Di.set(this._pos,e,t,i);var n=this._parent,r=this._lpos;n?(n.updateWorldTransform(),Di.transformMat4(r,this._pos,Qi.invert(yE,n._mat))):Di.copy(r,this._pos),this.invalidateChildren(eE.POSITION),1&this._eventMask&&this.emit(By.TRANSFORM_CHANGED,eE.POSITION)},i.getWorldPosition=function(e){return this.updateWorldTransform(),e?Di.copy(e,this._pos):Di.copy(new Di,this._pos)},i.setWorldRotation=function(e,t,i,n){void 0===t||void 0===i||void 0===n?Hi.copy(this._rot,e):Hi.set(this._rot,e,t,i,n),this._parent?(this._parent.updateWorldTransform(),Hi.multiply(this._lrot,Hi.conjugate(this._lrot,this._parent._rot),this._rot)):Hi.copy(this._lrot,this._rot),this._eulerDirty=!0,this.invalidateChildren(eE.ROTATION),1&this._eventMask&&this.emit(By.TRANSFORM_CHANGED,eE.ROTATION)},i.setWorldRotationFromEuler=function(e,t,i){Hi.fromEuler(this._rot,e,t,i),this._parent?(this._parent.updateWorldTransform(),Hi.multiply(this._lrot,Hi.conjugate(this._lrot,this._parent._rot),this._rot)):Hi.copy(this._lrot,this._rot),this._eulerDirty=!0,this.invalidateChildren(eE.ROTATION),1&this._eventMask&&this.emit(By.TRANSFORM_CHANGED,eE.ROTATION)},i.getWorldRotation=function(e){return this.updateWorldTransform(),e?Hi.copy(e,this._rot):Hi.copy(new Hi,this._rot)},i.setWorldScale=function(e,t,i){void 0===t||void 0===i?Di.copy(this._scale,e):Di.set(this._scale,e,t,i);var n=this._parent;n?(n.updateWorldTransform(),Gi.fromQuat(gE,Hi.conjugate(mE,n._rot)),Gi.multiplyMat4(gE,gE,n._mat),vE.m00=this._scale.x,vE.m04=this._scale.y,vE.m08=this._scale.z,Gi.multiply(gE,vE,Gi.invert(gE,gE)),this._lscale.x=Di.set(fE,gE.m00,gE.m01,gE.m02).length(),this._lscale.y=Di.set(fE,gE.m03,gE.m04,gE.m05).length(),this._lscale.z=Di.set(fE,gE.m06,gE.m07,gE.m08).length()):Di.copy(this._lscale,this._scale),this.invalidateChildren(eE.SCALE),1&this._eventMask&&this.emit(By.TRANSFORM_CHANGED,eE.SCALE)},i.getWorldScale=function(e){return this.updateWorldTransform(),e?Di.copy(e,this._scale):Di.copy(new Di,this._scale)},i.getWorldMatrix=function(e){this.updateWorldTransform();var t=e||new Qi;return Qi.copy(t,this._mat)},i.getWorldRS=function(e){this.updateWorldTransform();var t=e||new Qi;return Qi.copy(t,this._mat),t.m12=0,t.m13=0,t.m14=0,t},i.getWorldRT=function(e){this.updateWorldTransform();var t=e||new Qi;return Qi.fromRT(t,this._rot,this._pos)},i.setRTS=function(e,t,i){var n=0;e&&(n|=eE.ROTATION,void 0!==e.w?(Hi.copy(this._lrot,e),this._eulerDirty=!0):(Di.copy(this._euler,e),Hi.fromEuler(this._lrot,e.x,e.y,e.z),this._eulerDirty=!1)),t&&(Di.copy(this._lpos,t),n|=eE.POSITION),i&&(Di.copy(this._lscale,i),n|=eE.SCALE),n&&(this.invalidateChildren(n),1&this._eventMask&&this.emit(By.TRANSFORM_CHANGED,n))},i.pauseSystemEvents=function(e){this._eventProcessor.setEnabled(!1,e)},i.resumeSystemEvents=function(e){this._eventProcessor.setEnabled(!0,e)},t.resetHasChangedFlags=function(){AE+=1},t.clearNodeArray=function(){t.ClearFramet.priority?-1:0};var t=e.prototype;return t.init=function(){},t.update=function(){},t.postUpdate=function(){},t.destroy=function(){},c(e,[{key:"priority",get:function(){return this._priority},set:function(e){this._priority=e}},{key:"id",get:function(){return this._id},set:function(e){this._id=e}}]),e}());wE.Priority=dt({LOW:0,MEDIUM:100,HIGH:200,SCHEDULER:1<<31>>>0});var RE=new Vr;RE.format=gn.RGBA8;var IE=new Wr;IE.format=gn.DEPTH_STENCIL;var OE,NE,CE,ME,xE,FE=new Yr([RE],IE),PE={width:1,height:1,renderPassInfo:FE},DE=e("eL",th("cc.RenderTexture")(bE=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r=1&&this.width<=2048&&this.height>=1&&this.height<=2048},i.readPixels=function(e,t,i,n,r){void 0===e&&(e=0),void 0===t&&(t=0),i=i||this.width,n=n||this.height;var s=this.getGFXTexture();if(!s)return K(7606),null;var a=4*i*n;if(void 0===r)r=new Uint8Array(a);else if(r.length=this._materials.length?null:this._materials[e]},i.setMaterial=function(e,t){e&&e instanceof OA&&console.error("Can't set a material instance to a sharedMaterial slot"),this._materials[t]=e;var i=this._materialInstances[t];i&&(i.destroy(),this._materialInstances[t]=null),this._onMaterialModified(t,this._materials[t])},i.getMaterialInstance=function(e){if(!this._materials[e])return null;if(!this._materialInstances[e]){NA.parent=this._materials[e],NA.owner=this,NA.subModelIdx=e;var t=new OA(NA);NA.parent=null,NA.owner=null,NA.subModelIdx=0,this.setMaterialInstance(t,e)}return this._materialInstances[e]},i.setMaterialInstance=function(e,t){if("number"==typeof e){Y(12007);var i=e;e=t,t=i}var n=this._materialInstances[t];e&&e.parent?e!==n&&(this._materialInstances[t]=e,this._onMaterialModified(t,e)):(e!==this._materials[t]||n)&&this.setMaterial(e,t)},i.getRenderMaterial=function(e){return this._materialInstances[e]||this._materials[e]},i._onMaterialModified=function(){},i._onRebuildPSO=function(){},i._clearMaterials=function(){},c(t,[{key:"sharedMaterial",get:function(){return this.getMaterial(0)}},{key:"sharedMaterials",get:function(){return this._materials},set:function(e){for(var t=0;t0)for(var e=0;e0)for(var r=0;r=0;--n)if((t=jA[n]).eventProcessor.capturingTarget&&(e.currentTarget=t,t.eventProcessor.capturingTarget.emit(e.type,e,jA),e.propagationStopped))return void(jA.length=0);if(jA.length=0,e.eventPhase=2,e.currentTarget=i,this.capturingTarget&&this.capturingTarget.emit(e.type,e),!e.propagationImmediateStopped&&this.bubblingTarget&&this.bubblingTarget.emit(e.type,e),!e.propagationStopped&&e.bubbles)for(this.getBubblingTargets(e.type,jA),e.eventPhase=3,n=0;n0?n:null}return null},t._attachMask=function(){this.maskList=this._searchComponentsInParent(e._maskComp)},t._isTouchEvent=function(e){return-1!==qA.indexOf(e)},t._isMouseEvent=function(e){return-1!==KA.indexOf(e)},t._hasTouchListeners=function(){for(var e=0;e0?t[0].getShaderVariant(e):null},t.getPlanarInstanceShader=function(e){this._instancingMaterial||(this._instancingMaterial=new Ey,this._instancingMaterial.initialize({effectName:"pipeline/planar-shadow",defines:{USE_INSTANCING:!0}}));var t=this._instancingMaterial.passes;return t.length>0?t[0].getShaderVariant(e):null},t.initialize=function(e){this._enabled=e.enabled,this._type=this.enabled?e.type:nS,this.normal=e.planeDirection,this.distance=e.planeHeight,this.shadowColor=e.shadowColor,this.maxReceived=e.maxReceived,e.shadowMapSize!==this._size.x&&(this.size.set(e.shadowMapSize,e.shadowMapSize),this._shadowMapDirty=!0)},t.activate=function(){this.enabled&&this.type===$A.Planar&&this._updatePlanarInfo()},t._updatePlanarInfo=function(){this._material||(this._material=new Ey,this._material.initialize({effectName:"pipeline/planar-shadow"})),this._instancingMaterial||(this._instancingMaterial=new Ey,this._instancingMaterial.initialize({effectName:"pipeline/planar-shadow",defines:{USE_INSTANCING:!0}}))},t.destroy=function(){this._material&&this._material.destroy(),this._instancingMaterial&&this._instancingMaterial.destroy(),this.fixedSphere.destroy()},c(e,[{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e,this.activate()}},{key:"type",get:function(){return this._type},set:function(e){this._type=this.enabled?e:nS,this.activate()}},{key:"normal",get:function(){return this._normal},set:function(e){Di.copy(this._normal,e)}},{key:"distance",get:function(){return this._distance},set:function(e){this._distance=e}},{key:"shadowColor",get:function(){return this._shadowColor},set:function(e){this._shadowColor=e}},{key:"size",get:function(){return this._size},set:function(e){this._size.set(e)}},{key:"shadowMapDirty",get:function(){return this._shadowMapDirty},set:function(e){this._shadowMapDirty=e}},{key:"matLight",get:function(){return this._matLight}},{key:"material",get:function(){return this._material}},{key:"instancingMaterial",get:function(){return this._instancingMaterial}}]),e}());rS.MAX_FAR=2e3,rS.COEFFICIENT_OF_EXPANSION=2*Math.sqrt(3),R.Shadows=rS;var sS=null,aS=null,oS=e("cF",dt({HEMISPHERE_DIFFUSE:0,AUTOGEN_HEMISPHERE_DIFFUSE_WITH_REFLECTION:1,DIFFUSEMAP_WITH_REFLECTION:2})),uS=e("cG",function(){function e(){this._envmapLDR=null,this._envmapHDR=null,this._diffuseMapLDR=null,this._diffuseMapHDR=null,this._globalDSManager=null,this._model=null,this._default=null,this._enabled=!1,this._useIBL=!1,this._useHDR=!0,this._useDiffuseMap=!1,this._editableMaterial=null,this._activated=!1,this._reflectionHDR=null,this._reflectionLDR=null}var t=e.prototype;return t.initialize=function(e){this._activated=!1,this._enabled=e.enabled,this._useIBL=e.useIBL,this._useDiffuseMap=e.applyDiffuseMap,this._useHDR=e.useHDR},t.setEnvMaps=function(e,t){this._envmapHDR=e,this._envmapLDR=t,this._updateGlobalBinding(),this._updatePipeline()},t.setDiffuseMaps=function(e,t){this._diffuseMapHDR=e,this._diffuseMapLDR=t,this._updateGlobalBinding(),this._updatePipeline()},t.setSkyboxMaterial=function(e){e?(this._editableMaterial=new OA({parent:e}),this._editableMaterial.recompileShaders({USE_RGBE_CUBEMAP:this.isRGBE})):this._editableMaterial=null,this._updatePipeline()},t.setReflectionMaps=function(e,t){this._reflectionHDR=e,this._reflectionLDR=t,this._updateGlobalBinding(),this._updatePipeline()},t.updateMaterialRenderInfo=function(){this._updateGlobalBinding(),this._updatePipeline()},t.activate=function(){var e=R.director.root.pipeline;this._globalDSManager=e.globalDSManager,this._default=Kv.get("default-cube-texture"),this._model||(this._model=R.director.root.createModel(R.renderer.scene.Model));var t=this._default.isRGBE;if(this._default.isUsingOfflineMipmaps(),this.envmap&&(t=this.envmap.isRGBE,this.envmap.isUsingOfflineMipmaps()),!aS){var i=new Ey;i.initialize({effectName:"pipeline/skybox",defines:{USE_RGBE_CUBEMAP:t}}),aS=new OA({parent:i})}this.enabled&&(sS||(sS=R.utils.createMesh(R.primitives.box({width:2,height:2,length:2}))),this._editableMaterial?this._model.initSubModel(0,sS.renderingSubMeshes[0],this._editableMaterial):this._model.initSubModel(0,sS.renderingSubMeshes[0],aS)),this.envmap||(this.envmap=this._default),this.diffuseMap||(this.diffuseMap=this._default),this._updateGlobalBinding(),this._updatePipeline(),this._activated=!0},t._updatePipeline=function(){var e=R.director.root,t=e.pipeline,i=this.useIBL?this.isRGBE?2:1:0,n=this.useIBL&&this.useDiffuseMap&&this.diffuseMap?this.isRGBE?2:1:0,r=this.useHDR,s=this.useConvolutionMap;if(t.macros.CC_USE_IBL===i&&t.macros.CC_USE_DIFFUSEMAP===n&&t.macros.CC_USE_HDR===r&&t.macros.CC_IBL_CONVOLUTED===s||(t.macros.CC_USE_IBL=i,t.macros.CC_USE_DIFFUSEMAP=n,t.macros.CC_USE_HDR=r,t.macros.CC_IBL_CONVOLUTED=s,this._activated&&e.onGlobalPipelineStateChanged()),this.enabled){var a=this.envmap?this.envmap:this._default;this._editableMaterial?(this._editableMaterial.setProperty("environmentMap",a),this._editableMaterial.recompileShaders({USE_RGBE_CUBEMAP:this.isRGBE})):aS&&(aS.setProperty("environmentMap",a),aS.recompileShaders({USE_RGBE_CUBEMAP:this.isRGBE})),this._model&&(this._editableMaterial?this._model.setSubModelMaterial(0,this._editableMaterial):this._model.setSubModelMaterial(0,aS),this._updateSubModes())}},t._updateGlobalBinding=function(){if(this._globalDSManager){var e=Va.gfxDevice;if(this.reflectionMap){var t=this.reflectionMap.getGFXTexture(),i=e.getSampler(this.reflectionMap.getSamplerInfo());this._globalDSManager.bindSampler(qd,i),this._globalDSManager.bindTexture(qd,t)}else{var n=this.envmap?this.envmap:this._default;if(n){var r=n.getGFXTexture(),s=e.getSampler(n.getSamplerInfo());this._globalDSManager.bindSampler(qd,s),this._globalDSManager.bindTexture(qd,r)}}var a=this.diffuseMap?this.diffuseMap:this._default;if(a){var o=a.getGFXTexture(),u=e.getSampler(a.getSamplerInfo());this._globalDSManager.bindSampler(Zd,u),this._globalDSManager.bindTexture(Zd,o)}this._globalDSManager.update()}},t._updateSubModes=function(){if(this._model)for(var e=this._model.subModels,t=0;tAt.TOUCH_TIMEOUT&&(console.log("The touches is more than MAX_TOUCHES, release touch id "+e.getID()+"."),t.releaseTouch(e.getID()))})),i>=this._touchMap.size},e}()),wR=function(){function e(){this._canvas=void 0,this._eventTarget=new Aa,xa.hasFeature(Oa.INPUT_TOUCH)&&(this._canvas=document.getElementById("GameCanvas"),this._canvas||b||console.warn("failed to access canvas"),this._registerEvent())}var t=e.prototype;return t._registerEvent=function(){var e,t,i,n;null===(e=this._canvas)||void 0===e||e.addEventListener("touchstart",this._createCallback(FA.TOUCH_START)),null===(t=this._canvas)||void 0===t||t.addEventListener("touchmove",this._createCallback(FA.TOUCH_MOVE)),null===(i=this._canvas)||void 0===i||i.addEventListener("touchend",this._createCallback(FA.TOUCH_END)),null===(n=this._canvas)||void 0===n||n.addEventListener("touchcancel",this._createCallback(FA.TOUCH_CANCEL))},t._createCallback=function(e){var t=this;return function(i){for(var n,r=t._getCanvasRect(),s=[],a=i.changedTouches.length,o=0;o0){var _=new GA(s,!1,e,At.ENABLE_MULTI_TOUCH?bR.getAllTouches():s);t._eventTarget.emit(e,_)}}},t._getCanvasRect=function(){var e=this._canvas,t=null==e?void 0:e.getBoundingClientRect();return t?new cn(t.x,t.y,t.width,t.height):new cn(0,0,0,0)},t._getLocation=function(e,t){var i=e.clientX-t.x,n=t.y+t.height-e.clientY;if(La.isFrameRotated){var r=i;i=t.height-n,n=r}var s=La.devicePixelRatio;return new en(i*=s,n*=s)},t.on=function(e,t,i){this._eventTarget.on(e,t,i)},e}();!function(e){e[e.GLOBAL=0]="GLOBAL",e[e.UI=1]="UI"}(vR||(vR=e("f3",{})));var RR=function(){function e(e){this.priority=vR.GLOBAL,this._inputEventTarget=void 0,this._inputEventTarget=e}return e.prototype.dispatchEvent=function(e){return this._inputEventTarget.emit(e.type,e),!0},e}(),IR=((gR={})[FA.MOUSE_DOWN]=FA.TOUCH_START,gR[FA.MOUSE_MOVE]=FA.TOUCH_MOVE,gR[FA.MOUSE_UP]=FA.TOUCH_END,gR),OR=e("f2",function(){function e(){this._dispatchImmediately=!0,this._eventTarget=new Aa,this._touchInput=new wR,this._mouseInput=new AR,this._keyboardInput=new TR,this._accelerometerInput=new yR,this._eventTouchList=[],this._eventMouseList=[],this._eventKeyboardList=[],this._eventAccelerationList=[],this._needSimulateTouchMoveEvent=!1,this._inputEventDispatcher=void 0,this._eventDispatcherList=[],this._registerEvent(),this._inputEventDispatcher=new RR(this._eventTarget),this._registerEventDispatcher(this._inputEventDispatcher)}var t=e.prototype;return t._dispatchMouseDownEvent=function(e){var t,i;null===(t=(i=this._mouseInput).dispatchMouseDownEvent)||void 0===t||t.call(i,e)},t._dispatchMouseMoveEvent=function(e){var t,i;null===(t=(i=this._mouseInput).dispatchMouseMoveEvent)||void 0===t||t.call(i,e)},t._dispatchMouseUpEvent=function(e){var t,i;null===(t=(i=this._mouseInput).dispatchMouseUpEvent)||void 0===t||t.call(i,e)},t._dispatchMouseScrollEvent=function(e){var t,i;null===(t=(i=this._mouseInput).dispatchScrollEvent)||void 0===t||t.call(i,e)},t._dispatchKeyboardDownEvent=function(e){var t,i;null===(t=(i=this._keyboardInput).dispatchKeyboardDownEvent)||void 0===t||t.call(i,e)},t._dispatchKeyboardUpEvent=function(e){var t,i;null===(t=(i=this._keyboardInput).dispatchKeyboardUpEvent)||void 0===t||t.call(i,e)},t.on=function(e,t,i){return this._eventTarget.on(e,t,i),t},t.once=function(e,t,i){return this._eventTarget.once(e,t,i),t},t.off=function(e,t,i){this._eventTarget.off(e,t,i)},t.setAccelerometerEnabled=function(e){e?this._accelerometerInput.start():this._accelerometerInput.stop()},t.setAccelerometerInterval=function(e){this._accelerometerInput.setInterval(e)},t._simulateEventTouch=function(e){var t=IR[e.type],i=bR.getTouch(0,e.getLocationX(),e.getLocationY());if(i){var n=[i],r=new GA(n,!1,t,n);t===FA.TOUCH_END&&bR.releaseTouch(0),this._dispatchOrPushEventTouch(r,this._eventTouchList)}},t._registerEventDispatcher=function(e){this._eventDispatcherList.push(e),this._eventDispatcherList.sort((function(e,t){return t.priority-e.priority}))},t._emitEvent=function(e){for(var t=this._eventDispatcherList.length,i=0;i0)for(var u=0;u=0&&s.node._components.splice(a,1)}}}function XR(e,t,i){if(!(t.length<=0))for(var n=null,r=0;r0){var u=o.pop();if(!u)continue;for(var h=0;h0){var g=p.pop();if(!g)return;for(var v=0;v>>1;r<=s;a=r+s>>>1){var o=e[a],u=o.constructor._executionOrder;if(u>i)s=a-1;else if(un)s=a-1;else{if(!(h0&&(e.array.sort(rI),this._invoke(e),e.array.length=0),this._invoke(this._zero),this._zero.array.length=0;var t=this._pos;t.array.length>0&&(t.array.sort(rI),this._invoke(t),t.array.length=0)},t}(nI),aI=function(e){function t(){return e.apply(this,arguments)||this}_(t,e);var i=t.prototype;return i.add=function(e){var t=e.constructor._executionOrder;if(0===t)this._zero.array.push(e);else{var i=t<0?this._neg.array:this._pos.array,n=tI(i,e);n<0&&i.splice(~n,0,e)}},i.remove=function(e){var t=e.constructor._executionOrder;if(0===t)this._zero.fastRemove(e);else{var i=t<0?this._neg:this._pos,n=tI(i.array,e);n>=0&&i.removeAt(n)}},i.invoke=function(e){this._neg.array.length>0&&this._invoke(this._neg,e),this._invoke(this._zero,e),this._pos.array.length>0&&this._invoke(this._pos,e)},t}(nI);function oI(e,t,i){var n="var a=it.array;for(it.i=0;it.i=0?JR(this._deferredComps,t):(!e.start||e._objFlags&$R||this.startInvoker.remove(e),e.update&&this.updateInvoker.remove(e),e.lateUpdate&&this.lateUpdateInvoker.remove(e))},t.enableComp=function(e,t){if(!(e._objFlags&eI)){if(e.onEnable){if(t)return void t.add(e);if(e.onEnable(),!e.node._activeInHierarchy)return}this._onEnabled(e)}},t.disableComp=function(e){e._objFlags&eI&&(e.onDisable&&e.onDisable(),this._onDisabled(e))},t.startPhase=function(){this._updating=!0,this.startInvoker.invoke(),this._startForNewComps()},t.updatePhase=function(e){this.updateInvoker.invoke(e)},t.lateUpdatePhase=function(e){this.lateUpdateInvoker.invoke(e),this._updating=!1,this._startForNewComps()},t._startForNewComps=function(){this._deferredComps.length>0&&(this._deferredSchedule(),this.startInvoker.invoke())},t._scheduleImmediate=function(e){"function"!=typeof e.start||e._objFlags&$R||this.startInvoker.add(e),"function"==typeof e.update&&this.updateInvoker.add(e),"function"==typeof e.lateUpdate&&this.lateUpdateInvoker.add(e)},t._deferredSchedule=function(){for(var e=this._deferredComps,t=0,i=e.length;t=t.OptimizationPolicyThreshold)?(e=this._doInstantiate(),this.data._instantiate(e)):e=this.data._instantiate(),++this._instantiatedTimes,e},i.initDefault=function(t){e.prototype.initDefault.call(this,t),this.data=new SE,this.data.name="(Missing Node)";var i=new R._PrefabInfo;i.asset=this,i.root=this.data,this.data._prefab=i},i.validate=function(){return!!this.data},i.onLoaded=function(){var e=this.data;KR(e),YR(e)},t}(Cc),ZO.OptimizationPolicy=oN,ZO.OptimizationPolicyThreshold=3,qO=A((YO=JO).prototype,"data",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),KO=A(YO.prototype,"optimizationPolicy",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return oN.AUTO}}),QO=A(YO.prototype,"persistent",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),XO=YO))||XO);_t.value(uN,"_utils",aN),R.Prefab=uN,Le(R,"cc._Prefab","Prefab"),e("gM",($O=th("cc.PrefabLink"),eN=Dh(uN),tN=Th(),$O((sN=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r15e3&&(t=15e3);var i=t*t,n=(.860117757+.000154118254*t+1.28641212e-7*i)/(1+.000842420235*t+7.08145163e-7*i),r=(.317398726+422806245e-13*t+4.20481691e-8*i)/(1-289741816e-13*t+1.61456053e-7*i),s=2*n-8*r+4,a=3*n/s,o=2*r/s,u=1/o*a,h=1/o*(1-a-o);e.x=3.2404542*u-1.5371385+-.4985314*h,e.y=-.969266*u+1.8760108+.041556*h,e.z=.0556434*u-.2040259+1.0572252*h}!function(e){e[e.DIRECTIONAL=0]="DIRECTIONAL",e[e.SPHERE=1]="SPHERE",e[e.SPOT=2]="SPOT",e[e.UNKNOWN=3]="UNKNOWN"}(yN||(yN=e("cR",{})));var bN,wN,RN,IN,ON,NN,CN,MN,xN,FN,PN=e("cS",(function(e){return 4*Math.PI*Math.PI*e*e})),DN=e("cT",function(){function e(){this._baked=!1,this._color=new Di(1,1,1),this._colorTemp=6550,this._colorTempRGB=new Di(1,1,1),this._scene=null,this._node=null,this._name=null,this._useColorTemperature=!1,this._type=yN.UNKNOWN}var t=e.prototype;return t.initialize=function(){this.color=new Di(1,1,1),this.colorTemperature=6550},t.attachToScene=function(e){this._scene=e},t.detachFromScene=function(){this._scene=null},t.destroy=function(){this._name=null,this._node=null},t.update=function(){},c(e,[{key:"baked",get:function(){return this._baked},set:function(e){this._baked=e}},{key:"color",get:function(){return this._color},set:function(e){this._color.set(e)}},{key:"useColorTemperature",get:function(){return this._useColorTemperature},set:function(e){this._useColorTemperature=e}},{key:"colorTemperature",get:function(){return this._colorTemp},set:function(e){this._colorTemp=e,SN(this._colorTempRGB,this._colorTemp)}},{key:"colorTemperatureRGB",get:function(){return this._colorTempRGB}},{key:"node",get:function(){return this._node},set:function(e){this._node=e,this._node&&(this._node.hasChangedFlags|=eE.ROTATION)}},{key:"type",get:function(){return this._type}},{key:"name",get:function(){return this._name},set:function(e){this._name=e}},{key:"scene",get:function(){return this._scene}}]),e}()),LN=e("hw",function(){function e(){this._singleMode=0,this._compositeModeValue=0,this._lightingWithAlbedo=!0,this._csmLayerColoration=!1,this._nativeConfig=null,this._activate()}var t=e.prototype;return t.isCompositeModeEnabled=function(e){return 0!=(this._compositeModeValue&1<=0;--t){var i=e[t];if(i.window.swapchain)return void(gy=i)}gy=null}(e);for(var t=0;t0){var o=a;a=s,s=o}var u=0;switch(e){case pn.IDENTITY:u=0,i[u++]=-1,i[u++]=-1,i[u++]=n,i[u++]=a,i[u++]=1,i[u++]=-1,i[u++]=r,i[u++]=a,i[u++]=-1,i[u++]=1,i[u++]=n,i[u++]=s,i[u++]=1,i[u++]=1,i[u++]=r,i[u++]=s;break;case pn.ROTATE_90:u=0,i[u++]=-1,i[u++]=-1,i[u++]=r,i[u++]=a,i[u++]=1,i[u++]=-1,i[u++]=r,i[u++]=s,i[u++]=-1,i[u++]=1,i[u++]=n,i[u++]=a,i[u++]=1,i[u++]=1,i[u++]=n,i[u++]=s;break;case pn.ROTATE_180:u=0,i[u++]=-1,i[u++]=-1,i[u++]=n,i[u++]=s,i[u++]=1,i[u++]=-1,i[u++]=r,i[u++]=s,i[u++]=-1,i[u++]=1,i[u++]=n,i[u++]=a,i[u++]=1,i[u++]=1,i[u++]=r,i[u++]=a;break;case pn.ROTATE_270:u=0,i[u++]=-1,i[u++]=-1,i[u++]=n,i[u++]=s,i[u++]=1,i[u++]=-1,i[u++]=n,i[u++]=a,i[u++]=-1,i[u++]=1,i[u++]=r,i[u++]=s,i[u++]=1,i[u++]=1,i[u++]=r,i[u++]=a}return i},i._createQuadInputAssembler=function(){var e=new KM,t=4*Float32Array.BYTES_PER_ELEMENT,i=4*t,n=this._device.createBuffer(new Sr(En.VERTEX|En.TRANSFER_DST,Sn.DEVICE|Sn.HOST,i,t));if(!n)return e;var r=Uint8Array.BYTES_PER_ELEMENT,s=6*r,a=this._device.createBuffer(new Sr(En.INDEX|En.TRANSFER_DST,Sn.DEVICE,s,r));if(!a)return e;var o=new Uint8Array(6);o[0]=0,o[1]=1,o[2]=2,o[3]=1,o[4]=3,o[5]=2,a.update(o);var u=new Array(2);u[0]=new zr("a_position",gn.RG32F),u[1]=new zr("a_texCoord",gn.RG32F);var h=this._device.createInputAssembler(new Hr(u,[n],a));return e.quadIB=a,e.quadVB=n,e.quadIA=h,e},i.updateQuadVertexData=function(e,t){var i=this._lastUsedRenderArea;if(i.x!==e.x||i.y!==e.y||i.width!==e.width||i.height!==e.height){var n=this._genQuadVertexData(pn.IDENTITY,e);this._quadVBOffscreen.update(n);var r=this._genQuadVertexData(t.swapchain&&t.swapchain.surfaceTransform||pn.IDENTITY,e);this._quadVBOnscreen.update(r),i.copy(e)}},i.destroy=function(){for(var t,i,n=0;n>1,r>>1)),e.prefilterFramebuffer=t.createFramebuffer(new Zr(e.renderPass,[e.prefiterTex])),n>>=1,r>>=1;for(var s=0;s<6;++s)e.downsampleTexs.push(t.createTexture(new Or(bn.TEX2D,wn.COLOR_ATTACHMENT|wn.SAMPLED,gn.RGBA8,n>>1,r>>1))),e.downsampleFramebuffers[s]=t.createFramebuffer(new Zr(e.renderPass,[e.downsampleTexs[s]])),e.upsampleTexs.push(t.createTexture(new Or(bn.TEX2D,wn.COLOR_ATTACHMENT|wn.SAMPLED,gn.RGBA8,n,r))),e.upsampleFramebuffers[s]=t.createFramebuffer(new Zr(e.renderPass,[e.upsampleTexs[s]])),n>>=1,r>>=1;e.combineTex=t.createTexture(new Or(bn.TEX2D,wn.COLOR_ATTACHMENT|wn.SAMPLED,gn.RGBA8,this._width,this._height)),e.combineFramebuffer=t.createFramebuffer(new Zr(e.renderPass,[e.combineTex])),e.sampler=this.globalDSManager.linearSampler}},i.on=function(e,t,i,n){return this._eventProcessor.on(e,t,i,n)},i.once=function(e,t,i){return this._eventProcessor.once(e,t,i)},i.off=function(e,t,i){this._eventProcessor.off(e,t,i)},i.emit=function(e,t,i,n,r,s){this._eventProcessor.emit(e,t,i,n,r,s)},i.targetOff=function(e){this._eventProcessor.targetOff(e)},i.removeAll=function(e){this._eventProcessor.removeAll(e)},i.hasEventListener=function(e,t,i){return this._eventProcessor.hasEventListener(e,t,i)},c(t,[{key:"tag",get:function(){return this._tag}},{key:"flows",get:function(){return this._flows}},{key:"quadIAOnscreen",get:function(){return this._quadIAOnscreen}},{key:"quadIAOffscreen",get:function(){return this._quadIAOffscreen}},{key:"constantMacros",get:function(){return this._constantMacros}},{key:"macros",get:function(){return this._macros}},{key:"device",get:function(){return this._device}},{key:"globalDSManager",get:function(){return this._globalDSManager}},{key:"descriptorSetLayout",get:function(){return this._globalDSManager.descriptorSetLayout}},{key:"descriptorSet",get:function(){return this._descriptorSet}},{key:"commandBuffers",get:function(){return this._commandBuffers}},{key:"pipelineUBO",get:function(){return this._pipelineUBO}},{key:"pipelineSceneData",get:function(){return this._pipelineSceneData}},{key:"profiler",get:function(){return this._profiler},set:function(e){this._profiler=e}},{key:"geometryRenderer",get:function(){return this._geometryRenderer}},{key:"clusterEnabled",get:function(){return this._clusterEnabled},set:function(e){this._clusterEnabled=e}},{key:"bloomEnabled",get:function(){return this._bloomEnabled},set:function(e){this._bloomEnabled=e}},{key:"shadingScale",get:function(){return this._pipelineSceneData.shadingScale},set:function(e){this._pipelineSceneData.shadingScale!==e&&(this._pipelineSceneData.shadingScale=e,this.emit(rC.ATTACHMENT_SCALE_CAHNGED,e))}}]),t}(Cc),_C=A((lC=dC).prototype,"_tag",[oC,hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),fC=A(lC.prototype,"_flows",[uC,hC,hh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),cC=lC))||cC));R.RenderPipeline=QM,re(QM.prototype,"RenderPipeline.prototype",[{name:"geometryRenderer",suggest:"please use camera.geometryRenderer instead."}]),function(e){e[e.BLOOM=18]="BLOOM",e[e.POST_PROCESS=19]="POST_PROCESS",e[e.UI=20]="UI"}(pC||(pC={})),function(e){e[e.FORWARD=10]="FORWARD"}(mC||(mC={})),function(e){e[e.SHADOW=0]="SHADOW",e[e.FORWARD=1]="FORWARD",e[e.UI=10]="UI"}(gC||(gC={})),function(e){e[e.GBUFFER=10]="GBUFFER",e[e.LIGHTING=15]="LIGHTING",e[e.TRANSPARENT=18]="TRANSPARENT"}(vC||(vC={})),function(e){e[e.SHADOW=0]="SHADOW",e[e.MAIN=1]="MAIN",e[e.UI=10]="UI"}(yC||(yC={})),gt(bn),gt(wn),gt(Gn),gt(Un),gt(zn),gt(gn),function(e){e[e.SCENE=0]="SCENE",e[e.POSTPROCESS=1]="POSTPROCESS",e[e.UI=2]="UI"}(WM||(WM={})),gt(WM),EC=th("RenderTextureDesc"),TC=Dh(bn),AC=Dh(wn),SC=Dh(gn),EC((wC=A((bC=function(){T(this,"name",wC,this),T(this,"type",RC,this),T(this,"usage",IC,this),T(this,"format",OC,this),T(this,"width",NC,this),T(this,"height",CC,this)}).prototype,"name",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),RC=A(bC.prototype,"type",[TC],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return bn.TEX2D}}),IC=A(bC.prototype,"usage",[AC],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return wn.COLOR_ATTACHMENT}}),OC=A(bC.prototype,"format",[SC],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return gn.UNKNOWN}}),NC=A(bC.prototype,"width",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return-1}}),CC=A(bC.prototype,"height",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return-1}}),bC));var ZM,JM=(MC=th("RenderTextureConfig"),xC=Dh(DE),MC((DC=A((PC=function(){T(this,"name",DC,this),T(this,"texture",LC,this)}).prototype,"name",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),LC=A(PC.prototype,"texture",[xC],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),FC=PC))||FC),$M=(BC=th("MaterialConfig"),UC=Dh(Ey),BC((zC=A((GC=function(){T(this,"name",zC,this),T(this,"material",kC,this)}).prototype,"name",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),kC=A(GC.prototype,"material",[UC],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),GC)),HC=th("FrameBufferDesc"),VC=Dh([Yt]),WC=Dh(DE),HC((XC=A((jC=function(){T(this,"name",XC,this),T(this,"renderPass",YC,this),T(this,"colorTextures",qC,this),T(this,"depthStencilTexture",KC,this),T(this,"texture",QC,this)}).prototype,"name",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),YC=A(jC.prototype,"renderPass",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),qC=A(jC.prototype,"colorTextures",[VC],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),KC=A(jC.prototype,"depthStencilTexture",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),QC=A(jC.prototype,"texture",[WC],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),jC)),ZC=th("ColorDesc"),JC=Dh(gn),$C=Dh(Un),eM=Dh(Gn),tM=Dh([zn]),iM=Dh([zn]),ZC((sM=A((rM=function(){T(this,"format",sM,this),T(this,"loadOp",aM,this),T(this,"storeOp",oM,this),T(this,"sampleCount",uM,this),T(this,"beginAccesses",hM,this),T(this,"endAccesses",cM,this)}).prototype,"format",[JC],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return gn.UNKNOWN}}),aM=A(rM.prototype,"loadOp",[$C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Un.CLEAR}}),oM=A(rM.prototype,"storeOp",[eM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Gn.STORE}}),uM=A(rM.prototype,"sampleCount",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),hM=A(rM.prototype,"beginAccesses",[tM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return zn.NONE}}),cM=A(rM.prototype,"endAccesses",[iM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return zn.COLOR_ATTACHMENT_WRITE}}),nM=rM))||nM),ex=(lM=th("DepthStencilDesc"),_M=Dh(gn),fM=Dh(Un),dM=Dh(Gn),pM=Dh(Un),mM=Dh(Gn),gM=Dh(zn),vM=Dh(zn),lM((TM=A((EM=function(){T(this,"format",TM,this),T(this,"depthLoadOp",AM,this),T(this,"depthStoreOp",SM,this),T(this,"stencilLoadOp",bM,this),T(this,"stencilStoreOp",wM,this),T(this,"sampleCount",RM,this),T(this,"beginAccesses",IM,this),T(this,"endAccesses",OM,this)}).prototype,"format",[_M],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return gn.UNKNOWN}}),AM=A(EM.prototype,"depthLoadOp",[fM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Un.CLEAR}}),SM=A(EM.prototype,"depthStoreOp",[dM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Gn.STORE}}),bM=A(EM.prototype,"stencilLoadOp",[pM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Un.CLEAR}}),wM=A(EM.prototype,"stencilStoreOp",[mM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Gn.STORE}}),RM=A(EM.prototype,"sampleCount",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),IM=A(EM.prototype,"beginAccesses",[gM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return zn.NONE}}),OM=A(EM.prototype,"endAccesses",[vM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return zn.DEPTH_STENCIL_ATTACHMENT_WRITE}}),yM=EM))||yM);NM=th("RenderPassDesc"),CM=Dh([$M]),MM=Dh(ex),NM((FM=A((xM=function(){T(this,"index",FM,this),T(this,"colorAttachments",PM,this),T(this,"depthStencilAttachment",DM,this)}).prototype,"index",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return-1}}),PM=A(xM.prototype,"colorAttachments",[CM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),DM=A(xM.prototype,"depthStencilAttachment",[MM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new ex}}),xM)),function(e){e[e.FRONT_TO_BACK=0]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=1]="BACK_TO_FRONT"}(ZM||(ZM={})),gt(ZM);var tx=(LM=th("RenderQueueDesc"),BM=Dh(ZM),UM=Dh([Yt]),LM((kM=A((zM=function(){T(this,"isTransparent",kM,this),T(this,"sortMode",HM,this),T(this,"stages",VM,this)}).prototype,"isTransparent",[hh,Eh],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),HM=A(zM.prototype,"sortMode",[BM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return ZM.FRONT_TO_BACK}}),VM=A(zM.prototype,"stages",[UM],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),GM=zM))||GM);function ix(e,t){return e.hash-t.hash||e.depth-t.depth||e.shaderId-t.shaderId}function nx(e,t){return e.priority-t.priority||e.hash-t.hash||t.depth-e.depth||e.shaderId-t.shaderId}var rx=function(){function e(e){this.queue=void 0,this._passDesc=void 0,this._passPool=void 0,this._passDesc=e,this._passPool=new sa((function(){return{priority:0,hash:0,depth:0,shaderId:0,subModel:null,passIdx:0}}),64),this.queue=new aa(64,this._passDesc.sortFunc)}var t=e.prototype;return t.clear=function(){this.queue.clear(),this._passPool.reset()},t.insertRenderPass=function(e,t,i){var n=e.model.subModels[t],r=n.passes[i],s=n.shaders[i];if(r.blendState.targets[0].blend!==this._passDesc.isTransparent||!(r.phase&this._passDesc.phases))return!1;var a=0|r.priority<<16|n.priority<<8|i,o=this._passPool.add();return o.priority=e.model.priority,o.hash=a,o.depth=e.depth||0,o.shaderId=s.typedID,o.subModel=n,o.passIdx=i,this.queue.push(o),!0},t.sort=function(){this.queue.sort()},t.recordCommandBuffer=function(e,t,i){for(var n=0;n8?K(12004,8):(this._passes=e,this._flushPassInfo(),this._passes[0].batchingScheme===Yv.VB_MERGING&&this.subMesh.genFlatBuffers(),this._descriptorSet&&(this._descriptorSet.destroy(),lx.layout=e[0].localSetLayout,this._descriptorSet=this._device.createDescriptorSet(lx)))}},{key:"shaders",get:function(){return this._shaders}},{key:"subMesh",get:function(){return this._subMesh},set:function(e){this._inputAssembler.destroy(),this._inputAssembler.initialize(e.iaInfo),this._passes[0].batchingScheme===Yv.VB_MERGING&&this.subMesh.genFlatBuffers(),this._subMesh=e}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority=e}},{key:"inputAssembler",get:function(){return this._inputAssembler}},{key:"descriptorSet",get:function(){return this._descriptorSet}},{key:"worldBoundDescriptorSet",get:function(){return this._worldBoundDescriptorSet}},{key:"patches",get:function(){return this._patches}},{key:"planarInstanceShader",get:function(){return this._planarInstanceShader}},{key:"planarShader",get:function(){return this._planarShader}}]),e}()),fx=new Qi,dx=[{name:"CC_RECEIVE_SHADOW",value:!0}],px=[{name:"CC_USE_LIGHTMAP",value:!0}];!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.SKINNING=1]="SKINNING",e[e.BAKED_SKINNING=2]="BAKED_SKINNING",e[e.BATCH_2D=3]="BATCH_2D",e[e.PARTICLE_BATCH=4]="PARTICLE_BATCH",e[e.LINE=5]="LINE"}(ux||(ux=e("cB",{})));var mx=new Cr(Cn.LINEAR,Cn.LINEAR,Cn.NONE,Mn.CLAMP,Mn.CLAMP,Mn.CLAMP),gx=new Cr(Cn.LINEAR,Cn.LINEAR,Cn.LINEAR,Mn.CLAMP,Mn.CLAMP,Mn.CLAMP),vx=(e("cC",function(){function e(){this.type=ux.DEFAULT,this.scene=null,this.isDynamicBatching=!1,this.instancedAttributes={buffer:null,views:[],attributes:[]},this._worldBounds=null,this._modelBounds=null,this._subModels=[],this._node=null,this._transform=null,this._device=void 0,this._inited=!1,this._descriptorSetCount=1,this._updateStamp=-1,this._localDataUpdated=!0,this._localData=new Float32Array(np.COUNT),this._localBuffer=null,this._instMatWorldIdx=-1,this._lightmap=null,this._lightmapUVParam=new sn,this._worldBoundBuffer=null,this._receiveShadow=!1,this._castShadow=!1,this._shadowBias=0,this._shadowNormalBias=0,this._enabled=!0,this._visFlags=bd.Enum.NONE,this._priority=0,this._device=Va.gfxDevice}var t=e.prototype;return t.initialize=function(){this._inited||(this._receiveShadow=!0,this.castShadow=!1,this.enabled=!0,this.visFlags=bd.Enum.NONE,this._inited=!0)},t.destroy=function(){for(var e=this._subModels,t=0;t=0){var s=this.instancedAttributes.views;!function(e,t,i,n){t[0]=e.m00,t[1]=e.m01,t[2]=e.m02,t[3]=e.m12,i[0]=e.m04,i[1]=e.m05,i[2]=e.m06,i[3]=e.m13,n[0]=e.m08,n[1]=e.m09,n[2]=e.m10,n[3]=e.m14}(n,s[r],s[r+1],s[r+2])}else this._localBuffer&&(Qi.toArray(this._localData,n,np.MAT_WORLD_OFFSET),Qi.inverseTranspose(fx,n),Qi.toArray(this._localData,fx,np.MAT_WORLD_IT_OFFSET),this._localBuffer.update(this._localData))}},t.createBoundingShape=function(e,t){e&&t&&(this._modelBounds=Iu.fromPoints(Iu.create(),e,t),this._worldBounds=Iu.clone(this._modelBounds))},t._createSubModel=function(){return new _x},t.initSubModel=function(e,t,i){this.initialize(),null==this._subModels[e]?this._subModels[e]=this._createSubModel():this._subModels[e].destroy(),this._subModels[e].initialize(t,i.passes,this.getMacroPatches(e)),this._subModels[e].initPlanarShadowShader(),this._subModels[e].initPlanarShadowInstanceShader(),this._updateAttributesAndBinding(e)},t.setSubModelMesh=function(e,t){this._subModels[e]&&(this._subModels[e].subMesh=t)},t.setSubModelMaterial=function(e,t){this._subModels[e]&&(this._subModels[e].passes=t.passes,this._updateAttributesAndBinding(e))},t.onGlobalPipelineStateChanged=function(){for(var e=this._subModels,t=0;t1?gx:mx),r=this._subModels,s=0;s=0}},{key:"shadowBias",get:function(){return this._shadowBias},set:function(e){this._shadowBias=e}},{key:"shadowNormalBias",get:function(){return this._shadowNormalBias},set:function(e){this._shadowNormalBias=e}},{key:"receiveShadow",get:function(){return this._receiveShadow},set:function(e){this._receiveShadow=e,this.onMacroPatchesStateChanged()}},{key:"castShadow",get:function(){return this._castShadow},set:function(e){this._castShadow=e}},{key:"node",get:function(){return this._node},set:function(e){this._node=e}},{key:"transform",get:function(){return this._transform},set:function(e){this._transform=e}},{key:"visFlags",get:function(){return this._visFlags},set:function(e){this._visFlags=e}},{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority=e}}]),e}()),e("cP",function(){function e(){this._enabled=!1,this._minPos=new Di(0,0,0),this._maxPos=new Di(0,0,0),this._depth=0}return e.prototype.initialize=function(e){this._enabled=e.enabled,this._minPos=e.minPos,this._maxPos=e.maxPos,this._depth=e.depth},c(e,[{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e}},{key:"minPos",get:function(){return this._minPos},set:function(e){this._minPos=e}},{key:"maxPos",get:function(){return this._maxPos},set:function(e){this._maxPos=e}},{key:"depth",get:function(){return this._depth},set:function(e){this._depth=e}}]),e}())),yx=new Di(0,0,-1),Ex=new Di,Tx=(e("cU",function(e){function t(){var t;return(t=e.call(this)||this)._dir=new Di(1,-1,-1),t._illuminanceHDR=ZA.SUN_ILLUM,t._illuminanceLDR=1,t._shadowEnabled=!1,t._shadowPcf=eS.HARD,t._shadowBias=1e-5,t._shadowNormalBias=0,t._shadowSaturation=1,t._shadowDistance=50,t._shadowInvisibleOcclusionRange=200,t._csmLevel=tS.LEVEL_4,t._csmNeedUpdate=!1,t._csmLayerLambda=.75,t._csmOptimizationMode=iS.DisableRotationFix,t._shadowFixedArea=!1,t._shadowNear=.1,t._shadowFar=10,t._shadowOrthoSize=5,t._type=yN.DIRECTIONAL,t}_(t,e);var i=t.prototype;return i.initialize=function(){e.prototype.initialize.call(this),this.illuminance=ZA.SUN_ILLUM,this.direction=new Di(1,-1,-1)},i.update=function(){this._node&&this._node.hasChangedFlags&&(this.direction=Di.transformQuat(Ex,yx,this._node.worldRotation))},c(t,[{key:"direction",get:function(){return this._dir},set:function(e){Di.normalize(this._dir,e)}},{key:"illuminance",get:function(){return R.director.root.pipeline.pipelineSceneData.isHDR?this._illuminanceHDR:this._illuminanceLDR},set:function(e){R.director.root.pipeline.pipelineSceneData.isHDR?this.illuminanceHDR=e:this.illuminanceLDR=e}},{key:"illuminanceHDR",get:function(){return this._illuminanceHDR},set:function(e){this._illuminanceHDR=e}},{key:"illuminanceLDR",get:function(){return this._illuminanceLDR},set:function(e){this._illuminanceLDR=e}},{key:"shadowEnabled",get:function(){return this._shadowEnabled},set:function(e){this._shadowEnabled=e}},{key:"shadowPcf",get:function(){return this._shadowPcf},set:function(e){this._shadowPcf=e}},{key:"shadowBias",get:function(){return this._shadowBias},set:function(e){this._shadowBias=e}},{key:"shadowNormalBias",get:function(){return this._shadowNormalBias},set:function(e){this._shadowNormalBias=e}},{key:"shadowSaturation",get:function(){return this._shadowSaturation},set:function(e){this._shadowSaturation=e}},{key:"shadowDistance",get:function(){return this._shadowDistance},set:function(e){this._shadowDistance=Math.min(e,rS.MAX_FAR)}},{key:"shadowInvisibleOcclusionRange",get:function(){return this._shadowInvisibleOcclusionRange},set:function(e){this._shadowInvisibleOcclusionRange=Math.min(e,rS.MAX_FAR)}},{key:"csmLevel",get:function(){return this._csmLevel},set:function(e){this._csmLevel=e}},{key:"csmNeedUpdate",get:function(){return this._csmNeedUpdate},set:function(e){this._csmNeedUpdate=e}},{key:"csmLayerLambda",get:function(){return this._csmLayerLambda},set:function(e){this._csmLayerLambda=e}},{key:"csmOptimizationMode",get:function(){return this._csmOptimizationMode},set:function(e){this._csmOptimizationMode=e}},{key:"shadowFixedArea",get:function(){return this._shadowFixedArea},set:function(e){this._shadowFixedArea=e}},{key:"shadowNear",get:function(){return this._shadowNear},set:function(e){this._shadowNear=e}},{key:"shadowFar",get:function(){return this._shadowFar},set:function(e){this._shadowFar=Math.min(e,rS.MAX_FAR)}},{key:"shadowOrthoSize",get:function(){return this._shadowOrthoSize},set:function(e){this._shadowOrthoSize=e}}]),t}(DN)),e("cV",function(e){function t(){var t;return(t=e.call(this)||this)._needUpdate=!1,t._size=.15,t._range=1,t._luminanceHDR=0,t._luminanceLDR=0,t._pos=void 0,t._aabb=void 0,t._aabb=Iu.create(),t._pos=new Di,t._type=yN.SPHERE,t}_(t,e);var i=t.prototype;return i.initialize=function(){e.prototype.initialize.call(this),this.size=.15,this.range=1,this.luminanceHDR=1700/PN(.15),this.luminanceLDR=1},i.update=function(){if(this._node&&(this._node.hasChangedFlags||this._needUpdate)){this._node.getWorldPosition(this._pos);var e=this._range;Iu.set(this._aabb,this._pos.x,this._pos.y,this._pos.z,e,e,e),this._needUpdate=!1}},c(t,[{key:"position",get:function(){return this._pos}},{key:"size",get:function(){return this._size},set:function(e){this._size=e}},{key:"range",get:function(){return this._range},set:function(e){this._range=e,this._needUpdate=!0}},{key:"luminance",get:function(){return R.director.root.pipeline.pipelineSceneData.isHDR?this._luminanceHDR:this._luminanceLDR},set:function(e){R.director.root.pipeline.pipelineSceneData.isHDR?this.luminanceHDR=e:this.luminanceLDR=e}},{key:"luminanceHDR",get:function(){return this._luminanceHDR},set:function(e){this._luminanceHDR=e}},{key:"luminanceLDR",set:function(e){this._luminanceLDR=e}},{key:"aabb",get:function(){return this._aabb}}]),t}(DN)),new Di(0,0,-1)),Ax=new Hi,Sx=new Qi,bx=new Qi,wx=new Qi,Rx=new Qi,Ix=(e("cW",function(e){function t(){var t;return(t=e.call(this)||this)._dir=new Di(1,-1,-1),t._range=5,t._spotAngle=Math.cos(Math.PI/6),t._pos=void 0,t._aabb=void 0,t._frustum=void 0,t._angle=0,t._needUpdate=!1,t._size=.15,t._luminanceHDR=0,t._luminanceLDR=0,t._shadowEnabled=!1,t._shadowPcf=eS.HARD,t._shadowBias=1e-5,t._shadowNormalBias=0,t._aabb=Iu.create(),t._frustum=zu.create(),t._pos=new Di,t._type=yN.SPOT,t}_(t,e);var i=t.prototype;return i.initialize=function(){e.prototype.initialize.call(this),this.size=.15,this.luminanceHDR=1700/PN(.15),this.luminanceLDR=1,this.range=Math.cos(Math.PI/6),this._dir.set(new Di(1,-1,-1))},i.update=function(){this._node&&(this._node.hasChangedFlags||this._needUpdate)&&(this._node.getWorldPosition(this._pos),Di.transformQuat(this._dir,Tx,this._node.getWorldRotation(Ax)),Di.normalize(this._dir,this._dir),Iu.set(this._aabb,this._pos.x,this._pos.y,this._pos.z,this._range,this._range,this._range),this._node.getWorldRT(Sx),Qi.invert(Sx,Sx),Qi.perspective(bx,this._angle,1,.001,this._range),Qi.multiply(wx,bx,Sx),this._frustum.update(wx,Rx),this._needUpdate=!1)},c(t,[{key:"position",get:function(){return this._pos}},{key:"size",get:function(){return this._size},set:function(e){this._size=e}},{key:"range",get:function(){return this._range},set:function(e){this._range=e,this._needUpdate=!0}},{key:"luminance",get:function(){return R.director.root.pipeline.pipelineSceneData.isHDR?this._luminanceHDR:this._luminanceLDR},set:function(e){R.director.root.pipeline.pipelineSceneData.isHDR?this.luminanceHDR=e:this.luminanceLDR=e}},{key:"luminanceHDR",get:function(){return this._luminanceHDR},set:function(e){this._luminanceHDR=e}},{key:"luminanceLDR",get:function(){return this._luminanceLDR},set:function(e){this._luminanceLDR=e}},{key:"direction",get:function(){return this._dir}},{key:"spotAngle",get:function(){return this._spotAngle},set:function(e){this._angle=e,this._spotAngle=Math.cos(.5*e),this._needUpdate=!0}},{key:"angle",get:function(){return this._angle}},{key:"aabb",get:function(){return this._aabb}},{key:"frustum",get:function(){return this._frustum}},{key:"shadowEnabled",get:function(){return this._shadowEnabled},set:function(e){this._shadowEnabled=e}},{key:"shadowPcf",get:function(){return this._shadowPcf},set:function(e){this._shadowPcf=e}},{key:"shadowBias",get:function(){return this._shadowBias},set:function(e){this._shadowBias=e}},{key:"shadowNormalBias",get:function(){return this._shadowNormalBias},set:function(e){this._shadowNormalBias=e}}]),t}(DN)),new ra((function(){return{subModel:null,passIdx:-1,dynamicOffsets:[],lights:[]}}),16)),Ox=new Float32Array(4),Nx=[],Cx=[],Mx=new Qi,xx=new Qi;function Fx(e,t){return!(!t.worldBounds||pu.aabbWithAABB(t.worldBounds,e.aabb))}function Px(e,t){return!(!t.worldBounds||pu.aabbWithAABB(t.worldBounds,e.aabb)&&pu.aabbFrustum(t.worldBounds,e.frustum))}var Dx=Qv("forward-add"),Lx=[];function Bx(e,t){t.length=0;for(var i=!1,n=0;nthis._lightBufferCount&&(this._firstLightBufferView.destroy(),this._lightBufferCount=Oi(a.length),this._lightBuffer.resize(this._lightBufferStride*this._lightBufferCount),this._lightBufferData=new Float32Array(this._lightBufferElementCount*this._lightBufferCount),this._firstLightBufferView.initialize(new br(this._lightBuffer,0,op.SIZE)));for(var o=0,u=0;o=0;u--){var h=r.array[u];if(h){var c=h.model;c.enabled&&c.node&&(o&c.node.layer)===c.node.layer&&null!=a&&c.castShadow&&c.worldBounds&&pu.aabbFrustum(c.worldBounds,s)&&(a.push(h),i.level=(kd.COUNT+Hd.COUNT+Vd.COUNT+Wd.COUNT)/4,t.macros.CC_SUPPORT_CASCADED_SHADOW_MAP=t.pipelineSceneData.csmSupported,t.onGlobalPipelineStateChanged()},i.render=function(e){var t=this._pipeline,i=t.pipelineSceneData.shadows,n=t.pipelineSceneData.csmLayers,r=t.pipelineSceneData.shadowFrameBufferMap,s=n.castShadowObjects,a=this._pipeline.pipelineSceneData.validPunctualLights;if(i.enabled&&i.type===$A.ShadowMap){for(var o=0,u=0;or.x?i[u]:r.x,r.y=i[u+1]>r.y?i[u+1]:r.y,s.x=i[u]r.x?i[u]:r.x,r.y=i[u+1]>r.y?i[u+1]:r.y,r.z=i[u+2]>r.z?i[u+2]:r.z,s.x=i[u]1&&e.csmOptimizationMode===iS.RemoveDuplicates)if(this._level>=u-1)bP=this._castLightViewBoundingBox.halfExtents.z,SP=this._castLightViewBoundingBox.center.z;else{var h=Math.abs(this._castLightViewBoundingBox.center.z-SP)+bP;this._castLightViewBoundingBox.halfExtents.z=Math.max(this._castLightViewBoundingBox.center.z,h)}var c=this._castLightViewBoundingBox.halfExtents.z;this._shadowCameraFar=2*c+r;var l=this._castLightViewBoundingBox.center;if(AP.set(l.x,l.y,l.z+c+r),Di.transformMat4(AP,AP,hP),Qi.fromRT(hP,e.node.rotation,AP),Qi.invert(cP,hP),!i){var _=.5*s,f=.5*a;Qi.ortho(lP,-_,_,-f,f,.1,this._shadowCameraFar,n.capabilities.clipSpaceMinZ,n.capabilities.clipSpaceSignY),Qi.multiply(fP,lP,o),Di.transformMat4(mP,AP,fP);var d=2/t;gP.set(d,d);var p=mP.x%gP.x,m=mP.y%gP.y;vP.set(mP.x-p,mP.y-m,mP.z),Qi.invert(dP,fP),Di.transformMat4(yP,vP,dP),Qi.fromRT(hP,e.node.rotation,yP),Qi.invert(cP,hP),Qi.multiply(_P,lP,cP),Qi.copy(this._matShadowView,cP),Qi.copy(this._matShadowProj,lP),Qi.copy(this._matShadowViewProj,_P)}zu.createOrtho(this._validFrustum,s,a,.1,this._shadowCameraFar,hP)},c(e,[{key:"level",get:function(){return this._level}},{key:"shadowObjects",get:function(){return this._shadowObjects}},{key:"shadowCameraFar",get:function(){return this._shadowCameraFar},set:function(e){this._shadowCameraFar=e}},{key:"matShadowView",get:function(){return this._matShadowView},set:function(e){this._matShadowView=e}},{key:"matShadowProj",get:function(){return this._matShadowProj},set:function(e){this._matShadowProj=e}},{key:"matShadowViewProj",get:function(){return this._matShadowViewProj},set:function(e){this._matShadowViewProj=e}},{key:"validFrustum",get:function(){return this._validFrustum}},{key:"splitFrustum",get:function(){return this._splitFrustum}},{key:"lightViewFrustum",get:function(){return this._lightViewFrustum}},{key:"castLightViewBoundingBox",get:function(){return this._castLightViewBoundingBox}}]),e}(),RP=function(e){function t(t){var i;return(i=e.call(this,t)||this)._splitCameraNear=0,i._splitCameraFar=0,i._csmAtlas=new sn,i._calculateAtlas(t),i}_(t,e);var i=t.prototype;return i.destroy=function(){e.prototype.destroy.call(this)},i._calculateAtlas=function(e){var t=R.director.root.device.capabilities.clipSpaceSignY,i=e%2-.5,n=(.5-Math.floor(e/2))*t;this._csmAtlas.set(.5,.5,i,n)},c(t,[{key:"splitCameraNear",get:function(){return this._splitCameraNear},set:function(e){this._splitCameraNear=e}},{key:"splitCameraFar",get:function(){return this._splitCameraFar},set:function(e){this._splitCameraFar=e}},{key:"csmAtlas",get:function(){return this._csmAtlas},set:function(e){this._csmAtlas=e}}]),t}(wP),IP=function(){function e(){this._castShadowObjects=[],this._layerObjects=new aa(64),this._layers=[],this._levelCount=0,this._specialLayer=new wP(1),this._shadowDistance=0;for(var e=0;e1?.5*i.size.x:i.size.x;if(!(r<0)){this._getCameraWorldMatrix(uP,e);for(var s=n-1;s>=0;s--){var a=this._layers[s],o=a.splitCameraNear,u=a.splitCameraFar;a.calculateSplitFrustum(e,uP,o,u),a.createMatrix(t,r,!1)}n===tS.LEVEL_1?(this._specialLayer.shadowCameraFar=this._layers[0].shadowCameraFar,Qi.copy(this._specialLayer.matShadowView,this._layers[0].matShadowView),Qi.copy(this._specialLayer.matShadowProj,this._layers[0].matShadowProj),Qi.copy(this._specialLayer.matShadowViewProj,this._layers[0].matShadowViewProj),this._specialLayer.copyToValidFrustum(this._layers[0].validFrustum)):(this._specialLayer.calculateSplitFrustum(e,uP,.1,t.shadowDistance),this._specialLayer.createMatrix(t,r,!0))}},t._getCameraWorldMatrix=function(e,t){if(t.node){var i=t.node,n=i.getWorldPosition(),r=i.getWorldRotation();Qi.fromRT(e,r,n),e.m08*=-1,e.m09*=-1,e.m10*=-1}},c(e,[{key:"castShadowObjects",get:function(){return this._castShadowObjects}},{key:"layerObjects",get:function(){return this._layerObjects}},{key:"layers",get:function(){return this._layers}},{key:"specialLayer",get:function(){return this._specialLayer}}]),e}(),OP=e("hh",function(){function e(){this.fog=new tR,this.ambient=new ZA,this.skybox=new uS,this.shadows=new rS,this.csmLayers=new IP,this.octree=new vx,this.validPunctualLights=[],this.renderObjects=[],this.shadowFrameBufferMap=new Map,this._geometryRendererMaterials=[],this._geometryRendererPasses=[],this._geometryRendererShaders=[],this._occlusionQueryVertexBuffer=null,this._occlusionQueryIndicesBuffer=null,this._occlusionQueryInputAssembler=null,this._occlusionQueryMaterial=null,this._occlusionQueryShader=null,this._isHDR=!0,this._shadingScale=1,this._csmSupported=!0,this._shadingScale=1}var t=e.prototype;return t.activate=function(e){return this._device=e,this.initGeometryRendererMaterials(),this.initOcclusionQuery(),!0},t.initGeometryRendererMaterials=function(){for(var e=0,t=0;t<6;t++){this._geometryRendererMaterials[t]=new Ey,this._geometryRendererMaterials[t]._uuid="geometry-renderer-material-"+t,this._geometryRendererMaterials[t].initialize({effectName:"builtin-geometry-renderer",technique:t});for(var i=0;i0&&(this._occlusionQueryShader=e.passes[0].getShaderVariant())}},t.getOcclusionQueryPass=function(){return this._occlusionQueryMaterial&&this._occlusionQueryMaterial.passes.length>0?this._occlusionQueryMaterial.passes[0]:null},t.updatePipelineSceneData=function(){},t.destroy=function(){var e,t,i;this.shadows.destroy(),this.csmLayers.destroy(),this.validPunctualLights.length=0,null===(e=this._occlusionQueryInputAssembler)||void 0===e||e.destroy(),this._occlusionQueryInputAssembler=null,null===(t=this._occlusionQueryVertexBuffer)||void 0===t||t.destroy(),this._occlusionQueryVertexBuffer=null,null===(i=this._occlusionQueryIndicesBuffer)||void 0===i||i.destroy(),this._occlusionQueryIndicesBuffer=null},t._createOcclusionQueryIA=function(){var e=this._device,t=new Float32Array([-1,-1,-1,1,-1,-1,-1,1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,1,1,1,1,1]),i=3*Float32Array.BYTES_PER_ELEMENT,n=8*i;this._occlusionQueryVertexBuffer=e.createBuffer(new Sr(En.VERTEX|En.TRANSFER_DST,Sn.DEVICE,n,i)),this._occlusionQueryVertexBuffer.update(t);var r=new Uint16Array([0,2,1,1,2,3,4,5,6,5,7,6,1,3,7,1,7,5,0,4,6,0,6,2,0,1,5,0,5,4,2,6,7,2,7,3]),s=Uint16Array.BYTES_PER_ELEMENT,a=36*s;this._occlusionQueryIndicesBuffer=e.createBuffer(new Sr(En.INDEX|En.TRANSFER_DST,Sn.DEVICE,a,s)),this._occlusionQueryIndicesBuffer.update(r);var o=[new zr("a_position",gn.RGB32F)],u=new Hr(o,[this._occlusionQueryVertexBuffer],this._occlusionQueryIndicesBuffer);return e.createInputAssembler(u)},c(e,[{key:"isHDR",get:function(){return this._isHDR},set:function(e){this._isHDR=e}},{key:"shadingScale",get:function(){return this._shadingScale},set:function(e){this._shadingScale=e}},{key:"csmSupported",get:function(){return this._csmSupported},set:function(e){this._csmSupported=e}},{key:"geometryRendererPasses",get:function(){return this._geometryRendererPasses}},{key:"geometryRendererShaders",get:function(){return this._geometryRendererShaders}}]),e}()),NP=e("hi",(bF=th("ForwardPipeline"),wF=Dh([JM]),RF=Nh(),bF((CF=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r0){this._renderQueues.forEach(ox);for(var A=0;A0&&(this._stageDesc||(this._stageDesc=i.createDescriptorSet(new es(h.localSetLayout)),this._localUBO=i.createBuffer(new Sr(En.UNIFORM|En.TRANSFER_DST,Sn.DEVICE,np.SIZE,np.SIZE)),this._stageDesc.bindBuffer(np.BINDING,this._localUBO)),this._stageDesc.update(),r.bindPipelineState(_),r.bindDescriptorSet(Ld.MATERIAL,h.descriptorSet),r.bindDescriptorSet(Ld.LOCAL,this._stageDesc),r.bindInputAssembler(l),r.draw(l)),this._uiPhase.render(e,u),vy(i,u,r,t.profiler,e),r.endRenderPass()},t}(nC),sP.initInfo={name:"PostProcessStage",priority:pC.POST_PROCESS,tag:0},nP=A((iP=aP).prototype,"_postProcessMaterial",[ZF,hh,JF],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),rP=A(iP.prototype,"renderQueues",[$F,hh,eP],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),tP=iP))||tP));!function(e){e[e.NONE=0]="NONE",e[e.FXAA=1]="FXAA"}(oP||(oP={}));var LP,BP,UP,GP,zP,kP,HP,VP,WP=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r>=1,this._renderArea.height>>=1;var i=t.commandBuffers[0],n=t.pipelineSceneData.bloomMaterial.passes[0],r=t.getPipelineRenderData(),s=r.bloom,a=new Float32Array(XP.COUNT);a[XP.TEXTURE_SIZE_OFFSET+2]=this.threshold,i.updateBuffer(this._bloomUBO[0],a),i.beginRenderPass(s.renderPass,s.prefilterFramebuffer,this._renderArea,jP,0,0),i.bindDescriptorSet(Ld.GLOBAL,t.descriptorSet),n.descriptorSet.bindBuffer(0,this._bloomUBO[0]),n.descriptorSet.bindTexture(1,r.outputRenderTargets[0]),n.descriptorSet.bindSampler(1,s.sampler),n.descriptorSet.update(),i.bindDescriptorSet(Ld.MATERIAL,n.descriptorSet);var o=e.window.swapchain?t.quadIAOffscreen:t.quadIAOnscreen,u=null,h=n.getShaderVariant();null!=n&&null!=h&&null!=o&&(u=ny.getOrCreatePipelineState(t.device,n,h,s.renderPass,o)),null!=u&&(i.bindPipelineState(u),i.bindInputAssembler(o),i.draw(o)),i.endRenderPass()},i._downsamplePass=function(e,t){t.generateRenderArea(e,this._renderArea),this._renderArea.width>>=1,this._renderArea.height>>=1;for(var i=t.commandBuffers[0],n=t.pipelineSceneData.bloomMaterial,r=t.getPipelineRenderData().bloom,s=new Float32Array(XP.COUNT),a=0;a>=1,this._renderArea.height>>=1,i.beginRenderPass(r.renderPass,r.downsampleFramebuffers[a],this._renderArea,jP,0,0);var o=n.passes[1+a],u=o.getShaderVariant();o.descriptorSet.bindBuffer(0,this._bloomUBO[a+1]),0===a?o.descriptorSet.bindTexture(1,r.prefiterTex):o.descriptorSet.bindTexture(1,r.downsampleTexs[a-1]),o.descriptorSet.bindSampler(1,r.sampler),o.descriptorSet.update(),i.bindDescriptorSet(Ld.MATERIAL,o.descriptorSet);var h=e.window.swapchain?t.quadIAOffscreen:t.quadIAOnscreen,c=null;null!=o&&null!=u&&null!=h&&(c=ny.getOrCreatePipelineState(t.device,o,u,r.renderPass,h)),null!=c&&(i.bindPipelineState(c),i.bindInputAssembler(h),i.draw(h)),i.endRenderPass()}},i._upsamplePass=function(e,t){var i=t.getPipelineRenderData().bloom;t.generateRenderArea(e,this._renderArea),this._renderArea.width>>=this.iterations+1,this._renderArea.height>>=this.iterations+1;for(var n=t.commandBuffers[0],r=t.pipelineSceneData.bloomMaterial,s=new Float32Array(XP.COUNT),a=0;a=this.settings.totalTime}},{key:"curTime",get:function(){return this._curTime},set:function(e){this._curTime=e}}],[{key:"instance",get:function(){return t._ins||(t._ins=new t),t._ins}}]),t}();hD._ins=void 0,R.internal.SplashScreen=hD;var cD=new Ae("Scheduler"),lD=function(e,t,i,n){this.target=void 0,this.priority=void 0,this.paused=void 0,this.markedForDeletion=void 0,this.target=e,this.priority=t,this.paused=i,this.markedForDeletion=n};lD.get=function(e,t,i,n){var r=lD._listEntries.pop();return r?(r.target=e,r.priority=t,r.paused=i,r.markedForDeletion=n):r=new lD(e,t,i,n),r},lD.put=function(e){lD._listEntries.length<20&&(e.target=null,lD._listEntries.push(e))},lD._listEntries=[];var _D=function(e,t,i,n){this.list=void 0,this.entry=void 0,this.target=void 0,this.callback=void 0,this.list=e,this.entry=t,this.target=i,this.callback=n};_D.get=function(e,t,i,n){var r=_D._hashUpdateEntries.pop();return r?(r.list=e,r.entry=t,r.target=i,r.callback=n):r=new _D(e,t,i,n),r},_D.put=function(e){_D._hashUpdateEntries.length<20&&(e.list=e.entry=e.target=e.callback=null,_D._hashUpdateEntries.push(e))},_D._hashUpdateEntries=[];var fD=function(e,t,i,n,r,s){this.timers=void 0,this.target=void 0,this.timerIndex=void 0,this.currentTimer=void 0,this.currentTimerSalvaged=void 0,this.paused=void 0,this.timers=e,this.target=t,this.timerIndex=i,this.currentTimer=n,this.currentTimerSalvaged=r,this.paused=s};fD.get=function(e,t,i,n,r,s){var a=fD._hashTimerEntries.pop();return a?(a.timers=e,a.target=t,a.timerIndex=i,a.currentTimer=n,a.currentTimerSalvaged=r,a.paused=s):a=new fD(e,t,i,n,r,s),a},fD.put=function(e){fD._hashTimerEntries.length<20&&(e.timers=e.target=e.currentTimer=null,fD._hashTimerEntries.push(e))},fD._hashTimerEntries=[];var dD=function(){function e(){this._lock=void 0,this._scheduler=void 0,this._elapsed=void 0,this._runForever=void 0,this._useDelay=void 0,this._timesExecuted=void 0,this._repeat=void 0,this._delay=void 0,this._interval=void 0,this._target=void 0,this._callback=void 0,this._lock=!1,this._scheduler=null,this._elapsed=-1,this._runForever=!1,this._useDelay=!1,this._timesExecuted=0,this._repeat=0,this._delay=0,this._interval=0,this._target=null,this._callback=null}var t=e.prototype;return t.initWithCallback=function(e,t,i,n,r,s){return this._lock=!1,this._scheduler=e,this._target=i,this._callback=t,this._elapsed=-1,this._interval=n,this._delay=s,this._useDelay=this._delay>0,this._repeat=r,this._runForever=this._repeat===R.macro.REPEAT_FOREVER,!0},t.getInterval=function(){return this._interval},t.setInterval=function(e){this._interval=e},t.update=function(e){-1===this._elapsed?(this._elapsed=0,this._timesExecuted=0):(this._elapsed+=e,this._runForever&&!this._useDelay?this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0):(this._useDelay?this._elapsed>=this._delay&&(this.trigger(),this._elapsed-=this._delay,this._timesExecuted+=1,this._useDelay=!1):this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0,this._timesExecuted+=1),this._callback&&!this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))},t.getCallback=function(){return this._callback},t.trigger=function(){this._target&&this._callback&&(this._lock=!0,this._callback.call(this._target,this._elapsed),this._lock=!1)},t.cancel=function(){this._scheduler.unschedule(this._callback,this._target)},e}();dD._timers=[],dD.get=function(){return dD._timers.pop()||new dD},dD.put=function(e){dD._timers.length<20&&!e._lock&&(e._scheduler=e._target=e._callback=null,dD._timers.push(e))};var pD=e("cZ",function(e){function t(){var t;return(t=e.call(this)||this)._timeScale=void 0,t._updatesNegList=void 0,t._updates0List=void 0,t._updatesPosList=void 0,t._hashForUpdates=void 0,t._hashForTimers=void 0,t._currentTarget=void 0,t._currentTargetSalvaged=void 0,t._updateHashLocked=void 0,t._arrayForTimers=void 0,t._timeScale=1,t._updatesNegList=[],t._updates0List=[],t._updatesPosList=[],t._hashForUpdates=Pe(!0),t._hashForTimers=Pe(!0),t._currentTarget=null,t._currentTargetSalvaged=!1,t._updateHashLocked=!1,t._arrayForTimers=[],t}_(t,e),t.enableForTarget=function(e){var t=!1;(e.uuid||e.id)&&(t=!0),t||(e.__instanceId?Y(1513):e.id=cD.getNewId())};var i=t.prototype;return i.setTimeScale=function(e){this._timeScale=e},i.getTimeScale=function(){return this._timeScale},i.update=function(e){var t,i,n,r,s;for(this._updateHashLocked=!0,1!==this._timeScale&&(e*=this._timeScale),t=0,n=(i=this._updatesNegList).length;t=s&&n.timerIndex--,void(0===r.length&&(this._currentTarget===n?this._currentTargetSalvaged=!0:this._removeHashElement(n)))}}else K(1510)}},i.unscheduleUpdate=function(e){if(e){var t=e.uuid||e.id;if(t){var i=this._hashForUpdates[t];i&&(this._updateHashLocked?i.entry.markedForDeletion=!0:this._removeUpdateFromHash(i.entry))}else K(1510)}},i.unscheduleAllForTarget=function(e){if(e){var t=e.uuid||e.id;if(t){var i=this._hashForTimers[t];if(i){var n=i.timers;n.indexOf(i.currentTimer)>-1&&!i.currentTimerSalvaged&&(i.currentTimerSalvaged=!0);for(var r=0,s=n.length;r=0;t--)i=r[t],this.unscheduleAllForTarget(i.target);var s=0;if(e<0)for(t=0;t=e&&this.unscheduleUpdate(n.target),s===this._updatesNegList.length&&t++;if(e<=0)for(t=0;t=e&&this.unscheduleUpdate(n.target),s===this._updatesPosList.length&&t++},i.isScheduled=function(e,t){J(e,1508),J(t,1509);var i=t.uuid||t.id;if(!i)return K(1510),!1;var n=this._hashForTimers[i];if(!n)return!1;if(null==n.timers)return!1;for(var r=n.timers,s=0;s=e&&(r.paused=!0,s.push(r.target));if(e<=0)for(i=0;i=e&&(r.paused=!0,s.push(r.target));return s},i.resumeTargets=function(e){if(e)for(var t=0;t1&&(this._fps=this._frameCount,this._frameCount=0,this._fpsTime=0);for(var t=0;t0){this._device.acquire([Va.swapchain]);var s=this._scenes,a=R.director.getTotalFrames();this._batcher&&(this._batcher.update(),this._batcher.uploadBuffers());for(var o=0;o0?(this._fixedFPS=e,this._fixedFPSFrameTime=1e3/e):this._fixedFPSFrameTime=0}},{key:"dataPoolManager",get:function(){return this._dataPoolMgr}},{key:"useDeferredPipeline",get:function(){return this._useDeferredPipeline}}]),e}());R.Root=ED;var TD=function(){function e(){this._rafHandle=0,this._stHandle=0,this._onTick=null,this._targetFrameRate=60,this._frameTime=0,this._startTime=0,this._isPlaying=!1,this._rAF=void 0,this._cAF=void 0,this._rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||this._stTime.bind(this),this._cAF=window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.ocancelAnimationFrame||this._ctTime.bind(this)}var t=e.prototype;return t.start=function(){var e=this;this._isPlaying||(60===this._targetFrameRate?this._rafHandle=this._rAF.call(window,(function t(){e._isPlaying&&(e._rafHandle=e._rAF.call(window,t)),e._onTick&&e._onTick()})):(this._startTime=performance.now(),this._stHandle=this._stTime((function t(){e._startTime=performance.now(),e._isPlaying&&(e._stHandle=e._stTime(t)),e._onTick&&e._onTick()}))),this._isPlaying=!0)},t.stop=function(){this._isPlaying&&(this._cAF.call(window,this._rafHandle),this._ctTime(this._stHandle),this._rafHandle=this._stHandle=0,this._isPlaying=!1)},t._stTime=function(e){var t=performance.now(),i=Math.max(0,t-this._startTime),n=Math.max(0,this._frameTime-i);return setTimeout(e,n)},t._ctTime=function(e){clearTimeout(e)},c(e,[{key:"targetFrameRate",get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate!==e&&(this._targetFrameRate=e,this._frameTime=1e3/this._targetFrameRate,this._isPlaying&&(this.stop(),this.start()))}},{key:"onTick",get:function(){return this._onTick},set:function(e){this._onTick=e}}]),e}(),AD=function(){function e(){this._allRenderers=[],this._dirtyRenderers=[],this._dirtyVersion=0}var t=e.prototype;return t.addRenderer=function(e){-1===e._internalId&&(e._internalId=this._allRenderers.length,this._allRenderers.push(e))},t.removeRenderer=function(e){if(-1!==e._internalId){var t=e._internalId;this._allRenderers[this._allRenderers.length-1]._internalId=t,_t.array.fastRemoveAt(this._allRenderers,t),e._internalId=-1,e._dirtyVersion===this._dirtyVersion&&(_t.array.fastRemove(this._dirtyRenderers,e),e._dirtyVersion=-1)}},t.markDirtyRenderer=function(e){e._dirtyVersion!==this._dirtyVersion&&-1!==e._internalId&&(this._dirtyRenderers.push(e),e._dirtyVersion=this._dirtyVersion)},t.updateAllDirtyRenderers=function(){for(var e=this._dirtyRenderers.length,t=this._dirtyRenderers,i=0;ithis._startTime?(e-this._startTime)/1e3:0,this._deltaTime>i.DEBUG_DT_THRESHOLD&&(this._deltaTime=this.frameTime/1e3),this._startTime=e,this._deltaTime},n._updateCallback=function(){var e=this;if(this._inited)if(hD.instance.isFinished)if(this._shouldLoadLaunchScene){this._shouldLoadLaunchScene=!1;var t,i=Tt.querySettings(Et.Category.LAUNCH,"launchScene");i?wD.loadScene(i,(function(){var t;console.log("Success to load scene: "+i),e._initTime=performance.now(),wD.startAnimation(),null===(t=e.onStart)||void 0===t||t.call(e)})):(this._initTime=performance.now(),wD.startAnimation(),null===(t=this.onStart)||void 0===t||t.call(this))}else wD.tick(this._calculateDT());else hD.instance.update(this._calculateDT())},n.initPacer=function(){var e,t=null!==(e=Tt.querySettings(Et.Category.SCREEN,"frameRate"))&&void 0!==e?e:60;G("number"==typeof t),this._pacer=new TD,this._pacer.onTick=this._updateCallback.bind(this),this.frameRate=t},n._initEvents=function(){xa.on("show",this._onShow,this),xa.on("hide",this._onHide,this)},n._onHide=function(){this.emit(i.EVENT_HIDE),this.pause()},n._onShow=function(){this.emit(i.EVENT_SHOW),this.resume()},n.addPersistRootNode=function(e){wD.addPersistRootNode(e)},n.removePersistRootNode=function(e){wD.removePersistRootNode(e)},n.isPersistRootNode=function(e){return wD.isPersistRootNode(e)},n._setupRenderPipeline=function(){var e=this,t=Tt.querySettings(Et.Category.RENDERING,"renderPipeline");return t?new Promise((function(e,i){Wv.loadAny(t,(function(t,n){return!t&&n instanceof QM?e(n):i(t)}))})).then((function(t){e._setRenderPipeline(t)})).catch((function(i){B(i),B("Failed load render pipeline: "+t+", engine failed to initialize, will fallback to default pipeline"),e._setRenderPipeline()})):this._setRenderPipeline()},n._setRenderPipeline=function(e){wD.root.setRenderPipeline(e)||this._setRenderPipeline(),this._rendererInitialized=!0,this._safeEmit(i.EVENT_RENDERER_INITED)},n._safeEmit=function(e){this.emit(e)},c(i,[{key:"inited",get:function(){return this._inited}},{key:"frameRate",get:function(){return this._frameRate},set:function(e){"number"!=typeof e&&(e=parseInt(e,10),Number.isNaN(e)&&(e=60)),this._frameRate=e,this.frameTime=1e3/e,this._pacer&&(this._pacer.targetFrameRate=this._frameRate)}},{key:"deltaTime",get:function(){return this._deltaTime}},{key:"totalTime",get:function(){return performance.now()-this._initTime}},{key:"frameStartTime",get:function(){return this._startTime}}]),i}(Aa));RD.EVENT_HIDE="game_on_hide",RD.EVENT_SHOW="game_on_show",RD.EVENT_LOW_MEMORY="game_on_low_memory",RD.EVENT_GAME_INITED="game_inited",RD.EVENT_ENGINE_INITED="engine_inited",RD.EVENT_RENDERER_INITED="renderer_inited",RD.EVENT_PRE_BASE_INIT="pre_base_init",RD.EVENT_POST_BASE_INIT="post_base_init",RD.EVENT_PRE_INFRASTRUCTURE_INIT="pre_infrastructure_init",RD.EVENT_POST_INFRASTRUCTURE_INIT="post_infrastructure_init",RD.EVENT_PRE_SUBSYSTEM_INIT="pre_subsystem_init",RD.EVENT_POST_SUBSYSTEM_INIT="post_subsystem_init",RD.EVENT_PRE_PROJECT_INIT="pre_project_init",RD.EVENT_POST_PROJECT_INIT="post_project_init",RD.EVENT_RESTART="game_on_restart",RD.RENDER_TYPE_CANVAS=0,RD.RENDER_TYPE_WEBGL=1,RD.RENDER_TYPE_OPENGL=2,RD.RENDER_TYPE_HEADLESS=3,RD.DEBUG_DT_THRESHOLD=1,R.Game=RD;var ID,OD=e("d2",R.game=new RD),ND=e("eg",{topLeft:R.v2(0,0),topRight:R.v2(0,0),top:R.v2(0,0),bottomLeft:R.v2(0,0),bottomRight:R.v2(0,0),bottom:R.v2(0,0),center:R.v2(0,0),left:R.v2(0,0),right:R.v2(0,0),width:0,height:0,init:function(e){var t=this.width=e.width,i=this.height=e.height,n=e.x,r=e.y,s=r+i,a=n+t;this.topLeft.x=n,this.topLeft.y=s,this.topRight.x=a,this.topRight.y=s,this.top.x=n+t/2,this.top.y=s,this.bottomLeft.x=n,this.bottomLeft.y=r,this.bottomRight.x=a,this.bottomRight.y=r,this.bottom.x=n+t/2,this.bottom.y=r,this.center.x=n+t/2,this.center.y=r+i/2,this.left.x=n,this.left.y=r+i/2,this.right.x=a,this.right.y=r+i/2}});R.visibleRect=ND;var CD=new un,MD=((ID={})[At.ORIENTATION_AUTO]=Ca.AUTO,ID[At.ORIENTATION_LANDSCAPE]=Ca.LANDSCAPE,ID[At.ORIENTATION_PORTRAIT]=Ca.PORTRAIT,ID),xD=e("gF",function(e){function t(){var t;(t=e.call(this)||this)._designResolutionSize=void 0,t._scaleX=void 0,t._scaleY=void 0,t._viewportRect=void 0,t._visibleRect=void 0,t._autoFullScreen=void 0,t._retinaEnabled=void 0,t._resizeCallback=void 0,t._resolutionPolicy=void 0,t._rpExactFit=void 0,t._rpShowAll=void 0,t._rpNoBorder=void 0,t._rpFixedHeight=void 0,t._rpFixedWidth=void 0;var i=FD,n=PD;return t._designResolutionSize=new un(0,0),t._scaleX=1,t._scaleY=1,t._viewportRect=new cn(0,0,0,0),t._visibleRect=new cn(0,0,0,0),t._autoFullScreen=!1,t._retinaEnabled=!1,t._resizeCallback=null,t._rpExactFit=new DD(i.EQUAL_TO_FRAME,n.EXACT_FIT),t._rpShowAll=new DD(i.EQUAL_TO_FRAME,n.SHOW_ALL),t._rpNoBorder=new DD(i.EQUAL_TO_FRAME,n.NO_BORDER),t._rpFixedHeight=new DD(i.EQUAL_TO_FRAME,n.FIXED_HEIGHT),t._rpFixedWidth=new DD(i.EQUAL_TO_FRAME,n.FIXED_WIDTH),t._resolutionPolicy=t._rpShowAll,t}_(t,e);var i=t.prototype;return i.init=function(){var e=Ua.windowSize,t=e.width,i=e.height;this._designResolutionSize.width=t,this._designResolutionSize.height=i,this._viewportRect.width=t,this._viewportRect.height=i,this._visibleRect.width=t,this._visibleRect.height=i,CD.width=this._visibleRect.width,CD.height=this._visibleRect.height,ND&&ND.init(this._visibleRect),this.resizeWithBrowserSize(!0);var n=Tt.querySettings(Et.Category.SCREEN,"designResolution");n&&this.setDesignResolutionSize(Number(n.width),Number(n.height),n.policy||DD.FIXED_HEIGHT),La.on("window-resize",this._updateAdaptResult,this),La.on("orientation-change",this._updateAdaptResult,this),La.on("fullscreen-change",this._updateAdaptResult,this)},i.resizeWithBrowserSize=function(e){La.handleResizeEvent=e},i.setResizeCallback=function(e){"function"!=typeof e&&null!=e||(this._resizeCallback=e)},i.setOrientation=function(e){La.orientation=MD[e]},i.adjustViewportMeta=function(){},i.enableRetina=function(e){this._retinaEnabled=!!e},i.isRetinaEnabled=function(){return this._retinaEnabled},i.enableAutoFullScreen=function(e){e!==this._autoFullScreen&&(this._autoFullScreen=e,e&&Ua.requestFullScreen().catch((function(){})))},i.isAutoFullScreenEnabled=function(){return this._autoFullScreen},i.setCanvasSize=function(e,t){La.resolutionScale=1;var i=La.devicePixelRatio,n=new un(e*i,t*i);Ua.windowSize=n},i.getCanvasSize=function(){return Ua.windowSize},i.getFrameSize=function(){var e=La.devicePixelRatio,t=Ua.windowSize;return t.width/=e,t.height/=e,t},i.setFrameSize=function(e,t){var i=La.devicePixelRatio;Ua.windowSize=new un(e*i,t*i)},i.getVisibleSize=function(){return new un(this._visibleRect.width,this._visibleRect.height)},i.getVisibleSizeInPixel=function(){return new un(this._visibleRect.width*this._scaleX,this._visibleRect.height*this._scaleY)},i.getVisibleOrigin=function(){return new en(this._visibleRect.x,this._visibleRect.y)},i.getVisibleOriginInPixel=function(){return new en(this._visibleRect.x*this._scaleX,this._visibleRect.y*this._scaleY)},i.getResolutionPolicy=function(){return this._resolutionPolicy},i._updateResolutionPolicy=function(e){if(e instanceof DD)this._resolutionPolicy=e;else{var t=DD;e===t.EXACT_FIT&&(this._resolutionPolicy=this._rpExactFit),e===t.SHOW_ALL&&(this._resolutionPolicy=this._rpShowAll),e===t.NO_BORDER&&(this._resolutionPolicy=this._rpNoBorder),e===t.FIXED_HEIGHT&&(this._resolutionPolicy=this._rpFixedHeight),e===t.FIXED_WIDTH&&(this._resolutionPolicy=this._rpFixedWidth)}},i.setResolutionPolicy=function(e){this._updateResolutionPolicy(e);var t=LD.getDesignResolutionSize();LD.setDesignResolutionSize(t.width,t.height,e)},i.setDesignResolutionSize=function(e,t,i){if(e>0&&t>0){this._updateResolutionPolicy(i);var n=this._resolutionPolicy;n&&n.preApply(this),this._designResolutionSize.width=e,this._designResolutionSize.height=t;var r=n.apply(this,this._designResolutionSize);if(r.scale&&2===r.scale.length&&(this._scaleX=r.scale[0],this._scaleY=r.scale[1]),r.viewport){var s=this._viewportRect,a=this._visibleRect,o=r.viewport;s.x=o.x,s.y=o.y,s.width=o.width,s.height=o.height,a.x=0,a.y=0,a.width=o.width/this._scaleX,a.height=o.height/this._scaleY}n.postApply(this),CD.width=this._visibleRect.width,CD.height=this._visibleRect.height,ND&&ND.init(this._visibleRect),this.emit("design-resolution-changed")}else K(2200)},i.getDesignResolutionSize=function(){return new un(this._designResolutionSize.width,this._designResolutionSize.height)},i.setRealPixelResolution=function(e,t,i){document.documentElement.style.width=e+"px",document.body.style.width=e+"px",document.body.style.left="0px",document.body.style.top="0px",this.setDesignResolutionSize(e,t,i)},i.getViewportRect=function(){return this._viewportRect},i.getScaleX=function(){return this._scaleX},i.getScaleY=function(){return this._scaleY},i.getDevicePixelRatio=function(){return La.devicePixelRatio},i.convertToLocationInView=function(e,t,i,n){void 0===n&&(n=new en);var r=La.devicePixelRatio*(e-i.left),s=La.devicePixelRatio*(i.top+i.height-t);return La.isFrameRotated?(n.x=Ua.windowSize.width-s,n.y=r):(n.x=r,n.y=s),n},i._convertToUISpace=function(e){var t=this._viewportRect;e.x=(e.x-t.x)/this._scaleX,e.y=(e.y-t.y)/this._scaleY},i._updateAdaptResult=function(){var e;R.director.root.resize(Ua.windowSize.width,Ua.windowSize.height);var t=this._designResolutionSize.width,i=this._designResolutionSize.height;t>0&&this.setDesignResolutionSize(t,i,this._resolutionPolicy),this.emit("canvas-resize"),null===(e=this._resizeCallback)||void 0===e||e.call(this)},t}(Ta(wE)));xD.instance=void 0;var FD=function(){function e(){this.name="ContainerStrategy"}var t=e.prototype;return t.preApply=function(){},t.apply=function(){},t.postApply=function(){},t._setupCanvas=function(){var e=R.game.canvas;if(e){var t=Ua.windowSize;e.width=t.width,e.height=t.height}},e}();FD.EQUAL_TO_FRAME=void 0,FD.PROPORTION_TO_FRAME=void 0;var PD=function(){function e(){this.name="ContentStrategy",this._result=void 0,this._result={scale:[1,1],viewport:null}}var t=e.prototype;return t.preApply=function(){},t.apply=function(){return{scale:[1,1]}},t.postApply=function(){},t._buildResult=function(e,t,i,n,r,s){Math.abs(e-i)<2&&(i=e),Math.abs(t-n)<2&&(n=t);var a=new cn(Math.round((e-i)/2),Math.round((t-n)/2),i,n);return this._result.scale=[r,s],this._result.viewport=a,this._result},e}();PD.EXACT_FIT=void 0,PD.SHOW_ALL=void 0,PD.NO_BORDER=void 0,PD.FIXED_HEIGHT=void 0,PD.FIXED_WIDTH=void 0,function(){var e=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r