@realsee/dnalogel 3.50.16 → 3.50.17-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +4 -4
- package/dist/index.umd.js +3 -3
- package/dist/shared-utils/tag.d.ts +1 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +1 -1
- package/libs/shared-utils/tag.js +2 -2
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ue,ee){typeof exports=="object"&&typeof module!="undefined"?ee(exports,require("three"),require("three/examples/jsm/renderers/CSS3DRenderer"),require("@realsee/five/line"),require("animejs"),require("@realsee/five"),require("hammerjs"),require("three/examples/jsm/loaders/FBXLoader"),require("earcut"),require("@realsee/five/gltf-loader")):typeof define=="function"&&define.amd?define(["exports","three","three/examples/jsm/renderers/CSS3DRenderer","@realsee/five/line","animejs","@realsee/five","hammerjs","three/examples/jsm/loaders/FBXLoader","earcut","@realsee/five/gltf-loader"],ee):(ue=typeof globalThis!="undefined"?globalThis:ue||self,ee(ue.dnalogel={},ue.THREE,ue.CSS3DRenderer,ue.Line,ue.anime,ue.FiveSDK,ue.Hammer,ue.FBXLoader,ue.earcut,ue.GLTFLoader))})(this,function(ue,ee,Ut,Hn,_s,Zt,rl,vo,pr,sl){"use strict";var y6=Object.defineProperty,b6=Object.defineProperties;var A6=Object.getOwnPropertyDescriptors;var Xd=Object.getOwnPropertySymbols;var lC=Object.prototype.hasOwnProperty,cC=Object.prototype.propertyIsEnumerable;var pv=(ue,ee,Ut)=>ee in ue?y6(ue,ee,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):ue[ee]=Ut,O=(ue,ee)=>{for(var Ut in ee||(ee={}))lC.call(ee,Ut)&&pv(ue,Ut,ee[Ut]);if(Xd)for(var Ut of Xd(ee))cC.call(ee,Ut)&&pv(ue,Ut,ee[Ut]);return ue},Pe=(ue,ee)=>b6(ue,A6(ee));var go=(ue,ee)=>{var Ut={};for(var Hn in ue)lC.call(ue,Hn)&&ee.indexOf(Hn)<0&&(Ut[Hn]=ue[Hn]);if(ue!=null&&Xd)for(var Hn of Xd(ue))ee.indexOf(Hn)<0&&cC.call(ue,Hn)&&(Ut[Hn]=ue[Hn]);return Ut};var v=(ue,ee,Ut)=>(pv(ue,typeof ee!="symbol"?ee+"":ee,Ut),Ut);var te=(ue,ee,Ut)=>new Promise((Hn,_s)=>{var Zt=pr=>{try{vo(Ut.next(pr))}catch(sl){_s(sl)}},rl=pr=>{try{vo(Ut.throw(pr))}catch(sl){_s(sl)}},vo=pr=>pr.done?Hn(pr.value):Promise.resolve(pr.value).then(Zt,rl);vo((Ut=Ut.apply(ue,ee)).next())});function dC(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const C=dC(ee);function fC(){console.debug("%c %c@realsee/dnalogel %cv3.50.16",["background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')","background-repeat: no-repeat","background-position: 0 center","padding-left: 8px"].join(";"),"","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px")}function pC(){const e=typeof OffscreenCanvas!="undefined",n=e&&new OffscreenCanvas(1,1).getContext("webgl")!==null;e&&!n&&Object.assign(window,{OffscreenCanvas:function(t,i){const r=document.createElement("canvas");return r.width=t,r.height=i,r}})}function mv(){}const gv=()=>Promise.resolve(),vv={__queue:Promise.resolve()};function mC(e=gv){vv.__queue=vv.__queue.then(e).catch(gv)}function $c(e,n,t){const i=e.x,r=e.y,s=Math.floor(i/n*1e4)/1e4,o=Math.floor(r/t*1e4)/1e4;return{x:s,y:o}}function Zd(e,n,t){const{x:i,y:r}=e,s=i*n,o=r*t;return{x:s,y:o}}function eh(e){if(e.length<2)return{};const n=e.slice(-2),t=n[0],i={x:(n[0].x+n[1].x)/2,y:(n[0].y+n[1].y)/2};return{control:t,end:i}}function gC(e,n,t=mv){new Promise(i=>{setTimeout(()=>{t(),i(!0)},n*e)})}const vC=window,yv=window.requestAnimationFrame||vC.webkitRequestAnimationFrame||(e=>setTimeout(e,16));function th(e,n=0){n<=0?yv(e):yv(()=>th(e,n-1))}var Gi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return this.None(e)},Out:function(e){return this.None(e)},InOut:function(e){return this.None(e)}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Gi.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Gi.Bounce.In(e*2)*.5:Gi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),yo=function(){return performance.now()},bv=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(t){return n._tweens[t]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,t){n===void 0&&(n=yo()),t===void 0&&(t=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var s=this._tweens[i[r]],o=!t;s&&s.update(n,o)===!1&&!t&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),Ss={Linear:function(e,n){var t=e.length-1,i=t*n,r=Math.floor(i),s=Ss.Utils.Linear;return n<0?s(e[0],e[1],i):n>1?s(e[t],e[t-1],t-i):s(e[r],e[r+1>t?t:r+1],i-r)},Bezier:function(e,n){for(var t=0,i=e.length-1,r=Math.pow,s=Ss.Utils.Bernstein,o=0;o<=i;o++)t+=r(1-n,i-o)*r(n,o)*e[o]*s(i,o);return t},CatmullRom:function(e,n){var t=e.length-1,i=t*n,r=Math.floor(i),s=Ss.Utils.CatmullRom;return e[0]===e[t]?(n<0&&(r=Math.floor(i=t*(1+n))),s(e[(r-1+t)%t],e[r],e[(r+1)%t],e[(r+2)%t],i-r)):n<0?e[0]-(s(e[0],e[0],e[1],e[1],-i)-e[0]):n>1?e[t]-(s(e[t],e[t],e[t-1],e[t-1],i-t)-e[t]):s(e[r?r-1:0],e[r],e[t<r+1?t:r+1],e[t<r+2?t:r+2],i-r)},Utils:{Linear:function(e,n,t){return(n-e)*t+e},Bernstein:function(e,n){var t=Ss.Utils.Factorial;return t(e)/t(n)/t(e-n)},Factorial:function(){var e=[1];return function(n){var t=1;if(e[n])return e[n];for(var i=n;i>1;i--)t*=i;return e[n]=t,t}}(),CatmullRom:function(e,n,t,i,r){var s=(t-e)*.5,o=(i-n)*.5,a=r*r,l=r*a;return(2*n-2*t+s+o)*l+(-3*n+3*t-2*s-o)*a+s*r+n}}},qd=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Jd=new bv,nh=function(){function e(n,t){t===void 0&&(t=Jd),this._object=n,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Gi.Linear.None,this._interpolationFunction=Ss.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=qd.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,t){if(n===void 0&&(n=yo()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var s in this._valuesEnd)r[s]=this._valuesEnd[s];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,t,i,r,s){for(var o in i){var a=n[o],l=Array.isArray(a),c=l?"array":typeof a,h=!l&&Array.isArray(i[o]);if(!(c==="undefined"||c==="function")){if(h){var u=i[o];if(u.length===0)continue;for(var d=[a],f=0,m=u.length;f<m;f+=1){var p=this._handleRelativeValue(a,u[f]);if(isNaN(p)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(p)}h&&(i[o]=d)}if((c==="object"||l)&&a&&!h){t[o]=l?[]:{};var g=a;for(var y in g)t[o][y]=g[y];r[o]=l?[]:{};var u=i[o];if(!this._isDynamic){var b={};for(var y in u)b[y]=u[y];i[o]=u=b}this._setupProperties(g,t[o],u,r[o],s)}else(typeof t[o]=="undefined"||s)&&(t[o]=a),l||(t[o]*=1),h?r[o]=i[o].slice().reverse():r[o]=t[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=yo()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=yo()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,t=this._chainedTweens.length;n<t;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n===void 0&&(n=Jd),this._group=n,this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=Gi.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=Ss.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,t){var i=this,r;if(n===void 0&&(n=yo()),t===void 0&&(t=!0),this._isPaused)return!0;var s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(n>o)return!1;t&&this.start(n,!0)}if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=n-this._startTime,l=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*l,h=function(){if(i._duration===0||a>c)return 1;var g=Math.trunc(a/l),y=a-g*l,b=Math.min(y/i._duration,1);return b===0&&a===i._duration?1:b},u=h(),d=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||a>=this._duration)if(this._repeat>0){var f=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=f);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*f,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var m=0,p=this._chainedTweens.length;m<p;m++)this._chainedTweens[m].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,t,i,r){for(var s in i)if(t[s]!==void 0){var o=t[s]||0,a=i[s],l=Array.isArray(n[s]),c=Array.isArray(a),h=!l&&c;h?n[s]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(n[s],o,a,r):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(n[s]=o+(a-o)*r))}},e.prototype._handleRelativeValue=function(n,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?n+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(n){var t=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=t},e}(),yC="23.1.1",bC=qd.nextId,ji=Jd,AC=ji.getAll.bind(ji),wC=ji.removeAll.bind(ji),xC=ji.add.bind(ji),Av=ji.remove.bind(ji),MC=ji.update.bind(ji),wv={Easing:Gi,Group:bv,Interpolation:Ss,now:yo,Sequence:qd,nextId:bC,Tween:nh,VERSION:yC,getAll:AC,removeAll:wC,add:xC,remove:Av,update:MC};function CC(e,n,t,i=Gi.Linear.None){const r=new nh(e).to(n,t).easing(i).start();function s(o){r.update(o)&&requestAnimationFrame(s)}return requestAnimationFrame(s),r}var mr=(e=>(e.Drawline="Drawline",e.Undo="Undo",e.Exit="Exit",e))(mr||{});const ol=Symbol("$$PAINT_BRUSH_EVENT$$");function ih(e){return e[ol]||(e[ol]={}),e[ol]}function PC(e){e[ol]||delete e[ol]}let EC=class{hasListener(n){const t=ih(this);return t&&t[n]&&t[n].length>0}on(n,t,i){const r=ih(this);return r[n]||(r[n]=[]),r[n].push([t,i||!1]),()=>this.off(n,t)}once(n,t){return this.on(n,t,!0)}off(n,t){if(n===void 0){PC(this);return}const i=ih(this);if(i[n]||(i[n]=[]),t===void 0){i[n].length=0;return}let r=0;for(;r<i[n].length&&i[n][r][0]!==t;r++);r<i[n].length&&i[n].splice(r,1)}emit(n,...t){let i=!1;const s=ih(this)[n]||[];for(let o of s.slice()){const[a,l=!1]=o,c=a(...t);l&&this.off(n,a),c===!1&&(i=!0)}return i}};function Hr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function wn(){return(Hr()+Hr()+"-"+Hr()+"-4"+Hr().substr(0,3)+"-"+Hr()+"-"+Hr()+Hr()+Hr()).toLowerCase()}const _C=`
|
|
1
|
+
(function(ue,ee){typeof exports=="object"&&typeof module!="undefined"?ee(exports,require("three"),require("three/examples/jsm/renderers/CSS3DRenderer"),require("@realsee/five/line"),require("animejs"),require("@realsee/five"),require("hammerjs"),require("three/examples/jsm/loaders/FBXLoader"),require("earcut"),require("@realsee/five/gltf-loader")):typeof define=="function"&&define.amd?define(["exports","three","three/examples/jsm/renderers/CSS3DRenderer","@realsee/five/line","animejs","@realsee/five","hammerjs","three/examples/jsm/loaders/FBXLoader","earcut","@realsee/five/gltf-loader"],ee):(ue=typeof globalThis!="undefined"?globalThis:ue||self,ee(ue.dnalogel={},ue.THREE,ue.CSS3DRenderer,ue.Line,ue.anime,ue.FiveSDK,ue.Hammer,ue.FBXLoader,ue.earcut,ue.GLTFLoader))})(this,function(ue,ee,Ut,Hn,_s,Zt,rl,vo,pr,sl){"use strict";var y6=Object.defineProperty,b6=Object.defineProperties;var A6=Object.getOwnPropertyDescriptors;var Xd=Object.getOwnPropertySymbols;var lC=Object.prototype.hasOwnProperty,cC=Object.prototype.propertyIsEnumerable;var pv=(ue,ee,Ut)=>ee in ue?y6(ue,ee,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):ue[ee]=Ut,O=(ue,ee)=>{for(var Ut in ee||(ee={}))lC.call(ee,Ut)&&pv(ue,Ut,ee[Ut]);if(Xd)for(var Ut of Xd(ee))cC.call(ee,Ut)&&pv(ue,Ut,ee[Ut]);return ue},Pe=(ue,ee)=>b6(ue,A6(ee));var go=(ue,ee)=>{var Ut={};for(var Hn in ue)lC.call(ue,Hn)&&ee.indexOf(Hn)<0&&(Ut[Hn]=ue[Hn]);if(ue!=null&&Xd)for(var Hn of Xd(ue))ee.indexOf(Hn)<0&&cC.call(ue,Hn)&&(Ut[Hn]=ue[Hn]);return Ut};var v=(ue,ee,Ut)=>(pv(ue,typeof ee!="symbol"?ee+"":ee,Ut),Ut);var te=(ue,ee,Ut)=>new Promise((Hn,_s)=>{var Zt=pr=>{try{vo(Ut.next(pr))}catch(sl){_s(sl)}},rl=pr=>{try{vo(Ut.throw(pr))}catch(sl){_s(sl)}},vo=pr=>pr.done?Hn(pr.value):Promise.resolve(pr.value).then(Zt,rl);vo((Ut=Ut.apply(ue,ee)).next())});function dC(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const C=dC(ee);function fC(){console.debug("%c %c@realsee/dnalogel %cv3.50.17-alpha.0",["background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')","background-repeat: no-repeat","background-position: 0 center","padding-left: 8px"].join(";"),"","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px")}function pC(){const e=typeof OffscreenCanvas!="undefined",n=e&&new OffscreenCanvas(1,1).getContext("webgl")!==null;e&&!n&&Object.assign(window,{OffscreenCanvas:function(t,i){const r=document.createElement("canvas");return r.width=t,r.height=i,r}})}function mv(){}const gv=()=>Promise.resolve(),vv={__queue:Promise.resolve()};function mC(e=gv){vv.__queue=vv.__queue.then(e).catch(gv)}function $c(e,n,t){const i=e.x,r=e.y,s=Math.floor(i/n*1e4)/1e4,o=Math.floor(r/t*1e4)/1e4;return{x:s,y:o}}function Zd(e,n,t){const{x:i,y:r}=e,s=i*n,o=r*t;return{x:s,y:o}}function eh(e){if(e.length<2)return{};const n=e.slice(-2),t=n[0],i={x:(n[0].x+n[1].x)/2,y:(n[0].y+n[1].y)/2};return{control:t,end:i}}function gC(e,n,t=mv){new Promise(i=>{setTimeout(()=>{t(),i(!0)},n*e)})}const vC=window,yv=window.requestAnimationFrame||vC.webkitRequestAnimationFrame||(e=>setTimeout(e,16));function th(e,n=0){n<=0?yv(e):yv(()=>th(e,n-1))}var Gi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return this.None(e)},Out:function(e){return this.None(e)},InOut:function(e){return this.None(e)}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Gi.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Gi.Bounce.In(e*2)*.5:Gi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),yo=function(){return performance.now()},bv=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(t){return n._tweens[t]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,t){n===void 0&&(n=yo()),t===void 0&&(t=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var s=this._tweens[i[r]],o=!t;s&&s.update(n,o)===!1&&!t&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),Ss={Linear:function(e,n){var t=e.length-1,i=t*n,r=Math.floor(i),s=Ss.Utils.Linear;return n<0?s(e[0],e[1],i):n>1?s(e[t],e[t-1],t-i):s(e[r],e[r+1>t?t:r+1],i-r)},Bezier:function(e,n){for(var t=0,i=e.length-1,r=Math.pow,s=Ss.Utils.Bernstein,o=0;o<=i;o++)t+=r(1-n,i-o)*r(n,o)*e[o]*s(i,o);return t},CatmullRom:function(e,n){var t=e.length-1,i=t*n,r=Math.floor(i),s=Ss.Utils.CatmullRom;return e[0]===e[t]?(n<0&&(r=Math.floor(i=t*(1+n))),s(e[(r-1+t)%t],e[r],e[(r+1)%t],e[(r+2)%t],i-r)):n<0?e[0]-(s(e[0],e[0],e[1],e[1],-i)-e[0]):n>1?e[t]-(s(e[t],e[t],e[t-1],e[t-1],i-t)-e[t]):s(e[r?r-1:0],e[r],e[t<r+1?t:r+1],e[t<r+2?t:r+2],i-r)},Utils:{Linear:function(e,n,t){return(n-e)*t+e},Bernstein:function(e,n){var t=Ss.Utils.Factorial;return t(e)/t(n)/t(e-n)},Factorial:function(){var e=[1];return function(n){var t=1;if(e[n])return e[n];for(var i=n;i>1;i--)t*=i;return e[n]=t,t}}(),CatmullRom:function(e,n,t,i,r){var s=(t-e)*.5,o=(i-n)*.5,a=r*r,l=r*a;return(2*n-2*t+s+o)*l+(-3*n+3*t-2*s-o)*a+s*r+n}}},qd=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Jd=new bv,nh=function(){function e(n,t){t===void 0&&(t=Jd),this._object=n,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Gi.Linear.None,this._interpolationFunction=Ss.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=qd.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,t){if(n===void 0&&(n=yo()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var s in this._valuesEnd)r[s]=this._valuesEnd[s];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,t,i,r,s){for(var o in i){var a=n[o],l=Array.isArray(a),c=l?"array":typeof a,h=!l&&Array.isArray(i[o]);if(!(c==="undefined"||c==="function")){if(h){var u=i[o];if(u.length===0)continue;for(var d=[a],f=0,m=u.length;f<m;f+=1){var p=this._handleRelativeValue(a,u[f]);if(isNaN(p)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(p)}h&&(i[o]=d)}if((c==="object"||l)&&a&&!h){t[o]=l?[]:{};var g=a;for(var y in g)t[o][y]=g[y];r[o]=l?[]:{};var u=i[o];if(!this._isDynamic){var b={};for(var y in u)b[y]=u[y];i[o]=u=b}this._setupProperties(g,t[o],u,r[o],s)}else(typeof t[o]=="undefined"||s)&&(t[o]=a),l||(t[o]*=1),h?r[o]=i[o].slice().reverse():r[o]=t[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=yo()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=yo()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,t=this._chainedTweens.length;n<t;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n===void 0&&(n=Jd),this._group=n,this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=Gi.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=Ss.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,t){var i=this,r;if(n===void 0&&(n=yo()),t===void 0&&(t=!0),this._isPaused)return!0;var s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(n>o)return!1;t&&this.start(n,!0)}if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=n-this._startTime,l=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*l,h=function(){if(i._duration===0||a>c)return 1;var g=Math.trunc(a/l),y=a-g*l,b=Math.min(y/i._duration,1);return b===0&&a===i._duration?1:b},u=h(),d=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||a>=this._duration)if(this._repeat>0){var f=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=f);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*f,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var m=0,p=this._chainedTweens.length;m<p;m++)this._chainedTweens[m].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,t,i,r){for(var s in i)if(t[s]!==void 0){var o=t[s]||0,a=i[s],l=Array.isArray(n[s]),c=Array.isArray(a),h=!l&&c;h?n[s]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(n[s],o,a,r):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(n[s]=o+(a-o)*r))}},e.prototype._handleRelativeValue=function(n,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?n+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(n){var t=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=t},e}(),yC="23.1.1",bC=qd.nextId,ji=Jd,AC=ji.getAll.bind(ji),wC=ji.removeAll.bind(ji),xC=ji.add.bind(ji),Av=ji.remove.bind(ji),MC=ji.update.bind(ji),wv={Easing:Gi,Group:bv,Interpolation:Ss,now:yo,Sequence:qd,nextId:bC,Tween:nh,VERSION:yC,getAll:AC,removeAll:wC,add:xC,remove:Av,update:MC};function CC(e,n,t,i=Gi.Linear.None){const r=new nh(e).to(n,t).easing(i).start();function s(o){r.update(o)&&requestAnimationFrame(s)}return requestAnimationFrame(s),r}var mr=(e=>(e.Drawline="Drawline",e.Undo="Undo",e.Exit="Exit",e))(mr||{});const ol=Symbol("$$PAINT_BRUSH_EVENT$$");function ih(e){return e[ol]||(e[ol]={}),e[ol]}function PC(e){e[ol]||delete e[ol]}let EC=class{hasListener(n){const t=ih(this);return t&&t[n]&&t[n].length>0}on(n,t,i){const r=ih(this);return r[n]||(r[n]=[]),r[n].push([t,i||!1]),()=>this.off(n,t)}once(n,t){return this.on(n,t,!0)}off(n,t){if(n===void 0){PC(this);return}const i=ih(this);if(i[n]||(i[n]=[]),t===void 0){i[n].length=0;return}let r=0;for(;r<i[n].length&&i[n][r][0]!==t;r++);r<i[n].length&&i[n].splice(r,1)}emit(n,...t){let i=!1;const s=ih(this)[n]||[];for(let o of s.slice()){const[a,l=!1]=o,c=a(...t);l&&this.off(n,a),c===!1&&(i=!0)}return i}};function Hr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function wn(){return(Hr()+Hr()+"-"+Hr()+"-4"+Hr().substr(0,3)+"-"+Hr()+"-"+Hr()+Hr()+Hr()).toLowerCase()}const _C=`
|
|
2
2
|
<style type="text/css">
|
|
3
3
|
|
|
4
4
|
#_gl_paintBrush {
|
|
@@ -98,7 +98,7 @@ transition: all 500ms;
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
</style>
|
|
101
|
-
`;let SC=class extends EC{constructor(t){super();v(this,"configs");v(this,"clientWidth");v(this,"clientHeight");v(this,"ready",!1);v(this,"uuid",wn());v(this,"tween");v(this,"tweening",!1);v(this,"container");v(this,"canvas");v(this,"data",{});v(this,"tempLine",{});this.configs=t,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const t=document.createElement("div");t.id="_gl_paintBrush",document.body.appendChild(t),this.container=t}return this.container.innerHTML=_C,this.container}initCanvas(t){const i=document.createElement("canvas");i.className=t,i.width=this.clientWidth,i.height=this.clientHeight;const r=i.getContext("2d");if(r)return r.lineWidth=5*this.dpr,r.lineCap="round",r.lineJoin="round",this.container.appendChild(i),i}initCtrl(){const t=document.createElement("div");t.className="_paintBrush-ctrl";const i=document.createElement("div");i.className="_paintBrush-ctrlinner";const r=document.createElement("a");r.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",r.addEventListener("click",a=>{var d;if(a.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const l=this.data[this.uuid].pop();l&&this.emitStateChange({type:mr.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(d=this.canvas[this.uuid])==null?void 0:d.getContext("2d");if(!this.canvas[this.uuid])return;const{width:h,height:u}=this.canvas[this.uuid];c&&c.clearRect(0,0,h,u),this.data[this.uuid].forEach(f=>this.handleDrawLine(this.uuid,f,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[r,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),i.appendChild(r),i.appendChild(s),t.appendChild(i),this.container.appendChild(t),t}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const t=this.canvas[this.uuid];t.getContext("2d").clearRect(0,0,t.width,t.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){this.ready&&(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(t=>{this.canvas[t].ontouchstart=()=>!1,this.canvas[t].ontouchmove=()=>!1,this.canvas[t].ontouchend=()=>!1,this.canvas[t].ontouchcancel=()=>!1;const i=this.canvas[t].getContext("2d");i&&i.clearRect(0,0,this.canvas[t].width,this.canvas[t].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:mr.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(t){const i=this.canvas[this.uuid];if(!i)return;const r=i.getContext("2d");r&&(this.configs.currentColor=t,r.strokeStyle=t)}openBrushHandle(){const t=this.canvas[this.uuid];if(!t)return;const i=t.getContext("2d");if(!i)return;const r=this.color||"#6D92FF";i.strokeStyle=r;let s=null,o=[],a,l=[],c=0;const h=(u,d,f)=>{const m=this.color||"#ff0000";i.strokeStyle=m,i.beginPath(),i.moveTo(u.x,u.y),i.quadraticCurveTo(d.x,d.y,f.x,f.y),i.stroke()};t.onmousedown=u=>{u.preventDefault(),c=Date.now();const d=u.clientX,f=u.clientY;o=[],o.push({x:d,y:f}),s={x:d,y:f},a=$c({x:d,y:f},this.clientWidth,this.clientHeight),l=[]},t.onmousemove=u=>{if(u.preventDefault(),!s)return;const d=Number(u.clientX),f=Number(u.clientY);if(Math.abs(d-s.x)<5&&Math.abs(f-s.y)<5||(o.push({x:d,y:f}),l.push($c({x:d,y:f},this.clientWidth,this.clientHeight)),o.length<3))return;const{control:m,end:p}=eh(o);!m||!p||(h(s,m,p),s=p)},t.onmouseup=u=>{if(u.preventDefault(),s=null,o.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,f={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(f),th(()=>{this.emitStateChange({type:mr.Drawline,color:this.color,ready:this.ready,state:f,uuid:this.uuid})})},t.ontouchstart=u=>{u.preventDefault(),c=Date.now();const d=u.touches[0].clientX,f=u.touches[0].clientY;o=[],o.push({x:d,y:f}),s={x:d,y:f},a=$c({x:d,y:f},this.clientWidth,this.clientHeight),l=[]},t.ontouchmove=u=>{if(u.preventDefault(),!s)return;const d=Number(u.touches[0].clientX),f=Number(u.touches[0].clientY);if(Math.abs(d-s.x)<5&&Math.abs(f-s.y)<5||(o.push({x:d,y:f}),l.push($c({x:d,y:f},this.clientWidth,this.clientHeight)),o.length<3))return;const{control:m,end:p}=eh(o);!m||!p||(h(s,m,p),s=p)},t.ontouchend=t.ontouchcancel=u=>{if(u.preventDefault(),s=null,o.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,f={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(f),th(()=>{this.emitStateChange({type:mr.Drawline,color:this.color,ready:this.ready,state:f,uuid:this.uuid})})}}emitStateChange(t,i=!0){if(t.type!==mr.Drawline){this.emit("stateChange",t,i);return}const r=Date.now(),s=t.state;if(!s||!s.line)return;const o=Math.ceil(s.line.length/100);for(let a=0;a<o;a++){const l={uuid:this.uuid,color:this.color,ready:this.ready,type:t.type,state:{uuid:this.uuid,move:s.move,duration:s.duration,color:this.color,line:s.line.slice(a*100,(a+1)*100)},timestamp:r,end:a===o-1};gC(a,20,()=>{this.emit("stateChange",l,i)})}}action(t){const{ready:i,type:r,uuid:s}=t;if(!i&&this.ready){this.closeBrush();return}if(i&&!this.ready){this.openBrush();return}if(this.ready)switch(r){case mr.Drawline:const{state:o,timestamp:a,end:l}=t;if(!a||!o)return;this.tempLine[a]=[].concat(this.tempLine[a]||[],o.line),l&&(Object.assign(o,{line:this.tempLine[a]}),this.handleDrawLine(s,o,{},()=>delete this.tempLine[a]));break;case mr.Undo:this.handleUndo(s);break}}handleDrawLine(t,i,{withUndo:r=!1},s=mv){!i||Object.prototype.toString.call(i)!="[object Object]"||Object.keys(i).length===0||mC(()=>new Promise(o=>{if(r||(this.canvas[t]||(this.canvas[t]=this.initCanvas("_paintBrush-canvas--sync")),this.data[t]||(this.data[t]=[]),this.data[t].push(i)),!this.canvas[t])return;const a=this.canvas[t].getContext("2d");if(!a)return;const{line:l=[],color:c="black",duration:h=0,uuid:u}=i,d=Zd(i.move||{},this.clientWidth,this.clientHeight);let f=[d];if(a.strokeStyle=c,a.beginPath(),a.moveTo(d.x,d.y),h&&!r){let m=[];const p=this;p.tween=CC({step:0},{step:l.length-1},h).onUpdate(({step:g})=>{var b;if(p.tweening=!0,!p.ready)return a.clearRect(0,0,p.canvas[u].width,p.canvas[u].height),(b=p.tween)==null?void 0:b.stop();const y=Math.floor(g);if(!m.find(A=>A===y)){if(m.push(y),f.push(Zd(l[y],p.clientWidth,p.clientHeight)),f.length<3)return;const{control:A,end:w}=eh(f);if(!A||!w)return;a.quadraticCurveTo(A.x,A.y,w.x,w.y),a.stroke()}}).onComplete(g=>{p.tween=void 0,p.tweening=!1,m=[],f=[],s&&s(),o()})}else{for(let m=0;m<l.length;m++){if(f.push(Zd(l[m],this.clientWidth,this.clientHeight)),f.length<3)continue;const{control:p,end:g}=eh(f);!p||!g||a.quadraticCurveTo(p.x,p.y,g.x,g.y)}a.stroke(),f=[],s&&s(),o()}}))}handleUndo(t){if(!this.canvas[t]||!this.data[t]||this.data[t].length===0)return;this.data[t].pop();const i=()=>{var s;const r=(s=this.canvas[t])==null?void 0:s.getContext("2d");r&&r.clearRect(0,0,this.canvas[t].width,this.canvas[t].height),this.data[t].forEach(o=>this.handleDrawLine(t,o,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),th(i,60);return}i()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}};class IC{constructor(n={}){v(this,"controller");const t=Object.assign({currentColor:"#f44336",onUndoText:"回退",onExitText:"关闭"},n);this.controller=new SC(t)}on(n,t){this.controller.on(n,t)}off(n,t){this.controller.off(n,t)}once(n,t){this.controller.once(n,t)}show(){this.controller.openBrush()}action(n){this.controller.action(n)}get state(){return this.controller.state}get configs(){return this.controller.configs}dispose(){return this.controller.destroyBrush()}setCurrentColor(n){this.controller.updateCurrentColor(n)}}const TC=(e,n)=>{var k,R;let t=(R=(k=n==null?void 0:n.initialState)==null?void 0:k.enabled)!=null?R:!0,i=!1,r=!0,s=null;const a=O(O({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),n==null?void 0:n.config),l=new C.Scene,c=new Zt.Camera(60);let h=new C.Object3D,u,d;{const G=new C.DirectionalLight(16777215,.5);G.position.copy(new C.Vector3(1,1,1)),l.add(G)}{const G=new C.DirectionalLight(16777215,.3);l.add(G)}{const G=new C.AmbientLight(16777215,.3);l.add(G)}l.add(h);const f=()=>{if(i)return;u=x(e.model,c.fov,c.aspect),d=e.model.bounding.getCenter(new C.Vector3),l.remove(h),h=I(e.model),l.add(h),i=!0,E();function G(U){const J=U.clone();return J.uniforms.modelAlpha.value=1,J.uniforms.map.value&&(J.uniforms.map.value.needsUpdate=!0),J}function I(U){if(U instanceof C.Mesh){const J=U.geometry,K=Array.isArray(U.material)?U.material.map(G):G(U.material);return new C.Mesh(J,K)}else if(U instanceof C.Group){const J=new C.Group;return U.children.forEach(K=>J.add(I(K))),J}else{const J=new C.Object3D;return U.children.forEach(K=>J.add(I(K))),J}}},m=()=>{if(e.renderer)return s||(s=new C.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(e.renderer.getPixelRatio()),s.outputEncoding=C.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},p=()=>{h.traverse(G=>{G instanceof C.Mesh&&[].concat(G.material).forEach(U=>U.dispose())}),l.remove(h),h=new C.Object3D,l.add(h),i=!1,E()},g=()=>{t&&(i||f())},y=()=>{t||(t=!0,l.add(h),!i&&e.model.loaded&&f(),E())},b=()=>{t&&(l.remove(h),r=!0,S(),t=!1)},A=(G,I={})=>{const U=m();if(!U)return;G.appendChild(U.domElement),w(I);const J=window.getComputedStyle(G).position;J!=="relative"&&J!=="absolute"&&J!=="fixed"&&J!=="sticky"&&(G.style.position="relative")},w=(G={})=>{if(!s)return;const U=s.domElement.parentNode;if(U!=null&&U.nodeName){const{width:J=U.offsetWidth,height:K=U.offsetHeight}=G;s.setSize(J,K),c.aspect=J/K,c.updateProjectionMatrix()}E()};function x(G,I,U){const J=G.bounding,K=Math.pow(Math.pow(J.max.x-J.min.x+1,2)+Math.pow(J.max.y-J.min.y+1,2)+Math.pow(J.max.z-J.min.z+1,2),1/2);let ne=K/2/Math.tan(Math.PI*I/360);return U<1&&(ne=ne/U),isNaN(ne)?K:ne}function M(G){return e.work.observers[G].standingPosition.clone()}const E=()=>{if(!t||!u||!d)return;const G=e.getPose();G.fov=c.fov,G.offset=d,G.distance=u,typeof a.lockedLatitude=="number"&&(G.latitude=a.lockedLatitude),typeof a.lockedLongitude=="number"&&(G.longitude=a.lockedLongitude),typeof a.lockedPanoIndex=="number"&&(G.offset=M(a.lockedPanoIndex)),a.lookAtCurrentCamera&&(G.offset=e.camera.position.clone().setY(e.camera.position.y+1)),c.setFromPose(G),r=!0},S=()=>{!t||r!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),r=!1)},T=()=>{s&&s.dispose(),s=null},z=G=>{Object.assign(a,G),E()},D=()=>({enabled:t});return Object.assign(window,{camera:c}),e.on("modelLoaded",g),e.on("modelWillLoad",p),e.on("cameraDirectionUpdate",E),e.on("dispose",T),e.on("renderFrame",S),e.on("cameraPositionUpdate",E),{appendTo:A,refresh:w,changeConfigs:z,enable:y,disable:b,getCurrentState:D}},DC=({x:e,y:n,z:t})=>new ee.Vector3(e,n,t),Ur=e=>new ee.Vector3().fromArray(e),zt=e=>{if(e)return e instanceof ee.Vector3?e:Array.isArray(e)?Ur(e):DC(e)};function LC(e){if(e)return Array.isArray(e)?typeof e[0]=="number"?zt(e):e.map(zt):zt(e)}let kC=function(){let e=this,n,t,i,r,s=new ee.Matrix4,o={camera:{fov:0,style:""},objects:new WeakMap},a=document.createElement("div");a.style.overflow="hidden",this.domElement=a;let l=document.createElement("div");l.style.WebkitTransformStyle="preserve-3d",l.style.transformStyle="preserve-3d",l.style.pointerEvents="none",a.appendChild(l),this.getSize=function(){return{width:n,height:t}},this.setSize=function(m,p){n=m,t=p,i=n/2,r=t/2,a.style.width=m+"px",a.style.height=p+"px",l.style.width=m+"px",l.style.height=p+"px"};function c(m){return Math.abs(m)<1e-10?0:m}function h(m){let p=m.elements;return"matrix3d("+c(p[0])+","+c(-p[1])+","+c(p[2])+","+c(p[3])+","+c(p[4])+","+c(-p[5])+","+c(p[6])+","+c(p[7])+","+c(p[8])+","+c(-p[9])+","+c(p[10])+","+c(p[11])+","+c(p[12])+","+c(-p[13])+","+c(p[14])+","+c(p[15])+")"}function u(m,p){let g=m.elements;return"translate(-50%,-50%)"+("matrix3d("+c(g[0])+","+c(g[1])+","+c(g[2])+","+c(g[3])+","+c(-g[4])+","+c(-g[5])+","+c(-g[6])+","+c(-g[7])+","+c(g[8])+","+c(g[9])+","+c(g[10])+","+c(g[11])+","+c(g[12])+","+c(g[13])+","+c(g[14])+","+c(g[15])+")")}function d(m){m.isCSS3DObject&&(m.element.style.display="none");for(let p=0,g=m.children.length;p<g;p++)d(m.children[p])}function f(m,p,g,y){if(m.visible===!1){d(m);return}if(m.isCSS3DObject){const b=m.layers.test(g.layers)===!0,A=m.element;if(A.style.display=b===!0?"":"none",b){m.onBeforeRender(e,p,g);let w;m.isCSS3DSprite?(s.copy(g.matrixWorldInverse),s.transpose(),s.copyPosition(m.matrixWorld),s.scale(m.scale),s.elements[3]=0,s.elements[7]=0,s.elements[11]=0,s.elements[15]=1,w=u(s)):w=u(m.matrixWorld);let x=o.objects.get(m);if(x===void 0||x.style!==w){A.style.WebkitTransform=w,A.style.transform=w;let M={style:w};o.objects.set(m,M)}A.style.display=m.visible?"":"none",A.parentNode!==l&&l.appendChild(A),m.onAfterRender(e,p,g)}}for(let b=0,A=m.children.length;b<A;b++)f(m.children[b],p,g)}this.render=function(m,p){let g=p.projectionMatrix.elements[5]*r;if(o.camera.fov!==g&&(p.isPerspectiveCamera?(a.style.WebkitPerspective=g+"px",a.style.perspective=g+"px"):(a.style.WebkitPerspective="",a.style.perspective=""),o.camera.fov=g),m.autoUpdate===!0&&m.updateMatrixWorld(),p.parent===null&&p.updateMatrixWorld(),p.isOrthographicCamera)var y=-(p.right+p.left)/2,b=(p.top+p.bottom)/2;let w=(p.isOrthographicCamera?"scale("+g+")translate("+c(y)+"px,"+c(b)+"px)"+h(p.matrixWorldInverse):"translateZ("+g+"px)"+h(p.matrixWorldInverse))+"translate("+i+"px,"+r+"px)";o.camera.style!==w&&(l.style.WebkitTransform=w,l.style.transform=w,o.camera.style=w),f(m,m,p)}};function rh(e,n){const t=Math.round(e);return t%2===0?t:t+(n!=null&&n.floor?-1:1)}function OC(e,n,t=!0){if(!e)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const i=()=>{const s=rh(e.clientWidth,{floor:!0}),o=rh(e.clientHeight,{floor:!0});n(s,o)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>i(),unobserve:()=>{}};const r=new ResizeObserver(i);return t&&i(),{observe:()=>r.observe(e),unobserve:()=>r.unobserve(e)}}const RC=kC;class Kd extends RC{constructor(){super();v(this,"wrapper");v(this,"domElementWrapper",document.createElement("div"));v(this,"requestAnimationFrameId");v(this,"resizeDisoper");this.domElementWrapper.classList.add("ICSS3DRendererWrapper"),this.domElementWrapper.style.position="absolute",this.domElementWrapper.style.top="0",this.domElementWrapper.style.left="0",this.domElementWrapper.style.width="100%",this.domElementWrapper.style.height="100%",this.domElementWrapper.style.userSelect="none",this.domElementWrapper.style.pointerEvents="none",this.domElement.classList.add("ICSS3DRenderer"),this.domElement.style.position="absolute",this.domElement.style.top="0",this.domElement.style.left="0",this.domElement.style.userSelect="none",this.domElement.style.pointerEvents="none",this.domElementWrapper.appendChild(this.domElement)}setWrapper(t){if(!t)throw new Error("CSS3DRenderer: wrapper is required");if((()=>{for(let s=0;s<t.children.length;s++)if(t.children.item(s)===this.domElementWrapper)return!0;return!1})())return;const r=this.wrapper;return r&&r.contains(this.domElementWrapper)&&this.domElementWrapper.remove(),this.appendToElement(t),this.wrapper=t,this}appendToElement(t){t.appendChild(this.domElementWrapper);const i=(o,a)=>this.setSize(o,a),{observe:r,unobserve:s}=OC(this.domElementWrapper,i,!0);r(),this.resizeDisoper=s,this.wrapper=t}renderEveryFrame(t,i){if(this.wrapper||console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)",this,t),this.requestAnimationFrameId)return;const r=()=>{this.requestAnimationFrameId=requestAnimationFrame(r),t.visible&&this.render(t,i)};r()}stopRender(){this.requestAnimationFrameId&&cancelAnimationFrame(this.requestAnimationFrameId)}dispose(){var t;this.stopRender(),(t=this.resizeDisoper)==null||t.call(this),this.domElementWrapper.remove()}}function zC(e){return typeof Symbol=="undefined"?`$Symbol<${e}>$`:Symbol(e)}const al=zC("$$EVENT$$");function sh(e){return e[al]||(e[al]={}),e[al]}function BC(e){e[al]&&delete e[al]}class Pn{hasListener(n){const t=sh(this);return!!(t!=null&&t[n]&&t[n].length>0)}on(n,t,i){const r=sh(this);return r[n]||(r[n]=[]),r[n].push([t,i||!1]),()=>this.off(n,t)}once(n,t){return this.on(n,t,!0)}off(n,t){if(n===void 0){BC(this);return}const i=sh(this);if(i[n]||(i[n]=[]),t===void 0){i[n].length=0;return}let r=0;for(;r<i[n].length&&i[n][r][0]!==t;r++);r<i[n].length&&i[n].splice(r,1)}emit(n,...t){let i=!1;const s=sh(this)[n]||[];for(let o of s.slice()){const[a,l=!1]=o,c=a(...t);l&&this.off(n,a),c===!1&&(i=!0)}return i}}class NC extends C.Mesh{constructor(t,i){const r=new C.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:C.DoubleSide}),s=new C.PlaneGeometry(t,i);super(s,r);v(this,"name","opacity-mesh")}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}function Hi(...e){const n=new ee.Vector3;return e.forEach(t=>n.add(t)),n.divideScalar(e.length),n}const $d=e=>e?e.visible===!1?!1:$d(e.parent):!0;class ef{constructor(n=0,t=0){v(this,"min");v(this,"max");v(this,"isInterval",!0);this.min=n,this.max=t}fromArray(n){return this.min=n[0],this.max=n[1],this}isOverlap(n){return Math.min(this.max,n.max)<Math.max(this.min,n.min)}contains(n){return this.min<n.min&&this.max>n.max}}let FC=class{constructor(n,t){v(this,"min");v(this,"max");v(this,"xInterval");v(this,"yInterval");v(this,"isRectangle",!0);this.min=n,this.max=t,this.xInterval=new ef(this.min.x,this.max.x),this.yInterval=new ef(this.min.y,this.max.y)}isOverlapWithRectangle(n){return!this.xInterval.isOverlap(n.xInterval)&&!this.yInterval.isOverlap(n.yInterval)}containsRect(n){return this.xInterval.contains(n.xInterval)&&this.yInterval.contains(n.yInterval)}};function VC(e){e.sort(function(i,r){return i.x!=r.x?i.x-r.x:i.y-r.y});const n=e.length,t=[];for(let i=0;i<2*n;i++){const r=i<n?i:2*n-1-i;for(;t.length>=2&&GC(t[t.length-2],t[t.length-1],e[r]);)t.pop();t.push(e[r])}return t.pop(),t}function GC(e,n,t){const i=(e.x-n.x)*(t.y-n.y)-(e.y-n.y)*(t.x-n.x),r=(e.x-n.x)*(t.x-n.x)+(e.y-n.y)*(t.y-n.y);return i<0||i==0&&r<=0}function xv(e,n){const t=e[0],i=e[1];let r=!1;for(let s=0,o=n.length-1;s<n.length;o=s++){const a=n[s][0],l=n[s][1],c=n[o][0],h=n[o][1];l>i!=h>i&&t<(c-a)*(i-l)/(h-l)+a&&(r=!r)}return r}function tf(e,n,t){const{x:i,y:r,z:s}=n.clone().project(e);return s>1?void 0:{leftPx:(i+1)/2*t.x,topPx:(-r+1)/2*t.y}}function Mi(e){var t;return((t=e.models)==null?void 0:t.filter(i=>i.name===e.state.workCode)[0])||e.model}class Mv extends Pn{constructor(t){super();v(this,"five");this.five=t}}const ll=(e,n)=>{if(!n)return e;const t=new C.Vector3,i=new C.Quaternion,r=new C.Vector3;return n.decompose(t,i,r),e.clone().multiply(r).applyQuaternion(i).add(t)},nf=new Map;class jC extends Mv{constructor(t){super(t);v(this,"_workCode")}get fromType(){var r,s;const t=this.workCode;if(nf.has(t))return nf.get(t);const i=(s=(r=JSON.parse(this.work.raw.works[0]))==null?void 0:r.from_type)!=null?s:"vr";return nf.set(t,i),i}set workCode(t){this._workCode=t}get workCode(){var t;return(t=this._workCode)!=null?t:this.five.state.workCode}get work(){var t,i;return(i=(t=this.five.works)==null?void 0:t.find(r=>r.workCode===this.workCode))!=null?i:this.five.work}get observers(){var t;return(t=this.work)==null?void 0:t.observers}get transform(){var i,r,s,o;const t=(o=(i=this.work)==null?void 0:i.transform)!=null?o:(s=(r=this.work)==null?void 0:r.options)==null?void 0:s.transform;return t?t.clone():new C.Matrix4}getObserverPosition(t){var r;const i=(r=this.getObserver(t))==null?void 0:r.position;if(i)return ll(i,this.transform)}getObserverStandingPosition(t){var r;const i=(r=this.getObserver(t))==null?void 0:r.standingPosition;if(i)return ll(i,this.transform)}getObserver(t){var i;return(i=this.observers)==null?void 0:i[t]}}class oh extends Mv{constructor(t){super(t);v(this,"workUtil",new jC(this.five))}get version(){return this.five.constructor.version}get majorVersion(){return Number(this.version.split(".")[0])}get model(){return Mi(this.five)}moveToPano(t,i){const r=this.majorVersion===5?t:{workCode:this.workUtil.workCode,panoIndex:t};return this.five.moveToPano(r,i)}}const Wr=new C.Raycaster;Wr.params.Points.threshold=.02;function ah(e,n){if(!n||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",e),unobserve:()=>window.removeEventListener("resize",e)};{const t=new ResizeObserver(e);return{observe:()=>t.observe(n),unobserve:()=>t.unobserve(n)}}}const HC=new C.Vector2;class Qr{constructor(n,t,i){v(this,"container");v(this,"visible",!1);v(this,"enabled",!1);v(this,"wrapper");v(this,"positionsForRotate");v(this,"intersectCheck",!0);v(this,"simulate3D",!1);v(this,"tagWrapper");v(this,"five");v(this,"originPosition");v(this,"transformedPosition");v(this,"disposer");v(this,"config");v(this,"fiveUtil");v(this,"disposers",[]);v(this,"onCameraUpdate",()=>{this.visible!==!1&&this.updateScreenPosition()});v(this,"onFiveEveryReady",()=>{var n;if(this.intersectCheck&&this.visible&&this.five.state.mode!=="Panorama"){let t=!1,i=.01;this.fiveUtil.workUtil.fromType==="poincare"&&(i=.05);const r=this.transformedPosition.clone().sub(this.five.camera.position).normalize();Wr.set(this.five.camera.position,r);const s=(n=Mi(this.five).intersectRaycaster(Wr))==null?void 0:n[0];s?t=(s==null?void 0:s.distance)+i>this.transformedPosition.distanceTo(this.five.camera.position):t=!0,t?(this.container.style.opacity="1",this.container.style.pointerEvents="auto"):(this.container.style.opacity="0",this.container.style.pointerEvents="none")}});var r,s,o;this.five=n,this.fiveUtil=(r=n.__fiveUtil__)!=null?r:n.__fiveUtil__=new oh(n),this.originPosition=t?zt(t).clone():void 0,this.transformedPosition=(s=this.originPosition)==null?void 0:s.clone(),this.positionsForRotate=(o=i==null?void 0:i.positionsForRotate)==null?void 0:o.map(a=>zt(a).clone()),this.config=i!=null?i:{},this.container=(()=>{const a=document.createElement("div");return a.classList.add("light-tag"),a.style.width="0",a.style.height="0",a.style.position="absolute",a.style.transition="opacity 0.2s linear",a})(),this.enable(),this.show(),this.addResizeListener()}show(){this.visible=!0,this.container.style.opacity="1",this.container.style.pointerEvents="auto",this.onCameraUpdate()}hide(){this.visible=!1,this.container.style.opacity="0",this.container.style.pointerEvents="none"}enable(){var r,s,o,a,l;if(this.enabled)return;this.enabled=!0,this.wrapper=(o=(s=this.config.wrapper)!=null?s:(r=this.five.getElement())==null?void 0:r.parentElement)!=null?o:document.body;const n=`light-tag-wrapper-${(l=(a=this.config)==null?void 0:a.namespace)!=null?l:"default"}`;if(!this.tagWrapper){let c=Array.from(this.wrapper.children).find(h=>h.id===n);if(!c){const h=document.createElement("div");c=h,h.id=n,h.style.position="absolute",h.style.overflow="hidden",h.style.top="0",h.style.left="0",h.style.width="100%",h.style.height="100%",h.style.pointerEvents="none",h.style.zIndex="1",this.wrapper.appendChild(c)}this.tagWrapper=c}this.tagWrapper.appendChild(this.container);let t=!1;const i=()=>{t||(t=!0,this.five.ready().then(()=>{this.onFiveEveryReady(),t=!1}))};this.five.on("cameraUpdate",i),this.five.on("cameraUpdate",this.onCameraUpdate),this.disposer=()=>{this.five.off("cameraUpdate",i),this.five.off("cameraUpdate",this.onCameraUpdate)}}disable(){var n;this.enabled&&(this.enabled=!1,this.tagWrapper.removeChild(this.container),(n=this.disposer)==null||n.call(this))}destroy(){this.disable(),this.container.remove(),this.disposers.forEach(n=>n())}setTransformMatrix(n){var t;this.transformedPosition=(t=this.originPosition)==null?void 0:t.clone().applyMatrix4(n),this.onCameraUpdate()}setPosition(n,t){this.transformedPosition=zt(n).clone(),this.positionsForRotate=t==null?void 0:t.map(i=>zt(i).clone()),this.onCameraUpdate(),setTimeout(()=>this.onCameraUpdate(),0)}updateScreenPosition(){if(!this.transformedPosition){this.container.style.left="-100%",this.container.style.top="-100%";return}const n=this.five.renderer.getSize(HC),t=tf(this.five.camera,this.transformedPosition,n);if(!t){this.container.style.left="-100%",this.container.style.top="-100%";return}const i=(()=>{if(!this.simulate3D)return 1;const s=2*Math.tan(.5*this.five.camera.fov/180*Math.PI),o=this.transformedPosition.distanceTo(this.five.camera.position);return Math.max(Math.min(1-s*o/40,1),.5)})(),r=(()=>{if(this.positionsForRotate===void 0||this.positionsForRotate.length!==2)return 0;const[s,o]=this.positionsForRotate,a=tf(this.five.camera,s,n),l=tf(this.five.camera,o,n);if(!a||!l)return 0;const c=a.leftPx>l.leftPx?l:a,h=a.leftPx>l.leftPx?a:l,u=h.leftPx-c.leftPx,d=h.topPx-c.topPx;return Math.atan2(d,u)*(180/Math.PI)})();this.container.style.left=t.leftPx+"px",this.container.style.top=t.topPx+"px",this.container.style.transformOrigin="center",this.container.style.transform=`scale(${i})`,r&&(this.container.style.transform+=` rotate(${r}deg)`)}addResizeListener(){const n=this.five.getElement();if(n){const{observe:t,unobserve:i}=ah(this.onCameraUpdate,n);t(),this.disposers.push(i)}}}function Cv(e,n,t){return new Qr(e,n,t)}function Is(e){return e.toLowerCase().includes("panorama")}function Ci(e){return!Is(e)}class lh{constructor(n,t){v(this,"width");v(this,"height");v(this,"containerDom");v(this,"hooks",new Pn);v(this,"canvas",document.createElement("canvas"));v(this,"config");v(this,"state",{enabled:!1});v(this,"five");v(this,"scale");v(this,"offset",{x:0,y:0});v(this,"context");v(this,"renderCenter",new C.Vector3);v(this,"hammer");v(this,"offsetRange");v(this,"isPanning",!1);v(this,"imageData",new ImageData(1,1));v(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});v(this,"onPan",n=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",n))return;const{translateX:i,translateY:r}=this.getPanOffset(n,this.offsetRange);this.canvas.style.transform=`translate3d(${i}px, ${r}px, 100px)`});v(this,"onPanend",n=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:t,translateY:i}=this.getPanOffset(n,this.offsetRange);this.canvas.style.transform=`translate3d(${t}px, ${i}px, 100px)`,this.offset={x:t,y:i}});var r,s,o,a;if(!n.renderer){console.error("Five Render 未初始化");return}this.five=n,this.scale=(r=t==null?void 0:t.scale)!=null?r:2,this.width=(s=t==null?void 0:t.width)!=null?s:190,this.height=(a=(o=t==null?void 0:t.height)!=null?o:t==null?void 0:t.width)!=null?a:190,this.config={dragEnabled:(t==null?void 0:t.dragEnabled)||!1,autoFixPCPosition:(t==null?void 0:t.autoFixPCPosition)||!1,initialPosition:(t==null?void 0:t.initialPosition)||{left:"0",top:"0"}};const i=this.canvas.getContext("2d");if(!i)throw new Error("CANNOT CREATE CONTEXT2D");this.context=i,this.config.dragEnabled&&(this.hammer=new rl(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(this.state.enabled)return this.state.enabled=!1,this.canvas.style.visibility="hidden",this.canvas.remove(),this}dispose(){var n;this.clear(),this.disable(),(n=this.hammer)==null||n.destroy()}appendTo(n){var t;return this.containerDom&&((t=this.containerDom)==null||t.removeChild(this.canvas)),this.containerDom=n,this.state.enabled&&this._appendTo(n),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(n){this.containerDom&&this.state.enabled&&(this.renderCenter=n,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(n){this.containerDom&&this.state.enabled&&(this.renderCenter=n,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform="translate3d(0px, 0px, 100px)"}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:n,context:t,width:i,height:r}=this,s=this.five.renderer.getSize(new C.Vector2),[o,a]=(()=>{if(this.renderCenter instanceof C.Vector3){const p=this.renderCenter.clone().project(this.five.camera);return[(p.x+1)/2*s.x,(p.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=i/n,h=r/n,u=l*n,d=this.five.getPixels(o-c/2,a-c/2,c,h,u),f=Math.floor(i*l),m=Math.floor(r*l);UC(d,f,m),(this.imageData.width!==f||this.imageData.height!==m)&&(this.imageData=new ImageData(f,m)),this.imageData.data.set(d),t.putImageData(this.imageData,0,0),this.canvas.style.visibility="visible"}getRenderCenter(){return this.renderCenter}_appendTo(n){if(this.resetOffset(),n.appendChild(this.canvas),!this.offsetRange){const t=this.canvas.getBoundingClientRect(),i=n.getBoundingClientRect(),r=i.right-t.right,s=i.bottom-t.bottom,o=i.left-t.left,a=i.top-t.top;this.offsetRange={min:{x:o,y:a},max:{x:r,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:n,height:t}=this,{clientWidth:i,clientHeight:r}=this.containerDom,[s,o,a]=(()=>{if(this.renderCenter instanceof C.Vector3){const l=this.renderCenter.clone().project(this.five.camera);return[(l.x+1)/2*i,-(l.x-1)/2*i,-(l.y-1)/2*r]}else return[this.renderCenter.x,i-this.renderCenter.x,this.renderCenter.y]})();s<183?(this.canvas.style.top=-t/2+"px",this.canvas.style.left="90px"):a<183?(this.canvas.style.top="90px",this.canvas.style.left=-n/2+"px"):o<183?(this.canvas.style.top=-t/2+"px",this.canvas.style.left=-n-90+"px"):(this.canvas.style.left=-n/2+"px",this.canvas.style.top=-t-90+"px"),this.canvas.style.transform=`translate3d(${s}px, ${a}px, 10px)`,this.offset={x:s,y:a}}initStyle(){const n=this.canvas;n.classList.add("five-plugin__magnifier"),n.style.position="absolute",n.style.pointerEvents=this.config.dragEnabled?"all":"none",n.style.borderRadius="50%",n.style.zIndex="99";const t=1;n.setAttribute("width",(this.width*t).toString()),n.setAttribute("height",(this.height*t).toString()),n.style.border="2px solid rgba(255,255,255,0.20)",n.style.width=this.width+"px",n.style.height=this.height+"px",n.style.top=this.config.initialPosition.top,n.style.left=this.config.initialPosition.left,n.style.transform="translate(0,0,100px)",n.style.visibility="hidden",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(n,t){const{min:{x:i,y:r},max:{x:s,y:o}}=t,a=this.offset.x+n.deltaX,l=this.offset.y+n.deltaY,c=Math.min(Math.max(a,i),s),h=Math.min(Math.max(l,r),o);return{translateX:c,translateY:h}}}function ch(e,n,t){const i=e[n],r=e[t];i===void 0||r===void 0||(e[n]=r,e[t]=i)}function UC(e,n,t){const i=t/2;for(let r=1;r<=i;r++){const s=t-(r-1);for(let o=1;o<=n;o++){const a=(r-1)*n+o-1,l=(s-1)*n+o-1;ch(e,a*4+0,l*4+0),ch(e,a*4+1,l*4+1),ch(e,a*4+2,l*4+2),ch(e,a*4+3,l*4+3)}}}function WC(e,n){const{offsetWidth:t,offsetHeight:i}=n,{top:r,left:s}=n.getBoundingClientRect();return new C.Vector2().set((e.x-s)/t*2-1,-(e.y-r)/i*2+1)}function QC(e,n){const{offsetWidth:t,offsetHeight:i}=n;return new C.Vector2().set(e.x/t*2-1,-e.y/i*2+1)}const Pv="CSS3DRenderer-dshauidwahdslkadnmsla";function Ev(e){var i;const n=(i=e.getElement())==null?void 0:i.parentElement;if(!n){console.error("initialCSS3DRender: five element is not exist");return}if(document.getElementById(Pv))return;const t=new Kd;t.domElementWrapper.id=Pv,t.domElementWrapper.style.zIndex="1",t.appendToElement(n),t.renderEveryFrame(e.scene,e.camera)}const YC=16777215,_v=16777215,XC=2,bo=.6;class Sv extends Hn.Line{constructor(...n){super(...n)}toJSON(){return{type:"FiveLine",points:this.points.toJSON()}}}class ZC extends Hn.THREE_Line2{constructor(...n){super(...n)}toJSON(){return{type:"Five_THREE_Line2",geometryAttributes:this.geometry.attributes}}}class qC extends Hn.LineMaterial{constructor(...n){super(...n)}toJSON(){return{type:"FiveLineMaterial",color:this.color}}}Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52)),Number.isInteger===void 0&&(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}),Math.sign===void 0&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype||Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),Object.assign===void 0&&(Object.assign=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n=Object(e);for(let t=1;t<arguments.length;t++){const i=arguments[t];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n});const JC="117",KC=0,Iv=1,$C=2,Tv=1,eP=2,cl=3,hl=0,En=1,hh=2,Dv=1,Yr=0,ul=1,Lv=2,kv=3,Ov=4,tP=5,Ao=100,nP=101,iP=102,Rv=103,zv=104,rP=200,sP=201,oP=202,aP=203,Bv=204,Nv=205,lP=206,cP=207,hP=208,uP=209,dP=210,fP=0,pP=1,mP=2,rf=3,gP=4,vP=5,yP=6,bP=7,uh=0,AP=1,wP=2,dl=0,Fv=1,xP=2,MP=3,CP=4,PP=5,sf=300,of=301,af=302,Vv=303,lf=304,Gv=305,fl=306,cf=307,dh=1e3,Jn=1001,fh=1002,mn=1003,hf=1004,uf=1005,zn=1006,jv=1007,ph=1008,pl=1009,EP=1010,_P=1011,mh=1012,SP=1013,gh=1014,Xr=1015,vh=1016,IP=1017,TP=1018,DP=1019,ml=1020,LP=1021,Ts=1022,Pi=1023,kP=1024,OP=1025,RP=Pi,wo=1026,gl=1027,zP=1028,BP=1029,NP=1030,FP=1031,VP=1032,GP=1033,Hv=33776,Uv=33777,Wv=33778,Qv=33779,Yv=35840,Xv=35841,Zv=35842,qv=35843,jP=36196,Jv=37492,Kv=37496,HP=37808,UP=37809,WP=37810,QP=37811,YP=37812,XP=37813,ZP=37814,qP=37815,JP=37816,KP=37817,$P=37818,eE=37819,tE=37820,nE=37821,iE=36492,rE=37840,sE=37841,oE=37842,aE=37843,lE=37844,cE=37845,hE=37846,uE=37847,dE=37848,fE=37849,pE=37850,mE=37851,gE=37852,vE=37853,yE=2200,bE=2201,AE=2202,yh=2300,bh=2301,df=2302,xo=2400,Mo=2401,Ah=2402,ff=2500,$v=2501,wE=0,Kn=3e3,wh=3001,pf=3007,mf=3002,xE=3003,e0=3004,t0=3005,n0=3006,ME=3200,CE=3201,Co=0,PE=1,gf=7680,EE=519,xh=35044,vl=35048;function gr(){}Object.assign(gr.prototype,{addEventListener:function(e,n){this._listeners===void 0&&(this._listeners={});var t=this._listeners;t[e]===void 0&&(t[e]=[]),t[e].indexOf(n)===-1&&t[e].push(n)},hasEventListener:function(e,n){if(this._listeners===void 0)return!1;var t=this._listeners;return t[e]!==void 0&&t[e].indexOf(n)!==-1},removeEventListener:function(e,n){if(this._listeners!==void 0){var t=this._listeners,i=t[e];if(i!==void 0){var r=i.indexOf(n);r!==-1&&i.splice(r,1)}}},dispatchEvent:function(e){if(this._listeners!==void 0){var n=this._listeners,t=n[e.type];if(t!==void 0){e.target=this;for(var i=t.slice(0),r=0,s=i.length;r<s;r++)i[r].call(this,e)}}}});for(var Tn=[],yl=0;yl<256;yl++)Tn[yl]=(yl<16?"0":"")+yl.toString(16);var xt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,r=Tn[e&255]+Tn[e>>8&255]+Tn[e>>16&255]+Tn[e>>24&255]+"-"+Tn[n&255]+Tn[n>>8&255]+"-"+Tn[n>>16&15|64]+Tn[n>>24&255]+"-"+Tn[t&63|128]+Tn[t>>8&255]+"-"+Tn[t>>16&255]+Tn[t>>24&255]+Tn[i&255]+Tn[i>>8&255]+Tn[i>>16&255]+Tn[i>>24&255];return r.toUpperCase()},clamp:function(e,n,t){return Math.max(n,Math.min(t,e))},euclideanModulo:function(e,n){return(e%n+n)%n},mapLinear:function(e,n,t,i,r){return i+(e-n)*(r-i)/(t-n)},lerp:function(e,n,t){return(1-t)*e+t*n},smoothstep:function(e,n,t){return e<=n?0:e>=t?1:(e=(e-n)/(t-n),e*e*(3-2*e))},smootherstep:function(e,n,t){return e<=n?0:e>=t?1:(e=(e-n)/(t-n),e*e*e*(e*(e*6-15)+10))},randInt:function(e,n){return e+Math.floor(Math.random()*(n-e+1))},randFloat:function(e,n){return e+Math.random()*(n-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*xt.DEG2RAD},radToDeg:function(e){return e*xt.RAD2DEG},isPowerOfTwo:function(e){return(e&e-1)===0&&e!==0},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,n,t,i,r){var s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((n+i)/2),h=o((n+i)/2),u=s((n-i)/2),d=o((n-i)/2),f=s((i-n)/2),m=o((i-n)/2);switch(r){case"XYX":e.set(a*h,l*u,l*d,a*c);break;case"YZY":e.set(l*d,a*h,l*u,a*c);break;case"ZXZ":e.set(l*u,l*d,a*h,a*c);break;case"XZX":e.set(a*h,l*m,l*f,a*c);break;case"YXY":e.set(l*f,a*h,l*m,a*c);break;case"ZYZ":e.set(l*m,l*f,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};function ge(e,n){this.x=e||0,this.y=n||0}Object.defineProperties(ge.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(ge.prototype,{isVector2:!0,set:function(e,n){return this.x=e,this.y=n,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,n){return n!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,n)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this},addScaledVector:function(e,n){return this.x+=e.x*n,this.y+=e.y*n,this},sub:function(e,n){return n!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,n)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var n=this.x,t=this.y,i=e.elements;return this.x=i[0]*n+i[3]*t+i[6],this.y=i[1]*n+i[4]*t+i[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this},clampScalar:function(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this},clampLength:function(e,n){var t=this.length();return this.divideScalar(t||1).multiplyScalar(Math.max(e,Math.min(n,t)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var n=this.x-e.x,t=this.y-e.y;return n*n+t*t},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this},lerpVectors:function(e,n,t){return this.x=e.x+(n.x-e.x)*t,this.y=e.y+(n.y-e.y)*t,this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,n){return n===void 0&&(n=0),this.x=e[n],this.y=e[n+1],this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this.x,e[n+1]=this.y,e},fromBufferAttribute:function(e,n,t){return t!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(n),this.y=e.getY(n),this},rotateAround:function(e,n){var t=Math.cos(n),i=Math.sin(n),r=this.x-e.x,s=this.y-e.y;return this.x=r*t-s*i+e.x,this.y=r*i+s*t+e.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}});function Un(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Un.prototype,{isMatrix3:!0,set:function(e,n,t,i,r,s,o,a,l){var c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=n,c[4]=r,c[5]=a,c[6]=t,c[7]=s,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return new this.constructor().fromArray(this.elements)},copy:function(e){var n=this.elements,t=e.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],this},extractBasis:function(e,n,t){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),t.setFromMatrix3Column(this,2),this},setFromMatrix4:function(e){var n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,n){var t=e.elements,i=n.elements,r=this.elements,s=t[0],o=t[3],a=t[6],l=t[1],c=t[4],h=t[7],u=t[2],d=t[5],f=t[8],m=i[0],p=i[3],g=i[6],y=i[1],b=i[4],A=i[7],w=i[2],x=i[5],M=i[8];return r[0]=s*m+o*y+a*w,r[3]=s*p+o*b+a*x,r[6]=s*g+o*A+a*M,r[1]=l*m+c*y+h*w,r[4]=l*p+c*b+h*x,r[7]=l*g+c*A+h*M,r[2]=u*m+d*y+f*w,r[5]=u*p+d*b+f*x,r[8]=u*g+d*A+f*M,this},multiplyScalar:function(e){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this},determinant:function(){var e=this.elements,n=e[0],t=e[1],i=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return n*s*c-n*o*l-t*r*c+t*o*a+i*r*l-i*s*a},getInverse:function(e,n){n!==void 0&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var t=e.elements,i=this.elements,r=t[0],s=t[1],o=t[2],a=t[3],l=t[4],c=t[5],h=t[6],u=t[7],d=t[8],f=d*l-c*u,m=c*h-d*a,p=u*a-l*h,g=r*f+s*m+o*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);var y=1/g;return i[0]=f*y,i[1]=(o*u-d*s)*y,i[2]=(c*s-o*l)*y,i[3]=m*y,i[4]=(d*r-o*h)*y,i[5]=(o*a-c*r)*y,i[6]=p*y,i[7]=(s*h-u*r)*y,i[8]=(l*r-s*a)*y,this},transpose:function(){var e,n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this},setUvTransform:function(e,n,t,i,r,s,o){var a=Math.cos(r),l=Math.sin(r);this.set(t*a,t*l,-t*(a*s+l*o)+s+e,-i*l,i*a,-i*(-l*s+a*o)+o+n,0,0,1)},scale:function(e,n){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=n,t[4]*=n,t[7]*=n,this},rotate:function(e){var n=Math.cos(e),t=Math.sin(e),i=this.elements,r=i[0],s=i[3],o=i[6],a=i[1],l=i[4],c=i[7];return i[0]=n*r+t*a,i[3]=n*s+t*l,i[6]=n*o+t*c,i[1]=-t*r+n*a,i[4]=-t*s+n*l,i[7]=-t*o+n*c,this},translate:function(e,n){var t=this.elements;return t[0]+=e*t[2],t[3]+=e*t[5],t[6]+=e*t[8],t[1]+=n*t[2],t[4]+=n*t[5],t[7]+=n*t[8],this},equals:function(e){for(var n=this.elements,t=e.elements,i=0;i<9;i++)if(n[i]!==t[i])return!1;return!0},fromArray:function(e,n){n===void 0&&(n=0);for(var t=0;t<9;t++)this.elements[t]=e[t+n];return this},toArray:function(e,n){e===void 0&&(e=[]),n===void 0&&(n=0);var t=this.elements;return e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=t[3],e[n+4]=t[4],e[n+5]=t[5],e[n+6]=t[6],e[n+7]=t[7],e[n+8]=t[8],e}});var Po,Ds={getDataURL:function(e){var n;if(typeof HTMLCanvasElement=="undefined")return e.src;if(e instanceof HTMLCanvasElement)n=e;else{Po===void 0&&(Po=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Po.width=e.width,Po.height=e.height;var t=Po.getContext("2d");e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Po}return n.width>2048||n.height>2048?n.toDataURL("image/jpeg",.6):n.toDataURL("image/png")}},_E=0;function Wt(e,n,t,i,r,s,o,a,l,c){Object.defineProperty(this,"id",{value:_E++}),this.uuid=xt.generateUUID(),this.name="",this.image=e!==void 0?e:Wt.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=n!==void 0?n:Wt.DEFAULT_MAPPING,this.wrapS=t!==void 0?t:Jn,this.wrapT=i!==void 0?i:Jn,this.magFilter=r!==void 0?r:zn,this.minFilter=s!==void 0?s:ph,this.anisotropy=l!==void 0?l:1,this.format=o!==void 0?o:Pi,this.internalFormat=null,this.type=a!==void 0?a:pl,this.offset=new ge(0,0),this.repeat=new ge(1,1),this.center=new ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Un,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c!==void 0?c:Kn,this.version=0,this.onUpdate=null}Wt.DEFAULT_IMAGE=void 0,Wt.DEFAULT_MAPPING=sf,Wt.prototype=Object.assign(Object.create(gr.prototype),{constructor:Wt,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];var t={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){var i=this.image;if(i.uuid===void 0&&(i.uuid=xt.generateUUID()),!n&&e.images[i.uuid]===void 0){var r;if(Array.isArray(i)){r=[];for(var s=0,o=i.length;s<o;s++)r.push(Ds.getDataURL(i[s]))}else r=Ds.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}t.image=i.uuid}return n||(e.textures[this.uuid]=t),t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==sf)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case dh:e.x=e.x-Math.floor(e.x);break;case Jn:e.x=e.x<0?0:1;break;case fh:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case dh:e.y=e.y-Math.floor(e.y);break;case Jn:e.y=e.y<0?0:1;break;case fh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Wt.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}});function Vt(e,n,t,i){this.x=e||0,this.y=n||0,this.z=t||0,this.w=i!==void 0?i:1}Object.defineProperties(Vt.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(Vt.prototype,{isVector4:!0,set:function(e,n,t,i){return this.x=e,this.y=n,this.z=t,this.w=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this},add:function(e,n){return n!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,n)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this},addScaledVector:function(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this},sub:function(e,n){return n!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,n)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var n=this.x,t=this.y,i=this.z,r=this.w,s=e.elements;return this.x=s[0]*n+s[4]*t+s[8]*i+s[12]*r,this.y=s[1]*n+s[5]*t+s[9]*i+s[13]*r,this.z=s[2]*n+s[6]*t+s[10]*i+s[14]*r,this.w=s[3]*n+s[7]*t+s[11]*i+s[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this},setAxisAngleFromRotationMatrix:function(e){var n,t,i,r,s=.01,o=.1,a=e.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],f=a[9],m=a[2],p=a[6],g=a[10];if(Math.abs(c-u)<s&&Math.abs(h-m)<s&&Math.abs(f-p)<s){if(Math.abs(c+u)<o&&Math.abs(h+m)<o&&Math.abs(f+p)<o&&Math.abs(l+d+g-3)<o)return this.set(1,0,0,0),this;n=Math.PI;var y=(l+1)/2,b=(d+1)/2,A=(g+1)/2,w=(c+u)/4,x=(h+m)/4,M=(f+p)/4;return y>b&&y>A?y<s?(t=0,i=.707106781,r=.707106781):(t=Math.sqrt(y),i=w/t,r=x/t):b>A?b<s?(t=.707106781,i=0,r=.707106781):(i=Math.sqrt(b),t=w/i,r=M/i):A<s?(t=.707106781,i=.707106781,r=0):(r=Math.sqrt(A),t=x/r,i=M/r),this.set(t,i,r,n),this}var E=Math.sqrt((p-f)*(p-f)+(h-m)*(h-m)+(u-c)*(u-c));return Math.abs(E)<.001&&(E=1),this.x=(p-f)/E,this.y=(h-m)/E,this.z=(u-c)/E,this.w=Math.acos((l+d+g-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this},clampScalar:function(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this},clampLength:function(e,n){var t=this.length();return this.divideScalar(t||1).multiplyScalar(Math.max(e,Math.min(n,t)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this},lerpVectors:function(e,n,t){return this.x=e.x+(n.x-e.x)*t,this.y=e.y+(n.y-e.y)*t,this.z=e.z+(n.z-e.z)*t,this.w=e.w+(n.w-e.w)*t,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,n){return n===void 0&&(n=0),this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e},fromBufferAttribute:function(e,n,t){return t!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}});function di(e,n,t){this.width=e,this.height=n,this.scissor=new Vt(0,0,e,n),this.scissorTest=!1,this.viewport=new Vt(0,0,e,n),t=t||{},this.texture=new Wt(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=n,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:zn,this.depthBuffer=t.depthBuffer!==void 0?t.depthBuffer:!0,this.stencilBuffer=t.stencilBuffer!==void 0?t.stencilBuffer:!0,this.depthTexture=t.depthTexture!==void 0?t.depthTexture:null}di.prototype=Object.assign(Object.create(gr.prototype),{constructor:di,isWebGLRenderTarget:!0,setSize:function(e,n){(this.width!==e||this.height!==n)&&(this.width=e,this.height=n,this.texture.image.width=e,this.texture.image.height=n,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});function i0(e,n,t){di.call(this,e,n,t),this.samples=4}i0.prototype=Object.assign(Object.create(di.prototype),{constructor:i0,isWebGLMultisampleRenderTarget:!0,copy:function(e){return di.prototype.copy.call(this,e),this.samples=e.samples,this}});function _n(e,n,t,i){this._x=e||0,this._y=n||0,this._z=t||0,this._w=i!==void 0?i:1}Object.assign(_n,{slerp:function(e,n,t,i){return t.copy(e).slerp(n,i)},slerpFlat:function(e,n,t,i,r,s,o){var a=t[i+0],l=t[i+1],c=t[i+2],h=t[i+3],u=r[s+0],d=r[s+1],f=r[s+2],m=r[s+3];if(h!==m||a!==u||l!==d||c!==f){var p=1-o,g=a*u+l*d+c*f+h*m,y=g>=0?1:-1,b=1-g*g;if(b>Number.EPSILON){var A=Math.sqrt(b),w=Math.atan2(A,g*y);p=Math.sin(p*w)/A,o=Math.sin(o*w)/A}var x=o*y;if(a=a*p+u*x,l=l*p+d*x,c=c*p+f*x,h=h*p+m*x,p===1-o){var M=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=M,l*=M,c*=M,h*=M}}e[n]=a,e[n+1]=l,e[n+2]=c,e[n+3]=h},multiplyQuaternionsFlat:function(e,n,t,i,r,s){var o=t[i],a=t[i+1],l=t[i+2],c=t[i+3],h=r[s],u=r[s+1],d=r[s+2],f=r[s+3];return e[n]=o*f+c*h+a*d-l*u,e[n+1]=a*f+c*u+l*h-o*d,e[n+2]=l*f+c*d+o*u-a*h,e[n+3]=c*f-o*h-a*u-l*d,e}}),Object.defineProperties(_n.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(_n.prototype,{isQuaternion:!0,set:function(e,n,t,i){return this._x=e,this._y=n,this._z=t,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,n){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var t=e._x,i=e._y,r=e._z,s=e.order,o=Math.cos,a=Math.sin,l=o(t/2),c=o(i/2),h=o(r/2),u=a(t/2),d=a(i/2),f=a(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*f,this._y=l*d*h-u*c*f,this._z=l*c*f+u*d*h,this._w=l*c*h-u*d*f;break;case"YXZ":this._x=u*c*h+l*d*f,this._y=l*d*h-u*c*f,this._z=l*c*f-u*d*h,this._w=l*c*h+u*d*f;break;case"ZXY":this._x=u*c*h-l*d*f,this._y=l*d*h+u*c*f,this._z=l*c*f+u*d*h,this._w=l*c*h-u*d*f;break;case"ZYX":this._x=u*c*h-l*d*f,this._y=l*d*h+u*c*f,this._z=l*c*f-u*d*h,this._w=l*c*h+u*d*f;break;case"YZX":this._x=u*c*h+l*d*f,this._y=l*d*h+u*c*f,this._z=l*c*f-u*d*h,this._w=l*c*h-u*d*f;break;case"XZY":this._x=u*c*h-l*d*f,this._y=l*d*h-u*c*f,this._z=l*c*f+u*d*h,this._w=l*c*h+u*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n!==!1&&this._onChangeCallback(),this},setFromAxisAngle:function(e,n){var t=n/2,i=Math.sin(t);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(t),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var n=e.elements,t=n[0],i=n[4],r=n[8],s=n[1],o=n[5],a=n[9],l=n[2],c=n[6],h=n[10],u=t+o+h,d;return u>0?(d=.5/Math.sqrt(u+1),this._w=.25/d,this._x=(c-a)*d,this._y=(r-l)*d,this._z=(s-i)*d):t>o&&t>h?(d=2*Math.sqrt(1+t-o-h),this._w=(c-a)/d,this._x=.25*d,this._y=(i+s)/d,this._z=(r+l)/d):o>h?(d=2*Math.sqrt(1+o-t-h),this._w=(r-l)/d,this._x=(i+s)/d,this._y=.25*d,this._z=(a+c)/d):(d=2*Math.sqrt(1+h-t-o),this._w=(s-i)/d,this._x=(r+l)/d,this._y=(a+c)/d,this._z=.25*d),this._onChangeCallback(),this},setFromUnitVectors:function(e,n){var t=1e-6,i=e.dot(n)+1;return i<t?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(xt.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,n){var t=this.angleTo(e);if(t===0)return this;var i=Math.min(1,n/t);return this.slerp(e,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,n){return n!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,n)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,n){var t=e._x,i=e._y,r=e._z,s=e._w,o=n._x,a=n._y,l=n._z,c=n._w;return this._x=t*c+s*o+i*l-r*a,this._y=i*c+s*a+r*o-t*l,this._z=r*c+s*l+t*a-i*o,this._w=s*c-t*o-i*a-r*l,this._onChangeCallback(),this},slerp:function(e,n){if(n===0)return this;if(n===1)return this.copy(e);var t=this._x,i=this._y,r=this._z,s=this._w,o=s*e._w+t*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=t,this._y=i,this._z=r,this;var a=1-o*o;if(a<=Number.EPSILON){var l=1-n;return this._w=l*s+n*this._w,this._x=l*t+n*this._x,this._y=l*i+n*this._y,this._z=l*r+n*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(a),h=Math.atan2(c,o),u=Math.sin((1-n)*h)/c,d=Math.sin(n*h)/c;return this._w=s*u+this._w*d,this._x=t*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,n){return n===void 0&&(n=0),this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e},fromBufferAttribute:function(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var vf=new B,r0=new _n;function B(e,n,t){this.x=e||0,this.y=n||0,this.z=t||0}Object.assign(B.prototype,{isVector3:!0,set:function(e,n,t){return this.x=e,this.y=n,this.z=t,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,n){return n!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,n)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this},addScaledVector:function(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this},sub:function(e,n){return n!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,n)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this},multiply:function(e,n){return n!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,n)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(r0.setFromEuler(e))},applyAxisAngle:function(e,n){return this.applyQuaternion(r0.setFromAxisAngle(e,n))},applyMatrix3:function(e){var n=this.x,t=this.y,i=this.z,r=e.elements;return this.x=r[0]*n+r[3]*t+r[6]*i,this.y=r[1]*n+r[4]*t+r[7]*i,this.z=r[2]*n+r[5]*t+r[8]*i,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var n=this.x,t=this.y,i=this.z,r=e.elements,s=1/(r[3]*n+r[7]*t+r[11]*i+r[15]);return this.x=(r[0]*n+r[4]*t+r[8]*i+r[12])*s,this.y=(r[1]*n+r[5]*t+r[9]*i+r[13])*s,this.z=(r[2]*n+r[6]*t+r[10]*i+r[14])*s,this},applyQuaternion:function(e){var n=this.x,t=this.y,i=this.z,r=e.x,s=e.y,o=e.z,a=e.w,l=a*n+s*i-o*t,c=a*t+o*n-r*i,h=a*i+r*t-s*n,u=-r*n-s*t-o*i;return this.x=l*a+u*-r+c*-o-h*-s,this.y=c*a+u*-s+h*-r-l*-o,this.z=h*a+u*-o+l*-s-c*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var n=this.x,t=this.y,i=this.z,r=e.elements;return this.x=r[0]*n+r[4]*t+r[8]*i,this.y=r[1]*n+r[5]*t+r[9]*i,this.z=r[2]*n+r[6]*t+r[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this},clampScalar:function(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this},clampLength:function(e,n){var t=this.length();return this.divideScalar(t||1).multiplyScalar(Math.max(e,Math.min(n,t)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this},lerpVectors:function(e,n,t){return this.x=e.x+(n.x-e.x)*t,this.y=e.y+(n.y-e.y)*t,this.z=e.z+(n.z-e.z)*t,this},cross:function(e,n){return n!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,n)):this.crossVectors(this,e)},crossVectors:function(e,n){var t=e.x,i=e.y,r=e.z,s=n.x,o=n.y,a=n.z;return this.x=i*a-r*o,this.y=r*s-t*a,this.z=t*o-i*s,this},projectOnVector:function(e){var n=e.lengthSq();if(n===0)return this.set(0,0,0);var t=e.dot(this)/n;return this.copy(e).multiplyScalar(t)},projectOnPlane:function(e){return vf.copy(this).projectOnVector(e),this.sub(vf)},reflect:function(e){return this.sub(vf.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;var t=this.dot(e)/n;return Math.acos(xt.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var n=this.x-e.x,t=this.y-e.y,i=this.z-e.z;return n*n+t*t+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,n,t){var i=Math.sin(n)*e;return this.x=i*Math.sin(t),this.y=Math.cos(n)*e,this.z=i*Math.cos(t),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,n,t){return this.x=e*Math.sin(n),this.y=t,this.z=e*Math.cos(n),this},setFromMatrixPosition:function(e){var n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this},setFromMatrixScale:function(e){var n=this.setFromMatrixColumn(e,0).length(),t=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=t,this.z=i,this},setFromMatrixColumn:function(e,n){return this.fromArray(e.elements,n*4)},setFromMatrix3Column:function(e,n){return this.fromArray(e.elements,n*3)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,n){return n===void 0&&(n=0),this.x=e[n],this.y=e[n+1],this.z=e[n+2],this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e},fromBufferAttribute:function(e,n,t){return t!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var Eo=new B,Ei=new Ct,SE=new B(0,0,0),IE=new B(1,1,1),Zr=new B,Mh=new B,ri=new B;function Ct(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Ct.prototype,{isMatrix4:!0,set:function(e,n,t,i,r,s,o,a,l,c,h,u,d,f,m,p){var g=this.elements;return g[0]=e,g[4]=n,g[8]=t,g[12]=i,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=f,g[11]=m,g[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return new Ct().fromArray(this.elements)},copy:function(e){var n=this.elements,t=e.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],this},copyPosition:function(e){var n=this.elements,t=e.elements;return n[12]=t[12],n[13]=t[13],n[14]=t[14],this},extractBasis:function(e,n,t){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),t.setFromMatrixColumn(this,2),this},makeBasis:function(e,n,t){return this.set(e.x,n.x,t.x,0,e.y,n.y,t.y,0,e.z,n.z,t.z,0,0,0,0,1),this},extractRotation:function(e){var n=this.elements,t=e.elements,i=1/Eo.setFromMatrixColumn(e,0).length(),r=1/Eo.setFromMatrixColumn(e,1).length(),s=1/Eo.setFromMatrixColumn(e,2).length();return n[0]=t[0]*i,n[1]=t[1]*i,n[2]=t[2]*i,n[3]=0,n[4]=t[4]*r,n[5]=t[5]*r,n[6]=t[6]*r,n[7]=0,n[8]=t[8]*s,n[9]=t[9]*s,n[10]=t[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var n=this.elements,t=e.x,i=e.y,r=e.z,s=Math.cos(t),o=Math.sin(t),a=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){var u=s*c,d=s*h,f=o*c,m=o*h;n[0]=a*c,n[4]=-a*h,n[8]=l,n[1]=d+f*l,n[5]=u-m*l,n[9]=-o*a,n[2]=m-u*l,n[6]=f+d*l,n[10]=s*a}else if(e.order==="YXZ"){var p=a*c,g=a*h,y=l*c,b=l*h;n[0]=p+b*o,n[4]=y*o-g,n[8]=s*l,n[1]=s*h,n[5]=s*c,n[9]=-o,n[2]=g*o-y,n[6]=b+p*o,n[10]=s*a}else if(e.order==="ZXY"){var p=a*c,g=a*h,y=l*c,b=l*h;n[0]=p-b*o,n[4]=-s*h,n[8]=y+g*o,n[1]=g+y*o,n[5]=s*c,n[9]=b-p*o,n[2]=-s*l,n[6]=o,n[10]=s*a}else if(e.order==="ZYX"){var u=s*c,d=s*h,f=o*c,m=o*h;n[0]=a*c,n[4]=f*l-d,n[8]=u*l+m,n[1]=a*h,n[5]=m*l+u,n[9]=d*l-f,n[2]=-l,n[6]=o*a,n[10]=s*a}else if(e.order==="YZX"){var A=s*a,w=s*l,x=o*a,M=o*l;n[0]=a*c,n[4]=M-A*h,n[8]=x*h+w,n[1]=h,n[5]=s*c,n[9]=-o*c,n[2]=-l*c,n[6]=w*h+x,n[10]=A-M*h}else if(e.order==="XZY"){var A=s*a,w=s*l,x=o*a,M=o*l;n[0]=a*c,n[4]=-h,n[8]=l*c,n[1]=A*h+M,n[5]=s*c,n[9]=w*h-x,n[2]=x*h-w,n[6]=o*c,n[10]=M*h+A}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(SE,e,IE)},lookAt:function(e,n,t){var i=this.elements;return ri.subVectors(e,n),ri.lengthSq()===0&&(ri.z=1),ri.normalize(),Zr.crossVectors(t,ri),Zr.lengthSq()===0&&(Math.abs(t.z)===1?ri.x+=1e-4:ri.z+=1e-4,ri.normalize(),Zr.crossVectors(t,ri)),Zr.normalize(),Mh.crossVectors(ri,Zr),i[0]=Zr.x,i[4]=Mh.x,i[8]=ri.x,i[1]=Zr.y,i[5]=Mh.y,i[9]=ri.y,i[2]=Zr.z,i[6]=Mh.z,i[10]=ri.z,this},multiply:function(e,n){return n!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,n)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,n){var t=e.elements,i=n.elements,r=this.elements,s=t[0],o=t[4],a=t[8],l=t[12],c=t[1],h=t[5],u=t[9],d=t[13],f=t[2],m=t[6],p=t[10],g=t[14],y=t[3],b=t[7],A=t[11],w=t[15],x=i[0],M=i[4],E=i[8],S=i[12],T=i[1],z=i[5],D=i[9],k=i[13],R=i[2],G=i[6],I=i[10],U=i[14],J=i[3],K=i[7],ne=i[11],ie=i[15];return r[0]=s*x+o*T+a*R+l*J,r[4]=s*M+o*z+a*G+l*K,r[8]=s*E+o*D+a*I+l*ne,r[12]=s*S+o*k+a*U+l*ie,r[1]=c*x+h*T+u*R+d*J,r[5]=c*M+h*z+u*G+d*K,r[9]=c*E+h*D+u*I+d*ne,r[13]=c*S+h*k+u*U+d*ie,r[2]=f*x+m*T+p*R+g*J,r[6]=f*M+m*z+p*G+g*K,r[10]=f*E+m*D+p*I+g*ne,r[14]=f*S+m*k+p*U+g*ie,r[3]=y*x+b*T+A*R+w*J,r[7]=y*M+b*z+A*G+w*K,r[11]=y*E+b*D+A*I+w*ne,r[15]=y*S+b*k+A*U+w*ie,this},multiplyScalar:function(e){var n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this},determinant:function(){var e=this.elements,n=e[0],t=e[4],i=e[8],r=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14],f=e[3],m=e[7],p=e[11],g=e[15];return f*(+r*a*h-i*l*h-r*o*u+t*l*u+i*o*d-t*a*d)+m*(+n*a*d-n*l*u+r*s*u-i*s*d+i*l*c-r*a*c)+p*(+n*l*h-n*o*d-r*s*h+t*s*d+r*o*c-t*l*c)+g*(-i*o*c-n*a*h+n*o*u+i*s*h-t*s*u+t*a*c)},transpose:function(){var e=this.elements,n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this},setPosition:function(e,n,t){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=t),this},getInverse:function(e,n){n!==void 0&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var t=this.elements,i=e.elements,r=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],f=i[9],m=i[10],p=i[11],g=i[12],y=i[13],b=i[14],A=i[15],w=f*b*u-y*m*u+y*h*p-c*b*p-f*h*A+c*m*A,x=g*m*u-d*b*u-g*h*p+l*b*p+d*h*A-l*m*A,M=d*y*u-g*f*u+g*c*p-l*y*p-d*c*A+l*f*A,E=g*f*h-d*y*h-g*c*m+l*y*m+d*c*b-l*f*b,S=r*w+s*x+o*M+a*E;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/S;return t[0]=w*T,t[1]=(y*m*a-f*b*a-y*o*p+s*b*p+f*o*A-s*m*A)*T,t[2]=(c*b*a-y*h*a+y*o*u-s*b*u-c*o*A+s*h*A)*T,t[3]=(f*h*a-c*m*a-f*o*u+s*m*u+c*o*p-s*h*p)*T,t[4]=x*T,t[5]=(d*b*a-g*m*a+g*o*p-r*b*p-d*o*A+r*m*A)*T,t[6]=(g*h*a-l*b*a-g*o*u+r*b*u+l*o*A-r*h*A)*T,t[7]=(l*m*a-d*h*a+d*o*u-r*m*u-l*o*p+r*h*p)*T,t[8]=M*T,t[9]=(g*f*a-d*y*a-g*s*p+r*y*p+d*s*A-r*f*A)*T,t[10]=(l*y*a-g*c*a+g*s*u-r*y*u-l*s*A+r*c*A)*T,t[11]=(d*c*a-l*f*a-d*s*u+r*f*u+l*s*p-r*c*p)*T,t[12]=E*T,t[13]=(d*y*o-g*f*o+g*s*m-r*y*m-d*s*b+r*f*b)*T,t[14]=(g*c*o-l*y*o-g*s*h+r*y*h+l*s*b-r*c*b)*T,t[15]=(l*f*o-d*c*o+d*s*h-r*f*h-l*s*m+r*c*m)*T,this},scale:function(e){var n=this.elements,t=e.x,i=e.y,r=e.z;return n[0]*=t,n[4]*=i,n[8]*=r,n[1]*=t,n[5]*=i,n[9]*=r,n[2]*=t,n[6]*=i,n[10]*=r,n[3]*=t,n[7]*=i,n[11]*=r,this},getMaxScaleOnAxis:function(){var e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],t=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,t,i))},makeTranslation:function(e,n,t){return this.set(1,0,0,e,0,1,0,n,0,0,1,t,0,0,0,1),this},makeRotationX:function(e){var n=Math.cos(e),t=Math.sin(e);return this.set(1,0,0,0,0,n,-t,0,0,t,n,0,0,0,0,1),this},makeRotationY:function(e){var n=Math.cos(e),t=Math.sin(e);return this.set(n,0,t,0,0,1,0,0,-t,0,n,0,0,0,0,1),this},makeRotationZ:function(e){var n=Math.cos(e),t=Math.sin(e);return this.set(n,-t,0,0,t,n,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,n){var t=Math.cos(n),i=Math.sin(n),r=1-t,s=e.x,o=e.y,a=e.z,l=r*s,c=r*o;return this.set(l*s+t,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+t,c*a-i*s,0,l*a-i*o,c*a+i*s,r*a*a+t,0,0,0,0,1),this},makeScale:function(e,n,t){return this.set(e,0,0,0,0,n,0,0,0,0,t,0,0,0,0,1),this},makeShear:function(e,n,t){return this.set(1,n,t,0,e,1,t,0,e,n,1,0,0,0,0,1),this},compose:function(e,n,t){var i=this.elements,r=n._x,s=n._y,o=n._z,a=n._w,l=r+r,c=s+s,h=o+o,u=r*l,d=r*c,f=r*h,m=s*c,p=s*h,g=o*h,y=a*l,b=a*c,A=a*h,w=t.x,x=t.y,M=t.z;return i[0]=(1-(m+g))*w,i[1]=(d+A)*w,i[2]=(f-b)*w,i[3]=0,i[4]=(d-A)*x,i[5]=(1-(u+g))*x,i[6]=(p+y)*x,i[7]=0,i[8]=(f+b)*M,i[9]=(p-y)*M,i[10]=(1-(u+m))*M,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:function(e,n,t){var i=this.elements,r=Eo.set(i[0],i[1],i[2]).length(),s=Eo.set(i[4],i[5],i[6]).length(),o=Eo.set(i[8],i[9],i[10]).length(),a=this.determinant();a<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Ei.copy(this);var l=1/r,c=1/s,h=1/o;return Ei.elements[0]*=l,Ei.elements[1]*=l,Ei.elements[2]*=l,Ei.elements[4]*=c,Ei.elements[5]*=c,Ei.elements[6]*=c,Ei.elements[8]*=h,Ei.elements[9]*=h,Ei.elements[10]*=h,n.setFromRotationMatrix(Ei),t.x=r,t.y=s,t.z=o,this},makePerspective:function(e,n,t,i,r,s){s===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,a=2*r/(n-e),l=2*r/(t-i),c=(n+e)/(n-e),h=(t+i)/(t-i),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,n,t,i,r,s){var o=this.elements,a=1/(n-e),l=1/(t-i),c=1/(s-r),h=(n+e)*a,u=(t+i)*l,d=(s+r)*c;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var n=this.elements,t=e.elements,i=0;i<16;i++)if(n[i]!==t[i])return!1;return!0},fromArray:function(e,n){n===void 0&&(n=0);for(var t=0;t<16;t++)this.elements[t]=e[t+n];return this},toArray:function(e,n){e===void 0&&(e=[]),n===void 0&&(n=0);var t=this.elements;return e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=t[3],e[n+4]=t[4],e[n+5]=t[5],e[n+6]=t[6],e[n+7]=t[7],e[n+8]=t[8],e[n+9]=t[9],e[n+10]=t[10],e[n+11]=t[11],e[n+12]=t[12],e[n+13]=t[13],e[n+14]=t[14],e[n+15]=t[15],e}});var s0=new Ct,o0=new _n;function _o(e,n,t,i){this._x=e||0,this._y=n||0,this._z=t||0,this._order=i||_o.DefaultOrder}_o.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],_o.DefaultOrder="XYZ",Object.defineProperties(_o.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(_o.prototype,{isEuler:!0,set:function(e,n,t,i){return this._x=e,this._y=n,this._z=t,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,n,t){var i=xt.clamp,r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],f=r[10];switch(n=n||this._order,n){case"XYZ":this._y=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,t!==!1&&this._onChangeCallback(),this},setFromQuaternion:function(e,n,t){return s0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(s0,n,t)},setFromVector3:function(e,n){return this.set(e.x,e.y,e.z,n||this._order)},reorder:function(e){return o0.setFromEuler(this),this.setFromQuaternion(o0,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new B(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});function yf(){this.mask=1}Object.assign(yf.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return(this.mask&e.mask)!==0}});let TE=0;const a0=new B,So=new _n,vr=new Ct,Ch=new B,bl=new B,DE=new B,LE=new _n,l0=new B(1,0,0),c0=new B(0,1,0),h0=new B(0,0,1),kE={type:"added"},OE={type:"removed"};function He(){Object.defineProperty(this,"id",{value:TE++}),this.uuid=xt.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=He.DefaultUp.clone();var e=new B,n=new _o,t=new _n,i=new B(1,1,1);function r(){t.setFromEuler(n,!1)}function s(){n.setFromQuaternion(t,void 0,!1)}n._onChange(r),t._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:t},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Ct},normalMatrix:{value:new Un}}),this.matrix=new Ct,this.matrixWorld=new Ct,this.matrixAutoUpdate=He.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new yf,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}He.DefaultUp=new B(0,1,0),He.DefaultMatrixAutoUpdate=!0,He.prototype=Object.assign(Object.create(gr.prototype),{constructor:He,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,n){this.quaternion.setFromAxisAngle(e,n)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,n){return So.setFromAxisAngle(e,n),this.quaternion.multiply(So),this},rotateOnWorldAxis:function(e,n){return So.setFromAxisAngle(e,n),this.quaternion.premultiply(So),this},rotateX:function(e){return this.rotateOnAxis(l0,e)},rotateY:function(e){return this.rotateOnAxis(c0,e)},rotateZ:function(e){return this.rotateOnAxis(h0,e)},translateOnAxis:function(e,n){return a0.copy(e).applyQuaternion(this.quaternion),this.position.add(a0.multiplyScalar(n)),this},translateX:function(e){return this.translateOnAxis(l0,e)},translateY:function(e){return this.translateOnAxis(c0,e)},translateZ:function(e){return this.translateOnAxis(h0,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(vr.getInverse(this.matrixWorld))},lookAt:function(e,n,t){e.isVector3?Ch.copy(e):Ch.set(e,n,t);var i=this.parent;this.updateWorldMatrix(!0,!1),bl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?vr.lookAt(bl,Ch,this.up):vr.lookAt(Ch,bl,this.up),this.quaternion.setFromRotationMatrix(vr),i&&(vr.extractRotation(i.matrixWorld),So.setFromRotationMatrix(vr),this.quaternion.premultiply(So.inverse()))},add:function(e){if(arguments.length>1){for(var n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(kE)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}var t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(OE)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),vr.getInverse(this.matrixWorld),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),vr.multiply(e.parent.matrixWorld)),e.applyMatrix4(vr),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,n){if(this[e]===n)return this;for(var t=0,i=this.children.length;t<i;t++){var r=this.children[t],s=r.getObjectByProperty(e,n);if(s!==void 0)return s}},getWorldPosition:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new B),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new _n),this.updateMatrixWorld(!0),this.matrixWorld.decompose(bl,e,DE),e},getWorldScale:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new B),this.updateMatrixWorld(!0),this.matrixWorld.decompose(bl,LE,e),e},getWorldDirection:function(e){e===void 0&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new B),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var n=this.children,t=0,i=n.length;t<i;t++)n[t].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var n=this.children,t=0,i=n.length;t<i;t++)n[t].traverseVisible(e)}},traverseAncestors:function(e){var n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var n=this.children,t=0,i=n.length;t<i;t++)n[t].updateMatrixWorld(e)},updateWorldMatrix:function(e,n){var t=this.parent;if(e===!0&&t!==null&&t.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),n===!0)for(var i=this.children,r=0,s=i.length;r<s;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(e){var n=e===void 0||typeof e=="string",t={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},t.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON());function r(g,y){return g[y.uuid]===void 0&&(g[y.uuid]=y.toJSON(e)),y.uuid}if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);var s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){var o=s.shapes;if(Array.isArray(o))for(var a=0,l=o.length;a<l;a++){var c=o[a];r(e.shapes,c)}else r(e.shapes,o)}}if(this.material!==void 0)if(Array.isArray(this.material)){for(var h=[],a=0,l=this.material.length;a<l;a++)h.push(r(e.materials,this.material[a]));i.material=h}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(var a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(n){var u=p(e.geometries),d=p(e.materials),f=p(e.textures),m=p(e.images),o=p(e.shapes);u.length>0&&(t.geometries=u),d.length>0&&(t.materials=d),f.length>0&&(t.textures=f),m.length>0&&(t.images=m),o.length>0&&(t.shapes=o)}return t.object=i,t;function p(g){var y=[];for(var b in g){var A=g[b];delete A.metadata,y.push(A)}return y}},clone:function(e){return new this.constructor().copy(this,e)},copy:function(e,n){if(n===void 0&&(n=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(var t=0;t<e.children.length;t++){var i=e.children[t];this.add(i.clone())}return this}});function Al(){He.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Al.prototype=Object.assign(Object.create(He.prototype),{constructor:Al,isScene:!0,copy:function(e,n){return He.prototype.copy.call(this,e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var n=He.prototype.toJSON.call(this,e);return this.background!==null&&(n.object.background=this.background.toJSON(e)),this.environment!==null&&(n.object.environment=this.environment.toJSON(e)),this.fog!==null&&(n.object.fog=this.fog.toJSON()),n},dispose:function(){this.dispatchEvent({type:"dispose"})}});var yr=[new B,new B,new B,new B,new B,new B,new B,new B],wl=new B,bf=new fi,Io=new B,To=new B,Do=new B,qr=new B,Jr=new B,Ls=new B,xl=new B,Ph=new B,Eh=new B,ks=new B;function fi(e,n){this.min=e!==void 0?e:new B(1/0,1/0,1/0),this.max=n!==void 0?n:new B(-1/0,-1/0,-1/0)}Object.assign(fi.prototype,{isBox3:!0,set:function(e,n){return this.min.copy(e),this.max.copy(n),this},setFromArray:function(e){for(var n=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0,a=0,l=e.length;a<l;a+=3){var c=e[a],h=e[a+1],u=e[a+2];c<n&&(n=c),h<t&&(t=h),u<i&&(i=u),c>r&&(r=c),h>s&&(s=h),u>o&&(o=u)}return this.min.set(n,t,i),this.max.set(r,s,o),this},setFromBufferAttribute:function(e){for(var n=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0,a=0,l=e.count;a<l;a++){var c=e.getX(a),h=e.getY(a),u=e.getZ(a);c<n&&(n=c),h<t&&(t=h),u<i&&(i=u),c>r&&(r=c),h>s&&(s=h),u>o&&(o=u)}return this.min.set(n,t,i),this.max.set(r,s,o),this},setFromPoints:function(e){this.makeEmpty();for(var n=0,t=e.length;n<t;n++)this.expandByPoint(e[n]);return this},setFromCenterAndSize:function(e,n){var t=wl.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(t),this.max.copy(e).add(t),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return e===void 0&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new B),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e===void 0&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new B),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var n=e.geometry;n!==void 0&&(n.boundingBox===null&&n.computeBoundingBox(),bf.copy(n.boundingBox),bf.applyMatrix4(e.matrixWorld),this.union(bf));for(var t=e.children,i=0,r=t.length;i<r;i++)this.expandByObject(t[i]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,n){return n===void 0&&(console.warn("THREE.Box3: .getParameter() target is now required"),n=new B),n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,wl),wl.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var n,t;return e.normal.x>0?(n=e.normal.x*this.min.x,t=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,t=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,t+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,t+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,t+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,t+=e.normal.z*this.min.z),n<=-e.constant&&t>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(xl),Ph.subVectors(this.max,xl),Io.subVectors(e.a,xl),To.subVectors(e.b,xl),Do.subVectors(e.c,xl),qr.subVectors(To,Io),Jr.subVectors(Do,To),Ls.subVectors(Io,Do);var n=[0,-qr.z,qr.y,0,-Jr.z,Jr.y,0,-Ls.z,Ls.y,qr.z,0,-qr.x,Jr.z,0,-Jr.x,Ls.z,0,-Ls.x,-qr.y,qr.x,0,-Jr.y,Jr.x,0,-Ls.y,Ls.x,0];return!Af(n,Io,To,Do,Ph)||(n=[1,0,0,0,1,0,0,0,1],!Af(n,Io,To,Do,Ph))?!1:(Eh.crossVectors(qr,Jr),n=[Eh.x,Eh.y,Eh.z],Af(n,Io,To,Do,Ph))},clampPoint:function(e,n){return n===void 0&&(console.warn("THREE.Box3: .clampPoint() target is now required"),n=new B),n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){var n=wl.copy(e).clamp(this.min,this.max);return n.sub(e).length()},getBoundingSphere:function(e){return e===void 0&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=this.getSize(wl).length()*.5,e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()?this:(yr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),yr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),yr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),yr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),yr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),yr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),yr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),yr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(yr),this)},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});function Af(e,n,t,i,r){var s,o;for(s=0,o=e.length-3;s<=o;s+=3){ks.fromArray(e,s);var a=r.x*Math.abs(ks.x)+r.y*Math.abs(ks.y)+r.z*Math.abs(ks.z),l=n.dot(ks),c=t.dot(ks),h=i.dot(ks);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}var RE=new fi;function Ui(e,n){this.center=e!==void 0?e:new B,this.radius=n!==void 0?n:-1}Object.assign(Ui.prototype,{set:function(e,n){return this.center.copy(e),this.radius=n,this},setFromPoints:function(e,n){var t=this.center;n!==void 0?t.copy(n):RE.setFromPoints(e).getCenter(t);for(var i=0,r=0,s=e.length;r<s;r++)i=Math.max(i,t.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,n){var t=this.center.distanceToSquared(e);return n===void 0&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),n=new B),n.copy(e),t>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(e){return e===void 0&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new fi),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var br=new B,wf=new B,_h=new B,Kr=new B,xf=new B,Sh=new B,Mf=new B;function Lo(e,n){this.origin=e!==void 0?e:new B,this.direction=n!==void 0?n:new B(0,0,-1)}Object.assign(Lo.prototype,{set:function(e,n){return this.origin.copy(e),this.direction.copy(n),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,n){return n===void 0&&(console.warn("THREE.Ray: .at() target is now required"),n=new B),n.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,br)),this},closestPointToPoint:function(e,n){n===void 0&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),n=new B),n.subVectors(e,this.origin);var t=n.dot(this.direction);return t<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(t).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var n=br.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(br.copy(this.direction).multiplyScalar(n).add(this.origin),br.distanceToSquared(e))},distanceSqToSegment:function(e,n,t,i){wf.copy(e).add(n).multiplyScalar(.5),_h.copy(n).sub(e).normalize(),Kr.copy(this.origin).sub(wf);var r=e.distanceTo(n)*.5,s=-this.direction.dot(_h),o=Kr.dot(this.direction),a=-Kr.dot(_h),l=Kr.lengthSq(),c=Math.abs(1-s*s),h,u,d,f;if(c>0)if(h=s*a-o,u=s*o-a,f=r*c,h>=0)if(u>=-f)if(u<=f){var m=1/c;h*=m,u*=m,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-f?(h=Math.max(0,-(-s*r+o)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=f?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(s*r+o)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return t&&t.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(_h).multiplyScalar(u).add(wf),d},intersectSphere:function(e,n){br.subVectors(e.center,this.origin);var t=br.dot(this.direction),i=br.dot(br)-t*t,r=e.radius*e.radius;if(i>r)return null;var s=Math.sqrt(r-i),o=t-s,a=t+s;return o<0&&a<0?null:o<0?this.at(a,n):this.at(o,n)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;var t=-(this.origin.dot(e.normal)+e.constant)/n;return t>=0?t:null},intersectPlane:function(e,n){var t=this.distanceToPlane(e);return t===null?null:this.at(t,n)},intersectsPlane:function(e){var n=e.distanceToPoint(this.origin);if(n===0)return!0;var t=e.normal.dot(this.direction);return t*n<0},intersectBox:function(e,n){var t,i,r,s,o,a,l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(t=(e.min.x-u.x)*l,i=(e.max.x-u.x)*l):(t=(e.max.x-u.x)*l,i=(e.min.x-u.x)*l),c>=0?(r=(e.min.y-u.y)*c,s=(e.max.y-u.y)*c):(r=(e.max.y-u.y)*c,s=(e.min.y-u.y)*c),t>s||r>i||((r>t||t!==t)&&(t=r),(s<i||i!==i)&&(i=s),h>=0?(o=(e.min.z-u.z)*h,a=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,a=(e.min.z-u.z)*h),t>a||o>i)||((o>t||t!==t)&&(t=o),(a<i||i!==i)&&(i=a),i<0)?null:this.at(t>=0?t:i,n)},intersectsBox:function(e){return this.intersectBox(e,br)!==null},intersectTriangle:function(e,n,t,i,r){xf.subVectors(n,e),Sh.subVectors(t,e),Mf.crossVectors(xf,Sh);var s=this.direction.dot(Mf),o;if(s>0){if(i)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Kr.subVectors(this.origin,e);var a=o*this.direction.dot(Sh.crossVectors(Kr,Sh));if(a<0)return null;var l=o*this.direction.dot(xf.cross(Kr));if(l<0||a+l>s)return null;var c=-o*Kr.dot(Mf);return c<0?null:this.at(c/s,r)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var Cf=new B,zE=new B,BE=new Un;function Wi(e,n){this.normal=e!==void 0?e:new B(1,0,0),this.constant=n!==void 0?n:0}Object.assign(Wi.prototype,{isPlane:!0,set:function(e,n){return this.normal.copy(e),this.constant=n,this},setComponents:function(e,n,t,i){return this.normal.set(e,n,t),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this},setFromCoplanarPoints:function(e,n,t){var i=Cf.subVectors(t,n).cross(zE.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,n){return n===void 0&&(console.warn("THREE.Plane: .projectPoint() target is now required"),n=new B),n.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,n){n===void 0&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new B);var t=e.delta(Cf),i=this.normal.dot(t);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):void 0;var r=-(e.start.dot(this.normal)+this.constant)/i;if(!(r<0||r>1))return n.copy(t).multiplyScalar(r).add(e.start)},intersectsLine:function(e){var n=this.distanceToPoint(e.start),t=this.distanceToPoint(e.end);return n<0&&t>0||t<0&&n>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return e===void 0&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new B),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,n){var t=n||BE.getNormalMatrix(e),i=this.coplanarPoint(Cf).applyMatrix4(e),r=this.normal.applyMatrix3(t).normalize();return this.constant=-i.dot(r),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var _i=new B,Ar=new B,Pf=new B,wr=new B,ko=new B,Oo=new B,u0=new B,Ef=new B,_f=new B,Sf=new B;function Dn(e,n,t){this.a=e!==void 0?e:new B,this.b=n!==void 0?n:new B,this.c=t!==void 0?t:new B}Object.assign(Dn,{getNormal:function(e,n,t,i){i===void 0&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new B),i.subVectors(t,n),_i.subVectors(e,n),i.cross(_i);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(e,n,t,i,r){_i.subVectors(i,n),Ar.subVectors(t,n),Pf.subVectors(e,n);var s=_i.dot(_i),o=_i.dot(Ar),a=_i.dot(Pf),l=Ar.dot(Ar),c=Ar.dot(Pf),h=s*l-o*o;if(r===void 0&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new B),h===0)return r.set(-2,-1,-1);var u=1/h,d=(l*a-o*c)*u,f=(s*c-o*a)*u;return r.set(1-d-f,f,d)},containsPoint:function(e,n,t,i){return Dn.getBarycoord(e,n,t,i,wr),wr.x>=0&&wr.y>=0&&wr.x+wr.y<=1},getUV:function(e,n,t,i,r,s,o,a){return this.getBarycoord(e,n,t,i,wr),a.set(0,0),a.addScaledVector(r,wr.x),a.addScaledVector(s,wr.y),a.addScaledVector(o,wr.z),a},isFrontFacing:function(e,n,t,i){return _i.subVectors(t,n),Ar.subVectors(e,n),_i.cross(Ar).dot(i)<0}}),Object.assign(Dn.prototype,{set:function(e,n,t){return this.a.copy(e),this.b.copy(n),this.c.copy(t),this},setFromPointsAndIndices:function(e,n,t,i){return this.a.copy(e[n]),this.b.copy(e[t]),this.c.copy(e[i]),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return _i.subVectors(this.c,this.b),Ar.subVectors(this.a,this.b),_i.cross(Ar).length()*.5},getMidpoint:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new B),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Dn.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Wi),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,n){return Dn.getBarycoord(e,this.a,this.b,this.c,n)},getUV:function(e,n,t,i,r){return Dn.getUV(e,this.a,this.b,this.c,n,t,i,r)},containsPoint:function(e){return Dn.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return Dn.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,n){n===void 0&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),n=new B);var t=this.a,i=this.b,r=this.c,s,o;ko.subVectors(i,t),Oo.subVectors(r,t),Ef.subVectors(e,t);var a=ko.dot(Ef),l=Oo.dot(Ef);if(a<=0&&l<=0)return n.copy(t);_f.subVectors(e,i);var c=ko.dot(_f),h=Oo.dot(_f);if(c>=0&&h<=c)return n.copy(i);var u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),n.copy(t).addScaledVector(ko,s);Sf.subVectors(e,r);var d=ko.dot(Sf),f=Oo.dot(Sf);if(f>=0&&d<=f)return n.copy(r);var m=d*l-a*f;if(m<=0&&l>=0&&f<=0)return o=l/(l-f),n.copy(t).addScaledVector(Oo,o);var p=c*f-d*h;if(p<=0&&h-c>=0&&d-f>=0)return u0.subVectors(r,i),o=(h-c)/(h-c+(d-f)),n.copy(i).addScaledVector(u0,o);var g=1/(p+m+u);return s=m*g,o=u*g,n.copy(t).addScaledVector(ko,s).addScaledVector(Oo,o)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var d0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Si={h:0,s:0,l:0},Ih={h:0,s:0,l:0};function Ye(e,n,t){return n===void 0&&t===void 0?this.set(e):this.setRGB(e,n,t)}function If(e,n,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+(n-e)*6*t:t<1/2?n:t<2/3?e+(n-e)*6*(2/3-t):e}function Tf(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function Df(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}Object.assign(Ye.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this},setRGB:function(e,n,t){return this.r=e,this.g=n,this.b=t,this},setHSL:function(e,n,t){if(e=xt.euclideanModulo(e,1),n=xt.clamp(n,0,1),t=xt.clamp(t,0,1),n===0)this.r=this.g=this.b=t;else{var i=t<=.5?t*(1+n):t+n-t*n,r=2*t-i;this.r=If(r,i,e+1/3),this.g=If(r,i,e),this.b=If(r,i,e-1/3)}return this},setStyle:function(e){function n(u){u!==void 0&&parseFloat(u)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var t;if(t=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=t[1],s=t[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,n(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,n(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(s)){var o=parseFloat(i[1])/360,a=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return n(i[5]),this.setHSL(o,a,l)}break}}else if(t=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=t[1],h=c.length;if(h===3)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(h===6)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var n=d0[e];return n!==void 0?this.setHex(n):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,n){return n===void 0&&(n=2),this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},copyLinearToGamma:function(e,n){n===void 0&&(n=2);var t=n>0?1/n:1;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=Tf(e.r),this.g=Tf(e.g),this.b=Tf(e.b),this},copyLinearToSRGB:function(e){return this.r=Df(e.r),this.g=Df(e.g),this.b=Df(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){e===void 0&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var n=this.r,t=this.g,i=this.b,r=Math.max(n,t,i),s=Math.min(n,t,i),o,a,l=(s+r)/2;if(s===r)o=0,a=0;else{var c=r-s;switch(a=l<=.5?c/(r+s):c/(2-r-s),r){case n:o=(t-i)/c+(t<i?6:0);break;case t:o=(i-n)/c+2;break;case i:o=(n-t)/c+4;break}o/=6}return e.h=o,e.s=a,e.l=l,e},getStyle:function(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"},offsetHSL:function(e,n,t){return this.getHSL(Si),Si.h+=e,Si.s+=n,Si.l+=t,this.setHSL(Si.h,Si.s,Si.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this},lerpHSL:function(e,n){this.getHSL(Si),e.getHSL(Ih);var t=xt.lerp(Si.h,Ih.h,n),i=xt.lerp(Si.s,Ih.s,n),r=xt.lerp(Si.l,Ih.l,n);return this.setHSL(t,i,r),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,n){return n===void 0&&(n=0),this.r=e[n],this.g=e[n+1],this.b=e[n+2],this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e},toJSON:function(){return this.getHex()}}),Ye.NAMES=d0;function Th(e,n,t,i,r,s){this.a=e,this.b=n,this.c=t,this.normal=i&&i.isVector3?i:new B,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new Ye,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=s!==void 0?s:0}Object.assign(Th.prototype,{clone:function(){return new this.constructor().copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var n=0,t=e.vertexNormals.length;n<t;n++)this.vertexNormals[n]=e.vertexNormals[n].clone();for(var n=0,t=e.vertexColors.length;n<t;n++)this.vertexColors[n]=e.vertexColors[n].clone();return this}});var NE=0;function dt(){Object.defineProperty(this,"id",{value:NE++}),this.uuid=xt.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=ul,this.side=hl,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Bv,this.blendDst=Nv,this.blendEquation=Ao,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=rf,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=EE,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=gf,this.stencilZFail=gf,this.stencilZPass=gf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}dt.prototype=Object.assign(Object.create(gr.prototype),{constructor:dt,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(e!==void 0)for(var n in e){var t=e[n];if(t===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}if(n==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===Dv;continue}var i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(t):i&&i.isVector3&&t&&t.isVector3?i.copy(t):this[n]=t}},toJSON:function(e){var n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});var t={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),this.roughness!==void 0&&(t.roughness=this.roughness),this.metalness!==void 0&&(t.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(t.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(t.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),this.shininess!==void 0&&(t.shininess=this.shininess),this.clearcoat!==void 0&&(t.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(t.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(t.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(t.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(t.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,t.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(t.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(t.aoMap=this.aoMap.toJSON(e).uuid,t.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(e).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(e).uuid,t.normalMapType=this.normalMapType,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(e).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(e).uuid,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,this.combine!==void 0&&(t.combine=this.combine),this.envMapIntensity!==void 0&&(t.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(e).uuid),this.size!==void 0&&(t.size=this.size),this.sizeAttenuation!==void 0&&(t.sizeAttenuation=this.sizeAttenuation),this.blending!==ul&&(t.blending=this.blending),this.flatShading===!0&&(t.flatShading=this.flatShading),this.side!==hl&&(t.side=this.side),this.vertexColors&&(t.vertexColors=!0),this.opacity<1&&(t.opacity=this.opacity),this.transparent===!0&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,t.stencilWrite=this.stencilWrite,t.stencilWriteMask=this.stencilWriteMask,t.stencilFunc=this.stencilFunc,t.stencilRef=this.stencilRef,t.stencilFuncMask=this.stencilFuncMask,t.stencilFail=this.stencilFail,t.stencilZFail=this.stencilZFail,t.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(t.rotation=this.rotation),this.polygonOffset===!0&&(t.polygonOffset=!0),this.polygonOffsetFactor!==0&&(t.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(t.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(t.linewidth=this.linewidth),this.dashSize!==void 0&&(t.dashSize=this.dashSize),this.gapSize!==void 0&&(t.gapSize=this.gapSize),this.scale!==void 0&&(t.scale=this.scale),this.dithering===!0&&(t.dithering=!0),this.alphaTest>0&&(t.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(t.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(t.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(t.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(t.morphTargets=!0),this.morphNormals===!0&&(t.morphNormals=!0),this.skinning===!0&&(t.skinning=!0),this.visible===!1&&(t.visible=!1),this.toneMapped===!1&&(t.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(t.userData=this.userData);function i(o){var a=[];for(var l in o){var c=o[l];delete c.metadata,a.push(c)}return a}if(n){var r=i(e.textures),s=i(e.images);r.length>0&&(t.textures=r),s.length>0&&(t.images=s)}return t},clone:function(){return new this.constructor().copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var n=e.clippingPlanes,t=null;if(n!==null){var i=n.length;t=new Array(i);for(var r=0;r!==i;++r)t[r]=n[r].clone()}return this.clippingPlanes=t,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(dt.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}});function Ii(e){dt.call(this),this.type="MeshBasicMaterial",this.color=new Ye(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=uh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}Ii.prototype=Object.create(dt.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isMeshBasicMaterial=!0,Ii.prototype.copy=function(e){return dt.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var jt=new B;function ft(e,n,t){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=t===!0,this.usage=xh,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(ft.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.assign(ft.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,n,t){e*=this.itemSize,t*=n.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=n.array[t+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var n=this.array,t=0,i=0,r=e.length;i<r;i++){var s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),s=new Ye),n[t++]=s.r,n[t++]=s.g,n[t++]=s.b}return this},copyVector2sArray:function(e){for(var n=this.array,t=0,i=0,r=e.length;i<r;i++){var s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),s=new ge),n[t++]=s.x,n[t++]=s.y}return this},copyVector3sArray:function(e){for(var n=this.array,t=0,i=0,r=e.length;i<r;i++){var s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),s=new B),n[t++]=s.x,n[t++]=s.y,n[t++]=s.z}return this},copyVector4sArray:function(e){for(var n=this.array,t=0,i=0,r=e.length;i<r;i++){var s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),s=new Vt),n[t++]=s.x,n[t++]=s.y,n[t++]=s.z,n[t++]=s.w}return this},applyMatrix3:function(e){for(var n=0,t=this.count;n<t;n++)jt.x=this.getX(n),jt.y=this.getY(n),jt.z=this.getZ(n),jt.applyMatrix3(e),this.setXYZ(n,jt.x,jt.y,jt.z);return this},applyMatrix4:function(e){for(var n=0,t=this.count;n<t;n++)jt.x=this.getX(n),jt.y=this.getY(n),jt.z=this.getZ(n),jt.applyMatrix4(e),this.setXYZ(n,jt.x,jt.y,jt.z);return this},applyNormalMatrix:function(e){for(var n=0,t=this.count;n<t;n++)jt.x=this.getX(n),jt.y=this.getY(n),jt.z=this.getZ(n),jt.applyNormalMatrix(e),this.setXYZ(n,jt.x,jt.y,jt.z);return this},transformDirection:function(e){for(var n=0,t=this.count;n<t;n++)jt.x=this.getX(n),jt.y=this.getY(n),jt.z=this.getZ(n),jt.transformDirection(e),this.setXYZ(n,jt.x,jt.y,jt.z);return this},set:function(e,n){return n===void 0&&(n=0),this.array.set(e,n),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,n){return this.array[e*this.itemSize]=n,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,n){return this.array[e*this.itemSize+1]=n,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,n){return this.array[e*this.itemSize+2]=n,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,n){return this.array[e*this.itemSize+3]=n,this},setXY:function(e,n,t){return e*=this.itemSize,this.array[e+0]=n,this.array[e+1]=t,this},setXYZ:function(e,n,t,i){return e*=this.itemSize,this.array[e+0]=n,this.array[e+1]=t,this.array[e+2]=i,this},setXYZW:function(e,n,t,i,r){return e*=this.itemSize,this.array[e+0]=n,this.array[e+1]=t,this.array[e+2]=i,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}});function Lf(e,n,t){ft.call(this,new Int8Array(e),n,t)}Lf.prototype=Object.create(ft.prototype),Lf.prototype.constructor=Lf;function kf(e,n,t){ft.call(this,new Uint8Array(e),n,t)}kf.prototype=Object.create(ft.prototype),kf.prototype.constructor=kf;function Of(e,n,t){ft.call(this,new Uint8ClampedArray(e),n,t)}Of.prototype=Object.create(ft.prototype),Of.prototype.constructor=Of;function Rf(e,n,t){ft.call(this,new Int16Array(e),n,t)}Rf.prototype=Object.create(ft.prototype),Rf.prototype.constructor=Rf;function Ml(e,n,t){ft.call(this,new Uint16Array(e),n,t)}Ml.prototype=Object.create(ft.prototype),Ml.prototype.constructor=Ml;function zf(e,n,t){ft.call(this,new Int32Array(e),n,t)}zf.prototype=Object.create(ft.prototype),zf.prototype.constructor=zf;function Cl(e,n,t){ft.call(this,new Uint32Array(e),n,t)}Cl.prototype=Object.create(ft.prototype),Cl.prototype.constructor=Cl;function Be(e,n,t){ft.call(this,new Float32Array(e),n,t)}Be.prototype=Object.create(ft.prototype),Be.prototype.constructor=Be;function Bf(e,n,t){ft.call(this,new Float64Array(e),n,t)}Bf.prototype=Object.create(ft.prototype),Bf.prototype.constructor=Bf;function f0(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}Object.assign(f0.prototype,{computeGroups:function(e){for(var n,t=[],i=void 0,r=e.faces,s=0;s<r.length;s++){var o=r[s];o.materialIndex!==i&&(i=o.materialIndex,n!==void 0&&(n.count=s*3-n.start,t.push(n)),n={start:s*3,materialIndex:i})}n!==void 0&&(n.count=s*3-n.start,t.push(n)),this.groups=t},fromGeometry:function(e){var n=e.faces,t=e.vertices,i=e.faceVertexUvs,r=i[0]&&i[0].length>0,s=i[1]&&i[1].length>0,o=e.morphTargets,a=o.length,l;if(a>0){l=[];for(var c=0;c<a;c++)l[c]={name:o[c].name,data:[]};this.morphTargets.position=l}var h=e.morphNormals,u=h.length,d;if(u>0){d=[];for(var c=0;c<u;c++)d[c]={name:h[c].name,data:[]};this.morphTargets.normal=d}var f=e.skinIndices,m=e.skinWeights,p=f.length===t.length,g=m.length===t.length;t.length>0&&n.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var c=0;c<n.length;c++){var y=n[c];this.vertices.push(t[y.a],t[y.b],t[y.c]);var b=y.vertexNormals;if(b.length===3)this.normals.push(b[0],b[1],b[2]);else{var A=y.normal;this.normals.push(A,A,A)}var w=y.vertexColors;if(w.length===3)this.colors.push(w[0],w[1],w[2]);else{var x=y.color;this.colors.push(x,x,x)}if(r===!0){var M=i[0][c];M!==void 0?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new ge,new ge,new ge))}if(s===!0){var M=i[1][c];M!==void 0?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new ge,new ge,new ge))}for(var E=0;E<a;E++){var S=o[E].vertices;l[E].data.push(S[y.a],S[y.b],S[y.c])}for(var E=0;E<u;E++){var T=h[E].vertexNormals[c];d[E].data.push(T.a,T.b,T.c)}p&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),g&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this}});function p0(e){if(e.length===0)return-1/0;let n=e[0];for(let t=1,i=e.length;t<i;++t)e[t]>n&&(n=e[t]);return n}var FE=1,Qi=new Ct,Nf=new He,Ro=new B,si=new fi,Pl=new fi,gn=new B;function Xe(){Object.defineProperty(this,"id",{value:FE+=2}),this.uuid=xt.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}Xe.prototype=Object.assign(Object.create(gr.prototype),{constructor:Xe,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(p0(e)>65535?Cl:Ml)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,n){return this.attributes[e]=n,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,n,t){this.groups.push({start:e,count:n,materialIndex:t!==void 0?t:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,n){this.drawRange.start=e,this.drawRange.count=n},applyMatrix4:function(e){var n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);var t=this.attributes.normal;if(t!==void 0){var i=new Un().getNormalMatrix(e);t.applyNormalMatrix(i),t.needsUpdate=!0}var r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},rotateX:function(e){return Qi.makeRotationX(e),this.applyMatrix4(Qi),this},rotateY:function(e){return Qi.makeRotationY(e),this.applyMatrix4(Qi),this},rotateZ:function(e){return Qi.makeRotationZ(e),this.applyMatrix4(Qi),this},translate:function(e,n,t){return Qi.makeTranslation(e,n,t),this.applyMatrix4(Qi),this},scale:function(e,n,t){return Qi.makeScale(e,n,t),this.applyMatrix4(Qi),this},lookAt:function(e){return Nf.lookAt(e),Nf.updateMatrix(),this.applyMatrix4(Nf.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ro).negate(),this.translate(Ro.x,Ro.y,Ro.z),this},setFromObject:function(e){var n=e.geometry;if(e.isPoints||e.isLine){var t=new Be(n.vertices.length*3,3),i=new Be(n.colors.length*3,3);if(this.setAttribute("position",t.copyVector3sArray(n.vertices)),this.setAttribute("color",i.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){var r=new Be(n.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(n.lineDistances))}n.boundingSphere!==null&&(this.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(this.boundingBox=n.boundingBox.clone())}else e.isMesh&&n&&n.isGeometry&&this.fromGeometry(n);return this},setFromPoints:function(e){for(var n=[],t=0,i=e.length;t<i;t++){var r=e[t];n.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Be(n,3)),this},updateFromObject:function(e){var n=e.geometry;if(e.isMesh){var t=n.__directGeometry;if(n.elementsNeedUpdate===!0&&(t=void 0,n.elementsNeedUpdate=!1),t===void 0)return this.fromGeometry(n);t.verticesNeedUpdate=n.verticesNeedUpdate,t.normalsNeedUpdate=n.normalsNeedUpdate,t.colorsNeedUpdate=n.colorsNeedUpdate,t.uvsNeedUpdate=n.uvsNeedUpdate,t.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=t}var i;return n.verticesNeedUpdate===!0&&(i=this.attributes.position,i!==void 0&&(i.copyVector3sArray(n.vertices),i.needsUpdate=!0),n.verticesNeedUpdate=!1),n.normalsNeedUpdate===!0&&(i=this.attributes.normal,i!==void 0&&(i.copyVector3sArray(n.normals),i.needsUpdate=!0),n.normalsNeedUpdate=!1),n.colorsNeedUpdate===!0&&(i=this.attributes.color,i!==void 0&&(i.copyColorsArray(n.colors),i.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(i=this.attributes.uv,i!==void 0&&(i.copyVector2sArray(n.uvs),i.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(i=this.attributes.lineDistance,i!==void 0&&(i.copyArray(n.lineDistances),i.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=new f0().fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var n=new Float32Array(e.vertices.length*3);if(this.setAttribute("position",new ft(n,3).copyVector3sArray(e.vertices)),e.normals.length>0){var t=new Float32Array(e.normals.length*3);this.setAttribute("normal",new ft(t,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(e.colors.length*3);this.setAttribute("color",new ft(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var r=new Float32Array(e.uvs.length*2);this.setAttribute("uv",new ft(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var s=new Float32Array(e.uvs2.length*2);this.setAttribute("uv2",new ft(s,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(var o in e.morphTargets){for(var a=[],l=e.morphTargets[o],c=0,h=l.length;c<h;c++){var u=l[c],d=new Be(u.data.length*3,3);d.name=u.name,a.push(d.copyVector3sArray(u.data))}this.morphAttributes[o]=a}if(e.skinIndices.length>0){var f=new Be(e.skinIndices.length*4,4);this.setAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new Be(e.skinWeights.length*4,4);this.setAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new fi);var e=this.attributes.position,n=this.morphAttributes.position;if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(var t=0,i=n.length;t<i;t++){var r=n[t];si.setFromBufferAttribute(r),this.morphTargetsRelative?(gn.addVectors(this.boundingBox.min,si.min),this.boundingBox.expandByPoint(gn),gn.addVectors(this.boundingBox.max,si.max),this.boundingBox.expandByPoint(gn)):(this.boundingBox.expandByPoint(si.min),this.boundingBox.expandByPoint(si.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new Ui);var e=this.attributes.position,n=this.morphAttributes.position;if(e){var t=this.boundingSphere.center;if(si.setFromBufferAttribute(e),n)for(var i=0,r=n.length;i<r;i++){var s=n[i];Pl.setFromBufferAttribute(s),this.morphTargetsRelative?(gn.addVectors(si.min,Pl.min),si.expandByPoint(gn),gn.addVectors(si.max,Pl.max),si.expandByPoint(gn)):(si.expandByPoint(Pl.min),si.expandByPoint(Pl.max))}si.getCenter(t);for(var o=0,i=0,r=e.count;i<r;i++)gn.fromBufferAttribute(e,i),o=Math.max(o,t.distanceToSquared(gn));if(n)for(var i=0,r=n.length;i<r;i++)for(var s=n[i],a=this.morphTargetsRelative,l=0,c=s.count;l<c;l++)gn.fromBufferAttribute(s,l),a&&(Ro.fromBufferAttribute(e,l),gn.add(Ro)),o=Math.max(o,t.distanceToSquared(gn));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,n=this.attributes;if(n.position){var t=n.position.array;if(n.normal===void 0)this.setAttribute("normal",new ft(new Float32Array(t.length),3));else for(var i=n.normal.array,r=0,s=i.length;r<s;r++)i[r]=0;var o=n.normal.array,a,l,c,h=new B,u=new B,d=new B,f=new B,m=new B;if(e)for(var p=e.array,r=0,s=e.count;r<s;r+=3)a=p[r+0]*3,l=p[r+1]*3,c=p[r+2]*3,h.fromArray(t,a),u.fromArray(t,l),d.fromArray(t,c),f.subVectors(d,u),m.subVectors(h,u),f.cross(m),o[a]+=f.x,o[a+1]+=f.y,o[a+2]+=f.z,o[l]+=f.x,o[l+1]+=f.y,o[l+2]+=f.z,o[c]+=f.x,o[c+1]+=f.y,o[c+2]+=f.z;else for(var r=0,s=t.length;r<s;r+=9)h.fromArray(t,r),u.fromArray(t,r+3),d.fromArray(t,r+6),f.subVectors(d,u),m.subVectors(h,u),f.cross(m),o[r]=f.x,o[r+1]=f.y,o[r+2]=f.z,o[r+3]=f.x,o[r+4]=f.y,o[r+5]=f.z,o[r+6]=f.x,o[r+7]=f.y,o[r+8]=f.z;this.normalizeNormals(),n.normal.needsUpdate=!0}},merge:function(e,n){if(!(e&&e.isBufferGeometry)){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);return}n===void 0&&(n=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var t=this.attributes;for(var i in t)if(e.attributes[i]!==void 0)for(var r=t[i],s=r.array,o=e.attributes[i],a=o.array,l=o.itemSize*n,c=Math.min(a.length,s.length-l),h=0,u=l;h<c;h++,u++)s[u]=a[h];return this},normalizeNormals:function(){for(var e=this.attributes.normal,n=0,t=e.count;n<t;n++)gn.x=e.getX(n),gn.y=e.getY(n),gn.z=e.getZ(n),gn.normalize(),e.setXYZ(n,gn.x,gn.y,gn.z)},toNonIndexed:function(){function e(p,g){for(var y=p.array,b=p.itemSize,A=p.normalized,w=new y.constructor(g.length*b),x=0,M=0,E=0,S=g.length;E<S;E++){x=g[E]*b;for(var T=0;T<b;T++)w[M++]=y[x++]}return new ft(w,b,A)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var n=new Xe,t=this.index.array,i=this.attributes;for(var r in i){var s=i[r],o=e(s,t);n.setAttribute(r,o)}var a=this.morphAttributes;for(r in a){for(var l=[],c=a[r],h=0,u=c.length;h<u;h++){var s=c[h],o=e(s,t);l.push(o)}n.morphAttributes[r]=l}n.morphTargetsRelative=this.morphTargetsRelative;for(var d=this.groups,h=0,f=d.length;h<f;h++){var m=d[h];n.addGroup(m.start,m.count,m.materialIndex)}return n},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){var n=this.parameters;for(var t in n)n[t]!==void 0&&(e[t]=n[t]);return e}e.data={attributes:{}};var i=this.index;i!==null&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var t in r){var s=r[t],o=s.toJSON();s.name!==""&&(o.name=s.name),e.data.attributes[t]=o}var a={},l=!1;for(var t in this.morphAttributes){for(var c=this.morphAttributes[t],h=[],u=0,d=c.length;u<d;u++){var s=c[u],o=s.toJSON();s.name!==""&&(o.name=s.name),h.push(o)}h.length>0&&(a[t]=h,l=!0)}l&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(e.data.groups=JSON.parse(JSON.stringify(f)));var m=this.boundingSphere;return m!==null&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e},clone:function(){return new Xe().copy(this)},copy:function(e){var n,t,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;r!==null&&this.setIndex(r.clone());var s=e.attributes;for(n in s){var o=s[n];this.setAttribute(n,o.clone())}var a=e.morphAttributes;for(n in a){var l=[],c=a[n];for(t=0,i=c.length;t<i;t++)l.push(c[t].clone());this.morphAttributes[n]=l}this.morphTargetsRelative=e.morphTargetsRelative;var h=e.groups;for(t=0,i=h.length;t<i;t++){var u=h[t];this.addGroup(u.start,u.count,u.materialIndex)}var d=e.boundingBox;d!==null&&(this.boundingBox=d.clone());var f=e.boundingSphere;return f!==null&&(this.boundingSphere=f.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var m0=new Ct,Os=new Lo,Ff=new Ui,$r=new B,es=new B,ts=new B,Vf=new B,Gf=new B,jf=new B,Dh=new B,Lh=new B,kh=new B,zo=new ge,Bo=new ge,No=new ge,El=new B,Oh=new B;function en(e,n){He.call(this),this.type="Mesh",this.geometry=e!==void 0?e:new Xe,this.material=n!==void 0?n:new Ii,this.updateMorphTargets()}en.prototype=Object.assign(Object.create(He.prototype),{constructor:en,isMesh:!0,copy:function(e){return He.prototype.copy.call(this,e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e=this.geometry,n,t,i;if(e.isBufferGeometry){var r=e.morphAttributes,s=Object.keys(r);if(s.length>0){var o=r[s[0]];if(o!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},n=0,t=o.length;n<t;n++)i=o[n].name||String(n),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=n}}else{var a=e.morphTargets;a!==void 0&&a.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,n){var t=this.geometry,i=this.material,r=this.matrixWorld;if(i!==void 0&&(t.boundingSphere===null&&t.computeBoundingSphere(),Ff.copy(t.boundingSphere),Ff.applyMatrix4(r),e.ray.intersectsSphere(Ff)!==!1&&(m0.getInverse(r),Os.copy(e.ray).applyMatrix4(m0),!(t.boundingBox!==null&&Os.intersectsBox(t.boundingBox)===!1)))){var s;if(t.isBufferGeometry){var o,a,l,c=t.index,h=t.attributes.position,u=t.morphAttributes.position,d=t.morphTargetsRelative,f=t.attributes.uv,m=t.attributes.uv2,p=t.groups,g=t.drawRange,y,b,A,w,x,M,E,S;if(c!==null)if(Array.isArray(i))for(y=0,A=p.length;y<A;y++)for(x=p[y],M=i[x.materialIndex],E=Math.max(x.start,g.start),S=Math.min(x.start+x.count,g.start+g.count),b=E,w=S;b<w;b+=3)o=c.getX(b),a=c.getX(b+1),l=c.getX(b+2),s=Rh(this,M,e,Os,h,u,d,f,m,o,a,l),s&&(s.faceIndex=Math.floor(b/3),s.face.materialIndex=x.materialIndex,n.push(s));else for(E=Math.max(0,g.start),S=Math.min(c.count,g.start+g.count),y=E,A=S;y<A;y+=3)o=c.getX(y),a=c.getX(y+1),l=c.getX(y+2),s=Rh(this,i,e,Os,h,u,d,f,m,o,a,l),s&&(s.faceIndex=Math.floor(y/3),n.push(s));else if(h!==void 0)if(Array.isArray(i))for(y=0,A=p.length;y<A;y++)for(x=p[y],M=i[x.materialIndex],E=Math.max(x.start,g.start),S=Math.min(x.start+x.count,g.start+g.count),b=E,w=S;b<w;b+=3)o=b,a=b+1,l=b+2,s=Rh(this,M,e,Os,h,u,d,f,m,o,a,l),s&&(s.faceIndex=Math.floor(b/3),s.face.materialIndex=x.materialIndex,n.push(s));else for(E=Math.max(0,g.start),S=Math.min(h.count,g.start+g.count),y=E,A=S;y<A;y+=3)o=y,a=y+1,l=y+2,s=Rh(this,i,e,Os,h,u,d,f,m,o,a,l),s&&(s.faceIndex=Math.floor(y/3),n.push(s))}else if(t.isGeometry){var T,z,D,k=Array.isArray(i),R=t.vertices,G=t.faces,I,U=t.faceVertexUvs[0];U.length>0&&(I=U);for(var J=0,K=G.length;J<K;J++){var ne=G[J],ie=k?i[ne.materialIndex]:i;if(ie!==void 0&&(T=R[ne.a],z=R[ne.b],D=R[ne.c],s=g0(this,ie,e,Os,T,z,D,El),s)){if(I&&I[J]){var pe=I[J];zo.copy(pe[0]),Bo.copy(pe[1]),No.copy(pe[2]),s.uv=Dn.getUV(El,T,z,D,zo,Bo,No,new ge)}s.face=ne,s.faceIndex=J,n.push(s)}}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});function g0(e,n,t,i,r,s,o,a){var l;if(n.side===En?l=i.intersectTriangle(o,s,r,!0,a):l=i.intersectTriangle(r,s,o,n.side!==hh,a),l===null)return null;Oh.copy(a),Oh.applyMatrix4(e.matrixWorld);var c=t.ray.origin.distanceTo(Oh);return c<t.near||c>t.far?null:{distance:c,point:Oh.clone(),object:e}}function Rh(e,n,t,i,r,s,o,a,l,c,h,u){$r.fromBufferAttribute(r,c),es.fromBufferAttribute(r,h),ts.fromBufferAttribute(r,u);var d=e.morphTargetInfluences;if(n.morphTargets&&s&&d){Dh.set(0,0,0),Lh.set(0,0,0),kh.set(0,0,0);for(var f=0,m=s.length;f<m;f++){var p=d[f],g=s[f];p!==0&&(Vf.fromBufferAttribute(g,c),Gf.fromBufferAttribute(g,h),jf.fromBufferAttribute(g,u),o?(Dh.addScaledVector(Vf,p),Lh.addScaledVector(Gf,p),kh.addScaledVector(jf,p)):(Dh.addScaledVector(Vf.sub($r),p),Lh.addScaledVector(Gf.sub(es),p),kh.addScaledVector(jf.sub(ts),p)))}$r.add(Dh),es.add(Lh),ts.add(kh)}e.isSkinnedMesh&&(e.boneTransform(c,$r),e.boneTransform(h,es),e.boneTransform(u,ts));var y=g0(e,n,t,i,$r,es,ts,El);if(y){a&&(zo.fromBufferAttribute(a,c),Bo.fromBufferAttribute(a,h),No.fromBufferAttribute(a,u),y.uv=Dn.getUV(El,$r,es,ts,zo,Bo,No,new ge)),l&&(zo.fromBufferAttribute(l,c),Bo.fromBufferAttribute(l,h),No.fromBufferAttribute(l,u),y.uv2=Dn.getUV(El,$r,es,ts,zo,Bo,No,new ge));var b=new Th(c,h,u);Dn.getNormal($r,es,ts,b.normal),y.face=b}return y}var VE=0,Yi=new Ct,Hf=new He,zh=new B;function mt(){Object.defineProperty(this,"id",{value:VE+=2}),this.uuid=xt.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}mt.prototype=Object.assign(Object.create(gr.prototype),{constructor:mt,isGeometry:!0,applyMatrix4:function(e){for(var n=new Un().getNormalMatrix(e),t=0,i=this.vertices.length;t<i;t++){var r=this.vertices[t];r.applyMatrix4(e)}for(var t=0,i=this.faces.length;t<i;t++){var s=this.faces[t];s.normal.applyMatrix3(n).normalize();for(var o=0,a=s.vertexNormals.length;o<a;o++)s.vertexNormals[o].applyMatrix3(n).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return Yi.makeRotationX(e),this.applyMatrix4(Yi),this},rotateY:function(e){return Yi.makeRotationY(e),this.applyMatrix4(Yi),this},rotateZ:function(e){return Yi.makeRotationZ(e),this.applyMatrix4(Yi),this},translate:function(e,n,t){return Yi.makeTranslation(e,n,t),this.applyMatrix4(Yi),this},scale:function(e,n,t){return Yi.makeScale(e,n,t),this.applyMatrix4(Yi),this},lookAt:function(e){return Hf.lookAt(e),Hf.updateMatrix(),this.applyMatrix4(Hf.matrix),this},fromBufferGeometry:function(e){var n=this,t=e.index!==null?e.index.array:void 0,i=e.attributes;if(i.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var r=i.position.array,s=i.normal!==void 0?i.normal.array:void 0,o=i.color!==void 0?i.color.array:void 0,a=i.uv!==void 0?i.uv.array:void 0,l=i.uv2!==void 0?i.uv2.array:void 0;l!==void 0&&(this.faceVertexUvs[1]=[]);for(var c=0;c<r.length;c+=3)n.vertices.push(new B().fromArray(r,c)),o!==void 0&&n.colors.push(new Ye().fromArray(o,c));function h(y,b,A,w){var x=o===void 0?[]:[n.colors[y].clone(),n.colors[b].clone(),n.colors[A].clone()],M=s===void 0?[]:[new B().fromArray(s,y*3),new B().fromArray(s,b*3),new B().fromArray(s,A*3)],E=new Th(y,b,A,M,x,w);n.faces.push(E),a!==void 0&&n.faceVertexUvs[0].push([new ge().fromArray(a,y*2),new ge().fromArray(a,b*2),new ge().fromArray(a,A*2)]),l!==void 0&&n.faceVertexUvs[1].push([new ge().fromArray(l,y*2),new ge().fromArray(l,b*2),new ge().fromArray(l,A*2)])}var u=e.groups;if(u.length>0)for(var c=0;c<u.length;c++)for(var d=u[c],f=d.start,m=d.count,p=f,g=f+m;p<g;p+=3)t!==void 0?h(t[p],t[p+1],t[p+2],d.materialIndex):h(p,p+1,p+2,d.materialIndex);else if(t!==void 0)for(var c=0;c<t.length;c+=3)h(t[c],t[c+1],t[c+2]);else for(var c=0;c<r.length/3;c+=3)h(c,c+1,c+2);return this.computeFaceNormals(),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(zh).negate(),this.translate(zh.x,zh.y,zh.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,n=this.boundingSphere.radius,t=n===0?1:1/n,i=new Ct;return i.set(t,0,0,-t*e.x,0,t,0,-t*e.y,0,0,t,-t*e.z,0,0,0,1),this.applyMatrix4(i),this},computeFaceNormals:function(){for(var e=new B,n=new B,t=0,i=this.faces.length;t<i;t++){var r=this.faces[t],s=this.vertices[r.a],o=this.vertices[r.b],a=this.vertices[r.c];e.subVectors(a,o),n.subVectors(s,o),e.cross(n),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){e===void 0&&(e=!0);var n,t,i,r,s,o;for(o=new Array(this.vertices.length),n=0,t=this.vertices.length;n<t;n++)o[n]=new B;if(e){var a,l,c,h=new B,u=new B;for(i=0,r=this.faces.length;i<r;i++)s=this.faces[i],a=this.vertices[s.a],l=this.vertices[s.b],c=this.vertices[s.c],h.subVectors(c,l),u.subVectors(a,l),h.cross(u),o[s.a].add(h),o[s.b].add(h),o[s.c].add(h)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)s=this.faces[i],o[s.a].add(s.normal),o[s.b].add(s.normal),o[s.c].add(s.normal);for(n=0,t=this.vertices.length;n<t;n++)o[n].normalize();for(i=0,r=this.faces.length;i<r;i++){s=this.faces[i];var d=s.vertexNormals;d.length===3?(d[0].copy(o[s.a]),d[1].copy(o[s.b]),d[2].copy(o[s.c])):(d[0]=o[s.a].clone(),d[1]=o[s.b].clone(),d[2]=o[s.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,n,t;for(this.computeFaceNormals(),e=0,n=this.faces.length;e<n;e++){t=this.faces[e];var i=t.vertexNormals;i.length===3?(i[0].copy(t.normal),i[1].copy(t.normal),i[2].copy(t.normal)):(i[0]=t.normal.clone(),i[1]=t.normal.clone(),i[2]=t.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,n,t,i,r;for(t=0,i=this.faces.length;t<i;t++)for(r=this.faces[t],r.__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,n=r.vertexNormals.length;e<n;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var s=new mt;for(s.faces=this.faces,e=0,n=this.morphTargets.length;e<n;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,a=this.morphNormals[e].vertexNormals,c,h;for(t=0,i=this.faces.length;t<i;t++)c=new B,h={a:new B,b:new B,c:new B},o.push(c),a.push(h)}var l=this.morphNormals[e];s.vertices=this.morphTargets[e].vertices,s.computeFaceNormals(),s.computeVertexNormals();var c,h;for(t=0,i=this.faces.length;t<i;t++)r=this.faces[t],c=l.faceNormals[t],h=l.vertexNormals[t],c.copy(r.normal),h.a.copy(r.vertexNormals[0]),h.b.copy(r.vertexNormals[1]),h.c.copy(r.vertexNormals[2])}for(t=0,i=this.faces.length;t<i;t++)r=this.faces[t],r.normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new fi),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new Ui),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,n,t){if(!(e&&e.isGeometry)){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);return}var i,r=this.vertices.length,s=this.vertices,o=e.vertices,a=this.faces,l=e.faces,c=this.colors,h=e.colors;t===void 0&&(t=0),n!==void 0&&(i=new Un().getNormalMatrix(n));for(var u=0,d=o.length;u<d;u++){var f=o[u],m=f.clone();n!==void 0&&m.applyMatrix4(n),s.push(m)}for(var u=0,d=h.length;u<d;u++)c.push(h[u].clone());for(u=0,d=l.length;u<d;u++){var p=l[u],g,y,b,A=p.vertexNormals,w=p.vertexColors;g=new Th(p.a+r,p.b+r,p.c+r),g.normal.copy(p.normal),i!==void 0&&g.normal.applyMatrix3(i).normalize();for(var x=0,M=A.length;x<M;x++)y=A[x].clone(),i!==void 0&&y.applyMatrix3(i).normalize(),g.vertexNormals.push(y);g.color.copy(p.color);for(var x=0,M=w.length;x<M;x++)b=w[x],g.vertexColors.push(b.clone());g.materialIndex=p.materialIndex+t,a.push(g)}for(var u=0,d=e.faceVertexUvs.length;u<d;u++){var E=e.faceVertexUvs[u];this.faceVertexUvs[u]===void 0&&(this.faceVertexUvs[u]=[]);for(var x=0,M=E.length;x<M;x++){for(var S=E[x],T=[],z=0,D=S.length;z<D;z++)T.push(S[z].clone());this.faceVertexUvs[u].push(T)}}},mergeMesh:function(e){if(!(e&&e.isMesh)){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e);return}e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)},mergeVertices:function(){var e={},n=[],t=[],i,r,s=4,o=Math.pow(10,s),a,l,c,h,u,d;for(a=0,l=this.vertices.length;a<l;a++)i=this.vertices[a],r=Math.round(i.x*o)+"_"+Math.round(i.y*o)+"_"+Math.round(i.z*o),e[r]===void 0?(e[r]=a,n.push(this.vertices[a]),t[a]=n.length-1):t[a]=t[e[r]];var f=[];for(a=0,l=this.faces.length;a<l;a++){c=this.faces[a],c.a=t[c.a],c.b=t[c.b],c.c=t[c.c],h=[c.a,c.b,c.c];for(var m=0;m<3;m++)if(h[m]===h[(m+1)%3]){f.push(a);break}}for(a=f.length-1;a>=0;a--){var p=f[a];for(this.faces.splice(p,1),u=0,d=this.faceVertexUvs.length;u<d;u++)this.faceVertexUvs[u].splice(p,1)}var g=this.vertices.length-n.length;return this.vertices=n,g},setFromPoints:function(e){this.vertices=[];for(var n=0,t=e.length;n<t;n++){var i=e[n];this.vertices.push(new B(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,n=e.length,t=0;t<n;t++)e[t]._id=t;function i(c,h){return c.materialIndex-h.materialIndex}e.sort(i);var r=this.faceVertexUvs[0],s=this.faceVertexUvs[1],o,a;r&&r.length===n&&(o=[]),s&&s.length===n&&(a=[]);for(var t=0;t<n;t++){var l=e[t]._id;o&&o.push(r[l]),a&&a.push(s[l])}o&&(this.faceVertexUvs[0]=o),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),this.parameters!==void 0){var n=this.parameters;for(var t in n)n[t]!==void 0&&(e[t]=n[t]);return e}for(var i=[],r=0;r<this.vertices.length;r++){var s=this.vertices[r];i.push(s.x,s.y,s.z)}for(var o=[],a=[],l={},c=[],h={},u=[],d={},r=0;r<this.faces.length;r++){var f=this.faces[r],m=!0,p=!1,g=this.faceVertexUvs[0][r]!==void 0,y=f.normal.length()>0,b=f.vertexNormals.length>0,A=f.color.r!==1||f.color.g!==1||f.color.b!==1,w=f.vertexColors.length>0,x=0;if(x=T(x,0,0),x=T(x,1,m),x=T(x,2,p),x=T(x,3,g),x=T(x,4,y),x=T(x,5,b),x=T(x,6,A),x=T(x,7,w),o.push(x),o.push(f.a,f.b,f.c),o.push(f.materialIndex),g){var M=this.faceVertexUvs[0][r];o.push(k(M[0]),k(M[1]),k(M[2]))}if(y&&o.push(z(f.normal)),b){var E=f.vertexNormals;o.push(z(E[0]),z(E[1]),z(E[2]))}if(A&&o.push(D(f.color)),w){var S=f.vertexColors;o.push(D(S[0]),D(S[1]),D(S[2]))}}function T(R,G,I){return I?R|1<<G:R&~(1<<G)}function z(R){var G=R.x.toString()+R.y.toString()+R.z.toString();return l[G]!==void 0||(l[G]=a.length/3,a.push(R.x,R.y,R.z)),l[G]}function D(R){var G=R.r.toString()+R.g.toString()+R.b.toString();return h[G]!==void 0||(h[G]=c.length,c.push(R.getHex())),h[G]}function k(R){var G=R.x.toString()+R.y.toString();return d[G]!==void 0||(d[G]=u.length/2,u.push(R.x,R.y)),d[G]}return e.data={},e.data.vertices=i,e.data.normals=a,c.length>0&&(e.data.colors=c),u.length>0&&(e.data.uvs=[u]),e.data.faces=o,e},clone:function(){return new mt().copy(this)},copy:function(e){var n,t,i,r,s,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var a=e.vertices;for(n=0,t=a.length;n<t;n++)this.vertices.push(a[n].clone());var l=e.colors;for(n=0,t=l.length;n<t;n++)this.colors.push(l[n].clone());var c=e.faces;for(n=0,t=c.length;n<t;n++)this.faces.push(c[n].clone());for(n=0,t=e.faceVertexUvs.length;n<t;n++){var h=e.faceVertexUvs[n];for(this.faceVertexUvs[n]===void 0&&(this.faceVertexUvs[n]=[]),i=0,r=h.length;i<r;i++){var u=h[i],d=[];for(s=0,o=u.length;s<o;s++){var f=u[s];d.push(f.clone())}this.faceVertexUvs[n].push(d)}}var m=e.morphTargets;for(n=0,t=m.length;n<t;n++){var p={};if(p.name=m[n].name,m[n].vertices!==void 0)for(p.vertices=[],i=0,r=m[n].vertices.length;i<r;i++)p.vertices.push(m[n].vertices[i].clone());if(m[n].normals!==void 0)for(p.normals=[],i=0,r=m[n].normals.length;i<r;i++)p.normals.push(m[n].normals[i].clone());this.morphTargets.push(p)}var g=e.morphNormals;for(n=0,t=g.length;n<t;n++){var y={};if(g[n].vertexNormals!==void 0)for(y.vertexNormals=[],i=0,r=g[n].vertexNormals.length;i<r;i++){var b=g[n].vertexNormals[i],A={};A.a=b.a.clone(),A.b=b.b.clone(),A.c=b.c.clone(),y.vertexNormals.push(A)}if(g[n].faceNormals!==void 0)for(y.faceNormals=[],i=0,r=g[n].faceNormals.length;i<r;i++)y.faceNormals.push(g[n].faceNormals[i].clone());this.morphNormals.push(y)}var w=e.skinWeights;for(n=0,t=w.length;n<t;n++)this.skinWeights.push(w[n].clone());var x=e.skinIndices;for(n=0,t=x.length;n<t;n++)this.skinIndices.push(x[n].clone());var M=e.lineDistances;for(n=0,t=M.length;n<t;n++)this.lineDistances.push(M[n]);var E=e.boundingBox;E!==null&&(this.boundingBox=E.clone());var S=e.boundingSphere;return S!==null&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class GE extends mt{constructor(n,t,i,r,s,o){super(),this.type="BoxGeometry",this.parameters={width:n,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o},this.fromBufferGeometry(new Bh(n,t,i,r,s,o)),this.mergeVertices()}}class Bh extends Xe{constructor(n,t,i,r,s,o){super(),this.type="BoxBufferGeometry",this.parameters={width:n,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;n=n||1,t=t||1,i=i||1,r=Math.floor(r)||1,s=Math.floor(s)||1,o=Math.floor(o)||1;const l=[],c=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,i,t,n,o,s,0),m("z","y","x",1,-1,i,t,-n,o,s,1),m("x","z","y",1,1,n,i,t,r,o,2),m("x","z","y",1,-1,n,i,-t,r,o,3),m("x","y","z",1,-1,n,t,i,r,s,4),m("x","y","z",-1,-1,n,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Be(c,3)),this.setAttribute("normal",new Be(h,3)),this.setAttribute("uv",new Be(u,2));function m(p,g,y,b,A,w,x,M,E,S,T){const z=w/E,D=x/S,k=w/2,R=x/2,G=M/2,I=E+1,U=S+1;let J=0,K=0;const ne=new B;for(let ie=0;ie<U;ie++){const pe=ie*D-R;for(let be=0;be<I;be++){const Ae=be*z-k;ne[p]=Ae*b,ne[g]=pe*A,ne[y]=G,c.push(ne.x,ne.y,ne.z),ne[p]=0,ne[g]=0,ne[y]=M>0?1:-1,h.push(ne.x,ne.y,ne.z),u.push(be/E),u.push(1-ie/S),J+=1}}for(let ie=0;ie<S;ie++)for(let pe=0;pe<E;pe++){const be=d+pe+I*ie,Ae=d+pe+I*(ie+1),Je=d+(pe+1)+I*(ie+1),we=d+(pe+1)+I*ie;l.push(be,Ae,we),l.push(Ae,Je,we),K+=6}a.addGroup(f,K,T),f+=K,d+=J}}}function Fo(e){var n={};for(var t in e){n[t]={};for(var i in e[t]){var r=e[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?n[t][i]=r.clone():Array.isArray(r)?n[t][i]=r.slice():n[t][i]=r}}return n}function Bn(e){for(var n={},t=0;t<e.length;t++){var i=Fo(e[t]);for(var r in i)n[r]=i[r]}return n}var jE={clone:Fo,merge:Bn},HE=`void main() {
|
|
101
|
+
`;let SC=class extends EC{constructor(t){super();v(this,"configs");v(this,"clientWidth");v(this,"clientHeight");v(this,"ready",!1);v(this,"uuid",wn());v(this,"tween");v(this,"tweening",!1);v(this,"container");v(this,"canvas");v(this,"data",{});v(this,"tempLine",{});this.configs=t,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const t=document.createElement("div");t.id="_gl_paintBrush",document.body.appendChild(t),this.container=t}return this.container.innerHTML=_C,this.container}initCanvas(t){const i=document.createElement("canvas");i.className=t,i.width=this.clientWidth,i.height=this.clientHeight;const r=i.getContext("2d");if(r)return r.lineWidth=5*this.dpr,r.lineCap="round",r.lineJoin="round",this.container.appendChild(i),i}initCtrl(){const t=document.createElement("div");t.className="_paintBrush-ctrl";const i=document.createElement("div");i.className="_paintBrush-ctrlinner";const r=document.createElement("a");r.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",r.addEventListener("click",a=>{var d;if(a.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const l=this.data[this.uuid].pop();l&&this.emitStateChange({type:mr.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(d=this.canvas[this.uuid])==null?void 0:d.getContext("2d");if(!this.canvas[this.uuid])return;const{width:h,height:u}=this.canvas[this.uuid];c&&c.clearRect(0,0,h,u),this.data[this.uuid].forEach(f=>this.handleDrawLine(this.uuid,f,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[r,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),i.appendChild(r),i.appendChild(s),t.appendChild(i),this.container.appendChild(t),t}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const t=this.canvas[this.uuid];t.getContext("2d").clearRect(0,0,t.width,t.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){this.ready&&(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(t=>{this.canvas[t].ontouchstart=()=>!1,this.canvas[t].ontouchmove=()=>!1,this.canvas[t].ontouchend=()=>!1,this.canvas[t].ontouchcancel=()=>!1;const i=this.canvas[t].getContext("2d");i&&i.clearRect(0,0,this.canvas[t].width,this.canvas[t].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:mr.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(t){const i=this.canvas[this.uuid];if(!i)return;const r=i.getContext("2d");r&&(this.configs.currentColor=t,r.strokeStyle=t)}openBrushHandle(){const t=this.canvas[this.uuid];if(!t)return;const i=t.getContext("2d");if(!i)return;const r=this.color||"#6D92FF";i.strokeStyle=r;let s=null,o=[],a,l=[],c=0;const h=(u,d,f)=>{const m=this.color||"#ff0000";i.strokeStyle=m,i.beginPath(),i.moveTo(u.x,u.y),i.quadraticCurveTo(d.x,d.y,f.x,f.y),i.stroke()};t.onmousedown=u=>{u.preventDefault(),c=Date.now();const d=u.clientX,f=u.clientY;o=[],o.push({x:d,y:f}),s={x:d,y:f},a=$c({x:d,y:f},this.clientWidth,this.clientHeight),l=[]},t.onmousemove=u=>{if(u.preventDefault(),!s)return;const d=Number(u.clientX),f=Number(u.clientY);if(Math.abs(d-s.x)<5&&Math.abs(f-s.y)<5||(o.push({x:d,y:f}),l.push($c({x:d,y:f},this.clientWidth,this.clientHeight)),o.length<3))return;const{control:m,end:p}=eh(o);!m||!p||(h(s,m,p),s=p)},t.onmouseup=u=>{if(u.preventDefault(),s=null,o.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,f={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(f),th(()=>{this.emitStateChange({type:mr.Drawline,color:this.color,ready:this.ready,state:f,uuid:this.uuid})})},t.ontouchstart=u=>{u.preventDefault(),c=Date.now();const d=u.touches[0].clientX,f=u.touches[0].clientY;o=[],o.push({x:d,y:f}),s={x:d,y:f},a=$c({x:d,y:f},this.clientWidth,this.clientHeight),l=[]},t.ontouchmove=u=>{if(u.preventDefault(),!s)return;const d=Number(u.touches[0].clientX),f=Number(u.touches[0].clientY);if(Math.abs(d-s.x)<5&&Math.abs(f-s.y)<5||(o.push({x:d,y:f}),l.push($c({x:d,y:f},this.clientWidth,this.clientHeight)),o.length<3))return;const{control:m,end:p}=eh(o);!m||!p||(h(s,m,p),s=p)},t.ontouchend=t.ontouchcancel=u=>{if(u.preventDefault(),s=null,o.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,f={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(f),th(()=>{this.emitStateChange({type:mr.Drawline,color:this.color,ready:this.ready,state:f,uuid:this.uuid})})}}emitStateChange(t,i=!0){if(t.type!==mr.Drawline){this.emit("stateChange",t,i);return}const r=Date.now(),s=t.state;if(!s||!s.line)return;const o=Math.ceil(s.line.length/100);for(let a=0;a<o;a++){const l={uuid:this.uuid,color:this.color,ready:this.ready,type:t.type,state:{uuid:this.uuid,move:s.move,duration:s.duration,color:this.color,line:s.line.slice(a*100,(a+1)*100)},timestamp:r,end:a===o-1};gC(a,20,()=>{this.emit("stateChange",l,i)})}}action(t){const{ready:i,type:r,uuid:s}=t;if(!i&&this.ready){this.closeBrush();return}if(i&&!this.ready){this.openBrush();return}if(this.ready)switch(r){case mr.Drawline:const{state:o,timestamp:a,end:l}=t;if(!a||!o)return;this.tempLine[a]=[].concat(this.tempLine[a]||[],o.line),l&&(Object.assign(o,{line:this.tempLine[a]}),this.handleDrawLine(s,o,{},()=>delete this.tempLine[a]));break;case mr.Undo:this.handleUndo(s);break}}handleDrawLine(t,i,{withUndo:r=!1},s=mv){!i||Object.prototype.toString.call(i)!="[object Object]"||Object.keys(i).length===0||mC(()=>new Promise(o=>{if(r||(this.canvas[t]||(this.canvas[t]=this.initCanvas("_paintBrush-canvas--sync")),this.data[t]||(this.data[t]=[]),this.data[t].push(i)),!this.canvas[t])return;const a=this.canvas[t].getContext("2d");if(!a)return;const{line:l=[],color:c="black",duration:h=0,uuid:u}=i,d=Zd(i.move||{},this.clientWidth,this.clientHeight);let f=[d];if(a.strokeStyle=c,a.beginPath(),a.moveTo(d.x,d.y),h&&!r){let m=[];const p=this;p.tween=CC({step:0},{step:l.length-1},h).onUpdate(({step:g})=>{var b;if(p.tweening=!0,!p.ready)return a.clearRect(0,0,p.canvas[u].width,p.canvas[u].height),(b=p.tween)==null?void 0:b.stop();const y=Math.floor(g);if(!m.find(A=>A===y)){if(m.push(y),f.push(Zd(l[y],p.clientWidth,p.clientHeight)),f.length<3)return;const{control:A,end:w}=eh(f);if(!A||!w)return;a.quadraticCurveTo(A.x,A.y,w.x,w.y),a.stroke()}}).onComplete(g=>{p.tween=void 0,p.tweening=!1,m=[],f=[],s&&s(),o()})}else{for(let m=0;m<l.length;m++){if(f.push(Zd(l[m],this.clientWidth,this.clientHeight)),f.length<3)continue;const{control:p,end:g}=eh(f);!p||!g||a.quadraticCurveTo(p.x,p.y,g.x,g.y)}a.stroke(),f=[],s&&s(),o()}}))}handleUndo(t){if(!this.canvas[t]||!this.data[t]||this.data[t].length===0)return;this.data[t].pop();const i=()=>{var s;const r=(s=this.canvas[t])==null?void 0:s.getContext("2d");r&&r.clearRect(0,0,this.canvas[t].width,this.canvas[t].height),this.data[t].forEach(o=>this.handleDrawLine(t,o,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),th(i,60);return}i()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}};class IC{constructor(n={}){v(this,"controller");const t=Object.assign({currentColor:"#f44336",onUndoText:"回退",onExitText:"关闭"},n);this.controller=new SC(t)}on(n,t){this.controller.on(n,t)}off(n,t){this.controller.off(n,t)}once(n,t){this.controller.once(n,t)}show(){this.controller.openBrush()}action(n){this.controller.action(n)}get state(){return this.controller.state}get configs(){return this.controller.configs}dispose(){return this.controller.destroyBrush()}setCurrentColor(n){this.controller.updateCurrentColor(n)}}const TC=(e,n)=>{var k,R;let t=(R=(k=n==null?void 0:n.initialState)==null?void 0:k.enabled)!=null?R:!0,i=!1,r=!0,s=null;const a=O(O({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),n==null?void 0:n.config),l=new C.Scene,c=new Zt.Camera(60);let h=new C.Object3D,u,d;{const G=new C.DirectionalLight(16777215,.5);G.position.copy(new C.Vector3(1,1,1)),l.add(G)}{const G=new C.DirectionalLight(16777215,.3);l.add(G)}{const G=new C.AmbientLight(16777215,.3);l.add(G)}l.add(h);const f=()=>{if(i)return;u=x(e.model,c.fov,c.aspect),d=e.model.bounding.getCenter(new C.Vector3),l.remove(h),h=I(e.model),l.add(h),i=!0,E();function G(U){const J=U.clone();return J.uniforms.modelAlpha.value=1,J.uniforms.map.value&&(J.uniforms.map.value.needsUpdate=!0),J}function I(U){if(U instanceof C.Mesh){const J=U.geometry,K=Array.isArray(U.material)?U.material.map(G):G(U.material);return new C.Mesh(J,K)}else if(U instanceof C.Group){const J=new C.Group;return U.children.forEach(K=>J.add(I(K))),J}else{const J=new C.Object3D;return U.children.forEach(K=>J.add(I(K))),J}}},m=()=>{if(e.renderer)return s||(s=new C.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(e.renderer.getPixelRatio()),s.outputEncoding=C.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},p=()=>{h.traverse(G=>{G instanceof C.Mesh&&[].concat(G.material).forEach(U=>U.dispose())}),l.remove(h),h=new C.Object3D,l.add(h),i=!1,E()},g=()=>{t&&(i||f())},y=()=>{t||(t=!0,l.add(h),!i&&e.model.loaded&&f(),E())},b=()=>{t&&(l.remove(h),r=!0,S(),t=!1)},A=(G,I={})=>{const U=m();if(!U)return;G.appendChild(U.domElement),w(I);const J=window.getComputedStyle(G).position;J!=="relative"&&J!=="absolute"&&J!=="fixed"&&J!=="sticky"&&(G.style.position="relative")},w=(G={})=>{if(!s)return;const U=s.domElement.parentNode;if(U!=null&&U.nodeName){const{width:J=U.offsetWidth,height:K=U.offsetHeight}=G;s.setSize(J,K),c.aspect=J/K,c.updateProjectionMatrix()}E()};function x(G,I,U){const J=G.bounding,K=Math.pow(Math.pow(J.max.x-J.min.x+1,2)+Math.pow(J.max.y-J.min.y+1,2)+Math.pow(J.max.z-J.min.z+1,2),1/2);let ne=K/2/Math.tan(Math.PI*I/360);return U<1&&(ne=ne/U),isNaN(ne)?K:ne}function M(G){return e.work.observers[G].standingPosition.clone()}const E=()=>{if(!t||!u||!d)return;const G=e.getPose();G.fov=c.fov,G.offset=d,G.distance=u,typeof a.lockedLatitude=="number"&&(G.latitude=a.lockedLatitude),typeof a.lockedLongitude=="number"&&(G.longitude=a.lockedLongitude),typeof a.lockedPanoIndex=="number"&&(G.offset=M(a.lockedPanoIndex)),a.lookAtCurrentCamera&&(G.offset=e.camera.position.clone().setY(e.camera.position.y+1)),c.setFromPose(G),r=!0},S=()=>{!t||r!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),r=!1)},T=()=>{s&&s.dispose(),s=null},z=G=>{Object.assign(a,G),E()},D=()=>({enabled:t});return Object.assign(window,{camera:c}),e.on("modelLoaded",g),e.on("modelWillLoad",p),e.on("cameraDirectionUpdate",E),e.on("dispose",T),e.on("renderFrame",S),e.on("cameraPositionUpdate",E),{appendTo:A,refresh:w,changeConfigs:z,enable:y,disable:b,getCurrentState:D}},DC=({x:e,y:n,z:t})=>new ee.Vector3(e,n,t),Ur=e=>new ee.Vector3().fromArray(e),zt=e=>{if(e)return e instanceof ee.Vector3?e:Array.isArray(e)?Ur(e):DC(e)};function LC(e){if(e)return Array.isArray(e)?typeof e[0]=="number"?zt(e):e.map(zt):zt(e)}let kC=function(){let e=this,n,t,i,r,s=new ee.Matrix4,o={camera:{fov:0,style:""},objects:new WeakMap},a=document.createElement("div");a.style.overflow="hidden",this.domElement=a;let l=document.createElement("div");l.style.WebkitTransformStyle="preserve-3d",l.style.transformStyle="preserve-3d",l.style.pointerEvents="none",a.appendChild(l),this.getSize=function(){return{width:n,height:t}},this.setSize=function(m,p){n=m,t=p,i=n/2,r=t/2,a.style.width=m+"px",a.style.height=p+"px",l.style.width=m+"px",l.style.height=p+"px"};function c(m){return Math.abs(m)<1e-10?0:m}function h(m){let p=m.elements;return"matrix3d("+c(p[0])+","+c(-p[1])+","+c(p[2])+","+c(p[3])+","+c(p[4])+","+c(-p[5])+","+c(p[6])+","+c(p[7])+","+c(p[8])+","+c(-p[9])+","+c(p[10])+","+c(p[11])+","+c(p[12])+","+c(-p[13])+","+c(p[14])+","+c(p[15])+")"}function u(m,p){let g=m.elements;return"translate(-50%,-50%)"+("matrix3d("+c(g[0])+","+c(g[1])+","+c(g[2])+","+c(g[3])+","+c(-g[4])+","+c(-g[5])+","+c(-g[6])+","+c(-g[7])+","+c(g[8])+","+c(g[9])+","+c(g[10])+","+c(g[11])+","+c(g[12])+","+c(g[13])+","+c(g[14])+","+c(g[15])+")")}function d(m){m.isCSS3DObject&&(m.element.style.display="none");for(let p=0,g=m.children.length;p<g;p++)d(m.children[p])}function f(m,p,g,y){if(m.visible===!1){d(m);return}if(m.isCSS3DObject){const b=m.layers.test(g.layers)===!0,A=m.element;if(A.style.display=b===!0?"":"none",b){m.onBeforeRender(e,p,g);let w;m.isCSS3DSprite?(s.copy(g.matrixWorldInverse),s.transpose(),s.copyPosition(m.matrixWorld),s.scale(m.scale),s.elements[3]=0,s.elements[7]=0,s.elements[11]=0,s.elements[15]=1,w=u(s)):w=u(m.matrixWorld);let x=o.objects.get(m);if(x===void 0||x.style!==w){A.style.WebkitTransform=w,A.style.transform=w;let M={style:w};o.objects.set(m,M)}A.style.display=m.visible?"":"none",A.parentNode!==l&&l.appendChild(A),m.onAfterRender(e,p,g)}}for(let b=0,A=m.children.length;b<A;b++)f(m.children[b],p,g)}this.render=function(m,p){let g=p.projectionMatrix.elements[5]*r;if(o.camera.fov!==g&&(p.isPerspectiveCamera?(a.style.WebkitPerspective=g+"px",a.style.perspective=g+"px"):(a.style.WebkitPerspective="",a.style.perspective=""),o.camera.fov=g),m.autoUpdate===!0&&m.updateMatrixWorld(),p.parent===null&&p.updateMatrixWorld(),p.isOrthographicCamera)var y=-(p.right+p.left)/2,b=(p.top+p.bottom)/2;let w=(p.isOrthographicCamera?"scale("+g+")translate("+c(y)+"px,"+c(b)+"px)"+h(p.matrixWorldInverse):"translateZ("+g+"px)"+h(p.matrixWorldInverse))+"translate("+i+"px,"+r+"px)";o.camera.style!==w&&(l.style.WebkitTransform=w,l.style.transform=w,o.camera.style=w),f(m,m,p)}};function rh(e,n){const t=Math.round(e);return t%2===0?t:t+(n!=null&&n.floor?-1:1)}function OC(e,n,t=!0){if(!e)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const i=()=>{const s=rh(e.clientWidth,{floor:!0}),o=rh(e.clientHeight,{floor:!0});n(s,o)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>i(),unobserve:()=>{}};const r=new ResizeObserver(i);return t&&i(),{observe:()=>r.observe(e),unobserve:()=>r.unobserve(e)}}const RC=kC;class Kd extends RC{constructor(){super();v(this,"wrapper");v(this,"domElementWrapper",document.createElement("div"));v(this,"requestAnimationFrameId");v(this,"resizeDisoper");this.domElementWrapper.classList.add("ICSS3DRendererWrapper"),this.domElementWrapper.style.position="absolute",this.domElementWrapper.style.top="0",this.domElementWrapper.style.left="0",this.domElementWrapper.style.width="100%",this.domElementWrapper.style.height="100%",this.domElementWrapper.style.userSelect="none",this.domElementWrapper.style.pointerEvents="none",this.domElement.classList.add("ICSS3DRenderer"),this.domElement.style.position="absolute",this.domElement.style.top="0",this.domElement.style.left="0",this.domElement.style.userSelect="none",this.domElement.style.pointerEvents="none",this.domElementWrapper.appendChild(this.domElement)}setWrapper(t){if(!t)throw new Error("CSS3DRenderer: wrapper is required");if((()=>{for(let s=0;s<t.children.length;s++)if(t.children.item(s)===this.domElementWrapper)return!0;return!1})())return;const r=this.wrapper;return r&&r.contains(this.domElementWrapper)&&this.domElementWrapper.remove(),this.appendToElement(t),this.wrapper=t,this}appendToElement(t){t.appendChild(this.domElementWrapper);const i=(o,a)=>this.setSize(o,a),{observe:r,unobserve:s}=OC(this.domElementWrapper,i,!0);r(),this.resizeDisoper=s,this.wrapper=t}renderEveryFrame(t,i){if(this.wrapper||console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)",this,t),this.requestAnimationFrameId)return;const r=()=>{this.requestAnimationFrameId=requestAnimationFrame(r),t.visible&&this.render(t,i)};r()}stopRender(){this.requestAnimationFrameId&&cancelAnimationFrame(this.requestAnimationFrameId)}dispose(){var t;this.stopRender(),(t=this.resizeDisoper)==null||t.call(this),this.domElementWrapper.remove()}}function zC(e){return typeof Symbol=="undefined"?`$Symbol<${e}>$`:Symbol(e)}const al=zC("$$EVENT$$");function sh(e){return e[al]||(e[al]={}),e[al]}function BC(e){e[al]&&delete e[al]}class Pn{hasListener(n){const t=sh(this);return!!(t!=null&&t[n]&&t[n].length>0)}on(n,t,i){const r=sh(this);return r[n]||(r[n]=[]),r[n].push([t,i||!1]),()=>this.off(n,t)}once(n,t){return this.on(n,t,!0)}off(n,t){if(n===void 0){BC(this);return}const i=sh(this);if(i[n]||(i[n]=[]),t===void 0){i[n].length=0;return}let r=0;for(;r<i[n].length&&i[n][r][0]!==t;r++);r<i[n].length&&i[n].splice(r,1)}emit(n,...t){let i=!1;const s=sh(this)[n]||[];for(let o of s.slice()){const[a,l=!1]=o,c=a(...t);l&&this.off(n,a),c===!1&&(i=!0)}return i}}class NC extends C.Mesh{constructor(t,i){const r=new C.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:C.DoubleSide}),s=new C.PlaneGeometry(t,i);super(s,r);v(this,"name","opacity-mesh")}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}function Hi(...e){const n=new ee.Vector3;return e.forEach(t=>n.add(t)),n.divideScalar(e.length),n}const $d=e=>e?e.visible===!1?!1:$d(e.parent):!0;class ef{constructor(n=0,t=0){v(this,"min");v(this,"max");v(this,"isInterval",!0);this.min=n,this.max=t}fromArray(n){return this.min=n[0],this.max=n[1],this}isOverlap(n){return Math.min(this.max,n.max)<Math.max(this.min,n.min)}contains(n){return this.min<n.min&&this.max>n.max}}let FC=class{constructor(n,t){v(this,"min");v(this,"max");v(this,"xInterval");v(this,"yInterval");v(this,"isRectangle",!0);this.min=n,this.max=t,this.xInterval=new ef(this.min.x,this.max.x),this.yInterval=new ef(this.min.y,this.max.y)}isOverlapWithRectangle(n){return!this.xInterval.isOverlap(n.xInterval)&&!this.yInterval.isOverlap(n.yInterval)}containsRect(n){return this.xInterval.contains(n.xInterval)&&this.yInterval.contains(n.yInterval)}};function VC(e){e.sort(function(i,r){return i.x!=r.x?i.x-r.x:i.y-r.y});const n=e.length,t=[];for(let i=0;i<2*n;i++){const r=i<n?i:2*n-1-i;for(;t.length>=2&&GC(t[t.length-2],t[t.length-1],e[r]);)t.pop();t.push(e[r])}return t.pop(),t}function GC(e,n,t){const i=(e.x-n.x)*(t.y-n.y)-(e.y-n.y)*(t.x-n.x),r=(e.x-n.x)*(t.x-n.x)+(e.y-n.y)*(t.y-n.y);return i<0||i==0&&r<=0}function xv(e,n){const t=e[0],i=e[1];let r=!1;for(let s=0,o=n.length-1;s<n.length;o=s++){const a=n[s][0],l=n[s][1],c=n[o][0],h=n[o][1];l>i!=h>i&&t<(c-a)*(i-l)/(h-l)+a&&(r=!r)}return r}function tf(e,n,t){const{x:i,y:r,z:s}=n.clone().project(e);return s>1?void 0:{leftPx:(i+1)/2*t.x,topPx:(-r+1)/2*t.y}}function Mi(e){var t;return((t=e.models)==null?void 0:t.filter(i=>i.name===e.state.workCode)[0])||e.model}class Mv extends Pn{constructor(t){super();v(this,"five");this.five=t}}const ll=(e,n)=>{if(!n)return e;const t=new C.Vector3,i=new C.Quaternion,r=new C.Vector3;return n.decompose(t,i,r),e.clone().multiply(r).applyQuaternion(i).add(t)},nf=new Map;class jC extends Mv{constructor(t){super(t);v(this,"_workCode")}get fromType(){var r,s;const t=this.workCode;if(nf.has(t))return nf.get(t);const i=(s=(r=JSON.parse(this.work.raw.works[0]))==null?void 0:r.from_type)!=null?s:"vr";return nf.set(t,i),i}set workCode(t){this._workCode=t}get workCode(){var t;return(t=this._workCode)!=null?t:this.five.state.workCode}get work(){var t,i;return(i=(t=this.five.works)==null?void 0:t.find(r=>r.workCode===this.workCode))!=null?i:this.five.work}get observers(){var t;return(t=this.work)==null?void 0:t.observers}get transform(){var i,r,s,o;const t=(o=(i=this.work)==null?void 0:i.transform)!=null?o:(s=(r=this.work)==null?void 0:r.options)==null?void 0:s.transform;return t?t.clone():new C.Matrix4}getObserverPosition(t){var r;const i=(r=this.getObserver(t))==null?void 0:r.position;if(i)return ll(i,this.transform)}getObserverStandingPosition(t){var r;const i=(r=this.getObserver(t))==null?void 0:r.standingPosition;if(i)return ll(i,this.transform)}getObserver(t){var i;return(i=this.observers)==null?void 0:i[t]}}class oh extends Mv{constructor(t){super(t);v(this,"workUtil",new jC(this.five))}get version(){return this.five.constructor.version}get majorVersion(){return Number(this.version.split(".")[0])}get model(){return Mi(this.five)}moveToPano(t,i){const r=this.majorVersion===5?t:{workCode:this.workUtil.workCode,panoIndex:t};return this.five.moveToPano(r,i)}}const Wr=new C.Raycaster;Wr.params.Points.threshold=.02;function ah(e,n){if(!n||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",e),unobserve:()=>window.removeEventListener("resize",e)};{const t=new ResizeObserver(e);return{observe:()=>t.observe(n),unobserve:()=>t.unobserve(n)}}}const HC=new C.Vector2;class Qr{constructor(n,t,i){v(this,"container");v(this,"visible",!1);v(this,"enabled",!1);v(this,"wrapper");v(this,"positionsForRotate");v(this,"intersectCheck",!0);v(this,"simulate3D",!1);v(this,"tagWrapper");v(this,"five");v(this,"originPosition");v(this,"transformedPosition");v(this,"disposer");v(this,"config");v(this,"fiveUtil");v(this,"disposers",[]);v(this,"onCameraUpdate",()=>{this.visible!==!1&&this.updateScreenPosition()});v(this,"onFiveEveryReady",()=>{var n;if(this.intersectCheck&&this.visible&&this.five.state.mode!=="Panorama"){let t=!1,i=.01;this.fiveUtil.workUtil.fromType==="poincare"&&(i=.05);const r=this.transformedPosition.clone().sub(this.five.camera.position).normalize();Wr.set(this.five.camera.position,r);const s=(n=Mi(this.five).intersectRaycaster(Wr))==null?void 0:n[0];s?t=(s==null?void 0:s.distance)+i>this.transformedPosition.distanceTo(this.five.camera.position):t=!0,t?(this.container.style.opacity="1",this.container.style.pointerEvents="auto"):(this.container.style.opacity="0",this.container.style.pointerEvents="none")}});var r,s,o;this.five=n,this.fiveUtil=(r=n.__fiveUtil__)!=null?r:n.__fiveUtil__=new oh(n),this.originPosition=t?zt(t).clone():void 0,this.transformedPosition=(s=this.originPosition)==null?void 0:s.clone(),this.positionsForRotate=(o=i==null?void 0:i.positionsForRotate)==null?void 0:o.map(a=>zt(a).clone()),this.config=i!=null?i:{},this.container=(()=>{const a=document.createElement("div");return a.classList.add("light-tag"),a.style.width="0",a.style.height="0",a.style.position="absolute",a.style.transition="opacity 0.2s linear",a})(),this.enable(),this.show(),this.addResizeListener()}show(){this.visible=!0,this.container.style.opacity="1",this.container.style.pointerEvents="auto",this.onCameraUpdate()}hide(){this.visible=!1,this.container.style.opacity="0",this.container.style.pointerEvents="none"}enable(){var r,s,o,a,l;if(this.enabled)return;this.enabled=!0,this.wrapper=(o=(s=this.config.wrapper)!=null?s:(r=this.five.getElement())==null?void 0:r.parentElement)!=null?o:document.body;const n=`light-tag-wrapper-${(l=(a=this.config)==null?void 0:a.namespace)!=null?l:"default"}`;if(!this.tagWrapper){let c=Array.from(this.wrapper.children).find(h=>h.id===n);if(!c){const h=document.createElement("div");c=h,h.id=n,h.style.position="absolute",h.style.overflow="hidden",h.style.top="0",h.style.left="0",h.style.width="100%",h.style.height="100%",h.style.pointerEvents="none",h.style.zIndex="1",this.wrapper.appendChild(c)}this.tagWrapper=c}this.tagWrapper.appendChild(this.container);let t=!1;const i=()=>{t||(t=!0,this.five.ready().then(()=>{this.onFiveEveryReady(),t=!1}))};this.five.on("cameraUpdate",i),this.five.on("cameraUpdate",this.onCameraUpdate),this.disposer=()=>{this.five.off("cameraUpdate",i),this.five.off("cameraUpdate",this.onCameraUpdate)}}disable(){var n;this.enabled&&(this.enabled=!1,this.tagWrapper.removeChild(this.container),(n=this.disposer)==null||n.call(this))}destroy(){this.disable(),this.container.remove(),this.disposers.forEach(n=>n())}setTransformMatrix(n){var t;this.transformedPosition=(t=this.originPosition)==null?void 0:t.clone().applyMatrix4(n),this.onCameraUpdate()}setPosition(n,t){this.transformedPosition=zt(n).clone(),this.positionsForRotate=t==null?void 0:t.map(i=>zt(i).clone()),this.onCameraUpdate(),setTimeout(()=>this.onCameraUpdate(),0)}updateScreenPosition(){if(!this.transformedPosition){this.container.style.left="-100%",this.container.style.top="-100%";return}const n=this.five.renderer.getSize(HC),t=tf(this.five.camera,this.transformedPosition,n);if(!t){this.container.style.left="-100%",this.container.style.top="-100%";return}const i=(()=>{if(!this.simulate3D)return 1;const s=2*Math.tan(.5*this.five.camera.fov/180*Math.PI),o=this.transformedPosition.distanceTo(this.five.camera.position);return Math.max(Math.min(1-s*o/40,1),.5)})(),r=(()=>{if(this.positionsForRotate===void 0||this.positionsForRotate.length!==2)return 0;const[s,o]=this.positionsForRotate,a=tf(this.five.camera,s,n),l=tf(this.five.camera,o,n);if(!a||!l)return 0;const c=a.leftPx>l.leftPx?l:a,h=a.leftPx>l.leftPx?a:l,u=h.leftPx-c.leftPx,d=h.topPx-c.topPx;return Math.atan2(d,u)*(180/Math.PI)})();this.container.style.left=t.leftPx+"px",this.container.style.top=t.topPx+"px",this.container.style.transformOrigin="center",this.container.style.transform=`scale(${i})`,r&&(this.container.style.transform+=` rotate(${r}deg)`)}addResizeListener(){const n=this.five.getElement();if(n){const{observe:t,unobserve:i}=ah(this.onCameraUpdate,n);t(),this.disposers.push(i)}}}function Cv(...e){return new Qr(...e)}function Is(e){return e.toLowerCase().includes("panorama")}function Ci(e){return!Is(e)}class lh{constructor(n,t){v(this,"width");v(this,"height");v(this,"containerDom");v(this,"hooks",new Pn);v(this,"canvas",document.createElement("canvas"));v(this,"config");v(this,"state",{enabled:!1});v(this,"five");v(this,"scale");v(this,"offset",{x:0,y:0});v(this,"context");v(this,"renderCenter",new C.Vector3);v(this,"hammer");v(this,"offsetRange");v(this,"isPanning",!1);v(this,"imageData",new ImageData(1,1));v(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});v(this,"onPan",n=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",n))return;const{translateX:i,translateY:r}=this.getPanOffset(n,this.offsetRange);this.canvas.style.transform=`translate3d(${i}px, ${r}px, 100px)`});v(this,"onPanend",n=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:t,translateY:i}=this.getPanOffset(n,this.offsetRange);this.canvas.style.transform=`translate3d(${t}px, ${i}px, 100px)`,this.offset={x:t,y:i}});var r,s,o,a;if(!n.renderer){console.error("Five Render 未初始化");return}this.five=n,this.scale=(r=t==null?void 0:t.scale)!=null?r:2,this.width=(s=t==null?void 0:t.width)!=null?s:190,this.height=(a=(o=t==null?void 0:t.height)!=null?o:t==null?void 0:t.width)!=null?a:190,this.config={dragEnabled:(t==null?void 0:t.dragEnabled)||!1,autoFixPCPosition:(t==null?void 0:t.autoFixPCPosition)||!1,initialPosition:(t==null?void 0:t.initialPosition)||{left:"0",top:"0"}};const i=this.canvas.getContext("2d");if(!i)throw new Error("CANNOT CREATE CONTEXT2D");this.context=i,this.config.dragEnabled&&(this.hammer=new rl(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(this.state.enabled)return this.state.enabled=!1,this.canvas.style.visibility="hidden",this.canvas.remove(),this}dispose(){var n;this.clear(),this.disable(),(n=this.hammer)==null||n.destroy()}appendTo(n){var t;return this.containerDom&&((t=this.containerDom)==null||t.removeChild(this.canvas)),this.containerDom=n,this.state.enabled&&this._appendTo(n),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(n){this.containerDom&&this.state.enabled&&(this.renderCenter=n,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(n){this.containerDom&&this.state.enabled&&(this.renderCenter=n,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform="translate3d(0px, 0px, 100px)"}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:n,context:t,width:i,height:r}=this,s=this.five.renderer.getSize(new C.Vector2),[o,a]=(()=>{if(this.renderCenter instanceof C.Vector3){const p=this.renderCenter.clone().project(this.five.camera);return[(p.x+1)/2*s.x,(p.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=i/n,h=r/n,u=l*n,d=this.five.getPixels(o-c/2,a-c/2,c,h,u),f=Math.floor(i*l),m=Math.floor(r*l);UC(d,f,m),(this.imageData.width!==f||this.imageData.height!==m)&&(this.imageData=new ImageData(f,m)),this.imageData.data.set(d),t.putImageData(this.imageData,0,0),this.canvas.style.visibility="visible"}getRenderCenter(){return this.renderCenter}_appendTo(n){if(this.resetOffset(),n.appendChild(this.canvas),!this.offsetRange){const t=this.canvas.getBoundingClientRect(),i=n.getBoundingClientRect(),r=i.right-t.right,s=i.bottom-t.bottom,o=i.left-t.left,a=i.top-t.top;this.offsetRange={min:{x:o,y:a},max:{x:r,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:n,height:t}=this,{clientWidth:i,clientHeight:r}=this.containerDom,[s,o,a]=(()=>{if(this.renderCenter instanceof C.Vector3){const l=this.renderCenter.clone().project(this.five.camera);return[(l.x+1)/2*i,-(l.x-1)/2*i,-(l.y-1)/2*r]}else return[this.renderCenter.x,i-this.renderCenter.x,this.renderCenter.y]})();s<183?(this.canvas.style.top=-t/2+"px",this.canvas.style.left="90px"):a<183?(this.canvas.style.top="90px",this.canvas.style.left=-n/2+"px"):o<183?(this.canvas.style.top=-t/2+"px",this.canvas.style.left=-n-90+"px"):(this.canvas.style.left=-n/2+"px",this.canvas.style.top=-t-90+"px"),this.canvas.style.transform=`translate3d(${s}px, ${a}px, 10px)`,this.offset={x:s,y:a}}initStyle(){const n=this.canvas;n.classList.add("five-plugin__magnifier"),n.style.position="absolute",n.style.pointerEvents=this.config.dragEnabled?"all":"none",n.style.borderRadius="50%",n.style.zIndex="99";const t=1;n.setAttribute("width",(this.width*t).toString()),n.setAttribute("height",(this.height*t).toString()),n.style.border="2px solid rgba(255,255,255,0.20)",n.style.width=this.width+"px",n.style.height=this.height+"px",n.style.top=this.config.initialPosition.top,n.style.left=this.config.initialPosition.left,n.style.transform="translate(0,0,100px)",n.style.visibility="hidden",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(n,t){const{min:{x:i,y:r},max:{x:s,y:o}}=t,a=this.offset.x+n.deltaX,l=this.offset.y+n.deltaY,c=Math.min(Math.max(a,i),s),h=Math.min(Math.max(l,r),o);return{translateX:c,translateY:h}}}function ch(e,n,t){const i=e[n],r=e[t];i===void 0||r===void 0||(e[n]=r,e[t]=i)}function UC(e,n,t){const i=t/2;for(let r=1;r<=i;r++){const s=t-(r-1);for(let o=1;o<=n;o++){const a=(r-1)*n+o-1,l=(s-1)*n+o-1;ch(e,a*4+0,l*4+0),ch(e,a*4+1,l*4+1),ch(e,a*4+2,l*4+2),ch(e,a*4+3,l*4+3)}}}function WC(e,n){const{offsetWidth:t,offsetHeight:i}=n,{top:r,left:s}=n.getBoundingClientRect();return new C.Vector2().set((e.x-s)/t*2-1,-(e.y-r)/i*2+1)}function QC(e,n){const{offsetWidth:t,offsetHeight:i}=n;return new C.Vector2().set(e.x/t*2-1,-e.y/i*2+1)}const Pv="CSS3DRenderer-dshauidwahdslkadnmsla";function Ev(e){var i;const n=(i=e.getElement())==null?void 0:i.parentElement;if(!n){console.error("initialCSS3DRender: five element is not exist");return}if(document.getElementById(Pv))return;const t=new Kd;t.domElementWrapper.id=Pv,t.domElementWrapper.style.zIndex="1",t.appendToElement(n),t.renderEveryFrame(e.scene,e.camera)}const YC=16777215,_v=16777215,XC=2,bo=.6;class Sv extends Hn.Line{constructor(...n){super(...n)}toJSON(){return{type:"FiveLine",points:this.points.toJSON()}}}class ZC extends Hn.THREE_Line2{constructor(...n){super(...n)}toJSON(){return{type:"Five_THREE_Line2",geometryAttributes:this.geometry.attributes}}}class qC extends Hn.LineMaterial{constructor(...n){super(...n)}toJSON(){return{type:"FiveLineMaterial",color:this.color}}}Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52)),Number.isInteger===void 0&&(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}),Math.sign===void 0&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype||Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),Object.assign===void 0&&(Object.assign=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n=Object(e);for(let t=1;t<arguments.length;t++){const i=arguments[t];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n});const JC="117",KC=0,Iv=1,$C=2,Tv=1,eP=2,cl=3,hl=0,En=1,hh=2,Dv=1,Yr=0,ul=1,Lv=2,kv=3,Ov=4,tP=5,Ao=100,nP=101,iP=102,Rv=103,zv=104,rP=200,sP=201,oP=202,aP=203,Bv=204,Nv=205,lP=206,cP=207,hP=208,uP=209,dP=210,fP=0,pP=1,mP=2,rf=3,gP=4,vP=5,yP=6,bP=7,uh=0,AP=1,wP=2,dl=0,Fv=1,xP=2,MP=3,CP=4,PP=5,sf=300,of=301,af=302,Vv=303,lf=304,Gv=305,fl=306,cf=307,dh=1e3,Jn=1001,fh=1002,mn=1003,hf=1004,uf=1005,zn=1006,jv=1007,ph=1008,pl=1009,EP=1010,_P=1011,mh=1012,SP=1013,gh=1014,Xr=1015,vh=1016,IP=1017,TP=1018,DP=1019,ml=1020,LP=1021,Ts=1022,Pi=1023,kP=1024,OP=1025,RP=Pi,wo=1026,gl=1027,zP=1028,BP=1029,NP=1030,FP=1031,VP=1032,GP=1033,Hv=33776,Uv=33777,Wv=33778,Qv=33779,Yv=35840,Xv=35841,Zv=35842,qv=35843,jP=36196,Jv=37492,Kv=37496,HP=37808,UP=37809,WP=37810,QP=37811,YP=37812,XP=37813,ZP=37814,qP=37815,JP=37816,KP=37817,$P=37818,eE=37819,tE=37820,nE=37821,iE=36492,rE=37840,sE=37841,oE=37842,aE=37843,lE=37844,cE=37845,hE=37846,uE=37847,dE=37848,fE=37849,pE=37850,mE=37851,gE=37852,vE=37853,yE=2200,bE=2201,AE=2202,yh=2300,bh=2301,df=2302,xo=2400,Mo=2401,Ah=2402,ff=2500,$v=2501,wE=0,Kn=3e3,wh=3001,pf=3007,mf=3002,xE=3003,e0=3004,t0=3005,n0=3006,ME=3200,CE=3201,Co=0,PE=1,gf=7680,EE=519,xh=35044,vl=35048;function gr(){}Object.assign(gr.prototype,{addEventListener:function(e,n){this._listeners===void 0&&(this._listeners={});var t=this._listeners;t[e]===void 0&&(t[e]=[]),t[e].indexOf(n)===-1&&t[e].push(n)},hasEventListener:function(e,n){if(this._listeners===void 0)return!1;var t=this._listeners;return t[e]!==void 0&&t[e].indexOf(n)!==-1},removeEventListener:function(e,n){if(this._listeners!==void 0){var t=this._listeners,i=t[e];if(i!==void 0){var r=i.indexOf(n);r!==-1&&i.splice(r,1)}}},dispatchEvent:function(e){if(this._listeners!==void 0){var n=this._listeners,t=n[e.type];if(t!==void 0){e.target=this;for(var i=t.slice(0),r=0,s=i.length;r<s;r++)i[r].call(this,e)}}}});for(var Tn=[],yl=0;yl<256;yl++)Tn[yl]=(yl<16?"0":"")+yl.toString(16);var xt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,r=Tn[e&255]+Tn[e>>8&255]+Tn[e>>16&255]+Tn[e>>24&255]+"-"+Tn[n&255]+Tn[n>>8&255]+"-"+Tn[n>>16&15|64]+Tn[n>>24&255]+"-"+Tn[t&63|128]+Tn[t>>8&255]+"-"+Tn[t>>16&255]+Tn[t>>24&255]+Tn[i&255]+Tn[i>>8&255]+Tn[i>>16&255]+Tn[i>>24&255];return r.toUpperCase()},clamp:function(e,n,t){return Math.max(n,Math.min(t,e))},euclideanModulo:function(e,n){return(e%n+n)%n},mapLinear:function(e,n,t,i,r){return i+(e-n)*(r-i)/(t-n)},lerp:function(e,n,t){return(1-t)*e+t*n},smoothstep:function(e,n,t){return e<=n?0:e>=t?1:(e=(e-n)/(t-n),e*e*(3-2*e))},smootherstep:function(e,n,t){return e<=n?0:e>=t?1:(e=(e-n)/(t-n),e*e*e*(e*(e*6-15)+10))},randInt:function(e,n){return e+Math.floor(Math.random()*(n-e+1))},randFloat:function(e,n){return e+Math.random()*(n-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*xt.DEG2RAD},radToDeg:function(e){return e*xt.RAD2DEG},isPowerOfTwo:function(e){return(e&e-1)===0&&e!==0},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,n,t,i,r){var s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((n+i)/2),h=o((n+i)/2),u=s((n-i)/2),d=o((n-i)/2),f=s((i-n)/2),m=o((i-n)/2);switch(r){case"XYX":e.set(a*h,l*u,l*d,a*c);break;case"YZY":e.set(l*d,a*h,l*u,a*c);break;case"ZXZ":e.set(l*u,l*d,a*h,a*c);break;case"XZX":e.set(a*h,l*m,l*f,a*c);break;case"YXY":e.set(l*f,a*h,l*m,a*c);break;case"ZYZ":e.set(l*m,l*f,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};function ge(e,n){this.x=e||0,this.y=n||0}Object.defineProperties(ge.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(ge.prototype,{isVector2:!0,set:function(e,n){return this.x=e,this.y=n,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,n){return n!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,n)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this},addScaledVector:function(e,n){return this.x+=e.x*n,this.y+=e.y*n,this},sub:function(e,n){return n!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,n)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var n=this.x,t=this.y,i=e.elements;return this.x=i[0]*n+i[3]*t+i[6],this.y=i[1]*n+i[4]*t+i[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this},clampScalar:function(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this},clampLength:function(e,n){var t=this.length();return this.divideScalar(t||1).multiplyScalar(Math.max(e,Math.min(n,t)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var n=this.x-e.x,t=this.y-e.y;return n*n+t*t},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this},lerpVectors:function(e,n,t){return this.x=e.x+(n.x-e.x)*t,this.y=e.y+(n.y-e.y)*t,this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,n){return n===void 0&&(n=0),this.x=e[n],this.y=e[n+1],this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this.x,e[n+1]=this.y,e},fromBufferAttribute:function(e,n,t){return t!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(n),this.y=e.getY(n),this},rotateAround:function(e,n){var t=Math.cos(n),i=Math.sin(n),r=this.x-e.x,s=this.y-e.y;return this.x=r*t-s*i+e.x,this.y=r*i+s*t+e.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}});function Un(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Un.prototype,{isMatrix3:!0,set:function(e,n,t,i,r,s,o,a,l){var c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=n,c[4]=r,c[5]=a,c[6]=t,c[7]=s,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return new this.constructor().fromArray(this.elements)},copy:function(e){var n=this.elements,t=e.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],this},extractBasis:function(e,n,t){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),t.setFromMatrix3Column(this,2),this},setFromMatrix4:function(e){var n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,n){var t=e.elements,i=n.elements,r=this.elements,s=t[0],o=t[3],a=t[6],l=t[1],c=t[4],h=t[7],u=t[2],d=t[5],f=t[8],m=i[0],p=i[3],g=i[6],y=i[1],b=i[4],A=i[7],w=i[2],x=i[5],M=i[8];return r[0]=s*m+o*y+a*w,r[3]=s*p+o*b+a*x,r[6]=s*g+o*A+a*M,r[1]=l*m+c*y+h*w,r[4]=l*p+c*b+h*x,r[7]=l*g+c*A+h*M,r[2]=u*m+d*y+f*w,r[5]=u*p+d*b+f*x,r[8]=u*g+d*A+f*M,this},multiplyScalar:function(e){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this},determinant:function(){var e=this.elements,n=e[0],t=e[1],i=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return n*s*c-n*o*l-t*r*c+t*o*a+i*r*l-i*s*a},getInverse:function(e,n){n!==void 0&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var t=e.elements,i=this.elements,r=t[0],s=t[1],o=t[2],a=t[3],l=t[4],c=t[5],h=t[6],u=t[7],d=t[8],f=d*l-c*u,m=c*h-d*a,p=u*a-l*h,g=r*f+s*m+o*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);var y=1/g;return i[0]=f*y,i[1]=(o*u-d*s)*y,i[2]=(c*s-o*l)*y,i[3]=m*y,i[4]=(d*r-o*h)*y,i[5]=(o*a-c*r)*y,i[6]=p*y,i[7]=(s*h-u*r)*y,i[8]=(l*r-s*a)*y,this},transpose:function(){var e,n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this},setUvTransform:function(e,n,t,i,r,s,o){var a=Math.cos(r),l=Math.sin(r);this.set(t*a,t*l,-t*(a*s+l*o)+s+e,-i*l,i*a,-i*(-l*s+a*o)+o+n,0,0,1)},scale:function(e,n){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=n,t[4]*=n,t[7]*=n,this},rotate:function(e){var n=Math.cos(e),t=Math.sin(e),i=this.elements,r=i[0],s=i[3],o=i[6],a=i[1],l=i[4],c=i[7];return i[0]=n*r+t*a,i[3]=n*s+t*l,i[6]=n*o+t*c,i[1]=-t*r+n*a,i[4]=-t*s+n*l,i[7]=-t*o+n*c,this},translate:function(e,n){var t=this.elements;return t[0]+=e*t[2],t[3]+=e*t[5],t[6]+=e*t[8],t[1]+=n*t[2],t[4]+=n*t[5],t[7]+=n*t[8],this},equals:function(e){for(var n=this.elements,t=e.elements,i=0;i<9;i++)if(n[i]!==t[i])return!1;return!0},fromArray:function(e,n){n===void 0&&(n=0);for(var t=0;t<9;t++)this.elements[t]=e[t+n];return this},toArray:function(e,n){e===void 0&&(e=[]),n===void 0&&(n=0);var t=this.elements;return e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=t[3],e[n+4]=t[4],e[n+5]=t[5],e[n+6]=t[6],e[n+7]=t[7],e[n+8]=t[8],e}});var Po,Ds={getDataURL:function(e){var n;if(typeof HTMLCanvasElement=="undefined")return e.src;if(e instanceof HTMLCanvasElement)n=e;else{Po===void 0&&(Po=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Po.width=e.width,Po.height=e.height;var t=Po.getContext("2d");e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Po}return n.width>2048||n.height>2048?n.toDataURL("image/jpeg",.6):n.toDataURL("image/png")}},_E=0;function Wt(e,n,t,i,r,s,o,a,l,c){Object.defineProperty(this,"id",{value:_E++}),this.uuid=xt.generateUUID(),this.name="",this.image=e!==void 0?e:Wt.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=n!==void 0?n:Wt.DEFAULT_MAPPING,this.wrapS=t!==void 0?t:Jn,this.wrapT=i!==void 0?i:Jn,this.magFilter=r!==void 0?r:zn,this.minFilter=s!==void 0?s:ph,this.anisotropy=l!==void 0?l:1,this.format=o!==void 0?o:Pi,this.internalFormat=null,this.type=a!==void 0?a:pl,this.offset=new ge(0,0),this.repeat=new ge(1,1),this.center=new ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Un,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c!==void 0?c:Kn,this.version=0,this.onUpdate=null}Wt.DEFAULT_IMAGE=void 0,Wt.DEFAULT_MAPPING=sf,Wt.prototype=Object.assign(Object.create(gr.prototype),{constructor:Wt,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];var t={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(this.image!==void 0){var i=this.image;if(i.uuid===void 0&&(i.uuid=xt.generateUUID()),!n&&e.images[i.uuid]===void 0){var r;if(Array.isArray(i)){r=[];for(var s=0,o=i.length;s<o;s++)r.push(Ds.getDataURL(i[s]))}else r=Ds.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}t.image=i.uuid}return n||(e.textures[this.uuid]=t),t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==sf)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case dh:e.x=e.x-Math.floor(e.x);break;case Jn:e.x=e.x<0?0:1;break;case fh:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case dh:e.y=e.y-Math.floor(e.y);break;case Jn:e.y=e.y<0?0:1;break;case fh:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Wt.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}});function Vt(e,n,t,i){this.x=e||0,this.y=n||0,this.z=t||0,this.w=i!==void 0?i:1}Object.defineProperties(Vt.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(Vt.prototype,{isVector4:!0,set:function(e,n,t,i){return this.x=e,this.y=n,this.z=t,this.w=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this},add:function(e,n){return n!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,n)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this},addScaledVector:function(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this},sub:function(e,n){return n!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,n)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var n=this.x,t=this.y,i=this.z,r=this.w,s=e.elements;return this.x=s[0]*n+s[4]*t+s[8]*i+s[12]*r,this.y=s[1]*n+s[5]*t+s[9]*i+s[13]*r,this.z=s[2]*n+s[6]*t+s[10]*i+s[14]*r,this.w=s[3]*n+s[7]*t+s[11]*i+s[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this},setAxisAngleFromRotationMatrix:function(e){var n,t,i,r,s=.01,o=.1,a=e.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],f=a[9],m=a[2],p=a[6],g=a[10];if(Math.abs(c-u)<s&&Math.abs(h-m)<s&&Math.abs(f-p)<s){if(Math.abs(c+u)<o&&Math.abs(h+m)<o&&Math.abs(f+p)<o&&Math.abs(l+d+g-3)<o)return this.set(1,0,0,0),this;n=Math.PI;var y=(l+1)/2,b=(d+1)/2,A=(g+1)/2,w=(c+u)/4,x=(h+m)/4,M=(f+p)/4;return y>b&&y>A?y<s?(t=0,i=.707106781,r=.707106781):(t=Math.sqrt(y),i=w/t,r=x/t):b>A?b<s?(t=.707106781,i=0,r=.707106781):(i=Math.sqrt(b),t=w/i,r=M/i):A<s?(t=.707106781,i=.707106781,r=0):(r=Math.sqrt(A),t=x/r,i=M/r),this.set(t,i,r,n),this}var E=Math.sqrt((p-f)*(p-f)+(h-m)*(h-m)+(u-c)*(u-c));return Math.abs(E)<.001&&(E=1),this.x=(p-f)/E,this.y=(h-m)/E,this.z=(u-c)/E,this.w=Math.acos((l+d+g-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this},clampScalar:function(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this},clampLength:function(e,n){var t=this.length();return this.divideScalar(t||1).multiplyScalar(Math.max(e,Math.min(n,t)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this},lerpVectors:function(e,n,t){return this.x=e.x+(n.x-e.x)*t,this.y=e.y+(n.y-e.y)*t,this.z=e.z+(n.z-e.z)*t,this.w=e.w+(n.w-e.w)*t,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,n){return n===void 0&&(n=0),this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e},fromBufferAttribute:function(e,n,t){return t!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}});function di(e,n,t){this.width=e,this.height=n,this.scissor=new Vt(0,0,e,n),this.scissorTest=!1,this.viewport=new Vt(0,0,e,n),t=t||{},this.texture=new Wt(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=n,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:zn,this.depthBuffer=t.depthBuffer!==void 0?t.depthBuffer:!0,this.stencilBuffer=t.stencilBuffer!==void 0?t.stencilBuffer:!0,this.depthTexture=t.depthTexture!==void 0?t.depthTexture:null}di.prototype=Object.assign(Object.create(gr.prototype),{constructor:di,isWebGLRenderTarget:!0,setSize:function(e,n){(this.width!==e||this.height!==n)&&(this.width=e,this.height=n,this.texture.image.width=e,this.texture.image.height=n,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});function i0(e,n,t){di.call(this,e,n,t),this.samples=4}i0.prototype=Object.assign(Object.create(di.prototype),{constructor:i0,isWebGLMultisampleRenderTarget:!0,copy:function(e){return di.prototype.copy.call(this,e),this.samples=e.samples,this}});function _n(e,n,t,i){this._x=e||0,this._y=n||0,this._z=t||0,this._w=i!==void 0?i:1}Object.assign(_n,{slerp:function(e,n,t,i){return t.copy(e).slerp(n,i)},slerpFlat:function(e,n,t,i,r,s,o){var a=t[i+0],l=t[i+1],c=t[i+2],h=t[i+3],u=r[s+0],d=r[s+1],f=r[s+2],m=r[s+3];if(h!==m||a!==u||l!==d||c!==f){var p=1-o,g=a*u+l*d+c*f+h*m,y=g>=0?1:-1,b=1-g*g;if(b>Number.EPSILON){var A=Math.sqrt(b),w=Math.atan2(A,g*y);p=Math.sin(p*w)/A,o=Math.sin(o*w)/A}var x=o*y;if(a=a*p+u*x,l=l*p+d*x,c=c*p+f*x,h=h*p+m*x,p===1-o){var M=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=M,l*=M,c*=M,h*=M}}e[n]=a,e[n+1]=l,e[n+2]=c,e[n+3]=h},multiplyQuaternionsFlat:function(e,n,t,i,r,s){var o=t[i],a=t[i+1],l=t[i+2],c=t[i+3],h=r[s],u=r[s+1],d=r[s+2],f=r[s+3];return e[n]=o*f+c*h+a*d-l*u,e[n+1]=a*f+c*u+l*h-o*d,e[n+2]=l*f+c*d+o*u-a*h,e[n+3]=c*f-o*h-a*u-l*d,e}}),Object.defineProperties(_n.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(_n.prototype,{isQuaternion:!0,set:function(e,n,t,i){return this._x=e,this._y=n,this._z=t,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,n){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var t=e._x,i=e._y,r=e._z,s=e.order,o=Math.cos,a=Math.sin,l=o(t/2),c=o(i/2),h=o(r/2),u=a(t/2),d=a(i/2),f=a(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*f,this._y=l*d*h-u*c*f,this._z=l*c*f+u*d*h,this._w=l*c*h-u*d*f;break;case"YXZ":this._x=u*c*h+l*d*f,this._y=l*d*h-u*c*f,this._z=l*c*f-u*d*h,this._w=l*c*h+u*d*f;break;case"ZXY":this._x=u*c*h-l*d*f,this._y=l*d*h+u*c*f,this._z=l*c*f+u*d*h,this._w=l*c*h-u*d*f;break;case"ZYX":this._x=u*c*h-l*d*f,this._y=l*d*h+u*c*f,this._z=l*c*f-u*d*h,this._w=l*c*h+u*d*f;break;case"YZX":this._x=u*c*h+l*d*f,this._y=l*d*h+u*c*f,this._z=l*c*f-u*d*h,this._w=l*c*h-u*d*f;break;case"XZY":this._x=u*c*h-l*d*f,this._y=l*d*h-u*c*f,this._z=l*c*f+u*d*h,this._w=l*c*h+u*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n!==!1&&this._onChangeCallback(),this},setFromAxisAngle:function(e,n){var t=n/2,i=Math.sin(t);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(t),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var n=e.elements,t=n[0],i=n[4],r=n[8],s=n[1],o=n[5],a=n[9],l=n[2],c=n[6],h=n[10],u=t+o+h,d;return u>0?(d=.5/Math.sqrt(u+1),this._w=.25/d,this._x=(c-a)*d,this._y=(r-l)*d,this._z=(s-i)*d):t>o&&t>h?(d=2*Math.sqrt(1+t-o-h),this._w=(c-a)/d,this._x=.25*d,this._y=(i+s)/d,this._z=(r+l)/d):o>h?(d=2*Math.sqrt(1+o-t-h),this._w=(r-l)/d,this._x=(i+s)/d,this._y=.25*d,this._z=(a+c)/d):(d=2*Math.sqrt(1+h-t-o),this._w=(s-i)/d,this._x=(r+l)/d,this._y=(a+c)/d,this._z=.25*d),this._onChangeCallback(),this},setFromUnitVectors:function(e,n){var t=1e-6,i=e.dot(n)+1;return i<t?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(xt.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,n){var t=this.angleTo(e);if(t===0)return this;var i=Math.min(1,n/t);return this.slerp(e,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,n){return n!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,n)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,n){var t=e._x,i=e._y,r=e._z,s=e._w,o=n._x,a=n._y,l=n._z,c=n._w;return this._x=t*c+s*o+i*l-r*a,this._y=i*c+s*a+r*o-t*l,this._z=r*c+s*l+t*a-i*o,this._w=s*c-t*o-i*a-r*l,this._onChangeCallback(),this},slerp:function(e,n){if(n===0)return this;if(n===1)return this.copy(e);var t=this._x,i=this._y,r=this._z,s=this._w,o=s*e._w+t*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=t,this._y=i,this._z=r,this;var a=1-o*o;if(a<=Number.EPSILON){var l=1-n;return this._w=l*s+n*this._w,this._x=l*t+n*this._x,this._y=l*i+n*this._y,this._z=l*r+n*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(a),h=Math.atan2(c,o),u=Math.sin((1-n)*h)/c,d=Math.sin(n*h)/c;return this._w=s*u+this._w*d,this._x=t*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,n){return n===void 0&&(n=0),this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e},fromBufferAttribute:function(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var vf=new B,r0=new _n;function B(e,n,t){this.x=e||0,this.y=n||0,this.z=t||0}Object.assign(B.prototype,{isVector3:!0,set:function(e,n,t){return this.x=e,this.y=n,this.z=t,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,n){return n!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,n)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this},addScaledVector:function(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this},sub:function(e,n){return n!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,n)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this},multiply:function(e,n){return n!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,n)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(r0.setFromEuler(e))},applyAxisAngle:function(e,n){return this.applyQuaternion(r0.setFromAxisAngle(e,n))},applyMatrix3:function(e){var n=this.x,t=this.y,i=this.z,r=e.elements;return this.x=r[0]*n+r[3]*t+r[6]*i,this.y=r[1]*n+r[4]*t+r[7]*i,this.z=r[2]*n+r[5]*t+r[8]*i,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var n=this.x,t=this.y,i=this.z,r=e.elements,s=1/(r[3]*n+r[7]*t+r[11]*i+r[15]);return this.x=(r[0]*n+r[4]*t+r[8]*i+r[12])*s,this.y=(r[1]*n+r[5]*t+r[9]*i+r[13])*s,this.z=(r[2]*n+r[6]*t+r[10]*i+r[14])*s,this},applyQuaternion:function(e){var n=this.x,t=this.y,i=this.z,r=e.x,s=e.y,o=e.z,a=e.w,l=a*n+s*i-o*t,c=a*t+o*n-r*i,h=a*i+r*t-s*n,u=-r*n-s*t-o*i;return this.x=l*a+u*-r+c*-o-h*-s,this.y=c*a+u*-s+h*-r-l*-o,this.z=h*a+u*-o+l*-s-c*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var n=this.x,t=this.y,i=this.z,r=e.elements;return this.x=r[0]*n+r[4]*t+r[8]*i,this.y=r[1]*n+r[5]*t+r[9]*i,this.z=r[2]*n+r[6]*t+r[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this},clampScalar:function(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this},clampLength:function(e,n){var t=this.length();return this.divideScalar(t||1).multiplyScalar(Math.max(e,Math.min(n,t)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this},lerpVectors:function(e,n,t){return this.x=e.x+(n.x-e.x)*t,this.y=e.y+(n.y-e.y)*t,this.z=e.z+(n.z-e.z)*t,this},cross:function(e,n){return n!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,n)):this.crossVectors(this,e)},crossVectors:function(e,n){var t=e.x,i=e.y,r=e.z,s=n.x,o=n.y,a=n.z;return this.x=i*a-r*o,this.y=r*s-t*a,this.z=t*o-i*s,this},projectOnVector:function(e){var n=e.lengthSq();if(n===0)return this.set(0,0,0);var t=e.dot(this)/n;return this.copy(e).multiplyScalar(t)},projectOnPlane:function(e){return vf.copy(this).projectOnVector(e),this.sub(vf)},reflect:function(e){return this.sub(vf.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;var t=this.dot(e)/n;return Math.acos(xt.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var n=this.x-e.x,t=this.y-e.y,i=this.z-e.z;return n*n+t*t+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,n,t){var i=Math.sin(n)*e;return this.x=i*Math.sin(t),this.y=Math.cos(n)*e,this.z=i*Math.cos(t),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,n,t){return this.x=e*Math.sin(n),this.y=t,this.z=e*Math.cos(n),this},setFromMatrixPosition:function(e){var n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this},setFromMatrixScale:function(e){var n=this.setFromMatrixColumn(e,0).length(),t=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=t,this.z=i,this},setFromMatrixColumn:function(e,n){return this.fromArray(e.elements,n*4)},setFromMatrix3Column:function(e,n){return this.fromArray(e.elements,n*3)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,n){return n===void 0&&(n=0),this.x=e[n],this.y=e[n+1],this.z=e[n+2],this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e},fromBufferAttribute:function(e,n,t){return t!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var Eo=new B,Ei=new Ct,SE=new B(0,0,0),IE=new B(1,1,1),Zr=new B,Mh=new B,ri=new B;function Ct(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Ct.prototype,{isMatrix4:!0,set:function(e,n,t,i,r,s,o,a,l,c,h,u,d,f,m,p){var g=this.elements;return g[0]=e,g[4]=n,g[8]=t,g[12]=i,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=f,g[11]=m,g[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return new Ct().fromArray(this.elements)},copy:function(e){var n=this.elements,t=e.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],this},copyPosition:function(e){var n=this.elements,t=e.elements;return n[12]=t[12],n[13]=t[13],n[14]=t[14],this},extractBasis:function(e,n,t){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),t.setFromMatrixColumn(this,2),this},makeBasis:function(e,n,t){return this.set(e.x,n.x,t.x,0,e.y,n.y,t.y,0,e.z,n.z,t.z,0,0,0,0,1),this},extractRotation:function(e){var n=this.elements,t=e.elements,i=1/Eo.setFromMatrixColumn(e,0).length(),r=1/Eo.setFromMatrixColumn(e,1).length(),s=1/Eo.setFromMatrixColumn(e,2).length();return n[0]=t[0]*i,n[1]=t[1]*i,n[2]=t[2]*i,n[3]=0,n[4]=t[4]*r,n[5]=t[5]*r,n[6]=t[6]*r,n[7]=0,n[8]=t[8]*s,n[9]=t[9]*s,n[10]=t[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var n=this.elements,t=e.x,i=e.y,r=e.z,s=Math.cos(t),o=Math.sin(t),a=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){var u=s*c,d=s*h,f=o*c,m=o*h;n[0]=a*c,n[4]=-a*h,n[8]=l,n[1]=d+f*l,n[5]=u-m*l,n[9]=-o*a,n[2]=m-u*l,n[6]=f+d*l,n[10]=s*a}else if(e.order==="YXZ"){var p=a*c,g=a*h,y=l*c,b=l*h;n[0]=p+b*o,n[4]=y*o-g,n[8]=s*l,n[1]=s*h,n[5]=s*c,n[9]=-o,n[2]=g*o-y,n[6]=b+p*o,n[10]=s*a}else if(e.order==="ZXY"){var p=a*c,g=a*h,y=l*c,b=l*h;n[0]=p-b*o,n[4]=-s*h,n[8]=y+g*o,n[1]=g+y*o,n[5]=s*c,n[9]=b-p*o,n[2]=-s*l,n[6]=o,n[10]=s*a}else if(e.order==="ZYX"){var u=s*c,d=s*h,f=o*c,m=o*h;n[0]=a*c,n[4]=f*l-d,n[8]=u*l+m,n[1]=a*h,n[5]=m*l+u,n[9]=d*l-f,n[2]=-l,n[6]=o*a,n[10]=s*a}else if(e.order==="YZX"){var A=s*a,w=s*l,x=o*a,M=o*l;n[0]=a*c,n[4]=M-A*h,n[8]=x*h+w,n[1]=h,n[5]=s*c,n[9]=-o*c,n[2]=-l*c,n[6]=w*h+x,n[10]=A-M*h}else if(e.order==="XZY"){var A=s*a,w=s*l,x=o*a,M=o*l;n[0]=a*c,n[4]=-h,n[8]=l*c,n[1]=A*h+M,n[5]=s*c,n[9]=w*h-x,n[2]=x*h-w,n[6]=o*c,n[10]=M*h+A}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(SE,e,IE)},lookAt:function(e,n,t){var i=this.elements;return ri.subVectors(e,n),ri.lengthSq()===0&&(ri.z=1),ri.normalize(),Zr.crossVectors(t,ri),Zr.lengthSq()===0&&(Math.abs(t.z)===1?ri.x+=1e-4:ri.z+=1e-4,ri.normalize(),Zr.crossVectors(t,ri)),Zr.normalize(),Mh.crossVectors(ri,Zr),i[0]=Zr.x,i[4]=Mh.x,i[8]=ri.x,i[1]=Zr.y,i[5]=Mh.y,i[9]=ri.y,i[2]=Zr.z,i[6]=Mh.z,i[10]=ri.z,this},multiply:function(e,n){return n!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,n)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,n){var t=e.elements,i=n.elements,r=this.elements,s=t[0],o=t[4],a=t[8],l=t[12],c=t[1],h=t[5],u=t[9],d=t[13],f=t[2],m=t[6],p=t[10],g=t[14],y=t[3],b=t[7],A=t[11],w=t[15],x=i[0],M=i[4],E=i[8],S=i[12],T=i[1],z=i[5],D=i[9],k=i[13],R=i[2],G=i[6],I=i[10],U=i[14],J=i[3],K=i[7],ne=i[11],ie=i[15];return r[0]=s*x+o*T+a*R+l*J,r[4]=s*M+o*z+a*G+l*K,r[8]=s*E+o*D+a*I+l*ne,r[12]=s*S+o*k+a*U+l*ie,r[1]=c*x+h*T+u*R+d*J,r[5]=c*M+h*z+u*G+d*K,r[9]=c*E+h*D+u*I+d*ne,r[13]=c*S+h*k+u*U+d*ie,r[2]=f*x+m*T+p*R+g*J,r[6]=f*M+m*z+p*G+g*K,r[10]=f*E+m*D+p*I+g*ne,r[14]=f*S+m*k+p*U+g*ie,r[3]=y*x+b*T+A*R+w*J,r[7]=y*M+b*z+A*G+w*K,r[11]=y*E+b*D+A*I+w*ne,r[15]=y*S+b*k+A*U+w*ie,this},multiplyScalar:function(e){var n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this},determinant:function(){var e=this.elements,n=e[0],t=e[4],i=e[8],r=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14],f=e[3],m=e[7],p=e[11],g=e[15];return f*(+r*a*h-i*l*h-r*o*u+t*l*u+i*o*d-t*a*d)+m*(+n*a*d-n*l*u+r*s*u-i*s*d+i*l*c-r*a*c)+p*(+n*l*h-n*o*d-r*s*h+t*s*d+r*o*c-t*l*c)+g*(-i*o*c-n*a*h+n*o*u+i*s*h-t*s*u+t*a*c)},transpose:function(){var e=this.elements,n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this},setPosition:function(e,n,t){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=t),this},getInverse:function(e,n){n!==void 0&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var t=this.elements,i=e.elements,r=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],f=i[9],m=i[10],p=i[11],g=i[12],y=i[13],b=i[14],A=i[15],w=f*b*u-y*m*u+y*h*p-c*b*p-f*h*A+c*m*A,x=g*m*u-d*b*u-g*h*p+l*b*p+d*h*A-l*m*A,M=d*y*u-g*f*u+g*c*p-l*y*p-d*c*A+l*f*A,E=g*f*h-d*y*h-g*c*m+l*y*m+d*c*b-l*f*b,S=r*w+s*x+o*M+a*E;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/S;return t[0]=w*T,t[1]=(y*m*a-f*b*a-y*o*p+s*b*p+f*o*A-s*m*A)*T,t[2]=(c*b*a-y*h*a+y*o*u-s*b*u-c*o*A+s*h*A)*T,t[3]=(f*h*a-c*m*a-f*o*u+s*m*u+c*o*p-s*h*p)*T,t[4]=x*T,t[5]=(d*b*a-g*m*a+g*o*p-r*b*p-d*o*A+r*m*A)*T,t[6]=(g*h*a-l*b*a-g*o*u+r*b*u+l*o*A-r*h*A)*T,t[7]=(l*m*a-d*h*a+d*o*u-r*m*u-l*o*p+r*h*p)*T,t[8]=M*T,t[9]=(g*f*a-d*y*a-g*s*p+r*y*p+d*s*A-r*f*A)*T,t[10]=(l*y*a-g*c*a+g*s*u-r*y*u-l*s*A+r*c*A)*T,t[11]=(d*c*a-l*f*a-d*s*u+r*f*u+l*s*p-r*c*p)*T,t[12]=E*T,t[13]=(d*y*o-g*f*o+g*s*m-r*y*m-d*s*b+r*f*b)*T,t[14]=(g*c*o-l*y*o-g*s*h+r*y*h+l*s*b-r*c*b)*T,t[15]=(l*f*o-d*c*o+d*s*h-r*f*h-l*s*m+r*c*m)*T,this},scale:function(e){var n=this.elements,t=e.x,i=e.y,r=e.z;return n[0]*=t,n[4]*=i,n[8]*=r,n[1]*=t,n[5]*=i,n[9]*=r,n[2]*=t,n[6]*=i,n[10]*=r,n[3]*=t,n[7]*=i,n[11]*=r,this},getMaxScaleOnAxis:function(){var e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],t=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,t,i))},makeTranslation:function(e,n,t){return this.set(1,0,0,e,0,1,0,n,0,0,1,t,0,0,0,1),this},makeRotationX:function(e){var n=Math.cos(e),t=Math.sin(e);return this.set(1,0,0,0,0,n,-t,0,0,t,n,0,0,0,0,1),this},makeRotationY:function(e){var n=Math.cos(e),t=Math.sin(e);return this.set(n,0,t,0,0,1,0,0,-t,0,n,0,0,0,0,1),this},makeRotationZ:function(e){var n=Math.cos(e),t=Math.sin(e);return this.set(n,-t,0,0,t,n,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,n){var t=Math.cos(n),i=Math.sin(n),r=1-t,s=e.x,o=e.y,a=e.z,l=r*s,c=r*o;return this.set(l*s+t,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+t,c*a-i*s,0,l*a-i*o,c*a+i*s,r*a*a+t,0,0,0,0,1),this},makeScale:function(e,n,t){return this.set(e,0,0,0,0,n,0,0,0,0,t,0,0,0,0,1),this},makeShear:function(e,n,t){return this.set(1,n,t,0,e,1,t,0,e,n,1,0,0,0,0,1),this},compose:function(e,n,t){var i=this.elements,r=n._x,s=n._y,o=n._z,a=n._w,l=r+r,c=s+s,h=o+o,u=r*l,d=r*c,f=r*h,m=s*c,p=s*h,g=o*h,y=a*l,b=a*c,A=a*h,w=t.x,x=t.y,M=t.z;return i[0]=(1-(m+g))*w,i[1]=(d+A)*w,i[2]=(f-b)*w,i[3]=0,i[4]=(d-A)*x,i[5]=(1-(u+g))*x,i[6]=(p+y)*x,i[7]=0,i[8]=(f+b)*M,i[9]=(p-y)*M,i[10]=(1-(u+m))*M,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:function(e,n,t){var i=this.elements,r=Eo.set(i[0],i[1],i[2]).length(),s=Eo.set(i[4],i[5],i[6]).length(),o=Eo.set(i[8],i[9],i[10]).length(),a=this.determinant();a<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Ei.copy(this);var l=1/r,c=1/s,h=1/o;return Ei.elements[0]*=l,Ei.elements[1]*=l,Ei.elements[2]*=l,Ei.elements[4]*=c,Ei.elements[5]*=c,Ei.elements[6]*=c,Ei.elements[8]*=h,Ei.elements[9]*=h,Ei.elements[10]*=h,n.setFromRotationMatrix(Ei),t.x=r,t.y=s,t.z=o,this},makePerspective:function(e,n,t,i,r,s){s===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,a=2*r/(n-e),l=2*r/(t-i),c=(n+e)/(n-e),h=(t+i)/(t-i),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,n,t,i,r,s){var o=this.elements,a=1/(n-e),l=1/(t-i),c=1/(s-r),h=(n+e)*a,u=(t+i)*l,d=(s+r)*c;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var n=this.elements,t=e.elements,i=0;i<16;i++)if(n[i]!==t[i])return!1;return!0},fromArray:function(e,n){n===void 0&&(n=0);for(var t=0;t<16;t++)this.elements[t]=e[t+n];return this},toArray:function(e,n){e===void 0&&(e=[]),n===void 0&&(n=0);var t=this.elements;return e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=t[3],e[n+4]=t[4],e[n+5]=t[5],e[n+6]=t[6],e[n+7]=t[7],e[n+8]=t[8],e[n+9]=t[9],e[n+10]=t[10],e[n+11]=t[11],e[n+12]=t[12],e[n+13]=t[13],e[n+14]=t[14],e[n+15]=t[15],e}});var s0=new Ct,o0=new _n;function _o(e,n,t,i){this._x=e||0,this._y=n||0,this._z=t||0,this._order=i||_o.DefaultOrder}_o.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],_o.DefaultOrder="XYZ",Object.defineProperties(_o.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(_o.prototype,{isEuler:!0,set:function(e,n,t,i){return this._x=e,this._y=n,this._z=t,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,n,t){var i=xt.clamp,r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],f=r[10];switch(n=n||this._order,n){case"XYZ":this._y=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,t!==!1&&this._onChangeCallback(),this},setFromQuaternion:function(e,n,t){return s0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(s0,n,t)},setFromVector3:function(e,n){return this.set(e.x,e.y,e.z,n||this._order)},reorder:function(e){return o0.setFromEuler(this),this.setFromQuaternion(o0,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new B(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});function yf(){this.mask=1}Object.assign(yf.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return(this.mask&e.mask)!==0}});let TE=0;const a0=new B,So=new _n,vr=new Ct,Ch=new B,bl=new B,DE=new B,LE=new _n,l0=new B(1,0,0),c0=new B(0,1,0),h0=new B(0,0,1),kE={type:"added"},OE={type:"removed"};function He(){Object.defineProperty(this,"id",{value:TE++}),this.uuid=xt.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=He.DefaultUp.clone();var e=new B,n=new _o,t=new _n,i=new B(1,1,1);function r(){t.setFromEuler(n,!1)}function s(){n.setFromQuaternion(t,void 0,!1)}n._onChange(r),t._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:t},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Ct},normalMatrix:{value:new Un}}),this.matrix=new Ct,this.matrixWorld=new Ct,this.matrixAutoUpdate=He.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new yf,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}He.DefaultUp=new B(0,1,0),He.DefaultMatrixAutoUpdate=!0,He.prototype=Object.assign(Object.create(gr.prototype),{constructor:He,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,n){this.quaternion.setFromAxisAngle(e,n)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,n){return So.setFromAxisAngle(e,n),this.quaternion.multiply(So),this},rotateOnWorldAxis:function(e,n){return So.setFromAxisAngle(e,n),this.quaternion.premultiply(So),this},rotateX:function(e){return this.rotateOnAxis(l0,e)},rotateY:function(e){return this.rotateOnAxis(c0,e)},rotateZ:function(e){return this.rotateOnAxis(h0,e)},translateOnAxis:function(e,n){return a0.copy(e).applyQuaternion(this.quaternion),this.position.add(a0.multiplyScalar(n)),this},translateX:function(e){return this.translateOnAxis(l0,e)},translateY:function(e){return this.translateOnAxis(c0,e)},translateZ:function(e){return this.translateOnAxis(h0,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(vr.getInverse(this.matrixWorld))},lookAt:function(e,n,t){e.isVector3?Ch.copy(e):Ch.set(e,n,t);var i=this.parent;this.updateWorldMatrix(!0,!1),bl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?vr.lookAt(bl,Ch,this.up):vr.lookAt(Ch,bl,this.up),this.quaternion.setFromRotationMatrix(vr),i&&(vr.extractRotation(i.matrixWorld),So.setFromRotationMatrix(vr),this.quaternion.premultiply(So.inverse()))},add:function(e){if(arguments.length>1){for(var n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(kE)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}var t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(OE)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),vr.getInverse(this.matrixWorld),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),vr.multiply(e.parent.matrixWorld)),e.applyMatrix4(vr),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,n){if(this[e]===n)return this;for(var t=0,i=this.children.length;t<i;t++){var r=this.children[t],s=r.getObjectByProperty(e,n);if(s!==void 0)return s}},getWorldPosition:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new B),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new _n),this.updateMatrixWorld(!0),this.matrixWorld.decompose(bl,e,DE),e},getWorldScale:function(e){return e===void 0&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new B),this.updateMatrixWorld(!0),this.matrixWorld.decompose(bl,LE,e),e},getWorldDirection:function(e){e===void 0&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new B),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var n=this.children,t=0,i=n.length;t<i;t++)n[t].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var n=this.children,t=0,i=n.length;t<i;t++)n[t].traverseVisible(e)}},traverseAncestors:function(e){var n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var n=this.children,t=0,i=n.length;t<i;t++)n[t].updateMatrixWorld(e)},updateWorldMatrix:function(e,n){var t=this.parent;if(e===!0&&t!==null&&t.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),n===!0)for(var i=this.children,r=0,s=i.length;r<s;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(e){var n=e===void 0||typeof e=="string",t={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},t.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON());function r(g,y){return g[y.uuid]===void 0&&(g[y.uuid]=y.toJSON(e)),y.uuid}if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);var s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){var o=s.shapes;if(Array.isArray(o))for(var a=0,l=o.length;a<l;a++){var c=o[a];r(e.shapes,c)}else r(e.shapes,o)}}if(this.material!==void 0)if(Array.isArray(this.material)){for(var h=[],a=0,l=this.material.length;a<l;a++)h.push(r(e.materials,this.material[a]));i.material=h}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(var a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(n){var u=p(e.geometries),d=p(e.materials),f=p(e.textures),m=p(e.images),o=p(e.shapes);u.length>0&&(t.geometries=u),d.length>0&&(t.materials=d),f.length>0&&(t.textures=f),m.length>0&&(t.images=m),o.length>0&&(t.shapes=o)}return t.object=i,t;function p(g){var y=[];for(var b in g){var A=g[b];delete A.metadata,y.push(A)}return y}},clone:function(e){return new this.constructor().copy(this,e)},copy:function(e,n){if(n===void 0&&(n=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(var t=0;t<e.children.length;t++){var i=e.children[t];this.add(i.clone())}return this}});function Al(){He.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Al.prototype=Object.assign(Object.create(He.prototype),{constructor:Al,isScene:!0,copy:function(e,n){return He.prototype.copy.call(this,e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var n=He.prototype.toJSON.call(this,e);return this.background!==null&&(n.object.background=this.background.toJSON(e)),this.environment!==null&&(n.object.environment=this.environment.toJSON(e)),this.fog!==null&&(n.object.fog=this.fog.toJSON()),n},dispose:function(){this.dispatchEvent({type:"dispose"})}});var yr=[new B,new B,new B,new B,new B,new B,new B,new B],wl=new B,bf=new fi,Io=new B,To=new B,Do=new B,qr=new B,Jr=new B,Ls=new B,xl=new B,Ph=new B,Eh=new B,ks=new B;function fi(e,n){this.min=e!==void 0?e:new B(1/0,1/0,1/0),this.max=n!==void 0?n:new B(-1/0,-1/0,-1/0)}Object.assign(fi.prototype,{isBox3:!0,set:function(e,n){return this.min.copy(e),this.max.copy(n),this},setFromArray:function(e){for(var n=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0,a=0,l=e.length;a<l;a+=3){var c=e[a],h=e[a+1],u=e[a+2];c<n&&(n=c),h<t&&(t=h),u<i&&(i=u),c>r&&(r=c),h>s&&(s=h),u>o&&(o=u)}return this.min.set(n,t,i),this.max.set(r,s,o),this},setFromBufferAttribute:function(e){for(var n=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0,a=0,l=e.count;a<l;a++){var c=e.getX(a),h=e.getY(a),u=e.getZ(a);c<n&&(n=c),h<t&&(t=h),u<i&&(i=u),c>r&&(r=c),h>s&&(s=h),u>o&&(o=u)}return this.min.set(n,t,i),this.max.set(r,s,o),this},setFromPoints:function(e){this.makeEmpty();for(var n=0,t=e.length;n<t;n++)this.expandByPoint(e[n]);return this},setFromCenterAndSize:function(e,n){var t=wl.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(t),this.max.copy(e).add(t),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return e===void 0&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new B),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return e===void 0&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new B),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var n=e.geometry;n!==void 0&&(n.boundingBox===null&&n.computeBoundingBox(),bf.copy(n.boundingBox),bf.applyMatrix4(e.matrixWorld),this.union(bf));for(var t=e.children,i=0,r=t.length;i<r;i++)this.expandByObject(t[i]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,n){return n===void 0&&(console.warn("THREE.Box3: .getParameter() target is now required"),n=new B),n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,wl),wl.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var n,t;return e.normal.x>0?(n=e.normal.x*this.min.x,t=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,t=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,t+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,t+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,t+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,t+=e.normal.z*this.min.z),n<=-e.constant&&t>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(xl),Ph.subVectors(this.max,xl),Io.subVectors(e.a,xl),To.subVectors(e.b,xl),Do.subVectors(e.c,xl),qr.subVectors(To,Io),Jr.subVectors(Do,To),Ls.subVectors(Io,Do);var n=[0,-qr.z,qr.y,0,-Jr.z,Jr.y,0,-Ls.z,Ls.y,qr.z,0,-qr.x,Jr.z,0,-Jr.x,Ls.z,0,-Ls.x,-qr.y,qr.x,0,-Jr.y,Jr.x,0,-Ls.y,Ls.x,0];return!Af(n,Io,To,Do,Ph)||(n=[1,0,0,0,1,0,0,0,1],!Af(n,Io,To,Do,Ph))?!1:(Eh.crossVectors(qr,Jr),n=[Eh.x,Eh.y,Eh.z],Af(n,Io,To,Do,Ph))},clampPoint:function(e,n){return n===void 0&&(console.warn("THREE.Box3: .clampPoint() target is now required"),n=new B),n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){var n=wl.copy(e).clamp(this.min,this.max);return n.sub(e).length()},getBoundingSphere:function(e){return e===void 0&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=this.getSize(wl).length()*.5,e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()?this:(yr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),yr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),yr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),yr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),yr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),yr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),yr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),yr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(yr),this)},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});function Af(e,n,t,i,r){var s,o;for(s=0,o=e.length-3;s<=o;s+=3){ks.fromArray(e,s);var a=r.x*Math.abs(ks.x)+r.y*Math.abs(ks.y)+r.z*Math.abs(ks.z),l=n.dot(ks),c=t.dot(ks),h=i.dot(ks);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}var RE=new fi;function Ui(e,n){this.center=e!==void 0?e:new B,this.radius=n!==void 0?n:-1}Object.assign(Ui.prototype,{set:function(e,n){return this.center.copy(e),this.radius=n,this},setFromPoints:function(e,n){var t=this.center;n!==void 0?t.copy(n):RE.setFromPoints(e).getCenter(t);for(var i=0,r=0,s=e.length;r<s;r++)i=Math.max(i,t.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,n){var t=this.center.distanceToSquared(e);return n===void 0&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),n=new B),n.copy(e),t>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(e){return e===void 0&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new fi),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var br=new B,wf=new B,_h=new B,Kr=new B,xf=new B,Sh=new B,Mf=new B;function Lo(e,n){this.origin=e!==void 0?e:new B,this.direction=n!==void 0?n:new B(0,0,-1)}Object.assign(Lo.prototype,{set:function(e,n){return this.origin.copy(e),this.direction.copy(n),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,n){return n===void 0&&(console.warn("THREE.Ray: .at() target is now required"),n=new B),n.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,br)),this},closestPointToPoint:function(e,n){n===void 0&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),n=new B),n.subVectors(e,this.origin);var t=n.dot(this.direction);return t<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(t).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var n=br.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(br.copy(this.direction).multiplyScalar(n).add(this.origin),br.distanceToSquared(e))},distanceSqToSegment:function(e,n,t,i){wf.copy(e).add(n).multiplyScalar(.5),_h.copy(n).sub(e).normalize(),Kr.copy(this.origin).sub(wf);var r=e.distanceTo(n)*.5,s=-this.direction.dot(_h),o=Kr.dot(this.direction),a=-Kr.dot(_h),l=Kr.lengthSq(),c=Math.abs(1-s*s),h,u,d,f;if(c>0)if(h=s*a-o,u=s*o-a,f=r*c,h>=0)if(u>=-f)if(u<=f){var m=1/c;h*=m,u*=m,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-f?(h=Math.max(0,-(-s*r+o)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=f?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(s*r+o)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return t&&t.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(_h).multiplyScalar(u).add(wf),d},intersectSphere:function(e,n){br.subVectors(e.center,this.origin);var t=br.dot(this.direction),i=br.dot(br)-t*t,r=e.radius*e.radius;if(i>r)return null;var s=Math.sqrt(r-i),o=t-s,a=t+s;return o<0&&a<0?null:o<0?this.at(a,n):this.at(o,n)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;var t=-(this.origin.dot(e.normal)+e.constant)/n;return t>=0?t:null},intersectPlane:function(e,n){var t=this.distanceToPlane(e);return t===null?null:this.at(t,n)},intersectsPlane:function(e){var n=e.distanceToPoint(this.origin);if(n===0)return!0;var t=e.normal.dot(this.direction);return t*n<0},intersectBox:function(e,n){var t,i,r,s,o,a,l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(t=(e.min.x-u.x)*l,i=(e.max.x-u.x)*l):(t=(e.max.x-u.x)*l,i=(e.min.x-u.x)*l),c>=0?(r=(e.min.y-u.y)*c,s=(e.max.y-u.y)*c):(r=(e.max.y-u.y)*c,s=(e.min.y-u.y)*c),t>s||r>i||((r>t||t!==t)&&(t=r),(s<i||i!==i)&&(i=s),h>=0?(o=(e.min.z-u.z)*h,a=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,a=(e.min.z-u.z)*h),t>a||o>i)||((o>t||t!==t)&&(t=o),(a<i||i!==i)&&(i=a),i<0)?null:this.at(t>=0?t:i,n)},intersectsBox:function(e){return this.intersectBox(e,br)!==null},intersectTriangle:function(e,n,t,i,r){xf.subVectors(n,e),Sh.subVectors(t,e),Mf.crossVectors(xf,Sh);var s=this.direction.dot(Mf),o;if(s>0){if(i)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Kr.subVectors(this.origin,e);var a=o*this.direction.dot(Sh.crossVectors(Kr,Sh));if(a<0)return null;var l=o*this.direction.dot(xf.cross(Kr));if(l<0||a+l>s)return null;var c=-o*Kr.dot(Mf);return c<0?null:this.at(c/s,r)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var Cf=new B,zE=new B,BE=new Un;function Wi(e,n){this.normal=e!==void 0?e:new B(1,0,0),this.constant=n!==void 0?n:0}Object.assign(Wi.prototype,{isPlane:!0,set:function(e,n){return this.normal.copy(e),this.constant=n,this},setComponents:function(e,n,t,i){return this.normal.set(e,n,t),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this},setFromCoplanarPoints:function(e,n,t){var i=Cf.subVectors(t,n).cross(zE.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,n){return n===void 0&&(console.warn("THREE.Plane: .projectPoint() target is now required"),n=new B),n.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,n){n===void 0&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new B);var t=e.delta(Cf),i=this.normal.dot(t);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):void 0;var r=-(e.start.dot(this.normal)+this.constant)/i;if(!(r<0||r>1))return n.copy(t).multiplyScalar(r).add(e.start)},intersectsLine:function(e){var n=this.distanceToPoint(e.start),t=this.distanceToPoint(e.end);return n<0&&t>0||t<0&&n>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return e===void 0&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new B),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,n){var t=n||BE.getNormalMatrix(e),i=this.coplanarPoint(Cf).applyMatrix4(e),r=this.normal.applyMatrix3(t).normalize();return this.constant=-i.dot(r),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var _i=new B,Ar=new B,Pf=new B,wr=new B,ko=new B,Oo=new B,u0=new B,Ef=new B,_f=new B,Sf=new B;function Dn(e,n,t){this.a=e!==void 0?e:new B,this.b=n!==void 0?n:new B,this.c=t!==void 0?t:new B}Object.assign(Dn,{getNormal:function(e,n,t,i){i===void 0&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new B),i.subVectors(t,n),_i.subVectors(e,n),i.cross(_i);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(e,n,t,i,r){_i.subVectors(i,n),Ar.subVectors(t,n),Pf.subVectors(e,n);var s=_i.dot(_i),o=_i.dot(Ar),a=_i.dot(Pf),l=Ar.dot(Ar),c=Ar.dot(Pf),h=s*l-o*o;if(r===void 0&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new B),h===0)return r.set(-2,-1,-1);var u=1/h,d=(l*a-o*c)*u,f=(s*c-o*a)*u;return r.set(1-d-f,f,d)},containsPoint:function(e,n,t,i){return Dn.getBarycoord(e,n,t,i,wr),wr.x>=0&&wr.y>=0&&wr.x+wr.y<=1},getUV:function(e,n,t,i,r,s,o,a){return this.getBarycoord(e,n,t,i,wr),a.set(0,0),a.addScaledVector(r,wr.x),a.addScaledVector(s,wr.y),a.addScaledVector(o,wr.z),a},isFrontFacing:function(e,n,t,i){return _i.subVectors(t,n),Ar.subVectors(e,n),_i.cross(Ar).dot(i)<0}}),Object.assign(Dn.prototype,{set:function(e,n,t){return this.a.copy(e),this.b.copy(n),this.c.copy(t),this},setFromPointsAndIndices:function(e,n,t,i){return this.a.copy(e[n]),this.b.copy(e[t]),this.c.copy(e[i]),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return _i.subVectors(this.c,this.b),Ar.subVectors(this.a,this.b),_i.cross(Ar).length()*.5},getMidpoint:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new B),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Dn.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return e===void 0&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Wi),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,n){return Dn.getBarycoord(e,this.a,this.b,this.c,n)},getUV:function(e,n,t,i,r){return Dn.getUV(e,this.a,this.b,this.c,n,t,i,r)},containsPoint:function(e){return Dn.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return Dn.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,n){n===void 0&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),n=new B);var t=this.a,i=this.b,r=this.c,s,o;ko.subVectors(i,t),Oo.subVectors(r,t),Ef.subVectors(e,t);var a=ko.dot(Ef),l=Oo.dot(Ef);if(a<=0&&l<=0)return n.copy(t);_f.subVectors(e,i);var c=ko.dot(_f),h=Oo.dot(_f);if(c>=0&&h<=c)return n.copy(i);var u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),n.copy(t).addScaledVector(ko,s);Sf.subVectors(e,r);var d=ko.dot(Sf),f=Oo.dot(Sf);if(f>=0&&d<=f)return n.copy(r);var m=d*l-a*f;if(m<=0&&l>=0&&f<=0)return o=l/(l-f),n.copy(t).addScaledVector(Oo,o);var p=c*f-d*h;if(p<=0&&h-c>=0&&d-f>=0)return u0.subVectors(r,i),o=(h-c)/(h-c+(d-f)),n.copy(i).addScaledVector(u0,o);var g=1/(p+m+u);return s=m*g,o=u*g,n.copy(t).addScaledVector(ko,s).addScaledVector(Oo,o)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var d0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Si={h:0,s:0,l:0},Ih={h:0,s:0,l:0};function Ye(e,n,t){return n===void 0&&t===void 0?this.set(e):this.setRGB(e,n,t)}function If(e,n,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+(n-e)*6*t:t<1/2?n:t<2/3?e+(n-e)*6*(2/3-t):e}function Tf(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function Df(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}Object.assign(Ye.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this},setRGB:function(e,n,t){return this.r=e,this.g=n,this.b=t,this},setHSL:function(e,n,t){if(e=xt.euclideanModulo(e,1),n=xt.clamp(n,0,1),t=xt.clamp(t,0,1),n===0)this.r=this.g=this.b=t;else{var i=t<=.5?t*(1+n):t+n-t*n,r=2*t-i;this.r=If(r,i,e+1/3),this.g=If(r,i,e),this.b=If(r,i,e-1/3)}return this},setStyle:function(e){function n(u){u!==void 0&&parseFloat(u)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var t;if(t=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=t[1],s=t[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,n(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,n(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(s)){var o=parseFloat(i[1])/360,a=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return n(i[5]),this.setHSL(o,a,l)}break}}else if(t=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=t[1],h=c.length;if(h===3)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(h===6)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var n=d0[e];return n!==void 0?this.setHex(n):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,n){return n===void 0&&(n=2),this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},copyLinearToGamma:function(e,n){n===void 0&&(n=2);var t=n>0?1/n:1;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=Tf(e.r),this.g=Tf(e.g),this.b=Tf(e.b),this},copyLinearToSRGB:function(e){return this.r=Df(e.r),this.g=Df(e.g),this.b=Df(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){e===void 0&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var n=this.r,t=this.g,i=this.b,r=Math.max(n,t,i),s=Math.min(n,t,i),o,a,l=(s+r)/2;if(s===r)o=0,a=0;else{var c=r-s;switch(a=l<=.5?c/(r+s):c/(2-r-s),r){case n:o=(t-i)/c+(t<i?6:0);break;case t:o=(i-n)/c+2;break;case i:o=(n-t)/c+4;break}o/=6}return e.h=o,e.s=a,e.l=l,e},getStyle:function(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"},offsetHSL:function(e,n,t){return this.getHSL(Si),Si.h+=e,Si.s+=n,Si.l+=t,this.setHSL(Si.h,Si.s,Si.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this},lerpHSL:function(e,n){this.getHSL(Si),e.getHSL(Ih);var t=xt.lerp(Si.h,Ih.h,n),i=xt.lerp(Si.s,Ih.s,n),r=xt.lerp(Si.l,Ih.l,n);return this.setHSL(t,i,r),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,n){return n===void 0&&(n=0),this.r=e[n],this.g=e[n+1],this.b=e[n+2],this},toArray:function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=0),e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e},toJSON:function(){return this.getHex()}}),Ye.NAMES=d0;function Th(e,n,t,i,r,s){this.a=e,this.b=n,this.c=t,this.normal=i&&i.isVector3?i:new B,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new Ye,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=s!==void 0?s:0}Object.assign(Th.prototype,{clone:function(){return new this.constructor().copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var n=0,t=e.vertexNormals.length;n<t;n++)this.vertexNormals[n]=e.vertexNormals[n].clone();for(var n=0,t=e.vertexColors.length;n<t;n++)this.vertexColors[n]=e.vertexColors[n].clone();return this}});var NE=0;function dt(){Object.defineProperty(this,"id",{value:NE++}),this.uuid=xt.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=ul,this.side=hl,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Bv,this.blendDst=Nv,this.blendEquation=Ao,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=rf,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=EE,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=gf,this.stencilZFail=gf,this.stencilZPass=gf,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}dt.prototype=Object.assign(Object.create(gr.prototype),{constructor:dt,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(e!==void 0)for(var n in e){var t=e[n];if(t===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}if(n==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===Dv;continue}var i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(t):i&&i.isVector3&&t&&t.isVector3?i.copy(t):this[n]=t}},toJSON:function(e){var n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});var t={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),this.roughness!==void 0&&(t.roughness=this.roughness),this.metalness!==void 0&&(t.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(t.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(t.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),this.shininess!==void 0&&(t.shininess=this.shininess),this.clearcoat!==void 0&&(t.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(t.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(t.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(t.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(t.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,t.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(t.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(t.aoMap=this.aoMap.toJSON(e).uuid,t.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(e).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(e).uuid,t.normalMapType=this.normalMapType,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(e).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(e).uuid,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,this.combine!==void 0&&(t.combine=this.combine),this.envMapIntensity!==void 0&&(t.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(e).uuid),this.size!==void 0&&(t.size=this.size),this.sizeAttenuation!==void 0&&(t.sizeAttenuation=this.sizeAttenuation),this.blending!==ul&&(t.blending=this.blending),this.flatShading===!0&&(t.flatShading=this.flatShading),this.side!==hl&&(t.side=this.side),this.vertexColors&&(t.vertexColors=!0),this.opacity<1&&(t.opacity=this.opacity),this.transparent===!0&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,t.stencilWrite=this.stencilWrite,t.stencilWriteMask=this.stencilWriteMask,t.stencilFunc=this.stencilFunc,t.stencilRef=this.stencilRef,t.stencilFuncMask=this.stencilFuncMask,t.stencilFail=this.stencilFail,t.stencilZFail=this.stencilZFail,t.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(t.rotation=this.rotation),this.polygonOffset===!0&&(t.polygonOffset=!0),this.polygonOffsetFactor!==0&&(t.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(t.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(t.linewidth=this.linewidth),this.dashSize!==void 0&&(t.dashSize=this.dashSize),this.gapSize!==void 0&&(t.gapSize=this.gapSize),this.scale!==void 0&&(t.scale=this.scale),this.dithering===!0&&(t.dithering=!0),this.alphaTest>0&&(t.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(t.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(t.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(t.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(t.morphTargets=!0),this.morphNormals===!0&&(t.morphNormals=!0),this.skinning===!0&&(t.skinning=!0),this.visible===!1&&(t.visible=!1),this.toneMapped===!1&&(t.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(t.userData=this.userData);function i(o){var a=[];for(var l in o){var c=o[l];delete c.metadata,a.push(c)}return a}if(n){var r=i(e.textures),s=i(e.images);r.length>0&&(t.textures=r),s.length>0&&(t.images=s)}return t},clone:function(){return new this.constructor().copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var n=e.clippingPlanes,t=null;if(n!==null){var i=n.length;t=new Array(i);for(var r=0;r!==i;++r)t[r]=n[r].clone()}return this.clippingPlanes=t,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(dt.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}});function Ii(e){dt.call(this),this.type="MeshBasicMaterial",this.color=new Ye(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=uh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}Ii.prototype=Object.create(dt.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isMeshBasicMaterial=!0,Ii.prototype.copy=function(e){return dt.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var jt=new B;function ft(e,n,t){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=t===!0,this.usage=xh,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(ft.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),Object.assign(ft.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,n,t){e*=this.itemSize,t*=n.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=n.array[t+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var n=this.array,t=0,i=0,r=e.length;i<r;i++){var s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),s=new Ye),n[t++]=s.r,n[t++]=s.g,n[t++]=s.b}return this},copyVector2sArray:function(e){for(var n=this.array,t=0,i=0,r=e.length;i<r;i++){var s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),s=new ge),n[t++]=s.x,n[t++]=s.y}return this},copyVector3sArray:function(e){for(var n=this.array,t=0,i=0,r=e.length;i<r;i++){var s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),s=new B),n[t++]=s.x,n[t++]=s.y,n[t++]=s.z}return this},copyVector4sArray:function(e){for(var n=this.array,t=0,i=0,r=e.length;i<r;i++){var s=e[i];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),s=new Vt),n[t++]=s.x,n[t++]=s.y,n[t++]=s.z,n[t++]=s.w}return this},applyMatrix3:function(e){for(var n=0,t=this.count;n<t;n++)jt.x=this.getX(n),jt.y=this.getY(n),jt.z=this.getZ(n),jt.applyMatrix3(e),this.setXYZ(n,jt.x,jt.y,jt.z);return this},applyMatrix4:function(e){for(var n=0,t=this.count;n<t;n++)jt.x=this.getX(n),jt.y=this.getY(n),jt.z=this.getZ(n),jt.applyMatrix4(e),this.setXYZ(n,jt.x,jt.y,jt.z);return this},applyNormalMatrix:function(e){for(var n=0,t=this.count;n<t;n++)jt.x=this.getX(n),jt.y=this.getY(n),jt.z=this.getZ(n),jt.applyNormalMatrix(e),this.setXYZ(n,jt.x,jt.y,jt.z);return this},transformDirection:function(e){for(var n=0,t=this.count;n<t;n++)jt.x=this.getX(n),jt.y=this.getY(n),jt.z=this.getZ(n),jt.transformDirection(e),this.setXYZ(n,jt.x,jt.y,jt.z);return this},set:function(e,n){return n===void 0&&(n=0),this.array.set(e,n),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,n){return this.array[e*this.itemSize]=n,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,n){return this.array[e*this.itemSize+1]=n,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,n){return this.array[e*this.itemSize+2]=n,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,n){return this.array[e*this.itemSize+3]=n,this},setXY:function(e,n,t){return e*=this.itemSize,this.array[e+0]=n,this.array[e+1]=t,this},setXYZ:function(e,n,t,i){return e*=this.itemSize,this.array[e+0]=n,this.array[e+1]=t,this.array[e+2]=i,this},setXYZW:function(e,n,t,i,r){return e*=this.itemSize,this.array[e+0]=n,this.array[e+1]=t,this.array[e+2]=i,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}});function Lf(e,n,t){ft.call(this,new Int8Array(e),n,t)}Lf.prototype=Object.create(ft.prototype),Lf.prototype.constructor=Lf;function kf(e,n,t){ft.call(this,new Uint8Array(e),n,t)}kf.prototype=Object.create(ft.prototype),kf.prototype.constructor=kf;function Of(e,n,t){ft.call(this,new Uint8ClampedArray(e),n,t)}Of.prototype=Object.create(ft.prototype),Of.prototype.constructor=Of;function Rf(e,n,t){ft.call(this,new Int16Array(e),n,t)}Rf.prototype=Object.create(ft.prototype),Rf.prototype.constructor=Rf;function Ml(e,n,t){ft.call(this,new Uint16Array(e),n,t)}Ml.prototype=Object.create(ft.prototype),Ml.prototype.constructor=Ml;function zf(e,n,t){ft.call(this,new Int32Array(e),n,t)}zf.prototype=Object.create(ft.prototype),zf.prototype.constructor=zf;function Cl(e,n,t){ft.call(this,new Uint32Array(e),n,t)}Cl.prototype=Object.create(ft.prototype),Cl.prototype.constructor=Cl;function Be(e,n,t){ft.call(this,new Float32Array(e),n,t)}Be.prototype=Object.create(ft.prototype),Be.prototype.constructor=Be;function Bf(e,n,t){ft.call(this,new Float64Array(e),n,t)}Bf.prototype=Object.create(ft.prototype),Bf.prototype.constructor=Bf;function f0(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}Object.assign(f0.prototype,{computeGroups:function(e){for(var n,t=[],i=void 0,r=e.faces,s=0;s<r.length;s++){var o=r[s];o.materialIndex!==i&&(i=o.materialIndex,n!==void 0&&(n.count=s*3-n.start,t.push(n)),n={start:s*3,materialIndex:i})}n!==void 0&&(n.count=s*3-n.start,t.push(n)),this.groups=t},fromGeometry:function(e){var n=e.faces,t=e.vertices,i=e.faceVertexUvs,r=i[0]&&i[0].length>0,s=i[1]&&i[1].length>0,o=e.morphTargets,a=o.length,l;if(a>0){l=[];for(var c=0;c<a;c++)l[c]={name:o[c].name,data:[]};this.morphTargets.position=l}var h=e.morphNormals,u=h.length,d;if(u>0){d=[];for(var c=0;c<u;c++)d[c]={name:h[c].name,data:[]};this.morphTargets.normal=d}var f=e.skinIndices,m=e.skinWeights,p=f.length===t.length,g=m.length===t.length;t.length>0&&n.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var c=0;c<n.length;c++){var y=n[c];this.vertices.push(t[y.a],t[y.b],t[y.c]);var b=y.vertexNormals;if(b.length===3)this.normals.push(b[0],b[1],b[2]);else{var A=y.normal;this.normals.push(A,A,A)}var w=y.vertexColors;if(w.length===3)this.colors.push(w[0],w[1],w[2]);else{var x=y.color;this.colors.push(x,x,x)}if(r===!0){var M=i[0][c];M!==void 0?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new ge,new ge,new ge))}if(s===!0){var M=i[1][c];M!==void 0?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new ge,new ge,new ge))}for(var E=0;E<a;E++){var S=o[E].vertices;l[E].data.push(S[y.a],S[y.b],S[y.c])}for(var E=0;E<u;E++){var T=h[E].vertexNormals[c];d[E].data.push(T.a,T.b,T.c)}p&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),g&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this}});function p0(e){if(e.length===0)return-1/0;let n=e[0];for(let t=1,i=e.length;t<i;++t)e[t]>n&&(n=e[t]);return n}var FE=1,Qi=new Ct,Nf=new He,Ro=new B,si=new fi,Pl=new fi,gn=new B;function Xe(){Object.defineProperty(this,"id",{value:FE+=2}),this.uuid=xt.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}Xe.prototype=Object.assign(Object.create(gr.prototype),{constructor:Xe,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(p0(e)>65535?Cl:Ml)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,n){return this.attributes[e]=n,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,n,t){this.groups.push({start:e,count:n,materialIndex:t!==void 0?t:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,n){this.drawRange.start=e,this.drawRange.count=n},applyMatrix4:function(e){var n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);var t=this.attributes.normal;if(t!==void 0){var i=new Un().getNormalMatrix(e);t.applyNormalMatrix(i),t.needsUpdate=!0}var r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},rotateX:function(e){return Qi.makeRotationX(e),this.applyMatrix4(Qi),this},rotateY:function(e){return Qi.makeRotationY(e),this.applyMatrix4(Qi),this},rotateZ:function(e){return Qi.makeRotationZ(e),this.applyMatrix4(Qi),this},translate:function(e,n,t){return Qi.makeTranslation(e,n,t),this.applyMatrix4(Qi),this},scale:function(e,n,t){return Qi.makeScale(e,n,t),this.applyMatrix4(Qi),this},lookAt:function(e){return Nf.lookAt(e),Nf.updateMatrix(),this.applyMatrix4(Nf.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ro).negate(),this.translate(Ro.x,Ro.y,Ro.z),this},setFromObject:function(e){var n=e.geometry;if(e.isPoints||e.isLine){var t=new Be(n.vertices.length*3,3),i=new Be(n.colors.length*3,3);if(this.setAttribute("position",t.copyVector3sArray(n.vertices)),this.setAttribute("color",i.copyColorsArray(n.colors)),n.lineDistances&&n.lineDistances.length===n.vertices.length){var r=new Be(n.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(n.lineDistances))}n.boundingSphere!==null&&(this.boundingSphere=n.boundingSphere.clone()),n.boundingBox!==null&&(this.boundingBox=n.boundingBox.clone())}else e.isMesh&&n&&n.isGeometry&&this.fromGeometry(n);return this},setFromPoints:function(e){for(var n=[],t=0,i=e.length;t<i;t++){var r=e[t];n.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Be(n,3)),this},updateFromObject:function(e){var n=e.geometry;if(e.isMesh){var t=n.__directGeometry;if(n.elementsNeedUpdate===!0&&(t=void 0,n.elementsNeedUpdate=!1),t===void 0)return this.fromGeometry(n);t.verticesNeedUpdate=n.verticesNeedUpdate,t.normalsNeedUpdate=n.normalsNeedUpdate,t.colorsNeedUpdate=n.colorsNeedUpdate,t.uvsNeedUpdate=n.uvsNeedUpdate,t.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=t}var i;return n.verticesNeedUpdate===!0&&(i=this.attributes.position,i!==void 0&&(i.copyVector3sArray(n.vertices),i.needsUpdate=!0),n.verticesNeedUpdate=!1),n.normalsNeedUpdate===!0&&(i=this.attributes.normal,i!==void 0&&(i.copyVector3sArray(n.normals),i.needsUpdate=!0),n.normalsNeedUpdate=!1),n.colorsNeedUpdate===!0&&(i=this.attributes.color,i!==void 0&&(i.copyColorsArray(n.colors),i.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(i=this.attributes.uv,i!==void 0&&(i.copyVector2sArray(n.uvs),i.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(i=this.attributes.lineDistance,i!==void 0&&(i.copyArray(n.lineDistances),i.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=new f0().fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var n=new Float32Array(e.vertices.length*3);if(this.setAttribute("position",new ft(n,3).copyVector3sArray(e.vertices)),e.normals.length>0){var t=new Float32Array(e.normals.length*3);this.setAttribute("normal",new ft(t,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(e.colors.length*3);this.setAttribute("color",new ft(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var r=new Float32Array(e.uvs.length*2);this.setAttribute("uv",new ft(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var s=new Float32Array(e.uvs2.length*2);this.setAttribute("uv2",new ft(s,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(var o in e.morphTargets){for(var a=[],l=e.morphTargets[o],c=0,h=l.length;c<h;c++){var u=l[c],d=new Be(u.data.length*3,3);d.name=u.name,a.push(d.copyVector3sArray(u.data))}this.morphAttributes[o]=a}if(e.skinIndices.length>0){var f=new Be(e.skinIndices.length*4,4);this.setAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new Be(e.skinWeights.length*4,4);this.setAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new fi);var e=this.attributes.position,n=this.morphAttributes.position;if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(var t=0,i=n.length;t<i;t++){var r=n[t];si.setFromBufferAttribute(r),this.morphTargetsRelative?(gn.addVectors(this.boundingBox.min,si.min),this.boundingBox.expandByPoint(gn),gn.addVectors(this.boundingBox.max,si.max),this.boundingBox.expandByPoint(gn)):(this.boundingBox.expandByPoint(si.min),this.boundingBox.expandByPoint(si.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new Ui);var e=this.attributes.position,n=this.morphAttributes.position;if(e){var t=this.boundingSphere.center;if(si.setFromBufferAttribute(e),n)for(var i=0,r=n.length;i<r;i++){var s=n[i];Pl.setFromBufferAttribute(s),this.morphTargetsRelative?(gn.addVectors(si.min,Pl.min),si.expandByPoint(gn),gn.addVectors(si.max,Pl.max),si.expandByPoint(gn)):(si.expandByPoint(Pl.min),si.expandByPoint(Pl.max))}si.getCenter(t);for(var o=0,i=0,r=e.count;i<r;i++)gn.fromBufferAttribute(e,i),o=Math.max(o,t.distanceToSquared(gn));if(n)for(var i=0,r=n.length;i<r;i++)for(var s=n[i],a=this.morphTargetsRelative,l=0,c=s.count;l<c;l++)gn.fromBufferAttribute(s,l),a&&(Ro.fromBufferAttribute(e,l),gn.add(Ro)),o=Math.max(o,t.distanceToSquared(gn));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,n=this.attributes;if(n.position){var t=n.position.array;if(n.normal===void 0)this.setAttribute("normal",new ft(new Float32Array(t.length),3));else for(var i=n.normal.array,r=0,s=i.length;r<s;r++)i[r]=0;var o=n.normal.array,a,l,c,h=new B,u=new B,d=new B,f=new B,m=new B;if(e)for(var p=e.array,r=0,s=e.count;r<s;r+=3)a=p[r+0]*3,l=p[r+1]*3,c=p[r+2]*3,h.fromArray(t,a),u.fromArray(t,l),d.fromArray(t,c),f.subVectors(d,u),m.subVectors(h,u),f.cross(m),o[a]+=f.x,o[a+1]+=f.y,o[a+2]+=f.z,o[l]+=f.x,o[l+1]+=f.y,o[l+2]+=f.z,o[c]+=f.x,o[c+1]+=f.y,o[c+2]+=f.z;else for(var r=0,s=t.length;r<s;r+=9)h.fromArray(t,r),u.fromArray(t,r+3),d.fromArray(t,r+6),f.subVectors(d,u),m.subVectors(h,u),f.cross(m),o[r]=f.x,o[r+1]=f.y,o[r+2]=f.z,o[r+3]=f.x,o[r+4]=f.y,o[r+5]=f.z,o[r+6]=f.x,o[r+7]=f.y,o[r+8]=f.z;this.normalizeNormals(),n.normal.needsUpdate=!0}},merge:function(e,n){if(!(e&&e.isBufferGeometry)){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);return}n===void 0&&(n=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var t=this.attributes;for(var i in t)if(e.attributes[i]!==void 0)for(var r=t[i],s=r.array,o=e.attributes[i],a=o.array,l=o.itemSize*n,c=Math.min(a.length,s.length-l),h=0,u=l;h<c;h++,u++)s[u]=a[h];return this},normalizeNormals:function(){for(var e=this.attributes.normal,n=0,t=e.count;n<t;n++)gn.x=e.getX(n),gn.y=e.getY(n),gn.z=e.getZ(n),gn.normalize(),e.setXYZ(n,gn.x,gn.y,gn.z)},toNonIndexed:function(){function e(p,g){for(var y=p.array,b=p.itemSize,A=p.normalized,w=new y.constructor(g.length*b),x=0,M=0,E=0,S=g.length;E<S;E++){x=g[E]*b;for(var T=0;T<b;T++)w[M++]=y[x++]}return new ft(w,b,A)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var n=new Xe,t=this.index.array,i=this.attributes;for(var r in i){var s=i[r],o=e(s,t);n.setAttribute(r,o)}var a=this.morphAttributes;for(r in a){for(var l=[],c=a[r],h=0,u=c.length;h<u;h++){var s=c[h],o=e(s,t);l.push(o)}n.morphAttributes[r]=l}n.morphTargetsRelative=this.morphTargetsRelative;for(var d=this.groups,h=0,f=d.length;h<f;h++){var m=d[h];n.addGroup(m.start,m.count,m.materialIndex)}return n},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){var n=this.parameters;for(var t in n)n[t]!==void 0&&(e[t]=n[t]);return e}e.data={attributes:{}};var i=this.index;i!==null&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var t in r){var s=r[t],o=s.toJSON();s.name!==""&&(o.name=s.name),e.data.attributes[t]=o}var a={},l=!1;for(var t in this.morphAttributes){for(var c=this.morphAttributes[t],h=[],u=0,d=c.length;u<d;u++){var s=c[u],o=s.toJSON();s.name!==""&&(o.name=s.name),h.push(o)}h.length>0&&(a[t]=h,l=!0)}l&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(e.data.groups=JSON.parse(JSON.stringify(f)));var m=this.boundingSphere;return m!==null&&(e.data.boundingSphere={center:m.center.toArray(),radius:m.radius}),e},clone:function(){return new Xe().copy(this)},copy:function(e){var n,t,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;r!==null&&this.setIndex(r.clone());var s=e.attributes;for(n in s){var o=s[n];this.setAttribute(n,o.clone())}var a=e.morphAttributes;for(n in a){var l=[],c=a[n];for(t=0,i=c.length;t<i;t++)l.push(c[t].clone());this.morphAttributes[n]=l}this.morphTargetsRelative=e.morphTargetsRelative;var h=e.groups;for(t=0,i=h.length;t<i;t++){var u=h[t];this.addGroup(u.start,u.count,u.materialIndex)}var d=e.boundingBox;d!==null&&(this.boundingBox=d.clone());var f=e.boundingSphere;return f!==null&&(this.boundingSphere=f.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var m0=new Ct,Os=new Lo,Ff=new Ui,$r=new B,es=new B,ts=new B,Vf=new B,Gf=new B,jf=new B,Dh=new B,Lh=new B,kh=new B,zo=new ge,Bo=new ge,No=new ge,El=new B,Oh=new B;function en(e,n){He.call(this),this.type="Mesh",this.geometry=e!==void 0?e:new Xe,this.material=n!==void 0?n:new Ii,this.updateMorphTargets()}en.prototype=Object.assign(Object.create(He.prototype),{constructor:en,isMesh:!0,copy:function(e){return He.prototype.copy.call(this,e),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e=this.geometry,n,t,i;if(e.isBufferGeometry){var r=e.morphAttributes,s=Object.keys(r);if(s.length>0){var o=r[s[0]];if(o!==void 0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},n=0,t=o.length;n<t;n++)i=o[n].name||String(n),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=n}}else{var a=e.morphTargets;a!==void 0&&a.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,n){var t=this.geometry,i=this.material,r=this.matrixWorld;if(i!==void 0&&(t.boundingSphere===null&&t.computeBoundingSphere(),Ff.copy(t.boundingSphere),Ff.applyMatrix4(r),e.ray.intersectsSphere(Ff)!==!1&&(m0.getInverse(r),Os.copy(e.ray).applyMatrix4(m0),!(t.boundingBox!==null&&Os.intersectsBox(t.boundingBox)===!1)))){var s;if(t.isBufferGeometry){var o,a,l,c=t.index,h=t.attributes.position,u=t.morphAttributes.position,d=t.morphTargetsRelative,f=t.attributes.uv,m=t.attributes.uv2,p=t.groups,g=t.drawRange,y,b,A,w,x,M,E,S;if(c!==null)if(Array.isArray(i))for(y=0,A=p.length;y<A;y++)for(x=p[y],M=i[x.materialIndex],E=Math.max(x.start,g.start),S=Math.min(x.start+x.count,g.start+g.count),b=E,w=S;b<w;b+=3)o=c.getX(b),a=c.getX(b+1),l=c.getX(b+2),s=Rh(this,M,e,Os,h,u,d,f,m,o,a,l),s&&(s.faceIndex=Math.floor(b/3),s.face.materialIndex=x.materialIndex,n.push(s));else for(E=Math.max(0,g.start),S=Math.min(c.count,g.start+g.count),y=E,A=S;y<A;y+=3)o=c.getX(y),a=c.getX(y+1),l=c.getX(y+2),s=Rh(this,i,e,Os,h,u,d,f,m,o,a,l),s&&(s.faceIndex=Math.floor(y/3),n.push(s));else if(h!==void 0)if(Array.isArray(i))for(y=0,A=p.length;y<A;y++)for(x=p[y],M=i[x.materialIndex],E=Math.max(x.start,g.start),S=Math.min(x.start+x.count,g.start+g.count),b=E,w=S;b<w;b+=3)o=b,a=b+1,l=b+2,s=Rh(this,M,e,Os,h,u,d,f,m,o,a,l),s&&(s.faceIndex=Math.floor(b/3),s.face.materialIndex=x.materialIndex,n.push(s));else for(E=Math.max(0,g.start),S=Math.min(h.count,g.start+g.count),y=E,A=S;y<A;y+=3)o=y,a=y+1,l=y+2,s=Rh(this,i,e,Os,h,u,d,f,m,o,a,l),s&&(s.faceIndex=Math.floor(y/3),n.push(s))}else if(t.isGeometry){var T,z,D,k=Array.isArray(i),R=t.vertices,G=t.faces,I,U=t.faceVertexUvs[0];U.length>0&&(I=U);for(var J=0,K=G.length;J<K;J++){var ne=G[J],ie=k?i[ne.materialIndex]:i;if(ie!==void 0&&(T=R[ne.a],z=R[ne.b],D=R[ne.c],s=g0(this,ie,e,Os,T,z,D,El),s)){if(I&&I[J]){var pe=I[J];zo.copy(pe[0]),Bo.copy(pe[1]),No.copy(pe[2]),s.uv=Dn.getUV(El,T,z,D,zo,Bo,No,new ge)}s.face=ne,s.faceIndex=J,n.push(s)}}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});function g0(e,n,t,i,r,s,o,a){var l;if(n.side===En?l=i.intersectTriangle(o,s,r,!0,a):l=i.intersectTriangle(r,s,o,n.side!==hh,a),l===null)return null;Oh.copy(a),Oh.applyMatrix4(e.matrixWorld);var c=t.ray.origin.distanceTo(Oh);return c<t.near||c>t.far?null:{distance:c,point:Oh.clone(),object:e}}function Rh(e,n,t,i,r,s,o,a,l,c,h,u){$r.fromBufferAttribute(r,c),es.fromBufferAttribute(r,h),ts.fromBufferAttribute(r,u);var d=e.morphTargetInfluences;if(n.morphTargets&&s&&d){Dh.set(0,0,0),Lh.set(0,0,0),kh.set(0,0,0);for(var f=0,m=s.length;f<m;f++){var p=d[f],g=s[f];p!==0&&(Vf.fromBufferAttribute(g,c),Gf.fromBufferAttribute(g,h),jf.fromBufferAttribute(g,u),o?(Dh.addScaledVector(Vf,p),Lh.addScaledVector(Gf,p),kh.addScaledVector(jf,p)):(Dh.addScaledVector(Vf.sub($r),p),Lh.addScaledVector(Gf.sub(es),p),kh.addScaledVector(jf.sub(ts),p)))}$r.add(Dh),es.add(Lh),ts.add(kh)}e.isSkinnedMesh&&(e.boneTransform(c,$r),e.boneTransform(h,es),e.boneTransform(u,ts));var y=g0(e,n,t,i,$r,es,ts,El);if(y){a&&(zo.fromBufferAttribute(a,c),Bo.fromBufferAttribute(a,h),No.fromBufferAttribute(a,u),y.uv=Dn.getUV(El,$r,es,ts,zo,Bo,No,new ge)),l&&(zo.fromBufferAttribute(l,c),Bo.fromBufferAttribute(l,h),No.fromBufferAttribute(l,u),y.uv2=Dn.getUV(El,$r,es,ts,zo,Bo,No,new ge));var b=new Th(c,h,u);Dn.getNormal($r,es,ts,b.normal),y.face=b}return y}var VE=0,Yi=new Ct,Hf=new He,zh=new B;function mt(){Object.defineProperty(this,"id",{value:VE+=2}),this.uuid=xt.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}mt.prototype=Object.assign(Object.create(gr.prototype),{constructor:mt,isGeometry:!0,applyMatrix4:function(e){for(var n=new Un().getNormalMatrix(e),t=0,i=this.vertices.length;t<i;t++){var r=this.vertices[t];r.applyMatrix4(e)}for(var t=0,i=this.faces.length;t<i;t++){var s=this.faces[t];s.normal.applyMatrix3(n).normalize();for(var o=0,a=s.vertexNormals.length;o<a;o++)s.vertexNormals[o].applyMatrix3(n).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(e){return Yi.makeRotationX(e),this.applyMatrix4(Yi),this},rotateY:function(e){return Yi.makeRotationY(e),this.applyMatrix4(Yi),this},rotateZ:function(e){return Yi.makeRotationZ(e),this.applyMatrix4(Yi),this},translate:function(e,n,t){return Yi.makeTranslation(e,n,t),this.applyMatrix4(Yi),this},scale:function(e,n,t){return Yi.makeScale(e,n,t),this.applyMatrix4(Yi),this},lookAt:function(e){return Hf.lookAt(e),Hf.updateMatrix(),this.applyMatrix4(Hf.matrix),this},fromBufferGeometry:function(e){var n=this,t=e.index!==null?e.index.array:void 0,i=e.attributes;if(i.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var r=i.position.array,s=i.normal!==void 0?i.normal.array:void 0,o=i.color!==void 0?i.color.array:void 0,a=i.uv!==void 0?i.uv.array:void 0,l=i.uv2!==void 0?i.uv2.array:void 0;l!==void 0&&(this.faceVertexUvs[1]=[]);for(var c=0;c<r.length;c+=3)n.vertices.push(new B().fromArray(r,c)),o!==void 0&&n.colors.push(new Ye().fromArray(o,c));function h(y,b,A,w){var x=o===void 0?[]:[n.colors[y].clone(),n.colors[b].clone(),n.colors[A].clone()],M=s===void 0?[]:[new B().fromArray(s,y*3),new B().fromArray(s,b*3),new B().fromArray(s,A*3)],E=new Th(y,b,A,M,x,w);n.faces.push(E),a!==void 0&&n.faceVertexUvs[0].push([new ge().fromArray(a,y*2),new ge().fromArray(a,b*2),new ge().fromArray(a,A*2)]),l!==void 0&&n.faceVertexUvs[1].push([new ge().fromArray(l,y*2),new ge().fromArray(l,b*2),new ge().fromArray(l,A*2)])}var u=e.groups;if(u.length>0)for(var c=0;c<u.length;c++)for(var d=u[c],f=d.start,m=d.count,p=f,g=f+m;p<g;p+=3)t!==void 0?h(t[p],t[p+1],t[p+2],d.materialIndex):h(p,p+1,p+2,d.materialIndex);else if(t!==void 0)for(var c=0;c<t.length;c+=3)h(t[c],t[c+1],t[c+2]);else for(var c=0;c<r.length/3;c+=3)h(c,c+1,c+2);return this.computeFaceNormals(),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(zh).negate(),this.translate(zh.x,zh.y,zh.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,n=this.boundingSphere.radius,t=n===0?1:1/n,i=new Ct;return i.set(t,0,0,-t*e.x,0,t,0,-t*e.y,0,0,t,-t*e.z,0,0,0,1),this.applyMatrix4(i),this},computeFaceNormals:function(){for(var e=new B,n=new B,t=0,i=this.faces.length;t<i;t++){var r=this.faces[t],s=this.vertices[r.a],o=this.vertices[r.b],a=this.vertices[r.c];e.subVectors(a,o),n.subVectors(s,o),e.cross(n),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){e===void 0&&(e=!0);var n,t,i,r,s,o;for(o=new Array(this.vertices.length),n=0,t=this.vertices.length;n<t;n++)o[n]=new B;if(e){var a,l,c,h=new B,u=new B;for(i=0,r=this.faces.length;i<r;i++)s=this.faces[i],a=this.vertices[s.a],l=this.vertices[s.b],c=this.vertices[s.c],h.subVectors(c,l),u.subVectors(a,l),h.cross(u),o[s.a].add(h),o[s.b].add(h),o[s.c].add(h)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)s=this.faces[i],o[s.a].add(s.normal),o[s.b].add(s.normal),o[s.c].add(s.normal);for(n=0,t=this.vertices.length;n<t;n++)o[n].normalize();for(i=0,r=this.faces.length;i<r;i++){s=this.faces[i];var d=s.vertexNormals;d.length===3?(d[0].copy(o[s.a]),d[1].copy(o[s.b]),d[2].copy(o[s.c])):(d[0]=o[s.a].clone(),d[1]=o[s.b].clone(),d[2]=o[s.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,n,t;for(this.computeFaceNormals(),e=0,n=this.faces.length;e<n;e++){t=this.faces[e];var i=t.vertexNormals;i.length===3?(i[0].copy(t.normal),i[1].copy(t.normal),i[2].copy(t.normal)):(i[0]=t.normal.clone(),i[1]=t.normal.clone(),i[2]=t.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,n,t,i,r;for(t=0,i=this.faces.length;t<i;t++)for(r=this.faces[t],r.__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,n=r.vertexNormals.length;e<n;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var s=new mt;for(s.faces=this.faces,e=0,n=this.morphTargets.length;e<n;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,a=this.morphNormals[e].vertexNormals,c,h;for(t=0,i=this.faces.length;t<i;t++)c=new B,h={a:new B,b:new B,c:new B},o.push(c),a.push(h)}var l=this.morphNormals[e];s.vertices=this.morphTargets[e].vertices,s.computeFaceNormals(),s.computeVertexNormals();var c,h;for(t=0,i=this.faces.length;t<i;t++)r=this.faces[t],c=l.faceNormals[t],h=l.vertexNormals[t],c.copy(r.normal),h.a.copy(r.vertexNormals[0]),h.b.copy(r.vertexNormals[1]),h.c.copy(r.vertexNormals[2])}for(t=0,i=this.faces.length;t<i;t++)r=this.faces[t],r.normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new fi),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new Ui),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,n,t){if(!(e&&e.isGeometry)){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);return}var i,r=this.vertices.length,s=this.vertices,o=e.vertices,a=this.faces,l=e.faces,c=this.colors,h=e.colors;t===void 0&&(t=0),n!==void 0&&(i=new Un().getNormalMatrix(n));for(var u=0,d=o.length;u<d;u++){var f=o[u],m=f.clone();n!==void 0&&m.applyMatrix4(n),s.push(m)}for(var u=0,d=h.length;u<d;u++)c.push(h[u].clone());for(u=0,d=l.length;u<d;u++){var p=l[u],g,y,b,A=p.vertexNormals,w=p.vertexColors;g=new Th(p.a+r,p.b+r,p.c+r),g.normal.copy(p.normal),i!==void 0&&g.normal.applyMatrix3(i).normalize();for(var x=0,M=A.length;x<M;x++)y=A[x].clone(),i!==void 0&&y.applyMatrix3(i).normalize(),g.vertexNormals.push(y);g.color.copy(p.color);for(var x=0,M=w.length;x<M;x++)b=w[x],g.vertexColors.push(b.clone());g.materialIndex=p.materialIndex+t,a.push(g)}for(var u=0,d=e.faceVertexUvs.length;u<d;u++){var E=e.faceVertexUvs[u];this.faceVertexUvs[u]===void 0&&(this.faceVertexUvs[u]=[]);for(var x=0,M=E.length;x<M;x++){for(var S=E[x],T=[],z=0,D=S.length;z<D;z++)T.push(S[z].clone());this.faceVertexUvs[u].push(T)}}},mergeMesh:function(e){if(!(e&&e.isMesh)){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e);return}e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)},mergeVertices:function(){var e={},n=[],t=[],i,r,s=4,o=Math.pow(10,s),a,l,c,h,u,d;for(a=0,l=this.vertices.length;a<l;a++)i=this.vertices[a],r=Math.round(i.x*o)+"_"+Math.round(i.y*o)+"_"+Math.round(i.z*o),e[r]===void 0?(e[r]=a,n.push(this.vertices[a]),t[a]=n.length-1):t[a]=t[e[r]];var f=[];for(a=0,l=this.faces.length;a<l;a++){c=this.faces[a],c.a=t[c.a],c.b=t[c.b],c.c=t[c.c],h=[c.a,c.b,c.c];for(var m=0;m<3;m++)if(h[m]===h[(m+1)%3]){f.push(a);break}}for(a=f.length-1;a>=0;a--){var p=f[a];for(this.faces.splice(p,1),u=0,d=this.faceVertexUvs.length;u<d;u++)this.faceVertexUvs[u].splice(p,1)}var g=this.vertices.length-n.length;return this.vertices=n,g},setFromPoints:function(e){this.vertices=[];for(var n=0,t=e.length;n<t;n++){var i=e[n];this.vertices.push(new B(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,n=e.length,t=0;t<n;t++)e[t]._id=t;function i(c,h){return c.materialIndex-h.materialIndex}e.sort(i);var r=this.faceVertexUvs[0],s=this.faceVertexUvs[1],o,a;r&&r.length===n&&(o=[]),s&&s.length===n&&(a=[]);for(var t=0;t<n;t++){var l=e[t]._id;o&&o.push(r[l]),a&&a.push(s[l])}o&&(this.faceVertexUvs[0]=o),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),this.parameters!==void 0){var n=this.parameters;for(var t in n)n[t]!==void 0&&(e[t]=n[t]);return e}for(var i=[],r=0;r<this.vertices.length;r++){var s=this.vertices[r];i.push(s.x,s.y,s.z)}for(var o=[],a=[],l={},c=[],h={},u=[],d={},r=0;r<this.faces.length;r++){var f=this.faces[r],m=!0,p=!1,g=this.faceVertexUvs[0][r]!==void 0,y=f.normal.length()>0,b=f.vertexNormals.length>0,A=f.color.r!==1||f.color.g!==1||f.color.b!==1,w=f.vertexColors.length>0,x=0;if(x=T(x,0,0),x=T(x,1,m),x=T(x,2,p),x=T(x,3,g),x=T(x,4,y),x=T(x,5,b),x=T(x,6,A),x=T(x,7,w),o.push(x),o.push(f.a,f.b,f.c),o.push(f.materialIndex),g){var M=this.faceVertexUvs[0][r];o.push(k(M[0]),k(M[1]),k(M[2]))}if(y&&o.push(z(f.normal)),b){var E=f.vertexNormals;o.push(z(E[0]),z(E[1]),z(E[2]))}if(A&&o.push(D(f.color)),w){var S=f.vertexColors;o.push(D(S[0]),D(S[1]),D(S[2]))}}function T(R,G,I){return I?R|1<<G:R&~(1<<G)}function z(R){var G=R.x.toString()+R.y.toString()+R.z.toString();return l[G]!==void 0||(l[G]=a.length/3,a.push(R.x,R.y,R.z)),l[G]}function D(R){var G=R.r.toString()+R.g.toString()+R.b.toString();return h[G]!==void 0||(h[G]=c.length,c.push(R.getHex())),h[G]}function k(R){var G=R.x.toString()+R.y.toString();return d[G]!==void 0||(d[G]=u.length/2,u.push(R.x,R.y)),d[G]}return e.data={},e.data.vertices=i,e.data.normals=a,c.length>0&&(e.data.colors=c),u.length>0&&(e.data.uvs=[u]),e.data.faces=o,e},clone:function(){return new mt().copy(this)},copy:function(e){var n,t,i,r,s,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var a=e.vertices;for(n=0,t=a.length;n<t;n++)this.vertices.push(a[n].clone());var l=e.colors;for(n=0,t=l.length;n<t;n++)this.colors.push(l[n].clone());var c=e.faces;for(n=0,t=c.length;n<t;n++)this.faces.push(c[n].clone());for(n=0,t=e.faceVertexUvs.length;n<t;n++){var h=e.faceVertexUvs[n];for(this.faceVertexUvs[n]===void 0&&(this.faceVertexUvs[n]=[]),i=0,r=h.length;i<r;i++){var u=h[i],d=[];for(s=0,o=u.length;s<o;s++){var f=u[s];d.push(f.clone())}this.faceVertexUvs[n].push(d)}}var m=e.morphTargets;for(n=0,t=m.length;n<t;n++){var p={};if(p.name=m[n].name,m[n].vertices!==void 0)for(p.vertices=[],i=0,r=m[n].vertices.length;i<r;i++)p.vertices.push(m[n].vertices[i].clone());if(m[n].normals!==void 0)for(p.normals=[],i=0,r=m[n].normals.length;i<r;i++)p.normals.push(m[n].normals[i].clone());this.morphTargets.push(p)}var g=e.morphNormals;for(n=0,t=g.length;n<t;n++){var y={};if(g[n].vertexNormals!==void 0)for(y.vertexNormals=[],i=0,r=g[n].vertexNormals.length;i<r;i++){var b=g[n].vertexNormals[i],A={};A.a=b.a.clone(),A.b=b.b.clone(),A.c=b.c.clone(),y.vertexNormals.push(A)}if(g[n].faceNormals!==void 0)for(y.faceNormals=[],i=0,r=g[n].faceNormals.length;i<r;i++)y.faceNormals.push(g[n].faceNormals[i].clone());this.morphNormals.push(y)}var w=e.skinWeights;for(n=0,t=w.length;n<t;n++)this.skinWeights.push(w[n].clone());var x=e.skinIndices;for(n=0,t=x.length;n<t;n++)this.skinIndices.push(x[n].clone());var M=e.lineDistances;for(n=0,t=M.length;n<t;n++)this.lineDistances.push(M[n]);var E=e.boundingBox;E!==null&&(this.boundingBox=E.clone());var S=e.boundingSphere;return S!==null&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class GE extends mt{constructor(n,t,i,r,s,o){super(),this.type="BoxGeometry",this.parameters={width:n,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o},this.fromBufferGeometry(new Bh(n,t,i,r,s,o)),this.mergeVertices()}}class Bh extends Xe{constructor(n,t,i,r,s,o){super(),this.type="BoxBufferGeometry",this.parameters={width:n,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;n=n||1,t=t||1,i=i||1,r=Math.floor(r)||1,s=Math.floor(s)||1,o=Math.floor(o)||1;const l=[],c=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,i,t,n,o,s,0),m("z","y","x",1,-1,i,t,-n,o,s,1),m("x","z","y",1,1,n,i,t,r,o,2),m("x","z","y",1,-1,n,i,-t,r,o,3),m("x","y","z",1,-1,n,t,i,r,s,4),m("x","y","z",-1,-1,n,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Be(c,3)),this.setAttribute("normal",new Be(h,3)),this.setAttribute("uv",new Be(u,2));function m(p,g,y,b,A,w,x,M,E,S,T){const z=w/E,D=x/S,k=w/2,R=x/2,G=M/2,I=E+1,U=S+1;let J=0,K=0;const ne=new B;for(let ie=0;ie<U;ie++){const pe=ie*D-R;for(let be=0;be<I;be++){const Ae=be*z-k;ne[p]=Ae*b,ne[g]=pe*A,ne[y]=G,c.push(ne.x,ne.y,ne.z),ne[p]=0,ne[g]=0,ne[y]=M>0?1:-1,h.push(ne.x,ne.y,ne.z),u.push(be/E),u.push(1-ie/S),J+=1}}for(let ie=0;ie<S;ie++)for(let pe=0;pe<E;pe++){const be=d+pe+I*ie,Ae=d+pe+I*(ie+1),Je=d+(pe+1)+I*(ie+1),we=d+(pe+1)+I*ie;l.push(be,Ae,we),l.push(Ae,Je,we),K+=6}a.addGroup(f,K,T),f+=K,d+=J}}}function Fo(e){var n={};for(var t in e){n[t]={};for(var i in e[t]){var r=e[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?n[t][i]=r.clone():Array.isArray(r)?n[t][i]=r.slice():n[t][i]=r}}return n}function Bn(e){for(var n={},t=0;t<e.length;t++){var i=Fo(e[t]);for(var r in i)n[r]=i[r]}return n}var jE={clone:Fo,merge:Bn},HE=`void main() {
|
|
102
102
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
103
103
|
}`,UE=`void main() {
|
|
104
104
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
@@ -3171,7 +3171,7 @@ void main() {
|
|
|
3171
3171
|
svg [type='lineItemGroup'] g g g g {
|
|
3172
3172
|
stroke: #ffffff;
|
|
3173
3173
|
}</style>
|
|
3174
|
-
`;return e.$$set=s=>{"content"in s&&t(0,i=s.content)},[i,r]}class _D extends Oe{constructor(n){super(),ke(this,n,ED,PD,Le,{content:0},CD)}}function SD(e){Ue(e,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function ID(e){let n,t;return n=new MD({props:{url:e[1].url}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&2&&(s.url=i[1].url),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function TD(e){let n,t;return n=new _D({props:{content:e[0]}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.content=i[0]),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function DD(e){let n,t,i,r;const s=[TD,ID],o=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(t=a(e))&&(i=o[t]=s[t](e)),{c(){n=H("div"),i&&i.c(),_(n,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){X(l,n,c),~t&&o[t].m(n,null),r=!0},p(l,[c]){let h=t;t=a(l),t===h?~t&&o[t].p(l,c):(i&&(Fe(),Z(o[h],1,1,()=>{o[h]=null}),Ve()),~t?(i=o[t],i?i.p(l,c):(i=o[t]=s[t](l),i.c()),N(i,1),i.m(n,null)):i=null)},i(l){r||(N(i),r=!0)},o(l){Z(i),r=!1},d(l){l&&Y(n),~t&&o[t].d()}}}function LD(e,n,t){let i,r,{floorIndex:s}=n,{floorplanData:o}=n;return e.$$set=a=>{"floorIndex"in a&&t(2,s=a.floorIndex),"floorplanData"in a&&t(3,o=a.floorplanData)},e.$$.update=()=>{var a,l;e.$$.dirty&12&&t(1,i=o.outlines[s]),e.$$.dirty&12&&t(0,r=(l=(a=o.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[r,i,s,o]}class iA extends Oe{constructor(n){super(),ke(this,n,LD,DD,Le,{floorIndex:2,floorplanData:3},SD)}}function kD(e){Ue(e,"svelte-9vzn2f",".floorplan-plugin__room-label-item.svelte-9vzn2f{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-part1.svelte-9vzn2f{display:flex;flex-flow:column;align-items:center;color:#fff;white-space:nowrap}.floorplan-plugin__room-area.svelte-9vzn2f{opacity:0.6;line-height:1.25;margin-top:0.125rem}")}function OD(e){let n,t=e[15].outerHTML+"",i;return{c(){n=new Qu(!1),i=pt(),n.a=i},m(r,s){n.m(t,r,s),X(r,i,s)},p(r,s){s[0]&32768&&t!==(t=r[15].outerHTML+"")&&n.p(t)},d(r){r&&Y(i),r&&n.d()}}}function RD(e){let n,t,i,r,s,o,a=e[1]&&rA(e),l=e[0]&&sA(e),c=e[2]&&oA(e);return{c(){n=H("div"),a&&a.c(),t=ye(),l&&l.c(),i=ye(),c&&c.c(),r=pt(),_(n,"class","floorplan-plugin__room-part1 svelte-9vzn2f"),W(n,"opacity",e[11]?"1":"0")},m(h,u){X(h,n,u),a&&a.m(n,null),Q(n,t),l&&l.m(n,null),X(h,i,u),c&&c.m(h,u),X(h,r,u),s||(o=[zi(ys.call(null,n)),lt(n,"clientWidth",e[32]),lt(n,"clientHeight",e[33])],s=!0)},p(h,u){h[1]?a?a.p(h,u):(a=rA(h),a.c(),a.m(n,t)):a&&(a.d(1),a=null),h[0]?l?l.p(h,u):(l=sA(h),l.c(),l.m(n,null)):l&&(l.d(1),l=null),u[0]&2048&&W(n,"opacity",h[11]?"1":"0"),h[2]?c?c.p(h,u):(c=oA(h),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(h){h&&Y(n),a&&a.d(),l&&l.d(),h&&Y(i),c&&c.d(h),h&&Y(r),s=!1,bn(o)}}}function rA(e){let n,t=e[3].name+"",i;return{c(){n=H("span"),i=Mt(t),_(n,"class","floorplan-plugin__room-name")},m(r,s){X(r,n,s),Q(n,i)},p(r,s){s[0]&8&&t!==(t=r[3].name+"")&&Pt(i,t)},d(r){r&&Y(n)}}}function sA(e){let n,t;return{c(){n=H("span"),t=Mt(e[14]),_(n,"class","floorplan-plugin__room-area svelte-9vzn2f"),W(n,"font-size",e[19])},m(i,r){X(i,n,r),Q(n,t)},p(i,r){r[0]&16384&&Pt(t,i[14])},d(i){i&&Y(n)}}}function oA(e){let n,t;return{c(){n=H("span"),t=Mt(e[13]),_(n,"class","floorplan-plugin__room-size"),W(n,"font-size",e[19]),W(n,"opacity",e[10]?"0.6":"0")},m(i,r){X(i,n,r),Q(n,t)},p(i,r){r[0]&8192&&Pt(t,i[13]),r[0]&1024&&W(n,"opacity",i[10]?"0.6":"0")},d(i){i&&Y(n)}}}function zD(e){let n,t,i;function r(a,l){if(a[4]===void 0)return RD;if(a[15])return OD}let s=r(e),o=s&&s(e);return{c(){n=H("div"),o&&o.c(),_(n,"class","floorplan-plugin__room-label-item svelte-9vzn2f"),W(n,"left",e[16]),W(n,"top",e[17]),W(n,"font-size",e[18]),W(n,"opacity",e[12]?"1":"0"),W(n,"transform",e[9]?"translate(-50%, calc(-50% + 6px))":"translate(-50%, -50%)")},m(a,l){X(a,n,l),o&&o.m(n,null),t||(i=[zi(ys.call(null,n)),lt(n,"clientWidth",e[34]),lt(n,"clientHeight",e[35])],t=!0)},p(a,l){s===(s=r(a))&&o?o.p(a,l):(o&&o.d(1),o=s&&s(a),o&&(o.c(),o.m(n,null))),l[0]&4096&&W(n,"opacity",a[12]?"1":"0"),l[0]&512&&W(n,"transform",a[9]?"translate(-50%, calc(-50% + 6px))":"translate(-50%, -50%)")},i:de,o:de,d(a){a&&Y(n),o&&o.d(),t=!1,bn(i)}}}function BD(e,n){const t=e[0],i=e[1];let r=!1;for(let s=0,o=n.length-1;s<n.length;o=s++){const a=n[s][0],l=n[s][1],c=n[o][0],h=n[o][1];l>i!=h>i&&t<(c-a)*(i-l)/(h-l)+a&&(r=!r)}return r}function ND(e,n,t){let i,r,s,o,a,l,c,h,u,d,f,m,p,{pxmm:g}=n,{roomAreaEnable:y}=n,{roomNameEnable:b}=n,{roomDimensionEnable:A}=n,{room:w}=n,{hoveredRoom:x}=n,{getRoomAreaText:M}=n,{getRoomDimensionText:E}=n,{getLabelElement:S}=n,{adaptiveRoomLabelVisibleEnable:T}=n;function z(se,Me){if(Me.width===0||Me.height===0)return()=>!1;const Ge=se.path.map(({x:F,y:j})=>[F,j]),ae=se.roomLabel.position,{x:me,y:De}=ae,{width:We,height:gt}=Me,Ce=We/2,je=gt/2;return function(j){const _e=me*j,ve=De*j,Ke=Ge.map(([fe,ot])=>[fe*j,ot*j]);return[[_e+Ce,ve-je],[_e-Ce,ve-je],[_e-Ce,ve+je],[_e+Ce,ve+je]].every(fe=>BD(fe,Ke))}}const D=document.body.clientWidth,k=document.body.clientHeight,R=w.roomLabel,G=R.positionInImage.x*100+"%",I=R.positionInImage.y*100+"%",U=(D<500||k<500?10:14)+"px",J=(D<500||k<500?8:12)+"px";let K=0,ne=0,ie=0,pe=0,be=!1;x.subscribe(function(Me){t(25,be=!!Me&&Me.id===w.id)});const Ae=se=>{t(7,ie=se.detail)},Je=se=>{t(8,pe=se.detail)},we=se=>{t(5,K=se.detail)},le=se=>{t(6,ne=se.detail)};return e.$$set=se=>{"pxmm"in se&&t(20,g=se.pxmm),"roomAreaEnable"in se&&t(0,y=se.roomAreaEnable),"roomNameEnable"in se&&t(1,b=se.roomNameEnable),"roomDimensionEnable"in se&&t(2,A=se.roomDimensionEnable),"room"in se&&t(3,w=se.room),"hoveredRoom"in se&&t(21,x=se.hoveredRoom),"getRoomAreaText"in se&&t(22,M=se.getRoomAreaText),"getRoomDimensionText"in se&&t(23,E=se.getRoomDimensionText),"getLabelElement"in se&&t(4,S=se.getLabelElement),"adaptiveRoomLabelVisibleEnable"in se&&t(24,T=se.adaptiveRoomLabelVisibleEnable)},e.$$.update=()=>{var se,Me;e.$$.dirty[0]&24&&t(15,i=S==null?void 0:S(w)),e.$$.dirty[0]&4194312&&t(14,r=w.size?M(w.size):""),e.$$.dirty[0]&8388616&&t(13,s=w!=null&&w.dimension?E((se=w.dimension)==null?void 0:se.width,(Me=w.dimension)==null?void 0:Me.height):""),e.$$.dirty[0]&384&&t(31,o={width:ie,height:pe}),e.$$.dirty[0]&8|e.$$.dirty[1]&1&&t(30,a=o?z(w,o):void 0),e.$$.dirty[0]&1091567616&&t(27,l=T?!!(a!=null&&a(g)):!0),e.$$.dirty[0]&96&&t(29,c={width:K,height:ne}),e.$$.dirty[0]&536870920&&t(28,h=c?z(w,c):void 0),e.$$.dirty[0]&286261248&&t(26,u=T?!!(h!=null&&h(g)):!0),e.$$.dirty[0]&234881024&&t(12,d=u||l||be),e.$$.dirty[0]&167772160&&t(11,f=l||be),e.$$.dirty[0]&100663296&&t(10,m=u||be),e.$$.dirty[0]&201326592&&t(9,p=l&&!u)},[y,b,A,w,S,K,ne,ie,pe,p,m,f,d,s,r,i,G,I,U,J,g,x,M,E,T,be,u,l,h,c,a,o,Ae,Je,we,le]}class FD extends Oe{constructor(n){super(),ke(this,n,ND,zD,Le,{pxmm:20,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,room:3,hoveredRoom:21,getRoomAreaText:22,getRoomDimensionText:23,getLabelElement:4,adaptiveRoomLabelVisibleEnable:24},kD,[-1,-1])}}function VD(e){Ue(e,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function aA(e,n,t){const i=e.slice();return i[14]=n[t],i}function lA(e){let n,t=[],i=new Map,r,s,o,a=e[10];const l=c=>c[14].id;for(let c=0;c<a.length;c+=1){let h=aA(e,a,c),u=l(h);i.set(u,t[c]=cA(u,h))}return{c(){n=H("div");for(let c=0;c<t.length;c+=1)t[c].c();_(n,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,h){X(c,n,h);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(n,null);r=!0,s||(o=[zi(ys.call(null,n)),lt(n,"clientWidth",e[13])],s=!0)},p(c,h){h&1791&&(a=c[10],Fe(),t=Ni(t,h,l,1,c,a,i,n,vs,cA,null,aA),Ve())},i(c){if(!r){for(let h=0;h<a.length;h+=1)N(t[h]);r=!0}},o(c){for(let h=0;h<t.length;h+=1)Z(t[h]);r=!1},d(c){c&&Y(n);for(let h=0;h<t.length;h+=1)t[h].d();s=!1,bn(o)}}}function cA(e,n){let t,i,r;const s=[{pxmm:n[9],room:n[14],hoveredRoom:n[3],roomAreaEnable:n[0],roomNameEnable:n[1],roomDimensionEnable:n[2],getLabelElement:n[6],getRoomAreaText:n[4],getRoomDimensionText:n[5],adaptiveRoomLabelVisibleEnable:n[7]}];let o={};for(let a=0;a<s.length;a+=1)o=Ln(o,s[a]);return i=new FD({props:o}),{key:e,first:null,c(){t=pt(),Te(i.$$.fragment),this.first=t},m(a,l){X(a,t,l),Se(i,a,l),r=!0},p(a,l){n=a;const c=l&1791?Vn(s,[{pxmm:n[9],room:n[14],hoveredRoom:n[3],roomAreaEnable:n[0],roomNameEnable:n[1],roomDimensionEnable:n[2],getLabelElement:n[6],getRoomAreaText:n[4],getRoomDimensionText:n[5],adaptiveRoomLabelVisibleEnable:n[7]}]):{};i.$set(c)},i(a){r||(N(i.$$.fragment,a),r=!0)},o(a){Z(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Ie(i,a)}}}function GD(e){let n,t,i=e[10]&&lA(e);return{c(){i&&i.c(),n=pt()},m(r,s){i&&i.m(r,s),X(r,n,s),t=!0},p(r,[s]){r[10]?i?(i.p(r,s),s&1024&&N(i,1)):(i=lA(r),i.c(),N(i,1),i.m(n.parentNode,n)):i&&(Fe(),Z(i,1,1,()=>{i=null}),Ve())},i(r){t||(N(i),t=!0)},o(r){Z(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function jD(e,n,t){let i,{floorIndex:r}=n,{roomAreaEnable:s}=n,{roomNameEnable:o}=n,{roomDimensionEnable:a}=n,{floorplanData:l}=n,{hoveredRoom:c}=n,{getRoomAreaText:h}=n,{getRoomDimensionText:u}=n,{getLabelElement:d}=n,{adaptiveRoomLabelVisibleEnable:f}=n,m=0,p=0;const g=y=>{t(8,m=y.detail)};return e.$$set=y=>{"floorIndex"in y&&t(11,r=y.floorIndex),"roomAreaEnable"in y&&t(0,s=y.roomAreaEnable),"roomNameEnable"in y&&t(1,o=y.roomNameEnable),"roomDimensionEnable"in y&&t(2,a=y.roomDimensionEnable),"floorplanData"in y&&t(12,l=y.floorplanData),"hoveredRoom"in y&&t(3,c=y.hoveredRoom),"getRoomAreaText"in y&&t(4,h=y.getRoomAreaText),"getRoomDimensionText"in y&&t(5,u=y.getRoomDimensionText),"getLabelElement"in y&&t(6,d=y.getLabelElement),"adaptiveRoomLabelVisibleEnable"in y&&t(7,f=y.adaptiveRoomLabelVisibleEnable)},e.$$.update=()=>{if(e.$$.dirty&6144&&t(10,i=l.floorDatas[r].rooms),e.$$.dirty&4352){const{max:y,min:b}=l.bounding,A=y.x-b.x;t(9,p=m/A)}},[s,o,a,c,h,u,d,f,m,p,i,r,l,g]}class HD extends Oe{constructor(n){super(),ke(this,n,jD,GD,Le,{floorIndex:11,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,floorplanData:12,hoveredRoom:3,getRoomAreaText:4,getRoomDimensionText:5,getLabelElement:6,adaptiveRoomLabelVisibleEnable:7},VD)}}function UD(e){Ue(e,"svelte-1fuyezq",".floorplan-plugin__rule-labels.svelte-1fuyezq.svelte-1fuyezq{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-1fuyezq.svelte-1fuyezq{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq.svelte-1fuyezq{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq.svelte-1fuyezq{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq.svelte-1fuyezq{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-1fuyezq.svelte-1fuyezq{background:#fff;opacity:0.2;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-1fuyezq.svelte-1fuyezq{position:absolute;background:#fff;opacity:0.2;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale.svelte-1fuyezq{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute}.floorplan-plugin__rule-labels--top.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-1fuyezq.svelte-1fuyezq{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-text-item.svelte-1fuyezq{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-1fuyezq.svelte-1fuyezq{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.35}")}function hA(e,n,t){const i=e.slice();return i[11]=n[t],i[13]=t,i}function uA(e,n,t){const i=e.slice();return i[14]=n[t],i}function dA(e){let n;return{c(){n=H("div"),_(n,"class","floorplan-plugin__rule-scale svelte-1fuyezq"),W(n,"left",e[14].left*100+"%"),W(n,"bottom",e[14].bottom*100+"%")},m(t,i){X(t,n,i)},p:de,d(t){t&&Y(n)}}}function fA(e,n){let t,i,r=n[1](n[11].distance)+"",s,o;return{key:e,first:null,c(){t=H("div"),i=H("div"),s=Mt(r),o=ye(),_(i,"class","floorplan-plugin__rule-text svelte-1fuyezq"),Ee(i,"is-row",n[2]),_(t,"class","floorplan-plugin__rule-text-item svelte-1fuyezq"),W(t,"left",n[11].left*100+"%"),W(t,"bottom",n[11].bottom*100+"%"),this.first=t},m(a,l){X(a,t,l),Q(t,i),Q(i,s),Q(t,o)},p(a,l){n=a,l&2&&r!==(r=n[1](n[11].distance)+"")&&Pt(s,r)},d(a){a&&Y(t)}}}function WD(e){let n,t,i,r,s,o,a=[],l=new Map,c,h=e[3],u=[];for(let m=0;m<h.length;m+=1)u[m]=dA(uA(e,h,m));let d=e[4];const f=m=>m[13];for(let m=0;m<d.length;m+=1){let p=hA(e,d,m),g=f(p);l.set(g,a[m]=fA(g,p))}return{c(){n=H("div"),t=H("div"),i=ye(),r=H("div");for(let m=0;m<u.length;m+=1)u[m].c();s=ye(),o=H("div");for(let m=0;m<a.length;m+=1)a[m].c();_(t,"class","floorplan-plugin__rule-line svelte-1fuyezq"),_(r,"class","floorplan-plugin__rule-scale-wrapper svelte-1fuyezq"),Ee(r,"is-row",e[2]),_(o,"class","floorplan-plugin__rule-text-wrapper svelte-1fuyezq"),_(n,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+e[0]+" svelte-1fuyezq"),Ee(n,"is-row",e[2]),W(n,"width",e[2]?"100%":1/16+"rem"),W(n,"height",e[2]?1/16+"rem":"100%")},m(m,p){X(m,n,p),Q(n,t),Q(n,i),Q(n,r);for(let g=0;g<u.length;g+=1)u[g]&&u[g].m(r,null);Q(n,s),Q(n,o);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(o,null)},p(m,[p]){if(p&8){h=m[3];let g;for(g=0;g<h.length;g+=1){const y=uA(m,h,g);u[g]?u[g].p(y,p):(u[g]=dA(y),u[g].c(),u[g].m(r,null))}for(;g<u.length;g+=1)u[g].d(1);u.length=h.length}p&22&&(d=m[4],a=Ni(a,p,f,1,m,d,l,o,Am,fA,null,hA)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+m[0]+" svelte-1fuyezq")&&_(n,"class",c),p&5&&Ee(n,"is-row",m[2])},i:de,o:de,d(m){m&&Y(n),Bi(u,m);for(let p=0;p<a.length;p+=1)a[p].d()}}}const Fa=1e3,Va=180;function QD(e,n,t){let{type:i}=n,{data:r}=n,{bounding:s}=n,{getRuleDistanceText:o}=n;const a=i==="top"||i==="bottom",l=s.max.x-s.min.x-(Fa-Va)*2,c=s.max.y-s.min.y-(Fa-Va)*2,h=r.map(([m,p])=>a?[m.x,p.x]:[m.y,p.y]).flat().sort().filter((m,p,g)=>p===0?!0:m!==g[p-1]),u=h.map(m=>{const p=a?(m-s.min.x-Fa+Va)/l:0,g=a?0:(m-s.min.y-Fa+Va)/c;return{left:p,bottom:g}});u.unshift({left:0,bottom:0}),u.push(a?{left:1,bottom:0}:{left:0,bottom:1});const d=h[h.length-1]-h[0],f=h.map((m,p,g)=>{const y=p===0?0:m-g[p-1],b=p===0?0:(m+g[p-1])/2,A=a?(b-s.min.x-Fa+Va)/l:0,w=a?0:(b-s.min.y-Fa+Va)/c;return{left:A,bottom:w,distance:y}}).filter(({distance:m})=>m/d>.1);return e.$$set=m=>{"type"in m&&t(0,i=m.type),"data"in m&&t(5,r=m.data),"bounding"in m&&t(6,s=m.bounding),"getRuleDistanceText"in m&&t(1,o=m.getRuleDistanceText)},[i,o,a,u,f,r,s]}class YD extends Oe{constructor(n){super(),ke(this,n,QD,WD,Le,{type:0,data:5,bounding:6,getRuleDistanceText:1},UD)}}function XD(e){Ue(e,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function pA(e,n,t){const i=e.slice();return i[13]=n[t][0],i[14]=n[t][1],i}function mA(e,n){let t,i,r;const s=[{type:n[13],data:n[14],bounding:n[1],getRuleDistanceText:n[0]}];let o={};for(let a=0;a<s.length;a+=1)o=Ln(o,s[a]);return i=new YD({props:o}),{key:e,first:null,c(){t=pt(),Te(i.$$.fragment),this.first=t},m(a,l){X(a,t,l),Se(i,a,l),r=!0},p(a,l){n=a;const c=l&19?Vn(s,[{type:n[13],data:n[14],bounding:n[1],getRuleDistanceText:n[0]}]):{};i.$set(c)},i(a){r||(N(i.$$.fragment,a),r=!0)},o(a){Z(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Ie(i,a)}}}function ZD(e){let n,t=[],i=new Map,r,s=e[4];const o=a=>a[13];for(let a=0;a<s.length;a+=1){let l=pA(e,s,a),c=o(l);i.set(c,t[a]=mA(c,l))}return{c(){n=H("div");for(let a=0;a<t.length;a+=1)t[a].c();_(n,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),W(n,"width",e[3]),W(n,"height",e[2])},m(a,l){X(a,n,l);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(n,null);r=!0},p(a,[l]){l&19&&(s=a[4],Fe(),t=Ni(t,l,o,1,a,s,i,n,vs,mA,null,pA),Ve()),l&8&&W(n,"width",a[3]),l&4&&W(n,"height",a[2])},i(a){if(!r){for(let l=0;l<s.length;l+=1)N(t[l]);r=!0}},o(a){for(let l=0;l<t.length;l+=1)Z(t[l]);r=!1},d(a){a&&Y(n);for(let l=0;l<t.length;l+=1)t[l].d()}}}const gA=1e3,vA=180;function qD(e,n,t){let i,r,s,o,a,l,c,h,u,d,{floorIndex:f}=n,{floorplanData:m}=n,{getRuleDistanceText:p}=n;return e.$$set=g=>{"floorIndex"in g&&t(5,f=g.floorIndex),"floorplanData"in g&&t(6,m=g.floorplanData),"getRuleDistanceText"in g&&t(0,p=g.getRuleDistanceText)},e.$$.update=()=>{e.$$.dirty&64&&t(1,i=m.bounding),e.$$.dirty&96&&t(11,r=m.floorDatas[f].rules),e.$$.dirty&2048&&t(12,s=Object.keys(r)),e.$$.dirty&6144&&t(4,o=s.map(g=>[g,r[g]])),e.$$.dirty&2&&t(9,a=i.max.x-i.min.x),e.$$.dirty&2&&t(7,l=i.max.y-i.min.y),e.$$.dirty&2&&t(10,c=i.max.x-i.min.x-(gA-vA)*2),e.$$.dirty&2&&t(8,h=i.max.y-i.min.y-(gA-vA)*2),e.$$.dirty&1536&&t(3,u=c/a*100+"%"),e.$$.dirty&384&&t(2,d=h/l*100+"%")},[p,i,d,u,o,f,m,l,h,a,c,r,s]}class JD extends Oe{constructor(n){super(),ke(this,n,qD,ZD,Le,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},XD)}}function rd(e,n={}){let t="";const{needZ:i,needA:r}=n;return(i?e.slice().concat(e[0]):e.slice()).forEach((o,a)=>{const{x:l,y:c}=n.format?n.format(o):o,h=l+","+c;return a===0?(t+="M"+h,t):r!=null&&r[a]?(t+="A"+r[a]+","+h,t):(t+="L"+h,t)}),t+(i?"Z":"")}function yA({x:e,y:n},t){const{max:i,min:r}=t;return{x:e-r.x,y:i.y-n}}function KD(e,n){const t=e.x*1e3+n.bounding.origin.x,i=-e.z*1e3+n.bounding.origin.y;return{x:t,y:i}}function $D(e,n){const t=n.bounding,i=t.max.x-t.min.x,r=t.max.y-t.min.y;return{x:(e.x-t.min.x)/i,y:(t.max.y-e.y)/r}}function eL(e,n){return Math.max(...n.work.observers.map(i=>e.z>=i.standingPosition.z?i.floorIndex:0))}function tL(e){let n;return{c(){n=Bt("path"),_(n,"d",e[0]),_(n,"fill","#2F313A")},m(t,i){X(t,n,i)},p(t,[i]){i&1&&_(n,"d",t[0])},i:de,o:de,d(t){t&&Y(n)}}}function nL(e,n,t){let i,{path:r}=n;return e.$$set=s=>{"path"in s&&t(1,r=s.path)},e.$$.update=()=>{e.$$.dirty&2&&t(0,i=rd(r,{needZ:!0}))},[i,r]}class iL extends Oe{constructor(n){super(),ke(this,n,nL,tL,Le,{path:1})}}function rL(e){let n,t,i,r,s,o;return{c(){n=Bt("defs"),t=Bt("pattern"),i=Bt("rect"),r=Bt("path"),s=ye(),o=Bt("path"),_(i,"x","0"),_(i,"y","0"),_(i,"width",e[1]),_(i,"height",e[1]),_(i,"fill","#323747"),_(r,"d",e[2]),_(r,"stroke","#ffffff"),_(r,"stroke-opacity","0.06"),_(r,"stroke-width","0.5"),_(r,"fill","none"),_(t,"id","fpm-room-pattern-0"),_(t,"x","0"),_(t,"y","0"),_(t,"width",e[1]),_(t,"height",e[1]),_(t,"patternUnits","userSpaceOnUse"),_(t,"patternTransform","scale(50 50)"),_(o,"d",e[0]),_(o,"fill","url(#fpm-room-pattern-0)")},m(a,l){X(a,n,l),Q(n,t),Q(t,i),Q(t,r),X(a,s,l),X(a,o,l)},p(a,[l]){l&1&&_(o,"d",a[0])},i:de,o:de,d(a){a&&Y(n),a&&Y(s),a&&Y(o)}}}const Cm=6;function sL(e,n,t){let i,{path:r}=n;const s=Cm*2,o=`M0 ${Cm} h ${s} M${Cm} 0 v ${s}`;return e.$$set=a=>{"path"in a&&t(3,r=a.path)},e.$$.update=()=>{e.$$.dirty&8&&t(0,i=rd(r,{needZ:!0}))},[i,s,o,r]}class oL extends Oe{constructor(n){super(),ke(this,n,sL,rL,Le,{path:3})}}function aL(e){let n,t,i,r,s,o,a,l,c,h,u;return{c(){n=Bt("defs"),t=Bt("pattern"),i=Bt("rect"),r=Bt("pattern"),s=Bt("rect"),o=ye(),a=Bt("path"),l=ye(),c=Bt("path"),h=ye(),u=Bt("path"),_(i,"x","0"),_(i,"y","0"),_(i,"width","6"),_(i,"height","50"),_(i,"fill","none"),_(i,"stroke","#4B4B57"),_(i,"stroke-width","0.5"),_(t,"id","room-material-pattern-1"),_(t,"x","0"),_(t,"y","0"),_(t,"width","12"),_(t,"height","50"),_(t,"patternUnits","userSpaceOnUse"),_(t,"patternTransform","scale(50 50)"),_(s,"x","0"),_(s,"y","0"),_(s,"width","6"),_(s,"height","50"),_(s,"fill","none"),_(s,"stroke","#4B4B57"),_(s,"stroke-width","0.5"),_(r,"id","room-material-pattern-2"),_(r,"x","6"),_(r,"y","25"),_(r,"width","12"),_(r,"height","50"),_(r,"patternUnits","userSpaceOnUse"),_(r,"patternTransform","scale(50 50)"),_(a,"d",e[0]),_(a,"fill","#43434D"),_(c,"d",e[0]),_(c,"fill","url(#room-material-pattern-1)"),_(u,"d",e[0]),_(u,"fill","url(#room-material-pattern-2)")},m(d,f){X(d,n,f),Q(n,t),Q(t,i),Q(n,r),Q(r,s),X(d,o,f),X(d,a,f),X(d,l,f),X(d,c,f),X(d,h,f),X(d,u,f)},p(d,[f]){f&1&&_(a,"d",d[0]),f&1&&_(c,"d",d[0]),f&1&&_(u,"d",d[0])},i:de,o:de,d(d){d&&Y(n),d&&Y(o),d&&Y(a),d&&Y(l),d&&Y(c),d&&Y(h),d&&Y(u)}}}function lL(e,n,t){let i,{path:r}=n;return e.$$set=s=>{"path"in s&&t(1,r=s.path)},e.$$.update=()=>{e.$$.dirty&2&&t(0,i=rd(r,{needZ:!0}))},[i,r]}class cL extends Oe{constructor(n){super(),ke(this,n,lL,aL,Le,{path:1})}}function hL(e){Ue(e,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function bA(e,n,t){const i=e.slice();return i[5]=n[t],i}function uL(e){let n,t;return n=new oL({props:{path:e[5].path}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function dL(e){let n,t;return n=new cL({props:{path:e[5].path}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function fL(e){let n,t;return n=new iL({props:{path:e[5].path}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function AA(e){let n,t,i,r;const s=[fL,dL,uL],o=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return t=a(e),i=o[t]=s[t](e),{c(){n=Bt("svg"),i.c(),_(n,"width","100%"),_(n,"height","100%"),_(n,"viewBox",`0 0 ${e[1]} ${e[2]}`),_(n,"class","svelte-1dykexu")},m(l,c){X(l,n,c),o[t].m(n,null),r=!0},p(l,c){let h=t;t=a(l),t===h?o[t].p(l,c):(Fe(),Z(o[h],1,1,()=>{o[h]=null}),Ve(),i=o[t],i?i.p(l,c):(i=o[t]=s[t](l),i.c()),N(i,1),i.m(n,null))},i(l){r||(N(i),r=!0)},o(l){Z(i),r=!1},d(l){l&&Y(n),o[t].d()}}}function pL(e){let n,t,i=e[0],r=[];for(let o=0;o<i.length;o+=1)r[o]=AA(bA(e,i,o));const s=o=>Z(r[o],1,1,()=>{r[o]=null});return{c(){n=H("div");for(let o=0;o<r.length;o+=1)r[o].c();_(n,"class","floorplan-plugin__room-material svelte-1dykexu")},m(o,a){X(o,n,a);for(let l=0;l<r.length;l+=1)r[l]&&r[l].m(n,null);t=!0},p(o,[a]){if(a&7){i=o[0];let l;for(l=0;l<i.length;l+=1){const c=bA(o,i,l);r[l]?(r[l].p(c,a),N(r[l],1)):(r[l]=AA(c),r[l].c(),N(r[l],1),r[l].m(n,null))}for(Fe(),l=i.length;l<r.length;l+=1)s(l);Ve()}},i(o){if(!t){for(let a=0;a<i.length;a+=1)N(r[a]);t=!0}},o(o){r=r.filter(Boolean);for(let a=0;a<r.length;a+=1)Z(r[a]);t=!1},d(o){o&&Y(n),Bi(r,o)}}}function mL(e,n,t){let i,{floorIndex:r}=n,{floorplanData:s}=n;const o=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return e.$$set=l=>{"floorIndex"in l&&t(3,r=l.floorIndex),"floorplanData"in l&&t(4,s=l.floorplanData)},e.$$.update=()=>{e.$$.dirty&24&&t(0,i=s.floorDatas[r].rooms.map(l=>Pe(O({},l),{path:l.path.map(c=>yA(c,s.bounding))})))},[i,o,a,r,s]}class gL extends Oe{constructor(n){super(),ke(this,n,mL,pL,Le,{floorIndex:3,floorplanData:4},hL)}}function vL(e){Ue(e,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function yL(e){let n,t,i,r;return{c(){n=Bt("path"),_(n,"d",e[5]),_(n,"fill","#fff"),_(n,"style",e[2]),_(n,"id",t=`${e[1]}_${e[0].id}`),_(n,"class","svelte-qq2273")},m(s,o){X(s,n,o),i||(r=[lt(n,"mouseenter",e[3]),lt(n,"mouseleave",e[4])],i=!0)},p(s,[o]){o&4&&_(n,"style",s[2]),o&3&&t!==(t=`${s[1]}_${s[0].id}`)&&_(n,"id",t)},i:de,o:de,d(s){s&&Y(n),i=!1,bn(r)}}}function bL(e,n,t){let i,r,{room:s}=n,{floorIndex:o}=n,{floorplanData:a}=n,{highlightData:l}=n,{hoveredRoom:c}=n;function h(){c==null||c.set(s)}function u(){c==null||c.set(void 0)}const{bounding:d}=a,f=rd(s.path,{needZ:!0,format:m=>yA(m,d)});return e.$$set=m=>{"room"in m&&t(0,s=m.room),"floorIndex"in m&&t(1,o=m.floorIndex),"floorplanData"in m&&t(6,a=m.floorplanData),"highlightData"in m&&t(7,l=m.highlightData),"hoveredRoom"in m&&t(8,c=m.hoveredRoom)},e.$$.update=()=>{e.$$.dirty&131&&t(9,i=l[`${o}_${s.id}`]),e.$$.dirty&512&&t(2,r=i?`fill: ${i.color}; --opacity: ${i.opacity}; pointer-events: ${i.disabled?"none":"auto"}`:null)},[s,o,r,h,u,f,a,l,c,i]}class AL extends Oe{constructor(n){super(),ke(this,n,bL,yL,Le,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},vL)}}function wL(e){Ue(e,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function wA(e,n,t){const i=e.slice();return i[6]=n[t],i}function xA(e,n){let t,i,r;const s=[{room:n[6],floorplanData:n[1],hoveredRoom:n[3],floorIndex:n[0],highlightData:n[2]}];let o={};for(let a=0;a<s.length;a+=1)o=Ln(o,s[a]);return i=new AL({props:o}),{key:e,first:null,c(){t=pt(),Te(i.$$.fragment),this.first=t},m(a,l){X(a,t,l),Se(i,a,l),r=!0},p(a,l){n=a;const c=l&15?Vn(s,[{room:n[6],floorplanData:n[1],hoveredRoom:n[3],floorIndex:n[0],highlightData:n[2]}]):{};i.$set(c)},i(a){r||(N(i.$$.fragment,a),r=!0)},o(a){Z(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Ie(i,a)}}}function xL(e){let n,t,i=[],r=new Map,s,o=e[1].floorDatas[e[0]].rooms;const a=l=>l[6].id;for(let l=0;l<o.length;l+=1){let c=wA(e,o,l),h=a(c);r.set(h,i[l]=xA(h,c))}return{c(){n=H("div"),t=Bt("svg");for(let l=0;l<i.length;l+=1)i[l].c();_(t,"width","100%"),_(t,"height","100%"),_(t,"viewBox",`0 0 ${e[4]} ${e[5]}`),_(t,"class","svelte-1kqo6e4"),_(n,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){X(l,n,c),Q(n,t);for(let h=0;h<i.length;h+=1)i[h]&&i[h].m(t,null);s=!0},p(l,[c]){c&15&&(o=l[1].floorDatas[l[0]].rooms,Fe(),i=Ni(i,c,a,1,l,o,r,t,vs,xA,null,wA),Ve())},i(l){if(!s){for(let c=0;c<o.length;c+=1)N(i[c]);s=!0}},o(l){for(let c=0;c<i.length;c+=1)Z(i[c]);s=!1},d(l){l&&Y(n);for(let c=0;c<i.length;c+=1)i[c].d()}}}function ML(e,n,t){let{floorIndex:i}=n,{floorplanData:r}=n,{highlightData:s}=n,{hoveredRoom:o}=n;const a=r.bounding.max.x-r.bounding.min.x,l=r.bounding.max.y-r.bounding.min.y;return e.$$set=c=>{"floorIndex"in c&&t(0,i=c.floorIndex),"floorplanData"in c&&t(1,r=c.floorplanData),"highlightData"in c&&t(2,s=c.highlightData),"hoveredRoom"in c&&t(3,o=c.hoveredRoom)},[i,r,s,o,a,l]}class MA extends Oe{constructor(n){super(),ke(this,n,ML,xL,Le,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},wL)}}function CL(e){Ue(e,"svelte-1lm20n5",".missing-floor.svelte-1lm20n5{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;flex-direction:column;align-items:center}.text.svelte-1lm20n5{margin-top:0.75rem;color:#fff;opacity:0.3}")}function CA(e){let n,t=e[0].text+"",i;return{c(){n=H("span"),i=Mt(t),_(n,"class","text svelte-1lm20n5"),W(n,"font-size",e[0].textFontSize+"px")},m(r,s){X(r,n,s),Q(n,i)},p(r,s){s&1&&t!==(t=r[0].text+"")&&Pt(i,t),s&1&&W(n,"font-size",r[0].textFontSize+"px")},d(r){r&&Y(n)}}}function PL(e){let n,t,i,r,s=e[0].text&&CA(e);return{c(){n=H("div"),t=H("img"),r=ye(),s&&s.c(),_(t,"class","image"),_(t,"alt","缺省楼层展位图"),Sn(t.src,i=e[0].imageURL)||_(t,"src",i),W(t,"width",e[0].imageWidth+"px"),W(t,"height",e[0].imageHeight+"px"),_(n,"class","missing-floor svelte-1lm20n5")},m(o,a){X(o,n,a),Q(n,t),Q(n,r),s&&s.m(n,null)},p(o,[a]){a&1&&!Sn(t.src,i=o[0].imageURL)&&_(t,"src",i),a&1&&W(t,"width",o[0].imageWidth+"px"),a&1&&W(t,"height",o[0].imageHeight+"px"),o[0].text?s?s.p(o,a):(s=CA(o),s.c(),s.m(n,null)):s&&(s.d(1),s=null)},i:de,o:de,d(o){o&&Y(n),s&&s.d()}}}function EL(e,n,t){let{missingFloorConfig:i}=n;return e.$$set=r=>{"missingFloorConfig"in r&&t(0,i=r.missingFloorConfig)},[i]}class _L extends Oe{constructor(n){super(),ke(this,n,EL,PL,Le,{missingFloorConfig:0},CL)}}const As="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+Jq/+VvP+Vuv/c4v+Fnf+btP+InP+Blf/3+P6Txf+Jzf+Jyf+NxP+Qwf/t8/6Svv+Tvf/O1f7Czv3T2f6cu/+qvP7a4fvo7v77/v/o9//p9//0+v////+Vy//w9//k8/+B1f/v9/+D0/+UyP/u9v+D0v/i8f+F0v/g7/+G0P+KzP+Hz/////+Lx//s8/+Puf/h7P+Mxv/w9f7q8v/q8f2RwP/r8f6JrP/t8v6RvP/l6f7////j6P6VvP/f5/7q8P7a4P/U2f6au/+ZuP+ewf+auP+iu//n6f2Fn//j6P/h4fn9/v/4/P/3/P/o9v/l9P+F1P+B1f/i8v+UyP+J0f+E0f/h7//r8v6Izf/g7v/q8v6Pv//f7P7f7f/g7f+Lxf+MyP+Mw//k7v6Ow/+Ov//v8/2Pu//t8f+Tvv/p8P6Uu//q7v/i6P2Xvf+WuP/L1vypu//Azv7K0/zy8v/l8v/A4P/o9f/x+f+I0f/j8v+J0P/s9v/h8P+I0P/t9v/r9P6Lyv+Lyf/s9P/g7P+Myv/s8/7j7v+Jrv/q8P2Uwf+Epf+TuP/a3vzh5f3w8P/a4P20v//Nzfzx8f/Pz/Cg0P/f7//u9f/q8v7o8v7s8/7s8v3w9f+Sv/+TuP+Gp//s8fr///8/HFXHAAAA8nRSTlMANUQ/Z2JJXXaKTjCPmVMre3E6gFiylLxsxoVYnk5JwaOFU8utOjrV0KieQS2icWwzMC4Dt7aTQvjfrHprXD0zMyvpvUxGNjH+2sK9raeYkoiAcF5TUi0rKCYY2cy3pIJ/eGpEQDcxLx0S/Pv19PPu7Ovr5+Tk4eDe3NXU09DIsq2opKCViYN9e3V1cmZlXllVTk1GQDs2NTMwJw0K/vn28u/u5+Pj3tjNycjGw8DAua2pqJ6SjYyMf3BvaWNgWk5NSTc3MxT79PHw6efl2trY19PHurWysqWZe2xkXVlUPjo6OSskCO7Qzs6+vKCedmhdN1av0hoAAAV1SURBVEjHjZT3P9RxHMe1nCjcObo4cjpX5w53l7pUbnBGkr2TPZJKmiqVEQlJhGjvvfcm2nvvvXf5C3q/P98bkuR1D7+9n16v1/vzvtPrnAade/ty6anHJfFHOjkfXbe07PGxkuL4oqIjCzoDjHtxurzsRHmFStokjBDG/59JrwurOF2hkkUoIyKEQmFqatG3/xDnXlSGPZcKI5VKiVgsli+vrakpfNAx8UoVlpRWH6mUeMsVcm8vhah6WfXB3A6IlSlVKoE4KjxcgtNGRl1Ayzw9H+Z20DypMVkZZWKiUIi6oHj2PAbPs6Eh/+6/kBUpVUliIEQKGGcwGPbdiBpCQ/O//AMZJ218XW9igoHsGTwY7kopdMmSvTvbz/VGmiyhCARwWJ/Ss5CQ9pl3zVJZJCEwEszb6BtaGxrCn3XIyZP3trW3rybBWTCB1jy0sNGHeWM7+BgzrX4kJu752E57mWA5mIjsMRVxgGkrJpPpRvtJSywt3X2rPUSMuUgqIIzx37vRaLQeqNKEhN03/womg/bYhDJBBzdqvjsqYeHCHdfa1k9BF0QoEyuwoOadWc4sFutoXNzWGW2W3Axd8E3AxAZ6WNGeEoDl7EwPho/T0cDAtswb2Bi6kFx2VkwaDYgRI5zo9EUGRIGHD82e+ufrJ8uo+l31oQogYMJiOdFh2BQ03NTscEDAn8wKgQCeUsRTI8QEMhkYDDc1NTMLMuNwLAP8/a9Pbl0mJQlXhvVtrO2YNLce3Uew6IvAAsYtLS17gvwLCrKR0d3la0DsgdG3NiZVMBZacMh8L9CB2NjsS61eRiCtB4YH/Q21CMQKAgLnh1hYWAyJ3b9/40Qd09woppJhFytAnIPpBmBCCBjvjdrn59eKSU+SRWkZphu40IMBgRpAAMBmO7DZbL/786+s0TIpKqXOhgqGCKcnhOrd28HBlmj+2LFZWia9KjkqnHoa3BmsjG7wKIgDuSzQw9F29Gh+3jDunTseWas1zKtKYbiIsrEjZdAF2iPiYOvIz+Nyuebm5h6+HuvGa2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function Pm(e){return e*180/Math.PI}function SL(e){Ue(e,"svelte-17cl35n",".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}")}function IL(e){let n,t;return{c(){n=H("div"),t=H("div"),_(t,"class","floorplan__camera-rotate svelte-17cl35n"),W(t,"background-image",`url(${e[0]||As})`),W(t,"width",e[4]),W(t,"height",e[4]),W(t,"left","-"+e[4]),W(t,"top","-"+e[4]),W(t,"transform",`rotate(${e[3]}deg)`),W(t,"transform-origin",`${e[4]} ${e[4]}`),_(n,"class","floorplan__camera-position svelte-17cl35n"),W(n,"left",e[1]),W(n,"top",e[2])},m(i,r){X(i,n,r),Q(n,t)},p(i,[r]){r&1&&W(t,"background-image",`url(${i[0]||As})`);const s=r&1;s&&W(t,"width",i[4]),s&&W(t,"height",i[4]),s&&W(t,"left","-"+i[4]),s&&W(t,"top","-"+i[4]),s&&W(t,"transform",`rotate(${i[3]}deg)`),s&&W(t,"transform-origin",`${i[4]} ${i[4]}`)},i:de,o:de,d(i){i&&Y(n)}}}function TL(e,n,t){let{panoIndex:i}=n,{floorplanData:r}=n,{lastPanoramaLongitude:s}=n,{cameraImageUrl:o}=n;const{observers:a}=r,l=a[i],c=l.positionInImage.x,h=l.positionInImage.y,u=c*100+"%",d=h*100+"%",f=-Pm(s)+45,m=document.body.clientWidth,p=document.body.clientHeight,y=`${(m<500||p<500?17:37)/16}rem`;return e.$$set=b=>{"panoIndex"in b&&t(5,i=b.panoIndex),"floorplanData"in b&&t(6,r=b.floorplanData),"lastPanoramaLongitude"in b&&t(7,s=b.lastPanoramaLongitude),"cameraImageUrl"in b&&t(0,o=b.cameraImageUrl)},[o,u,d,f,y,i,r,s]}let DL=class extends Oe{constructor(n){super(),ke(this,n,TL,IL,Le,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},SL)}};const LL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1/+Bnv/6+/+SrP/m7P/f5v/O2v/L2P/E0v/Az//+///s8P/e5v+rv/+pvv+Anv+qvv+Pqv+Kpv+CoP93l/9xlP/z9v/p7v90lf9uj//P2//v8//o7f/k6v/K1v+6yv9rjv98nv/E0v/9/v/09//h6P/X4f9pjP/9/f/N2f/K1v/C0f+Ho/99nP/1+P9sj//6+//u8/+iuP/u8//g6P/U3v+3x/+0xv+etf+Vrv9pjf/B0P9ukf+ht/+Vr/94mP/G0/+8zP+2x//+/v/09v/W4f9ojv/c5P+xxP/d5v+xw/+vwv+Jo//g6P+nvP+SrP/R3P/1+f/W3//U3//C0P+Jp/9nh/+Kpv+Fov/Y4f/J1/+Pqf+rv/+Oqv+Oqv+muv+twP/f5//t8P97mf/h5/+twP+kuf/L2P+juP+Ipf+huP+Pqf/d5v+zxf+cs/+Zsf+wwv/V3v+8zP+Go/+zxP+GpP/T3f/r8P/u8v/o7f/d5P/m7P/H1P/w9P/D0f+uwf/Z4v/F0v/09//D0v/v8//s8v/d5P/Y4f/s8P+etv/X4f+gt/+ovf+bsv+xw/+Vr//j6v+1x//J1v+4yf/r8P+yxf/T3f/B0f+Fo//09//W4P/h6P/L1v/i6f/x9f/t8v/G0/+uwf/z9f/7/P/n7f/z9v/T3f+4yf/J1v/z9f/w8//q7v/O2v/8/f/5+v/y9f/w8//g6P/z9v+/zv+5yf+9zf/5+v/Q3P/B0P/u8f/R2//////LSJnaAAAA/HRSTlMAAwGMx2jAn2u7ebn0q8zX7J3TiHz45bRS35SFYZmPSembkYNwVMXh2cmodWVjXN43DHZu6gfyrJZGOvrzLAbVvbBB91raz7aypqH+4s6Bfj9/Vk9EMint3C8gt+fc1q+XGAml/O/SxBz7s66kSz3wI/bjc+fQvpOObV8VoyZyXjSpmgv97sMPyorNiYZN0XpYuvHCv6JNEhEWw61YgCUdGBIP5CIgHypaUEU6NS9JQy8lGlY6NCuMfVtPSzspJoRxcExBNTMUyn9zaWRfVkk9Oad9emtkY0RBMLGsnJaQj4ZmXVHhsaKbeW9owb466dnVy7mYj45wyaGV3bdGzuNnAAASkklEQVR42uyaS0iUURiGTUQZ1MaMURSEbOFt4ybGQClFHO9rBS8F3nAURHG0hZvyQrgQRsfNuKmRCTcGGaEzThNqMyouwswKNTVMLe/a/bLo+845/5z/dzIiumj971I3gz6+Puc9x0POT6bRaXfYrJa18YHFhYXXKzMz6+/fb2+/ePFia8uvWlXelFkcr6pO2NqCr2xv77xfn5lZWXm9sDgwvmZZGnHYzaZjHnLk/PaYzL0jS9Pji6+XN3Z3gvJPnTkTEJCT01xSUtWuVick+PlVJ6tUqvj44uLipkxIU3F5fLxKlZxc7efnl6BWt1eVlDTn5AQEnDl16lR+be2n3fWZlYWBNcugze485yFHzq/Kub7eEcv44tzyekpsbEhIZGRWVk1NUFBtPqU2gFGbANRWVycnI7XlCO0XQm25mFp1VRWjFrDNz68NCqqpyYqMDAmJjc3NzQ3cmJwfmLba7CZPDzlyfg5Wh3V6YG559HyhUhkVlZJSUJDLqK3pDkJqoS8ZtVWEWiCTUltejl37BaCVdG2Cul1MLUIb1M2pLShIiYpSKpWF58+37U3Oj1ue2E0ecuT8EK1mm3VoYG4vW6MrLQ0MDDwvUIvQ8q6tBWqZIeRQQ+DU8q51NwQxtbVAbRajNrZARG1gaWBpm0anyY6enB+bGOyV6ZVzIK6bPUPzs17Rx48fb80GaHVtpQRaF7XYtZFIbTcRBAFb7rWc2uJM1rVoCCqgFquWdy0TBDCEbqSWlm2KQC38rZSW6nS67OxW+CxXr0Z7ec/J8MqRxtQ7ONQ/2xIREeHlFR191UVtqRu1wBep2hpqCNxrpYYg6dp4Ude2Y9cG8K5FQ8hyNwSglnZtNoE22svLKyKirKxFsTo28cQsH9v+81Bevb29O1qMZQAtUhs9SqnVsK5199osRi3fENwNgXitcBqrrmZly7r2DKUWq7Zb8FrBEAoptW1tGg3rWk5tC3xSQ53ig8zuf5pzd4df9c8qFIrEOgOhtgyphdCubaVdC9iyrkVo+Wnsm12bID6NZYqWLxX32qpm0fKVD9ii10bSrkVDiJJ2bWuriFqjsaUDPmpdXWIifG7f1bGezT55bfhfYrrfM7Wamufrq9cjtIkGA+1aZgiArdRrlUBtirRr2YbAvBZGBLV71/INAcuWbwjcEERey7tWKe7abGnXdiC1DFq9r29eampF/3O5dv/1ODd7pj5og4ODU13UQtdyQ+Beq9FovnMaE20IAdwQJHut2BCE05jaffkSDAGwxbJl1CK27DQ2iqcxCFKLXWsgXatX+BJqg4O1aWlJz14N35XR/RfTeP/2VOeFpKS0tDQCLVDrq9AjtXVIrdFYVsaoHWWGQKgN3EdtCNVa91sGtdQQmvhpjFUtX74QWjoioNdm0a5lGwL3Wp1GI/HaCCP1WkMddi1Cm5cH1BJsky5UxGHrysLw7wQd9pl/XFfFBaRWq9UCtalIrZ56rcG7A7u2jHktMQQN91qllFq2fImoba468G5M6rVq4rV8Q0CvZdTGgtcitrxrNUgtli1QCyFe6+0yBL3eF6Cl1CYBtYBtnL9/0b2ezWseco56QGLvpV++7O8fF1dRAdhC16Ih0K4lhpBoQBaMLS6vZacxTdu+DSFXsiHkU689YENgd2MSQ0iQ7rXiG90Qvnxh2eJhTOfqWihb7rXUEIBalyFotaRru+IQ28uXY9LBF27JD3OObPqePn9TlJ4eExNDqO0CapOQWsCWdq2CUmtgGwKnli9f6LWFrg0hhFEr7doS1rXSu7HM8nK3DaHd7W6shnutyxACqdficYxSyzYEgVqEVsENQYtdi9j6U2rTi4oqfaZu32n0kHO04nlr+N3HjIaGoqIipNafUNsF1KIicK9VUK8FQ8Cu5YbAqQVslfv2Wuq1+TU7uxszK/DycG1t2mJZWrKOjIzYHA673Wx2Ok3nPImbNJqcfWa7vdfhsMG3rUtLFss0PG3Eh43ruzvC8sW7lhkCgxYMQXzLYCReyzYESGoePY0JXesPiYlBbCsbOjMyMu713L/uIedo5NiNm+8++vhkALSVlaRrqSEAtNKu1VNqWddKN4Rs3f6uLdxYnsTXsdNLg7Ze8y95WOhp6rM7RqyW6fGB+bnJ5Q0lNQRyo+u+fOGGIMFWOI2Rqq2ghgDUYtcSbH18fE4AuXLnHvr0PX30JvzEiRM+gG0nYFsE2IIgQARD0LINIY9vCNLla1R8ozu6PLc4brE6zH/iEcAxp90GD83mJ/dAqjU64TTGvNYodC0uX2SvJV1LNwSkFg3B1bWEWvhBhIdfeSjbwiHO9QeP34aFXQkPp9AitWgIgtfGYdcecBrrMJYJy1c0gLIHb62GrE96+/7aCmoyOwYnhvrnJo3otXz5Yl6roNCmptLTGHYtei1imy50rQ+lFrANC7v48ra86B6+HLs1/PDs2YsA7RWAlmLb0MkNgXStdENwv2WIUKzi2yrnoZo98ekkPpYQ7saQWtq1dPlCr+WGIO1axJZSe/Hs2bePHsiae4jSeOfxpdBQhJZULe/aSmIISG0cNwTetQoIMQTDbP9Qj818mP+Pejp7ByfGVmeF5WufIVw4wGuxahm1oaGh9S9vyqPYYYgnnL1O19cDtEAt7VrqtXCIdnWtsCEkYdfyWwaF4jMp174j9JtsvGvrGer/oMcNQXzL0CVZvhoaMii1iG2YQG19/enTp08+li33K/tm7JNGGIbxqiEht5m7iasMcBuwwOJk0tEFcn9BG7s1bizQGBycCCbXpUkTo9VFJVpRSeNkuBqnq6BRoiwOMtldm3Tr+37fJ9+dtFEUbNX3+RPIj+d+93zf/ctgyZb1YDAUAmx510J410JY1wqvbTeEma3vJ9uP9571yObu8rfTd6xrhSEIahFb2bXCayW1wWAwM2CvLf5XFvSMMr9fzw9kMhnEFqmVXSsMYQI3hFFJLUD7GixwZuvHU/kuoG+zsXx0CtS+Yl4runZ0fHzcvSEAtUPcEEKCWshhdYlezx44I0vV80J+AILQQgIuagdby9e1vXbm9Ogp3kmd2j45q7z1Ll/tXRuAoCEAtQzbQkE93qdLCw+Wsa9NXVXVfB6xdXftsOxauSHwszHgtfG0L6IufNkBdhm0vGul10Kk14quzQO1qqqDK7yg9Dwj682wrk+raqEgoGXUtrp2yGUI3Gt/we3T5/L+0Q+6W/mIXTvR7rWArTSEfJ5Rq+the40at5dBMTDDCC2jVhoCYjscAGo5tBC+fA0elXefhsF2dqTdOKtMyLlWvo2F3NQCtNPTiG04aZcI3B6lb6mqJZPhK2rVFrVBFATRtXKvrZw1Fh/RotXdoOzu/LwYhLj3Wo8hCGrDQG1y1jTIcbufvo2ilTJnZxFbnRsC81qxIYQ8XntRpy9SWOZ3y+dv2pevjPRaQa1pplIph87OuoxsXEulTJND6zWEjPRagDZwXqbredd94bgiqfUYgsq6Ngldi9hqmna8Qj9etw6/bMvSNIYt/MAtQ8i7DQG79rLeoPH8b75QPg8wbINyQ+CGILtW0yxLUZoE7v2RrRmKolgaUouGwL1W93gtdu1lnY57bj5IPBRei+GGAHF3rYKJ7608l82lF5lacSLxOFLLutaUXeuhNlOnOyEdkMu9VnYtJGnysrUshDYej6SLG9QBd5TZdASgjSsQhNZFrS69FoilF6+OsgDkIrauDWEWu1ZjhoDYRiKRdNohU+g4CyUnl2tRa1nSEKTXFmwi9s7kNg89G4IwBNG1SG0uZ9BVhQ4PEwzDyKWBWoEtUis2BNG19toSydc9bx81D91dC9hKaiNIrWE4dPxwy8yXnEQCoL3WtSnetQhtsklXRLv1YajNli8BraYgtozaXBqgTSQS2cl1+q1vytj6pD+bBWpF10qvFV2btIukBV2WhVRrQxDQCkNAbLNZv1N7zoeMt/jr13x+P1LLyhawlYLAX8fobl33g0ZWtE2+11oearFr/RDf3gEV7p/z6WDS5/MJaF1eqwhslSo9q3qW/vn9Y63Na7Fqs0gtpDZHhXs9/Z9r0ShC6+5aQS1C65ToEKHXmVqvRtoNwQ9BbKPR96vUGt5H1IcYg9YjCDkxIcSrNB32ONLRSg7H1msIEMA2GqNJoZWp1ckYQCuoRWwZtUYaFSFdpNHwYbOwsodde7UhtLAFaGOxl7U5eub9Ztfscd0Eoihsu8oSKJBoQpUYyYULmhSIBVjACuip0tFQpEaaagTSyLiI9GSMZArEKp4it95N7oXBk6dUr7Ln59sB4uNw7p0BTlfb3s7Wcm0fvfbbV7MveAYo7k9eEB5h+x0Aa22b9OlKb9bHP7kNgLZC2slawKTs80Bx/2sIW8DO7dy7VSt9SfuoyHMurei1k7bnt/3K8ExQXLT2Y0MA8qLwro2mRaG6hV5RTNpuuba81345v+n+E3oR6su7aAjc2hyt9cL4qN+fcNNcw9DzPJG1i7VG2dfidHlHaYW1qK0H2oauZvvz/ZEyhtLyrBUN4WzuxLweIO6HrOXWhiQa6pUupHeLkRCYrbWB2dqzZh+vPGxOl1xoW3iztYyxqNWj4KadG0URm7z9tyHoPZi+PnBJRExjk7WEEHiTrtMof9T7q7NctJYwcBaYGgJwVf/R5Sft3bkh8KydrXVV93aHzs7WklBMY2b+kob65uE0NhcEQhhaa1mWo+7VmqqzgElaRlDbKWtD0wykAg6GikJkretO2saKelt1cRyjtQAD5qw1zUBCdr2L1jIWAdzaWEVvq44+pI0AErLQs/rdyiAjm9ONiF5rATGlpaPWwUM1ZHSxFokIY9FNn12fivw4toQwkbWobemPynhbD1lW0hKtfYTtVa3PUk+q3pp7LYDW0jLL2lGJ+yP14DhZltFFW5DW6swApgbrpn1kbVmCtJnj+KP0GyFwFsCspZRLq1j70Z2qsxC0loK0qK0vd95Wne/7IC1Q8qgd9DgB1Il0dKx4CVsH8P1E3n3C7t76AM/aErKW3s1FAxVZNweUllvrIwc5V5r7MUiSWVoMW5C2NdVAXao7DmNL1vpJkgy1dH/V9W9wNmmTxdqy7OR7CMMnV2EiaxMgkGzoXjdDEKC2S0HwR3OeoD6beuBZ26K0QXC4y/Pa/7Jrx7gJw1AYx2su0iuYgYFI7sAJstiS2ZKpk8UeWfKWKyQLLJ5Qxyp34TZ9D15YOkBpm9ji/U/A8CP+HFj0styMapHtZ54bh/t5y2E9LoQNVppMXoN1uixLQns8rl9PeZ0T3O96O5T4rL2wBQkuZnCbWQ7OXdUe1zwNni8YCsh2VOuK1I/a2jtHapHtZp/J+cD9bf0HoiW1rpAp38TfYlEUgJaetWUOZwP3P3UnetYCW1ChU52JogoS1UKIlq9gT95yILSugKRKciq2VhLaEpIVm3366j2pxaSMyf07YRUlND5qTynvGG6aaDOSWgnptFiIKoQLWmQ7pLphuOkTB0lqoZDSTGiVBrXE1iT0wbgEEn0gtSEEncoNfRV1uKKN/KqL+/4C1xYSA7XapjATRGU1hGxT3NtcGnUK0UJgZf7TuDWEls1yt9wiWsja7awzYRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function kL(e){Ue(e,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function OL(e){let n,t,i,r,s;return{c(){n=H("div"),t=H("div"),i=ye(),r=H("span"),s=Mt(e[0]),_(t,"class","floorplan-plugin__compass-image svelte-rpkaro"),W(t,"background-image",`url(${LL})`),_(r,"class","floorplan-plugin__compass-text svelte-rpkaro"),_(n,"class","floorplan-plugin__compass svelte-rpkaro"),W(n,"transform",e[2])},m(o,a){X(o,n,a),Q(n,t),Q(n,i),Q(n,r),Q(r,s)},p(o,a){a&1&&Pt(s,o[0])},d(o){o&&Y(n)}}}function RL(e){let n,t=e[1]&&OL(e);return{c(){t&&t.c(),n=pt()},m(i,r){t&&t.m(i,r),X(i,n,r)},p(i,[r]){i[1]&&t.p(i,r)},i:de,o:de,d(i){t&&t.d(i),i&&Y(n)}}}function zL(e,n,t){var c;let{floorplanData:i}=n,{northDesc:r}=n;const s=(c=i.entrance)==null?void 0:c.northRad,o=typeof s=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(s?Pm(s):0)+90}deg)`;return e.$$set=h=>{"floorplanData"in h&&t(3,i=h.floorplanData),"northDesc"in h&&t(0,r=h.northDesc)},[r,o,l,i]}class BL extends Oe{constructor(n){super(),ke(this,n,zL,RL,Le,{floorplanData:3,northDesc:0},kL)}}function NL(e){Ue(e,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function FL(e){let n,t,i,r,s,o,a,l,c,h;const u=[{floorIndex:e[2],floorplanData:e[11]}];let d={};for(let w=0;w<u.length;w+=1)d=Ln(d,u[w]);n=new gL({props:d});let f=(e[3]||e[5])&&PA(e);const m=[{floorplanData:e[11],floorIndex:e[2]}];let p={};for(let w=0;w<m.length;w+=1)p=Ln(p,m[w]);r=new iA({props:p});let g=e[6]&&EA(e),y=e[10]&&_A(e),b=e[4]&&SA(e),A=e[22]&&IA(e);return{c(){Te(n.$$.fragment),t=ye(),f&&f.c(),i=ye(),Te(r.$$.fragment),s=ye(),g&&g.c(),o=ye(),y&&y.c(),a=ye(),b&&b.c(),l=ye(),A&&A.c(),c=pt()},m(w,x){Se(n,w,x),X(w,t,x),f&&f.m(w,x),X(w,i,x),Se(r,w,x),X(w,s,x),g&&g.m(w,x),X(w,o,x),y&&y.m(w,x),X(w,a,x),b&&b.m(w,x),X(w,l,x),A&&A.m(w,x),X(w,c,x),h=!0},p(w,x){const M=x&2052?Vn(u,[{floorIndex:w[2],floorplanData:w[11]}]):{};n.$set(M),w[3]||w[5]?f?(f.p(w,x),x&40&&N(f,1)):(f=PA(w),f.c(),N(f,1),f.m(i.parentNode,i)):f&&(Fe(),Z(f,1,1,()=>{f=null}),Ve());const E=x&2052?Vn(m,[{floorplanData:w[11],floorIndex:w[2]}]):{};r.$set(E),w[6]?g?(g.p(w,x),x&64&&N(g,1)):(g=EA(w),g.c(),N(g,1),g.m(o.parentNode,o)):g&&(Fe(),Z(g,1,1,()=>{g=null}),Ve()),w[10]?y?(y.p(w,x),x&1024&&N(y,1)):(y=_A(w),y.c(),N(y,1),y.m(a.parentNode,a)):y&&(Fe(),Z(y,1,1,()=>{y=null}),Ve()),w[4]?b?(b.p(w,x),x&16&&N(b,1)):(b=SA(w),b.c(),N(b,1),b.m(l.parentNode,l)):b&&(Fe(),Z(b,1,1,()=>{b=null}),Ve()),w[22]?A?(A.p(w,x),x&4194304&&N(A,1)):(A=IA(w),A.c(),N(A,1),A.m(c.parentNode,c)):A&&(Fe(),Z(A,1,1,()=>{A=null}),Ve())},i(w){h||(N(n.$$.fragment,w),N(f),N(r.$$.fragment,w),N(g),N(y),N(b),N(A),h=!0)},o(w){Z(n.$$.fragment,w),Z(f),Z(r.$$.fragment,w),Z(g),Z(y),Z(b),Z(A),h=!1},d(w){Ie(n,w),w&&Y(t),f&&f.d(w),w&&Y(i),Ie(r,w),w&&Y(s),g&&g.d(w),w&&Y(o),y&&y.d(w),w&&Y(a),b&&b.d(w),w&&Y(l),A&&A.d(w),w&&Y(c)}}}function VL(e){let n,t;return n=new _L({props:{missingFloorConfig:e[18]}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&262144&&(s.missingFloorConfig=i[18]),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function PA(e){let n,t;const i=[{floorIndex:e[2],floorplanData:e[11],hoveredRoom:e[24],highlightData:e[17]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new MA({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&16910340?Vn(i,[{floorIndex:s[2],floorplanData:s[11],hoveredRoom:s[24],highlightData:s[17]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function EA(e){let n,t;const i=[{floorplanData:e[11],roomAreaEnable:e[7],roomNameEnable:e[8],roomDimensionEnable:e[9],floorIndex:e[2],getRoomAreaText:e[12],getRoomDimensionText:e[13],getLabelElement:e[14],hoveredRoom:e[24],adaptiveRoomLabelVisibleEnable:e[16]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new HD({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&16874372?Vn(i,[{floorplanData:s[11],roomAreaEnable:s[7],roomNameEnable:s[8],roomDimensionEnable:s[9],floorIndex:s[2],getRoomAreaText:s[12],getRoomDimensionText:s[13],getLabelElement:s[14],hoveredRoom:s[24],adaptiveRoomLabelVisibleEnable:s[16]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function _A(e){let n,t;const i=[{floorplanData:e[11],floorIndex:e[2],getRuleDistanceText:e[15]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new JD({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&34820?Vn(i,[{floorplanData:s[11],floorIndex:s[2],getRuleDistanceText:s[15]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function SA(e){let n,t;const i=[{panoIndex:e[0],floorplanData:e[11],lastPanoramaLongitude:e[19],cameraImageUrl:e[20]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new DL({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&1574913?Vn(i,[{panoIndex:s[0],floorplanData:s[11],lastPanoramaLongitude:s[19],cameraImageUrl:s[20]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function IA(e){let n,t;return n=new BL({props:{floorplanData:e[11],northDesc:e[21]}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&2048&&(s.floorplanData=i[11]),r&2097152&&(s.northDesc=i[21]),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function GL(e){let n,t,i,r,s;const o=[VL,FL],a=[];function l(c,h){return c[23]?1:0}return t=l(e),i=a[t]=o[t](e),{c(){n=H("div"),i.c(),_(n,"class",r=an(`floorplan-plugin__floor${e[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(c,h){X(c,n,h),a[t].m(n,null),s=!0},p(c,[h]){let u=t;t=l(c),t===u?a[t].p(c,h):(Fe(),Z(a[u],1,1,()=>{a[u]=null}),Ve(),i=a[t],i?i.p(c,h):(i=a[t]=o[t](c),i.c()),N(i,1),i.m(n,null)),(!s||h&2&&r!==(r=an(`floorplan-plugin__floor${c[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&_(n,"class",r)},i(c){s||(N(i),s=!0)},o(c){Z(i),s=!1},d(c){c&&Y(n),a[t].d()}}}function jL(e,n,t){let i,r,{panoIndex:s}=n,{isCurrent:o}=n,{floorIndex:a}=n,{highlightEnable:l}=n,{cameraEnable:c}=n,{hoverEnable:h}=n,{roomLabelsEnable:u}=n,{roomAreaEnable:d}=n,{roomNameEnable:f}=n,{roomDimensionEnable:m}=n,{ruleLabelsEnable:p}=n,{floorplanData:g}=n,{getRoomAreaText:y}=n,{getRoomDimensionText:b}=n,{getLabelElement:A}=n,{getRuleDistanceText:w}=n,{adaptiveRoomLabelVisibleEnable:x}=n,{highlightData:M}=n,{missingFloorConfig:E}=n,{lastPanoramaLongitude:S}=n,{cameraImageUrl:T}=n,{northDesc:z}=n,{compassEnable:D}=n;const k=Mm(void 0);return e.$$set=R=>{"panoIndex"in R&&t(0,s=R.panoIndex),"isCurrent"in R&&t(1,o=R.isCurrent),"floorIndex"in R&&t(2,a=R.floorIndex),"highlightEnable"in R&&t(3,l=R.highlightEnable),"cameraEnable"in R&&t(4,c=R.cameraEnable),"hoverEnable"in R&&t(5,h=R.hoverEnable),"roomLabelsEnable"in R&&t(6,u=R.roomLabelsEnable),"roomAreaEnable"in R&&t(7,d=R.roomAreaEnable),"roomNameEnable"in R&&t(8,f=R.roomNameEnable),"roomDimensionEnable"in R&&t(9,m=R.roomDimensionEnable),"ruleLabelsEnable"in R&&t(10,p=R.ruleLabelsEnable),"floorplanData"in R&&t(11,g=R.floorplanData),"getRoomAreaText"in R&&t(12,y=R.getRoomAreaText),"getRoomDimensionText"in R&&t(13,b=R.getRoomDimensionText),"getLabelElement"in R&&t(14,A=R.getLabelElement),"getRuleDistanceText"in R&&t(15,w=R.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in R&&t(16,x=R.adaptiveRoomLabelVisibleEnable),"highlightData"in R&&t(17,M=R.highlightData),"missingFloorConfig"in R&&t(18,E=R.missingFloorConfig),"lastPanoramaLongitude"in R&&t(19,S=R.lastPanoramaLongitude),"cameraImageUrl"in R&&t(20,T=R.cameraImageUrl),"northDesc"in R&&t(21,z=R.northDesc),"compassEnable"in R&&t(22,D=R.compassEnable)},e.$$.update=()=>{e.$$.dirty&2052&&t(25,i=g.floorDatas[a]),e.$$.dirty&33554432&&t(23,r=i.rooms.length>0)},[s,o,a,l,c,h,u,d,f,m,p,g,y,b,A,w,x,M,E,S,T,z,D,r,k,i]}let HL=class extends Oe{constructor(n){super(),ke(this,n,jL,GL,Le,{panoIndex:0,isCurrent:1,floorIndex:2,highlightEnable:3,cameraEnable:4,hoverEnable:5,roomLabelsEnable:6,roomAreaEnable:7,roomNameEnable:8,roomDimensionEnable:9,ruleLabelsEnable:10,floorplanData:11,getRoomAreaText:12,getRoomDimensionText:13,getLabelElement:14,getRuleDistanceText:15,adaptiveRoomLabelVisibleEnable:16,highlightData:17,missingFloorConfig:18,lastPanoramaLongitude:19,cameraImageUrl:20,northDesc:21,compassEnable:22},NL)}};function UL(e){Ue(e,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function TA(e,n,t){const i=e.slice();return i[24]=n[t],i}function DA(e){let n,t,i,r=e[14].floorDatas,s=[];for(let a=0;a<r.length;a+=1)s[a]=LA(TA(e,r,a));const o=a=>Z(s[a],1,1,()=>{s[a]=null});return{c(){n=H("div");for(let a=0;a<s.length;a+=1)s[a].c();_(n,"class","floorplan-main svelte-86bqav")},m(a,l){X(a,n,l);for(let c=0;c<s.length;c+=1)s[c]&&s[c].m(n,null);i=!0},p(a,l){if(e=a,l&16777212){r=e[14].floorDatas;let c;for(c=0;c<r.length;c+=1){const h=TA(e,r,c);s[c]?(s[c].p(h,l),N(s[c],1)):(s[c]=LA(h),s[c].c(),N(s[c],1),s[c].m(n,null))}for(Fe(),c=r.length;c<s.length;c+=1)o(c);Ve()}},i(a){if(!i){for(let l=0;l<r.length;l+=1)N(s[l]);t||ln(()=>{t=gs(n,In,{duration:e[0],easing:Lr}),t.start()}),i=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)Z(s[l]);i=!1},d(a){a&&Y(n),Bi(s,a)}}}function LA(e){let n,t;const i=[{hoverEnable:e[6],highlightEnable:e[7],floorplanData:e[14],getRoomAreaText:e[17],getRoomDimensionText:e[18],getLabelElement:e[19],getRuleDistanceText:e[20],roomLabelsEnable:e[9],roomAreaEnable:e[10],roomNameEnable:e[11],roomDimensionEnable:e[12],ruleLabelsEnable:e[13],adaptiveRoomLabelVisibleEnable:e[21],highlightData:e[22],missingFloorConfig:e[23],panoIndex:e[3],cameraEnable:e[5],cameraImageUrl:e[16],lastPanoramaLongitude:e[15],compassEnable:e[8],northDesc:e[2]},{floorIndex:e[24].floorIndex},{isCurrent:e[24].floorIndex===e[4]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new HL({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&16777212?Vn(i,[o&16777196&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[14],getRoomAreaText:s[17],getRoomDimensionText:s[18],getLabelElement:s[19],getRuleDistanceText:s[20],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],roomDimensionEnable:s[12],ruleLabelsEnable:s[13],adaptiveRoomLabelVisibleEnable:s[21],highlightData:s[22],missingFloorConfig:s[23],panoIndex:s[3],cameraEnable:s[5],cameraImageUrl:s[16],lastPanoramaLongitude:s[15],compassEnable:s[8],northDesc:s[2]},o&16384&&{floorIndex:s[24].floorIndex},o&16400&&{isCurrent:s[24].floorIndex===s[4]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function WL(e){let n,t,i=e[1]&&DA(e);return{c(){i&&i.c(),n=pt()},m(r,s){i&&i.m(r,s),X(r,n,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&N(i,1)):(i=DA(r),i.c(),N(i,1),i.m(n.parentNode,n)):i&&(Fe(),Z(i,1,1,()=>{i=null}),Ve())},i(r){t||(N(i),t=!0)},o(r){Z(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function QL(e,n,t){let{duration:i=0}=n,{visible:r}=n,{northDesc:s}=n,{panoIndex:o}=n,{floorIndex:a}=n,{cameraEnable:l}=n,{hoverEnable:c}=n,{highlightEnable:h}=n,{compassEnable:u}=n,{roomLabelsEnable:d}=n,{roomAreaEnable:f}=n,{roomNameEnable:m}=n,{roomDimensionEnable:p}=n,{ruleLabelsEnable:g}=n,{floorplanData:y}=n,{lastPanoramaLongitude:b}=n,{cameraImageUrl:A}=n,{getRoomAreaText:w}=n,{getRoomDimensionText:x}=n,{getLabelElement:M}=n,{getRuleDistanceText:E}=n,{adaptiveRoomLabelVisibleEnable:S}=n,{highlightData:T}=n,{missingFloorConfig:z}=n;return e.$$set=D=>{"duration"in D&&t(0,i=D.duration),"visible"in D&&t(1,r=D.visible),"northDesc"in D&&t(2,s=D.northDesc),"panoIndex"in D&&t(3,o=D.panoIndex),"floorIndex"in D&&t(4,a=D.floorIndex),"cameraEnable"in D&&t(5,l=D.cameraEnable),"hoverEnable"in D&&t(6,c=D.hoverEnable),"highlightEnable"in D&&t(7,h=D.highlightEnable),"compassEnable"in D&&t(8,u=D.compassEnable),"roomLabelsEnable"in D&&t(9,d=D.roomLabelsEnable),"roomAreaEnable"in D&&t(10,f=D.roomAreaEnable),"roomNameEnable"in D&&t(11,m=D.roomNameEnable),"roomDimensionEnable"in D&&t(12,p=D.roomDimensionEnable),"ruleLabelsEnable"in D&&t(13,g=D.ruleLabelsEnable),"floorplanData"in D&&t(14,y=D.floorplanData),"lastPanoramaLongitude"in D&&t(15,b=D.lastPanoramaLongitude),"cameraImageUrl"in D&&t(16,A=D.cameraImageUrl),"getRoomAreaText"in D&&t(17,w=D.getRoomAreaText),"getRoomDimensionText"in D&&t(18,x=D.getRoomDimensionText),"getLabelElement"in D&&t(19,M=D.getLabelElement),"getRuleDistanceText"in D&&t(20,E=D.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in D&&t(21,S=D.adaptiveRoomLabelVisibleEnable),"highlightData"in D&&t(22,T=D.highlightData),"missingFloorConfig"in D&&t(23,z=D.missingFloorConfig)},[i,r,s,o,a,l,c,h,u,d,f,m,p,g,y,b,A,w,x,M,E,S,T,z]}let Em=class extends Oe{constructor(n){super(),ke(this,n,QL,WL,Le,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,roomDimensionEnable:12,ruleLabelsEnable:13,floorplanData:14,lastPanoramaLongitude:15,cameraImageUrl:16,getRoomAreaText:17,getRoomDimensionText:18,getLabelElement:19,getRuleDistanceText:20,adaptiveRoomLabelVisibleEnable:21,highlightData:22,missingFloorConfig:23},UL)}};const YL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function XL(e){return te(this,null,function*(){const n=new Headers({"Content-Type":"text/plain"}),t=function(r){return te(this,null,function*(){const s={index:r.index,url:r.url,svgUrl:r.svg_url};if(r.svg_url){const o=yield fetch(r.svg_url,{headers:n}).then(a=>a.text());s.svgContent=o}return s})};return yield Promise.all(e.map(t))})}function ZL(e){const n={id:e.id,size:e.size,name:e.name,path:e.path,roomType:e.room_type,floorType:e.floor_type,roomLabel:{position:e.room_label.position,positionInImage:e.room_label.position_in_image},observerIndexs:e.observer_indexs};return e.dimension&&Object.assign(n,{dimension:e.dimension}),n}function qL(e){return{floorName:e.floor_name,floorIndex:e.floor_index,rooms:e.rooms.map(ZL),rules:e.rules}}function JL(e){return{index:e.index,floorIndex:e.floor_index,position:e.position,positionInImage:e.position_in_image}}function KL(e){return{rad:e.rad,position:e.position,positionInImage:e.position_in_image,northRad:e.north_rad,roomId:e.room_id,floorIndex:e.floor_index}}function ws(e){return te(this,null,function*(){const n=yield XL(e.outlines),t=e.computed_data.bounding,i=e.computed_data.floor_datas.map(qL),r=e.computed_data.entrance?KL(e.computed_data.entrance):null;return{outlines:n,entrance:r,bounding:t,floorDatas:i,observers:e.computed_data.observers.map(JL)}})}function $L(e,n,t){return e.map(r=>{const s=r.position,o=r.icon?r.icon:{url:YL,width:45,height:48},a=eL(s,n),l=KD(s,t),c=$D(l,t);return{floorIndex:a,icon:o,id:r.id,position:l,positionInImage:c}})}function ek(e,n){return n(e),e}function Ga(e,n){return ek({},t=>{for(const i in e)n.indexOf(i)===-1&&(t[i]=e[i])})}function kA(e,n){const t=Math.max(...e.work.observers.map(i=>i.floorIndex));return n>t?e.model.bounding.max.y:Math.max(...e.work.observers.filter(i=>i.floorIndex===n).map(i=>i.standingPosition.y))}function _m(e,n,t=bs.BOUNDING_CENTER){const i=kA(e,n),r=kA(e,n+1);return t===bs.BOUNDING_CENTER?(e.model.bounding.max.y+e.model.bounding.min.y)/2:t===bs.CEILING?r:i}function Sm(e,n,t,i){const r=_m(e,t,i==null?void 0:i.attachedTo),s=new C.Vector3(0,r,0),o=new C.Vector3(1,r,0),a=s.clone().project(e.camera),l=o.clone().project(e.camera);return Math.abs((l.x-a.x)/1e3)*(n.getBoundingClientRect().width/2)}let xs=class{constructor(n,t){v(this,"VERSION","3.50.16");v(this,"NAME");v(this,"five");v(this,"workUtil");v(this,"fiveUtil");v(this,"hooks",new Pn);v(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");this.updateFive(n),t!=null&&t.staticPrefix&&(this.staticPrefix=t.staticPrefix)}set workCode(n){this.workUtil.workCode=n,this.onWorkCodeChange()}get workCode(){return this.workUtil.workCode}updateFive(n){this.five=n,this.fiveUtil=new oh(n),this.workUtil=this.fiveUtil.workUtil}getCurrentState(){return this.state}absoluteUrl(n){return nm(this.staticPrefix,n)}onWorkCodeChange(){}},Or=class extends xs{};var ti=(e=>(e.UnknownError="UnknownError",e.DataNotLoaded="DataNotLoaded",e.UpdateSizeError="UpdateSizeError",e.BreakOffByHide="BreakOffByHide",e.BreakOffByDisable="BreakOffByDisable",e.ModelNotLoaded="ModelNotLoaded",e.ChangeModeError="ChangeModeError",e.UpdateCameraError="UpdateCameraError",e))(ti||{});const OA=500,tk=80;function Js(e,n,t=4){return Math.abs(e-n)<Math.pow(10,-t)}function RA(e,n,t=4){const i=Math.PI*2,r=e%i,s=n%i,o=Math.min(r,s),a=Math.max(r,s);return Js(o,a,t)||Js(o+i,a,t)}Object.assign(window,{nearlyEqual:Js,nearlyEqualRad:RA});function nk(e){return Object.prototype.toString.call(e)==="[object Object]"}function zA(e){return nk(e)&&!!e.isVector3}function Im(e,n){return te(this,null,function*(){const[t]=yield qs(e.changeMode(...n));if(t)throw new Error("change mode canceled");yield new Promise(o=>{e.once("initAnimationWillStart",()=>{e.once("initAnimationEnded",()=>o())})});const i=n[1];if(!i)return!0;const r=e.getCurrentState();if(!ik(i,r))throw new Error("pose 与预期不符")})}function ik(e,n){return Object.keys(e).every(t=>{const i=n[t],r=e[t];return i===void 0||r===void 0?!0:t==="longitude"||t==="latitude"?RA(i,r,2):typeof i=="number"&&typeof r=="number"?Js(i,r,2):zA(r)&&zA(i)?r.distanceTo(i)<.01:i===r})}function rk(e,n){if(e.currentMode!==n.mode)return!1;const{latitude:t,longitude:i,fov:r,offset:s}=n,{latitude:o,longitude:a,offset:l}=e.getCurrentState(),c=e.camera.fov;return!(!Js(t,o,2)||!Js(i,a,2)||s!==void 0&&s.distanceTo(l)>.01||!Js(r,c,2))}function BA(e,n,t=!0){return te(this,null,function*(){if(rk(e,n)===!0)return;const r=e.getCurrentState();if(r.mode!==n.mode){const[h]=yield qs(Im(e,[n.mode,n,void 0,t]));if(h)throw h;return}const{latitude:s,longitude:o,fov:a}=r,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(o>Math.PI?2*Math.PI-o:o)*500,typeof n.fov=="number"?Math.abs(a-n.fov)*10:1/0)),[c]=yield qs(e.updateCamera(Ga(n,["mode"]),l,t));if(c)throw new Error(ti.UpdateCameraError)})}function ja(e,n,t=300){var r,s;const i=e.getElement();if(i){i.style.opacity=n+"";for(let o=0;o<((s=(r=i.parentElement)==null?void 0:r.children)==null?void 0:s.length);o++){const a=i.parentElement.children[o];a instanceof HTMLElement&&a.dataset.infive==="1"&&(a.style.opacity=n+"")}i.style.transition=t===0?"none":`opacity ${t}ms linear`,t!==0&&Promise.race([new Promise(o=>i.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,t))]).then(()=>{i.style.transition="none"})}}function sk(e){const{latitude:n,longitude:t}=e,i=Math.abs(n-Math.PI/2)>5*Math.PI/180,r=t>5*(Math.PI/180)&&t<355*(Math.PI/180);return i||r}function ok(e){const{latitude:n,longitude:t}=e,i=Math.abs(n-Math.PI/2)<10*Math.PI/180,r=t<30*(Math.PI/180)||t>330*(Math.PI/180);return i&&r}let ak=class extends Or{constructor(t,i){var l,c,h;super(t);v(this,"name","modelFloorplanPlugin");v(this,"state");v(this,"data");v(this,"showState");v(this,"showPromise");v(this,"app");v(this,"panoIndex",0);v(this,"floorIndex",0);v(this,"selector");v(this,"showRejection");v(this,"wrapper");v(this,"container",document.createElement("div"));v(this,"lastPanoramaLongitude",0);v(this,"size",{width:0,height:0});v(this,"defaultMissingFloorConfig");v(this,"hasAddedEventListener",!1);v(this,"isHiddenByHideFunc",!1);v(this,"highlightData",{});v(this,"dispose",()=>{var t,i;this.removeEventListener(),(t=this.app)==null||t.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});v(this,"show",(...i)=>te(this,[...i],function*(t={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const r=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!0},r),this._show(t)}));v(this,"hide",(...i)=>te(this,[...i],function*(t={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},t.userAction||!0),this._hide(t)))}));v(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper)return!1;const{min:t,max:i}=this.data.bounding,r=i.x-t.x,s=i.y-t.y,o=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Sm(this.five,this.wrapper,this.floorIndex,o),l=Math.ceil(r*a),c=Math.ceil(s*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});v(this,"highlight",t=>{this.state.config.highlightEnable&&(this.highlightData=t,this.render())});v(this,"unhighlight",()=>{this.highlightData={},this.render()});v(this,"_disable",t=>{var r,s,o;const{userAction:i}=t;this.hooks.emit("disable",{userAction:i}),(r=this.showRejection)==null||r.call(this,ti.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener()});v(this,"_enable",t=>{const{userAction:i}=t;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});v(this,"_show",t=>te(this,null,function*(){var o;if(!this.state.enabled)return;if(!((o=this.five.model)!=null&&o.loaded))throw new Error(ti.ModelNotLoaded);if(!this.data)throw new Error(ti.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},r=O(O({},i),t),s=()=>te(this,null,function*(){this.hooks.emit("show",{userAction:r.userAction,auto:r.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield qs(BA(this.five,this.showState,r.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(ti.UnknownError);if(!this.updateSize())throw new Error(ti.UpdateSizeError);this.floorIndex=r.floorIndex,this.five.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=s().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=r.modelOpacity,l=r.immediately?0:OA;ja(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:r.isAutoShow,userAction:r.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},r.userAction),!r.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));v(this,"_hide",t=>{var s;(s=this.showRejection)==null||s.call(this,ti.BreakOffByHide),this.showPromise=void 0;const r=O(O({},{userAction:!0,isAutoHide:!1}),t);ja(this.five,1,0),this.hooks.emit("hide",{auto:r.isAutoHide,userAction:r.userAction}),this.render()});v(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});v(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const t=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!t)throw new Error("不正确的父容器选择器");this.wrapper=t,t.append(this.container)});v(this,"onFiveModeChange",t=>{t!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});v(this,"onFiveInteriaPan",(t,i)=>{if(!i||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const r=this.five.getCurrentState();r.mode==="Floorplan"&&(this.state.visible||ok(r)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});v(this,"onFivePanoArrived",t=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=t,this.floorIndex=this.workUtil.observers[t].floorIndex)});v(this,"onFiveCameraUpdate",(t,i)=>{if(!this.state.visible||this.showPromise)return;const r=this.five.getCurrentState();sk(r)&&(this.updateState({visible:!1},i),this._hide({userAction:i,isAutoHide:!0}))});v(this,"onFiveWantsGesture",(t,i)=>{if(this.state.visible&&(i.length>1||t==="mouseWheel"))return!1});v(this,"onFiveWantsPanGesture",(t,i)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});v(this,"onFiveWantsTapGesture",()=>this.handleClick());v(this,"onFiveWantsChangeMode",(t,i)=>{i==="Panorama"&&t==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});v(this,"onModelShownFloorChange",t=>{if(this.floorIndex!==t){if(t===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=t,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:tk/((l=i==null?void 0:i.scale)!=null?l:1)},this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(h=(c=i.i18n)==null?void 0:c.call(i,"暂无平面图"))!=null?h:"暂无平面图",textFontSize:14};const r={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:As,attachedTo:bs.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:O(O({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:u=>u,getRoomAreaText:u=>(u/1e6).toFixed(1)+"㎡",getRoomDimensionText:(u,d)=>(u/1e3).toFixed(1)+"m × "+(d/1e3).toFixed(1)+"m",getRuleDistanceText:u=>u.toString()},s=i?Ga(i,["selector","scale"]):{},o=O(O({},r.missingFloorConfig),s.missingFloorConfig),a=Pe(O(O({},r),s),{missingFloorConfig:o});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),t.once("dispose",this.dispose),this.addEventListener()}load(t,i,r=!0){return te(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&Dr(o.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(t)),l=s(a)?a.data:a,c=this.data;this.data=yield ws(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,r),this.render()})}appendTo(t){if(this.wrapper=t,!!this.state.enabled)return t.appendChild(this.container),this.render(),this}enable(t={}){if(this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!0},t.userAction||i),this._enable({userAction:i})}disable(t={}){if(!this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!1},t.userAction||i),this._disable({userAction:i})}setState(t,i={}){const r=this.state,s=i.userAction!==void 0?i.userAction:!0;if(this.updateState(t,s),t.enabled!==void 0&&r.enabled!==t.enabled&&(t.enabled?this._enable({userAction:s}):this._disable({userAction:s})),t.visible!==void 0&&r.visible!==t.visible){const o={userAction:s};t.visible?this._show(o):this._hide(o)}this.render()}changeConfigs(t,i=!0){this.updateState({config:t},i),this.render()}formatData(t){return te(this,null,function*(){return yield ws(t.data)})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?O(O({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Pe(O(O({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Pe(O(O({},this.state),t),{config:o}),!Fn(this.state,r,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const t=this.five;t.model.loaded?this.onFiveModelLoaded():t.once("modelLoaded",this.onFiveModelLoaded),t.on("modeChange",this.onFiveModeChange),t.on("interiaPan",this.onFiveInteriaPan),t.on("panoArrived",this.onFivePanoArrived),t.on("cameraUpdate",this.onFiveCameraUpdate),t.on("wantsGesture",this.onFiveWantsGesture),t.on("wantsPanGesture",this.onFiveWantsPanGesture),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsChangeMode",this.onFiveWantsChangeMode),t.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const t=this.five;this.hasAddedEventListener=!1,t.off("modelLoaded",this.onFiveModelLoaded),t.off("modeChange",this.onFiveModeChange),t.off("interiaPan",this.onFiveInteriaPan),t.off("panoArrived",this.onFivePanoArrived),t.off("cameraUpdate",this.onFiveCameraUpdate),t.off("wantsGesture",this.onFiveWantsGesture),t.off("wantsPanGesture",this.onFiveWantsPanGesture),t.off("wantsTapGesture",this.onFiveWantsTapGesture),t.off("wantsChangeMode",this.onFiveWantsChangeMode),t.off("modelShownFloorChange",this.onModelShownFloorChange)}render(t){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=Pe(O({},this.state.config),{visible:this.state.visible,duration:t!=null?t:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(i);this.app=new Em({target:this.container,intro:!0,props:i})}};const lk=(e,n)=>new ak(e,n);function ck(e){const{latitude:n,longitude:t}=e,i=Math.abs(n-Math.PI/2)>5*Math.PI/180,r=t>5*(Math.PI/180)&&t<355*(Math.PI/180);return i||r}function hk(e){const{latitude:n,longitude:t}=e,i=Math.abs(n-Math.PI/2)<10*Math.PI/180,r=t<30*(Math.PI/180)||t>330*(Math.PI/180);return i&&r}let uk=class extends Or{constructor(t,i){var l,c;super(t);v(this,"name","modelFloorplanPlugin");v(this,"state");v(this,"data");v(this,"showState");v(this,"showPromise");v(this,"app");v(this,"panoIndex",0);v(this,"floorIndex",0);v(this,"selector");v(this,"showRejection");v(this,"wrapper");v(this,"container",document.createElement("div"));v(this,"lastPanoramaLongitude",0);v(this,"size",{width:0,height:0});v(this,"defaultMissingFloorConfig");v(this,"hasAddedEventListener",!1);v(this,"isHiddenByHideFunc",!1);v(this,"highlightData",{});v(this,"dispose",()=>{var t,i;this.removeEventListener(),(t=this.app)==null||t.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});v(this,"show",(...i)=>te(this,[...i],function*(t={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const r=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!0},r),this._show(t)}));v(this,"hide",(...i)=>te(this,[...i],function*(t={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},t.userAction||!0),this._hide(t)))}));v(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper)return!1;const{min:t,max:i}=this.data.bounding,r=i.x-t.x,s=i.y-t.y,o=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Sm(this.five,this.wrapper,this.floorIndex,o),l=Math.ceil(r*a),c=Math.ceil(s*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});v(this,"highlight",t=>{this.state.config.highlightEnable&&(this.highlightData=t,this.render())});v(this,"unhighlight",()=>{this.highlightData={},this.render()});v(this,"_disable",t=>{var r,s,o;const{userAction:i}=t;this.hooks.emit("disable",{userAction:i}),(r=this.showRejection)==null||r.call(this,ti.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener()});v(this,"_enable",t=>{const{userAction:i}=t;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});v(this,"_show",t=>te(this,null,function*(){var o;if(!this.state.enabled)return;if(!((o=this.fiveUtil.model)!=null&&o.loaded))throw new Error(ti.ModelNotLoaded);if(!this.data)throw new Error(ti.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},r=O(O({},i),t),s=()=>te(this,null,function*(){this.hooks.emit("show",{userAction:r.userAction,auto:r.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield qs(BA(this.five,this.showState,r.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(ti.UnknownError);if(!this.updateSize())throw new Error(ti.UpdateSizeError);this.updatePosition(),this.floorIndex=r.floorIndex,this.fiveUtil.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=s().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=r.modelOpacity,l=r.immediately?0:OA;ja(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:r.isAutoShow,userAction:r.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},r.userAction),!r.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));v(this,"_hide",t=>{var s;(s=this.showRejection)==null||s.call(this,ti.BreakOffByHide),this.showPromise=void 0;const r=O(O({},{userAction:!0,isAutoHide:!1}),t);ja(this.five,1,0),this.hooks.emit("hide",{auto:r.isAutoHide,userAction:r.userAction}),this.render()});v(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});v(this,"onFiveModelLoaded",()=>{const i=this.five.model.bounding.getCenter(new C.Vector3);if(this.showState.offset=i,this.state.enabled===!1||this.wrapper||!this.selector)return;const r=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!r)throw new Error("不正确的父容器选择器");this.wrapper=r,r.append(this.container)});v(this,"onFiveModeChange",t=>{t!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});v(this,"onFiveInteriaPan",(t,i)=>{if(!i||this.state.visible||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const r=this.five.getCurrentState();r.mode===this.showState.mode&&hk(r)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))});v(this,"onFivePanoArrived",t=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=t,this.floorIndex=this.workUtil.observers[t].floorIndex)});v(this,"onFiveCameraUpdate",(t,i)=>{if(!this.state.visible||this.showPromise)return;const r=this.five.getCurrentState();this.updatePosition(),this.updateSize(),ck(r)&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});v(this,"onFiveWantsPanGesture",(t,i)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(Ga(this.showState,["offset"]),0),!1});v(this,"onFiveWantsTapGesture",()=>this.handleClick());v(this,"onFiveWantsChangeMode",(t,i)=>{i==="Panorama"&&t===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});v(this,"onModelShownFloorChange",t=>{var i;if(this.floorIndex!==t){if(t===null){const r=this.five.getCurrentState().panoIndex;this.floorIndex=(i=this.five.work)==null?void 0:i.observers[r].floorIndex;return}this.floorIndex=t,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2},this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(c=(l=i.i18n)==null?void 0:l.call(i,"暂无平面图"))!=null?c:"暂无平面图",textFontSize:14};const r={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,cameraImageUrl:As,attachedTo:bs.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:O(O({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:h=>h,getRoomAreaText:h=>(h/1e6).toFixed(1)+"㎡",getRoomDimensionText:(h,u)=>(h/1e3).toFixed(1)+"m × "+(u/1e3).toFixed(1)+"m",getRuleDistanceText:h=>h.toString()},s=i?Ga(i,["selector","scale"]):{},o=O(O({},r.missingFloorConfig),s.missingFloorConfig),a=Pe(O(O({},r),s),{missingFloorConfig:o});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),Xs(t).then(this.onFiveModelLoaded),t.once("dispose",this.dispose),this.addEventListener()}load(t,i,r=!0){return te(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&Dr(o.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(t)),l=s(a)?a.data:a,c=this.data;this.data=yield ws(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,r),this.render()})}appendTo(t){if(this.wrapper=t,!!this.state.enabled)return t.appendChild(this.container),this.render(),this}enable(t={}){if(this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!0},t.userAction||i),this._enable({userAction:i})}disable(t={}){if(!this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!1},t.userAction||i),this._disable({userAction:i})}setState(t,i={}){const r=this.state,s=i.userAction!==void 0?i.userAction:!0;if(this.updateState(t,s),t.enabled!==void 0&&r.enabled!==t.enabled&&(t.enabled?this._enable({userAction:s}):this._disable({userAction:s})),t.visible!==void 0&&r.visible!==t.visible){const o={userAction:s};t.visible?this._show(o):this._hide(o)}}changeConfigs(t,i=!0){this.updateState({config:t},i),this.render()}updatePosition(){var a;const t=_m(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.fiveUtil.model)==null?void 0:a.bounding.getCenter(new C.Vector3).setY(t);if(!i)return;const r=i.clone().project(this.five.camera),s=(r.x+1)/2,o=-(r.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=o*100+"%"}formatData(t){return te(this,null,function*(){return yield ws(t.data)})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?O(O({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Pe(O(O({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Pe(O(O({},this.state),t),{config:o}),!Fn(this.state,r,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const t=this.five;t.on("modeChange",this.onFiveModeChange),t.on("interiaPan",this.onFiveInteriaPan),t.on("panoArrived",this.onFivePanoArrived),t.on("cameraUpdate",this.onFiveCameraUpdate),t.on("wantsPanGesture",this.onFiveWantsPanGesture),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsChangeMode",this.onFiveWantsChangeMode),t.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const t=this.five;this.hasAddedEventListener=!1,t.off("modelLoaded",this.onFiveModelLoaded),t.off("modeChange",this.onFiveModeChange),t.off("panoArrived",this.onFivePanoArrived),t.off("cameraUpdate",this.onFiveCameraUpdate),t.off("wantsPanGesture",this.onFiveWantsPanGesture),t.off("wantsTapGesture",this.onFiveWantsTapGesture),t.off("wantsChangeMode",this.onFiveWantsChangeMode),t.off("modelShownFloorChange",this.onModelShownFloorChange)}render(t){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=Pe(O({},this.state.config),{visible:this.state.visible,duration:t!=null?t:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(i);this.app=new Em({target:this.container,intro:!0,props:i})}};const dk=(e,n)=>new uk(e,n);let fk=class extends Or{constructor(t,i){var l,c;super(t);v(this,"name","topviewFloorplanPlugin");v(this,"state");v(this,"data");v(this,"app");v(this,"selector");v(this,"panoIndex",0);v(this,"floorIndex",0);v(this,"wrapper");v(this,"container",document.createElement("div"));v(this,"lastPanoramaLongitude",0);v(this,"size",{width:0,height:0});v(this,"defaultMissingFloorConfig");v(this,"hasAddedEventListener",!1);v(this,"isHiddenByHideFunc",!1);v(this,"highlightData",{});v(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return!1;const{min:t,max:i}=this.data.bounding,r=i.x-t.x,s=i.y-t.y,o=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Sm(this.five,this.wrapper,this.floorIndex,o),l=Math.ceil(r*a),c=Math.ceil(s*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});v(this,"dispose",()=>{var t,i;this.removeEventListener(),(t=this.app)==null||t.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});v(this,"highlight",t=>{this.state.config.highlightEnable&&(this.highlightData=t,this.render())});v(this,"unhighlight",()=>{this.highlightData={},this.render()});v(this,"_disable",t=>{var r,s;const{userAction:i}=t;(r=this.app)==null||r.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:i})});v(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const t=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!t)throw new Error("不正确的父容器选择器");this.wrapper=t,t.append(this.container)});v(this,"onFiveModeChange",(...[t,,,,i])=>{t!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});v(this,"onFivePanoArrived",t=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=t,this.floorIndex=this.five.work.observers[t].floorIndex)});v(this,"onFiveCameraUpdate",(t,i)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});v(this,"onFiveWantsGesture",t=>{if(!(t!=="pan"&&t!=="pinch"&&t!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});v(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});v(this,"onFiveInitAnimationEnded",(...[,,t])=>{const{mode:i}=this.five.getCurrentState();i==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},t),this._show({userAction:t}))});v(this,"onModelShownFloorChange",t=>{if(this.floorIndex!==t){if(t===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=t,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(c=(l=i.i18n)==null?void 0:l.call(i,"暂无平面图"))!=null?c:"暂无平面图",textFontSize:14};const r={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,cameraImageUrl:As,attachedTo:bs.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:O(O({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:h=>h,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:h=>(h/1e6).toFixed(1)+"㎡",getRoomDimensionText:(h,u)=>(h/1e3).toFixed(1)+"m × "+(u/1e3).toFixed(1)+"m",getRuleDistanceText:h=>h.toString()},s=i?Ga(i,["selector","scale"]):{},o=O(O({},r.missingFloorConfig),s.missingFloorConfig),a=Pe(O(O({},r),s),{missingFloorConfig:o});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),t.model.loaded?this.onFiveModelLoaded():t.once("modelLoaded",this.onFiveModelLoaded),t.once("dispose",this.dispose),this.addEventListener()}load(t,i,r=!0){return te(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&Dr(o.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(t)),l=s(a)?a.data:a,c=this.data;this.data=yield ws(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,r),this.render()})}updatePosition(){var a;const t=_m(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new C.Vector3).setY(t);if(!i)return;const r=i.clone().project(this.five.camera),s=(r.x+1)/2,o=-(r.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=o*100+"%"}appendTo(t){if(this.wrapper=t,!!this.state.enabled)return t.appendChild(this.container),this.render(),this}show(){return te(this,arguments,function*(t={}){if(this.state.visible)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return te(this,arguments,function*(t={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(t={}){if(this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!0},t.userAction||i),this._enable({userAction:i})}disable(t={}){if(!this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!1},t.userAction||i),this._disable({userAction:i})}setState(t,i={}){const r=this.state,s=i.userAction!==void 0?i.userAction:!0;if(this.updateState(t,s),t.enabled!==void 0&&r.enabled!==t.enabled){const o={userAction:s};t.enabled?this._enable(o):this._disable(o)}if(t.visible!==void 0&&r.visible!==t.visible){const o={userAction:s};t.visible?this._show(o):this._hide(o)}}changeConfigs(t,i=!0){this.updateState({config:t},i),this.render()}formatData(t){return te(this,null,function*(){return yield ws(t.data)})}_show(t){return te(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:i}=t;this.hooks.emit("show",{userAction:i,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Im(this.five,["Topview",void 0,void 0,i])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const r=500,s=this.state.config.modelOpacity;ja(this.five,s,r),this.hooks.emit("showAnimationEnded",{userAction:i,auto:!1}),this.render()})}_hide(t){return te(this,null,function*(){if(!this.state.enabled)return;const{userAction:i}=t;this.hooks.emit("hide",{userAction:i,auto:!1});const r=1,s=0;ja(this.five,r,s),this.render()})}_enable(t){const{userAction:i}=t;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?O(O({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Pe(O(O({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Pe(O(O({},this.state),t),{config:o}),!Fn(this.state,r,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const t=this.five;t.on("modeChange",this.onFiveModeChange),t.on("panoArrived",this.onFivePanoArrived),t.on("cameraUpdate",this.onFiveCameraUpdate),t.on("wantsGesture",this.onFiveWantsGesture),t.on("wantsMoveToPano",this.onFiveWantsMoveToPano),t.on("initAnimationEnded",this.onFiveInitAnimationEnded),t.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const t=this.five;this.hasAddedEventListener=!1,t.off("modeChange",this.onFiveModeChange),t.off("panoArrived",this.onFivePanoArrived),t.off("cameraUpdate",this.onFiveCameraUpdate),t.off("wantsGesture",this.onFiveWantsGesture),t.off("wantsMoveToPano",this.onFiveWantsMoveToPano),t.off("initAnimationEnded",this.onFiveInitAnimationEnded),t.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(t){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const i=Pe(O({},this.state.config),{visible:this.state.visible,duration:t!=null?t:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(i);this.app=new Em({target:this.container,intro:!0,props:i})}};const pk=(e,n)=>new fk(e,n);function Tm(e,n=200){let t;return function(...i){t||(e(...i),t=setTimeout(function(){t=null},n))}}function mk(e){Ue(e,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function gk(e){let n,t,i;return{c(){n=H("div"),t=H("div"),i=H("div"),_(i,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),W(i,"background-image","url("+(e[0]||As)+")"),W(i,"transform",e[1]),_(t,"class","plugin-radar__camera-position svelte-1nqrlxd"),W(t,"transform",e[2]),_(n,"class","plugin-radar__camera-wrapper svelte-1nqrlxd"),W(n,"opacity",e[3]?1:0)},m(r,s){X(r,n,s),Q(n,t),Q(t,i)},p(r,[s]){s&1&&W(i,"background-image","url("+(r[0]||As)+")"),(s&1||s&3)&&W(i,"transform",r[1]),s&4&&W(t,"transform",r[2]),s&8&&W(n,"opacity",r[3]?1:0)},i:de,o:de,d(r){r&&Y(n)}}}function vk(e){return`rotate(${Math.floor(e/Math.PI*180)*-1+45}deg)`}function yk(e,n,t){var b,A;let i,r,s,o,{five:a}=n,{pxmm:l}=n,{floorplanData:c}=n,{cameraImageUrl:h}=n,u=a.getCurrentState().panoIndex,d=a.getCurrentState().longitude,f=(A=(b=a.work.observers[a.getCurrentState().panoIndex])==null?void 0:b.floorIndex)!=null?A:0;function m(w,x){const M=w.bounding,E=w.observers[x];if(!E)return"";const S=(M.max.x-M.min.x)*l,T=(M.max.y-M.min.y)*l,z=Math.floor(E.positionInImage.x*S),D=Math.floor(E.positionInImage.y*T);return`translate(${z}px, ${D}px)`}function p(w){t(7,u=w)}function g(w){t(9,f=a.work.observers[w].floorIndex)}const y=Tm(w=>{t(8,d=w.longitude)},1e3/60);return Yn(()=>(a.on("panoWillArrive",p),a.on("panoArrived",g),a.on("cameraDirectionUpdate",y),function(){a.off("panoWillArrive",p),a.off("panoArrived",g),a.off("cameraDirectionUpdate",y)})),e.$$set=w=>{"five"in w&&t(4,a=w.five),"pxmm"in w&&t(5,l=w.pxmm),"floorplanData"in w&&t(6,c=w.floorplanData),"cameraImageUrl"in w&&t(0,h=w.cameraImageUrl)},e.$$.update=()=>{e.$$.dirty&576&&t(10,i=c.floorDatas[f]),e.$$.dirty&1024&&t(3,r=i.rooms.length>0),e.$$.dirty&192&&t(2,s=m(c,u)),e.$$.dirty&256&&t(1,o=vk(d))},[h,o,s,r,a,l,c,u,d,f,i]}class bk extends Oe{constructor(n){super(),ke(this,n,yk,gk,Le,{five:4,pxmm:5,floorplanData:6,cameraImageUrl:0},mk)}}function Ak(e){Ue(e,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function NA(e,n,t){const i=e.slice();return i[1]=n[t],i}function FA(e,n){let t,i,r=`${n[1].icon.width/16}rem`,s=`${n[1].icon.height/16}rem`,o,a=`${n[1].positionInImage.y*100}%`,l=`${n[1].positionInImage.x*100}%`;return{key:e,first:null,c(){t=H("div"),i=H("div"),o=ye(),_(i,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),W(i,"background-image",`url(${n[1].icon.url})`),W(i,"width",r),W(i,"height",s),_(t,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),W(t,"top",a),W(t,"left",l),this.first=t},m(c,h){X(c,t,h),Q(t,i),Q(t,o)},p(c,h){n=c,h&1&&W(i,"background-image",`url(${n[1].icon.url})`);const u=h&1;u&&W(i,"width",r),u&&W(i,"height",s),h&1&&a!==(a=`${n[1].positionInImage.y*100}%`)&&W(t,"top",a),h&1&&l!==(l=`${n[1].positionInImage.x*100}%`)&&W(t,"left",l)},d(c){c&&Y(t)}}}function wk(e){let n,t=[],i=new Map,r=e[0];const s=o=>o[1].id;for(let o=0;o<r.length;o+=1){let a=NA(e,r,o),l=s(a);i.set(l,t[o]=FA(l,a))}return{c(){n=H("div");for(let o=0;o<t.length;o+=1)t[o].c();_(n,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(o,a){X(o,n,a);for(let l=0;l<t.length;l+=1)t[l]&&t[l].m(n,null)},p(o,[a]){a&1&&(r=o[0],t=Ni(t,a,s,1,o,r,i,n,Am,FA,null,NA))},i:de,o:de,d(o){o&&Y(n);for(let a=0;a<t.length;a+=1)t[a].d()}}}function xk(e,n,t){let{extraObjects:i=[]}=n;return e.$$set=r=>{"extraObjects"in r&&t(0,i=r.extraObjects)},[i]}class Mk extends Oe{constructor(n){super(),ke(this,n,xk,wk,Le,{extraObjects:0},Ak)}}function Ck(e){Ue(e,"svelte-18287ai",".missing-floor-wrapper.svelte-18287ai{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:flex;justify-content:center;align-items:center}.missing-floor-image.svelte-18287ai{max-width:100%;max-height:100%}")}function Pk(e){let n,t,i,r,s,o;const a=[{floorIndex:e[2],floorplanData:e[4]}];let l={};for(let h=0;h<a.length;h+=1)l=Ln(l,a[h]);n=new iA({props:l}),i=new Mk({props:{extraObjects:e[7]}});let c=e[3]&&VA(e);return{c(){Te(n.$$.fragment),t=ye(),Te(i.$$.fragment),r=ye(),c&&c.c(),s=pt()},m(h,u){Se(n,h,u),X(h,t,u),Se(i,h,u),X(h,r,u),c&&c.m(h,u),X(h,s,u),o=!0},p(h,u){const d=u&20?Vn(a,[{floorIndex:h[2],floorplanData:h[4]}]):{};n.$set(d);const f={};u&128&&(f.extraObjects=h[7]),i.$set(f),h[3]?c?(c.p(h,u),u&8&&N(c,1)):(c=VA(h),c.c(),N(c,1),c.m(s.parentNode,s)):c&&(Fe(),Z(c,1,1,()=>{c=null}),Ve())},i(h){o||(N(n.$$.fragment,h),N(i.$$.fragment,h),N(c),o=!0)},o(h){Z(n.$$.fragment,h),Z(i.$$.fragment,h),Z(c),o=!1},d(h){Ie(n,h),h&&Y(t),Ie(i,h),h&&Y(r),c&&c.d(h),h&&Y(s)}}}function Ek(e){let n,t,i;return{c(){n=H("div"),t=H("img"),_(t,"class","missing-floor-image svelte-18287ai"),Sn(t.src,i=e[6])||_(t,"src",i),_(t,"alt","缺省楼层"),_(n,"class","missing-floor-wrapper svelte-18287ai")},m(r,s){X(r,n,s),Q(n,t)},p(r,s){s&64&&!Sn(t.src,i=r[6])&&_(t,"src",i)},i:de,o:de,d(r){r&&Y(n)}}}function VA(e){let n,t;const i=[{five:e[0],pxmm:e[1],floorIndex:e[2],floorplanData:e[4],onRoomHeightClick:e[9],highlightData:e[5],hoveredRoom:void 0}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new MA({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&567?Vn(i,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[9],highlightData:s[5],hoveredRoom:void 0}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function _k(e){let n,t,i,r;const s=[Ek,Pk],o=[];function a(l,c){return l[8]?1:0}return n=a(e),t=o[n]=s[n](e),{c(){t.c(),i=pt()},m(l,c){o[n].m(l,c),X(l,i,c),r=!0},p(l,[c]){let h=n;n=a(l),n===h?o[n].p(l,c):(Fe(),Z(o[h],1,1,()=>{o[h]=null}),Ve(),t=o[n],t?t.p(l,c):(t=o[n]=s[n](l),t.c()),N(t,1),t.m(i.parentNode,i))},i(l){r||(N(t),r=!0)},o(l){Z(t),r=!1},d(l){o[n].d(l),l&&Y(i)}}}function Sk(e,n,t){let i,r,s,{five:o}=n,{pxmm:a}=n,{floorIndex:l}=n,{hoverEnable:c}=n,{floorplanData:h}=n,{extraObjects:u=[]}=n,{highlightData:d}=n,{missingFloorImageUrl:f}=n;const m=void 0;return e.$$set=p=>{"five"in p&&t(0,o=p.five),"pxmm"in p&&t(1,a=p.pxmm),"floorIndex"in p&&t(2,l=p.floorIndex),"hoverEnable"in p&&t(3,c=p.hoverEnable),"floorplanData"in p&&t(4,h=p.floorplanData),"extraObjects"in p&&t(10,u=p.extraObjects),"highlightData"in p&&t(5,d=p.highlightData),"missingFloorImageUrl"in p&&t(6,f=p.missingFloorImageUrl)},e.$$.update=()=>{e.$$.dirty&20&&t(11,i=h.floorDatas[l]),e.$$.dirty&2048&&t(8,r=i.rooms.length>0),e.$$.dirty&1028&&t(7,s=u==null?void 0:u.filter(p=>p.floorIndex===l))},[o,a,l,c,h,d,f,s,r,m,u,i]}class Ik extends Oe{constructor(n){super(),ke(this,n,Sk,_k,Le,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:10,highlightData:5,missingFloorImageUrl:6},Ck)}}function Tk(e){Ue(e,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function GA(e){let n,t,i,r,s=e[8]!==0&&jA(e);return{c(){n=H("div"),s&&s.c(),_(n,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(o,a){X(o,n,a),s&&s.m(n,null),t=!0,i||(r=[zi(ys.call(null,n)),lt(n,"clientWidth",e[14]),lt(n,"clientHeight",e[15])],i=!0)},p(o,a){o[8]!==0?s?(s.p(o,a),a&256&&N(s,1)):(s=jA(o),s.c(),N(s,1),s.m(n,null)):s&&(Fe(),Z(s,1,1,()=>{s=null}),Ve())},i(o){t||(N(s),t=!0)},o(o){Z(s),t=!1},d(o){o&&Y(n),s&&s.d(),i=!1,bn(r)}}}function jA(e){let n,t,i,r,s=`${e[10]}px`,o=`${e[13]}px`,a;const l=[{five:e[0],pxmm:e[11],floorIndex:e[12],floorplanData:e[3],hoverEnable:e[2],extraObjects:e[5],highlightData:e[6],missingFloorImageUrl:e[7]}];let c={};for(let d=0;d<l.length;d+=1)c=Ln(c,l[d]);t=new Ik({props:c});const h=[{pxmm:e[11],five:e[0],floorplanData:e[3],cameraImageUrl:e[4]}];let u={};for(let d=0;d<h.length;d+=1)u=Ln(u,h[d]);return r=new bk({props:u}),{c(){n=H("div"),Te(t.$$.fragment),i=ye(),Te(r.$$.fragment),_(n,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),W(n,"width",s),W(n,"height",o)},m(d,f){X(d,n,f),Se(t,n,null),Q(n,i),Se(r,n,null),a=!0},p(d,f){const m=f&6381?Vn(l,[{five:d[0],pxmm:d[11],floorIndex:d[12],floorplanData:d[3],hoverEnable:d[2],extraObjects:d[5],highlightData:d[6],missingFloorImageUrl:d[7]}]):{};t.$set(m);const p=f&2073?Vn(h,[{pxmm:d[11],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};r.$set(p),f&1024&&s!==(s=`${d[10]}px`)&&W(n,"width",s),f&8192&&o!==(o=`${d[13]}px`)&&W(n,"height",o)},i(d){a||(N(t.$$.fragment,d),N(r.$$.fragment,d),a=!0)},o(d){Z(t.$$.fragment,d),Z(r.$$.fragment,d),a=!1},d(d){d&&Y(n),Ie(t),Ie(r)}}}function Dk(e){let n,t,i=e[1]&&GA(e);return{c(){i&&i.c(),n=pt()},m(r,s){i&&i.m(r,s),X(r,n,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&N(i,1)):(i=GA(r),i.c(),N(i,1),i.m(n.parentNode,n)):i&&(Fe(),Z(i,1,1,()=>{i=null}),Ve())},i(r){t||(N(i),t=!0)},o(r){Z(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function Lk(e,n,t){var w,x;let{five:i}=n,{visible:r}=n,{hoverEnable:s}=n,{floorplanData:o}=n,{cameraImageUrl:a}=n,{extraObjects:l=[]}=n,{highlightData:c}=n,{missingFloorImageUrl:h}=n,u=0,d=(x=(w=i.work.observers[i.getCurrentState().panoIndex])==null?void 0:w.floorIndex)!=null?x:0,f=0,m=0,p=0,g=0;function y(M){t(12,d=i.work.observers[M].floorIndex)}Yn(()=>(i.on("panoArrived",y),()=>{i.off("panoArrived",y)}));const b=M=>{t(8,f=M.detail)},A=M=>{t(9,m=M.detail)};return e.$$set=M=>{"five"in M&&t(0,i=M.five),"visible"in M&&t(1,r=M.visible),"hoverEnable"in M&&t(2,s=M.hoverEnable),"floorplanData"in M&&t(3,o=M.floorplanData),"cameraImageUrl"in M&&t(4,a=M.cameraImageUrl),"extraObjects"in M&&t(5,l=M.extraObjects),"highlightData"in M&&t(6,c=M.highlightData),"missingFloorImageUrl"in M&&t(7,h=M.missingFloorImageUrl)},e.$$.update=()=>{if(e.$$.dirty&1800){const M=Math.min(f,m),{max:E,min:S}=o.bounding,T=E.x-S.x,z=E.y-S.y,D=function(){return T>z?[M,M/T*z]:[M/z*T,M]}();t(10,p=D[0]),t(13,g=D[1]),t(11,u=p/T)}},[i,r,s,o,a,l,c,h,f,m,p,u,d,g,b,A]}class kk extends Oe{constructor(n){super(),ke(this,n,Lk,Dk,Le,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6,missingFloorImageUrl:7},Tk)}}let Ok=class extends Or{constructor(t,i){super(t);v(this,"name","panoFloorplanRadarPlugin");v(this,"state");v(this,"data");v(this,"app");v(this,"wrapperSelector","");v(this,"wrapper",null);v(this,"disposed",!1);v(this,"extraObjects",[]);v(this,"highlightData",{});v(this,"dispose",()=>{var t;this.disposed=!0,(t=this.app)==null||t.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});v(this,"highlight",t=>{this.state.config.highlightEnable&&(this.highlightData=t,this.render())});v(this,"unhighlight",()=>{this.highlightData={},this.render()});v(this,"_disable",t=>{var r;const{userAction:i}=t;(r=this.app)==null||r.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:i})});this.five=t;const r={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:As,missingFloorImageUrl:this.staticPrefix+"/release/web/saas/missing-floor.d687a5ed.png"},s=O(O({},r),i==null?void 0:i.configs);this.state={enabled:!0,visible:!0,config:s},i!=null&&i.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(i==null?void 0:i.wrapper)=="string"?this.wrapperSelector=i.wrapper:(i==null?void 0:i.wrapper)instanceof Element&&(this.wrapper=i.wrapper),t.once("dispose",this.dispose)}load(t,i,r=!0){return te(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const o=JSON.parse(JSON.stringify(t)),a=s(o)?o.data:o,l=this.data;this.data=yield ws(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),i&&this.updateState(i,r),this.render()})}show(){return te(this,arguments,function*(t={}){if(this.state.visible)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return te(this,arguments,function*(t={}){if(!this.state.visible)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(t={}){if(this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!0},t.userAction||i),this._enable({userAction:i})}disable(t={}){if(!this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!1},t.userAction||i),this._disable({userAction:i})}setState(t,i={}){const r=this.state,s=i.userAction!==void 0?i.userAction:!0;if(this.updateState(t,s),t.enabled!==void 0&&r.enabled!==t.enabled){const o={userAction:s};t.enabled?this._enable(o):this._disable(o)}if(t.visible!==void 0&&r.visible!==t.visible){const o={userAction:s};t.visible?this._show(o):this._hide(o)}}appendTo(t){this.wrapper!==t&&this.app&&(this.app.$destroy(),this.app=void 0),this.wrapper=t,this.render()}changeConfigs(t,i=!0){this.setState({config:t},{userAction:i}),this.render()}setExtraObjectsWith3DPositions(t){this.data&&(this.extraObjects=$L(t,this.five,this.data),this.render())}formatData(t){return te(this,null,function*(){return yield ws(t.data)})}_enable(t){const{userAction:i}=t;this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}_show(t){if(this.disposed||!this.state.enabled)return;const{userAction:i}=t;this.hooks.emit("show",{userAction:i}),this.render()}_hide(t){if(this.disposed||!this.state.enabled)return;const{userAction:i}=t;this.hooks.emit("hide",{userAction:i}),this.render()}updateState(t,i){const r=this.state,s=t.config?O(O({},r.config),t.config):r.config;this.state=Pe(O(O({},this.state),t),{config:s}),!Fn(this.state,r,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const i=document.querySelector(this.wrapperSelector);this.wrapper=i}if(!this.data||!this.wrapper)return;const t=Pe(O({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(t):this.app=new kk({target:this.wrapper,props:t})}};const Rk=(e,n)=>new Ok(e,n),zk=[{type:0,floorType:1,roomType:"100900000012",name:"其他"},{type:1,floorType:1,roomType:"100900000002",name:"客厅"},{type:2,floorType:1,roomType:"100900000002",name:"餐厅"},{type:3,floorType:0,roomType:"100900000001",name:"卧室"},{type:4,floorType:0,roomType:"100900000001",name:"书房"},{type:5,floorType:3,roomType:"100900000004",name:"卫生间"},{type:6,floorType:3,roomType:"100900000004",name:"淋浴间"},{type:7,floorType:3,roomType:"100900000004",name:"洗手间"},{type:8,floorType:3,roomType:"100900000003",name:"厨房"},{type:9,floorType:1,roomType:"100900000003",name:"开放厨房",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"多功能间"},{type:11,floorType:0,roomType:"100900000009",name:"保姆间"},{type:12,floorType:4,roomType:"100900000005",name:"阳台"},{type:13,floorType:4,roomType:"100900000006",name:"露台"},{type:14,floorType:0,roomType:"100900000008",name:"储物间"},{type:15,floorType:0,roomType:"100900000013",name:"衣帽间"},{type:16,floorType:0,roomType:"100900000011",name:"阁楼"},{type:17,floorType:2,roomType:"100900000007",name:"花园"},{type:18,floorType:5,roomType:"100900000010",name:"车库"},{type:19,floorType:1,roomType:"100900000012",name:"电梯"},{type:20,floorType:1,roomType:"100900000012",name:"地下室"},{type:21,floorType:1,roomType:"100900000012",name:"天井"},{type:22,floorType:1,roomType:"100900000012",name:"阳光房"},{type:23,floorType:1,roomType:"100900000012",name:"过道"},{type:24,floorType:1,roomType:"100900000012",name:"楼梯间"},{type:25,floorType:1,roomType:"100900000012",name:"门厅"},{type:26,floorType:2,roomType:"100900000012",name:"入户花园"},{type:27,floorType:1,roomType:"100900000012",name:"玄关"},{type:28,floorType:1,roomType:"100900000012",name:"挑空"},{type:29,floorType:4,roomType:"100900000012",name:"晾晒区"},{type:30,floorType:4,roomType:"100900000012",name:"洗衣房"},{type:31,floorType:0,roomType:"100900000012",name:"娱乐区"},{type:32,floorType:0,roomType:"100900000012",name:"健身区"},{type:33,floorType:0,roomType:"100900000012",name:"接待区"},{type:34,floorType:0,roomType:"100900000012",name:"影音区"},{type:35,floorType:1,roomType:"100900000012",name:"餐饮区"},{type:36,floorType:1,roomType:"100900000012",name:"其他",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"起居室"},{type:38,floorType:0,roomType:"100900000001",name:"主卧"},{type:39,floorType:0,roomType:"100900000001",name:"次卧"},{type:40,floorType:0,roomType:"100900000001",name:"优化间"},{type:41,floorType:0,roomType:"100900000001",name:"办公室"},{type:42,floorType:0,roomType:"100900000001",name:"会议室"},{type:43,floorType:0,roomType:"100900000001",name:"洽谈间"},{type:44,floorType:1,roomType:"100900000002",name:"共享大厅"},{type:45,floorType:1,roomType:"100900000012",name:"水吧"},{type:46,floorType:0,roomType:"100900000015",name:"出入口"},{type:47,floorType:0,roomType:"100900000015",name:"大厅"},{type:48,floorType:0,roomType:"100900000015",name:"包厢"},{type:49,floorType:0,roomType:"100900000015",name:"其他"},{type:50,floorType:0,roomType:"100900000016",name:"出入口"},{type:51,floorType:0,roomType:"100900000016",name:"办公区"},{type:52,floorType:0,roomType:"100900000016",name:"老板间"},{type:53,floorType:0,roomType:"100900000016",name:"会议室"},{type:54,floorType:0,roomType:"100900000016",name:"休息区/水吧"},{type:55,floorType:0,roomType:"100900000016",name:"其他"},{type:56,floorType:2,roomType:"100900000012",name:"空中花园"},{type:57,floorType:0,roomType:"100900000001",name:"洋室"},{type:58,floorType:0,roomType:"100900000001",name:"和室"}],Bk=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],Nk=[{roomType:"100900000001",description:"室"},{roomType:"100900000002",description:"厅"},{roomType:"100900000003",description:"厨"},{roomType:"100900000004",description:"卫"},{roomType:"100900000005",description:"阳台"},{roomType:"100900000006",description:"露台"},{roomType:"100900000007",description:"花园"},{roomType:"100900000008",description:"储"},{roomType:"100900000009",description:"保姆间"},{roomType:"100900000010",description:"车库"},{roomType:"100900000011",description:"阁楼"},{roomType:"100900000012",description:"其他"},{roomType:"100900000013",description:"衣"},{roomType:"100900000015",description:"商铺"},{roomType:"100900000016",description:"写字楼"}],Dm=(e,n,t)=>{const i=new C.Matrix4,r=new C.Euler(e,n,t,"YXZ");return i.makeRotationFromEuler(r),i},Fk=(e,{scale:n,rotation:t,position:i})=>{if(n&&e.scale.set(n,n,n),t){const[r,s,o]=t;r&&e.applyMatrix4(Dm(r,0,0)),s&&e.applyMatrix4(Dm(0,s,0)),o&&e.applyMatrix4(Dm(0,0,o))}return i&&e.position.set(i.x,i.y,i.z),e};function HA(e,n){e.traverse(t=>{var i;if(t.type==="Mesh"){const r=t,s=O({map:r.material.map||{}},n);r.material=new ee.MeshBasicMaterial(s),r.renderOrder=1,((i=t.parent)==null?void 0:i.type)==="Mesh"&&(t.renderOrder=t.parent.renderOrder+1)}})}const Vk=(e,n)=>{var p;const t=n.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",i=(p=n.north_rad)!=null?p:void 0,r={};let s={x:0,y:0,z:0},o=[0,0,0],a=1,l=i;e.on("modelLoaded",m);const c=g=>te(this,null,function*(){var w;const y=(g==null?void 0:g.fbx_url)||t;if(l=(w=g==null?void 0:g.north_rad)!=null?w:i,typeof l!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const A=yield new vo.FBXLoader().loadAsync(y);return HA(A,{transparent:!0,side:C.DoubleSide,blending:C.AdditiveBlending}),r.object=A,m(),!0}),h=({latitude:g})=>{if(!r.object)return;const y=u(g);y&&(r.object.position.y=y)},u=g=>{if(r.yBase===void 0)return;const y=.6;if(g>=Math.PI/4)return r.yBase-(y+1.6);const b=g*(4/Math.PI);return r.yBase-(y*b+1.6)},d=()=>{if(!r.object)return;const g=u(e.getPose().latitude);g&&(r.object.position.y=g),e.scene.add(r.object),e.needsRender=!0,e.on("cameraDirectionUpdate",h)},f=()=>{r.object&&(e.scene.remove(r.object),e.needsRender=!0,e.off("cameraDirectionUpdate",h))};function m(){const g=r.object;if(!g)return;const y=e.model.bounding,b=y.max.x-y.min.x,A=y.max.z-y.min.z,w=Math.max(b,A),{max:{x,z:M},min:{x:E,y:S,z:T}}=y;r.yBase=S,s={x:(x+E)/2,y:S-1.6,z:(M+T)/2},o=[0,l-Math.PI/2,0],a=.0045*w,Fk(g,{position:s,rotation:o,scale:a})}return{load:c,disable:f,enable:d}};function Gk(e,n){var c,h,u,d,f;const t=(c=n==null?void 0:n.size)!=null?c:512,i=(h=n==null?void 0:n.fontSize)!=null?h:t*(35/256)*1.2,r=(u=n==null?void 0:n.backgroundColor)!=null?u:"rgba(0,0,0,0)",s=(d=n==null?void 0:n.fontColor)!=null?d:"#fff",o=(f=n==null?void 0:n.textAlign)!=null?f:"center",a=document.createElement("canvas");a.setAttribute("width",t+""),a.setAttribute("height",t+"");const l=a.getContext("2d");return l.fillStyle=r,l.fillRect(0,0,t,t),l.font=`${i}px "微软雅黑"`,l.textAlign=o,l.fillStyle=s,l.fillText(e,t/2,t*.7),new ee.CanvasTexture(a)}const jk=({x:e,y:n,z:t})=>new ee.Vector3(e,n,t),Hk=(e,n)=>{var p,g,y;const t={},i=(p=n.animationEnabled)!=null?p:!0,r=(g=n.position)!=null?g:void 0,s=(y=n.rad)!=null?y:void 0,o=n.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=b=>te(this,null,function*(){var z,D,k,R,G,I,U,J;const A=(z=b==null?void 0:b.position)!=null?z:r;if(!A)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const w=jk(A),x=(D=b==null?void 0:b.rad)!=null?D:s,M=(k=b==null?void 0:b.fbx_url)!=null?k:o;if(t.rad=x,x===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${x}`));const E=yield new vo.FBXLoader().loadAsync(M);E.position.copy(w),E.rotation.z=x,E.scale.set(.8,.8,.8),HA(E,{transparent:!0,side:C.DoubleSide});const S=(U=(I=(G=(R=E.children)==null?void 0:R[0])==null?void 0:G.children)==null?void 0:I[3])==null?void 0:U.clone();if(!S)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${S}`));const T=(J=n.name)!=null?J:"入户门";return S.material=new ee.MeshBasicMaterial({transparent:!0,map:Gk(T)}),S.renderOrder=3,E.children[0].add(S),t.object=E,!0}),c=()=>{if(t.animation)return;if(!t.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",t.object);const b=1,A=new ee.AnimationMixer(t.object);a.push(A);const w=A.clipAction(t.object.animations[0]);w.timeScale=b;let x;const M=()=>{let z=0,D=0;const k=1e3/30,R=G=>{z=requestAnimationFrame(R);const I=G-D;I<k||(D=G,a.forEach(U=>U.update(I/1e3)),e.needsRender=!0)};return z=requestAnimationFrame(R),()=>{cancelAnimationFrame(z)}},T={play:()=>{x||(w.play(),x=M(),requestAnimationFrame(()=>{t.object&&t.object.rotation.z!==t.rad&&(t.object.rotation.z=t.rad)}))},stop:()=>{w.stop(),x==null||x(),x=void 0}};t.animation=T},h=b=>{var w;if(!t.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",t.object);((w=b==null?void 0:b.animationEnable)!=null?w:i)&&(t.animation||c(),t.animation.play()),e.scene.add(t.object),e.needsRender=!0},u=()=>{t.object&&(t.animation&&t.animation.stop(),e.scene.remove(t.object),e.needsRender=!0)},d=b=>b==="Floorplan"?h():u();return{load:l,enable:b=>(t.enabled||(t.enabled=!0,d(e.currentMode),e.on("modeChange",d),h(b)),!0),disable:()=>(t.enabled&&(t.enabled=!1,u(),e.off("modeChange",d)),!0)}},Uk=Gi;function Wk(e,n,t,i=Uk.Linear.None){const r=new nh(e).to(n,t).easing(i);bc(()=>r.start(0));const s=xa(a=>{r.update(a)===!1&&s()}),o=[];return r.onDestroy=a=>(o.push(a),r),r.destroy=function(){this.stop(),Object.assign(r,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=o.shift();)a();s()},r}function Qk(e,n){return Wk({progress:0},{progress:1},e,n)}var UA=(e=>(e.Move="Move",e.Rotate="Rotate",e))(UA||{}),sr=(e=>(e.Clockwise="Clockwise",e.Anticlockwise="Anticlockwise",e.Loop="Loop",e))(sr||{});const sd=Math.PI*2;function WA(e){return(e%sd+sd)%sd}function QA(e){return e%sd}function Lm(e,n,t){return e+(n-e)*t}const km=(e,n,t)=>{const i=Math.PI,r=i*2;let s=WA(e),o=WA(n);return t===sr.Anticlockwise&&s<o&&(s+=r),t===sr.Clockwise&&o<s&&(o+=r),t===sr.Loop&&o-s>i?km(s,o,sr.Anticlockwise):t===sr.Loop&&s-o>i?km(s,o,sr.Clockwise):{from:s,to:o}},Yk=e=>{const n={},t=(l,c,...h)=>te(this,[l,c,...h],function*(s,o,a={preload:!0}){return n.interruptCallback&&n.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==e.currentMode&&(yield e.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==e.panoIndex&&(yield e.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((u,d)=>{const f=s.panoIndex!==void 0?s.panoIndex:e.panoIndex;f!==void 0?e.moveToPano(f,O({duration:o,moveEndCallback:()=>u(!0),moveCancelCallback:()=>d(new Error("move canceled"))},s)):d(new Error("unexpected error"))})}),i=s=>{const o=e.state,a=QA(o.latitude),l=QA(s.latitude),{from:c,to:h}=km(o.longitude,s.longitude,s.rotation||sr.Loop),u=o.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:u},to:{latitude:l,longitude:h,fov:d}}};return{move:t,rotate:(l,c,...h)=>te(this,[l,c,...h],function*(s,o,a={}){n.interruptCallback&&n.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),e.currentMode!==Zt.Five.Mode.Panorama&&(yield e.changeMode(Zt.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==e.panoIndex&&(a.preload&&(yield e.preloadPano(s.panoIndex)),yield new Promise((f,m)=>{if(!s.panoIndex){f(!0);return}e.moveToPano(s.panoIndex,{moveEndCallback:()=>f(!0),moveCancelCallback:()=>m(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:u,to:d}=i(s);return yield new Promise(f=>{const m=({progress:A})=>{const w={};w.longitude=Lm(u.longitude,d.longitude,A),w.latitude=Lm(u.latitude,d.latitude,A),w.fov=Lm(u.fov,d.fov,A),e.setState(w,!0)},p=()=>{f(!0)},g=()=>{f(!1)},y=s.rotateSpeed?Math.ceil(Math.abs(d.longitude-u.longitude)/s.rotateSpeed*1e3):o,b=Qk(y,Gi.Linear.None).onUpdate(m).onComplete(p).onDestroy(g);s.rotation===sr.Loop&&b.repeat(1/0).yoyo(!0),n.interruptCallback=(A=!0)=>{b.destroy(),n.interruptCallback=void 0,n.timeoutId&&(clearTimeout(n.timeoutId),n.timeoutId=void 0),f(A)},n.timeoutId=setTimeout(()=>{n.interruptCallback&&n.interruptCallback(!0)},o)})})}};function YA(e,n){return e.x===n.x&&e.y===n.y}function XA(e,n){return Math.abs(e)===1/0&&Math.abs(n)===1/0?!0:Math.abs(e-n)<.001}function od(e,n){return(n.y-e.y)/(n.x-e.x)}function ZA(e,n,t){const i=od(e[1],e[0]),r=od(n[1],n[0]);if(isNaN(i)||isNaN(r)||XA(i,r))return!1;if(ad(e[0],n))return e[0];if(ad(e[1],n))return e[1];if(ad(n[0],e))return n[0];if(ad(n[1],e))return n[1];if(t&&!Zk(e,n))return!1;const s=e[0],o=n[0];if(Math.abs(i)===1/0)return{x:s.x,y:n[1].y-(n[1].x-s.x)*r};if(Math.abs(r)===1/0)return{x:o.x,y:e[1].y-(e[1].x-o.x)*i};const a=(o.y-s.y+i*s.x-r*o.x)/(i-r),l=i*a-i*s.x+s.y;return{x:a,y:l}}function ad(e,n){return YA(e,n[0])||YA(e,n[1])?!0:(n[0].x-e.x)*(e.x-n[1].x)>=0&&(n[0].y-e.y)*(e.y-n[1].y)>=0&&XA(od(n[0],e),od(e,n[1]))}function Xk(e){let n=1/0,t=-1/0,i=1/0,r=-1/0;return e.forEach(s=>{n=Math.min(n,s.x),t=Math.max(t,s.x),i=Math.min(i,s.y),r=Math.max(r,s.y)}),{x:(n+t)/2,y:(i+r)/2}}function ld(e,n,t){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)}function Zk(e,n){return Math.max(e[0].x,e[1].x)>=Math.min(n[0].x,n[1].x)&&Math.max(n[0].x,n[1].x)>=Math.min(e[0].x,e[1].x)&&Math.max(e[0].y,e[1].y)>=Math.min(n[0].y,n[1].y)&&ld(n[0],e[1],e[0])*ld(e[1],n[1],e[0])>0&&ld(e[0],n[1],n[0])*ld(n[1],e[1],n[0])>0?1:0}function qA(e,n=0){n<=0?requestAnimationFrame(e):requestAnimationFrame(()=>qA(e,n-1))}const qk=`<style type="text/css">
|
|
3174
|
+
`;return e.$$set=s=>{"content"in s&&t(0,i=s.content)},[i,r]}class _D extends Oe{constructor(n){super(),ke(this,n,ED,PD,Le,{content:0},CD)}}function SD(e){Ue(e,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function ID(e){let n,t;return n=new MD({props:{url:e[1].url}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&2&&(s.url=i[1].url),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function TD(e){let n,t;return n=new _D({props:{content:e[0]}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.content=i[0]),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function DD(e){let n,t,i,r;const s=[TD,ID],o=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(t=a(e))&&(i=o[t]=s[t](e)),{c(){n=H("div"),i&&i.c(),_(n,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){X(l,n,c),~t&&o[t].m(n,null),r=!0},p(l,[c]){let h=t;t=a(l),t===h?~t&&o[t].p(l,c):(i&&(Fe(),Z(o[h],1,1,()=>{o[h]=null}),Ve()),~t?(i=o[t],i?i.p(l,c):(i=o[t]=s[t](l),i.c()),N(i,1),i.m(n,null)):i=null)},i(l){r||(N(i),r=!0)},o(l){Z(i),r=!1},d(l){l&&Y(n),~t&&o[t].d()}}}function LD(e,n,t){let i,r,{floorIndex:s}=n,{floorplanData:o}=n;return e.$$set=a=>{"floorIndex"in a&&t(2,s=a.floorIndex),"floorplanData"in a&&t(3,o=a.floorplanData)},e.$$.update=()=>{var a,l;e.$$.dirty&12&&t(1,i=o.outlines[s]),e.$$.dirty&12&&t(0,r=(l=(a=o.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[r,i,s,o]}class iA extends Oe{constructor(n){super(),ke(this,n,LD,DD,Le,{floorIndex:2,floorplanData:3},SD)}}function kD(e){Ue(e,"svelte-9vzn2f",".floorplan-plugin__room-label-item.svelte-9vzn2f{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-part1.svelte-9vzn2f{display:flex;flex-flow:column;align-items:center;color:#fff;white-space:nowrap}.floorplan-plugin__room-area.svelte-9vzn2f{opacity:0.6;line-height:1.25;margin-top:0.125rem}")}function OD(e){let n,t=e[15].outerHTML+"",i;return{c(){n=new Qu(!1),i=pt(),n.a=i},m(r,s){n.m(t,r,s),X(r,i,s)},p(r,s){s[0]&32768&&t!==(t=r[15].outerHTML+"")&&n.p(t)},d(r){r&&Y(i),r&&n.d()}}}function RD(e){let n,t,i,r,s,o,a=e[1]&&rA(e),l=e[0]&&sA(e),c=e[2]&&oA(e);return{c(){n=H("div"),a&&a.c(),t=ye(),l&&l.c(),i=ye(),c&&c.c(),r=pt(),_(n,"class","floorplan-plugin__room-part1 svelte-9vzn2f"),W(n,"opacity",e[11]?"1":"0")},m(h,u){X(h,n,u),a&&a.m(n,null),Q(n,t),l&&l.m(n,null),X(h,i,u),c&&c.m(h,u),X(h,r,u),s||(o=[zi(ys.call(null,n)),lt(n,"clientWidth",e[32]),lt(n,"clientHeight",e[33])],s=!0)},p(h,u){h[1]?a?a.p(h,u):(a=rA(h),a.c(),a.m(n,t)):a&&(a.d(1),a=null),h[0]?l?l.p(h,u):(l=sA(h),l.c(),l.m(n,null)):l&&(l.d(1),l=null),u[0]&2048&&W(n,"opacity",h[11]?"1":"0"),h[2]?c?c.p(h,u):(c=oA(h),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(h){h&&Y(n),a&&a.d(),l&&l.d(),h&&Y(i),c&&c.d(h),h&&Y(r),s=!1,bn(o)}}}function rA(e){let n,t=e[3].name+"",i;return{c(){n=H("span"),i=Mt(t),_(n,"class","floorplan-plugin__room-name")},m(r,s){X(r,n,s),Q(n,i)},p(r,s){s[0]&8&&t!==(t=r[3].name+"")&&Pt(i,t)},d(r){r&&Y(n)}}}function sA(e){let n,t;return{c(){n=H("span"),t=Mt(e[14]),_(n,"class","floorplan-plugin__room-area svelte-9vzn2f"),W(n,"font-size",e[19])},m(i,r){X(i,n,r),Q(n,t)},p(i,r){r[0]&16384&&Pt(t,i[14])},d(i){i&&Y(n)}}}function oA(e){let n,t;return{c(){n=H("span"),t=Mt(e[13]),_(n,"class","floorplan-plugin__room-size"),W(n,"font-size",e[19]),W(n,"opacity",e[10]?"0.6":"0")},m(i,r){X(i,n,r),Q(n,t)},p(i,r){r[0]&8192&&Pt(t,i[13]),r[0]&1024&&W(n,"opacity",i[10]?"0.6":"0")},d(i){i&&Y(n)}}}function zD(e){let n,t,i;function r(a,l){if(a[4]===void 0)return RD;if(a[15])return OD}let s=r(e),o=s&&s(e);return{c(){n=H("div"),o&&o.c(),_(n,"class","floorplan-plugin__room-label-item svelte-9vzn2f"),W(n,"left",e[16]),W(n,"top",e[17]),W(n,"font-size",e[18]),W(n,"opacity",e[12]?"1":"0"),W(n,"transform",e[9]?"translate(-50%, calc(-50% + 6px))":"translate(-50%, -50%)")},m(a,l){X(a,n,l),o&&o.m(n,null),t||(i=[zi(ys.call(null,n)),lt(n,"clientWidth",e[34]),lt(n,"clientHeight",e[35])],t=!0)},p(a,l){s===(s=r(a))&&o?o.p(a,l):(o&&o.d(1),o=s&&s(a),o&&(o.c(),o.m(n,null))),l[0]&4096&&W(n,"opacity",a[12]?"1":"0"),l[0]&512&&W(n,"transform",a[9]?"translate(-50%, calc(-50% + 6px))":"translate(-50%, -50%)")},i:de,o:de,d(a){a&&Y(n),o&&o.d(),t=!1,bn(i)}}}function BD(e,n){const t=e[0],i=e[1];let r=!1;for(let s=0,o=n.length-1;s<n.length;o=s++){const a=n[s][0],l=n[s][1],c=n[o][0],h=n[o][1];l>i!=h>i&&t<(c-a)*(i-l)/(h-l)+a&&(r=!r)}return r}function ND(e,n,t){let i,r,s,o,a,l,c,h,u,d,f,m,p,{pxmm:g}=n,{roomAreaEnable:y}=n,{roomNameEnable:b}=n,{roomDimensionEnable:A}=n,{room:w}=n,{hoveredRoom:x}=n,{getRoomAreaText:M}=n,{getRoomDimensionText:E}=n,{getLabelElement:S}=n,{adaptiveRoomLabelVisibleEnable:T}=n;function z(se,Me){if(Me.width===0||Me.height===0)return()=>!1;const Ge=se.path.map(({x:F,y:j})=>[F,j]),ae=se.roomLabel.position,{x:me,y:De}=ae,{width:We,height:gt}=Me,Ce=We/2,je=gt/2;return function(j){const _e=me*j,ve=De*j,Ke=Ge.map(([fe,ot])=>[fe*j,ot*j]);return[[_e+Ce,ve-je],[_e-Ce,ve-je],[_e-Ce,ve+je],[_e+Ce,ve+je]].every(fe=>BD(fe,Ke))}}const D=document.body.clientWidth,k=document.body.clientHeight,R=w.roomLabel,G=R.positionInImage.x*100+"%",I=R.positionInImage.y*100+"%",U=(D<500||k<500?10:14)+"px",J=(D<500||k<500?8:12)+"px";let K=0,ne=0,ie=0,pe=0,be=!1;x.subscribe(function(Me){t(25,be=!!Me&&Me.id===w.id)});const Ae=se=>{t(7,ie=se.detail)},Je=se=>{t(8,pe=se.detail)},we=se=>{t(5,K=se.detail)},le=se=>{t(6,ne=se.detail)};return e.$$set=se=>{"pxmm"in se&&t(20,g=se.pxmm),"roomAreaEnable"in se&&t(0,y=se.roomAreaEnable),"roomNameEnable"in se&&t(1,b=se.roomNameEnable),"roomDimensionEnable"in se&&t(2,A=se.roomDimensionEnable),"room"in se&&t(3,w=se.room),"hoveredRoom"in se&&t(21,x=se.hoveredRoom),"getRoomAreaText"in se&&t(22,M=se.getRoomAreaText),"getRoomDimensionText"in se&&t(23,E=se.getRoomDimensionText),"getLabelElement"in se&&t(4,S=se.getLabelElement),"adaptiveRoomLabelVisibleEnable"in se&&t(24,T=se.adaptiveRoomLabelVisibleEnable)},e.$$.update=()=>{var se,Me;e.$$.dirty[0]&24&&t(15,i=S==null?void 0:S(w)),e.$$.dirty[0]&4194312&&t(14,r=w.size?M(w.size):""),e.$$.dirty[0]&8388616&&t(13,s=w!=null&&w.dimension?E((se=w.dimension)==null?void 0:se.width,(Me=w.dimension)==null?void 0:Me.height):""),e.$$.dirty[0]&384&&t(31,o={width:ie,height:pe}),e.$$.dirty[0]&8|e.$$.dirty[1]&1&&t(30,a=o?z(w,o):void 0),e.$$.dirty[0]&1091567616&&t(27,l=T?!!(a!=null&&a(g)):!0),e.$$.dirty[0]&96&&t(29,c={width:K,height:ne}),e.$$.dirty[0]&536870920&&t(28,h=c?z(w,c):void 0),e.$$.dirty[0]&286261248&&t(26,u=T?!!(h!=null&&h(g)):!0),e.$$.dirty[0]&234881024&&t(12,d=u||l||be),e.$$.dirty[0]&167772160&&t(11,f=l||be),e.$$.dirty[0]&100663296&&t(10,m=u||be),e.$$.dirty[0]&201326592&&t(9,p=l&&!u)},[y,b,A,w,S,K,ne,ie,pe,p,m,f,d,s,r,i,G,I,U,J,g,x,M,E,T,be,u,l,h,c,a,o,Ae,Je,we,le]}class FD extends Oe{constructor(n){super(),ke(this,n,ND,zD,Le,{pxmm:20,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,room:3,hoveredRoom:21,getRoomAreaText:22,getRoomDimensionText:23,getLabelElement:4,adaptiveRoomLabelVisibleEnable:24},kD,[-1,-1])}}function VD(e){Ue(e,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function aA(e,n,t){const i=e.slice();return i[14]=n[t],i}function lA(e){let n,t=[],i=new Map,r,s,o,a=e[10];const l=c=>c[14].id;for(let c=0;c<a.length;c+=1){let h=aA(e,a,c),u=l(h);i.set(u,t[c]=cA(u,h))}return{c(){n=H("div");for(let c=0;c<t.length;c+=1)t[c].c();_(n,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,h){X(c,n,h);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(n,null);r=!0,s||(o=[zi(ys.call(null,n)),lt(n,"clientWidth",e[13])],s=!0)},p(c,h){h&1791&&(a=c[10],Fe(),t=Ni(t,h,l,1,c,a,i,n,vs,cA,null,aA),Ve())},i(c){if(!r){for(let h=0;h<a.length;h+=1)N(t[h]);r=!0}},o(c){for(let h=0;h<t.length;h+=1)Z(t[h]);r=!1},d(c){c&&Y(n);for(let h=0;h<t.length;h+=1)t[h].d();s=!1,bn(o)}}}function cA(e,n){let t,i,r;const s=[{pxmm:n[9],room:n[14],hoveredRoom:n[3],roomAreaEnable:n[0],roomNameEnable:n[1],roomDimensionEnable:n[2],getLabelElement:n[6],getRoomAreaText:n[4],getRoomDimensionText:n[5],adaptiveRoomLabelVisibleEnable:n[7]}];let o={};for(let a=0;a<s.length;a+=1)o=Ln(o,s[a]);return i=new FD({props:o}),{key:e,first:null,c(){t=pt(),Te(i.$$.fragment),this.first=t},m(a,l){X(a,t,l),Se(i,a,l),r=!0},p(a,l){n=a;const c=l&1791?Vn(s,[{pxmm:n[9],room:n[14],hoveredRoom:n[3],roomAreaEnable:n[0],roomNameEnable:n[1],roomDimensionEnable:n[2],getLabelElement:n[6],getRoomAreaText:n[4],getRoomDimensionText:n[5],adaptiveRoomLabelVisibleEnable:n[7]}]):{};i.$set(c)},i(a){r||(N(i.$$.fragment,a),r=!0)},o(a){Z(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Ie(i,a)}}}function GD(e){let n,t,i=e[10]&&lA(e);return{c(){i&&i.c(),n=pt()},m(r,s){i&&i.m(r,s),X(r,n,s),t=!0},p(r,[s]){r[10]?i?(i.p(r,s),s&1024&&N(i,1)):(i=lA(r),i.c(),N(i,1),i.m(n.parentNode,n)):i&&(Fe(),Z(i,1,1,()=>{i=null}),Ve())},i(r){t||(N(i),t=!0)},o(r){Z(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function jD(e,n,t){let i,{floorIndex:r}=n,{roomAreaEnable:s}=n,{roomNameEnable:o}=n,{roomDimensionEnable:a}=n,{floorplanData:l}=n,{hoveredRoom:c}=n,{getRoomAreaText:h}=n,{getRoomDimensionText:u}=n,{getLabelElement:d}=n,{adaptiveRoomLabelVisibleEnable:f}=n,m=0,p=0;const g=y=>{t(8,m=y.detail)};return e.$$set=y=>{"floorIndex"in y&&t(11,r=y.floorIndex),"roomAreaEnable"in y&&t(0,s=y.roomAreaEnable),"roomNameEnable"in y&&t(1,o=y.roomNameEnable),"roomDimensionEnable"in y&&t(2,a=y.roomDimensionEnable),"floorplanData"in y&&t(12,l=y.floorplanData),"hoveredRoom"in y&&t(3,c=y.hoveredRoom),"getRoomAreaText"in y&&t(4,h=y.getRoomAreaText),"getRoomDimensionText"in y&&t(5,u=y.getRoomDimensionText),"getLabelElement"in y&&t(6,d=y.getLabelElement),"adaptiveRoomLabelVisibleEnable"in y&&t(7,f=y.adaptiveRoomLabelVisibleEnable)},e.$$.update=()=>{if(e.$$.dirty&6144&&t(10,i=l.floorDatas[r].rooms),e.$$.dirty&4352){const{max:y,min:b}=l.bounding,A=y.x-b.x;t(9,p=m/A)}},[s,o,a,c,h,u,d,f,m,p,i,r,l,g]}class HD extends Oe{constructor(n){super(),ke(this,n,jD,GD,Le,{floorIndex:11,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,floorplanData:12,hoveredRoom:3,getRoomAreaText:4,getRoomDimensionText:5,getLabelElement:6,adaptiveRoomLabelVisibleEnable:7},VD)}}function UD(e){Ue(e,"svelte-1fuyezq",".floorplan-plugin__rule-labels.svelte-1fuyezq.svelte-1fuyezq{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-1fuyezq.svelte-1fuyezq{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq.svelte-1fuyezq{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq.svelte-1fuyezq{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq.svelte-1fuyezq{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-1fuyezq.svelte-1fuyezq{background:#fff;opacity:0.2;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-1fuyezq.svelte-1fuyezq{position:absolute;background:#fff;opacity:0.2;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale.svelte-1fuyezq{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute}.floorplan-plugin__rule-labels--top.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-1fuyezq.svelte-1fuyezq{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-text-item.svelte-1fuyezq{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-1fuyezq.svelte-1fuyezq{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.35}")}function hA(e,n,t){const i=e.slice();return i[11]=n[t],i[13]=t,i}function uA(e,n,t){const i=e.slice();return i[14]=n[t],i}function dA(e){let n;return{c(){n=H("div"),_(n,"class","floorplan-plugin__rule-scale svelte-1fuyezq"),W(n,"left",e[14].left*100+"%"),W(n,"bottom",e[14].bottom*100+"%")},m(t,i){X(t,n,i)},p:de,d(t){t&&Y(n)}}}function fA(e,n){let t,i,r=n[1](n[11].distance)+"",s,o;return{key:e,first:null,c(){t=H("div"),i=H("div"),s=Mt(r),o=ye(),_(i,"class","floorplan-plugin__rule-text svelte-1fuyezq"),Ee(i,"is-row",n[2]),_(t,"class","floorplan-plugin__rule-text-item svelte-1fuyezq"),W(t,"left",n[11].left*100+"%"),W(t,"bottom",n[11].bottom*100+"%"),this.first=t},m(a,l){X(a,t,l),Q(t,i),Q(i,s),Q(t,o)},p(a,l){n=a,l&2&&r!==(r=n[1](n[11].distance)+"")&&Pt(s,r)},d(a){a&&Y(t)}}}function WD(e){let n,t,i,r,s,o,a=[],l=new Map,c,h=e[3],u=[];for(let m=0;m<h.length;m+=1)u[m]=dA(uA(e,h,m));let d=e[4];const f=m=>m[13];for(let m=0;m<d.length;m+=1){let p=hA(e,d,m),g=f(p);l.set(g,a[m]=fA(g,p))}return{c(){n=H("div"),t=H("div"),i=ye(),r=H("div");for(let m=0;m<u.length;m+=1)u[m].c();s=ye(),o=H("div");for(let m=0;m<a.length;m+=1)a[m].c();_(t,"class","floorplan-plugin__rule-line svelte-1fuyezq"),_(r,"class","floorplan-plugin__rule-scale-wrapper svelte-1fuyezq"),Ee(r,"is-row",e[2]),_(o,"class","floorplan-plugin__rule-text-wrapper svelte-1fuyezq"),_(n,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+e[0]+" svelte-1fuyezq"),Ee(n,"is-row",e[2]),W(n,"width",e[2]?"100%":1/16+"rem"),W(n,"height",e[2]?1/16+"rem":"100%")},m(m,p){X(m,n,p),Q(n,t),Q(n,i),Q(n,r);for(let g=0;g<u.length;g+=1)u[g]&&u[g].m(r,null);Q(n,s),Q(n,o);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(o,null)},p(m,[p]){if(p&8){h=m[3];let g;for(g=0;g<h.length;g+=1){const y=uA(m,h,g);u[g]?u[g].p(y,p):(u[g]=dA(y),u[g].c(),u[g].m(r,null))}for(;g<u.length;g+=1)u[g].d(1);u.length=h.length}p&22&&(d=m[4],a=Ni(a,p,f,1,m,d,l,o,Am,fA,null,hA)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+m[0]+" svelte-1fuyezq")&&_(n,"class",c),p&5&&Ee(n,"is-row",m[2])},i:de,o:de,d(m){m&&Y(n),Bi(u,m);for(let p=0;p<a.length;p+=1)a[p].d()}}}const Fa=1e3,Va=180;function QD(e,n,t){let{type:i}=n,{data:r}=n,{bounding:s}=n,{getRuleDistanceText:o}=n;const a=i==="top"||i==="bottom",l=s.max.x-s.min.x-(Fa-Va)*2,c=s.max.y-s.min.y-(Fa-Va)*2,h=r.map(([m,p])=>a?[m.x,p.x]:[m.y,p.y]).flat().sort().filter((m,p,g)=>p===0?!0:m!==g[p-1]),u=h.map(m=>{const p=a?(m-s.min.x-Fa+Va)/l:0,g=a?0:(m-s.min.y-Fa+Va)/c;return{left:p,bottom:g}});u.unshift({left:0,bottom:0}),u.push(a?{left:1,bottom:0}:{left:0,bottom:1});const d=h[h.length-1]-h[0],f=h.map((m,p,g)=>{const y=p===0?0:m-g[p-1],b=p===0?0:(m+g[p-1])/2,A=a?(b-s.min.x-Fa+Va)/l:0,w=a?0:(b-s.min.y-Fa+Va)/c;return{left:A,bottom:w,distance:y}}).filter(({distance:m})=>m/d>.1);return e.$$set=m=>{"type"in m&&t(0,i=m.type),"data"in m&&t(5,r=m.data),"bounding"in m&&t(6,s=m.bounding),"getRuleDistanceText"in m&&t(1,o=m.getRuleDistanceText)},[i,o,a,u,f,r,s]}class YD extends Oe{constructor(n){super(),ke(this,n,QD,WD,Le,{type:0,data:5,bounding:6,getRuleDistanceText:1},UD)}}function XD(e){Ue(e,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function pA(e,n,t){const i=e.slice();return i[13]=n[t][0],i[14]=n[t][1],i}function mA(e,n){let t,i,r;const s=[{type:n[13],data:n[14],bounding:n[1],getRuleDistanceText:n[0]}];let o={};for(let a=0;a<s.length;a+=1)o=Ln(o,s[a]);return i=new YD({props:o}),{key:e,first:null,c(){t=pt(),Te(i.$$.fragment),this.first=t},m(a,l){X(a,t,l),Se(i,a,l),r=!0},p(a,l){n=a;const c=l&19?Vn(s,[{type:n[13],data:n[14],bounding:n[1],getRuleDistanceText:n[0]}]):{};i.$set(c)},i(a){r||(N(i.$$.fragment,a),r=!0)},o(a){Z(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Ie(i,a)}}}function ZD(e){let n,t=[],i=new Map,r,s=e[4];const o=a=>a[13];for(let a=0;a<s.length;a+=1){let l=pA(e,s,a),c=o(l);i.set(c,t[a]=mA(c,l))}return{c(){n=H("div");for(let a=0;a<t.length;a+=1)t[a].c();_(n,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),W(n,"width",e[3]),W(n,"height",e[2])},m(a,l){X(a,n,l);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(n,null);r=!0},p(a,[l]){l&19&&(s=a[4],Fe(),t=Ni(t,l,o,1,a,s,i,n,vs,mA,null,pA),Ve()),l&8&&W(n,"width",a[3]),l&4&&W(n,"height",a[2])},i(a){if(!r){for(let l=0;l<s.length;l+=1)N(t[l]);r=!0}},o(a){for(let l=0;l<t.length;l+=1)Z(t[l]);r=!1},d(a){a&&Y(n);for(let l=0;l<t.length;l+=1)t[l].d()}}}const gA=1e3,vA=180;function qD(e,n,t){let i,r,s,o,a,l,c,h,u,d,{floorIndex:f}=n,{floorplanData:m}=n,{getRuleDistanceText:p}=n;return e.$$set=g=>{"floorIndex"in g&&t(5,f=g.floorIndex),"floorplanData"in g&&t(6,m=g.floorplanData),"getRuleDistanceText"in g&&t(0,p=g.getRuleDistanceText)},e.$$.update=()=>{e.$$.dirty&64&&t(1,i=m.bounding),e.$$.dirty&96&&t(11,r=m.floorDatas[f].rules),e.$$.dirty&2048&&t(12,s=Object.keys(r)),e.$$.dirty&6144&&t(4,o=s.map(g=>[g,r[g]])),e.$$.dirty&2&&t(9,a=i.max.x-i.min.x),e.$$.dirty&2&&t(7,l=i.max.y-i.min.y),e.$$.dirty&2&&t(10,c=i.max.x-i.min.x-(gA-vA)*2),e.$$.dirty&2&&t(8,h=i.max.y-i.min.y-(gA-vA)*2),e.$$.dirty&1536&&t(3,u=c/a*100+"%"),e.$$.dirty&384&&t(2,d=h/l*100+"%")},[p,i,d,u,o,f,m,l,h,a,c,r,s]}class JD extends Oe{constructor(n){super(),ke(this,n,qD,ZD,Le,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},XD)}}function rd(e,n={}){let t="";const{needZ:i,needA:r}=n;return(i?e.slice().concat(e[0]):e.slice()).forEach((o,a)=>{const{x:l,y:c}=n.format?n.format(o):o,h=l+","+c;return a===0?(t+="M"+h,t):r!=null&&r[a]?(t+="A"+r[a]+","+h,t):(t+="L"+h,t)}),t+(i?"Z":"")}function yA({x:e,y:n},t){const{max:i,min:r}=t;return{x:e-r.x,y:i.y-n}}function KD(e,n){const t=e.x*1e3+n.bounding.origin.x,i=-e.z*1e3+n.bounding.origin.y;return{x:t,y:i}}function $D(e,n){const t=n.bounding,i=t.max.x-t.min.x,r=t.max.y-t.min.y;return{x:(e.x-t.min.x)/i,y:(t.max.y-e.y)/r}}function eL(e,n){return Math.max(...n.work.observers.map(i=>e.z>=i.standingPosition.z?i.floorIndex:0))}function tL(e){let n;return{c(){n=Bt("path"),_(n,"d",e[0]),_(n,"fill","#2F313A")},m(t,i){X(t,n,i)},p(t,[i]){i&1&&_(n,"d",t[0])},i:de,o:de,d(t){t&&Y(n)}}}function nL(e,n,t){let i,{path:r}=n;return e.$$set=s=>{"path"in s&&t(1,r=s.path)},e.$$.update=()=>{e.$$.dirty&2&&t(0,i=rd(r,{needZ:!0}))},[i,r]}class iL extends Oe{constructor(n){super(),ke(this,n,nL,tL,Le,{path:1})}}function rL(e){let n,t,i,r,s,o;return{c(){n=Bt("defs"),t=Bt("pattern"),i=Bt("rect"),r=Bt("path"),s=ye(),o=Bt("path"),_(i,"x","0"),_(i,"y","0"),_(i,"width",e[1]),_(i,"height",e[1]),_(i,"fill","#323747"),_(r,"d",e[2]),_(r,"stroke","#ffffff"),_(r,"stroke-opacity","0.06"),_(r,"stroke-width","0.5"),_(r,"fill","none"),_(t,"id","fpm-room-pattern-0"),_(t,"x","0"),_(t,"y","0"),_(t,"width",e[1]),_(t,"height",e[1]),_(t,"patternUnits","userSpaceOnUse"),_(t,"patternTransform","scale(50 50)"),_(o,"d",e[0]),_(o,"fill","url(#fpm-room-pattern-0)")},m(a,l){X(a,n,l),Q(n,t),Q(t,i),Q(t,r),X(a,s,l),X(a,o,l)},p(a,[l]){l&1&&_(o,"d",a[0])},i:de,o:de,d(a){a&&Y(n),a&&Y(s),a&&Y(o)}}}const Cm=6;function sL(e,n,t){let i,{path:r}=n;const s=Cm*2,o=`M0 ${Cm} h ${s} M${Cm} 0 v ${s}`;return e.$$set=a=>{"path"in a&&t(3,r=a.path)},e.$$.update=()=>{e.$$.dirty&8&&t(0,i=rd(r,{needZ:!0}))},[i,s,o,r]}class oL extends Oe{constructor(n){super(),ke(this,n,sL,rL,Le,{path:3})}}function aL(e){let n,t,i,r,s,o,a,l,c,h,u;return{c(){n=Bt("defs"),t=Bt("pattern"),i=Bt("rect"),r=Bt("pattern"),s=Bt("rect"),o=ye(),a=Bt("path"),l=ye(),c=Bt("path"),h=ye(),u=Bt("path"),_(i,"x","0"),_(i,"y","0"),_(i,"width","6"),_(i,"height","50"),_(i,"fill","none"),_(i,"stroke","#4B4B57"),_(i,"stroke-width","0.5"),_(t,"id","room-material-pattern-1"),_(t,"x","0"),_(t,"y","0"),_(t,"width","12"),_(t,"height","50"),_(t,"patternUnits","userSpaceOnUse"),_(t,"patternTransform","scale(50 50)"),_(s,"x","0"),_(s,"y","0"),_(s,"width","6"),_(s,"height","50"),_(s,"fill","none"),_(s,"stroke","#4B4B57"),_(s,"stroke-width","0.5"),_(r,"id","room-material-pattern-2"),_(r,"x","6"),_(r,"y","25"),_(r,"width","12"),_(r,"height","50"),_(r,"patternUnits","userSpaceOnUse"),_(r,"patternTransform","scale(50 50)"),_(a,"d",e[0]),_(a,"fill","#43434D"),_(c,"d",e[0]),_(c,"fill","url(#room-material-pattern-1)"),_(u,"d",e[0]),_(u,"fill","url(#room-material-pattern-2)")},m(d,f){X(d,n,f),Q(n,t),Q(t,i),Q(n,r),Q(r,s),X(d,o,f),X(d,a,f),X(d,l,f),X(d,c,f),X(d,h,f),X(d,u,f)},p(d,[f]){f&1&&_(a,"d",d[0]),f&1&&_(c,"d",d[0]),f&1&&_(u,"d",d[0])},i:de,o:de,d(d){d&&Y(n),d&&Y(o),d&&Y(a),d&&Y(l),d&&Y(c),d&&Y(h),d&&Y(u)}}}function lL(e,n,t){let i,{path:r}=n;return e.$$set=s=>{"path"in s&&t(1,r=s.path)},e.$$.update=()=>{e.$$.dirty&2&&t(0,i=rd(r,{needZ:!0}))},[i,r]}class cL extends Oe{constructor(n){super(),ke(this,n,lL,aL,Le,{path:1})}}function hL(e){Ue(e,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function bA(e,n,t){const i=e.slice();return i[5]=n[t],i}function uL(e){let n,t;return n=new oL({props:{path:e[5].path}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function dL(e){let n,t;return n=new cL({props:{path:e[5].path}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function fL(e){let n,t;return n=new iL({props:{path:e[5].path}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function AA(e){let n,t,i,r;const s=[fL,dL,uL],o=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return t=a(e),i=o[t]=s[t](e),{c(){n=Bt("svg"),i.c(),_(n,"width","100%"),_(n,"height","100%"),_(n,"viewBox",`0 0 ${e[1]} ${e[2]}`),_(n,"class","svelte-1dykexu")},m(l,c){X(l,n,c),o[t].m(n,null),r=!0},p(l,c){let h=t;t=a(l),t===h?o[t].p(l,c):(Fe(),Z(o[h],1,1,()=>{o[h]=null}),Ve(),i=o[t],i?i.p(l,c):(i=o[t]=s[t](l),i.c()),N(i,1),i.m(n,null))},i(l){r||(N(i),r=!0)},o(l){Z(i),r=!1},d(l){l&&Y(n),o[t].d()}}}function pL(e){let n,t,i=e[0],r=[];for(let o=0;o<i.length;o+=1)r[o]=AA(bA(e,i,o));const s=o=>Z(r[o],1,1,()=>{r[o]=null});return{c(){n=H("div");for(let o=0;o<r.length;o+=1)r[o].c();_(n,"class","floorplan-plugin__room-material svelte-1dykexu")},m(o,a){X(o,n,a);for(let l=0;l<r.length;l+=1)r[l]&&r[l].m(n,null);t=!0},p(o,[a]){if(a&7){i=o[0];let l;for(l=0;l<i.length;l+=1){const c=bA(o,i,l);r[l]?(r[l].p(c,a),N(r[l],1)):(r[l]=AA(c),r[l].c(),N(r[l],1),r[l].m(n,null))}for(Fe(),l=i.length;l<r.length;l+=1)s(l);Ve()}},i(o){if(!t){for(let a=0;a<i.length;a+=1)N(r[a]);t=!0}},o(o){r=r.filter(Boolean);for(let a=0;a<r.length;a+=1)Z(r[a]);t=!1},d(o){o&&Y(n),Bi(r,o)}}}function mL(e,n,t){let i,{floorIndex:r}=n,{floorplanData:s}=n;const o=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return e.$$set=l=>{"floorIndex"in l&&t(3,r=l.floorIndex),"floorplanData"in l&&t(4,s=l.floorplanData)},e.$$.update=()=>{e.$$.dirty&24&&t(0,i=s.floorDatas[r].rooms.map(l=>Pe(O({},l),{path:l.path.map(c=>yA(c,s.bounding))})))},[i,o,a,r,s]}class gL extends Oe{constructor(n){super(),ke(this,n,mL,pL,Le,{floorIndex:3,floorplanData:4},hL)}}function vL(e){Ue(e,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function yL(e){let n,t,i,r;return{c(){n=Bt("path"),_(n,"d",e[5]),_(n,"fill","#fff"),_(n,"style",e[2]),_(n,"id",t=`${e[1]}_${e[0].id}`),_(n,"class","svelte-qq2273")},m(s,o){X(s,n,o),i||(r=[lt(n,"mouseenter",e[3]),lt(n,"mouseleave",e[4])],i=!0)},p(s,[o]){o&4&&_(n,"style",s[2]),o&3&&t!==(t=`${s[1]}_${s[0].id}`)&&_(n,"id",t)},i:de,o:de,d(s){s&&Y(n),i=!1,bn(r)}}}function bL(e,n,t){let i,r,{room:s}=n,{floorIndex:o}=n,{floorplanData:a}=n,{highlightData:l}=n,{hoveredRoom:c}=n;function h(){c==null||c.set(s)}function u(){c==null||c.set(void 0)}const{bounding:d}=a,f=rd(s.path,{needZ:!0,format:m=>yA(m,d)});return e.$$set=m=>{"room"in m&&t(0,s=m.room),"floorIndex"in m&&t(1,o=m.floorIndex),"floorplanData"in m&&t(6,a=m.floorplanData),"highlightData"in m&&t(7,l=m.highlightData),"hoveredRoom"in m&&t(8,c=m.hoveredRoom)},e.$$.update=()=>{e.$$.dirty&131&&t(9,i=l[`${o}_${s.id}`]),e.$$.dirty&512&&t(2,r=i?`fill: ${i.color}; --opacity: ${i.opacity}; pointer-events: ${i.disabled?"none":"auto"}`:null)},[s,o,r,h,u,f,a,l,c,i]}class AL extends Oe{constructor(n){super(),ke(this,n,bL,yL,Le,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},vL)}}function wL(e){Ue(e,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function wA(e,n,t){const i=e.slice();return i[6]=n[t],i}function xA(e,n){let t,i,r;const s=[{room:n[6],floorplanData:n[1],hoveredRoom:n[3],floorIndex:n[0],highlightData:n[2]}];let o={};for(let a=0;a<s.length;a+=1)o=Ln(o,s[a]);return i=new AL({props:o}),{key:e,first:null,c(){t=pt(),Te(i.$$.fragment),this.first=t},m(a,l){X(a,t,l),Se(i,a,l),r=!0},p(a,l){n=a;const c=l&15?Vn(s,[{room:n[6],floorplanData:n[1],hoveredRoom:n[3],floorIndex:n[0],highlightData:n[2]}]):{};i.$set(c)},i(a){r||(N(i.$$.fragment,a),r=!0)},o(a){Z(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Ie(i,a)}}}function xL(e){let n,t,i=[],r=new Map,s,o=e[1].floorDatas[e[0]].rooms;const a=l=>l[6].id;for(let l=0;l<o.length;l+=1){let c=wA(e,o,l),h=a(c);r.set(h,i[l]=xA(h,c))}return{c(){n=H("div"),t=Bt("svg");for(let l=0;l<i.length;l+=1)i[l].c();_(t,"width","100%"),_(t,"height","100%"),_(t,"viewBox",`0 0 ${e[4]} ${e[5]}`),_(t,"class","svelte-1kqo6e4"),_(n,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){X(l,n,c),Q(n,t);for(let h=0;h<i.length;h+=1)i[h]&&i[h].m(t,null);s=!0},p(l,[c]){c&15&&(o=l[1].floorDatas[l[0]].rooms,Fe(),i=Ni(i,c,a,1,l,o,r,t,vs,xA,null,wA),Ve())},i(l){if(!s){for(let c=0;c<o.length;c+=1)N(i[c]);s=!0}},o(l){for(let c=0;c<i.length;c+=1)Z(i[c]);s=!1},d(l){l&&Y(n);for(let c=0;c<i.length;c+=1)i[c].d()}}}function ML(e,n,t){let{floorIndex:i}=n,{floorplanData:r}=n,{highlightData:s}=n,{hoveredRoom:o}=n;const a=r.bounding.max.x-r.bounding.min.x,l=r.bounding.max.y-r.bounding.min.y;return e.$$set=c=>{"floorIndex"in c&&t(0,i=c.floorIndex),"floorplanData"in c&&t(1,r=c.floorplanData),"highlightData"in c&&t(2,s=c.highlightData),"hoveredRoom"in c&&t(3,o=c.hoveredRoom)},[i,r,s,o,a,l]}class MA extends Oe{constructor(n){super(),ke(this,n,ML,xL,Le,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},wL)}}function CL(e){Ue(e,"svelte-1lm20n5",".missing-floor.svelte-1lm20n5{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;flex-direction:column;align-items:center}.text.svelte-1lm20n5{margin-top:0.75rem;color:#fff;opacity:0.3}")}function CA(e){let n,t=e[0].text+"",i;return{c(){n=H("span"),i=Mt(t),_(n,"class","text svelte-1lm20n5"),W(n,"font-size",e[0].textFontSize+"px")},m(r,s){X(r,n,s),Q(n,i)},p(r,s){s&1&&t!==(t=r[0].text+"")&&Pt(i,t),s&1&&W(n,"font-size",r[0].textFontSize+"px")},d(r){r&&Y(n)}}}function PL(e){let n,t,i,r,s=e[0].text&&CA(e);return{c(){n=H("div"),t=H("img"),r=ye(),s&&s.c(),_(t,"class","image"),_(t,"alt","缺省楼层展位图"),Sn(t.src,i=e[0].imageURL)||_(t,"src",i),W(t,"width",e[0].imageWidth+"px"),W(t,"height",e[0].imageHeight+"px"),_(n,"class","missing-floor svelte-1lm20n5")},m(o,a){X(o,n,a),Q(n,t),Q(n,r),s&&s.m(n,null)},p(o,[a]){a&1&&!Sn(t.src,i=o[0].imageURL)&&_(t,"src",i),a&1&&W(t,"width",o[0].imageWidth+"px"),a&1&&W(t,"height",o[0].imageHeight+"px"),o[0].text?s?s.p(o,a):(s=CA(o),s.c(),s.m(n,null)):s&&(s.d(1),s=null)},i:de,o:de,d(o){o&&Y(n),s&&s.d()}}}function EL(e,n,t){let{missingFloorConfig:i}=n;return e.$$set=r=>{"missingFloorConfig"in r&&t(0,i=r.missingFloorConfig)},[i]}class _L extends Oe{constructor(n){super(),ke(this,n,EL,PL,Le,{missingFloorConfig:0},CL)}}const As="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+Jq/+VvP+Vuv/c4v+Fnf+btP+InP+Blf/3+P6Txf+Jzf+Jyf+NxP+Qwf/t8/6Svv+Tvf/O1f7Czv3T2f6cu/+qvP7a4fvo7v77/v/o9//p9//0+v////+Vy//w9//k8/+B1f/v9/+D0/+UyP/u9v+D0v/i8f+F0v/g7/+G0P+KzP+Hz/////+Lx//s8/+Puf/h7P+Mxv/w9f7q8v/q8f2RwP/r8f6JrP/t8v6RvP/l6f7////j6P6VvP/f5/7q8P7a4P/U2f6au/+ZuP+ewf+auP+iu//n6f2Fn//j6P/h4fn9/v/4/P/3/P/o9v/l9P+F1P+B1f/i8v+UyP+J0f+E0f/h7//r8v6Izf/g7v/q8v6Pv//f7P7f7f/g7f+Lxf+MyP+Mw//k7v6Ow/+Ov//v8/2Pu//t8f+Tvv/p8P6Uu//q7v/i6P2Xvf+WuP/L1vypu//Azv7K0/zy8v/l8v/A4P/o9f/x+f+I0f/j8v+J0P/s9v/h8P+I0P/t9v/r9P6Lyv+Lyf/s9P/g7P+Myv/s8/7j7v+Jrv/q8P2Uwf+Epf+TuP/a3vzh5f3w8P/a4P20v//Nzfzx8f/Pz/Cg0P/f7//u9f/q8v7o8v7s8/7s8v3w9f+Sv/+TuP+Gp//s8fr///8/HFXHAAAA8nRSTlMANUQ/Z2JJXXaKTjCPmVMre3E6gFiylLxsxoVYnk5JwaOFU8utOjrV0KieQS2icWwzMC4Dt7aTQvjfrHprXD0zMyvpvUxGNjH+2sK9raeYkoiAcF5TUi0rKCYY2cy3pIJ/eGpEQDcxLx0S/Pv19PPu7Ovr5+Tk4eDe3NXU09DIsq2opKCViYN9e3V1cmZlXllVTk1GQDs2NTMwJw0K/vn28u/u5+Pj3tjNycjGw8DAua2pqJ6SjYyMf3BvaWNgWk5NSTc3MxT79PHw6efl2trY19PHurWysqWZe2xkXVlUPjo6OSskCO7Qzs6+vKCedmhdN1av0hoAAAV1SURBVEjHjZT3P9RxHMe1nCjcObo4cjpX5w53l7pUbnBGkr2TPZJKmiqVEQlJhGjvvfcm2nvvvXf5C3q/P98bkuR1D7+9n16v1/vzvtPrnAade/ty6anHJfFHOjkfXbe07PGxkuL4oqIjCzoDjHtxurzsRHmFStokjBDG/59JrwurOF2hkkUoIyKEQmFqatG3/xDnXlSGPZcKI5VKiVgsli+vrakpfNAx8UoVlpRWH6mUeMsVcm8vhah6WfXB3A6IlSlVKoE4KjxcgtNGRl1Ayzw9H+Z20DypMVkZZWKiUIi6oHj2PAbPs6Eh/+6/kBUpVUliIEQKGGcwGPbdiBpCQ/O//AMZJ218XW9igoHsGTwY7kopdMmSvTvbz/VGmiyhCARwWJ/Ss5CQ9pl3zVJZJCEwEszb6BtaGxrCn3XIyZP3trW3rybBWTCB1jy0sNGHeWM7+BgzrX4kJu752E57mWA5mIjsMRVxgGkrJpPpRvtJSywt3X2rPUSMuUgqIIzx37vRaLQeqNKEhN03/womg/bYhDJBBzdqvjsqYeHCHdfa1k9BF0QoEyuwoOadWc4sFutoXNzWGW2W3Axd8E3AxAZ6WNGeEoDl7EwPho/T0cDAtswb2Bi6kFx2VkwaDYgRI5zo9EUGRIGHD82e+ufrJ8uo+l31oQogYMJiOdFh2BQ03NTscEDAn8wKgQCeUsRTI8QEMhkYDDc1NTMLMuNwLAP8/a9Pbl0mJQlXhvVtrO2YNLce3Uew6IvAAsYtLS17gvwLCrKR0d3la0DsgdG3NiZVMBZacMh8L9CB2NjsS61eRiCtB4YH/Q21CMQKAgLnh1hYWAyJ3b9/40Qd09woppJhFytAnIPpBmBCCBjvjdrn59eKSU+SRWkZphu40IMBgRpAAMBmO7DZbL/786+s0TIpKqXOhgqGCKcnhOrd28HBlmj+2LFZWia9KjkqnHoa3BmsjG7wKIgDuSzQw9F29Gh+3jDunTseWas1zKtKYbiIsrEjZdAF2iPiYOvIz+Nyuebm5h6+HuvGa2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function Pm(e){return e*180/Math.PI}function SL(e){Ue(e,"svelte-17cl35n",".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}")}function IL(e){let n,t;return{c(){n=H("div"),t=H("div"),_(t,"class","floorplan__camera-rotate svelte-17cl35n"),W(t,"background-image",`url(${e[0]||As})`),W(t,"width",e[4]),W(t,"height",e[4]),W(t,"left","-"+e[4]),W(t,"top","-"+e[4]),W(t,"transform",`rotate(${e[3]}deg)`),W(t,"transform-origin",`${e[4]} ${e[4]}`),_(n,"class","floorplan__camera-position svelte-17cl35n"),W(n,"left",e[1]),W(n,"top",e[2])},m(i,r){X(i,n,r),Q(n,t)},p(i,[r]){r&1&&W(t,"background-image",`url(${i[0]||As})`);const s=r&1;s&&W(t,"width",i[4]),s&&W(t,"height",i[4]),s&&W(t,"left","-"+i[4]),s&&W(t,"top","-"+i[4]),s&&W(t,"transform",`rotate(${i[3]}deg)`),s&&W(t,"transform-origin",`${i[4]} ${i[4]}`)},i:de,o:de,d(i){i&&Y(n)}}}function TL(e,n,t){let{panoIndex:i}=n,{floorplanData:r}=n,{lastPanoramaLongitude:s}=n,{cameraImageUrl:o}=n;const{observers:a}=r,l=a[i],c=l.positionInImage.x,h=l.positionInImage.y,u=c*100+"%",d=h*100+"%",f=-Pm(s)+45,m=document.body.clientWidth,p=document.body.clientHeight,y=`${(m<500||p<500?17:37)/16}rem`;return e.$$set=b=>{"panoIndex"in b&&t(5,i=b.panoIndex),"floorplanData"in b&&t(6,r=b.floorplanData),"lastPanoramaLongitude"in b&&t(7,s=b.lastPanoramaLongitude),"cameraImageUrl"in b&&t(0,o=b.cameraImageUrl)},[o,u,d,f,y,i,r,s]}let DL=class extends Oe{constructor(n){super(),ke(this,n,TL,IL,Le,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},SL)}};const LL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1/+Bnv/6+/+SrP/m7P/f5v/O2v/L2P/E0v/Az//+///s8P/e5v+rv/+pvv+Anv+qvv+Pqv+Kpv+CoP93l/9xlP/z9v/p7v90lf9uj//P2//v8//o7f/k6v/K1v+6yv9rjv98nv/E0v/9/v/09//h6P/X4f9pjP/9/f/N2f/K1v/C0f+Ho/99nP/1+P9sj//6+//u8/+iuP/u8//g6P/U3v+3x/+0xv+etf+Vrv9pjf/B0P9ukf+ht/+Vr/94mP/G0/+8zP+2x//+/v/09v/W4f9ojv/c5P+xxP/d5v+xw/+vwv+Jo//g6P+nvP+SrP/R3P/1+f/W3//U3//C0P+Jp/9nh/+Kpv+Fov/Y4f/J1/+Pqf+rv/+Oqv+Oqv+muv+twP/f5//t8P97mf/h5/+twP+kuf/L2P+juP+Ipf+huP+Pqf/d5v+zxf+cs/+Zsf+wwv/V3v+8zP+Go/+zxP+GpP/T3f/r8P/u8v/o7f/d5P/m7P/H1P/w9P/D0f+uwf/Z4v/F0v/09//D0v/v8//s8v/d5P/Y4f/s8P+etv/X4f+gt/+ovf+bsv+xw/+Vr//j6v+1x//J1v+4yf/r8P+yxf/T3f/B0f+Fo//09//W4P/h6P/L1v/i6f/x9f/t8v/G0/+uwf/z9f/7/P/n7f/z9v/T3f+4yf/J1v/z9f/w8//q7v/O2v/8/f/5+v/y9f/w8//g6P/z9v+/zv+5yf+9zf/5+v/Q3P/B0P/u8f/R2//////LSJnaAAAA/HRSTlMAAwGMx2jAn2u7ebn0q8zX7J3TiHz45bRS35SFYZmPSembkYNwVMXh2cmodWVjXN43DHZu6gfyrJZGOvrzLAbVvbBB91raz7aypqH+4s6Bfj9/Vk9EMint3C8gt+fc1q+XGAml/O/SxBz7s66kSz3wI/bjc+fQvpOObV8VoyZyXjSpmgv97sMPyorNiYZN0XpYuvHCv6JNEhEWw61YgCUdGBIP5CIgHypaUEU6NS9JQy8lGlY6NCuMfVtPSzspJoRxcExBNTMUyn9zaWRfVkk9Oad9emtkY0RBMLGsnJaQj4ZmXVHhsaKbeW9owb466dnVy7mYj45wyaGV3bdGzuNnAAASkklEQVR42uyaS0iUURiGTUQZ1MaMURSEbOFt4ybGQClFHO9rBS8F3nAURHG0hZvyQrgQRsfNuKmRCTcGGaEzThNqMyouwswKNTVMLe/a/bLo+845/5z/dzIiumj971I3gz6+Puc9x0POT6bRaXfYrJa18YHFhYXXKzMz6+/fb2+/ePFia8uvWlXelFkcr6pO2NqCr2xv77xfn5lZWXm9sDgwvmZZGnHYzaZjHnLk/PaYzL0jS9Pji6+XN3Z3gvJPnTkTEJCT01xSUtWuVick+PlVJ6tUqvj44uLipkxIU3F5fLxKlZxc7efnl6BWt1eVlDTn5AQEnDl16lR+be2n3fWZlYWBNcugze485yFHzq/Kub7eEcv44tzyekpsbEhIZGRWVk1NUFBtPqU2gFGbANRWVycnI7XlCO0XQm25mFp1VRWjFrDNz68NCqqpyYqMDAmJjc3NzQ3cmJwfmLba7CZPDzlyfg5Wh3V6YG559HyhUhkVlZJSUJDLqK3pDkJqoS8ZtVWEWiCTUltejl37BaCVdG2Cul1MLUIb1M2pLShIiYpSKpWF58+37U3Oj1ue2E0ecuT8EK1mm3VoYG4vW6MrLQ0MDDwvUIvQ8q6tBWqZIeRQQ+DU8q51NwQxtbVAbRajNrZARG1gaWBpm0anyY6enB+bGOyV6ZVzIK6bPUPzs17Rx48fb80GaHVtpQRaF7XYtZFIbTcRBAFb7rWc2uJM1rVoCCqgFquWdy0TBDCEbqSWlm2KQC38rZSW6nS67OxW+CxXr0Z7ec/J8MqRxtQ7ONQ/2xIREeHlFR191UVtqRu1wBep2hpqCNxrpYYg6dp4Ude2Y9cG8K5FQ8hyNwSglnZtNoE22svLKyKirKxFsTo28cQsH9v+81Bevb29O1qMZQAtUhs9SqnVsK5199osRi3fENwNgXitcBqrrmZly7r2DKUWq7Zb8FrBEAoptW1tGg3rWk5tC3xSQ53ig8zuf5pzd4df9c8qFIrEOgOhtgyphdCubaVdC9iyrkVo+Wnsm12bID6NZYqWLxX32qpm0fKVD9ii10bSrkVDiJJ2bWuriFqjsaUDPmpdXWIifG7f1bGezT55bfhfYrrfM7Wamufrq9cjtIkGA+1aZgiArdRrlUBtirRr2YbAvBZGBLV71/INAcuWbwjcEERey7tWKe7abGnXdiC1DFq9r29eampF/3O5dv/1ODd7pj5og4ODU13UQtdyQ+Beq9FovnMaE20IAdwQJHut2BCE05jaffkSDAGwxbJl1CK27DQ2iqcxCFKLXWsgXatX+BJqg4O1aWlJz14N35XR/RfTeP/2VOeFpKS0tDQCLVDrq9AjtXVIrdFYVsaoHWWGQKgN3EdtCNVa91sGtdQQmvhpjFUtX74QWjoioNdm0a5lGwL3Wp1GI/HaCCP1WkMddi1Cm5cH1BJsky5UxGHrysLw7wQd9pl/XFfFBaRWq9UCtalIrZ56rcG7A7u2jHktMQQN91qllFq2fImoba468G5M6rVq4rV8Q0CvZdTGgtcitrxrNUgtli1QCyFe6+0yBL3eF6Cl1CYBtYBtnL9/0b2ezWseco56QGLvpV++7O8fF1dRAdhC16Ih0K4lhpBoQBaMLS6vZacxTdu+DSFXsiHkU689YENgd2MSQ0iQ7rXiG90Qvnxh2eJhTOfqWihb7rXUEIBalyFotaRru+IQ28uXY9LBF27JD3OObPqePn9TlJ4eExNDqO0CapOQWsCWdq2CUmtgGwKnli9f6LWFrg0hhFEr7doS1rXSu7HM8nK3DaHd7W6shnutyxACqdficYxSyzYEgVqEVsENQYtdi9j6U2rTi4oqfaZu32n0kHO04nlr+N3HjIaGoqIipNafUNsF1KIicK9VUK8FQ8Cu5YbAqQVslfv2Wuq1+TU7uxszK/DycG1t2mJZWrKOjIzYHA673Wx2Ok3nPImbNJqcfWa7vdfhsMG3rUtLFss0PG3Eh43ruzvC8sW7lhkCgxYMQXzLYCReyzYESGoePY0JXesPiYlBbCsbOjMyMu713L/uIedo5NiNm+8++vhkALSVlaRrqSEAtNKu1VNqWddKN4Rs3f6uLdxYnsTXsdNLg7Ze8y95WOhp6rM7RqyW6fGB+bnJ5Q0lNQRyo+u+fOGGIMFWOI2Rqq2ghgDUYtcSbH18fE4AuXLnHvr0PX30JvzEiRM+gG0nYFsE2IIgQARD0LINIY9vCNLla1R8ozu6PLc4brE6zH/iEcAxp90GD83mJ/dAqjU64TTGvNYodC0uX2SvJV1LNwSkFg3B1bWEWvhBhIdfeSjbwiHO9QeP34aFXQkPp9AitWgIgtfGYdcecBrrMJYJy1c0gLIHb62GrE96+/7aCmoyOwYnhvrnJo3otXz5Yl6roNCmptLTGHYtei1imy50rQ+lFrANC7v48ra86B6+HLs1/PDs2YsA7RWAlmLb0MkNgXStdENwv2WIUKzi2yrnoZo98ekkPpYQ7saQWtq1dPlCr+WGIO1axJZSe/Hs2bePHsiae4jSeOfxpdBQhJZULe/aSmIISG0cNwTetQoIMQTDbP9Qj818mP+Pejp7ByfGVmeF5WufIVw4wGuxahm1oaGh9S9vyqPYYYgnnL1O19cDtEAt7VrqtXCIdnWtsCEkYdfyWwaF4jMp174j9JtsvGvrGer/oMcNQXzL0CVZvhoaMii1iG2YQG19/enTp08+li33K/tm7JNGGIbxqiEht5m7iasMcBuwwOJk0tEFcn9BG7s1bizQGBycCCbXpUkTo9VFJVpRSeNkuBqnq6BRoiwOMtldm3Tr+37fJ9+dtFEUbNX3+RPIj+d+93zf/ctgyZb1YDAUAmx510J410JY1wqvbTeEma3vJ9uP9571yObu8rfTd6xrhSEIahFb2bXCayW1wWAwM2CvLf5XFvSMMr9fzw9kMhnEFqmVXSsMYQI3hFFJLUD7GixwZuvHU/kuoG+zsXx0CtS+Yl4runZ0fHzcvSEAtUPcEEKCWshhdYlezx44I0vV80J+AILQQgIuagdby9e1vXbm9Ogp3kmd2j45q7z1Ll/tXRuAoCEAtQzbQkE93qdLCw+Wsa9NXVXVfB6xdXftsOxauSHwszHgtfG0L6IufNkBdhm0vGul10Kk14quzQO1qqqDK7yg9Dwj682wrk+raqEgoGXUtrp2yGUI3Gt/we3T5/L+0Q+6W/mIXTvR7rWArTSEfJ5Rq+the40at5dBMTDDCC2jVhoCYjscAGo5tBC+fA0elXefhsF2dqTdOKtMyLlWvo2F3NQCtNPTiG04aZcI3B6lb6mqJZPhK2rVFrVBFATRtXKvrZw1Fh/RotXdoOzu/LwYhLj3Wo8hCGrDQG1y1jTIcbufvo2ilTJnZxFbnRsC81qxIYQ8XntRpy9SWOZ3y+dv2pevjPRaQa1pplIph87OuoxsXEulTJND6zWEjPRagDZwXqbredd94bgiqfUYgsq6Ngldi9hqmna8Qj9etw6/bMvSNIYt/MAtQ8i7DQG79rLeoPH8b75QPg8wbINyQ+CGILtW0yxLUZoE7v2RrRmKolgaUouGwL1W93gtdu1lnY57bj5IPBRei+GGAHF3rYKJ7608l82lF5lacSLxOFLLutaUXeuhNlOnOyEdkMu9VnYtJGnysrUshDYej6SLG9QBd5TZdASgjSsQhNZFrS69FoilF6+OsgDkIrauDWEWu1ZjhoDYRiKRdNohU+g4CyUnl2tRa1nSEKTXFmwi9s7kNg89G4IwBNG1SG0uZ9BVhQ4PEwzDyKWBWoEtUis2BNG19toSydc9bx81D91dC9hKaiNIrWE4dPxwy8yXnEQCoL3WtSnetQhtsklXRLv1YajNli8BraYgtozaXBqgTSQS2cl1+q1vytj6pD+bBWpF10qvFV2btIukBV2WhVRrQxDQCkNAbLNZv1N7zoeMt/jr13x+P1LLyhawlYLAX8fobl33g0ZWtE2+11oearFr/RDf3gEV7p/z6WDS5/MJaF1eqwhslSo9q3qW/vn9Y63Na7Fqs0gtpDZHhXs9/Z9r0ShC6+5aQS1C65ToEKHXmVqvRtoNwQ9BbKPR96vUGt5H1IcYg9YjCDkxIcSrNB32ONLRSg7H1msIEMA2GqNJoZWp1ckYQCuoRWwZtUYaFSFdpNHwYbOwsodde7UhtLAFaGOxl7U5eub9Ztfscd0Eoihsu8oSKJBoQpUYyYULmhSIBVjACuip0tFQpEaaagTSyLiI9GSMZArEKp4it95N7oXBk6dUr7Ln59sB4uNw7p0BTlfb3s7Wcm0fvfbbV7MveAYo7k9eEB5h+x0Aa22b9OlKb9bHP7kNgLZC2slawKTs80Bx/2sIW8DO7dy7VSt9SfuoyHMurei1k7bnt/3K8ExQXLT2Y0MA8qLwro2mRaG6hV5RTNpuuba81345v+n+E3oR6su7aAjc2hyt9cL4qN+fcNNcw9DzPJG1i7VG2dfidHlHaYW1qK0H2oauZvvz/ZEyhtLyrBUN4WzuxLweIO6HrOXWhiQa6pUupHeLkRCYrbWB2dqzZh+vPGxOl1xoW3iztYyxqNWj4KadG0URm7z9tyHoPZi+PnBJRExjk7WEEHiTrtMof9T7q7NctJYwcBaYGgJwVf/R5Sft3bkh8KydrXVV93aHzs7WklBMY2b+kob65uE0NhcEQhhaa1mWo+7VmqqzgElaRlDbKWtD0wykAg6GikJkretO2saKelt1cRyjtQAD5qw1zUBCdr2L1jIWAdzaWEVvq44+pI0AErLQs/rdyiAjm9ONiF5rATGlpaPWwUM1ZHSxFokIY9FNn12fivw4toQwkbWobemPynhbD1lW0hKtfYTtVa3PUk+q3pp7LYDW0jLL2lGJ+yP14DhZltFFW5DW6swApgbrpn1kbVmCtJnj+KP0GyFwFsCspZRLq1j70Z2qsxC0loK0qK0vd95Wne/7IC1Q8qgd9DgB1Il0dKx4CVsH8P1E3n3C7t76AM/aErKW3s1FAxVZNweUllvrIwc5V5r7MUiSWVoMW5C2NdVAXao7DmNL1vpJkgy1dH/V9W9wNmmTxdqy7OR7CMMnV2EiaxMgkGzoXjdDEKC2S0HwR3OeoD6beuBZ26K0QXC4y/Pa/7Jrx7gJw1AYx2su0iuYgYFI7sAJstiS2ZKpk8UeWfKWKyQLLJ5Qxyp34TZ9D15YOkBpm9ji/U/A8CP+HFj0styMapHtZ54bh/t5y2E9LoQNVppMXoN1uixLQns8rl9PeZ0T3O96O5T4rL2wBQkuZnCbWQ7OXdUe1zwNni8YCsh2VOuK1I/a2jtHapHtZp/J+cD9bf0HoiW1rpAp38TfYlEUgJaetWUOZwP3P3UnetYCW1ChU52JogoS1UKIlq9gT95yILSugKRKciq2VhLaEpIVm3366j2pxaSMyf07YRUlND5qTynvGG6aaDOSWgnptFiIKoQLWmQ7pLphuOkTB0lqoZDSTGiVBrXE1iT0wbgEEn0gtSEEncoNfRV1uKKN/KqL+/4C1xYSA7XapjATRGU1hGxT3NtcGnUK0UJgZf7TuDWEls1yt9wiWsja7awzYRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function kL(e){Ue(e,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function OL(e){let n,t,i,r,s;return{c(){n=H("div"),t=H("div"),i=ye(),r=H("span"),s=Mt(e[0]),_(t,"class","floorplan-plugin__compass-image svelte-rpkaro"),W(t,"background-image",`url(${LL})`),_(r,"class","floorplan-plugin__compass-text svelte-rpkaro"),_(n,"class","floorplan-plugin__compass svelte-rpkaro"),W(n,"transform",e[2])},m(o,a){X(o,n,a),Q(n,t),Q(n,i),Q(n,r),Q(r,s)},p(o,a){a&1&&Pt(s,o[0])},d(o){o&&Y(n)}}}function RL(e){let n,t=e[1]&&OL(e);return{c(){t&&t.c(),n=pt()},m(i,r){t&&t.m(i,r),X(i,n,r)},p(i,[r]){i[1]&&t.p(i,r)},i:de,o:de,d(i){t&&t.d(i),i&&Y(n)}}}function zL(e,n,t){var c;let{floorplanData:i}=n,{northDesc:r}=n;const s=(c=i.entrance)==null?void 0:c.northRad,o=typeof s=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(s?Pm(s):0)+90}deg)`;return e.$$set=h=>{"floorplanData"in h&&t(3,i=h.floorplanData),"northDesc"in h&&t(0,r=h.northDesc)},[r,o,l,i]}class BL extends Oe{constructor(n){super(),ke(this,n,zL,RL,Le,{floorplanData:3,northDesc:0},kL)}}function NL(e){Ue(e,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function FL(e){let n,t,i,r,s,o,a,l,c,h;const u=[{floorIndex:e[2],floorplanData:e[11]}];let d={};for(let w=0;w<u.length;w+=1)d=Ln(d,u[w]);n=new gL({props:d});let f=(e[3]||e[5])&&PA(e);const m=[{floorplanData:e[11],floorIndex:e[2]}];let p={};for(let w=0;w<m.length;w+=1)p=Ln(p,m[w]);r=new iA({props:p});let g=e[6]&&EA(e),y=e[10]&&_A(e),b=e[4]&&SA(e),A=e[22]&&IA(e);return{c(){Te(n.$$.fragment),t=ye(),f&&f.c(),i=ye(),Te(r.$$.fragment),s=ye(),g&&g.c(),o=ye(),y&&y.c(),a=ye(),b&&b.c(),l=ye(),A&&A.c(),c=pt()},m(w,x){Se(n,w,x),X(w,t,x),f&&f.m(w,x),X(w,i,x),Se(r,w,x),X(w,s,x),g&&g.m(w,x),X(w,o,x),y&&y.m(w,x),X(w,a,x),b&&b.m(w,x),X(w,l,x),A&&A.m(w,x),X(w,c,x),h=!0},p(w,x){const M=x&2052?Vn(u,[{floorIndex:w[2],floorplanData:w[11]}]):{};n.$set(M),w[3]||w[5]?f?(f.p(w,x),x&40&&N(f,1)):(f=PA(w),f.c(),N(f,1),f.m(i.parentNode,i)):f&&(Fe(),Z(f,1,1,()=>{f=null}),Ve());const E=x&2052?Vn(m,[{floorplanData:w[11],floorIndex:w[2]}]):{};r.$set(E),w[6]?g?(g.p(w,x),x&64&&N(g,1)):(g=EA(w),g.c(),N(g,1),g.m(o.parentNode,o)):g&&(Fe(),Z(g,1,1,()=>{g=null}),Ve()),w[10]?y?(y.p(w,x),x&1024&&N(y,1)):(y=_A(w),y.c(),N(y,1),y.m(a.parentNode,a)):y&&(Fe(),Z(y,1,1,()=>{y=null}),Ve()),w[4]?b?(b.p(w,x),x&16&&N(b,1)):(b=SA(w),b.c(),N(b,1),b.m(l.parentNode,l)):b&&(Fe(),Z(b,1,1,()=>{b=null}),Ve()),w[22]?A?(A.p(w,x),x&4194304&&N(A,1)):(A=IA(w),A.c(),N(A,1),A.m(c.parentNode,c)):A&&(Fe(),Z(A,1,1,()=>{A=null}),Ve())},i(w){h||(N(n.$$.fragment,w),N(f),N(r.$$.fragment,w),N(g),N(y),N(b),N(A),h=!0)},o(w){Z(n.$$.fragment,w),Z(f),Z(r.$$.fragment,w),Z(g),Z(y),Z(b),Z(A),h=!1},d(w){Ie(n,w),w&&Y(t),f&&f.d(w),w&&Y(i),Ie(r,w),w&&Y(s),g&&g.d(w),w&&Y(o),y&&y.d(w),w&&Y(a),b&&b.d(w),w&&Y(l),A&&A.d(w),w&&Y(c)}}}function VL(e){let n,t;return n=new _L({props:{missingFloorConfig:e[18]}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&262144&&(s.missingFloorConfig=i[18]),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function PA(e){let n,t;const i=[{floorIndex:e[2],floorplanData:e[11],hoveredRoom:e[24],highlightData:e[17]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new MA({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&16910340?Vn(i,[{floorIndex:s[2],floorplanData:s[11],hoveredRoom:s[24],highlightData:s[17]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function EA(e){let n,t;const i=[{floorplanData:e[11],roomAreaEnable:e[7],roomNameEnable:e[8],roomDimensionEnable:e[9],floorIndex:e[2],getRoomAreaText:e[12],getRoomDimensionText:e[13],getLabelElement:e[14],hoveredRoom:e[24],adaptiveRoomLabelVisibleEnable:e[16]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new HD({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&16874372?Vn(i,[{floorplanData:s[11],roomAreaEnable:s[7],roomNameEnable:s[8],roomDimensionEnable:s[9],floorIndex:s[2],getRoomAreaText:s[12],getRoomDimensionText:s[13],getLabelElement:s[14],hoveredRoom:s[24],adaptiveRoomLabelVisibleEnable:s[16]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function _A(e){let n,t;const i=[{floorplanData:e[11],floorIndex:e[2],getRuleDistanceText:e[15]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new JD({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&34820?Vn(i,[{floorplanData:s[11],floorIndex:s[2],getRuleDistanceText:s[15]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function SA(e){let n,t;const i=[{panoIndex:e[0],floorplanData:e[11],lastPanoramaLongitude:e[19],cameraImageUrl:e[20]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new DL({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&1574913?Vn(i,[{panoIndex:s[0],floorplanData:s[11],lastPanoramaLongitude:s[19],cameraImageUrl:s[20]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function IA(e){let n,t;return n=new BL({props:{floorplanData:e[11],northDesc:e[21]}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&2048&&(s.floorplanData=i[11]),r&2097152&&(s.northDesc=i[21]),n.$set(s)},i(i){t||(N(n.$$.fragment,i),t=!0)},o(i){Z(n.$$.fragment,i),t=!1},d(i){Ie(n,i)}}}function GL(e){let n,t,i,r,s;const o=[VL,FL],a=[];function l(c,h){return c[23]?1:0}return t=l(e),i=a[t]=o[t](e),{c(){n=H("div"),i.c(),_(n,"class",r=an(`floorplan-plugin__floor${e[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(c,h){X(c,n,h),a[t].m(n,null),s=!0},p(c,[h]){let u=t;t=l(c),t===u?a[t].p(c,h):(Fe(),Z(a[u],1,1,()=>{a[u]=null}),Ve(),i=a[t],i?i.p(c,h):(i=a[t]=o[t](c),i.c()),N(i,1),i.m(n,null)),(!s||h&2&&r!==(r=an(`floorplan-plugin__floor${c[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&_(n,"class",r)},i(c){s||(N(i),s=!0)},o(c){Z(i),s=!1},d(c){c&&Y(n),a[t].d()}}}function jL(e,n,t){let i,r,{panoIndex:s}=n,{isCurrent:o}=n,{floorIndex:a}=n,{highlightEnable:l}=n,{cameraEnable:c}=n,{hoverEnable:h}=n,{roomLabelsEnable:u}=n,{roomAreaEnable:d}=n,{roomNameEnable:f}=n,{roomDimensionEnable:m}=n,{ruleLabelsEnable:p}=n,{floorplanData:g}=n,{getRoomAreaText:y}=n,{getRoomDimensionText:b}=n,{getLabelElement:A}=n,{getRuleDistanceText:w}=n,{adaptiveRoomLabelVisibleEnable:x}=n,{highlightData:M}=n,{missingFloorConfig:E}=n,{lastPanoramaLongitude:S}=n,{cameraImageUrl:T}=n,{northDesc:z}=n,{compassEnable:D}=n;const k=Mm(void 0);return e.$$set=R=>{"panoIndex"in R&&t(0,s=R.panoIndex),"isCurrent"in R&&t(1,o=R.isCurrent),"floorIndex"in R&&t(2,a=R.floorIndex),"highlightEnable"in R&&t(3,l=R.highlightEnable),"cameraEnable"in R&&t(4,c=R.cameraEnable),"hoverEnable"in R&&t(5,h=R.hoverEnable),"roomLabelsEnable"in R&&t(6,u=R.roomLabelsEnable),"roomAreaEnable"in R&&t(7,d=R.roomAreaEnable),"roomNameEnable"in R&&t(8,f=R.roomNameEnable),"roomDimensionEnable"in R&&t(9,m=R.roomDimensionEnable),"ruleLabelsEnable"in R&&t(10,p=R.ruleLabelsEnable),"floorplanData"in R&&t(11,g=R.floorplanData),"getRoomAreaText"in R&&t(12,y=R.getRoomAreaText),"getRoomDimensionText"in R&&t(13,b=R.getRoomDimensionText),"getLabelElement"in R&&t(14,A=R.getLabelElement),"getRuleDistanceText"in R&&t(15,w=R.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in R&&t(16,x=R.adaptiveRoomLabelVisibleEnable),"highlightData"in R&&t(17,M=R.highlightData),"missingFloorConfig"in R&&t(18,E=R.missingFloorConfig),"lastPanoramaLongitude"in R&&t(19,S=R.lastPanoramaLongitude),"cameraImageUrl"in R&&t(20,T=R.cameraImageUrl),"northDesc"in R&&t(21,z=R.northDesc),"compassEnable"in R&&t(22,D=R.compassEnable)},e.$$.update=()=>{e.$$.dirty&2052&&t(25,i=g.floorDatas[a]),e.$$.dirty&33554432&&t(23,r=i.rooms.length>0)},[s,o,a,l,c,h,u,d,f,m,p,g,y,b,A,w,x,M,E,S,T,z,D,r,k,i]}let HL=class extends Oe{constructor(n){super(),ke(this,n,jL,GL,Le,{panoIndex:0,isCurrent:1,floorIndex:2,highlightEnable:3,cameraEnable:4,hoverEnable:5,roomLabelsEnable:6,roomAreaEnable:7,roomNameEnable:8,roomDimensionEnable:9,ruleLabelsEnable:10,floorplanData:11,getRoomAreaText:12,getRoomDimensionText:13,getLabelElement:14,getRuleDistanceText:15,adaptiveRoomLabelVisibleEnable:16,highlightData:17,missingFloorConfig:18,lastPanoramaLongitude:19,cameraImageUrl:20,northDesc:21,compassEnable:22},NL)}};function UL(e){Ue(e,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function TA(e,n,t){const i=e.slice();return i[24]=n[t],i}function DA(e){let n,t,i,r=e[14].floorDatas,s=[];for(let a=0;a<r.length;a+=1)s[a]=LA(TA(e,r,a));const o=a=>Z(s[a],1,1,()=>{s[a]=null});return{c(){n=H("div");for(let a=0;a<s.length;a+=1)s[a].c();_(n,"class","floorplan-main svelte-86bqav")},m(a,l){X(a,n,l);for(let c=0;c<s.length;c+=1)s[c]&&s[c].m(n,null);i=!0},p(a,l){if(e=a,l&16777212){r=e[14].floorDatas;let c;for(c=0;c<r.length;c+=1){const h=TA(e,r,c);s[c]?(s[c].p(h,l),N(s[c],1)):(s[c]=LA(h),s[c].c(),N(s[c],1),s[c].m(n,null))}for(Fe(),c=r.length;c<s.length;c+=1)o(c);Ve()}},i(a){if(!i){for(let l=0;l<r.length;l+=1)N(s[l]);t||ln(()=>{t=gs(n,In,{duration:e[0],easing:Lr}),t.start()}),i=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)Z(s[l]);i=!1},d(a){a&&Y(n),Bi(s,a)}}}function LA(e){let n,t;const i=[{hoverEnable:e[6],highlightEnable:e[7],floorplanData:e[14],getRoomAreaText:e[17],getRoomDimensionText:e[18],getLabelElement:e[19],getRuleDistanceText:e[20],roomLabelsEnable:e[9],roomAreaEnable:e[10],roomNameEnable:e[11],roomDimensionEnable:e[12],ruleLabelsEnable:e[13],adaptiveRoomLabelVisibleEnable:e[21],highlightData:e[22],missingFloorConfig:e[23],panoIndex:e[3],cameraEnable:e[5],cameraImageUrl:e[16],lastPanoramaLongitude:e[15],compassEnable:e[8],northDesc:e[2]},{floorIndex:e[24].floorIndex},{isCurrent:e[24].floorIndex===e[4]}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new HL({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&16777212?Vn(i,[o&16777196&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[14],getRoomAreaText:s[17],getRoomDimensionText:s[18],getLabelElement:s[19],getRuleDistanceText:s[20],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],roomDimensionEnable:s[12],ruleLabelsEnable:s[13],adaptiveRoomLabelVisibleEnable:s[21],highlightData:s[22],missingFloorConfig:s[23],panoIndex:s[3],cameraEnable:s[5],cameraImageUrl:s[16],lastPanoramaLongitude:s[15],compassEnable:s[8],northDesc:s[2]},o&16384&&{floorIndex:s[24].floorIndex},o&16400&&{isCurrent:s[24].floorIndex===s[4]}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function WL(e){let n,t,i=e[1]&&DA(e);return{c(){i&&i.c(),n=pt()},m(r,s){i&&i.m(r,s),X(r,n,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&N(i,1)):(i=DA(r),i.c(),N(i,1),i.m(n.parentNode,n)):i&&(Fe(),Z(i,1,1,()=>{i=null}),Ve())},i(r){t||(N(i),t=!0)},o(r){Z(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function QL(e,n,t){let{duration:i=0}=n,{visible:r}=n,{northDesc:s}=n,{panoIndex:o}=n,{floorIndex:a}=n,{cameraEnable:l}=n,{hoverEnable:c}=n,{highlightEnable:h}=n,{compassEnable:u}=n,{roomLabelsEnable:d}=n,{roomAreaEnable:f}=n,{roomNameEnable:m}=n,{roomDimensionEnable:p}=n,{ruleLabelsEnable:g}=n,{floorplanData:y}=n,{lastPanoramaLongitude:b}=n,{cameraImageUrl:A}=n,{getRoomAreaText:w}=n,{getRoomDimensionText:x}=n,{getLabelElement:M}=n,{getRuleDistanceText:E}=n,{adaptiveRoomLabelVisibleEnable:S}=n,{highlightData:T}=n,{missingFloorConfig:z}=n;return e.$$set=D=>{"duration"in D&&t(0,i=D.duration),"visible"in D&&t(1,r=D.visible),"northDesc"in D&&t(2,s=D.northDesc),"panoIndex"in D&&t(3,o=D.panoIndex),"floorIndex"in D&&t(4,a=D.floorIndex),"cameraEnable"in D&&t(5,l=D.cameraEnable),"hoverEnable"in D&&t(6,c=D.hoverEnable),"highlightEnable"in D&&t(7,h=D.highlightEnable),"compassEnable"in D&&t(8,u=D.compassEnable),"roomLabelsEnable"in D&&t(9,d=D.roomLabelsEnable),"roomAreaEnable"in D&&t(10,f=D.roomAreaEnable),"roomNameEnable"in D&&t(11,m=D.roomNameEnable),"roomDimensionEnable"in D&&t(12,p=D.roomDimensionEnable),"ruleLabelsEnable"in D&&t(13,g=D.ruleLabelsEnable),"floorplanData"in D&&t(14,y=D.floorplanData),"lastPanoramaLongitude"in D&&t(15,b=D.lastPanoramaLongitude),"cameraImageUrl"in D&&t(16,A=D.cameraImageUrl),"getRoomAreaText"in D&&t(17,w=D.getRoomAreaText),"getRoomDimensionText"in D&&t(18,x=D.getRoomDimensionText),"getLabelElement"in D&&t(19,M=D.getLabelElement),"getRuleDistanceText"in D&&t(20,E=D.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in D&&t(21,S=D.adaptiveRoomLabelVisibleEnable),"highlightData"in D&&t(22,T=D.highlightData),"missingFloorConfig"in D&&t(23,z=D.missingFloorConfig)},[i,r,s,o,a,l,c,h,u,d,f,m,p,g,y,b,A,w,x,M,E,S,T,z]}let Em=class extends Oe{constructor(n){super(),ke(this,n,QL,WL,Le,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,roomDimensionEnable:12,ruleLabelsEnable:13,floorplanData:14,lastPanoramaLongitude:15,cameraImageUrl:16,getRoomAreaText:17,getRoomDimensionText:18,getLabelElement:19,getRuleDistanceText:20,adaptiveRoomLabelVisibleEnable:21,highlightData:22,missingFloorConfig:23},UL)}};const YL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function XL(e){return te(this,null,function*(){const n=new Headers({"Content-Type":"text/plain"}),t=function(r){return te(this,null,function*(){const s={index:r.index,url:r.url,svgUrl:r.svg_url};if(r.svg_url){const o=yield fetch(r.svg_url,{headers:n}).then(a=>a.text());s.svgContent=o}return s})};return yield Promise.all(e.map(t))})}function ZL(e){const n={id:e.id,size:e.size,name:e.name,path:e.path,roomType:e.room_type,floorType:e.floor_type,roomLabel:{position:e.room_label.position,positionInImage:e.room_label.position_in_image},observerIndexs:e.observer_indexs};return e.dimension&&Object.assign(n,{dimension:e.dimension}),n}function qL(e){return{floorName:e.floor_name,floorIndex:e.floor_index,rooms:e.rooms.map(ZL),rules:e.rules}}function JL(e){return{index:e.index,floorIndex:e.floor_index,position:e.position,positionInImage:e.position_in_image}}function KL(e){return{rad:e.rad,position:e.position,positionInImage:e.position_in_image,northRad:e.north_rad,roomId:e.room_id,floorIndex:e.floor_index}}function ws(e){return te(this,null,function*(){const n=yield XL(e.outlines),t=e.computed_data.bounding,i=e.computed_data.floor_datas.map(qL),r=e.computed_data.entrance?KL(e.computed_data.entrance):null;return{outlines:n,entrance:r,bounding:t,floorDatas:i,observers:e.computed_data.observers.map(JL)}})}function $L(e,n,t){return e.map(r=>{const s=r.position,o=r.icon?r.icon:{url:YL,width:45,height:48},a=eL(s,n),l=KD(s,t),c=$D(l,t);return{floorIndex:a,icon:o,id:r.id,position:l,positionInImage:c}})}function ek(e,n){return n(e),e}function Ga(e,n){return ek({},t=>{for(const i in e)n.indexOf(i)===-1&&(t[i]=e[i])})}function kA(e,n){const t=Math.max(...e.work.observers.map(i=>i.floorIndex));return n>t?e.model.bounding.max.y:Math.max(...e.work.observers.filter(i=>i.floorIndex===n).map(i=>i.standingPosition.y))}function _m(e,n,t=bs.BOUNDING_CENTER){const i=kA(e,n),r=kA(e,n+1);return t===bs.BOUNDING_CENTER?(e.model.bounding.max.y+e.model.bounding.min.y)/2:t===bs.CEILING?r:i}function Sm(e,n,t,i){const r=_m(e,t,i==null?void 0:i.attachedTo),s=new C.Vector3(0,r,0),o=new C.Vector3(1,r,0),a=s.clone().project(e.camera),l=o.clone().project(e.camera);return Math.abs((l.x-a.x)/1e3)*(n.getBoundingClientRect().width/2)}let xs=class{constructor(n,t){v(this,"VERSION","3.50.17-alpha.0");v(this,"NAME");v(this,"five");v(this,"workUtil");v(this,"fiveUtil");v(this,"hooks",new Pn);v(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");this.updateFive(n),t!=null&&t.staticPrefix&&(this.staticPrefix=t.staticPrefix)}set workCode(n){this.workUtil.workCode=n,this.onWorkCodeChange()}get workCode(){return this.workUtil.workCode}updateFive(n){this.five=n,this.fiveUtil=new oh(n),this.workUtil=this.fiveUtil.workUtil}getCurrentState(){return this.state}absoluteUrl(n){return nm(this.staticPrefix,n)}onWorkCodeChange(){}},Or=class extends xs{};var ti=(e=>(e.UnknownError="UnknownError",e.DataNotLoaded="DataNotLoaded",e.UpdateSizeError="UpdateSizeError",e.BreakOffByHide="BreakOffByHide",e.BreakOffByDisable="BreakOffByDisable",e.ModelNotLoaded="ModelNotLoaded",e.ChangeModeError="ChangeModeError",e.UpdateCameraError="UpdateCameraError",e))(ti||{});const OA=500,tk=80;function Js(e,n,t=4){return Math.abs(e-n)<Math.pow(10,-t)}function RA(e,n,t=4){const i=Math.PI*2,r=e%i,s=n%i,o=Math.min(r,s),a=Math.max(r,s);return Js(o,a,t)||Js(o+i,a,t)}Object.assign(window,{nearlyEqual:Js,nearlyEqualRad:RA});function nk(e){return Object.prototype.toString.call(e)==="[object Object]"}function zA(e){return nk(e)&&!!e.isVector3}function Im(e,n){return te(this,null,function*(){const[t]=yield qs(e.changeMode(...n));if(t)throw new Error("change mode canceled");yield new Promise(o=>{e.once("initAnimationWillStart",()=>{e.once("initAnimationEnded",()=>o())})});const i=n[1];if(!i)return!0;const r=e.getCurrentState();if(!ik(i,r))throw new Error("pose 与预期不符")})}function ik(e,n){return Object.keys(e).every(t=>{const i=n[t],r=e[t];return i===void 0||r===void 0?!0:t==="longitude"||t==="latitude"?RA(i,r,2):typeof i=="number"&&typeof r=="number"?Js(i,r,2):zA(r)&&zA(i)?r.distanceTo(i)<.01:i===r})}function rk(e,n){if(e.currentMode!==n.mode)return!1;const{latitude:t,longitude:i,fov:r,offset:s}=n,{latitude:o,longitude:a,offset:l}=e.getCurrentState(),c=e.camera.fov;return!(!Js(t,o,2)||!Js(i,a,2)||s!==void 0&&s.distanceTo(l)>.01||!Js(r,c,2))}function BA(e,n,t=!0){return te(this,null,function*(){if(rk(e,n)===!0)return;const r=e.getCurrentState();if(r.mode!==n.mode){const[h]=yield qs(Im(e,[n.mode,n,void 0,t]));if(h)throw h;return}const{latitude:s,longitude:o,fov:a}=r,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(o>Math.PI?2*Math.PI-o:o)*500,typeof n.fov=="number"?Math.abs(a-n.fov)*10:1/0)),[c]=yield qs(e.updateCamera(Ga(n,["mode"]),l,t));if(c)throw new Error(ti.UpdateCameraError)})}function ja(e,n,t=300){var r,s;const i=e.getElement();if(i){i.style.opacity=n+"";for(let o=0;o<((s=(r=i.parentElement)==null?void 0:r.children)==null?void 0:s.length);o++){const a=i.parentElement.children[o];a instanceof HTMLElement&&a.dataset.infive==="1"&&(a.style.opacity=n+"")}i.style.transition=t===0?"none":`opacity ${t}ms linear`,t!==0&&Promise.race([new Promise(o=>i.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,t))]).then(()=>{i.style.transition="none"})}}function sk(e){const{latitude:n,longitude:t}=e,i=Math.abs(n-Math.PI/2)>5*Math.PI/180,r=t>5*(Math.PI/180)&&t<355*(Math.PI/180);return i||r}function ok(e){const{latitude:n,longitude:t}=e,i=Math.abs(n-Math.PI/2)<10*Math.PI/180,r=t<30*(Math.PI/180)||t>330*(Math.PI/180);return i&&r}let ak=class extends Or{constructor(t,i){var l,c,h;super(t);v(this,"name","modelFloorplanPlugin");v(this,"state");v(this,"data");v(this,"showState");v(this,"showPromise");v(this,"app");v(this,"panoIndex",0);v(this,"floorIndex",0);v(this,"selector");v(this,"showRejection");v(this,"wrapper");v(this,"container",document.createElement("div"));v(this,"lastPanoramaLongitude",0);v(this,"size",{width:0,height:0});v(this,"defaultMissingFloorConfig");v(this,"hasAddedEventListener",!1);v(this,"isHiddenByHideFunc",!1);v(this,"highlightData",{});v(this,"dispose",()=>{var t,i;this.removeEventListener(),(t=this.app)==null||t.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});v(this,"show",(...i)=>te(this,[...i],function*(t={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const r=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!0},r),this._show(t)}));v(this,"hide",(...i)=>te(this,[...i],function*(t={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},t.userAction||!0),this._hide(t)))}));v(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper)return!1;const{min:t,max:i}=this.data.bounding,r=i.x-t.x,s=i.y-t.y,o=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Sm(this.five,this.wrapper,this.floorIndex,o),l=Math.ceil(r*a),c=Math.ceil(s*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});v(this,"highlight",t=>{this.state.config.highlightEnable&&(this.highlightData=t,this.render())});v(this,"unhighlight",()=>{this.highlightData={},this.render()});v(this,"_disable",t=>{var r,s,o;const{userAction:i}=t;this.hooks.emit("disable",{userAction:i}),(r=this.showRejection)==null||r.call(this,ti.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener()});v(this,"_enable",t=>{const{userAction:i}=t;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});v(this,"_show",t=>te(this,null,function*(){var o;if(!this.state.enabled)return;if(!((o=this.five.model)!=null&&o.loaded))throw new Error(ti.ModelNotLoaded);if(!this.data)throw new Error(ti.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},r=O(O({},i),t),s=()=>te(this,null,function*(){this.hooks.emit("show",{userAction:r.userAction,auto:r.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield qs(BA(this.five,this.showState,r.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(ti.UnknownError);if(!this.updateSize())throw new Error(ti.UpdateSizeError);this.floorIndex=r.floorIndex,this.five.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=s().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=r.modelOpacity,l=r.immediately?0:OA;ja(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:r.isAutoShow,userAction:r.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},r.userAction),!r.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));v(this,"_hide",t=>{var s;(s=this.showRejection)==null||s.call(this,ti.BreakOffByHide),this.showPromise=void 0;const r=O(O({},{userAction:!0,isAutoHide:!1}),t);ja(this.five,1,0),this.hooks.emit("hide",{auto:r.isAutoHide,userAction:r.userAction}),this.render()});v(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});v(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const t=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!t)throw new Error("不正确的父容器选择器");this.wrapper=t,t.append(this.container)});v(this,"onFiveModeChange",t=>{t!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});v(this,"onFiveInteriaPan",(t,i)=>{if(!i||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const r=this.five.getCurrentState();r.mode==="Floorplan"&&(this.state.visible||ok(r)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});v(this,"onFivePanoArrived",t=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=t,this.floorIndex=this.workUtil.observers[t].floorIndex)});v(this,"onFiveCameraUpdate",(t,i)=>{if(!this.state.visible||this.showPromise)return;const r=this.five.getCurrentState();sk(r)&&(this.updateState({visible:!1},i),this._hide({userAction:i,isAutoHide:!0}))});v(this,"onFiveWantsGesture",(t,i)=>{if(this.state.visible&&(i.length>1||t==="mouseWheel"))return!1});v(this,"onFiveWantsPanGesture",(t,i)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});v(this,"onFiveWantsTapGesture",()=>this.handleClick());v(this,"onFiveWantsChangeMode",(t,i)=>{i==="Panorama"&&t==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});v(this,"onModelShownFloorChange",t=>{if(this.floorIndex!==t){if(t===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=t,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:tk/((l=i==null?void 0:i.scale)!=null?l:1)},this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(h=(c=i.i18n)==null?void 0:c.call(i,"暂无平面图"))!=null?h:"暂无平面图",textFontSize:14};const r={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:As,attachedTo:bs.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:O(O({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:u=>u,getRoomAreaText:u=>(u/1e6).toFixed(1)+"㎡",getRoomDimensionText:(u,d)=>(u/1e3).toFixed(1)+"m × "+(d/1e3).toFixed(1)+"m",getRuleDistanceText:u=>u.toString()},s=i?Ga(i,["selector","scale"]):{},o=O(O({},r.missingFloorConfig),s.missingFloorConfig),a=Pe(O(O({},r),s),{missingFloorConfig:o});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),t.once("dispose",this.dispose),this.addEventListener()}load(t,i,r=!0){return te(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&Dr(o.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(t)),l=s(a)?a.data:a,c=this.data;this.data=yield ws(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,r),this.render()})}appendTo(t){if(this.wrapper=t,!!this.state.enabled)return t.appendChild(this.container),this.render(),this}enable(t={}){if(this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!0},t.userAction||i),this._enable({userAction:i})}disable(t={}){if(!this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!1},t.userAction||i),this._disable({userAction:i})}setState(t,i={}){const r=this.state,s=i.userAction!==void 0?i.userAction:!0;if(this.updateState(t,s),t.enabled!==void 0&&r.enabled!==t.enabled&&(t.enabled?this._enable({userAction:s}):this._disable({userAction:s})),t.visible!==void 0&&r.visible!==t.visible){const o={userAction:s};t.visible?this._show(o):this._hide(o)}this.render()}changeConfigs(t,i=!0){this.updateState({config:t},i),this.render()}formatData(t){return te(this,null,function*(){return yield ws(t.data)})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?O(O({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Pe(O(O({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Pe(O(O({},this.state),t),{config:o}),!Fn(this.state,r,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const t=this.five;t.model.loaded?this.onFiveModelLoaded():t.once("modelLoaded",this.onFiveModelLoaded),t.on("modeChange",this.onFiveModeChange),t.on("interiaPan",this.onFiveInteriaPan),t.on("panoArrived",this.onFivePanoArrived),t.on("cameraUpdate",this.onFiveCameraUpdate),t.on("wantsGesture",this.onFiveWantsGesture),t.on("wantsPanGesture",this.onFiveWantsPanGesture),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsChangeMode",this.onFiveWantsChangeMode),t.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const t=this.five;this.hasAddedEventListener=!1,t.off("modelLoaded",this.onFiveModelLoaded),t.off("modeChange",this.onFiveModeChange),t.off("interiaPan",this.onFiveInteriaPan),t.off("panoArrived",this.onFivePanoArrived),t.off("cameraUpdate",this.onFiveCameraUpdate),t.off("wantsGesture",this.onFiveWantsGesture),t.off("wantsPanGesture",this.onFiveWantsPanGesture),t.off("wantsTapGesture",this.onFiveWantsTapGesture),t.off("wantsChangeMode",this.onFiveWantsChangeMode),t.off("modelShownFloorChange",this.onModelShownFloorChange)}render(t){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=Pe(O({},this.state.config),{visible:this.state.visible,duration:t!=null?t:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(i);this.app=new Em({target:this.container,intro:!0,props:i})}};const lk=(e,n)=>new ak(e,n);function ck(e){const{latitude:n,longitude:t}=e,i=Math.abs(n-Math.PI/2)>5*Math.PI/180,r=t>5*(Math.PI/180)&&t<355*(Math.PI/180);return i||r}function hk(e){const{latitude:n,longitude:t}=e,i=Math.abs(n-Math.PI/2)<10*Math.PI/180,r=t<30*(Math.PI/180)||t>330*(Math.PI/180);return i&&r}let uk=class extends Or{constructor(t,i){var l,c;super(t);v(this,"name","modelFloorplanPlugin");v(this,"state");v(this,"data");v(this,"showState");v(this,"showPromise");v(this,"app");v(this,"panoIndex",0);v(this,"floorIndex",0);v(this,"selector");v(this,"showRejection");v(this,"wrapper");v(this,"container",document.createElement("div"));v(this,"lastPanoramaLongitude",0);v(this,"size",{width:0,height:0});v(this,"defaultMissingFloorConfig");v(this,"hasAddedEventListener",!1);v(this,"isHiddenByHideFunc",!1);v(this,"highlightData",{});v(this,"dispose",()=>{var t,i;this.removeEventListener(),(t=this.app)==null||t.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});v(this,"show",(...i)=>te(this,[...i],function*(t={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const r=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!0},r),this._show(t)}));v(this,"hide",(...i)=>te(this,[...i],function*(t={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},t.userAction||!0),this._hide(t)))}));v(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper)return!1;const{min:t,max:i}=this.data.bounding,r=i.x-t.x,s=i.y-t.y,o=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Sm(this.five,this.wrapper,this.floorIndex,o),l=Math.ceil(r*a),c=Math.ceil(s*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});v(this,"highlight",t=>{this.state.config.highlightEnable&&(this.highlightData=t,this.render())});v(this,"unhighlight",()=>{this.highlightData={},this.render()});v(this,"_disable",t=>{var r,s,o;const{userAction:i}=t;this.hooks.emit("disable",{userAction:i}),(r=this.showRejection)==null||r.call(this,ti.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener()});v(this,"_enable",t=>{const{userAction:i}=t;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});v(this,"_show",t=>te(this,null,function*(){var o;if(!this.state.enabled)return;if(!((o=this.fiveUtil.model)!=null&&o.loaded))throw new Error(ti.ModelNotLoaded);if(!this.data)throw new Error(ti.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},r=O(O({},i),t),s=()=>te(this,null,function*(){this.hooks.emit("show",{userAction:r.userAction,auto:r.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=yield qs(BA(this.five,this.showState,r.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(ti.UnknownError);if(!this.updateSize())throw new Error(ti.UpdateSizeError);this.updatePosition(),this.floorIndex=r.floorIndex,this.fiveUtil.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=s().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=r.modelOpacity,l=r.immediately?0:OA;ja(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:r.isAutoShow,userAction:r.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},r.userAction),!r.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));v(this,"_hide",t=>{var s;(s=this.showRejection)==null||s.call(this,ti.BreakOffByHide),this.showPromise=void 0;const r=O(O({},{userAction:!0,isAutoHide:!1}),t);ja(this.five,1,0),this.hooks.emit("hide",{auto:r.isAutoHide,userAction:r.userAction}),this.render()});v(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});v(this,"onFiveModelLoaded",()=>{const i=this.five.model.bounding.getCenter(new C.Vector3);if(this.showState.offset=i,this.state.enabled===!1||this.wrapper||!this.selector)return;const r=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!r)throw new Error("不正确的父容器选择器");this.wrapper=r,r.append(this.container)});v(this,"onFiveModeChange",t=>{t!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});v(this,"onFiveInteriaPan",(t,i)=>{if(!i||this.state.visible||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const r=this.five.getCurrentState();r.mode===this.showState.mode&&hk(r)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))});v(this,"onFivePanoArrived",t=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=t,this.floorIndex=this.workUtil.observers[t].floorIndex)});v(this,"onFiveCameraUpdate",(t,i)=>{if(!this.state.visible||this.showPromise)return;const r=this.five.getCurrentState();this.updatePosition(),this.updateSize(),ck(r)&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});v(this,"onFiveWantsPanGesture",(t,i)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(Ga(this.showState,["offset"]),0),!1});v(this,"onFiveWantsTapGesture",()=>this.handleClick());v(this,"onFiveWantsChangeMode",(t,i)=>{i==="Panorama"&&t===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});v(this,"onModelShownFloorChange",t=>{var i;if(this.floorIndex!==t){if(t===null){const r=this.five.getCurrentState().panoIndex;this.floorIndex=(i=this.five.work)==null?void 0:i.observers[r].floorIndex;return}this.floorIndex=t,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2},this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(c=(l=i.i18n)==null?void 0:l.call(i,"暂无平面图"))!=null?c:"暂无平面图",textFontSize:14};const r={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,cameraImageUrl:As,attachedTo:bs.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:O(O({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:h=>h,getRoomAreaText:h=>(h/1e6).toFixed(1)+"㎡",getRoomDimensionText:(h,u)=>(h/1e3).toFixed(1)+"m × "+(u/1e3).toFixed(1)+"m",getRuleDistanceText:h=>h.toString()},s=i?Ga(i,["selector","scale"]):{},o=O(O({},r.missingFloorConfig),s.missingFloorConfig),a=Pe(O(O({},r),s),{missingFloorConfig:o});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),Xs(t).then(this.onFiveModelLoaded),t.once("dispose",this.dispose),this.addEventListener()}load(t,i,r=!0){return te(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&Dr(o.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(t)),l=s(a)?a.data:a,c=this.data;this.data=yield ws(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,r),this.render()})}appendTo(t){if(this.wrapper=t,!!this.state.enabled)return t.appendChild(this.container),this.render(),this}enable(t={}){if(this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!0},t.userAction||i),this._enable({userAction:i})}disable(t={}){if(!this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!1},t.userAction||i),this._disable({userAction:i})}setState(t,i={}){const r=this.state,s=i.userAction!==void 0?i.userAction:!0;if(this.updateState(t,s),t.enabled!==void 0&&r.enabled!==t.enabled&&(t.enabled?this._enable({userAction:s}):this._disable({userAction:s})),t.visible!==void 0&&r.visible!==t.visible){const o={userAction:s};t.visible?this._show(o):this._hide(o)}}changeConfigs(t,i=!0){this.updateState({config:t},i),this.render()}updatePosition(){var a;const t=_m(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.fiveUtil.model)==null?void 0:a.bounding.getCenter(new C.Vector3).setY(t);if(!i)return;const r=i.clone().project(this.five.camera),s=(r.x+1)/2,o=-(r.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=o*100+"%"}formatData(t){return te(this,null,function*(){return yield ws(t.data)})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?O(O({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Pe(O(O({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Pe(O(O({},this.state),t),{config:o}),!Fn(this.state,r,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const t=this.five;t.on("modeChange",this.onFiveModeChange),t.on("interiaPan",this.onFiveInteriaPan),t.on("panoArrived",this.onFivePanoArrived),t.on("cameraUpdate",this.onFiveCameraUpdate),t.on("wantsPanGesture",this.onFiveWantsPanGesture),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsChangeMode",this.onFiveWantsChangeMode),t.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const t=this.five;this.hasAddedEventListener=!1,t.off("modelLoaded",this.onFiveModelLoaded),t.off("modeChange",this.onFiveModeChange),t.off("panoArrived",this.onFivePanoArrived),t.off("cameraUpdate",this.onFiveCameraUpdate),t.off("wantsPanGesture",this.onFiveWantsPanGesture),t.off("wantsTapGesture",this.onFiveWantsTapGesture),t.off("wantsChangeMode",this.onFiveWantsChangeMode),t.off("modelShownFloorChange",this.onModelShownFloorChange)}render(t){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=Pe(O({},this.state.config),{visible:this.state.visible,duration:t!=null?t:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(i);this.app=new Em({target:this.container,intro:!0,props:i})}};const dk=(e,n)=>new uk(e,n);let fk=class extends Or{constructor(t,i){var l,c;super(t);v(this,"name","topviewFloorplanPlugin");v(this,"state");v(this,"data");v(this,"app");v(this,"selector");v(this,"panoIndex",0);v(this,"floorIndex",0);v(this,"wrapper");v(this,"container",document.createElement("div"));v(this,"lastPanoramaLongitude",0);v(this,"size",{width:0,height:0});v(this,"defaultMissingFloorConfig");v(this,"hasAddedEventListener",!1);v(this,"isHiddenByHideFunc",!1);v(this,"highlightData",{});v(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return!1;const{min:t,max:i}=this.data.bounding,r=i.x-t.x,s=i.y-t.y,o=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Sm(this.five,this.wrapper,this.floorIndex,o),l=Math.ceil(r*a),c=Math.ceil(s*a);return this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c}),!0});v(this,"dispose",()=>{var t,i;this.removeEventListener(),(t=this.app)==null||t.$destroy(),this.app=void 0,(i=this.container)==null||i.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});v(this,"highlight",t=>{this.state.config.highlightEnable&&(this.highlightData=t,this.render())});v(this,"unhighlight",()=>{this.highlightData={},this.render()});v(this,"_disable",t=>{var r,s;const{userAction:i}=t;(r=this.app)==null||r.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:i})});v(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const t=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!t)throw new Error("不正确的父容器选择器");this.wrapper=t,t.append(this.container)});v(this,"onFiveModeChange",(...[t,,,,i])=>{t!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});v(this,"onFivePanoArrived",t=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=t,this.floorIndex=this.five.work.observers[t].floorIndex)});v(this,"onFiveCameraUpdate",(t,i)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});v(this,"onFiveWantsGesture",t=>{if(!(t!=="pan"&&t!=="pinch"&&t!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});v(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});v(this,"onFiveInitAnimationEnded",(...[,,t])=>{const{mode:i}=this.five.getCurrentState();i==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},t),this._show({userAction:t}))});v(this,"onModelShownFloorChange",t=>{if(this.floorIndex!==t){if(t===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=t,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法")),this.defaultMissingFloorConfig={imageURL:this.staticPrefix+"/release/web/saas/missing-floorplan.e274c596.png",imageWidth:200,imageHeight:120,text:(c=(l=i.i18n)==null?void 0:l.call(i,"暂无平面图"))!=null?c:"暂无平面图",textFontSize:14};const r={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,roomDimensionEnable:!0,cameraImageUrl:As,attachedTo:bs.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:O(O({},this.defaultMissingFloorConfig),i.missingFloorConfig),i18n:h=>h,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:h=>(h/1e6).toFixed(1)+"㎡",getRoomDimensionText:(h,u)=>(h/1e3).toFixed(1)+"m × "+(u/1e3).toFixed(1)+"m",getRuleDistanceText:h=>h.toString()},s=i?Ga(i,["selector","scale"]):{},o=O(O({},r.missingFloorConfig),s.missingFloorConfig),a=Pe(O(O({},r),s),{missingFloorConfig:o});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),t.model.loaded?this.onFiveModelLoaded():t.once("modelLoaded",this.onFiveModelLoaded),t.once("dispose",this.dispose),this.addEventListener()}load(t,i,r=!0){return te(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&Dr(o.version)&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(t)),l=s(a)?a.data:a,c=this.data;this.data=yield ws(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,r),this.render()})}updatePosition(){var a;const t=_m(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new C.Vector3).setY(t);if(!i)return;const r=i.clone().project(this.five.camera),s=(r.x+1)/2,o=-(r.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=o*100+"%"}appendTo(t){if(this.wrapper=t,!!this.state.enabled)return t.appendChild(this.container),this.render(),this}show(){return te(this,arguments,function*(t={}){if(this.state.visible)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return te(this,arguments,function*(t={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(t={}){if(this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!0},t.userAction||i),this._enable({userAction:i})}disable(t={}){if(!this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!1},t.userAction||i),this._disable({userAction:i})}setState(t,i={}){const r=this.state,s=i.userAction!==void 0?i.userAction:!0;if(this.updateState(t,s),t.enabled!==void 0&&r.enabled!==t.enabled){const o={userAction:s};t.enabled?this._enable(o):this._disable(o)}if(t.visible!==void 0&&r.visible!==t.visible){const o={userAction:s};t.visible?this._show(o):this._hide(o)}}changeConfigs(t,i=!0){this.updateState({config:t},i),this.render()}formatData(t){return te(this,null,function*(){return yield ws(t.data)})}_show(t){return te(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:i}=t;this.hooks.emit("show",{userAction:i,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Im(this.five,["Topview",void 0,void 0,i])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const r=500,s=this.state.config.modelOpacity;ja(this.five,s,r),this.hooks.emit("showAnimationEnded",{userAction:i,auto:!1}),this.render()})}_hide(t){return te(this,null,function*(){if(!this.state.enabled)return;const{userAction:i}=t;this.hooks.emit("hide",{userAction:i,auto:!1});const r=1,s=0;ja(this.five,r,s),this.render()})}_enable(t){const{userAction:i}=t;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?O(O({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Pe(O(O({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Pe(O(O({},this.state),t),{config:o}),!Fn(this.state,r,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const t=this.five;t.on("modeChange",this.onFiveModeChange),t.on("panoArrived",this.onFivePanoArrived),t.on("cameraUpdate",this.onFiveCameraUpdate),t.on("wantsGesture",this.onFiveWantsGesture),t.on("wantsMoveToPano",this.onFiveWantsMoveToPano),t.on("initAnimationEnded",this.onFiveInitAnimationEnded),t.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const t=this.five;this.hasAddedEventListener=!1,t.off("modeChange",this.onFiveModeChange),t.off("panoArrived",this.onFivePanoArrived),t.off("cameraUpdate",this.onFiveCameraUpdate),t.off("wantsGesture",this.onFiveWantsGesture),t.off("wantsMoveToPano",this.onFiveWantsMoveToPano),t.off("initAnimationEnded",this.onFiveInitAnimationEnded),t.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(t){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const i=Pe(O({},this.state.config),{visible:this.state.visible,duration:t!=null?t:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(i);this.app=new Em({target:this.container,intro:!0,props:i})}};const pk=(e,n)=>new fk(e,n);function Tm(e,n=200){let t;return function(...i){t||(e(...i),t=setTimeout(function(){t=null},n))}}function mk(e){Ue(e,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function gk(e){let n,t,i;return{c(){n=H("div"),t=H("div"),i=H("div"),_(i,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),W(i,"background-image","url("+(e[0]||As)+")"),W(i,"transform",e[1]),_(t,"class","plugin-radar__camera-position svelte-1nqrlxd"),W(t,"transform",e[2]),_(n,"class","plugin-radar__camera-wrapper svelte-1nqrlxd"),W(n,"opacity",e[3]?1:0)},m(r,s){X(r,n,s),Q(n,t),Q(t,i)},p(r,[s]){s&1&&W(i,"background-image","url("+(r[0]||As)+")"),(s&1||s&3)&&W(i,"transform",r[1]),s&4&&W(t,"transform",r[2]),s&8&&W(n,"opacity",r[3]?1:0)},i:de,o:de,d(r){r&&Y(n)}}}function vk(e){return`rotate(${Math.floor(e/Math.PI*180)*-1+45}deg)`}function yk(e,n,t){var b,A;let i,r,s,o,{five:a}=n,{pxmm:l}=n,{floorplanData:c}=n,{cameraImageUrl:h}=n,u=a.getCurrentState().panoIndex,d=a.getCurrentState().longitude,f=(A=(b=a.work.observers[a.getCurrentState().panoIndex])==null?void 0:b.floorIndex)!=null?A:0;function m(w,x){const M=w.bounding,E=w.observers[x];if(!E)return"";const S=(M.max.x-M.min.x)*l,T=(M.max.y-M.min.y)*l,z=Math.floor(E.positionInImage.x*S),D=Math.floor(E.positionInImage.y*T);return`translate(${z}px, ${D}px)`}function p(w){t(7,u=w)}function g(w){t(9,f=a.work.observers[w].floorIndex)}const y=Tm(w=>{t(8,d=w.longitude)},1e3/60);return Yn(()=>(a.on("panoWillArrive",p),a.on("panoArrived",g),a.on("cameraDirectionUpdate",y),function(){a.off("panoWillArrive",p),a.off("panoArrived",g),a.off("cameraDirectionUpdate",y)})),e.$$set=w=>{"five"in w&&t(4,a=w.five),"pxmm"in w&&t(5,l=w.pxmm),"floorplanData"in w&&t(6,c=w.floorplanData),"cameraImageUrl"in w&&t(0,h=w.cameraImageUrl)},e.$$.update=()=>{e.$$.dirty&576&&t(10,i=c.floorDatas[f]),e.$$.dirty&1024&&t(3,r=i.rooms.length>0),e.$$.dirty&192&&t(2,s=m(c,u)),e.$$.dirty&256&&t(1,o=vk(d))},[h,o,s,r,a,l,c,u,d,f,i]}class bk extends Oe{constructor(n){super(),ke(this,n,yk,gk,Le,{five:4,pxmm:5,floorplanData:6,cameraImageUrl:0},mk)}}function Ak(e){Ue(e,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function NA(e,n,t){const i=e.slice();return i[1]=n[t],i}function FA(e,n){let t,i,r=`${n[1].icon.width/16}rem`,s=`${n[1].icon.height/16}rem`,o,a=`${n[1].positionInImage.y*100}%`,l=`${n[1].positionInImage.x*100}%`;return{key:e,first:null,c(){t=H("div"),i=H("div"),o=ye(),_(i,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),W(i,"background-image",`url(${n[1].icon.url})`),W(i,"width",r),W(i,"height",s),_(t,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),W(t,"top",a),W(t,"left",l),this.first=t},m(c,h){X(c,t,h),Q(t,i),Q(t,o)},p(c,h){n=c,h&1&&W(i,"background-image",`url(${n[1].icon.url})`);const u=h&1;u&&W(i,"width",r),u&&W(i,"height",s),h&1&&a!==(a=`${n[1].positionInImage.y*100}%`)&&W(t,"top",a),h&1&&l!==(l=`${n[1].positionInImage.x*100}%`)&&W(t,"left",l)},d(c){c&&Y(t)}}}function wk(e){let n,t=[],i=new Map,r=e[0];const s=o=>o[1].id;for(let o=0;o<r.length;o+=1){let a=NA(e,r,o),l=s(a);i.set(l,t[o]=FA(l,a))}return{c(){n=H("div");for(let o=0;o<t.length;o+=1)t[o].c();_(n,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(o,a){X(o,n,a);for(let l=0;l<t.length;l+=1)t[l]&&t[l].m(n,null)},p(o,[a]){a&1&&(r=o[0],t=Ni(t,a,s,1,o,r,i,n,Am,FA,null,NA))},i:de,o:de,d(o){o&&Y(n);for(let a=0;a<t.length;a+=1)t[a].d()}}}function xk(e,n,t){let{extraObjects:i=[]}=n;return e.$$set=r=>{"extraObjects"in r&&t(0,i=r.extraObjects)},[i]}class Mk extends Oe{constructor(n){super(),ke(this,n,xk,wk,Le,{extraObjects:0},Ak)}}function Ck(e){Ue(e,"svelte-18287ai",".missing-floor-wrapper.svelte-18287ai{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:flex;justify-content:center;align-items:center}.missing-floor-image.svelte-18287ai{max-width:100%;max-height:100%}")}function Pk(e){let n,t,i,r,s,o;const a=[{floorIndex:e[2],floorplanData:e[4]}];let l={};for(let h=0;h<a.length;h+=1)l=Ln(l,a[h]);n=new iA({props:l}),i=new Mk({props:{extraObjects:e[7]}});let c=e[3]&&VA(e);return{c(){Te(n.$$.fragment),t=ye(),Te(i.$$.fragment),r=ye(),c&&c.c(),s=pt()},m(h,u){Se(n,h,u),X(h,t,u),Se(i,h,u),X(h,r,u),c&&c.m(h,u),X(h,s,u),o=!0},p(h,u){const d=u&20?Vn(a,[{floorIndex:h[2],floorplanData:h[4]}]):{};n.$set(d);const f={};u&128&&(f.extraObjects=h[7]),i.$set(f),h[3]?c?(c.p(h,u),u&8&&N(c,1)):(c=VA(h),c.c(),N(c,1),c.m(s.parentNode,s)):c&&(Fe(),Z(c,1,1,()=>{c=null}),Ve())},i(h){o||(N(n.$$.fragment,h),N(i.$$.fragment,h),N(c),o=!0)},o(h){Z(n.$$.fragment,h),Z(i.$$.fragment,h),Z(c),o=!1},d(h){Ie(n,h),h&&Y(t),Ie(i,h),h&&Y(r),c&&c.d(h),h&&Y(s)}}}function Ek(e){let n,t,i;return{c(){n=H("div"),t=H("img"),_(t,"class","missing-floor-image svelte-18287ai"),Sn(t.src,i=e[6])||_(t,"src",i),_(t,"alt","缺省楼层"),_(n,"class","missing-floor-wrapper svelte-18287ai")},m(r,s){X(r,n,s),Q(n,t)},p(r,s){s&64&&!Sn(t.src,i=r[6])&&_(t,"src",i)},i:de,o:de,d(r){r&&Y(n)}}}function VA(e){let n,t;const i=[{five:e[0],pxmm:e[1],floorIndex:e[2],floorplanData:e[4],onRoomHeightClick:e[9],highlightData:e[5],hoveredRoom:void 0}];let r={};for(let s=0;s<i.length;s+=1)r=Ln(r,i[s]);return n=new MA({props:r}),{c(){Te(n.$$.fragment)},m(s,o){Se(n,s,o),t=!0},p(s,o){const a=o&567?Vn(i,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[9],highlightData:s[5],hoveredRoom:void 0}]):{};n.$set(a)},i(s){t||(N(n.$$.fragment,s),t=!0)},o(s){Z(n.$$.fragment,s),t=!1},d(s){Ie(n,s)}}}function _k(e){let n,t,i,r;const s=[Ek,Pk],o=[];function a(l,c){return l[8]?1:0}return n=a(e),t=o[n]=s[n](e),{c(){t.c(),i=pt()},m(l,c){o[n].m(l,c),X(l,i,c),r=!0},p(l,[c]){let h=n;n=a(l),n===h?o[n].p(l,c):(Fe(),Z(o[h],1,1,()=>{o[h]=null}),Ve(),t=o[n],t?t.p(l,c):(t=o[n]=s[n](l),t.c()),N(t,1),t.m(i.parentNode,i))},i(l){r||(N(t),r=!0)},o(l){Z(t),r=!1},d(l){o[n].d(l),l&&Y(i)}}}function Sk(e,n,t){let i,r,s,{five:o}=n,{pxmm:a}=n,{floorIndex:l}=n,{hoverEnable:c}=n,{floorplanData:h}=n,{extraObjects:u=[]}=n,{highlightData:d}=n,{missingFloorImageUrl:f}=n;const m=void 0;return e.$$set=p=>{"five"in p&&t(0,o=p.five),"pxmm"in p&&t(1,a=p.pxmm),"floorIndex"in p&&t(2,l=p.floorIndex),"hoverEnable"in p&&t(3,c=p.hoverEnable),"floorplanData"in p&&t(4,h=p.floorplanData),"extraObjects"in p&&t(10,u=p.extraObjects),"highlightData"in p&&t(5,d=p.highlightData),"missingFloorImageUrl"in p&&t(6,f=p.missingFloorImageUrl)},e.$$.update=()=>{e.$$.dirty&20&&t(11,i=h.floorDatas[l]),e.$$.dirty&2048&&t(8,r=i.rooms.length>0),e.$$.dirty&1028&&t(7,s=u==null?void 0:u.filter(p=>p.floorIndex===l))},[o,a,l,c,h,d,f,s,r,m,u,i]}class Ik extends Oe{constructor(n){super(),ke(this,n,Sk,_k,Le,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:10,highlightData:5,missingFloorImageUrl:6},Ck)}}function Tk(e){Ue(e,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function GA(e){let n,t,i,r,s=e[8]!==0&&jA(e);return{c(){n=H("div"),s&&s.c(),_(n,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(o,a){X(o,n,a),s&&s.m(n,null),t=!0,i||(r=[zi(ys.call(null,n)),lt(n,"clientWidth",e[14]),lt(n,"clientHeight",e[15])],i=!0)},p(o,a){o[8]!==0?s?(s.p(o,a),a&256&&N(s,1)):(s=jA(o),s.c(),N(s,1),s.m(n,null)):s&&(Fe(),Z(s,1,1,()=>{s=null}),Ve())},i(o){t||(N(s),t=!0)},o(o){Z(s),t=!1},d(o){o&&Y(n),s&&s.d(),i=!1,bn(r)}}}function jA(e){let n,t,i,r,s=`${e[10]}px`,o=`${e[13]}px`,a;const l=[{five:e[0],pxmm:e[11],floorIndex:e[12],floorplanData:e[3],hoverEnable:e[2],extraObjects:e[5],highlightData:e[6],missingFloorImageUrl:e[7]}];let c={};for(let d=0;d<l.length;d+=1)c=Ln(c,l[d]);t=new Ik({props:c});const h=[{pxmm:e[11],five:e[0],floorplanData:e[3],cameraImageUrl:e[4]}];let u={};for(let d=0;d<h.length;d+=1)u=Ln(u,h[d]);return r=new bk({props:u}),{c(){n=H("div"),Te(t.$$.fragment),i=ye(),Te(r.$$.fragment),_(n,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),W(n,"width",s),W(n,"height",o)},m(d,f){X(d,n,f),Se(t,n,null),Q(n,i),Se(r,n,null),a=!0},p(d,f){const m=f&6381?Vn(l,[{five:d[0],pxmm:d[11],floorIndex:d[12],floorplanData:d[3],hoverEnable:d[2],extraObjects:d[5],highlightData:d[6],missingFloorImageUrl:d[7]}]):{};t.$set(m);const p=f&2073?Vn(h,[{pxmm:d[11],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};r.$set(p),f&1024&&s!==(s=`${d[10]}px`)&&W(n,"width",s),f&8192&&o!==(o=`${d[13]}px`)&&W(n,"height",o)},i(d){a||(N(t.$$.fragment,d),N(r.$$.fragment,d),a=!0)},o(d){Z(t.$$.fragment,d),Z(r.$$.fragment,d),a=!1},d(d){d&&Y(n),Ie(t),Ie(r)}}}function Dk(e){let n,t,i=e[1]&&GA(e);return{c(){i&&i.c(),n=pt()},m(r,s){i&&i.m(r,s),X(r,n,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&N(i,1)):(i=GA(r),i.c(),N(i,1),i.m(n.parentNode,n)):i&&(Fe(),Z(i,1,1,()=>{i=null}),Ve())},i(r){t||(N(i),t=!0)},o(r){Z(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function Lk(e,n,t){var w,x;let{five:i}=n,{visible:r}=n,{hoverEnable:s}=n,{floorplanData:o}=n,{cameraImageUrl:a}=n,{extraObjects:l=[]}=n,{highlightData:c}=n,{missingFloorImageUrl:h}=n,u=0,d=(x=(w=i.work.observers[i.getCurrentState().panoIndex])==null?void 0:w.floorIndex)!=null?x:0,f=0,m=0,p=0,g=0;function y(M){t(12,d=i.work.observers[M].floorIndex)}Yn(()=>(i.on("panoArrived",y),()=>{i.off("panoArrived",y)}));const b=M=>{t(8,f=M.detail)},A=M=>{t(9,m=M.detail)};return e.$$set=M=>{"five"in M&&t(0,i=M.five),"visible"in M&&t(1,r=M.visible),"hoverEnable"in M&&t(2,s=M.hoverEnable),"floorplanData"in M&&t(3,o=M.floorplanData),"cameraImageUrl"in M&&t(4,a=M.cameraImageUrl),"extraObjects"in M&&t(5,l=M.extraObjects),"highlightData"in M&&t(6,c=M.highlightData),"missingFloorImageUrl"in M&&t(7,h=M.missingFloorImageUrl)},e.$$.update=()=>{if(e.$$.dirty&1800){const M=Math.min(f,m),{max:E,min:S}=o.bounding,T=E.x-S.x,z=E.y-S.y,D=function(){return T>z?[M,M/T*z]:[M/z*T,M]}();t(10,p=D[0]),t(13,g=D[1]),t(11,u=p/T)}},[i,r,s,o,a,l,c,h,f,m,p,u,d,g,b,A]}class kk extends Oe{constructor(n){super(),ke(this,n,Lk,Dk,Le,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6,missingFloorImageUrl:7},Tk)}}let Ok=class extends Or{constructor(t,i){super(t);v(this,"name","panoFloorplanRadarPlugin");v(this,"state");v(this,"data");v(this,"app");v(this,"wrapperSelector","");v(this,"wrapper",null);v(this,"disposed",!1);v(this,"extraObjects",[]);v(this,"highlightData",{});v(this,"dispose",()=>{var t;this.disposed=!0,(t=this.app)==null||t.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});v(this,"highlight",t=>{this.state.config.highlightEnable&&(this.highlightData=t,this.render())});v(this,"unhighlight",()=>{this.highlightData={},this.render()});v(this,"_disable",t=>{var r;const{userAction:i}=t;(r=this.app)==null||r.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:i})});this.five=t;const r={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:As,missingFloorImageUrl:this.staticPrefix+"/release/web/saas/missing-floor.d687a5ed.png"},s=O(O({},r),i==null?void 0:i.configs);this.state={enabled:!0,visible:!0,config:s},i!=null&&i.wrapper&&console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"),typeof(i==null?void 0:i.wrapper)=="string"?this.wrapperSelector=i.wrapper:(i==null?void 0:i.wrapper)instanceof Element&&(this.wrapper=i.wrapper),t.once("dispose",this.dispose)}load(t,i,r=!0){return te(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const o=JSON.parse(JSON.stringify(t)),a=s(o)?o.data:o,l=this.data;this.data=yield ws(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),i&&this.updateState(i,r),this.render()})}show(){return te(this,arguments,function*(t={}){if(this.state.visible)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return te(this,arguments,function*(t={}){if(!this.state.visible)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(t={}){if(this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!0},t.userAction||i),this._enable({userAction:i})}disable(t={}){if(!this.state.enabled)return;const i=t.userAction!==void 0?t.userAction:!0;this.updateState({enabled:!1},t.userAction||i),this._disable({userAction:i})}setState(t,i={}){const r=this.state,s=i.userAction!==void 0?i.userAction:!0;if(this.updateState(t,s),t.enabled!==void 0&&r.enabled!==t.enabled){const o={userAction:s};t.enabled?this._enable(o):this._disable(o)}if(t.visible!==void 0&&r.visible!==t.visible){const o={userAction:s};t.visible?this._show(o):this._hide(o)}}appendTo(t){this.wrapper!==t&&this.app&&(this.app.$destroy(),this.app=void 0),this.wrapper=t,this.render()}changeConfigs(t,i=!0){this.setState({config:t},{userAction:i}),this.render()}setExtraObjectsWith3DPositions(t){this.data&&(this.extraObjects=$L(t,this.five,this.data),this.render())}formatData(t){return te(this,null,function*(){return yield ws(t.data)})}_enable(t){const{userAction:i}=t;this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}_show(t){if(this.disposed||!this.state.enabled)return;const{userAction:i}=t;this.hooks.emit("show",{userAction:i}),this.render()}_hide(t){if(this.disposed||!this.state.enabled)return;const{userAction:i}=t;this.hooks.emit("hide",{userAction:i}),this.render()}updateState(t,i){const r=this.state,s=t.config?O(O({},r.config),t.config):r.config;this.state=Pe(O(O({},this.state),t),{config:s}),!Fn(this.state,r,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const i=document.querySelector(this.wrapperSelector);this.wrapper=i}if(!this.data||!this.wrapper)return;const t=Pe(O({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(t):this.app=new kk({target:this.wrapper,props:t})}};const Rk=(e,n)=>new Ok(e,n),zk=[{type:0,floorType:1,roomType:"100900000012",name:"其他"},{type:1,floorType:1,roomType:"100900000002",name:"客厅"},{type:2,floorType:1,roomType:"100900000002",name:"餐厅"},{type:3,floorType:0,roomType:"100900000001",name:"卧室"},{type:4,floorType:0,roomType:"100900000001",name:"书房"},{type:5,floorType:3,roomType:"100900000004",name:"卫生间"},{type:6,floorType:3,roomType:"100900000004",name:"淋浴间"},{type:7,floorType:3,roomType:"100900000004",name:"洗手间"},{type:8,floorType:3,roomType:"100900000003",name:"厨房"},{type:9,floorType:1,roomType:"100900000003",name:"开放厨房",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"多功能间"},{type:11,floorType:0,roomType:"100900000009",name:"保姆间"},{type:12,floorType:4,roomType:"100900000005",name:"阳台"},{type:13,floorType:4,roomType:"100900000006",name:"露台"},{type:14,floorType:0,roomType:"100900000008",name:"储物间"},{type:15,floorType:0,roomType:"100900000013",name:"衣帽间"},{type:16,floorType:0,roomType:"100900000011",name:"阁楼"},{type:17,floorType:2,roomType:"100900000007",name:"花园"},{type:18,floorType:5,roomType:"100900000010",name:"车库"},{type:19,floorType:1,roomType:"100900000012",name:"电梯"},{type:20,floorType:1,roomType:"100900000012",name:"地下室"},{type:21,floorType:1,roomType:"100900000012",name:"天井"},{type:22,floorType:1,roomType:"100900000012",name:"阳光房"},{type:23,floorType:1,roomType:"100900000012",name:"过道"},{type:24,floorType:1,roomType:"100900000012",name:"楼梯间"},{type:25,floorType:1,roomType:"100900000012",name:"门厅"},{type:26,floorType:2,roomType:"100900000012",name:"入户花园"},{type:27,floorType:1,roomType:"100900000012",name:"玄关"},{type:28,floorType:1,roomType:"100900000012",name:"挑空"},{type:29,floorType:4,roomType:"100900000012",name:"晾晒区"},{type:30,floorType:4,roomType:"100900000012",name:"洗衣房"},{type:31,floorType:0,roomType:"100900000012",name:"娱乐区"},{type:32,floorType:0,roomType:"100900000012",name:"健身区"},{type:33,floorType:0,roomType:"100900000012",name:"接待区"},{type:34,floorType:0,roomType:"100900000012",name:"影音区"},{type:35,floorType:1,roomType:"100900000012",name:"餐饮区"},{type:36,floorType:1,roomType:"100900000012",name:"其他",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"起居室"},{type:38,floorType:0,roomType:"100900000001",name:"主卧"},{type:39,floorType:0,roomType:"100900000001",name:"次卧"},{type:40,floorType:0,roomType:"100900000001",name:"优化间"},{type:41,floorType:0,roomType:"100900000001",name:"办公室"},{type:42,floorType:0,roomType:"100900000001",name:"会议室"},{type:43,floorType:0,roomType:"100900000001",name:"洽谈间"},{type:44,floorType:1,roomType:"100900000002",name:"共享大厅"},{type:45,floorType:1,roomType:"100900000012",name:"水吧"},{type:46,floorType:0,roomType:"100900000015",name:"出入口"},{type:47,floorType:0,roomType:"100900000015",name:"大厅"},{type:48,floorType:0,roomType:"100900000015",name:"包厢"},{type:49,floorType:0,roomType:"100900000015",name:"其他"},{type:50,floorType:0,roomType:"100900000016",name:"出入口"},{type:51,floorType:0,roomType:"100900000016",name:"办公区"},{type:52,floorType:0,roomType:"100900000016",name:"老板间"},{type:53,floorType:0,roomType:"100900000016",name:"会议室"},{type:54,floorType:0,roomType:"100900000016",name:"休息区/水吧"},{type:55,floorType:0,roomType:"100900000016",name:"其他"},{type:56,floorType:2,roomType:"100900000012",name:"空中花园"},{type:57,floorType:0,roomType:"100900000001",name:"洋室"},{type:58,floorType:0,roomType:"100900000001",name:"和室"}],Bk=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],Nk=[{roomType:"100900000001",description:"室"},{roomType:"100900000002",description:"厅"},{roomType:"100900000003",description:"厨"},{roomType:"100900000004",description:"卫"},{roomType:"100900000005",description:"阳台"},{roomType:"100900000006",description:"露台"},{roomType:"100900000007",description:"花园"},{roomType:"100900000008",description:"储"},{roomType:"100900000009",description:"保姆间"},{roomType:"100900000010",description:"车库"},{roomType:"100900000011",description:"阁楼"},{roomType:"100900000012",description:"其他"},{roomType:"100900000013",description:"衣"},{roomType:"100900000015",description:"商铺"},{roomType:"100900000016",description:"写字楼"}],Dm=(e,n,t)=>{const i=new C.Matrix4,r=new C.Euler(e,n,t,"YXZ");return i.makeRotationFromEuler(r),i},Fk=(e,{scale:n,rotation:t,position:i})=>{if(n&&e.scale.set(n,n,n),t){const[r,s,o]=t;r&&e.applyMatrix4(Dm(r,0,0)),s&&e.applyMatrix4(Dm(0,s,0)),o&&e.applyMatrix4(Dm(0,0,o))}return i&&e.position.set(i.x,i.y,i.z),e};function HA(e,n){e.traverse(t=>{var i;if(t.type==="Mesh"){const r=t,s=O({map:r.material.map||{}},n);r.material=new ee.MeshBasicMaterial(s),r.renderOrder=1,((i=t.parent)==null?void 0:i.type)==="Mesh"&&(t.renderOrder=t.parent.renderOrder+1)}})}const Vk=(e,n)=>{var p;const t=n.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",i=(p=n.north_rad)!=null?p:void 0,r={};let s={x:0,y:0,z:0},o=[0,0,0],a=1,l=i;e.on("modelLoaded",m);const c=g=>te(this,null,function*(){var w;const y=(g==null?void 0:g.fbx_url)||t;if(l=(w=g==null?void 0:g.north_rad)!=null?w:i,typeof l!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const A=yield new vo.FBXLoader().loadAsync(y);return HA(A,{transparent:!0,side:C.DoubleSide,blending:C.AdditiveBlending}),r.object=A,m(),!0}),h=({latitude:g})=>{if(!r.object)return;const y=u(g);y&&(r.object.position.y=y)},u=g=>{if(r.yBase===void 0)return;const y=.6;if(g>=Math.PI/4)return r.yBase-(y+1.6);const b=g*(4/Math.PI);return r.yBase-(y*b+1.6)},d=()=>{if(!r.object)return;const g=u(e.getPose().latitude);g&&(r.object.position.y=g),e.scene.add(r.object),e.needsRender=!0,e.on("cameraDirectionUpdate",h)},f=()=>{r.object&&(e.scene.remove(r.object),e.needsRender=!0,e.off("cameraDirectionUpdate",h))};function m(){const g=r.object;if(!g)return;const y=e.model.bounding,b=y.max.x-y.min.x,A=y.max.z-y.min.z,w=Math.max(b,A),{max:{x,z:M},min:{x:E,y:S,z:T}}=y;r.yBase=S,s={x:(x+E)/2,y:S-1.6,z:(M+T)/2},o=[0,l-Math.PI/2,0],a=.0045*w,Fk(g,{position:s,rotation:o,scale:a})}return{load:c,disable:f,enable:d}};function Gk(e,n){var c,h,u,d,f;const t=(c=n==null?void 0:n.size)!=null?c:512,i=(h=n==null?void 0:n.fontSize)!=null?h:t*(35/256)*1.2,r=(u=n==null?void 0:n.backgroundColor)!=null?u:"rgba(0,0,0,0)",s=(d=n==null?void 0:n.fontColor)!=null?d:"#fff",o=(f=n==null?void 0:n.textAlign)!=null?f:"center",a=document.createElement("canvas");a.setAttribute("width",t+""),a.setAttribute("height",t+"");const l=a.getContext("2d");return l.fillStyle=r,l.fillRect(0,0,t,t),l.font=`${i}px "微软雅黑"`,l.textAlign=o,l.fillStyle=s,l.fillText(e,t/2,t*.7),new ee.CanvasTexture(a)}const jk=({x:e,y:n,z:t})=>new ee.Vector3(e,n,t),Hk=(e,n)=>{var p,g,y;const t={},i=(p=n.animationEnabled)!=null?p:!0,r=(g=n.position)!=null?g:void 0,s=(y=n.rad)!=null?y:void 0,o=n.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=b=>te(this,null,function*(){var z,D,k,R,G,I,U,J;const A=(z=b==null?void 0:b.position)!=null?z:r;if(!A)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const w=jk(A),x=(D=b==null?void 0:b.rad)!=null?D:s,M=(k=b==null?void 0:b.fbx_url)!=null?k:o;if(t.rad=x,x===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${x}`));const E=yield new vo.FBXLoader().loadAsync(M);E.position.copy(w),E.rotation.z=x,E.scale.set(.8,.8,.8),HA(E,{transparent:!0,side:C.DoubleSide});const S=(U=(I=(G=(R=E.children)==null?void 0:R[0])==null?void 0:G.children)==null?void 0:I[3])==null?void 0:U.clone();if(!S)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${S}`));const T=(J=n.name)!=null?J:"入户门";return S.material=new ee.MeshBasicMaterial({transparent:!0,map:Gk(T)}),S.renderOrder=3,E.children[0].add(S),t.object=E,!0}),c=()=>{if(t.animation)return;if(!t.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",t.object);const b=1,A=new ee.AnimationMixer(t.object);a.push(A);const w=A.clipAction(t.object.animations[0]);w.timeScale=b;let x;const M=()=>{let z=0,D=0;const k=1e3/30,R=G=>{z=requestAnimationFrame(R);const I=G-D;I<k||(D=G,a.forEach(U=>U.update(I/1e3)),e.needsRender=!0)};return z=requestAnimationFrame(R),()=>{cancelAnimationFrame(z)}},T={play:()=>{x||(w.play(),x=M(),requestAnimationFrame(()=>{t.object&&t.object.rotation.z!==t.rad&&(t.object.rotation.z=t.rad)}))},stop:()=>{w.stop(),x==null||x(),x=void 0}};t.animation=T},h=b=>{var w;if(!t.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",t.object);((w=b==null?void 0:b.animationEnable)!=null?w:i)&&(t.animation||c(),t.animation.play()),e.scene.add(t.object),e.needsRender=!0},u=()=>{t.object&&(t.animation&&t.animation.stop(),e.scene.remove(t.object),e.needsRender=!0)},d=b=>b==="Floorplan"?h():u();return{load:l,enable:b=>(t.enabled||(t.enabled=!0,d(e.currentMode),e.on("modeChange",d),h(b)),!0),disable:()=>(t.enabled&&(t.enabled=!1,u(),e.off("modeChange",d)),!0)}},Uk=Gi;function Wk(e,n,t,i=Uk.Linear.None){const r=new nh(e).to(n,t).easing(i);bc(()=>r.start(0));const s=xa(a=>{r.update(a)===!1&&s()}),o=[];return r.onDestroy=a=>(o.push(a),r),r.destroy=function(){this.stop(),Object.assign(r,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=o.shift();)a();s()},r}function Qk(e,n){return Wk({progress:0},{progress:1},e,n)}var UA=(e=>(e.Move="Move",e.Rotate="Rotate",e))(UA||{}),sr=(e=>(e.Clockwise="Clockwise",e.Anticlockwise="Anticlockwise",e.Loop="Loop",e))(sr||{});const sd=Math.PI*2;function WA(e){return(e%sd+sd)%sd}function QA(e){return e%sd}function Lm(e,n,t){return e+(n-e)*t}const km=(e,n,t)=>{const i=Math.PI,r=i*2;let s=WA(e),o=WA(n);return t===sr.Anticlockwise&&s<o&&(s+=r),t===sr.Clockwise&&o<s&&(o+=r),t===sr.Loop&&o-s>i?km(s,o,sr.Anticlockwise):t===sr.Loop&&s-o>i?km(s,o,sr.Clockwise):{from:s,to:o}},Yk=e=>{const n={},t=(l,c,...h)=>te(this,[l,c,...h],function*(s,o,a={preload:!0}){return n.interruptCallback&&n.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==e.currentMode&&(yield e.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==e.panoIndex&&(yield e.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((u,d)=>{const f=s.panoIndex!==void 0?s.panoIndex:e.panoIndex;f!==void 0?e.moveToPano(f,O({duration:o,moveEndCallback:()=>u(!0),moveCancelCallback:()=>d(new Error("move canceled"))},s)):d(new Error("unexpected error"))})}),i=s=>{const o=e.state,a=QA(o.latitude),l=QA(s.latitude),{from:c,to:h}=km(o.longitude,s.longitude,s.rotation||sr.Loop),u=o.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:u},to:{latitude:l,longitude:h,fov:d}}};return{move:t,rotate:(l,c,...h)=>te(this,[l,c,...h],function*(s,o,a={}){n.interruptCallback&&n.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),e.currentMode!==Zt.Five.Mode.Panorama&&(yield e.changeMode(Zt.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==e.panoIndex&&(a.preload&&(yield e.preloadPano(s.panoIndex)),yield new Promise((f,m)=>{if(!s.panoIndex){f(!0);return}e.moveToPano(s.panoIndex,{moveEndCallback:()=>f(!0),moveCancelCallback:()=>m(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:u,to:d}=i(s);return yield new Promise(f=>{const m=({progress:A})=>{const w={};w.longitude=Lm(u.longitude,d.longitude,A),w.latitude=Lm(u.latitude,d.latitude,A),w.fov=Lm(u.fov,d.fov,A),e.setState(w,!0)},p=()=>{f(!0)},g=()=>{f(!1)},y=s.rotateSpeed?Math.ceil(Math.abs(d.longitude-u.longitude)/s.rotateSpeed*1e3):o,b=Qk(y,Gi.Linear.None).onUpdate(m).onComplete(p).onDestroy(g);s.rotation===sr.Loop&&b.repeat(1/0).yoyo(!0),n.interruptCallback=(A=!0)=>{b.destroy(),n.interruptCallback=void 0,n.timeoutId&&(clearTimeout(n.timeoutId),n.timeoutId=void 0),f(A)},n.timeoutId=setTimeout(()=>{n.interruptCallback&&n.interruptCallback(!0)},o)})})}};function YA(e,n){return e.x===n.x&&e.y===n.y}function XA(e,n){return Math.abs(e)===1/0&&Math.abs(n)===1/0?!0:Math.abs(e-n)<.001}function od(e,n){return(n.y-e.y)/(n.x-e.x)}function ZA(e,n,t){const i=od(e[1],e[0]),r=od(n[1],n[0]);if(isNaN(i)||isNaN(r)||XA(i,r))return!1;if(ad(e[0],n))return e[0];if(ad(e[1],n))return e[1];if(ad(n[0],e))return n[0];if(ad(n[1],e))return n[1];if(t&&!Zk(e,n))return!1;const s=e[0],o=n[0];if(Math.abs(i)===1/0)return{x:s.x,y:n[1].y-(n[1].x-s.x)*r};if(Math.abs(r)===1/0)return{x:o.x,y:e[1].y-(e[1].x-o.x)*i};const a=(o.y-s.y+i*s.x-r*o.x)/(i-r),l=i*a-i*s.x+s.y;return{x:a,y:l}}function ad(e,n){return YA(e,n[0])||YA(e,n[1])?!0:(n[0].x-e.x)*(e.x-n[1].x)>=0&&(n[0].y-e.y)*(e.y-n[1].y)>=0&&XA(od(n[0],e),od(e,n[1]))}function Xk(e){let n=1/0,t=-1/0,i=1/0,r=-1/0;return e.forEach(s=>{n=Math.min(n,s.x),t=Math.max(t,s.x),i=Math.min(i,s.y),r=Math.max(r,s.y)}),{x:(n+t)/2,y:(i+r)/2}}function ld(e,n,t){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)}function Zk(e,n){return Math.max(e[0].x,e[1].x)>=Math.min(n[0].x,n[1].x)&&Math.max(n[0].x,n[1].x)>=Math.min(e[0].x,e[1].x)&&Math.max(e[0].y,e[1].y)>=Math.min(n[0].y,n[1].y)&&ld(n[0],e[1],e[0])*ld(e[1],n[1],e[0])>0&&ld(e[0],n[1],n[0])*ld(n[1],e[1],n[0])>0?1:0}function qA(e,n=0){n<=0?requestAnimationFrame(e):requestAnimationFrame(()=>qA(e,n-1))}const qk=`<style type="text/css">
|
|
3175
3175
|
.PanoRulerPlugin-rule-line {
|
|
3176
3176
|
position: absolute;
|
|
3177
3177
|
transform-origin: left center;
|