diff --git a/public/demo/dxf_5.html b/public/demo/dxf_5.html index 7f81817..1cff2ae 100644 --- a/public/demo/dxf_5.html +++ b/public/demo/dxf_5.html @@ -78,8 +78,10 @@
@@ -197,6 +199,8 @@ const getMarkupDataBtn = document.getElementById("GetMarkupData"); const setMarkupDataBtn = document.getElementById("SetMarkupData"); + const updateMarkupDataBtn = document.getElementById("UpdateMarkupData"); + const removeMarkupDataBtn = document.getElementById("RemoveMarkupData"); const markupDataTxt = document.getElementById("MarkupData"); getMarkupDataBtn.onclick = () => { const markups = viewer.getMarkups(); @@ -212,9 +216,37 @@ }; setMarkupDataBtn.onclick = () => { try { - const val = JSON.parse(markupDataTxt.value); - console.log(val); - viewer.setMarkups(val); + const markups = JSON.parse(markupDataTxt.value); + console.log(markups); + viewer.setMarkups(markups); + } catch (ex) { + console.warn(ex); + } + }; + updateMarkupDataBtn.onclick = () => { + try { + const markups = JSON.parse(markupDataTxt.value); + console.log(markups); + // update markups one by one + for (let i = 0; i < markups.length; ++i) { + const ret = viewer.updateMarkup(markups[i]); + const str = `[Demo] ${ret ? "Updated" : "Failed to"} markup with id: ${markups[i].id}`; + console.log(str); + } + } catch (ex) { + console.warn(ex); + } + }; + removeMarkupDataBtn.onclick = () => { + try { + const markups = JSON.parse(markupDataTxt.value); + console.log(markups); + // remove markups one by one + for (let i = 0; i < markups.length; ++i) { + const ret = viewer.removeMarkup(markups[i].id); + const str = `[Demo] ${ret ? "Updated" : "Failed to"} markup with id: ${markups[i].id}`; + console.log(str); + } } catch (ex) { console.warn(ex); } diff --git a/public/demo/libs/gemini-viewer.esm.min.js b/public/demo/libs/gemini-viewer.esm.min.js index 849ce23..6d8f6da 100644 --- a/public/demo/libs/gemini-viewer.esm.min.js +++ b/public/demo/libs/gemini-viewer.esm.min.js @@ -1,10909 +1,7 @@ /** - * @pattern-x/gemini-viewer-threejs v0.2.23 build Sun Mar 05 2023 + * @pattern-x/gemini-viewer-threejs v0.2.25 build Wed Mar 22 2023 * https://pattern-x.github.io/gemini-viewer-examples/ * Copyright 2023 gemini * @license UNLICENSED */ -var nNe=Object.create;var e1=Object.defineProperty,sNe=Object.defineProperties,aNe=Object.getOwnPropertyDescriptor,oNe=Object.getOwnPropertyDescriptors,lNe=Object.getOwnPropertyNames,_7=Object.getOwnPropertySymbols,R7=Object.getPrototypeOf,M7=Object.prototype.hasOwnProperty,cNe=Object.prototype.propertyIsEnumerable,uNe=Reflect.get;var Gh=Math.pow,w7=(t,r,e)=>r in t?e1(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,Ur=(t,r)=>{for(var e in r||(r={}))M7.call(r,e)&&w7(t,e,r[e]);if(_7)for(var e of _7(r))cNe.call(r,e)&&w7(t,e,r[e]);return t},Mn=(t,r)=>sNe(t,oNe(r));var zP=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(r,e)=>(typeof require!="undefined"?require:r)[e]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var hNe=(t,r)=>()=>(t&&(r=t(t=0)),r);var V=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),z_=(t,r)=>{for(var e in r)e1(t,e,{get:r[e],enumerable:!0})},D7=(t,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of lNe(r))!M7.call(t,n)&&n!==e&&e1(t,n,{get:()=>r[n],enumerable:!(i=aNe(r,n))||i.enumerable});return t};var Un=(t,r,e)=>(e=t!=null?nNe(R7(t)):{},D7(r||!t||!t.__esModule?e1(e,"default",{value:t,enumerable:!0}):e,t)),pNe=t=>D7(e1({},"__esModule",{value:!0}),t);var C7=(t,r,e)=>uNe(R7(t),e,r);var ot=(t,r,e)=>new Promise((i,n)=>{var s=l=>{try{o(e.next(l))}catch(c){n(c)}},a=l=>{try{o(e.throw(l))}catch(c){n(c)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,a);o((e=e.apply(t,r)).next())});var P7={};z_(P7,{default:()=>TNe});function j_(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j_=function(r){return typeof r}:j_=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},j_(t)}function fNe(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function A7(t,r){for(var e=0;e{var dst=Ou();dst("Float32",function(t){return function(e,i,n){return t(this,e,i,n)}})});var yne=V(()=>{var fst=Ou();fst("Float64",function(t){return function(e,i,n){return t(this,e,i,n)}})});var Tne=V(()=>{var mst=Ou();mst("Int8",function(t){return function(e,i,n){return t(this,e,i,n)}})});var Ene=V(()=>{var gst=Ou();gst("Int16",function(t){return function(e,i,n){return t(this,e,i,n)}})});var bne=V(()=>{var vst=Ou();vst("Int32",function(t){return function(e,i,n){return t(this,e,i,n)}})});var xne=V(()=>{var yst=Ou();yst("Uint8",function(t){return function(e,i,n){return t(this,e,i,n)}})});var Ine=V(()=>{var Tst=Ou();Tst("Uint8",function(t){return function(e,i,n){return t(this,e,i,n)}},!0)});var Sne=V(()=>{var Est=Ou();Est("Uint16",function(t){return function(e,i,n){return t(this,e,i,n)}})});var _ne=V(()=>{var bst=Ou();bst("Uint32",function(t){return function(e,i,n){return t(this,e,i,n)}})});var Rne=V(()=>{"use strict";var wne=_i(),xst=ln(),Ist=ms(),Sst=wne.aTypedArray,_st=wne.exportTypedArrayMethod;_st("at",function(r){var e=Sst(this),i=xst(e),n=Ist(r),s=n>=0?n:i+n;return s<0||s>=i?void 0:e[s]})});var Dne=V(()=>{"use strict";var wst=Bt(),Mne=_i(),Rst=cN(),Mst=wst(Rst),Dst=Mne.aTypedArray,Cst=Mne.exportTypedArrayMethod;Cst("copyWithin",function(r,e){return Mst(Dst(this),r,e,arguments.length>2?arguments[2]:void 0)})});var Ane=V(()=>{"use strict";var Cne=_i(),Ast=ws().every,Ost=Cne.aTypedArray,Pst=Cne.exportTypedArrayMethod;Pst("every",function(r){return Ast(Ost(this),r,arguments.length>1?arguments[1]:void 0)})});var Pne=V(()=>{"use strict";var One=_i(),Nst=Dw(),Lst=KF(),Fst=mc(),Hst=ni(),Ust=Bt(),Bst=Rt(),kst=One.aTypedArray,Gst=One.exportTypedArrayMethod,Vst=Ust("".slice),zst=Bst(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),t!==1});Gst("fill",function(r){var e=arguments.length;kst(this);var i=Vst(Fst(this),0,3)==="Big"?Lst(r):+r;return Hst(Nst,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},zst)});var Lne=V((y7t,Nne)=>{var jst=ln();Nne.exports=function(t,r){for(var e=0,i=jst(r),n=new t(i);i>e;)n[e]=r[e++];return n}});var sb=V((T7t,Hne)=>{var Fne=_i(),Wst=Fm(),qst=Fne.aTypedArrayConstructor,Yst=Fne.getTypedArrayConstructor;Hne.exports=function(t){return qst(Wst(t,Yst(t)))}});var Bne=V((E7t,Une)=>{var Xst=Lne(),$st=sb();Une.exports=function(t,r){return Xst($st(t),r)}});var Gne=V(()=>{"use strict";var kne=_i(),Zst=ws().filter,Kst=Bne(),Jst=kne.aTypedArray,Qst=kne.exportTypedArrayMethod;Qst("filter",function(r){var e=Zst(Jst(this),r,arguments.length>1?arguments[1]:void 0);return Kst(this,e)})});var zne=V(()=>{"use strict";var Vne=_i(),eat=ws().find,tat=Vne.aTypedArray,rat=Vne.exportTypedArrayMethod;rat("find",function(r){return eat(tat(this),r,arguments.length>1?arguments[1]:void 0)})});var Wne=V(()=>{"use strict";var jne=_i(),iat=ws().findIndex,nat=jne.aTypedArray,sat=jne.exportTypedArrayMethod;sat("findIndex",function(r){return iat(nat(this),r,arguments.length>1?arguments[1]:void 0)})});var Yne=V(()=>{"use strict";var qne=_i(),aat=E1().findLast,oat=qne.aTypedArray,lat=qne.exportTypedArrayMethod;lat("findLast",function(r){return aat(oat(this),r,arguments.length>1?arguments[1]:void 0)})});var $ne=V(()=>{"use strict";var Xne=_i(),cat=E1().findLastIndex,uat=Xne.aTypedArray,hat=Xne.exportTypedArrayMethod;hat("findLastIndex",function(r){return cat(uat(this),r,arguments.length>1?arguments[1]:void 0)})});var Kne=V(()=>{"use strict";var Zne=_i(),pat=ws().forEach,dat=Zne.aTypedArray,fat=Zne.exportTypedArrayMethod;fat("forEach",function(r){pat(dat(this),r,arguments.length>1?arguments[1]:void 0)})});var Jne=V(()=>{"use strict";var mat=LR(),gat=_i().exportTypedArrayStaticMethod,vat=JF();gat("from",vat,mat)});var ese=V(()=>{"use strict";var Qne=_i(),yat=nv().includes,Tat=Qne.aTypedArray,Eat=Qne.exportTypedArrayMethod;Eat("includes",function(r){return yat(Tat(this),r,arguments.length>1?arguments[1]:void 0)})});var rse=V(()=>{"use strict";var tse=_i(),bat=nv().indexOf,xat=tse.aTypedArray,Iat=tse.exportTypedArrayMethod;Iat("indexOf",function(r){return bat(xat(this),r,arguments.length>1?arguments[1]:void 0)})});var ose=V(()=>{"use strict";var Sat=ir(),_at=Rt(),l5=Bt(),nse=_i(),c5=_1(),wat=fi(),u5=wat("iterator"),ise=Sat.Uint8Array,Rat=l5(c5.values),Mat=l5(c5.keys),Dat=l5(c5.entries),h5=nse.aTypedArray,kR=nse.exportTypedArrayMethod,zv=ise&&ise.prototype,GR=!_at(function(){zv[u5].call([1])}),sse=!!zv&&zv.values&&zv[u5]===zv.values&&zv.values.name==="values",ase=function(){return Rat(h5(this))};kR("entries",function(){return Dat(h5(this))},GR);kR("keys",function(){return Mat(h5(this))},GR);kR("values",ase,GR||!sse,{name:"values"});kR(u5,ase,GR||!sse,{name:"values"})});var cse=V(()=>{"use strict";var lse=_i(),Cat=Bt(),Aat=lse.aTypedArray,Oat=lse.exportTypedArrayMethod,Pat=Cat([].join);Oat("join",function(r){return Pat(Aat(this),r)})});var hse=V(()=>{"use strict";var use=_i(),Nat=Po(),Lat=SN(),Fat=use.aTypedArray,Hat=use.exportTypedArrayMethod;Hat("lastIndexOf",function(r){var e=arguments.length;return Nat(Lat,Fat(this),e>1?[r,arguments[1]]:[r])})});var dse=V(()=>{"use strict";var pse=_i(),Uat=ws().map,Bat=sb(),kat=pse.aTypedArray,Gat=pse.exportTypedArrayMethod;Gat("map",function(r){return Uat(kat(this),r,arguments.length>1?arguments[1]:void 0,function(e,i){return new(Bat(e))(i)})})});var mse=V(()=>{"use strict";var fse=_i(),Vat=LR(),zat=fse.aTypedArrayConstructor,jat=fse.exportTypedArrayStaticMethod;jat("of",function(){for(var r=0,e=arguments.length,i=new(zat(this))(e);e>r;)i[r]=arguments[r++];return i},Vat)});var vse=V(()=>{"use strict";var gse=_i(),Wat=w1().left,qat=gse.aTypedArray,Yat=gse.exportTypedArrayMethod;Yat("reduce",function(r){var e=arguments.length;return Wat(qat(this),r,e,e>1?arguments[1]:void 0)})});var Tse=V(()=>{"use strict";var yse=_i(),Xat=w1().right,$at=yse.aTypedArray,Zat=yse.exportTypedArrayMethod;Zat("reduceRight",function(r){var e=arguments.length;return Xat($at(this),r,e,e>1?arguments[1]:void 0)})});var bse=V(()=>{"use strict";var Ese=_i(),Kat=Ese.aTypedArray,Jat=Ese.exportTypedArrayMethod,Qat=Math.floor;Jat("reverse",function(){for(var r=this,e=Kat(r).length,i=Qat(e/2),n=0,s;n{"use strict";var Ise=ir(),Sse=ni(),f5=_i(),eot=ln(),tot=ZF(),rot=Li(),_se=Rt(),iot=Ise.RangeError,p5=Ise.Int8Array,xse=p5&&p5.prototype,wse=xse&&xse.set,not=f5.aTypedArray,sot=f5.exportTypedArrayMethod,d5=!_se(function(){var t=new Uint8ClampedArray(2);return Sse(wse,t,{length:1,0:3},1),t[1]!==3}),aot=d5&&f5.NATIVE_ARRAY_BUFFER_VIEWS&&_se(function(){var t=new p5(2);return t.set(1),t.set("2",1),t[0]!==0||t[1]!==2});sot("set",function(r){not(this);var e=tot(arguments.length>1?arguments[1]:void 0,1),i=rot(r);if(d5)return Sse(wse,this,i,e);var n=this.length,s=eot(i),a=0;if(s+e>n)throw iot("Wrong length");for(;a o&&(c.push(u),l=u);return l!==u&&c.push(u),c}function i(a,o,l,c,u){for(var h=c,p,d=o+1;d 0&&(n[l]=u,s=!0)}s&&(r.data.morphAttributes=n,r.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(r.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(r.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),r}clone(){return new this.constructor().copy(this)}copy(r){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=r.name;let i=r.index;i!==null&&this.setIndex(i.clone(e));let n=r.attributes;for(let c in n){let u=n[c];this.setAttribute(c,u.clone(e))}let s=r.morphAttributes;for(let c in s){let u=[],h=s[c];for(let p=0,d=h.length;p 0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}},vg=class extends pr{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ue,this.projectionMatrix=new Ue,this.projectionMatrixInverse=new Ue}copy(r,e){return super.copy(r,e),this.matrixWorldInverse.copy(r.matrixWorldInverse),this.projectionMatrix.copy(r.projectionMatrix),this.projectionMatrixInverse.copy(r.projectionMatrixInverse),this}getWorldDirection(r){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return r.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(r){super.updateMatrixWorld(r),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(r,e){super.updateWorldMatrix(r,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},qr=class extends vg{constructor(r=50,e=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=r,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(r,e){return super.copy(r,e),this.fov=r.fov,this.zoom=r.zoom,this.near=r.near,this.far=r.far,this.focus=r.focus,this.aspect=r.aspect,this.view=r.view===null?null:Object.assign({},r.view),this.filmGauge=r.filmGauge,this.filmOffset=r.filmOffset,this}setFocalLength(r){let e=.5*this.getFilmHeight()/r;this.fov=Qb*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let r=Math.tan(dg*.5*this.fov);return .5*this.getFilmHeight()/r}getEffectiveFOV(){return Qb*2*Math.atan(Math.tan(dg*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(r,e,i,n,s,a){this.aspect=r/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=r,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let r=this.near,e=r*Math.tan(dg*.5*this.fov)/this.zoom,i=2*e,n=this.aspect*i,s=-.5*n,a=this.view;if(this.view!==null&&this.view.enabled){let l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*n/l,e-=a.offsetY*i/c,n*=a.width/l,i*=a.height/c}let o=this.filmOffset;o!==0&&(s+=r*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+n,e,e-i,r,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(r){let e=super.toJSON(r);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},dy=-90,fy=1,bD=class extends pr{constructor(r,e,i){super(),this.type="CubeCamera",this.renderTarget=i;let n=new qr(dy,fy,r,e);n.layers=this.layers,n.up.set(0,1,0),n.lookAt(1,0,0),this.add(n);let s=new qr(dy,fy,r,e);s.layers=this.layers,s.up.set(0,1,0),s.lookAt(-1,0,0),this.add(s);let a=new qr(dy,fy,r,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(0,1,0),this.add(a);let o=new qr(dy,fy,r,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(0,-1,0),this.add(o);let l=new qr(dy,fy,r,e);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);let c=new qr(dy,fy,r,e);c.layers=this.layers,c.up.set(0,1,0),c.lookAt(0,0,-1),this.add(c)}update(r,e){this.parent===null&&this.updateMatrixWorld();let i=this.renderTarget,[n,s,a,o,l,c]=this.children,u=r.getRenderTarget(),h=r.toneMapping,p=r.xr.enabled;r.toneMapping=Lu,r.xr.enabled=!1;let d=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,r.setRenderTarget(i,0),r.render(e,n),r.setRenderTarget(i,1),r.render(e,s),r.setRenderTarget(i,2),r.render(e,a),r.setRenderTarget(i,3),r.render(e,o),r.setRenderTarget(i,4),r.render(e,l),i.texture.generateMipmaps=d,r.setRenderTarget(i,5),r.render(e,c),r.setRenderTarget(u),r.toneMapping=h,r.xr.enabled=p,i.texture.needsPMREMUpdate=!0}},yg=class extends Hi{constructor(r,e,i,n,s,a,o,l,c,u){r=r!==void 0?r:[],e=e!==void 0?e:sf,super(r,e,i,n,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(r){this.image=r}},xD=class extends kr{constructor(r=1,e={}){super(r,r,e),this.isWebGLCubeRenderTarget=!0;let i={width:r,height:r,depth:1},n=[i,i,i,i,i,i];this.texture=new yg(n,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:ai}fromEquirectangularTexture(r,e){this.texture.type=e.type,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
-
- varying vec3 vWorldDirection;
-
- vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
-
- return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
-
- }
-
- void main() {
-
- vWorldDirection = transformDirection( position, modelMatrix );
-
- #include {"use strict";var Mse=_i(),oot=sb(),lot=Rt(),cot=Od(),uot=Mse.aTypedArray,hot=Mse.exportTypedArrayMethod,pot=lot(function(){new Int8Array(1).slice()});hot("slice",function(r,e){for(var i=cot(uot(this),r,e),n=oot(this),s=0,a=i.length,o=new n(a);a>s;)o[s]=i[s++];return o},pot)});var Ase=V(()=>{"use strict";var Cse=_i(),dot=ws().some,fot=Cse.aTypedArray,mot=Cse.exportTypedArrayMethod;mot("some",function(r){return dot(fot(this),r,arguments.length>1?arguments[1]:void 0)})});var Hse=V(()=>{"use strict";var got=ir(),vot=jh(),m5=Rt(),yot=fs(),Tot=Fw(),Fse=_i(),Ose=RN(),Eot=MN(),Pse=xu(),Nse=Hw(),bot=Fse.aTypedArray,xot=Fse.exportTypedArrayMethod,ab=got.Uint16Array,jv=ab&&vot(ab.prototype.sort),Iot=!!jv&&!(m5(function(){jv(new ab(2),null)})&&m5(function(){jv(new ab(2),{})})),Lse=!!jv&&!m5(function(){if(Pse)return Pse<74;if(Ose)return Ose<67;if(Eot)return!0;if(Nse)return Nse<602;var t=new ab(516),r=Array(516),e,i;for(e=0;e<516;e++)i=e%4,t[e]=515-e,r[e]=e-2*i+3;for(jv(t,function(n,s){return(n/4|0)-(s/4|0)}),e=0;e<516;e++)if(t[e]!==r[e])return!0}),Sot=function(t){return function(r,e){return t!==void 0?+t(r,e)||0:e!==e?-1:r!==r?1:r===0&&e===0?1/r>0&&1/e<0?1:-1:r>e}};xot("sort",function(r){return r!==void 0&&yot(r),Lse?jv(this,r):Tot(bot(this),Sot(r))},!Lse||Iot)});var kse=V(()=>{"use strict";var Bse=_i(),_ot=Wa(),Use=Su(),wot=sb(),Rot=Bse.aTypedArray,Mot=Bse.exportTypedArrayMethod;Mot("subarray",function(r,e){var i=Rot(this),n=i.length,s=Use(r,n),a=wot(i);return new a(i.buffer,i.byteOffset+s*i.BYTES_PER_ELEMENT,_ot((e===void 0?n:Use(e,n))-s))})});var Wse=V(()=>{"use strict";var Dot=ir(),Cot=Po(),zse=_i(),g5=Rt(),Gse=Od(),VR=Dot.Int8Array,Vse=zse.aTypedArray,Aot=zse.exportTypedArrayMethod,jse=[].toLocaleString,Oot=!!VR&&g5(function(){jse.call(new VR(1))}),Pot=g5(function(){return[1,2].toLocaleString()!=new VR([1,2]).toLocaleString()})||!g5(function(){VR.prototype.toLocaleString.call([1,2])});Aot("toLocaleString",function(){return Cot(jse,Oot?Gse(Vse(this)):Vse(this),Gse(arguments))},Pot)});var Yse=V(()=>{"use strict";var Not=_i().exportTypedArrayMethod,Lot=Rt(),Fot=ir(),Hot=Bt(),qse=Fot.Uint8Array,Uot=qse&&qse.prototype||{},zR=[].toString,Bot=Hot([].join);Lot(function(){zR.call({})})&&(zR=function(){return Bot(this)});var kot=Uot.toString!=zR;Not("toString",zR,kot)});var Jse=V(()=>{"use strict";var Got=Ne(),v5=Bt(),Vot=mi(),Xse=String.fromCharCode,$se=v5("".charAt),Zse=v5(/./.exec),Kse=v5("".slice),zot=/^[\da-f]{2}$/i,jot=/^[\da-f]{4}$/i;Got({global:!0},{unescape:function(r){for(var e=Vot(r),i="",n=e.length,s=0,a,o;s-1;)Me!==v&&Y0.call(Me,He,1),Y0.call(v,He,1);return v}function lV(v,T){for(var R=v?T.length:0,B=R-1;R--;){var Q=T[R];if(R==B||Q!==fe){var fe=Q;Hh(Q)?Y0.call(v,Q,1):pP(v,Q)}}return v}function cP(v,T){return v+bd(te()*(T-v+1))}function uAe(v,T,R,B){for(var Q=-1,fe=I(Ah((T-v)/(R||1)),0),Se=Ye(fe);fe--;)Se[B?fe:++Q]=v,v+=R;return Se}function uP(v,T){var R="";if(!v||T<1||T>k)return R;do T%2&&(R+=v),T=bd(T/2),T&&(v+=v);while(T);return R}function $r(v,T){return RP(UV(v,T,ja),v+"")}function hAe(v){return WG(ev(v))}function pAe(v,T){var R=ev(v);return N_(R,vm(T,0,R.length))}function $E(v,T,R,B){if(!Rn(v))return v;T=Sd(T,v);for(var Q=-1,fe=T.length,Se=fe-1,Me=v;Me!=null&&++Q
>>1,Se=v[fe];Se!==null&&!Mo(Se)&&(R?Se<=T:Se
-1?Q[fe?T[Se]:Se]:t}}function _V(v){return Fh(function(T){var R=T.length,B=R,Q=cl.prototype.thru;for(v&&T.reverse();B--;){var fe=T[B];if(typeof fe!="function")throw new ka(n);if(Q&&!Se&&O_(fe)=="wrapper")var Se=new cl([],!0)}for(B=Se?B:R;++B
T){var B=v;v=T,T=B}if(R||v%1||T%1){var Q=te();return M(v+Q*(T-v+SE("1e-"+((Q+"").length-1))),T)}return cP(v,T)}var YPe=K0(function(v,T,R){return T=T.toLowerCase(),v+(R?T7(T):T)});function T7(v){return FP(Gi(v).toLowerCase())}function E7(v){return v=Gi(v),v&&v.replace(Vr,HE).replace($t,"")}function XPe(v,T,R){v=Gi(v),T=Ro(T);var B=v.length;R=R===t?B:vm(Br(R),0,B);var Q=R;return R-=T.length,R>=0&&v.slice(R,Q)==T}function $Pe(v){return v=Gi(v),v&&_t.test(v)?v.replace(Xe,F3):v}function ZPe(v){return v=Gi(v),v&&Is.test(v)?v.replace(ds,"\\$&"):v}var KPe=K0(function(v,T,R){return v+(R?"-":"")+T.toLowerCase()}),JPe=K0(function(v,T,R){return v+(R?" ":"")+T.toLowerCase()}),QPe=IV("toLowerCase");function e2e(v,T,R){v=Gi(v),T=Br(T);var B=T?Td(v):0;if(!T||B>=T)return v;var Q=(T-B)/2;return C_(bd(Q),R)+v+C_(Ah(Q),R)}function t2e(v,T,R){v=Gi(v),T=Br(T);var B=T?Td(v):0;return T&&B
2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",r),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(r){if(typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap){let e=ex("canvas");e.width=r.width,e.height=r.height;let i=e.getContext("2d");i.drawImage(r,0,0,r.width,r.height);let n=i.getImageData(0,0,r.width,r.height),s=n.data;for(let a=0;a0&&(r.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(r[c]=l[c]);return r}r.data={attributes:{}};let e=this.index;e!==null&&(r.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let i=this.attributes;for(let l in i){let c=i[l];r.data.attributes[l]=c.toJSON(r.data)}let n={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,p=c.length;h