@galacean/cli 2.0.0-alpha.16 → 2.0.0-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/cli.bundle.cjs +1 -1
  2. package/dist/viewport-client/_static/{Accordion-8e8abfeb.js → Accordion-4581466b.js} +1 -1
  3. package/dist/viewport-client/_static/{AmbientLightAsset-20ad0c84.js → AmbientLightAsset-52dfaaf8.js} +1 -1
  4. package/dist/viewport-client/_static/{AnimationClipAsset-fc42dad4.js → AnimationClipAsset-a5adbe0b.js} +1 -1
  5. package/dist/viewport-client/_static/{AnimatorControllerAsset-2d28e356.js → AnimatorControllerAsset-1b29c766.js} +1 -1
  6. package/dist/viewport-client/_static/{AnimatorStore-41d7a260.js → AnimatorStore-2bd92a36.js} +1 -1
  7. package/dist/viewport-client/_static/{AssetViewer-ee5df0a5.js → AssetViewer-a2f4ee75.js} +1 -1
  8. package/dist/viewport-client/_static/{AudioAsset-4a8dee15.js → AudioAsset-f206da55.js} +1 -1
  9. package/dist/viewport-client/_static/{AudioComponent-b49da961.js → AudioComponent-a1e6e156.js} +1 -1
  10. package/dist/viewport-client/_static/{Callout-5731416b.js → Callout-a96a8430.js} +1 -1
  11. package/dist/viewport-client/_static/{CameraComponent-d400a082.js → CameraComponent-850a5d98.js} +1 -1
  12. package/dist/viewport-client/_static/{Component-49fa7a68.js → Component-964374b8.js} +1 -1
  13. package/dist/viewport-client/_static/{DirectLight-33282025.js → DirectLight-8734007f.js} +1 -1
  14. package/dist/viewport-client/_static/{FontAsset-68e03b27.js → FontAsset-29ed97fd.js} +1 -1
  15. package/dist/viewport-client/_static/{FormItemArray-1eb0a655.js → FormItemArray-536e9ade.js} +1 -1
  16. package/dist/viewport-client/_static/{GlTFAsset-f105daea.js → GlTFAsset-84f09723.js} +1 -1
  17. package/dist/viewport-client/_static/{IconEdit-e6cba426.js → IconEdit-493cbbb3.js} +1 -1
  18. package/dist/viewport-client/_static/{IconPointFilled-7903ac4b.js → IconPointFilled-71525313.js} +1 -1
  19. package/dist/viewport-client/_static/{LightBaseComponent-64fe62fe.js → LightBaseComponent-14ad9432.js} +1 -1
  20. package/dist/viewport-client/_static/{LottieAnimationComponent-5a53d9a8.js → LottieAnimationComponent-163b16fe.js} +1 -1
  21. package/dist/viewport-client/_static/{LottieAsset-4be66309.js → LottieAsset-898108e3.js} +1 -1
  22. package/dist/viewport-client/_static/{MarkdownAsset-b5fb62bf.js → MarkdownAsset-707897f5.js} +1 -1
  23. package/dist/viewport-client/_static/{MaterialAsset-1b309564.js → MaterialAsset-088e8e0a.js} +1 -1
  24. package/dist/viewport-client/_static/{MaterialInspector-0f1fa214.js → MaterialInspector-93a0838d.js} +1 -1
  25. package/dist/viewport-client/_static/{Menu-4b6f69f6.js → Menu-d694f08a.js} +1 -1
  26. package/dist/viewport-client/_static/{MeshAsset-4c7358f8.js → MeshAsset-ff94b6a7.js} +1 -1
  27. package/dist/viewport-client/_static/{MeshRendererBaseComponent-7d9673f0.js → MeshRendererBaseComponent-b7db519d.js} +1 -1
  28. package/dist/viewport-client/_static/{MeshRendererComponent-ac7bf46b.js → MeshRendererComponent-7f29ba50.js} +1 -1
  29. package/dist/viewport-client/_static/{MeshThumbnail-e9c08166.js → MeshThumbnail-768ca939.js} +1 -1
  30. package/dist/viewport-client/_static/{ParticleRendererComponent-34dd0c15.js → ParticleRendererComponent-9bcd1886.js} +1 -1
  31. package/dist/viewport-client/_static/{PhysicsMaterialAsset-af1ebf10.js → PhysicsMaterialAsset-291fc997.js} +1 -1
  32. package/dist/viewport-client/_static/{PhysicsStore-e7d36c5c.js → PhysicsStore-50022658.js} +1 -1
  33. package/dist/viewport-client/_static/{PointLight-651ea32e.js → PointLight-248fb1a9.js} +1 -1
  34. package/dist/viewport-client/_static/{PostProcessComponent-fc2f6f21.js → PostProcessComponent-cd6546b3.js} +1 -1
  35. package/dist/viewport-client/_static/{PrefabAsset-a6b88bbd.js → PrefabAsset-0afc28fa.js} +1 -1
  36. package/dist/viewport-client/_static/{PrimitiveMesh-dc3ad0fa.js → PrimitiveMesh-10b1161f.js} +1 -1
  37. package/dist/viewport-client/_static/{ProxyConfigs-85431ba7.js → ProxyConfigs-d85202ac.js} +1 -1
  38. package/dist/viewport-client/_static/{ReferencedMaterial-b96134c1.js → ReferencedMaterial-659bf0ee.js} +1 -1
  39. package/dist/viewport-client/_static/{RenderTargetAsset-fab94566.js → RenderTargetAsset-248f1eb5.js} +1 -1
  40. package/dist/viewport-client/_static/{SceneAsset-7e22b810.js → SceneAsset-c2a6f842.js} +1 -1
  41. package/dist/viewport-client/_static/{ShaderAsset-c9f375b5.js → ShaderAsset-d1e99a96.js} +1 -1
  42. package/dist/viewport-client/_static/{ShaderChunkAsset-e6717d7f.js → ShaderChunkAsset-6fc715c5.js} +1 -1
  43. package/dist/viewport-client/_static/{ShaderUIScriptAsset-259555e9.js → ShaderUIScriptAsset-aa3adb43.js} +1 -1
  44. package/dist/viewport-client/_static/{SkinnedMeshRendererComponent-d64b225e.js → SkinnedMeshRendererComponent-4a77c8d9.js} +1 -1
  45. package/dist/viewport-client/_static/{SpineAnimationComponent-ba68382f.js → SpineAnimationComponent-b5de1844.js} +1 -1
  46. package/dist/viewport-client/_static/{SpineSkeletonDataAsset-8ea5b7b8.js → SpineSkeletonDataAsset-cddcc22b.js} +1 -1
  47. package/dist/viewport-client/_static/{SpotLight-18d73c78.js → SpotLight-3bb8f39e.js} +1 -1
  48. package/dist/viewport-client/_static/{SpriteAsset-0c49dc5d.js → SpriteAsset-9b36d0ae.js} +1 -1
  49. package/dist/viewport-client/_static/{SpriteAtlasAsset-6461f25f.js → SpriteAtlasAsset-3f3112ca.js} +1 -1
  50. package/dist/viewport-client/_static/{SpriteBaseComponent-f1a5422d.js → SpriteBaseComponent-ab727e8e.js} +1 -1
  51. package/dist/viewport-client/_static/{SpriteMaskComponent-b2cd1787.js → SpriteMaskComponent-ed64e403.js} +1 -1
  52. package/dist/viewport-client/_static/{SpriteRendererComponent-503d7e55.js → SpriteRendererComponent-8afb7837.js} +1 -1
  53. package/dist/viewport-client/_static/{TextBaseComponent-186ad55d.js → TextBaseComponent-13689460.js} +1 -1
  54. package/dist/viewport-client/_static/{TextRendererComponent-cffe7c03.js → TextRendererComponent-8eb60833.js} +1 -1
  55. package/dist/viewport-client/_static/{TextureAsset-be48e190.js → TextureAsset-77e6000d.js} +2 -2
  56. package/dist/viewport-client/_static/{Tooltip-01dd51dc.js → Tooltip-c35612f0.js} +1 -1
  57. package/dist/viewport-client/_static/{TrailRendererComponent-2bbe404b.js → TrailRendererComponent-cabae051.js} +1 -1
  58. package/dist/viewport-client/_static/{TransformBaseComponent-4fd596d1.js → TransformBaseComponent-c0a6a3c8.js} +1 -1
  59. package/dist/viewport-client/_static/{TransformComponent-540cfdc3.js → TransformComponent-d6649e8f.js} +1 -1
  60. package/dist/viewport-client/_static/{XRReferenceImageAsset-b3c01eec.js → XRReferenceImageAsset-b786aca3.js} +1 -1
  61. package/dist/viewport-client/_static/{audio-4bf84573.js → audio-7c0ae7d6.js} +1 -1
  62. package/dist/viewport-client/_static/{index-7e3053d3.js → index-0487cdcf.js} +1 -1
  63. package/dist/viewport-client/_static/index-06fc94fa.js +1 -0
  64. package/dist/viewport-client/_static/{index-a6b152de.js → index-24bc6a91.js} +1 -1
  65. package/dist/viewport-client/_static/{index-adfb8156.js → index-48d557b0.js} +1 -1
  66. package/dist/viewport-client/_static/{index-07686e59.js → index-6087df7e.js} +1 -1
  67. package/dist/viewport-client/_static/index-6798427d.js +1 -0
  68. package/dist/viewport-client/_static/{index-07b22cd4.js → index-7abbe07f.js} +1 -1
  69. package/dist/viewport-client/_static/index-7b81c737.js +1 -0
  70. package/dist/viewport-client/_static/{index-f3f5cf05.js → index-8800c7e6.js} +1 -1
  71. package/dist/viewport-client/_static/index-8b6ebbf6.js +1 -0
  72. package/dist/viewport-client/_static/index-8b6efd6a.js +1 -0
  73. package/dist/viewport-client/_static/{index-1844727f.js → index-906d9f78.js} +1 -1
  74. package/dist/viewport-client/_static/{index-d7bb5fc3.js → index-b731a7fe.js} +1 -1
  75. package/dist/viewport-client/_static/index-bd2b1247.js +1 -0
  76. package/dist/viewport-client/_static/{index-3c825346.js → index-ca459192.js} +1 -1
  77. package/dist/viewport-client/_static/{index-c91bca3c.js → index-d07818b5.js} +3 -3
  78. package/dist/viewport-client/_static/{index-af55ef2b.js → index-fd599472.js} +1 -1
  79. package/dist/viewport-client/_static/{ktx2-encoder-486056b9.js → ktx2-encoder-5413e034.js} +1 -1
  80. package/dist/viewport-client/_static/{module-a20a329a.js → module-4879e776.js} +1 -1
  81. package/dist/viewport-client/_static/{module-ea41b53d.js → module-7c8b159f.js} +1 -1
  82. package/dist/viewport-client/_static/{module-b106d3a2.js → module-b565f34f.js} +1 -1
  83. package/dist/viewport-client/_static/postmen-e6429bad.js +1 -0
  84. package/dist/viewport-client/index.html +1 -1
  85. package/package.json +24 -29
  86. package/dist/viewport-client/_static/index-05673ab3.js +0 -1
  87. package/dist/viewport-client/_static/index-1aa955ce.js +0 -1
  88. package/dist/viewport-client/_static/index-39c4a09f.js +0 -1
  89. package/dist/viewport-client/_static/index-a44cbb78.js +0 -1
  90. package/dist/viewport-client/_static/index-a5d368cf.js +0 -1
  91. package/dist/viewport-client/_static/index-ad26cc11.js +0 -1
  92. package/dist/viewport-client/_static/postmen-c85935a0.js +0 -1
