@realsee/dnalogel 3.49.14-alpha.1 → 3.50.1
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/CHANGELOG.md +6 -0
- package/dist/index.cjs.js +5 -5
- package/dist/index.js +202 -198
- package/dist/index.umd.js +5 -5
- package/libs/Sculpt/utils/Meshes/getLengthHTML.js +1 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.js +13 -9
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +11 -11
- package/package.json +1 -1
- package/README.md +0 -116
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,Es,Zt,rl,go,pr,sl){"use strict";var M6=Object.defineProperty,C6=Object.defineProperties;var P6=Object.getOwnPropertyDescriptors;var Xd=Object.getOwnPropertySymbols;var uC=Object.prototype.hasOwnProperty,dC=Object.prototype.propertyIsEnumerable;var pv=(ue,ee,Ut)=>ee in ue?M6(ue,ee,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):ue[ee]=Ut,O=(ue,ee)=>{for(var Ut in ee||(ee={}))uC.call(ee,Ut)&&pv(ue,Ut,ee[Ut]);if(Xd)for(var Ut of Xd(ee))dC.call(ee,Ut)&&pv(ue,Ut,ee[Ut]);return ue},Pe=(ue,ee)=>C6(ue,P6(ee));var mo=(ue,ee)=>{var Ut={};for(var Hn in ue)uC.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&&dC.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,Es)=>{var Zt=pr=>{try{go(Ut.next(pr))}catch(sl){Es(sl)}},rl=pr=>{try{go(Ut.throw(pr))}catch(sl){Es(sl)}},go=pr=>pr.done?Hn(pr.value):Promise.resolve(pr.value).then(Zt,rl);go((Ut=Ut.apply(ue,ee)).next())});function mC(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 P=mC(ee);function gC(){console.debug("%c %c@realsee/dnalogel %cv3.49.14-alpha.1",["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 vC(){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 yC(e=gv){vv.__queue=vv.__queue.then(e).catch(gv)}function eh(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 th(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 bC(e,n,t=mv){new Promise(i=>{setTimeout(()=>{t(),i(!0)},n*e)})}const AC=window,yv=window.requestAnimationFrame||AC.webkitRequestAnimationFrame||(e=>setTimeout(e,16));function nh(e,n=0){n<=0?yv(e):yv(()=>nh(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}}}}),vo=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=vo()),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}(),_s={Linear:function(e,n){var t=e.length-1,i=t*n,r=Math.floor(i),s=_s.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=_s.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=_s.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=_s.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}}},Jd=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),qd=new bv,ih=function(){function e(n,t){t===void 0&&(t=qd),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=_s.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Jd.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=vo()),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=vo()),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=vo()),!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=qd),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=_s.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=vo()),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}(),wC="23.1.1",xC=Jd.nextId,ji=qd,MC=ji.getAll.bind(ji),CC=ji.removeAll.bind(ji),PC=ji.add.bind(ji),Av=ji.remove.bind(ji),EC=ji.update.bind(ji),wv={Easing:Gi,Group:bv,Interpolation:_s,now:vo,Sequence:Jd,nextId:xC,Tween:ih,VERSION:wC,getAll:MC,removeAll:CC,add:PC,remove:Av,update:EC};function _C(e,n,t,i=Gi.Linear.None){const r=new ih(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 rh(e){return e[ol]||(e[ol]={}),e[ol]}function SC(e){e[ol]||delete e[ol]}let IC=class{hasListener(n){const t=rh(this);return t&&t[n]&&t[n].length>0}on(n,t,i){const r=rh(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){SC(this);return}const i=rh(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=rh(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 TC=`
|
|
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,Es,Zt,rl,go,pr,sl){"use strict";var M6=Object.defineProperty,C6=Object.defineProperties;var P6=Object.getOwnPropertyDescriptors;var Xd=Object.getOwnPropertySymbols;var uC=Object.prototype.hasOwnProperty,dC=Object.prototype.propertyIsEnumerable;var pv=(ue,ee,Ut)=>ee in ue?M6(ue,ee,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):ue[ee]=Ut,O=(ue,ee)=>{for(var Ut in ee||(ee={}))uC.call(ee,Ut)&&pv(ue,Ut,ee[Ut]);if(Xd)for(var Ut of Xd(ee))dC.call(ee,Ut)&&pv(ue,Ut,ee[Ut]);return ue},Pe=(ue,ee)=>C6(ue,P6(ee));var mo=(ue,ee)=>{var Ut={};for(var Hn in ue)uC.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&&dC.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,Es)=>{var Zt=pr=>{try{go(Ut.next(pr))}catch(sl){Es(sl)}},rl=pr=>{try{go(Ut.throw(pr))}catch(sl){Es(sl)}},go=pr=>pr.done?Hn(pr.value):Promise.resolve(pr.value).then(Zt,rl);go((Ut=Ut.apply(ue,ee)).next())});function mC(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 P=mC(ee);function gC(){console.debug("%c %c@realsee/dnalogel %cv3.50.1",["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 vC(){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 yC(e=gv){vv.__queue=vv.__queue.then(e).catch(gv)}function eh(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 th(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 bC(e,n,t=mv){new Promise(i=>{setTimeout(()=>{t(),i(!0)},n*e)})}const AC=window,yv=window.requestAnimationFrame||AC.webkitRequestAnimationFrame||(e=>setTimeout(e,16));function nh(e,n=0){n<=0?yv(e):yv(()=>nh(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}}}}),vo=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=vo()),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}(),_s={Linear:function(e,n){var t=e.length-1,i=t*n,r=Math.floor(i),s=_s.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=_s.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=_s.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=_s.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}}},Jd=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),qd=new bv,ih=function(){function e(n,t){t===void 0&&(t=qd),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=_s.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Jd.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=vo()),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=vo()),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=vo()),!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=qd),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=_s.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=vo()),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}(),wC="23.1.1",xC=Jd.nextId,ji=qd,MC=ji.getAll.bind(ji),CC=ji.removeAll.bind(ji),PC=ji.add.bind(ji),Av=ji.remove.bind(ji),EC=ji.update.bind(ji),wv={Easing:Gi,Group:bv,Interpolation:_s,now:vo,Sequence:Jd,nextId:xC,Tween:ih,VERSION:wC,getAll:MC,removeAll:CC,add:PC,remove:Av,update:EC};function _C(e,n,t,i=Gi.Linear.None){const r=new ih(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 rh(e){return e[ol]||(e[ol]={}),e[ol]}function SC(e){e[ol]||delete e[ol]}let IC=class{hasListener(n){const t=rh(this);return t&&t[n]&&t[n].length>0}on(n,t,i){const r=rh(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){SC(this);return}const i=rh(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=rh(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 TC=`
|
|
2
2
|
<style type="text/css">
|
|
3
3
|
|
|
4
4
|
#_gl_paintBrush {
|
|
@@ -3104,7 +3104,7 @@ vec4 envMapTexelToLinear(vec4 color) {
|
|
|
3104
3104
|
color: white;
|
|
3105
3105
|
left: 50%;
|
|
3106
3106
|
transform: translate(-50%, -100%);
|
|
3107
|
-
|
|
3107
|
+
word-break: keep-all;
|
|
3108
3108
|
}
|
|
3109
3109
|
.LineLengthTag div:first-child {
|
|
3110
3110
|
position: absolute;
|
|
@@ -3154,7 +3154,7 @@ void main() {
|
|
|
3154
3154
|
gl_FragColor = vec4(1.0, 1.0, 1.0, 0.2);
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
|
-
`;function Z3(){const n=new P.CircleGeometry(.2,64),t=new P.ShaderMaterial({uniforms:{borderWidth:{value:.01},radius:{value:.2}},vertexShader:Y3,fragmentShader:X3,depthTest:!1,transparent:!0,blending:P.CustomBlending,blendEquation:P.AddEquation,blendSrc:P.DstColorFactor,blendDst:P.SrcAlphaFactor,blendDstAlpha:P.DstAlphaFactor});return new P.Mesh(n,t)}function J3(){const n=new P.Group,t={lineWidth:1,lineColor:3407837,opacity:.7,occlusionVisibility:!0},i=new ki(Pe(O({points:[{x:-.5},{x:.5}]},t),{lineColor:3407837})),r=new ki(Pe(O({points:[{y:-.5},{y:.5}]},t),{lineColor:3407837}));return n.add(i,r),n}function q3(e){const n=new P.CurvePath;n.add(new P.LineCurve3(new P.Vector3(0,0,0),new P.Vector3(0,0,e)));const t=new P.TubeGeometry(n,32,.003),i=new P.MeshBasicMaterial({color:10994687,depthTest:!1,transparent:!0});return new P.Mesh(t,i)}function K3(){const e=new P.RingGeometry(.03,.035,64),n=new P.MeshBasicMaterial({color:16777215,depthTest:!1,transparent:!0});return new P.Mesh(e,n)}function $3(){const e=new P.SphereGeometry(.018,32,32),n=new P.MeshBasicMaterial({color:5085183,depthTest:!1,transparent:!0});return new P.Mesh(e,n)}function eT(){const e=document.createElement("img");e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAVCAMAAAB8FU7dAAAAw1BMVEUAAACDuuiAsu11q/x8r/+HxtKHxtKIx9J4ut6Hx9Jcn/uNwNlmmf+RuP9ppf9orel3ud2HxtJrpf9oremev/9ppP9orelQmP9ZoPWSuP92q/9cnv9prel4ut53qv9orelYoPWIxdJPmP+HxtGRuP9oo/+Suf9Qmf92q/+RuP+DsP9Pmv+FxdFtre2SyMiRuP9PmP+evv9ppf9cnv+rxf9orepZofV4ut52q/+Dsf+Esv+5y/93q/9aofbF0f93rP9qpf8IzZ1iAAAAL3RSTlMAEg4s3dK5nodgVQoF/Pf39vbt7evr39rV1NTOzs6srJ+fiIZ9fWlpW09ERCwcHMH8LhIAAADRSURBVBjTjdDHkoMwEIThBrzOm3POOQwSYCRhe/f9n2p75FD2zX/VXL5qOAjzkixLsFL6fOFF5PwpXUj/eEwx7Oh9Jq+FdV5MqZkXlU9K4KZsmqY02x/A8LSwv14o0ylJWkP087WVhDfcjmjj5b/E3+CEpDPdGY58C7tKfzSiiA9uB4dV/NIF7yVQ7AGuq0lOIzrvnLP2Et2aMzUqryge8FVX0Zjl5XkG3KsR593pM2zVEScjvbMU7IdGjF19IzZ43Ceyve4Ai5Jep93u9BJs3j/gXjHbRgy31AAAAABJRU5ErkJggg==";const n=new Q3(e);return e.style.pointerEvents="none",n.scale.set(.003,.003,.003),n}class tT extends P.Object3D{constructor(t){super();v(this,"planeMesh");v(this,"ringMesh");v(this,"crossline");v(this,"lineMesh");v(this,"ballMesh");v(this,"cssBallMesh");const i=.18;this.planeMesh=Z3(),this.ringMesh=K3(),this.crossline=J3(),this.lineMesh=q3(i),this.ballMesh=$3(),this.cssBallMesh=eT(),this.ballMesh.position.setZ(i),this.cssBallMesh.position.setZ(i),this.planeMesh.renderOrder=0,this.ringMesh.renderOrder=1,this.crossline.renderOrder=2,this.lineMesh.renderOrder=3,this.ballMesh.renderOrder=4,this.add(this.planeMesh,this.crossline,this.lineMesh,this.ballMesh,this.ringMesh,this.cssBallMesh),Pv(t)}updateWithIntersect(t){if(!t.face)return;const i=(()=>{const s=t.face.normal.clone().normalize();return s.y>.99?new P.Vector3(0,1,0):s.y<-.99?new P.Vector3(0,-1,0):s.x>.99?new P.Vector3(1,0,0):s.x<-.99?new P.Vector3(-1,0,0):s.z>.99?new P.Vector3(0,0,1):s.z<-.99?new P.Vector3(0,0,-1):s.y<.01&&s.y>-.01?new P.Vector3(s.x,0,s.z):s})(),r=new P.Vector3().addVectors(t.point,i);this.position.copy(t.point),this.lookAt(r)}show(){this.visible=!0,this.add(this.cssBallMesh)}hide(){this.visible=!1,this.remove(this.cssBallMesh)}dispose(){}}class cb{constructor(n,t){v(this,"five");v(this,"hooks",new Pn);v(this,"position");v(this,"magnifier",null);v(this,"pointHelper",null);v(this,"state",{enabled:!1,visible:!0});v(this,"group",new P.Group);v(this,"show",()=>{var n,t;this.state.visible||(this.state.visible=!0,(n=this.pointHelper)==null||n.show(),(t=this.magnifier)==null||t.enable(),this.five.needsRender=!0)});v(this,"hide",()=>{var n,t;this.state.visible&&(this.state.visible=!1,(n=this.pointHelper)==null||n.hide(),(t=this.magnifier)==null||t.disable(),this.five.needsRender=!0)});v(this,"updateWithIntersect",(n,t={emitEvent:!0})=>{var r;if(!n)return;this.abortUpdateMagnifier(),this.position=n,t.emitEvent&&this.hooks.emit("intersectionUpdate",n),(r=this.pointHelper)==null||r.updateWithIntersect(n);const i=()=>{var s;return(s=this.magnifier)==null?void 0:s.renderWithPoint(n.point)};this.abortUpdateMagnifier=()=>this.five.off("renderFrame",i),this.five.once("renderFrame",i),this.five.needsRender=!0});v(this,"abortUpdateMagnifier",()=>{});var r,s,o,a,l;this.five=n,this.magnifier=(t==null?void 0:t.magnifier)!==void 0?t.magnifier:new ah(n,(r=t==null?void 0:t.magnifierParams)!=null?r:{dragEnabled:!0});let i;(t==null?void 0:t.pointHelper)==="default"||(t==null?void 0:t.pointHelper)===void 0?i=new Ev(n):(t==null?void 0:t.pointHelper)==="highlight"?i=new tT(n):i=t.pointHelper,this.pointHelper=i,this.group.name="five-point-selector",this.five.scene.add(this.group),(l=this.magnifier)==null||l.appendTo((a=(o=t.container)!=null?o:(s=n.getElement())==null?void 0:s.parentElement)!=null?a:document.body)}enable(){var n;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&(this.group.add(this.pointHelper),this.pointHelper.show()),(n=this.magnifier)==null||n.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var n;this.state.enabled&&(this.state.enabled=!1,this.pointHelper&&(this.group.remove(this.pointHelper),this.pointHelper.hide()),(n=this.magnifier)==null||n.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null}}class hb extends P.Object3D{constructor(){super(...arguments);v(this,"children",[])}getRaycastIntersects(t){const i=[];return this.raycast(t,i),i}getRaycastIntersection(t){return this.getRaycastIntersects(t)[0]}}class ub extends ee.LineSegments{constructor(n,t){super(n,t)}}const Jp=new P.Vector3;class nT extends P.Sphere{expandByPoint(n){if(this.isEmpty())return this.center.copy(n),this.radius=0,this;Jp.subVectors(n,this.center);const t=Jp.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Jp,r/i),this.radius+=r}return this}}function iT(e){const{max:n,min:t}=e;return[new P.Vector3(n.x,n.y,n.z),new P.Vector3(t.x,n.y,n.z),new P.Vector3(t.x,t.y,n.z),new P.Vector3(n.x,t.y,n.z),new P.Vector3(n.x,n.y,t.z),new P.Vector3(t.x,n.y,t.z),new P.Vector3(t.x,t.y,t.z),new P.Vector3(n.x,t.y,t.z)]}function Tr(e,n){const{max:t,min:i}=e;switch(n){case 0:return new P.Vector3(t.x,t.y,t.z);case 1:return new P.Vector3(i.x,t.y,t.z);case 2:return new P.Vector3(i.x,i.y,t.z);case 3:return new P.Vector3(t.x,i.y,t.z);case 4:return new P.Vector3(t.x,t.y,i.z);case 5:return new P.Vector3(i.x,t.y,i.z);case 6:return new P.Vector3(i.x,i.y,i.z);case 7:return new P.Vector3(t.x,i.y,i.z)}}function va(e){return qp(e,"box3")}function db(e){return qp(e,"sphere")}function rT(e){return Fu(e,"box3")}function fb(e){return Fu(e,"sphere")}function Fu(e,n){const t=n==="box3"?new P.Box3:new nT,i=new P.Vector3;if(e.updateWorldMatrix(!1,!1),e.traverse(r=>{var o;if(r.name==="shadow"||r.type==="Line2")return;const s=r.geometry;if(r.updateWorldMatrix(!1,!1),s!==void 0){const a=(o=s==null?void 0:s.attributes)==null?void 0:o.position;if(a)for(let l=0,c=a.count;l<c;l++)i.fromBufferAttribute(a,l).applyMatrix4(r.matrixWorld),t.expandByPoint(i);else s.vertices&&s.vertices.forEach(l=>{const c=l.clone().applyMatrix4(r.matrixWorld);t.expandByPoint(c)})}}),!t.isEmpty())return t}function qp(e,n){const t=Fu(e,n);return t&&t.applyMatrix4(sT(e.matrixWorld.clone())),t}const sT=e=>{const n=e.elements,t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],h=n[8],u=n[9],d=n[10],f=n[11],m=n[12],p=n[13],g=n[14],y=n[15],b=u*g*c-p*d*c+p*l*f-a*g*f-u*l*y+a*d*y,A=m*d*c-h*g*c-m*l*f+o*g*f+h*l*y-o*d*y,w=h*p*c-m*u*c+m*a*f-o*p*f-h*a*y+o*u*y,x=m*u*l-h*p*l-m*a*d+o*p*d+h*a*g-o*u*g,M=t*b+i*A+r*w+s*x;if(M===0)return e.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/M;return n[0]=b*E,n[1]=(p*d*s-u*g*s-p*r*f+i*g*f+u*r*y-i*d*y)*E,n[2]=(a*g*s-p*l*s+p*r*c-i*g*c-a*r*y+i*l*y)*E,n[3]=(u*l*s-a*d*s-u*r*c+i*d*c+a*r*f-i*l*f)*E,n[4]=A*E,n[5]=(h*g*s-m*d*s+m*r*f-t*g*f-h*r*y+t*d*y)*E,n[6]=(m*l*s-o*g*s-m*r*c+t*g*c+o*r*y-t*l*y)*E,n[7]=(o*d*s-h*l*s+h*r*c-t*d*c-o*r*f+t*l*f)*E,n[8]=w*E,n[9]=(m*u*s-h*p*s-m*i*f+t*p*f+h*i*y-t*u*y)*E,n[10]=(o*p*s-m*a*s+m*i*c-t*p*c-o*i*y+t*a*y)*E,n[11]=(h*a*s-o*u*s-h*i*c+t*u*c+o*i*f-t*a*f)*E,n[12]=x*E,n[13]=(h*p*r-m*u*r+m*i*d-t*p*d-h*i*g+t*u*g)*E,n[14]=(m*a*r-o*p*r-m*i*l+t*p*l+o*i*g-t*a*g)*E,n[15]=(o*u*r-h*a*r+h*i*l-t*u*l-o*i*d+t*a*d)*E,e},Oi=new Map,mc=new Map;function oT(e){Ir(e).forEach(t=>{var i,r,s;Oi.has(t)||(t instanceof HTMLElement?Oi.set(t,{opacity:t.style.opacity===""?void 0:t.style.opacity,visible:{display:t.style.display,visibility:t.style.visibility}}):t.isObject3D&&(t.material?t.material instanceof P.ShaderMaterial?Oi.set(t,{opacity:(i=t.material.uniforms.opacity)==null?void 0:i.value,transparent:t.material.transparent,visible:t.visible}):Oi.set(t,{opacity:(r=t.material)==null?void 0:r.opacity,transparent:(s=t.material)==null?void 0:s.transparent,visible:t.visible}):Oi.set(t,{visible:t.visible})))})}function pb(e){Ir(e).forEach(t=>{const i=Oi.get(t);i&&(t instanceof HTMLElement&&(t.style.opacity=i.opacity===void 0?"":i.opacity,t.style.display=i.visible.display,t.style.visibility=i.visible.visibility),t.isObject3D&&(t.visible=i.visible,t.material&&(t.material instanceof P.ShaderMaterial?(t.material.uniforms.opacity&&(t.material.uniforms.opacity.value=i.opacity),t.material.transparent=i.transparent):(t.material.opacity=i.opacity,t.material.transparent=i.transparent))),Oi.delete(t))})}function Vu(e,n){var a;const t=(a=n==null?void 0:n.traverseTHREEObject)!=null?a:!0;let i=Ir(e);const r=[];i.forEach(l=>{l&&(l instanceof HTMLElement?r.push(l):l.isObject3D&&(t?(r.push(l),l.traverse(c=>{c&&r.push(c)})):r.push(l)))}),i=[...new Set(r.filter(Boolean))],oT(i);const s=Es(O({targets:i,duration:300,easing:"linear",direction:"alternate",loop:4,autoplay:!1,update:l=>{var c;l.animatables.forEach(h=>{var m;const u=h.target;if(!Oi.has(u))return;const f=Number((m=Oi.get(u).opacity)!=null?m:1)*(100-l.progress)/100;u instanceof HTMLElement?u.style.opacity=String(f):u.material&&(u.material instanceof P.ShaderMaterial?(u.material.uniforms.opacity&&(u.material.uniforms.opacity.value=f),u.material.transparent=!0):(u.material.opacity=f,u.material.transparent=!0))}),(c=n==null?void 0:n.updateRender)==null||c.call(n)}},n));s.preComplete=()=>{s!=null&&s.completed||(s==null||s.pause(),pb(i),setTimeout(()=>{var l;return(l=n==null?void 0:n.updateRender)==null?void 0:l.call(n)}))};const o=mc.get(e);return o==null||o.pause(),o==null||o.seek(0),mc.set(e,s),s.play(),s.finished.then(()=>{var l;pb(i),setTimeout(()=>{mc.get(e)===s&&mc.delete(e)},1e3),(l=n==null?void 0:n.updateRender)==null||l.call(n)}),s}function mb(e,n){return Vu(e,O({update:t=>{var i;t.animatables.forEach(r=>{const s=r.target;if(!Oi.has(s))return;const o=Oi.get(s),l=(Number(o==null?void 0:o.opacity)||Number(n==null?void 0:n.maxOpacity)||1)*(t.progress/100);s instanceof HTMLElement?(s.style.opacity=String(l),s.style.visibility="visible"):s.isObject3D&&(Ir(e).includes(s)&&(s.visible=!0),s.material&&(s.material instanceof P.ShaderMaterial?(s.material.uniforms.opacity&&(s.material.uniforms.opacity.value=l),s.material.transparent=!0):(s.material.opacity=l,s.material.transparent=!0)))}),(i=n==null?void 0:n.updateRender)==null||i.call(n)}},n))}const Kp=Math.PI*2;function aT(e){return(e%Kp+Kp)%Kp}function gc(e){return{longitude:aT(-Math.atan2(e.x,-e.z)),latitude:-Math.asin(e.y/1)}}function Dr(e){return!wt(e)}function wt(e){return e!=null}function lT(e,n,t){return te(this,null,function*(){var b,A,w;if(!n)return;const i=fb(n);if(!i)return;const r=new zu(e),s=(b=t==null?void 0:t.scale)!=null?b:1.4,o=i.center,a=e.camera.position.clone().sub(o).setY(0).normalize(),l=e.state.mode==="Mapview"?e.state.fov:60,h=Math.max(1.5,i.radius*s),u=h*(1/Math.tan(P.MathUtils.degToRad(l/2)));let d=0;const f=[],m=x=>{const M=P.MathUtils.degToRad(x);return a.clone().applyAxisAngle(new P.Vector3(0,1,0),M).clone().multiplyScalar(u).add(new P.Vector3(0,h,0)).add(o)};for(;d!==360;){let x=0;const M=m(d),E=z=>{const D=z.distanceTo(M),k=new P.Raycaster(z,M.clone().sub(z).normalize()),R=r.model.intersectRaycaster(k,void 0,!0)[0],G=R==null?void 0:R.distance;wt(G)?G>D&&(x+=1):x+=1},S=i.clampPoint(M,new P.Vector3);E(S);const T=new P.Vector3(o.x,M.y,o.z);if(E(T),f[x]=d,x===2)break;d+=30}const p=m((w=(A=f[2])!=null?A:f[1])!=null?w:0),g=p.distanceTo(o),y=gc(o.clone().sub(p).normalize());if(e.state.mode==="Mapview")return e.updateCamera(O({offset:o,distance:g},y),800);e.setState(O({mode:"Mapview",offset:o,distance:g},y)),yield e.ready()})}function gb(e,n,t){return te(this,null,function*(){var p,g;if(!n)return;const i=(p=t==null?void 0:t.distance)!=null?p:3,r=new zu(e),s=e.camera.position.clone().sub(n).setY(0).normalize(),o=e.state.mode==="Mapview"?e.state.fov:60,a=i,l=a*Math.cos(P.MathUtils.degToRad(o/2)),c=a*Math.sin(P.MathUtils.degToRad(o/2));let h=0;const u=[],d=y=>{const b=P.MathUtils.degToRad(y);return s.clone().applyAxisAngle(new P.Vector3(0,1,0),b).clone().multiplyScalar(l).add(new P.Vector3(0,c,0)).add(n)};for(;h!==360;){let y=0;const b=d(h);if((w=>{const x=w.distanceTo(b),M=new P.Raycaster(w,b.clone().sub(w).normalize()),E=r.model.intersectRaycaster(M,void 0,!0)[0],S=E==null?void 0:E.distance;wt(S)?S>x&&(y+=1):y+=1})(n),u[y]=h,y===1)break;h+=30}const f=d((g=u[1])!=null?g:0),m=gc(n.clone().sub(f).normalize());if(e.state.mode==="Mapview")return e.updateCamera(O({offset:n,distance:i},m),800);e.setState(O({mode:"Mapview",offset:n,distance:i},m)),yield e.ready()})}function cT(e){return e.model?e.work?e.model.loaded?e.model.name!==e.work.model.file?{result:!1,msg:"five.model.name 与 five.work.model.file 不一致"}:{result:!0,msg:""}:{result:!1,msg:"five.model 未加载完成"}:{result:!1,msg:"five 数据未加载"}:{result:!1,msg:"five.model 不存在"}}function vb(e){return/^https?:\/\/|^\/\//.test(e)||/^data:/.test(e)}function $p(e,n){return vb(n)?n:`${e}${n}`}class ya extends ih{constructor(){super(...arguments);v(this,"disposeMethods",[]);v(this,"animationFrameDisposer");v(this,"onDispose",t=>(this.disposeMethods.push(t),this));v(this,"play",()=>{var t;return this.start(0),(t=this.animationFrameDisposer)==null||t.call(this),this.animationFrameDisposer=Aa(i=>this.update(i)),this});v(this,"stop",()=>{var t;return super.stop(),(t=this.animationFrameDisposer)==null||t.call(this),this});v(this,"dispose",()=>{var t;this.stop(),(t=this.animationFrameDisposer)==null||t.call(this),this.disposeMethods.forEach(i=>i()),this.disposeMethods=[],Av(this)})}}function vc(e,n=Gi.Linear.None){const t=new ya({progress:0}).to({progress:1});return e!==void 0&&t.duration(e),n!==void 0&&t.easing(n),t}const ba=window.requestAnimationFrame||(e=>setTimeout(e,16)),hT=window.cancelAnimationFrame||clearTimeout;function yc(e,n=0){n<=0?ba(e):ba(()=>yc(e,n-1))}function uT(){return te(this,null,function*(){return new Promise(e=>{ba(()=>e())})})}function Aa(e,n=60){let t=-1,i=0,r=-1;const s=1e3/n;function o(a){r===-1&&(r=a),t=ba(o),!(a-i<s)&&(i=a,e==null||e(a-r))}return t=ba(o),function(){hT(t)}}function dT(){const e=Date.now();return new Promise(n=>{ba(()=>{n(Date.now()-e)})})}function Gu(e){return Object.prototype.toString.call(e)==="[object Object]"}function ju(e,n){return e===n?!0:typeof e!=typeof n?!1:!!(Number.isNaN(e)&&Number.isNaN(n))}function fT(e,n){const t=Object.getOwnPropertyNames(e),i=Object.getOwnPropertyNames(n);if(t.length!==i.length)return!1;for(let r=0,s=t.length;r<s;r++){const o=t[r];if(!ju(e[o],n[o]))return!1}return!0}function pT(e,n){if(e.length!==n.length)return!1;for(let t=0,i=e.length;t<i;t++)if(!ju(e[t],n[t]))return!1;return!0}function mT(e,n){return ju(e,n)?!0:Gu(e)&&Gu(n)?fT(e,n):Array.isArray(e)&&Array.isArray(n)?pT(e,n):!1}function em(e,n){return ju(e,n)?!0:Gu(e)&&Gu(n)?vT(e,n):Array.isArray(e)&&Array.isArray(n)?gT(e,n):!1}function gT(e,n){if(e.length!==n.length)return!1;for(let t=0,i=e.length;t<i;t++)if(!em(e[t],n[t]))return!1;return!0}function vT(e,n){const t=Object.getOwnPropertyNames(e),i=Object.getOwnPropertyNames(n);if(t.length!==i.length)return!1;for(let r=0,s=t.length;r<s;r++){const o=t[r];if(!em(e[o],n[o]))return!1}return!0}function Fn(e,n,t={deep:!1}){return t.deep?em(e,n):mT(e,n)}const yT=Object.freeze(Object.defineProperty({__proto__:null,BetterTween:ya,Interval:ef,LineSegments:ub,Magnifier:ah,Object3D:hb,PointHelper:Ev,PointSelectorHelper:cb,Rectangle:jC,absoluteUrl:$p,animeMap:mc,awaitNextFrame:uT,blink:Vu,bounding:qp,boundingBox:va,boundingSphere:db,boxVertex:Tr,boxVertexes:iT,checkFiveModelLoaded:cT,convexHull:HC,equal:Fn,getCoordsFromClient:QC,getCoordsFromElement:YC,getFrameTime:dT,inside:xv,isAbsoluteURL:vb,isModelLike:Mi,isNil:Dr,isPanoramaLike:Ss,lookObject:lT,lookPoint:gb,nextFrame:yc,notNil:wt,pointInPolygon:xv,reblink:mb,requestAnimationFrameInterval:Aa,tweenProgress:vc,uuid:wn,worldBounding:Fu,worldBoundingBox:rT,worldBoundingSphere:fb},Symbol.toStringTag,{value:"Module"})),yb=1,bb=`CSS3DObjectPlus@${yb}`,bT=.00216,AT=.003;class Ab extends Ut.CSS3DObject{constructor(t){var x,M,E,S,T;if(Dr(t.cornerPoints)&&Dr(t.width))throw new Error("cornerPoints and width cannot be both empty");const i=(x=t.container)!=null?x:document.createElement("div"),r=(M=t.cornerPoints)!=null?M:(()=>{const z=t.width/2;return[new ee.Vector3(-z,z,0),new ee.Vector3(-z,-z,0),new ee.Vector3(z,-z,0),new ee.Vector3(z,z,0)]})(),s=(E=t.ratio)!=null?E:AT,o=(S=t.dpr)!=null?S:1,a=(T=t.pointerEvents)!=null?T:"auto",l=Math.max(bT,s),c=r[0].distanceTo(r[1]),h=r[1].distanceTo(r[2]),u=sh(c/s*o),d=sh(h/s*o),f=Hi(...r);let m;if(l===s)i.style.width=`${u}px`,i.style.height=`${d}px`,m=i;else{const z=document.createElement("div");z.style.width=`${u}px`,z.style.height=`${d}px`,z.style.pointerEvents="none";const D=s/l;i.style.position="absolute",i.style.left="0",i.style.top="0",i.style.width=`${D*u}px`,i.style.height=`${D*d}px`,z.appendChild(i),m=z}super(m);v(this,"version",yb);v(this,"isCSS3DObjectPlus",!0);v(this,"isCSS3DObject",!0);v(this,"name",bb);v(this,"container");v(this,"width");v(this,"height");v(this,"domWidthPx");v(this,"domHeightPx");v(this,"cornerPoints");v(this,"centerPosition");v(this,"ratio");v(this,"mode","front");v(this,"hooks",new Pn);v(this,"opacityMesh");v(this,"selfVisible",!0);v(this,"setVisible",t=>{this.selfVisible=t,this.visible=$d(this.parent)&&this.selfVisible,this.opacityMesh&&(this.opacityMesh.visible=this.visible)});v(this,"updateVisible",()=>{this.setVisible(this.selfVisible)});v(this,"createOpacityMesh",t=>{const{domWidthPx:i,domHeightPx:r}=t,s=new GC(i,r);return s.position.copy(t.position),s.rotation.copy(t.rotation),s.scale.copy(t.scale),s});if(i.style.pointerEvents=a,Object.assign(i.style,t.style),this.scale.set(l,l,l),this.cornerPoints=r,this.ratio=s,this.container=i,t.mode&&(this.mode=t.mode),l===s)this.width=c,this.height=h,this.domWidthPx=u,this.domHeightPx=d,this.centerPosition=f;else{const z=s/l;this.width=z*c,this.height=z*h,this.domWidthPx=z*u,this.domHeightPx=z*d,this.centerPosition=new ee.Vector3().subVectors(f,r[0]).multiplyScalar(z).add(r[0])}i.classList.add(`${bb}__container`);const p=new ee.Vector3().subVectors(r[1],r[0]),g=new ee.Vector3().subVectors(r[3],r[0]),y=new ee.Vector3().crossVectors(p,g).normalize();this.lookAt(y);const b=this.up.clone().applyQuaternion(this.quaternion),A=g.clone(),w=new ee.Vector3().crossVectors(b,A).normalize();this.rotateOnWorldAxis(w,b.angleTo(A)),this.position.copy(f),this.addEventListener("added",()=>{var z;this.mode==="front"&&((z=this.opacityMesh)==null||z.removeFromParent())}),this.addEventListener("removed",()=>{var z;(z=this.opacityMesh)==null||z.removeFromParent()})}removeFromParent(){var i;const t=this.parent;return t!==null&&t.remove(this),(i=this.opacityMesh)==null||i.removeFromParent(),this}removeOpacityMesh(){var t;return(t=this.opacityMesh)==null||t.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var t;this.container.remove(),this.removeFromParent(),(t=this.opacityMesh)==null||t.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const t=this.createOpacityMesh(this);return this.opacityMesh=t,t}}applyMatrix4(t){var i;super.applyMatrix4(t),(i=this.opacityMesh)==null||i.applyMatrix4(t)}applyQuaternion(t){var i;return super.applyQuaternion(t),(i=this.opacityMesh)==null||i.applyQuaternion(t),this}applyScaleMatrix4(t){var i;this.scale.applyMatrix4(t),(i=this.opacityMesh)==null||i.scale.applyMatrix4(t)}}function wa(e){const n=[];return Ir(e).forEach(i=>{i.traverse(r=>{(r.isCSS3DObjectPlus||r.isCSS3DObject||r.isCSS3DSprite)&&n.push(r)})}),n}class wT extends P.Scene{constructor(){super()}add(...n){return super.add(...n),wa(n).forEach(t=>{t.mode="front"}),this}}class xT extends P.Scene{constructor(t){super();v(this,"scene");if(!t)throw new Error("CSS3DBehindScene: scene is required");this.scene=t}add(...t){return super.add(...t),wa(t).forEach(i=>{i.mode="behind",this.scene.add(i.getOpacityMesh())}),this}remove(...t){return wa(t).forEach(i=>{var r;(r=i.opacityMesh)==null||r.removeFromParent(),i.opacityMesh=null}),super.remove(...t),this}}class wb extends P.Group{constructor(t){super();v(this,"isCSS3DGroup",!0);v(this,"mode");v(this,"CSS3DObjectLength",0);this.mode=t}add(...t){return wa(t).forEach(i=>{i.mode=this.mode}),super.add(...t),this.updateLength(),this}setVisible(t){this.visible=t,this.traverse(i=>{i.isCSS3DObjectPlus&&i.updateVisible()})}remove(...t){return super.remove(...t),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=wa(this).length}}class MT extends wb{constructor(){super("front")}}class CT extends wb{constructor(t){super("behind");v(this,"scene");if(!t)throw new Error("CSS3DBehindScene: scene is required");this.scene=t}add(...t){return wa(t).forEach(i=>{this.scene.add(i.getOpacityMesh())}),super.add(...t),this}}const PT=3,tm="CSS3DRenderer",bc=`${tm}@${PT}`,xa=()=>{console.error(`${bc} is disposed`)},yn={css3DObjects:[],frontModeStore:{css3DRenderer:new Kd},behindModeStore:{css3DRenderer:new Kd}};function xb(e){return yn.css3DObjects.find(n=>n.id===e)}function ET(e){yn.frontModeStore.css3DRenderer.setWrapper(e)}function _T(e){yn.behindModeStore.css3DRenderer.setWrapper(e)}class Ma{constructor(n){v(this,"hooks",new Pn);v(this,"state",{enabled:!0,visible:!0,disposed:!1});v(this,"_scene");v(this,"store",{frontModeGroup:new MT});v(this,"create3DElement",(n,t,i)=>{if(this.state.disposed)return xa();const r=(()=>{const x={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none",wrapperStyle:{}};return Object.assign(x,i)})(),s=t.map(Ft);if((s==null?void 0:s.length)<4)return console.error(`${bc}: requires 4 point but params may have fewer`);const{ratio:o,devicePixelRatio:a,mode:l,autoRender:c,container:h,pointerEvents:u,wrapperStyle:d}=r;let f=!1;const m=this.createObject(s,{ratio:o,dpr:a,container:h,mode:l,pointerEvents:u,wrapperStyle:d});yn.css3DObjects.push(m),r.scene&&this.setScene(r.scene);const p=()=>{if(f)return;const x=m.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();x&&x.add(m)},g=()=>{f||(p(),this.render(n),this.hooks.emit("render"))},y=x=>this.setVisibleById(m.id,x),b=x=>this.setEnabledById(m.id,x),A=()=>(f=!0,m.removeFromParent(),!0),w=l==="front"?yn.frontModeStore.css3DRenderer:yn.behindModeStore.css3DRenderer;return c&&g(),{id:m.uuid,container:h,css3DObject:m,render:c?void 0:g,show:()=>y(!0),hide:()=>y(!1),setVisible:y,enable:()=>b(!0),disable:()=>b(!1),setEnabled:b,dispose:A,appendToElement:x=>w.setWrapper(x)}});v(this,"setVisibleById",(n,t)=>{var i;(i=xb(n))==null||i.setVisible(t)});v(this,"setEnabledById",(n,t)=>{const i=xb(n);if(!i)return;const r=i.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});r&&(t?r.add(i):r.remove(i))});v(this,"createObject",(n,t)=>{const i=new Ab(Pe(O({cornerPoints:n},t),{style:t.wrapperStyle}));return i.element.classList.add(`${tm}__container`),i.element.id=`${tm}__container--${i.uuid}`,i});n&&this.setScene(n)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return yn.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return yn.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return yn.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return yn.behindModeStore.css3DRenderer}setScene(n){this._scene=n}getCurrentState(){return this.state}setState(n,t={userAction:!0}){if(this.state.disposed)return xa();const i=O({},this.state);this.state=Object.assign(this.state,n),i.visible!==this.state.visible&&(n.visible?this.handleShow():this.handleHide()),i.enabled!==this.state.enabled&&(n.enabled?this.handleEnable():this.handleDisable()),i.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:i,userAction:t.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return te(this,arguments,function*({userAction:n}={userAction:!0}){if(this.state.disposed)return xa();this.setState({visible:!0},{userAction:n}),this.hooks.emit("show",{userAction:n})})}hide(){return te(this,arguments,function*({userAction:n}={userAction:!0}){if(this.state.disposed)return xa();this.setState({visible:!1},{userAction:n}),this.hooks.emit("hide",{userAction:n})})}enable({userAction:n}={userAction:!0}){if(this.state.disposed)return xa();this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable({userAction:n}={userAction:!0}){if(this.state.disposed)return xa();this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}getFrontCSS3DScene({createSceneIfNotExists:n=!1}={}){var i;const t=(i=yn.frontModeStore)==null?void 0:i.css3DScene;if(t)return t;if(n){const r=new wT;yn.frontModeStore.css3DScene=r}return yn.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:n=!1}={}){var i,r;const t=(i=yn.behindModeStore)==null?void 0:i.css3DScene;if(t)return t;if(n){const s=(r=yn.behindModeStore.scene)!=null?r:this.scene;if(!s){console.error(`${bc}: scene is required when mode is behind`);return}const o=new xT(s);yn.behindModeStore.css3DScene=o,yn.behindModeStore.scene=s}return yn.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:n=!0}={}){const t=this.getFrontCSS3DScene({createSceneIfNotExists:n});return n&&t&&(t.getObjectById(this.store.frontModeGroup.id)||t.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:n=!0}={}){var i;const t=this.getBehindCSS3DScene({createSceneIfNotExists:n});if(n&&t&&this.scene){const r=(i=this.store.behindModeGroup)!=null?i:new CT(this.scene);this.store.behindModeGroup=r,t.getObjectById(r.id)||t.add(r)}return this.store.behindModeGroup}render(n){var t,i;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const r=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!r)return console.error(`${bc}: css3DScene is required when mode is front`);yn.frontModeStore.css3DRenderer.renderEveryFrame(r,n)}if(((i=(t=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:t.CSS3DObjectLength)!=null?i:0)>0){const r=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!r)return console.error(`${bc}: css3DScene is required when mode is behind`);yn.behindModeStore.css3DRenderer.renderEveryFrame(r,n)}}handleShow(){return te(this,null,function*(){var n;this.store.frontModeGroup.setVisible(!0),(n=this.store.behindModeGroup)==null||n.setVisible(!0)})}handleHide(){return te(this,null,function*(){var n;this.store.frontModeGroup.setVisible(!1),(n=this.store.behindModeGroup)==null||n.setVisible(!1)})}handleEnable(){var n,t;(n=this.getFrontCSS3DScene())==null||n.add(this.store.frontModeGroup),this.store.behindModeGroup&&((t=this.getBehindCSS3DScene())==null||t.add(this.store.behindModeGroup))}handleDisable(){var n,t,i;this.store.frontModeGroup.children.forEach(r=>{r instanceof Ut.CSS3DObject&&r.element instanceof Element&&r.element.parentNode!==null&&r.element.remove()}),(n=this.store.behindModeGroup)==null||n.children.forEach(r=>{r instanceof Ut.CSS3DObject&&r.element instanceof Element&&r.element.parentNode!==null&&r.element.remove()}),(t=this.getFrontCSS3DScene())==null||t.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((i=this.getBehindCSS3DScene())==null||i.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}v(Ma,"setFrontModeContainer",ET),v(Ma,"setBehindModeContainer",_T);const Ri=document.createElement("div");Ri.classList.add("behindFiveElement"),Ri.style.position="absolute",Ri.style.top="0",Ri.style.left="0",Ri.style.width="100%",Ri.style.height="100%",Ri.style.pointerEvents="none";function Mb(e){var i,r,s,o,a;const n=(a=(r=nm(e.getElement()))!=null?r:nm((i=e.getElement())==null?void 0:i.parentElement))!=null?a:nm((o=(s=e.getElement())==null?void 0:s.parentElement)==null?void 0:o.parentElement),t=n==null?void 0:n.parentElement;if(t)return t.contains(Ri)||n.parentElement.insertBefore(Ri,n),Ri;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/tree/main/plugins/src/CSS3DRenderPlugin/README.md")}function nm(e){var a;if(!e)return;const n=(a=e.style.position)!=null?a:getComputedStyle(e).position;if(n!=="fixed"&&n!=="absolute"&&n!=="relative")return;const t=getComputedStyle(e),i=t.backgroundColor,r=t.backgroundImage;if(!(i!=="transparent"&&i!=="rgba(0, 0, 0, 0)"&&i!==""||r!=="none"&&r!==""))return e}function Ca(e){return te(this,null,function*(){return new Promise(n=>{if(ST(e))n();else{const t=i=>{const r=Li(e);i===r&&(e.off("modelLoaded",t),n())};e.on("modelLoaded",t)}})})}function ST(e){var n;return(n=Li(e))==null?void 0:n.loaded}const Cb="v2.0.1",Pb=`CSS3DRenderPlugin@${Cb}`;let IT=class extends Ma{constructor(t){super();v(this,"five");v(this,"behindFiveContainer");v(this,"frontFiveContainer");v(this,"VERSION",Cb);v(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");v(this,"created3DElementResults",[]);v(this,"create3DDomContainer",(t,i)=>{if(this.state.disposed)return;const r=(()=>{var u;(i==null?void 0:i.dpr)!==void 0&&console.warn(`${Pb}: please use "config.devicePixelRatio" replace "config.dpr"`);const h={ratio:.00216,devicePixelRatio:(u=i==null?void 0:i.dpr)!=null?u:1,mode:"front",autoRender:!0,wrapperStyle:{}};return Object.assign(h,i,(i==null?void 0:i.mode)==="behind"?{scene:this.five.scene}:void 0)})(),{autoRender:s}=r;r.mode==="behind"&&r.behindFiveContainer&&(this.behindFiveContainer=r.behindFiveContainer);const o=this.create3DElement(this.five.camera,t,Pe(O({},r),{autoRender:!1}));if(!o)return;const a=o.dispose;o.dispose=()=>(this.created3DElementResults.includes(o)&&this.created3DElementResults.splice(this.created3DElementResults.indexOf(o),1),a());const l=()=>{var u,d;const h=o.css3DObject.mode==="front"?(d=this.frontFiveContainer)!=null?d:(u=this.five.getElement())==null?void 0:u.parentElement:this.getBehindFiveElement();if(!h)return console.error(`${Pb}: wrapper is ${h}; mode is ${o.css3DObject.mode}`);o.appendToElement(h),o.render(),this.created3DElementResults.push(o)},c=()=>{o.css3DObject.mode==="front"&&l(),o.css3DObject.mode==="behind"&&Ca(this.five).then(()=>l())};return s&&c(),Pe(O({},o),{render:s?void 0:c})});this.five=t}disposeAll(){return this.dispose()}setState(...t){const i=super.setState(...t);return this.five.needsRender=!0,i}appendToFrontFiveContainer(t){this.frontFiveContainer=t,this.created3DElementResults.forEach(i=>{i.css3DObject.mode==="front"&&i.appendToElement(t)})}appendToBehindFiveContainer(t){this.behindFiveContainer=t,this.created3DElementResults.forEach(i=>{i.css3DObject.mode==="behind"&&i.appendToElement(t)})}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=Mb(this.five),this.behindFiveContainer)}absoluteUrl(t){return $p(this.staticPrefix,t)}clear(){this.created3DElementResults.forEach(t=>{t.dispose()}),this.created3DElementResults=[]}};const Ac=e=>new IT(e);function im(e,n,t=new ee.Vector3(1,1,1),i=!1){const r=new Sv(e,n);return r.setMaterial({dashed:i,color:t,linewidth:1}),r.remove(r.points),r}const TT=e=>{const n={intersection:null,disposers:[]},t=h=>{n.intersection=h},i=()=>{n.intersection=null};e.on("modelLoaded",()=>{e.on("intersectionOnModelUpdate",t),e.on("intersectionHidden",i)}),e.on("dispose",()=>{e.off("intersectionOnModelUpdate",t),e.off("intersectionHidden",i)});const r=(h,u=2,d=.1)=>{const f=u/2,p=c(h,d),g=new ee.Group;g.add(im(new ee.Vector3(p.x+f,p.y,p.z),new ee.Vector3(p.x-f,p.y,p.z),new ee.Vector3(1,0,0)),im(new ee.Vector3(p.x,p.y+f,p.z),new ee.Vector3(p.x,p.y-f,p.z),new ee.Vector3(0,1,0)),im(new ee.Vector3(p.x,p.y,p.z+f),new ee.Vector3(p.x,p.y,p.z-f),new ee.Vector3(0,0,1))),e.scene.add(g),e.needsRender=!0;const y=()=>{e.scene.remove(g)};return n.disposers.push(y),{clear:y,pointAxesHelperMesh:g}},s=(h,u=0)=>{var y,b;const d=(y=e==null?void 0:e.camera)==null?void 0:y.position;if(!d)return!1;const f=h.distanceTo(d),m=h.sub(d).normalize(),p=new ee.Raycaster(d,m),g=(b=e.model.intersectRaycaster(p))==null?void 0:b[0];return!(g&&g.distance+u<f)},o=()=>n.intersection,a=()=>{var h,u;(u=(h=n.disposers)==null?void 0:h.forEach)==null||u.call(h,d=>d==null?void 0:d()),e.off("intersectionOnModelUpdate",t),e.off("intersectionHidden",i)},l=a,c=(h,u)=>{const d=h.clone();return e.camera.position.clone().sub(d).setLength(u).add(d)};return{intersection:o,pointAxesHelper:r,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function de(){}const Lr=e=>e;function Ln(e,n){for(const t in n)e[t]=n[t];return e}function DT(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Eb(e){return e()}function _b(){return Object.create(null)}function bn(e){e.forEach(Eb)}function nr(e){return typeof e=="function"}function Le(e,n){return e!=e?n==n:e!==n||e&&typeof e=="object"||typeof e=="function"}let Hu;function Sn(e,n){return Hu||(Hu=document.createElement("a")),Hu.href=n,e===Hu.href}function LT(e){return Object.keys(e).length===0}function Pa(e,n,t,i){if(e){const r=Sb(e,n,t,i);return e[0](r)}}function Sb(e,n,t,i){return e[1]&&i?Ln(t.ctx.slice(),e[1](i(n))):t.ctx}function Ea(e,n,t,i){if(e[2]&&i){const r=e[2](i(t));if(n.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(n.dirty.length,r.length);for(let a=0;a<o;a+=1)s[a]=n.dirty[a]|r[a];return s}return n.dirty|r}return n.dirty}function _a(e,n,t,i,r,s){if(r){const o=Sb(n,t,i,s);e.p(o,r)}}function Sa(e){if(e.ctx.length>32){const n=[],t=e.ctx.length/32;for(let i=0;i<t;i++)n[i]=-1;return n}return-1}function an(e){return e==null?"":e}function zi(e){return e&&nr(e.destroy)?e.destroy:de}function Ib(e){const n=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return n?[parseFloat(n[1]),n[2]||"px"]:[e,"px"]}const Tb=typeof window!="undefined";let rm=Tb?()=>window.performance.now():()=>Date.now(),sm=Tb?e=>requestAnimationFrame(e):de;const Ia=new Set;function Db(e){Ia.forEach(n=>{n.c(e)||(Ia.delete(n),n.f())}),Ia.size!==0&&sm(Db)}function om(e){let n;return Ia.size===0&&sm(Db),{promise:new Promise(t=>{Ia.add(n={c:e,f:t})}),abort(){Ia.delete(n)}}}function Q(e,n){e.appendChild(n)}function Ue(e,n,t){const i=am(e);if(!i.getElementById(n)){const r=H("style");r.id=n,r.textContent=t,Lb(i,r)}}function am(e){if(!e)return document;const n=e.getRootNode?e.getRootNode():e.ownerDocument;return n&&n.host?n:e.ownerDocument}function kT(e){const n=H("style");return Lb(am(e),n),n.sheet}function Lb(e,n){return Q(e.head||e,n),n.sheet}function X(e,n,t){e.insertBefore(n,t||null)}function Y(e){e.parentNode&&e.parentNode.removeChild(e)}function Bi(e,n){for(let t=0;t<e.length;t+=1)e[t]&&e[t].d(n)}function H(e){return document.createElement(e)}function zt(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Mt(e){return document.createTextNode(e)}function ye(){return Mt(" ")}function pt(){return Mt("")}function lt(e,n,t,i){return e.addEventListener(n,t,i),()=>e.removeEventListener(n,t,i)}function OT(e){return function(n){return n.stopPropagation(),e.call(this,n)}}function _(e,n,t){t==null?e.removeAttribute(n):e.getAttribute(n)!==t&&e.setAttribute(n,t)}function RT(e){return Array.from(e.childNodes)}function Pt(e,n){n=""+n,e.data!==n&&(e.data=n)}function W(e,n,t,i){t===null?e.style.removeProperty(n):e.style.setProperty(n,t,i?"important":"")}let Uu;function zT(){if(Uu===void 0){Uu=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(e){Uu=!0}}return Uu}function lm(e,n){getComputedStyle(e).position==="static"&&(e.style.position="relative");const i=H("iframe");i.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),i.setAttribute("aria-hidden","true"),i.tabIndex=-1;const r=zT();let s;return r?(i.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=lt(window,"message",o=>{o.source===i.contentWindow&&n()})):(i.src="about:blank",i.onload=()=>{s=lt(i.contentWindow,"resize",n),n()}),Q(e,i),()=>{(r||s&&i.contentWindow)&&s(),Y(i)}}function Ee(e,n,t){e.classList[t?"add":"remove"](n)}function kb(e,n,{bubbles:t=!1,cancelable:i=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t,i,n),r}class Wu{constructor(n=!1){this.is_svg=!1,this.is_svg=n,this.e=this.n=null}c(n){this.h(n)}m(n,t,i=null){this.e||(this.is_svg?this.e=zt(t.nodeName):this.e=H(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(n)),this.i(i)}h(n){this.e.innerHTML=n,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(n){for(let t=0;t<this.n.length;t+=1)X(this.t,this.n[t],n)}p(n){this.d(),this.h(n),this.i(this.a)}d(){this.n.forEach(Y)}}const Qu=new Map;let Yu=0;function BT(e){let n=5381,t=e.length;for(;t--;)n=(n<<5)-n^e.charCodeAt(t);return n>>>0}function NT(e,n){const t={stylesheet:kT(n),rules:{}};return Qu.set(e,t),t}function Xu(e,n,t,i,r,s,o,a=0){const l=16.666/i;let c=`{
|
|
3157
|
+
`;function Z3(){const n=new P.CircleGeometry(.2,64),t=new P.ShaderMaterial({uniforms:{borderWidth:{value:.01},radius:{value:.2}},vertexShader:Y3,fragmentShader:X3,depthTest:!1,transparent:!0,blending:P.CustomBlending,blendEquation:P.AddEquation,blendSrc:P.DstColorFactor,blendDst:P.SrcAlphaFactor,blendDstAlpha:P.DstAlphaFactor});return new P.Mesh(n,t)}function J3(){const n=new P.Group,t={lineWidth:1,lineColor:3407837,opacity:.7,occlusionVisibility:!0},i=new ki(Pe(O({points:[{x:-.5},{x:.5}]},t),{lineColor:3407837})),r=new ki(Pe(O({points:[{y:-.5},{y:.5}]},t),{lineColor:3407837}));return n.add(i,r),n}function q3(e){const n=new P.CurvePath;n.add(new P.LineCurve3(new P.Vector3(0,0,0),new P.Vector3(0,0,e)));const t=new P.TubeGeometry(n,32,.003),i=new P.MeshBasicMaterial({color:10994687,depthTest:!1,transparent:!0});return new P.Mesh(t,i)}function K3(){const e=new P.RingGeometry(.03,.035,64),n=new P.MeshBasicMaterial({color:16777215,depthTest:!1,transparent:!0});return new P.Mesh(e,n)}function $3(){const e=new P.SphereGeometry(.018,32,32),n=new P.MeshBasicMaterial({color:5085183,depthTest:!1,transparent:!0});return new P.Mesh(e,n)}function eT(){const e=document.createElement("img");e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAVCAMAAAB8FU7dAAAAw1BMVEUAAACDuuiAsu11q/x8r/+HxtKHxtKIx9J4ut6Hx9Jcn/uNwNlmmf+RuP9ppf9orel3ud2HxtJrpf9oremev/9ppP9orelQmP9ZoPWSuP92q/9cnv9prel4ut53qv9orelYoPWIxdJPmP+HxtGRuP9oo/+Suf9Qmf92q/+RuP+DsP9Pmv+FxdFtre2SyMiRuP9PmP+evv9ppf9cnv+rxf9orepZofV4ut52q/+Dsf+Esv+5y/93q/9aofbF0f93rP9qpf8IzZ1iAAAAL3RSTlMAEg4s3dK5nodgVQoF/Pf39vbt7evr39rV1NTOzs6srJ+fiIZ9fWlpW09ERCwcHMH8LhIAAADRSURBVBjTjdDHkoMwEIThBrzOm3POOQwSYCRhe/f9n2p75FD2zX/VXL5qOAjzkixLsFL6fOFF5PwpXUj/eEwx7Oh9Jq+FdV5MqZkXlU9K4KZsmqY02x/A8LSwv14o0ylJWkP087WVhDfcjmjj5b/E3+CEpDPdGY58C7tKfzSiiA9uB4dV/NIF7yVQ7AGuq0lOIzrvnLP2Et2aMzUqryge8FVX0Zjl5XkG3KsR593pM2zVEScjvbMU7IdGjF19IzZ43Ceyve4Ai5Jep93u9BJs3j/gXjHbRgy31AAAAABJRU5ErkJggg==";const n=new Q3(e);return e.style.pointerEvents="none",n.scale.set(.003,.003,.003),n}class tT extends P.Object3D{constructor(t){super();v(this,"planeMesh");v(this,"ringMesh");v(this,"crossline");v(this,"lineMesh");v(this,"ballMesh");v(this,"cssBallMesh");const i=.18;this.planeMesh=Z3(),this.ringMesh=K3(),this.crossline=J3(),this.lineMesh=q3(i),this.ballMesh=$3(),this.cssBallMesh=eT(),this.ballMesh.position.setZ(i),this.cssBallMesh.position.setZ(i),this.planeMesh.renderOrder=0,this.ringMesh.renderOrder=1,this.crossline.renderOrder=2,this.lineMesh.renderOrder=3,this.ballMesh.renderOrder=4,this.add(this.planeMesh,this.crossline,this.lineMesh,this.ballMesh,this.ringMesh,this.cssBallMesh),Pv(t)}updateWithIntersect(t){if(!t.face)return;const i=(()=>{const s=t.face.normal.clone().normalize();return s.y>.99?new P.Vector3(0,1,0):s.y<-.99?new P.Vector3(0,-1,0):s.x>.99?new P.Vector3(1,0,0):s.x<-.99?new P.Vector3(-1,0,0):s.z>.99?new P.Vector3(0,0,1):s.z<-.99?new P.Vector3(0,0,-1):s.y<.01&&s.y>-.01?new P.Vector3(s.x,0,s.z):s})(),r=new P.Vector3().addVectors(t.point,i);this.position.copy(t.point),this.lookAt(r)}show(){this.visible=!0,this.add(this.cssBallMesh)}hide(){this.visible=!1,this.remove(this.cssBallMesh)}dispose(){}}class cb{constructor(n,t){v(this,"five");v(this,"hooks",new Pn);v(this,"position");v(this,"magnifier",null);v(this,"pointHelper",null);v(this,"state",{enabled:!1,visible:!0});v(this,"group",new P.Group);v(this,"show",()=>{var n,t;this.state.visible||(this.state.visible=!0,(n=this.pointHelper)==null||n.show(),(t=this.magnifier)==null||t.enable(),this.five.needsRender=!0)});v(this,"hide",()=>{var n,t;this.state.visible&&(this.state.visible=!1,(n=this.pointHelper)==null||n.hide(),(t=this.magnifier)==null||t.disable(),this.five.needsRender=!0)});v(this,"updateWithIntersect",(n,t={emitEvent:!0})=>{var r;if(!n)return;this.abortUpdateMagnifier(),this.position=n,t.emitEvent&&this.hooks.emit("intersectionUpdate",n),(r=this.pointHelper)==null||r.updateWithIntersect(n);const i=()=>{var s;return(s=this.magnifier)==null?void 0:s.renderWithPoint(n.point)};this.abortUpdateMagnifier=()=>this.five.off("renderFrame",i),this.five.once("renderFrame",i),this.five.needsRender=!0});v(this,"abortUpdateMagnifier",()=>{});var r,s,o,a,l;this.five=n,this.magnifier=(t==null?void 0:t.magnifier)!==void 0?t.magnifier:new ah(n,(r=t==null?void 0:t.magnifierParams)!=null?r:{dragEnabled:!0});let i;(t==null?void 0:t.pointHelper)==="default"||(t==null?void 0:t.pointHelper)===void 0?i=new Ev(n):(t==null?void 0:t.pointHelper)==="highlight"?i=new tT(n):i=t.pointHelper,this.pointHelper=i,this.group.name="five-point-selector",this.five.scene.add(this.group),(l=this.magnifier)==null||l.appendTo((a=(o=t.container)!=null?o:(s=n.getElement())==null?void 0:s.parentElement)!=null?a:document.body)}enable(){var n;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(n=this.magnifier)==null||n.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var n;this.state.enabled&&(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(n=this.magnifier)==null||n.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null}}class hb extends P.Object3D{constructor(){super(...arguments);v(this,"children",[])}getRaycastIntersects(t){const i=[];return this.raycast(t,i),i}getRaycastIntersection(t){return this.getRaycastIntersects(t)[0]}}class ub extends ee.LineSegments{constructor(n,t){super(n,t)}}const Jp=new P.Vector3;class nT extends P.Sphere{expandByPoint(n){if(this.isEmpty())return this.center.copy(n),this.radius=0,this;Jp.subVectors(n,this.center);const t=Jp.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Jp,r/i),this.radius+=r}return this}}function iT(e){const{max:n,min:t}=e;return[new P.Vector3(n.x,n.y,n.z),new P.Vector3(t.x,n.y,n.z),new P.Vector3(t.x,t.y,n.z),new P.Vector3(n.x,t.y,n.z),new P.Vector3(n.x,n.y,t.z),new P.Vector3(t.x,n.y,t.z),new P.Vector3(t.x,t.y,t.z),new P.Vector3(n.x,t.y,t.z)]}function Tr(e,n){const{max:t,min:i}=e;switch(n){case 0:return new P.Vector3(t.x,t.y,t.z);case 1:return new P.Vector3(i.x,t.y,t.z);case 2:return new P.Vector3(i.x,i.y,t.z);case 3:return new P.Vector3(t.x,i.y,t.z);case 4:return new P.Vector3(t.x,t.y,i.z);case 5:return new P.Vector3(i.x,t.y,i.z);case 6:return new P.Vector3(i.x,i.y,i.z);case 7:return new P.Vector3(t.x,i.y,i.z)}}function va(e){return qp(e,"box3")}function db(e){return qp(e,"sphere")}function rT(e){return Fu(e,"box3")}function fb(e){return Fu(e,"sphere")}function Fu(e,n){const t=n==="box3"?new P.Box3:new nT,i=new P.Vector3;if(e.updateWorldMatrix(!1,!1),e.traverse(r=>{var o;if(r.name==="shadow"||r.type==="Line2")return;const s=r.geometry;if(r.updateWorldMatrix(!1,!1),s!==void 0){const a=(o=s==null?void 0:s.attributes)==null?void 0:o.position;if(a)for(let l=0,c=a.count;l<c;l++)i.fromBufferAttribute(a,l).applyMatrix4(r.matrixWorld),t.expandByPoint(i);else s.vertices&&s.vertices.forEach(l=>{const c=l.clone().applyMatrix4(r.matrixWorld);t.expandByPoint(c)})}}),!t.isEmpty())return t}function qp(e,n){const t=Fu(e,n);return t&&t.applyMatrix4(sT(e.matrixWorld.clone())),t}const sT=e=>{const n=e.elements,t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],h=n[8],u=n[9],d=n[10],f=n[11],m=n[12],p=n[13],g=n[14],y=n[15],b=u*g*c-p*d*c+p*l*f-a*g*f-u*l*y+a*d*y,A=m*d*c-h*g*c-m*l*f+o*g*f+h*l*y-o*d*y,w=h*p*c-m*u*c+m*a*f-o*p*f-h*a*y+o*u*y,x=m*u*l-h*p*l-m*a*d+o*p*d+h*a*g-o*u*g,M=t*b+i*A+r*w+s*x;if(M===0)return e.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/M;return n[0]=b*E,n[1]=(p*d*s-u*g*s-p*r*f+i*g*f+u*r*y-i*d*y)*E,n[2]=(a*g*s-p*l*s+p*r*c-i*g*c-a*r*y+i*l*y)*E,n[3]=(u*l*s-a*d*s-u*r*c+i*d*c+a*r*f-i*l*f)*E,n[4]=A*E,n[5]=(h*g*s-m*d*s+m*r*f-t*g*f-h*r*y+t*d*y)*E,n[6]=(m*l*s-o*g*s-m*r*c+t*g*c+o*r*y-t*l*y)*E,n[7]=(o*d*s-h*l*s+h*r*c-t*d*c-o*r*f+t*l*f)*E,n[8]=w*E,n[9]=(m*u*s-h*p*s-m*i*f+t*p*f+h*i*y-t*u*y)*E,n[10]=(o*p*s-m*a*s+m*i*c-t*p*c-o*i*y+t*a*y)*E,n[11]=(h*a*s-o*u*s-h*i*c+t*u*c+o*i*f-t*a*f)*E,n[12]=x*E,n[13]=(h*p*r-m*u*r+m*i*d-t*p*d-h*i*g+t*u*g)*E,n[14]=(m*a*r-o*p*r-m*i*l+t*p*l+o*i*g-t*a*g)*E,n[15]=(o*u*r-h*a*r+h*i*l-t*u*l-o*i*d+t*a*d)*E,e},Oi=new Map,mc=new Map;function oT(e){Ir(e).forEach(t=>{var i,r,s;Oi.has(t)||(t instanceof HTMLElement?Oi.set(t,{opacity:t.style.opacity===""?void 0:t.style.opacity,visible:{display:t.style.display,visibility:t.style.visibility}}):t.isObject3D&&(t.material?t.material instanceof P.ShaderMaterial?Oi.set(t,{opacity:(i=t.material.uniforms.opacity)==null?void 0:i.value,transparent:t.material.transparent,visible:t.visible}):Oi.set(t,{opacity:(r=t.material)==null?void 0:r.opacity,transparent:(s=t.material)==null?void 0:s.transparent,visible:t.visible}):Oi.set(t,{visible:t.visible})))})}function pb(e){Ir(e).forEach(t=>{const i=Oi.get(t);i&&(t instanceof HTMLElement&&(t.style.opacity=i.opacity===void 0?"":i.opacity,t.style.display=i.visible.display,t.style.visibility=i.visible.visibility),t.isObject3D&&(t.visible=i.visible,t.material&&(t.material instanceof P.ShaderMaterial?(t.material.uniforms.opacity&&(t.material.uniforms.opacity.value=i.opacity),t.material.transparent=i.transparent):(t.material.opacity=i.opacity,t.material.transparent=i.transparent))),Oi.delete(t))})}function Vu(e,n){var a;const t=(a=n==null?void 0:n.traverseTHREEObject)!=null?a:!0;let i=Ir(e);const r=[];i.forEach(l=>{l&&(l instanceof HTMLElement?r.push(l):l.isObject3D&&(t?(r.push(l),l.traverse(c=>{c&&r.push(c)})):r.push(l)))}),i=[...new Set(r.filter(Boolean))],oT(i);const s=Es(O({targets:i,duration:300,easing:"linear",direction:"alternate",loop:4,autoplay:!1,update:l=>{var c;l.animatables.forEach(h=>{var m;const u=h.target;if(!Oi.has(u))return;const f=Number((m=Oi.get(u).opacity)!=null?m:1)*(100-l.progress)/100;u instanceof HTMLElement?u.style.opacity=String(f):u.material&&(u.material instanceof P.ShaderMaterial?(u.material.uniforms.opacity&&(u.material.uniforms.opacity.value=f),u.material.transparent=!0):(u.material.opacity=f,u.material.transparent=!0))}),(c=n==null?void 0:n.updateRender)==null||c.call(n)}},n));s.preComplete=()=>{s!=null&&s.completed||(s==null||s.pause(),pb(i),setTimeout(()=>{var l;return(l=n==null?void 0:n.updateRender)==null?void 0:l.call(n)}))};const o=mc.get(e);return o==null||o.pause(),o==null||o.seek(0),mc.set(e,s),s.play(),s.finished.then(()=>{var l;pb(i),setTimeout(()=>{mc.get(e)===s&&mc.delete(e)},1e3),(l=n==null?void 0:n.updateRender)==null||l.call(n)}),s}function mb(e,n){return Vu(e,O({update:t=>{var i;t.animatables.forEach(r=>{const s=r.target;if(!Oi.has(s))return;const o=Oi.get(s),l=(Number(o==null?void 0:o.opacity)||Number(n==null?void 0:n.maxOpacity)||1)*(t.progress/100);s instanceof HTMLElement?(s.style.opacity=String(l),s.style.visibility="visible"):s.isObject3D&&(Ir(e).includes(s)&&(s.visible=!0),s.material&&(s.material instanceof P.ShaderMaterial?(s.material.uniforms.opacity&&(s.material.uniforms.opacity.value=l),s.material.transparent=!0):(s.material.opacity=l,s.material.transparent=!0)))}),(i=n==null?void 0:n.updateRender)==null||i.call(n)}},n))}const Kp=Math.PI*2;function aT(e){return(e%Kp+Kp)%Kp}function gc(e){return{longitude:aT(-Math.atan2(e.x,-e.z)),latitude:-Math.asin(e.y/1)}}function Dr(e){return!wt(e)}function wt(e){return e!=null}function lT(e,n,t){return te(this,null,function*(){var b,A,w;if(!n)return;const i=fb(n);if(!i)return;const r=new zu(e),s=(b=t==null?void 0:t.scale)!=null?b:1.4,o=i.center,a=e.camera.position.clone().sub(o).setY(0).normalize(),l=e.state.mode==="Mapview"?e.state.fov:60,h=Math.max(1.5,i.radius*s),u=h*(1/Math.tan(P.MathUtils.degToRad(l/2)));let d=0;const f=[],m=x=>{const M=P.MathUtils.degToRad(x);return a.clone().applyAxisAngle(new P.Vector3(0,1,0),M).clone().multiplyScalar(u).add(new P.Vector3(0,h,0)).add(o)};for(;d!==360;){let x=0;const M=m(d),E=z=>{const D=z.distanceTo(M),k=new P.Raycaster(z,M.clone().sub(z).normalize()),R=r.model.intersectRaycaster(k,void 0,!0)[0],G=R==null?void 0:R.distance;wt(G)?G>D&&(x+=1):x+=1},S=i.clampPoint(M,new P.Vector3);E(S);const T=new P.Vector3(o.x,M.y,o.z);if(E(T),f[x]=d,x===2)break;d+=30}const p=m((w=(A=f[2])!=null?A:f[1])!=null?w:0),g=p.distanceTo(o),y=gc(o.clone().sub(p).normalize());if(e.state.mode==="Mapview")return e.updateCamera(O({offset:o,distance:g},y),800);e.setState(O({mode:"Mapview",offset:o,distance:g},y)),yield e.ready()})}function gb(e,n,t){return te(this,null,function*(){var p,g;if(!n)return;const i=(p=t==null?void 0:t.distance)!=null?p:3,r=new zu(e),s=e.camera.position.clone().sub(n).setY(0).normalize(),o=e.state.mode==="Mapview"?e.state.fov:60,a=i,l=a*Math.cos(P.MathUtils.degToRad(o/2)),c=a*Math.sin(P.MathUtils.degToRad(o/2));let h=0;const u=[],d=y=>{const b=P.MathUtils.degToRad(y);return s.clone().applyAxisAngle(new P.Vector3(0,1,0),b).clone().multiplyScalar(l).add(new P.Vector3(0,c,0)).add(n)};for(;h!==360;){let y=0;const b=d(h);if((w=>{const x=w.distanceTo(b),M=new P.Raycaster(w,b.clone().sub(w).normalize()),E=r.model.intersectRaycaster(M,void 0,!0)[0],S=E==null?void 0:E.distance;wt(S)?S>x&&(y+=1):y+=1})(n),u[y]=h,y===1)break;h+=30}const f=d((g=u[1])!=null?g:0),m=gc(n.clone().sub(f).normalize());if(e.state.mode==="Mapview")return e.updateCamera(O({offset:n,distance:i},m),800);e.setState(O({mode:"Mapview",offset:n,distance:i},m)),yield e.ready()})}function cT(e){return e.model?e.work?e.model.loaded?e.model.name!==e.work.model.file?{result:!1,msg:"five.model.name 与 five.work.model.file 不一致"}:{result:!0,msg:""}:{result:!1,msg:"five.model 未加载完成"}:{result:!1,msg:"five 数据未加载"}:{result:!1,msg:"five.model 不存在"}}function vb(e){return/^https?:\/\/|^\/\//.test(e)||/^data:/.test(e)}function $p(e,n){return vb(n)?n:`${e}${n}`}class ya extends ih{constructor(){super(...arguments);v(this,"disposeMethods",[]);v(this,"animationFrameDisposer");v(this,"onDispose",t=>(this.disposeMethods.push(t),this));v(this,"play",()=>{var t;return this.start(0),(t=this.animationFrameDisposer)==null||t.call(this),this.animationFrameDisposer=Aa(i=>this.update(i)),this});v(this,"stop",()=>{var t;return super.stop(),(t=this.animationFrameDisposer)==null||t.call(this),this});v(this,"dispose",()=>{var t;this.stop(),(t=this.animationFrameDisposer)==null||t.call(this),this.disposeMethods.forEach(i=>i()),this.disposeMethods=[],Av(this)})}}function vc(e,n=Gi.Linear.None){const t=new ya({progress:0}).to({progress:1});return e!==void 0&&t.duration(e),n!==void 0&&t.easing(n),t}const ba=window.requestAnimationFrame||(e=>setTimeout(e,16)),hT=window.cancelAnimationFrame||clearTimeout;function yc(e,n=0){n<=0?ba(e):ba(()=>yc(e,n-1))}function uT(){return te(this,null,function*(){return new Promise(e=>{ba(()=>e())})})}function Aa(e,n=60){let t=-1,i=0,r=-1;const s=1e3/n;function o(a){r===-1&&(r=a),t=ba(o),!(a-i<s)&&(i=a,e==null||e(a-r))}return t=ba(o),function(){hT(t)}}function dT(){const e=Date.now();return new Promise(n=>{ba(()=>{n(Date.now()-e)})})}function Gu(e){return Object.prototype.toString.call(e)==="[object Object]"}function ju(e,n){return e===n?!0:typeof e!=typeof n?!1:!!(Number.isNaN(e)&&Number.isNaN(n))}function fT(e,n){const t=Object.getOwnPropertyNames(e),i=Object.getOwnPropertyNames(n);if(t.length!==i.length)return!1;for(let r=0,s=t.length;r<s;r++){const o=t[r];if(!ju(e[o],n[o]))return!1}return!0}function pT(e,n){if(e.length!==n.length)return!1;for(let t=0,i=e.length;t<i;t++)if(!ju(e[t],n[t]))return!1;return!0}function mT(e,n){return ju(e,n)?!0:Gu(e)&&Gu(n)?fT(e,n):Array.isArray(e)&&Array.isArray(n)?pT(e,n):!1}function em(e,n){return ju(e,n)?!0:Gu(e)&&Gu(n)?vT(e,n):Array.isArray(e)&&Array.isArray(n)?gT(e,n):!1}function gT(e,n){if(e.length!==n.length)return!1;for(let t=0,i=e.length;t<i;t++)if(!em(e[t],n[t]))return!1;return!0}function vT(e,n){const t=Object.getOwnPropertyNames(e),i=Object.getOwnPropertyNames(n);if(t.length!==i.length)return!1;for(let r=0,s=t.length;r<s;r++){const o=t[r];if(!em(e[o],n[o]))return!1}return!0}function Fn(e,n,t={deep:!1}){return t.deep?em(e,n):mT(e,n)}const yT=Object.freeze(Object.defineProperty({__proto__:null,BetterTween:ya,Interval:ef,LineSegments:ub,Magnifier:ah,Object3D:hb,PointHelper:Ev,PointSelectorHelper:cb,Rectangle:jC,absoluteUrl:$p,animeMap:mc,awaitNextFrame:uT,blink:Vu,bounding:qp,boundingBox:va,boundingSphere:db,boxVertex:Tr,boxVertexes:iT,checkFiveModelLoaded:cT,convexHull:HC,equal:Fn,getCoordsFromClient:QC,getCoordsFromElement:YC,getFrameTime:dT,inside:xv,isAbsoluteURL:vb,isModelLike:Mi,isNil:Dr,isPanoramaLike:Ss,lookObject:lT,lookPoint:gb,nextFrame:yc,notNil:wt,pointInPolygon:xv,reblink:mb,requestAnimationFrameInterval:Aa,tweenProgress:vc,uuid:wn,worldBounding:Fu,worldBoundingBox:rT,worldBoundingSphere:fb},Symbol.toStringTag,{value:"Module"})),yb=1,bb=`CSS3DObjectPlus@${yb}`,bT=.00216,AT=.003;class Ab extends Ut.CSS3DObject{constructor(t){var x,M,E,S,T;if(Dr(t.cornerPoints)&&Dr(t.width))throw new Error("cornerPoints and width cannot be both empty");const i=(x=t.container)!=null?x:document.createElement("div"),r=(M=t.cornerPoints)!=null?M:(()=>{const z=t.width/2;return[new ee.Vector3(-z,z,0),new ee.Vector3(-z,-z,0),new ee.Vector3(z,-z,0),new ee.Vector3(z,z,0)]})(),s=(E=t.ratio)!=null?E:AT,o=(S=t.dpr)!=null?S:1,a=(T=t.pointerEvents)!=null?T:"auto",l=Math.max(bT,s),c=r[0].distanceTo(r[1]),h=r[1].distanceTo(r[2]),u=sh(c/s*o),d=sh(h/s*o),f=Hi(...r);let m;if(l===s)i.style.width=`${u}px`,i.style.height=`${d}px`,m=i;else{const z=document.createElement("div");z.style.width=`${u}px`,z.style.height=`${d}px`,z.style.pointerEvents="none";const D=s/l;i.style.position="absolute",i.style.left="0",i.style.top="0",i.style.width=`${D*u}px`,i.style.height=`${D*d}px`,z.appendChild(i),m=z}super(m);v(this,"version",yb);v(this,"isCSS3DObjectPlus",!0);v(this,"isCSS3DObject",!0);v(this,"name",bb);v(this,"container");v(this,"width");v(this,"height");v(this,"domWidthPx");v(this,"domHeightPx");v(this,"cornerPoints");v(this,"centerPosition");v(this,"ratio");v(this,"mode","front");v(this,"hooks",new Pn);v(this,"opacityMesh");v(this,"selfVisible",!0);v(this,"setVisible",t=>{this.selfVisible=t,this.visible=$d(this.parent)&&this.selfVisible,this.opacityMesh&&(this.opacityMesh.visible=this.visible)});v(this,"updateVisible",()=>{this.setVisible(this.selfVisible)});v(this,"createOpacityMesh",t=>{const{domWidthPx:i,domHeightPx:r}=t,s=new GC(i,r);return s.position.copy(t.position),s.rotation.copy(t.rotation),s.scale.copy(t.scale),s});if(i.style.pointerEvents=a,Object.assign(i.style,t.style),this.scale.set(l,l,l),this.cornerPoints=r,this.ratio=s,this.container=i,t.mode&&(this.mode=t.mode),l===s)this.width=c,this.height=h,this.domWidthPx=u,this.domHeightPx=d,this.centerPosition=f;else{const z=s/l;this.width=z*c,this.height=z*h,this.domWidthPx=z*u,this.domHeightPx=z*d,this.centerPosition=new ee.Vector3().subVectors(f,r[0]).multiplyScalar(z).add(r[0])}i.classList.add(`${bb}__container`);const p=new ee.Vector3().subVectors(r[1],r[0]),g=new ee.Vector3().subVectors(r[3],r[0]),y=new ee.Vector3().crossVectors(p,g).normalize();this.lookAt(y);const b=this.up.clone().applyQuaternion(this.quaternion),A=g.clone(),w=new ee.Vector3().crossVectors(b,A).normalize();this.rotateOnWorldAxis(w,b.angleTo(A)),this.position.copy(f),this.addEventListener("added",()=>{var z;this.mode==="front"&&((z=this.opacityMesh)==null||z.removeFromParent())}),this.addEventListener("removed",()=>{var z;(z=this.opacityMesh)==null||z.removeFromParent()})}removeFromParent(){var i;const t=this.parent;return t!==null&&t.remove(this),(i=this.opacityMesh)==null||i.removeFromParent(),this}removeOpacityMesh(){var t;return(t=this.opacityMesh)==null||t.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var t;this.container.remove(),this.removeFromParent(),(t=this.opacityMesh)==null||t.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const t=this.createOpacityMesh(this);return this.opacityMesh=t,t}}applyMatrix4(t){var i;super.applyMatrix4(t),(i=this.opacityMesh)==null||i.applyMatrix4(t)}applyQuaternion(t){var i;return super.applyQuaternion(t),(i=this.opacityMesh)==null||i.applyQuaternion(t),this}applyScaleMatrix4(t){var i;this.scale.applyMatrix4(t),(i=this.opacityMesh)==null||i.scale.applyMatrix4(t)}}function wa(e){const n=[];return Ir(e).forEach(i=>{i.traverse(r=>{(r.isCSS3DObjectPlus||r.isCSS3DObject||r.isCSS3DSprite)&&n.push(r)})}),n}class wT extends P.Scene{constructor(){super()}add(...n){return super.add(...n),wa(n).forEach(t=>{t.mode="front"}),this}}class xT extends P.Scene{constructor(t){super();v(this,"scene");if(!t)throw new Error("CSS3DBehindScene: scene is required");this.scene=t}add(...t){return super.add(...t),wa(t).forEach(i=>{i.mode="behind",this.scene.add(i.getOpacityMesh())}),this}remove(...t){return wa(t).forEach(i=>{var r;(r=i.opacityMesh)==null||r.removeFromParent(),i.opacityMesh=null}),super.remove(...t),this}}class wb extends P.Group{constructor(t){super();v(this,"isCSS3DGroup",!0);v(this,"mode");v(this,"CSS3DObjectLength",0);this.mode=t}add(...t){return wa(t).forEach(i=>{i.mode=this.mode}),super.add(...t),this.updateLength(),this}setVisible(t){this.visible=t,this.traverse(i=>{i.isCSS3DObjectPlus&&i.updateVisible()})}remove(...t){return super.remove(...t),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=wa(this).length}}class MT extends wb{constructor(){super("front")}}class CT extends wb{constructor(t){super("behind");v(this,"scene");if(!t)throw new Error("CSS3DBehindScene: scene is required");this.scene=t}add(...t){return wa(t).forEach(i=>{this.scene.add(i.getOpacityMesh())}),super.add(...t),this}}const PT=3,tm="CSS3DRenderer",bc=`${tm}@${PT}`,xa=()=>{console.error(`${bc} is disposed`)},yn={css3DObjects:[],frontModeStore:{css3DRenderer:new Kd},behindModeStore:{css3DRenderer:new Kd}};function xb(e){return yn.css3DObjects.find(n=>n.id===e)}function ET(e){yn.frontModeStore.css3DRenderer.setWrapper(e)}function _T(e){yn.behindModeStore.css3DRenderer.setWrapper(e)}class Ma{constructor(n){v(this,"hooks",new Pn);v(this,"state",{enabled:!0,visible:!0,disposed:!1});v(this,"_scene");v(this,"store",{frontModeGroup:new MT});v(this,"create3DElement",(n,t,i)=>{if(this.state.disposed)return xa();const r=(()=>{const x={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none",wrapperStyle:{}};return Object.assign(x,i)})(),s=t.map(Ft);if((s==null?void 0:s.length)<4)return console.error(`${bc}: requires 4 point but params may have fewer`);const{ratio:o,devicePixelRatio:a,mode:l,autoRender:c,container:h,pointerEvents:u,wrapperStyle:d}=r;let f=!1;const m=this.createObject(s,{ratio:o,dpr:a,container:h,mode:l,pointerEvents:u,wrapperStyle:d});yn.css3DObjects.push(m),r.scene&&this.setScene(r.scene);const p=()=>{if(f)return;const x=m.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();x&&x.add(m)},g=()=>{f||(p(),this.render(n),this.hooks.emit("render"))},y=x=>this.setVisibleById(m.id,x),b=x=>this.setEnabledById(m.id,x),A=()=>(f=!0,m.removeFromParent(),!0),w=l==="front"?yn.frontModeStore.css3DRenderer:yn.behindModeStore.css3DRenderer;return c&&g(),{id:m.uuid,container:h,css3DObject:m,render:c?void 0:g,show:()=>y(!0),hide:()=>y(!1),setVisible:y,enable:()=>b(!0),disable:()=>b(!1),setEnabled:b,dispose:A,appendToElement:x=>w.setWrapper(x)}});v(this,"setVisibleById",(n,t)=>{var i;(i=xb(n))==null||i.setVisible(t)});v(this,"setEnabledById",(n,t)=>{const i=xb(n);if(!i)return;const r=i.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});r&&(t?r.add(i):r.remove(i))});v(this,"createObject",(n,t)=>{const i=new Ab(Pe(O({cornerPoints:n},t),{style:t.wrapperStyle}));return i.element.classList.add(`${tm}__container`),i.element.id=`${tm}__container--${i.uuid}`,i});n&&this.setScene(n)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return yn.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return yn.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return yn.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return yn.behindModeStore.css3DRenderer}setScene(n){this._scene=n}getCurrentState(){return this.state}setState(n,t={userAction:!0}){if(this.state.disposed)return xa();const i=O({},this.state);this.state=Object.assign(this.state,n),i.visible!==this.state.visible&&(n.visible?this.handleShow():this.handleHide()),i.enabled!==this.state.enabled&&(n.enabled?this.handleEnable():this.handleDisable()),i.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:i,userAction:t.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return te(this,arguments,function*({userAction:n}={userAction:!0}){if(this.state.disposed)return xa();this.setState({visible:!0},{userAction:n}),this.hooks.emit("show",{userAction:n})})}hide(){return te(this,arguments,function*({userAction:n}={userAction:!0}){if(this.state.disposed)return xa();this.setState({visible:!1},{userAction:n}),this.hooks.emit("hide",{userAction:n})})}enable({userAction:n}={userAction:!0}){if(this.state.disposed)return xa();this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable({userAction:n}={userAction:!0}){if(this.state.disposed)return xa();this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}getFrontCSS3DScene({createSceneIfNotExists:n=!1}={}){var i;const t=(i=yn.frontModeStore)==null?void 0:i.css3DScene;if(t)return t;if(n){const r=new wT;yn.frontModeStore.css3DScene=r}return yn.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:n=!1}={}){var i,r;const t=(i=yn.behindModeStore)==null?void 0:i.css3DScene;if(t)return t;if(n){const s=(r=yn.behindModeStore.scene)!=null?r:this.scene;if(!s){console.error(`${bc}: scene is required when mode is behind`);return}const o=new xT(s);yn.behindModeStore.css3DScene=o,yn.behindModeStore.scene=s}return yn.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:n=!0}={}){const t=this.getFrontCSS3DScene({createSceneIfNotExists:n});return n&&t&&(t.getObjectById(this.store.frontModeGroup.id)||t.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:n=!0}={}){var i;const t=this.getBehindCSS3DScene({createSceneIfNotExists:n});if(n&&t&&this.scene){const r=(i=this.store.behindModeGroup)!=null?i:new CT(this.scene);this.store.behindModeGroup=r,t.getObjectById(r.id)||t.add(r)}return this.store.behindModeGroup}render(n){var t,i;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const r=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!r)return console.error(`${bc}: css3DScene is required when mode is front`);yn.frontModeStore.css3DRenderer.renderEveryFrame(r,n)}if(((i=(t=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:t.CSS3DObjectLength)!=null?i:0)>0){const r=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!r)return console.error(`${bc}: css3DScene is required when mode is behind`);yn.behindModeStore.css3DRenderer.renderEveryFrame(r,n)}}handleShow(){return te(this,null,function*(){var n;this.store.frontModeGroup.setVisible(!0),(n=this.store.behindModeGroup)==null||n.setVisible(!0)})}handleHide(){return te(this,null,function*(){var n;this.store.frontModeGroup.setVisible(!1),(n=this.store.behindModeGroup)==null||n.setVisible(!1)})}handleEnable(){var n,t;(n=this.getFrontCSS3DScene())==null||n.add(this.store.frontModeGroup),this.store.behindModeGroup&&((t=this.getBehindCSS3DScene())==null||t.add(this.store.behindModeGroup))}handleDisable(){var n,t,i;this.store.frontModeGroup.children.forEach(r=>{r instanceof Ut.CSS3DObject&&r.element instanceof Element&&r.element.parentNode!==null&&r.element.remove()}),(n=this.store.behindModeGroup)==null||n.children.forEach(r=>{r instanceof Ut.CSS3DObject&&r.element instanceof Element&&r.element.parentNode!==null&&r.element.remove()}),(t=this.getFrontCSS3DScene())==null||t.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((i=this.getBehindCSS3DScene())==null||i.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}v(Ma,"setFrontModeContainer",ET),v(Ma,"setBehindModeContainer",_T);const Ri=document.createElement("div");Ri.classList.add("behindFiveElement"),Ri.style.position="absolute",Ri.style.top="0",Ri.style.left="0",Ri.style.width="100%",Ri.style.height="100%",Ri.style.pointerEvents="none";function Mb(e){var i,r,s,o,a;const n=(a=(r=nm(e.getElement()))!=null?r:nm((i=e.getElement())==null?void 0:i.parentElement))!=null?a:nm((o=(s=e.getElement())==null?void 0:s.parentElement)==null?void 0:o.parentElement),t=n==null?void 0:n.parentElement;if(t)return t.contains(Ri)||n.parentElement.insertBefore(Ri,n),Ri;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/tree/main/plugins/src/CSS3DRenderPlugin/README.md")}function nm(e){var a;if(!e)return;const n=(a=e.style.position)!=null?a:getComputedStyle(e).position;if(n!=="fixed"&&n!=="absolute"&&n!=="relative")return;const t=getComputedStyle(e),i=t.backgroundColor,r=t.backgroundImage;if(!(i!=="transparent"&&i!=="rgba(0, 0, 0, 0)"&&i!==""||r!=="none"&&r!==""))return e}function Ca(e){return te(this,null,function*(){return new Promise(n=>{if(ST(e))n();else{const t=i=>{const r=Li(e);i===r&&(e.off("modelLoaded",t),n())};e.on("modelLoaded",t)}})})}function ST(e){var n;return(n=Li(e))==null?void 0:n.loaded}const Cb="v2.0.1",Pb=`CSS3DRenderPlugin@${Cb}`;let IT=class extends Ma{constructor(t){super();v(this,"five");v(this,"behindFiveContainer");v(this,"frontFiveContainer");v(this,"VERSION",Cb);v(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");v(this,"created3DElementResults",[]);v(this,"create3DDomContainer",(t,i)=>{if(this.state.disposed)return;const r=(()=>{var u;(i==null?void 0:i.dpr)!==void 0&&console.warn(`${Pb}: please use "config.devicePixelRatio" replace "config.dpr"`);const h={ratio:.00216,devicePixelRatio:(u=i==null?void 0:i.dpr)!=null?u:1,mode:"front",autoRender:!0,wrapperStyle:{}};return Object.assign(h,i,(i==null?void 0:i.mode)==="behind"?{scene:this.five.scene}:void 0)})(),{autoRender:s}=r;r.mode==="behind"&&r.behindFiveContainer&&(this.behindFiveContainer=r.behindFiveContainer);const o=this.create3DElement(this.five.camera,t,Pe(O({},r),{autoRender:!1}));if(!o)return;const a=o.dispose;o.dispose=()=>(this.created3DElementResults.includes(o)&&this.created3DElementResults.splice(this.created3DElementResults.indexOf(o),1),a());const l=()=>{var u,d;const h=o.css3DObject.mode==="front"?(d=this.frontFiveContainer)!=null?d:(u=this.five.getElement())==null?void 0:u.parentElement:this.getBehindFiveElement();if(!h)return console.error(`${Pb}: wrapper is ${h}; mode is ${o.css3DObject.mode}`);o.appendToElement(h),o.render(),this.created3DElementResults.push(o)},c=()=>{o.css3DObject.mode==="front"&&l(),o.css3DObject.mode==="behind"&&Ca(this.five).then(()=>l())};return s&&c(),Pe(O({},o),{render:s?void 0:c})});this.five=t}disposeAll(){return this.dispose()}setState(...t){const i=super.setState(...t);return this.five.needsRender=!0,i}appendToFrontFiveContainer(t){this.frontFiveContainer=t,this.created3DElementResults.forEach(i=>{i.css3DObject.mode==="front"&&i.appendToElement(t)})}appendToBehindFiveContainer(t){this.behindFiveContainer=t,this.created3DElementResults.forEach(i=>{i.css3DObject.mode==="behind"&&i.appendToElement(t)})}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=Mb(this.five),this.behindFiveContainer)}absoluteUrl(t){return $p(this.staticPrefix,t)}clear(){this.created3DElementResults.forEach(t=>{t.dispose()}),this.created3DElementResults=[]}};const Ac=e=>new IT(e);function im(e,n,t=new ee.Vector3(1,1,1),i=!1){const r=new Sv(e,n);return r.setMaterial({dashed:i,color:t,linewidth:1}),r.remove(r.points),r}const TT=e=>{const n={intersection:null,disposers:[]},t=h=>{n.intersection=h},i=()=>{n.intersection=null};e.on("modelLoaded",()=>{e.on("intersectionOnModelUpdate",t),e.on("intersectionHidden",i)}),e.on("dispose",()=>{e.off("intersectionOnModelUpdate",t),e.off("intersectionHidden",i)});const r=(h,u=2,d=.1)=>{const f=u/2,p=c(h,d),g=new ee.Group;g.add(im(new ee.Vector3(p.x+f,p.y,p.z),new ee.Vector3(p.x-f,p.y,p.z),new ee.Vector3(1,0,0)),im(new ee.Vector3(p.x,p.y+f,p.z),new ee.Vector3(p.x,p.y-f,p.z),new ee.Vector3(0,1,0)),im(new ee.Vector3(p.x,p.y,p.z+f),new ee.Vector3(p.x,p.y,p.z-f),new ee.Vector3(0,0,1))),e.scene.add(g),e.needsRender=!0;const y=()=>{e.scene.remove(g)};return n.disposers.push(y),{clear:y,pointAxesHelperMesh:g}},s=(h,u=0)=>{var y,b;const d=(y=e==null?void 0:e.camera)==null?void 0:y.position;if(!d)return!1;const f=h.distanceTo(d),m=h.sub(d).normalize(),p=new ee.Raycaster(d,m),g=(b=e.model.intersectRaycaster(p))==null?void 0:b[0];return!(g&&g.distance+u<f)},o=()=>n.intersection,a=()=>{var h,u;(u=(h=n.disposers)==null?void 0:h.forEach)==null||u.call(h,d=>d==null?void 0:d()),e.off("intersectionOnModelUpdate",t),e.off("intersectionHidden",i)},l=a,c=(h,u)=>{const d=h.clone();return e.camera.position.clone().sub(d).setLength(u).add(d)};return{intersection:o,pointAxesHelper:r,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function de(){}const Lr=e=>e;function Ln(e,n){for(const t in n)e[t]=n[t];return e}function DT(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Eb(e){return e()}function _b(){return Object.create(null)}function bn(e){e.forEach(Eb)}function nr(e){return typeof e=="function"}function Le(e,n){return e!=e?n==n:e!==n||e&&typeof e=="object"||typeof e=="function"}let Hu;function Sn(e,n){return Hu||(Hu=document.createElement("a")),Hu.href=n,e===Hu.href}function LT(e){return Object.keys(e).length===0}function Pa(e,n,t,i){if(e){const r=Sb(e,n,t,i);return e[0](r)}}function Sb(e,n,t,i){return e[1]&&i?Ln(t.ctx.slice(),e[1](i(n))):t.ctx}function Ea(e,n,t,i){if(e[2]&&i){const r=e[2](i(t));if(n.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(n.dirty.length,r.length);for(let a=0;a<o;a+=1)s[a]=n.dirty[a]|r[a];return s}return n.dirty|r}return n.dirty}function _a(e,n,t,i,r,s){if(r){const o=Sb(n,t,i,s);e.p(o,r)}}function Sa(e){if(e.ctx.length>32){const n=[],t=e.ctx.length/32;for(let i=0;i<t;i++)n[i]=-1;return n}return-1}function an(e){return e==null?"":e}function zi(e){return e&&nr(e.destroy)?e.destroy:de}function Ib(e){const n=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return n?[parseFloat(n[1]),n[2]||"px"]:[e,"px"]}const Tb=typeof window!="undefined";let rm=Tb?()=>window.performance.now():()=>Date.now(),sm=Tb?e=>requestAnimationFrame(e):de;const Ia=new Set;function Db(e){Ia.forEach(n=>{n.c(e)||(Ia.delete(n),n.f())}),Ia.size!==0&&sm(Db)}function om(e){let n;return Ia.size===0&&sm(Db),{promise:new Promise(t=>{Ia.add(n={c:e,f:t})}),abort(){Ia.delete(n)}}}function Q(e,n){e.appendChild(n)}function Ue(e,n,t){const i=am(e);if(!i.getElementById(n)){const r=H("style");r.id=n,r.textContent=t,Lb(i,r)}}function am(e){if(!e)return document;const n=e.getRootNode?e.getRootNode():e.ownerDocument;return n&&n.host?n:e.ownerDocument}function kT(e){const n=H("style");return Lb(am(e),n),n.sheet}function Lb(e,n){return Q(e.head||e,n),n.sheet}function X(e,n,t){e.insertBefore(n,t||null)}function Y(e){e.parentNode&&e.parentNode.removeChild(e)}function Bi(e,n){for(let t=0;t<e.length;t+=1)e[t]&&e[t].d(n)}function H(e){return document.createElement(e)}function zt(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Mt(e){return document.createTextNode(e)}function ye(){return Mt(" ")}function pt(){return Mt("")}function lt(e,n,t,i){return e.addEventListener(n,t,i),()=>e.removeEventListener(n,t,i)}function OT(e){return function(n){return n.stopPropagation(),e.call(this,n)}}function _(e,n,t){t==null?e.removeAttribute(n):e.getAttribute(n)!==t&&e.setAttribute(n,t)}function RT(e){return Array.from(e.childNodes)}function Pt(e,n){n=""+n,e.data!==n&&(e.data=n)}function W(e,n,t,i){t===null?e.style.removeProperty(n):e.style.setProperty(n,t,i?"important":"")}let Uu;function zT(){if(Uu===void 0){Uu=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(e){Uu=!0}}return Uu}function lm(e,n){getComputedStyle(e).position==="static"&&(e.style.position="relative");const i=H("iframe");i.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),i.setAttribute("aria-hidden","true"),i.tabIndex=-1;const r=zT();let s;return r?(i.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=lt(window,"message",o=>{o.source===i.contentWindow&&n()})):(i.src="about:blank",i.onload=()=>{s=lt(i.contentWindow,"resize",n),n()}),Q(e,i),()=>{(r||s&&i.contentWindow)&&s(),Y(i)}}function Ee(e,n,t){e.classList[t?"add":"remove"](n)}function kb(e,n,{bubbles:t=!1,cancelable:i=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t,i,n),r}class Wu{constructor(n=!1){this.is_svg=!1,this.is_svg=n,this.e=this.n=null}c(n){this.h(n)}m(n,t,i=null){this.e||(this.is_svg?this.e=zt(t.nodeName):this.e=H(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(n)),this.i(i)}h(n){this.e.innerHTML=n,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(n){for(let t=0;t<this.n.length;t+=1)X(this.t,this.n[t],n)}p(n){this.d(),this.h(n),this.i(this.a)}d(){this.n.forEach(Y)}}const Qu=new Map;let Yu=0;function BT(e){let n=5381,t=e.length;for(;t--;)n=(n<<5)-n^e.charCodeAt(t);return n>>>0}function NT(e,n){const t={stylesheet:kT(n),rules:{}};return Qu.set(e,t),t}function Xu(e,n,t,i,r,s,o,a=0){const l=16.666/i;let c=`{
|
|
3158
3158
|
`;for(let g=0;g<=1;g+=l){const y=n+(t-n)*s(g);c+=g*100+`%{${o(y,1-y)}}
|
|
3159
3159
|
`}const h=c+`100% {${o(t,1-t)}}
|
|
3160
3160
|
}`,u=`__svelte_${BT(h)}_${a}`,d=am(e),{stylesheet:f,rules:m}=Qu.get(d)||NT(d,e);m[u]||(m[u]=!0,f.insertRule(`@keyframes ${u} ${h}`,f.cssRules.length));const p=e.style.animation||"";return e.style.animation=`${p?`${p}, `:""}${u} ${i}ms linear ${r}ms 1 both`,Yu+=1,u}function Zu(e,n){const t=(e.style.animation||"").split(", "),i=t.filter(n?s=>s.indexOf(n)<0:s=>s.indexOf("__svelte")===-1),r=t.length-i.length;r&&(e.style.animation=i.join(", "),Yu-=r,Yu||FT())}function FT(){sm(()=>{Yu||(Qu.forEach(e=>{const{ownerNode:n}=e.stylesheet;n&&Y(n)}),Qu.clear())})}let wc;function kr(e){wc=e}function fs(){if(!wc)throw new Error("Function called outside component initialization");return wc}function Ob(e){fs().$$.before_update.push(e)}function Yn(e){fs().$$.on_mount.push(e)}function Rb(e){fs().$$.after_update.push(e)}function yi(e){fs().$$.on_destroy.push(e)}function Ju(){const e=fs();return(n,t,{cancelable:i=!1}={})=>{const r=e.$$.callbacks[n];if(r){const s=kb(n,t,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function cm(e,n){return fs().$$.context.set(e,n),n}function ps(e){return fs().$$.context.get(e)}function Ta(e,n){const t=e.$$.callbacks[n.type];t&&t.slice().forEach(i=>i.call(this,n))}const Da=[],Qt=[];let La=[];const hm=[],zb=Promise.resolve();let um=!1;function Bb(){um||(um=!0,zb.then(pm))}function Nb(){return Bb(),zb}function ln(e){La.push(e)}function dm(e){hm.push(e)}const fm=new Set;let ka=0;function pm(){if(ka!==0)return;const e=wc;do{try{for(;ka<Da.length;){const n=Da[ka];ka++,kr(n),VT(n.$$)}}catch(n){throw Da.length=0,ka=0,n}for(kr(null),Da.length=0,ka=0;Qt.length;)Qt.pop()();for(let n=0;n<La.length;n+=1){const t=La[n];fm.has(t)||(fm.add(t),t())}La.length=0}while(Da.length);for(;hm.length;)hm.pop()();um=!1,fm.clear(),kr(e)}function VT(e){if(e.fragment!==null){e.update(),bn(e.before_update);const n=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,n),e.after_update.forEach(ln)}}function GT(e){const n=[],t=[];La.forEach(i=>e.indexOf(i)===-1?n.push(i):t.push(i)),t.forEach(i=>i()),La=n}let xc;function mm(){return xc||(xc=Promise.resolve(),xc.then(()=>{xc=null})),xc}function Xs(e,n,t){e.dispatchEvent(kb(`${n?"intro":"outro"}${t}`))}const qu=new Set;let ir;function Fe(){ir={r:0,c:[],p:ir}}function Ve(){ir.r||bn(ir.c),ir=ir.p}function N(e,n){e&&e.i&&(qu.delete(e),e.i(n))}function Z(e,n,t,i){if(e&&e.o){if(qu.has(e))return;qu.add(e),ir.c.push(()=>{qu.delete(e),i&&(t&&e.d(1),i())}),e.o(n)}else i&&i()}const gm={duration:0};function ms(e,n,t){const i={direction:"in"};let r=n(e,t,i),s=!1,o,a,l=0;function c(){o&&Zu(e,o)}function h(){const{delay:d=0,duration:f=300,easing:m=Lr,tick:p=de,css:g}=r||gm;g&&(o=Xu(e,0,1,f,d,m,g,l++)),p(0,1);const y=rm()+d,b=y+f;a&&a.abort(),s=!0,ln(()=>Xs(e,!0,"start")),a=om(A=>{if(s){if(A>=b)return p(1,0),Xs(e,!0,"end"),c(),s=!1;if(A>=y){const w=m((A-y)/f);p(w,1-w)}}return s})}let u=!1;return{start(){u||(u=!0,Zu(e),nr(r)?(r=r(i),mm().then(h)):h())},invalidate(){u=!1},end(){s&&(c(),s=!1)}}}function Oa(e,n,t){const i={direction:"out"};let r=n(e,t,i),s=!0,o;const a=ir;a.r+=1;function l(){const{delay:c=0,duration:h=300,easing:u=Lr,tick:d=de,css:f}=r||gm;f&&(o=Xu(e,1,0,h,c,u,f));const m=rm()+c,p=m+h;ln(()=>Xs(e,!1,"start")),om(g=>{if(s){if(g>=p)return d(0,1),Xs(e,!1,"end"),--a.r||bn(a.c),!1;if(g>=m){const y=u((g-m)/h);d(1-y,y)}}return s})}return nr(r)?mm().then(()=>{r=r(i),l()}):l(),{end(c){c&&r.tick&&r.tick(1,0),s&&(o&&Zu(e,o),s=!1)}}}function rr(e,n,t,i){const r={direction:"both"};let s=n(e,t,r),o=i?0:1,a=null,l=null,c=null;function h(){c&&Zu(e,c)}function u(f,m){const p=f.b-o;return m*=Math.abs(p),{a:o,b:f.b,d:p,duration:m,start:f.start,end:f.start+m,group:f.group}}function d(f){const{delay:m=0,duration:p=300,easing:g=Lr,tick:y=de,css:b}=s||gm,A={start:rm()+m,b:f};f||(A.group=ir,ir.r+=1),a||l?l=A:(b&&(h(),c=Xu(e,o,f,p,m,g,b)),f&&y(0,1),a=u(A,p),ln(()=>Xs(e,f,"start")),om(w=>{if(l&&w>l.start&&(a=u(l,p),l=null,Xs(e,a.b,"start"),b&&(h(),c=Xu(e,o,a.b,a.duration,0,g,s.css))),a){if(w>=a.end)y(o=a.b,1-o),Xs(e,a.b,"end"),l||(a.b?h():--a.group.r||bn(a.group.c)),a=null;else if(w>=a.start){const x=w-a.start;o=a.a+a.d*g(x/a.duration),y(o,1-o)}}return!!(a||l)}))}return{run(f){nr(s)?mm().then(()=>{s=s(r),d(f)}):d(f)},end(){h(),a=l=null}}}function Ku(e,n){const t=n.token={};function i(r,s,o,a){if(n.token!==t)return;n.resolved=a;let l=n.ctx;o!==void 0&&(l=l.slice(),l[o]=a);const c=r&&(n.current=r)(l);let h=!1;n.block&&(n.blocks?n.blocks.forEach((u,d)=>{d!==s&&u&&(Fe(),Z(u,1,1,()=>{n.blocks[d]===u&&(n.blocks[d]=null)}),Ve())}):n.block.d(1),c.c(),N(c,1),c.m(n.mount(),n.anchor),h=!0),n.block=c,n.blocks&&(n.blocks[s]=c),h&&pm()}if(DT(e)){const r=fs();if(e.then(s=>{kr(r),i(n.then,1,n.value,s),kr(null)},s=>{if(kr(r),i(n.catch,2,n.error,s),kr(null),!n.hasCatch)throw s}),n.current!==n.pending)return i(n.pending,0),!0}else{if(n.current!==n.then)return i(n.then,1,n.value,e),!0;n.resolved=e}}function Fb(e,n,t){const i=n.slice(),{resolved:r}=e;e.current===e.then&&(i[e.value]=r),e.current===e.catch&&(i[e.error]=r),e.block.p(i,t)}const jT=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function vm(e,n){e.d(1),n.delete(e.key)}function gs(e,n){Z(e,1,1,()=>{n.delete(e.key)})}function Ni(e,n,t,i,r,s,o,a,l,c,h,u){let d=e.length,f=s.length,m=d;const p={};for(;m--;)p[e[m].key]=m;const g=[],y=new Map,b=new Map,A=[];for(m=f;m--;){const E=u(r,s,m),S=t(E);let T=o.get(S);T?i&&A.push(()=>T.p(E,n)):(T=c(S,E),T.c()),y.set(S,g[m]=T),S in p&&b.set(S,Math.abs(m-p[S]))}const w=new Set,x=new Set;function M(E){N(E,1),E.m(a,h),o.set(E.key,E),h=E.first,f--}for(;d&&f;){const E=g[f-1],S=e[d-1],T=E.key,z=S.key;E===S?(h=E.first,d--,f--):y.has(z)?!o.has(T)||w.has(T)?M(E):x.has(z)?d--:b.get(T)>b.get(z)?(x.add(T),M(E)):(w.add(z),d--):(l(S,o),d--)}for(;d--;){const E=e[d];y.has(E.key)||l(E,o)}for(;f;)M(g[f-1]);return bn(A),g}function Vn(e,n){const t={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],a=n[s];if(a){for(const l in o)l in a||(i[l]=1);for(const l in a)r[l]||(t[l]=a[l],r[l]=1);e[s]=a}else for(const l in o)r[l]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Vb(e){return typeof e=="object"&&e!==null?e:{}}function ym(e,n,t){const i=e.$$.props[n];i!==void 0&&(e.$$.bound[i]=t,t(e.$$.ctx[i]))}function Te(e){e&&e.c()}function Se(e,n,t,i){const{fragment:r,after_update:s}=e.$$;r&&r.m(n,t),i||ln(()=>{const o=e.$$.on_mount.map(Eb).filter(nr);e.$$.on_destroy?e.$$.on_destroy.push(...o):bn(o),e.$$.on_mount=[]}),s.forEach(ln)}function Ie(e,n){const t=e.$$;t.fragment!==null&&(GT(t.after_update),bn(t.on_destroy),t.fragment&&t.fragment.d(n),t.on_destroy=t.fragment=null,t.ctx=[])}function HT(e,n){e.$$.dirty[0]===-1&&(Da.push(e),Bb(),e.$$.dirty.fill(0)),e.$$.dirty[n/31|0]|=1<<n%31}function ke(e,n,t,i,r,s,o,a=[-1]){const l=wc;kr(e);const c=e.$$={fragment:null,ctx:[],props:s,update:de,not_equal:r,bound:_b(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(l?l.$$.context:[])),callbacks:_b(),dirty:a,skip_bound:!1,root:n.target||l.$$.root};o&&o(c.root);let h=!1;if(c.ctx=t?t(e,n.props||{},(u,d,...f)=>{const m=f.length?f[0]:d;return c.ctx&&r(c.ctx[u],c.ctx[u]=m)&&(!c.skip_bound&&c.bound[u]&&c.bound[u](m),h&&HT(e,u)),d}):[],c.update(),h=!0,bn(c.before_update),c.fragment=i?i(c.ctx):!1,n.target){if(n.hydrate){const u=RT(n.target);c.fragment&&c.fragment.l(u),u.forEach(Y)}else c.fragment&&c.fragment.c();n.intro&&N(e.$$.fragment),Se(e,n.target,n.anchor,n.customElement),pm()}kr(l)}class Oe{$destroy(){Ie(this,1),this.$destroy=de}$on(n,t){if(!nr(t))return de;const i=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(n){this.$$set&&!LT(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}const UT="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3XfrZWWVcVVLHVLmuXG/74148V5m2bm/N8bR0dH+Bx988Po333zzbz///PONg4ODa+I9I9y/cuXKgV77h4eH+1KH3hP/yv7+vuBAsG+5UCIpCkMzDQ962Eu80Q1P/KmHT82v8IocZFL4pslDvL3fNARHoPI2wtbrV1jBIf9N8SEZ0UUP2wFHv2ocSc/2ouEz8PVooJXQ0/j10aNHoH2Idj4PHz4k1n29/k+5/u3ll1/+r7fffvtLzfGzd8ibjK6+9957f5ajf1XzH9y7d+8Xjf9FRs1SdvNBBg2SDQ1xh9ALH4yN0M2BNZrKwtFc9Fmkquuma5HJBzvLiIONBnx40B7QIzTdxCcNwj3dYlEoUmabAU+UFZDpxah22Ng2NjQXH0LrwccGwyEzXfWhWQwSYQHYuFevXj14/vnn37h79+7Nr7766gup/FX5PnAj33///f/46aef3vj444/vfPbZZz9IYGMcnDbkhEYQL001Hfsu775i+7j6LID6cDQWYo8mab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L5Ax/Edn2uKDEd9BM8tbzxe98IraJJM7CBP98JjHFmR+3vqxOXzmmWceaKU337CxGhqCTUVolIGMabAnhGgUb71iahI7fFf7FIFCb3j/18voiuemdd/Mu/+uE1sQWfeX3MBuyzx5B39P/fRcr4dcAT9p5bxl4zhIgNqgnlRkILKuf1654tIUCk2oLJYbQpr0ZqRrGt30C1tk4FnyQYccray31B3s9UQviG104IUGmZ8mH5v+3qF2w51nn332TzHCsI7KJzEVm6akEVuPhLWGhUeM0CAjvkHmxCM+uCYPD2R0f2Ilt7lB4tMGZ3i7qPqfe+65P6j3X1y5du3aZ3rSefrGjRsvkNxpI80AeTGC0NgGoakvuFYrtvDjD11okBF6m3yjdfze9eM7sbPQIC8sg8detlPdP7XCy8ASOh6IC534Qf126Au6Aq7S+0P9jOJ/f/jhh7dfeeWVN1C4c+cOv5zoxsQgKD7O/OgIT3OLgrrkLAMR9EuQYsXLlWO5ePNMJ25s7Fhv8EIraduDDOJI7kfh6FT98M6Ka/GrLbE0/131X79+/YVXX331+tNPP32b3nt1tGhXP/rooz/ruf9N/YzWQ/2e2c8Cfg7Wz8RC9WkeE8pj/rQltMRH/jXdsdreAEp04mg8u22zYhvZ9IPueLE4puMLfnjRKzKCbD4ZHv9oK/mwaPOlm/ukkbFwjKLj428j8t8DEEvN9xJoJuhsDI9lxOeHXr3zE8cGm7fpQMfNgR54ntXmYXzx1ltvbX64VUl4SH//66+/fl2/5ndLC/BHMV/Q6ypN06Bm3lgFaKMcEbj+bDHN88/curvewF4hjhNWasrwhy/0waIPjylyYjp49Ag++NhFhi7F+jeEFcc/H6w5TYbnxo2OoufXmNPcX+XWv4QLMo+taJkfeY4gvtRs/n8vzY/cssxB5CyKxi96/aB+/Y9+KfE/X3vttS8lI7e9/wfu514OAjYP0QAAAABJRU5ErkJggg==";function WT(e){Ue(e,"svelte-1d7uzh5",".room-label-item.svelte-1d7uzh5{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-1d7uzh5{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1d7uzh5{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1d7uzh5{font-size:0.625rem}")}function QT(e){let n,t,i=e[0].name+"",r,s,o,a,l;return{c(){n=H("div"),t=H("span"),r=Mt(i),s=ye(),o=H("div"),_(t,"class","room-label-item__text svelte-1d7uzh5"),W(t,"background-image","url("+UT+")"),Ee(t,"wide",e[0].name.length>3),_(o,"class","room-label-item__bar svelte-1d7uzh5"),_(n,"class","room-label-item svelte-1d7uzh5"),W(n,"z-index",e[0].zIndex),W(n,"transform",e[0].transform),W(n,"opacity",e[0].visible?1:0)},m(c,h){X(c,n,h),Q(n,t),Q(t,r),Q(n,s),Q(n,o),a||(l=lt(t,"click",e[1]),a=!0)},p(c,[h]){h&1&&i!==(i=c[0].name+"")&&Pt(r,i),h&1&&Ee(t,"wide",c[0].name.length>3),h&1&&W(n,"z-index",c[0].zIndex),h&1&&W(n,"transform",c[0].transform),h&1&&W(n,"opacity",c[0].visible?1:0)},i:de,o:de,d(c){c&&Y(n),a=!1,l()}}}function YT(e,n,t){let{five:i}=n,{roomLabel:r}=n;function s(){i.setState({panoIndex:r.panoIndex,mode:"Panorama",longitude:r.longitude})}return e.$$set=o=>{"five"in o&&t(2,i=o.five),"roomLabel"in o&&t(0,r=o.roomLabel)},[r,s,i]}class XT extends Oe{constructor(n){super(),ke(this,n,YT,QT,Le,{five:2,roomLabel:0},WT)}}var Gb=function(){if(typeof Map!="undefined")return Map;function e(n,t){var i=-1;return n.some(function(r,s){return r[0]===t?(i=s,!0):!1}),i}return function(){function n(){this.__entries__=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),n.prototype.get=function(t){var i=e(this.__entries__,t),r=this.__entries__[i];return r&&r[1]},n.prototype.set=function(t,i){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},n.prototype.delete=function(t){var i=this.__entries__,r=e(i,t);~r&&i.splice(r,1)},n.prototype.has=function(t){return!!~e(this.__entries__,t)},n.prototype.clear=function(){this.__entries__.splice(0)},n.prototype.forEach=function(t,i){i===void 0&&(i=null);for(var r=0,s=this.__entries__;r<s.length;r++){var o=s[r];t.call(i,o[1],o[0])}},n}()}(),bm=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,$u=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ZT=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind($u):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),JT=2;function qT(e,n){var t=!1,i=!1,r=0;function s(){t&&(t=!1,e()),i&&a()}function o(){ZT(s)}function a(){var l=Date.now();if(t){if(l-r<JT)return;i=!0}else t=!0,i=!1,setTimeout(o,n);r=l}return a}var KT=20,$T=["top","right","bottom","left","width","height","size","weight"],eD=typeof MutationObserver!="undefined",tD=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=qT(this.refresh.bind(this),KT)}return e.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n),this.connected_||this.connect_()},e.prototype.removeObserver=function(n){var t=this.observers_,i=t.indexOf(n);~i&&t.splice(i,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},e.prototype.updateObservers_=function(){var n=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return n.forEach(function(t){return t.broadcastActive()}),n.length>0},e.prototype.connect_=function(){!bm||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),eD?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!bm||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(n){var t=n.propertyName,i=t===void 0?"":t,r=$T.some(function(s){return!!~i.indexOf(s)});r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),jb=function(e,n){for(var t=0,i=Object.keys(n);t<i.length;t++){var r=i[t];Object.defineProperty(e,r,{value:n[r],enumerable:!1,writable:!1,configurable:!0})}return e},Ra=function(e){var n=e&&e.ownerDocument&&e.ownerDocument.defaultView;return n||$u},Hb=td(0,0,0,0);function ed(e){return parseFloat(e)||0}function Ub(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return n.reduce(function(i,r){var s=e["border-"+r+"-width"];return i+ed(s)},0)}function nD(e){for(var n=["top","right","bottom","left"],t={},i=0,r=n;i<r.length;i++){var s=r[i],o=e["padding-"+s];t[s]=ed(o)}return t}function iD(e){var n=e.getBBox();return td(0,0,n.width,n.height)}function rD(e){var n=e.clientWidth,t=e.clientHeight;if(!n&&!t)return Hb;var i=Ra(e).getComputedStyle(e),r=nD(i),s=r.left+r.right,o=r.top+r.bottom,a=ed(i.width),l=ed(i.height);if(i.boxSizing==="border-box"&&(Math.round(a+s)!==n&&(a-=Ub(i,"left","right")+s),Math.round(l+o)!==t&&(l-=Ub(i,"top","bottom")+o)),!oD(e)){var c=Math.round(a+s)-n,h=Math.round(l+o)-t;Math.abs(c)!==1&&(a-=c),Math.abs(h)!==1&&(l-=h)}return td(r.left,r.top,a,l)}var sD=function(){return typeof SVGGraphicsElement!="undefined"?function(e){return e instanceof Ra(e).SVGGraphicsElement}:function(e){return e instanceof Ra(e).SVGElement&&typeof e.getBBox=="function"}}();function oD(e){return e===Ra(e).document.documentElement}function aD(e){return bm?sD(e)?iD(e):rD(e):Hb}function lD(e){var n=e.x,t=e.y,i=e.width,r=e.height,s=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,o=Object.create(s.prototype);return jb(o,{x:n,y:t,width:i,height:r,top:t,right:n+i,bottom:r+t,left:n}),o}function td(e,n,t,i){return{x:e,y:n,width:t,height:i}}var cD=function(){function e(n){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=td(0,0,0,0),this.target=n}return e.prototype.isActive=function(){var n=aD(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},e}(),hD=function(){function e(n,t){var i=lD(t);jb(this,{target:n,contentRect:i})}return e}(),uD=function(){function e(n,t,i){if(this.activeObservations_=[],this.observations_=new Gb,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n,this.controller_=t,this.callbackCtx_=i}return e.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(n instanceof Ra(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)||(t.set(n,new cD(n)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(n instanceof Ra(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)&&(t.delete(n),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var n=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&n.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,t=this.activeObservations_.map(function(i){return new hD(i.target,i.broadcastRect())});this.callback_.call(n,t,n),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Wb=typeof WeakMap!="undefined"?new WeakMap:new Gb,Qb=function(){function e(n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=tD.getInstance(),i=new uD(n,t,this);Wb.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Qb.prototype[e]=function(){var n;return(n=Wb.get(this))[e].apply(n,arguments)}});var dD=function(){return typeof $u.ResizeObserver!="undefined"?$u.ResizeObserver:Qb}();function vs(e){new dD((t,i)=>{var r,s,o,a,l,c;for(const h of t){const{borderBoxSize:u,contentRect:d}=h,f=(o=(s=(r=u==null?void 0:u[0])==null?void 0:r.inlineSize)!=null?s:d.width)!=null?o:e.clientWidth,m=(c=(l=(a=u==null?void 0:u[0])==null?void 0:a.blockSize)!=null?l:d.height)!=null?c:e.clientHeight;e.dispatchEvent(new CustomEvent("clientWidth",{detail:f})),e.dispatchEvent(new CustomEvent("clientHeight",{detail:m}))}}).observe(e)}const{Map:fD}=jT;function pD(e){Ue(e,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function Yb(e,n,t){const i=e.slice();return i[13]=n[t],i}function Xb(e,n){let t,i,r;return i=new XT({props:{roomLabel:n[13],five:n[1]}}),{key:e,first:null,c(){t=pt(),Te(i.$$.fragment),this.first=t},m(s,o){X(s,t,o),Se(i,s,o),r=!0},p(s,o){n=s;const a={};o&1&&(a.roomLabel=n[13]),o&2&&(a.five=n[1]),i.$set(a)},i(s){r||(N(i.$$.fragment,s),r=!0)},o(s){Z(i.$$.fragment,s),r=!1},d(s){s&&Y(t),Ie(i,s)}}}function mD(e){let n,t=[],i=new fD,r,s,o,a=e[0];const l=c=>c[13].id;for(let c=0;c<a.length;c+=1){let h=Yb(e,a,c),u=l(h);i.set(u,t[c]=Xb(u,h))}return{c(){n=H("div");for(let c=0;c<t.length;c+=1)t[c].c();_(n,"class","room-labels-container svelte-9eg4zi")},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(vs.call(null,n)),lt(n,"clientWidth",e[6]),lt(n,"clientHeight",e[7])],s=!0)},p(c,[h]){h&3&&(a=c[0],Fe(),t=Ni(t,h,l,1,c,a,i,n,gs,Xb,null,Yb),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 gD(e,n,t){var g;let i,{five:r}=n,{roomLabels:s}=n,o,a,l=(g=r.model.shownFloor)!=null?g:null;function c(y){if(!(l===null||y.floorIndex===l))return!1;const A=new ee.Raycaster,w=r.camera.position.clone(),x=new ee.Vector3(y.position.x,y.position.y,y.position.z),M=x.distanceTo(w);A.set(w.clone(),x.clone().sub(w).normalize());const[E]=r.model.intersectRaycaster(A);return!(E&&E.distance+1<M)}function h(y,b){const w=new ee.Vector3(y.position.x,y.position.y,y.position.z).clone().project(r.camera),x=Math.ceil((w.x+1)/2*b.x),M=Math.ceil((-w.y+1)/2*b.y);return`translate(${x}px, ${M}px)`}function u(y){const{rendererSize:b}=y,A=new Map;function w(M){const E=A.get(M.id);if(E)return E;const{x:S,y:T,z}=M.position,D=new ee.Vector3(S,T,z).clone().distanceTo(r.camera.position);return A.set(M.id,D),D}return s.map(M=>{const E=c(M),S=E?h(M,b):M.transform,T=w(M),D=s.filter(k=>k.visible&&w(k)<T).length*10;return Pe(O({},M),{visible:E,transform:S,zIndex:D})})}function d(){t(0,s=u({rendererSize:i,shownFloor:l}))}function f(y){t(4,l=y)}r.on("cameraUpdate",d),r.on("modelShownFloorChange",f),Rb(()=>{t(0,s=u({rendererSize:i,shownFloor:l}))}),yi(()=>{r.off("cameraUpdate",d),r.off("modelShownFloorChange",f)});const m=y=>{t(2,o=y.detail)},p=y=>{t(3,a=y.detail)};return e.$$set=y=>{"five"in y&&t(1,r=y.five),"roomLabels"in y&&t(0,s=y.roomLabels)},e.$$.update=()=>{e.$$.dirty&12&&t(5,i={x:o,y:a}),e.$$.dirty&48&&t(0,s=u({rendererSize:i,shownFloor:l}))},[s,r,o,a,l,i,m,p]}class vD extends Oe{constructor(n){super(),ke(this,n,gD,mD,Le,{five:1,roomLabels:0},pD)}}function yD(e){return e.model_room_labels.map(({id:n,pano_index:t,floor_index:i,name:r,position:s,longitude:o})=>({id:n,name:r,position:s,longitude:o,panoIndex:t,floorIndex:i,zIndex:0,visible:!1,transform:""}))}class bD{constructor(n){v(this,"five");v(this,"enabled",!0);v(this,"fiveModeEnabled");v(this,"app");v(this,"wrapper");v(this,"roomLabels",[]);v(this,"container",document.createElement("div"));v(this,"onFiveModeChange",n=>{if(!this.checkFiveMode(n)){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.checkFiveMode(this.five.getCurrentState().mode),this.render()})});this.five=n,this.fiveModeEnabled=this.checkFiveMode(n.getCurrentState().mode),this.container.classList.add("model-room-label-plugin-container"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this.container.style.pointerEvents="none",this.container.style.left="0",this.container.style.top="0",this.container.style.zIndex="5",this.five.once("dispose",()=>this.dispose()),this.five.on("modeChange",this.onFiveModeChange),this.render()}dispose(){this.five.off("modeChange",this.onFiveModeChange),this.container.remove()}load(n){this.roomLabels=yD(n),this.render()}appendTo(n){return this.wrapper=n,n.appendChild(this.container),this.render(),this}disable(){return this.enabled=!1,this.render(),this}enable(){return this.enabled=!0,this.render(),this}checkFiveMode(n){return n==="Floorplan"||n==="Mapview"}render(){var n;if(this.wrapper){if(!this.enabled||!this.fiveModeEnabled){(n=this.app)==null||n.$destroy(),this.app=void 0;return}this.app?this.app.$set({five:this.five,roomLabels:this.roomLabels}):this.app=new vD({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const AD=e=>new bD(e),wD={name:"ModelRoomLabelPlugin",version:0};var ys=(e=>(e[e.FLOOR=1]="FLOOR",e[e.CEILING=2]="CEILING",e[e.BOUNDING_CENTER=3]="BOUNDING_CENTER",e))(ys||{});function Zs(e){return te(this,null,function*(){try{return[null,yield e]}catch(n){return n instanceof Error?[n,null]:[new Error(""),null]}})}function za(e){return e<.5?4*e*e*e:.5*Math.pow(2*e-2,3)+1}function Zb(e){const n=e-1;return n*n*n+1}function In(e,{delay:n=0,duration:t=400,easing:i=Lr}={}){const r=+getComputedStyle(e).opacity;return{delay:n,duration:t,easing:i,css:s=>`opacity: ${s*r}`}}function Jb(e,{delay:n=0,duration:t=400,easing:i=Zb,x:r=0,y:s=0,opacity:o=0}={}){const a=getComputedStyle(e),l=+a.opacity,c=a.transform==="none"?"":a.transform,h=l*(1-o),[u,d]=Ib(r),[f,m]=Ib(s);return{delay:n,duration:t,easing:i,css:(p,g)=>`
|
|
@@ -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 ID extends Oe{constructor(n){super(),ke(this,n,SD,_D,Le,{content:0},ED)}}function TD(e){Ue(e,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function DD(e){let n,t;return n=new PD({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 LD(e){let n,t;return n=new ID({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 kD(e){let n,t,i,r;const s=[LD,DD],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 OD(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 qb extends Oe{constructor(n){super(),ke(this,n,OD,kD,Le,{floorIndex:2,floorplanData:3},TD)}}function RD(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 zD(e){let n,t=e[15].outerHTML+"",i;return{c(){n=new Wu(!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 BD(e){let n,t,i,r,s,o,a=e[1]&&Kb(e),l=e[0]&&$b(e),c=e[2]&&eA(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(vs.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=Kb(h),a.c(),a.m(n,t)):a&&(a.d(1),a=null),h[0]?l?l.p(h,u):(l=$b(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=eA(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 Kb(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 $b(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 eA(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 ND(e){let n,t,i;function r(a,l){if(a[4]===void 0)return BD;if(a[15])return zD}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(vs.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 FD(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 VD(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=>FD(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",q=(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)},qe=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,q,g,x,M,E,T,be,u,l,h,c,a,o,Ae,qe,we,le]}class GD extends Oe{constructor(n){super(),ke(this,n,VD,ND,Le,{pxmm:20,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,room:3,hoveredRoom:21,getRoomAreaText:22,getRoomDimensionText:23,getLabelElement:4,adaptiveRoomLabelVisibleEnable:24},RD,[-1,-1])}}function jD(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 tA(e,n,t){const i=e.slice();return i[14]=n[t],i}function nA(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=tA(e,a,c),u=l(h);i.set(u,t[c]=iA(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(vs.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,gs,iA,null,tA),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 iA(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 GD({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 HD(e){let n,t,i=e[10]&&nA(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=nA(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 UD(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 WD extends Oe{constructor(n){super(),ke(this,n,UD,HD,Le,{floorIndex:11,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,floorplanData:12,hoveredRoom:3,getRoomAreaText:4,getRoomDimensionText:5,getLabelElement:6,adaptiveRoomLabelVisibleEnable:7},jD)}}function QD(e){Ue(e,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function rA(e,n,t){const i=e.slice();return i[11]=n[t],i[13]=t,i}function sA(e,n,t){const i=e.slice();return i[14]=n[t],i}function oA(e){let n;return{c(){n=H("div"),_(n,"class","floorplan-plugin__rule-scale svelte-djlmk4"),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 aA(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-djlmk4"),Ee(i,"is-row",n[2]),_(t,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),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 YD(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]=oA(sA(e,h,m));let d=e[4];const f=m=>m[13];for(let m=0;m<d.length;m+=1){let p=rA(e,d,m),g=f(p);l.set(g,a[m]=aA(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-djlmk4"),_(r,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),Ee(r,"is-row",e[2]),_(o,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),_(n,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+e[0]+" svelte-djlmk4"),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=sA(m,h,g);u[g]?u[g].p(y,p):(u[g]=oA(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,vm,aA,null,rA)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+m[0]+" svelte-djlmk4")&&_(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 Na=1e3,Fa=180;function XD(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-(Na-Fa)*2,c=s.max.y-s.min.y-(Na-Fa)*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-Na+Fa)/l:0,g=a?0:(m-s.min.y-Na+Fa)/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-Na+Fa)/l:0,w=a?0:(b-s.min.y-Na+Fa)/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 ZD extends Oe{constructor(n){super(),ke(this,n,XD,YD,Le,{type:0,data:5,bounding:6,getRuleDistanceText:1},QD)}}function JD(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 lA(e,n,t){const i=e.slice();return i[13]=n[t][0],i[14]=n[t][1],i}function cA(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 ZD({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 qD(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=lA(e,s,a),c=o(l);i.set(c,t[a]=cA(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,gs,cA,null,lA),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 hA=1e3,uA=180;function KD(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-(hA-uA)*2),e.$$.dirty&2&&t(8,h=i.max.y-i.min.y-(hA-uA)*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 $D extends Oe{constructor(n){super(),ke(this,n,KD,qD,Le,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},JD)}}function id(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 dA({x:e,y:n},t){const{max:i,min:r}=t;return{x:e-r.x,y:i.y-n}}function eL(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 tL(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 nL(e,n){return Math.max(...n.work.observers.map(i=>e.z>=i.standingPosition.z?i.floorIndex:0))}function iL(e){let n;return{c(){n=zt("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 rL(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=id(r,{needZ:!0}))},[i,r]}class sL extends Oe{constructor(n){super(),ke(this,n,rL,iL,Le,{path:1})}}function oL(e){let n,t,i,r,s,o;return{c(){n=zt("defs"),t=zt("pattern"),i=zt("rect"),r=zt("path"),s=ye(),o=zt("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 wm=6;function aL(e,n,t){let i,{path:r}=n;const s=wm*2,o=`M0 ${wm} h ${s} M${wm} 0 v ${s}`;return e.$$set=a=>{"path"in a&&t(3,r=a.path)},e.$$.update=()=>{e.$$.dirty&8&&t(0,i=id(r,{needZ:!0}))},[i,s,o,r]}class lL extends Oe{constructor(n){super(),ke(this,n,aL,oL,Le,{path:3})}}function cL(e){let n,t,i,r,s,o,a,l,c,h,u;return{c(){n=zt("defs"),t=zt("pattern"),i=zt("rect"),r=zt("pattern"),s=zt("rect"),o=ye(),a=zt("path"),l=ye(),c=zt("path"),h=ye(),u=zt("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 hL(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=id(r,{needZ:!0}))},[i,r]}class uL extends Oe{constructor(n){super(),ke(this,n,hL,cL,Le,{path:1})}}function dL(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 fA(e,n,t){const i=e.slice();return i[5]=n[t],i}function fL(e){let n,t;return n=new lL({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 pL(e){let n,t;return n=new uL({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 mL(e){let n,t;return n=new sL({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 pA(e){let n,t,i,r;const s=[mL,pL,fL],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=zt("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 gL(e){let n,t,i=e[0],r=[];for(let o=0;o<i.length;o+=1)r[o]=pA(fA(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=fA(o,i,l);r[l]?(r[l].p(c,a),N(r[l],1)):(r[l]=pA(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 vL(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=>dA(c,s.bounding))})))},[i,o,a,r,s]}class yL extends Oe{constructor(n){super(),ke(this,n,vL,gL,Le,{floorIndex:3,floorplanData:4},dL)}}function bL(e){Ue(e,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function AL(e){let n,t,i,r;return{c(){n=zt("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 wL(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=id(s.path,{needZ:!0,format:m=>dA(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 xL extends Oe{constructor(n){super(),ke(this,n,wL,AL,Le,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},bL)}}function ML(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 mA(e,n,t){const i=e.slice();return i[6]=n[t],i}function gA(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 xL({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 CL(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=mA(e,o,l),h=a(c);r.set(h,i[l]=gA(h,c))}return{c(){n=H("div"),t=zt("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,gs,gA,null,mA),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 PL(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 vA extends Oe{constructor(n){super(),ke(this,n,PL,CL,Le,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},ML)}}function EL(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 yA(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 _L(e){let n,t,i,r,s=e[0].text&&yA(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=yA(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 SL(e,n,t){let{missingFloorConfig:i}=n;return e.$$set=r=>{"missingFloorConfig"in r&&t(0,i=r.missingFloorConfig)},[i]}class IL extends Oe{constructor(n){super(),ke(this,n,SL,_L,Le,{missingFloorConfig:0},EL)}}const bs="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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C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function xm(e){return e*180/Math.PI}function TL(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 DL(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]||bs})`),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]||bs})`);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 LL(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=-xm(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 kL=class extends Oe{constructor(n){super(),ke(this,n,LL,DL,Le,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},TL)}};const OL="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//t8P97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EDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function RL(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 zL(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(${OL})`),_(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 BL(e){let n,t=e[1]&&zL(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 NL(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?xm(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 FL extends Oe{constructor(n){super(),ke(this,n,NL,BL,Le,{floorplanData:3,northDesc:0},RL)}}function VL(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 GL(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 yL({props:d});let f=(e[3]||e[5])&&bA(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 qb({props:p});let g=e[6]&&AA(e),y=e[10]&&wA(e),b=e[4]&&xA(e),A=e[22]&&MA(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=bA(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=AA(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=wA(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=xA(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=MA(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 jL(e){let n,t;return n=new IL({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 bA(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 vA({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 AA(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 WD({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 wA(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 $D({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 xA(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 kL({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 MA(e){let n,t;return n=new FL({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 HL(e){let n,t,i,r,s;const o=[jL,GL],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 UL(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=Am(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 WL=class extends Oe{constructor(n){super(),ke(this,n,UL,HL,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},VL)}};function QL(e){Ue(e,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function CA(e,n,t){const i=e.slice();return i[24]=n[t],i}function PA(e){let n,t,i,r=e[14].floorDatas,s=[];for(let a=0;a<r.length;a+=1)s[a]=EA(CA(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=CA(e,r,c);s[c]?(s[c].p(h,l),N(s[c],1)):(s[c]=EA(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=ms(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 EA(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 WL({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 YL(e){let n,t,i=e[1]&&PA(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=PA(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 XL(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 Mm=class extends Oe{constructor(n){super(),ke(this,n,XL,YL,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},QL)}};const ZL="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 JL(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 qL(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 KL(e){return{floorName:e.floor_name,floorIndex:e.floor_index,rooms:e.rooms.map(qL),rules:e.rules}}function $L(e){return{index:e.index,floorIndex:e.floor_index,position:e.position,positionInImage:e.position_in_image}}function ek(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 As(e){return te(this,null,function*(){const n=yield JL(e.outlines),t=e.computed_data.bounding,i=e.computed_data.floor_datas.map(KL),r=e.computed_data.entrance?ek(e.computed_data.entrance):null;return{outlines:n,entrance:r,bounding:t,floorDatas:i,observers:e.computed_data.observers.map($L)}})}function tk(e,n,t){return e.map(r=>{const s=r.position,o=r.icon?r.icon:{url:ZL,width:45,height:48},a=nL(s,n),l=eL(s,t),c=tL(l,t);return{floorIndex:a,icon:o,id:r.id,position:l,positionInImage:c}})}function nk(e,n){return n(e),e}function Va(e,n){return nk({},t=>{for(const i in e)n.indexOf(i)===-1&&(t[i]=e[i])})}function _A(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 Cm(e,n,t=ys.BOUNDING_CENTER){const i=_A(e,n),r=_A(e,n+1);return t===ys.BOUNDING_CENTER?(e.model.bounding.max.y+e.model.bounding.min.y)/2:t===ys.CEILING?r:i}function Pm(e,n,t,i){const r=Cm(e,t,i==null?void 0:i.attachedTo),s=new P.Vector3(0,r,0),o=new P.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 ws=class{constructor(n,t){v(this,"VERSION","3.49.14-alpha.1");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 zu(n),this.workUtil=this.fiveUtil.workUtil}getCurrentState(){return this.state}absoluteUrl(n){return $p(this.staticPrefix,n)}onWorkCodeChange(){}},Or=class extends ws{};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 SA=500,ik=80;function Js(e,n,t=4){return Math.abs(e-n)<Math.pow(10,-t)}function IA(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:IA});function rk(e){return Object.prototype.toString.call(e)==="[object Object]"}function TA(e){return rk(e)&&!!e.isVector3}function Em(e,n){return te(this,null,function*(){const[t]=yield Zs(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(!sk(i,r))throw new Error("pose 与预期不符")})}function sk(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"?IA(i,r,2):typeof i=="number"&&typeof r=="number"?Js(i,r,2):TA(r)&&TA(i)?r.distanceTo(i)<.01:i===r})}function ok(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 DA(e,n,t=!0){return te(this,null,function*(){if(ok(e,n)===!0)return;const r=e.getCurrentState();if(r.mode!==n.mode){const[h]=yield Zs(Em(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 Zs(e.updateCamera(Va(n,["mode"]),l,t));if(c)throw new Error(ti.UpdateCameraError)})}function Ga(e,n,t=300){const i=e.getElement();i&&(i.style.opacity=n+"",i.style.transition=t===0?"none":`opacity ${t}ms linear`,t!==0&&Promise.race([new Promise(r=>i.addEventListener("transitionend",r,{once:!0})),new Promise(r=>setTimeout(r,t))]).then(()=>{i.style.transition="none"}))}function ak(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 lk(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 ck=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=Pm(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 Zs(DA(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:SA;Ga(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);Ga(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||lk(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();ak(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:ik/((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:bs,attachedTo:ys.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?Va(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 As(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 As(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 Mm({target:this.container,intro:!0,props:i})}};const hk=(e,n)=>new ck(e,n);function uk(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 dk(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 fk=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=Pm(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 Zs(DA(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:SA;Ga(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);Ga(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 P.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&&dk(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(),uk(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(Va(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:bs,attachedTo:ys.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?Va(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(),Ca(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 As(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=Cm(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.fiveUtil.model)==null?void 0:a.bounding.getCenter(new P.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 As(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 Mm({target:this.container,intro:!0,props:i})}};const pk=(e,n)=>new fk(e,n);let mk=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=Pm(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:bs,attachedTo:ys.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?Va(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 As(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=Cm(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new P.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 As(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 Em(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;Ga(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;Ga(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 Mm({target:this.container,intro:!0,props:i})}};const gk=(e,n)=>new mk(e,n);function _m(e,n=200){let t;return function(...i){t||(e(...i),t=setTimeout(function(){t=null},n))}}function vk(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 yk(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]||bs)+")"),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]||bs)+")"),(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 bk(e){return`rotate(${Math.floor(e/Math.PI*180)*-1+45}deg)`}function Ak(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=_m(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=bk(d))},[h,o,s,r,a,l,c,u,d,f,i]}class wk extends Oe{constructor(n){super(),ke(this,n,Ak,yk,Le,{five:4,pxmm:5,floorplanData:6,cameraImageUrl:0},vk)}}function xk(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 LA(e,n,t){const i=e.slice();return i[1]=n[t],i}function kA(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 Mk(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=LA(e,r,o),l=s(a);i.set(l,t[o]=kA(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,vm,kA,null,LA))},i:de,o:de,d(o){o&&Y(n);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Ck(e,n,t){let{extraObjects:i=[]}=n;return e.$$set=r=>{"extraObjects"in r&&t(0,i=r.extraObjects)},[i]}class Pk extends Oe{constructor(n){super(),ke(this,n,Ck,Mk,Le,{extraObjects:0},xk)}}function Ek(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 _k(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 qb({props:l}),i=new Pk({props:{extraObjects:e[7]}});let c=e[3]&&OA(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=OA(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 Sk(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 OA(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 vA({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 Ik(e){let n,t,i,r;const s=[Sk,_k],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 Tk(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 Dk extends Oe{constructor(n){super(),ke(this,n,Tk,Ik,Le,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:10,highlightData:5,missingFloorImageUrl:6},Ek)}}function Lk(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 RA(e){let n,t,i,r,s=e[8]!==0&&zA(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(vs.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=zA(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 zA(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 Dk({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 wk({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 kk(e){let n,t,i=e[1]&&RA(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=RA(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 Ok(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 Rk extends Oe{constructor(n){super(),ke(this,n,Ok,kk,Le,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6,missingFloorImageUrl:7},Lk)}}let zk=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:bs,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 As(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=tk(t,this.five,this.data),this.render())}formatData(t){return te(this,null,function*(){return yield As(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 Rk({target:this.wrapper,props:t})}};const Bk=(e,n)=>new zk(e,n),Nk=[{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:"和室"}],Fk=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],Vk=[{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:"写字楼"}],Sm=(e,n,t)=>{const i=new P.Matrix4,r=new P.Euler(e,n,t,"YXZ");return i.makeRotationFromEuler(r),i},Gk=(e,{scale:n,rotation:t,position:i})=>{if(n&&e.scale.set(n,n,n),t){const[r,s,o]=t;r&&e.applyMatrix4(Sm(r,0,0)),s&&e.applyMatrix4(Sm(0,s,0)),o&&e.applyMatrix4(Sm(0,0,o))}return i&&e.position.set(i.x,i.y,i.z),e};function BA(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 jk=(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 go.FBXLoader().loadAsync(y);return BA(A,{transparent:!0,side:P.DoubleSide,blending:P.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,Gk(g,{position:s,rotation:o,scale:a})}return{load:c,disable:f,enable:d}};function Hk(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 Uk=({x:e,y:n,z:t})=>new ee.Vector3(e,n,t),Wk=(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,q;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=Uk(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 go.FBXLoader().loadAsync(M);E.position.copy(w),E.rotation.z=x,E.scale.set(.8,.8,.8),BA(E,{transparent:!0,side:P.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=(q=n.name)!=null?q:"入户门";return S.material=new ee.MeshBasicMaterial({transparent:!0,map:Hk(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)}},Qk=Gi;function Yk(e,n,t,i=Qk.Linear.None){const r=new ih(e).to(n,t).easing(i);yc(()=>r.start(0));const s=Aa(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 Xk(e,n){return Yk({progress:0},{progress:1},e,n)}var NA=(e=>(e.Move="Move",e.Rotate="Rotate",e))(NA||{}),sr=(e=>(e.Clockwise="Clockwise",e.Anticlockwise="Anticlockwise",e.Loop="Loop",e))(sr||{});const rd=Math.PI*2;function FA(e){return(e%rd+rd)%rd}function VA(e){return e%rd}function Im(e,n,t){return e+(n-e)*t}const Tm=(e,n,t)=>{const i=Math.PI,r=i*2;let s=FA(e),o=FA(n);return t===sr.Anticlockwise&&s<o&&(s+=r),t===sr.Clockwise&&o<s&&(o+=r),t===sr.Loop&&o-s>i?Tm(s,o,sr.Anticlockwise):t===sr.Loop&&s-o>i?Tm(s,o,sr.Clockwise):{from:s,to:o}},Zk=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=VA(o.latitude),l=VA(s.latitude),{from:c,to:h}=Tm(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=Im(u.longitude,d.longitude,A),w.latitude=Im(u.latitude,d.latitude,A),w.fov=Im(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=Xk(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 GA(e,n){return e.x===n.x&&e.y===n.y}function jA(e,n){return Math.abs(e)===1/0&&Math.abs(n)===1/0?!0:Math.abs(e-n)<.001}function sd(e,n){return(n.y-e.y)/(n.x-e.x)}function HA(e,n,t){const i=sd(e[1],e[0]),r=sd(n[1],n[0]);if(isNaN(i)||isNaN(r)||jA(i,r))return!1;if(od(e[0],n))return e[0];if(od(e[1],n))return e[1];if(od(n[0],e))return n[0];if(od(n[1],e))return n[1];if(t&&!qk(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 od(e,n){return GA(e,n[0])||GA(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&&jA(sd(n[0],e),sd(e,n[1]))}function Jk(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 ad(e,n,t){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)}function qk(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)&&ad(n[0],e[1],e[0])*ad(e[1],n[1],e[0])>0&&ad(e[0],n[1],n[0])*ad(n[1],e[1],n[0])>0?1:0}function UA(e,n=0){n<=0?requestAnimationFrame(e):requestAnimationFrame(()=>UA(e,n-1))}const Kk=`<style type="text/css">
|
|
3174
|
+
`;return e.$$set=s=>{"content"in s&&t(0,i=s.content)},[i,r]}class ID extends Oe{constructor(n){super(),ke(this,n,SD,_D,Le,{content:0},ED)}}function TD(e){Ue(e,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function DD(e){let n,t;return n=new PD({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 LD(e){let n,t;return n=new ID({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 kD(e){let n,t,i,r;const s=[LD,DD],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 OD(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 qb extends Oe{constructor(n){super(),ke(this,n,OD,kD,Le,{floorIndex:2,floorplanData:3},TD)}}function RD(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 zD(e){let n,t=e[15].outerHTML+"",i;return{c(){n=new Wu(!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 BD(e){let n,t,i,r,s,o,a=e[1]&&Kb(e),l=e[0]&&$b(e),c=e[2]&&eA(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(vs.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=Kb(h),a.c(),a.m(n,t)):a&&(a.d(1),a=null),h[0]?l?l.p(h,u):(l=$b(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=eA(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 Kb(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 $b(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 eA(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 ND(e){let n,t,i;function r(a,l){if(a[4]===void 0)return BD;if(a[15])return zD}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(vs.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 FD(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 VD(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=>FD(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",q=(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)},qe=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,q,g,x,M,E,T,be,u,l,h,c,a,o,Ae,qe,we,le]}class GD extends Oe{constructor(n){super(),ke(this,n,VD,ND,Le,{pxmm:20,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,room:3,hoveredRoom:21,getRoomAreaText:22,getRoomDimensionText:23,getLabelElement:4,adaptiveRoomLabelVisibleEnable:24},RD,[-1,-1])}}function jD(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 tA(e,n,t){const i=e.slice();return i[14]=n[t],i}function nA(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=tA(e,a,c),u=l(h);i.set(u,t[c]=iA(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(vs.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,gs,iA,null,tA),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 iA(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 GD({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 HD(e){let n,t,i=e[10]&&nA(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=nA(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 UD(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 WD extends Oe{constructor(n){super(),ke(this,n,UD,HD,Le,{floorIndex:11,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,floorplanData:12,hoveredRoom:3,getRoomAreaText:4,getRoomDimensionText:5,getLabelElement:6,adaptiveRoomLabelVisibleEnable:7},jD)}}function QD(e){Ue(e,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function rA(e,n,t){const i=e.slice();return i[11]=n[t],i[13]=t,i}function sA(e,n,t){const i=e.slice();return i[14]=n[t],i}function oA(e){let n;return{c(){n=H("div"),_(n,"class","floorplan-plugin__rule-scale svelte-djlmk4"),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 aA(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-djlmk4"),Ee(i,"is-row",n[2]),_(t,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),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 YD(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]=oA(sA(e,h,m));let d=e[4];const f=m=>m[13];for(let m=0;m<d.length;m+=1){let p=rA(e,d,m),g=f(p);l.set(g,a[m]=aA(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-djlmk4"),_(r,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),Ee(r,"is-row",e[2]),_(o,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),_(n,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+e[0]+" svelte-djlmk4"),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=sA(m,h,g);u[g]?u[g].p(y,p):(u[g]=oA(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,vm,aA,null,rA)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+m[0]+" svelte-djlmk4")&&_(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 Na=1e3,Fa=180;function XD(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-(Na-Fa)*2,c=s.max.y-s.min.y-(Na-Fa)*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-Na+Fa)/l:0,g=a?0:(m-s.min.y-Na+Fa)/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-Na+Fa)/l:0,w=a?0:(b-s.min.y-Na+Fa)/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 ZD extends Oe{constructor(n){super(),ke(this,n,XD,YD,Le,{type:0,data:5,bounding:6,getRuleDistanceText:1},QD)}}function JD(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 lA(e,n,t){const i=e.slice();return i[13]=n[t][0],i[14]=n[t][1],i}function cA(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 ZD({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 qD(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=lA(e,s,a),c=o(l);i.set(c,t[a]=cA(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,gs,cA,null,lA),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 hA=1e3,uA=180;function KD(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-(hA-uA)*2),e.$$.dirty&2&&t(8,h=i.max.y-i.min.y-(hA-uA)*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 $D extends Oe{constructor(n){super(),ke(this,n,KD,qD,Le,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},JD)}}function id(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 dA({x:e,y:n},t){const{max:i,min:r}=t;return{x:e-r.x,y:i.y-n}}function eL(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 tL(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 nL(e,n){return Math.max(...n.work.observers.map(i=>e.z>=i.standingPosition.z?i.floorIndex:0))}function iL(e){let n;return{c(){n=zt("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 rL(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=id(r,{needZ:!0}))},[i,r]}class sL extends Oe{constructor(n){super(),ke(this,n,rL,iL,Le,{path:1})}}function oL(e){let n,t,i,r,s,o;return{c(){n=zt("defs"),t=zt("pattern"),i=zt("rect"),r=zt("path"),s=ye(),o=zt("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 wm=6;function aL(e,n,t){let i,{path:r}=n;const s=wm*2,o=`M0 ${wm} h ${s} M${wm} 0 v ${s}`;return e.$$set=a=>{"path"in a&&t(3,r=a.path)},e.$$.update=()=>{e.$$.dirty&8&&t(0,i=id(r,{needZ:!0}))},[i,s,o,r]}class lL extends Oe{constructor(n){super(),ke(this,n,aL,oL,Le,{path:3})}}function cL(e){let n,t,i,r,s,o,a,l,c,h,u;return{c(){n=zt("defs"),t=zt("pattern"),i=zt("rect"),r=zt("pattern"),s=zt("rect"),o=ye(),a=zt("path"),l=ye(),c=zt("path"),h=ye(),u=zt("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 hL(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=id(r,{needZ:!0}))},[i,r]}class uL extends Oe{constructor(n){super(),ke(this,n,hL,cL,Le,{path:1})}}function dL(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 fA(e,n,t){const i=e.slice();return i[5]=n[t],i}function fL(e){let n,t;return n=new lL({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 pL(e){let n,t;return n=new uL({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 mL(e){let n,t;return n=new sL({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 pA(e){let n,t,i,r;const s=[mL,pL,fL],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=zt("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 gL(e){let n,t,i=e[0],r=[];for(let o=0;o<i.length;o+=1)r[o]=pA(fA(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=fA(o,i,l);r[l]?(r[l].p(c,a),N(r[l],1)):(r[l]=pA(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 vL(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=>dA(c,s.bounding))})))},[i,o,a,r,s]}class yL extends Oe{constructor(n){super(),ke(this,n,vL,gL,Le,{floorIndex:3,floorplanData:4},dL)}}function bL(e){Ue(e,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function AL(e){let n,t,i,r;return{c(){n=zt("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 wL(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=id(s.path,{needZ:!0,format:m=>dA(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 xL extends Oe{constructor(n){super(),ke(this,n,wL,AL,Le,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},bL)}}function ML(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 mA(e,n,t){const i=e.slice();return i[6]=n[t],i}function gA(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 xL({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 CL(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=mA(e,o,l),h=a(c);r.set(h,i[l]=gA(h,c))}return{c(){n=H("div"),t=zt("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,gs,gA,null,mA),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 PL(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 vA extends Oe{constructor(n){super(),ke(this,n,PL,CL,Le,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},ML)}}function EL(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 yA(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 _L(e){let n,t,i,r,s=e[0].text&&yA(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=yA(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 SL(e,n,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mJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function xm(e){return e*180/Math.PI}function TL(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 DL(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]||bs})`),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]||bs})`);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 LL(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=-xm(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 kL=class extends Oe{constructor(n){super(),ke(this,n,LL,DL,Le,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},TL)}};const OL="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/D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0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function RL(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 zL(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(${OL})`),_(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 BL(e){let n,t=e[1]&&zL(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 NL(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?xm(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 FL extends Oe{constructor(n){super(),ke(this,n,NL,BL,Le,{floorplanData:3,northDesc:0},RL)}}function VL(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 GL(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 yL({props:d});let f=(e[3]||e[5])&&bA(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 qb({props:p});let g=e[6]&&AA(e),y=e[10]&&wA(e),b=e[4]&&xA(e),A=e[22]&&MA(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=bA(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=AA(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=wA(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=xA(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=MA(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 jL(e){let n,t;return n=new IL({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 bA(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 vA({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 AA(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 WD({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 wA(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 $D({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 xA(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 kL({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 MA(e){let n,t;return n=new FL({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 HL(e){let n,t,i,r,s;const o=[jL,GL],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 UL(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=Am(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 WL=class extends Oe{constructor(n){super(),ke(this,n,UL,HL,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},VL)}};function QL(e){Ue(e,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function CA(e,n,t){const i=e.slice();return i[24]=n[t],i}function PA(e){let n,t,i,r=e[14].floorDatas,s=[];for(let a=0;a<r.length;a+=1)s[a]=EA(CA(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=CA(e,r,c);s[c]?(s[c].p(h,l),N(s[c],1)):(s[c]=EA(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=ms(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 EA(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 WL({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 YL(e){let n,t,i=e[1]&&PA(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=PA(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 XL(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 Mm=class extends Oe{constructor(n){super(),ke(this,n,XL,YL,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},QL)}};const ZL="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 JL(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 qL(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 KL(e){return{floorName:e.floor_name,floorIndex:e.floor_index,rooms:e.rooms.map(qL),rules:e.rules}}function $L(e){return{index:e.index,floorIndex:e.floor_index,position:e.position,positionInImage:e.position_in_image}}function ek(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 As(e){return te(this,null,function*(){const n=yield JL(e.outlines),t=e.computed_data.bounding,i=e.computed_data.floor_datas.map(KL),r=e.computed_data.entrance?ek(e.computed_data.entrance):null;return{outlines:n,entrance:r,bounding:t,floorDatas:i,observers:e.computed_data.observers.map($L)}})}function tk(e,n,t){return e.map(r=>{const s=r.position,o=r.icon?r.icon:{url:ZL,width:45,height:48},a=nL(s,n),l=eL(s,t),c=tL(l,t);return{floorIndex:a,icon:o,id:r.id,position:l,positionInImage:c}})}function nk(e,n){return n(e),e}function Va(e,n){return nk({},t=>{for(const i in e)n.indexOf(i)===-1&&(t[i]=e[i])})}function _A(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 Cm(e,n,t=ys.BOUNDING_CENTER){const i=_A(e,n),r=_A(e,n+1);return t===ys.BOUNDING_CENTER?(e.model.bounding.max.y+e.model.bounding.min.y)/2:t===ys.CEILING?r:i}function Pm(e,n,t,i){const r=Cm(e,t,i==null?void 0:i.attachedTo),s=new P.Vector3(0,r,0),o=new P.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 ws=class{constructor(n,t){v(this,"VERSION","3.50.1");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 zu(n),this.workUtil=this.fiveUtil.workUtil}getCurrentState(){return this.state}absoluteUrl(n){return $p(this.staticPrefix,n)}onWorkCodeChange(){}},Or=class extends ws{};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 SA=500,ik=80;function Js(e,n,t=4){return Math.abs(e-n)<Math.pow(10,-t)}function IA(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:IA});function rk(e){return Object.prototype.toString.call(e)==="[object Object]"}function TA(e){return rk(e)&&!!e.isVector3}function Em(e,n){return te(this,null,function*(){const[t]=yield Zs(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(!sk(i,r))throw new Error("pose 与预期不符")})}function sk(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"?IA(i,r,2):typeof i=="number"&&typeof r=="number"?Js(i,r,2):TA(r)&&TA(i)?r.distanceTo(i)<.01:i===r})}function ok(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 DA(e,n,t=!0){return te(this,null,function*(){if(ok(e,n)===!0)return;const r=e.getCurrentState();if(r.mode!==n.mode){const[h]=yield Zs(Em(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 Zs(e.updateCamera(Va(n,["mode"]),l,t));if(c)throw new Error(ti.UpdateCameraError)})}function Ga(e,n,t=300){const i=e.getElement();i&&(i.style.opacity=n+"",i.style.transition=t===0?"none":`opacity ${t}ms linear`,t!==0&&Promise.race([new Promise(r=>i.addEventListener("transitionend",r,{once:!0})),new Promise(r=>setTimeout(r,t))]).then(()=>{i.style.transition="none"}))}function ak(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 lk(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 ck=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=Pm(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 Zs(DA(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:SA;Ga(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);Ga(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||lk(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();ak(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:ik/((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:bs,attachedTo:ys.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?Va(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 As(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 As(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 Mm({target:this.container,intro:!0,props:i})}};const hk=(e,n)=>new ck(e,n);function uk(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 dk(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 fk=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=Pm(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 Zs(DA(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:SA;Ga(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);Ga(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 P.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&&dk(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(),uk(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(Va(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:bs,attachedTo:ys.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?Va(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(),Ca(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 As(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=Cm(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.fiveUtil.model)==null?void 0:a.bounding.getCenter(new P.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 As(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 Mm({target:this.container,intro:!0,props:i})}};const pk=(e,n)=>new fk(e,n);let mk=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=Pm(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:bs,attachedTo:ys.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?Va(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 As(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=Cm(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new P.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 As(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 Em(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;Ga(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;Ga(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 Mm({target:this.container,intro:!0,props:i})}};const gk=(e,n)=>new mk(e,n);function _m(e,n=200){let t;return function(...i){t||(e(...i),t=setTimeout(function(){t=null},n))}}function vk(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 yk(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]||bs)+")"),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]||bs)+")"),(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 bk(e){return`rotate(${Math.floor(e/Math.PI*180)*-1+45}deg)`}function Ak(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=_m(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=bk(d))},[h,o,s,r,a,l,c,u,d,f,i]}class wk extends Oe{constructor(n){super(),ke(this,n,Ak,yk,Le,{five:4,pxmm:5,floorplanData:6,cameraImageUrl:0},vk)}}function xk(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 LA(e,n,t){const i=e.slice();return i[1]=n[t],i}function kA(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 Mk(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=LA(e,r,o),l=s(a);i.set(l,t[o]=kA(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,vm,kA,null,LA))},i:de,o:de,d(o){o&&Y(n);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Ck(e,n,t){let{extraObjects:i=[]}=n;return e.$$set=r=>{"extraObjects"in r&&t(0,i=r.extraObjects)},[i]}class Pk extends Oe{constructor(n){super(),ke(this,n,Ck,Mk,Le,{extraObjects:0},xk)}}function Ek(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 _k(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 qb({props:l}),i=new Pk({props:{extraObjects:e[7]}});let c=e[3]&&OA(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=OA(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 Sk(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 OA(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 vA({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 Ik(e){let n,t,i,r;const s=[Sk,_k],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 Tk(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 Dk extends Oe{constructor(n){super(),ke(this,n,Tk,Ik,Le,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:10,highlightData:5,missingFloorImageUrl:6},Ek)}}function Lk(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 RA(e){let n,t,i,r,s=e[8]!==0&&zA(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(vs.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=zA(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 zA(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 Dk({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 wk({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 kk(e){let n,t,i=e[1]&&RA(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=RA(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 Ok(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 Rk extends Oe{constructor(n){super(),ke(this,n,Ok,kk,Le,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6,missingFloorImageUrl:7},Lk)}}let zk=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:bs,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 As(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=tk(t,this.five,this.data),this.render())}formatData(t){return te(this,null,function*(){return yield As(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 Rk({target:this.wrapper,props:t})}};const Bk=(e,n)=>new zk(e,n),Nk=[{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:"和室"}],Fk=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],Vk=[{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:"写字楼"}],Sm=(e,n,t)=>{const i=new P.Matrix4,r=new P.Euler(e,n,t,"YXZ");return i.makeRotationFromEuler(r),i},Gk=(e,{scale:n,rotation:t,position:i})=>{if(n&&e.scale.set(n,n,n),t){const[r,s,o]=t;r&&e.applyMatrix4(Sm(r,0,0)),s&&e.applyMatrix4(Sm(0,s,0)),o&&e.applyMatrix4(Sm(0,0,o))}return i&&e.position.set(i.x,i.y,i.z),e};function BA(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 jk=(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 go.FBXLoader().loadAsync(y);return BA(A,{transparent:!0,side:P.DoubleSide,blending:P.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,Gk(g,{position:s,rotation:o,scale:a})}return{load:c,disable:f,enable:d}};function Hk(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 Uk=({x:e,y:n,z:t})=>new ee.Vector3(e,n,t),Wk=(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,q;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=Uk(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 go.FBXLoader().loadAsync(M);E.position.copy(w),E.rotation.z=x,E.scale.set(.8,.8,.8),BA(E,{transparent:!0,side:P.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=(q=n.name)!=null?q:"入户门";return S.material=new ee.MeshBasicMaterial({transparent:!0,map:Hk(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)}},Qk=Gi;function Yk(e,n,t,i=Qk.Linear.None){const r=new ih(e).to(n,t).easing(i);yc(()=>r.start(0));const s=Aa(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 Xk(e,n){return Yk({progress:0},{progress:1},e,n)}var NA=(e=>(e.Move="Move",e.Rotate="Rotate",e))(NA||{}),sr=(e=>(e.Clockwise="Clockwise",e.Anticlockwise="Anticlockwise",e.Loop="Loop",e))(sr||{});const rd=Math.PI*2;function FA(e){return(e%rd+rd)%rd}function VA(e){return e%rd}function Im(e,n,t){return e+(n-e)*t}const Tm=(e,n,t)=>{const i=Math.PI,r=i*2;let s=FA(e),o=FA(n);return t===sr.Anticlockwise&&s<o&&(s+=r),t===sr.Clockwise&&o<s&&(o+=r),t===sr.Loop&&o-s>i?Tm(s,o,sr.Anticlockwise):t===sr.Loop&&s-o>i?Tm(s,o,sr.Clockwise):{from:s,to:o}},Zk=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=VA(o.latitude),l=VA(s.latitude),{from:c,to:h}=Tm(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=Im(u.longitude,d.longitude,A),w.latitude=Im(u.latitude,d.latitude,A),w.fov=Im(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=Xk(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 GA(e,n){return e.x===n.x&&e.y===n.y}function jA(e,n){return Math.abs(e)===1/0&&Math.abs(n)===1/0?!0:Math.abs(e-n)<.001}function sd(e,n){return(n.y-e.y)/(n.x-e.x)}function HA(e,n,t){const i=sd(e[1],e[0]),r=sd(n[1],n[0]);if(isNaN(i)||isNaN(r)||jA(i,r))return!1;if(od(e[0],n))return e[0];if(od(e[1],n))return e[1];if(od(n[0],e))return n[0];if(od(n[1],e))return n[1];if(t&&!qk(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 od(e,n){return GA(e,n[0])||GA(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&&jA(sd(n[0],e),sd(e,n[1]))}function Jk(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 ad(e,n,t){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)}function qk(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)&&ad(n[0],e[1],e[0])*ad(e[1],n[1],e[0])>0&&ad(e[0],n[1],n[0])*ad(n[1],e[1],n[0])>0?1:0}function UA(e,n=0){n<=0?requestAnimationFrame(e):requestAnimationFrame(()=>UA(e,n-1))}const Kk=`<style type="text/css">
|
|
3175
3175
|
.PanoRulerPlugin-rule-line {
|
|
3176
3176
|
position: absolute;
|
|
3177
3177
|
transform-origin: left center;
|
|
@@ -3264,7 +3264,7 @@ void main() {
|
|
|
3264
3264
|
<div class="PanoRulerPlugin-rule-label-name">${t.options.distanceText(g)}</div>
|
|
3265
3265
|
</div>
|
|
3266
3266
|
</div>
|
|
3267
|
-
`,b=document.createElement("div");return b.setAttribute("class","PanoRulerPlugin-rule"),b.setAttribute("data-name",p),b.setAttribute("style","display: none"),b.innerHTML=y,b},r=document.createElement("div");r.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Kk,r.appendChild(s);const o={},a=(p,g)=>{var A;if(t.loaded)throw new Error("标尺被重复初始化!");const y=e5(p,e),b=e.work;if(!b)return!1;for(const w in g){const x=g[w],M=(A=b.observers[0])==null?void 0:A.standingPosition;if(!M)return;const E=x.map(({x:S,z:T,observers:z})=>{const D=z.length>0?p.rooms[p.observers[z[0]]].name:"",k=y[D]?y[D].floor:null;let R=1/0,G={index:0,x:M.x,y:M.y,z:M.z};z.forEach(ie=>{if(!b.observers[ie])return;const{standingPosition:pe}=b.observers[ie],be={index:ie,x:pe.x,y:pe.y,z:pe.z},Ae=$k({x:S,z:T},be);k?Ae<R&&Math.abs(be.y-k)<.3&&(R=Ae,G=be):Ae<R&&(R=Ae,G=be)});const I=new ee.Vector3(S,G.y,T);Object.assign(I,{observers:z});const U=y[D]?y[D].roof:null,q=U?new ee.Vector3(S,U,T):null;return q&&Object.assign(q,{observers:z}),{origin:I,vertical:q}});o[w]={origins:E.map(S=>S.origin),rules:[]};for(const{origin:S,vertical:T}of E){if(!T)continue;const z=i(w,S.distanceTo(T));r.append(z),o[w].rules.push({vertical:!0,rule:[S,T],$element:z})}for(let S=0;S<E.length;S++){let T=S+1;T>=E.length&&(T=0);const{origin:z}=E[S],{origin:D}=E[T],k=i(w,z.distanceTo(D));r.append(k),o[w].rules.push({vertical:!1,rule:[z,D],$element:k})}}return t.loaded=!0,!0},l=(p,g,y)=>te(this,null,function*(){const b=p||n.roomInfo,A=g||n.roomRules;if(!b||!A)throw new Error("标尺数据依赖不齐全!");return t.loaded=!1,t.options=O(O({},t.options),y||{}),e.model.loaded?a(b,A):yield new Promise(w=>e.once("modelLoaded",()=>w(a(b,A))))});n.roomInfo&&n.roomRules&&l(n.roomInfo,n.roomRules);const c=(p,g,y,b)=>{const A=[[{x:0,y:0},{x:y,y:0}],[{x:0,y:0},{x:0,y:b}],[{x:y,y:0},{x:y,y:b}],[{x:0,y:b},{x:y,y:b}]],w=[];for(let x=0;x<A.length;x++){const M=HA([p,g],[A[x][0],A[x][1]],!0);M&&w.push(M)}return w.length===0?!1:w},h=()=>{var T;const p=(T=e.getElement())==null?void 0:T.parentElement;if(!p||!t.loaded||Object.keys(o).length<=0)return;const{panoIndex:g,camera:y,currentMode:b}=e;if(g===void 0)return;let A;for(const z in o)z.split(",").indexOf(g.toString())>=0&&(A=z);if(!A){for(const z in o)for(const{$element:D}of o[z].rules)D.style.display="none";return}const w=y.position,x=y.getWorldDirection(new ee.Vector3),M=p.clientWidth,E=p.clientHeight;if(b!==Zt.Five.Mode.Panorama){for(const z in o)for(const{$element:D}of o[z].rules)D.style.display="none";return}for(const z in o)for(const{$element:D}of o[z].rules)D.style.display=z===A?"block":"none";const[S]=o[A].origins.slice().filter(z=>z.observers.indexOf(g)>=0).sort((z,D)=>{const k=z.clone().setY(0).sub(w).normalize().angleTo(x.clone().setY(0)),R=D.clone().setY(0).sub(w).normalize().angleTo(x.clone().setY(0));return k-R});for(const{rule:z,vertical:D,$element:k}of o[A].rules){const[R,G]=z,I=k.querySelector(".PanoRulerPlugin-rule-line");if(!I)return;if(!S){k.style.display="none";continue}if(R!==S&&G!==S){k.style.display="none";continue}if(R.distanceTo(G)<.3){k.style.display="none";continue}if(R.observers.indexOf(g)===-1||G.observers.indexOf(g)===-1){k.style.display="none";continue}if(R.clone().sub(w).normalize().angleTo(x)>Math.PI/2){k.style.display="none";continue}if(G.clone().sub(w).normalize().angleTo(x)>Math.PI/2){k.style.display="none";continue}const K=R.distanceTo(G);if(G.clone().sub(G.clone().sub(R).divide(new ee.Vector3(2,2,2))).distanceTo(w)/K>8){k.style.display="none";continue}const pe=R.clone().project(y),be=(pe.x+1)/2*M,Ae=(-pe.y+1)/2*E,qe=G.clone().project(y),we=(qe.x+1)/2*M,le=(-qe.y+1)/2*E,se=Math.sqrt(Math.pow(we-be,2)+Math.pow(le-Ae,2));let Me=se,Ge=50;const ae=c({x:~~be,y:~~Ae},{x:~~we,y:~~le},M,E);if(ae&&ae.length===1&&(S===R?(Me=Math.sqrt(Math.pow(ae[0].x-be,2)+Math.pow(ae[0].y-Ae,2)),Ge=Me/se*50):S===G&&(Me=Math.sqrt(Math.pow(ae[0].x-we,2)+Math.pow(ae[0].y-le,2)),Ge=100-Me/se*50)),ae&&ae.length===2){const Ce={x:(ae[0].x+ae[1].x)/2,y:(ae[0].y+ae[1].y)/2};Ge=Math.sqrt(Math.pow(Ce.x-be,2)+Math.pow(Ce.y-Ae,2))/se*100}const De=(Math.PI/2-Math.atan2(we-be,Ae-le))/Math.PI*180,We=I.querySelector(".PanoRulerPlugin-rule-label"),gt=We.children[0].clientWidth;gt>=se||gt/2>=Ge/100*se||gt/2>=(1-Ge/100)*se?I.style.display="none":(I.style.display="block",I.style.width=se+"px",I.style.left=be+"px",I.style.top=Ae+"px",I.style.transform=`rotate(${-De}deg)`,We.style.left=`${Ge}%`)}},u=()=>UA(h),d=()=>{var p,g;return t.loaded?(t.enable||(r.setAttribute("class","PanoRulerPlugin"+(t.options.className?" "+t.options.className:"")),(g=(p=e.getElement())==null?void 0:p.parentElement)==null||g.append(r),h(),e.on("modeChange",h),e.on("cameraUpdate",u),t.enable=!0),!0):!1},f=()=>(t.enable&&(e.off("modeChange",h),e.off("cameraUpdate",u),r&&r.remove(),t.enable=!1),!0);function m(p){if(p.distanceText&&p.distanceText!==t.options.distanceText){const g=p.distanceText;t.options.distanceText=g,Object.values(o).forEach(y=>{y.rules.forEach(b=>{const[A,w]=b.rule,x=A.distanceTo(w),M=b.$element.querySelector(".PanoRulerPlugin-rule-label-name");M&&(M.innerText=g(x))})})}}return{enable:d,disable:f,load:l,state:t,changeConfigs:m}};function n5(e){Ue(e,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function WA(e,n,t){const i=e.slice();return i[6]=n[t],i}function i5(e){let n,t=e[0].children,i=[];for(let r=0;r<t.length;r+=1)i[r]=QA(WA(e,t,r));return{c(){n=H("div");for(let r=0;r<i.length;r+=1)i[r].c();_(n,"class","rule-mixed-line svelte-1h27ktp")},m(r,s){X(r,n,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(n,null)},p(r,s){if(s&9){t=r[0].children;let o;for(o=0;o<t.length;o+=1){const a=WA(r,t,o);i[o]?i[o].p(a,s):(i[o]=QA(a),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(r){r&&Y(n),Bi(i,r)}}}function r5(e){let n,t;return{c(){n=H("em"),_(n,"class",t=an(e[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),_(n,"style",e[3])},m(i,r){X(i,n,r)},p(i,r){r&1&&t!==(t=an(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&_(n,"class",t),r&8&&_(n,"style",i[3])},d(i){i&&Y(n)}}}function QA(e){let n,t,i=`${e[6].width}px`;return{c(){n=H("div"),_(n,"class",t=an(e[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),_(n,"style",e[3]),W(n,"width",i)},m(r,s){X(r,n,s)},p(r,s){s&1&&t!==(t=an(r[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&_(n,"class",t),s&8&&_(n,"style",r[3]),(s&8||s&9&&i!==(i=`${r[6].width}px`))&&W(n,"width",i)},d(r){r&&Y(n)}}}function s5(e){let n,t,i,r,s=e[0].labelElement+"",o,a,l=`${e[0].labelOffset}%`,c=`${e[0].width}px`,h=`${e[0].left}px`,u=`${e[0].top}px`,d=`rotate(${e[0].rotateDeg}deg)`;function f(g,y){return g[0].children.length===0?r5:i5}let m=f(e),p=m(e);return{c(){n=H("div"),p.c(),t=ye(),i=H("div"),r=H("div"),o=Mt(s),_(r,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),ln(()=>e[4].call(r)),_(i,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),W(i,"left",l),_(n,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),W(n,"width",c),W(n,"left",h),W(n,"top",u),W(n,"transform",d),W(n,"display",e[0].visible&&e[2]?"block":"none")},m(g,y){X(g,n,y),p.m(n,null),Q(n,t),Q(n,i),Q(i,r),Q(r,o),a=lm(r,e[4].bind(r))},p(g,[y]){m===(m=f(g))&&p?p.p(g,y):(p.d(1),p=m(g),p&&(p.c(),p.m(n,t))),y&1&&s!==(s=g[0].labelElement+"")&&Pt(o,s),y&1&&l!==(l=`${g[0].labelOffset}%`)&&W(i,"left",l),y&1&&c!==(c=`${g[0].width}px`)&&W(n,"width",c),y&1&&h!==(h=`${g[0].left}px`)&&W(n,"left",h),y&1&&u!==(u=`${g[0].top}px`)&&W(n,"top",u),y&1&&d!==(d=`rotate(${g[0].rotateDeg}deg)`)&&W(n,"transform",d),y&5&&W(n,"display",g[0].visible&&g[2]?"block":"none")},i:de,o:de,d(g){g&&Y(n),p.d(),a()}}}function o5(e,n,t){let i,{rulerItemProp:r}=n,s=!0,o,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hh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$.dirty&3&&(o>=r.width||o/2>=r.labelOffset/100*r.width||o/2>=(1-r.labelOffset/100)*r.width?t(2,s=!1):t(2,s=!0))},t(3,i=`--background-image: url(${a})`),[r,o,s,i,l]}class a5 extends Oe{constructor(n){super(),ke(this,n,o5,s5,Le,{rulerItemProp:0},n5)}}function YA(e,n,t){const i=e.slice();return i[12]=n[t],i}function XA(e){let n,t;return n=new a5({props:{rulerItemProp:e[12]}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.rulerItemProp=i[12]),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 l5(e){let n,t,i=e[0],r=[];for(let o=0;o<i.length;o+=1)r[o]=XA(YA(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()},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&1){i=o[0];let l;for(l=0;l<i.length;l+=1){const c=YA(o,i,l);r[l]?(r[l].p(c,a),N(r[l],1)):(r[l]=XA(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 c5(e,n,t){var p,g,y,b;let{five:i}=n,{rulerDatas:r}=n,{options:s}=n,o=[];const a=((g=(p=i.getElement())==null?void 0:p.parentElement)==null?void 0:g.clientWidth)||0,l=((b=(y=i.getElement())==null?void 0:y.parentElement)==null?void 0:b.clientHeight)||0,c=(A,w)=>{const x=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],M=[];for(let E=0;E<x.length;E++){const S=HA([A,w],[x[E][0],x[E][1]],!0);S&&M.push(S)}return M.length===0?!1:M},h=(A,w)=>{const x=A.clone().project(i.camera),M=(x.x+1)/2*a,E=(-x.y+1)/2*l,S=w.clone().project(i.camera),T=(S.x+1)/2*a,z=(-S.y+1)/2*l,D=Math.sqrt(Math.pow(T-M,2)+Math.pow(z-E,2));return{startLeft:M,startTop:E,endLeft:T,endTop:z,distance:D}},u=(A,w,x)=>{const M=i.camera.position,E=i.camera.getWorldDirection(new ee.Vector3),S=A.clone().sub(M).normalize().angleTo(E),T=w.clone().sub(M).normalize().angleTo(E),z=A.distanceTo(w),k=w.clone().sub(w.clone().sub(A).divide(new ee.Vector3(2,2,2))).distanceTo(M),{startLeft:R,startTop:G,endLeft:I,endTop:U,distance:q}=h(A,w),ne=-((Math.PI/2-Math.atan2(I-R,G-U))/Math.PI)*180;let ie=!0;x||(ie=!1),!Fn(A,x)&&!Fn(w,x)&&(ie=!1),z<.3&&(ie=!1),S>Math.PI/2&&(ie=!1),T>Math.PI/2&&(ie=!1),k/z>8&&(ie=!1);let pe=50,be=q;const Ae=c({x:~~R,y:~~G},{x:~~I,y:~~U});if(Ae&&Ae.length===1&&(Fn(A,x)?(be=Math.sqrt(Math.pow(Ae[0].x-R,2)+Math.pow(Ae[0].y-G,2)),pe=be/q*50):Fn(w,x)&&(be=Math.sqrt(Math.pow(Ae[0].x-I,2)+Math.pow(Ae[0].y-U,2)),pe=100-be/q*50)),Ae&&Ae.length===2){const qe={x:(Ae[0].x+Ae[1].x)/2,y:(Ae[0].y+Ae[1].y)/2};pe=Math.sqrt(Math.pow(qe.x-R,2)+Math.pow(qe.y-G,2))/q*100}return{startLeft:R,startTop:G,distance:q,deg:ne,visible:ie,labelOffset:pe,ruleLength:z}},d=()=>{const A=i.panoIndex,w=r.find(D=>D.panoIndex===A);if(!w)return t(0,o=[]);if(i.currentMode!==Zt.Five.Mode.Panorama)return t(0,o=[]);const x=i.camera.position,M=i.camera.getWorldDirection(new ee.Vector3),E=w.lines.map(D=>new ee.Vector3(D.start[0],-D.start[1],-D.start[2])),S=w.lines.map(D=>new ee.Vector3(D.end[0],-D.end[1],-D.end[2])),[T]=E.concat(S).sort((D,k)=>{const R=D.clone().setY(0).sub(x).normalize().angleTo(M.clone().setY(0)),G=k.clone().setY(0).sub(x).normalize().angleTo(M.clone().setY(0));return R-G}),z=w.lines.map(D=>{var be,Ae;const k=D.start,R=D.end,{startLeft:G,startTop:I,distance:U,deg:q,visible:K,labelOffset:ne,ruleLength:ie}=u(new ee.Vector3(k[0],-k[1],-k[2]),new ee.Vector3(R[0],-R[1],-R[2]),T),pe=[];return D.children&&((be=D.children)==null?void 0:be.length)>0&&((Ae=D.children)==null||Ae.forEach(qe=>{const we=qe.start,le=qe.end,{distance:se}=h(new ee.Vector3(we[0],-we[1],-we[2]),new ee.Vector3(le[0],-le[1],-le[2]));pe.push({width:se,state:qe.state})})),{width:U,left:G,top:I,rotateDeg:q,state:D.state,children:pe,labelOffset:ne,visible:K,labelElement:s.distanceText(ie)}});t(0,o=z)},f=()=>yc(d),m=_m(d,80);return Yn(()=>{d(),i.on("panoArrived",d),i.on("modeChange",d),i.on("cameraDirectionUpdate",f),i.on("movingToPano",f),i.on("mouseWheel",()=>m()),i.on("pinchGesture",()=>m())}),yi(()=>{i.off("panoArrived",d),i.off("modeChange",d),i.off("cameraDirectionUpdate",f),i.off("movingToPano",f),i.off("mouseWheel",()=>m()),i.off("pinchGesture",()=>m())}),e.$$set=A=>{"five"in A&&t(1,i=A.five),"rulerDatas"in A&&t(2,r=A.rulerDatas),"options"in A&&t(3,s=A.options)},[o,i,r,s]}class h5 extends Oe{constructor(n){super(),ke(this,n,c5,l5,Le,{five:1,rulerDatas:2,options:3})}}let u5=class{constructor(n,t){v(this,"five");v(this,"container",document.createElement("div"));v(this,"panoRulerProData");v(this,"rulerItems");v(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:n=>`${n.toFixed(1)}m`}});var i,r;this.five=n,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),t&&(t.data&&this.load(t.data),this.state.options=O(O({},this.state.options),t.options||{}),(i=t.options)!=null&&i.className&&this.container.classList.add((r=t.options)==null?void 0:r.className)),this.five.once("modelLoaded",()=>te(this,null,function*(){var s,o;(o=(s=this.five.getElement())==null?void 0:s.parentNode)==null||o.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(n){return te(this,null,function*(){if(!this.five.work)return;const t=n.data;if(!t)throw new Error("标尺数据依赖不齐全!");this.panoRulerProData=t,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return te(this,null,function*(){var n;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new h5({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(n=this.rulerItems)==null||n.$destroy(),this.rulerItems=void 0})}dispose(){var n;this.container&&((n=this.rulerItems)==null||n.$destroy(),this.rulerItems=void 0),this.container.remove()}};const d5=(e,n)=>new u5(e,n),f5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCI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UAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function p5(){const e=document.createElement("div"),n=document.createElement("i"),t=document.createElement("span");return e.appendChild(n),e.appendChild(t),e.style.position="relative",e.style.width="100%",e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.marginTop=`${150/16}rem`,e.style.opacity="0",e.style.transition="opacity 1000ms linear",n.style.display="block",n.style.width=`${134/16}rem`,n.style.height=`${22/16}rem`,n.style.backgroundSize="100%",n.style.backgroundRepeat="no-repeat",n.style.backgroundImage=`url(${f5})`,t.style.marginTop=`${10/16}rem`,t.style.fontSize=`${16/16}rem`,t.style.color="#fff",t.style.opacity="0.7",t.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",t.style.fontWeight="bold",{appendTo(i){i.appendChild(e)},dispose(){e.remove()},setRoom(i){t.innerHTML=i.name+" "+Math.floor(i.size/1e6)+"㎡"},show(){e.style.opacity="1"},hide(){e.style.opacity="0"}}}const m5=new P.TextureLoader;function qs(e){return te(this,null,function*(){return new Promise((n,t)=>{m5.load(e,n,void 0,t)}).then(n=>(n.encoding=P.sRGBEncoding,n.minFilter=P.NearestFilter,n.magFilter=P.NearestFilter,n))})}function ZA(e){return te(this,null,function*(){return qs(e).then(n=>{const t=e.startsWith("data:")?e.includes("png"):new URL(e,location.href).pathname.toLowerCase().endsWith(".png");return{texture:n,transparent:t}})})}const ld={userAction:!0};class g5 extends Or{constructor(t,i){super(t,i);v(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:this.absoluteUrl("/release/web/v3/north-point-circle.96498e69.png"),entryDoorImageUrl:this.absoluteUrl("/release/web/enterDoor.831b8208.png")}});v(this,"data");v(this,"group",new P.Group);v(this,"roomInfoInstance");v(this,"roomInfoWrapperInstance");v(this,"compassMeshTween");v(this,"compassMesh");v(this,"logoMesh");v(this,"logoMeshTween");v(this,"entryDoorMesh");v(this,"dispose",()=>{var t,i,r,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(i=(t=this.compassMesh)==null?void 0:t.material.map)==null||i.dispose(),(s=(r=this.entryDoorMesh)==null?void 0:r.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});v(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});v(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});v(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});v(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});v(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});v(this,"_clearCompassIfNeed",()=>{var t;this.compassMesh&&(this.group.remove(this.compassMesh),(t=this.compassMesh.material.map)==null||t.dispose(),this.compassMesh=null)});v(this,"_clearLogoIfNeed",()=>{var t;this.logoMesh&&(this.group.remove(this.logoMesh),(t=this.logoMesh.material.map)==null||t.dispose(),this.logoMesh=null)});v(this,"_clearEntryDoorIfNeed",()=>{var t;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(t=this.entryDoorMesh.material.map)==null||t.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});v(this,"onFivePanoWillArrive",t=>{var i,r,s,o;t!==this.five.panoIndex&&((i=this.compassMeshTween)==null||i.dispose(),(r=this.compassMesh)==null||r.material.setValues({opacity:0}),(s=this.logoMeshTween)==null||s.dispose(),(o=this.logoMesh)==null||o.material.setValues({opacity:0}))});v(this,"onFivePanoArrived",t=>{var r,s,o,a,l,c,h,u;const i=(o=(s=(r=this.five.work)==null?void 0:r.observers)==null?void 0:s[t])==null?void 0:o.standingPosition;if(this.compassMesh&&i&&(this.compassMesh.position.copy(i.clone().setY(i.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=vc(1e3).onUpdate(({progress:d})=>{var f;(f=this.compassMesh)==null||f.material.setValues({opacity:d}),this.five.needsRender=!0}).play())),this.logoMesh&&i&&(this.logoMesh.position.copy(i.clone().setY(i.y+.011)),this.logoMesh.material.opacity===0&&((l=this.logoMeshTween)==null||l.dispose(),this.logoMeshTween=vc(1e3).onUpdate(({progress:d})=>{var f;(f=this.logoMesh)==null||f.material.setValues({opacity:d}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const f=new P.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(i.y).sub(i).normalize(),m=i.clone().add(f.clone().multiplyScalar(.7)).setY(i.y+.01);this.entryDoorMesh.rotation.z=new P.Vector3(0,0,-1).angleTo(f),this.entryDoorMesh.position.copy(m),((c=this.data)==null?void 0:c.room_observers[t].room.type)===1?(h=this.entryDoorMesh)==null||h.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&i&&(this.roomInfoWrapperInstance.css3DObject.position.copy(i.clone().setY(i.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[t].room)),this.five.needsRender=!0});v(this,"onFiveCameraDirectionUpdate",({longitude:t,latitude:i})=>{var r,s;this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.rotation.z=t,i>.66&&this.five.getCurrentState().mode==="Panorama"?(r=this.roomInfoInstance)==null||r.show():(s=this.roomInfoInstance)==null||s.hide())});v(this,"onFiveModeChange",(t,i,r,s,o)=>{t!==i&&this.setState({visible:t===Zt.Five.Mode.Panorama},{userAction:o})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:O(O({},this.state.config),i||{})})}enable(t=ld){this.setState({enabled:!0},t)}disable(t=ld){this.setState({enabled:!1},t)}show(t=ld){if(this.state.enabled)return this.setState({visible:!0},t),Promise.resolve()}hide(t=ld){if(this.state.enabled)return this.setState({visible:!1},t),Promise.resolve()}setState(t,i={userAction:!0}){var s,o;const r=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=t.visible)!=null?s:r.visible,enabled:(o=t.enabled)!=null?o:r.enabled,config:O(O({},r.config),t.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i.userAction}),t.enabled===!0&&(this._enable(),this.hooks.emit("enable",i)),t.enabled===!1&&(this._disable(),this.hooks.emit("disable",i)),t.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",i)),t.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",i)),t.config&&this.init()}load(t,i,r=!0){return te(this,null,function*(){const s=yield this.formatData(t);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=O({},s),this.init(),i&&this.setState(i,{userAction:r}),this.hooks.emit("dataLoaded",this.data))})}formatData(t){return t.version&&t.data?Promise.resolve(t.data):Promise.resolve(t)}init(){return te(this,null,function*(){var r,s,o,a;const t=(s=(r=this.data)==null?void 0:r.north_rad)!=null?s:null;this._clearCompassIfNeed(),t!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh&&(this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(t-Math.PI/2),this.group.add(this.compassMesh))),this._clearLogoIfNeed(),this.logoMesh=yield this.loadLogoMesh(),this.logoMesh&&(this.logoMesh.rotateX(-Math.PI/2),this.group.add(this.logoMesh));const i=(a=(o=this.data)==null?void 0:o.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),i!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=p5(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return te(this,null,function*(){const t=this.state.config.compassImageUrl,i=yield qs(t),r=new P.CircleGeometry(.7,32),s=new P.MeshBasicMaterial({map:i,transparent:!0,opacity:0,depthTest:!1}),o=new P.Mesh(r,s);return o.name="pano-compass-mesh",o})}loadLogoMesh(){return te(this,null,function*(){if(!this.state.config.logoURL)return;const t=this.state.config.logoURL,i=yield qs(t);i.minFilter=P.NearestFilter,i.magFilter=P.NearestFilter;const r=new P.PlaneBufferGeometry(.4,.4),s=new P.MeshBasicMaterial({map:i,opacity:0,transparent:!0,depthTest:!1}),o=new P.Mesh(r,s);return o.name="pano-compass-logo-mesh",o})}loadEntryDoorMesh(){return te(this,null,function*(){const t=this.state.config.entryDoorImageUrl,i=yield qs(t),r=new P.PlaneGeometry(.2,.16),s=new P.MeshBasicMaterial({map:i,transparent:!0,opacity:.8,depthTest:!1}),o=new P.Mesh(r,s);return o.name="pano-compass-entry-door",o})}loadRoomInfo(){const t=[new P.Vector3(-.7,0,-.7),new P.Vector3(.7,0,-.7),new P.Vector3(.7,0,.7),new P.Vector3(-.7,0,.7)];return Ac(this.five).create3DDomContainer(t)}}const v5=(e,n)=>new g5(e,n),y5=1,b5=3,A5=new ee.Color(16777215),w5=new ee.Color(6522623),x5=new ee.Color(16777215),M5=new ee.Color(6522623),C5=6,P5=8,E5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",JA=new ee.TextureLoader().load(E5),_5={pointTexture:JA,pointSize:C5,lineWidth:y5,lineColor:A5,pointColor:x5,lineRenderOrder:20,pointsRenderOrder:20},S5={pointTexture:JA,pointSize:P5,lineWidth:b5,lineColor:w5,pointColor:M5,lineRenderOrder:10,pointsRenderOrder:10};function I5(e,n,t){var h,u,d,f,m;const i=(h=t==null?void 0:t.lineWidth)!=null?h:2,r=(u=t==null?void 0:t.lineColor)!=null?u:new ee.Color(16777215),s=(d=t==null?void 0:t.pointSize)!=null?d:5,o=(f=t==null?void 0:t.lineRenderOrder)!=null?f:10,a=(m=t==null?void 0:t.lineRenderOrder)!=null?m:20,l=new Sv(e,n);l.setMaterial({linewidth:i,color:r}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=o,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,t!=null&&t.pointColor&&c.color.set(t.pointColor).convertSRGBToLinear(),t!=null&&t.pointTexture&&(c.map=t.pointTexture),l}function qA(e,n){const[t,i]=e.points,r=n==="light"?S5:_5,s=I5(t.position,i.position,r);return s.name="normalLine_"+e.id,s}function Ks(e){const{x:n,y:t,z:i}=e;return!(Math.abs(n)>1||Math.abs(t)>1||Math.abs(i)>1)}function cd(e){const{z:n}=e;return!(Math.abs(n)>1)}function T5(e){const n=document.createElement("div");return n.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),n.style.width="max-content",n.style.padding="3px 6px",n.style.lineHeight="1",n.style.textAlign="center",n.style.transform="translate(-50%, -50%)",n.style.fontSize="14px",n.style.color="#fff",n.style.cursor="pointer",n.style.userSelect="none",e!=null&&e.style&&Object.assign(n.style,e==null?void 0:e.style),n}function D5(e){const n=document.createElement("div");return e!=null&&e.id&&(n.id=e==null?void 0:e.id),n.classList.add("five-plugin-measure__distance"),n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width="0",n.style.height="0",n.style.transform="translate(-10px, -10px)",n.style.transformOrigin="left top",e!=null&&e.style&&Object.assign(n.style,e.style),n}class KA{constructor(n){v(this,"ndcPosition");v(this,"contentDom");v(this,"containerDom");v(this,"params");v(this,"canSelected");v(this,"handleClick",n=>{var t,i;(i=(t=this.params).clickCallback)==null||i.call(t,n,this)});this.params=n,this.contentDom=T5({style:n.contentStyle}),this.containerDom=D5({style:n.containerStyle}),this.setCanSelect(!0)}setCanSelect(n){this.canSelected=n,this.containerDom.style.pointerEvents=n?"all":"none"}highlight(){this.contentDom.style.border="0.5px solid #95AEFF",this.contentDom.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}unHighlight(){this.contentDom.style.border="0.5px solid rgba(255,255,255,0.6)",this.contentDom.style.background="rgba(195,195,195,0.70)"}appendTo(n){n.appendChild(this.containerDom),this.containerDom.addEventListener("click",this.handleClick)}remove(){this.contentDom.removeEventListener("click",this.handleClick),this.containerDom.remove()}show(){this.containerDom.style.visibility="visible"}hide(){this.containerDom.style.visibility="hidden"}tempHide(){this.containerDom.style.opacity="0"}tempShow(){this.containerDom.style.opacity="1"}updateDomPosition(n){if(!this.ndcPosition){this.tempHide();return}const t=n.getElement();if(!t)return;const i=t.clientWidth,r=t.clientHeight,s=this.ndcPosition.clone().project(n.camera);if(!cd(s)){this.tempHide();return}const o=(s.x+1)/2*i,a=-(s.y-1)/2*r;this.containerDom.style.transform=`translate(${o}px, ${a}px)`,this.tempShow()}}class L5 extends KA{constructor(t){var i;t.contentStyle=Pe(O({},t.contentStyle),{background:"rgba(195,195,195,0.70)",border:"0.5px solid rgba(255,255,255,0.6)",borderRadius:"999px"});super(t);v(this,"line");this.line=t.line,(i=this.params.userDistanceItem)!=null&&i.element?this.containerDom.appendChild(this.params.userDistanceItem.element):this.containerDom.appendChild(this.contentDom)}update(t){var E;if(this.line.mesh.visible===!1){this.hide();return}const i=t.getElement();if(!i)return;const r=i.clientWidth,s=i.clientHeight,o=r/2,a=s/2;if(this.line.points.length<2)return;const[l,c]=this.line.points.map(S=>S.position.clone().applyMatrix4(this.line.mesh.matrixWorld)),h=l.clone().project(t.camera),u=c.clone().project(t.camera),d=Hi(l,c).clone().project(t.camera),f=new ee.Vector2(h.x*o,h.y*a),m=new ee.Vector2(u.x*o,u.y*a),p=f.distanceTo(m);if((()=>!(Math.abs(h.z)>1||Math.abs(u.z)>1||!cd(h)&&!cd(u)||!cd(d)||p===0))()===!1){this.hide();return}const y=(d.x+1)/2*r,b=-(d.y-1)/2*s,w=-(Math.atan((f.y-m.y)/(f.x-m.x))*180)/Math.PI,x=this.containerDom.parentElement&&this.contentDom.clientWidth>p?-20:0;this.containerDom.style.transform=`translate(${y}px, ${b}px) rotate(${w}deg) translateY(${x}px)`,this.show(),(E=this.params.userDistanceItem)==null||E.update({line:this.line,polyline:this.line.getPolyline()});const M=this.getCurrentContent();this.contentDom.innerText=M}getCurrentContent(){var l,c,h,u;if(this.line.points.length<2)return"";const[t,i]=this.line.points,r=t.position.clone().distanceTo(i.position),s=(c=this.line.text)!=null?c:(l=this.line.model.config)==null?void 0:l.defaultText,o=(u=(h=this.line.model.config)==null?void 0:h.getDistanceText)==null?void 0:u.call(h,r),a=s!=null?s:o;return a!=null?a:r.toFixed(2)+"m"}}let $s=class fC{constructor(n,t,i){v(this,"id");v(this,"selected",!1);v(this,"text");v(this,"type","line");v(this,"model");v(this,"mesh");v(this,"points");v(this,"lightMesh");v(this,"hook");v(this,"distanceItem");v(this,"polyline");v(this,"visible");var r;if(this.id=wn(),this.model=i,n.id===t.id)throw new Error("无效的线段, 一个点无法构成线段");typeof i.config.defaultText=="string"&&(this.text=i.config.defaultText),this.hook=new Zt.Subscribe,this.points=[n,t],this.mesh=qA(this,"normal"),this.lightMesh=qA(this,"light"),this.distanceItem=new L5({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(r=this.model.config)!=null&&r.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0})}hide(){this.visible&&(this.visible=!1,this.mesh.visible=!1,this.distanceItem.hide())}show(){this.visible||(this.visible=!0,this.mesh.visible=!0,this.distanceItem.show())}setPoints(n,t){this.points[0].position.copy(n),this.points[1].position.copy(t),this.mesh.setPoints(n,t)}remove(){this.mesh.parent&&this.mesh.parent.remove(this.mesh),this.distanceItem.remove()}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const n=this.model.polylines.find(t=>t.lines.includes(this));if(n)return this.polyline=n,n}findAnotherPoint(n){return this.points.find(({id:t})=>t!==n.id)}setText(n){this.text=n,this.hook.emit("textChanged",n)}toJSON(){return this.toJson()}toJson(){return{id:this.id,points:this.points.map(n=>n.toJson()),text:this.text}}clone(){const n=new fC(this.points[0].clone(),this.points[1].clone(),this.model);return n.text=this.text,n}},hi=class pC{constructor(n){v(this,"id");v(this,"position");v(this,"type","point");if(this.id=wn(),this.position=new ee.Vector3,Array.isArray(n))this.position.fromArray(n);else if(typeof n=="object"&&n.isVector3)this.position.copy(n);else throw new Error("position must be Vector3 or number[]")}toJson(){return{id:this.id,position:this.position.toArray()}}clone(){return new pC(this.position)}};const hd=e=>e.preventDefault();let ud=class{constructor(n){v(this,"model");v(this,"five");v(this,"group");v(this,"config");v(this,"dashed");v(this,"perpendicularDashed");v(this,"disposed",!1);v(this,"isMobile");v(this,"editParams");v(this,"magnifierParams");v(this,"mouseGroup");v(this,"container");v(this,"hook");v(this,"magnifier");v(this,"userDistanceItemCreator");v(this,"pointSelectorConfig");v(this,"workUtil");v(this,"getMeasureType");v(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(n=>n.distanceItem.update(this.five))});v(this,"updateAreaUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllAreas().forEach(n=>{n.areaItem.updateArea(this.five),n.polyline.lines.forEach(t=>{t.distanceItem.update(this.five)})})});var i,r,s;this.five=n.five,this.hook=n.hook,this.model=n.model,this.getMeasureType=n.getMeasureType,this.config=n.config,this.editParams=n.editParams,this.magnifierParams=n.magnifierParams,this.magnifier=n.magnifier,this.pointSelectorConfig=Pe(O({},n.pointSelectorConfig),{helper:O({magnifierParams:n.magnifierParams},(i=n.pointSelectorConfig)==null?void 0:i.helper)}),this.container=n.container,this.isMobile=(s=(r=n.openParams)==null?void 0:r.isMobile)!=null?s:!1,this.workUtil=n.workUtil,this.userDistanceItemCreator=n.userDistanceItemCreator,this.group=n.group,this.mouseGroup=n.mouseGroup,this.dashed=new $s(new hi([0,0,0]),new hi([0,0,0]),this.model),this.dashed.distanceItem.setCanSelect(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine",this.perpendicularDashed=new $s(new hi([0,0,0]),new hi([0,0,0]),this.model),this.perpendicularDashed.distanceItem.setCanSelect(!1),this.perpendicularDashed.mesh.setMaterial({dashed:!0,dashScale:40,color:new ee.Color(10218089)}),this.perpendicularDashed.mesh.name="perpendicularDashLine";const t=this.five.getElement();t&&(t.addEventListener("touchstart",hd),t.addEventListener("contextmenu",hd))}get currentMeasureType(){return this.getMeasureType()}removeLine(n){this.group.remove(n.mesh,n.lightMesh),n.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(n,t){if(!n)return this.mouseGroup;if(this.mouseGroup.position.copy(n.point),t)this.mouseGroup.quaternion.copy(t.quaternion);else if(n.face){const r=n.face.normal.clone().multiplyScalar(.05),o=n.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(o)}return this.mouseGroup}dispose(){var t;this.disposed=!0,(t=this.magnifier)==null||t.disable(),this.model.getAllLines().forEach(i=>this.removeLine(i)),this.model.areas.forEach(i=>i.remove());const n=this.five.getElement();n&&(n.removeEventListener("touchstart",hd),n.removeEventListener("contextmenu",hd))}},eo=class{constructor(n){v(this,"id",wn());v(this,"lines",[]);v(this,"visiblePanoIndexes");v(this,"visibleFiveMode");v(this,"model");v(this,"type","polyline");v(this,"hook",new Zt.Subscribe);this.model=n.model}get points(){const n=new Set;return this.lines.forEach(t=>{n.add(t.points[0]),n.add(t.points[1])}),Array.from(n)}addLine(n){if(this.includes(n)){console.error(new Error("不能重复添加线段"));return}const t=this.getLastPoint(),i=t&&n.findAnotherPoint(t);if(t&&!i){console.error(new Error("传入线段无法与当前折线进行连接"));return}this.lines.push(n),this.hook.emit("lineAdded",n)}removeLine(n){if(this.lines.length===0)return;if(!this.isLastLine(n)){console.error(new Error("传入线段不是当前折线的最后一段"));return}this.lines.pop()&&this.hook.emit("lineRemoved",n)}isLastLine(n){const t=this.getLastLine();return t?n.id===t.id:!1}getLastLine(){return this.lines.slice(-1)[0]}getPointLength(){return this.lines.length+1}clear(){const n=this.lines.slice();this.lines.length=0,n.reduceRight((t,i)=>this.hook.emit("lineRemoved",i),void 0)}overlapWith(n){return n.type==="point"?this.includes(n):n.type==="line"?n.points.some(t=>this.includes(t)):n.type==="polyline"?n.points.some(t=>this.includes(t)):!0}includes(n){return n.type==="point"?this.points.find(({id:t})=>t===n.id)!==void 0:n.type==="line"?this.lines.find(({id:t})=>t===n.id)!==void 0:!1}isEmpty(){return this.lines.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJSON(){return this.toJson()}toJson(){return{id:this.id,lines:this.lines.map(n=>n.toJson()),visiblePanoIndexes:this.visiblePanoIndexes,visibleFiveMode:this.visibleFiveMode}}getPointByID(n){return this.points.find(({id:t})=>t===n)}fromJson(n){this.clear(),this.id=n.id;const{getPoint:t}=r(),i=n.lines.map(s=>{const[o,a]=s.points,l=t(o),c=t(a);if(!l||!c)throw new Error("线上的点不存在");const h=new $s(l,c,this.model);return h.id=s.id,h.text=s.text,h});this.lines.push(...i),this.visiblePanoIndexes=n.visiblePanoIndexes,this.visibleFiveMode=n.visibleFiveMode;function r(){const s=new Map;function o(l){const c=s.get(l.id);if(c)return c;const h=new hi(l.position);return h.id=l.id,s.set(l.id,h),h}function a(){return Array.from(s.values())}return{getPoint:o,getAllPoints:a}}return this}replace(n){this.id=n.id,this.clear(),this.lines.push(...n.lines)}};function Mc(e,n){if(e.length<3){console.error("points.length < 3");return}const[t,i,r]=e,s=t.clone().sub(i),o=t.clone().sub(r),a=s.cross(o).normalize();return typeof n=="number"?a.multiplyScalar(n):a}function k5(e){if(e.length<3)return[];const n=Mc([e[0].clone(),e[1].clone(),e[2].clone()]),t=new P.Quaternion().setFromUnitVectors(new P.Vector3(0,1,0),n),r=e.map(o=>o.clone().applyQuaternion(t)).flatMap(o=>[o.x,o.z]);return pr(r)}function Dm(e,n){const t=Array.isArray(n)?n:[n];for(let i=0;i<t.length;i++){const r=e.start,s=e.end,o=t[i].start,a=t[i].end;if(!(Cc(r,o)||Cc(r,a)||Cc(s,o)||Cc(s,a)||Cc(r,s))&&O5([r.x,r.y,r.z],[s.x,s.y,s.z],[o.x,o.y,o.z],[a.x,a.y,a.z]))return!0}return!1}function O5(e,n,t,i){const r=[n[0]-e[0],n[1]-e[1],n[2]-e[2]],s=[i[0]-t[0],i[1]-t[1],i[2]-t[2]],o=[[r[0],-s[0]],[r[1],-s[1]],[r[2],-s[2]]],a=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],l=R5(o,a);if(l===null)return!1;const[c,h]=l;return!!($A(c)&&$A(h))}function R5(e,n){if(z5(e)===0)return null;const i=B5(e);return N5(i,n)}function z5(e){return e[0][0]*e[1][1]-e[0][1]*e[1][0]}function B5(e){const n=e[0][0]*e[1][1]-e[0][1]*e[1][0];return[[e[1][1]/n,-e[0][1]/n],[-e[1][0]/n,e[0][0]/n]]}function N5(e,n){return[e[0][0]*n[0]+e[0][1]*n[1],e[1][0]*n[0]+e[1][1]*n[1]]}function $A(e){return e>=0&&e<=1}function Cc(e,n){return e.x===n.x&&e.y===n.y&&e.z===n.z}function e1(e,n){const t=[...new Set(e)];if(t.length<3)return;if(t.at(-1).equals(t[0])||t.push(t[0]),n!=null&&n.checkLinesIntersect&&t.length>=5){const a=t.map((l,c)=>{if(c!==0)return{start:t[c-1],end:t[c]}}).filter(Boolean);for(let l=0;l<a.length;l++)if(Dm(a[l],a.slice(l)))return}const i=t.flatMap(a=>[a.x,a.y,a.z]),r=new P.Float32BufferAttribute(i,3),s=k5(t),o=new P.BufferGeometry;return o.setAttribute("position",r),o.setIndex(s),o.name="PolygonGeometry",o}const F5=new P.BufferGeometry;let t1=class extends ei{constructor(t){super();v(this,"isPolygonMesh",!0);v(this,"geometry",new P.BufferGeometry);v(this,"isBlank",!0);v(this,"points",[]);const i=new P.MeshBasicMaterial({color:4090367,transparent:!0,side:P.DoubleSide,depthTest:!0,opacity:.5}),r=new P.MeshBasicMaterial({color:16777215,transparent:!0,side:P.DoubleSide,depthTest:!1,depthWrite:!1,opacity:.3}),s=new P.Mesh(this.geometry,i),o=new P.Mesh(this.geometry,r);s.renderOrder=1,o.renderOrder=0,t&&this.updatePoints(t),this.add(s,o)}updatePoints(t){this.points=t;const i=e1(t);i?(this.geometry.copy(i),this.isBlank=!1):(this.geometry.copy(F5),this.isBlank=!0)}};function n1(e){const n=G5(e);if(n.length===0){console.warn("No geometry triangles found"),console.debug({geometry:e,triangles:n});return}let t=0,i=new ee.Vector3;for(const[r,s,o]of n){const a=i1(r,s,o),l=V5(r,s,o,a);t+=a,i.add(l)}return i=i.divideScalar(t),{center:i,area:t}}function i1(e,n,t){return n.clone().sub(e).cross(t.clone().sub(e)).length()/2}function V5(e,n,t,i){const r=i!=null?i:i1(e,n,t);return Hi(e,n,t).multiplyScalar(r)}function G5(e){var r;const n=e.getAttribute("position"),t=(r=e.getIndex())==null?void 0:r.array;if(!n||!t)return[];let i=[];for(let s=0;s<t.length;s+=3){const o=t[s],a=t[s+1],l=t[s+2],c=new ee.Vector3().fromArray([n.getX(o),n.getY(o),n.getZ(o)]),h=new ee.Vector3().fromArray([n.getX(a),n.getY(a),n.getZ(a)]),u=new ee.Vector3().fromArray([n.getX(l),n.getY(l),n.getZ(l)]);i.push([c,h,u])}return i}class j5 extends KA{constructor(t){t.containerStyle=Pe(O({},t.containerStyle),{zIndex:"1"}),t.contentStyle=Pe(O({},t.contentStyle),{background:"#6386FF",borderRadius:"2px"});super(t);v(this,"area");this.area=t.area,this.containerDom.appendChild(this.contentDom)}updateArea(t,i){var l,c;const r=i!=null?i:this.area.polygon.geometry,s=n1(r);if(!s){this.ndcPosition=null,this.updateDomPosition(t);return}const{area:o,center:a}=s;this.ndcPosition=a,this.updateDomPosition(t),(c=(l=this.area.model)==null?void 0:l.config)!=null&&c.getAreaText?this.contentDom.innerText=this.area.model.config.getAreaText(o):this.updateAreaText(o,{fix:2})}updateAreaText(t,i){const{unit:r="m²",fix:s}=i!=null?i:{};this.contentDom.innerText=`${Dr(s)?t:t.toFixed(s)}${r}`}}class Lm{constructor(n,t){v(this,"id",wn());v(this,"selected",!1);v(this,"text");v(this,"type","area");v(this,"lightMesh");v(this,"areaItem");v(this,"hook",new Zt.Subscribe);v(this,"model");v(this,"polygon");v(this,"points",[]);v(this,"planeHelper");v(this,"polyline");v(this,"meshContainer");v(this,"domContainer");v(this,"five");v(this,"updateDom",()=>{this.five&&(this.polyline.lines.forEach(n=>n.distanceItem.update(this.five)),this.areaItem.updateDomPosition(this.five))});var i;n&&(this.points=n),this.model=t.model,this.polygon=new t1(n),this.polyline=new eo({model:t.model}),this.areaItem=new j5({area:this,clickCallback:(r,s)=>{const o=r.clientX+"px",a=r.clientY+"px";this.hook.emit("selected",this,{left:o,top:a})}}),this.domContainer=t.domContainer||null,this.meshContainer=t.meshContainer||null,this.five=t.five||null,this.areaItem.appendTo(this.domContainer),(i=this.five)==null||i.on("cameraUpdate",this.updateDom)}get isClosed(){var n;return this.points.length>=4&&((n=this.points.at(0))==null?void 0:n.equals(this.points.at(-1)))}addPoints(n){var r;this.points=this.points.concat(n);const t=this.points.at(-2),i=this.points.at(-1);if(t&&i){const s=new $s(new hi(t),new hi(i),this.polyline.model);this.polyline.addLine(s),this.meshContainer.add(s.mesh),this.five&&(s.distanceItem.setCanSelect(!1),s.distanceItem.appendTo(this.domContainer),s.distanceItem.update(this.five))}(r=this.meshContainer)!=null&&r.children.includes(this.polygon)||this.meshContainer.add(this.polygon),this.polygon.updatePoints(this.points),this.areaItem.updateArea(this.five),this.points.length===3?this.planeHelper=new P.Plane().setFromCoplanarPoints(this.points[0],this.points[1],this.points[2]):this.points.length<3&&(this.planeHelper=null)}popPoint(){this.points.pop();const n=this.polyline.lines.pop();n==null||n.remove(),this.polygon.updatePoints(this.points),this.areaItem.updateArea(this.five),this.points.length<3&&(this.planeHelper=null)}complete(){this.points.at(-1).equals(this.points[0])||this.addPoints(this.points[0])}hideArea(){this.polygon.visible=!1,this.areaItem.hide()}showArea(){this.polygon.visible=!0,this.areaItem.show()}projectPoint(n){return n&&(this.planeHelper?this.planeHelper.projectPoint(n,new P.Vector3):n)}remove(){this.polygon.removeFromParent(),this.areaItem.remove(),this.polyline.lines.forEach(n=>n.remove())}dispose(){this.remove(),this.model.areas.splice(this.model.areas.indexOf(this),1),this.planeHelper=null,this.five.off("cameraUpdate",this.updateDom),this.five.needsRender=!0}toJSON(){return{id:this.id,points:this.points.map(n=>n.toArray()),text:this.text}}}const Pc="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;function H5(e,n){const{x:t,y:i}=n,r=t*2-1,s=i*2-1,o=new P.Raycaster;return o.setFromCamera({x:r,y:s},e.camera),o.params.Points.threshold=.02,o}function Ec(e,n,t){const i=U5(e,n);return t!=null&&t.virtualPoint?i!=null?i:r1(n):i}function r1(e,n=3){const t=new P.Vector3().addVectors(e.ray.origin,e.ray.direction.clone().normalize().multiplyScalar(n)),i=e.ray.direction.clone().negate();return{distance:n,point:t,object:new P.Object3D,face:new P.Face3(0,0,0,i),raycaster:e,isVirtual:!0}}function U5(e,n){const r=Li(e).intersectRaycaster(n)[0];if(r)return Pe(O({},r),{raycaster:n,isVirtual:!1})}const s1=`url("data:image/svg+xml,%3Csvg width='12px' height='12px' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cpath d='M6,12 C9.3137085,12 12,9.3137085 12,6 C12,2.6862915 9.3137085,0 6,0 C2.6862915,0 0,2.6862915 0,6 C0,9.3137085 2.6862915,12 6,12 Z' fill='%23FF5959'%3E%3C/path%3E%3Cg transform='translate(2, 2)' stroke='%23FFFFFF'%3E%3Ccircle cx='4' cy='4' r='4'%3E%3C/circle%3E%3Cline x1='1.07141075' y1='1.23997894' x2='6.64700843' y2='6.81557662'%3E%3C/line%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 6 6, auto`,W5=new P.Vector3,ja=()=>!1;class o1 extends Pn{constructor(t,i){var o,a,l;super();v(this,"_cursorError",!1);v(this,"actionIfNoModelUnderMouse","virtualPoint");v(this,"plane");v(this,"pointSelectorHelper");v(this,"hook",this);v(this,"five");v(this,"_outOfFive",!1);v(this,"_enabled",!1);v(this,"mode");v(this,"pressDown",!1);v(this,"adherePoints");v(this,"adherePointsRadius",.1);v(this,"setPressDown");v(this,"lastFiveHelperVisible");v(this,"lastIntersection");v(this,"mousePosition");v(this,"config",{});v(this,"select",t=>{t&&this.updatePointSelectorHelperIntersect(t);const i=this.emit("wantsSelect",this.position);return i||(this.pointSelectorHelper.hide(),this.emit("select",this.position),console.debug(this.position)),!i});v(this,"onMouseWheel",t=>{this.updateByMousePosition(t);const i=()=>this.updateByMousePosition();this.five.off("render.prepare",i),this.five.on("render.prepare",i),setTimeout(()=>{this.five.off("render.prepare",i)},200)});v(this,"onEnter",()=>{this.cursorError||this.pointSelectorHelper.show(),this.outOfFive=!1,this.emit("intersectionUpdate",this.position)});v(this,"onLeave",()=>{this.pointSelectorHelper.hide(),this.outOfFive=!0,this.emit("intersectionUpdate",null)});v(this,"onClick",()=>{this.select()});v(this,"onTouchStart",t=>{console.log("touchstart"),this.setPressDown=setTimeout(()=>{if(this.setPressDown=void 0,this.mousePosition={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},!this.mouseNdcPosition)return;const i=this.updateByNdcPosition(this.mouseNdcPosition);this.pressDown=i},300)});v(this,"onTouchMove",t=>{if(console.log("touchmove"),this.setPressDown){clearTimeout(this.setPressDown),this.setPressDown=void 0;return}if(this.pressDown){if(this.mousePosition={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},!this.mouseNdcPosition)return;this.updateByNdcPosition(this.mouseNdcPosition)}});v(this,"onTouchEnd",t=>{this.pressDown&&(setTimeout(()=>{this.pressDown=!1},100),this.select())});v(this,"updateByMousePosition",t=>{this.five.getElement()&&(t&&(this.mousePosition=t),this.updateByNdcPosition(this.mouseNdcPosition))});v(this,"updateByNdcPosition",t=>{var s,o;const i=H5(this.five,t),r=Ec(this.five,i);if(r)return this.updatePointSelectorHelperIntersect(r),this.lastIntersection=r,!0;if(this.plane){const a=i.ray.intersectPlane(this.plane,W5);if(a){const l={distance:this.five.camera.position.distanceTo(a),point:a.clone(),object:new P.Object3D,face:new P.Face3(0,0,0,this.plane.normal.clone()),raycaster:i,isVirtual:!0};return this.updatePointSelectorHelperIntersect(l),!0}}if(this.actionIfNoModelUnderMouse==="lastPoint")return this.updatePointSelectorHelperIntersect(this.lastIntersection),!0;if(this.actionIfNoModelUnderMouse==="virtualPoint"){const a=r1(i,(s=this.lastIntersection)==null?void 0:s.distance);return a.face=new P.Face3(0,0,0,(o=this.lastIntersection)==null?void 0:o.face.normal),a.isVirtual=!0,this.lastIntersection=a,this.updatePointSelectorHelperIntersect(a),!0}else if(this.actionIfNoModelUnderMouse==="disable")return this.updatePointSelectorHelperIntersect(null),!1});v(this,"updatePointSelectorHelperIntersect",t=>{if(!t){this.onLeave(),this.five.getElement().style.cursor=s1;return}this.onEnter(),this.cursorError||(this.five.getElement().style.cursor="");const i=O({},t);let r=!1;if(typeof this.adherePoints=="function"&&typeof this.adherePointsRadius=="number"){for(const s of this.adherePoints({intersection:t,pointSelectorInstance:this}))if(s.distanceTo(t.point)<this.adherePointsRadius){i.point=s.clone(),r=!0;break}}this.pointSelectorHelper.updateWithIntersect(i,{emitEvent:!1}),this.emit("intersectionUpdate",i,r)});v(this,"mousePositionToNdcPosition",t=>{const i=this.five.getElement();if(!i)return null;const{top:r,left:s,width:o,height:a}=i.getBoundingClientRect(),{clientX:l,clientY:c}=t;return{x:(l-s)/o,y:1-(c-r)/a}});v(this,"onFiveWantsPanGesture",()=>{if(this.pressDown)return!1});v(this,"renderScreenCenter",()=>{this.updateByNdcPosition({x:.5,y:.5})});v(this,"emitIntersectionUpdate",t=>{this.emit("intersectionUpdate",t)});this.five=t,this.config=O(O({},this.config),i),this.actionIfNoModelUnderMouse=(o=i==null?void 0:i.actionIfNoModelUnderMouse)!=null?o:"virtualPoint";const r=(a=i==null?void 0:i.mode)!=null?a:"auto";r==="auto"?this.mode=Pc?"fixed":"cursor":this.mode=r;const s={autoFixPCPosition:this.mode==="cursor",initialPosition:this.mode==="fixed"?{left:"35%",top:"20%"}:void 0};this.pointSelectorHelper=new cb(this.five,Pe(O({},i==null?void 0:i.helper),{magnifierParams:O(O({},s),(l=i==null?void 0:i.helper)==null?void 0:l.magnifierParams)})),this.pointSelectorHelper.hide()}get position(){return this.outOfFive?null:this.pointSelectorHelper.position}get outOfFive(){return this._outOfFive}get enabled(){return this._enabled}get cursorError(){return this._cursorError}set cursorError(t){this._cursorError=t,this.five.getElement().style.cursor=t?s1:"",t?this.pointSelectorHelper.hide():this.pointSelectorHelper.show()}set outOfFive(t){this._outOfFive=t}set enabled(t){this._enabled=t}get mouseNdcPosition(){return this.mousePosition?this.mousePositionToNdcPosition(this.mousePosition):null}enable(){if(this.enabled)return;this.enabled=!0,this.outOfFive=!1,this.pointSelectorHelper.enable();const t=this.five.getElement();if(!t)throw new Error("five element not found");this.mode==="cursor"?(this.five.on("wantsMoveToPano",ja),this.five.on("wantsChangeMode",ja),this.five.on("wantsTapGesture",ja),Pc?(t.addEventListener("touchstart",this.onTouchStart,{passive:!0}),t.addEventListener("touchmove",this.onTouchMove),t.addEventListener("touchend",this.onTouchEnd)):(t.addEventListener("click",this.onClick),t.addEventListener("mousemove",this.updateByMousePosition),t.addEventListener("wheel",this.onMouseWheel),t.addEventListener("mouseenter",this.onEnter),t.addEventListener("mouseout",this.onLeave)),this.five.on("wantsPanGesture",this.onFiveWantsPanGesture)):this.mode==="fixed"&&(this.five.on("panoArrived",this.renderScreenCenter),this.five.on("panGesture",this.renderScreenCenter),this.five.on("interiaPan",this.renderScreenCenter),this.renderScreenCenter(),this.pointSelectorHelper.show()),this.pointSelectorHelper.hooks.on("intersectionUpdate",this.emitIntersectionUpdate),this.lastFiveHelperVisible=this.five.helperVisible,this.five.helperVisible=!1,this.emit("enable")}disable(){if(!this.enabled)return;this.enabled=!1,this.pointSelectorHelper.disable(),this.five.getElement().style.cursor="";const t=this.five.getElement();this.five.off("wantsPanGesture",this.onFiveWantsPanGesture),this.five.off("wantsMoveToPano",ja),this.five.off("wantsChangeMode",ja),this.five.off("wantsTapGesture",ja),this.five.helperVisible=this.lastFiveHelperVisible,t==null||t.removeEventListener("touchstart",this.onTouchStart),t==null||t.removeEventListener("touchmove",this.onTouchMove),t==null||t.removeEventListener("touchend",this.onTouchEnd),t==null||t.removeEventListener("click",this.onClick),t==null||t.removeEventListener("mousemove",this.updateByMousePosition),t==null||t.removeEventListener("wheel",this.onMouseWheel),t==null||t.removeEventListener("mouseenter",this.onEnter),t==null||t.removeEventListener("mouseout",this.onLeave),this.five.off("panoArrived",this.renderScreenCenter),this.five.off("panGesture",this.renderScreenCenter),this.five.off("interiaPan",this.renderScreenCenter),this.pointSelectorHelper.hooks.off("intersectionUpdate",this.emitIntersectionUpdate),this.emit("disable")}dispose(){this.disable(),this.pointSelectorHelper.dispose()}setAdherePoints(t,i){t?typeof t=="function"?this.adherePoints=t:this.adherePoints=()=>t:this.adherePoints=null,typeof i=="number"&&(this.adherePointsRadius=i)}}const Q5=`
|
|
3267
|
+
`,b=document.createElement("div");return b.setAttribute("class","PanoRulerPlugin-rule"),b.setAttribute("data-name",p),b.setAttribute("style","display: none"),b.innerHTML=y,b},r=document.createElement("div");r.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Kk,r.appendChild(s);const o={},a=(p,g)=>{var A;if(t.loaded)throw new Error("标尺被重复初始化!");const y=e5(p,e),b=e.work;if(!b)return!1;for(const w in g){const x=g[w],M=(A=b.observers[0])==null?void 0:A.standingPosition;if(!M)return;const E=x.map(({x:S,z:T,observers:z})=>{const D=z.length>0?p.rooms[p.observers[z[0]]].name:"",k=y[D]?y[D].floor:null;let R=1/0,G={index:0,x:M.x,y:M.y,z:M.z};z.forEach(ie=>{if(!b.observers[ie])return;const{standingPosition:pe}=b.observers[ie],be={index:ie,x:pe.x,y:pe.y,z:pe.z},Ae=$k({x:S,z:T},be);k?Ae<R&&Math.abs(be.y-k)<.3&&(R=Ae,G=be):Ae<R&&(R=Ae,G=be)});const I=new ee.Vector3(S,G.y,T);Object.assign(I,{observers:z});const U=y[D]?y[D].roof:null,q=U?new ee.Vector3(S,U,T):null;return q&&Object.assign(q,{observers:z}),{origin:I,vertical:q}});o[w]={origins:E.map(S=>S.origin),rules:[]};for(const{origin:S,vertical:T}of E){if(!T)continue;const z=i(w,S.distanceTo(T));r.append(z),o[w].rules.push({vertical:!0,rule:[S,T],$element:z})}for(let S=0;S<E.length;S++){let T=S+1;T>=E.length&&(T=0);const{origin:z}=E[S],{origin:D}=E[T],k=i(w,z.distanceTo(D));r.append(k),o[w].rules.push({vertical:!1,rule:[z,D],$element:k})}}return t.loaded=!0,!0},l=(p,g,y)=>te(this,null,function*(){const b=p||n.roomInfo,A=g||n.roomRules;if(!b||!A)throw new Error("标尺数据依赖不齐全!");return t.loaded=!1,t.options=O(O({},t.options),y||{}),e.model.loaded?a(b,A):yield new Promise(w=>e.once("modelLoaded",()=>w(a(b,A))))});n.roomInfo&&n.roomRules&&l(n.roomInfo,n.roomRules);const c=(p,g,y,b)=>{const A=[[{x:0,y:0},{x:y,y:0}],[{x:0,y:0},{x:0,y:b}],[{x:y,y:0},{x:y,y:b}],[{x:0,y:b},{x:y,y:b}]],w=[];for(let x=0;x<A.length;x++){const M=HA([p,g],[A[x][0],A[x][1]],!0);M&&w.push(M)}return w.length===0?!1:w},h=()=>{var T;const p=(T=e.getElement())==null?void 0:T.parentElement;if(!p||!t.loaded||Object.keys(o).length<=0)return;const{panoIndex:g,camera:y,currentMode:b}=e;if(g===void 0)return;let A;for(const z in o)z.split(",").indexOf(g.toString())>=0&&(A=z);if(!A){for(const z in o)for(const{$element:D}of o[z].rules)D.style.display="none";return}const w=y.position,x=y.getWorldDirection(new ee.Vector3),M=p.clientWidth,E=p.clientHeight;if(b!==Zt.Five.Mode.Panorama){for(const z in o)for(const{$element:D}of o[z].rules)D.style.display="none";return}for(const z in o)for(const{$element:D}of o[z].rules)D.style.display=z===A?"block":"none";const[S]=o[A].origins.slice().filter(z=>z.observers.indexOf(g)>=0).sort((z,D)=>{const k=z.clone().setY(0).sub(w).normalize().angleTo(x.clone().setY(0)),R=D.clone().setY(0).sub(w).normalize().angleTo(x.clone().setY(0));return k-R});for(const{rule:z,vertical:D,$element:k}of o[A].rules){const[R,G]=z,I=k.querySelector(".PanoRulerPlugin-rule-line");if(!I)return;if(!S){k.style.display="none";continue}if(R!==S&&G!==S){k.style.display="none";continue}if(R.distanceTo(G)<.3){k.style.display="none";continue}if(R.observers.indexOf(g)===-1||G.observers.indexOf(g)===-1){k.style.display="none";continue}if(R.clone().sub(w).normalize().angleTo(x)>Math.PI/2){k.style.display="none";continue}if(G.clone().sub(w).normalize().angleTo(x)>Math.PI/2){k.style.display="none";continue}const K=R.distanceTo(G);if(G.clone().sub(G.clone().sub(R).divide(new ee.Vector3(2,2,2))).distanceTo(w)/K>8){k.style.display="none";continue}const pe=R.clone().project(y),be=(pe.x+1)/2*M,Ae=(-pe.y+1)/2*E,qe=G.clone().project(y),we=(qe.x+1)/2*M,le=(-qe.y+1)/2*E,se=Math.sqrt(Math.pow(we-be,2)+Math.pow(le-Ae,2));let Me=se,Ge=50;const ae=c({x:~~be,y:~~Ae},{x:~~we,y:~~le},M,E);if(ae&&ae.length===1&&(S===R?(Me=Math.sqrt(Math.pow(ae[0].x-be,2)+Math.pow(ae[0].y-Ae,2)),Ge=Me/se*50):S===G&&(Me=Math.sqrt(Math.pow(ae[0].x-we,2)+Math.pow(ae[0].y-le,2)),Ge=100-Me/se*50)),ae&&ae.length===2){const Ce={x:(ae[0].x+ae[1].x)/2,y:(ae[0].y+ae[1].y)/2};Ge=Math.sqrt(Math.pow(Ce.x-be,2)+Math.pow(Ce.y-Ae,2))/se*100}const De=(Math.PI/2-Math.atan2(we-be,Ae-le))/Math.PI*180,We=I.querySelector(".PanoRulerPlugin-rule-label"),gt=We.children[0].clientWidth;gt>=se||gt/2>=Ge/100*se||gt/2>=(1-Ge/100)*se?I.style.display="none":(I.style.display="block",I.style.width=se+"px",I.style.left=be+"px",I.style.top=Ae+"px",I.style.transform=`rotate(${-De}deg)`,We.style.left=`${Ge}%`)}},u=()=>UA(h),d=()=>{var p,g;return t.loaded?(t.enable||(r.setAttribute("class","PanoRulerPlugin"+(t.options.className?" "+t.options.className:"")),(g=(p=e.getElement())==null?void 0:p.parentElement)==null||g.append(r),h(),e.on("modeChange",h),e.on("cameraUpdate",u),t.enable=!0),!0):!1},f=()=>(t.enable&&(e.off("modeChange",h),e.off("cameraUpdate",u),r&&r.remove(),t.enable=!1),!0);function m(p){if(p.distanceText&&p.distanceText!==t.options.distanceText){const g=p.distanceText;t.options.distanceText=g,Object.values(o).forEach(y=>{y.rules.forEach(b=>{const[A,w]=b.rule,x=A.distanceTo(w),M=b.$element.querySelector(".PanoRulerPlugin-rule-label-name");M&&(M.innerText=g(x))})})}}return{enable:d,disable:f,load:l,state:t,changeConfigs:m}};function n5(e){Ue(e,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function WA(e,n,t){const i=e.slice();return i[6]=n[t],i}function i5(e){let n,t=e[0].children,i=[];for(let r=0;r<t.length;r+=1)i[r]=QA(WA(e,t,r));return{c(){n=H("div");for(let r=0;r<i.length;r+=1)i[r].c();_(n,"class","rule-mixed-line svelte-1h27ktp")},m(r,s){X(r,n,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(n,null)},p(r,s){if(s&9){t=r[0].children;let o;for(o=0;o<t.length;o+=1){const a=WA(r,t,o);i[o]?i[o].p(a,s):(i[o]=QA(a),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(r){r&&Y(n),Bi(i,r)}}}function r5(e){let n,t;return{c(){n=H("em"),_(n,"class",t=an(e[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),_(n,"style",e[3])},m(i,r){X(i,n,r)},p(i,r){r&1&&t!==(t=an(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&_(n,"class",t),r&8&&_(n,"style",i[3])},d(i){i&&Y(n)}}}function QA(e){let n,t,i=`${e[6].width}px`;return{c(){n=H("div"),_(n,"class",t=an(e[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),_(n,"style",e[3]),W(n,"width",i)},m(r,s){X(r,n,s)},p(r,s){s&1&&t!==(t=an(r[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&_(n,"class",t),s&8&&_(n,"style",r[3]),(s&8||s&9&&i!==(i=`${r[6].width}px`))&&W(n,"width",i)},d(r){r&&Y(n)}}}function s5(e){let n,t,i,r,s=e[0].labelElement+"",o,a,l=`${e[0].labelOffset}%`,c=`${e[0].width}px`,h=`${e[0].left}px`,u=`${e[0].top}px`,d=`rotate(${e[0].rotateDeg}deg)`;function f(g,y){return g[0].children.length===0?r5:i5}let m=f(e),p=m(e);return{c(){n=H("div"),p.c(),t=ye(),i=H("div"),r=H("div"),o=Mt(s),_(r,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),ln(()=>e[4].call(r)),_(i,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),W(i,"left",l),_(n,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),W(n,"width",c),W(n,"left",h),W(n,"top",u),W(n,"transform",d),W(n,"display",e[0].visible&&e[2]?"block":"none")},m(g,y){X(g,n,y),p.m(n,null),Q(n,t),Q(n,i),Q(i,r),Q(r,o),a=lm(r,e[4].bind(r))},p(g,[y]){m===(m=f(g))&&p?p.p(g,y):(p.d(1),p=m(g),p&&(p.c(),p.m(n,t))),y&1&&s!==(s=g[0].labelElement+"")&&Pt(o,s),y&1&&l!==(l=`${g[0].labelOffset}%`)&&W(i,"left",l),y&1&&c!==(c=`${g[0].width}px`)&&W(n,"width",c),y&1&&h!==(h=`${g[0].left}px`)&&W(n,"left",h),y&1&&u!==(u=`${g[0].top}px`)&&W(n,"top",u),y&1&&d!==(d=`rotate(${g[0].rotateDeg}deg)`)&&W(n,"transform",d),y&5&&W(n,"display",g[0].visible&&g[2]?"block":"none")},i:de,o:de,d(g){g&&Y(n),p.d(),a()}}}function o5(e,n,t){let i,{rulerItemProp:r}=n,s=!0,o,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xsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){o=this.offsetWidth,t(1,o)}return e.$$set=c=>{"rulerItemProp"in c&&t(0,r=c.rulerItemProp)},e.$$.update=()=>{e.$$.dirty&3&&(o>=r.width||o/2>=r.labelOffset/100*r.width||o/2>=(1-r.labelOffset/100)*r.width?t(2,s=!1):t(2,s=!0))},t(3,i=`--background-image: url(${a})`),[r,o,s,i,l]}class a5 extends Oe{constructor(n){super(),ke(this,n,o5,s5,Le,{rulerItemProp:0},n5)}}function YA(e,n,t){const i=e.slice();return i[12]=n[t],i}function XA(e){let n,t;return n=new a5({props:{rulerItemProp:e[12]}}),{c(){Te(n.$$.fragment)},m(i,r){Se(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.rulerItemProp=i[12]),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 l5(e){let n,t,i=e[0],r=[];for(let o=0;o<i.length;o+=1)r[o]=XA(YA(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()},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&1){i=o[0];let l;for(l=0;l<i.length;l+=1){const c=YA(o,i,l);r[l]?(r[l].p(c,a),N(r[l],1)):(r[l]=XA(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 c5(e,n,t){var p,g,y,b;let{five:i}=n,{rulerDatas:r}=n,{options:s}=n,o=[];const a=((g=(p=i.getElement())==null?void 0:p.parentElement)==null?void 0:g.clientWidth)||0,l=((b=(y=i.getElement())==null?void 0:y.parentElement)==null?void 0:b.clientHeight)||0,c=(A,w)=>{const x=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],M=[];for(let E=0;E<x.length;E++){const S=HA([A,w],[x[E][0],x[E][1]],!0);S&&M.push(S)}return M.length===0?!1:M},h=(A,w)=>{const x=A.clone().project(i.camera),M=(x.x+1)/2*a,E=(-x.y+1)/2*l,S=w.clone().project(i.camera),T=(S.x+1)/2*a,z=(-S.y+1)/2*l,D=Math.sqrt(Math.pow(T-M,2)+Math.pow(z-E,2));return{startLeft:M,startTop:E,endLeft:T,endTop:z,distance:D}},u=(A,w,x)=>{const M=i.camera.position,E=i.camera.getWorldDirection(new ee.Vector3),S=A.clone().sub(M).normalize().angleTo(E),T=w.clone().sub(M).normalize().angleTo(E),z=A.distanceTo(w),k=w.clone().sub(w.clone().sub(A).divide(new ee.Vector3(2,2,2))).distanceTo(M),{startLeft:R,startTop:G,endLeft:I,endTop:U,distance:q}=h(A,w),ne=-((Math.PI/2-Math.atan2(I-R,G-U))/Math.PI)*180;let ie=!0;x||(ie=!1),!Fn(A,x)&&!Fn(w,x)&&(ie=!1),z<.3&&(ie=!1),S>Math.PI/2&&(ie=!1),T>Math.PI/2&&(ie=!1),k/z>8&&(ie=!1);let pe=50,be=q;const Ae=c({x:~~R,y:~~G},{x:~~I,y:~~U});if(Ae&&Ae.length===1&&(Fn(A,x)?(be=Math.sqrt(Math.pow(Ae[0].x-R,2)+Math.pow(Ae[0].y-G,2)),pe=be/q*50):Fn(w,x)&&(be=Math.sqrt(Math.pow(Ae[0].x-I,2)+Math.pow(Ae[0].y-U,2)),pe=100-be/q*50)),Ae&&Ae.length===2){const qe={x:(Ae[0].x+Ae[1].x)/2,y:(Ae[0].y+Ae[1].y)/2};pe=Math.sqrt(Math.pow(qe.x-R,2)+Math.pow(qe.y-G,2))/q*100}return{startLeft:R,startTop:G,distance:q,deg:ne,visible:ie,labelOffset:pe,ruleLength:z}},d=()=>{const A=i.panoIndex,w=r.find(D=>D.panoIndex===A);if(!w)return t(0,o=[]);if(i.currentMode!==Zt.Five.Mode.Panorama)return t(0,o=[]);const x=i.camera.position,M=i.camera.getWorldDirection(new ee.Vector3),E=w.lines.map(D=>new ee.Vector3(D.start[0],-D.start[1],-D.start[2])),S=w.lines.map(D=>new ee.Vector3(D.end[0],-D.end[1],-D.end[2])),[T]=E.concat(S).sort((D,k)=>{const R=D.clone().setY(0).sub(x).normalize().angleTo(M.clone().setY(0)),G=k.clone().setY(0).sub(x).normalize().angleTo(M.clone().setY(0));return R-G}),z=w.lines.map(D=>{var be,Ae;const k=D.start,R=D.end,{startLeft:G,startTop:I,distance:U,deg:q,visible:K,labelOffset:ne,ruleLength:ie}=u(new ee.Vector3(k[0],-k[1],-k[2]),new ee.Vector3(R[0],-R[1],-R[2]),T),pe=[];return D.children&&((be=D.children)==null?void 0:be.length)>0&&((Ae=D.children)==null||Ae.forEach(qe=>{const we=qe.start,le=qe.end,{distance:se}=h(new ee.Vector3(we[0],-we[1],-we[2]),new ee.Vector3(le[0],-le[1],-le[2]));pe.push({width:se,state:qe.state})})),{width:U,left:G,top:I,rotateDeg:q,state:D.state,children:pe,labelOffset:ne,visible:K,labelElement:s.distanceText(ie)}});t(0,o=z)},f=()=>yc(d),m=_m(d,80);return Yn(()=>{d(),i.on("panoArrived",d),i.on("modeChange",d),i.on("cameraDirectionUpdate",f),i.on("movingToPano",f),i.on("mouseWheel",()=>m()),i.on("pinchGesture",()=>m())}),yi(()=>{i.off("panoArrived",d),i.off("modeChange",d),i.off("cameraDirectionUpdate",f),i.off("movingToPano",f),i.off("mouseWheel",()=>m()),i.off("pinchGesture",()=>m())}),e.$$set=A=>{"five"in A&&t(1,i=A.five),"rulerDatas"in A&&t(2,r=A.rulerDatas),"options"in A&&t(3,s=A.options)},[o,i,r,s]}class h5 extends Oe{constructor(n){super(),ke(this,n,c5,l5,Le,{five:1,rulerDatas:2,options:3})}}let u5=class{constructor(n,t){v(this,"five");v(this,"container",document.createElement("div"));v(this,"panoRulerProData");v(this,"rulerItems");v(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:n=>`${n.toFixed(1)}m`}});var i,r;this.five=n,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),t&&(t.data&&this.load(t.data),this.state.options=O(O({},this.state.options),t.options||{}),(i=t.options)!=null&&i.className&&this.container.classList.add((r=t.options)==null?void 0:r.className)),this.five.once("modelLoaded",()=>te(this,null,function*(){var s,o;(o=(s=this.five.getElement())==null?void 0:s.parentNode)==null||o.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(n){return te(this,null,function*(){if(!this.five.work)return;const t=n.data;if(!t)throw new Error("标尺数据依赖不齐全!");this.panoRulerProData=t,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return te(this,null,function*(){var n;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new h5({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(n=this.rulerItems)==null||n.$destroy(),this.rulerItems=void 0})}dispose(){var n;this.container&&((n=this.rulerItems)==null||n.$destroy(),this.rulerItems=void 0),this.container.remove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vIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function p5(){const e=document.createElement("div"),n=document.createElement("i"),t=document.createElement("span");return e.appendChild(n),e.appendChild(t),e.style.position="relative",e.style.width="100%",e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.marginTop=`${150/16}rem`,e.style.opacity="0",e.style.transition="opacity 1000ms linear",n.style.display="block",n.style.width=`${134/16}rem`,n.style.height=`${22/16}rem`,n.style.backgroundSize="100%",n.style.backgroundRepeat="no-repeat",n.style.backgroundImage=`url(${f5})`,t.style.marginTop=`${10/16}rem`,t.style.fontSize=`${16/16}rem`,t.style.color="#fff",t.style.opacity="0.7",t.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",t.style.fontWeight="bold",{appendTo(i){i.appendChild(e)},dispose(){e.remove()},setRoom(i){t.innerHTML=i.name+" "+Math.floor(i.size/1e6)+"㎡"},show(){e.style.opacity="1"},hide(){e.style.opacity="0"}}}const m5=new P.TextureLoader;function qs(e){return te(this,null,function*(){return new Promise((n,t)=>{m5.load(e,n,void 0,t)}).then(n=>(n.encoding=P.sRGBEncoding,n.minFilter=P.NearestFilter,n.magFilter=P.NearestFilter,n))})}function ZA(e){return te(this,null,function*(){return qs(e).then(n=>{const t=e.startsWith("data:")?e.includes("png"):new URL(e,location.href).pathname.toLowerCase().endsWith(".png");return{texture:n,transparent:t}})})}const ld={userAction:!0};class g5 extends Or{constructor(t,i){super(t,i);v(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:this.absoluteUrl("/release/web/v3/north-point-circle.96498e69.png"),entryDoorImageUrl:this.absoluteUrl("/release/web/enterDoor.831b8208.png")}});v(this,"data");v(this,"group",new P.Group);v(this,"roomInfoInstance");v(this,"roomInfoWrapperInstance");v(this,"compassMeshTween");v(this,"compassMesh");v(this,"logoMesh");v(this,"logoMeshTween");v(this,"entryDoorMesh");v(this,"dispose",()=>{var t,i,r,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(i=(t=this.compassMesh)==null?void 0:t.material.map)==null||i.dispose(),(s=(r=this.entryDoorMesh)==null?void 0:r.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});v(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});v(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});v(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});v(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});v(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});v(this,"_clearCompassIfNeed",()=>{var t;this.compassMesh&&(this.group.remove(this.compassMesh),(t=this.compassMesh.material.map)==null||t.dispose(),this.compassMesh=null)});v(this,"_clearLogoIfNeed",()=>{var t;this.logoMesh&&(this.group.remove(this.logoMesh),(t=this.logoMesh.material.map)==null||t.dispose(),this.logoMesh=null)});v(this,"_clearEntryDoorIfNeed",()=>{var t;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(t=this.entryDoorMesh.material.map)==null||t.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});v(this,"onFivePanoWillArrive",t=>{var i,r,s,o;t!==this.five.panoIndex&&((i=this.compassMeshTween)==null||i.dispose(),(r=this.compassMesh)==null||r.material.setValues({opacity:0}),(s=this.logoMeshTween)==null||s.dispose(),(o=this.logoMesh)==null||o.material.setValues({opacity:0}))});v(this,"onFivePanoArrived",t=>{var r,s,o,a,l,c,h,u;const i=(o=(s=(r=this.five.work)==null?void 0:r.observers)==null?void 0:s[t])==null?void 0:o.standingPosition;if(this.compassMesh&&i&&(this.compassMesh.position.copy(i.clone().setY(i.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=vc(1e3).onUpdate(({progress:d})=>{var f;(f=this.compassMesh)==null||f.material.setValues({opacity:d}),this.five.needsRender=!0}).play())),this.logoMesh&&i&&(this.logoMesh.position.copy(i.clone().setY(i.y+.011)),this.logoMesh.material.opacity===0&&((l=this.logoMeshTween)==null||l.dispose(),this.logoMeshTween=vc(1e3).onUpdate(({progress:d})=>{var f;(f=this.logoMesh)==null||f.material.setValues({opacity:d}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const f=new P.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(i.y).sub(i).normalize(),m=i.clone().add(f.clone().multiplyScalar(.7)).setY(i.y+.01);this.entryDoorMesh.rotation.z=new P.Vector3(0,0,-1).angleTo(f),this.entryDoorMesh.position.copy(m),((c=this.data)==null?void 0:c.room_observers[t].room.type)===1?(h=this.entryDoorMesh)==null||h.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&i&&(this.roomInfoWrapperInstance.css3DObject.position.copy(i.clone().setY(i.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[t].room)),this.five.needsRender=!0});v(this,"onFiveCameraDirectionUpdate",({longitude:t,latitude:i})=>{var r,s;this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.rotation.z=t,i>.66&&this.five.getCurrentState().mode==="Panorama"?(r=this.roomInfoInstance)==null||r.show():(s=this.roomInfoInstance)==null||s.hide())});v(this,"onFiveModeChange",(t,i,r,s,o)=>{t!==i&&this.setState({visible:t===Zt.Five.Mode.Panorama},{userAction:o})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:O(O({},this.state.config),i||{})})}enable(t=ld){this.setState({enabled:!0},t)}disable(t=ld){this.setState({enabled:!1},t)}show(t=ld){if(this.state.enabled)return this.setState({visible:!0},t),Promise.resolve()}hide(t=ld){if(this.state.enabled)return this.setState({visible:!1},t),Promise.resolve()}setState(t,i={userAction:!0}){var s,o;const r=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=t.visible)!=null?s:r.visible,enabled:(o=t.enabled)!=null?o:r.enabled,config:O(O({},r.config),t.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:i.userAction}),t.enabled===!0&&(this._enable(),this.hooks.emit("enable",i)),t.enabled===!1&&(this._disable(),this.hooks.emit("disable",i)),t.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",i)),t.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",i)),t.config&&this.init()}load(t,i,r=!0){return te(this,null,function*(){const s=yield this.formatData(t);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=O({},s),this.init(),i&&this.setState(i,{userAction:r}),this.hooks.emit("dataLoaded",this.data))})}formatData(t){return t.version&&t.data?Promise.resolve(t.data):Promise.resolve(t)}init(){return te(this,null,function*(){var r,s,o,a;const t=(s=(r=this.data)==null?void 0:r.north_rad)!=null?s:null;this._clearCompassIfNeed(),t!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh&&(this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(t-Math.PI/2),this.group.add(this.compassMesh))),this._clearLogoIfNeed(),this.logoMesh=yield this.loadLogoMesh(),this.logoMesh&&(this.logoMesh.rotateX(-Math.PI/2),this.group.add(this.logoMesh));const i=(a=(o=this.data)==null?void 0:o.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),i!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=p5(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return te(this,null,function*(){const t=this.state.config.compassImageUrl,i=yield qs(t),r=new P.CircleGeometry(.7,32),s=new P.MeshBasicMaterial({map:i,transparent:!0,opacity:0,depthTest:!1}),o=new P.Mesh(r,s);return o.name="pano-compass-mesh",o})}loadLogoMesh(){return te(this,null,function*(){if(!this.state.config.logoURL)return;const t=this.state.config.logoURL,i=yield qs(t);i.minFilter=P.NearestFilter,i.magFilter=P.NearestFilter;const r=new P.PlaneBufferGeometry(.4,.4),s=new P.MeshBasicMaterial({map:i,opacity:0,transparent:!0,depthTest:!1}),o=new P.Mesh(r,s);return o.name="pano-compass-logo-mesh",o})}loadEntryDoorMesh(){return te(this,null,function*(){const t=this.state.config.entryDoorImageUrl,i=yield qs(t),r=new P.PlaneGeometry(.2,.16),s=new P.MeshBasicMaterial({map:i,transparent:!0,opacity:.8,depthTest:!1}),o=new P.Mesh(r,s);return o.name="pano-compass-entry-door",o})}loadRoomInfo(){const t=[new P.Vector3(-.7,0,-.7),new P.Vector3(.7,0,-.7),new P.Vector3(.7,0,.7),new P.Vector3(-.7,0,.7)];return Ac(this.five).create3DDomContainer(t)}}const v5=(e,n)=>new g5(e,n),y5=1,b5=3,A5=new ee.Color(16777215),w5=new ee.Color(6522623),x5=new ee.Color(16777215),M5=new ee.Color(6522623),C5=6,P5=8,E5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",JA=new ee.TextureLoader().load(E5),_5={pointTexture:JA,pointSize:C5,lineWidth:y5,lineColor:A5,pointColor:x5,lineRenderOrder:20,pointsRenderOrder:20},S5={pointTexture:JA,pointSize:P5,lineWidth:b5,lineColor:w5,pointColor:M5,lineRenderOrder:10,pointsRenderOrder:10};function I5(e,n,t){var h,u,d,f,m;const i=(h=t==null?void 0:t.lineWidth)!=null?h:2,r=(u=t==null?void 0:t.lineColor)!=null?u:new ee.Color(16777215),s=(d=t==null?void 0:t.pointSize)!=null?d:5,o=(f=t==null?void 0:t.lineRenderOrder)!=null?f:10,a=(m=t==null?void 0:t.lineRenderOrder)!=null?m:20,l=new Sv(e,n);l.setMaterial({linewidth:i,color:r}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=o,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,t!=null&&t.pointColor&&c.color.set(t.pointColor).convertSRGBToLinear(),t!=null&&t.pointTexture&&(c.map=t.pointTexture),l}function qA(e,n){const[t,i]=e.points,r=n==="light"?S5:_5,s=I5(t.position,i.position,r);return s.name="normalLine_"+e.id,s}function Ks(e){const{x:n,y:t,z:i}=e;return!(Math.abs(n)>1||Math.abs(t)>1||Math.abs(i)>1)}function cd(e){const{z:n}=e;return!(Math.abs(n)>1)}function T5(e){const n=document.createElement("div");return n.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),n.style.width="max-content",n.style.padding="3px 6px",n.style.lineHeight="1",n.style.textAlign="center",n.style.transform="translate(-50%, -50%)",n.style.fontSize="14px",n.style.color="#fff",n.style.cursor="pointer",n.style.userSelect="none",e!=null&&e.style&&Object.assign(n.style,e==null?void 0:e.style),n}function D5(e){const n=document.createElement("div");return e!=null&&e.id&&(n.id=e==null?void 0:e.id),n.classList.add("five-plugin-measure__distance"),n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width="0",n.style.height="0",n.style.transform="translate(-10px, -10px)",n.style.transformOrigin="left top",e!=null&&e.style&&Object.assign(n.style,e.style),n}class KA{constructor(n){v(this,"ndcPosition");v(this,"contentDom");v(this,"containerDom");v(this,"params");v(this,"canSelected");v(this,"handleClick",n=>{var t,i;(i=(t=this.params).clickCallback)==null||i.call(t,n,this)});this.params=n,this.contentDom=T5({style:n.contentStyle}),this.containerDom=D5({style:n.containerStyle}),this.setCanSelect(!0)}setCanSelect(n){this.canSelected=n,this.containerDom.style.pointerEvents=n?"all":"none"}highlight(){this.contentDom.style.border="0.5px solid #95AEFF",this.contentDom.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}unHighlight(){this.contentDom.style.border="0.5px solid rgba(255,255,255,0.6)",this.contentDom.style.background="rgba(195,195,195,0.70)"}appendTo(n){n.appendChild(this.containerDom),this.containerDom.addEventListener("click",this.handleClick)}remove(){this.contentDom.removeEventListener("click",this.handleClick),this.containerDom.remove()}show(){this.containerDom.style.visibility="visible"}hide(){this.containerDom.style.visibility="hidden"}tempHide(){this.containerDom.style.opacity="0"}tempShow(){this.containerDom.style.opacity="1"}updateDomPosition(n){if(!this.ndcPosition){this.tempHide();return}const t=n.getElement();if(!t)return;const i=t.clientWidth,r=t.clientHeight,s=this.ndcPosition.clone().project(n.camera);if(!cd(s)){this.tempHide();return}const o=(s.x+1)/2*i,a=-(s.y-1)/2*r;this.containerDom.style.transform=`translate(${o}px, ${a}px)`,this.tempShow()}}class L5 extends KA{constructor(t){var i;t.contentStyle=Pe(O({},t.contentStyle),{background:"rgba(195,195,195,0.70)",border:"0.5px solid rgba(255,255,255,0.6)",borderRadius:"999px"});super(t);v(this,"line");this.line=t.line,(i=this.params.userDistanceItem)!=null&&i.element?this.containerDom.appendChild(this.params.userDistanceItem.element):this.containerDom.appendChild(this.contentDom)}update(t){var E;if(this.line.mesh.visible===!1){this.hide();return}const i=t.getElement();if(!i)return;const r=i.clientWidth,s=i.clientHeight,o=r/2,a=s/2;if(this.line.points.length<2)return;const[l,c]=this.line.points.map(S=>S.position.clone().applyMatrix4(this.line.mesh.matrixWorld)),h=l.clone().project(t.camera),u=c.clone().project(t.camera),d=Hi(l,c).clone().project(t.camera),f=new ee.Vector2(h.x*o,h.y*a),m=new ee.Vector2(u.x*o,u.y*a),p=f.distanceTo(m);if((()=>!(Math.abs(h.z)>1||Math.abs(u.z)>1||!cd(h)&&!cd(u)||!cd(d)||p===0))()===!1){this.hide();return}const y=(d.x+1)/2*r,b=-(d.y-1)/2*s,w=-(Math.atan((f.y-m.y)/(f.x-m.x))*180)/Math.PI,x=this.containerDom.parentElement&&this.contentDom.clientWidth>p?-20:0;this.containerDom.style.transform=`translate(${y}px, ${b}px) rotate(${w}deg) translateY(${x}px)`,this.show(),(E=this.params.userDistanceItem)==null||E.update({line:this.line,polyline:this.line.getPolyline()});const M=this.getCurrentContent();this.contentDom.innerText=M}getCurrentContent(){var l,c,h,u;if(this.line.points.length<2)return"";const[t,i]=this.line.points,r=t.position.clone().distanceTo(i.position),s=(c=this.line.text)!=null?c:(l=this.line.model.config)==null?void 0:l.defaultText,o=(u=(h=this.line.model.config)==null?void 0:h.getDistanceText)==null?void 0:u.call(h,r),a=s!=null?s:o;return a!=null?a:r.toFixed(2)+"m"}}let $s=class fC{constructor(n,t,i){v(this,"id");v(this,"selected",!1);v(this,"text");v(this,"type","line");v(this,"model");v(this,"mesh");v(this,"points");v(this,"lightMesh");v(this,"hook");v(this,"distanceItem");v(this,"polyline");v(this,"visible");var r;if(this.id=wn(),this.model=i,n.id===t.id)throw new Error("无效的线段, 一个点无法构成线段");typeof i.config.defaultText=="string"&&(this.text=i.config.defaultText),this.hook=new Zt.Subscribe,this.points=[n,t],this.mesh=qA(this,"normal"),this.lightMesh=qA(this,"light"),this.distanceItem=new L5({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(r=this.model.config)!=null&&r.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0})}hide(){this.visible&&(this.visible=!1,this.mesh.visible=!1,this.distanceItem.hide())}show(){this.visible||(this.visible=!0,this.mesh.visible=!0,this.distanceItem.show())}setPoints(n,t){this.points[0].position.copy(n),this.points[1].position.copy(t),this.mesh.setPoints(n,t)}remove(){this.mesh.parent&&this.mesh.parent.remove(this.mesh),this.distanceItem.remove()}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const n=this.model.polylines.find(t=>t.lines.includes(this));if(n)return this.polyline=n,n}findAnotherPoint(n){return this.points.find(({id:t})=>t!==n.id)}setText(n){this.text=n,this.hook.emit("textChanged",n)}toJSON(){return this.toJson()}toJson(){return{id:this.id,points:this.points.map(n=>n.toJson()),text:this.text}}clone(){const n=new fC(this.points[0].clone(),this.points[1].clone(),this.model);return n.text=this.text,n}},hi=class pC{constructor(n){v(this,"id");v(this,"position");v(this,"type","point");if(this.id=wn(),this.position=new ee.Vector3,Array.isArray(n))this.position.fromArray(n);else if(typeof n=="object"&&n.isVector3)this.position.copy(n);else throw new Error("position must be Vector3 or number[]")}toJson(){return{id:this.id,position:this.position.toArray()}}clone(){return new pC(this.position)}};const hd=e=>e.preventDefault();let ud=class{constructor(n){v(this,"model");v(this,"five");v(this,"group");v(this,"config");v(this,"dashed");v(this,"perpendicularDashed");v(this,"disposed",!1);v(this,"isMobile");v(this,"editParams");v(this,"magnifierParams");v(this,"mouseGroup");v(this,"container");v(this,"hook");v(this,"magnifier");v(this,"userDistanceItemCreator");v(this,"pointSelectorConfig");v(this,"workUtil");v(this,"getMeasureType");v(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(n=>n.distanceItem.update(this.five))});v(this,"updateAreaUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllAreas().forEach(n=>{n.areaItem.updateArea(this.five),n.polyline.lines.forEach(t=>{t.distanceItem.update(this.five)})})});var i,r,s;this.five=n.five,this.hook=n.hook,this.model=n.model,this.getMeasureType=n.getMeasureType,this.config=n.config,this.editParams=n.editParams,this.magnifierParams=n.magnifierParams,this.magnifier=n.magnifier,this.pointSelectorConfig=Pe(O({},n.pointSelectorConfig),{helper:O({magnifierParams:n.magnifierParams},(i=n.pointSelectorConfig)==null?void 0:i.helper)}),this.container=n.container,this.isMobile=(s=(r=n.openParams)==null?void 0:r.isMobile)!=null?s:!1,this.workUtil=n.workUtil,this.userDistanceItemCreator=n.userDistanceItemCreator,this.group=n.group,this.mouseGroup=n.mouseGroup,this.dashed=new $s(new hi([0,0,0]),new hi([0,0,0]),this.model),this.dashed.distanceItem.setCanSelect(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine",this.perpendicularDashed=new $s(new hi([0,0,0]),new hi([0,0,0]),this.model),this.perpendicularDashed.distanceItem.setCanSelect(!1),this.perpendicularDashed.mesh.setMaterial({dashed:!0,dashScale:40,color:new ee.Color(10218089)}),this.perpendicularDashed.mesh.name="perpendicularDashLine";const t=this.five.getElement();t&&(t.addEventListener("touchstart",hd),t.addEventListener("contextmenu",hd))}get currentMeasureType(){return this.getMeasureType()}removeLine(n){this.group.remove(n.mesh,n.lightMesh),n.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(n,t){if(!n)return this.mouseGroup;if(this.mouseGroup.position.copy(n.point),t)this.mouseGroup.quaternion.copy(t.quaternion);else if(n.face){const r=n.face.normal.clone().multiplyScalar(.05),o=n.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(o)}return this.mouseGroup}dispose(){var t;this.disposed=!0,(t=this.magnifier)==null||t.disable(),this.model.getAllLines().forEach(i=>this.removeLine(i)),this.model.areas.forEach(i=>i.remove());const n=this.five.getElement();n&&(n.removeEventListener("touchstart",hd),n.removeEventListener("contextmenu",hd))}},eo=class{constructor(n){v(this,"id",wn());v(this,"lines",[]);v(this,"visiblePanoIndexes");v(this,"visibleFiveMode");v(this,"model");v(this,"type","polyline");v(this,"hook",new Zt.Subscribe);this.model=n.model}get points(){const n=new Set;return this.lines.forEach(t=>{n.add(t.points[0]),n.add(t.points[1])}),Array.from(n)}addLine(n){if(this.includes(n)){console.error(new Error("不能重复添加线段"));return}const t=this.getLastPoint(),i=t&&n.findAnotherPoint(t);if(t&&!i){console.error(new Error("传入线段无法与当前折线进行连接"));return}this.lines.push(n),this.hook.emit("lineAdded",n)}removeLine(n){if(this.lines.length===0)return;if(!this.isLastLine(n)){console.error(new Error("传入线段不是当前折线的最后一段"));return}this.lines.pop()&&this.hook.emit("lineRemoved",n)}isLastLine(n){const t=this.getLastLine();return t?n.id===t.id:!1}getLastLine(){return this.lines.slice(-1)[0]}getPointLength(){return this.lines.length+1}clear(){const n=this.lines.slice();this.lines.length=0,n.reduceRight((t,i)=>this.hook.emit("lineRemoved",i),void 0)}overlapWith(n){return n.type==="point"?this.includes(n):n.type==="line"?n.points.some(t=>this.includes(t)):n.type==="polyline"?n.points.some(t=>this.includes(t)):!0}includes(n){return n.type==="point"?this.points.find(({id:t})=>t===n.id)!==void 0:n.type==="line"?this.lines.find(({id:t})=>t===n.id)!==void 0:!1}isEmpty(){return this.lines.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJSON(){return this.toJson()}toJson(){return{id:this.id,lines:this.lines.map(n=>n.toJson()),visiblePanoIndexes:this.visiblePanoIndexes,visibleFiveMode:this.visibleFiveMode}}getPointByID(n){return this.points.find(({id:t})=>t===n)}fromJson(n){this.clear(),this.id=n.id;const{getPoint:t}=r(),i=n.lines.map(s=>{const[o,a]=s.points,l=t(o),c=t(a);if(!l||!c)throw new Error("线上的点不存在");const h=new $s(l,c,this.model);return h.id=s.id,h.text=s.text,h});this.lines.push(...i),this.visiblePanoIndexes=n.visiblePanoIndexes,this.visibleFiveMode=n.visibleFiveMode;function r(){const s=new Map;function o(l){const c=s.get(l.id);if(c)return c;const h=new hi(l.position);return h.id=l.id,s.set(l.id,h),h}function a(){return Array.from(s.values())}return{getPoint:o,getAllPoints:a}}return this}replace(n){this.id=n.id,this.clear(),this.lines.push(...n.lines)}};function Mc(e,n){if(e.length<3){console.error("points.length < 3");return}const[t,i,r]=e,s=t.clone().sub(i),o=t.clone().sub(r),a=s.cross(o).normalize();return typeof n=="number"?a.multiplyScalar(n):a}function k5(e){if(e.length<3)return[];const n=Mc([e[0].clone(),e[1].clone(),e[2].clone()]),t=new P.Quaternion().setFromUnitVectors(new P.Vector3(0,1,0),n),r=e.map(o=>o.clone().applyQuaternion(t)).flatMap(o=>[o.x,o.z]);return pr(r)}function Dm(e,n){const t=Array.isArray(n)?n:[n];for(let i=0;i<t.length;i++){const r=e.start,s=e.end,o=t[i].start,a=t[i].end;if(!(Cc(r,o)||Cc(r,a)||Cc(s,o)||Cc(s,a)||Cc(r,s))&&O5([r.x,r.y,r.z],[s.x,s.y,s.z],[o.x,o.y,o.z],[a.x,a.y,a.z]))return!0}return!1}function O5(e,n,t,i){const r=[n[0]-e[0],n[1]-e[1],n[2]-e[2]],s=[i[0]-t[0],i[1]-t[1],i[2]-t[2]],o=[[r[0],-s[0]],[r[1],-s[1]],[r[2],-s[2]]],a=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],l=R5(o,a);if(l===null)return!1;const[c,h]=l;return!!($A(c)&&$A(h))}function R5(e,n){if(z5(e)===0)return null;const i=B5(e);return N5(i,n)}function z5(e){return e[0][0]*e[1][1]-e[0][1]*e[1][0]}function B5(e){const n=e[0][0]*e[1][1]-e[0][1]*e[1][0];return[[e[1][1]/n,-e[0][1]/n],[-e[1][0]/n,e[0][0]/n]]}function N5(e,n){return[e[0][0]*n[0]+e[0][1]*n[1],e[1][0]*n[0]+e[1][1]*n[1]]}function $A(e){return e>=0&&e<=1}function Cc(e,n){return e.x===n.x&&e.y===n.y&&e.z===n.z}function e1(e,n){const t=[...new Set(e)];if(t.length<3)return;if(t.at(-1).equals(t[0])||t.push(t[0]),n!=null&&n.checkLinesIntersect&&t.length>=5){const a=t.map((l,c)=>{if(c!==0)return{start:t[c-1],end:t[c]}}).filter(Boolean);for(let l=0;l<a.length;l++)if(Dm(a[l],a.slice(l)))return}const i=t.flatMap(a=>[a.x,a.y,a.z]),r=new P.Float32BufferAttribute(i,3),s=k5(t),o=new P.BufferGeometry;return o.setAttribute("position",r),o.setIndex(s),o.name="PolygonGeometry",o}const F5=new P.BufferGeometry;let t1=class extends ei{constructor(t){super();v(this,"isPolygonMesh",!0);v(this,"geometry",new P.BufferGeometry);v(this,"isBlank",!0);v(this,"points",[]);const i=new P.MeshBasicMaterial({color:4090367,transparent:!0,side:P.DoubleSide,depthTest:!0,opacity:.5}),r=new P.MeshBasicMaterial({color:16777215,transparent:!0,side:P.DoubleSide,depthTest:!1,depthWrite:!1,opacity:.3}),s=new P.Mesh(this.geometry,i),o=new P.Mesh(this.geometry,r);s.renderOrder=1,o.renderOrder=0,t&&this.updatePoints(t),this.add(s,o)}updatePoints(t){this.points=t;const i=e1(t);i?(this.geometry.copy(i),this.isBlank=!1):(this.geometry.copy(F5),this.isBlank=!0)}};function n1(e){const n=G5(e);if(n.length===0){console.warn("No geometry triangles found"),console.debug({geometry:e,triangles:n});return}let t=0,i=new ee.Vector3;for(const[r,s,o]of n){const a=i1(r,s,o),l=V5(r,s,o,a);t+=a,i.add(l)}return i=i.divideScalar(t),{center:i,area:t}}function i1(e,n,t){return n.clone().sub(e).cross(t.clone().sub(e)).length()/2}function V5(e,n,t,i){const r=i!=null?i:i1(e,n,t);return Hi(e,n,t).multiplyScalar(r)}function G5(e){var r;const n=e.getAttribute("position"),t=(r=e.getIndex())==null?void 0:r.array;if(!n||!t)return[];let i=[];for(let s=0;s<t.length;s+=3){const o=t[s],a=t[s+1],l=t[s+2],c=new ee.Vector3().fromArray([n.getX(o),n.getY(o),n.getZ(o)]),h=new ee.Vector3().fromArray([n.getX(a),n.getY(a),n.getZ(a)]),u=new ee.Vector3().fromArray([n.getX(l),n.getY(l),n.getZ(l)]);i.push([c,h,u])}return i}class j5 extends KA{constructor(t){t.containerStyle=Pe(O({},t.containerStyle),{zIndex:"1"}),t.contentStyle=Pe(O({},t.contentStyle),{background:"#6386FF",borderRadius:"2px"});super(t);v(this,"area");this.area=t.area,this.containerDom.appendChild(this.contentDom)}updateArea(t,i){var l,c;const r=i!=null?i:this.area.polygon.geometry,s=n1(r);if(!s){this.ndcPosition=null,this.updateDomPosition(t);return}const{area:o,center:a}=s;this.ndcPosition=a,this.updateDomPosition(t),(c=(l=this.area.model)==null?void 0:l.config)!=null&&c.getAreaText?this.contentDom.innerText=this.area.model.config.getAreaText(o):this.updateAreaText(o,{fix:2})}updateAreaText(t,i){const{unit:r="m²",fix:s}=i!=null?i:{};this.contentDom.innerText=`${Dr(s)?t:t.toFixed(s)}${r}`}}class Lm{constructor(n,t){v(this,"id",wn());v(this,"selected",!1);v(this,"text");v(this,"type","area");v(this,"lightMesh");v(this,"areaItem");v(this,"hook",new Zt.Subscribe);v(this,"model");v(this,"polygon");v(this,"points",[]);v(this,"planeHelper");v(this,"polyline");v(this,"meshContainer");v(this,"domContainer");v(this,"five");v(this,"updateDom",()=>{this.five&&(this.polyline.lines.forEach(n=>n.distanceItem.update(this.five)),this.areaItem.updateDomPosition(this.five))});var i;n&&(this.points=n),this.model=t.model,this.polygon=new t1(n),this.polyline=new eo({model:t.model}),this.areaItem=new j5({area:this,clickCallback:(r,s)=>{const o=r.clientX+"px",a=r.clientY+"px";this.hook.emit("selected",this,{left:o,top:a})}}),this.domContainer=t.domContainer||null,this.meshContainer=t.meshContainer||null,this.five=t.five||null,this.areaItem.appendTo(this.domContainer),(i=this.five)==null||i.on("cameraUpdate",this.updateDom)}get isClosed(){var n;return this.points.length>=4&&((n=this.points.at(0))==null?void 0:n.equals(this.points.at(-1)))}addPoints(n){var r;this.points=this.points.concat(n);const t=this.points.at(-2),i=this.points.at(-1);if(t&&i){const s=new $s(new hi(t),new hi(i),this.polyline.model);this.polyline.addLine(s),this.meshContainer.add(s.mesh),this.five&&(s.distanceItem.setCanSelect(!1),s.distanceItem.appendTo(this.domContainer),s.distanceItem.update(this.five))}(r=this.meshContainer)!=null&&r.children.includes(this.polygon)||this.meshContainer.add(this.polygon),this.polygon.updatePoints(this.points),this.areaItem.updateArea(this.five),this.points.length===3?this.planeHelper=new P.Plane().setFromCoplanarPoints(this.points[0],this.points[1],this.points[2]):this.points.length<3&&(this.planeHelper=null)}popPoint(){this.points.pop();const n=this.polyline.lines.pop();n==null||n.remove(),this.polygon.updatePoints(this.points),this.areaItem.updateArea(this.five),this.points.length<3&&(this.planeHelper=null)}complete(){this.points.at(-1).equals(this.points[0])||this.addPoints(this.points[0])}hideArea(){this.polygon.visible=!1,this.areaItem.hide()}showArea(){this.polygon.visible=!0,this.areaItem.show()}projectPoint(n){return n&&(this.planeHelper?this.planeHelper.projectPoint(n,new P.Vector3):n)}remove(){this.polygon.removeFromParent(),this.areaItem.remove(),this.polyline.lines.forEach(n=>n.remove())}dispose(){this.remove(),this.model.areas.splice(this.model.areas.indexOf(this),1),this.planeHelper=null,this.five.off("cameraUpdate",this.updateDom),this.five.needsRender=!0}toJSON(){return{id:this.id,points:this.points.map(n=>n.toArray()),text:this.text}}}const Pc="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;function H5(e,n){const{x:t,y:i}=n,r=t*2-1,s=i*2-1,o=new P.Raycaster;return o.setFromCamera({x:r,y:s},e.camera),o.params.Points.threshold=.02,o}function Ec(e,n,t){const i=U5(e,n);return t!=null&&t.virtualPoint?i!=null?i:r1(n):i}function r1(e,n=3){const t=new P.Vector3().addVectors(e.ray.origin,e.ray.direction.clone().normalize().multiplyScalar(n)),i=e.ray.direction.clone().negate();return{distance:n,point:t,object:new P.Object3D,face:new P.Face3(0,0,0,i),raycaster:e,isVirtual:!0}}function U5(e,n){const r=Li(e).intersectRaycaster(n)[0];if(r)return Pe(O({},r),{raycaster:n,isVirtual:!1})}const s1=`url("data:image/svg+xml,%3Csvg width='12px' height='12px' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cpath d='M6,12 C9.3137085,12 12,9.3137085 12,6 C12,2.6862915 9.3137085,0 6,0 C2.6862915,0 0,2.6862915 0,6 C0,9.3137085 2.6862915,12 6,12 Z' fill='%23FF5959'%3E%3C/path%3E%3Cg transform='translate(2, 2)' stroke='%23FFFFFF'%3E%3Ccircle cx='4' cy='4' r='4'%3E%3C/circle%3E%3Cline x1='1.07141075' y1='1.23997894' x2='6.64700843' y2='6.81557662'%3E%3C/line%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 6 6, auto`,W5=new P.Vector3,ja=()=>!1;class o1 extends Pn{constructor(t,i){var o,a,l;super();v(this,"_cursorError",!1);v(this,"actionIfNoModelUnderMouse","virtualPoint");v(this,"plane");v(this,"pointSelectorHelper");v(this,"hook",this);v(this,"five");v(this,"_outOfFive",!1);v(this,"_enabled",!1);v(this,"mode");v(this,"pressDown",!1);v(this,"adherePoints");v(this,"adherePointsRadius",.1);v(this,"setPressDown");v(this,"lastFiveHelperVisible");v(this,"lastIntersection");v(this,"mousePosition");v(this,"config",{});v(this,"select",t=>{t&&this.updatePointSelectorHelperIntersect(t);const i=this.emit("wantsSelect",this.position);return i||(this.pointSelectorHelper.hide(),this.emit("select",this.position),console.debug(this.position)),!i});v(this,"onMouseWheel",t=>{this.updateByMousePosition(t);const i=()=>this.updateByMousePosition();this.five.off("render.prepare",i),this.five.on("render.prepare",i),setTimeout(()=>{this.five.off("render.prepare",i)},200)});v(this,"onEnter",()=>{this.cursorError||this.pointSelectorHelper.show(),this.outOfFive=!1,this.emit("intersectionUpdate",this.position)});v(this,"onLeave",()=>{this.pointSelectorHelper.hide(),this.outOfFive=!0,this.emit("intersectionUpdate",null)});v(this,"onClick",()=>{this.select()});v(this,"onTouchStart",t=>{this.setPressDown=setTimeout(()=>{if(this.setPressDown=void 0,this.mousePosition={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},!this.mouseNdcPosition)return;const i=this.updateByNdcPosition(this.mouseNdcPosition);this.pressDown=i},300)});v(this,"onTouchMove",t=>{if(this.setPressDown){clearTimeout(this.setPressDown),this.setPressDown=void 0;return}if(this.pressDown){if(this.mousePosition={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},!this.mouseNdcPosition)return;this.updateByNdcPosition(this.mouseNdcPosition)}});v(this,"onTouchEnd",t=>{if(this.setPressDown){clearTimeout(this.setPressDown),this.setPressDown=void 0;return}this.pressDown&&(setTimeout(()=>{this.pressDown=!1},100),this.select())});v(this,"updateByMousePosition",t=>{this.five.getElement()&&(t&&(this.mousePosition=t),this.updateByNdcPosition(this.mouseNdcPosition))});v(this,"updateByNdcPosition",t=>{var s,o;const i=H5(this.five,t),r=Ec(this.five,i);if(r)return this.updatePointSelectorHelperIntersect(r),this.lastIntersection=r,!0;if(this.plane){const a=i.ray.intersectPlane(this.plane,W5);if(a){const l={distance:this.five.camera.position.distanceTo(a),point:a.clone(),object:new P.Object3D,face:new P.Face3(0,0,0,this.plane.normal.clone()),raycaster:i,isVirtual:!0};return this.updatePointSelectorHelperIntersect(l),!0}}if(this.actionIfNoModelUnderMouse==="lastPoint")return this.updatePointSelectorHelperIntersect(this.lastIntersection),!0;if(this.actionIfNoModelUnderMouse==="virtualPoint"){const a=r1(i,(s=this.lastIntersection)==null?void 0:s.distance);return a.face=new P.Face3(0,0,0,(o=this.lastIntersection)==null?void 0:o.face.normal),a.isVirtual=!0,this.lastIntersection=a,this.updatePointSelectorHelperIntersect(a),!0}else if(this.actionIfNoModelUnderMouse==="disable")return this.updatePointSelectorHelperIntersect(null),!1});v(this,"updatePointSelectorHelperIntersect",t=>{if(!t){this.onLeave(),this.five.getElement().style.cursor=s1;return}this.onEnter(),this.cursorError||(this.five.getElement().style.cursor="");const i=O({},t);let r=!1;if(typeof this.adherePoints=="function"&&typeof this.adherePointsRadius=="number"){for(const s of this.adherePoints({intersection:t,pointSelectorInstance:this}))if(s.distanceTo(t.point)<this.adherePointsRadius){i.point=s.clone(),r=!0;break}}this.pointSelectorHelper.updateWithIntersect(i,{emitEvent:!1}),this.emit("intersectionUpdate",i,r)});v(this,"mousePositionToNdcPosition",t=>{const i=this.five.getElement();if(!i)return null;const{top:r,left:s,width:o,height:a}=i.getBoundingClientRect(),{clientX:l,clientY:c}=t;return{x:(l-s)/o,y:1-(c-r)/a}});v(this,"onFiveWantsPanGesture",()=>{if(this.pressDown)return!1});v(this,"renderScreenCenter",()=>{this.updateByNdcPosition({x:.5,y:.5})});v(this,"emitIntersectionUpdate",t=>{this.emit("intersectionUpdate",t)});this.five=t,this.config=O(O({},this.config),i),this.actionIfNoModelUnderMouse=(o=i==null?void 0:i.actionIfNoModelUnderMouse)!=null?o:"virtualPoint";const r=(a=i==null?void 0:i.mode)!=null?a:"auto";r==="auto"?this.mode=Pc?"fixed":"cursor":this.mode=r;const s={autoFixPCPosition:this.mode==="cursor",initialPosition:this.mode==="fixed"?{left:"35%",top:"20%"}:void 0};this.pointSelectorHelper=new cb(this.five,Pe(O({},i==null?void 0:i.helper),{magnifierParams:O(O({},s),(l=i==null?void 0:i.helper)==null?void 0:l.magnifierParams)})),this.pointSelectorHelper.hide()}get position(){return this.outOfFive?null:this.pointSelectorHelper.position}get outOfFive(){return this._outOfFive}get enabled(){return this._enabled}get cursorError(){return this._cursorError}set cursorError(t){this._cursorError=t,this.five.getElement().style.cursor=t?s1:"",t?this.pointSelectorHelper.hide():this.pointSelectorHelper.show()}set outOfFive(t){this._outOfFive=t}set enabled(t){this._enabled=t}get mouseNdcPosition(){return this.mousePosition?this.mousePositionToNdcPosition(this.mousePosition):null}enable(){if(this.enabled)return;this.enabled=!0,this.outOfFive=!1,this.pointSelectorHelper.enable(),this.pointSelectorHelper.hide();const t=this.five.getElement();if(!t)throw new Error("five element not found");this.mode==="cursor"?(this.five.on("wantsMoveToPano",ja),this.five.on("wantsChangeMode",ja),this.five.on("wantsTapGesture",ja),Pc?(t.addEventListener("touchstart",this.onTouchStart,{passive:!0}),t.addEventListener("touchmove",this.onTouchMove),t.addEventListener("touchend",this.onTouchEnd)):(t.addEventListener("click",this.onClick),t.addEventListener("mousemove",this.updateByMousePosition),t.addEventListener("wheel",this.onMouseWheel),t.addEventListener("mouseenter",this.onEnter),t.addEventListener("mouseout",this.onLeave)),this.five.on("wantsPanGesture",this.onFiveWantsPanGesture)):this.mode==="fixed"&&(this.five.on("panoArrived",this.renderScreenCenter),this.five.on("panGesture",this.renderScreenCenter),this.five.on("interiaPan",this.renderScreenCenter),this.renderScreenCenter(),this.pointSelectorHelper.show()),this.pointSelectorHelper.hooks.on("intersectionUpdate",this.emitIntersectionUpdate),this.lastFiveHelperVisible=this.five.helperVisible,this.five.helperVisible=!1,this.emit("enable")}disable(){if(!this.enabled)return;this.enabled=!1,this.pointSelectorHelper.disable(),this.five.getElement().style.cursor="";const t=this.five.getElement();this.five.off("wantsPanGesture",this.onFiveWantsPanGesture),this.five.off("wantsMoveToPano",ja),this.five.off("wantsChangeMode",ja),this.five.off("wantsTapGesture",ja),this.five.helperVisible=this.lastFiveHelperVisible,t==null||t.removeEventListener("touchstart",this.onTouchStart),t==null||t.removeEventListener("touchmove",this.onTouchMove),t==null||t.removeEventListener("touchend",this.onTouchEnd),t==null||t.removeEventListener("click",this.onClick),t==null||t.removeEventListener("mousemove",this.updateByMousePosition),t==null||t.removeEventListener("wheel",this.onMouseWheel),t==null||t.removeEventListener("mouseenter",this.onEnter),t==null||t.removeEventListener("mouseout",this.onLeave),this.five.off("panoArrived",this.renderScreenCenter),this.five.off("panGesture",this.renderScreenCenter),this.five.off("interiaPan",this.renderScreenCenter),this.pointSelectorHelper.hooks.off("intersectionUpdate",this.emitIntersectionUpdate),this.emit("disable")}dispose(){this.disable(),this.pointSelectorHelper.dispose()}setAdherePoints(t,i){t?typeof t=="function"?this.adherePoints=t:this.adherePoints=()=>t:this.adherePoints=null,typeof i=="number"&&(this.adherePointsRadius=i)}}const Q5=`
|
|
3268
3268
|
<svg class="fpm__delete-icon" width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3269
3269
|
<defs>
|
|
3270
3270
|
<linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">
|