@realsee/dnalogel 3.50.12 → 3.50.13
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 +3 -0
- package/dist/PanoTagPlugin/controller/Tag/BaseTag.d.ts +3 -3
- package/dist/PanoTagPlugin/controller/TagRender.d.ts +0 -3
- package/dist/PanoTagPlugin/controller/index.d.ts +4 -0
- package/dist/base/BasePlugin.d.ts +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +18 -20
- package/dist/index.umd.js +3 -3
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.d.ts +3 -3
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +0 -3
- package/libs/PanoTagPlugin/controller/TagRender.js +80 -110
- package/libs/PanoTagPlugin/controller/index.d.ts +4 -0
- package/libs/PanoTagPlugin/controller/index.js +41 -29
- package/libs/base/BasePlugin.d.ts +1 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var lE=Object.defineProperty,cE=Object.defineProperties;var hE=Object.getOwnPropertyDescriptors;var ih=Object.getOwnPropertySymbols;var uv=Object.prototype.hasOwnProperty,dv=Object.prototype.propertyIsEnumerable;var uf=(e,n,t)=>n in e?lE(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,R=(e,n)=>{for(var t in n||(n={}))uv.call(n,t)&&uf(e,t,n[t]);if(ih)for(var t of ih(n))dv.call(n,t)&&uf(e,t,n[t]);return e},Ee=(e,n)=>cE(e,hE(n));var Ps=(e,n)=>{var t={};for(var i in e)uv.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&ih)for(var i of ih(e))n.indexOf(i)<0&&dv.call(e,i)&&(t[i]=e[i]);return t};var v=(e,n,t)=>(uf(e,typeof n!="symbol"?n+"":n,t),t);var ee=(e,n,t)=>new Promise((i,r)=>{var s=l=>{try{a(t.next(l))}catch(c){r(c)}},o=l=>{try{a(t.throw(l))}catch(c){r(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(e,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Jt=require("@realsee/five"),ne=require("three"),du=require("three/examples/jsm/renderers/CSS3DRenderer"),Wm=require("hammerjs"),Qm=require("@realsee/five/line"),fu=require("animejs"),H1=require("three/examples/jsm/loaders/FBXLoader"),uE=require("earcut"),dE=require("@realsee/five/gltf-loader");function fE(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 E=fE(ne);function pE(){console.debug("%c %c@realsee/dnalogel %cv3.50.12",["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 mE(){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 j1(){}const fv=()=>Promise.resolve(),pv={__queue:Promise.resolve()};function gE(e=fv){pv.__queue=pv.__queue.then(e).catch(fv)}function rh(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 df(e,n,t){const{x:i,y:r}=e,s=i*n,o=r*t;return{x:s,y:o}}function sh(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 vE(e,n,t=j1){new Promise(i=>{setTimeout(()=>{t(),i(!0)},n*e)})}const yE=window,mv=window.requestAnimationFrame||yE.webkitRequestAnimationFrame||(e=>setTimeout(e,16));function su(e,n=0){n<=0?mv(e):mv(()=>su(e,n-1))}var Ki=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-Ki.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?Ki.Bounce.In(e*2)*.5:Ki.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}}}}),Ho=function(){return performance.now()},U1=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=Ho()),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}(),Bs={Linear:function(e,n){var t=e.length-1,i=t*n,r=Math.floor(i),s=Bs.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=Bs.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=Bs.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=Bs.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}}},Ym=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Ep=new U1,yd=function(){function e(n,t){t===void 0&&(t=Ep),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=Ki.Linear.None,this._interpolationFunction=Bs.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Ym.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=Ho()),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=Ho()),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=Ho()),!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=Ep),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=Ki.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=Bs.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=Ho()),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}(),bE="23.1.1",AE=Ym.nextId,er=Ep,wE=er.getAll.bind(er),xE=er.removeAll.bind(er),ME=er.add.bind(er),W1=er.remove.bind(er),EE=er.update.bind(er),gv={Easing:Ki,Group:U1,Interpolation:Bs,now:Ho,Sequence:Ym,nextId:AE,Tween:yd,VERSION:bE,getAll:wE,removeAll:xE,add:ME,remove:W1,update:EE};function CE(e,n,t,i=Ki.Linear.None){const r=new yd(e).to(n,t).easing(i).start();function s(o){r.update(o)&&requestAnimationFrame(s)}return requestAnimationFrame(s),r}var wr=(e=>(e.Drawline="Drawline",e.Undo="Undo",e.Exit="Exit",e))(wr||{});const _l=Symbol("$$PAINT_BRUSH_EVENT$$");function oh(e){return e[_l]||(e[_l]={}),e[_l]}function PE(e){e[_l]||delete e[_l]}let _E=class{hasListener(n){const t=oh(this);return t&&t[n]&&t[n].length>0}on(n,t,i){const r=oh(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){PE(this);return}const i=oh(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=oh(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 Vr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function xn(){return(Vr()+Vr()+"-"+Vr()+"-4"+Vr().substr(0,3)+"-"+Vr()+"-"+Vr()+Vr()+Vr()).toLowerCase()}const SE=`
|
|
1
|
+
"use strict";var lE=Object.defineProperty,cE=Object.defineProperties;var hE=Object.getOwnPropertyDescriptors;var ih=Object.getOwnPropertySymbols;var uv=Object.prototype.hasOwnProperty,dv=Object.prototype.propertyIsEnumerable;var uf=(e,n,t)=>n in e?lE(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,R=(e,n)=>{for(var t in n||(n={}))uv.call(n,t)&&uf(e,t,n[t]);if(ih)for(var t of ih(n))dv.call(n,t)&&uf(e,t,n[t]);return e},Ee=(e,n)=>cE(e,hE(n));var Ps=(e,n)=>{var t={};for(var i in e)uv.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&ih)for(var i of ih(e))n.indexOf(i)<0&&dv.call(e,i)&&(t[i]=e[i]);return t};var v=(e,n,t)=>(uf(e,typeof n!="symbol"?n+"":n,t),t);var ee=(e,n,t)=>new Promise((i,r)=>{var s=l=>{try{a(t.next(l))}catch(c){r(c)}},o=l=>{try{a(t.throw(l))}catch(c){r(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(e,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Jt=require("@realsee/five"),ne=require("three"),du=require("three/examples/jsm/renderers/CSS3DRenderer"),Wm=require("hammerjs"),Qm=require("@realsee/five/line"),fu=require("animejs"),H1=require("three/examples/jsm/loaders/FBXLoader"),uE=require("earcut"),dE=require("@realsee/five/gltf-loader");function fE(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 E=fE(ne);function pE(){console.debug("%c %c@realsee/dnalogel %cv3.50.13",["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 mE(){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 j1(){}const fv=()=>Promise.resolve(),pv={__queue:Promise.resolve()};function gE(e=fv){pv.__queue=pv.__queue.then(e).catch(fv)}function rh(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 df(e,n,t){const{x:i,y:r}=e,s=i*n,o=r*t;return{x:s,y:o}}function sh(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 vE(e,n,t=j1){new Promise(i=>{setTimeout(()=>{t(),i(!0)},n*e)})}const yE=window,mv=window.requestAnimationFrame||yE.webkitRequestAnimationFrame||(e=>setTimeout(e,16));function su(e,n=0){n<=0?mv(e):mv(()=>su(e,n-1))}var Ki=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-Ki.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?Ki.Bounce.In(e*2)*.5:Ki.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}}}}),Ho=function(){return performance.now()},U1=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=Ho()),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}(),Bs={Linear:function(e,n){var t=e.length-1,i=t*n,r=Math.floor(i),s=Bs.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=Bs.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=Bs.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=Bs.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}}},Ym=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Ep=new U1,yd=function(){function e(n,t){t===void 0&&(t=Ep),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=Ki.Linear.None,this._interpolationFunction=Bs.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Ym.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=Ho()),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=Ho()),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=Ho()),!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=Ep),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=Ki.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=Bs.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=Ho()),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}(),bE="23.1.1",AE=Ym.nextId,er=Ep,wE=er.getAll.bind(er),xE=er.removeAll.bind(er),ME=er.add.bind(er),W1=er.remove.bind(er),EE=er.update.bind(er),gv={Easing:Ki,Group:U1,Interpolation:Bs,now:Ho,Sequence:Ym,nextId:AE,Tween:yd,VERSION:bE,getAll:wE,removeAll:xE,add:ME,remove:W1,update:EE};function CE(e,n,t,i=Ki.Linear.None){const r=new yd(e).to(n,t).easing(i).start();function s(o){r.update(o)&&requestAnimationFrame(s)}return requestAnimationFrame(s),r}var wr=(e=>(e.Drawline="Drawline",e.Undo="Undo",e.Exit="Exit",e))(wr||{});const _l=Symbol("$$PAINT_BRUSH_EVENT$$");function oh(e){return e[_l]||(e[_l]={}),e[_l]}function PE(e){e[_l]||delete e[_l]}let _E=class{hasListener(n){const t=oh(this);return t&&t[n]&&t[n].length>0}on(n,t,i){const r=oh(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){PE(this);return}const i=oh(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=oh(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 Vr(){return((1+Math.random())*65536|0).toString(16).substring(1)}function xn(){return(Vr()+Vr()+"-"+Vr()+"-4"+Vr().substr(0,3)+"-"+Vr()+"-"+Vr()+Vr()+Vr()).toLowerCase()}const SE=`
|
|
2
2
|
<style type="text/css">
|
|
3
3
|
|
|
4
4
|
#_gl_paintBrush {
|
|
@@ -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 SD extends ke{constructor(n){super(),Le(this,n,_D,PD,De,{content:0},CD)}}function ID(e){Ue(e,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function TD(e){let n,t;return n=new ED({props:{url:e[1].url}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&2&&(s.url=i[1].url),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function DD(e){let n,t;return n=new SD({props:{content:e[0]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.content=i[0]),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function LD(e){let n,t,i,r;const s=[DD,TD],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=j("div"),i&&i.c(),_(n,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){Z(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&&(Ve(),X(o[h],1,1,()=>{o[h]=null}),Ge()),~t?(i=o[t],i?i.p(l,c):(i=o[t]=s[t](l),i.c()),F(i,1),i.m(n,null)):i=null)},i(l){r||(F(i),r=!0)},o(l){X(i),r=!1},d(l){l&&Y(n),~t&&o[t].d()}}}function kD(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 Ex extends ke{constructor(n){super(),Le(this,n,kD,LD,De,{floorIndex:2,floorplanData:3},ID)}}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 OD(e){let n,t=e[15].outerHTML+"",i;return{c(){n=new $u(!1),i=ft(),n.a=i},m(r,s){n.m(t,r,s),Z(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 zD(e){let n,t,i,r,s,o,a=e[1]&&py(e),l=e[0]&&my(e),c=e[2]&&gy(e);return{c(){n=j("div"),a&&a.c(),t=ve(),l&&l.c(),i=ve(),c&&c.c(),r=ft(),_(n,"class","floorplan-plugin__room-part1 svelte-9vzn2f"),W(n,"opacity",e[11]?"1":"0")},m(h,u){Z(h,n,u),a&&a.m(n,null),Q(n,t),l&&l.m(n,null),Z(h,i,u),c&&c.m(h,u),Z(h,r,u),s||(o=[Di(As.call(null,n)),ot(n,"clientWidth",e[32]),ot(n,"clientHeight",e[33])],s=!0)},p(h,u){h[1]?a?a.p(h,u):(a=py(h),a.c(),a.m(n,t)):a&&(a.d(1),a=null),h[0]?l?l.p(h,u):(l=my(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=gy(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,yn(o)}}}function py(e){let n,t=e[3].name+"",i;return{c(){n=j("span"),i=xt(t),_(n,"class","floorplan-plugin__room-name")},m(r,s){Z(r,n,s),Q(n,i)},p(r,s){s[0]&8&&t!==(t=r[3].name+"")&&Ct(i,t)},d(r){r&&Y(n)}}}function my(e){let n,t;return{c(){n=j("span"),t=xt(e[14]),_(n,"class","floorplan-plugin__room-area svelte-9vzn2f"),W(n,"font-size",e[19])},m(i,r){Z(i,n,r),Q(n,t)},p(i,r){r[0]&16384&&Ct(t,i[14])},d(i){i&&Y(n)}}}function gy(e){let n,t;return{c(){n=j("span"),t=xt(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){Z(i,n,r),Q(n,t)},p(i,r){r[0]&8192&&Ct(t,i[13]),r[0]&1024&&W(n,"opacity",i[10]?"0.6":"0")},d(i){i&&Y(n)}}}function BD(e){let n,t,i;function r(a,l){if(a[4]===void 0)return zD;if(a[15])return OD}let s=r(e),o=s&&s(e);return{c(){n=j("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){Z(a,n,l),o&&o.m(n,null),t||(i=[Di(As.call(null,n)),ot(n,"clientWidth",e[34]),ot(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,yn(i)}}}function ND(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 FD(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:P}=n,{getLabelElement:S}=n,{adaptiveRoomLabelVisibleEnable:T}=n;function z(se,xe){if(xe.width===0||xe.height===0)return()=>!1;const Be=se.path.map(({x:N,y:H})=>[N,H]),ae=se.roomLabel.position,{x:pe,y:Te}=ae,{width:je,height:mt}=xe,Me=je/2,Ne=mt/2;return function(H){const Pe=pe*H,ge=Te*H,Je=Be.map(([ue,st])=>[ue*H,st*H]);return[[Pe+Me,ge-Ne],[Pe-Me,ge-Ne],[Pe-Me,ge+Ne],[Pe+Me,ge+Ne]].every(ue=>ND(ue,Je))}}const D=document.body.clientWidth,k=document.body.clientHeight,O=w.roomLabel,G=O.positionInImage.x*100+"%",I=O.positionInImage.y*100+"%",U=(D<500||k<500?10:14)+"px",J=(D<500||k<500?8:12)+"px";let K=0,te=0,ie=0,fe=0,ye=!1;x.subscribe(function(xe){t(25,ye=!!xe&&xe.id===w.id)});const be=se=>{t(7,ie=se.detail)},qe=se=>{t(8,fe=se.detail)},Ae=se=>{t(5,K=se.detail)},le=se=>{t(6,te=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,P=se.getRoomDimensionText),"getLabelElement"in se&&t(4,S=se.getLabelElement),"adaptiveRoomLabelVisibleEnable"in se&&t(24,T=se.adaptiveRoomLabelVisibleEnable)},e.$$.update=()=>{var se,xe;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?P((se=w.dimension)==null?void 0:se.width,(xe=w.dimension)==null?void 0:xe.height):""),e.$$.dirty[0]&384&&t(31,o={width:ie,height:fe}),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:te}),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||ye),e.$$.dirty[0]&167772160&&t(11,f=l||ye),e.$$.dirty[0]&100663296&&t(10,m=u||ye),e.$$.dirty[0]&201326592&&t(9,p=l&&!u)},[y,b,A,w,S,K,te,ie,fe,p,m,f,d,s,r,i,G,I,U,J,g,x,M,P,T,ye,u,l,h,c,a,o,be,qe,Ae,le]}class VD extends ke{constructor(n){super(),Le(this,n,FD,BD,De,{pxmm:20,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,room:3,hoveredRoom:21,getRoomAreaText:22,getRoomDimensionText:23,getLabelElement:4,adaptiveRoomLabelVisibleEnable:24},RD,[-1,-1])}}function GD(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 vy(e,n,t){const i=e.slice();return i[14]=n[t],i}function yy(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=vy(e,a,c),u=l(h);i.set(u,t[c]=by(u,h))}return{c(){n=j("div");for(let c=0;c<t.length;c+=1)t[c].c();_(n,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,h){Z(c,n,h);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(n,null);r=!0,s||(o=[Di(As.call(null,n)),ot(n,"clientWidth",e[13])],s=!0)},p(c,h){h&1791&&(a=c[10],Ve(),t=zi(t,h,l,1,c,a,i,n,bs,by,null,vy),Ge())},i(c){if(!r){for(let h=0;h<a.length;h+=1)F(t[h]);r=!0}},o(c){for(let h=0;h<t.length;h+=1)X(t[h]);r=!1},d(c){c&&Y(n);for(let h=0;h<t.length;h+=1)t[h].d();s=!1,yn(o)}}}function by(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=kn(o,s[a]);return i=new VD({props:o}),{key:e,first:null,c(){t=ft(),Ie(i.$$.fragment),this.first=t},m(a,l){Z(a,t,l),_e(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||(F(i.$$.fragment,a),r=!0)},o(a){X(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Se(i,a)}}}function HD(e){let n,t,i=e[10]&&yy(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[10]?i?(i.p(r,s),s&1024&&F(i,1)):(i=yy(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function jD(e,n,t){let i,{floorIndex:r}=n,{roomAreaEnable:s}=n,{roomNameEnable:o}=n,{roomDimensionEnable:a}=n,{floorplanData:l}=n,{hoveredRoom:c}=n,{getRoomAreaText:h}=n,{getRoomDimensionText:u}=n,{getLabelElement:d}=n,{adaptiveRoomLabelVisibleEnable:f}=n,m=0,p=0;const g=y=>{t(8,m=y.detail)};return e.$$set=y=>{"floorIndex"in y&&t(11,r=y.floorIndex),"roomAreaEnable"in y&&t(0,s=y.roomAreaEnable),"roomNameEnable"in y&&t(1,o=y.roomNameEnable),"roomDimensionEnable"in y&&t(2,a=y.roomDimensionEnable),"floorplanData"in y&&t(12,l=y.floorplanData),"hoveredRoom"in y&&t(3,c=y.hoveredRoom),"getRoomAreaText"in y&&t(4,h=y.getRoomAreaText),"getRoomDimensionText"in y&&t(5,u=y.getRoomDimensionText),"getLabelElement"in y&&t(6,d=y.getLabelElement),"adaptiveRoomLabelVisibleEnable"in y&&t(7,f=y.adaptiveRoomLabelVisibleEnable)},e.$$.update=()=>{if(e.$$.dirty&6144&&t(10,i=l.floorDatas[r].rooms),e.$$.dirty&4352){const{max:y,min:b}=l.bounding,A=y.x-b.x;t(9,p=m/A)}},[s,o,a,c,h,u,d,f,m,p,i,r,l,g]}class UD extends ke{constructor(n){super(),Le(this,n,jD,HD,De,{floorIndex:11,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,floorplanData:12,hoveredRoom:3,getRoomAreaText:4,getRoomDimensionText:5,getLabelElement:6,adaptiveRoomLabelVisibleEnable:7},GD)}}function WD(e){Ue(e,"svelte-1fuyezq",".floorplan-plugin__rule-labels.svelte-1fuyezq.svelte-1fuyezq{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-1fuyezq.svelte-1fuyezq{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq.svelte-1fuyezq{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq.svelte-1fuyezq{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq.svelte-1fuyezq{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-1fuyezq.svelte-1fuyezq{background:#fff;opacity:0.2;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-1fuyezq.svelte-1fuyezq{position:absolute;background:#fff;opacity:0.2;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale.svelte-1fuyezq{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute}.floorplan-plugin__rule-labels--top.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-1fuyezq.svelte-1fuyezq{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-text-item.svelte-1fuyezq{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-1fuyezq.svelte-1fuyezq{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.35}")}function Ay(e,n,t){const i=e.slice();return i[11]=n[t],i[13]=t,i}function wy(e,n,t){const i=e.slice();return i[14]=n[t],i}function xy(e){let n;return{c(){n=j("div"),_(n,"class","floorplan-plugin__rule-scale svelte-1fuyezq"),W(n,"left",e[14].left*100+"%"),W(n,"bottom",e[14].bottom*100+"%")},m(t,i){Z(t,n,i)},p:de,d(t){t&&Y(n)}}}function My(e,n){let t,i,r=n[1](n[11].distance)+"",s,o;return{key:e,first:null,c(){t=j("div"),i=j("div"),s=xt(r),o=ve(),_(i,"class","floorplan-plugin__rule-text svelte-1fuyezq"),Ce(i,"is-row",n[2]),_(t,"class","floorplan-plugin__rule-text-item svelte-1fuyezq"),W(t,"left",n[11].left*100+"%"),W(t,"bottom",n[11].bottom*100+"%"),this.first=t},m(a,l){Z(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)+"")&&Ct(s,r)},d(a){a&&Y(t)}}}function QD(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]=xy(wy(e,h,m));let d=e[4];const f=m=>m[13];for(let m=0;m<d.length;m+=1){let p=Ay(e,d,m),g=f(p);l.set(g,a[m]=My(g,p))}return{c(){n=j("div"),t=j("div"),i=ve(),r=j("div");for(let m=0;m<u.length;m+=1)u[m].c();s=ve(),o=j("div");for(let m=0;m<a.length;m+=1)a[m].c();_(t,"class","floorplan-plugin__rule-line svelte-1fuyezq"),_(r,"class","floorplan-plugin__rule-scale-wrapper svelte-1fuyezq"),Ce(r,"is-row",e[2]),_(o,"class","floorplan-plugin__rule-text-wrapper svelte-1fuyezq"),_(n,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+e[0]+" svelte-1fuyezq"),Ce(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){Z(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=wy(m,h,g);u[g]?u[g].p(y,p):(u[g]=xy(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=zi(a,p,f,1,m,d,l,o,Mg,My,null,Ay)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+m[0]+" svelte-1fuyezq")&&_(n,"class",c),p&5&&Ce(n,"is-row",m[2])},i:de,o:de,d(m){m&&Y(n),Oi(u,m);for(let p=0;p<a.length;p+=1)a[p].d()}}}const zo=1e3,Bo=180;function YD(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-(zo-Bo)*2,c=s.max.y-s.min.y-(zo-Bo)*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-zo+Bo)/l:0,g=a?0:(m-s.min.y-zo+Bo)/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-zo+Bo)/l:0,w=a?0:(b-s.min.y-zo+Bo)/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 XD extends ke{constructor(n){super(),Le(this,n,YD,QD,De,{type:0,data:5,bounding:6,getRuleDistanceText:1},WD)}}function ZD(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 Ey(e,n,t){const i=e.slice();return i[13]=n[t][0],i[14]=n[t][1],i}function Cy(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=kn(o,s[a]);return i=new XD({props:o}),{key:e,first:null,c(){t=ft(),Ie(i.$$.fragment),this.first=t},m(a,l){Z(a,t,l),_e(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||(F(i.$$.fragment,a),r=!0)},o(a){X(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Se(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=Ey(e,s,a),c=o(l);i.set(c,t[a]=Cy(c,l))}return{c(){n=j("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){Z(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],Ve(),t=zi(t,l,o,1,a,s,i,n,bs,Cy,null,Ey),Ge()),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)F(t[l]);r=!0}},o(a){for(let l=0;l<t.length;l+=1)X(t[l]);r=!1},d(a){a&&Y(n);for(let l=0;l<t.length;l+=1)t[l].d()}}}const Py=1e3,_y=180;function JD(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-(Py-_y)*2),e.$$.dirty&2&&t(8,h=i.max.y-i.min.y-(Py-_y)*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 KD extends ke{constructor(n){super(),Le(this,n,JD,qD,De,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},ZD)}}function Rd(e,n={}){let t="";const{needZ:i,needA:r}=n;return(i?e.slice().concat(e[0]):e.slice()).forEach((o,a)=>{const{x:l,y:c}=n.format?n.format(o):o,h=l+","+c;return a===0?(t+="M"+h,t):r!=null&&r[a]?(t+="A"+r[a]+","+h,t):(t+="L"+h,t)}),t+(i?"Z":"")}function Cx({x:e,y:n},t){const{max:i,min:r}=t;return{x:e-r.x,y:i.y-n}}function $D(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 eL(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 tL(e,n){return Math.max(...n.work.observers.map(i=>e.z>=i.standingPosition.z?i.floorIndex:0))}function nL(e){let n;return{c(){n=Bt("path"),_(n,"d",e[0]),_(n,"fill","#2F313A")},m(t,i){Z(t,n,i)},p(t,[i]){i&1&&_(n,"d",t[0])},i:de,o:de,d(t){t&&Y(n)}}}function iL(e,n,t){let i,{path:r}=n;return e.$$set=s=>{"path"in s&&t(1,r=s.path)},e.$$.update=()=>{e.$$.dirty&2&&t(0,i=Rd(r,{needZ:!0}))},[i,r]}class rL extends ke{constructor(n){super(),Le(this,n,iL,nL,De,{path:1})}}function sL(e){let n,t,i,r,s,o;return{c(){n=Bt("defs"),t=Bt("pattern"),i=Bt("rect"),r=Bt("path"),s=ve(),o=Bt("path"),_(i,"x","0"),_(i,"y","0"),_(i,"width",e[1]),_(i,"height",e[1]),_(i,"fill","#323747"),_(r,"d",e[2]),_(r,"stroke","#ffffff"),_(r,"stroke-opacity","0.06"),_(r,"stroke-width","0.5"),_(r,"fill","none"),_(t,"id","fpm-room-pattern-0"),_(t,"x","0"),_(t,"y","0"),_(t,"width",e[1]),_(t,"height",e[1]),_(t,"patternUnits","userSpaceOnUse"),_(t,"patternTransform","scale(50 50)"),_(o,"d",e[0]),_(o,"fill","url(#fpm-room-pattern-0)")},m(a,l){Z(a,n,l),Q(n,t),Q(t,i),Q(t,r),Z(a,s,l),Z(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 ep=6;function oL(e,n,t){let i,{path:r}=n;const s=ep*2,o=`M0 ${ep} h ${s} M${ep} 0 v ${s}`;return e.$$set=a=>{"path"in a&&t(3,r=a.path)},e.$$.update=()=>{e.$$.dirty&8&&t(0,i=Rd(r,{needZ:!0}))},[i,s,o,r]}class aL extends ke{constructor(n){super(),Le(this,n,oL,sL,De,{path:3})}}function lL(e){let n,t,i,r,s,o,a,l,c,h,u;return{c(){n=Bt("defs"),t=Bt("pattern"),i=Bt("rect"),r=Bt("pattern"),s=Bt("rect"),o=ve(),a=Bt("path"),l=ve(),c=Bt("path"),h=ve(),u=Bt("path"),_(i,"x","0"),_(i,"y","0"),_(i,"width","6"),_(i,"height","50"),_(i,"fill","none"),_(i,"stroke","#4B4B57"),_(i,"stroke-width","0.5"),_(t,"id","room-material-pattern-1"),_(t,"x","0"),_(t,"y","0"),_(t,"width","12"),_(t,"height","50"),_(t,"patternUnits","userSpaceOnUse"),_(t,"patternTransform","scale(50 50)"),_(s,"x","0"),_(s,"y","0"),_(s,"width","6"),_(s,"height","50"),_(s,"fill","none"),_(s,"stroke","#4B4B57"),_(s,"stroke-width","0.5"),_(r,"id","room-material-pattern-2"),_(r,"x","6"),_(r,"y","25"),_(r,"width","12"),_(r,"height","50"),_(r,"patternUnits","userSpaceOnUse"),_(r,"patternTransform","scale(50 50)"),_(a,"d",e[0]),_(a,"fill","#43434D"),_(c,"d",e[0]),_(c,"fill","url(#room-material-pattern-1)"),_(u,"d",e[0]),_(u,"fill","url(#room-material-pattern-2)")},m(d,f){Z(d,n,f),Q(n,t),Q(t,i),Q(n,r),Q(r,s),Z(d,o,f),Z(d,a,f),Z(d,l,f),Z(d,c,f),Z(d,h,f),Z(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 cL(e,n,t){let i,{path:r}=n;return e.$$set=s=>{"path"in s&&t(1,r=s.path)},e.$$.update=()=>{e.$$.dirty&2&&t(0,i=Rd(r,{needZ:!0}))},[i,r]}class hL extends ke{constructor(n){super(),Le(this,n,cL,lL,De,{path:1})}}function uL(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 Sy(e,n,t){const i=e.slice();return i[5]=n[t],i}function dL(e){let n,t;return n=new aL({props:{path:e[5].path}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function fL(e){let n,t;return n=new hL({props:{path:e[5].path}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function pL(e){let n,t;return n=new rL({props:{path:e[5].path}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function Iy(e){let n,t,i,r;const s=[pL,fL,dL],o=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return t=a(e),i=o[t]=s[t](e),{c(){n=Bt("svg"),i.c(),_(n,"width","100%"),_(n,"height","100%"),_(n,"viewBox",`0 0 ${e[1]} ${e[2]}`),_(n,"class","svelte-1dykexu")},m(l,c){Z(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):(Ve(),X(o[h],1,1,()=>{o[h]=null}),Ge(),i=o[t],i?i.p(l,c):(i=o[t]=s[t](l),i.c()),F(i,1),i.m(n,null))},i(l){r||(F(i),r=!0)},o(l){X(i),r=!1},d(l){l&&Y(n),o[t].d()}}}function mL(e){let n,t,i=e[0],r=[];for(let o=0;o<i.length;o+=1)r[o]=Iy(Sy(e,i,o));const s=o=>X(r[o],1,1,()=>{r[o]=null});return{c(){n=j("div");for(let o=0;o<r.length;o+=1)r[o].c();_(n,"class","floorplan-plugin__room-material svelte-1dykexu")},m(o,a){Z(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=Sy(o,i,l);r[l]?(r[l].p(c,a),F(r[l],1)):(r[l]=Iy(c),r[l].c(),F(r[l],1),r[l].m(n,null))}for(Ve(),l=i.length;l<r.length;l+=1)s(l);Ge()}},i(o){if(!t){for(let a=0;a<i.length;a+=1)F(r[a]);t=!0}},o(o){r=r.filter(Boolean);for(let a=0;a<r.length;a+=1)X(r[a]);t=!1},d(o){o&&Y(n),Oi(r,o)}}}function gL(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=>Ee(R({},l),{path:l.path.map(c=>Cx(c,s.bounding))})))},[i,o,a,r,s]}class vL extends ke{constructor(n){super(),Le(this,n,gL,mL,De,{floorIndex:3,floorplanData:4},uL)}}function yL(e){Ue(e,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function bL(e){let n,t,i,r;return{c(){n=Bt("path"),_(n,"d",e[5]),_(n,"fill","#fff"),_(n,"style",e[2]),_(n,"id",t=`${e[1]}_${e[0].id}`),_(n,"class","svelte-qq2273")},m(s,o){Z(s,n,o),i||(r=[ot(n,"mouseenter",e[3]),ot(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,yn(r)}}}function AL(e,n,t){let i,r,{room:s}=n,{floorIndex:o}=n,{floorplanData:a}=n,{highlightData:l}=n,{hoveredRoom:c}=n;function h(){c==null||c.set(s)}function u(){c==null||c.set(void 0)}const{bounding:d}=a,f=Rd(s.path,{needZ:!0,format:m=>Cx(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 wL extends ke{constructor(n){super(),Le(this,n,AL,bL,De,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},yL)}}function xL(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 Ty(e,n,t){const i=e.slice();return i[6]=n[t],i}function Dy(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=kn(o,s[a]);return i=new wL({props:o}),{key:e,first:null,c(){t=ft(),Ie(i.$$.fragment),this.first=t},m(a,l){Z(a,t,l),_e(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||(F(i.$$.fragment,a),r=!0)},o(a){X(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Se(i,a)}}}function ML(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=Ty(e,o,l),h=a(c);r.set(h,i[l]=Dy(h,c))}return{c(){n=j("div"),t=Bt("svg");for(let l=0;l<i.length;l+=1)i[l].c();_(t,"width","100%"),_(t,"height","100%"),_(t,"viewBox",`0 0 ${e[4]} ${e[5]}`),_(t,"class","svelte-1kqo6e4"),_(n,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){Z(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,Ve(),i=zi(i,c,a,1,l,o,r,t,bs,Dy,null,Ty),Ge())},i(l){if(!s){for(let c=0;c<o.length;c+=1)F(i[c]);s=!0}},o(l){for(let c=0;c<i.length;c+=1)X(i[c]);s=!1},d(l){l&&Y(n);for(let c=0;c<i.length;c+=1)i[c].d()}}}function EL(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 Px extends ke{constructor(n){super(),Le(this,n,EL,ML,De,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},xL)}}function CL(e){Ue(e,"svelte-1lm20n5",".missing-floor.svelte-1lm20n5{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;flex-direction:column;align-items:center}.text.svelte-1lm20n5{margin-top:0.75rem;color:#fff;opacity:0.3}")}function Ly(e){let n,t=e[0].text+"",i;return{c(){n=j("span"),i=xt(t),_(n,"class","text svelte-1lm20n5"),W(n,"font-size",e[0].textFontSize+"px")},m(r,s){Z(r,n,s),Q(n,i)},p(r,s){s&1&&t!==(t=r[0].text+"")&&Ct(i,t),s&1&&W(n,"font-size",r[0].textFontSize+"px")},d(r){r&&Y(n)}}}function PL(e){let n,t,i,r,s=e[0].text&&Ly(e);return{c(){n=j("div"),t=j("img"),r=ve(),s&&s.c(),_(t,"class","image"),_(t,"alt","缺省楼层展位图"),Pn(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){Z(o,n,a),Q(n,t),Q(n,r),s&&s.m(n,null)},p(o,[a]){a&1&&!Pn(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=Ly(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 _L(e,n,t){let{missingFloorConfig:i}=n;return e.$$set=r=>{"missingFloorConfig"in r&&t(0,i=r.missingFloorConfig)},[i]}class SL extends ke{constructor(n){super(),Le(this,n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/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function Pg(e){return e*180/Math.PI}function IL(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 TL(e){let n,t;return{c(){n=j("div"),t=j("div"),_(t,"class","floorplan__camera-rotate svelte-17cl35n"),W(t,"background-image",`url(${e[0]||ps})`),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){Z(i,n,r),Q(n,t)},p(i,[r]){r&1&&W(t,"background-image",`url(${i[0]||ps})`);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 DL(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=-Pg(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 LL=class extends ke{constructor(n){super(),Le(this,n,DL,TL,De,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},IL)}};const kL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1/+Bnv/6+/+SrP/m7P/f5v/O2v/L2P/E0v/Az//+///s8P/e5v+rv/+pvv+Anv+qvv+Pqv+Kpv+CoP93l/9xlP/z9v/p7v90lf9uj//P2//v8//o7f/k6v/K1v+6yv9rjv98nv/E0v/9/v/09//h6P/X4f9pjP/9/f/N2f/K1v/C0f+Ho/99nP/1+P9sj//6+//u8/+iuP/u8//g6P/U3v+3x/+0xv+etf+Vrv9pjf/B0P9ukf+ht/+Vr/94mP/G0/+8zP+2x//+/v/09v/W4f9ojv/c5P+xxP/d5v+xw/+vwv+Jo//g6P+nvP+SrP/R3P/1+f/W3//U3//C0P+Jp/9nh/+Kpv+Fov/Y4f/J1/+Pqf+rv/+Oqv+Oqv+muv+twP/f5//t8P97mf/h5/+twP+kuf/L2P+juP+Ipf+huP+Pqf/d5v+zxf+cs/+Zsf+wwv/V3v+8zP+Go/+zxP+GpP/T3f/r8P/u8v/o7f/d5P/m7P/H1P/w9P/D0f+uwf/Z4v/F0v/09//D0v/v8//s8v/d5P/Y4f/s8P+etv/X4f+gt/+ovf+bsv+xw/+Vr//j6v+1x//J1v+4yf/r8P+y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Tmm+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 OL(e){let n,t,i,r,s;return{c(){n=j("div"),t=j("div"),i=ve(),r=j("span"),s=xt(e[0]),_(t,"class","floorplan-plugin__compass-image svelte-rpkaro"),W(t,"background-image",`url(${kL})`),_(r,"class","floorplan-plugin__compass-text svelte-rpkaro"),_(n,"class","floorplan-plugin__compass svelte-rpkaro"),W(n,"transform",e[2])},m(o,a){Z(o,n,a),Q(n,t),Q(n,i),Q(n,r),Q(r,s)},p(o,a){a&1&&Ct(s,o[0])},d(o){o&&Y(n)}}}function zL(e){let n,t=e[1]&&OL(e);return{c(){t&&t.c(),n=ft()},m(i,r){t&&t.m(i,r),Z(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 BL(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?Pg(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 NL extends ke{constructor(n){super(),Le(this,n,BL,zL,De,{floorplanData:3,northDesc:0},RL)}}function FL(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 VL(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=kn(d,u[w]);n=new vL({props:d});let f=(e[3]||e[5])&&ky(e);const m=[{floorplanData:e[11],floorIndex:e[2]}];let p={};for(let w=0;w<m.length;w+=1)p=kn(p,m[w]);r=new Ex({props:p});let g=e[6]&&Ry(e),y=e[10]&&Oy(e),b=e[4]&&zy(e),A=e[22]&&By(e);return{c(){Ie(n.$$.fragment),t=ve(),f&&f.c(),i=ve(),Ie(r.$$.fragment),s=ve(),g&&g.c(),o=ve(),y&&y.c(),a=ve(),b&&b.c(),l=ve(),A&&A.c(),c=ft()},m(w,x){_e(n,w,x),Z(w,t,x),f&&f.m(w,x),Z(w,i,x),_e(r,w,x),Z(w,s,x),g&&g.m(w,x),Z(w,o,x),y&&y.m(w,x),Z(w,a,x),b&&b.m(w,x),Z(w,l,x),A&&A.m(w,x),Z(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&&F(f,1)):(f=ky(w),f.c(),F(f,1),f.m(i.parentNode,i)):f&&(Ve(),X(f,1,1,()=>{f=null}),Ge());const P=x&2052?Vn(m,[{floorplanData:w[11],floorIndex:w[2]}]):{};r.$set(P),w[6]?g?(g.p(w,x),x&64&&F(g,1)):(g=Ry(w),g.c(),F(g,1),g.m(o.parentNode,o)):g&&(Ve(),X(g,1,1,()=>{g=null}),Ge()),w[10]?y?(y.p(w,x),x&1024&&F(y,1)):(y=Oy(w),y.c(),F(y,1),y.m(a.parentNode,a)):y&&(Ve(),X(y,1,1,()=>{y=null}),Ge()),w[4]?b?(b.p(w,x),x&16&&F(b,1)):(b=zy(w),b.c(),F(b,1),b.m(l.parentNode,l)):b&&(Ve(),X(b,1,1,()=>{b=null}),Ge()),w[22]?A?(A.p(w,x),x&4194304&&F(A,1)):(A=By(w),A.c(),F(A,1),A.m(c.parentNode,c)):A&&(Ve(),X(A,1,1,()=>{A=null}),Ge())},i(w){h||(F(n.$$.fragment,w),F(f),F(r.$$.fragment,w),F(g),F(y),F(b),F(A),h=!0)},o(w){X(n.$$.fragment,w),X(f),X(r.$$.fragment,w),X(g),X(y),X(b),X(A),h=!1},d(w){Se(n,w),w&&Y(t),f&&f.d(w),w&&Y(i),Se(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 GL(e){let n,t;return n=new SL({props:{missingFloorConfig:e[18]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&262144&&(s.missingFloorConfig=i[18]),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function ky(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=kn(r,i[s]);return n=new Px({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function Ry(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=kn(r,i[s]);return n=new UD({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function Oy(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=kn(r,i[s]);return n=new KD({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function zy(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=kn(r,i[s]);return n=new LL({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function By(e){let n,t;return n=new NL({props:{floorplanData:e[11],northDesc:e[21]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(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||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function HL(e){let n,t,i,r,s;const o=[GL,VL],a=[];function l(c,h){return c[23]?1:0}return t=l(e),i=a[t]=o[t](e),{c(){n=j("div"),i.c(),_(n,"class",r=on(`floorplan-plugin__floor${e[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(c,h){Z(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):(Ve(),X(a[u],1,1,()=>{a[u]=null}),Ge(),i=a[t],i?i.p(c,h):(i=a[t]=o[t](c),i.c()),F(i,1),i.m(n,null)),(!s||h&2&&r!==(r=on(`floorplan-plugin__floor${c[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&_(n,"class",r)},i(c){s||(F(i),s=!0)},o(c){X(i),s=!1},d(c){c&&Y(n),a[t].d()}}}function jL(e,n,t){let i,r,{panoIndex:s}=n,{isCurrent:o}=n,{floorIndex:a}=n,{highlightEnable:l}=n,{cameraEnable:c}=n,{hoverEnable:h}=n,{roomLabelsEnable:u}=n,{roomAreaEnable:d}=n,{roomNameEnable:f}=n,{roomDimensionEnable:m}=n,{ruleLabelsEnable:p}=n,{floorplanData:g}=n,{getRoomAreaText:y}=n,{getRoomDimensionText:b}=n,{getLabelElement:A}=n,{getRuleDistanceText:w}=n,{adaptiveRoomLabelVisibleEnable:x}=n,{highlightData:M}=n,{missingFloorConfig:P}=n,{lastPanoramaLongitude:S}=n,{cameraImageUrl:T}=n,{northDesc:z}=n,{compassEnable:D}=n;const k=Cg(void 0);return e.$$set=O=>{"panoIndex"in O&&t(0,s=O.panoIndex),"isCurrent"in O&&t(1,o=O.isCurrent),"floorIndex"in O&&t(2,a=O.floorIndex),"highlightEnable"in O&&t(3,l=O.highlightEnable),"cameraEnable"in O&&t(4,c=O.cameraEnable),"hoverEnable"in O&&t(5,h=O.hoverEnable),"roomLabelsEnable"in O&&t(6,u=O.roomLabelsEnable),"roomAreaEnable"in O&&t(7,d=O.roomAreaEnable),"roomNameEnable"in O&&t(8,f=O.roomNameEnable),"roomDimensionEnable"in O&&t(9,m=O.roomDimensionEnable),"ruleLabelsEnable"in O&&t(10,p=O.ruleLabelsEnable),"floorplanData"in O&&t(11,g=O.floorplanData),"getRoomAreaText"in O&&t(12,y=O.getRoomAreaText),"getRoomDimensionText"in O&&t(13,b=O.getRoomDimensionText),"getLabelElement"in O&&t(14,A=O.getLabelElement),"getRuleDistanceText"in O&&t(15,w=O.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in O&&t(16,x=O.adaptiveRoomLabelVisibleEnable),"highlightData"in O&&t(17,M=O.highlightData),"missingFloorConfig"in O&&t(18,P=O.missingFloorConfig),"lastPanoramaLongitude"in O&&t(19,S=O.lastPanoramaLongitude),"cameraImageUrl"in O&&t(20,T=O.cameraImageUrl),"northDesc"in O&&t(21,z=O.northDesc),"compassEnable"in O&&t(22,D=O.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,P,S,T,z,D,r,k,i]}let UL=class extends ke{constructor(n){super(),Le(this,n,jL,HL,De,{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},FL)}};function WL(e){Ue(e,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function Ny(e,n,t){const i=e.slice();return i[24]=n[t],i}function Fy(e){let n,t,i,r=e[14].floorDatas,s=[];for(let a=0;a<r.length;a+=1)s[a]=Vy(Ny(e,r,a));const o=a=>X(s[a],1,1,()=>{s[a]=null});return{c(){n=j("div");for(let a=0;a<s.length;a+=1)s[a].c();_(n,"class","floorplan-main svelte-86bqav")},m(a,l){Z(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=Ny(e,r,c);s[c]?(s[c].p(h,l),F(s[c],1)):(s[c]=Vy(h),s[c].c(),F(s[c],1),s[c].m(n,null))}for(Ve(),c=r.length;c<s.length;c+=1)o(c);Ge()}},i(a){if(!i){for(let l=0;l<r.length;l+=1)F(s[l]);t||an(()=>{t=ys(n,_n,{duration:e[0],easing:Rr}),t.start()}),i=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)X(s[l]);i=!1},d(a){a&&Y(n),Oi(s,a)}}}function Vy(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=kn(r,i[s]);return n=new UL({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function QL(e){let n,t,i=e[1]&&Fy(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&F(i,1)):(i=Fy(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function YL(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:P}=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,P=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,P,S,T,z]}let _g=class extends ke{constructor(n){super(),Le(this,n,YL,QL,De,{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},WL)}};const XL="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 ZL(e){return ee(this,null,function*(){const n=new Headers({"Content-Type":"text/plain"}),t=function(r){return ee(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 JL(e){return{floorName:e.floor_name,floorIndex:e.floor_index,rooms:e.rooms.map(qL),rules:e.rules}}function KL(e){return{index:e.index,floorIndex:e.floor_index,position:e.position,positionInImage:e.position_in_image}}function $L(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 ms(e){return ee(this,null,function*(){const n=yield ZL(e.outlines),t=e.computed_data.bounding,i=e.computed_data.floor_datas.map(JL),r=e.computed_data.entrance?$L(e.computed_data.entrance):null;return{outlines:n,entrance:r,bounding:t,floorDatas:i,observers:e.computed_data.observers.map(KL)}})}function ek(e,n,t){return e.map(r=>{const s=r.position,o=r.icon?r.icon:{url:XL,width:45,height:48},a=tL(s,n),l=$D(s,t),c=eL(l,t);return{floorIndex:a,icon:o,id:r.id,position:l,positionInImage:c}})}function tk(e,n){return n(e),e}function ka(e,n){return tk({},t=>{for(const i in e)n.indexOf(i)===-1&&(t[i]=e[i])})}function Gy(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 Sg(e,n,t=ss.BOUNDING_CENTER){const i=Gy(e,n),r=Gy(e,n+1);return t===ss.BOUNDING_CENTER?(e.model.bounding.max.y+e.model.bounding.min.y)/2:t===ss.CEILING?r:i}function Ig(e,n,t,i){const r=Sg(e,t,i==null?void 0:i.attachedTo),s=new E.Vector3(0,r,0),o=new E.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.12");v(this,"NAME");v(this,"five");v(this,"workUtil");v(this,"fiveUtil");v(this,"hooks",new Cn);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 _d(n),this.workUtil=this.fiveUtil.workUtil}getCurrentState(){return this.state}absoluteUrl(n){return dg(this.staticPrefix,n)}onWorkCodeChange(){}},Br=class extends ws{};var Zn=(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))(Zn||{});const _x=500,nk=80;function Ws(e,n,t=4){return Math.abs(e-n)<Math.pow(10,-t)}function Sx(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 Ws(o,a,t)||Ws(o+i,a,t)}Object.assign(window,{nearlyEqual:Ws,nearlyEqualRad:Sx});function ik(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hy(e){return ik(e)&&!!e.isVector3}function Tg(e,n){return ee(this,null,function*(){const[t]=yield to(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(!rk(i,r))throw new Error("pose 与预期不符")})}function rk(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"?Sx(i,r,2):typeof i=="number"&&typeof r=="number"?Ws(i,r,2):Hy(r)&&Hy(i)?r.distanceTo(i)<.01:i===r})}function sk(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!(!Ws(t,o,2)||!Ws(i,a,2)||s!==void 0&&s.distanceTo(l)>.01||!Ws(r,c,2))}function Ix(e,n,t=!0){return ee(this,null,function*(){if(sk(e,n)===!0)return;const r=e.getCurrentState();if(r.mode!==n.mode){const[h]=yield to(Tg(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 to(e.updateCamera(ka(n,["mode"]),l,t));if(c)throw new Error(Zn.UpdateCameraError)})}function Ra(e,n,t=300){var r,s;const i=e.getElement();if(i){i.style.opacity=n+"";for(let o=0;o<((s=(r=i.parentElement)==null?void 0:r.children)==null?void 0:s.length);o++){const a=i.parentElement.children[o];a instanceof HTMLElement&&a.dataset.infive==="1"&&(a.style.opacity=n+"")}i.style.transition=t===0?"none":`opacity ${t}ms linear`,t!==0&&Promise.race([new Promise(o=>i.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,t))]).then(()=>{i.style.transition="none"})}}function ok(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 ak(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 lk=class extends Br{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)=>ee(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)=>ee(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=Ig(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,Zn.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=>ee(this,null,function*(){var o;if(!this.state.enabled)return;if(!((o=this.five.model)!=null&&o.loaded))throw new Error(Zn.ModelNotLoaded);if(!this.data)throw new Error(Zn.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},r=R(R({},i),t),s=()=>ee(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 to(Ix(this.five,this.showState,r.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Zn.UnknownError);if(!this.updateSize())throw new Error(Zn.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:_x;Ra(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,Zn.BreakOffByHide),this.showPromise=void 0;const r=R(R({},{userAction:!0,isAutoHide:!1}),t);Ra(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||ak(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();ok(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:nk/((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:ps,attachedTo:ss.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:R(R({},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?ka(i,["selector","scale"]):{},o=R(R({},r.missingFloorConfig),s.missingFloorConfig),a=Ee(R(R({},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 ee(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&kr(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 ms(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 ee(this,null,function*(){return yield ms(t.data)})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?R(R({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Ee(R(R({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Ee(R(R({},this.state),t),{config:o}),!Nn(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=Ee(R({},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 _g({target:this.container,intro:!0,props:i})}};const ck=(e,n)=>new lk(e,n);function hk(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 uk(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 dk=class extends Br{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)=>ee(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)=>ee(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=Ig(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,Zn.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=>ee(this,null,function*(){var o;if(!this.state.enabled)return;if(!((o=this.fiveUtil.model)!=null&&o.loaded))throw new Error(Zn.ModelNotLoaded);if(!this.data)throw new Error(Zn.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},r=R(R({},i),t),s=()=>ee(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 to(Ix(this.five,this.showState,r.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Zn.UnknownError);if(!this.updateSize())throw new Error(Zn.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:_x;Ra(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,Zn.BreakOffByHide),this.showPromise=void 0;const r=R(R({},{userAction:!0,isAutoHide:!1}),t);Ra(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 E.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&&uk(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(),hk(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(ka(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:ps,attachedTo:ss.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:R(R({},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?ka(i,["selector","scale"]):{},o=R(R({},r.missingFloorConfig),s.missingFloorConfig),a=Ee(R(R({},r),s),{missingFloorConfig:o});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),Ua(t).then(this.onFiveModelLoaded),t.once("dispose",this.dispose),this.addEventListener()}load(t,i,r=!0){return ee(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&kr(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 ms(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=Sg(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.fiveUtil.model)==null?void 0:a.bounding.getCenter(new E.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 ee(this,null,function*(){return yield ms(t.data)})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?R(R({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Ee(R(R({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Ee(R(R({},this.state),t),{config:o}),!Nn(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=Ee(R({},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 _g({target:this.container,intro:!0,props:i})}};const fk=(e,n)=>new dk(e,n);let pk=class extends Br{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=Ig(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:ps,attachedTo:ss.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:R(R({},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?ka(i,["selector","scale"]):{},o=R(R({},r.missingFloorConfig),s.missingFloorConfig),a=Ee(R(R({},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 ee(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&kr(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 ms(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=Sg(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.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 ee(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 ee(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 ee(this,null,function*(){return yield ms(t.data)})}_show(t){return ee(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 Tg(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;Ra(this.five,s,r),this.hooks.emit("showAnimationEnded",{userAction:i,auto:!1}),this.render()})}_hide(t){return ee(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;Ra(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?R(R({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Ee(R(R({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Ee(R(R({},this.state),t),{config:o}),!Nn(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=Ee(R({},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 _g({target:this.container,intro:!0,props:i})}};const mk=(e,n)=>new pk(e,n);function Dg(e,n=200){let t;return function(...i){t||(e(...i),t=setTimeout(function(){t=null},n))}}function gk(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 vk(e){let n,t,i;return{c(){n=j("div"),t=j("div"),i=j("div"),_(i,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),W(i,"background-image","url("+(e[0]||ps)+")"),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){Z(r,n,s),Q(n,t),Q(t,i)},p(r,[s]){s&1&&W(i,"background-image","url("+(r[0]||ps)+")"),(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 yk(e){return`rotate(${Math.floor(e/Math.PI*180)*-1+45}deg)`}function bk(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,P=w.observers[x];if(!P)return"";const S=(M.max.x-M.min.x)*l,T=(M.max.y-M.min.y)*l,z=Math.floor(P.positionInImage.x*S),D=Math.floor(P.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=Dg(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=yk(d))},[h,o,s,r,a,l,c,u,d,f,i]}class Ak extends ke{constructor(n){super(),Le(this,n,bk,vk,De,{five:4,pxmm:5,floorplanData:6,cameraImageUrl:0},gk)}}function wk(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 jy(e,n,t){const i=e.slice();return i[1]=n[t],i}function Uy(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=j("div"),i=j("div"),o=ve(),_(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){Z(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 xk(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=jy(e,r,o),l=s(a);i.set(l,t[o]=Uy(l,a))}return{c(){n=j("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){Z(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=zi(t,a,s,1,o,r,i,n,Mg,Uy,null,jy))},i:de,o:de,d(o){o&&Y(n);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Mk(e,n,t){let{extraObjects:i=[]}=n;return e.$$set=r=>{"extraObjects"in r&&t(0,i=r.extraObjects)},[i]}class Ek extends ke{constructor(n){super(),Le(this,n,Mk,xk,De,{extraObjects:0},wk)}}function Ck(e){Ue(e,"svelte-18287ai",".missing-floor-wrapper.svelte-18287ai{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:flex;justify-content:center;align-items:center}.missing-floor-image.svelte-18287ai{max-width:100%;max-height:100%}")}function Pk(e){let n,t,i,r,s,o;const a=[{floorIndex:e[2],floorplanData:e[4]}];let l={};for(let h=0;h<a.length;h+=1)l=kn(l,a[h]);n=new Ex({props:l}),i=new Ek({props:{extraObjects:e[7]}});let c=e[3]&&Wy(e);return{c(){Ie(n.$$.fragment),t=ve(),Ie(i.$$.fragment),r=ve(),c&&c.c(),s=ft()},m(h,u){_e(n,h,u),Z(h,t,u),_e(i,h,u),Z(h,r,u),c&&c.m(h,u),Z(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&&F(c,1)):(c=Wy(h),c.c(),F(c,1),c.m(s.parentNode,s)):c&&(Ve(),X(c,1,1,()=>{c=null}),Ge())},i(h){o||(F(n.$$.fragment,h),F(i.$$.fragment,h),F(c),o=!0)},o(h){X(n.$$.fragment,h),X(i.$$.fragment,h),X(c),o=!1},d(h){Se(n,h),h&&Y(t),Se(i,h),h&&Y(r),c&&c.d(h),h&&Y(s)}}}function _k(e){let n,t,i;return{c(){n=j("div"),t=j("img"),_(t,"class","missing-floor-image svelte-18287ai"),Pn(t.src,i=e[6])||_(t,"src",i),_(t,"alt","缺省楼层"),_(n,"class","missing-floor-wrapper svelte-18287ai")},m(r,s){Z(r,n,s),Q(n,t)},p(r,s){s&64&&!Pn(t.src,i=r[6])&&_(t,"src",i)},i:de,o:de,d(r){r&&Y(n)}}}function Wy(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=kn(r,i[s]);return n=new Px({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function Sk(e){let n,t,i,r;const s=[_k,Pk],o=[];function a(l,c){return l[8]?1:0}return n=a(e),t=o[n]=s[n](e),{c(){t.c(),i=ft()},m(l,c){o[n].m(l,c),Z(l,i,c),r=!0},p(l,[c]){let h=n;n=a(l),n===h?o[n].p(l,c):(Ve(),X(o[h],1,1,()=>{o[h]=null}),Ge(),t=o[n],t?t.p(l,c):(t=o[n]=s[n](l),t.c()),F(t,1),t.m(i.parentNode,i))},i(l){r||(F(t),r=!0)},o(l){X(t),r=!1},d(l){o[n].d(l),l&&Y(i)}}}function Ik(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 Tk extends ke{constructor(n){super(),Le(this,n,Ik,Sk,De,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:10,highlightData:5,missingFloorImageUrl:6},Ck)}}function Dk(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 Qy(e){let n,t,i,r,s=e[8]!==0&&Yy(e);return{c(){n=j("div"),s&&s.c(),_(n,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(o,a){Z(o,n,a),s&&s.m(n,null),t=!0,i||(r=[Di(As.call(null,n)),ot(n,"clientWidth",e[14]),ot(n,"clientHeight",e[15])],i=!0)},p(o,a){o[8]!==0?s?(s.p(o,a),a&256&&F(s,1)):(s=Yy(o),s.c(),F(s,1),s.m(n,null)):s&&(Ve(),X(s,1,1,()=>{s=null}),Ge())},i(o){t||(F(s),t=!0)},o(o){X(s),t=!1},d(o){o&&Y(n),s&&s.d(),i=!1,yn(r)}}}function Yy(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=kn(c,l[d]);t=new Tk({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=kn(u,h[d]);return r=new Ak({props:u}),{c(){n=j("div"),Ie(t.$$.fragment),i=ve(),Ie(r.$$.fragment),_(n,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),W(n,"width",s),W(n,"height",o)},m(d,f){Z(d,n,f),_e(t,n,null),Q(n,i),_e(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||(F(t.$$.fragment,d),F(r.$$.fragment,d),a=!0)},o(d){X(t.$$.fragment,d),X(r.$$.fragment,d),a=!1},d(d){d&&Y(n),Se(t),Se(r)}}}function Lk(e){let n,t,i=e[1]&&Qy(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&F(i,1)):(i=Qy(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function kk(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:P,min:S}=o.bounding,T=P.x-S.x,z=P.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 ke{constructor(n){super(),Le(this,n,kk,Lk,De,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6,missingFloorImageUrl:7},Dk)}}let Ok=class extends Br{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:ps,missingFloorImageUrl:this.staticPrefix+"/release/web/saas/missing-floor.d687a5ed.png"},s=R(R({},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 ee(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 ms(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),i&&this.updateState(i,r),this.render()})}show(){return ee(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 ee(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=ek(t,this.five,this.data),this.render())}formatData(t){return ee(this,null,function*(){return yield ms(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?R(R({},r.config),t.config):r.config;this.state=Ee(R(R({},this.state),t),{config:s}),!Nn(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=Ee(R({},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 zk=(e,n)=>new Ok(e,n),Bk=[{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:"和室"}],Nk=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],Fk=[{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:"写字楼"}],tp=(e,n,t)=>{const i=new E.Matrix4,r=new E.Euler(e,n,t,"YXZ");return i.makeRotationFromEuler(r),i},Vk=(e,{scale:n,rotation:t,position:i})=>{if(n&&e.scale.set(n,n,n),t){const[r,s,o]=t;r&&e.applyMatrix4(tp(r,0,0)),s&&e.applyMatrix4(tp(0,s,0)),o&&e.applyMatrix4(tp(0,0,o))}return i&&e.position.set(i.x,i.y,i.z),e};function Tx(e,n){e.traverse(t=>{var i;if(t.type==="Mesh"){const r=t,s=R({map:r.material.map||{}},n);r.material=new ne.MeshBasicMaterial(s),r.renderOrder=1,((i=t.parent)==null?void 0:i.type)==="Mesh"&&(t.renderOrder=t.parent.renderOrder+1)}})}const Gk=(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=>ee(exports,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 H1.FBXLoader().loadAsync(y);return Tx(A,{transparent:!0,side:E.DoubleSide,blending:E.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:P,y:S,z:T}}=y;r.yBase=S,s={x:(x+P)/2,y:S-1.6,z:(M+T)/2},o=[0,l-Math.PI/2,0],a=.0045*w,Vk(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 ne.CanvasTexture(a)}const jk=({x:e,y:n,z:t})=>new ne.Vector3(e,n,t),Uk=(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=>ee(exports,null,function*(){var z,D,k,O,G,I,U,J;const A=(z=b==null?void 0:b.position)!=null?z:r;if(!A)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const w=jk(A),x=(D=b==null?void 0:b.rad)!=null?D:s,M=(k=b==null?void 0:b.fbx_url)!=null?k:o;if(t.rad=x,x===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${x}`));const P=yield new H1.FBXLoader().loadAsync(M);P.position.copy(w),P.rotation.z=x,P.scale.set(.8,.8,.8),Tx(P,{transparent:!0,side:E.DoubleSide});const S=(U=(I=(G=(O=P.children)==null?void 0:O[0])==null?void 0:G.children)==null?void 0:I[3])==null?void 0:U.clone();if(!S)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${S}`));const T=(J=n.name)!=null?J:"入户门";return S.material=new ne.MeshBasicMaterial({transparent:!0,map:Hk(T)}),S.renderOrder=3,P.children[0].add(S),t.object=P,!0}),c=()=>{if(t.animation)return;if(!t.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",t.object);const b=1,A=new ne.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,O=G=>{z=requestAnimationFrame(O);const I=G-D;I<k||(D=G,a.forEach(U=>U.update(I/1e3)),e.needsRender=!0)};return z=requestAnimationFrame(O),()=>{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)}},Wk=Ki;function Qk(e,n,t,i=Wk.Linear.None){const r=new yd(e).to(n,t).easing(i);Bc(()=>r.start(0));const s=ja(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 Yk(e,n){return Qk({progress:0},{progress:1},e,n)}var Dx=(e=>(e.Move="Move",e.Rotate="Rotate",e))(Dx||{}),Yi=(e=>(e.Clockwise="Clockwise",e.Anticlockwise="Anticlockwise",e.Loop="Loop",e))(Yi||{});const cu=Math.PI*2;function Xy(e){return(e%cu+cu)%cu}function Zy(e){return e%cu}function np(e,n,t){return e+(n-e)*t}const Sm=(e,n,t)=>{const i=Math.PI,r=i*2;let s=Xy(e),o=Xy(n);return t===Yi.Anticlockwise&&s<o&&(s+=r),t===Yi.Clockwise&&o<s&&(o+=r),t===Yi.Loop&&o-s>i?Sm(s,o,Yi.Anticlockwise):t===Yi.Loop&&s-o>i?Sm(s,o,Yi.Clockwise):{from:s,to:o}},Xk=e=>{const n={},t=(l,c,...h)=>ee(exports,[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,R({duration:o,moveEndCallback:()=>u(!0),moveCancelCallback:()=>d(new Error("move canceled"))},s)):d(new Error("unexpected error"))})}),i=s=>{const o=e.state,a=Zy(o.latitude),l=Zy(s.latitude),{from:c,to:h}=Sm(o.longitude,s.longitude,s.rotation||Yi.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)=>ee(exports,[l,c,...h],function*(s,o,a={}){n.interruptCallback&&n.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),e.currentMode!==Jt.Five.Mode.Panorama&&(yield e.changeMode(Jt.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=np(u.longitude,d.longitude,A),w.latitude=np(u.latitude,d.latitude,A),w.fov=np(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=Yk(y,Ki.Linear.None).onUpdate(m).onComplete(p).onDestroy(g);s.rotation===Yi.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 qy(e,n){return e.x===n.x&&e.y===n.y}function Lx(e,n){return Math.abs(e)===1/0&&Math.abs(n)===1/0?!0:Math.abs(e-n)<.001}function ld(e,n){return(n.y-e.y)/(n.x-e.x)}function kx(e,n,t){const i=ld(e[1],e[0]),r=ld(n[1],n[0]);if(isNaN(i)||isNaN(r)||Lx(i,r))return!1;if(Yh(e[0],n))return e[0];if(Yh(e[1],n))return e[1];if(Yh(n[0],e))return n[0];if(Yh(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 Yh(e,n){return qy(e,n[0])||qy(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&&Lx(ld(n[0],e),ld(e,n[1]))}function Zk(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 Xh(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)&&Xh(n[0],e[1],e[0])*Xh(e[1],n[1],e[0])>0&&Xh(e[0],n[1],n[0])*Xh(n[1],e[1],n[0])>0?1:0}function Rx(e,n=0){n<=0?requestAnimationFrame(e):requestAnimationFrame(()=>Rx(e,n-1))}const Jk=`<style type="text/css">
|
|
3174
|
+
`;return e.$$set=s=>{"content"in s&&t(0,i=s.content)},[i,r]}class SD extends ke{constructor(n){super(),Le(this,n,_D,PD,De,{content:0},CD)}}function ID(e){Ue(e,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function TD(e){let n,t;return n=new ED({props:{url:e[1].url}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&2&&(s.url=i[1].url),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function DD(e){let n,t;return n=new SD({props:{content:e[0]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.content=i[0]),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function LD(e){let n,t,i,r;const s=[DD,TD],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=j("div"),i&&i.c(),_(n,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){Z(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&&(Ve(),X(o[h],1,1,()=>{o[h]=null}),Ge()),~t?(i=o[t],i?i.p(l,c):(i=o[t]=s[t](l),i.c()),F(i,1),i.m(n,null)):i=null)},i(l){r||(F(i),r=!0)},o(l){X(i),r=!1},d(l){l&&Y(n),~t&&o[t].d()}}}function kD(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 Ex extends ke{constructor(n){super(),Le(this,n,kD,LD,De,{floorIndex:2,floorplanData:3},ID)}}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 OD(e){let n,t=e[15].outerHTML+"",i;return{c(){n=new $u(!1),i=ft(),n.a=i},m(r,s){n.m(t,r,s),Z(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 zD(e){let n,t,i,r,s,o,a=e[1]&&py(e),l=e[0]&&my(e),c=e[2]&&gy(e);return{c(){n=j("div"),a&&a.c(),t=ve(),l&&l.c(),i=ve(),c&&c.c(),r=ft(),_(n,"class","floorplan-plugin__room-part1 svelte-9vzn2f"),W(n,"opacity",e[11]?"1":"0")},m(h,u){Z(h,n,u),a&&a.m(n,null),Q(n,t),l&&l.m(n,null),Z(h,i,u),c&&c.m(h,u),Z(h,r,u),s||(o=[Di(As.call(null,n)),ot(n,"clientWidth",e[32]),ot(n,"clientHeight",e[33])],s=!0)},p(h,u){h[1]?a?a.p(h,u):(a=py(h),a.c(),a.m(n,t)):a&&(a.d(1),a=null),h[0]?l?l.p(h,u):(l=my(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=gy(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,yn(o)}}}function py(e){let n,t=e[3].name+"",i;return{c(){n=j("span"),i=xt(t),_(n,"class","floorplan-plugin__room-name")},m(r,s){Z(r,n,s),Q(n,i)},p(r,s){s[0]&8&&t!==(t=r[3].name+"")&&Ct(i,t)},d(r){r&&Y(n)}}}function my(e){let n,t;return{c(){n=j("span"),t=xt(e[14]),_(n,"class","floorplan-plugin__room-area svelte-9vzn2f"),W(n,"font-size",e[19])},m(i,r){Z(i,n,r),Q(n,t)},p(i,r){r[0]&16384&&Ct(t,i[14])},d(i){i&&Y(n)}}}function gy(e){let n,t;return{c(){n=j("span"),t=xt(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){Z(i,n,r),Q(n,t)},p(i,r){r[0]&8192&&Ct(t,i[13]),r[0]&1024&&W(n,"opacity",i[10]?"0.6":"0")},d(i){i&&Y(n)}}}function BD(e){let n,t,i;function r(a,l){if(a[4]===void 0)return zD;if(a[15])return OD}let s=r(e),o=s&&s(e);return{c(){n=j("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){Z(a,n,l),o&&o.m(n,null),t||(i=[Di(As.call(null,n)),ot(n,"clientWidth",e[34]),ot(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,yn(i)}}}function ND(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 FD(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:P}=n,{getLabelElement:S}=n,{adaptiveRoomLabelVisibleEnable:T}=n;function z(se,xe){if(xe.width===0||xe.height===0)return()=>!1;const Be=se.path.map(({x:N,y:H})=>[N,H]),ae=se.roomLabel.position,{x:pe,y:Te}=ae,{width:je,height:mt}=xe,Me=je/2,Ne=mt/2;return function(H){const Pe=pe*H,ge=Te*H,Je=Be.map(([ue,st])=>[ue*H,st*H]);return[[Pe+Me,ge-Ne],[Pe-Me,ge-Ne],[Pe-Me,ge+Ne],[Pe+Me,ge+Ne]].every(ue=>ND(ue,Je))}}const D=document.body.clientWidth,k=document.body.clientHeight,O=w.roomLabel,G=O.positionInImage.x*100+"%",I=O.positionInImage.y*100+"%",U=(D<500||k<500?10:14)+"px",J=(D<500||k<500?8:12)+"px";let K=0,te=0,ie=0,fe=0,ye=!1;x.subscribe(function(xe){t(25,ye=!!xe&&xe.id===w.id)});const be=se=>{t(7,ie=se.detail)},qe=se=>{t(8,fe=se.detail)},Ae=se=>{t(5,K=se.detail)},le=se=>{t(6,te=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,P=se.getRoomDimensionText),"getLabelElement"in se&&t(4,S=se.getLabelElement),"adaptiveRoomLabelVisibleEnable"in se&&t(24,T=se.adaptiveRoomLabelVisibleEnable)},e.$$.update=()=>{var se,xe;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?P((se=w.dimension)==null?void 0:se.width,(xe=w.dimension)==null?void 0:xe.height):""),e.$$.dirty[0]&384&&t(31,o={width:ie,height:fe}),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:te}),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||ye),e.$$.dirty[0]&167772160&&t(11,f=l||ye),e.$$.dirty[0]&100663296&&t(10,m=u||ye),e.$$.dirty[0]&201326592&&t(9,p=l&&!u)},[y,b,A,w,S,K,te,ie,fe,p,m,f,d,s,r,i,G,I,U,J,g,x,M,P,T,ye,u,l,h,c,a,o,be,qe,Ae,le]}class VD extends ke{constructor(n){super(),Le(this,n,FD,BD,De,{pxmm:20,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,room:3,hoveredRoom:21,getRoomAreaText:22,getRoomDimensionText:23,getLabelElement:4,adaptiveRoomLabelVisibleEnable:24},RD,[-1,-1])}}function GD(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 vy(e,n,t){const i=e.slice();return i[14]=n[t],i}function yy(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=vy(e,a,c),u=l(h);i.set(u,t[c]=by(u,h))}return{c(){n=j("div");for(let c=0;c<t.length;c+=1)t[c].c();_(n,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,h){Z(c,n,h);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(n,null);r=!0,s||(o=[Di(As.call(null,n)),ot(n,"clientWidth",e[13])],s=!0)},p(c,h){h&1791&&(a=c[10],Ve(),t=zi(t,h,l,1,c,a,i,n,bs,by,null,vy),Ge())},i(c){if(!r){for(let h=0;h<a.length;h+=1)F(t[h]);r=!0}},o(c){for(let h=0;h<t.length;h+=1)X(t[h]);r=!1},d(c){c&&Y(n);for(let h=0;h<t.length;h+=1)t[h].d();s=!1,yn(o)}}}function by(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=kn(o,s[a]);return i=new VD({props:o}),{key:e,first:null,c(){t=ft(),Ie(i.$$.fragment),this.first=t},m(a,l){Z(a,t,l),_e(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||(F(i.$$.fragment,a),r=!0)},o(a){X(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Se(i,a)}}}function HD(e){let n,t,i=e[10]&&yy(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[10]?i?(i.p(r,s),s&1024&&F(i,1)):(i=yy(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function jD(e,n,t){let i,{floorIndex:r}=n,{roomAreaEnable:s}=n,{roomNameEnable:o}=n,{roomDimensionEnable:a}=n,{floorplanData:l}=n,{hoveredRoom:c}=n,{getRoomAreaText:h}=n,{getRoomDimensionText:u}=n,{getLabelElement:d}=n,{adaptiveRoomLabelVisibleEnable:f}=n,m=0,p=0;const g=y=>{t(8,m=y.detail)};return e.$$set=y=>{"floorIndex"in y&&t(11,r=y.floorIndex),"roomAreaEnable"in y&&t(0,s=y.roomAreaEnable),"roomNameEnable"in y&&t(1,o=y.roomNameEnable),"roomDimensionEnable"in y&&t(2,a=y.roomDimensionEnable),"floorplanData"in y&&t(12,l=y.floorplanData),"hoveredRoom"in y&&t(3,c=y.hoveredRoom),"getRoomAreaText"in y&&t(4,h=y.getRoomAreaText),"getRoomDimensionText"in y&&t(5,u=y.getRoomDimensionText),"getLabelElement"in y&&t(6,d=y.getLabelElement),"adaptiveRoomLabelVisibleEnable"in y&&t(7,f=y.adaptiveRoomLabelVisibleEnable)},e.$$.update=()=>{if(e.$$.dirty&6144&&t(10,i=l.floorDatas[r].rooms),e.$$.dirty&4352){const{max:y,min:b}=l.bounding,A=y.x-b.x;t(9,p=m/A)}},[s,o,a,c,h,u,d,f,m,p,i,r,l,g]}class UD extends ke{constructor(n){super(),Le(this,n,jD,HD,De,{floorIndex:11,roomAreaEnable:0,roomNameEnable:1,roomDimensionEnable:2,floorplanData:12,hoveredRoom:3,getRoomAreaText:4,getRoomDimensionText:5,getLabelElement:6,adaptiveRoomLabelVisibleEnable:7},GD)}}function WD(e){Ue(e,"svelte-1fuyezq",".floorplan-plugin__rule-labels.svelte-1fuyezq.svelte-1fuyezq{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-1fuyezq.svelte-1fuyezq{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq.svelte-1fuyezq{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq.svelte-1fuyezq{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq.svelte-1fuyezq{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-1fuyezq.svelte-1fuyezq{background:#fff;opacity:0.2;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale-wrapper.svelte-1fuyezq{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-1fuyezq.svelte-1fuyezq{position:absolute;background:#fff;opacity:0.2;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-scale.svelte-1fuyezq{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-1fuyezq.svelte-1fuyezq{position:absolute}.floorplan-plugin__rule-labels--top.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-1fuyezq .floorplan-plugin__rule-text-wrapper.svelte-1fuyezq{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-1fuyezq.svelte-1fuyezq{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-1fuyezq .floorplan-plugin__rule-text-item.svelte-1fuyezq{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-1fuyezq.svelte-1fuyezq{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.35}")}function Ay(e,n,t){const i=e.slice();return i[11]=n[t],i[13]=t,i}function wy(e,n,t){const i=e.slice();return i[14]=n[t],i}function xy(e){let n;return{c(){n=j("div"),_(n,"class","floorplan-plugin__rule-scale svelte-1fuyezq"),W(n,"left",e[14].left*100+"%"),W(n,"bottom",e[14].bottom*100+"%")},m(t,i){Z(t,n,i)},p:de,d(t){t&&Y(n)}}}function My(e,n){let t,i,r=n[1](n[11].distance)+"",s,o;return{key:e,first:null,c(){t=j("div"),i=j("div"),s=xt(r),o=ve(),_(i,"class","floorplan-plugin__rule-text svelte-1fuyezq"),Ce(i,"is-row",n[2]),_(t,"class","floorplan-plugin__rule-text-item svelte-1fuyezq"),W(t,"left",n[11].left*100+"%"),W(t,"bottom",n[11].bottom*100+"%"),this.first=t},m(a,l){Z(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)+"")&&Ct(s,r)},d(a){a&&Y(t)}}}function QD(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]=xy(wy(e,h,m));let d=e[4];const f=m=>m[13];for(let m=0;m<d.length;m+=1){let p=Ay(e,d,m),g=f(p);l.set(g,a[m]=My(g,p))}return{c(){n=j("div"),t=j("div"),i=ve(),r=j("div");for(let m=0;m<u.length;m+=1)u[m].c();s=ve(),o=j("div");for(let m=0;m<a.length;m+=1)a[m].c();_(t,"class","floorplan-plugin__rule-line svelte-1fuyezq"),_(r,"class","floorplan-plugin__rule-scale-wrapper svelte-1fuyezq"),Ce(r,"is-row",e[2]),_(o,"class","floorplan-plugin__rule-text-wrapper svelte-1fuyezq"),_(n,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+e[0]+" svelte-1fuyezq"),Ce(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){Z(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=wy(m,h,g);u[g]?u[g].p(y,p):(u[g]=xy(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=zi(a,p,f,1,m,d,l,o,Mg,My,null,Ay)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+m[0]+" svelte-1fuyezq")&&_(n,"class",c),p&5&&Ce(n,"is-row",m[2])},i:de,o:de,d(m){m&&Y(n),Oi(u,m);for(let p=0;p<a.length;p+=1)a[p].d()}}}const zo=1e3,Bo=180;function YD(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-(zo-Bo)*2,c=s.max.y-s.min.y-(zo-Bo)*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-zo+Bo)/l:0,g=a?0:(m-s.min.y-zo+Bo)/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-zo+Bo)/l:0,w=a?0:(b-s.min.y-zo+Bo)/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 XD extends ke{constructor(n){super(),Le(this,n,YD,QD,De,{type:0,data:5,bounding:6,getRuleDistanceText:1},WD)}}function ZD(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 Ey(e,n,t){const i=e.slice();return i[13]=n[t][0],i[14]=n[t][1],i}function Cy(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=kn(o,s[a]);return i=new XD({props:o}),{key:e,first:null,c(){t=ft(),Ie(i.$$.fragment),this.first=t},m(a,l){Z(a,t,l),_e(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||(F(i.$$.fragment,a),r=!0)},o(a){X(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Se(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=Ey(e,s,a),c=o(l);i.set(c,t[a]=Cy(c,l))}return{c(){n=j("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){Z(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],Ve(),t=zi(t,l,o,1,a,s,i,n,bs,Cy,null,Ey),Ge()),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)F(t[l]);r=!0}},o(a){for(let l=0;l<t.length;l+=1)X(t[l]);r=!1},d(a){a&&Y(n);for(let l=0;l<t.length;l+=1)t[l].d()}}}const Py=1e3,_y=180;function JD(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-(Py-_y)*2),e.$$.dirty&2&&t(8,h=i.max.y-i.min.y-(Py-_y)*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 KD extends ke{constructor(n){super(),Le(this,n,JD,qD,De,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},ZD)}}function Rd(e,n={}){let t="";const{needZ:i,needA:r}=n;return(i?e.slice().concat(e[0]):e.slice()).forEach((o,a)=>{const{x:l,y:c}=n.format?n.format(o):o,h=l+","+c;return a===0?(t+="M"+h,t):r!=null&&r[a]?(t+="A"+r[a]+","+h,t):(t+="L"+h,t)}),t+(i?"Z":"")}function Cx({x:e,y:n},t){const{max:i,min:r}=t;return{x:e-r.x,y:i.y-n}}function $D(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 eL(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 tL(e,n){return Math.max(...n.work.observers.map(i=>e.z>=i.standingPosition.z?i.floorIndex:0))}function nL(e){let n;return{c(){n=Bt("path"),_(n,"d",e[0]),_(n,"fill","#2F313A")},m(t,i){Z(t,n,i)},p(t,[i]){i&1&&_(n,"d",t[0])},i:de,o:de,d(t){t&&Y(n)}}}function iL(e,n,t){let i,{path:r}=n;return e.$$set=s=>{"path"in s&&t(1,r=s.path)},e.$$.update=()=>{e.$$.dirty&2&&t(0,i=Rd(r,{needZ:!0}))},[i,r]}class rL extends ke{constructor(n){super(),Le(this,n,iL,nL,De,{path:1})}}function sL(e){let n,t,i,r,s,o;return{c(){n=Bt("defs"),t=Bt("pattern"),i=Bt("rect"),r=Bt("path"),s=ve(),o=Bt("path"),_(i,"x","0"),_(i,"y","0"),_(i,"width",e[1]),_(i,"height",e[1]),_(i,"fill","#323747"),_(r,"d",e[2]),_(r,"stroke","#ffffff"),_(r,"stroke-opacity","0.06"),_(r,"stroke-width","0.5"),_(r,"fill","none"),_(t,"id","fpm-room-pattern-0"),_(t,"x","0"),_(t,"y","0"),_(t,"width",e[1]),_(t,"height",e[1]),_(t,"patternUnits","userSpaceOnUse"),_(t,"patternTransform","scale(50 50)"),_(o,"d",e[0]),_(o,"fill","url(#fpm-room-pattern-0)")},m(a,l){Z(a,n,l),Q(n,t),Q(t,i),Q(t,r),Z(a,s,l),Z(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 ep=6;function oL(e,n,t){let i,{path:r}=n;const s=ep*2,o=`M0 ${ep} h ${s} M${ep} 0 v ${s}`;return e.$$set=a=>{"path"in a&&t(3,r=a.path)},e.$$.update=()=>{e.$$.dirty&8&&t(0,i=Rd(r,{needZ:!0}))},[i,s,o,r]}class aL extends ke{constructor(n){super(),Le(this,n,oL,sL,De,{path:3})}}function lL(e){let n,t,i,r,s,o,a,l,c,h,u;return{c(){n=Bt("defs"),t=Bt("pattern"),i=Bt("rect"),r=Bt("pattern"),s=Bt("rect"),o=ve(),a=Bt("path"),l=ve(),c=Bt("path"),h=ve(),u=Bt("path"),_(i,"x","0"),_(i,"y","0"),_(i,"width","6"),_(i,"height","50"),_(i,"fill","none"),_(i,"stroke","#4B4B57"),_(i,"stroke-width","0.5"),_(t,"id","room-material-pattern-1"),_(t,"x","0"),_(t,"y","0"),_(t,"width","12"),_(t,"height","50"),_(t,"patternUnits","userSpaceOnUse"),_(t,"patternTransform","scale(50 50)"),_(s,"x","0"),_(s,"y","0"),_(s,"width","6"),_(s,"height","50"),_(s,"fill","none"),_(s,"stroke","#4B4B57"),_(s,"stroke-width","0.5"),_(r,"id","room-material-pattern-2"),_(r,"x","6"),_(r,"y","25"),_(r,"width","12"),_(r,"height","50"),_(r,"patternUnits","userSpaceOnUse"),_(r,"patternTransform","scale(50 50)"),_(a,"d",e[0]),_(a,"fill","#43434D"),_(c,"d",e[0]),_(c,"fill","url(#room-material-pattern-1)"),_(u,"d",e[0]),_(u,"fill","url(#room-material-pattern-2)")},m(d,f){Z(d,n,f),Q(n,t),Q(t,i),Q(n,r),Q(r,s),Z(d,o,f),Z(d,a,f),Z(d,l,f),Z(d,c,f),Z(d,h,f),Z(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 cL(e,n,t){let i,{path:r}=n;return e.$$set=s=>{"path"in s&&t(1,r=s.path)},e.$$.update=()=>{e.$$.dirty&2&&t(0,i=Rd(r,{needZ:!0}))},[i,r]}class hL extends ke{constructor(n){super(),Le(this,n,cL,lL,De,{path:1})}}function uL(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 Sy(e,n,t){const i=e.slice();return i[5]=n[t],i}function dL(e){let n,t;return n=new aL({props:{path:e[5].path}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function fL(e){let n,t;return n=new hL({props:{path:e[5].path}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function pL(e){let n,t;return n=new rL({props:{path:e[5].path}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.path=i[5].path),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function Iy(e){let n,t,i,r;const s=[pL,fL,dL],o=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return t=a(e),i=o[t]=s[t](e),{c(){n=Bt("svg"),i.c(),_(n,"width","100%"),_(n,"height","100%"),_(n,"viewBox",`0 0 ${e[1]} ${e[2]}`),_(n,"class","svelte-1dykexu")},m(l,c){Z(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):(Ve(),X(o[h],1,1,()=>{o[h]=null}),Ge(),i=o[t],i?i.p(l,c):(i=o[t]=s[t](l),i.c()),F(i,1),i.m(n,null))},i(l){r||(F(i),r=!0)},o(l){X(i),r=!1},d(l){l&&Y(n),o[t].d()}}}function mL(e){let n,t,i=e[0],r=[];for(let o=0;o<i.length;o+=1)r[o]=Iy(Sy(e,i,o));const s=o=>X(r[o],1,1,()=>{r[o]=null});return{c(){n=j("div");for(let o=0;o<r.length;o+=1)r[o].c();_(n,"class","floorplan-plugin__room-material svelte-1dykexu")},m(o,a){Z(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=Sy(o,i,l);r[l]?(r[l].p(c,a),F(r[l],1)):(r[l]=Iy(c),r[l].c(),F(r[l],1),r[l].m(n,null))}for(Ve(),l=i.length;l<r.length;l+=1)s(l);Ge()}},i(o){if(!t){for(let a=0;a<i.length;a+=1)F(r[a]);t=!0}},o(o){r=r.filter(Boolean);for(let a=0;a<r.length;a+=1)X(r[a]);t=!1},d(o){o&&Y(n),Oi(r,o)}}}function gL(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=>Ee(R({},l),{path:l.path.map(c=>Cx(c,s.bounding))})))},[i,o,a,r,s]}class vL extends ke{constructor(n){super(),Le(this,n,gL,mL,De,{floorIndex:3,floorplanData:4},uL)}}function yL(e){Ue(e,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function bL(e){let n,t,i,r;return{c(){n=Bt("path"),_(n,"d",e[5]),_(n,"fill","#fff"),_(n,"style",e[2]),_(n,"id",t=`${e[1]}_${e[0].id}`),_(n,"class","svelte-qq2273")},m(s,o){Z(s,n,o),i||(r=[ot(n,"mouseenter",e[3]),ot(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,yn(r)}}}function AL(e,n,t){let i,r,{room:s}=n,{floorIndex:o}=n,{floorplanData:a}=n,{highlightData:l}=n,{hoveredRoom:c}=n;function h(){c==null||c.set(s)}function u(){c==null||c.set(void 0)}const{bounding:d}=a,f=Rd(s.path,{needZ:!0,format:m=>Cx(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 wL extends ke{constructor(n){super(),Le(this,n,AL,bL,De,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},yL)}}function xL(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 Ty(e,n,t){const i=e.slice();return i[6]=n[t],i}function Dy(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=kn(o,s[a]);return i=new wL({props:o}),{key:e,first:null,c(){t=ft(),Ie(i.$$.fragment),this.first=t},m(a,l){Z(a,t,l),_e(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||(F(i.$$.fragment,a),r=!0)},o(a){X(i.$$.fragment,a),r=!1},d(a){a&&Y(t),Se(i,a)}}}function ML(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=Ty(e,o,l),h=a(c);r.set(h,i[l]=Dy(h,c))}return{c(){n=j("div"),t=Bt("svg");for(let l=0;l<i.length;l+=1)i[l].c();_(t,"width","100%"),_(t,"height","100%"),_(t,"viewBox",`0 0 ${e[4]} ${e[5]}`),_(t,"class","svelte-1kqo6e4"),_(n,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){Z(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,Ve(),i=zi(i,c,a,1,l,o,r,t,bs,Dy,null,Ty),Ge())},i(l){if(!s){for(let c=0;c<o.length;c+=1)F(i[c]);s=!0}},o(l){for(let c=0;c<i.length;c+=1)X(i[c]);s=!1},d(l){l&&Y(n);for(let c=0;c<i.length;c+=1)i[c].d()}}}function EL(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 Px extends ke{constructor(n){super(),Le(this,n,EL,ML,De,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},xL)}}function CL(e){Ue(e,"svelte-1lm20n5",".missing-floor.svelte-1lm20n5{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;flex-direction:column;align-items:center}.text.svelte-1lm20n5{margin-top:0.75rem;color:#fff;opacity:0.3}")}function Ly(e){let n,t=e[0].text+"",i;return{c(){n=j("span"),i=xt(t),_(n,"class","text svelte-1lm20n5"),W(n,"font-size",e[0].textFontSize+"px")},m(r,s){Z(r,n,s),Q(n,i)},p(r,s){s&1&&t!==(t=r[0].text+"")&&Ct(i,t),s&1&&W(n,"font-size",r[0].textFontSize+"px")},d(r){r&&Y(n)}}}function PL(e){let n,t,i,r,s=e[0].text&&Ly(e);return{c(){n=j("div"),t=j("img"),r=ve(),s&&s.c(),_(t,"class","image"),_(t,"alt","缺省楼层展位图"),Pn(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){Z(o,n,a),Q(n,t),Q(n,r),s&&s.m(n,null)},p(o,[a]){a&1&&!Pn(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=Ly(o),s.c(),s.m(n,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UT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function Pg(e){return e*180/Math.PI}function IL(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 TL(e){let n,t;return{c(){n=j("div"),t=j("div"),_(t,"class","floorplan__camera-rotate svelte-17cl35n"),W(t,"background-image",`url(${e[0]||ps})`),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){Z(i,n,r),Q(n,t)},p(i,[r]){r&1&&W(t,"background-image",`url(${i[0]||ps})`);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 DL(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=-Pg(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 LL=class extends ke{constructor(n){super(),Le(this,n,DL,TL,De,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},IL)}};const kL="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+ww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LaUnXMbvFyrzby8xRrayqUM2+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 OL(e){let n,t,i,r,s;return{c(){n=j("div"),t=j("div"),i=ve(),r=j("span"),s=xt(e[0]),_(t,"class","floorplan-plugin__compass-image svelte-rpkaro"),W(t,"background-image",`url(${kL})`),_(r,"class","floorplan-plugin__compass-text svelte-rpkaro"),_(n,"class","floorplan-plugin__compass svelte-rpkaro"),W(n,"transform",e[2])},m(o,a){Z(o,n,a),Q(n,t),Q(n,i),Q(n,r),Q(r,s)},p(o,a){a&1&&Ct(s,o[0])},d(o){o&&Y(n)}}}function zL(e){let n,t=e[1]&&OL(e);return{c(){t&&t.c(),n=ft()},m(i,r){t&&t.m(i,r),Z(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 BL(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?Pg(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 NL extends ke{constructor(n){super(),Le(this,n,BL,zL,De,{floorplanData:3,northDesc:0},RL)}}function FL(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 VL(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=kn(d,u[w]);n=new vL({props:d});let f=(e[3]||e[5])&&ky(e);const m=[{floorplanData:e[11],floorIndex:e[2]}];let p={};for(let w=0;w<m.length;w+=1)p=kn(p,m[w]);r=new Ex({props:p});let g=e[6]&&Ry(e),y=e[10]&&Oy(e),b=e[4]&&zy(e),A=e[22]&&By(e);return{c(){Ie(n.$$.fragment),t=ve(),f&&f.c(),i=ve(),Ie(r.$$.fragment),s=ve(),g&&g.c(),o=ve(),y&&y.c(),a=ve(),b&&b.c(),l=ve(),A&&A.c(),c=ft()},m(w,x){_e(n,w,x),Z(w,t,x),f&&f.m(w,x),Z(w,i,x),_e(r,w,x),Z(w,s,x),g&&g.m(w,x),Z(w,o,x),y&&y.m(w,x),Z(w,a,x),b&&b.m(w,x),Z(w,l,x),A&&A.m(w,x),Z(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&&F(f,1)):(f=ky(w),f.c(),F(f,1),f.m(i.parentNode,i)):f&&(Ve(),X(f,1,1,()=>{f=null}),Ge());const P=x&2052?Vn(m,[{floorplanData:w[11],floorIndex:w[2]}]):{};r.$set(P),w[6]?g?(g.p(w,x),x&64&&F(g,1)):(g=Ry(w),g.c(),F(g,1),g.m(o.parentNode,o)):g&&(Ve(),X(g,1,1,()=>{g=null}),Ge()),w[10]?y?(y.p(w,x),x&1024&&F(y,1)):(y=Oy(w),y.c(),F(y,1),y.m(a.parentNode,a)):y&&(Ve(),X(y,1,1,()=>{y=null}),Ge()),w[4]?b?(b.p(w,x),x&16&&F(b,1)):(b=zy(w),b.c(),F(b,1),b.m(l.parentNode,l)):b&&(Ve(),X(b,1,1,()=>{b=null}),Ge()),w[22]?A?(A.p(w,x),x&4194304&&F(A,1)):(A=By(w),A.c(),F(A,1),A.m(c.parentNode,c)):A&&(Ve(),X(A,1,1,()=>{A=null}),Ge())},i(w){h||(F(n.$$.fragment,w),F(f),F(r.$$.fragment,w),F(g),F(y),F(b),F(A),h=!0)},o(w){X(n.$$.fragment,w),X(f),X(r.$$.fragment,w),X(g),X(y),X(b),X(A),h=!1},d(w){Se(n,w),w&&Y(t),f&&f.d(w),w&&Y(i),Se(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 GL(e){let n,t;return n=new SL({props:{missingFloorConfig:e[18]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&262144&&(s.missingFloorConfig=i[18]),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function ky(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=kn(r,i[s]);return n=new Px({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function Ry(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=kn(r,i[s]);return n=new UD({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function Oy(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=kn(r,i[s]);return n=new KD({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function zy(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=kn(r,i[s]);return n=new LL({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function By(e){let n,t;return n=new NL({props:{floorplanData:e[11],northDesc:e[21]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(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||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function HL(e){let n,t,i,r,s;const o=[GL,VL],a=[];function l(c,h){return c[23]?1:0}return t=l(e),i=a[t]=o[t](e),{c(){n=j("div"),i.c(),_(n,"class",r=on(`floorplan-plugin__floor${e[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(c,h){Z(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):(Ve(),X(a[u],1,1,()=>{a[u]=null}),Ge(),i=a[t],i?i.p(c,h):(i=a[t]=o[t](c),i.c()),F(i,1),i.m(n,null)),(!s||h&2&&r!==(r=on(`floorplan-plugin__floor${c[1]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&_(n,"class",r)},i(c){s||(F(i),s=!0)},o(c){X(i),s=!1},d(c){c&&Y(n),a[t].d()}}}function jL(e,n,t){let i,r,{panoIndex:s}=n,{isCurrent:o}=n,{floorIndex:a}=n,{highlightEnable:l}=n,{cameraEnable:c}=n,{hoverEnable:h}=n,{roomLabelsEnable:u}=n,{roomAreaEnable:d}=n,{roomNameEnable:f}=n,{roomDimensionEnable:m}=n,{ruleLabelsEnable:p}=n,{floorplanData:g}=n,{getRoomAreaText:y}=n,{getRoomDimensionText:b}=n,{getLabelElement:A}=n,{getRuleDistanceText:w}=n,{adaptiveRoomLabelVisibleEnable:x}=n,{highlightData:M}=n,{missingFloorConfig:P}=n,{lastPanoramaLongitude:S}=n,{cameraImageUrl:T}=n,{northDesc:z}=n,{compassEnable:D}=n;const k=Cg(void 0);return e.$$set=O=>{"panoIndex"in O&&t(0,s=O.panoIndex),"isCurrent"in O&&t(1,o=O.isCurrent),"floorIndex"in O&&t(2,a=O.floorIndex),"highlightEnable"in O&&t(3,l=O.highlightEnable),"cameraEnable"in O&&t(4,c=O.cameraEnable),"hoverEnable"in O&&t(5,h=O.hoverEnable),"roomLabelsEnable"in O&&t(6,u=O.roomLabelsEnable),"roomAreaEnable"in O&&t(7,d=O.roomAreaEnable),"roomNameEnable"in O&&t(8,f=O.roomNameEnable),"roomDimensionEnable"in O&&t(9,m=O.roomDimensionEnable),"ruleLabelsEnable"in O&&t(10,p=O.ruleLabelsEnable),"floorplanData"in O&&t(11,g=O.floorplanData),"getRoomAreaText"in O&&t(12,y=O.getRoomAreaText),"getRoomDimensionText"in O&&t(13,b=O.getRoomDimensionText),"getLabelElement"in O&&t(14,A=O.getLabelElement),"getRuleDistanceText"in O&&t(15,w=O.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in O&&t(16,x=O.adaptiveRoomLabelVisibleEnable),"highlightData"in O&&t(17,M=O.highlightData),"missingFloorConfig"in O&&t(18,P=O.missingFloorConfig),"lastPanoramaLongitude"in O&&t(19,S=O.lastPanoramaLongitude),"cameraImageUrl"in O&&t(20,T=O.cameraImageUrl),"northDesc"in O&&t(21,z=O.northDesc),"compassEnable"in O&&t(22,D=O.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,P,S,T,z,D,r,k,i]}let UL=class extends ke{constructor(n){super(),Le(this,n,jL,HL,De,{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},FL)}};function WL(e){Ue(e,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function Ny(e,n,t){const i=e.slice();return i[24]=n[t],i}function Fy(e){let n,t,i,r=e[14].floorDatas,s=[];for(let a=0;a<r.length;a+=1)s[a]=Vy(Ny(e,r,a));const o=a=>X(s[a],1,1,()=>{s[a]=null});return{c(){n=j("div");for(let a=0;a<s.length;a+=1)s[a].c();_(n,"class","floorplan-main svelte-86bqav")},m(a,l){Z(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=Ny(e,r,c);s[c]?(s[c].p(h,l),F(s[c],1)):(s[c]=Vy(h),s[c].c(),F(s[c],1),s[c].m(n,null))}for(Ve(),c=r.length;c<s.length;c+=1)o(c);Ge()}},i(a){if(!i){for(let l=0;l<r.length;l+=1)F(s[l]);t||an(()=>{t=ys(n,_n,{duration:e[0],easing:Rr}),t.start()}),i=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)X(s[l]);i=!1},d(a){a&&Y(n),Oi(s,a)}}}function Vy(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=kn(r,i[s]);return n=new UL({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function QL(e){let n,t,i=e[1]&&Fy(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&F(i,1)):(i=Fy(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function YL(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:P}=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,P=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,P,S,T,z]}let _g=class extends ke{constructor(n){super(),Le(this,n,YL,QL,De,{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},WL)}};const XL="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 ZL(e){return ee(this,null,function*(){const n=new Headers({"Content-Type":"text/plain"}),t=function(r){return ee(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 JL(e){return{floorName:e.floor_name,floorIndex:e.floor_index,rooms:e.rooms.map(qL),rules:e.rules}}function KL(e){return{index:e.index,floorIndex:e.floor_index,position:e.position,positionInImage:e.position_in_image}}function $L(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 ms(e){return ee(this,null,function*(){const n=yield ZL(e.outlines),t=e.computed_data.bounding,i=e.computed_data.floor_datas.map(JL),r=e.computed_data.entrance?$L(e.computed_data.entrance):null;return{outlines:n,entrance:r,bounding:t,floorDatas:i,observers:e.computed_data.observers.map(KL)}})}function ek(e,n,t){return e.map(r=>{const s=r.position,o=r.icon?r.icon:{url:XL,width:45,height:48},a=tL(s,n),l=$D(s,t),c=eL(l,t);return{floorIndex:a,icon:o,id:r.id,position:l,positionInImage:c}})}function tk(e,n){return n(e),e}function ka(e,n){return tk({},t=>{for(const i in e)n.indexOf(i)===-1&&(t[i]=e[i])})}function Gy(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 Sg(e,n,t=ss.BOUNDING_CENTER){const i=Gy(e,n),r=Gy(e,n+1);return t===ss.BOUNDING_CENTER?(e.model.bounding.max.y+e.model.bounding.min.y)/2:t===ss.CEILING?r:i}function Ig(e,n,t,i){const r=Sg(e,t,i==null?void 0:i.attachedTo),s=new E.Vector3(0,r,0),o=new E.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.13");v(this,"NAME");v(this,"five");v(this,"workUtil");v(this,"fiveUtil");v(this,"hooks",new Cn);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 _d(n),this.workUtil=this.fiveUtil.workUtil}getCurrentState(){return this.state}absoluteUrl(n){return dg(this.staticPrefix,n)}onWorkCodeChange(){}},Br=class extends ws{};var Zn=(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))(Zn||{});const _x=500,nk=80;function Ws(e,n,t=4){return Math.abs(e-n)<Math.pow(10,-t)}function Sx(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 Ws(o,a,t)||Ws(o+i,a,t)}Object.assign(window,{nearlyEqual:Ws,nearlyEqualRad:Sx});function ik(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hy(e){return ik(e)&&!!e.isVector3}function Tg(e,n){return ee(this,null,function*(){const[t]=yield to(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(!rk(i,r))throw new Error("pose 与预期不符")})}function rk(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"?Sx(i,r,2):typeof i=="number"&&typeof r=="number"?Ws(i,r,2):Hy(r)&&Hy(i)?r.distanceTo(i)<.01:i===r})}function sk(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!(!Ws(t,o,2)||!Ws(i,a,2)||s!==void 0&&s.distanceTo(l)>.01||!Ws(r,c,2))}function Ix(e,n,t=!0){return ee(this,null,function*(){if(sk(e,n)===!0)return;const r=e.getCurrentState();if(r.mode!==n.mode){const[h]=yield to(Tg(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 to(e.updateCamera(ka(n,["mode"]),l,t));if(c)throw new Error(Zn.UpdateCameraError)})}function Ra(e,n,t=300){var r,s;const i=e.getElement();if(i){i.style.opacity=n+"";for(let o=0;o<((s=(r=i.parentElement)==null?void 0:r.children)==null?void 0:s.length);o++){const a=i.parentElement.children[o];a instanceof HTMLElement&&a.dataset.infive==="1"&&(a.style.opacity=n+"")}i.style.transition=t===0?"none":`opacity ${t}ms linear`,t!==0&&Promise.race([new Promise(o=>i.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,t))]).then(()=>{i.style.transition="none"})}}function ok(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 ak(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 lk=class extends Br{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)=>ee(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)=>ee(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=Ig(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,Zn.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=>ee(this,null,function*(){var o;if(!this.state.enabled)return;if(!((o=this.five.model)!=null&&o.loaded))throw new Error(Zn.ModelNotLoaded);if(!this.data)throw new Error(Zn.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},r=R(R({},i),t),s=()=>ee(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 to(Ix(this.five,this.showState,r.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Zn.UnknownError);if(!this.updateSize())throw new Error(Zn.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:_x;Ra(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,Zn.BreakOffByHide),this.showPromise=void 0;const r=R(R({},{userAction:!0,isAutoHide:!1}),t);Ra(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||ak(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();ok(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:nk/((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:ps,attachedTo:ss.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:R(R({},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?ka(i,["selector","scale"]):{},o=R(R({},r.missingFloorConfig),s.missingFloorConfig),a=Ee(R(R({},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 ee(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&kr(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 ms(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 ee(this,null,function*(){return yield ms(t.data)})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?R(R({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Ee(R(R({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Ee(R(R({},this.state),t),{config:o}),!Nn(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=Ee(R({},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 _g({target:this.container,intro:!0,props:i})}};const ck=(e,n)=>new lk(e,n);function hk(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 uk(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 dk=class extends Br{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)=>ee(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)=>ee(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=Ig(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,Zn.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=>ee(this,null,function*(){var o;if(!this.state.enabled)return;if(!((o=this.fiveUtil.model)!=null&&o.loaded))throw new Error(Zn.ModelNotLoaded);if(!this.data)throw new Error(Zn.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},r=R(R({},i),t),s=()=>ee(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 to(Ix(this.five,this.showState,r.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Zn.UnknownError);if(!this.updateSize())throw new Error(Zn.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:_x;Ra(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,Zn.BreakOffByHide),this.showPromise=void 0;const r=R(R({},{userAction:!0,isAutoHide:!1}),t);Ra(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 E.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&&uk(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(),hk(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(ka(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:ps,attachedTo:ss.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,missingFloorConfig:R(R({},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?ka(i,["selector","scale"]):{},o=R(R({},r.missingFloorConfig),s.missingFloorConfig),a=Ee(R(R({},r),s),{missingFloorConfig:o});this.state={enabled:!0,visible:!1,config:a},this.initContainer(),Ua(t).then(this.onFiveModelLoaded),t.once("dispose",this.dispose),this.addEventListener()}load(t,i,r=!0){return ee(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&kr(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 ms(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=Sg(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.fiveUtil.model)==null?void 0:a.bounding.getCenter(new E.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 ee(this,null,function*(){return yield ms(t.data)})}updateState(t,i){var a;const r=this.state,s=(a=t.config)!=null&&a.missingFloorConfig?R(R({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Ee(R(R({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Ee(R(R({},this.state),t),{config:o}),!Nn(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=Ee(R({},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 _g({target:this.container,intro:!0,props:i})}};const fk=(e,n)=>new dk(e,n);let pk=class extends Br{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=Ig(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:ps,attachedTo:ss.BOUNDING_CENTER,getLabelElement:void 0,missingFloorConfig:R(R({},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?ka(i,["selector","scale"]):{},o=R(R({},r.missingFloorConfig),s.missingFloorConfig),a=Ee(R(R({},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 ee(this,null,function*(){function s(h){return Object.prototype.hasOwnProperty.apply(h,["version"])}const o=t;o&&kr(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 ms(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=Sg(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.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 ee(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 ee(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 ee(this,null,function*(){return yield ms(t.data)})}_show(t){return ee(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 Tg(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;Ra(this.five,s,r),this.hooks.emit("showAnimationEnded",{userAction:i,auto:!1}),this.render()})}_hide(t){return ee(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;Ra(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?R(R({},r.config.missingFloorConfig),t.config.missingFloorConfig):r.config.missingFloorConfig,o=t.config?Ee(R(R({},r.config),t.config),{missingFloorConfig:s}):r.config;this.state=Ee(R(R({},this.state),t),{config:o}),!Nn(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=Ee(R({},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 _g({target:this.container,intro:!0,props:i})}};const mk=(e,n)=>new pk(e,n);function Dg(e,n=200){let t;return function(...i){t||(e(...i),t=setTimeout(function(){t=null},n))}}function gk(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 vk(e){let n,t,i;return{c(){n=j("div"),t=j("div"),i=j("div"),_(i,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),W(i,"background-image","url("+(e[0]||ps)+")"),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){Z(r,n,s),Q(n,t),Q(t,i)},p(r,[s]){s&1&&W(i,"background-image","url("+(r[0]||ps)+")"),(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 yk(e){return`rotate(${Math.floor(e/Math.PI*180)*-1+45}deg)`}function bk(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,P=w.observers[x];if(!P)return"";const S=(M.max.x-M.min.x)*l,T=(M.max.y-M.min.y)*l,z=Math.floor(P.positionInImage.x*S),D=Math.floor(P.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=Dg(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=yk(d))},[h,o,s,r,a,l,c,u,d,f,i]}class Ak extends ke{constructor(n){super(),Le(this,n,bk,vk,De,{five:4,pxmm:5,floorplanData:6,cameraImageUrl:0},gk)}}function wk(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 jy(e,n,t){const i=e.slice();return i[1]=n[t],i}function Uy(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=j("div"),i=j("div"),o=ve(),_(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){Z(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 xk(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=jy(e,r,o),l=s(a);i.set(l,t[o]=Uy(l,a))}return{c(){n=j("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){Z(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=zi(t,a,s,1,o,r,i,n,Mg,Uy,null,jy))},i:de,o:de,d(o){o&&Y(n);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Mk(e,n,t){let{extraObjects:i=[]}=n;return e.$$set=r=>{"extraObjects"in r&&t(0,i=r.extraObjects)},[i]}class Ek extends ke{constructor(n){super(),Le(this,n,Mk,xk,De,{extraObjects:0},wk)}}function Ck(e){Ue(e,"svelte-18287ai",".missing-floor-wrapper.svelte-18287ai{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:flex;justify-content:center;align-items:center}.missing-floor-image.svelte-18287ai{max-width:100%;max-height:100%}")}function Pk(e){let n,t,i,r,s,o;const a=[{floorIndex:e[2],floorplanData:e[4]}];let l={};for(let h=0;h<a.length;h+=1)l=kn(l,a[h]);n=new Ex({props:l}),i=new Ek({props:{extraObjects:e[7]}});let c=e[3]&&Wy(e);return{c(){Ie(n.$$.fragment),t=ve(),Ie(i.$$.fragment),r=ve(),c&&c.c(),s=ft()},m(h,u){_e(n,h,u),Z(h,t,u),_e(i,h,u),Z(h,r,u),c&&c.m(h,u),Z(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&&F(c,1)):(c=Wy(h),c.c(),F(c,1),c.m(s.parentNode,s)):c&&(Ve(),X(c,1,1,()=>{c=null}),Ge())},i(h){o||(F(n.$$.fragment,h),F(i.$$.fragment,h),F(c),o=!0)},o(h){X(n.$$.fragment,h),X(i.$$.fragment,h),X(c),o=!1},d(h){Se(n,h),h&&Y(t),Se(i,h),h&&Y(r),c&&c.d(h),h&&Y(s)}}}function _k(e){let n,t,i;return{c(){n=j("div"),t=j("img"),_(t,"class","missing-floor-image svelte-18287ai"),Pn(t.src,i=e[6])||_(t,"src",i),_(t,"alt","缺省楼层"),_(n,"class","missing-floor-wrapper svelte-18287ai")},m(r,s){Z(r,n,s),Q(n,t)},p(r,s){s&64&&!Pn(t.src,i=r[6])&&_(t,"src",i)},i:de,o:de,d(r){r&&Y(n)}}}function Wy(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=kn(r,i[s]);return n=new Px({props:r}),{c(){Ie(n.$$.fragment)},m(s,o){_e(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||(F(n.$$.fragment,s),t=!0)},o(s){X(n.$$.fragment,s),t=!1},d(s){Se(n,s)}}}function Sk(e){let n,t,i,r;const s=[_k,Pk],o=[];function a(l,c){return l[8]?1:0}return n=a(e),t=o[n]=s[n](e),{c(){t.c(),i=ft()},m(l,c){o[n].m(l,c),Z(l,i,c),r=!0},p(l,[c]){let h=n;n=a(l),n===h?o[n].p(l,c):(Ve(),X(o[h],1,1,()=>{o[h]=null}),Ge(),t=o[n],t?t.p(l,c):(t=o[n]=s[n](l),t.c()),F(t,1),t.m(i.parentNode,i))},i(l){r||(F(t),r=!0)},o(l){X(t),r=!1},d(l){o[n].d(l),l&&Y(i)}}}function Ik(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 Tk extends ke{constructor(n){super(),Le(this,n,Ik,Sk,De,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:10,highlightData:5,missingFloorImageUrl:6},Ck)}}function Dk(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 Qy(e){let n,t,i,r,s=e[8]!==0&&Yy(e);return{c(){n=j("div"),s&&s.c(),_(n,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(o,a){Z(o,n,a),s&&s.m(n,null),t=!0,i||(r=[Di(As.call(null,n)),ot(n,"clientWidth",e[14]),ot(n,"clientHeight",e[15])],i=!0)},p(o,a){o[8]!==0?s?(s.p(o,a),a&256&&F(s,1)):(s=Yy(o),s.c(),F(s,1),s.m(n,null)):s&&(Ve(),X(s,1,1,()=>{s=null}),Ge())},i(o){t||(F(s),t=!0)},o(o){X(s),t=!1},d(o){o&&Y(n),s&&s.d(),i=!1,yn(r)}}}function Yy(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=kn(c,l[d]);t=new Tk({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=kn(u,h[d]);return r=new Ak({props:u}),{c(){n=j("div"),Ie(t.$$.fragment),i=ve(),Ie(r.$$.fragment),_(n,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),W(n,"width",s),W(n,"height",o)},m(d,f){Z(d,n,f),_e(t,n,null),Q(n,i),_e(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||(F(t.$$.fragment,d),F(r.$$.fragment,d),a=!0)},o(d){X(t.$$.fragment,d),X(r.$$.fragment,d),a=!1},d(d){d&&Y(n),Se(t),Se(r)}}}function Lk(e){let n,t,i=e[1]&&Qy(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&F(i,1)):(i=Qy(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function kk(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:P,min:S}=o.bounding,T=P.x-S.x,z=P.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 ke{constructor(n){super(),Le(this,n,kk,Lk,De,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6,missingFloorImageUrl:7},Dk)}}let Ok=class extends Br{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:ps,missingFloorImageUrl:this.staticPrefix+"/release/web/saas/missing-floor.d687a5ed.png"},s=R(R({},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 ee(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 ms(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),i&&this.updateState(i,r),this.render()})}show(){return ee(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 ee(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=ek(t,this.five,this.data),this.render())}formatData(t){return ee(this,null,function*(){return yield ms(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?R(R({},r.config),t.config):r.config;this.state=Ee(R(R({},this.state),t),{config:s}),!Nn(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=Ee(R({},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 zk=(e,n)=>new Ok(e,n),Bk=[{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:"和室"}],Nk=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],Fk=[{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:"写字楼"}],tp=(e,n,t)=>{const i=new E.Matrix4,r=new E.Euler(e,n,t,"YXZ");return i.makeRotationFromEuler(r),i},Vk=(e,{scale:n,rotation:t,position:i})=>{if(n&&e.scale.set(n,n,n),t){const[r,s,o]=t;r&&e.applyMatrix4(tp(r,0,0)),s&&e.applyMatrix4(tp(0,s,0)),o&&e.applyMatrix4(tp(0,0,o))}return i&&e.position.set(i.x,i.y,i.z),e};function Tx(e,n){e.traverse(t=>{var i;if(t.type==="Mesh"){const r=t,s=R({map:r.material.map||{}},n);r.material=new ne.MeshBasicMaterial(s),r.renderOrder=1,((i=t.parent)==null?void 0:i.type)==="Mesh"&&(t.renderOrder=t.parent.renderOrder+1)}})}const Gk=(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=>ee(exports,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 H1.FBXLoader().loadAsync(y);return Tx(A,{transparent:!0,side:E.DoubleSide,blending:E.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:P,y:S,z:T}}=y;r.yBase=S,s={x:(x+P)/2,y:S-1.6,z:(M+T)/2},o=[0,l-Math.PI/2,0],a=.0045*w,Vk(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 ne.CanvasTexture(a)}const jk=({x:e,y:n,z:t})=>new ne.Vector3(e,n,t),Uk=(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=>ee(exports,null,function*(){var z,D,k,O,G,I,U,J;const A=(z=b==null?void 0:b.position)!=null?z:r;if(!A)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const w=jk(A),x=(D=b==null?void 0:b.rad)!=null?D:s,M=(k=b==null?void 0:b.fbx_url)!=null?k:o;if(t.rad=x,x===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${x}`));const P=yield new H1.FBXLoader().loadAsync(M);P.position.copy(w),P.rotation.z=x,P.scale.set(.8,.8,.8),Tx(P,{transparent:!0,side:E.DoubleSide});const S=(U=(I=(G=(O=P.children)==null?void 0:O[0])==null?void 0:G.children)==null?void 0:I[3])==null?void 0:U.clone();if(!S)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${S}`));const T=(J=n.name)!=null?J:"入户门";return S.material=new ne.MeshBasicMaterial({transparent:!0,map:Hk(T)}),S.renderOrder=3,P.children[0].add(S),t.object=P,!0}),c=()=>{if(t.animation)return;if(!t.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",t.object);const b=1,A=new ne.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,O=G=>{z=requestAnimationFrame(O);const I=G-D;I<k||(D=G,a.forEach(U=>U.update(I/1e3)),e.needsRender=!0)};return z=requestAnimationFrame(O),()=>{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)}},Wk=Ki;function Qk(e,n,t,i=Wk.Linear.None){const r=new yd(e).to(n,t).easing(i);Bc(()=>r.start(0));const s=ja(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 Yk(e,n){return Qk({progress:0},{progress:1},e,n)}var Dx=(e=>(e.Move="Move",e.Rotate="Rotate",e))(Dx||{}),Yi=(e=>(e.Clockwise="Clockwise",e.Anticlockwise="Anticlockwise",e.Loop="Loop",e))(Yi||{});const cu=Math.PI*2;function Xy(e){return(e%cu+cu)%cu}function Zy(e){return e%cu}function np(e,n,t){return e+(n-e)*t}const Sm=(e,n,t)=>{const i=Math.PI,r=i*2;let s=Xy(e),o=Xy(n);return t===Yi.Anticlockwise&&s<o&&(s+=r),t===Yi.Clockwise&&o<s&&(o+=r),t===Yi.Loop&&o-s>i?Sm(s,o,Yi.Anticlockwise):t===Yi.Loop&&s-o>i?Sm(s,o,Yi.Clockwise):{from:s,to:o}},Xk=e=>{const n={},t=(l,c,...h)=>ee(exports,[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,R({duration:o,moveEndCallback:()=>u(!0),moveCancelCallback:()=>d(new Error("move canceled"))},s)):d(new Error("unexpected error"))})}),i=s=>{const o=e.state,a=Zy(o.latitude),l=Zy(s.latitude),{from:c,to:h}=Sm(o.longitude,s.longitude,s.rotation||Yi.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)=>ee(exports,[l,c,...h],function*(s,o,a={}){n.interruptCallback&&n.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),e.currentMode!==Jt.Five.Mode.Panorama&&(yield e.changeMode(Jt.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=np(u.longitude,d.longitude,A),w.latitude=np(u.latitude,d.latitude,A),w.fov=np(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=Yk(y,Ki.Linear.None).onUpdate(m).onComplete(p).onDestroy(g);s.rotation===Yi.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 qy(e,n){return e.x===n.x&&e.y===n.y}function Lx(e,n){return Math.abs(e)===1/0&&Math.abs(n)===1/0?!0:Math.abs(e-n)<.001}function ld(e,n){return(n.y-e.y)/(n.x-e.x)}function kx(e,n,t){const i=ld(e[1],e[0]),r=ld(n[1],n[0]);if(isNaN(i)||isNaN(r)||Lx(i,r))return!1;if(Yh(e[0],n))return e[0];if(Yh(e[1],n))return e[1];if(Yh(n[0],e))return n[0];if(Yh(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 Yh(e,n){return qy(e,n[0])||qy(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&&Lx(ld(n[0],e),ld(e,n[1]))}function Zk(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 Xh(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)&&Xh(n[0],e[1],e[0])*Xh(e[1],n[1],e[0])>0&&Xh(e[0],n[1],n[0])*Xh(n[1],e[1],n[0])>0?1:0}function Rx(e,n=0){n<=0?requestAnimationFrame(e):requestAnimationFrame(()=>Rx(e,n-1))}const Jk=`<style type="text/css">
|
|
3175
3175
|
.PanoRulerPlugin-rule-line {
|
|
3176
3176
|
position: absolute;
|
|
3177
3177
|
transform-origin: left center;
|
|
@@ -3561,7 +3561,7 @@ void main() {
|
|
|
3561
3561
|
void main() {
|
|
3562
3562
|
gl_FragColor = texture2D(map, vUv);
|
|
3563
3563
|
}
|
|
3564
|
-
`);this.uniforms={map:{value:t}}}}class _M extends E.Mesh{constructor(){super(...arguments);v(this,"name","MediaPlane");v(this,"src")}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}dispose(){this.traverse(t=>{if(t.isMesh){const i=t;i.geometry.dispose(),(i.material instanceof Array?i.material:[i.material]).forEach(s=>{s.dispose()})}})}}class SM extends _M{constructor(t,i,r){var a;super();v(this,"name","PanoTagPluginImagePlane");this.src=t;const s=(a=r==null?void 0:r.resolveZFighting)!=null?a:!0;let o=i;if(s){const l=Fc(i,5e-4);o=i.map(c=>c.clone().add(l))}Ox(t).then(({texture:l,transparent:c})=>{var p;const h=new E.MeshBasicMaterial({map:l,transparent:c}),u=Pl((p=r==null?void 0:r.objectFit)!=null?p:"contain",o,l.image.width/l.image.height),d=lr(...u),f=u.map(g=>g.clone().sub(d)),m=new PM(f);this.position.copy(d),this.geometry=m,this.material=h}).catch(l=>{console.error(`Imageplane error ${l==null?void 0:l.message}`)})}}class IM extends _M{constructor(t,i,r){const{videoCoverSrc:s,objectFit:o="contain",playButton:a="withText",paused:l=!0,videoTextureMap:c,ImageTextureMap:h,domEvents:u}=r!=null?r:{};super();v(this,"isVideoPlane",!0);v(this,"name","PanoTagPluginImagePlane");v(this,"videoInstance");v(this,"onVideoReady");v(this,"objectFit");v(this,"buttonSrc");v(this,"videoCoverSrc");v(this,"domEvents");v(this,"disposers",[]);v(this,"cornerPoints");v(this,"videoMesh");v(this,"coverMesh");v(this,"buttonMesh");v(this,"videoTextureMap");v(this,"ImageTextureMap");this.cornerPoints=i,this.src=t,this.buttonSrc=(()=>a==="withText"?zg:a==="withoutText"?Rm:typeof a=="string"?a:Rm)(),this.videoCoverSrc=s,this.objectFit=o,this.videoTextureMap=c,this.ImageTextureMap=h,this.domEvents=u,this.position.copy(lr(...i)),this.videoCoverSrc&&l?this.addCoverMesh().then(()=>this.addButtonMesh()):this.addVideoMesh().then(()=>{l?this.addButtonMesh():this.play(!0)}),this.addEventListener("removed",()=>{this.remove(...this.children)}),this.addEventListener("dispose",()=>{var d;(d=this.disposers)==null||d.forEach(f=>f==null?void 0:f())})}play(t=!1){return ee(this,null,function*(){this.videoMesh||(yield this.addVideoMesh()),this.showPlayUI(),this.videoInstance.paused&&this.videoInstance.play().then(()=>this.showPlayUI()).catch(i=>{this.pause(),console.error("play error",i)}),this.videoInstance.muted=t,this.render()})}pause(){this.videoInstance&&(this.videoInstance.pause(),this.showPauseUI().then(()=>this.render()))}initialRenderHooks(t){const r=t(()=>{var s;this.videoMesh&&((s=this.videoInstance)==null?void 0:s.paused)===!1&&(this.videoMesh.needsRender=!0)});this.disposers.push(()=>r)}showPlayUI(){this.coverMesh&&(this.coverMesh.visible=!1),this.remove(this.buttonMesh),this.videoMesh.visible=!0}showPauseUI(){return ee(this,null,function*(){this.coverMesh?(this.coverMesh.visible=!0,this.videoMesh&&(this.videoMesh.visible=!1)):(yield this.addCoverMesh(),this.coverMesh&&(this.videoMesh.visible=!1)),this.addButtonMesh().then(()=>this.render())})}render(){var t;this.videoMesh&&(this.videoMesh.needsRender=!0),this.coverMesh&&(this.coverMesh.needsRender=!0),this.buttonMesh&&(this.buttonMesh.needsRender=!0),this.videoMesh&&((t=this.videoInstance)==null?void 0:t.paused)===!1&&(this.videoMesh.needsRender=!0)}addCoverMesh(){return ee(this,null,function*(){if(this.children.includes(this.coverMesh))return;const t=yield(()=>ee(this,null,function*(){if(this.coverMesh)return this.coverMesh;if(!this.videoCoverSrc)return;const{texture:i,transparent:r}=yield this.getImageTexture(this.videoCoverSrc),s=new E.MeshBasicMaterial({transparent:!1,map:i}),o=Pl(this.objectFit,this.cornerPoints,i.image.width/i.image.height),a=new cp(o,s);return a.position.copy(new ne.Vector3(0,0,0)),a.name="videoCoverMesh",a}))();return t&&(this.children.includes(this.coverMesh)||(this.add(t),this.coverMesh=t)),t})}addVideoMesh(){return ee(this,null,function*(){if(this.children.includes(this.videoMesh))return;const t=yield(()=>ee(this,null,function*(){if(this.videoMesh)return this.videoMesh;if(!this.src)return;const r=this.getVideoTexture(this.src),s=new E.MeshBasicMaterial({transparent:!1,map:r}),o=yield new Promise(l=>{r.metadataLoaded?l(Pl(this.objectFit,this.cornerPoints,r.image.videoWidth/r.image.videoHeight)):r.addEventListener("videoLoaded",()=>l(Pl(this.objectFit,this.cornerPoints,r.image.videoWidth/r.image.videoHeight)))}),a=new cp(o,s);return a.name="videoMesh",a.position.copy(new ne.Vector3(0,0,0)),a}))();if(!t)return;this.domEvents.addAutoBindEventListener(t,"click",()=>{!this.videoInstance.paused&&this.videoInstance.muted?this.videoInstance.muted=!1:this.pause()},{noEmitWhenHide:!0});const i=t.material.map.image;return i.addEventListener("playing",()=>{this.coverMesh||this.remove(this.buttonMesh),this.render()}),i.addEventListener("pause",()=>{this.videoInstance.paused&&(this.showPauseUI(),this.render())}),this.children.includes(this.videoMesh)||(this.add(t),this.videoMesh=t,this.videoInstance=i),t})}addButtonMesh(){return ee(this,null,function*(){if(this.children.includes(this.buttonMesh))return;const t=yield(()=>ee(this,null,function*(){var f,m,p,g;if(this.buttonMesh)return this.buttonMesh;const i=(m=(f=this.videoMesh)==null?void 0:f.geometry.points[0].distanceTo(this.videoMesh.geometry.points[3]))!=null?m:1/0,r=(g=(p=this.coverMesh)==null?void 0:p.geometry.points[0].distanceTo(this.coverMesh.geometry.points[3]))!=null?g:1/0,s=this.cornerPoints[0].distanceTo(this.cornerPoints[3]),a=Math.min(i,r,s)/s*.3,{texture:l,transparent:c}=yield this.getImageTexture(this.buttonSrc),h=Pl("contain",this.cornerPoints,l.image.width/l.image.height),u=new cp(h,new mF(l));u.position.copy(new ne.Vector3(0,0,0)),u.name="buttonMesh",u.scale.set(a,a,a),this.domEvents.addAutoBindEventListener(u,"click",()=>{this.play()},{noEmitWhenHide:!0});const d=Fc(h,5e-4);return u.position.add(d),u}))();return this.children.includes(this.buttonMesh)||(this.add(t),this.buttonMesh=t),t})}getImageTexture(t){return ee(this,null,function*(){var r,s;if((r=this.ImageTextureMap)!=null&&r.has(t))return this.ImageTextureMap.get(t);const i=yield Ox(t);return(s=this.ImageTextureMap)==null||s.set(t,i),i})}getVideoTexture(t){var r,s;if((r=this.videoTextureMap)!=null&&r.has(t))return this.videoTextureMap.get(t);const i=pF(t);return(s=this.videoTextureMap)==null||s.set(t,i),i}}function s1(e){return Object.entries(e)}function o1(e){var t,i;typeof e.visibleConfig=="object"&&e.visibleConfig.keep&&(e.visibleConfig.keep==="visible"?e.visibleConfig={keep:e.visibleConfig.keep,visibleFiveMode:(t=e.visibleConfig)==null?void 0:t.visibleFiveMode}:e.visibleConfig.keep==="hidden"&&(e.visibleConfig={keep:e.visibleConfig.keep})),typeof e.unfoldedConfig=="object"&&(e.unfoldedConfig.disableFold&&(e.unfoldedConfig={keep:"unfolded"}),e.unfoldedConfig.disableUnfold&&(e.unfoldedConfig={keep:"folded"}),e.unfoldedConfig.keep&&(e.unfoldedConfig={keep:e.unfoldedConfig.keep}));const n=(i=e.initialState)!=null?i:{};return typeof e.unfoldedConfig=="object"&&(e.unfoldedConfig.keep==="unfolded"?n.unfolded=!0:e.unfoldedConfig.keep==="folded"&&(n.unfolded=!1)),typeof e.visibleConfig=="object"&&(e.visibleConfig.keep==="visible"?n.visible=!0:e.visibleConfig.keep==="hidden"&&(n.visible=!1)),e.initialState=n,e}const TM={visibleConfig:{intersectRaycaster:{enabled:!0,distanceAccuracy:.01,checkPoints:"corner",needPassed:1}},clickable:!0,simulate3D:!1,renderType:"Dom"};var DM=(e=>(e.PointTag="PointTag",e.PlaneTag="PlaneTag",e))(DM||{}),LM=(e=>(e.Audio="Audio",e.Text="Text",e.ImageText="ImageText",e.Image="Image",e.Video="Video",e.Link="Link",e.Sticker="Sticker",e.VRLink="VRLink",e.PanoLink="PanoLink",e.Marketing="Marketing",e.MediaPlane="MediaPlane",e.MediaModel="MediaModel",e.Model="Model",e.Panorama="Panorama",e.Custom="Custom",e.Unknown="Unknown",e))(LM||{}),kM=(e=>(e.Two="2D",e.Three="3D",e))(kM||{});function hp(e,n,t){var f,m,p,g,y;const i=(f=t==null?void 0:t.useCache)!=null?f:!0;if(!e)return(m=n.globalConfig)!=null?m:{};if(i){if((p=e==null?void 0:e.computedConfig)!=null&&p._isMerged)return e.computedConfig;if((g=e==null?void 0:e.config)!=null&&g._isMerged)return e.config}const r={},s={},o={};n.contentTypeConfig&&Object.entries(n.contentTypeConfig).forEach(([b,A])=>{var z,D;const w=b,x=w.split("-"),M=b.startsWith("["),P=M?x[0].slice(1,-1):void 0,S=M?x.slice(1):x,T=P?["PanoramaLike","ModelLike"].includes(P)?(z=s[P])!=null?z:s[P]={}:(D=o[P])!=null?D:o[P]={}:r;if(!T[w]){if(S.length===0&&(T[w]=A),S.length===1){const[k]=S;(e.contentType===k||k==="Any")&&(T[w]=A)}if(S.length===2){const[k="Any",O="Any"]=S;k==="Mixin"&&e.contentType===O&&(T[w]=A),(e.stickType===k||k==="Any")&&(e.contentType===O||O==="Any")&&(T[w]=A)}if(S.length===3){const[k="Any",O,G]=S;if(O==="Audio"&&e.contentType==="Audio"){const I=e;(I.stickType===k||k==="Any")&&I.data.appearance===G&&(T[w]=A)}}}});const a=(y=e.initialConfig)!=null?y:{},l=Ht({},TM,n.globalConfig,...Object.values(r)),c=Ht({},l,a),h={},u=Object.values(Jt.Five.Mode);s1(s).forEach(([b,A])=>{u.forEach(w=>{(b==="PanoramaLike"&&Vs(w)||b==="ModelLike"&&_i(w))&&(h[w]=Ht({},l,...Object.values(A),a,{_isMerged:!0}))})}),s1(o).forEach(([b,A])=>{const w=h[b];h[b]=Ht({},l,w,...Object.values(A),a,{_isMerged:!0})});const d=Ee(R({},c),{configWithFiveMode:h});return o1(d),Object.values(h).forEach(b=>o1(b)),d._isMerged=!0,d}function a1(e){const n=e.split("?")[0].split(".").pop();return n?n.toLowerCase():""}function gF(e,n){if(!e)return 0;const t=e.observers;if(!n||!t)return console.error("getFloorIndex: invalid arguments: ",{point:n,observer:t}),0;const i=[];t.forEach(s=>{var a,l,c;const o=(l=(a=s.floorIndex)!=null?a:s.floor_index)!=null?l:0;i[o]||(i[o]=[]),i[o].push(xc(s.position,(c=e.options)==null?void 0:c.transform).y)});const r=i.map(s=>s.reduce((o,a)=>o+a,0)/s.length);for(let s=r.length-1;s>0;s--)if(n.y>=r[s])return s;return 0}class Sc{constructor(){v(this,"cache_raycasterDistance",new Map);v(this,"cache_visible",new Map)}clear(){this.cache_visible.clear(),this.cache_raycasterDistance.clear()}static generateCameraTagKey(n,t,i=3){const r=R(R({},t.five.getCurrentState()),n),s=r.mode==="Panorama"?t.workUtil.getObserverPosition(r.panoIndex):t.five.camera.position;return s?[s.x.toFixed(i),s.y.toFixed(i),s.z.toFixed(i),t.id].join(","):void 0}getVisible(n,t,i=1){const r=Sc.generateCameraTagKey(t,n,i);if(r)return this.cache_visible.get(r)}setVisible(n,t,i,r=1){const s=Sc.generateCameraTagKey(t,n,r);s&&this.cache_visible.set(s,i)}}class Yg{constructor(n,t){v(this,"plugin");v(this,"id");v(this,"contentType");v(this,"stickType");v(this,"enabled");v(this,"config");v(this,"data");v(this,"state");v(this,"temporaryState",{visible:!0});v(this,"originPosition");v(this,"position");v(this,"fiveState");v(this,"model");v(this,"matrix");v(this,"screenPosition");v(this,"normal");v(this,"mediaPlane");v(this,"hooks");v(this,"zIndex");v(this,"play");v(this,"pause");v(this,"tag3DContentSvelte");v(this,"dom");v(this,"contentDom");v(this,"initialConfig");v(this,"computedConfig");v(this,"cache");v(this,"entryFromModel");var l,c,h,u;this.plugin=n;const i=Bg(t);t.stickType=i;const r=JSON.parse(JSON.stringify(t.data)),s=(l=t.initialConfig)!=null?l:t.config?JSON.parse(JSON.stringify(t.config)):{};t.initialConfig=s;const o=hp(t,n.config),a=this.getConfig(t);t.config=a,this.id=(c=t.id)!=null?c:xn(),this.enabled=(h=t.enabled)!=null?h:!0,this.contentType=t.contentType,this.data=(u=a.initialData)!=null&&u.important?Ht(t.data,r,a.initialData):Ht(t.data,a.initialData,r),this.state=R({visible:void 0,unfolded:!this.can("fold")},a.initialState),this.originPosition=t.position,t.originPosition=this.originPosition,this.position=(()=>{const d=t.originPosition;if(!d)return;const f=n.workUtil.transform;return Array.isArray(d)&&d.length===4?d.map(Ft).map(m=>xc(m,f).toArray()):xc(Ft(d),f).toArray()})(),this.matrix=t.matrix?(()=>{const d=new E.Matrix4().fromArray(t.matrix);return d.premultiply(n.workUtil.transform),d.elements})():t.matrix,this.initialConfig=s,this.computedConfig=o,this.stickType=i,this.config=t.config,this.fiveState=t.fiveState,this.normal=t.normal,this.cache=new Sc,this.hooks=new Cn,Object.keys(t).forEach(d=>{this[d]===void 0&&t[d]!==void 0&&(this[d]=t[d])})}get five(){return this.plugin.five}get fiveUtil(){return this.plugin.fiveUtil}get workUtil(){return this.plugin.workUtil}get centerPosition(){const n=zm(this);return lr(...Array.isArray(n)?n:[n])}get currentConfig(){var r,s;const n=hp(this,this.plugin.config,{useCache:!0}),t=this.five.getCurrentState().mode,i=(r=n.configWithFiveMode)==null?void 0:r[t];return(s=i!=null?i:n)!=null?s:{}}get currentVisible(){return!(!this.plugin.state.enabled||!this.plugin.state.visible||!this.enabled||!this.state.visible)}get sharedCache(){return this.plugin.cache}applyVisible(){throw new Error("Method not implemented.")}find(n){return ee(this,null,function*(){var r;const t=this.fiveState;if(!this.fiveState)return;const i=(r=n==null?void 0:n.targetMode)!=null?r:this.five.state.mode;if(i==="Panorama"){const s=t==null?void 0:t.panoIndex;if(kr(s))return;const o=this.workUtil.getObserverPosition(s),a=this.centerPosition.clone().sub(o).normalize();this.five.setState(R({mode:"Panorama",workCode:this.workUtil.workCode,panoIndex:s},zc(a))),yield this.five.ready()}else i==="Mapview"&&(yield $w(this.five,this.centerPosition,n==null?void 0:n.pointConfig))})}blink(n){return ee(this,null,function*(){var a,l,c,h;const t=(a=this.enabled)!=null?a:!0,i=(l=this.state)==null?void 0:l.visible,r=t&&i;r===!1&&(this.state.visible=!0,this.enabled=!0,this.applyVisible(),this.plugin.render(),this.computeRenderType()!=="Mesh"?yield new Promise(u=>ee(this,null,function*(){if(this.dom||this.contentDom){u();return}const d=setInterval(()=>{(this.dom||this.contentDom)&&(u(),clearInterval(d))},16.7)})):this.stickType==="Model"&&!((c=this.model)!=null&&c.object)?yield(h=this.model)==null?void 0:h.promise:this.stickType==="Plane"&&(yield new Promise(u=>ee(this,null,function*(){if(this.mediaPlane){u();return}const d=setInterval(()=>{this.mediaPlane&&(u(),clearInterval(d))},16.7)}))),this.dom&&(this.dom.style.visibility="hidden"),this.contentDom&&(this.contentDom.style.visibility="hidden"));const s=(()=>{var d;const u=[];return u.push(this.dom),this.stickType!=="2DPoint"&&u.push(this.contentDom),u.push((d=this.model)==null?void 0:d.object),u.push(this.mediaPlane),u.filter(Boolean)})();if(!s.length){console.warn("tagDom is empty");return}yield(r?Td:Kw)(s,R({begin:()=>{r===!1&&(this.dom&&(this.dom.style.visibility=""),this.contentDom&&(this.contentDom.style.visibility=""))},updateRender:()=>{this.five.needsRender=!0}},n)).finished,t===!1&&(this.enabled=!1,this.updateVisible()),i===!1&&this.updateVisible(),r===!1&&(this.dom&&(this.dom.style.visibility=""),this.contentDom&&(this.contentDom.style.visibility=""))})}unfold(){}unfoldAndFoldOthers(){}fold(){}enable(){this.enabled=!0,this.hooks.emit("enable"),this.applyVisible()}disable(){this.enabled=!1,this.hooks.emit("disable"),this.applyVisible()}changeData(n,t=!0){return this.setData(n,t)}changePosition(n){return this.setPosition(n)}setData(n,t=!0){t?this.data=Ht(this.data,n):this.data=R(R({},this.data),n),this.hooks.emit("dataChanged",this.data)}setPosition(n){throw new Error("Method not implemented.")}set(n,t=!0){this.plugin.tagsLengthWillUpdate=!0,t?Ht(this,n):Object.assign(this,n),this.cache.clear()}updateConfig(){var i;const n=this.getConfig(void 0,{useCache:!1});this.computedConfig=n;const t=this.getConfig();if(this.config=t,this.config.initialData){const r=JSON.parse(JSON.stringify(this.data));this.data=(i=t.initialData)!=null&&i.important?Ht(this.data,r,t.initialData):Ht(this.data,t.initialData,r)}this.cache.clear()}updateVisible(){this.state.visible=this.getVisible(),this.applyVisible()}updateZIndex(){const n=this.getDistance();this.zIndex=Math.round((1e4-(n!=null?n:0))*100)}getConfig(n,t){var o,a,l;const i=hp(n!=null?n:this,this.plugin.config,{useCache:t==null?void 0:t.useCache}),r=(o=t==null?void 0:t.fiveMode)!=null?o:this.five.getCurrentState().mode,s=(a=i.configWithFiveMode)==null?void 0:a[r];return(l=s!=null?s:i)!=null?l:{}}getDistance(n,t=3){const i=R(R({},this.five.getCurrentState()),n),{panoIndex:r,mode:s}=i,o=s==="Panorama"?this.workUtil.getObserverPosition(r):this.five.camera.position,a=this.centerPosition;return!o||!a?-1:o.distanceTo(a)}getVisible(n){if(!this.enabled||!this.plugin.state.enabled||!this.fiveUtil.model)return!1;const t=R(R({},this.five.getCurrentState()),n);let i=this.cache.getVisible(this,t);return kr(i)&&(i=this.computeVisible(t).value,this.cache.setVisible(this,t,i)),i}getUnfoldedByPanoIndex(n){if(!this.currentVisible)return;const i=this.computeUnfoldedByPanoIndex(n);return i&&this.getUnfoldedByCamera()}getUnfoldedByCamera(){return this.currentVisible?this.computeUnfoldedByCamera():void 0}can(n){const t=this.currentConfig;if(!t||typeof t!="object")return!0;if(n==="show"||n==="hide"){if(!t.visibleConfig||typeof t.visibleConfig!="object")return!0;if(n==="show"&&t.visibleConfig.keep==="hidden"||n==="hide"&&(t.visibleConfig.keep==="visible"||t.visibleConfig.alwaysShowWhenMovePano))return!1}if(n==="fold"||n==="unfold"){if(!t.unfoldedConfig||typeof t.unfoldedConfig!="object")return!0;if(n==="fold"&&t.unfoldedConfig.keep==="unfolded"||n==="unfold"&&t.unfoldedConfig.keep==="folded")return!1}return!0}onClick(n){}computeRenderType(){const n=(()=>{if(this.stickType==="3DPoint")return"Dom";const t=this.getConfig();if(!t||typeof t!="object"||!t.renderType)return;const i=this.data.mediaData;if(!(!i||i.length===0)&&t.renderType==="Mesh"){if(DO(this)){if(i.length===1){if(i[0].type==="Video")return navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&navigator.userAgent.toLowerCase().indexOf("mobile")>-1?"Dom":"Mesh";if(i[0].type==="Image")return a1(i[0].url)==="gif"?"Dom":"Mesh"}}else if($i(this))return i.length===1&&i[0].type==="Image"?a1(i[0].url)==="gif"?"Dom":"Mesh":"BehindDom"}})();return n!=null?n:"Dom"}computeVisible(n){const t=R(R({},this.five.getCurrentState()),n),{panoIndex:i,mode:r}=t,s=[];return(()=>{var c,u,d;const l=(c=this.getConfig().visibleConfig)!=null?c:{};if(typeof l=="function")return{value:l(this.five,{tag:this,distance:this.getDistance(t,void 0)}),checkedList:s,reason:"config function result"};{if(l.keep==="hidden")return{value:!1,checkedList:s,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,checkedList:s,reason:"config.keep is visible"};const f=this.computeVisibleByFiveMode(l,r);if((f==null?void 0:f.value)===!1)return f;if(l.followModelVisibility===!0&&["poincare","aerophoto","sand"].includes(this.workUtil.fromType)&&(r==="Floorplan"||r==="Mapview")){const h=this.computeVisibleByFloorIndex(),{value:m}=h,p=Ps(h,["value"]);if(m===!1)return R({value:!1,checkedList:s,reason:"followModelVisibility check failed"},p)}if(Vs(r)&&l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&i!==void 0){if(s.push("visiblePanoIndex"),Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(i))return{value:!1,checkedList:s,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${i}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&i!==((u=this.fiveState)==null?void 0:u.panoIndex))return{value:!1,checkedList:s,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${i}, tag.panoIndex: ${(d=this.fiveState)==null?void 0:d.panoIndex}`}}if(l.visibleDistance!==void 0&&(s.push("visibleDistance"),l.visibleDistance!=="unLimited")){const m=this.getDistance(t,1);if(Kh(m,l.visibleDistance)===!1)return{value:!1,checkedList:s,panoIndex:i,visibleDistance:l.visibleDistance,reason:`distance is not in visibleDistance. distance: ${m}, visibleDistance: ${l.visibleDistance.min} - ${l.visibleDistance.max}`}}if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s.push("intersectRaycaster"),i===void 0)return{value:!1,checkedList:s,reason:`intersectRaycaster check failed: panoIndex is ${i}`};const m=this.computeVisibleByIntersect(i);if(m.value===!1)return Object.assign(m,{checkedList:s})}return{value:!0,checkedList:s,reason:"all check passed"}}})()}computeVisibleByFiveMode(n,t){const i=()=>{var o,a;let s=typeof n.visibleFiveMode=="function"?n.visibleFiveMode(this):n.visibleFiveMode;if(s||(s=(a=(o=this.fiveState)==null?void 0:o.mode)!=null?a:this.workUtil.observers.length?"Panorama":"ModelLike"),Array.isArray(s))return s.includes(t);if(s==="ModelLike")return _i(t);if(s==="PanoramaLike")return!Vs(t);if(s==="all")return!0;if(typeof s=="string")return s===t};if((()=>{var o;const s=i();if(bt((o=this.fiveState)==null?void 0:o.panoIndex)&&n.entryFromModel){if(_i(t)&&s?this.entryFromModel=!1:this.entryFromModel=!0,_i(t))return!0}else this.entryFromModel=!1;return s})()===!1)return{value:!1,reason:"current mode is not included in visibleFiveMode",visibleFiveMode:n.visibleFiveMode,mode:t}}computeVisibleByIntersect(n){var l,c,h,u;const t=so(so((l=this.getConfig().visibleConfig)!=null?l:{}).intersectRaycaster),i=n!=null?n:this.five.getCurrentState().panoIndex,r=Vs(this.five.getCurrentState().mode)?this.workUtil.getObserverPosition(i):this.five.camera.position;if(r===void 0)return{value:!1,reason:{type:"startPosition is undefined",fivePanoIndex:i}};const s=zr((()=>{var f;const d=(f=t.checkPoints)!=null?f:"center";return d==="center"?Qb(this):d==="corner"?zm(this):Array.isArray(d)?d:[]})());let o=0,a=0;for(const d of s){const f=new E.Vector3().subVectors(d,r).normalize();let m;rs.set(r,f);const[p]=this.fiveUtil.model.intersectRaycaster(rs);m=p==null?void 0:p.distance;const g=(()=>{if(!$i(this))return;const x=this.plugin.tags.filter($i).map(P=>{var S;return(S=P.model)==null?void 0:S.object}).filter(bt),[M]=rs.intersectObjects(x,!0);return M})(),y=r.distanceTo(d),b=(c=t.distanceAccuracy)!=null?c:.01;m=Math.min(m!=null?m:1/0,(h=g==null?void 0:g.distance)!=null?h:1/0),m+b>=y?o++:a++;const w=(u=t.needPassed)!=null?u:1;if(o>=w)return{value:!0}}return a===0?{value:!0}:{value:!1,reason:{type:"intersectRaycaster check failed",passedCount:o,needPassed:t.needPassed,model:this.fiveUtil.model.name}}}computeVisibleByFloorIndex(){var r,s,o,a,l,c,h;let n=0;const t=(r=this.fiveState)==null?void 0:r.panoIndex;t!==void 0?n=(s=this.workUtil.getObserver(t))==null?void 0:s.floorIndex:n=gF(this.workUtil.work,(h=(c=(a=(o=this.model)==null?void 0:o.object)==null?void 0:a.position)!=null?c:(l=this.mediaPlane)==null?void 0:l.position)!=null?h:Qb(this));const i=this.fiveUtil.model.shownFloor;return{value:i===null||i===n,currentFiveFloorIndex:i,tagFloorIndex:n}}computeUnfoldedByPanoIndex(n){const t=this.getConfig().unfoldedConfig;if(t){if(typeof t=="function")return t(this.five,{tag:this,distance:this.getDistance({panoIndex:n})});if(t.keep==="folded")return!1;if(t.keep==="unfolded")return!0;if(t.unfoldDistance&&Kh(this.getDistance({panoIndex:n}),t.unfoldDistance)===!1)return!1}}computeUnfoldedByCamera(){var t;if(this.entryFromModel&&_i(this.five.state.mode))return!1;const n=this.getConfig().unfoldedConfig;if(n){if(typeof n=="function")return n(this.five,{tag:this,distance:this.getDistance()});if(n.keep==="folded")return!1;if(n.keep==="unfolded")return!0;if(n.autoUnfold===void 0||n.autoUnfold===!1||n.autoUnfold.enable===!1||!n.autoUnfold.strategy)return;if(n.autoUnfold.strategy==="ScreenPostion"){const i=this.computeTagProject();if(i&&Kh(i.x,n.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(n.autoUnfold.strategy==="MinimumDistance"){const s=this.plugin.filterPointTag.filter(a=>a.currentVisible).filter(a=>{const l=this.computeTagProject();if(!l)return!1;const{x:c,y:h,z:u}=l;return!(Math.abs(u)>1||Math.abs(c)>1||Math.abs(h)>1)}).map(a=>({tag:a,id:a.id,tagConfig:a.getConfig().unfoldedConfig})).filter(({tagConfig:a})=>{var l,c;return!(typeof a=="function"||a.keep||a.autoUnfold===!1||((l=a.autoUnfold)==null?void 0:l.enable)===!1||((c=a.autoUnfold)==null?void 0:c.strategy)!=="MinimumDistance")}).map(a=>Ee(R({},a),{distance:a.tag.getDistance()})).filter(({distance:a,tagConfig:l})=>{const c=l.autoUnfold.distance;return!(c&&Kh(a,c)===!1)}).sort((a,l)=>a.distance-l.distance).findIndex(a=>a.id===this.id);if(s===-1||s<=((t=n.autoUnfold.maxNumber)!=null?t:1)-1===!1)return!1}return n.autoUnfold.strategy!=="FoldWhenMove"}}computeTagProject(){const n=this.centerPosition;if(!n)return;const{x:t,y:i,z:r}=n.project(this.five.camera);if(!(r>1))return{x:t,y:i,z:r}}addObjectClickHandler(n,t,i){if(!t||!this.plugin.domEvents)return()=>{};const r=()=>!(!n.currentVisible||n.loading),s=o=>{if(!r())return!1;i(o.origDomEvent)};return this.plugin.domEvents.addEventListener(t,"click",s),()=>{var o;(o=this.plugin.domEvents)==null||o.removeEventListener(t,"click",s)}}whyHide(){var t;if(!this.plugin.state.enabled)return{reason:`plugin.state.enabled is ${this.plugin.state.enabled}`};if(!this.plugin.state.visible)return{reason:`plugin.state.visible is ${this.plugin.state.visible}`};if(!this.enabled)return{reason:`tag ${this.id} enabled is: ${this.enabled}`};const n=Ee(R({},this.computeVisible()),{tagInstance:this});return n.value!==this.state.visible?{reason:"插件故障,请联系维护人员, err: 0",info:n}:this.state.visible?{reason:"应该是能看见才对",info:n}:n.value===!0?{reason:"插件故障,请联系维护人员, err: 1",info:n}:{reason:(t=n.reason.type)!=null?t:n.reason,info:n}}destroy(){const n=this.plugin.tags.findIndex(t=>t.id===this.id);if(n===-1){console.warn(`Destroy failed: tag ${this.id} not found`);return}this.disable(),this.hooks.off(),this.cache.clear(),this.plugin.tags.splice(n,1),this.plugin.tagsLengthWillUpdate=!0,this.plugin.hooks.emit("tagsLengthChange")}}class RM extends Yg{constructor(t,i){super(t,i);v(this,"loading",!1);v(this,"loadModel",()=>ee(this,null,function*(){var o;const t=this.data.modelUrl;if(!t)return;this.loading=!0;const i=hF(t).then(a=>ee(this,null,function*(){var h;const l=Object.assign(a.scene,{customID:this.id,isTagModel:!0,removeEventListener:this.getConfig().clickable===!1?()=>{}:this.addObjectClickHandler(this,a.scene,u=>{this.plugin.hooks.emit("click",{target:"TagModel",tag:this,event:u})})});return l.visible=this.currentVisible,new E.Matrix4().fromArray(this.matrix).decompose(l.position,l.quaternion,l.scale),l.updateWorldMatrix(!0,!0),l.visible=yield this.getVisible(),(h=this.getConfig().modelConfig)!=null&&h.autoLookAtEnabled&&l.lookAt(this.five.camera.position.clone().setY(l.position.y)),l}));this.model={promise:i};const r=yield i;if(this.loading=!1,((o=this.model)==null?void 0:o.promise)!==i||!this.plugin.tags.includes(this))return;this.model.object=r;const s=this.plugin.gltfObjectGroup.children.find(a=>a.customID===this.id);if(s&&(this.plugin.gltfObjectGroup.remove(s),s.removeEventListener()),this.plugin.updateRender3DDomTag(),$i(this)){if(this.computeRenderType()==="Mesh"&&!this.mediaPlane){const a=this.data.mediaPosition.map(os);this.mediaPlane=new SM(this.data.mediaData[0].url,this.data.mediaPosition.map(os),{objectFit:this.data.objectFit});const l=new E.Vector3().addVectors(a[0],a[2]).divideScalar(2);this.mediaPlane.position.copy(l),r.add(this.mediaPlane)}this.computeRenderType()!=="Mesh"&&(r.updateTagCss3DObjectMatrix=()=>this.plugin.updateTagCss3DObjectMatrix(this,r),r.updateTagCss3DObjectMatrix())}return this.plugin.gltfObjectGroup.add(r),r}));this.state.unfolded=!0}applyVisible(){var t,i,r;(t=this.model)!=null&&t.object&&(this.model.object.visible=this.currentVisible),(i=this.tag3DContentSvelte)==null||i.svelteApp.$set({tag:this,state:this.plugin.state}),(r=this.tag3DContentSvelte)==null||r.css3DInstance.setVisible(this.currentVisible)}computeNormal(){return sM(this.data.mediaPosition)}}function vF(e){Ue(e,"svelte-elzzn6",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAF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gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-elzzn6{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif;transition:opacity 0.2s linear}.content__container.unClickable.svelte-elzzn6{pointer-events:none !important}.content__container.unClickable.svelte-elzzn6 *{pointer-events:none !important}.content__wrapper.svelte-elzzn6{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-elzzn6{opacity:0;pointer-events:none}.content__container.hide.svelte-elzzn6 *{pointer-events:none !important}.content__container.disable.svelte-elzzn6{display:none}.content.svelte-elzzn6{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-elzzn6:not(.unfolded){pointer-events:none}.content.svelte-elzzn6:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-elzzn6{pointer-events:auto}')}function yF(e){let n,t;return{c(){n=j("div"),_(n,"data-info","tag content is keep folded"),_(n,"data-id",t=e[0].id)},m(i,r){Z(i,n,r)},p(i,r){r&1&&t!==(t=i[0].id)&&_(n,"data-id",t)},i:de,o:de,d(i){i&&Y(n)}}}function bF(e){let n,t,i,r,s,o,a,l,c,h,u,d,f,m,p,g,y;const b=[_F,PF,CF,EF,MF,xF,wF],A=[];function w(x,M){return M&9&&(r=null),M&9&&(s=null),M&9&&(o=null),M&9&&(a=null),M&9&&(l=null),M&9&&(c=null),M&9&&(h=null),r==null&&(r=!!(["Text"].includes(x[0].contentType)||["Text"].includes(x[3].get(x[0].contentType)))),r?0:(s==null&&(s=!!(["ImageText","Image","Video"].includes(x[0].contentType)||["ImageText","Image","Video"].includes(x[3].get(x[0].contentType)))),s?1:(o==null&&(o=!!(["Audio"].includes(x[0].contentType)||["Audio"].includes(x[3].get(x[0].contentType)))),o?2:(a==null&&(a=!!(["Marketing"].includes(x[0].contentType)||["Marketing"].includes(x[3].get(x[0].contentType)))),a?3:(l==null&&(l=!!(["Link","VRLink","PanoLink","Sticker"].includes(x[0].contentType)||["Link","VRLink","PanoLink","Sticker"].includes(x[3].get(x[0].contentType)))),l?4:(c==null&&(c=!!(["MediaPlane","MediaModel"].includes(x[0].contentType)||["MediaPlane","MediaModel"].includes(x[3].get(x[0].contentType)))),c?5:(h==null&&(h=!!(["Panorama"].includes(x[0].contentType)||["Panorama"].includes(x[3].get(x[0].contentType)))),h?6:-1))))))}return~(u=w(e,-1))&&(d=A[u]=b[u](e)),{c(){var x;n=j("div"),t=j("div"),i=j("div"),d&&d.c(),_(i,"class","content svelte-elzzn6"),Ce(i,"unfolded",(x=e[0].state)==null?void 0:x.unfolded),_(t,"class","content__wrapper svelte-elzzn6"),_(n,"class",f=on(qn("content__container",e[0].className))+" svelte-elzzn6"),_(n,"data-id",m=e[0].id),Ce(n,"disable",e[0].enabled===!1),Ce(n,"hide",e[5]),Ce(n,"unClickable",e[0].config.clickable===!1),W(n,"width",e[0].stickType==="Plane"||e[0].contentType==="MediaModel"?"100%":0),W(n,"height",e[0].stickType==="Plane"||e[0].contentType==="MediaModel"?"100%":0)},m(x,M){Z(x,n,M),Q(n,t),Q(t,i),~u&&A[u].m(i,null),e[16](n),p=!0,g||(y=ot(n,"click",e[17],!0),g=!0)},p(x,M){var S;let P=u;u=w(x,M),u===P?~u&&A[u].p(x,M):(d&&(Ve(),X(A[P],1,1,()=>{A[P]=null}),Ge()),~u?(d=A[u],d?d.p(x,M):(d=A[u]=b[u](x),d.c()),F(d,1),d.m(i,null)):d=null),(!p||M&1)&&Ce(i,"unfolded",(S=x[0].state)==null?void 0:S.unfolded),(!p||M&1&&f!==(f=on(qn("content__container",x[0].className))+" svelte-elzzn6"))&&_(n,"class",f),(!p||M&1&&m!==(m=x[0].id))&&_(n,"data-id",m),(!p||M&1)&&Ce(n,"disable",x[0].enabled===!1),(!p||M&33)&&Ce(n,"hide",x[5]),(!p||M&1)&&Ce(n,"unClickable",x[0].config.clickable===!1),M&1&&W(n,"width",x[0].stickType==="Plane"||x[0].contentType==="MediaModel"?"100%":0),M&1&&W(n,"height",x[0].stickType==="Plane"||x[0].contentType==="MediaModel"?"100%":0)},i(x){p||(F(d),p=!0)},o(x){X(d),p=!1},d(x){x&&Y(n),~u&&A[u].d(),e[16](null),g=!1,y()}}}function AF(e){let n,t,i,r,s,o,a;return t=new lF({props:{tag:nn(e[0]),rendererMap:e[2]}}),{c(){n=j("div"),Ie(t.$$.fragment),_(n,"class",i=on(qn("content__container",e[0].className))+" svelte-elzzn6"),_(n,"data-id",r=e[0].id),Ce(n,"custom-tag-disable",e[0].enabled===!1),Ce(n,"custom-tag-hide",e[5])},m(l,c){Z(l,n,c),_e(t,n,null),e[14](n),s=!0,o||(a=ot(n,"click",e[15]),o=!0)},p(l,c){const h={};c&1&&(h.tag=nn(l[0])),c&4&&(h.rendererMap=l[2]),t.$set(h),(!s||c&1&&i!==(i=on(qn("content__container",l[0].className))+" svelte-elzzn6"))&&_(n,"class",i),(!s||c&1&&r!==(r=l[0].id))&&_(n,"data-id",r),(!s||c&1)&&Ce(n,"custom-tag-disable",l[0].enabled===!1),(!s||c&33)&&Ce(n,"custom-tag-hide",l[5])},i(l){s||(F(t.$$.fragment,l),s=!0)},o(l){X(t.$$.fragment,l),s=!1},d(l){l&&Y(n),Se(t),e[14](null),o=!1,a()}}}function wF(e){let n,t;return n=new iF({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function xF(e){let n,t;return n=new zN({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function MF(e){let n,t;return n=new $N({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function EF(e){let n,t;return n=new cN({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function CF(e){let n,t;return n=new LN({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function PF(e){let n,t;return n=new sN({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function _F(e){let n,t;return n=new Ez({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function SF(e){let n,t,i,r,s;const o=[AF,bF,yF],a=[];function l(c,h){return h&5&&(n=null),n==null&&(n=!!(c[0].element||c[2].has(c[0].contentType))),n?0:c[4]?1:2}return t=l(e,-1),i=a[t]=o[t](e),{c(){i.c(),r=ft()},m(c,h){a[t].m(c,h),Z(c,r,h),s=!0},p(c,[h]){let u=t;t=l(c,h),t===u?a[t].p(c,h):(Ve(),X(a[u],1,1,()=>{a[u]=null}),Ge(),i=a[t],i?i.p(c,h):(i=a[t]=o[t](c),i.c()),F(i,1),i.m(r.parentNode,r))},i(c){s||(F(i),s=!0)},o(c){X(i),s=!1},d(c){a[t].d(c),c&&Y(r)}}}function IF(e,n,t){let i,r,s,o,a,l,{tag:c}=n,{hooks:h}=n,{rendererMap:u=new Map}=n,{contentTypeMap:d=new Map}=n,{state:f}=n,{mediaStore:m}=n,{temporaryState:p}=n;Em("hooks",h),Em("mediaStore",m);let g,y;function b(S){S?h.emit("exposure",{id:o,type:"start"}):h.emit("exposure",{id:o,type:"end"})}function A(S,T,z){var D,k;return!(!T.visible||!T.enabled||!z.visible||!((D=S.state)!=null&&D.visible)||((k=S.temporaryState)==null?void 0:k.visible)===!1||S instanceof RM&&S.loading)}function w(S){Qt[S?"unshift":"push"](()=>{c.contentDom=S,t(0,c)})}const x=S=>h.emit("click",{event:S,target:"TagContent",tag:c});function M(S){Qt[S?"unshift":"push"](()=>{c.contentDom=S,t(0,c)})}const P=S=>{c.entryFromModel&&_i(c.five.state.mode)?(S.stopPropagation(),c.find({targetMode:"Panorama"})):h.emit("click",{event:S,target:"TagContent",tag:c})};return e.$$set=S=>{"tag"in S&&t(0,c=S.tag),"hooks"in S&&t(1,h=S.hooks),"rendererMap"in S&&t(2,u=S.rendererMap),"contentTypeMap"in S&&t(3,d=S.contentTypeMap),"state"in S&&t(6,f=S.state),"mediaStore"in S&&t(7,m=S.mediaStore),"temporaryState"in S&&t(8,p=S.temporaryState)},e.$$.update=()=>{var S,T,z,D,k,O,G,I,U,J,K;e.$$.dirty&1&&t(12,i=(S=c.state)==null?void 0:S.unfolded),e.$$.dirty&1&&t(11,r=(T=c.state)==null?void 0:T.visible),e.$$.dirty&321&&t(13,s=f.visible&&p.visible&&((z=c.state)==null?void 0:z.visible)),e.$$.dirty&1&&(o=c.id),e.$$.dirty&321&&t(5,a=!A(c,f,p)),e.$$.dirty&8192&&b(s),e.$$.dirty&7681&&c.hooks&&(i!==void 0&&i!==y&&(t(10,y=i),i?(k=(D=c.hooks).emit)==null||k.call(D,"unfolded"):(G=c==null?void 0:(O=c.hooks).emit)==null||G.call(O,"folded")),r!==void 0&&r!==g&&(t(9,g=r),r?(U=(I=c.hooks).emit)==null||U.call(I,"show"):(K=(J=c.hooks).emit)==null||K.call(J,"hide"))),e.$$.dirty&1&&t(4,l=(()=>!(typeof c.config.unfoldedConfig=="object"&&c.config.unfoldedConfig.keep==="folded"))())},[c,h,u,d,l,a,f,m,p,g,y,r,i,s,w,x,M,P]}let OM=class extends ke{constructor(n){super(),Le(this,n,IF,SF,De,{tag:0,hooks:1,rendererMap:2,contentTypeMap:3,state:6,mediaStore:7,temporaryState:8},vF)}};const TF={globalConfig:{visibleConfig:{followModelVisibility:!0},unfoldedConfig:{autoUnfold:{enable:!0,strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"[Mapview]":{unfoldedConfig:{autoUnfold:{enable:!1,distance:{max:9999}}}},"[Floorplan]":{unfoldedConfig:{autoUnfold:{enable:!1,distance:{max:9999}}}},"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"}},Link:{unfoldedConfig:{keep:"unfolded"}},Panorama:{unfoldedConfig:{keep:"unfolded"}},VRLink:{unfoldedConfig:{keep:"unfolded"}},PanoLink:{unfoldedConfig:{keep:"unfolded"}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0},initialData:{autoplayConfig:{autoplayCarousel:!0,autoplayVideo:!1,autoplayVideoInCarousel:!1}}},"Model-Any":{unfoldedConfig:{keep:"unfolded"},visibleConfig:{visibleFiveMode:"all",alwaysShowWhenMovePano:!0}}}};class l1 extends E.Raycaster{intersectObject(n,t=!0,i=[]){return Nm(n,this,i,t),i.sort(c1),i}intersectObjects(n,t=!0,i=[]){for(let r=0,s=n.length;r<s;r++)Nm(n[r],this,i,t);return i.sort(c1),i}}function c1(e,n){return e.distance-n.distance}function Nm(e,n,t,i){let r=!0;if(e.layers.test(n.layers)&&e.raycast(n,t)===!1&&(r=!1),r===!0&&i===!0){const s=e.children;for(let o=0,a=s.length;o<a;o++)Nm(s[o],n,t,!0)}}function Xg(e,n,t,i){let r=!0;if(e.type!=="Line2"&&(e.layers.test(n.layers)&&e.raycast(n,t)===!1&&(r=!1),r===!0&&i===!0)){const s=e.children;for(let o=0,a=s.length;o<a;o++)s[o].type!=="Line2"&&Xg(s[o],n,t,!0)}}class Zg{constructor(n,t){v(this,"five");v(this,"dragging",!1);v(this,"boundObject",{});v(this,"config");v(this,"lastMouseDownEvent");v(this,"lastTouchEvent");v(this,"handleWantsGesture",(n,t)=>{if(t.length!==1)return;const i=t[0];if(i.raycaster){const r=new l1;r.ray=i.raycaster.ray,r.near=i.raycaster.near,r.far=i.raycaster.far,r.camera=i.raycaster.camera,r.layers=i.raycaster.layers,r.params=i.raycaster.params,i.raycaster=r}if(i){if(n==="mouseMove"&&this.onDomEvent("hover",i),n==="tap"){let r;!r&&!Pc&&(r=this.lastMouseDownEvent),!r&&Pc&&(r=this.lastTouchEvent),r||(r=new MouseEvent("click",{clientX:i.x,clientY:i.y}));const s=this.onDomEvent("click",i,r),o=this.onDomEvent("wantDblclick",i,r,this.boundObject.dblclick);if(s===!1||o===!1)return!1}if(this.dragging)return!1}});v(this,"handleDomEvent",(n,t,i)=>{const r={x:t.clientX,y:t.clientY};this.onDomEvent(n,r,t,i)});v(this,"handleMouseEvent",n=>{this.handleDomEvent(n.type,n)});v(this,"handleMousedown",n=>{this.lastMouseDownEvent=n,this.handleDomEvent("mousedown",n),this.handleDomEvent("dragstart",n,this.haveDragEventObject)});v(this,"handleTouchStart",n=>{this.lastTouchEvent=n});v(this,"handleMouseup",n=>{var t;this.dragging=!1,(t=this.haveDragEventObject)==null||t.forEach(i=>{i._dragging&&(i._dragging=!1,this.notify({eventName:"dragend",object:i,originEvent:n,raycaster:this.getRaycaster({x:n.clientX,y:n.clientY})}))}),this.handleDomEvent("mouseup",n)});v(this,"handleMousemove",n=>{var t;this.dragging&&((t=this.boundObject.drag)==null||t.forEach(i=>{i._dragging&&this.notify({eventName:"drag",object:i,originEvent:n,raycaster:this.getRaycaster({x:n.clientX,y:n.clientY})})}))});v(this,"onDomEvent",(n,t,i,r=this.boundObject[n])=>{var d,f,m,p,g;if(!t||!r||(r==null?void 0:r.length)===0)return;const s=[];((d=this.config)==null?void 0:d.fiveModels)!==null&&((f=this.config)!=null&&f.fiveModels?s.push(...this.config.fiveModels):s.push(this.model));const o=s.filter(y=>y.loaded),a=(m=t.raycaster)!=null?m:this.getRaycaster(t);a.params.Points.threshold=.02;const l=a.intersectObjects(r,!0),c=[];o.forEach(y=>{const b=y.intersectRaycaster(a);c.push(...b)});const h=.01;if(c.length>0&&l.length>0&&c[0].distance+h<l[0].distance)return;const u=(p=l==null?void 0:l[0])==null?void 0:p.object;if(n==="wantDblclick")return!1;if((!u||!this.objectIsBound(u))&&n==="hover")for(const y of(g=this.boundObject.hover)!=null?g:[])y._hovered&&this.notify({eventName:"unHover",object:y});if(u&&u&&this.notify({eventName:n,object:u,originEvent:i,raycaster:a,intersects:l}))return!1});v(this,"objectIsBound",n=>{let t=n._domEvent,i=n.parent;for(;typeof t=="undefined"&&i;)t=i._domEvent,i=i.parent;return!!t});v(this,"notify",n=>{var d,f,m;const{eventName:t,object:i,originEvent:r,raycaster:s,intersects:o}=n;let a=!1,l=[];const c=[];let h=i;for(c.push(h);h.parent;)h=h.parent,c.push(h);const u=c.at(-1);if(!((d=this.config)!=null&&d.noEmitWhenNotInScene&&u.type!=="Scene")){for(const p of c){if(a)break;p.draggable&&(t==="dragstart"&&(p._dragging=!0,this.dragging=!0),t==="dragend"&&(p._dragging=!1,this.dragging=!1));const g=p._domEvent;if(!g)continue;const y=g[`${t}Handler`];if(y)for(const[b,A]of y){if(A!=null&&A.noEmitWhenNotInScene&&u.type!=="Scene"||((f=this.config)!=null&&f.noEmitWhenHide||A!=null&&A.noEmitWhenHide)&&!Xm(p))continue;if(t==="hover"){if(p._hovered)continue;p._hovered=!0;for(const x of(m=this.boundObject.hover)!=null?m:[])x!==p&&x._hovered&&this.notify({eventName:"unHover",object:x})}if(t==="unHover"){if(!p._hovered)continue;p._hovered=!1}const w=b({type:t,target:p,origDomEvent:r,raycaster:s,intersects:o,stopPropagation:()=>{a=!0}});l.push(w!=null?w:!0)}}if(t==="click"||t==="wantDblclick")return l.some(p=>p===!0)}});this.five=n,this.config=t,n.on("wantsGesture",this.handleWantsGesture),document.addEventListener("mousedown",this.handleMousedown),document.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("dblclick",this.handleMouseEvent),document.addEventListener("mouseup",this.handleMouseup),document.addEventListener("mousemove",this.handleMousemove)}get haveDragEventObject(){return[...new Set([this.boundObject.dragend,this.boundObject.drag,this.boundObject.dragstart].flat())].filter(Boolean)}get model(){return ki(this.five)}addAutoBindEventListener(n,t,i,r){const s=()=>this.addEventListener(n,t,i,r),o=()=>this.removeEventListener(n,t,i,r);return n.addEventListener("added",s),n.addEventListener("removed",o),n.addEventListener("dispose",o),()=>{n.removeEventListener("added",s),n.removeEventListener("removed",o),n.removeEventListener("dispose",o)}}addEventListener(n,t,i,r){n._domEvent||(n._domEvent={}),n._domEvent[`${t}Handler`]||(n._domEvent[`${t}Handler`]=[]),this.boundObject[t]||(this.boundObject[t]=[]),this.boundObject[t].includes(n)||this.boundObject[t].push(n),n._domEvent[`${t}Handler`].push([i,R({noEmitWhenHide:!1,noEmitWhenNotInScene:!1},r)])}removeEventListener(n,t,i,...r){var o,a;if(!n._domEvent||(t===void 0&&(Object.keys(this.boundObject).forEach(l=>{var h,u;const c=(h=this.boundObject[l])==null?void 0:h.findIndex(d=>d===n);c!==-1&&((u=this.boundObject[l])==null||u.splice(c,1))}),n._domEvent={}),!n._domEvent[`${t}Handler`]))return;if(i===void 0){delete n._domEvent[`${t}Handler`];return}const s=n._domEvent[`${t}Handler`].findIndex(l=>l[0]===i);if(s!==-1&&(n._domEvent[`${t}Handler`].splice(s,1),n._domEvent[`${t}Handler`].length===0&&delete n._domEvent[`${t}Handler`],n._domEvent&&Object.keys(n._domEvent).length===0&&delete n._domEvent,!n._domEvent)){const l=(o=this.boundObject[t])==null?void 0:o.findIndex(c=>c===n);l!==-1&&((a=this.boundObject[t])==null||a.splice(l,1))}}clear(){this.boundObject={}}dispose(){var n;(n=this.five)==null||n.off("wantsGesture",this.handleWantsGesture),document.removeEventListener("mousedown",this.handleMousedown),document.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("mouseup",this.handleMouseup),document.removeEventListener("mousemove",this.handleMousemove),this.boundObject={}}toJSON(){return{boundObject:this.boundObject}}getRaycaster(n){const t=this.five.getElement();if(!t)return;const i=Yx(n,t),r=new l1;return r.setFromCamera(i,this.five.camera),r}}class DF extends ws{constructor(t){super(t);v(this,"tags",[]);v(this,"cache",new Sc);v(this,"config",TF);v(this,"renderQueue",new Map);v(this,"params");v(this,"mediaStore",Cg({currentMediaElement:null}));v(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});v(this,"domEvents",new Zg(this.five));v(this,"_cache_pointTag");v(this,"_cache_2DPointTag");v(this,"_cache_css3DTag");v(this,"_container",null);v(this,"_css3DRenderPlugin");v(this,"whyHide",t=>{const i=this.getTagById(t);return i?i.whyHide():{reason:`tag ${t} not found`}});v(this,"loadVideoFirstFrame",()=>{fF&&this.hooks.emit("loadVideoFirstFrame")});this.mediaStore.subscribe(({currentMediaElement:i})=>{this.tags.forEach(r=>{var s;if(r.mediaPlane instanceof IM&&i!==r.mediaPlane.videoInstance){if(!((s=r.mediaPlane.videoInstance)!=null&&s.src)||i===r.mediaPlane.videoInstance)return;r.mediaPlane.pause()}})})}get container(){var t;return this._container||((t=this.five.getElement())==null?void 0:t.parentElement)}set container(t){this._container=t}set tagsLengthWillUpdate(t){t&&(this._cache_pointTag=this.tags.filter(i=>i.stickType==="2DPoint"||i.stickType==="3DPoint").filter(i=>i.position),this._cache_2DPointTag=this.tags.filter(i=>i.stickType==="2DPoint").filter(i=>i.position),this._cache_css3DTag=this.tags.filter(i=>i.stickType==="3DPoint"||i.stickType==="Plane"||i.stickType==="Model"&&i.contentType==="MediaModel").filter(i=>{const r=i.computeRenderType();return r==="BehindDom"||r==="Dom"}))}get css3DRenderPlugin(){var t,i,r;if(!this._css3DRenderPlugin){const s=Nc(this.five);this._css3DRenderPlugin=s,(t=s.frontModeCSS3DRenderer)!=null&&t.domElementWrapper&&(s.frontModeCSS3DRenderer.domElementWrapper.style.zIndex=(r=(i=this.params.containerZIndex)==null?void 0:i.toString())!=null?r:"")}return this._css3DRenderPlugin}get filterPointTag(){var t;return(t=this._cache_pointTag)!=null?t:[]}get filter2DPointTag(){var t;return(t=this._cache_2DPointTag)!=null?t:[]}get filterCSS3DTag(){var t;return(t=this._cache_css3DTag)!=null?t:[]}addRenderQueue(t){var o,a;const{type:i,keys:r=[],tags:s=[]}=t;this.renderQueue.has(i)?this.renderQueue.set(i,{keys:Array.from(new Set([...(o=this.renderQueue.get(i).keys)!=null?o:[],...r])),tags:Array.from(new Set([...(a=this.renderQueue.get(i).tags)!=null?a:[],...s]))}):this.renderQueue.set(i,{keys:r,tags:s})}getTagById(t){const i=this.tags.find(r=>r.id===t);if(!i){console.warn(`getTagById Error: can't find tag id: ${t}`);return}return i}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}getPositions(t){if(SO(t))return t.position;if($i(t))return t.data.mediaPosition;if(IO(t))return LO(this.five.camera.position,Ft(t.position),Ft(t.normal))}addObjectClickHandler(t,i,r){if(!i||!this.domEvents)return()=>{};const s=()=>!(!t.currentVisible||t.loading),o=a=>{if(!s())return!1;r(a.origDomEvent)};return this.domEvents.addEventListener(i,"click",o),()=>{var a;(a=this.domEvents)==null||a.removeEventListener(i,"click",o)}}checkDisposed(){return this.store.disposed?(console.error("PanoTagPluginController has been disposed"),!0):!1}}class LF extends DF{constructor(t){super(t);v(this,"rendererMap",new Map);v(this,"contentTypeMap",new Map);v(this,"group",new ne.Group);v(this,"imagePlaneGroup",new ne.Group);v(this,"gltfObjectGroup",new ne.Group);v(this,"enabledModelTagSet",new Set);v(this,"temporaryState",{visible:!0});v(this,"TagContainerSvelte");this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.imagePlaneGroup.name="ImagePlaneGroup",this.group.add(this.gltfObjectGroup),this.group.add(this.imagePlaneGroup)}registerRenderer(t,i,r){var s;this.rendererMap.set(t,{renderer:i,usePoint:(s=r==null?void 0:r.usePoint)!=null?s:!1})}bindRenderer(t,i){this.contentTypeMap.set(t,i)}clearTags(){var t;this.tags.length&&(this.tags.forEach(i=>{var r,s,o,a,l;(s=(r=i.mediaPlane)==null?void 0:r.parent)==null||s.remove(i.mediaPlane),(l=(a=(o=i.model)==null?void 0:o.object)==null?void 0:a.parent)==null||l.remove(i.model.object)}),this.tags=[],this.tagsLengthWillUpdate=!0,this.hooks.emit("tagsLengthChange"),(t=this.TagContainerSvelte)==null||t.$destroy(),this.TagContainerSvelte=void 0,this.disposeAllCSS3DContainer()),this.enabledModelTagSet.clear(),this.cache.clear()}updateRender3DDomTag(t){(t?zr(t):this.filterCSS3DTag).forEach(r=>{var s,o,a,l,c,h;if(r.tag3DContentSvelte){const{svelteApp:u,css3DInstance:d,initialNormal:f,currentNormal:m}=r.tag3DContentSvelte;if((o=d==null?void 0:d.css3DObject)==null||o.setVisible((this.state.visible&&((s=r.state)==null?void 0:s.visible))!==!1),u.$set({tag:r,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!f.equals(m)){const p=new ne.Quaternion().setFromUnitVectors(f,m);d.css3DObject.setRotationFromQuaternion(p)}return}else{if($i(r)&&!((a=r.model)!=null&&a.object)||((l=r.state)==null?void 0:l.visible)===!1||!this.state.visible||!this.state.enabled||!this.css3DRenderPlugin)return;if(r.stickType==="3DPoint"&&!r.normal)return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");const u=this.getPositions(r);if(!u)return;const d=r.computeNormal();if(!d)return;const f=r.getConfig(),m=R({wrapperStyle:{zIndex:`${Math.round((1e4-((c=r.getDistance())!=null?c:0))*100)}`}},f.tag3DConfig);if(r.computeRenderType()==="BehindDom"||m.mode==="behind"){m.mode="behind",m.container=document.createElement("div");const y="black";m.container.style.backgroundColor=y,m.container.style.border=`3px solid ${y}`,this.css3DRenderPlugin.hooks.on("render",()=>{var b;if(p.css3DObject.opacityMesh&&f.clickable!==!1){const A=this.addObjectClickHandler(r,p.css3DObject.opacityMesh,w=>{this.hooks.emit("click",{event:w,target:"TagContent",tag:r})});(b=this.store.css3DRenderDisposer.get(r.id))==null||b.push(A)}})}const p=this.css3DRenderPlugin.create3DDomContainer(u,m);if(!p)return;this.store.css3DRenderDisposer.set(r.id,[p.dispose]);const g=new OM({target:p.container,props:{tag:r,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}});r.tag3DContentSvelte={svelteApp:g,domContainer:p,css3DInstance:p,initialNormal:d,currentNormal:d,dispose:()=>{g.$destroy(),p.dispose()}},$i(r)&&((h=r.model)!=null&&h.object)&&this.updateTagCss3DObjectMatrix(r,r.model.object)}}),this.clearUnusedPanelTag()}updateTagCss3DObjectMatrix(t,i){var p,g,y;const r=(g=(p=t.getConfig().tag3DConfig)==null?void 0:p.ratio)!=null?g:.00216,s=(y=t.tag3DContentSvelte)==null?void 0:y.css3DInstance.css3DObject;if(!s)return;const o=$i(t)?t.data.mediaPosition:t.position;if(!o||o.length!==4||!Array.isArray(o[0])||!Array.isArray(o[2]))return;i.updateWorldMatrix(!1,!1);const a=i.matrixWorld,l=new ne.Vector3().fromArray(o[0]),c=new ne.Vector3().fromArray(o[2]),h=lr(l,c).add(new ne.Vector3(0,0,5e-4)),u=new ne.Matrix4().setPosition(h),d=new ne.Matrix4().makeScale(r,r,r),f=new ne.Matrix4().multiply(a).multiply(u).multiply(d);f.decompose(s.position,s.quaternion,s.scale);const m=s.opacityMesh;m&&f.decompose(m.position,m.quaternion,m.scale)}addMediaModelTag(t){return ee(this,null,function*(){const i=t.filter(r=>r.stickType==="Model").map(r=>r.loadModel());yield Promise.all(i),t.forEach(r=>r.updateVisible())})}disposeAllCSS3DContainer(){for(const[,t]of this.store.css3DRenderDisposer)t==null||t.forEach(i=>i==null?void 0:i());this.store.css3DRenderDisposer=new Map}clearUnusedPanelTag(){this.filter2DPointTag.forEach(t=>{var i;(i=t.tag3DContentSvelte)==null||i.css3DInstance.dispose(),t.tag3DContentSvelte=void 0});for(const[t,i]of this.store.css3DRenderDisposer){const r=this.getTagById(t);(!r||r.stickType==="2DPoint")&&(i==null||i.forEach(s=>s==null?void 0:s()),this.store.css3DRenderDisposer.delete(t))}}}class kF{constructor(n){v(this,"plugin");v(this,"logBinded",!1);this.plugin=n}get debug(){return this.plugin.debug}addDebugPoints(){try{_O(this.plugin.five,this.plugin.tags)}catch(n){console.error(n)}}bindLog(){if(this.logBinded)return;this.logBinded=!0;const n=t=>{Object.getOwnPropertyNames(t).forEach(i=>{typeof t[i]=="function"&&(t[i]=new Proxy(t[i],{apply:(r,s,o)=>(["render"].includes(i)||this.addLog(i,...o),r.apply(s,o))}))})};n(this.plugin),n(this.plugin.constructor.prototype)}addLog(n,...t){if(this.debug){let i=new Error().stack;console.debug(`%cPanoTagPlugin%c${n}`,"background-color: #35e0ed; color: black; padding:0 6px; border-radius: 3px","padding: 0 3px; color: #f3f47c",...t,{stack:i})}}closeIntersectRaycaster(){this.plugin.tags.forEach(n=>{var t;so((t=n==null?void 0:n.initialConfig)==null?void 0:t.visibleConfig).intersectRaycaster&&(n.initialConfig.visibleConfig.intersectRaycaster.enabled=!1)}),this.plugin.changeGlobalConfig({visibleConfig:{intersectRaycaster:{enabled:!1}}})}}const RF=new E.Vector2;class OF extends Yg{constructor(t,i){super(t,i);v(this,"__Object__");v(this,"requestIdleCallbackId")}unfoldAndFoldOthers(){const t=this.can("fold"),i=this.can("unfold");t&&i&&(this.state.unfolded=!this.state.unfolded,this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]}),this.state.unfolded&&this.plugin.tags.forEach(r=>{r.id!==this.id&&r.fold()}))}onClick(t){t.target==="TagPoint"&&this.unfoldAndFoldOthers()}updateVisible(){if(typeof window.requestIdleCallback=="undefined"){super.updateVisible();return}const t=()=>{this.requestIdleCallbackId&&cancelIdleCallback(this.requestIdleCallbackId),this.requestIdleCallbackId=requestIdleCallback(()=>{super.updateVisible()})};let i=!1;requestIdleCallback(()=>{i=!0}),t(),setTimeout(()=>{i||(this.requestIdleCallbackId&&cancelIdleCallback(this.requestIdleCallbackId),super.updateVisible())},200)}applyVisible(){var t,i,r,s;this.currentVisible&&this.updateScreenPosition(),(r=(i=(t=this.tag3DContentSvelte)==null?void 0:t.css3DInstance)==null?void 0:i.css3DObject)==null||r.setVisible(this.currentVisible),(s=this.tag3DContentSvelte)==null||s.svelteApp.$set({state:this.plugin.state,temporaryState:this.temporaryState}),this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]})}unfold(){this.setUnfold(!0)}fold(){this.setUnfold(!1)}setUnfold(t){const i=this.can("fold"),r=this.can("unfold");i&&r&&(this.state.unfolded=t,this.hooks.emit(t?"unfolded":"folded"),this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]}))}setPosition(t){this.originPosition=t,this.position=t,this.cache.clear(),this.updateVisible(),this.updateScreenPosition(),this.updateZIndex(),this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]})}updateScreenPosition(t){var a;if(this.stickType!=="2DPoint"&&this.stickType!=="3DPoint")return;const{force:i=!1}=t!=null?t:{},r=i?this.state.visible:this.currentVisible,s=(a=this.__Object__)!=null?a:{timeoutId:void 0,inAnimation:!1};if(this.__Object__=s,!r&&this.screenPosition?(s.inAnimation=!0,s.timeoutId=setTimeout(()=>{requestAnimationFrame(()=>{this.currentVisible||(s.inAnimation=!1,this.screenPosition=null,this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]}))})},1e3)):s.timeoutId&&(clearTimeout(s.timeoutId),s.inAnimation=!1,s.timeoutId=void 0),!r&&!s.inAnimation)return;const o=this.computeTagProject();if(o){const l=(()=>{if(!this.currentConfig.simulate3D)return 1;const h=2*Math.tan(.5*this.five.camera.fov/180*Math.PI),u=this.getDistance(void 0,1);return Math.max(Math.min(1-h*u/40,1),.5)})(),c=this.five.renderer.getSize(RF);this.screenPosition={leftPx:(o.x+1)/2*c.x,topPx:(-o.y+1)/2*c.y,scale:l}}else this.screenPosition=null;this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]})}updateUnfoldedByPanoIndex(){const t=this.getUnfoldedByPanoIndex();if(this.state&&(t!==void 0&&(this.state.unfolded=t),t&&!this.state.visible)){const i=this.getConfig();typeof i.unfoldedConfig=="object"&&i.unfoldedConfig.autoFoldWhenHide!==!1&&(this.state.unfolded=!1)}}computeNormal(){return new E.Vector3().fromArray(this.normal)}}const zF=new Map,BF=new Map;class NF extends Yg{constructor(n,t){super(n,t),this.state.unfolded=!0}applyVisible(){var t,i,r,s,o,a;this.computeRenderType()==="Mesh"?((i=(t=this.data.mediaData)==null?void 0:t[0])==null?void 0:i.type)==="Video"?this.renderVideoPlane():((s=(r=this.data.mediaData)==null?void 0:r[0])==null?void 0:s.type)==="Image"&&this.renderImagePlane():(this.tag3DContentSvelte||this.plugin.updateRender3DDomTag(),(o=this.tag3DContentSvelte)==null||o.svelteApp.$set({tag:this,state:this.plugin.state}),(a=this.tag3DContentSvelte)==null||a.css3DInstance.setVisible(this.currentVisible))}renderVideoPlane(){var a;const n=this.data.mediaData[0];if(!n)return;const{url:t}=n;if(!t)return;const i=this.currentVisible,r=(()=>!!(this.mediaPlane&&!i))(),s=(()=>!!(!this.mediaPlane&&i))(),o=(()=>!!(this.mediaPlane&&this.mediaPlane.src!==t))();if((r||o)&&this.mediaPlane&&(this.plugin.imagePlaneGroup.remove(this.mediaPlane),this.mediaPlane.dispose(),this.mediaPlane.removeFromParent(),this.mediaPlane=void 0),s||o){const l=this.position.map(os),c=new IM(t,l,{videoCoverSrc:n.videoCoverUrl,playButton:this.data.playIcon,paused:!((a=this.data.autoplayConfig)!=null&&a.autoplayVideo),objectFit:this.data.objectFit,videoTextureMap:zF,ImageTextureMap:BF,domEvents:this.plugin.domEvents});c.onVideoReady=u=>{u.addEventListener("play",()=>this.plugin.mediaStore.set({currentMediaElement:c.videoInstance}))};const h=u=>(this.five.on("renderFrame",u),()=>this.five.off("renderFrame",u));c.initialRenderHooks(h),this.mediaPlane=c,this.play=()=>c.play(),this.pause=()=>c.pause(),this.plugin.imagePlaneGroup.add(this.mediaPlane)}this.five.needsRender=!0}renderImagePlane(){const n=this.data.mediaData[0];if(!n)return;const{url:t}=n;if(!t)return;const i=this.position.map(os),r=this.currentVisible,s=(()=>!!(this.mediaPlane&&!r))(),o=(()=>!!(!this.mediaPlane&&r))(),a=(()=>!!(this.mediaPlane&&this.mediaPlane.src!==t))();(s||a)&&this.mediaPlane&&(this.plugin.imagePlaneGroup.remove(this.mediaPlane),this.mediaPlane.dispose(),this.mediaPlane.removeFromParent(),this.mediaPlane=void 0),(o||a)&&(this.mediaPlane=new SM(t,i,{objectFit:this.data.objectFit}),this.getConfig().clickable!==!1&&this.plugin.domEvents.addAutoBindEventListener(this.mediaPlane,"click",l=>{this.plugin.hooks.emit("click",{tag:this,target:"TagContent",event:l.origDomEvent})},{noEmitWhenHide:!0}),this.plugin.imagePlaneGroup.add(this.mediaPlane)),this.five.needsRender=!0}computeNormal(){return sM(this.position)}}function FF(e){Ue(e,"svelte-7aiuwz",'@charset "UTF-8";.tag-point-click-helper.svelte-7aiuwz.svelte-7aiuwz{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-7aiuwz.svelte-7aiuwz{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.tag-folded-point.svelte-7aiuwz.svelte-7aiuwz,.tag-unfolded-point.svelte-7aiuwz.svelte-7aiuwz{transition:all 0.5s}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-7aiuwz .tag-folded-point.svelte-7aiuwz{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-7aiuwz .tag-folded-point.svelte-7aiuwz{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{opacity:1;scale:1}')}function VF(e){let n,t,i,r,s,o,a,l,c,h,u,d;return r=new Bi({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new CM({props:{icon:e[2],width:e[1]}}),c.$on("iconLoaded",e[7]),{c(){n=j("div"),t=j("div"),i=ve(),Ie(r.$$.fragment),s=ve(),o=j("div"),a=ve(),l=j("div"),Ie(c.$$.fragment),_(t,"class","tag-point-click-helper svelte-7aiuwz"),_(o,"class","tag-unfolded-point svelte-7aiuwz"),W(o,"transition-delay",(e[3]?e[5]:0)+"ms"),_(l,"class","tag-folded-point svelte-7aiuwz"),W(l,"transition-delay",(e[3]?e[5]:0)+"ms"),_(n,"class","tag-point-wrapper svelte-7aiuwz"),Ce(n,"unfolded",e[0]),Ce(n,"folded",e[3])},m(f,m){Z(f,n,m),Q(n,t),Q(n,i),_e(r,n,null),Q(n,s),Q(n,o),Q(n,a),Q(n,l),_e(c,l,null),h=!0,u||(d=ot(t,"click",e[4]),u=!0)},p(f,[m]){m&8&&W(o,"transition-delay",(f[3]?f[5]:0)+"ms");const p={};m&4&&(p.icon=f[2]),m&2&&(p.width=f[1]),c.$set(p),m&8&&W(l,"transition-delay",(f[3]?f[5]:0)+"ms"),(!h||m&1)&&Ce(n,"unfolded",f[0]),(!h||m&8)&&Ce(n,"folded",f[3])},i(f){h||(F(r.$$.fragment,f),F(c.$$.fragment,f),h=!0)},o(f){X(r.$$.fragment,f),X(c.$$.fragment,f),h=!1},d(f){f&&Y(n),Se(r),Se(c),u=!1,d()}}}function GF(e,n,t){let i,r,s,o;const a=fs("hooks");let{tag:l}=n,c,h=!1;const u=()=>{c!==void 0&&clearTimeout(c),h=!0,c=setTimeout(()=>{h=!1},800)},d=p=>{h||(l.entryFromModel&&_i(l.five.state.mode)?l.find({targetMode:"Panorama"}).then(()=>l.unfoldAndFoldOthers()):a.emit("click",{event:p,target:"TagPoint",tag:l}))},f=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();function m(p){Za.call(this,e,p)}return e.$$set=p=>{"tag"in p&&t(6,l=p.tag)},e.$$.update=()=>{var p,g,y,b;e.$$.dirty&64&&t(0,i=(p=l.state)==null?void 0:p.unfolded),e.$$.dirty&1&&t(3,r=!i),e.$$.dirty&64&&t(2,s=(y=(g=l.style)==null?void 0:g.point)!=null&&y.url?(b=l.style)==null?void 0:b.point:{url:_4}),e.$$.dirty&64&&t(1,o=(()=>{var x,M,P,S;const A=(M=(x=l.style)==null?void 0:x.point)==null?void 0:M.width;if(typeof A=="number")return A;const w=(S=(P=l.style)==null?void 0:P.point)==null?void 0:S.size;if(typeof w=="number")return w;if(w==="S")return 18;if(w==="M")return 20;if(w==="L")return 24;if(w==="XL")return 28})())},u(),[i,o,s,r,d,f,l,m]}class HF extends ke{constructor(n){super(),Le(this,n,GF,VF,De,{tag:6},FF)}}function jF(e){Ue(e,"svelte-2g2g8a",".tag.svelte-2g2g8a{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto;will-change:opacity;transition:opacity 0.2s linear}.tag.enableZIndex.svelte-2g2g8a{position:absolute}.tag.hide.svelte-2g2g8a{opacity:0;pointer-events:none}.tag.hide.svelte-2g2g8a *{pointer-events:none !important}.tag.unClickable.svelte-2g2g8a{pointer-events:none !important}.tag.unClickable.svelte-2g2g8a *{pointer-events:none !important}")}function h1(e){let n,t,i,r,s,o,a,l,c;const h=[WF,UF],u=[];function d(g,y){return g[8]?0:1}t=d(e),i=u[t]=h[t](e);const f=[YF,QF],m=[];function p(g,y){return g[15]?0:1}return s=p(e),o=m[s]=f[s](e),{c(){n=j("div"),i.c(),r=ve(),o.c(),_(n,"class","tag svelte-2g2g8a"),_(n,"data-tag-id",e[14]),_(n,"data-tag-unfolded",e[6]),_(n,"data-content-type",a=e[0].contentType),_(n,"id",l=`tag-${e[14]}`),Ce(n,"unClickable",e[0].config.clickable===!1),Ce(n,"hide",e[12]),Ce(n,"enableZIndex",e[9]),W(n,"z-index",e[9]),W(n,"transform",`translate3d(${e[11]}, ${e[10]}, 0) scale(${e[7].scale})`)},m(g,y){Z(g,n,y),u[t].m(n,null),Q(n,r),m[s].m(n,null),e[17](n),c=!0},p(g,y){let b=t;t=d(g),t===b?u[t].p(g,y):(Ve(),X(u[b],1,1,()=>{u[b]=null}),Ge(),i=u[t],i?i.p(g,y):(i=u[t]=h[t](g),i.c()),F(i,1),i.m(n,r));let A=s;s=p(g),s===A?m[s].p(g,y):(Ve(),X(m[A],1,1,()=>{m[A]=null}),Ge(),o=m[s],o?o.p(g,y):(o=m[s]=f[s](g),o.c()),F(o,1),o.m(n,null)),(!c||y&16384)&&_(n,"data-tag-id",g[14]),(!c||y&64)&&_(n,"data-tag-unfolded",g[6]),(!c||y&1&&a!==(a=g[0].contentType))&&_(n,"data-content-type",a),(!c||y&16384&&l!==(l=`tag-${g[14]}`))&&_(n,"id",l),(!c||y&1)&&Ce(n,"unClickable",g[0].config.clickable===!1),(!c||y&4096)&&Ce(n,"hide",g[12]),(!c||y&512)&&Ce(n,"enableZIndex",g[9]),y&512&&W(n,"z-index",g[9]),y&3200&&W(n,"transform",`translate3d(${g[11]}, ${g[10]}, 0) scale(${g[7].scale})`)},i(g){c||(F(i),F(o),c=!0)},o(g){X(i),X(o),c=!1},d(g){g&&Y(n),u[t].d(),m[s].d(),e[17](null)}}}function UF(e){let n;return{c(){n=j("div"),_(n,"data-info","tag point is disable")},m(t,i){Z(t,n,i)},p:de,i:de,o:de,d(t){t&&Y(n)}}}function WF(e){let n,t;return n=new HF({props:{tag:e[0]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=i[0]),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function QF(e){let n;return{c(){n=j("div"),_(n,"data-info","tag content is disable")},m(t,i){Z(t,n,i)},p:de,i:de,o:de,d(t){t&&Y(n)}}}function YF(e){let n,t;return n=new OM({props:{mediaStore:e[1],tag:nn(e[0]),hooks:e[16],state:e[4],temporaryState:e[5],rendererMap:e[2],contentTypeMap:e[3]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&2&&(s.mediaStore=i[1]),r&1&&(s.tag=nn(i[0])),r&16&&(s.state=i[4]),r&32&&(s.temporaryState=i[5]),r&4&&(s.rendererMap=i[2]),r&8&&(s.contentTypeMap=i[3]),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function XF(e){let n,t,i=e[7]&&!e[13]&&h1(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[7]&&!r[13]?i?(i.p(r,s),s&8320&&F(i,1)):(i=h1(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function ZF(e,n,t){let i,r,s,o,a,l,c,h,u,d,{tag:f}=n,{mediaStore:m}=n,{rendererMap:p=new Map}=n,{contentTypeMap:g=new Map}=n,{state:y}=n,{temporaryState:b}=n;const A=fs("hooks");function w(x){Qt[x?"unshift":"push"](()=>{f.dom=x,t(0,f)})}return e.$$set=x=>{"tag"in x&&t(0,f=x.tag),"mediaStore"in x&&t(1,m=x.mediaStore),"rendererMap"in x&&t(2,p=x.rendererMap),"contentTypeMap"in x&&t(3,g=x.contentTypeMap),"state"in x&&t(4,y=x.state),"temporaryState"in x&&t(5,b=x.temporaryState)},e.$$.update=()=>{var x,M,P,S;e.$$.dirty&5&&t(8,i=(()=>{var T,z,D;return!(((z=(T=f.style)==null?void 0:T.point)==null?void 0:z.enabled)===!1||((D=p.get(f.contentType))==null?void 0:D.usePoint)===!1||f.contentType==="Sticker"||f.contentType==="Link"||f.contentType==="VRLink"||f.contentType==="PanoLink"||f.contentType==="Panorama"||f.contentType==="Audio"&&f.data.appearance==="plane")})()),e.$$.dirty&257&&t(15,r=(()=>!(f.stickType!=="2DPoint"||f.entryFromModel&&_i(f.five.state.mode)&&i))()),e.$$.dirty&1&&t(14,s=f.id),e.$$.dirty&1&&t(7,o=f.screenPosition),e.$$.dirty&1&&t(13,a=f.enabled===!1||!f.state),e.$$.dirty&129&&t(12,l=!((x=f.state)!=null&&x.visible)||((M=f.temporaryState)==null?void 0:M.visible)===!1||!o),e.$$.dirty&1&&t(6,c=(P=f.state)==null?void 0:P.unfolded),e.$$.dirty&128&&t(11,h=(o==null?void 0:o.leftPx)+"px"),e.$$.dirty&128&&t(10,u=(o==null?void 0:o.topPx)+"px"),e.$$.dirty&65&&t(9,d=c?((S=f.zIndex)!=null?S:0)+(c?1e6:0):void 0)},[f,m,p,g,y,b,c,o,i,d,u,h,l,a,s,r,A,w]}class qF extends ke{constructor(n){super(),Le(this,n,ZF,XF,De,{tag:0,mediaStore:1,rendererMap:2,contentTypeMap:3,state:4,temporaryState:5},jF)}}function JF(e){Ue(e,"svelte-1owzhnq",".tag--container.svelte-1owzhnq{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0);transition:opacity 0.2s linear}.tag--container.hide.svelte-1owzhnq{opacity:0;pointer-events:none}.tag--container.hide.svelte-1owzhnq *{pointer-events:none !important}")}function u1(e,n,t){const i=e.slice();return i[8]=n[t],i}function d1(e){let n,t=[],i=new Map,r,s,o=e[0];const a=l=>l[8].id;for(let l=0;l<o.length;l+=1){let c=u1(e,o,l),h=a(c);i.set(h,t[l]=f1(h,c))}return{c(){var l;n=j("div");for(let c=0;c<t.length;c+=1)t[c].c();_(n,"class","tag--container svelte-1owzhnq"),_(n,"data-infive","1"),Ce(n,"hide",!e[4].visible||!e[5].visible),W(n,"z-index",(l=e[6])!=null?l:"")},m(l,c){Z(l,n,c);for(let h=0;h<t.length;h+=1)t[h]&&t[h].m(n,null);s=!0},p(l,c){var h;c&63&&(o=l[0],Ve(),t=zi(t,c,a,1,l,o,i,n,bs,f1,null,u1),Ge()),(!s||c&48)&&Ce(n,"hide",!l[4].visible||!l[5].visible),c&64&&W(n,"z-index",(h=l[6])!=null?h:"")},i(l){if(!s){for(let c=0;c<o.length;c+=1)F(t[c]);r||an(()=>{r=ys(n,_n,{}),r.start()}),s=!0}},o(l){for(let c=0;c<t.length;c+=1)X(t[c]);s=!1},d(l){l&&Y(n);for(let c=0;c<t.length;c+=1)t[c].d()}}}function f1(e,n){let t,i,r;return i=new qF({props:{state:n[4],temporaryState:n[5],tag:n[8],mediaStore:n[1],rendererMap:n[2],contentTypeMap:n[3]}}),{key:e,first:null,c(){t=ft(),Ie(i.$$.fragment),this.first=t},m(s,o){Z(s,t,o),_e(i,s,o),r=!0},p(s,o){n=s;const a={};o&16&&(a.state=n[4]),o&32&&(a.temporaryState=n[5]),o&1&&(a.tag=n[8]),o&2&&(a.mediaStore=n[1]),o&4&&(a.rendererMap=n[2]),o&8&&(a.contentTypeMap=n[3]),i.$set(a)},i(s){r||(F(i.$$.fragment,s),r=!0)},o(s){X(i.$$.fragment,s),r=!1},d(s){s&&Y(t),Se(i,s)}}}function KF(e){let n,t,i=e[4].enabled&&d1(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[4].enabled?i?(i.p(r,s),s&16&&F(i,1)):(i=d1(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function $F(e,n,t){let{tags:i=[]}=n,{hooks:r}=n,{mediaStore:s}=n,{rendererMap:o}=n,{contentTypeMap:a}=n,{state:l}=n,{temporaryState:c}=n,{zIndex:h=void 0}=n;return Em("hooks",r),e.$$set=u=>{"tags"in u&&t(0,i=u.tags),"hooks"in u&&t(7,r=u.hooks),"mediaStore"in u&&t(1,s=u.mediaStore),"rendererMap"in u&&t(2,o=u.rendererMap),"contentTypeMap"in u&&t(3,a=u.contentTypeMap),"state"in u&&t(4,l=u.state),"temporaryState"in u&&t(5,c=u.temporaryState),"zIndex"in u&&t(6,h=u.zIndex)},[i,s,o,a,l,c,h,r]}class eV extends ke{constructor(n){super(),Le(this,n,$F,KF,De,{tags:0,hooks:7,mediaStore:1,rendererMap:2,contentTypeMap:3,state:4,temporaryState:5,zIndex:6},JF)}}const zM="Dnalogel-PanoTagPlugin",tV=e=>`${zM}--${e}`;class fd extends LF{constructor(t,i){super(t);v(this,"state",{enabled:!0,visible:!0});v(this,"debug");v(this,"debugUtil",new kF(this));v(this,"changeTagModel",(t,i)=>ee(this,null,function*(){var r;t.data=Ht({},t.data,i),yield(r=t.loadModel)==null?void 0:r.call(t)}));v(this,"handleFiveModeChange",t=>{const i=()=>{this.tags.forEach(r=>{r.state.visible=!1,r.applyVisible(),this.five.ready().then(()=>{r.updateVisible(),$i(r)&&t!=="Panorama"&&this.changeTagMode(r,"behind")})})};this.tags.length<500?i():this.five.ready().then(()=>i())});v(this,"handleFiveWantsMoveToPano",t=>{if(this.tags.length>500){this.temporaryState.visible=!1,this.addRenderQueue({type:"TagContainerSvelte",keys:["temporaryState"]});return}else this.tags.forEach(i=>{i.getVisible({panoIndex:t})&&(i.state.visible=!0);const s=i.getConfig();typeof s.visibleConfig=="object"&&i.temporaryState&&(s.visibleConfig.keep?i.temporaryState.visible=s.visibleConfig.keep==="visible":i.temporaryState.visible=!!s.visibleConfig.alwaysShowWhenMovePano)}),this.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]}),this.tags.forEach(i=>i.applyVisible())});v(this,"clickhandler",t=>{t.tag.onClick(t)});v(this,"handleFiveCameraUpdate",()=>{this.filterPointTag.forEach(t=>t.updateScreenPosition())});v(this,"handleFiveCameraFovUpdate",()=>{this.handleFiveCameraUpdate(),this.five.off("render.prepare",this.handleFiveCameraUpdate),this.five.on("render.prepare",this.handleFiveCameraUpdate),setTimeout(()=>{this.five.off("render.prepare",this.handleFiveCameraUpdate)},1e3)});v(this,"handleFivePanoArrived",()=>ee(this,null,function*(){this.tags.forEach(t=>{t.state.visible=!1,t.temporaryState=Ee(R({},t.temporaryState),{visible:!0}),t.applyVisible(),t.updateVisible()}),this.temporaryState.visible=!0,this.addRenderQueue({type:"TagContainerSvelte",keys:["temporaryState"]}),yield this.setUnfolded(),this.updateRender3DDomTag(),this.tags.filter(TO).filter(t=>{var i;return(i=t.getConfig().modelConfig)==null?void 0:i.autoLookAtEnabled}).forEach(t=>{var c;const i=new E.Mesh(new E.BoxGeometry,new E.MeshBasicMaterial),r=(c=t.model)==null?void 0:c.object;if(!r)return;i.position.copy(r.position),i.quaternion.copy(r.quaternion);const s=this.five.camera.position;i.lookAt(s.clone().setY(i.position.y));const o=r.quaternion.clone(),a=i.quaternion.clone(),l=Ec();l.onUpdate(({progress:h})=>{r.quaternion.copy(o.clone().slerp(a,h))}),l.play()})}));v(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(t=>t.updateVisible())});v(this,"onFiveEveryReady",()=>{this.setUnfoldedByCamera(),_i(this.five.getCurrentState().mode)&&this.tags.forEach(t=>t.updateVisible())});v(this,"render",()=>{this.renderQueue.forEach((t,i)=>{const{keys:r}=t;if(i==="TagContainerSvelte"){const o=this.filterPointTag.filter(l=>l.screenPosition),a={hooks:this.hooks,tags:o,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore,rendererMap:this.rendererMap,contentTypeMap:this.contentTypeMap,zIndex:this.params.containerZIndex};if(this.TagContainerSvelte){let l={};if(r.length===0)l=a;else for(const c of r)l[c]=a[c];this.TagContainerSvelte.$set(l)}else{if(!this.container)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new eV({target:this.container,props:Ee(R({},a),{state:Ee(R({},this.state),{enabled:!1})})}),Bc(()=>{var l;(l=this.TagContainerSvelte)==null||l.$set({state:this.state})})}}}),this.renderQueue.clear()});this.params=Ht({},{debug:!1,config:this.config},R({},i)),this.debug=this.params.debug,this.config=this.params.config,this.debug&&this.debugUtil.bindLog(),BO(1,{namespace:Ng.PlayAudio});try{Array.isArray(window.__PANOTAGPLUGIN_DEBUG_LIST__)||(window.__PANOTAGPLUGIN_DEBUG_LIST__=[]),window.__PANOTAGPLUGIN_DEBUG_LIST__.push(this),window.__PANOTAGPLUGIN_DEBUG__||Object.defineProperty(window,"__PANOTAGPLUGIN_DEBUG__",{get:function(){return window.__PANOTAGPLUGIN_DEBUG_LIST__.sort((r,s)=>s.tags.length-r.tags.length)[0]}})}catch(r){}}appendTo(t){var r,s,o,a;this.debugUtil.addLog("appendTo"),this.container=t,(r=this.css3DRenderPlugin)==null||r.appendToFrontFiveContainer(this.container);const i=(o=(s=this.TagContainerSvelte)==null?void 0:s.$$)==null?void 0:o.root;i&&i!==this.container&&((a=this.TagContainerSvelte)==null||a.$destroy(),this.TagContainerSvelte=void 0)}load(t){return ee(this,null,function*(){var r,s;this.clearTags();try{console.debug(zM," load:",{data:JSON.parse(JSON.stringify(t))})}catch(o){}this.config=Ht({},this.config,{globalConfig:(r=t.globalConfig)!=null?r:{},contentTypeConfig:(s=t.contentTypeConfig)!=null?s:{}});const i=yield this.addTag(t.tagList);return this.hooks.emit("loaded"),i})}addTag(t){return ee(this,null,function*(){const r=(Array.isArray(t)?t:[t]).filter(s=>s.position).map(s=>{const o=Bg(s);if(o==="2DPoint"||o==="3DPoint")return new OF(this,s);if(o==="Model")return new RM(this,s);if(o==="Plane")return new NF(this,s)});return r.forEach(OO),this.tags.push(...r),this.tagsLengthWillUpdate=!0,Ua(this.five).then(()=>ee(this,null,function*(){var s,o;this.store.eventListenerDisposer&&((o=(s=this.store).eventListenerDisposer)==null||o.call(s)),this.state.enabled&&this.handleEnable(),this.addResizeListener(),this.clearUnusedPanelTag(),this.addMediaModelTag(r),r.forEach(a=>{a.updateVisible(),a.updateZIndex()}),this.setUnfolded(),this.addRenderQueue({type:"TagContainerSvelte"}),this.hooks.emit("tagsLengthChange")}))})}changeConfig(t,i=!0){i?this.config=Ht({},this.config,t):this.config=t,this.tags.forEach(r=>{r.updateConfig(),r.updateVisible()})}changeGlobalConfig(t,i=!0){i?this.config.globalConfig=Ht({},this.config.globalConfig,t):this.config.globalConfig=t,this.tags.forEach(r=>{r.updateConfig(),r.updateVisible()})}changeContentTypeConfig(t,i,r=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),r?this.config.contentTypeConfig[t]=Ht({},this.config.contentTypeConfig[t],i):this.config.contentTypeConfig[t]=i,this.tags.forEach(s=>{s.updateConfig(),s.updateVisible()})}show(t){return ee(this,null,function*(){if(this.checkDisposed())return;const{userAction:i=!0}=t!=null?t:{};this.setState({visible:!0},{userAction:i}),this.hooks.emit("show",{userAction:i})})}hide(t){return ee(this,null,function*(){if(this.checkDisposed())return;const{userAction:i=!0}=t!=null?t:{};this.setState({visible:!1},{userAction:i}),this.hooks.emit("hide",{userAction:i})})}enable(t){if(this.checkDisposed())return;const{userAction:i=!0}=t!=null?t:{};this.setState({enabled:!0},{userAction:i}),this.hooks.emit("enable",{userAction:i})}disable(t){if(this.checkDisposed())return;const{userAction:i=!0}=t!=null?t:{};this.setState({enabled:!1},{userAction:i}),this.hooks.emit("disable",{userAction:i})}setState(t,i){if(this.checkDisposed())return;const{userAction:r=!0}=i!=null?i:{},s=R({},this.state);this.state=Object.assign(this.state,t),s.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),s.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:r})}dispose(){var t,i,r,s,o,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(t=this.TagContainerSvelte)==null||t.$destroy(),this.filterCSS3DTag.forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags.forEach(l=>l.cache.clear()),this.tags=[],this.tagsLengthWillUpdate=!0,this.hooks.emit("tagsLengthChange"),(i=this.store.disposers)==null||i.forEach(l=>l==null?void 0:l()),this.store.disposers=[],(s=(r=this.store).eventListenerDisposer)==null||s.call(r),this.store.eventListenerDisposer=void 0,(a=(o=this.store).resizeObserverDisposer)==null||a.call(o),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.imagePlaneGroup.remove(...this.imagePlaneGroup.children),this.five.needsRender=!0,this.store.disposed=!0,this.hooks.emit("dispose")}blinkTagById(t,i){return ee(this,null,function*(){var r;return(r=this.getTagById(t))==null?void 0:r.blink(i)})}changeUnfoldedById(t,i){const r=this.getTagById(t);i?r==null||r.unfold():r==null||r.fold()}changeEnabledById(t,i){var s;const r=this.getTagById(t);r&&(r.enabled=i,(s=r.hooks)==null||s.emit(i?"enable":"disable"))}changeTagNormalById(t,i){const r=this.getTagById(t);r&&r.tag3DContentSvelte&&(r.tag3DContentSvelte.currentNormal=os(i))}changePositionById(t,i){const r=this.getTagById(t);r&&r.setPosition(i)}changeDataById(t,i,r=!0){const s=this.getTagById(t);s&&(s.setData(i,r),this.clearUnusedPanelTag(),s.hooks.emit("dataChanged",s.data))}changeStickTypeById(t,i,r=!0){this.changeTagById(t,i,r)}changeTagById(t,i,r=!0){const s=this.getTagById(t);s&&(s.set(i),s.updateVisible(),this.clearUnusedPanelTag(),s.hooks.emit("dataChanged",s.data))}destroyTagById(t){(Array.isArray(t)?t:[t]).forEach(r=>{var s;return(s=this.getTagById(r))==null?void 0:s.destroy()})}updateRenderAllTags(){this.tags.forEach(t=>t.updateVisible()),this.five.needsRender=!0}setUnfolded(){return ee(this,null,function*(){return new Promise(t=>{setTimeout(()=>{this.setUnfoldedByCamera(),t()},100)})})}handleShow(){this.state.visible=!0,this.group.visible=!0,this.addRenderQueue({type:"TagContainerSvelte",keys:["state"]}),this.updateRender3DDomTag(),this.five.needsRender=!0}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.group.visible=!1,this.addRenderQueue({type:"TagContainerSvelte",keys:["state"]}),this.updateRender3DDomTag(),this.five.needsRender=!0}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.group.traverse(t=>{var i;(i=t==null?void 0:t.updateTagCss3DObjectMatrix)==null||i.call(t)}),this.updateRender3DDomTag(),this.five.needsRender=!0}handleDisable(){var t,i,r;this.pauseCurrentMedia(),this.state.enabled=!1,(i=(t=this.store).eventListenerDisposer)==null||i.call(t),this.five.scene.remove(this.group),(r=this.TagContainerSvelte)==null||r.$set({tags:[]}),this.filterCSS3DTag.forEach(s=>{var o;(o=s.tag3DContentSvelte)==null||o.dispose(),s.tag3DContentSvelte=void 0}),this.five.needsRender=!0}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const t=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=t,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(this.store.disposed)return;const t=this.five.getElement(),i=()=>{this.state.enabled&&(this.filterPointTag.forEach(c=>c.updateScreenPosition({force:!0})),this.temporaryState.visible=!0,this.addRenderQueue({type:"TagContainerSvelte",keys:["temporaryState"]}))},r=()=>{this.state.enabled&&(this.temporaryState.visible=!1,this.addRenderQueue({type:"TagContainerSvelte",keys:["temporaryState"]}))},{observe:s,unobserve:o}=Ju(Yb(()=>{this.store.resizeObserverDisposer&&r()},500),t),{observe:a,unobserve:l}=Ju(kO(()=>i(),400),t);return s(),a(),()=>{o(),l()}}setUnfoldedByCamera(){let t=!1;this.filterPointTag.forEach(i=>{const r=i.getUnfoldedByCamera();if(i.state&&r!==void 0){if(r===!0&&i.screenPosition){const s=i.getConfig().unfoldedConfig;so(s).keep!=="unfolded"&&(t=!0)}i.state.unfolded=r}}),t&&this.filterPointTag.forEach(i=>{const r=i.getConfig().unfoldedConfig;typeof r=="object"&&(r.autoUnfold||r.autoUnfold===!1||so(r.autoUnfold).enable===!1||r.keep)||i.state&&(i.state.unfolded=!1)})}changeTagMode(t,i){var r,s,o,a,l,c;((r=t.config)==null?void 0:r.renderType)!=="Mesh"&&((a=(o=(s=t.tag3DContentSvelte)==null?void 0:s.css3DInstance)==null?void 0:o.css3DObject)==null?void 0:a.mode)!==i&&((l=t.config)!=null&&l.tag3DConfig?t.config.tag3DConfig.mode=i:t.config?t.config.tag3DConfig={mode:i}:t.config={tag3DConfig:{mode:i}},(c=this.store.css3DRenderDisposer.get(t.id))==null||c.forEach(h=>h==null?void 0:h()),t.tag3DContentSvelte=void 0)}addEventListener(){const{five:t,hooks:i}=this;let r=!1;const s=Yb(()=>{r||(r=!0,t.ready().then(()=>{this.onFiveEveryReady(),r=!1}))},150);return t.on("cameraUpdate",s),this.handleFivePanoArrived(),t.on("wantsMoveToPano",this.handleFiveWantsMoveToPano),t.on("models.refined",this.onFiveEveryReady),t.on("modeChange",this.handleFiveModeChange),t.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),t.on("cameraUpdate",this.handleFiveCameraUpdate),t.on("cameraFovUpdate",this.handleFiveCameraFovUpdate),t.on("panoArrived",this.handleFivePanoArrived),t.on("panoArrived",this.loadVideoFirstFrame),t.on("render.prepare",this.render),i.on("click",this.clickhandler),()=>{t.off("wantsMoveToPano",this.handleFiveWantsMoveToPano),t.off("models.refined",this.onFiveEveryReady),t.off("modeChange",this.handleFiveModeChange),t.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),t.off("cameraUpdate",this.handleFiveCameraUpdate),t.off("cameraFovUpdate",this.handleFiveCameraFovUpdate),t.off("cameraUpdate",s),t.off("panoArrived",this.handleFivePanoArrived),t.off("panoArrived",this.loadVideoFirstFrame),t.off("render.prepare",this.render),i.off("click",this.clickhandler),this.store.eventListenerDisposer=void 0}}}const nV=(e,n)=>new fd(e,n);function iV(e){Ue(e,"svelte-4qjwer",".guide-line__tag.svelte-4qjwer.svelte-4qjwer{position:relative}.text-with-distance.svelte-4qjwer.svelte-4qjwer{display:flex;flex-direction:column;position:relative;padding:0.125rem 0.25rem;border-radius:0.125rem;background:linear-gradient(to top, rgba(147, 147, 147, 0.3), rgba(74, 74, 74, 0.3));box-shadow:0 0.125rem 0.5rem 0 rgba(0, 0, 0, 0.2)}.text-with-distance.svelte-4qjwer .border.svelte-4qjwer{position:absolute;top:-50%;right:-50%;bottom:-50%;left:-50%;padding:0.0625rem;border-radius:0.25rem;background:linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.2));-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask-composite:exclude;-webkit-mask-composite:xor;transform:scale(0.5)}.distance-and-name.svelte-4qjwer.svelte-4qjwer{display:flex;gap:0.1875rem}.distance.svelte-4qjwer.svelte-4qjwer{white-space:nowrap;font-size:0.625rem;line-height:0.875rem;color:#66afff}.name.svelte-4qjwer.svelte-4qjwer{opacity:0.6;font-size:0.625rem;line-height:0.875rem;white-space:nowrap;color:#ffffff}.line-name.svelte-4qjwer.svelte-4qjwer{color:#fff;white-space:nowrap;font-size:0.625rem;line-height:0.875rem}.guide-line__tag-point.svelte-4qjwer.svelte-4qjwer{position:absolute;left:50%;bottom:0.0625rem;width:0.4375rem;height:0.125rem;transform:translateX(-50%);background:#fff;border-radius:50%;opacity:0.5}.guide-line__tag-line.svelte-4qjwer.svelte-4qjwer{position:absolute;left:50%;bottom:0.0625rem;width:0.0625rem;height:1.875rem;transform:translateX(-50%);background:linear-gradient(to top, #fff, rgba(255, 255, 255, 0))}.guide-line__tag-content.svelte-4qjwer.svelte-4qjwer{position:absolute;left:-0.9375rem;bottom:1.9375rem;display:flex}.guide-line__tag-icon.svelte-4qjwer.svelte-4qjwer{width:1.875rem;height:1.875rem;background-size:100%}.guide-line__tag-text.svelte-4qjwer.svelte-4qjwer{box-sizing:content-box;height:0.875rem;width:-moz-max-content;width:max-content;margin-top:0.3125rem;transform:translateX(-0.1875rem);white-space:nowrap;font-size:0.625rem;line-height:0.875rem;border:solid transparent;border-width:0.125rem 0.5rem 0.125rem 0.375rem;border-image-slice:6 25 6 18 fill;color:#fff}")}function p1(e){let n,t;return{c(){n=j("div"),t=xt(e[0]),_(n,"class","guide-line__tag-text svelte-4qjwer"),W(n,"border-image-source",`url(${e[6]})`)},m(i,r){Z(i,n,r),Q(n,t)},p(i,r){r&1&&Ct(t,i[0])},d(i){i&&Y(n)}}}function m1(e){let n,t,i,r,s=e[5]("全程")+"",o,a,l=e[5]("米")+"",c,h,u,d,f,m,p=e[4]&&g1(e);return{c(){n=j("div"),p&&p.c(),t=ve(),i=j("div"),r=j("span"),o=xt(s),a=xt(e[2]),c=xt(l),h=ve(),u=j("span"),d=xt(e[0]),f=ve(),m=j("div"),_(r,"class","distance svelte-4qjwer"),_(u,"class","name svelte-4qjwer"),_(i,"class","distance-and-name svelte-4qjwer"),_(m,"class","border svelte-4qjwer"),_(n,"class","text-with-distance svelte-4qjwer")},m(g,y){Z(g,n,y),p&&p.m(n,null),Q(n,t),Q(n,i),Q(i,r),Q(r,o),Q(r,a),Q(r,c),Q(i,h),Q(i,u),Q(u,d),Q(n,f),Q(n,m)},p(g,y){g[4]?p?p.p(g,y):(p=g1(g),p.c(),p.m(n,t)):p&&(p.d(1),p=null),y&32&&s!==(s=g[5]("全程")+"")&&Ct(o,s),y&4&&Ct(a,g[2]),y&32&&l!==(l=g[5]("米")+"")&&Ct(c,l),y&1&&Ct(d,g[0])},d(g){g&&Y(n),p&&p.d()}}}function g1(e){let n,t;return{c(){n=j("span"),t=xt(e[4]),_(n,"class","line-name svelte-4qjwer")},m(i,r){Z(i,n,r),Q(n,t)},p(i,r){r&16&&Ct(t,i[4])},d(i){i&&Y(n)}}}function rV(e){let n,t,i,r,s,o,a,l,c,h=e[0]&&!e[2]&&p1(e),u=e[2]&&m1(e);return{c(){n=j("div"),t=j("div"),i=ve(),r=j("div"),s=ve(),o=j("div"),a=j("div"),l=ve(),h&&h.c(),c=ve(),u&&u.c(),_(t,"class","guide-line__tag-point svelte-4qjwer"),_(r,"class","guide-line__tag-line svelte-4qjwer"),_(a,"class","guide-line__tag-icon svelte-4qjwer"),W(a,"background-image",`url(${e[1]})`),_(o,"class","guide-line__tag-content svelte-4qjwer"),_(n,"class","guide-line__tag svelte-4qjwer"),W(n,"opacity",e[3])},m(d,f){Z(d,n,f),Q(n,t),Q(n,i),Q(n,r),Q(n,s),Q(n,o),Q(o,a),Q(o,l),h&&h.m(o,null),Q(o,c),u&&u.m(o,null)},p(d,[f]){f&2&&W(a,"background-image",`url(${d[1]})`),d[0]&&!d[2]?h?h.p(d,f):(h=p1(d),h.c(),h.m(o,c)):h&&(h.d(1),h=null),d[2]?u?u.p(d,f):(u=m1(d),u.c(),u.m(o,null)):u&&(u.d(1),u=null),f&8&&W(n,"opacity",d[3])},i:de,o:de,d(d){d&&Y(n),h&&h.d(),u&&u.d()}}}function sV(e,n,t){let{text:i=""}=n,{icon_url:r=""}=n,{distance:s=0}=n,{opacity:o=1}=n,{name:a=""}=n,{i18n:l=h=>h}=n;const c="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAA2CAMAAADOFiZMAAACEFBMVEUAAACIiIheXl5oaGh6enpsbGxiYmJ9fX1wcHBXV1eBgYFzc3NSUlKNjY2Dg4NOTk51dXVXV1dmZmZTU1N3d3dcXFyMjIyEhIRNTU2QkJC0tLS5ubnHx8fOzs6np6exsbHKysqoqKi9vb3U1NTPz8/Nzc2vr6/Dw8OysrK/v7/X19fS0tKurq62traqqqrJycmurq64uL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WIGMN/wBY8/mXRosFxrrDCE20EwJzCGQ9XP7crBN46AdHbthmkPvluICccLzgchnDjBD/eqaxKOOtIKGyiEzDqSFOCt7D4X/dlHFDkNCWPu3fjTHGQBgpbI06TkeIpuQ37bbltAlSKstM/g6EdYcEr0jJv2rLfrZXkFKcPhVjMsWY0GGSrTn00H7TakbD11sChd7qa+gCSKdJVitpyvWLlab6uifsieKtLk1N7QZWtvpYXl4aGxsrAtIJBQVNWVlZOTkZGRm2z7bHW0q2lJRkZ2c3NOTn19fV19fn5zfAsmQL8Nhmg66cHOhvKigoSC/Iysk+vH9//jd2n8g6TG7yjbXZYCAMq6s7fBiah4aGLl0aGLhw4f758zuBmpq+vurq6h07dnR1dXTcrqqq2uejqup2R0dXF8jV1X19NTU1O3feu3f+/oWBgUtD++uePHtbLAThNzRClbi+VnseAAAAAElFTkSuQmCC";return e.$$set=h=>{"text"in h&&t(0,i=h.text),"icon_url"in h&&t(1,r=h.icon_url),"distance"in h&&t(2,s=h.distance),"opacity"in h&&t(3,o=h.opacity),"name"in h&&t(4,a=h.name),"i18n"in h&&t(5,l=h.i18n)},[i,r,s,o,a,l,c]}class oV extends ke{constructor(n){super(),Le(this,n,sV,rV,De,{text:0,icon_url:1,distance:2,opacity:3,name:4,i18n:5},iV)}}function aV(e){return e.length===0?[]:e.filter((n,t)=>n!==e[t-1])}const lV=`
|
|
3564
|
+
`);this.uniforms={map:{value:t}}}}class _M extends E.Mesh{constructor(){super(...arguments);v(this,"name","MediaPlane");v(this,"src")}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}dispose(){this.traverse(t=>{if(t.isMesh){const i=t;i.geometry.dispose(),(i.material instanceof Array?i.material:[i.material]).forEach(s=>{s.dispose()})}})}}class SM extends _M{constructor(t,i,r){var a;super();v(this,"name","PanoTagPluginImagePlane");this.src=t;const s=(a=r==null?void 0:r.resolveZFighting)!=null?a:!0;let o=i;if(s){const l=Fc(i,5e-4);o=i.map(c=>c.clone().add(l))}Ox(t).then(({texture:l,transparent:c})=>{var p;const h=new E.MeshBasicMaterial({map:l,transparent:c}),u=Pl((p=r==null?void 0:r.objectFit)!=null?p:"contain",o,l.image.width/l.image.height),d=lr(...u),f=u.map(g=>g.clone().sub(d)),m=new PM(f);this.position.copy(d),this.geometry=m,this.material=h}).catch(l=>{console.error(`Imageplane error ${l==null?void 0:l.message}`)})}}class IM extends _M{constructor(t,i,r){const{videoCoverSrc:s,objectFit:o="contain",playButton:a="withText",paused:l=!0,videoTextureMap:c,ImageTextureMap:h,domEvents:u}=r!=null?r:{};super();v(this,"isVideoPlane",!0);v(this,"name","PanoTagPluginImagePlane");v(this,"videoInstance");v(this,"onVideoReady");v(this,"objectFit");v(this,"buttonSrc");v(this,"videoCoverSrc");v(this,"domEvents");v(this,"disposers",[]);v(this,"cornerPoints");v(this,"videoMesh");v(this,"coverMesh");v(this,"buttonMesh");v(this,"videoTextureMap");v(this,"ImageTextureMap");this.cornerPoints=i,this.src=t,this.buttonSrc=(()=>a==="withText"?zg:a==="withoutText"?Rm:typeof a=="string"?a:Rm)(),this.videoCoverSrc=s,this.objectFit=o,this.videoTextureMap=c,this.ImageTextureMap=h,this.domEvents=u,this.position.copy(lr(...i)),this.videoCoverSrc&&l?this.addCoverMesh().then(()=>this.addButtonMesh()):this.addVideoMesh().then(()=>{l?this.addButtonMesh():this.play(!0)}),this.addEventListener("removed",()=>{this.remove(...this.children)}),this.addEventListener("dispose",()=>{var d;(d=this.disposers)==null||d.forEach(f=>f==null?void 0:f())})}play(t=!1){return ee(this,null,function*(){this.videoMesh||(yield this.addVideoMesh()),this.showPlayUI(),this.videoInstance.paused&&this.videoInstance.play().then(()=>this.showPlayUI()).catch(i=>{this.pause(),console.error("play error",i)}),this.videoInstance.muted=t,this.render()})}pause(){this.videoInstance&&(this.videoInstance.pause(),this.showPauseUI().then(()=>this.render()))}initialRenderHooks(t){const r=t(()=>{var s;this.videoMesh&&((s=this.videoInstance)==null?void 0:s.paused)===!1&&(this.videoMesh.needsRender=!0)});this.disposers.push(()=>r)}showPlayUI(){this.coverMesh&&(this.coverMesh.visible=!1),this.remove(this.buttonMesh),this.videoMesh.visible=!0}showPauseUI(){return ee(this,null,function*(){this.coverMesh?(this.coverMesh.visible=!0,this.videoMesh&&(this.videoMesh.visible=!1)):(yield this.addCoverMesh(),this.coverMesh&&(this.videoMesh.visible=!1)),this.addButtonMesh().then(()=>this.render())})}render(){var t;this.videoMesh&&(this.videoMesh.needsRender=!0),this.coverMesh&&(this.coverMesh.needsRender=!0),this.buttonMesh&&(this.buttonMesh.needsRender=!0),this.videoMesh&&((t=this.videoInstance)==null?void 0:t.paused)===!1&&(this.videoMesh.needsRender=!0)}addCoverMesh(){return ee(this,null,function*(){if(this.children.includes(this.coverMesh))return;const t=yield(()=>ee(this,null,function*(){if(this.coverMesh)return this.coverMesh;if(!this.videoCoverSrc)return;const{texture:i,transparent:r}=yield this.getImageTexture(this.videoCoverSrc),s=new E.MeshBasicMaterial({transparent:!1,map:i}),o=Pl(this.objectFit,this.cornerPoints,i.image.width/i.image.height),a=new cp(o,s);return a.position.copy(new ne.Vector3(0,0,0)),a.name="videoCoverMesh",a}))();return t&&(this.children.includes(this.coverMesh)||(this.add(t),this.coverMesh=t)),t})}addVideoMesh(){return ee(this,null,function*(){if(this.children.includes(this.videoMesh))return;const t=yield(()=>ee(this,null,function*(){if(this.videoMesh)return this.videoMesh;if(!this.src)return;const r=this.getVideoTexture(this.src),s=new E.MeshBasicMaterial({transparent:!1,map:r}),o=yield new Promise(l=>{r.metadataLoaded?l(Pl(this.objectFit,this.cornerPoints,r.image.videoWidth/r.image.videoHeight)):r.addEventListener("videoLoaded",()=>l(Pl(this.objectFit,this.cornerPoints,r.image.videoWidth/r.image.videoHeight)))}),a=new cp(o,s);return a.name="videoMesh",a.position.copy(new ne.Vector3(0,0,0)),a}))();if(!t)return;this.domEvents.addAutoBindEventListener(t,"click",()=>{!this.videoInstance.paused&&this.videoInstance.muted?this.videoInstance.muted=!1:this.pause()},{noEmitWhenHide:!0});const i=t.material.map.image;return i.addEventListener("playing",()=>{this.coverMesh||this.remove(this.buttonMesh),this.render()}),i.addEventListener("pause",()=>{this.videoInstance.paused&&(this.showPauseUI(),this.render())}),this.children.includes(this.videoMesh)||(this.add(t),this.videoMesh=t,this.videoInstance=i),t})}addButtonMesh(){return ee(this,null,function*(){if(this.children.includes(this.buttonMesh))return;const t=yield(()=>ee(this,null,function*(){var f,m,p,g;if(this.buttonMesh)return this.buttonMesh;const i=(m=(f=this.videoMesh)==null?void 0:f.geometry.points[0].distanceTo(this.videoMesh.geometry.points[3]))!=null?m:1/0,r=(g=(p=this.coverMesh)==null?void 0:p.geometry.points[0].distanceTo(this.coverMesh.geometry.points[3]))!=null?g:1/0,s=this.cornerPoints[0].distanceTo(this.cornerPoints[3]),a=Math.min(i,r,s)/s*.3,{texture:l,transparent:c}=yield this.getImageTexture(this.buttonSrc),h=Pl("contain",this.cornerPoints,l.image.width/l.image.height),u=new cp(h,new mF(l));u.position.copy(new ne.Vector3(0,0,0)),u.name="buttonMesh",u.scale.set(a,a,a),this.domEvents.addAutoBindEventListener(u,"click",()=>{this.play()},{noEmitWhenHide:!0});const d=Fc(h,5e-4);return u.position.add(d),u}))();return this.children.includes(this.buttonMesh)||(this.add(t),this.buttonMesh=t),t})}getImageTexture(t){return ee(this,null,function*(){var r,s;if((r=this.ImageTextureMap)!=null&&r.has(t))return this.ImageTextureMap.get(t);const i=yield Ox(t);return(s=this.ImageTextureMap)==null||s.set(t,i),i})}getVideoTexture(t){var r,s;if((r=this.videoTextureMap)!=null&&r.has(t))return this.videoTextureMap.get(t);const i=pF(t);return(s=this.videoTextureMap)==null||s.set(t,i),i}}function s1(e){return Object.entries(e)}function o1(e){var t,i;typeof e.visibleConfig=="object"&&e.visibleConfig.keep&&(e.visibleConfig.keep==="visible"?e.visibleConfig={keep:e.visibleConfig.keep,visibleFiveMode:(t=e.visibleConfig)==null?void 0:t.visibleFiveMode}:e.visibleConfig.keep==="hidden"&&(e.visibleConfig={keep:e.visibleConfig.keep})),typeof e.unfoldedConfig=="object"&&(e.unfoldedConfig.disableFold&&(e.unfoldedConfig={keep:"unfolded"}),e.unfoldedConfig.disableUnfold&&(e.unfoldedConfig={keep:"folded"}),e.unfoldedConfig.keep&&(e.unfoldedConfig={keep:e.unfoldedConfig.keep}));const n=(i=e.initialState)!=null?i:{};return typeof e.unfoldedConfig=="object"&&(e.unfoldedConfig.keep==="unfolded"?n.unfolded=!0:e.unfoldedConfig.keep==="folded"&&(n.unfolded=!1)),typeof e.visibleConfig=="object"&&(e.visibleConfig.keep==="visible"?n.visible=!0:e.visibleConfig.keep==="hidden"&&(n.visible=!1)),e.initialState=n,e}const TM={visibleConfig:{intersectRaycaster:{enabled:!0,distanceAccuracy:.01,checkPoints:"corner",needPassed:1}},clickable:!0,simulate3D:!1,renderType:"Dom"};var DM=(e=>(e.PointTag="PointTag",e.PlaneTag="PlaneTag",e))(DM||{}),LM=(e=>(e.Audio="Audio",e.Text="Text",e.ImageText="ImageText",e.Image="Image",e.Video="Video",e.Link="Link",e.Sticker="Sticker",e.VRLink="VRLink",e.PanoLink="PanoLink",e.Marketing="Marketing",e.MediaPlane="MediaPlane",e.MediaModel="MediaModel",e.Model="Model",e.Panorama="Panorama",e.Custom="Custom",e.Unknown="Unknown",e))(LM||{}),kM=(e=>(e.Two="2D",e.Three="3D",e))(kM||{});function hp(e,n,t){var f,m,p,g,y;const i=(f=t==null?void 0:t.useCache)!=null?f:!0;if(!e)return(m=n.globalConfig)!=null?m:{};if(i){if((p=e==null?void 0:e.computedConfig)!=null&&p._isMerged)return e.computedConfig;if((g=e==null?void 0:e.config)!=null&&g._isMerged)return e.config}const r={},s={},o={};n.contentTypeConfig&&Object.entries(n.contentTypeConfig).forEach(([b,A])=>{var z,D;const w=b,x=w.split("-"),M=b.startsWith("["),P=M?x[0].slice(1,-1):void 0,S=M?x.slice(1):x,T=P?["PanoramaLike","ModelLike"].includes(P)?(z=s[P])!=null?z:s[P]={}:(D=o[P])!=null?D:o[P]={}:r;if(!T[w]){if(S.length===0&&(T[w]=A),S.length===1){const[k]=S;(e.contentType===k||k==="Any")&&(T[w]=A)}if(S.length===2){const[k="Any",O="Any"]=S;k==="Mixin"&&e.contentType===O&&(T[w]=A),(e.stickType===k||k==="Any")&&(e.contentType===O||O==="Any")&&(T[w]=A)}if(S.length===3){const[k="Any",O,G]=S;if(O==="Audio"&&e.contentType==="Audio"){const I=e;(I.stickType===k||k==="Any")&&I.data.appearance===G&&(T[w]=A)}}}});const a=(y=e.initialConfig)!=null?y:{},l=Ht({},TM,n.globalConfig,...Object.values(r)),c=Ht({},l,a),h={},u=Object.values(Jt.Five.Mode);s1(s).forEach(([b,A])=>{u.forEach(w=>{(b==="PanoramaLike"&&Vs(w)||b==="ModelLike"&&_i(w))&&(h[w]=Ht({},l,...Object.values(A),a,{_isMerged:!0}))})}),s1(o).forEach(([b,A])=>{const w=h[b];h[b]=Ht({},l,w,...Object.values(A),a,{_isMerged:!0})});const d=Ee(R({},c),{configWithFiveMode:h});return o1(d),Object.values(h).forEach(b=>o1(b)),d._isMerged=!0,d}function a1(e){const n=e.split("?")[0].split(".").pop();return n?n.toLowerCase():""}function gF(e,n){if(!e)return 0;const t=e.observers;if(!n||!t)return console.error("getFloorIndex: invalid arguments: ",{point:n,observer:t}),0;const i=[];t.forEach(s=>{var a,l,c;const o=(l=(a=s.floorIndex)!=null?a:s.floor_index)!=null?l:0;i[o]||(i[o]=[]),i[o].push(xc(s.position,(c=e.options)==null?void 0:c.transform).y)});const r=i.map(s=>s.reduce((o,a)=>o+a,0)/s.length);for(let s=r.length-1;s>0;s--)if(n.y>=r[s])return s;return 0}class Sc{constructor(){v(this,"cache_raycasterDistance",new Map);v(this,"cache_visible",new Map)}clear(){this.cache_visible.clear(),this.cache_raycasterDistance.clear()}static generateCameraTagKey(n,t,i=3){const r=R(R({},t.five.getCurrentState()),n),s=r.mode==="Panorama"?t.workUtil.getObserverPosition(r.panoIndex):t.five.camera.position;return s?[s.x.toFixed(i),s.y.toFixed(i),s.z.toFixed(i),t.id].join(","):void 0}getVisible(n,t,i=1){const r=Sc.generateCameraTagKey(t,n,i);if(r)return this.cache_visible.get(r)}setVisible(n,t,i,r=1){const s=Sc.generateCameraTagKey(t,n,r);s&&this.cache_visible.set(s,i)}}class Yg{constructor(n,t){v(this,"plugin");v(this,"id");v(this,"contentType");v(this,"stickType");v(this,"enabled");v(this,"config");v(this,"data");v(this,"state");v(this,"temporaryState",{visible:!0});v(this,"originPosition");v(this,"position");v(this,"fiveState");v(this,"model");v(this,"matrix");v(this,"screenPosition");v(this,"normal");v(this,"mediaPlane");v(this,"hooks");v(this,"zIndex");v(this,"play");v(this,"pause");v(this,"tag3DContentSvelte");v(this,"dom");v(this,"contentDom");v(this,"initialConfig");v(this,"computedConfig");v(this,"cache");v(this,"entryFromModel");var l,c,h,u;this.plugin=n;const i=Bg(t);t.stickType=i;const r=JSON.parse(JSON.stringify(t.data)),s=(l=t.initialConfig)!=null?l:t.config?JSON.parse(JSON.stringify(t.config)):{};t.initialConfig=s;const o=hp(t,n.config),a=this.getConfig(t);t.config=a,this.id=(c=t.id)!=null?c:xn(),this.enabled=(h=t.enabled)!=null?h:!0,this.contentType=t.contentType,this.data=(u=a.initialData)!=null&&u.important?Ht(t.data,r,a.initialData):Ht(t.data,a.initialData,r),this.state=R({visible:void 0,unfolded:!this.can("fold")},a.initialState),this.originPosition=t.position,t.originPosition=this.originPosition,this.position=(()=>{const d=t.originPosition;if(!d)return;const f=n.workUtil.transform;return Array.isArray(d)&&d.length===4?d.map(Ft).map(m=>xc(m,f).toArray()):xc(Ft(d),f).toArray()})(),this.matrix=t.matrix?(()=>{const d=new E.Matrix4().fromArray(t.matrix);return d.premultiply(n.workUtil.transform),d.elements})():t.matrix,this.initialConfig=s,this.computedConfig=o,this.stickType=i,this.config=t.config,this.fiveState=t.fiveState,this.normal=t.normal,this.cache=new Sc,this.hooks=new Cn,Object.keys(t).forEach(d=>{this[d]===void 0&&t[d]!==void 0&&(this[d]=t[d])})}get five(){return this.plugin.five}get fiveUtil(){return this.plugin.fiveUtil}get workUtil(){return this.plugin.workUtil}get centerPosition(){const n=zm(this);return lr(...Array.isArray(n)?n:[n])}get currentConfig(){var r,s;const n=hp(this,this.plugin.config,{useCache:!0}),t=this.five.getCurrentState().mode,i=(r=n.configWithFiveMode)==null?void 0:r[t];return(s=i!=null?i:n)!=null?s:{}}get currentVisible(){return!(!this.plugin.state.enabled||!this.plugin.state.visible||!this.enabled||!this.state.visible)}get sharedCache(){return this.plugin.cache}applyVisible(){throw new Error("Method not implemented.")}find(n){return ee(this,null,function*(){var r;const t=this.fiveState;if(!this.fiveState)return;const i=(r=n==null?void 0:n.targetMode)!=null?r:this.five.state.mode;if(i==="Panorama"){const s=t==null?void 0:t.panoIndex;if(kr(s))return;const o=this.workUtil.getObserverPosition(s),a=this.centerPosition.clone().sub(o).normalize();this.five.setState(R({mode:"Panorama",workCode:this.workUtil.workCode,panoIndex:s},zc(a))),yield this.five.ready()}else i==="Mapview"&&(yield $w(this.five,this.centerPosition,n==null?void 0:n.pointConfig))})}blink(n){return ee(this,null,function*(){var a,l,c,h;const t=(a=this.enabled)!=null?a:!0,i=(l=this.state)==null?void 0:l.visible,r=t&&i;r===!1&&(this.state.visible=!0,this.enabled=!0,this.applyVisible(),this.plugin.render(),this.computeRenderType()!=="Mesh"?yield new Promise(u=>ee(this,null,function*(){if(this.dom||this.contentDom){u();return}const d=setInterval(()=>{(this.dom||this.contentDom)&&(u(),clearInterval(d))},16.7)})):this.stickType==="Model"&&!((c=this.model)!=null&&c.object)?yield(h=this.model)==null?void 0:h.promise:this.stickType==="Plane"&&(yield new Promise(u=>ee(this,null,function*(){if(this.mediaPlane){u();return}const d=setInterval(()=>{this.mediaPlane&&(u(),clearInterval(d))},16.7)}))),this.dom&&(this.dom.style.visibility="hidden"),this.contentDom&&(this.contentDom.style.visibility="hidden"));const s=(()=>{var d;const u=[];return u.push(this.dom),this.stickType!=="2DPoint"&&u.push(this.contentDom),u.push((d=this.model)==null?void 0:d.object),u.push(this.mediaPlane),u.filter(Boolean)})();if(!s.length){console.warn("tagDom is empty");return}yield(r?Td:Kw)(s,R({begin:()=>{r===!1&&(this.dom&&(this.dom.style.visibility=""),this.contentDom&&(this.contentDom.style.visibility=""))},updateRender:()=>{this.five.needsRender=!0}},n)).finished,t===!1&&(this.enabled=!1,this.updateVisible()),i===!1&&this.updateVisible(),r===!1&&(this.dom&&(this.dom.style.visibility=""),this.contentDom&&(this.contentDom.style.visibility=""))})}unfold(){}unfoldAndFoldOthers(){}fold(){}enable(){this.enabled=!0,this.hooks.emit("enable"),this.applyVisible()}disable(){this.enabled=!1,this.hooks.emit("disable"),this.applyVisible()}changeData(n,t=!0){return this.setData(n,t)}changePosition(n){return this.setPosition(n)}setData(n,t=!0){t?this.data=Ht(this.data,n):this.data=R(R({},this.data),n),this.hooks.emit("dataChanged",this.data)}setPosition(n){throw new Error("Method not implemented.")}set(n,t=!0){this.plugin.tagsLengthWillUpdate=!0,t?Ht(this,n):Object.assign(this,n),this.cache.clear()}updateConfig(){var i;const n=this.getConfig(void 0,{useCache:!1});this.computedConfig=n;const t=this.getConfig();if(this.config=t,this.config.initialData){const r=JSON.parse(JSON.stringify(this.data));this.data=(i=t.initialData)!=null&&i.important?Ht(this.data,r,t.initialData):Ht(this.data,t.initialData,r)}this.cache.clear()}updateVisible(){this.state.visible=this.getVisible(),this.applyVisible()}updateZIndex(){const n=this.getDistance();this.zIndex=Math.round((1e4-(n!=null?n:0))*100)}getConfig(n,t){var o,a,l;const i=hp(n!=null?n:this,this.plugin.config,{useCache:t==null?void 0:t.useCache}),r=(o=t==null?void 0:t.fiveMode)!=null?o:this.five.getCurrentState().mode,s=(a=i.configWithFiveMode)==null?void 0:a[r];return(l=s!=null?s:i)!=null?l:{}}getDistance(n,t=3){const i=R(R({},this.five.getCurrentState()),n),{panoIndex:r,mode:s}=i,o=s==="Panorama"?this.workUtil.getObserverPosition(r):this.five.camera.position,a=this.centerPosition;return!o||!a?-1:o.distanceTo(a)}getVisible(n){if(!this.enabled||!this.plugin.state.enabled||!this.fiveUtil.model)return!1;const t=R(R({},this.five.getCurrentState()),n);let i=this.cache.getVisible(this,t);return kr(i)&&(i=this.computeVisible(t).value,this.cache.setVisible(this,t,i)),i}getUnfoldedByPanoIndex(n){if(!this.currentVisible)return;const i=this.computeUnfoldedByPanoIndex(n);return i&&this.getUnfoldedByCamera()}getUnfoldedByCamera(){return this.currentVisible?this.computeUnfoldedByCamera():void 0}can(n){const t=this.currentConfig;if(!t||typeof t!="object")return!0;if(n==="show"||n==="hide"){if(!t.visibleConfig||typeof t.visibleConfig!="object")return!0;if(n==="show"&&t.visibleConfig.keep==="hidden"||n==="hide"&&(t.visibleConfig.keep==="visible"||t.visibleConfig.alwaysShowWhenMovePano))return!1}if(n==="fold"||n==="unfold"){if(!t.unfoldedConfig||typeof t.unfoldedConfig!="object")return!0;if(n==="fold"&&t.unfoldedConfig.keep==="unfolded"||n==="unfold"&&t.unfoldedConfig.keep==="folded")return!1}return!0}onClick(n){}computeRenderType(){const n=(()=>{if(this.stickType==="3DPoint")return"Dom";const t=this.getConfig();if(!t||typeof t!="object"||!t.renderType)return;const i=this.data.mediaData;if(!(!i||i.length===0)&&t.renderType==="Mesh"){if(DO(this)){if(i.length===1){if(i[0].type==="Video")return navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&navigator.userAgent.toLowerCase().indexOf("mobile")>-1?"Dom":"Mesh";if(i[0].type==="Image")return a1(i[0].url)==="gif"?"Dom":"Mesh"}}else if($i(this))return i.length===1&&i[0].type==="Image"?a1(i[0].url)==="gif"?"Dom":"Mesh":"BehindDom"}})();return n!=null?n:"Dom"}computeVisible(n){const t=R(R({},this.five.getCurrentState()),n),{panoIndex:i,mode:r}=t,s=[];return(()=>{var c,u,d;const l=(c=this.getConfig().visibleConfig)!=null?c:{};if(typeof l=="function")return{value:l(this.five,{tag:this,distance:this.getDistance(t,void 0)}),checkedList:s,reason:"config function result"};{if(l.keep==="hidden")return{value:!1,checkedList:s,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,checkedList:s,reason:"config.keep is visible"};const f=this.computeVisibleByFiveMode(l,r);if((f==null?void 0:f.value)===!1)return f;if(l.followModelVisibility===!0&&["poincare","aerophoto","sand"].includes(this.workUtil.fromType)&&(r==="Floorplan"||r==="Mapview")){const h=this.computeVisibleByFloorIndex(),{value:m}=h,p=Ps(h,["value"]);if(m===!1)return R({value:!1,checkedList:s,reason:"followModelVisibility check failed"},p)}if(Vs(r)&&l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&i!==void 0){if(s.push("visiblePanoIndex"),Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(i))return{value:!1,checkedList:s,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${i}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&i!==((u=this.fiveState)==null?void 0:u.panoIndex))return{value:!1,checkedList:s,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${i}, tag.panoIndex: ${(d=this.fiveState)==null?void 0:d.panoIndex}`}}if(l.visibleDistance!==void 0&&(s.push("visibleDistance"),l.visibleDistance!=="unLimited")){const m=this.getDistance(t,1);if(Kh(m,l.visibleDistance)===!1)return{value:!1,checkedList:s,panoIndex:i,visibleDistance:l.visibleDistance,reason:`distance is not in visibleDistance. distance: ${m}, visibleDistance: ${l.visibleDistance.min} - ${l.visibleDistance.max}`}}if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s.push("intersectRaycaster"),i===void 0)return{value:!1,checkedList:s,reason:`intersectRaycaster check failed: panoIndex is ${i}`};const m=this.computeVisibleByIntersect(i);if(m.value===!1)return Object.assign(m,{checkedList:s})}return{value:!0,checkedList:s,reason:"all check passed"}}})()}computeVisibleByFiveMode(n,t){const i=()=>{var o,a;let s=typeof n.visibleFiveMode=="function"?n.visibleFiveMode(this):n.visibleFiveMode;if(s||(s=(a=(o=this.fiveState)==null?void 0:o.mode)!=null?a:this.workUtil.observers.length?"Panorama":"ModelLike"),Array.isArray(s))return s.includes(t);if(s==="ModelLike")return _i(t);if(s==="PanoramaLike")return!Vs(t);if(s==="all")return!0;if(typeof s=="string")return s===t};if((()=>{var o;const s=i();if(bt((o=this.fiveState)==null?void 0:o.panoIndex)&&n.entryFromModel){if(_i(t)&&s?this.entryFromModel=!1:this.entryFromModel=!0,_i(t))return!0}else this.entryFromModel=!1;return s})()===!1)return{value:!1,reason:"current mode is not included in visibleFiveMode",visibleFiveMode:n.visibleFiveMode,mode:t}}computeVisibleByIntersect(n){var l,c,h,u;const t=so(so((l=this.getConfig().visibleConfig)!=null?l:{}).intersectRaycaster),i=n!=null?n:this.five.getCurrentState().panoIndex,r=Vs(this.five.getCurrentState().mode)?this.workUtil.getObserverPosition(i):this.five.camera.position;if(r===void 0)return{value:!1,reason:{type:"startPosition is undefined",fivePanoIndex:i}};const s=zr((()=>{var f;const d=(f=t.checkPoints)!=null?f:"center";return d==="center"?Qb(this):d==="corner"?zm(this):Array.isArray(d)?d:[]})());let o=0,a=0;for(const d of s){const f=new E.Vector3().subVectors(d,r).normalize();let m;rs.set(r,f);const[p]=this.fiveUtil.model.intersectRaycaster(rs);m=p==null?void 0:p.distance;const g=(()=>{if(!$i(this))return;const x=this.plugin.tags.filter($i).map(P=>{var S;return(S=P.model)==null?void 0:S.object}).filter(bt),[M]=rs.intersectObjects(x,!0);return M})(),y=r.distanceTo(d),b=(c=t.distanceAccuracy)!=null?c:.01;m=Math.min(m!=null?m:1/0,(h=g==null?void 0:g.distance)!=null?h:1/0),m+b>=y?o++:a++;const w=(u=t.needPassed)!=null?u:1;if(o>=w)return{value:!0}}return a===0?{value:!0}:{value:!1,reason:{type:"intersectRaycaster check failed",passedCount:o,needPassed:t.needPassed,model:this.fiveUtil.model.name}}}computeVisibleByFloorIndex(){var r,s,o,a,l,c,h;let n=0;const t=(r=this.fiveState)==null?void 0:r.panoIndex;t!==void 0?n=(s=this.workUtil.getObserver(t))==null?void 0:s.floorIndex:n=gF(this.workUtil.work,(h=(c=(a=(o=this.model)==null?void 0:o.object)==null?void 0:a.position)!=null?c:(l=this.mediaPlane)==null?void 0:l.position)!=null?h:Qb(this));const i=this.fiveUtil.model.shownFloor;return{value:i===null||i===n,currentFiveFloorIndex:i,tagFloorIndex:n}}computeUnfoldedByPanoIndex(n){const t=this.getConfig().unfoldedConfig;if(t){if(typeof t=="function")return t(this.five,{tag:this,distance:this.getDistance({panoIndex:n})});if(t.keep==="folded")return!1;if(t.keep==="unfolded")return!0;if(t.unfoldDistance&&Kh(this.getDistance({panoIndex:n}),t.unfoldDistance)===!1)return!1}}computeUnfoldedByCamera(){var t;if(this.entryFromModel&&_i(this.five.state.mode))return!1;const n=this.getConfig().unfoldedConfig;if(n){if(typeof n=="function")return n(this.five,{tag:this,distance:this.getDistance()});if(n.keep==="folded")return!1;if(n.keep==="unfolded")return!0;if(n.autoUnfold===void 0||n.autoUnfold===!1||n.autoUnfold.enable===!1||!n.autoUnfold.strategy)return;if(n.autoUnfold.strategy==="ScreenPostion"){const i=this.computeTagProject();if(i&&Kh(i.x,n.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(n.autoUnfold.strategy==="MinimumDistance"){const s=this.plugin.filterPointTag.filter(a=>a.currentVisible).filter(a=>{const l=this.computeTagProject();if(!l)return!1;const{x:c,y:h,z:u}=l;return!(Math.abs(u)>1||Math.abs(c)>1||Math.abs(h)>1)}).map(a=>({tag:a,id:a.id,tagConfig:a.getConfig().unfoldedConfig})).filter(({tagConfig:a})=>{var l,c;return!(typeof a=="function"||a.keep||a.autoUnfold===!1||((l=a.autoUnfold)==null?void 0:l.enable)===!1||((c=a.autoUnfold)==null?void 0:c.strategy)!=="MinimumDistance")}).map(a=>Ee(R({},a),{distance:a.tag.getDistance()})).filter(({distance:a,tagConfig:l})=>{const c=l.autoUnfold.distance;return!(c&&Kh(a,c)===!1)}).sort((a,l)=>a.distance-l.distance).findIndex(a=>a.id===this.id);if(s===-1||s<=((t=n.autoUnfold.maxNumber)!=null?t:1)-1===!1)return!1}return n.autoUnfold.strategy!=="FoldWhenMove"}}computeTagProject(){const n=this.centerPosition;if(!n)return;const{x:t,y:i,z:r}=n.project(this.five.camera);if(!(r>1))return{x:t,y:i,z:r}}addObjectClickHandler(n,t,i){if(!t||!this.plugin.domEvents)return()=>{};const r=()=>!(!n.currentVisible||n.loading),s=o=>{if(!r())return!1;i(o.origDomEvent)};return this.plugin.domEvents.addEventListener(t,"click",s),()=>{var o;(o=this.plugin.domEvents)==null||o.removeEventListener(t,"click",s)}}whyHide(){var t;if(!this.plugin.state.enabled)return{reason:`plugin.state.enabled is ${this.plugin.state.enabled}`};if(!this.plugin.state.visible)return{reason:`plugin.state.visible is ${this.plugin.state.visible}`};if(!this.enabled)return{reason:`tag ${this.id} enabled is: ${this.enabled}`};const n=Ee(R({},this.computeVisible()),{tagInstance:this});return n.value!==this.state.visible?{reason:"插件故障,请联系维护人员, err: 0",info:n}:this.state.visible?{reason:"应该是能看见才对",info:n}:n.value===!0?{reason:"插件故障,请联系维护人员, err: 1",info:n}:{reason:(t=n.reason.type)!=null?t:n.reason,info:n}}destroy(){const n=this.plugin.tags.findIndex(t=>t.id===this.id);if(n===-1){console.warn(`Destroy failed: tag ${this.id} not found`);return}this.disable(),this.hooks.off(),this.cache.clear(),this.plugin.tags.splice(n,1),this.plugin.tagsLengthWillUpdate=!0,this.plugin.hooks.emit("tagsLengthChange")}}class RM extends Yg{constructor(t,i){super(t,i);v(this,"loading",!1);v(this,"loadModel",()=>ee(this,null,function*(){var o;const t=this.data.modelUrl;if(!t)return;this.loading=!0;const i=hF(t).then(a=>ee(this,null,function*(){var h;const l=Object.assign(a.scene,{customID:this.id,isTagModel:!0,removeEventListener:this.getConfig().clickable===!1?()=>{}:this.addObjectClickHandler(this,a.scene,u=>{this.plugin.hooks.emit("click",{target:"TagModel",tag:this,event:u})})});return l.visible=this.currentVisible,new E.Matrix4().fromArray(this.matrix).decompose(l.position,l.quaternion,l.scale),l.updateWorldMatrix(!0,!0),l.visible=yield this.getVisible(),(h=this.getConfig().modelConfig)!=null&&h.autoLookAtEnabled&&l.lookAt(this.five.camera.position.clone().setY(l.position.y)),l}));this.model={promise:i};const r=yield i;if(this.loading=!1,((o=this.model)==null?void 0:o.promise)!==i||!this.plugin.tags.includes(this))return;this.model.object=r;const s=this.plugin.gltfObjectGroup.children.find(a=>a.customID===this.id);if(s&&(this.plugin.gltfObjectGroup.remove(s),s.removeEventListener()),this.plugin.updateRender3DDomTag(),$i(this)){if(this.computeRenderType()==="Mesh"&&!this.mediaPlane){const a=this.data.mediaPosition.map(os);this.mediaPlane=new SM(this.data.mediaData[0].url,this.data.mediaPosition.map(os),{objectFit:this.data.objectFit});const l=new E.Vector3().addVectors(a[0],a[2]).divideScalar(2);this.mediaPlane.position.copy(l),r.add(this.mediaPlane)}this.computeRenderType()!=="Mesh"&&(r.updateTagCss3DObjectMatrix=()=>this.plugin.updateTagCss3DObjectMatrix(this,r),r.updateTagCss3DObjectMatrix())}return this.plugin.gltfObjectGroup.add(r),r}));this.state.unfolded=!0}applyVisible(){var t,i,r;(t=this.model)!=null&&t.object&&(this.model.object.visible=this.currentVisible),(i=this.tag3DContentSvelte)==null||i.svelteApp.$set({tag:this,state:this.plugin.state}),(r=this.tag3DContentSvelte)==null||r.css3DInstance.setVisible(this.currentVisible)}computeNormal(){return sM(this.data.mediaPosition)}}function vF(e){Ue(e,"svelte-elzzn6",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAA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UnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-elzzn6{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif;transition:opacity 0.2s linear}.content__container.unClickable.svelte-elzzn6{pointer-events:none !important}.content__container.unClickable.svelte-elzzn6 *{pointer-events:none !important}.content__wrapper.svelte-elzzn6{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-elzzn6{opacity:0;pointer-events:none}.content__container.hide.svelte-elzzn6 *{pointer-events:none !important}.content__container.disable.svelte-elzzn6{display:none}.content.svelte-elzzn6{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-elzzn6:not(.unfolded){pointer-events:none}.content.svelte-elzzn6:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-elzzn6{pointer-events:auto}')}function yF(e){let n,t;return{c(){n=j("div"),_(n,"data-info","tag content is keep folded"),_(n,"data-id",t=e[0].id)},m(i,r){Z(i,n,r)},p(i,r){r&1&&t!==(t=i[0].id)&&_(n,"data-id",t)},i:de,o:de,d(i){i&&Y(n)}}}function bF(e){let n,t,i,r,s,o,a,l,c,h,u,d,f,m,p,g,y;const b=[_F,PF,CF,EF,MF,xF,wF],A=[];function w(x,M){return M&9&&(r=null),M&9&&(s=null),M&9&&(o=null),M&9&&(a=null),M&9&&(l=null),M&9&&(c=null),M&9&&(h=null),r==null&&(r=!!(["Text"].includes(x[0].contentType)||["Text"].includes(x[3].get(x[0].contentType)))),r?0:(s==null&&(s=!!(["ImageText","Image","Video"].includes(x[0].contentType)||["ImageText","Image","Video"].includes(x[3].get(x[0].contentType)))),s?1:(o==null&&(o=!!(["Audio"].includes(x[0].contentType)||["Audio"].includes(x[3].get(x[0].contentType)))),o?2:(a==null&&(a=!!(["Marketing"].includes(x[0].contentType)||["Marketing"].includes(x[3].get(x[0].contentType)))),a?3:(l==null&&(l=!!(["Link","VRLink","PanoLink","Sticker"].includes(x[0].contentType)||["Link","VRLink","PanoLink","Sticker"].includes(x[3].get(x[0].contentType)))),l?4:(c==null&&(c=!!(["MediaPlane","MediaModel"].includes(x[0].contentType)||["MediaPlane","MediaModel"].includes(x[3].get(x[0].contentType)))),c?5:(h==null&&(h=!!(["Panorama"].includes(x[0].contentType)||["Panorama"].includes(x[3].get(x[0].contentType)))),h?6:-1))))))}return~(u=w(e,-1))&&(d=A[u]=b[u](e)),{c(){var x;n=j("div"),t=j("div"),i=j("div"),d&&d.c(),_(i,"class","content svelte-elzzn6"),Ce(i,"unfolded",(x=e[0].state)==null?void 0:x.unfolded),_(t,"class","content__wrapper svelte-elzzn6"),_(n,"class",f=on(qn("content__container",e[0].className))+" svelte-elzzn6"),_(n,"data-id",m=e[0].id),Ce(n,"disable",e[0].enabled===!1),Ce(n,"hide",e[5]),Ce(n,"unClickable",e[0].config.clickable===!1),W(n,"width",e[0].stickType==="Plane"||e[0].contentType==="MediaModel"?"100%":0),W(n,"height",e[0].stickType==="Plane"||e[0].contentType==="MediaModel"?"100%":0)},m(x,M){Z(x,n,M),Q(n,t),Q(t,i),~u&&A[u].m(i,null),e[16](n),p=!0,g||(y=ot(n,"click",e[17],!0),g=!0)},p(x,M){var S;let P=u;u=w(x,M),u===P?~u&&A[u].p(x,M):(d&&(Ve(),X(A[P],1,1,()=>{A[P]=null}),Ge()),~u?(d=A[u],d?d.p(x,M):(d=A[u]=b[u](x),d.c()),F(d,1),d.m(i,null)):d=null),(!p||M&1)&&Ce(i,"unfolded",(S=x[0].state)==null?void 0:S.unfolded),(!p||M&1&&f!==(f=on(qn("content__container",x[0].className))+" svelte-elzzn6"))&&_(n,"class",f),(!p||M&1&&m!==(m=x[0].id))&&_(n,"data-id",m),(!p||M&1)&&Ce(n,"disable",x[0].enabled===!1),(!p||M&33)&&Ce(n,"hide",x[5]),(!p||M&1)&&Ce(n,"unClickable",x[0].config.clickable===!1),M&1&&W(n,"width",x[0].stickType==="Plane"||x[0].contentType==="MediaModel"?"100%":0),M&1&&W(n,"height",x[0].stickType==="Plane"||x[0].contentType==="MediaModel"?"100%":0)},i(x){p||(F(d),p=!0)},o(x){X(d),p=!1},d(x){x&&Y(n),~u&&A[u].d(),e[16](null),g=!1,y()}}}function AF(e){let n,t,i,r,s,o,a;return t=new lF({props:{tag:nn(e[0]),rendererMap:e[2]}}),{c(){n=j("div"),Ie(t.$$.fragment),_(n,"class",i=on(qn("content__container",e[0].className))+" svelte-elzzn6"),_(n,"data-id",r=e[0].id),Ce(n,"custom-tag-disable",e[0].enabled===!1),Ce(n,"custom-tag-hide",e[5])},m(l,c){Z(l,n,c),_e(t,n,null),e[14](n),s=!0,o||(a=ot(n,"click",e[15]),o=!0)},p(l,c){const h={};c&1&&(h.tag=nn(l[0])),c&4&&(h.rendererMap=l[2]),t.$set(h),(!s||c&1&&i!==(i=on(qn("content__container",l[0].className))+" svelte-elzzn6"))&&_(n,"class",i),(!s||c&1&&r!==(r=l[0].id))&&_(n,"data-id",r),(!s||c&1)&&Ce(n,"custom-tag-disable",l[0].enabled===!1),(!s||c&33)&&Ce(n,"custom-tag-hide",l[5])},i(l){s||(F(t.$$.fragment,l),s=!0)},o(l){X(t.$$.fragment,l),s=!1},d(l){l&&Y(n),Se(t),e[14](null),o=!1,a()}}}function wF(e){let n,t;return n=new iF({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function xF(e){let n,t;return n=new zN({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function MF(e){let n,t;return n=new $N({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function EF(e){let n,t;return n=new cN({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function CF(e){let n,t;return n=new LN({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function PF(e){let n,t;return n=new sN({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function _F(e){let n,t;return n=new Ez({props:{tag:nn(e[0])}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=nn(i[0])),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function SF(e){let n,t,i,r,s;const o=[AF,bF,yF],a=[];function l(c,h){return h&5&&(n=null),n==null&&(n=!!(c[0].element||c[2].has(c[0].contentType))),n?0:c[4]?1:2}return t=l(e,-1),i=a[t]=o[t](e),{c(){i.c(),r=ft()},m(c,h){a[t].m(c,h),Z(c,r,h),s=!0},p(c,[h]){let u=t;t=l(c,h),t===u?a[t].p(c,h):(Ve(),X(a[u],1,1,()=>{a[u]=null}),Ge(),i=a[t],i?i.p(c,h):(i=a[t]=o[t](c),i.c()),F(i,1),i.m(r.parentNode,r))},i(c){s||(F(i),s=!0)},o(c){X(i),s=!1},d(c){a[t].d(c),c&&Y(r)}}}function IF(e,n,t){let i,r,s,o,a,l,{tag:c}=n,{hooks:h}=n,{rendererMap:u=new Map}=n,{contentTypeMap:d=new Map}=n,{state:f}=n,{mediaStore:m}=n,{temporaryState:p}=n;Em("hooks",h),Em("mediaStore",m);let g,y;function b(S){S?h.emit("exposure",{id:o,type:"start"}):h.emit("exposure",{id:o,type:"end"})}function A(S,T,z){var D,k;return!(!T.visible||!T.enabled||!z.visible||!((D=S.state)!=null&&D.visible)||((k=S.temporaryState)==null?void 0:k.visible)===!1||S instanceof RM&&S.loading)}function w(S){Qt[S?"unshift":"push"](()=>{c.contentDom=S,t(0,c)})}const x=S=>h.emit("click",{event:S,target:"TagContent",tag:c});function M(S){Qt[S?"unshift":"push"](()=>{c.contentDom=S,t(0,c)})}const P=S=>{c.entryFromModel&&_i(c.five.state.mode)?(S.stopPropagation(),c.find({targetMode:"Panorama"})):h.emit("click",{event:S,target:"TagContent",tag:c})};return e.$$set=S=>{"tag"in S&&t(0,c=S.tag),"hooks"in S&&t(1,h=S.hooks),"rendererMap"in S&&t(2,u=S.rendererMap),"contentTypeMap"in S&&t(3,d=S.contentTypeMap),"state"in S&&t(6,f=S.state),"mediaStore"in S&&t(7,m=S.mediaStore),"temporaryState"in S&&t(8,p=S.temporaryState)},e.$$.update=()=>{var S,T,z,D,k,O,G,I,U,J,K;e.$$.dirty&1&&t(12,i=(S=c.state)==null?void 0:S.unfolded),e.$$.dirty&1&&t(11,r=(T=c.state)==null?void 0:T.visible),e.$$.dirty&321&&t(13,s=f.visible&&p.visible&&((z=c.state)==null?void 0:z.visible)),e.$$.dirty&1&&(o=c.id),e.$$.dirty&321&&t(5,a=!A(c,f,p)),e.$$.dirty&8192&&b(s),e.$$.dirty&7681&&c.hooks&&(i!==void 0&&i!==y&&(t(10,y=i),i?(k=(D=c.hooks).emit)==null||k.call(D,"unfolded"):(G=c==null?void 0:(O=c.hooks).emit)==null||G.call(O,"folded")),r!==void 0&&r!==g&&(t(9,g=r),r?(U=(I=c.hooks).emit)==null||U.call(I,"show"):(K=(J=c.hooks).emit)==null||K.call(J,"hide"))),e.$$.dirty&1&&t(4,l=(()=>!(typeof c.config.unfoldedConfig=="object"&&c.config.unfoldedConfig.keep==="folded"))())},[c,h,u,d,l,a,f,m,p,g,y,r,i,s,w,x,M,P]}let OM=class extends ke{constructor(n){super(),Le(this,n,IF,SF,De,{tag:0,hooks:1,rendererMap:2,contentTypeMap:3,state:6,mediaStore:7,temporaryState:8},vF)}};const TF={globalConfig:{visibleConfig:{followModelVisibility:!0},unfoldedConfig:{autoUnfold:{enable:!0,strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"[Mapview]":{unfoldedConfig:{autoUnfold:{enable:!1,distance:{max:9999}}}},"[Floorplan]":{unfoldedConfig:{autoUnfold:{enable:!1,distance:{max:9999}}}},"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"}},Link:{unfoldedConfig:{keep:"unfolded"}},Panorama:{unfoldedConfig:{keep:"unfolded"}},VRLink:{unfoldedConfig:{keep:"unfolded"}},PanoLink:{unfoldedConfig:{keep:"unfolded"}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0},initialData:{autoplayConfig:{autoplayCarousel:!0,autoplayVideo:!1,autoplayVideoInCarousel:!1}}},"Model-Any":{unfoldedConfig:{keep:"unfolded"},visibleConfig:{visibleFiveMode:"all",alwaysShowWhenMovePano:!0}}}};class l1 extends E.Raycaster{intersectObject(n,t=!0,i=[]){return Nm(n,this,i,t),i.sort(c1),i}intersectObjects(n,t=!0,i=[]){for(let r=0,s=n.length;r<s;r++)Nm(n[r],this,i,t);return i.sort(c1),i}}function c1(e,n){return e.distance-n.distance}function Nm(e,n,t,i){let r=!0;if(e.layers.test(n.layers)&&e.raycast(n,t)===!1&&(r=!1),r===!0&&i===!0){const s=e.children;for(let o=0,a=s.length;o<a;o++)Nm(s[o],n,t,!0)}}function Xg(e,n,t,i){let r=!0;if(e.type!=="Line2"&&(e.layers.test(n.layers)&&e.raycast(n,t)===!1&&(r=!1),r===!0&&i===!0)){const s=e.children;for(let o=0,a=s.length;o<a;o++)s[o].type!=="Line2"&&Xg(s[o],n,t,!0)}}class Zg{constructor(n,t){v(this,"five");v(this,"dragging",!1);v(this,"boundObject",{});v(this,"config");v(this,"lastMouseDownEvent");v(this,"lastTouchEvent");v(this,"handleWantsGesture",(n,t)=>{if(t.length!==1)return;const i=t[0];if(i.raycaster){const r=new l1;r.ray=i.raycaster.ray,r.near=i.raycaster.near,r.far=i.raycaster.far,r.camera=i.raycaster.camera,r.layers=i.raycaster.layers,r.params=i.raycaster.params,i.raycaster=r}if(i){if(n==="mouseMove"&&this.onDomEvent("hover",i),n==="tap"){let r;!r&&!Pc&&(r=this.lastMouseDownEvent),!r&&Pc&&(r=this.lastTouchEvent),r||(r=new MouseEvent("click",{clientX:i.x,clientY:i.y}));const s=this.onDomEvent("click",i,r),o=this.onDomEvent("wantDblclick",i,r,this.boundObject.dblclick);if(s===!1||o===!1)return!1}if(this.dragging)return!1}});v(this,"handleDomEvent",(n,t,i)=>{const r={x:t.clientX,y:t.clientY};this.onDomEvent(n,r,t,i)});v(this,"handleMouseEvent",n=>{this.handleDomEvent(n.type,n)});v(this,"handleMousedown",n=>{this.lastMouseDownEvent=n,this.handleDomEvent("mousedown",n),this.handleDomEvent("dragstart",n,this.haveDragEventObject)});v(this,"handleTouchStart",n=>{this.lastTouchEvent=n});v(this,"handleMouseup",n=>{var t;this.dragging=!1,(t=this.haveDragEventObject)==null||t.forEach(i=>{i._dragging&&(i._dragging=!1,this.notify({eventName:"dragend",object:i,originEvent:n,raycaster:this.getRaycaster({x:n.clientX,y:n.clientY})}))}),this.handleDomEvent("mouseup",n)});v(this,"handleMousemove",n=>{var t;this.dragging&&((t=this.boundObject.drag)==null||t.forEach(i=>{i._dragging&&this.notify({eventName:"drag",object:i,originEvent:n,raycaster:this.getRaycaster({x:n.clientX,y:n.clientY})})}))});v(this,"onDomEvent",(n,t,i,r=this.boundObject[n])=>{var d,f,m,p,g;if(!t||!r||(r==null?void 0:r.length)===0)return;const s=[];((d=this.config)==null?void 0:d.fiveModels)!==null&&((f=this.config)!=null&&f.fiveModels?s.push(...this.config.fiveModels):s.push(this.model));const o=s.filter(y=>y.loaded),a=(m=t.raycaster)!=null?m:this.getRaycaster(t);a.params.Points.threshold=.02;const l=a.intersectObjects(r,!0),c=[];o.forEach(y=>{const b=y.intersectRaycaster(a);c.push(...b)});const h=.01;if(c.length>0&&l.length>0&&c[0].distance+h<l[0].distance)return;const u=(p=l==null?void 0:l[0])==null?void 0:p.object;if(n==="wantDblclick")return!1;if((!u||!this.objectIsBound(u))&&n==="hover")for(const y of(g=this.boundObject.hover)!=null?g:[])y._hovered&&this.notify({eventName:"unHover",object:y});if(u&&u&&this.notify({eventName:n,object:u,originEvent:i,raycaster:a,intersects:l}))return!1});v(this,"objectIsBound",n=>{let t=n._domEvent,i=n.parent;for(;typeof t=="undefined"&&i;)t=i._domEvent,i=i.parent;return!!t});v(this,"notify",n=>{var d,f,m;const{eventName:t,object:i,originEvent:r,raycaster:s,intersects:o}=n;let a=!1,l=[];const c=[];let h=i;for(c.push(h);h.parent;)h=h.parent,c.push(h);const u=c.at(-1);if(!((d=this.config)!=null&&d.noEmitWhenNotInScene&&u.type!=="Scene")){for(const p of c){if(a)break;p.draggable&&(t==="dragstart"&&(p._dragging=!0,this.dragging=!0),t==="dragend"&&(p._dragging=!1,this.dragging=!1));const g=p._domEvent;if(!g)continue;const y=g[`${t}Handler`];if(y)for(const[b,A]of y){if(A!=null&&A.noEmitWhenNotInScene&&u.type!=="Scene"||((f=this.config)!=null&&f.noEmitWhenHide||A!=null&&A.noEmitWhenHide)&&!Xm(p))continue;if(t==="hover"){if(p._hovered)continue;p._hovered=!0;for(const x of(m=this.boundObject.hover)!=null?m:[])x!==p&&x._hovered&&this.notify({eventName:"unHover",object:x})}if(t==="unHover"){if(!p._hovered)continue;p._hovered=!1}const w=b({type:t,target:p,origDomEvent:r,raycaster:s,intersects:o,stopPropagation:()=>{a=!0}});l.push(w!=null?w:!0)}}if(t==="click"||t==="wantDblclick")return l.some(p=>p===!0)}});this.five=n,this.config=t,n.on("wantsGesture",this.handleWantsGesture),document.addEventListener("mousedown",this.handleMousedown),document.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("dblclick",this.handleMouseEvent),document.addEventListener("mouseup",this.handleMouseup),document.addEventListener("mousemove",this.handleMousemove)}get haveDragEventObject(){return[...new Set([this.boundObject.dragend,this.boundObject.drag,this.boundObject.dragstart].flat())].filter(Boolean)}get model(){return ki(this.five)}addAutoBindEventListener(n,t,i,r){const s=()=>this.addEventListener(n,t,i,r),o=()=>this.removeEventListener(n,t,i,r);return n.addEventListener("added",s),n.addEventListener("removed",o),n.addEventListener("dispose",o),()=>{n.removeEventListener("added",s),n.removeEventListener("removed",o),n.removeEventListener("dispose",o)}}addEventListener(n,t,i,r){n._domEvent||(n._domEvent={}),n._domEvent[`${t}Handler`]||(n._domEvent[`${t}Handler`]=[]),this.boundObject[t]||(this.boundObject[t]=[]),this.boundObject[t].includes(n)||this.boundObject[t].push(n),n._domEvent[`${t}Handler`].push([i,R({noEmitWhenHide:!1,noEmitWhenNotInScene:!1},r)])}removeEventListener(n,t,i,...r){var o,a;if(!n._domEvent||(t===void 0&&(Object.keys(this.boundObject).forEach(l=>{var h,u;const c=(h=this.boundObject[l])==null?void 0:h.findIndex(d=>d===n);c!==-1&&((u=this.boundObject[l])==null||u.splice(c,1))}),n._domEvent={}),!n._domEvent[`${t}Handler`]))return;if(i===void 0){delete n._domEvent[`${t}Handler`];return}const s=n._domEvent[`${t}Handler`].findIndex(l=>l[0]===i);if(s!==-1&&(n._domEvent[`${t}Handler`].splice(s,1),n._domEvent[`${t}Handler`].length===0&&delete n._domEvent[`${t}Handler`],n._domEvent&&Object.keys(n._domEvent).length===0&&delete n._domEvent,!n._domEvent)){const l=(o=this.boundObject[t])==null?void 0:o.findIndex(c=>c===n);l!==-1&&((a=this.boundObject[t])==null||a.splice(l,1))}}clear(){this.boundObject={}}dispose(){var n;(n=this.five)==null||n.off("wantsGesture",this.handleWantsGesture),document.removeEventListener("mousedown",this.handleMousedown),document.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("mouseup",this.handleMouseup),document.removeEventListener("mousemove",this.handleMousemove),this.boundObject={}}toJSON(){return{boundObject:this.boundObject}}getRaycaster(n){const t=this.five.getElement();if(!t)return;const i=Yx(n,t),r=new l1;return r.setFromCamera(i,this.five.camera),r}}class DF extends ws{constructor(t){super(t);v(this,"tags",[]);v(this,"cache",new Sc);v(this,"config",TF);v(this,"renderQueue",new Map);v(this,"params");v(this,"mediaStore",Cg({currentMediaElement:null}));v(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});v(this,"domEvents",new Zg(this.five));v(this,"_cache_pointTag");v(this,"_cache_2DPointTag");v(this,"_cache_css3DTag");v(this,"_container",null);v(this,"_css3DRenderPlugin");v(this,"whyHide",t=>{const i=this.getTagById(t);return i?i.whyHide():{reason:`tag ${t} not found`}});v(this,"loadVideoFirstFrame",()=>{fF&&this.hooks.emit("loadVideoFirstFrame")});this.mediaStore.subscribe(({currentMediaElement:i})=>{this.tags.forEach(r=>{var s;if(r.mediaPlane instanceof IM&&i!==r.mediaPlane.videoInstance){if(!((s=r.mediaPlane.videoInstance)!=null&&s.src)||i===r.mediaPlane.videoInstance)return;r.mediaPlane.pause()}})})}get container(){var t;return this._container||((t=this.five.getElement())==null?void 0:t.parentElement)}set container(t){this._container=t}set tagsLengthWillUpdate(t){t&&(this._cache_pointTag=this.tags.filter(i=>i.stickType==="2DPoint"||i.stickType==="3DPoint").filter(i=>i.position),this._cache_2DPointTag=this.tags.filter(i=>i.stickType==="2DPoint").filter(i=>i.position),this._cache_css3DTag=this.tags.filter(i=>i.stickType==="3DPoint"||i.stickType==="Plane"||i.stickType==="Model"&&i.contentType==="MediaModel").filter(i=>{const r=i.computeRenderType();return r==="BehindDom"||r==="Dom"}))}get css3DRenderPlugin(){var t,i,r;if(!this._css3DRenderPlugin){const s=Nc(this.five);this._css3DRenderPlugin=s,(t=s.frontModeCSS3DRenderer)!=null&&t.domElementWrapper&&(s.frontModeCSS3DRenderer.domElementWrapper.style.zIndex=(r=(i=this.params.containerZIndex)==null?void 0:i.toString())!=null?r:"")}return this._css3DRenderPlugin}get filterPointTag(){var t;return(t=this._cache_pointTag)!=null?t:[]}get filter2DPointTag(){var t;return(t=this._cache_2DPointTag)!=null?t:[]}get filterCSS3DTag(){var t;return(t=this._cache_css3DTag)!=null?t:[]}addRenderQueue(t){var o,a;const{type:i,keys:r=[],tags:s=[]}=t;this.renderQueue.has(i)?this.renderQueue.set(i,{keys:Array.from(new Set([...(o=this.renderQueue.get(i).keys)!=null?o:[],...r])),tags:Array.from(new Set([...(a=this.renderQueue.get(i).tags)!=null?a:[],...s]))}):this.renderQueue.set(i,{keys:r,tags:s})}getTagById(t){const i=this.tags.find(r=>r.id===t);if(!i){console.warn(`getTagById Error: can't find tag id: ${t}`);return}return i}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}getPositions(t){if(SO(t))return t.position;if($i(t))return t.data.mediaPosition;if(IO(t))return LO(this.five.camera.position,Ft(t.position),Ft(t.normal))}addObjectClickHandler(t,i,r){if(!i||!this.domEvents)return()=>{};const s=()=>!(!t.currentVisible||t.loading),o=a=>{if(!s())return!1;r(a.origDomEvent)};return this.domEvents.addEventListener(i,"click",o),()=>{var a;(a=this.domEvents)==null||a.removeEventListener(i,"click",o)}}checkDisposed(){return this.store.disposed?(console.error("PanoTagPluginController has been disposed"),!0):!1}}class LF extends DF{constructor(t){super(t);v(this,"rendererMap",new Map);v(this,"contentTypeMap",new Map);v(this,"group",new ne.Group);v(this,"imagePlaneGroup",new ne.Group);v(this,"gltfObjectGroup",new ne.Group);v(this,"enabledModelTagSet",new Set);v(this,"temporaryState",{visible:!0});v(this,"TagContainerSvelte");this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.imagePlaneGroup.name="ImagePlaneGroup",this.group.add(this.gltfObjectGroup),this.group.add(this.imagePlaneGroup)}registerRenderer(t,i,r){var s;this.rendererMap.set(t,{renderer:i,usePoint:(s=r==null?void 0:r.usePoint)!=null?s:!1})}bindRenderer(t,i){this.contentTypeMap.set(t,i)}updateRender3DDomTag(t){(t?zr(t):this.filterCSS3DTag).forEach(r=>{var s,o,a,l,c,h;if(r.tag3DContentSvelte){const{svelteApp:u,css3DInstance:d,initialNormal:f,currentNormal:m}=r.tag3DContentSvelte;if((o=d==null?void 0:d.css3DObject)==null||o.setVisible((this.state.visible&&((s=r.state)==null?void 0:s.visible))!==!1),u.$set({tag:r,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!f.equals(m)){const p=new ne.Quaternion().setFromUnitVectors(f,m);d.css3DObject.setRotationFromQuaternion(p)}return}else{if($i(r)&&!((a=r.model)!=null&&a.object)||((l=r.state)==null?void 0:l.visible)===!1||!this.state.visible||!this.state.enabled||!this.css3DRenderPlugin)return;if(r.stickType==="3DPoint"&&!r.normal)return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");const u=this.getPositions(r);if(!u)return;const d=r.computeNormal();if(!d)return;const f=r.getConfig(),m=R({wrapperStyle:{zIndex:`${Math.round((1e4-((c=r.getDistance())!=null?c:0))*100)}`}},f.tag3DConfig);if(r.computeRenderType()==="BehindDom"||m.mode==="behind"){m.mode="behind",m.container=document.createElement("div");const y="black";m.container.style.backgroundColor=y,m.container.style.border=`3px solid ${y}`,this.css3DRenderPlugin.hooks.on("render",()=>{var b;if(p.css3DObject.opacityMesh&&f.clickable!==!1){const A=this.addObjectClickHandler(r,p.css3DObject.opacityMesh,w=>{this.hooks.emit("click",{event:w,target:"TagContent",tag:r})});(b=this.store.css3DRenderDisposer.get(r.id))==null||b.push(A)}})}const p=this.css3DRenderPlugin.create3DDomContainer(u,m);if(!p)return;this.store.css3DRenderDisposer.set(r.id,[p.dispose]);const g=new OM({target:p.container,props:{tag:r,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}});r.tag3DContentSvelte={svelteApp:g,domContainer:p,css3DInstance:p,initialNormal:d,currentNormal:d,dispose:()=>{g.$destroy(),p.dispose()}},$i(r)&&((h=r.model)!=null&&h.object)&&this.updateTagCss3DObjectMatrix(r,r.model.object)}}),this.clearUnusedPanelTag()}updateTagCss3DObjectMatrix(t,i){var p,g,y;const r=(g=(p=t.getConfig().tag3DConfig)==null?void 0:p.ratio)!=null?g:.00216,s=(y=t.tag3DContentSvelte)==null?void 0:y.css3DInstance.css3DObject;if(!s)return;const o=$i(t)?t.data.mediaPosition:t.position;if(!o||o.length!==4||!Array.isArray(o[0])||!Array.isArray(o[2]))return;i.updateWorldMatrix(!1,!1);const a=i.matrixWorld,l=new ne.Vector3().fromArray(o[0]),c=new ne.Vector3().fromArray(o[2]),h=lr(l,c).add(new ne.Vector3(0,0,5e-4)),u=new ne.Matrix4().setPosition(h),d=new ne.Matrix4().makeScale(r,r,r),f=new ne.Matrix4().multiply(a).multiply(u).multiply(d);f.decompose(s.position,s.quaternion,s.scale);const m=s.opacityMesh;m&&f.decompose(m.position,m.quaternion,m.scale)}disposeAllCSS3DContainer(){for(const[,t]of this.store.css3DRenderDisposer)t==null||t.forEach(i=>i==null?void 0:i());this.store.css3DRenderDisposer=new Map}clearUnusedPanelTag(){this.filter2DPointTag.forEach(t=>{var i;(i=t.tag3DContentSvelte)==null||i.css3DInstance.dispose(),t.tag3DContentSvelte=void 0});for(const[t,i]of this.store.css3DRenderDisposer){const r=this.getTagById(t);(!r||r.stickType==="2DPoint")&&(i==null||i.forEach(s=>s==null?void 0:s()),this.store.css3DRenderDisposer.delete(t))}}}class kF{constructor(n){v(this,"plugin");v(this,"logBinded",!1);this.plugin=n}get debug(){return this.plugin.debug}addDebugPoints(){try{_O(this.plugin.five,this.plugin.tags)}catch(n){console.error(n)}}bindLog(){if(this.logBinded)return;this.logBinded=!0;const n=t=>{Object.getOwnPropertyNames(t).forEach(i=>{typeof t[i]=="function"&&(t[i]=new Proxy(t[i],{apply:(r,s,o)=>(["render"].includes(i)||this.addLog(i,...o),r.apply(s,o))}))})};n(this.plugin),n(this.plugin.constructor.prototype)}addLog(n,...t){if(this.debug){let i=new Error().stack;console.debug(`%cPanoTagPlugin%c${n}`,"background-color: #35e0ed; color: black; padding:0 6px; border-radius: 3px","padding: 0 3px; color: #f3f47c",...t,{stack:i})}}closeIntersectRaycaster(){this.plugin.tags.forEach(n=>{var t;so((t=n==null?void 0:n.initialConfig)==null?void 0:t.visibleConfig).intersectRaycaster&&(n.initialConfig.visibleConfig.intersectRaycaster.enabled=!1)}),this.plugin.changeGlobalConfig({visibleConfig:{intersectRaycaster:{enabled:!1}}})}}const RF=new E.Vector2;class OF extends Yg{constructor(t,i){super(t,i);v(this,"__Object__");v(this,"requestIdleCallbackId")}unfoldAndFoldOthers(){const t=this.can("fold"),i=this.can("unfold");t&&i&&(this.state.unfolded=!this.state.unfolded,this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]}),this.state.unfolded&&this.plugin.tags.forEach(r=>{r.id!==this.id&&r.fold()}))}onClick(t){t.target==="TagPoint"&&this.unfoldAndFoldOthers()}updateVisible(){if(typeof window.requestIdleCallback=="undefined"){super.updateVisible();return}const t=()=>{this.requestIdleCallbackId&&cancelIdleCallback(this.requestIdleCallbackId),this.requestIdleCallbackId=requestIdleCallback(()=>{super.updateVisible()})};let i=!1;requestIdleCallback(()=>{i=!0}),t(),setTimeout(()=>{i||(this.requestIdleCallbackId&&cancelIdleCallback(this.requestIdleCallbackId),super.updateVisible())},200)}applyVisible(){var t,i,r,s;this.currentVisible&&this.updateScreenPosition(),(r=(i=(t=this.tag3DContentSvelte)==null?void 0:t.css3DInstance)==null?void 0:i.css3DObject)==null||r.setVisible(this.currentVisible),(s=this.tag3DContentSvelte)==null||s.svelteApp.$set({state:this.plugin.state,temporaryState:this.temporaryState}),this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]})}unfold(){this.setUnfold(!0)}fold(){this.setUnfold(!1)}setUnfold(t){const i=this.can("fold"),r=this.can("unfold");i&&r&&(this.state.unfolded=t,this.hooks.emit(t?"unfolded":"folded"),this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]}))}setPosition(t){this.originPosition=t,this.position=t,this.cache.clear(),this.updateVisible(),this.updateScreenPosition(),this.updateZIndex(),this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]})}updateScreenPosition(t){var a;if(this.stickType!=="2DPoint"&&this.stickType!=="3DPoint")return;const{force:i=!1}=t!=null?t:{},r=i?this.state.visible:this.currentVisible,s=(a=this.__Object__)!=null?a:{timeoutId:void 0,inAnimation:!1};if(this.__Object__=s,!r&&this.screenPosition?(s.inAnimation=!0,s.timeoutId=setTimeout(()=>{requestAnimationFrame(()=>{this.currentVisible||(s.inAnimation=!1,this.screenPosition=null,this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]}))})},1e3)):s.timeoutId&&(clearTimeout(s.timeoutId),s.inAnimation=!1,s.timeoutId=void 0),!r&&!s.inAnimation)return;const o=this.computeTagProject();if(o){const l=(()=>{if(!this.currentConfig.simulate3D)return 1;const h=2*Math.tan(.5*this.five.camera.fov/180*Math.PI),u=this.getDistance(void 0,1);return Math.max(Math.min(1-h*u/40,1),.5)})(),c=this.five.renderer.getSize(RF);this.screenPosition={leftPx:(o.x+1)/2*c.x,topPx:(-o.y+1)/2*c.y,scale:l}}else this.screenPosition=null;this.plugin.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]})}updateUnfoldedByPanoIndex(){const t=this.getUnfoldedByPanoIndex();if(this.state&&(t!==void 0&&(this.state.unfolded=t),t&&!this.state.visible)){const i=this.getConfig();typeof i.unfoldedConfig=="object"&&i.unfoldedConfig.autoFoldWhenHide!==!1&&(this.state.unfolded=!1)}}computeNormal(){return new E.Vector3().fromArray(this.normal)}}const zF=new Map,BF=new Map;class NF extends Yg{constructor(n,t){super(n,t),this.state.unfolded=!0}applyVisible(){var t,i,r,s,o,a;this.computeRenderType()==="Mesh"?((i=(t=this.data.mediaData)==null?void 0:t[0])==null?void 0:i.type)==="Video"?this.renderVideoPlane():((s=(r=this.data.mediaData)==null?void 0:r[0])==null?void 0:s.type)==="Image"&&this.renderImagePlane():(this.tag3DContentSvelte||this.plugin.updateRender3DDomTag(),(o=this.tag3DContentSvelte)==null||o.svelteApp.$set({tag:this,state:this.plugin.state}),(a=this.tag3DContentSvelte)==null||a.css3DInstance.setVisible(this.currentVisible))}renderVideoPlane(){var a;const n=this.data.mediaData[0];if(!n)return;const{url:t}=n;if(!t)return;const i=this.currentVisible,r=(()=>!!(this.mediaPlane&&!i))(),s=(()=>!!(!this.mediaPlane&&i))(),o=(()=>!!(this.mediaPlane&&this.mediaPlane.src!==t))();if((r||o)&&this.mediaPlane&&(this.plugin.imagePlaneGroup.remove(this.mediaPlane),this.mediaPlane.dispose(),this.mediaPlane.removeFromParent(),this.mediaPlane=void 0),s||o){const l=this.position.map(os),c=new IM(t,l,{videoCoverSrc:n.videoCoverUrl,playButton:this.data.playIcon,paused:!((a=this.data.autoplayConfig)!=null&&a.autoplayVideo),objectFit:this.data.objectFit,videoTextureMap:zF,ImageTextureMap:BF,domEvents:this.plugin.domEvents});c.onVideoReady=u=>{u.addEventListener("play",()=>this.plugin.mediaStore.set({currentMediaElement:c.videoInstance}))};const h=u=>(this.five.on("renderFrame",u),()=>this.five.off("renderFrame",u));c.initialRenderHooks(h),this.mediaPlane=c,this.play=()=>c.play(),this.pause=()=>c.pause(),this.plugin.imagePlaneGroup.add(this.mediaPlane)}this.five.needsRender=!0}renderImagePlane(){const n=this.data.mediaData[0];if(!n)return;const{url:t}=n;if(!t)return;const i=this.position.map(os),r=this.currentVisible,s=(()=>!!(this.mediaPlane&&!r))(),o=(()=>!!(!this.mediaPlane&&r))(),a=(()=>!!(this.mediaPlane&&this.mediaPlane.src!==t))();(s||a)&&this.mediaPlane&&(this.plugin.imagePlaneGroup.remove(this.mediaPlane),this.mediaPlane.dispose(),this.mediaPlane.removeFromParent(),this.mediaPlane=void 0),(o||a)&&(this.mediaPlane=new SM(t,i,{objectFit:this.data.objectFit}),this.getConfig().clickable!==!1&&this.plugin.domEvents.addAutoBindEventListener(this.mediaPlane,"click",l=>{this.plugin.hooks.emit("click",{tag:this,target:"TagContent",event:l.origDomEvent})},{noEmitWhenHide:!0}),this.plugin.imagePlaneGroup.add(this.mediaPlane)),this.five.needsRender=!0}computeNormal(){return sM(this.position)}}function FF(e){Ue(e,"svelte-7aiuwz",'@charset "UTF-8";.tag-point-click-helper.svelte-7aiuwz.svelte-7aiuwz{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-7aiuwz.svelte-7aiuwz{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.tag-folded-point.svelte-7aiuwz.svelte-7aiuwz,.tag-unfolded-point.svelte-7aiuwz.svelte-7aiuwz{transition:all 0.5s}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-7aiuwz .tag-folded-point.svelte-7aiuwz{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-7aiuwz .tag-folded-point.svelte-7aiuwz{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-7aiuwz .tag-unfolded-point.svelte-7aiuwz{opacity:1;scale:1}')}function VF(e){let n,t,i,r,s,o,a,l,c,h,u,d;return r=new Bi({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new CM({props:{icon:e[2],width:e[1]}}),c.$on("iconLoaded",e[7]),{c(){n=j("div"),t=j("div"),i=ve(),Ie(r.$$.fragment),s=ve(),o=j("div"),a=ve(),l=j("div"),Ie(c.$$.fragment),_(t,"class","tag-point-click-helper svelte-7aiuwz"),_(o,"class","tag-unfolded-point svelte-7aiuwz"),W(o,"transition-delay",(e[3]?e[5]:0)+"ms"),_(l,"class","tag-folded-point svelte-7aiuwz"),W(l,"transition-delay",(e[3]?e[5]:0)+"ms"),_(n,"class","tag-point-wrapper svelte-7aiuwz"),Ce(n,"unfolded",e[0]),Ce(n,"folded",e[3])},m(f,m){Z(f,n,m),Q(n,t),Q(n,i),_e(r,n,null),Q(n,s),Q(n,o),Q(n,a),Q(n,l),_e(c,l,null),h=!0,u||(d=ot(t,"click",e[4]),u=!0)},p(f,[m]){m&8&&W(o,"transition-delay",(f[3]?f[5]:0)+"ms");const p={};m&4&&(p.icon=f[2]),m&2&&(p.width=f[1]),c.$set(p),m&8&&W(l,"transition-delay",(f[3]?f[5]:0)+"ms"),(!h||m&1)&&Ce(n,"unfolded",f[0]),(!h||m&8)&&Ce(n,"folded",f[3])},i(f){h||(F(r.$$.fragment,f),F(c.$$.fragment,f),h=!0)},o(f){X(r.$$.fragment,f),X(c.$$.fragment,f),h=!1},d(f){f&&Y(n),Se(r),Se(c),u=!1,d()}}}function GF(e,n,t){let i,r,s,o;const a=fs("hooks");let{tag:l}=n,c,h=!1;const u=()=>{c!==void 0&&clearTimeout(c),h=!0,c=setTimeout(()=>{h=!1},800)},d=p=>{h||(l.entryFromModel&&_i(l.five.state.mode)?l.find({targetMode:"Panorama"}).then(()=>l.unfoldAndFoldOthers()):a.emit("click",{event:p,target:"TagPoint",tag:l}))},f=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();function m(p){Za.call(this,e,p)}return e.$$set=p=>{"tag"in p&&t(6,l=p.tag)},e.$$.update=()=>{var p,g,y,b;e.$$.dirty&64&&t(0,i=(p=l.state)==null?void 0:p.unfolded),e.$$.dirty&1&&t(3,r=!i),e.$$.dirty&64&&t(2,s=(y=(g=l.style)==null?void 0:g.point)!=null&&y.url?(b=l.style)==null?void 0:b.point:{url:_4}),e.$$.dirty&64&&t(1,o=(()=>{var x,M,P,S;const A=(M=(x=l.style)==null?void 0:x.point)==null?void 0:M.width;if(typeof A=="number")return A;const w=(S=(P=l.style)==null?void 0:P.point)==null?void 0:S.size;if(typeof w=="number")return w;if(w==="S")return 18;if(w==="M")return 20;if(w==="L")return 24;if(w==="XL")return 28})())},u(),[i,o,s,r,d,f,l,m]}class HF extends ke{constructor(n){super(),Le(this,n,GF,VF,De,{tag:6},FF)}}function jF(e){Ue(e,"svelte-2g2g8a",".tag.svelte-2g2g8a{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto;will-change:opacity;transition:opacity 0.2s linear}.tag.enableZIndex.svelte-2g2g8a{position:absolute}.tag.hide.svelte-2g2g8a{opacity:0;pointer-events:none}.tag.hide.svelte-2g2g8a *{pointer-events:none !important}.tag.unClickable.svelte-2g2g8a{pointer-events:none !important}.tag.unClickable.svelte-2g2g8a *{pointer-events:none !important}")}function h1(e){let n,t,i,r,s,o,a,l,c;const h=[WF,UF],u=[];function d(g,y){return g[8]?0:1}t=d(e),i=u[t]=h[t](e);const f=[YF,QF],m=[];function p(g,y){return g[15]?0:1}return s=p(e),o=m[s]=f[s](e),{c(){n=j("div"),i.c(),r=ve(),o.c(),_(n,"class","tag svelte-2g2g8a"),_(n,"data-tag-id",e[14]),_(n,"data-tag-unfolded",e[6]),_(n,"data-content-type",a=e[0].contentType),_(n,"id",l=`tag-${e[14]}`),Ce(n,"unClickable",e[0].config.clickable===!1),Ce(n,"hide",e[12]),Ce(n,"enableZIndex",e[9]),W(n,"z-index",e[9]),W(n,"transform",`translate3d(${e[11]}, ${e[10]}, 0) scale(${e[7].scale})`)},m(g,y){Z(g,n,y),u[t].m(n,null),Q(n,r),m[s].m(n,null),e[17](n),c=!0},p(g,y){let b=t;t=d(g),t===b?u[t].p(g,y):(Ve(),X(u[b],1,1,()=>{u[b]=null}),Ge(),i=u[t],i?i.p(g,y):(i=u[t]=h[t](g),i.c()),F(i,1),i.m(n,r));let A=s;s=p(g),s===A?m[s].p(g,y):(Ve(),X(m[A],1,1,()=>{m[A]=null}),Ge(),o=m[s],o?o.p(g,y):(o=m[s]=f[s](g),o.c()),F(o,1),o.m(n,null)),(!c||y&16384)&&_(n,"data-tag-id",g[14]),(!c||y&64)&&_(n,"data-tag-unfolded",g[6]),(!c||y&1&&a!==(a=g[0].contentType))&&_(n,"data-content-type",a),(!c||y&16384&&l!==(l=`tag-${g[14]}`))&&_(n,"id",l),(!c||y&1)&&Ce(n,"unClickable",g[0].config.clickable===!1),(!c||y&4096)&&Ce(n,"hide",g[12]),(!c||y&512)&&Ce(n,"enableZIndex",g[9]),y&512&&W(n,"z-index",g[9]),y&3200&&W(n,"transform",`translate3d(${g[11]}, ${g[10]}, 0) scale(${g[7].scale})`)},i(g){c||(F(i),F(o),c=!0)},o(g){X(i),X(o),c=!1},d(g){g&&Y(n),u[t].d(),m[s].d(),e[17](null)}}}function UF(e){let n;return{c(){n=j("div"),_(n,"data-info","tag point is disable")},m(t,i){Z(t,n,i)},p:de,i:de,o:de,d(t){t&&Y(n)}}}function WF(e){let n,t;return n=new HF({props:{tag:e[0]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&1&&(s.tag=i[0]),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function QF(e){let n;return{c(){n=j("div"),_(n,"data-info","tag content is disable")},m(t,i){Z(t,n,i)},p:de,i:de,o:de,d(t){t&&Y(n)}}}function YF(e){let n,t;return n=new OM({props:{mediaStore:e[1],tag:nn(e[0]),hooks:e[16],state:e[4],temporaryState:e[5],rendererMap:e[2],contentTypeMap:e[3]}}),{c(){Ie(n.$$.fragment)},m(i,r){_e(n,i,r),t=!0},p(i,r){const s={};r&2&&(s.mediaStore=i[1]),r&1&&(s.tag=nn(i[0])),r&16&&(s.state=i[4]),r&32&&(s.temporaryState=i[5]),r&4&&(s.rendererMap=i[2]),r&8&&(s.contentTypeMap=i[3]),n.$set(s)},i(i){t||(F(n.$$.fragment,i),t=!0)},o(i){X(n.$$.fragment,i),t=!1},d(i){Se(n,i)}}}function XF(e){let n,t,i=e[7]&&!e[13]&&h1(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[7]&&!r[13]?i?(i.p(r,s),s&8320&&F(i,1)):(i=h1(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function ZF(e,n,t){let i,r,s,o,a,l,c,h,u,d,{tag:f}=n,{mediaStore:m}=n,{rendererMap:p=new Map}=n,{contentTypeMap:g=new Map}=n,{state:y}=n,{temporaryState:b}=n;const A=fs("hooks");function w(x){Qt[x?"unshift":"push"](()=>{f.dom=x,t(0,f)})}return e.$$set=x=>{"tag"in x&&t(0,f=x.tag),"mediaStore"in x&&t(1,m=x.mediaStore),"rendererMap"in x&&t(2,p=x.rendererMap),"contentTypeMap"in x&&t(3,g=x.contentTypeMap),"state"in x&&t(4,y=x.state),"temporaryState"in x&&t(5,b=x.temporaryState)},e.$$.update=()=>{var x,M,P,S;e.$$.dirty&5&&t(8,i=(()=>{var T,z,D;return!(((z=(T=f.style)==null?void 0:T.point)==null?void 0:z.enabled)===!1||((D=p.get(f.contentType))==null?void 0:D.usePoint)===!1||f.contentType==="Sticker"||f.contentType==="Link"||f.contentType==="VRLink"||f.contentType==="PanoLink"||f.contentType==="Panorama"||f.contentType==="Audio"&&f.data.appearance==="plane")})()),e.$$.dirty&257&&t(15,r=(()=>!(f.stickType!=="2DPoint"||f.entryFromModel&&_i(f.five.state.mode)&&i))()),e.$$.dirty&1&&t(14,s=f.id),e.$$.dirty&1&&t(7,o=f.screenPosition),e.$$.dirty&1&&t(13,a=f.enabled===!1||!f.state),e.$$.dirty&129&&t(12,l=!((x=f.state)!=null&&x.visible)||((M=f.temporaryState)==null?void 0:M.visible)===!1||!o),e.$$.dirty&1&&t(6,c=(P=f.state)==null?void 0:P.unfolded),e.$$.dirty&128&&t(11,h=(o==null?void 0:o.leftPx)+"px"),e.$$.dirty&128&&t(10,u=(o==null?void 0:o.topPx)+"px"),e.$$.dirty&65&&t(9,d=c?((S=f.zIndex)!=null?S:0)+(c?1e6:0):void 0)},[f,m,p,g,y,b,c,o,i,d,u,h,l,a,s,r,A,w]}class qF extends ke{constructor(n){super(),Le(this,n,ZF,XF,De,{tag:0,mediaStore:1,rendererMap:2,contentTypeMap:3,state:4,temporaryState:5},jF)}}function JF(e){Ue(e,"svelte-1owzhnq",".tag--container.svelte-1owzhnq{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0);transition:opacity 0.2s linear}.tag--container.hide.svelte-1owzhnq{opacity:0;pointer-events:none}.tag--container.hide.svelte-1owzhnq *{pointer-events:none !important}")}function u1(e,n,t){const i=e.slice();return i[8]=n[t],i}function d1(e){let n,t=[],i=new Map,r,s,o=e[0];const a=l=>l[8].id;for(let l=0;l<o.length;l+=1){let c=u1(e,o,l),h=a(c);i.set(h,t[l]=f1(h,c))}return{c(){var l;n=j("div");for(let c=0;c<t.length;c+=1)t[c].c();_(n,"class","tag--container svelte-1owzhnq"),_(n,"data-infive","1"),Ce(n,"hide",!e[4].visible||!e[5].visible),W(n,"z-index",(l=e[6])!=null?l:"")},m(l,c){Z(l,n,c);for(let h=0;h<t.length;h+=1)t[h]&&t[h].m(n,null);s=!0},p(l,c){var h;c&63&&(o=l[0],Ve(),t=zi(t,c,a,1,l,o,i,n,bs,f1,null,u1),Ge()),(!s||c&48)&&Ce(n,"hide",!l[4].visible||!l[5].visible),c&64&&W(n,"z-index",(h=l[6])!=null?h:"")},i(l){if(!s){for(let c=0;c<o.length;c+=1)F(t[c]);r||an(()=>{r=ys(n,_n,{}),r.start()}),s=!0}},o(l){for(let c=0;c<t.length;c+=1)X(t[c]);s=!1},d(l){l&&Y(n);for(let c=0;c<t.length;c+=1)t[c].d()}}}function f1(e,n){let t,i,r;return i=new qF({props:{state:n[4],temporaryState:n[5],tag:n[8],mediaStore:n[1],rendererMap:n[2],contentTypeMap:n[3]}}),{key:e,first:null,c(){t=ft(),Ie(i.$$.fragment),this.first=t},m(s,o){Z(s,t,o),_e(i,s,o),r=!0},p(s,o){n=s;const a={};o&16&&(a.state=n[4]),o&32&&(a.temporaryState=n[5]),o&1&&(a.tag=n[8]),o&2&&(a.mediaStore=n[1]),o&4&&(a.rendererMap=n[2]),o&8&&(a.contentTypeMap=n[3]),i.$set(a)},i(s){r||(F(i.$$.fragment,s),r=!0)},o(s){X(i.$$.fragment,s),r=!1},d(s){s&&Y(t),Se(i,s)}}}function KF(e){let n,t,i=e[4].enabled&&d1(e);return{c(){i&&i.c(),n=ft()},m(r,s){i&&i.m(r,s),Z(r,n,s),t=!0},p(r,[s]){r[4].enabled?i?(i.p(r,s),s&16&&F(i,1)):(i=d1(r),i.c(),F(i,1),i.m(n.parentNode,n)):i&&(Ve(),X(i,1,1,()=>{i=null}),Ge())},i(r){t||(F(i),t=!0)},o(r){X(i),t=!1},d(r){i&&i.d(r),r&&Y(n)}}}function $F(e,n,t){let{tags:i=[]}=n,{hooks:r}=n,{mediaStore:s}=n,{rendererMap:o}=n,{contentTypeMap:a}=n,{state:l}=n,{temporaryState:c}=n,{zIndex:h=void 0}=n;return Em("hooks",r),e.$$set=u=>{"tags"in u&&t(0,i=u.tags),"hooks"in u&&t(7,r=u.hooks),"mediaStore"in u&&t(1,s=u.mediaStore),"rendererMap"in u&&t(2,o=u.rendererMap),"contentTypeMap"in u&&t(3,a=u.contentTypeMap),"state"in u&&t(4,l=u.state),"temporaryState"in u&&t(5,c=u.temporaryState),"zIndex"in u&&t(6,h=u.zIndex)},[i,s,o,a,l,c,h,r]}class eV extends ke{constructor(n){super(),Le(this,n,$F,KF,De,{tags:0,hooks:7,mediaStore:1,rendererMap:2,contentTypeMap:3,state:4,temporaryState:5,zIndex:6},JF)}}const zM="Dnalogel-PanoTagPlugin",tV=e=>`${zM}--${e}`;class fd extends LF{constructor(t,i){super(t);v(this,"state",{enabled:!0,visible:!0});v(this,"debug");v(this,"debugUtil",new kF(this));v(this,"changeTagModel",(t,i)=>ee(this,null,function*(){var r;t.data=Ht({},t.data,i),yield(r=t.loadModel)==null?void 0:r.call(t)}));v(this,"handleFiveModeChange",t=>{const i=()=>{this.tags.forEach(r=>{r.state.visible=!1,r.applyVisible(),this.five.ready().then(()=>{r.updateVisible(),$i(r)&&t!=="Panorama"&&this.changeTagMode(r,"behind")})})};this.tags.length<500?i():this.five.ready().then(()=>i())});v(this,"handleFiveWantsMoveToPano",t=>{if(this.tags.length>500){this.temporaryState.visible=!1,this.addRenderQueue({type:"TagContainerSvelte",keys:["temporaryState"]});return}else this.tags.forEach(i=>{i.getVisible({panoIndex:t})&&(i.state.visible=!0);const s=i.getConfig();typeof s.visibleConfig=="object"&&i.temporaryState&&(s.visibleConfig.keep?i.temporaryState.visible=s.visibleConfig.keep==="visible":i.temporaryState.visible=!!s.visibleConfig.alwaysShowWhenMovePano)}),this.addRenderQueue({type:"TagContainerSvelte",keys:["tags"]}),this.tags.forEach(i=>i.applyVisible())});v(this,"clickhandler",t=>{t.tag.onClick(t)});v(this,"handleFiveCameraUpdate",()=>{this.filterPointTag.forEach(t=>t.updateScreenPosition())});v(this,"handleFiveCameraFovUpdate",()=>{this.handleFiveCameraUpdate(),this.five.off("render.prepare",this.handleFiveCameraUpdate),this.five.on("render.prepare",this.handleFiveCameraUpdate),setTimeout(()=>{this.five.off("render.prepare",this.handleFiveCameraUpdate)},1e3)});v(this,"handleFivePanoArrived",()=>ee(this,null,function*(){this.tags.forEach(t=>{t.state.visible=!1,t.temporaryState=Ee(R({},t.temporaryState),{visible:!0}),t.applyVisible(),t.updateVisible()}),this.temporaryState.visible=!0,this.addRenderQueue({type:"TagContainerSvelte",keys:["temporaryState"]}),yield this.setUnfolded(),this.updateRender3DDomTag(),this.tags.filter(TO).filter(t=>{var i;return(i=t.getConfig().modelConfig)==null?void 0:i.autoLookAtEnabled}).forEach(t=>{var c;const i=new E.Mesh(new E.BoxGeometry,new E.MeshBasicMaterial),r=(c=t.model)==null?void 0:c.object;if(!r)return;i.position.copy(r.position),i.quaternion.copy(r.quaternion);const s=this.five.camera.position;i.lookAt(s.clone().setY(i.position.y));const o=r.quaternion.clone(),a=i.quaternion.clone(),l=Ec();l.onUpdate(({progress:h})=>{r.quaternion.copy(o.clone().slerp(a,h))}),l.play()})}));v(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(t=>t.updateVisible())});v(this,"onFiveEveryReady",()=>{this.setUnfoldedByCamera(),_i(this.five.getCurrentState().mode)&&this.tags.forEach(t=>t.updateVisible())});v(this,"render",()=>{this.renderQueue.forEach((t,i)=>{const{keys:r}=t;if(i==="TagContainerSvelte"){const o=this.filterPointTag.filter(l=>l.screenPosition),a={hooks:this.hooks,tags:o,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore,rendererMap:this.rendererMap,contentTypeMap:this.contentTypeMap,zIndex:this.params.containerZIndex};if(this.TagContainerSvelte){let l={};if(r.length===0)l=a;else for(const c of r)l[c]=a[c];this.TagContainerSvelte.$set(l)}else{if(!this.container)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new eV({target:this.container,props:Ee(R({},a),{state:Ee(R({},this.state),{enabled:!1})})}),Bc(()=>{var l;(l=this.TagContainerSvelte)==null||l.$set({state:this.state})})}}}),this.renderQueue.clear()});this.params=Ht({},{debug:!1,config:this.config},R({},i)),this.debug=this.params.debug,this.config=this.params.config,this.debug&&this.debugUtil.bindLog(),BO(1,{namespace:Ng.PlayAudio});try{Array.isArray(window.__PANOTAGPLUGIN_DEBUG_LIST__)||(window.__PANOTAGPLUGIN_DEBUG_LIST__=[]),this.NAME=zM+"-"+window.__PANOTAGPLUGIN_DEBUG_LIST__.length,window.__PANOTAGPLUGIN_DEBUG_LIST__.push(this),window.__PANOTAGPLUGIN_DEBUG__||Object.defineProperty(window,"__PANOTAGPLUGIN_DEBUG__",{get:function(){return window.__PANOTAGPLUGIN_DEBUG_LIST__.sort((r,s)=>s.tags.length-r.tags.length)[0]}})}catch(r){}}appendTo(t){var r,s,o,a;this.debugUtil.addLog("appendTo"),this.container=t,(r=this.css3DRenderPlugin)==null||r.appendToFrontFiveContainer(this.container);const i=(o=(s=this.TagContainerSvelte)==null?void 0:s.$$)==null?void 0:o.root;i&&i!==this.container&&((a=this.TagContainerSvelte)==null||a.$destroy(),this.TagContainerSvelte=void 0)}load(t){return ee(this,null,function*(){var r,s;this.clearTags();try{console.debug(this.NAME," load:",{data:JSON.parse(JSON.stringify(t))})}catch(o){}this.config=Ht({},this.config,{globalConfig:(r=t.globalConfig)!=null?r:{},contentTypeConfig:(s=t.contentTypeConfig)!=null?s:{}});const i=yield this.addTag(t.tagList);return this.hooks.emit("loaded"),i})}addTag(t){return ee(this,null,function*(){const r=(Array.isArray(t)?t:[t]).filter(s=>s.position).map(s=>{const o=Bg(s);if(o==="2DPoint"||o==="3DPoint")return new OF(this,s);if(o==="Model")return new RM(this,s);if(o==="Plane")return new NF(this,s)});return r.forEach(OO),this.tags.push(...r),this.tagsLengthWillUpdate=!0,Ua(this.five).then(()=>ee(this,null,function*(){var s,o;this.store.eventListenerDisposer&&((o=(s=this.store).eventListenerDisposer)==null||o.call(s)),this.state.enabled&&this.handleEnable(),this.addResizeListener(),this.clearUnusedPanelTag(),r.forEach(a=>{this.tags.includes(a)&&(a.stickType==="Model"&&a.loadModel().then(()=>{this.tags.includes(a)&&a.updateVisible()}),a.updateVisible(),a.updateZIndex())}),this.setUnfolded(),this.addRenderQueue({type:"TagContainerSvelte"}),this.hooks.emit("tagsLengthChange")}))})}changeConfig(t,i=!0){i?this.config=Ht({},this.config,t):this.config=t,this.tags.forEach(r=>{r.updateConfig(),r.updateVisible()})}changeGlobalConfig(t,i=!0){i?this.config.globalConfig=Ht({},this.config.globalConfig,t):this.config.globalConfig=t,this.tags.forEach(r=>{r.updateConfig(),r.updateVisible()})}changeContentTypeConfig(t,i,r=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),r?this.config.contentTypeConfig[t]=Ht({},this.config.contentTypeConfig[t],i):this.config.contentTypeConfig[t]=i,this.tags.forEach(s=>{s.updateConfig(),s.updateVisible()})}show(t){return ee(this,null,function*(){if(this.checkDisposed())return;const{userAction:i=!0}=t!=null?t:{};this.setState({visible:!0},{userAction:i}),this.hooks.emit("show",{userAction:i})})}hide(t){return ee(this,null,function*(){if(this.checkDisposed())return;const{userAction:i=!0}=t!=null?t:{};this.setState({visible:!1},{userAction:i}),this.hooks.emit("hide",{userAction:i})})}enable(t){if(this.checkDisposed())return;const{userAction:i=!0}=t!=null?t:{};this.setState({enabled:!0},{userAction:i}),this.hooks.emit("enable",{userAction:i})}disable(t){if(this.checkDisposed())return;const{userAction:i=!0}=t!=null?t:{};this.setState({enabled:!1},{userAction:i}),this.hooks.emit("disable",{userAction:i})}setState(t,i){if(this.checkDisposed())return;const{userAction:r=!0}=i!=null?i:{},s=R({},this.state);this.state=Object.assign(this.state,t),s.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),s.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:r})}dispose(){var t,i,r,s,o,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(t=this.TagContainerSvelte)==null||t.$destroy(),this.filterCSS3DTag.forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags.forEach(l=>l.cache.clear()),this.tags=[],this.tagsLengthWillUpdate=!0,this.hooks.emit("tagsLengthChange"),(i=this.store.disposers)==null||i.forEach(l=>l==null?void 0:l()),this.store.disposers=[],(s=(r=this.store).eventListenerDisposer)==null||s.call(r),this.store.eventListenerDisposer=void 0,(a=(o=this.store).resizeObserverDisposer)==null||a.call(o),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.imagePlaneGroup.remove(...this.imagePlaneGroup.children),this.five.needsRender=!0,this.store.disposed=!0,this.hooks.emit("dispose")}blinkTagById(t,i){return ee(this,null,function*(){var r;return(r=this.getTagById(t))==null?void 0:r.blink(i)})}changeUnfoldedById(t,i){const r=this.getTagById(t);i?r==null||r.unfold():r==null||r.fold()}changeEnabledById(t,i){var s;const r=this.getTagById(t);r&&(r.enabled=i,(s=r.hooks)==null||s.emit(i?"enable":"disable"))}changeTagNormalById(t,i){const r=this.getTagById(t);r&&r.tag3DContentSvelte&&(r.tag3DContentSvelte.currentNormal=os(i))}changePositionById(t,i){const r=this.getTagById(t);r&&r.setPosition(i)}changeDataById(t,i,r=!0){const s=this.getTagById(t);s&&(s.setData(i,r),this.clearUnusedPanelTag(),s.hooks.emit("dataChanged",s.data))}changeStickTypeById(t,i,r=!0){this.changeTagById(t,i,r)}changeTagById(t,i,r=!0){const s=this.getTagById(t);s&&(s.set(i),s.updateVisible(),this.clearUnusedPanelTag(),s.hooks.emit("dataChanged",s.data))}destroyTagById(t){(Array.isArray(t)?t:[t]).forEach(r=>{var s;return(s=this.getTagById(r))==null?void 0:s.destroy()})}updateRenderAllTags(){this.tags.forEach(t=>t.updateVisible()),this.five.needsRender=!0}clearTags(){var t;this.tags.length&&(this.tags.forEach(i=>{var r,s,o,a,l;(s=(r=i.mediaPlane)==null?void 0:r.parent)==null||s.remove(i.mediaPlane),(l=(a=(o=i.model)==null?void 0:o.object)==null?void 0:a.parent)==null||l.remove(i.model.object)}),this.tags=[],this.tagsLengthWillUpdate=!0,this.hooks.emit("tagsLengthChange"),(t=this.TagContainerSvelte)==null||t.$destroy(),this.TagContainerSvelte=void 0,this.disposeAllCSS3DContainer()),this.enabledModelTagSet.clear(),this.cache.clear()}setUnfolded(){return ee(this,null,function*(){return new Promise(t=>{setTimeout(()=>{this.setUnfoldedByCamera(),t()},100)})})}handleShow(){this.state.visible=!0,this.group.visible=!0,this.addRenderQueue({type:"TagContainerSvelte",keys:["state"]}),this.updateRender3DDomTag(),this.five.needsRender=!0}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.group.visible=!1,this.addRenderQueue({type:"TagContainerSvelte",keys:["state"]}),this.updateRender3DDomTag(),this.five.needsRender=!0}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.group.traverse(t=>{var i;(i=t==null?void 0:t.updateTagCss3DObjectMatrix)==null||i.call(t)}),this.updateRender3DDomTag(),this.five.needsRender=!0}handleDisable(){var t,i,r;this.pauseCurrentMedia(),this.state.enabled=!1,(i=(t=this.store).eventListenerDisposer)==null||i.call(t),this.five.scene.remove(this.group),(r=this.TagContainerSvelte)==null||r.$set({tags:[]}),this.filterCSS3DTag.forEach(s=>{var o;(o=s.tag3DContentSvelte)==null||o.dispose(),s.tag3DContentSvelte=void 0}),this.five.needsRender=!0}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const t=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=t,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(this.store.disposed)return;const t=this.five.getElement(),i=()=>{this.state.enabled&&(this.filterPointTag.forEach(c=>c.updateScreenPosition({force:!0})),this.temporaryState.visible=!0,this.addRenderQueue({type:"TagContainerSvelte",keys:["temporaryState"]}))},r=()=>{this.state.enabled&&(this.temporaryState.visible=!1,this.addRenderQueue({type:"TagContainerSvelte",keys:["temporaryState"]}))},{observe:s,unobserve:o}=Ju(Yb(()=>{this.store.resizeObserverDisposer&&r()},500),t),{observe:a,unobserve:l}=Ju(kO(()=>i(),400),t);return s(),a(),()=>{o(),l()}}setUnfoldedByCamera(){let t=!1;this.filterPointTag.forEach(i=>{const r=i.getUnfoldedByCamera();if(i.state&&r!==void 0){if(r===!0&&i.screenPosition){const s=i.getConfig().unfoldedConfig;so(s).keep!=="unfolded"&&(t=!0)}i.state.unfolded=r}}),t&&this.filterPointTag.forEach(i=>{const r=i.getConfig().unfoldedConfig;typeof r=="object"&&(r.autoUnfold||r.autoUnfold===!1||so(r.autoUnfold).enable===!1||r.keep)||i.state&&(i.state.unfolded=!1)})}changeTagMode(t,i){var r,s,o,a,l,c;((r=t.config)==null?void 0:r.renderType)!=="Mesh"&&((a=(o=(s=t.tag3DContentSvelte)==null?void 0:s.css3DInstance)==null?void 0:o.css3DObject)==null?void 0:a.mode)!==i&&((l=t.config)!=null&&l.tag3DConfig?t.config.tag3DConfig.mode=i:t.config?t.config.tag3DConfig={mode:i}:t.config={tag3DConfig:{mode:i}},(c=this.store.css3DRenderDisposer.get(t.id))==null||c.forEach(h=>h==null?void 0:h()),t.tag3DContentSvelte=void 0)}addEventListener(){const{five:t,hooks:i}=this;let r=!1;const s=Yb(()=>{r||(r=!0,t.ready().then(()=>{this.onFiveEveryReady(),r=!1}))},150);return t.on("cameraUpdate",s),this.handleFivePanoArrived(),t.on("wantsMoveToPano",this.handleFiveWantsMoveToPano),t.on("models.refined",this.onFiveEveryReady),t.on("modeChange",this.handleFiveModeChange),t.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),t.on("cameraUpdate",this.handleFiveCameraUpdate),t.on("cameraFovUpdate",this.handleFiveCameraFovUpdate),t.on("panoArrived",this.handleFivePanoArrived),t.on("panoArrived",this.loadVideoFirstFrame),t.on("render.prepare",this.render),i.on("click",this.clickhandler),()=>{t.off("wantsMoveToPano",this.handleFiveWantsMoveToPano),t.off("models.refined",this.onFiveEveryReady),t.off("modeChange",this.handleFiveModeChange),t.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),t.off("cameraUpdate",this.handleFiveCameraUpdate),t.off("cameraFovUpdate",this.handleFiveCameraFovUpdate),t.off("cameraUpdate",s),t.off("panoArrived",this.handleFivePanoArrived),t.off("panoArrived",this.loadVideoFirstFrame),t.off("render.prepare",this.render),i.off("click",this.clickhandler),this.store.eventListenerDisposer=void 0}}}const nV=(e,n)=>new fd(e,n);function iV(e){Ue(e,"svelte-4qjwer",".guide-line__tag.svelte-4qjwer.svelte-4qjwer{position:relative}.text-with-distance.svelte-4qjwer.svelte-4qjwer{display:flex;flex-direction:column;position:relative;padding:0.125rem 0.25rem;border-radius:0.125rem;background:linear-gradient(to top, rgba(147, 147, 147, 0.3), rgba(74, 74, 74, 0.3));box-shadow:0 0.125rem 0.5rem 0 rgba(0, 0, 0, 0.2)}.text-with-distance.svelte-4qjwer .border.svelte-4qjwer{position:absolute;top:-50%;right:-50%;bottom:-50%;left:-50%;padding:0.0625rem;border-radius:0.25rem;background:linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.2));-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);mask-composite:exclude;-webkit-mask-composite:xor;transform:scale(0.5)}.distance-and-name.svelte-4qjwer.svelte-4qjwer{display:flex;gap:0.1875rem}.distance.svelte-4qjwer.svelte-4qjwer{white-space:nowrap;font-size:0.625rem;line-height:0.875rem;color:#66afff}.name.svelte-4qjwer.svelte-4qjwer{opacity:0.6;font-size:0.625rem;line-height:0.875rem;white-space:nowrap;color:#ffffff}.line-name.svelte-4qjwer.svelte-4qjwer{color:#fff;white-space:nowrap;font-size:0.625rem;line-height:0.875rem}.guide-line__tag-point.svelte-4qjwer.svelte-4qjwer{position:absolute;left:50%;bottom:0.0625rem;width:0.4375rem;height:0.125rem;transform:translateX(-50%);background:#fff;border-radius:50%;opacity:0.5}.guide-line__tag-line.svelte-4qjwer.svelte-4qjwer{position:absolute;left:50%;bottom:0.0625rem;width:0.0625rem;height:1.875rem;transform:translateX(-50%);background:linear-gradient(to top, #fff, rgba(255, 255, 255, 0))}.guide-line__tag-content.svelte-4qjwer.svelte-4qjwer{position:absolute;left:-0.9375rem;bottom:1.9375rem;display:flex}.guide-line__tag-icon.svelte-4qjwer.svelte-4qjwer{width:1.875rem;height:1.875rem;background-size:100%}.guide-line__tag-text.svelte-4qjwer.svelte-4qjwer{box-sizing:content-box;height:0.875rem;width:-moz-max-content;width:max-content;margin-top:0.3125rem;transform:translateX(-0.1875rem);white-space:nowrap;font-size:0.625rem;line-height:0.875rem;border:solid transparent;border-width:0.125rem 0.5rem 0.125rem 0.375rem;border-image-slice:6 25 6 18 fill;color:#fff}")}function p1(e){let n,t;return{c(){n=j("div"),t=xt(e[0]),_(n,"class","guide-line__tag-text svelte-4qjwer"),W(n,"border-image-source",`url(${e[6]})`)},m(i,r){Z(i,n,r),Q(n,t)},p(i,r){r&1&&Ct(t,i[0])},d(i){i&&Y(n)}}}function m1(e){let n,t,i,r,s=e[5]("全程")+"",o,a,l=e[5]("米")+"",c,h,u,d,f,m,p=e[4]&&g1(e);return{c(){n=j("div"),p&&p.c(),t=ve(),i=j("div"),r=j("span"),o=xt(s),a=xt(e[2]),c=xt(l),h=ve(),u=j("span"),d=xt(e[0]),f=ve(),m=j("div"),_(r,"class","distance svelte-4qjwer"),_(u,"class","name svelte-4qjwer"),_(i,"class","distance-and-name svelte-4qjwer"),_(m,"class","border svelte-4qjwer"),_(n,"class","text-with-distance svelte-4qjwer")},m(g,y){Z(g,n,y),p&&p.m(n,null),Q(n,t),Q(n,i),Q(i,r),Q(r,o),Q(r,a),Q(r,c),Q(i,h),Q(i,u),Q(u,d),Q(n,f),Q(n,m)},p(g,y){g[4]?p?p.p(g,y):(p=g1(g),p.c(),p.m(n,t)):p&&(p.d(1),p=null),y&32&&s!==(s=g[5]("全程")+"")&&Ct(o,s),y&4&&Ct(a,g[2]),y&32&&l!==(l=g[5]("米")+"")&&Ct(c,l),y&1&&Ct(d,g[0])},d(g){g&&Y(n),p&&p.d()}}}function g1(e){let n,t;return{c(){n=j("span"),t=xt(e[4]),_(n,"class","line-name svelte-4qjwer")},m(i,r){Z(i,n,r),Q(n,t)},p(i,r){r&16&&Ct(t,i[4])},d(i){i&&Y(n)}}}function rV(e){let n,t,i,r,s,o,a,l,c,h=e[0]&&!e[2]&&p1(e),u=e[2]&&m1(e);return{c(){n=j("div"),t=j("div"),i=ve(),r=j("div"),s=ve(),o=j("div"),a=j("div"),l=ve(),h&&h.c(),c=ve(),u&&u.c(),_(t,"class","guide-line__tag-point svelte-4qjwer"),_(r,"class","guide-line__tag-line svelte-4qjwer"),_(a,"class","guide-line__tag-icon svelte-4qjwer"),W(a,"background-image",`url(${e[1]})`),_(o,"class","guide-line__tag-content svelte-4qjwer"),_(n,"class","guide-line__tag svelte-4qjwer"),W(n,"opacity",e[3])},m(d,f){Z(d,n,f),Q(n,t),Q(n,i),Q(n,r),Q(n,s),Q(n,o),Q(o,a),Q(o,l),h&&h.m(o,null),Q(o,c),u&&u.m(o,null)},p(d,[f]){f&2&&W(a,"background-image",`url(${d[1]})`),d[0]&&!d[2]?h?h.p(d,f):(h=p1(d),h.c(),h.m(o,c)):h&&(h.d(1),h=null),d[2]?u?u.p(d,f):(u=m1(d),u.c(),u.m(o,null)):u&&(u.d(1),u=null),f&8&&W(n,"opacity",d[3])},i:de,o:de,d(d){d&&Y(n),h&&h.d(),u&&u.d()}}}function sV(e,n,t){let{text:i=""}=n,{icon_url:r=""}=n,{distance:s=0}=n,{opacity:o=1}=n,{name:a=""}=n,{i18n:l=h=>h}=n;const c="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHUAAAA2CAMAAADOFiZMAAACEFBMVEUAAACIiIheXl5oaGh6enpsbGxiYmJ9fX1wcHBXV1eBgYFzc3NSUlKNjY2Dg4NOTk51dXVXV1dmZmZTU1N3d3dcXFyMjIyEhIRNTU2QkJC0tLS5ubnHx8fOzs6np6exsbHKysqoqKi9vb3U1NTPz8/Nzc2vr6/Dw8OysrK/v7/X19fS0tKurq62traqqqrJycmurq64uLifn5/Dw8O6urqQkJC6urro6Ojt7e3o6OjU1NS3t7fBwcGjo6Ozs7Orq6u1tbXAwMCurq6rq6vy8vLx8fHr6+vp6enZ2dnd3d3a2trX19fV1dW/v7/IyMihoaGampqVlZWLi4uCgoK+vr6urq7m5ubw8PDk5OTu7u7i4uLg4ODe3t7q6urS0tLi4uLOzs7e3t7Hx8fa2tqrq6vExMTAwMCnp6efn5+WlpaHh4ezs7OoqKiJiYm6urqZmZmurq59fX29vb23t7e4uLipqanp6enc3Nza2trW1tbT09Pm5ubj4+PQ0NDg4ODExMTCwsK7u7vBwcG8vLy5ubm8vLy+vr64uLiysrKdnZ3CwsJoaGisrKzHx8ekpKTExMTv7+/i4uLa2trm5ubk5OT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2uejqup2R0dXF8jV1X19NTU1O3feu3f+/oWBgUtD++uePHtbLAThNzRClbi+VnseAAAAAElFTkSuQmCC";return e.$$set=h=>{"text"in h&&t(0,i=h.text),"icon_url"in h&&t(1,r=h.icon_url),"distance"in h&&t(2,s=h.distance),"opacity"in h&&t(3,o=h.opacity),"name"in h&&t(4,a=h.name),"i18n"in h&&t(5,l=h.i18n)},[i,r,s,o,a,l,c]}class oV extends ke{constructor(n){super(),Le(this,n,sV,rV,De,{text:0,icon_url:1,distance:2,opacity:3,name:4,i18n:5},iV)}}function aV(e){return e.length===0?[]:e.filter((n,t)=>n!==e[t-1])}const lV=`
|
|
3565
3565
|
varying vec2 vUv;
|
|
3566
3566
|
varying float ignoreAnimationMap;
|
|
3567
3567
|
attribute float animationWillError;
|