@@ -1 +1 @@
1
- import{N as wt,W as ct,X as tt,Y as bt,Z as F,_ as q,$ as it,a0 as xt,a1 as Pt,a2 as St,a3 as nt,a4 as zt,a as At,S as Lt,a5 as W,a6 as st,a7 as et,a8 as Tt,a9 as Mt}from"./index-c91bca3c.js";function ot(a,n){for(var i=0;i<n.length;i++){var t=n[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}function Rt(a,n,i){return n&&ot(a.prototype,n),i&&ot(a,i),a}function Y(a,n){return Y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Y(a,n)}function A(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),n&&Y(a,n)}function O(a,n,i,t){var e=arguments.length,r=e<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,i):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(a,n,i,t);else for(var o=a.length-1;o>=0;o--)(s=a[o])&&(r=(e<3?s(r):e>3?s(n,i,r):s(n,i))||r);return e>3&&r&&Object.defineProperty(n,i,r),r}var Ot=4,It=.001,Ct=1e-7,Vt=10,D=11,N=1/(D-1),Ft=typeof Float32Array=="function";function _t(a,n){return 1-3*n+3*a}function dt(a,n){return 3*n-6*a}function yt(a){return 3*a}function G(a,n,i){return((_t(n,i)*a+dt(n,i))*a+yt(n))*a}function gt(a,n,i){return 3*_t(n,i)*a*a+2*dt(n,i)*a+yt(n)}function Ut(a,n,i,t,e){var r,s,o=0;do s=n+(i-n)/2,r=G(s,t,e)-a,r>0?i=s:n=s;while(Math.abs(r)>Ct&&++o<Vt);return s}function Bt(a,n,i,t){for(var e=0;e<Ot;++e){var r=gt(n,i,t);if(r===0)return n;var s=G(n,i,t)-a;n-=s/r}return n}function jt(a){return a}var Dt=function(n,i,t,e){if(!(0<=n&&n<=1&&0<=t&&t<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===i&&t===e)return jt;for(var r=Ft?new Float32Array(D):new Array(D),s=0;s<D;++s)r[s]=G(s*N,n,t);function o(u){for(var h=0,f=1,l=D-1;f!==l&&r[f]<=u;++f)h+=N;--f;var p=(u-r[f])/(r[f+1]-r[f]),c=h+p*N,v=gt(c,n,t);return v>=It?Bt(u,c,n,t):v===0?c:Ut(u,h,h+N,n,t)}return function(h){return h===0?0:h===1?1:G(o(h),i,e)}},at=200,ht={};function qt(a,n,i,t,e){var r=e||("bez_"+a+"_"+n+"_"+i+"_"+t).replace(/\./g,"p"),s=ht[r];return s||(s=Dt(a,n,i,t),ht[r]=s,s)}var J={};function Nt(a,n,i,t,e){var r=e?Math.min(e,at):at,s=(a[0]+"_"+a[1]+"_"+n[0]+"_"+n[1]+"_"+i[0]+"_"+i[1]+"_"+t[0]+"_"+t[1]+"_"+r).replace(/\./g,"p");if(!J[s]){for(var o=0,u,h=[],f=0;f<r;f++){for(var l=i.length,p=new Array(l),c=f/(r-1),v=0,_=0;_<l;_+=1){var d=Math.pow(1-c,3)*a[_]+3*Math.pow(1-c,2)*c*(a[_]+i[_])+3*(1-c)*Math.pow(c,2)*(n[_]+t[_])+Math.pow(c,3)*n[_];p[_]=d,u&&(v+=Math.pow(p[_]-u[_],2))}v=Math.sqrt(v),o+=v,h.push({partialLength:v,point:p}),u=p}J[s]={segmentLength:o,points:h}}return J[s]}var K={buildBezierData:Nt,getBezierEasing:qt},L={euclideanModulo:function(n,i){return(n%i+i)%i},codomainBounce:function(n,i,t){return n<i?2*i-n:n>t?2*t-n:n},clamp:function(n,i,t){return n<i?i:n>t?t:n}},mt=/(loopIn|loopOut)\(([^)]+)/,Wt=/["']\w+["']/,ut=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in")return t>=this.begin?t:this.end-L.euclideanModulo(this.begin-t,this.total);if(this.type==="out")return t<=this.end?t:this.begin+L.euclideanModulo(t-this.end,this.total)},a}(),lt=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in"&&t<this.begin||this.type==="out"&&t>this.end){var e=t-this.end;return this.pingpong(e)}return t},n.pingpong=function(t){var e=Math.floor(t/this.total)%2;return e?this.begin+L.euclideanModulo(t,this.total):this.end-L.euclideanModulo(t,this.total)},a}(),ft={loopIn:function(n,i,t){var e=n[0].t,r=n.length-1,s=Math.min(r,t),o=n[s].t;switch(i){case"cycle":return new ut("in",e,o);case"pingpong":return new lt("in",e,o)}return null},loopOut:function(n,i,t){var e=n.length-1,r=Math.max(0,e-t),s=n[r].t,o=n[e].t;switch(i){case"cycle":return new ut("out",s,o);case"pingpong":return new lt("out",s,o)}return null}};function Gt(a){var n=a.split(/\s*,\s*/);return n.map(function(i){return Wt.test(i)?i.replace(/"|'/g,""):parseInt(i)})}function Kt(a){var n=a.match(mt),i=Gt(n[2]);return{name:n[1],mode:i[0],offset:i[1]}}function Zt(a){return a.x&&mt.test(a.x)}function $t(a){var n=Kt(a.x),i=n.name,t=n.mode,e=n.offset,r=e===void 0?0:e,s=r===0?a.k.length-1:r;return ft[i]&&ft[i](a.k,t,s)}var Z={hasSupportExpression:Zt,getExpression:$t},k=function(){function a(i,t){this.mult=t||1,this.value=i.k,this.animated=i.a,Z.hasSupportExpression(i)&&(this.expression=Z.getExpression(i))}var n=a.prototype;return n.getValue=function(t,e,r,s){var o,u=r.t,h=s.t,f=r.s[e],l=(s.s||r.e)[e];if(r.h===1)return f;if(t>=h)o=1;else if(t<u)o=0;else{var p=r.beziers[e];p||(typeof r.o.x=="number"?p=K.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y):p=K.getBezierEasing(r.o.x[e],r.o.y[e],r.i.x[e],r.i.y[e]),r.beziers[e]=p),o=p((t-u)/(h-u))}return f+(l-f)*o},n.reset=function(){},a}(),kt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r.v=e?r.value*e:r.value,r}var i=n.prototype;return i.update=function(){this.v=this.value*this.mult},n}(k),Ht=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;r=a.call(this,t,e)||this;var s=r.value.length;r.v=new Float32Array(s),r.newValue=new Float32Array(s);for(var o=0;o<s;o+=1)r.v[o]=r.value[o]*r.mult;return r}var i=n.prototype;return i.update=function(){var e;e=this.value;for(var r=0,s=this.v.length;r<s;r++)this.v[r]=e[r]*this.mult},n}(k),Jt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r._value=0,r.v=0,Z.hasSupportExpression(t)&&(r.expression=Z.getExpression(t)),r}var i=n.prototype;return i.reset=function(){this._value=0},i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s,o,u=0,h=r.length-1;u<h&&(s=r[u],o=r[u+1],!(o.t>e));u++);s.beziers||(s.beziers=[]),this.v=this.getValue(e,0,s,o)*this.mult},n}(k),Qt=function(a){A(n,a);function n(t,e,r){e===void 0&&(e=1);var s;s=a.call(this,t,e)||this,s._lastPoint=0,s._addedLength=0;var o=s.value[0].s.length;return r&&(s._frames=r>>0),s.newValue=new Float32Array(o),s.v=new Float32Array(o),s}var i=n.prototype;return i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s=this.newValue,o,u,h=0,f=r.length-1;h<f;h++)if(o=r[h],u=r[h+1],u.t>e){this._lastPoint=0,this._addedLength=0;break}if(e>u.t){for(var l=0,p=this.v.length;l<p;l++)this.v[l]=this.getValue(e,l,o,u)*this.mult;return}if(o.to){var c=u.t,v=o.t;o.bezierData||(o.bezierData=K.buildBezierData(o.s,u.s||o.e,o.to,o.ti,this._frames));var _=o.bezierData,d=_.points,m=_.segmentLength,y=o.timeBezier;y||(y=K.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n),o.timeBezier=y);var b=0;c>=0&&(b=(e-v)/(c-v),b=Math.min(Math.max(0,b),1));for(var g=y(b),x=m*g,E=this._addedLength,P=this._lastPoint,w=P,T=d.length;w<T;w++){if(w===T-1){P=0,E=0;break}P=w;var M=d[w],R=d[w+1],I=R.partialLength;if(x>=E&&x<E+I){for(var U=(x-E)/I,S=0,B=M.point.length;S<B;S+=1)s[S]=M.point[S]+(R.point[S]-M.point[S])*U;break}E+=I}this._lastPoint=P,this._addedLength=E}else{o.beziers||(o.beziers=[]);for(var C=0,j=o.s.length;C<j;C++)s[C]=this.getValue(e,C,o,u)}for(var V=0,H=this.v.length;V<H;V++)this.v[V]=s[V]*this.mult},n}(k),Yt=function(){function a(i){this.properties=[],this.autoOrient=!1;var t=a.create;i.p.k?(this.p=t(i.p,1),this.properties.push(this.p)):(i.p.x&&(this.x=t(i.p.x,1),this.properties.push(this.x)),i.p.y&&(this.y=t(i.p.y,1),this.properties.push(this.y)),i.p.z&&(this.z=t(i.p.z,1),this.properties.push(this.z))),this.a=t(i.a,1),this.properties.push(this.a),this.s=t(i.s,1,.01),this.properties.push(this.s),this.o=t(i.o,0,.01),this.properties.push(this.o),i.r?(this.r=t(i.r,0),this.properties.push(this.r)):i.rx||i.ry||i.rz?(i.rx&&(this.rx=t(i.rx,0),this.properties.push(this.rx)),i.ry&&(this.ry=t(i.ry,0),this.properties.push(this.ry)),i.rz&&(this.rz=t(i.rz,0),this.properties.push(this.rz))):i.or&&(this.or=t(i.or,1),this.properties.push(this.or)),this.properties.length||this.update()}var n=a.prototype;return n.reset=function(){for(var t=0,e=this.properties.length;t<e;t++)this.properties[t].reset()},n.update=function(t){t===void 0&&(t=0);for(var e=this.properties.length,r=0;r<e;r++)this.properties[r].update(t);this.autoOrient},a.create=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t.k.length?typeof t.k[0]=="number"?new Ht(t,r):e?new Qt(t,r,t.k[t.k.length-1].t-t.k[0].t):new Jt(t,r):new kt(t,r)},a}(),rt=function(){function a(i){this.stretch=1,this.parent=null,this.visible=!0,this.startTime=0,this.treeIndex=[],this.childLayers=[],this.is3D=!!i.ddd,this.name=i.nm||"",this.index=i.index,this.timeRemapping=i.tm,this.width=i.w,this.height=i.h,this.inPoint=i.ip,this.outPoint=i.op,i.st&&(this.startTime=i.st),this.stretch=i.stretch||1,this.offsetTime=i.offsetTime||0,i.ks&&(this.transform=new Yt(i.ks))}var n=a.prototype;return n.reset=function(){this.transform&&this.transform.reset();for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].reset()},n.update=function(t,e){t===void 0&&(t=0);var r=(t-this.offsetTime)/this.stretch;e===!0?this.visible=this.inPoint<=r&&this.outPoint>=r:e===!1&&(this.visible=!1),this.transform&&this.visible&&this.transform.update(r);for(var s=0;s<this.childLayers.length;s++)this.childLayers[s].update(t,this.visible)},n.addChild=function(t){t.parent=this,t.entity.parent=this.entity,this.childLayers.push(t)},n.destroy=function(){this.entity.parent=null,this.entity.destroy(),this.entity=null,this.transform=null,this.parent=null},a}(),Q=function(a){A(n,a);function n(t,e,r,s){var o;if(o=a.call(this,t)||this,o.layers=t.layers,o.comps=t.comps,r)o.entity=r,s&&(o.entity.name=s);else{var u=new q(e,s);o.entity=u}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.layers=null,this.comps=null},n}(rt),Xt=function(a){A(n,a);function n(t,e,r,s){var o;o=a.call(this,t)||this;var u;if(t.refId){if(s)o.entity=s,u=s.getComponent(it),o.sprite=u.sprite;else{o.sprite=e.getSprite(t.refId);var h=new q(r.engine,t.nm);u=h.addComponent(it),u.sprite=o.sprite,o.entity=h}var f=o.sprite,l=f.atlasRegion,p=f.texture;p.wrapModeU=p.wrapModeV=xt.Clamp,o.spriteRenderer=u,u.priority=(Number.MAX_SAFE_INTEGER-o.index*1e6)/Number.MAX_SAFE_INTEGER,o.width=l.width*p.width,o.height=l.height*p.height}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.sprite=null,this.spriteRenderer=null},n}(rt),te=function(a){A(n,a);function n(i,t,e,r){var s,o,u,h;s=a.call(this,i)||this,e?(s.entity=e,r&&(s.entity.name=r)):s.entity=new q(t,i.nm);var f=s.entity.addComponent(Pt),l=(h=i)==null||(u=h.t)==null||(o=u.d)==null?void 0:o.k;if(l.length===1){var p,c,v=(c=l)==null||(p=c[0])==null?void 0:p.s;if(v){var _=v.t,d=v.f,m=v.s,y=v.fc,b=v.lh;f.font=St.createFromOS(t,d),f.text=_,f.fontSize=m,f.color.set(y[0],y[1],y[2],1),f.lineSpacing=b}else nt.warn("TextLottieElement: "+r+", No corresponding text data found.")}else nt.warn("TextLottieElement: multi keyframes feature is not supported in this version.");return f.priority=(Number.MAX_SAFE_INTEGER-s.index*1e6)/Number.MAX_SAFE_INTEGER,s}return n}(rt),z=function(a){A(n,a);function n(){var t;return t=a.apply(this,arguments)||this,t.repeats=0,t.isLooping=!1,t.isAlternate=!1,t.direction=1,t.speed=1,t.pixelsPerUnit=zt._pixelsPerUnit,t._alpha=1,t._priority=0,t._priorityDirty=!0,t._layer=At.Layer0,t._layerDirty=!0,t._autoPlay=!1,t._clipEndCallbacks={},t._isPlaying=!1,t._curFrame=0,t._frame=0,t._root=null,t}var i=n.prototype;return i.play=function(e){var r=this;if(e){var s=this.resource.clips[e];this._clip=s}else this._clip=null;return this._isPlaying=!0,this._frame=this._curFrame,new Promise(function(o){e?r._clipEndCallbacks[e]=o:r._clipEndCallbacks.ALL=o})},i.pause=function(){this._isPlaying=!1,this._curFrame=this._frame},i.stop=function(){this._isPlaying=!1,this._curFrame=0,this._frame=0},i._setLayer=function(e,r){r||(r=this.entity),r.layer=e;for(var s=r.children,o=s.length-1;o>=0;o--){var u=s[o];u.layer=e,this._setLayer(e,u)}},i._createLayerElements=function(e,r,s,o){if(e)for(var u=0,h=e.length;u<h;u++){var f=e[u],l=null;if(f.td===void 0){var p=s.treeIndex.concat(u),c=o&&this._findEntityInTree(p);switch(f.ty){case 0:l=new Q(f,this.engine,c,f.id);break;case 2:l=new Xt(f,this._resource.atlas,this.entity,c);break;case 3:var v,_,d;((d=f)==null||(_=d.ks)==null||(v=_.o)==null?void 0:v.k)===0&&(f.ks.o.k=100),l=new Q(f,this.engine,c,f.id);break;case 5:l=new te(f,this.engine,c,f.id);break}l&&(l.treeIndex=p,r.push(l),s.addChild(l),f.layers&&this._createLayerElements(f.layers,r,l,o))}}},i._findEntityInTree=function(e){for(var r,s=0,o=e.length;s<o;s++){var u=e[s];r?r=r.children[u]:r=this.entity.children[u]}return r},i._createElements=function(e,r){var s=new Q(e,this.engine,this.entity);this._root=s;var o=s.layers,u=[];this._createLayerElements(o,u,s,r),this._elements=u},i._updateElements=function(e){this._root.update(e);for(var r=this._elements,s=0,o=r.length;s<o;s++){var u=r[s];this._updateElement(u)}},i._updateElement=function(e){var r,s,o,u,h=e.transform,f=e.entity,l=e.sprite,p=e.spriteRenderer,c=e.parent,v=e.width,_=e.height,d=f.transform,m=h.a.v,y=h.s.v,b=h.o.v,g=this.pixelsPerUnit,x=0,E=0,P=0;if(h.p){var w=h.p.v,T;x=(T=w[0])!=null?T:0;var M;E=(M=w[1])!=null?M:0;var R;P=(R=w[2])!=null?R:0}else h.x&&(x=h.x.v),h.y&&(E=h.y.v),h.z&&(P=h.z.v);var I=0,U=0,S=0;if(!e.visible){f.isActive=e.visible;return}if(h.r)S=h.r.v;else if(h.rx||h.ry||h.rz)I=h.rx?h.rx.v:0,U=h.ry?h.ry.v:0,S=h.rz?h.rz.v:0;else if(h.or){var B=h.or.v;I=B[0],U=B[1],S=B[2]}if(!((s=c)==null||(r=s.transform)==null)&&r.o){var C;b*=(C=c)==null?void 0:C.transform.o.v}if(l){var j=p.color,V=j.r,H=j.g,Et=j.b;p.color.set(V,H,Et,b*this._alpha),l.pixelsPerUnit=g,l.pivot=n._pivotVector.set(m[0]/v,(_-m[1])/_)}f.isActive=e.visible,d.setScale(y[0],y[1],y[2]),d.setRotation(I,U,-S),!((u=c)==null||(o=u.transform)==null)&&o.a?d.setPosition((x-c.transform.a.v[0])/g,(-E+c.transform.a.v[1])/g,P/g):d.setPosition((x-this._width/2)/g,(-E+this._height/2)/g,P/g)},i._resetElements=function(){for(var e=this._elements,r=0,s=e.length;r<s;r++)e[r].reset()},i.onUpdate=function(e){if(!this._isPlaying||!this._resource)return null;if(this._priorityDirty){this._priorityDirty=!1;var r=n._tempRenderers;r.length=0,this.entity.getComponentsIncludeChildren(bt,r);for(var s=0,o=0,u=r.length;o<u;++o){var h=r[o];o===0&&(s=this._priority-Math.floor(h.priority)),h.priority=h.priority+s}}this._layerDirty&&(this._layerDirty=!1,this._setLayer(this.layer,this.entity));var f=this.direction*this.speed*e*1e3;this._frame+=f/this._resource.timePerFrame;var l=this._clip;if(this._spill()){var p=this._resource.duration;if(this._resetElements(),this.repeats>0||this.isLooping)this.repeats>0&&--this.repeats,this.isAlternate?(this.direction*=-1,l?this._frame=L.codomainBounce(this._frame,0,l.end-l.start):this._frame=L.codomainBounce(this._frame,0,p)):(this.direction=1,l?this._frame=L.euclideanModulo(this._frame,l.end-l.start):this._frame=L.euclideanModulo(this._frame,p));else if(l){if(this._frame>=l.end-l.start){var c=this._clipEndCallbacks[l.name];c&&c(l)}this._frame=L.clamp(this._frame,0,l.end-l.start)}else{if(this._frame>=p){var v=this._clipEndCallbacks.ALL;v&&v()}this._frame=L.clamp(this._frame,0,p)}}l?this._updateElements(this._resource.inPoint+this._frame+l.start):this._updateElements(this._resource.inPoint+this._frame)},i._spill=function(){var e;if(this._clip){var r=this._clip;e=r.end-r.start}else e=this._resource.duration;var s=this._frame<=0&&this.direction===-1,o=this._frame>=e&&this.direction===1;return s||o},i._cloneTo=function(e){e._createElements(this._resource,!0)},i._destroy=function(){var e=this._elements;if(e)for(var r=0,s=e.length;r<s;r++)e[r].destroy()},i.onDestroy=function(){this._destroy()},Rt(n,[{key:"resource",get:function(){return this._resource},set:function(e){this._resource!==e&&(this._resource&&(this.pause(),this._destroy(),this._resource.refCount--,this._resource.refCount<=0&&this._resource.destroy()),this._resource=e,e&&(e.refCount++,this._width=e.width,this._height=e.height,this._createElements(e),this._priorityDirty=!0,this._layerDirty=!0),this._curFrame=0,this.play(),this.onUpdate(0),this.autoPlay||this.pause())}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority!==e&&(this._priority=e,this._priorityDirty=!0)}},{key:"layer",get:function(){return this._layer},set:function(e){this._layer!==e&&(this._layer=e,this._layerDirty=!0)}},{key:"alpha",get:function(){return this._alpha},set:function(e){this._alpha!==e&&(this._alpha=e,this.isPlaying||(this.play(),this.onUpdate(0),this.pause()))}},{key:"autoPlay",get:function(){return this._autoPlay},set:function(e){this._autoPlay=e,e&&this.play()}},{key:"frame",get:function(){return this._frame}},{key:"isPlaying",get:function(){return this._isPlaying}}]),n}(Lt);(function(){z._pivotVector=new wt})();(function(){z._tempRenderers=[]})();O([F],z.prototype,"_clipEndCallbacks",void 0);O([F],z.prototype,"_isPlaying",void 0);O([F],z.prototype,"_curFrame",void 0);O([F],z.prototype,"_frame",void 0);O([F],z.prototype,"_root",void 0);O([F],z.prototype,"_elements",void 0);function ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function $(){return $=Object.assign||function(n){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},$.apply(this,arguments)}function re(a){"@swc/helpers - typeof";return a&&typeof Symbol<"u"&&a.constructor===Symbol?"symbol":typeof a}var X=function(a){A(n,a);function n(t,e,r){var s;s=a.call(this,t)||this,s.refCount=0,s.timePerFrame=1e3/e.fr,s.duration=Math.floor(e.op-e.ip),s.width=e.w,s.height=e.h,s.inPoint=e.ip,s.outPoint=e.op,s.atlas=r,s.layers=e.layers,s.comps=e.assets,s.name=e.nm,s.clips={};var o={},u=ee(s).comps;if(u)for(var h=0,f=u.length;h<f;h++){var l=u[h];l.id&&(o[l.id]=l)}return s._buildTree(s.layers,o),e.lolitaAnimations&&s._parseAnimations(e.lolitaAnimations),s}var i=n.prototype;return i.setClips=function(e){this.clips={},this._parseAnimations(e)},i._parseAnimations=function(e){var r=this;e.forEach(function(s){r.clips[s.name]=$({},s)})},i._buildTree=function(e,r,s,o,u,h){s===void 0&&(s=0),o===void 0&&(o=1),u===void 0&&(u=0),h===void 0&&(h=1);for(var f={},l=0,p=e.length;l<p;l++){var c=e[l],v;f[(v=c.ind)!=null?v:l]=c}for(var _=e.length-1;_>=0;_--){var d=e[_],m=d.refId,y=d.parent;d.offsetTime=s,d.stretch=o;var b;if(d.index=((b=d.ind)!=null?b:_)*h+u,y&&(f[y].layers||(f[y].layers=[]),f[y].layers.push(d),e.splice(_,1)),m&&r[m]){for(var g=[],x=0;x<r[m].layers.length;x++)g.push(this._deepClone(r[m].layers[x]));var E=(d.offsetTime||0)+(d.st||0),P=(d.stretch||1)*(d.sr||1),w=g.length-1,T,M=h/(((T=g[w].ind)!=null?T:w)+1)*h;if(this._buildTree(g,r,E,P,d.index,M),d.layers){var R;(R=d.layers).push.apply(R,[].concat(g))}else d.layers=[].concat(g)}}},i._deepClone=function(e){var r=this,s=Array.isArray(e)?[].concat(e):$({},e);return Reflect.ownKeys(s).map(function(o){s[o]=r._isObject(e[o])?r._deepClone(e[o]):e[o]}),s},i._isObject=function(e){return(typeof e=="object"||typeof e=="function")&&(typeof e>"u"?"undefined":re(e))!==null},i.destroy=function(){var e,r;(e=(r=this.atlas).destroy)==null||e.call(r),this.atlas=null,this.layers=null,this.clips=null,this.comps=null,a.prototype.destroy.call(this)},n}(Tt),pt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){return new W(function(s,o){var u=e.url;r._request(u,{type:"json"}).then(function(h){var f=h.jsonUrl,l=h.atlasUrl,p=r._request(st.resolveAbsoluteUrl(u,f),r),c=r.load({url:st.resolveAbsoluteUrl(u,l),type:et.SpriteAtlas});W.all([p,c]).then(function(v){var _=v[0],d=v[1],m=r.engine,y=new X(m,_,d);s(y)}).catch(o)}).catch(o)})},n}(tt);pt=O([ct("EditorLottie",["json"])],pt);var ie=function(){function a(i,t){var e=this;this.sprites={},this.assetsPromises=[],this.assetsPromises=i.map(function(r){return t.resourceManager.load({url:r.p,type:et.Texture2D}).then(function(s){var o=new Mt(t);o.texture=s,e.sprites[r.id]=o})})}var n=a.prototype;return n.request=function(){return Promise.all(this.assetsPromises)},n.getSprite=function(t){return this.sprites[t]},a}(),vt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){var s=e.urls,o=r._request(s[0],{type:"json"});if(s[1]){var u=r.load({url:s[1],type:et.SpriteAtlas});return W.all([o,u]).then(function(h){var f=h[0],l=h[1],p=r.engine,c=new X(p,f,l),v=new q(p),_=v.addComponent(z);return _.resource=c,v})}else return W.all([o]).then(function(h){var f=h[0],l=r.engine,p=f.assets.filter(function(v){return v.p});f.assets=f.assets.filter(function(v){return!v.p});var c=new ie(p,l);return c.request().then(function(){var v=new X(l,f,c),_=new q(l),d=_.addComponent(z);return d.resource=v,_})})},n}(tt);vt=O([ct("lottie",["json"])],vt);tt.registerClass("LottieAnimation",z);export{z as L};
1
+ import{N as wt,W as ct,X as tt,Y as bt,Z as F,_ as q,$ as it,a0 as xt,a1 as Pt,a2 as St,a3 as nt,a4 as zt,a as At,S as Lt,a5 as W,a6 as st,a7 as et,a8 as Tt,a9 as Mt}from"./index-d07818b5.js";function ot(a,n){for(var i=0;i<n.length;i++){var t=n[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}function Rt(a,n,i){return n&&ot(a.prototype,n),i&&ot(a,i),a}function Y(a,n){return Y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Y(a,n)}function A(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),n&&Y(a,n)}function O(a,n,i,t){var e=arguments.length,r=e<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,i):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(a,n,i,t);else for(var o=a.length-1;o>=0;o--)(s=a[o])&&(r=(e<3?s(r):e>3?s(n,i,r):s(n,i))||r);return e>3&&r&&Object.defineProperty(n,i,r),r}var Ot=4,It=.001,Ct=1e-7,Vt=10,D=11,N=1/(D-1),Ft=typeof Float32Array=="function";function _t(a,n){return 1-3*n+3*a}function dt(a,n){return 3*n-6*a}function yt(a){return 3*a}function G(a,n,i){return((_t(n,i)*a+dt(n,i))*a+yt(n))*a}function gt(a,n,i){return 3*_t(n,i)*a*a+2*dt(n,i)*a+yt(n)}function Ut(a,n,i,t,e){var r,s,o=0;do s=n+(i-n)/2,r=G(s,t,e)-a,r>0?i=s:n=s;while(Math.abs(r)>Ct&&++o<Vt);return s}function Bt(a,n,i,t){for(var e=0;e<Ot;++e){var r=gt(n,i,t);if(r===0)return n;var s=G(n,i,t)-a;n-=s/r}return n}function jt(a){return a}var Dt=function(n,i,t,e){if(!(0<=n&&n<=1&&0<=t&&t<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===i&&t===e)return jt;for(var r=Ft?new Float32Array(D):new Array(D),s=0;s<D;++s)r[s]=G(s*N,n,t);function o(u){for(var h=0,f=1,l=D-1;f!==l&&r[f]<=u;++f)h+=N;--f;var p=(u-r[f])/(r[f+1]-r[f]),c=h+p*N,v=gt(c,n,t);return v>=It?Bt(u,c,n,t):v===0?c:Ut(u,h,h+N,n,t)}return function(h){return h===0?0:h===1?1:G(o(h),i,e)}},at=200,ht={};function qt(a,n,i,t,e){var r=e||("bez_"+a+"_"+n+"_"+i+"_"+t).replace(/\./g,"p"),s=ht[r];return s||(s=Dt(a,n,i,t),ht[r]=s,s)}var J={};function Nt(a,n,i,t,e){var r=e?Math.min(e,at):at,s=(a[0]+"_"+a[1]+"_"+n[0]+"_"+n[1]+"_"+i[0]+"_"+i[1]+"_"+t[0]+"_"+t[1]+"_"+r).replace(/\./g,"p");if(!J[s]){for(var o=0,u,h=[],f=0;f<r;f++){for(var l=i.length,p=new Array(l),c=f/(r-1),v=0,_=0;_<l;_+=1){var d=Math.pow(1-c,3)*a[_]+3*Math.pow(1-c,2)*c*(a[_]+i[_])+3*(1-c)*Math.pow(c,2)*(n[_]+t[_])+Math.pow(c,3)*n[_];p[_]=d,u&&(v+=Math.pow(p[_]-u[_],2))}v=Math.sqrt(v),o+=v,h.push({partialLength:v,point:p}),u=p}J[s]={segmentLength:o,points:h}}return J[s]}var K={buildBezierData:Nt,getBezierEasing:qt},L={euclideanModulo:function(n,i){return(n%i+i)%i},codomainBounce:function(n,i,t){return n<i?2*i-n:n>t?2*t-n:n},clamp:function(n,i,t){return n<i?i:n>t?t:n}},mt=/(loopIn|loopOut)\(([^)]+)/,Wt=/["']\w+["']/,ut=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in")return t>=this.begin?t:this.end-L.euclideanModulo(this.begin-t,this.total);if(this.type==="out")return t<=this.end?t:this.begin+L.euclideanModulo(t-this.end,this.total)},a}(),lt=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in"&&t<this.begin||this.type==="out"&&t>this.end){var e=t-this.end;return this.pingpong(e)}return t},n.pingpong=function(t){var e=Math.floor(t/this.total)%2;return e?this.begin+L.euclideanModulo(t,this.total):this.end-L.euclideanModulo(t,this.total)},a}(),ft={loopIn:function(n,i,t){var e=n[0].t,r=n.length-1,s=Math.min(r,t),o=n[s].t;switch(i){case"cycle":return new ut("in",e,o);case"pingpong":return new lt("in",e,o)}return null},loopOut:function(n,i,t){var e=n.length-1,r=Math.max(0,e-t),s=n[r].t,o=n[e].t;switch(i){case"cycle":return new ut("out",s,o);case"pingpong":return new lt("out",s,o)}return null}};function Gt(a){var n=a.split(/\s*,\s*/);return n.map(function(i){return Wt.test(i)?i.replace(/"|'/g,""):parseInt(i)})}function Kt(a){var n=a.match(mt),i=Gt(n[2]);return{name:n[1],mode:i[0],offset:i[1]}}function Zt(a){return a.x&&mt.test(a.x)}function $t(a){var n=Kt(a.x),i=n.name,t=n.mode,e=n.offset,r=e===void 0?0:e,s=r===0?a.k.length-1:r;return ft[i]&&ft[i](a.k,t,s)}var Z={hasSupportExpression:Zt,getExpression:$t},k=function(){function a(i,t){this.mult=t||1,this.value=i.k,this.animated=i.a,Z.hasSupportExpression(i)&&(this.expression=Z.getExpression(i))}var n=a.prototype;return n.getValue=function(t,e,r,s){var o,u=r.t,h=s.t,f=r.s[e],l=(s.s||r.e)[e];if(r.h===1)return f;if(t>=h)o=1;else if(t<u)o=0;else{var p=r.beziers[e];p||(typeof r.o.x=="number"?p=K.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y):p=K.getBezierEasing(r.o.x[e],r.o.y[e],r.i.x[e],r.i.y[e]),r.beziers[e]=p),o=p((t-u)/(h-u))}return f+(l-f)*o},n.reset=function(){},a}(),kt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r.v=e?r.value*e:r.value,r}var i=n.prototype;return i.update=function(){this.v=this.value*this.mult},n}(k),Ht=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;r=a.call(this,t,e)||this;var s=r.value.length;r.v=new Float32Array(s),r.newValue=new Float32Array(s);for(var o=0;o<s;o+=1)r.v[o]=r.value[o]*r.mult;return r}var i=n.prototype;return i.update=function(){var e;e=this.value;for(var r=0,s=this.v.length;r<s;r++)this.v[r]=e[r]*this.mult},n}(k),Jt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r._value=0,r.v=0,Z.hasSupportExpression(t)&&(r.expression=Z.getExpression(t)),r}var i=n.prototype;return i.reset=function(){this._value=0},i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s,o,u=0,h=r.length-1;u<h&&(s=r[u],o=r[u+1],!(o.t>e));u++);s.beziers||(s.beziers=[]),this.v=this.getValue(e,0,s,o)*this.mult},n}(k),Qt=function(a){A(n,a);function n(t,e,r){e===void 0&&(e=1);var s;s=a.call(this,t,e)||this,s._lastPoint=0,s._addedLength=0;var o=s.value[0].s.length;return r&&(s._frames=r>>0),s.newValue=new Float32Array(o),s.v=new Float32Array(o),s}var i=n.prototype;return i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s=this.newValue,o,u,h=0,f=r.length-1;h<f;h++)if(o=r[h],u=r[h+1],u.t>e){this._lastPoint=0,this._addedLength=0;break}if(e>u.t){for(var l=0,p=this.v.length;l<p;l++)this.v[l]=this.getValue(e,l,o,u)*this.mult;return}if(o.to){var c=u.t,v=o.t;o.bezierData||(o.bezierData=K.buildBezierData(o.s,u.s||o.e,o.to,o.ti,this._frames));var _=o.bezierData,d=_.points,m=_.segmentLength,y=o.timeBezier;y||(y=K.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n),o.timeBezier=y);var b=0;c>=0&&(b=(e-v)/(c-v),b=Math.min(Math.max(0,b),1));for(var g=y(b),x=m*g,E=this._addedLength,P=this._lastPoint,w=P,T=d.length;w<T;w++){if(w===T-1){P=0,E=0;break}P=w;var M=d[w],R=d[w+1],I=R.partialLength;if(x>=E&&x<E+I){for(var U=(x-E)/I,S=0,B=M.point.length;S<B;S+=1)s[S]=M.point[S]+(R.point[S]-M.point[S])*U;break}E+=I}this._lastPoint=P,this._addedLength=E}else{o.beziers||(o.beziers=[]);for(var C=0,j=o.s.length;C<j;C++)s[C]=this.getValue(e,C,o,u)}for(var V=0,H=this.v.length;V<H;V++)this.v[V]=s[V]*this.mult},n}(k),Yt=function(){function a(i){this.properties=[],this.autoOrient=!1;var t=a.create;i.p.k?(this.p=t(i.p,1),this.properties.push(this.p)):(i.p.x&&(this.x=t(i.p.x,1),this.properties.push(this.x)),i.p.y&&(this.y=t(i.p.y,1),this.properties.push(this.y)),i.p.z&&(this.z=t(i.p.z,1),this.properties.push(this.z))),this.a=t(i.a,1),this.properties.push(this.a),this.s=t(i.s,1,.01),this.properties.push(this.s),this.o=t(i.o,0,.01),this.properties.push(this.o),i.r?(this.r=t(i.r,0),this.properties.push(this.r)):i.rx||i.ry||i.rz?(i.rx&&(this.rx=t(i.rx,0),this.properties.push(this.rx)),i.ry&&(this.ry=t(i.ry,0),this.properties.push(this.ry)),i.rz&&(this.rz=t(i.rz,0),this.properties.push(this.rz))):i.or&&(this.or=t(i.or,1),this.properties.push(this.or)),this.properties.length||this.update()}var n=a.prototype;return n.reset=function(){for(var t=0,e=this.properties.length;t<e;t++)this.properties[t].reset()},n.update=function(t){t===void 0&&(t=0);for(var e=this.properties.length,r=0;r<e;r++)this.properties[r].update(t);this.autoOrient},a.create=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t.k.length?typeof t.k[0]=="number"?new Ht(t,r):e?new Qt(t,r,t.k[t.k.length-1].t-t.k[0].t):new Jt(t,r):new kt(t,r)},a}(),rt=function(){function a(i){this.stretch=1,this.parent=null,this.visible=!0,this.startTime=0,this.treeIndex=[],this.childLayers=[],this.is3D=!!i.ddd,this.name=i.nm||"",this.index=i.index,this.timeRemapping=i.tm,this.width=i.w,this.height=i.h,this.inPoint=i.ip,this.outPoint=i.op,i.st&&(this.startTime=i.st),this.stretch=i.stretch||1,this.offsetTime=i.offsetTime||0,i.ks&&(this.transform=new Yt(i.ks))}var n=a.prototype;return n.reset=function(){this.transform&&this.transform.reset();for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].reset()},n.update=function(t,e){t===void 0&&(t=0);var r=(t-this.offsetTime)/this.stretch;e===!0?this.visible=this.inPoint<=r&&this.outPoint>=r:e===!1&&(this.visible=!1),this.transform&&this.visible&&this.transform.update(r);for(var s=0;s<this.childLayers.length;s++)this.childLayers[s].update(t,this.visible)},n.addChild=function(t){t.parent=this,t.entity.parent=this.entity,this.childLayers.push(t)},n.destroy=function(){this.entity.parent=null,this.entity.destroy(),this.entity=null,this.transform=null,this.parent=null},a}(),Q=function(a){A(n,a);function n(t,e,r,s){var o;if(o=a.call(this,t)||this,o.layers=t.layers,o.comps=t.comps,r)o.entity=r,s&&(o.entity.name=s);else{var u=new q(e,s);o.entity=u}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.layers=null,this.comps=null},n}(rt),Xt=function(a){A(n,a);function n(t,e,r,s){var o;o=a.call(this,t)||this;var u;if(t.refId){if(s)o.entity=s,u=s.getComponent(it),o.sprite=u.sprite;else{o.sprite=e.getSprite(t.refId);var h=new q(r.engine,t.nm);u=h.addComponent(it),u.sprite=o.sprite,o.entity=h}var f=o.sprite,l=f.atlasRegion,p=f.texture;p.wrapModeU=p.wrapModeV=xt.Clamp,o.spriteRenderer=u,u.priority=(Number.MAX_SAFE_INTEGER-o.index*1e6)/Number.MAX_SAFE_INTEGER,o.width=l.width*p.width,o.height=l.height*p.height}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.sprite=null,this.spriteRenderer=null},n}(rt),te=function(a){A(n,a);function n(i,t,e,r){var s,o,u,h;s=a.call(this,i)||this,e?(s.entity=e,r&&(s.entity.name=r)):s.entity=new q(t,i.nm);var f=s.entity.addComponent(Pt),l=(h=i)==null||(u=h.t)==null||(o=u.d)==null?void 0:o.k;if(l.length===1){var p,c,v=(c=l)==null||(p=c[0])==null?void 0:p.s;if(v){var _=v.t,d=v.f,m=v.s,y=v.fc,b=v.lh;f.font=St.createFromOS(t,d),f.text=_,f.fontSize=m,f.color.set(y[0],y[1],y[2],1),f.lineSpacing=b}else nt.warn("TextLottieElement: "+r+", No corresponding text data found.")}else nt.warn("TextLottieElement: multi keyframes feature is not supported in this version.");return f.priority=(Number.MAX_SAFE_INTEGER-s.index*1e6)/Number.MAX_SAFE_INTEGER,s}return n}(rt),z=function(a){A(n,a);function n(){var t;return t=a.apply(this,arguments)||this,t.repeats=0,t.isLooping=!1,t.isAlternate=!1,t.direction=1,t.speed=1,t.pixelsPerUnit=zt._pixelsPerUnit,t._alpha=1,t._priority=0,t._priorityDirty=!0,t._layer=At.Layer0,t._layerDirty=!0,t._autoPlay=!1,t._clipEndCallbacks={},t._isPlaying=!1,t._curFrame=0,t._frame=0,t._root=null,t}var i=n.prototype;return i.play=function(e){var r=this;if(e){var s=this.resource.clips[e];this._clip=s}else this._clip=null;return this._isPlaying=!0,this._frame=this._curFrame,new Promise(function(o){e?r._clipEndCallbacks[e]=o:r._clipEndCallbacks.ALL=o})},i.pause=function(){this._isPlaying=!1,this._curFrame=this._frame},i.stop=function(){this._isPlaying=!1,this._curFrame=0,this._frame=0},i._setLayer=function(e,r){r||(r=this.entity),r.layer=e;for(var s=r.children,o=s.length-1;o>=0;o--){var u=s[o];u.layer=e,this._setLayer(e,u)}},i._createLayerElements=function(e,r,s,o){if(e)for(var u=0,h=e.length;u<h;u++){var f=e[u],l=null;if(f.td===void 0){var p=s.treeIndex.concat(u),c=o&&this._findEntityInTree(p);switch(f.ty){case 0:l=new Q(f,this.engine,c,f.id);break;case 2:l=new Xt(f,this._resource.atlas,this.entity,c);break;case 3:var v,_,d;((d=f)==null||(_=d.ks)==null||(v=_.o)==null?void 0:v.k)===0&&(f.ks.o.k=100),l=new Q(f,this.engine,c,f.id);break;case 5:l=new te(f,this.engine,c,f.id);break}l&&(l.treeIndex=p,r.push(l),s.addChild(l),f.layers&&this._createLayerElements(f.layers,r,l,o))}}},i._findEntityInTree=function(e){for(var r,s=0,o=e.length;s<o;s++){var u=e[s];r?r=r.children[u]:r=this.entity.children[u]}return r},i._createElements=function(e,r){var s=new Q(e,this.engine,this.entity);this._root=s;var o=s.layers,u=[];this._createLayerElements(o,u,s,r),this._elements=u},i._updateElements=function(e){this._root.update(e);for(var r=this._elements,s=0,o=r.length;s<o;s++){var u=r[s];this._updateElement(u)}},i._updateElement=function(e){var r,s,o,u,h=e.transform,f=e.entity,l=e.sprite,p=e.spriteRenderer,c=e.parent,v=e.width,_=e.height,d=f.transform,m=h.a.v,y=h.s.v,b=h.o.v,g=this.pixelsPerUnit,x=0,E=0,P=0;if(h.p){var w=h.p.v,T;x=(T=w[0])!=null?T:0;var M;E=(M=w[1])!=null?M:0;var R;P=(R=w[2])!=null?R:0}else h.x&&(x=h.x.v),h.y&&(E=h.y.v),h.z&&(P=h.z.v);var I=0,U=0,S=0;if(!e.visible){f.isActive=e.visible;return}if(h.r)S=h.r.v;else if(h.rx||h.ry||h.rz)I=h.rx?h.rx.v:0,U=h.ry?h.ry.v:0,S=h.rz?h.rz.v:0;else if(h.or){var B=h.or.v;I=B[0],U=B[1],S=B[2]}if(!((s=c)==null||(r=s.transform)==null)&&r.o){var C;b*=(C=c)==null?void 0:C.transform.o.v}if(l){var j=p.color,V=j.r,H=j.g,Et=j.b;p.color.set(V,H,Et,b*this._alpha),l.pixelsPerUnit=g,l.pivot=n._pivotVector.set(m[0]/v,(_-m[1])/_)}f.isActive=e.visible,d.setScale(y[0],y[1],y[2]),d.setRotation(I,U,-S),!((u=c)==null||(o=u.transform)==null)&&o.a?d.setPosition((x-c.transform.a.v[0])/g,(-E+c.transform.a.v[1])/g,P/g):d.setPosition((x-this._width/2)/g,(-E+this._height/2)/g,P/g)},i._resetElements=function(){for(var e=this._elements,r=0,s=e.length;r<s;r++)e[r].reset()},i.onUpdate=function(e){if(!this._isPlaying||!this._resource)return null;if(this._priorityDirty){this._priorityDirty=!1;var r=n._tempRenderers;r.length=0,this.entity.getComponentsIncludeChildren(bt,r);for(var s=0,o=0,u=r.length;o<u;++o){var h=r[o];o===0&&(s=this._priority-Math.floor(h.priority)),h.priority=h.priority+s}}this._layerDirty&&(this._layerDirty=!1,this._setLayer(this.layer,this.entity));var f=this.direction*this.speed*e*1e3;this._frame+=f/this._resource.timePerFrame;var l=this._clip;if(this._spill()){var p=this._resource.duration;if(this._resetElements(),this.repeats>0||this.isLooping)this.repeats>0&&--this.repeats,this.isAlternate?(this.direction*=-1,l?this._frame=L.codomainBounce(this._frame,0,l.end-l.start):this._frame=L.codomainBounce(this._frame,0,p)):(this.direction=1,l?this._frame=L.euclideanModulo(this._frame,l.end-l.start):this._frame=L.euclideanModulo(this._frame,p));else if(l){if(this._frame>=l.end-l.start){var c=this._clipEndCallbacks[l.name];c&&c(l)}this._frame=L.clamp(this._frame,0,l.end-l.start)}else{if(this._frame>=p){var v=this._clipEndCallbacks.ALL;v&&v()}this._frame=L.clamp(this._frame,0,p)}}l?this._updateElements(this._resource.inPoint+this._frame+l.start):this._updateElements(this._resource.inPoint+this._frame)},i._spill=function(){var e;if(this._clip){var r=this._clip;e=r.end-r.start}else e=this._resource.duration;var s=this._frame<=0&&this.direction===-1,o=this._frame>=e&&this.direction===1;return s||o},i._cloneTo=function(e){e._createElements(this._resource,!0)},i._destroy=function(){var e=this._elements;if(e)for(var r=0,s=e.length;r<s;r++)e[r].destroy()},i.onDestroy=function(){this._destroy()},Rt(n,[{key:"resource",get:function(){return this._resource},set:function(e){this._resource!==e&&(this._resource&&(this.pause(),this._destroy(),this._resource.refCount--,this._resource.refCount<=0&&this._resource.destroy()),this._resource=e,e&&(e.refCount++,this._width=e.width,this._height=e.height,this._createElements(e),this._priorityDirty=!0,this._layerDirty=!0),this._curFrame=0,this.play(),this.onUpdate(0),this.autoPlay||this.pause())}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority!==e&&(this._priority=e,this._priorityDirty=!0)}},{key:"layer",get:function(){return this._layer},set:function(e){this._layer!==e&&(this._layer=e,this._layerDirty=!0)}},{key:"alpha",get:function(){return this._alpha},set:function(e){this._alpha!==e&&(this._alpha=e,this.isPlaying||(this.play(),this.onUpdate(0),this.pause()))}},{key:"autoPlay",get:function(){return this._autoPlay},set:function(e){this._autoPlay=e,e&&this.play()}},{key:"frame",get:function(){return this._frame}},{key:"isPlaying",get:function(){return this._isPlaying}}]),n}(Lt);(function(){z._pivotVector=new wt})();(function(){z._tempRenderers=[]})();O([F],z.prototype,"_clipEndCallbacks",void 0);O([F],z.prototype,"_isPlaying",void 0);O([F],z.prototype,"_curFrame",void 0);O([F],z.prototype,"_frame",void 0);O([F],z.prototype,"_root",void 0);O([F],z.prototype,"_elements",void 0);function ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function $(){return $=Object.assign||function(n){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},$.apply(this,arguments)}function re(a){"@swc/helpers - typeof";return a&&typeof Symbol<"u"&&a.constructor===Symbol?"symbol":typeof a}var X=function(a){A(n,a);function n(t,e,r){var s;s=a.call(this,t)||this,s.refCount=0,s.timePerFrame=1e3/e.fr,s.duration=Math.floor(e.op-e.ip),s.width=e.w,s.height=e.h,s.inPoint=e.ip,s.outPoint=e.op,s.atlas=r,s.layers=e.layers,s.comps=e.assets,s.name=e.nm,s.clips={};var o={},u=ee(s).comps;if(u)for(var h=0,f=u.length;h<f;h++){var l=u[h];l.id&&(o[l.id]=l)}return s._buildTree(s.layers,o),e.lolitaAnimations&&s._parseAnimations(e.lolitaAnimations),s}var i=n.prototype;return i.setClips=function(e){this.clips={},this._parseAnimations(e)},i._parseAnimations=function(e){var r=this;e.forEach(function(s){r.clips[s.name]=$({},s)})},i._buildTree=function(e,r,s,o,u,h){s===void 0&&(s=0),o===void 0&&(o=1),u===void 0&&(u=0),h===void 0&&(h=1);for(var f={},l=0,p=e.length;l<p;l++){var c=e[l],v;f[(v=c.ind)!=null?v:l]=c}for(var _=e.length-1;_>=0;_--){var d=e[_],m=d.refId,y=d.parent;d.offsetTime=s,d.stretch=o;var b;if(d.index=((b=d.ind)!=null?b:_)*h+u,y&&(f[y].layers||(f[y].layers=[]),f[y].layers.push(d),e.splice(_,1)),m&&r[m]){for(var g=[],x=0;x<r[m].layers.length;x++)g.push(this._deepClone(r[m].layers[x]));var E=(d.offsetTime||0)+(d.st||0),P=(d.stretch||1)*(d.sr||1),w=g.length-1,T,M=h/(((T=g[w].ind)!=null?T:w)+1)*h;if(this._buildTree(g,r,E,P,d.index,M),d.layers){var R;(R=d.layers).push.apply(R,[].concat(g))}else d.layers=[].concat(g)}}},i._deepClone=function(e){var r=this,s=Array.isArray(e)?[].concat(e):$({},e);return Reflect.ownKeys(s).map(function(o){s[o]=r._isObject(e[o])?r._deepClone(e[o]):e[o]}),s},i._isObject=function(e){return(typeof e=="object"||typeof e=="function")&&(typeof e>"u"?"undefined":re(e))!==null},i.destroy=function(){var e,r;(e=(r=this.atlas).destroy)==null||e.call(r),this.atlas=null,this.layers=null,this.clips=null,this.comps=null,a.prototype.destroy.call(this)},n}(Tt),pt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){return new W(function(s,o){var u=e.url;r._request(u,{type:"json"}).then(function(h){var f=h.jsonUrl,l=h.atlasUrl,p=r._request(st.resolveAbsoluteUrl(u,f),r),c=r.load({url:st.resolveAbsoluteUrl(u,l),type:et.SpriteAtlas});W.all([p,c]).then(function(v){var _=v[0],d=v[1],m=r.engine,y=new X(m,_,d);s(y)}).catch(o)}).catch(o)})},n}(tt);pt=O([ct("EditorLottie",["json"])],pt);var ie=function(){function a(i,t){var e=this;this.sprites={},this.assetsPromises=[],this.assetsPromises=i.map(function(r){return t.resourceManager.load({url:r.p,type:et.Texture2D}).then(function(s){var o=new Mt(t);o.texture=s,e.sprites[r.id]=o})})}var n=a.prototype;return n.request=function(){return Promise.all(this.assetsPromises)},n.getSprite=function(t){return this.sprites[t]},a}(),vt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){var s=e.urls,o=r._request(s[0],{type:"json"});if(s[1]){var u=r.load({url:s[1],type:et.SpriteAtlas});return W.all([o,u]).then(function(h){var f=h[0],l=h[1],p=r.engine,c=new X(p,f,l),v=new q(p),_=v.addComponent(z);return _.resource=c,v})}else return W.all([o]).then(function(h){var f=h[0],l=r.engine,p=f.assets.filter(function(v){return v.p});f.assets=f.assets.filter(function(v){return!v.p});var c=new ie(p,l);return c.request().then(function(){var v=new X(l,f,c),_=new q(l),d=_.addComponent(z);return d.resource=v,_})})},n}(tt);vt=O([ct("lottie",["json"])],vt);tt.registerClass("LottieAnimation",z);export{z as L};
@@ -1 +1 @@
1
- import{W as de,as as he,at as me,au as pe,av as ve,N as Se,K as v,a5 as ue,aw as we,X as ke,ax as q,ay as H,b as j,az as Q,aA as be,aB as ye}from"./index-c91bca3c.js";function ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ce=function(){return!!e})()}function V(e,r){return V=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},V(e,r)}function R(e,r,a){return ce()?R=Reflect.construct:R=function(t,i,s){var o=[null];o.push.apply(o,i);var h=Function.bind.apply(t,o),u=new h;return s&&V(u,s.prototype),u},R.apply(null,arguments)}function X(e,r){for(var a=0;a<r.length;a++){var n=r[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function A(e,r,a){return r&&X(e.prototype,r),a&&X(e,a),e}function p(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&V(e,r)}function ee(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}var M=function(e){return e[e.Controller=0]="Controller",e[e.LeftController=1]="LeftController",e[e.RightController=2]="RightController",e[e.Camera=3]="Camera",e[e.LeftCamera=4]="LeftCamera",e[e.RightCamera=5]="RightCamera",e[e.LeftHand=6]="LeftHand",e[e.RightHand=7]="RightHand",e}({}),k=function(e){return e[e.None=0]="None",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized",e[e.Running=3]="Running",e[e.Paused=4]="Paused",e}({}),Me=function(){function e(a){this._xrManager=a}var r=e.prototype;return r.attachCamera=function(n,t){var i=this._xrManager.inputManager.getTrackedDevice(n),s=i._camera;if(s!==t){switch(s&&(s._cameraType=q.Normal),n){case M.Camera:t._cameraType=q.XRCenterCamera;break;case M.LeftCamera:t._cameraType=q.XRLeftCamera;break;case M.RightCamera:t._cameraType=q.XRRightCamera;break}i._camera=t}},r.detachCamera=function(n){var t=this._xrManager.inputManager.getTrackedDevice(n),i=t._camera;return i&&(i._cameraType=q.Normal),t._camera=null,i},r._onSessionStart=function(){},r._onUpdate=function(){for(var n=this._xrManager.inputManager._cameras,t=this._xrManager.sessionManager._platformSession,i=0,s=n.length;i<s;i++){var o=n[i],h=o._camera;if(h){var u=h.entity.transform,c=o.pose;u.position=c.position,u.rotationQuaternion=c.rotation;var f=h.viewport,_=o.viewport,l=_.x,g=_.y,d=_.width,m=_.height;l===f.x&&g===f.y&&d===f.z&&m===f.w||(h.viewport=f.set(l,g,d,m)),H.equals(h.projectionMatrix,o.projectionMatrix)||(h.projectionMatrix=o.projectionMatrix),h.renderTarget||h._adjustPixelViewport(t.framebufferWidth,t.framebufferHeight)}}},r._onSessionExit=function(){for(var n=this._xrManager.inputManager._cameras,t=0,i=n.length;t<i;t++){var s;(s=n[t]._camera)==null||s._updatePixelViewport()}},r._getIgnoreClearFlags=function(n){return n===q.XRCenterCamera?this._xrManager.sessionManager.state===k.Running?j.Color:j.None:j.None},r._onDestroy=function(){},A(e,[{key:"fixedFoveation",get:function(){var n=this._xrManager.sessionManager,t=n._platformSession;if(t)return t.getFixedFoveation();throw new Error("XR session is not available.")},set:function(n){var t=this._xrManager.sessionManager,i=t._platformSession;if(i)i.setFixedFoveation(n);else throw new Error("XR session is not available.")}}]),e}(),O=function(){this.position=new v,this.rotation=new ye,this.matrix=new H,this.inverseMatrix=new H},w=function(e){return e[e.NotTracking=0]="NotTracking",e[e.Tracking=1]="Tracking",e[e.TrackingLost=2]="TrackingLost",e}({}),fe=function(r){this.type=r,this.trackingState=w.NotTracking},xe=function(e){p(r,e);function r(){var a;return a=e.apply(this,arguments)||this,a.pose=new O,a.viewport=new be,a.projectionMatrix=new H,a}return r}(fe),b=function(e){return e[e.None=0]="None",e[e.Select=1]="Select",e[e.Trigger=1]="Trigger",e[e.Squeeze=2]="Squeeze",e[e.TouchPad=4]="TouchPad",e[e.AButton=8]="AButton",e[e.BButton=16]="BButton",e}({}),Ce=function(e){p(r,e);function r(){var n;return n=e.apply(this,arguments)||this,n.gripPose=new O,n.targetRayPose=new O,n.pressedButtons=b.None,n.down=b.None,n.up=b.None,n}var a=r.prototype;return a.isButtonDown=function(t){return(this.down&t)!==0},a.isButtonUp=function(t){return(this.up&t)!==0},a.isButtonHeldDown=function(t){return(this.pressedButtons&t)!==0},r}(fe),P=function(e){return e[e.SelectStart=0]="SelectStart",e[e.Select=1]="Select",e[e.SelectEnd=2]="SelectEnd",e[e.SqueezeStart=3]="SqueezeStart",e[e.Squeeze=4]="Squeeze",e[e.SqueezeEnd=5]="SqueezeEnd",e}({}),te=function(e){return e[e.Gaze=0]="Gaze",e[e.TrackedPointer=1]="TrackedPointer",e[e.Screen=2]="Screen",e}({}),Ee=function(){function e(a,n){this._xrManager=a,this._engine=n,this.onTrackedDeviceChanged=new Q,this._cameras=[],this._controllers=[],this._added=[],this._removed=[],this._trackedDevices=[],this._statusSnapshot=[];for(var t=this,i=t._trackedDevices,s=t._controllers,o=t._cameras,h=0;h<6;h++)switch(h){case M.Camera:case M.LeftCamera:case M.RightCamera:o.push(i[h]=new xe(h));break;case M.Controller:case M.LeftController:case M.RightController:s.push(i[h]=new Ce(h));break}this._statusSnapshot.fill(w.NotTracking,0,i.length)}var r=e.prototype;return r.getTrackedDevice=function(n){return this._trackedDevices[n]},r._onUpdate=function(){var n=this,t=n._added,i=n._removed,s=n._statusSnapshot,o=this,h=o._trackedDevices,u=o._controllers;t.length=i.length=0;for(var c=0,f=u.length;c<f;c++){var _=u[c];_.down=_.up=0}for(var l=this._xrManager.sessionManager,g=l._platformSession,d=g.events,m=0,S=d.length;m<S;m++)this._handleEvent(d[m]);g.resetEvents(),g.frame.updateInputs(h);for(var x=0,z=h.length;x<z;x++){var F=h[x];if(F){var E=F.trackingState;s[x]===w.Tracking?E!==w.Tracking&&i.push(F):E===w.Tracking&&t.push(F),s[x]=E}}(t.length>0||i.length>0)&&this.onTrackedDeviceChanged.invoke(t,i)},r._onDestroy=function(){this.onTrackedDeviceChanged.removeAll()},r._handleEvent=function(n){var t=this._trackedDevices[n.input];switch(n.targetRayMode){case te.TrackedPointer:switch(n.type){case P.SelectStart:t.down|=b.Select,t.pressedButtons|=b.Select;break;case P.SelectEnd:t.up|=b.Select,t.pressedButtons&=~b.Select;break;case P.SqueezeStart:t.down|=b.Squeeze,t.pressedButtons|=b.Squeeze;break;case P.SqueezeEnd:t.up|=b.Squeeze,t.pressedButtons&=~b.Squeeze;break}break;case te.Screen:var i=this,s=i._engine,o=s.inputManager._pointerManager._target,h=s.canvas._webCanvas,u=h.clientWidth,c=h.clientHeight,f=u*(n.x+1)*.5,_=c*(n.y+1)*.5;switch(n.type){case P.SelectStart:o.dispatchEvent(this._makeUpPointerEvent("pointerdown",n.id,f,_));break;case P.Select:o.dispatchEvent(this._makeUpPointerEvent("pointermove",n.id,f,_));break;case P.SelectEnd:o.dispatchEvent(this._makeUpPointerEvent("pointerup",n.id,f,_)),o.dispatchEvent(this._makeUpPointerEvent("pointerleave",n.id,f,_));break}break}},r._makeUpPointerEvent=function(n,t,i,s){var o={pointerId:t,clientX:i,clientY:s};switch(n){case"pointerdown":o.button=0,o.buttons=1;break;case"pointermove":o.button=-1,o.buttons=1;break;case"pointerup":o.button=0,o.buttons=0;break;case"pointerleave":o.button=0,o.buttons=0;break}return new PointerEvent(n,o)},r.addTrackedDeviceChangedListener=function(n){this.onTrackedDeviceChanged.on(n)},r.removeTrackedDeviceChangedListener=function(n){this.onTrackedDeviceChanged.off(n)},e}(),_e=function(e){return e[e.None=0]="None",e[e.AR=1]="AR",e[e.VR=2]="VR",e}({}),Pe=function(){function e(a,n){this._xrManager=a,this._engine=n,this.onStateChanged=new Q,this._mode=_e.None,this._state=k.None,this._rhi=n._hardwareRenderer,this._raf=requestAnimationFrame.bind(window),this._caf=cancelAnimationFrame.bind(window),this._onSessionExit=this._onSessionExit.bind(this)}var r=e.prototype;return r.isSupportedMode=function(n){return this._xrManager._platformDevice.isSupportedSessionMode(n)},r.run=function(){var n=this,t=n._platformSession,i=n._engine;if(!t)throw new Error("Without session to run.");t.start(),this._setState(k.Running),this._xrManager._onSessionStart(),i.isPaused||(i.pause(),i.resume())},r.stop=function(){var n=this,t=n._platformSession,i=n._engine,s=n._rhi;if(!t)throw new Error("Without session to stop.");if(this._state!==k.Running)throw new Error("Session is not running.");s._mainFrameBuffer=null,s._mainFrameWidth=s._mainFrameHeight=0,t.stop(),this._setState(k.Paused),this._xrManager._onSessionStop(),i.isPaused||(i.pause(),i.resume())},r._setState=function(n){this._state=n,this.onStateChanged.invoke(n)},r._initialize=function(n,t){var i=this;return new Promise(function(s,o){for(var h=i._xrManager,u=[],c=0,f=t.length;c<f;c++){var _=t[c],l=_._platformFeature;l&&u.push(l)}h._platformDevice.requestSession(i._rhi,n,u).then(function(g){i._mode=n,i._platformSession=g,i._setState(k.Initialized),g.setSessionExitCallBack(i._onSessionExit),g.addEventListener(),h._onSessionInit(),s()},o)})},r._onUpdate=function(){var n=this,t=n._rhi,i=n._platformSession;t._mainFrameBuffer=i.framebuffer,t._mainFrameWidth=i.framebufferWidth,t._mainFrameHeight=i.framebufferHeight},r._getRequestAnimationFrame=function(){return this._state===k.Running?this._platformSession.requestAnimationFrame:this._raf},r._getCancelAnimationFrame=function(){return this._state===k.Running?this._platformSession.cancelAnimationFrame:this._caf},r._exit=function(){var n=this,t=n._platformSession;return t?t.end():Promise.reject("Without session to stop.")},r._onSessionExit=function(){var n=this,t=n._rhi,i=n._platformSession,s=n._engine;t._mainFrameBuffer=null,t._mainFrameWidth=t._mainFrameHeight=0,i.removeEventListener(),this._platformSession=null,this._setState(k.None),this._xrManager._onSessionExit(),s.isPaused||(s.pause(),s.resume())},r._onDestroy=function(){this.onStateChanged.removeAll(),this._raf=this._caf=null},r.addStateChangedListener=function(n){this.onStateChanged.on(n)},r.removeStateChangedListener=function(n){this.onStateChanged.off(n)},A(e,[{key:"mode",get:function(){return this._mode}},{key:"state",get:function(){return this._state}},{key:"supportedFrameRate",get:function(){return this._platformSession.supportedFrameRates}},{key:"frameRate",get:function(){return this._platformSession.frameRate}}]),e}(),K=function(e){p(r,e);function r(){return e.apply(this,arguments)||this}var a=r.prototype;return a.isSupportedFeature=function(t){return this._platformDevice.isSupportedFeature(r._featureMap.get(t))},a.addFeature=function(t){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(this.sessionManager._platformSession)throw new Error("Cannot add feature when the session is initialized.");if(!this._platformDevice.isSupportedFeature(r._featureMap.get(t)))throw new Error("The feature is not supported");for(var h=this.features,u=0,c=h.length;u<c;u++)if(ee(h[u],t))throw new Error("The feature has been added");var f=R(t,[].concat([this],s));return h.push(f),f},a.getFeature=function(t){for(var i=this.features,s=0,o=i.length;s<o;s++){var h=i[s];if(ee(h,t))return h}},a.enterXR=function(t,i){var s=this;i===void 0&&(i=!0);var o=this.sessionManager;if(o._platformSession)throw new Error("Please exit XR immersive mode first.");if(!this._origin)throw new Error("Please set origin before enter XR.");return new Promise(function(h,u){o.isSupportedMode(t).then(function(){o._setState(k.Initializing),o._initialize(t,s.features).then(function(){i&&o.run(),h()},u)},u)})},a.exitXR=function(){var t=this;return new Promise(function(i,s){t.sessionManager._exit().then(function(){i()},s)})},a._initialize=function(t,i){this._features=[],this._platformDevice=i,this.sessionManager=new Pe(this,t),this.inputManager=new Ee(this,t),this.cameraManager=new Me(this)},a._update=function(){var t=this.sessionManager;if(t.state===k.Running){t._onUpdate(),this.inputManager._onUpdate(),this.cameraManager._onUpdate();for(var i=this.features,s=0,o=i.length;s<o;s++){var h=i[s];h.enabled&&h._onUpdate()}}},a._destroy=function(){var t=this;this.sessionManager._platformSession?this.exitXR().then(function(){t.sessionManager._onDestroy(),t.inputManager._onDestroy(),t.cameraManager._onDestroy()}):(this.sessionManager._onDestroy(),this.inputManager._onDestroy(),this.cameraManager._onDestroy())},a._getRequestAnimationFrame=function(){return this.sessionManager._getRequestAnimationFrame()},a._getCancelAnimationFrame=function(){return this.sessionManager._getCancelAnimationFrame()},a._getCameraIgnoreClearFlags=function(t){return this.cameraManager._getIgnoreClearFlags(t)},a._onSessionStop=function(){for(var t=this.features,i=0,s=t.length;i<s;i++){var o=t[i];o.enabled&&o._onSessionStop()}},a._onSessionInit=function(){for(var t=this.features,i=0,s=t.length;i<s;i++){var o=t[i];o.enabled&&o._onSessionInit()}},a._onSessionStart=function(){this.cameraManager._onSessionStart();for(var t=this.features,i=0,s=t.length;i<s;i++){var o=t[i];o.enabled&&o._onSessionStart()}},a._onSessionExit=function(){this.cameraManager._onSessionExit();for(var t=this.features,i=0,s=t.length;i<s;i++){var o=t[i];o.enabled&&o._onSessionExit(),o._onDestroy()}t.length=0},A(r,[{key:"features",get:function(){return this._features}},{key:"origin",get:function(){return this._origin},set:function(t){if(this.sessionManager._platformSession)throw new Error("Cannot set origin when the session is initialized.");this._origin=t}}]),r}(he);K._featureMap=new Map;function W(e){return function(r){K._featureMap.set(r,e)}}function Te(e,r){r.forEach(function(a){Object.getOwnPropertyNames(a.prototype).forEach(function(n){Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(a.prototype,n)||Object.create(null))})})}Te(he,[K]);var le=function(){function e(a,n){for(var t=arguments.length,i=new Array(t>2?t-2:0),s=2;s<t;s++)i[s-2]=arguments[s];var o;this._xrManager=a,this._type=n,this._enabled=!0,this._platformFeature=(o=a._platformDevice).createPlatformFeature.apply(o,[].concat([n],i)),this._onEnable()}var r=e.prototype;return r._onEnable=function(){},r._onDisable=function(){},r._onUpdate=function(){},r._onSessionInit=function(){},r._onSessionStart=function(){},r._onSessionStop=function(){},r._onSessionExit=function(){},r._onDestroy=function(){},A(e,[{key:"enabled",get:function(){return this._enabled},set:function(n){this.enabled!==n&&(this._enabled=n,n?this._onEnable():this._onDisable())}}]),e}(),y=function(e){return e[e.AnchorTracking=0]="AnchorTracking",e[e.ImageTracking=1]="ImageTracking",e[e.PlaneTracking=2]="PlaneTracking",e[e.HitTest=3]="HitTest",e}({}),U=function(e){return e[e.None=0]="None",e[e.Submitted=1]="Submitted",e[e.Resolved=2]="Resolved",e[e.Rejected=3]="Rejected",e[e.Destroyed=4]="Destroyed",e[e.WaitingDestroy=5]="WaitingDestroy",e}({}),T=function(e){p(r,e);function r(){var n;return n=e.apply(this,arguments)||this,n.onChanged=new Q,n._requestTrackings=[],n._tracked=[],n._added=[],n._updated=[],n._removed=[],n._statusSnapshot={},n}var a=r.prototype;return a._onUpdate=function(){var t=this._xrManager.sessionManager,i=t._platformSession,s=i.frame,o=this,h=o._platformFeature,u=o._requestTrackings,c=o._statusSnapshot,f=o._tracked,_=o._added,l=o._updated,g=o._removed;if(!(!s||!u.length)&&h.checkAvailable(i,s,u)){_.length=l.length=g.length=0,h.getTrackedResult(i,s,u,this._generateTracked);for(var d=0,m=u.length;d<m;d++){var S=u[d];switch(S.state){case U.Destroyed:for(var x=S.tracked,z=0,F=x.length;z<F;z++){var E=x[z],$=E.id;c[$]===w.Tracking&&(g.push(E),f.splice(f.indexOf(E),1)),c[$]=w.NotTracking}break;case U.Resolved:for(var Y=S.tracked,B=0,ge=Y.length;B<ge;B++){var C=Y[B],L=C.id;C.state===w.Tracking?c[L]===w.Tracking?l.push(C):(_.push(C),c[L]=w.Tracking,f.push(C)):(c[L]===w.Tracking&&(g.push(C),f.splice(f.indexOf(C),1)),c[L]=C.state)}break}}for(var N=u.length-1;N>=0;N--)u[N].state===U.Destroyed&&u.splice(N,1);(_.length>0||l.length>0||g.length>0)&&this.onChanged.invoke(_,l,g)}},a._onSessionStop=function(){this._added.length=this._updated.length=this._removed.length=0},a._onSessionExit=function(){this._requestTrackings.length=this._tracked.length=this._added.length=this._updated.length=this._removed.length=0,this.onChanged.removeAll()},a._addRequestTracking=function(t){var i=this,s=i._platformFeature;if(this._xrManager.sessionManager._platformSession&&!s.canModifyRequestTrackingAfterInit)throw new Error(y[this._type]+" request tracking cannot be modified after initialization.");this._requestTrackings.push(t),s.onAddRequestTracking(t)},a._removeRequestTracking=function(t){var i=this,s=i._platformFeature;if(this._xrManager.sessionManager._platformSession&&!s.canModifyRequestTrackingAfterInit)throw new Error(y[this._type]+" request tracking cannot be modified after initialization.");s.onDelRequestTracking(t)},a._removeAllRequestTrackings=function(){var t=this,i=t._platformFeature;if(this._xrManager.sessionManager._platformSession&&!i.canModifyRequestTrackingAfterInit)throw new Error(y[this._type]+" request tracking cannot be modified after initialization.");for(var s=this,o=s._requestTrackings,h=0,u=o.length;h<u;h++)i.onDelRequestTracking(o[h])},a.addChangedListener=function(t){this.onChanged.on(t)},a.removeChangedListener=function(t){this.onChanged.off(t)},r}(le);T._uuid=0;var J=function(){this.pose=new O,this.state=w.NotTracking},ne=function(e){return e[e.Plane=1]="Plane",e[e.All=1]="All",e}({}),Ae=function(){this.point=new v,this.normal=new v};function D(e,r,a,n){var t=arguments.length,i=t<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,a):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,a,n);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(t<3?s(i):t>3?s(r,a,i):s(r,a))||i);return t>3&&i&&Object.defineProperty(r,a,i),i}var Fe=function(e){return e[e.None=0]="None",e[e.Horizontal=1]="Horizontal",e[e.Vertical=2]="Vertical",e[e.EveryThing=3]="EveryThing",e}({}),Z=function(){this.state=U.None,this.tracked=[]},qe=function(e){p(r,e);function r(a){var n;return n=e.call(this)||this,n.detectionMode=a,n}return r}(Z),De=function(e){p(r,e);function r(){var a;return a=e.apply(this,arguments)||this,a.polygon=[],a.attributesDirty=!1,a}return r}(J),I=function(e){p(r,e);function r(n,t){t===void 0&&(t=Fe.EveryThing);var i;return i=e.call(this,n,y.PlaneTracking,t)||this,i._addRequestTracking(new qe(t)),i}var a=r.prototype;return a._generateTracked=function(){var t=new De;return t.id=T._uuid++,t},A(r,[{key:"detectionMode",get:function(){return this._requestTrackings[0].detectionMode}},{key:"trackedPlanes",get:function(){return this._tracked}}]),r}(T);I=D([W(y.PlaneTracking)],I);var re=function(e){p(r,e);function r(n){var t;return t=e.call(this,n,y.HitTest)||this,t._tempRay=new pe,t._tempPlane=new ve,t._tempVec2=new Se,t._tempVec30=new v,t._tempVec31=new v,t._tempVec32=new v,t._tempVec33=new v,t._tempVec34=new v,t._tempVec35=new v,t}var a=r.prototype;return a.hitTest=function(t,i){var s=[];return i&ne.Plane&&this._hitTestPlane(t,s),s},a.screenHitTest=function(t,i,s){var o=this,h=o._xrManager;if(h.sessionManager.mode!==_e.AR)throw new Error("Only AR mode supports using screen ray hit test.");var u=h.inputManager.getTrackedDevice(M.Camera),c=u._camera;if(!c)throw new Error("No camera available.");var f=c.screenPointToRay(this._tempVec2.set(t,i),this._tempRay);return this.hitTest(f,s)},a._hitTestPlane=function(t,i){var s=this._xrManager.getFeature(I);if(!s||!s.enabled)throw new Error("The plane estimation function needs to be turned on for plane hit test.");for(var o=this,h=o._tempPlane,u=o._tempVec30,c=o._tempVec31,f=o._tempVec32,_=s.trackedPlanes,l=0,g=_.length;l<g;l++){var d=_[l];u.set(0,1,0).transformNormal(d.pose.matrix),h.normal.copyFrom(u),h.distance=-v.dot(u,d.pose.position);var m=t.intersectPlane(h);if(m>=0&&(t.getPoint(m,c),v.transformToVec3(c,d.pose.inverseMatrix,f),this._checkPointerWithinPlane(f,d))){var S=new Ae;S.point.copyFrom(c),S.normal.copyFrom(u),S.distance=m,S.trackedObject=d,S.trackableType=ne.Plane,i.push(S)}}},a._checkPointerWithinPlane=function(t,i){for(var s=this,o=s._tempVec33,h=s._tempVec34,u=s._tempVec35,c=i.polygon,f=c.length,_=c[f-1],l=0,g=0;g<f;g++){var d=c[g];v.subtract(d,_,o),v.subtract(t,_,h),v.cross(o,h,u);var m=u.y;if(l===0)m>0?l=1:m<0&&(l=-1);else if(m>0&&l<0||m<0&&l>0)return!1;_=d}return!0},r}(le);re=D([W(y.HitTest)],re);var ze=function(e){p(r,e);function r(){return e.apply(this,arguments)||this}return r}(J),Le=function(e){p(r,e);function r(a,n){var t;return t=e.call(this)||this,t.position=a,t.rotation=n,t}return r}(Z),ae=function(e){p(r,e);function r(n){var t;return t=e.call(this,n,y.AnchorTracking)||this,t._anchors=[],t}var a=r.prototype;return a.addAnchor=function(t,i){if(!this._enabled)throw new Error("Cannot add an anchor from a disabled anchor manager.");var s=this,o=s._anchors,h=new Le(t,i),u=this._generateTracked();return h.tracked[0]=u,this._addRequestTracking(h),o.push(u),u},a.removeAnchor=function(t){if(!this._enabled)throw new Error("Cannot remove an anchor from a disabled anchor manager.");for(var i=this,s=i._requestTrackings,o=i._anchors,h=0,u=s.length;h<u;h++){var c=s[h];if(c.tracked[0]===t){this._removeRequestTracking(c);break}}o.splice(o.indexOf(t),1)},a.clearAnchors=function(){if(!this._enabled)throw new Error("Cannot remove anchors from a disabled anchor manager.");this._removeAllRequestTrackings()},a._generateTracked=function(){var t=new ze;return t.id=T._uuid++,t},A(r,[{key:"trackingAnchors",get:function(){return this._anchors}},{key:"trackedAnchors",get:function(){return this._tracked}}]),r}(T);ae=D([W(y.AnchorTracking)],ae);var Ne=function(e){p(r,e);function r(a){var n;return n=e.call(this)||this,n.image=a,n}return r}(Z),Re=function(e){p(r,e);function r(){return e.apply(this,arguments)||this}return r}(J),ie=function(e){p(r,e);function r(n,t){var i;i=e.call(this,n,y.ImageTracking,t)||this,i._trackingImages=t;var s=t?t.length:0;if(s>0)for(var o=0,h=t.length;o<h;o++)i._addRequestTracking(new Ne(t[o]));else console.warn("No image to be tracked.");return i}var a=r.prototype;return a._generateTracked=function(){var t=new Re;return t.id=T._uuid++,t},A(r,[{key:"trackingImages",get:function(){return this._trackingImages}},{key:"trackedImages",get:function(){return this._tracked}}]),r}(T);ie=D([W(y.ImageTracking)],ie);var Ue=function(r,a,n){this.name=r,this.imageSource=a,this.physicalWidth=n},oe=function(){function e(){}return e.decode=function(a,n){return new ue(function(t,i){var s=n.nextFloat32();n.nextUint8();var o=new Image;o.onload=function(){t(new Ue("",o,s))},o.src=URL.createObjectURL(new window.Blob([n.nextImagesData(1)[0]]))})},e}();oe=D([me("XRReferenceImage")],oe);function G(){return G=Object.assign||function(r){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},G.apply(this,arguments)}var se=function(e){p(r,e);function r(){return e.apply(this,arguments)||this}var a=r.prototype;return a.load=function(t,i){return new ue(function(s,o){i._request(t.url,G({},t,{type:"arraybuffer"})).then(function(h){we(h,i.engine).then(function(u){s(u)})}).catch(o)})},r}(ke);se=D([de("XRReferenceImage",[])],se);export{Ue as X,_e as a,M as b,k as c,ae as d,ie as e,I as f,Fe as g};
1
+ import{W as de,as as he,at as me,au as pe,av as ve,N as Se,K as v,a5 as ue,aw as we,X as ke,ax as q,ay as H,b as j,az as Q,aA as be,aB as ye}from"./index-d07818b5.js";function ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ce=function(){return!!e})()}function V(e,r){return V=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},V(e,r)}function R(e,r,a){return ce()?R=Reflect.construct:R=function(t,i,s){var o=[null];o.push.apply(o,i);var h=Function.bind.apply(t,o),u=new h;return s&&V(u,s.prototype),u},R.apply(null,arguments)}function X(e,r){for(var a=0;a<r.length;a++){var n=r[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function A(e,r,a){return r&&X(e.prototype,r),a&&X(e,a),e}function p(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&V(e,r)}function ee(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}var M=function(e){return e[e.Controller=0]="Controller",e[e.LeftController=1]="LeftController",e[e.RightController=2]="RightController",e[e.Camera=3]="Camera",e[e.LeftCamera=4]="LeftCamera",e[e.RightCamera=5]="RightCamera",e[e.LeftHand=6]="LeftHand",e[e.RightHand=7]="RightHand",e}({}),k=function(e){return e[e.None=0]="None",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized",e[e.Running=3]="Running",e[e.Paused=4]="Paused",e}({}),Me=function(){function e(a){this._xrManager=a}var r=e.prototype;return r.attachCamera=function(n,t){var i=this._xrManager.inputManager.getTrackedDevice(n),s=i._camera;if(s!==t){switch(s&&(s._cameraType=q.Normal),n){case M.Camera:t._cameraType=q.XRCenterCamera;break;case M.LeftCamera:t._cameraType=q.XRLeftCamera;break;case M.RightCamera:t._cameraType=q.XRRightCamera;break}i._camera=t}},r.detachCamera=function(n){var t=this._xrManager.inputManager.getTrackedDevice(n),i=t._camera;return i&&(i._cameraType=q.Normal),t._camera=null,i},r._onSessionStart=function(){},r._onUpdate=function(){for(var n=this._xrManager.inputManager._cameras,t=this._xrManager.sessionManager._platformSession,i=0,s=n.length;i<s;i++){var o=n[i],h=o._camera;if(h){var u=h.entity.transform,c=o.pose;u.position=c.position,u.rotationQuaternion=c.rotation;var f=h.viewport,_=o.viewport,l=_.x,g=_.y,d=_.width,m=_.height;l===f.x&&g===f.y&&d===f.z&&m===f.w||(h.viewport=f.set(l,g,d,m)),H.equals(h.projectionMatrix,o.projectionMatrix)||(h.projectionMatrix=o.projectionMatrix),h.renderTarget||h._adjustPixelViewport(t.framebufferWidth,t.framebufferHeight)}}},r._onSessionExit=function(){for(var n=this._xrManager.inputManager._cameras,t=0,i=n.length;t<i;t++){var s;(s=n[t]._camera)==null||s._updatePixelViewport()}},r._getIgnoreClearFlags=function(n){return n===q.XRCenterCamera?this._xrManager.sessionManager.state===k.Running?j.Color:j.None:j.None},r._onDestroy=function(){},A(e,[{key:"fixedFoveation",get:function(){var n=this._xrManager.sessionManager,t=n._platformSession;if(t)return t.getFixedFoveation();throw new Error("XR session is not available.")},set:function(n){var t=this._xrManager.sessionManager,i=t._platformSession;if(i)i.setFixedFoveation(n);else throw new Error("XR session is not available.")}}]),e}(),O=function(){this.position=new v,this.rotation=new ye,this.matrix=new H,this.inverseMatrix=new H},w=function(e){return e[e.NotTracking=0]="NotTracking",e[e.Tracking=1]="Tracking",e[e.TrackingLost=2]="TrackingLost",e}({}),fe=function(r){this.type=r,this.trackingState=w.NotTracking},xe=function(e){p(r,e);function r(){var a;return a=e.apply(this,arguments)||this,a.pose=new O,a.viewport=new be,a.projectionMatrix=new H,a}return r}(fe),b=function(e){return e[e.None=0]="None",e[e.Select=1]="Select",e[e.Trigger=1]="Trigger",e[e.Squeeze=2]="Squeeze",e[e.TouchPad=4]="TouchPad",e[e.AButton=8]="AButton",e[e.BButton=16]="BButton",e}({}),Ce=function(e){p(r,e);function r(){var n;return n=e.apply(this,arguments)||this,n.gripPose=new O,n.targetRayPose=new O,n.pressedButtons=b.None,n.down=b.None,n.up=b.None,n}var a=r.prototype;return a.isButtonDown=function(t){return(this.down&t)!==0},a.isButtonUp=function(t){return(this.up&t)!==0},a.isButtonHeldDown=function(t){return(this.pressedButtons&t)!==0},r}(fe),P=function(e){return e[e.SelectStart=0]="SelectStart",e[e.Select=1]="Select",e[e.SelectEnd=2]="SelectEnd",e[e.SqueezeStart=3]="SqueezeStart",e[e.Squeeze=4]="Squeeze",e[e.SqueezeEnd=5]="SqueezeEnd",e}({}),te=function(e){return e[e.Gaze=0]="Gaze",e[e.TrackedPointer=1]="TrackedPointer",e[e.Screen=2]="Screen",e}({}),Ee=function(){function e(a,n){this._xrManager=a,this._engine=n,this.onTrackedDeviceChanged=new Q,this._cameras=[],this._controllers=[],this._added=[],this._removed=[],this._trackedDevices=[],this._statusSnapshot=[];for(var t=this,i=t._trackedDevices,s=t._controllers,o=t._cameras,h=0;h<6;h++)switch(h){case M.Camera:case M.LeftCamera:case M.RightCamera:o.push(i[h]=new xe(h));break;case M.Controller:case M.LeftController:case M.RightController:s.push(i[h]=new Ce(h));break}this._statusSnapshot.fill(w.NotTracking,0,i.length)}var r=e.prototype;return r.getTrackedDevice=function(n){return this._trackedDevices[n]},r._onUpdate=function(){var n=this,t=n._added,i=n._removed,s=n._statusSnapshot,o=this,h=o._trackedDevices,u=o._controllers;t.length=i.length=0;for(var c=0,f=u.length;c<f;c++){var _=u[c];_.down=_.up=0}for(var l=this._xrManager.sessionManager,g=l._platformSession,d=g.events,m=0,S=d.length;m<S;m++)this._handleEvent(d[m]);g.resetEvents(),g.frame.updateInputs(h);for(var x=0,z=h.length;x<z;x++){var F=h[x];if(F){var E=F.trackingState;s[x]===w.Tracking?E!==w.Tracking&&i.push(F):E===w.Tracking&&t.push(F),s[x]=E}}(t.length>0||i.length>0)&&this.onTrackedDeviceChanged.invoke(t,i)},r._onDestroy=function(){this.onTrackedDeviceChanged.removeAll()},r._handleEvent=function(n){var t=this._trackedDevices[n.input];switch(n.targetRayMode){case te.TrackedPointer:switch(n.type){case P.SelectStart:t.down|=b.Select,t.pressedButtons|=b.Select;break;case P.SelectEnd:t.up|=b.Select,t.pressedButtons&=~b.Select;break;case P.SqueezeStart:t.down|=b.Squeeze,t.pressedButtons|=b.Squeeze;break;case P.SqueezeEnd:t.up|=b.Squeeze,t.pressedButtons&=~b.Squeeze;break}break;case te.Screen:var i=this,s=i._engine,o=s.inputManager._pointerManager._target,h=s.canvas._webCanvas,u=h.clientWidth,c=h.clientHeight,f=u*(n.x+1)*.5,_=c*(n.y+1)*.5;switch(n.type){case P.SelectStart:o.dispatchEvent(this._makeUpPointerEvent("pointerdown",n.id,f,_));break;case P.Select:o.dispatchEvent(this._makeUpPointerEvent("pointermove",n.id,f,_));break;case P.SelectEnd:o.dispatchEvent(this._makeUpPointerEvent("pointerup",n.id,f,_)),o.dispatchEvent(this._makeUpPointerEvent("pointerleave",n.id,f,_));break}break}},r._makeUpPointerEvent=function(n,t,i,s){var o={pointerId:t,clientX:i,clientY:s};switch(n){case"pointerdown":o.button=0,o.buttons=1;break;case"pointermove":o.button=-1,o.buttons=1;break;case"pointerup":o.button=0,o.buttons=0;break;case"pointerleave":o.button=0,o.buttons=0;break}return new PointerEvent(n,o)},r.addTrackedDeviceChangedListener=function(n){this.onTrackedDeviceChanged.on(n)},r.removeTrackedDeviceChangedListener=function(n){this.onTrackedDeviceChanged.off(n)},e}(),_e=function(e){return e[e.None=0]="None",e[e.AR=1]="AR",e[e.VR=2]="VR",e}({}),Pe=function(){function e(a,n){this._xrManager=a,this._engine=n,this.onStateChanged=new Q,this._mode=_e.None,this._state=k.None,this._rhi=n._hardwareRenderer,this._raf=requestAnimationFrame.bind(window),this._caf=cancelAnimationFrame.bind(window),this._onSessionExit=this._onSessionExit.bind(this)}var r=e.prototype;return r.isSupportedMode=function(n){return this._xrManager._platformDevice.isSupportedSessionMode(n)},r.run=function(){var n=this,t=n._platformSession,i=n._engine;if(!t)throw new Error("Without session to run.");t.start(),this._setState(k.Running),this._xrManager._onSessionStart(),i.isPaused||(i.pause(),i.resume())},r.stop=function(){var n=this,t=n._platformSession,i=n._engine,s=n._rhi;if(!t)throw new Error("Without session to stop.");if(this._state!==k.Running)throw new Error("Session is not running.");s._mainFrameBuffer=null,s._mainFrameWidth=s._mainFrameHeight=0,t.stop(),this._setState(k.Paused),this._xrManager._onSessionStop(),i.isPaused||(i.pause(),i.resume())},r._setState=function(n){this._state=n,this.onStateChanged.invoke(n)},r._initialize=function(n,t){var i=this;return new Promise(function(s,o){for(var h=i._xrManager,u=[],c=0,f=t.length;c<f;c++){var _=t[c],l=_._platformFeature;l&&u.push(l)}h._platformDevice.requestSession(i._rhi,n,u).then(function(g){i._mode=n,i._platformSession=g,i._setState(k.Initialized),g.setSessionExitCallBack(i._onSessionExit),g.addEventListener(),h._onSessionInit(),s()},o)})},r._onUpdate=function(){var n=this,t=n._rhi,i=n._platformSession;t._mainFrameBuffer=i.framebuffer,t._mainFrameWidth=i.framebufferWidth,t._mainFrameHeight=i.framebufferHeight},r._getRequestAnimationFrame=function(){return this._state===k.Running?this._platformSession.requestAnimationFrame:this._raf},r._getCancelAnimationFrame=function(){return this._state===k.Running?this._platformSession.cancelAnimationFrame:this._caf},r._exit=function(){var n=this,t=n._platformSession;return t?t.end():Promise.reject("Without session to stop.")},r._onSessionExit=function(){var n=this,t=n._rhi,i=n._platformSession,s=n._engine;t._mainFrameBuffer=null,t._mainFrameWidth=t._mainFrameHeight=0,i.removeEventListener(),this._platformSession=null,this._setState(k.None),this._xrManager._onSessionExit(),s.isPaused||(s.pause(),s.resume())},r._onDestroy=function(){this.onStateChanged.removeAll(),this._raf=this._caf=null},r.addStateChangedListener=function(n){this.onStateChanged.on(n)},r.removeStateChangedListener=function(n){this.onStateChanged.off(n)},A(e,[{key:"mode",get:function(){return this._mode}},{key:"state",get:function(){return this._state}},{key:"supportedFrameRate",get:function(){return this._platformSession.supportedFrameRates}},{key:"frameRate",get:function(){return this._platformSession.frameRate}}]),e}(),K=function(e){p(r,e);function r(){return e.apply(this,arguments)||this}var a=r.prototype;return a.isSupportedFeature=function(t){return this._platformDevice.isSupportedFeature(r._featureMap.get(t))},a.addFeature=function(t){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(this.sessionManager._platformSession)throw new Error("Cannot add feature when the session is initialized.");if(!this._platformDevice.isSupportedFeature(r._featureMap.get(t)))throw new Error("The feature is not supported");for(var h=this.features,u=0,c=h.length;u<c;u++)if(ee(h[u],t))throw new Error("The feature has been added");var f=R(t,[].concat([this],s));return h.push(f),f},a.getFeature=function(t){for(var i=this.features,s=0,o=i.length;s<o;s++){var h=i[s];if(ee(h,t))return h}},a.enterXR=function(t,i){var s=this;i===void 0&&(i=!0);var o=this.sessionManager;if(o._platformSession)throw new Error("Please exit XR immersive mode first.");if(!this._origin)throw new Error("Please set origin before enter XR.");return new Promise(function(h,u){o.isSupportedMode(t).then(function(){o._setState(k.Initializing),o._initialize(t,s.features).then(function(){i&&o.run(),h()},u)},u)})},a.exitXR=function(){var t=this;return new Promise(function(i,s){t.sessionManager._exit().then(function(){i()},s)})},a._initialize=function(t,i){this._features=[],this._platformDevice=i,this.sessionManager=new Pe(this,t),this.inputManager=new Ee(this,t),this.cameraManager=new Me(this)},a._update=function(){var t=this.sessionManager;if(t.state===k.Running){t._onUpdate(),this.inputManager._onUpdate(),this.cameraManager._onUpdate();for(var i=this.features,s=0,o=i.length;s<o;s++){var h=i[s];h.enabled&&h._onUpdate()}}},a._destroy=function(){var t=this;this.sessionManager._platformSession?this.exitXR().then(function(){t.sessionManager._onDestroy(),t.inputManager._onDestroy(),t.cameraManager._onDestroy()}):(this.sessionManager._onDestroy(),this.inputManager._onDestroy(),this.cameraManager._onDestroy())},a._getRequestAnimationFrame=function(){return this.sessionManager._getRequestAnimationFrame()},a._getCancelAnimationFrame=function(){return this.sessionManager._getCancelAnimationFrame()},a._getCameraIgnoreClearFlags=function(t){return this.cameraManager._getIgnoreClearFlags(t)},a._onSessionStop=function(){for(var t=this.features,i=0,s=t.length;i<s;i++){var o=t[i];o.enabled&&o._onSessionStop()}},a._onSessionInit=function(){for(var t=this.features,i=0,s=t.length;i<s;i++){var o=t[i];o.enabled&&o._onSessionInit()}},a._onSessionStart=function(){this.cameraManager._onSessionStart();for(var t=this.features,i=0,s=t.length;i<s;i++){var o=t[i];o.enabled&&o._onSessionStart()}},a._onSessionExit=function(){this.cameraManager._onSessionExit();for(var t=this.features,i=0,s=t.length;i<s;i++){var o=t[i];o.enabled&&o._onSessionExit(),o._onDestroy()}t.length=0},A(r,[{key:"features",get:function(){return this._features}},{key:"origin",get:function(){return this._origin},set:function(t){if(this.sessionManager._platformSession)throw new Error("Cannot set origin when the session is initialized.");this._origin=t}}]),r}(he);K._featureMap=new Map;function W(e){return function(r){K._featureMap.set(r,e)}}function Te(e,r){r.forEach(function(a){Object.getOwnPropertyNames(a.prototype).forEach(function(n){Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(a.prototype,n)||Object.create(null))})})}Te(he,[K]);var le=function(){function e(a,n){for(var t=arguments.length,i=new Array(t>2?t-2:0),s=2;s<t;s++)i[s-2]=arguments[s];var o;this._xrManager=a,this._type=n,this._enabled=!0,this._platformFeature=(o=a._platformDevice).createPlatformFeature.apply(o,[].concat([n],i)),this._onEnable()}var r=e.prototype;return r._onEnable=function(){},r._onDisable=function(){},r._onUpdate=function(){},r._onSessionInit=function(){},r._onSessionStart=function(){},r._onSessionStop=function(){},r._onSessionExit=function(){},r._onDestroy=function(){},A(e,[{key:"enabled",get:function(){return this._enabled},set:function(n){this.enabled!==n&&(this._enabled=n,n?this._onEnable():this._onDisable())}}]),e}(),y=function(e){return e[e.AnchorTracking=0]="AnchorTracking",e[e.ImageTracking=1]="ImageTracking",e[e.PlaneTracking=2]="PlaneTracking",e[e.HitTest=3]="HitTest",e}({}),U=function(e){return e[e.None=0]="None",e[e.Submitted=1]="Submitted",e[e.Resolved=2]="Resolved",e[e.Rejected=3]="Rejected",e[e.Destroyed=4]="Destroyed",e[e.WaitingDestroy=5]="WaitingDestroy",e}({}),T=function(e){p(r,e);function r(){var n;return n=e.apply(this,arguments)||this,n.onChanged=new Q,n._requestTrackings=[],n._tracked=[],n._added=[],n._updated=[],n._removed=[],n._statusSnapshot={},n}var a=r.prototype;return a._onUpdate=function(){var t=this._xrManager.sessionManager,i=t._platformSession,s=i.frame,o=this,h=o._platformFeature,u=o._requestTrackings,c=o._statusSnapshot,f=o._tracked,_=o._added,l=o._updated,g=o._removed;if(!(!s||!u.length)&&h.checkAvailable(i,s,u)){_.length=l.length=g.length=0,h.getTrackedResult(i,s,u,this._generateTracked);for(var d=0,m=u.length;d<m;d++){var S=u[d];switch(S.state){case U.Destroyed:for(var x=S.tracked,z=0,F=x.length;z<F;z++){var E=x[z],$=E.id;c[$]===w.Tracking&&(g.push(E),f.splice(f.indexOf(E),1)),c[$]=w.NotTracking}break;case U.Resolved:for(var Y=S.tracked,B=0,ge=Y.length;B<ge;B++){var C=Y[B],L=C.id;C.state===w.Tracking?c[L]===w.Tracking?l.push(C):(_.push(C),c[L]=w.Tracking,f.push(C)):(c[L]===w.Tracking&&(g.push(C),f.splice(f.indexOf(C),1)),c[L]=C.state)}break}}for(var N=u.length-1;N>=0;N--)u[N].state===U.Destroyed&&u.splice(N,1);(_.length>0||l.length>0||g.length>0)&&this.onChanged.invoke(_,l,g)}},a._onSessionStop=function(){this._added.length=this._updated.length=this._removed.length=0},a._onSessionExit=function(){this._requestTrackings.length=this._tracked.length=this._added.length=this._updated.length=this._removed.length=0,this.onChanged.removeAll()},a._addRequestTracking=function(t){var i=this,s=i._platformFeature;if(this._xrManager.sessionManager._platformSession&&!s.canModifyRequestTrackingAfterInit)throw new Error(y[this._type]+" request tracking cannot be modified after initialization.");this._requestTrackings.push(t),s.onAddRequestTracking(t)},a._removeRequestTracking=function(t){var i=this,s=i._platformFeature;if(this._xrManager.sessionManager._platformSession&&!s.canModifyRequestTrackingAfterInit)throw new Error(y[this._type]+" request tracking cannot be modified after initialization.");s.onDelRequestTracking(t)},a._removeAllRequestTrackings=function(){var t=this,i=t._platformFeature;if(this._xrManager.sessionManager._platformSession&&!i.canModifyRequestTrackingAfterInit)throw new Error(y[this._type]+" request tracking cannot be modified after initialization.");for(var s=this,o=s._requestTrackings,h=0,u=o.length;h<u;h++)i.onDelRequestTracking(o[h])},a.addChangedListener=function(t){this.onChanged.on(t)},a.removeChangedListener=function(t){this.onChanged.off(t)},r}(le);T._uuid=0;var J=function(){this.pose=new O,this.state=w.NotTracking},ne=function(e){return e[e.Plane=1]="Plane",e[e.All=1]="All",e}({}),Ae=function(){this.point=new v,this.normal=new v};function D(e,r,a,n){var t=arguments.length,i=t<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,a):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,a,n);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(t<3?s(i):t>3?s(r,a,i):s(r,a))||i);return t>3&&i&&Object.defineProperty(r,a,i),i}var Fe=function(e){return e[e.None=0]="None",e[e.Horizontal=1]="Horizontal",e[e.Vertical=2]="Vertical",e[e.EveryThing=3]="EveryThing",e}({}),Z=function(){this.state=U.None,this.tracked=[]},qe=function(e){p(r,e);function r(a){var n;return n=e.call(this)||this,n.detectionMode=a,n}return r}(Z),De=function(e){p(r,e);function r(){var a;return a=e.apply(this,arguments)||this,a.polygon=[],a.attributesDirty=!1,a}return r}(J),I=function(e){p(r,e);function r(n,t){t===void 0&&(t=Fe.EveryThing);var i;return i=e.call(this,n,y.PlaneTracking,t)||this,i._addRequestTracking(new qe(t)),i}var a=r.prototype;return a._generateTracked=function(){var t=new De;return t.id=T._uuid++,t},A(r,[{key:"detectionMode",get:function(){return this._requestTrackings[0].detectionMode}},{key:"trackedPlanes",get:function(){return this._tracked}}]),r}(T);I=D([W(y.PlaneTracking)],I);var re=function(e){p(r,e);function r(n){var t;return t=e.call(this,n,y.HitTest)||this,t._tempRay=new pe,t._tempPlane=new ve,t._tempVec2=new Se,t._tempVec30=new v,t._tempVec31=new v,t._tempVec32=new v,t._tempVec33=new v,t._tempVec34=new v,t._tempVec35=new v,t}var a=r.prototype;return a.hitTest=function(t,i){var s=[];return i&ne.Plane&&this._hitTestPlane(t,s),s},a.screenHitTest=function(t,i,s){var o=this,h=o._xrManager;if(h.sessionManager.mode!==_e.AR)throw new Error("Only AR mode supports using screen ray hit test.");var u=h.inputManager.getTrackedDevice(M.Camera),c=u._camera;if(!c)throw new Error("No camera available.");var f=c.screenPointToRay(this._tempVec2.set(t,i),this._tempRay);return this.hitTest(f,s)},a._hitTestPlane=function(t,i){var s=this._xrManager.getFeature(I);if(!s||!s.enabled)throw new Error("The plane estimation function needs to be turned on for plane hit test.");for(var o=this,h=o._tempPlane,u=o._tempVec30,c=o._tempVec31,f=o._tempVec32,_=s.trackedPlanes,l=0,g=_.length;l<g;l++){var d=_[l];u.set(0,1,0).transformNormal(d.pose.matrix),h.normal.copyFrom(u),h.distance=-v.dot(u,d.pose.position);var m=t.intersectPlane(h);if(m>=0&&(t.getPoint(m,c),v.transformToVec3(c,d.pose.inverseMatrix,f),this._checkPointerWithinPlane(f,d))){var S=new Ae;S.point.copyFrom(c),S.normal.copyFrom(u),S.distance=m,S.trackedObject=d,S.trackableType=ne.Plane,i.push(S)}}},a._checkPointerWithinPlane=function(t,i){for(var s=this,o=s._tempVec33,h=s._tempVec34,u=s._tempVec35,c=i.polygon,f=c.length,_=c[f-1],l=0,g=0;g<f;g++){var d=c[g];v.subtract(d,_,o),v.subtract(t,_,h),v.cross(o,h,u);var m=u.y;if(l===0)m>0?l=1:m<0&&(l=-1);else if(m>0&&l<0||m<0&&l>0)return!1;_=d}return!0},r}(le);re=D([W(y.HitTest)],re);var ze=function(e){p(r,e);function r(){return e.apply(this,arguments)||this}return r}(J),Le=function(e){p(r,e);function r(a,n){var t;return t=e.call(this)||this,t.position=a,t.rotation=n,t}return r}(Z),ae=function(e){p(r,e);function r(n){var t;return t=e.call(this,n,y.AnchorTracking)||this,t._anchors=[],t}var a=r.prototype;return a.addAnchor=function(t,i){if(!this._enabled)throw new Error("Cannot add an anchor from a disabled anchor manager.");var s=this,o=s._anchors,h=new Le(t,i),u=this._generateTracked();return h.tracked[0]=u,this._addRequestTracking(h),o.push(u),u},a.removeAnchor=function(t){if(!this._enabled)throw new Error("Cannot remove an anchor from a disabled anchor manager.");for(var i=this,s=i._requestTrackings,o=i._anchors,h=0,u=s.length;h<u;h++){var c=s[h];if(c.tracked[0]===t){this._removeRequestTracking(c);break}}o.splice(o.indexOf(t),1)},a.clearAnchors=function(){if(!this._enabled)throw new Error("Cannot remove anchors from a disabled anchor manager.");this._removeAllRequestTrackings()},a._generateTracked=function(){var t=new ze;return t.id=T._uuid++,t},A(r,[{key:"trackingAnchors",get:function(){return this._anchors}},{key:"trackedAnchors",get:function(){return this._tracked}}]),r}(T);ae=D([W(y.AnchorTracking)],ae);var Ne=function(e){p(r,e);function r(a){var n;return n=e.call(this)||this,n.image=a,n}return r}(Z),Re=function(e){p(r,e);function r(){return e.apply(this,arguments)||this}return r}(J),ie=function(e){p(r,e);function r(n,t){var i;i=e.call(this,n,y.ImageTracking,t)||this,i._trackingImages=t;var s=t?t.length:0;if(s>0)for(var o=0,h=t.length;o<h;o++)i._addRequestTracking(new Ne(t[o]));else console.warn("No image to be tracked.");return i}var a=r.prototype;return a._generateTracked=function(){var t=new Re;return t.id=T._uuid++,t},A(r,[{key:"trackingImages",get:function(){return this._trackingImages}},{key:"trackedImages",get:function(){return this._tracked}}]),r}(T);ie=D([W(y.ImageTracking)],ie);var Ue=function(r,a,n){this.name=r,this.imageSource=a,this.physicalWidth=n},oe=function(){function e(){}return e.decode=function(a,n){return new ue(function(t,i){var s=n.nextFloat32();n.nextUint8();var o=new Image;o.onload=function(){t(new Ue("",o,s))},o.src=URL.createObjectURL(new window.Blob([n.nextImagesData(1)[0]]))})},e}();oe=D([me("XRReferenceImage")],oe);function G(){return G=Object.assign||function(r){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},G.apply(this,arguments)}var se=function(e){p(r,e);function r(){return e.apply(this,arguments)||this}var a=r.prototype;return a.load=function(t,i){return new ue(function(s,o){i._request(t.url,G({},t,{type:"arraybuffer"})).then(function(h){we(h,i.engine).then(function(u){s(u)})}).catch(o)})},r}(ke);se=D([de("XRReferenceImage",[])],se);export{Ue as X,_e as a,M as b,k as c,ae as d,ie as e,I as f,Fe as g};
@@ -0,0 +1 @@
1
+ import{y as r}from"./index-d07818b5.js";import"./index-0487cdcf.js";r.createPublisher();
@@ -10,7 +10,7 @@
10
10
  #status { position: fixed; left: 8px; top: 8px; background: rgba(0,0,0,0.6); color: #fff; padding: 6px 8px; font: 12px/1.4 monospace; z-index: 10; opacity: 1; transition: opacity 0.5s ease; pointer-events: none; }
11
11
  #status[data-state="idle"] { opacity: 0; transition: opacity 0.8s ease 1.5s; }
12
12
  </style>
13
- <script type="module" crossorigin src="/_static/index-c91bca3c.js"></script>
13
+ <script type="module" crossorigin src="/_static/index-d07818b5.js"></script>
14
14
  </head>
15
15
  <body>
16
16
  <div id="app">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/cli",
3
- "version": "2.0.0-alpha.16",
3
+ "version": "2.0.0-alpha.17",
4
4
  "main": "dist/cli.bundle.cjs",
5
5
  "bin": {
6
6
  "galacean": "bin/galacean.js"
@@ -16,19 +16,7 @@
16
16
  "README.md"
17
17
  ],
18
18
  "publishConfig": {
19
- "registry": "https://registry.npmjs.org/",
20
- "main": "dist/cli.bundle.cjs",
21
- "bin": {
22
- "galacean": "bin/galacean.js"
23
- }
24
- },
25
- "scripts": {
26
- "build": "node build.mjs",
27
- "build:tsc": "tsc -p tsconfig.build.json",
28
- "prepublishOnly": "node build.mjs",
29
- "update:basis-assets": "node scripts/update-basis-assets.mjs",
30
- "test": "vitest run",
31
- "test:watch": "vitest"
19
+ "registry": "https://registry.npmjs.org/"
32
20
  },
33
21
  "dependencies": {
34
22
  "chokidar": "^4.0.3",
@@ -37,22 +25,29 @@
37
25
  "sharp": "^0.33.0"
38
26
  },
39
27
  "devDependencies": {
40
- "@editor/ai": "workspace:^",
41
- "@editor/asset-bundle-utils": "workspace:*",
42
- "@editor/builder": "workspace:*",
43
- "@editor/cli-viewport": "workspace:*",
44
- "@editor/constants": "workspace:*",
45
- "@editor/editor-api": "workspace:*",
46
- "@editor/model": "workspace:*",
47
- "@editor/storage": "workspace:*",
48
- "@editor/vfs": "workspace:*",
49
- "@galacean/tools-color-dilation": "workspace:*",
50
- "@galacean/tools-ktx2-encoder": "workspace:*",
51
28
  "@gltf-transform/core": "^4.1.0",
52
29
  "@gltf-transform/extensions": "^4.1.0",
53
30
  "@types/node": "^22.10.2",
54
- "config": "workspace:*",
55
- "tsconfig": "workspace:*",
56
- "vitest": "^3.1.0"
31
+ "vitest": "^3.1.0",
32
+ "@editor/asset-bundle-utils": "1.0.0",
33
+ "@editor/cli-viewport": "0.0.0",
34
+ "@editor/constants": "2.0.3",
35
+ "@editor/editor-api": "1.0.0",
36
+ "@editor/builder": "1.0.0",
37
+ "@editor/ai": "^1.0.0",
38
+ "@editor/model": "2.0.3",
39
+ "@editor/storage": "0.0.1",
40
+ "@galacean/tools-color-dilation": "1.5.0-alpha.0",
41
+ "config": "1.0.1",
42
+ "@editor/vfs": "1.0.0",
43
+ "@galacean/tools-ktx2-encoder": "1.5.0-alpha.0",
44
+ "tsconfig": "1.0.1"
45
+ },
46
+ "scripts": {
47
+ "build": "node build.mjs",
48
+ "build:tsc": "tsc -p tsconfig.build.json",
49
+ "update:basis-assets": "node scripts/update-basis-assets.mjs",
50
+ "test": "vitest run",
51
+ "test:watch": "vitest"
57
52
  }
58
- }
53
+ }
@@ -1 +0,0 @@
1
- import{E as s,c as S,b as i,a as d,S as h}from"./ShaderAsset-c9f375b5.js";import{S as T}from"./ShaderUIScriptAsset-259555e9.js";import"./index-c91bca3c.js";import"./index-7e3053d3.js";import"./ProxyConfigs-85431ba7.js";import"./IconPointFilled-7903ac4b.js";import"./index-3c825346.js";export{s as EShaderPropertyType,S as ShaderAsset,i as ShaderPropertyEnumType,d as ShaderPropertyRangeType,h as ShaderTemplateConfigs,T as ShaderUIScript};
@@ -1 +0,0 @@
1
- import{P as e}from"./PostProcessComponent-fc2f6f21.js";import"./index-c91bca3c.js";import"./index-7e3053d3.js";import"./Component-49fa7a68.js";import"./Menu-4b6f69f6.js";import"./Accordion-8e8abfeb.js";export{e as PostProcessComponent};
@@ -1 +0,0 @@
1
- import{C,D as s,F as l,H as c,P as S,a as d,S as J}from"./PhysicsStore-e7d36c5c.js";import"./index-c91bca3c.js";import"./index-7e3053d3.js";import"./Component-49fa7a68.js";import"./postmen-c85935a0.js";import"./FormItemArray-1eb0a655.js";import"./Accordion-8e8abfeb.js";import"./IconEdit-e6cba426.js";export{C as CharacterControllerComponent,s as DynamicColliderComponent,l as FixedJointComponent,c as HingeJointComponent,S as PhysicsStore,d as SpringJointComponent,J as StaticColliderComponent};
@@ -1 +0,0 @@
1
- import{A as a,a as n}from"./AnimatorStore-41d7a260.js";import"./index-c91bca3c.js";import"./index-7e3053d3.js";import"./Component-49fa7a68.js";import"./postmen-c85935a0.js";export{a as AnimatorComponent,n as AnimatorStore};
@@ -1 +0,0 @@
1
- import{K as E,b as w,T as I,a as R}from"./TextureAsset-be48e190.js";import{G as F,a as G}from"./GlTFAsset-f105daea.js";import{M as V,a as K}from"./MaterialAsset-1b309564.js";import{MeshAsset as X}from"./MeshAsset-4c7358f8.js";import{AnimatorControllerAsset as D}from"./AnimatorControllerAsset-2d28e356.js";import{A as j,a as q,b as z}from"./AnimationClipAsset-fc42dad4.js";import{S as H}from"./SpriteAsset-0c49dc5d.js";import{S as N}from"./SpriteAtlasAsset-6461f25f.js";import{AmbientLightAsset as W}from"./AmbientLightAsset-20ad0c84.js";import{LottieAsset as Z}from"./LottieAsset-4be66309.js";import{a as $,S as rr}from"./ShaderChunkAsset-e6717d7f.js";import{S as tr}from"./SpineSkeletonDataAsset-8ea5b7b8.js";import{FontAsset as sr}from"./FontAsset-68e03b27.js";import{SceneAsset as ar}from"./SceneAsset-7e22b810.js";import{E as mr,c as Ar,b as Sr,a as fr,S as xr}from"./ShaderAsset-c9f375b5.js";import{E as hr,a as lr,S as Tr,b as cr,t as dr}from"./ShaderUIScriptAsset-259555e9.js";import{PrimitiveMesh as Mr}from"./PrimitiveMesh-dc3ad0fa.js";import{XRReferenceImageAsset as ur}from"./XRReferenceImageAsset-b3c01eec.js";import{PrefabAsset as Pr}from"./PrefabAsset-a6b88bbd.js";import{PhysicsMaterialAsset as Er}from"./PhysicsMaterialAsset-af1ebf10.js";import{RenderTargetAsset as Ir}from"./RenderTargetAsset-fab94566.js";import{AudioAsset as kr}from"./AudioAsset-4a8dee15.js";import{StateMachineScript as Gr}from"./index-07b22cd4.js";import{MarkdownAsset as Vr}from"./MarkdownAsset-b5fb62bf.js";import"./index-c91bca3c.js";import"./enum-58295f88.js";import"./index-7e3053d3.js";import"./postmen-c85935a0.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-01dd51dc.js";import"./AssetViewer-ee5df0a5.js";import"./ktx2-encoder-486056b9.js";import"./TaskQueue-05c94a4d.js";import"./glTFIO-79bbca27.js";import"./MaterialInspector-0f1fa214.js";import"./IconPointFilled-7903ac4b.js";import"./ProxyConfigs-85431ba7.js";import"./index-3c825346.js";import"./MeshThumbnail-e9c08166.js";import"./bundlers-9b0d37fc.js";import"./assetEditorActions-c4e5962f.js";import"./module-ea41b53d.js";import"./module-a20a329a.js";import"./FormItemArray-1eb0a655.js";import"./Accordion-8e8abfeb.js";import"./IconEdit-e6cba426.js";import"./module-b106d3a2.js";export{W as AmbientLightAsset,j as AnimationClipAsset,q as AnimationClipInspector,z as AnimationClipViewer,D as AnimatorControllerAsset,kr as AudioAsset,hr as EScriptSubType,mr as EShaderPropertyType,sr as FontAsset,F as GlTFAsset,G as GlTFViewer,E as KTX2Options,Z as LottieAsset,Vr as MarkdownAsset,V as MaterialAsset,K as MaterialViewer,X as MeshAsset,Er as PhysicsMaterialAsset,Pr as PrefabAsset,Mr as PrimitiveMesh,Ir as RenderTargetAsset,ar as SceneAsset,lr as ScriptAsset,Ar as ShaderAsset,$ as ShaderChunkAsset,Sr as ShaderPropertyEnumType,fr as ShaderPropertyRangeType,xr as ShaderTemplateConfigs,Tr as ShaderUIScript,cr as ShaderUIScriptAsset,rr as SpineAtlasAsset,tr as SpineSkeletonDataAsset,H as SpriteAsset,N as SpriteAtlasAsset,Gr as StateMachineScript,w as TextureAsset,I as TextureShape,R as TextureUseType,ur as XRReferenceImageAsset,dr as scriptTemplates};
@@ -1 +0,0 @@
1
- import{A as l,a as C,b}from"./AnimationClipAsset-fc42dad4.js";import"./index-c91bca3c.js";import"./index-7e3053d3.js";import"./postmen-c85935a0.js";import"./AssetViewer-ee5df0a5.js";import"./assetEditorActions-c4e5962f.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./module-ea41b53d.js";import"./module-a20a329a.js";export{l as AnimationClipAsset,C as AnimationClipInspector,b as AnimationClipViewer};
@@ -1 +0,0 @@
1
- import{y as r}from"./index-c91bca3c.js";import"./index-7e3053d3.js";r.createPublisher();