@realsee/dnalogel 2.28.5 → 2.28.6
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/dist/index.cjs.js +3 -3
- package/dist/index.js +4 -4
- package/dist/index.umd.js +3 -3
- package/libs/CruisePlugin/Controller.js +93 -93
- 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 ff=Object.defineProperty,mf=Object.defineProperties;var gf=Object.getOwnPropertyDescriptors;var $a=Object.getOwnPropertySymbols;var pf=Object.prototype.hasOwnProperty,Af=Object.prototype.propertyIsEnumerable;var vr=(n,t,e)=>t in n?ff(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,G=(n,t)=>{for(var e in t||(t={}))pf.call(t,e)&&vr(n,e,t[e]);if($a)for(var e of $a(t))Af.call(t,e)&&vr(n,e,t[e]);return n},Ae=(n,t)=>mf(n,gf(t));var f=(n,t,e)=>(vr(n,typeof t!="symbol"?t+"":t,e),e);var F=(n,t,e)=>new Promise((i,s)=>{var o=l=>{try{a(e.next(l))}catch(c){s(c)}},r=l=>{try{a(e.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((e=e.apply(n,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Le=require("@realsee/five"),R=require("three"),qs=require("three/examples/jsm/renderers/CSS3DRenderer"),ls=require("hammerjs"),fh=require("@realsee/five/line"),mh=require("three/examples/jsm/loaders/FBXLoader"),vf=require("earcut"),el=require("animejs"),bf=require("@realsee/five/gltf-loader");function yf(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const I=yf(R);function wf(){console.debug("%c %c@realsee/dnalogel %cv2.28.5",["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 Cf(){const n=typeof OffscreenCanvas!="undefined",t=n&&new OffscreenCanvas(1,1).getContext("webgl")!==null;n&&!t&&Object.assign(window,{OffscreenCanvas:function(e,i){const s=document.createElement("canvas");return s.width=e,s.height=i,s}})}function gh(){}const tl=()=>Promise.resolve(),il={__queue:Promise.resolve()};function If(n=tl){il.__queue=il.__queue.then(n).catch(tl)}function Ms(n,t,e){const i=n.x,s=n.y,o=Math.floor(i/t*1e4)/1e4,r=Math.floor(s/e*1e4)/1e4;return{x:o,y:r}}function br(n,t,e){const{x:i,y:s}=n,o=i*t,r=s*e;return{x:o,y:r}}function ks(n){if(n.length<2)return{};const t=n.slice(-2),e=t[0],i={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:i}}function Pf(n,t,e=gh){new Promise(i=>{setTimeout(()=>{e(),i(!0)},t*n)})}const Ef=window,nl=window.requestAnimationFrame||Ef.webkitRequestAnimationFrame||(n=>setTimeout(n,16));function Ys(n,t=0){t<=0?nl(n):nl(()=>Ys(n,t-1))}var Tt=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return this.None(n)},Out:function(n){return this.None(n)},InOut:function(n){return this.None(n)}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var t=1.70158;return n===1?1:n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return n===0?0:--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}}),Bounce:Object.freeze({In:function(n){return 1-Tt.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?Tt.Bounce.In(n*2)*.5:Tt.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return Math.pow(t,n)},Out:function(t){return 1-Math.pow(1-t,n)},InOut:function(t){return t<.5?Math.pow(t*2,n)/2:(1-Math.pow(2-t*2,n))/2+.5}}}}),on=function(){return performance.now()},ph=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},n.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},n.prototype.update=function(t,e){t===void 0&&(t=on()),e===void 0&&(e=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<i.length;s++){var o=this._tweens[i[s]],r=!e;o&&o.update(t,r)===!1&&!e&&delete this._tweens[i[s]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),xi={Linear:function(n,t){var e=n.length-1,i=e*t,s=Math.floor(i),o=xi.Utils.Linear;return t<0?o(n[0],n[1],i):t>1?o(n[e],n[e-1],e-i):o(n[s],n[s+1>e?e:s+1],i-s)},Bezier:function(n,t){for(var e=0,i=n.length-1,s=Math.pow,o=xi.Utils.Bernstein,r=0;r<=i;r++)e+=s(1-t,i-r)*s(t,r)*n[r]*o(i,r);return e},CatmullRom:function(n,t){var e=n.length-1,i=e*t,s=Math.floor(i),o=xi.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(s=Math.floor(i=e*(1+t))),o(n[(s-1+e)%e],n[s],n[(s+1)%e],n[(s+2)%e],i-s)):t<0?n[0]-(o(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(o(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):o(n[s?s-1:0],n[s],n[e<s+1?e:s+1],n[e<s+2?e:s+2],i-s)},Utils:{Linear:function(n,t,e){return(t-n)*e+n},Bernstein:function(n,t){var e=xi.Utils.Factorial;return e(n)/e(t)/e(n-t)},Factorial:function(){var n=[1];return function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}}(),CatmullRom:function(n,t,e,i,s){var o=(e-n)*.5,r=(i-t)*.5,a=s*s,l=s*a;return(2*t-2*e+o+r)*l+(-3*t+3*e-2*o-r)*a+o*s+t}}},fa=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),Wr=new ph,Ao=function(){function n(t,e){e===void 0&&(e=Wr),this._object=t,this._group=e,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=Tt.Linear.None,this._interpolationFunction=xi.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=fa.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.to=function(t,e){if(e===void 0&&(e=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=t,this._propertiesAreSetUp=!1,this._duration=e,this},n.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},n.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},n.prototype.start=function(t,e){if(t===void 0&&(t=on()),e===void 0&&(e=!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=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},n.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},n.prototype._setupProperties=function(t,e,i,s,o){for(var r in i){var a=t[r],l=Array.isArray(a),c=l?"array":typeof a,d=!l&&Array.isArray(i[r]);if(!(c==="undefined"||c==="function")){if(d){var h=i[r];if(h.length===0)continue;for(var u=[a],m=0,A=h.length;m<A;m+=1){var p=this._handleRelativeValue(a,h[m]);if(isNaN(p)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(p)}d&&(i[r]=u)}if((c==="object"||l)&&a&&!d){e[r]=l?[]:{};var g=a;for(var v in g)e[r][v]=g[v];s[r]=l?[]:{};var h=i[r];if(!this._isDynamic){var y={};for(var v in h)y[v]=h[v];i[r]=h=y}this._setupProperties(g,e[r],h,s[r],o)}else(typeof e[r]=="undefined"||o)&&(e[r]=a),l||(e[r]*=1),d?s[r]=i[r].slice().reverse():s[r]=e[r]||0}}},n.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},n.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},n.prototype.pause=function(t){return t===void 0&&(t=on()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},n.prototype.resume=function(t){return t===void 0&&(t=on()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},n.prototype.group=function(t){return t===void 0&&(t=Wr),this._group=t,this},n.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},n.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},n.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},n.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},n.prototype.easing=function(t){return t===void 0&&(t=Tt.Linear.None),this._easingFunction=t,this},n.prototype.interpolation=function(t){return t===void 0&&(t=xi.Linear),this._interpolationFunction=t,this},n.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},n.prototype.onStart=function(t){return this._onStartCallback=t,this},n.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},n.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},n.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},n.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},n.prototype.onStop=function(t){return this._onStopCallback=t,this},n.prototype.update=function(t,e){if(t===void 0&&(t=on()),e===void 0&&(e=!0),this._isPaused)return!0;var i,s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<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),s=(t-this._startTime)/this._duration,s=this._duration===0||s>1?1:s;var r=this._easingFunction(s);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),s===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a<l;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(t,e,i,s){for(var o in i)if(e[o]!==void 0){var r=e[o]||0,a=i[o],l=Array.isArray(t[o]),c=Array.isArray(a),d=!l&&c;d?t[o]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[o],r,a,s):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[o]=r+(a-r)*s))}},n.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},n.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},n}(),Mf="20.0.3",kf=fa.nextId,Ht=Wr,xf=Ht.getAll.bind(Ht),Df=Ht.removeAll.bind(Ht),Sf=Ht.add.bind(Ht),Ah=Ht.remove.bind(Ht),Tf=Ht.update.bind(Ht),sl={Easing:Tt,Group:ph,Interpolation:xi,now:on,Sequence:fa,nextId:kf,Tween:Ao,VERSION:Mf,getAll:xf,removeAll:Df,add:Sf,remove:Ah,update:Tf};function Lf(n,t,e,i=Tt.Linear.None){const s=new Ao(n).to(t,e).easing(i).start();function o(r){s.update(r)&&requestAnimationFrame(o)}return requestAnimationFrame(o),s}var Kt=(n=>(n.Drawline="Drawline",n.Undo="Undo",n.Exit="Exit",n))(Kt||{});const $n=Symbol("$$PAINT_BRUSH_EVENT$$");function xs(n){return n[$n]||(n[$n]={}),n[$n]}function jf(n){n[$n]||delete n[$n]}let zf=class{hasListener(t){const e=xs(this);return e&&e[t]&&e[t].length>0}on(t,e,i){const s=xs(this);return s[t]||(s[t]=[]),s[t].push([e,i||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){jf(this);return}const i=xs(this);if(i[t]||(i[t]=[]),e===void 0){i[t].length=0;return}let s=0;for(;s<i[t].length&&i[t][s][0]!==e;s++);s<i[t].length&&i[t].splice(s,1)}emit(t,...e){let i=!1;const o=xs(this)[t]||[];for(let r of o.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(i=!0)}return i}};function li(){return((1+Math.random())*65536|0).toString(16).substring(1)}function at(){return(li()+li()+"-"+li()+"-4"+li().substr(0,3)+"-"+li()+"-"+li()+li()+li()).toLowerCase()}const Of=`
|
|
1
|
+
"use strict";var ff=Object.defineProperty,mf=Object.defineProperties;var gf=Object.getOwnPropertyDescriptors;var $a=Object.getOwnPropertySymbols;var pf=Object.prototype.hasOwnProperty,Af=Object.prototype.propertyIsEnumerable;var vr=(n,t,e)=>t in n?ff(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,G=(n,t)=>{for(var e in t||(t={}))pf.call(t,e)&&vr(n,e,t[e]);if($a)for(var e of $a(t))Af.call(t,e)&&vr(n,e,t[e]);return n},Ae=(n,t)=>mf(n,gf(t));var f=(n,t,e)=>(vr(n,typeof t!="symbol"?t+"":t,e),e);var F=(n,t,e)=>new Promise((i,s)=>{var o=l=>{try{a(e.next(l))}catch(c){s(c)}},r=l=>{try{a(e.throw(l))}catch(c){s(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,r);a((e=e.apply(n,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Le=require("@realsee/five"),R=require("three"),qs=require("three/examples/jsm/renderers/CSS3DRenderer"),ls=require("hammerjs"),fh=require("@realsee/five/line"),mh=require("three/examples/jsm/loaders/FBXLoader"),vf=require("earcut"),el=require("animejs"),bf=require("@realsee/five/gltf-loader");function yf(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const I=yf(R);function wf(){console.debug("%c %c@realsee/dnalogel %cv2.28.6",["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 Cf(){const n=typeof OffscreenCanvas!="undefined",t=n&&new OffscreenCanvas(1,1).getContext("webgl")!==null;n&&!t&&Object.assign(window,{OffscreenCanvas:function(e,i){const s=document.createElement("canvas");return s.width=e,s.height=i,s}})}function gh(){}const tl=()=>Promise.resolve(),il={__queue:Promise.resolve()};function If(n=tl){il.__queue=il.__queue.then(n).catch(tl)}function Ms(n,t,e){const i=n.x,s=n.y,o=Math.floor(i/t*1e4)/1e4,r=Math.floor(s/e*1e4)/1e4;return{x:o,y:r}}function br(n,t,e){const{x:i,y:s}=n,o=i*t,r=s*e;return{x:o,y:r}}function ks(n){if(n.length<2)return{};const t=n.slice(-2),e=t[0],i={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:i}}function Pf(n,t,e=gh){new Promise(i=>{setTimeout(()=>{e(),i(!0)},t*n)})}const Ef=window,nl=window.requestAnimationFrame||Ef.webkitRequestAnimationFrame||(n=>setTimeout(n,16));function Ys(n,t=0){t<=0?nl(n):nl(()=>Ys(n,t-1))}var Tt=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return this.None(n)},Out:function(n){return this.None(n)},InOut:function(n){return this.None(n)}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var t=1.70158;return n===1?1:n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return n===0?0:--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}}),Bounce:Object.freeze({In:function(n){return 1-Tt.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?Tt.Bounce.In(n*2)*.5:Tt.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return Math.pow(t,n)},Out:function(t){return 1-Math.pow(1-t,n)},InOut:function(t){return t<.5?Math.pow(t*2,n)/2:(1-Math.pow(2-t*2,n))/2+.5}}}}),on=function(){return performance.now()},ph=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},n.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},n.prototype.update=function(t,e){t===void 0&&(t=on()),e===void 0&&(e=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var s=0;s<i.length;s++){var o=this._tweens[i[s]],r=!e;o&&o.update(t,r)===!1&&!e&&delete this._tweens[i[s]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),xi={Linear:function(n,t){var e=n.length-1,i=e*t,s=Math.floor(i),o=xi.Utils.Linear;return t<0?o(n[0],n[1],i):t>1?o(n[e],n[e-1],e-i):o(n[s],n[s+1>e?e:s+1],i-s)},Bezier:function(n,t){for(var e=0,i=n.length-1,s=Math.pow,o=xi.Utils.Bernstein,r=0;r<=i;r++)e+=s(1-t,i-r)*s(t,r)*n[r]*o(i,r);return e},CatmullRom:function(n,t){var e=n.length-1,i=e*t,s=Math.floor(i),o=xi.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(s=Math.floor(i=e*(1+t))),o(n[(s-1+e)%e],n[s],n[(s+1)%e],n[(s+2)%e],i-s)):t<0?n[0]-(o(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(o(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):o(n[s?s-1:0],n[s],n[e<s+1?e:s+1],n[e<s+2?e:s+2],i-s)},Utils:{Linear:function(n,t,e){return(t-n)*e+n},Bernstein:function(n,t){var e=xi.Utils.Factorial;return e(n)/e(t)/e(n-t)},Factorial:function(){var n=[1];return function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}}(),CatmullRom:function(n,t,e,i,s){var o=(e-n)*.5,r=(i-t)*.5,a=s*s,l=s*a;return(2*t-2*e+o+r)*l+(-3*t+3*e-2*o-r)*a+o*s+t}}},fa=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),Wr=new ph,Ao=function(){function n(t,e){e===void 0&&(e=Wr),this._object=t,this._group=e,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=Tt.Linear.None,this._interpolationFunction=xi.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=fa.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.to=function(t,e){if(e===void 0&&(e=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=t,this._propertiesAreSetUp=!1,this._duration=e,this},n.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t,this},n.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},n.prototype.start=function(t,e){if(t===void 0&&(t=on()),e===void 0&&(e=!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=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var s={};for(var o in this._valuesEnd)s[o]=this._valuesEnd[o];this._valuesEnd=s}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},n.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},n.prototype._setupProperties=function(t,e,i,s,o){for(var r in i){var a=t[r],l=Array.isArray(a),c=l?"array":typeof a,d=!l&&Array.isArray(i[r]);if(!(c==="undefined"||c==="function")){if(d){var h=i[r];if(h.length===0)continue;for(var u=[a],m=0,A=h.length;m<A;m+=1){var p=this._handleRelativeValue(a,h[m]);if(isNaN(p)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(p)}d&&(i[r]=u)}if((c==="object"||l)&&a&&!d){e[r]=l?[]:{};var g=a;for(var v in g)e[r][v]=g[v];s[r]=l?[]:{};var h=i[r];if(!this._isDynamic){var y={};for(var v in h)y[v]=h[v];i[r]=h=y}this._setupProperties(g,e[r],h,s[r],o)}else(typeof e[r]=="undefined"||o)&&(e[r]=a),l||(e[r]*=1),d?s[r]=i[r].slice().reverse():s[r]=e[r]||0}}},n.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},n.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},n.prototype.pause=function(t){return t===void 0&&(t=on()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},n.prototype.resume=function(t){return t===void 0&&(t=on()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},n.prototype.group=function(t){return t===void 0&&(t=Wr),this._group=t,this},n.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},n.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},n.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},n.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},n.prototype.easing=function(t){return t===void 0&&(t=Tt.Linear.None),this._easingFunction=t,this},n.prototype.interpolation=function(t){return t===void 0&&(t=xi.Linear),this._interpolationFunction=t,this},n.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},n.prototype.onStart=function(t){return this._onStartCallback=t,this},n.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},n.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},n.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},n.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},n.prototype.onStop=function(t){return this._onStopCallback=t,this},n.prototype.update=function(t,e){if(t===void 0&&(t=on()),e===void 0&&(e=!0),this._isPaused)return!0;var i,s,o=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>o)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<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),s=(t-this._startTime)/this._duration,s=this._duration===0||s>1?1:s;var r=this._easingFunction(s);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),s===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a<l;a++)this._chainedTweens[a].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(t,e,i,s){for(var o in i)if(e[o]!==void 0){var r=e[o]||0,a=i[o],l=Array.isArray(t[o]),c=Array.isArray(a),d=!l&&c;d?t[o]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[o],r,a,s):(a=this._handleRelativeValue(r,a),typeof a=="number"&&(t[o]=r+(a-r)*s))}},n.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},n.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},n}(),Mf="20.0.3",kf=fa.nextId,Ht=Wr,xf=Ht.getAll.bind(Ht),Df=Ht.removeAll.bind(Ht),Sf=Ht.add.bind(Ht),Ah=Ht.remove.bind(Ht),Tf=Ht.update.bind(Ht),sl={Easing:Tt,Group:ph,Interpolation:xi,now:on,Sequence:fa,nextId:kf,Tween:Ao,VERSION:Mf,getAll:xf,removeAll:Df,add:Sf,remove:Ah,update:Tf};function Lf(n,t,e,i=Tt.Linear.None){const s=new Ao(n).to(t,e).easing(i).start();function o(r){s.update(r)&&requestAnimationFrame(o)}return requestAnimationFrame(o),s}var Kt=(n=>(n.Drawline="Drawline",n.Undo="Undo",n.Exit="Exit",n))(Kt||{});const $n=Symbol("$$PAINT_BRUSH_EVENT$$");function xs(n){return n[$n]||(n[$n]={}),n[$n]}function jf(n){n[$n]||delete n[$n]}let zf=class{hasListener(t){const e=xs(this);return e&&e[t]&&e[t].length>0}on(t,e,i){const s=xs(this);return s[t]||(s[t]=[]),s[t].push([e,i||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){jf(this);return}const i=xs(this);if(i[t]||(i[t]=[]),e===void 0){i[t].length=0;return}let s=0;for(;s<i[t].length&&i[t][s][0]!==e;s++);s<i[t].length&&i[t].splice(s,1)}emit(t,...e){let i=!1;const o=xs(this)[t]||[];for(let r of o.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(i=!0)}return i}};function li(){return((1+Math.random())*65536|0).toString(16).substring(1)}function at(){return(li()+li()+"-"+li()+"-4"+li().substr(0,3)+"-"+li()+"-"+li()+li()+li()).toLowerCase()}const Of=`
|
|
2
2
|
<style type="text/css">
|
|
3
3
|
|
|
4
4
|
#_gl_paintBrush {
|
|
@@ -191,7 +191,7 @@ void main() {
|
|
|
191
191
|
svg [type='lineItemGroup'] g g g g {
|
|
192
192
|
stroke: #ffffff;
|
|
193
193
|
}</style>
|
|
194
|
-
`;return n.$$set=o=>{"content"in o&&e(0,i=o.content)},[i,s]}class Lg extends le{constructor(t){super(),ae(this,t,Tg,Sg,se,{content:0},Dg)}}function jg(n){ue(n,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function zg(n){let t,e;return t=new xg({props:{url:n[1].url}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&2&&(o.url=i[1].url),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function Og(n){let t,e;return t=new Lg({props:{content:n[0]}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.content=i[0]),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function Bg(n){let t,e,i,s;const o=[Og,zg],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(n))&&(i=r[e]=o[e](n)),{c(){t=D("div"),i&&i.c(),w(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){O(l,t,c),~e&&r[e].m(t,null),s=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(i&&(de(),L(r[d],1,1,()=>{r[d]=null}),he()),~e?(i=r[e],i?i.p(l,c):(i=r[e]=o[e](l),i.c()),k(i,1),i.m(t,null)):i=null)},i(l){s||(k(i),s=!0)},o(l){L(i),s=!1},d(l){l&&z(t),~e&&r[e].d()}}}function Vg(n,t,e){let i,s,{floorIndex:o}=t,{floorplanData:r}=t;return n.$$set=a=>{"floorIndex"in a&&e(2,o=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},n.$$.update=()=>{var a,l;n.$$.dirty&12&&e(1,i=r.outlines[o]),n.$$.dirty&12&&e(0,s=(l=(a=r.outlines)==null?void 0:a[o])==null?void 0:l.svgContent)},[s,i,o,r]}class eu extends le{constructor(t){super(),ae(this,t,Vg,Bg,se,{floorIndex:2,floorplanData:3},jg)}}function Rg(n){ue(n,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{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-size.svelte-12pzct5{opacity:0.45}")}function Gg(n){let t,e=n[8].outerHTML+"",i;return{c(){t=new eo(!1),i=Pe(),t.a=i},m(s,o){t.m(e,s,o),O(s,i,o)},p(s,o){o&256&&e!==(e=s[8].outerHTML+"")&&t.p(e)},d(s){s&&z(i),s&&t.d()}}}function Qg(n){let t,e,i=n[1]&&ml(n),s=n[0]&&gl(n);return{c(){i&&i.c(),t=$(),s&&s.c(),e=Pe()},m(o,r){i&&i.m(o,r),O(o,t,r),s&&s.m(o,r),O(o,e,r)},p(o,r){o[1]?i?i.p(o,r):(i=ml(o),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),o[0]?s?s.p(o,r):(s=gl(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(o){i&&i.d(o),o&&z(t),s&&s.d(o),o&&z(e)}}}function ml(n){let t,e=n[2].name+"",i;return{c(){t=D("span"),i=ke(e),w(t,"class","floorplan-plugin__room-name")},m(s,o){O(s,t,o),x(t,i)},p(s,o){o&4&&e!==(e=s[2].name+"")&&De(i,e)},d(s){s&&z(t)}}}function gl(n){let t,e;return{c(){t=D("span"),e=ke(n[7]),w(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(i,s){O(i,t,s),x(t,e)},p(i,s){s&128&&De(e,i[7])},d(i){i&&z(t)}}}function Ng(n){let t,e,i;function s(a,l){if(a[3]===void 0)return Qg;if(a[8])return Gg}let o=s(n),r=o&&o(n);return{c(){t=D("div"),r&&r.c(),w(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),T(t,"left",n[9]),T(t,"top",n[10]),T(t,"font-size",n[11]),T(t,"opacity",n[6]?"1":"0")},m(a,l){O(a,t,l),r&&r.m(t,null),e||(i=[ei(Dn.call(null,t)),be(t,"clientWidth",n[19]),be(t,"clientHeight",n[20])],e=!0)},p(a,[l]){o===(o=s(a))&&r?r.p(a,l):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null))),l&64&&T(t,"opacity",a[6]?"1":"0")},i:q,o:q,d(a){a&&z(t),r&&r.d(),e=!1,Ze(i)}}}function Hg(n,t){const e=n[0],i=n[1];let s=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){const a=t[o][0],l=t[o][1],c=t[r][0],d=t[r][1];l>i!=d>i&&e<(c-a)*(i-l)/(d-l)+a&&(s=!s)}return s}function Fg(n,t,e){let i,s,o,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:d}=t,{room:h}=t,{hoveredRoom:u}=t,{getRoomAreaText:m}=t,{getLabelElement:A}=t,{adaptiveRoomLabelVisibleEnable:p}=t;function g(H,_){if(_.width===0||_.height===0)return()=>!1;const Q=H.path.map(({x:Ce,y:pe})=>[Ce,pe]),W=H.roomLabel.position,{x:Z,y:J}=W,{width:ee,height:ce}=_,oe=ee/2,we=ce/2;return function(pe){const Be=Z*pe,ve=J*pe,We=Q.map(([ye,je])=>[ye*pe,je*pe]);return[[Be+oe,ve-we],[Be-oe,ve-we],[Be-oe,ve+we],[Be+oe,ve+we]].every(ye=>Hg(ye,We))}}const v=document.body.clientWidth,y=document.body.clientHeight,P=h.roomLabel,M=P.positionInImage.x*100+"%",B=P.positionInImage.y*100+"%",E=(v<500||y<500?10:14)+"px";let V=0,j=0,X=!1;u.subscribe(function(_){e(16,X=!!_&&_.id===h.id)});const Y=H=>{e(4,V=H.detail)},N=H=>{e(5,j=H.detail)};return n.$$set=H=>{"pxmm"in H&&e(12,l=H.pxmm),"roomAreaEnable"in H&&e(0,c=H.roomAreaEnable),"roomNameEnable"in H&&e(1,d=H.roomNameEnable),"room"in H&&e(2,h=H.room),"hoveredRoom"in H&&e(13,u=H.hoveredRoom),"getRoomAreaText"in H&&e(14,m=H.getRoomAreaText),"getLabelElement"in H&&e(3,A=H.getLabelElement),"adaptiveRoomLabelVisibleEnable"in H&&e(15,p=H.adaptiveRoomLabelVisibleEnable)},n.$$.update=()=>{n.$$.dirty&12&&e(8,i=A==null?void 0:A(h)),n.$$.dirty&16388&&e(7,s=h.size?m(h.size):""),n.$$.dirty&48&&e(18,o={width:V,height:j}),n.$$.dirty&262148&&e(17,r=o?g(h,o):void 0),n.$$.dirty&233472&&e(6,a=p?X?!0:!!(r!=null&&r(l)):!0)},[c,d,h,A,V,j,a,s,i,M,B,E,l,u,m,p,X,r,o,Y,N]}class _g extends le{constructor(t){super(),ae(this,t,Fg,Ng,se,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Rg)}}function Wg(n){ue(n,"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 pl(n,t,e){const i=n.slice();return i[12]=t[e],i}function Al(n){let t,e=[],i=new Map,s,o,r,a=n[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=pl(n,a,c),h=l(d);i.set(h,e[c]=vl(h,d))}return{c(){t=D("div");for(let c=0;c<e.length;c+=1)e[c].c();w(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,d){O(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);s=!0,o||(r=[ei(Dn.call(null,t)),be(t,"clientWidth",n[11])],o=!0)},p(c,d){d&447&&(a=c[8],de(),e=zt(e,d,l,1,c,a,i,t,bi,vl,null,pl),he())},i(c){if(!s){for(let d=0;d<a.length;d+=1)k(e[d]);s=!0}},o(c){for(let d=0;d<e.length;d+=1)L(e[d]);s=!1},d(c){c&&z(t);for(let d=0;d<e.length;d+=1)e[d].d();o=!1,Ze(r)}}}function vl(n,t){let e,i,s;const o=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return i=new _g({props:r}),{key:n,first:null,c(){e=Pe(),ne(i.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(i,a,l),s=!0},p(a,l){t=a;const c=l&447?lt(o,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};i.$set(c)},i(a){s||(k(i.$$.fragment,a),s=!0)},o(a){L(i.$$.fragment,a),s=!1},d(a){a&&z(e),ie(i,a)}}}function Yg(n){let t,e,i=n[8]&&Al(n);return{c(){i&&i.c(),t=Pe()},m(s,o){i&&i.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[8]?i?(i.p(s,o),o&256&&k(i,1)):(i=Al(s),i.c(),k(i,1),i.m(t.parentNode,t)):i&&(de(),L(i,1,1,()=>{i=null}),he())},i(s){e||(k(i),e=!0)},o(s){L(i),e=!1},d(s){i&&i.d(s),s&&z(t)}}}function Ug(n,t,e){let i,{floorIndex:s}=t,{roomAreaEnable:o}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t,u=0,m=0;const A=p=>{e(6,u=p.detail)};return n.$$set=p=>{"floorIndex"in p&&e(9,s=p.floorIndex),"roomAreaEnable"in p&&e(0,o=p.roomAreaEnable),"roomNameEnable"in p&&e(1,r=p.roomNameEnable),"floorplanData"in p&&e(10,a=p.floorplanData),"hoveredRoom"in p&&e(2,l=p.hoveredRoom),"getRoomAreaText"in p&&e(3,c=p.getRoomAreaText),"getLabelElement"in p&&e(4,d=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(5,h=p.adaptiveRoomLabelVisibleEnable)},n.$$.update=()=>{if(n.$$.dirty&1536&&e(8,i=a.floorDatas[s].rooms),n.$$.dirty&1088){const{max:p,min:g}=a.bounding,v=p.x-g.x;e(7,m=u/v)}},[o,r,l,c,d,h,u,m,i,s,a,A]}class Xg extends le{constructor(t){super(),ae(this,t,Ug,Yg,se,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Wg)}}function Jg(n){ue(n,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function bl(n,t,e){const i=n.slice();return i[11]=t[e],i[13]=e,i}function yl(n,t,e){const i=n.slice();return i[14]=t[e],i}function wl(n){let t;return{c(){t=D("div"),w(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),T(t,"left",n[14].left*100+"%"),T(t,"bottom",n[14].bottom*100+"%")},m(e,i){O(e,t,i)},p:q,d(e){e&&z(t)}}}function Cl(n,t){let e,i,s=t[1](t[11].distance)+"",o,r;return{key:n,first:null,c(){e=D("div"),i=D("div"),o=ke(s),r=$(),w(i,"class","floorplan-plugin__rule-text svelte-djlmk4"),K(i,"is-row",t[2]),w(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),T(e,"left",t[11].left*100+"%"),T(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){O(a,e,l),x(e,i),x(i,o),x(e,r)},p(a,l){t=a,l&2&&s!==(s=t[1](t[11].distance)+"")&&De(o,s)},d(a){a&&z(e)}}}function Zg(n){let t,e,i,s,o,r,a=[],l=new Map,c,d=n[3],h=[];for(let A=0;A<d.length;A+=1)h[A]=wl(yl(n,d,A));let u=n[4];const m=A=>A[13];for(let A=0;A<u.length;A+=1){let p=bl(n,u,A),g=m(p);l.set(g,a[A]=Cl(g,p))}return{c(){t=D("div"),e=D("div"),i=$(),s=D("div");for(let A=0;A<h.length;A+=1)h[A].c();o=$(),r=D("div");for(let A=0;A<a.length;A+=1)a[A].c();w(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),w(s,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),K(s,"is-row",n[2]),w(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),w(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+n[0]+" svelte-djlmk4"),K(t,"is-row",n[2]),T(t,"width",n[2]?"100%":1/16+"rem"),T(t,"height",n[2]?1/16+"rem":"100%")},m(A,p){O(A,t,p),x(t,e),x(t,i),x(t,s);for(let g=0;g<h.length;g+=1)h[g]&&h[g].m(s,null);x(t,o),x(t,r);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(r,null)},p(A,[p]){if(p&8){d=A[3];let g;for(g=0;g<d.length;g+=1){const v=yl(A,d,g);h[g]?h[g].p(v,p):(h[g]=wl(v),h[g].c(),h[g].m(s,null))}for(;g<h.length;g+=1)h[g].d(1);h.length=d.length}p&22&&(u=A[4],a=zt(a,p,m,1,A,u,l,r,ka,Cl,null,bl)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+A[0]+" svelte-djlmk4")&&w(t,"class",c),p&5&&K(t,"is-row",A[2])},i:q,o:q,d(A){A&&z(t),Lt(h,A);for(let p=0;p<a.length;p+=1)a[p].d()}}}const en=1e3,tn=180;function qg(n,t,e){let{type:i}=t,{data:s}=t,{bounding:o}=t,{getRuleDistanceText:r}=t;const a=i==="top"||i==="bottom",l=o.max.x-o.min.x-(en-tn)*2,c=o.max.y-o.min.y-(en-tn)*2,d=s.map(([A,p])=>a?[A.x,p.x]:[A.y,p.y]).flat().sort().filter((A,p,g)=>p===0?!0:A!==g[p-1]),h=d.map(A=>{const p=a?(A-o.min.x-en+tn)/l:0,g=a?0:(A-o.min.y-en+tn)/c;return{left:p,bottom:g}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=d[d.length-1]-d[0],m=d.map((A,p,g)=>{const v=p===0?0:A-g[p-1],y=p===0?0:(A+g[p-1])/2,P=a?(y-o.min.x-en+tn)/l:0,M=a?0:(y-o.min.y-en+tn)/c;return{left:P,bottom:M,distance:v}}).filter(({distance:A})=>A/u>.1);return n.$$set=A=>{"type"in A&&e(0,i=A.type),"data"in A&&e(5,s=A.data),"bounding"in A&&e(6,o=A.bounding),"getRuleDistanceText"in A&&e(1,r=A.getRuleDistanceText)},[i,r,a,h,m,s,o]}class Kg extends le{constructor(t){super(),ae(this,t,qg,Zg,se,{type:0,data:5,bounding:6,getRuleDistanceText:1},Jg)}}function $g(n){ue(n,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Il(n,t,e){const i=n.slice();return i[13]=t[e][0],i[14]=t[e][1],i}function Pl(n,t){let e,i,s;const o=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return i=new Kg({props:r}),{key:n,first:null,c(){e=Pe(),ne(i.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(i,a,l),s=!0},p(a,l){t=a;const c=l&19?lt(o,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};i.$set(c)},i(a){s||(k(i.$$.fragment,a),s=!0)},o(a){L(i.$$.fragment,a),s=!1},d(a){a&&z(e),ie(i,a)}}}function ep(n){let t,e=[],i=new Map,s,o=n[4];const r=a=>a[13];for(let a=0;a<o.length;a+=1){let l=Il(n,o,a),c=r(l);i.set(c,e[a]=Pl(c,l))}return{c(){t=D("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),T(t,"width",n[3]),T(t,"height",n[2])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&19&&(o=a[4],de(),e=zt(e,l,r,1,a,o,i,t,bi,Pl,null,Il),he()),l&8&&T(t,"width",a[3]),l&4&&T(t,"height",a[2])},i(a){if(!s){for(let l=0;l<o.length;l+=1)k(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)L(e[l]);s=!1},d(a){a&&z(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const El=1e3,Ml=180;function tp(n,t,e){let i,s,o,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:A}=t,{getRuleDistanceText:p}=t;return n.$$set=g=>{"floorIndex"in g&&e(5,m=g.floorIndex),"floorplanData"in g&&e(6,A=g.floorplanData),"getRuleDistanceText"in g&&e(0,p=g.getRuleDistanceText)},n.$$.update=()=>{n.$$.dirty&64&&e(1,i=A.bounding),n.$$.dirty&96&&e(11,s=A.floorDatas[m].rules),n.$$.dirty&2048&&e(12,o=Object.keys(s)),n.$$.dirty&6144&&e(4,r=o.map(g=>[g,s[g]])),n.$$.dirty&2&&e(9,a=i.max.x-i.min.x),n.$$.dirty&2&&e(7,l=i.max.y-i.min.y),n.$$.dirty&2&&e(10,c=i.max.x-i.min.x-(El-Ml)*2),n.$$.dirty&2&&e(8,d=i.max.y-i.min.y-(El-Ml)*2),n.$$.dirty&1536&&e(3,h=c/a*100+"%"),n.$$.dirty&384&&e(2,u=d/l*100+"%")},[p,i,u,h,r,m,A,l,d,a,c,s,o]}class ip extends le{constructor(t){super(),ae(this,t,tp,ep,se,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},$g)}}function Po(n,t={}){let e="";const{needZ:i,needA:s}=t;return(i?n.slice().concat(n[0]):n.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,d=l+","+c;return a===0?(e+="M"+d,e):s!=null&&s[a]?(e+="A"+s[a]+","+d,e):(e+="L"+d,e)}),e+(i?"Z":"")}function tu({x:n,y:t},e){const{max:i,min:s}=e;return{x:n-s.x,y:i.y-t}}function np(n,t){const e=n.x*1e3+t.bounding.origin.x,i=-n.z*1e3+t.bounding.origin.y;return{x:e,y:i}}function sp(n,t){const e=t.bounding,i=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(n.x-e.min.x)/i,y:(e.max.y-n.y)/s}}function op(n,t){return Math.max(...t.work.observers.map(i=>n.z>=i.standingPosition.z?i.floorIndex:0))}function rp(n){let t;return{c(){t=Oe("path"),w(t,"d",n[0]),w(t,"fill","#2F313A")},m(e,i){O(e,t,i)},p(e,[i]){i&1&&w(t,"d",e[0])},i:q,o:q,d(e){e&&z(t)}}}function ap(n,t,e){let i,{path:s}=t;return n.$$set=o=>{"path"in o&&e(1,s=o.path)},n.$$.update=()=>{n.$$.dirty&2&&e(0,i=Po(s,{needZ:!0}))},[i,s]}class lp extends le{constructor(t){super(),ae(this,t,ap,rp,se,{path:1})}}function cp(n){let t,e,i,s,o,r;return{c(){t=Oe("defs"),e=Oe("pattern"),i=Oe("rect"),s=Oe("path"),o=$(),r=Oe("path"),w(i,"x","0"),w(i,"y","0"),w(i,"width",n[1]),w(i,"height",n[1]),w(i,"fill","#323747"),w(s,"d",n[2]),w(s,"stroke","#ffffff"),w(s,"stroke-opacity","0.06"),w(s,"stroke-width","0.5"),w(s,"fill","none"),w(e,"id","fpm-room-pattern-0"),w(e,"x","0"),w(e,"y","0"),w(e,"width",n[1]),w(e,"height",n[1]),w(e,"patternUnits","userSpaceOnUse"),w(e,"patternTransform","scale(50 50)"),w(r,"d",n[0]),w(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){O(a,t,l),x(t,e),x(e,i),x(e,s),O(a,o,l),O(a,r,l)},p(a,[l]){l&1&&w(r,"d",a[0])},i:q,o:q,d(a){a&&z(t),a&&z(o),a&&z(r)}}}const Pr=6;function dp(n,t,e){let i,{path:s}=t;const o=Pr*2,r=`M0 ${Pr} h ${o} M${Pr} 0 v ${o}`;return n.$$set=a=>{"path"in a&&e(3,s=a.path)},n.$$.update=()=>{n.$$.dirty&8&&e(0,i=Po(s,{needZ:!0}))},[i,o,r,s]}class hp extends le{constructor(t){super(),ae(this,t,dp,cp,se,{path:3})}}function up(n){let t,e,i,s,o,r,a,l,c,d,h;return{c(){t=Oe("defs"),e=Oe("pattern"),i=Oe("rect"),s=Oe("pattern"),o=Oe("rect"),r=$(),a=Oe("path"),l=$(),c=Oe("path"),d=$(),h=Oe("path"),w(i,"x","0"),w(i,"y","0"),w(i,"width","6"),w(i,"height","50"),w(i,"fill","none"),w(i,"stroke","#4B4B57"),w(i,"stroke-width","0.5"),w(e,"id","room-material-pattern-1"),w(e,"x","0"),w(e,"y","0"),w(e,"width","12"),w(e,"height","50"),w(e,"patternUnits","userSpaceOnUse"),w(e,"patternTransform","scale(50 50)"),w(o,"x","0"),w(o,"y","0"),w(o,"width","6"),w(o,"height","50"),w(o,"fill","none"),w(o,"stroke","#4B4B57"),w(o,"stroke-width","0.5"),w(s,"id","room-material-pattern-2"),w(s,"x","6"),w(s,"y","25"),w(s,"width","12"),w(s,"height","50"),w(s,"patternUnits","userSpaceOnUse"),w(s,"patternTransform","scale(50 50)"),w(a,"d",n[0]),w(a,"fill","#43434D"),w(c,"d",n[0]),w(c,"fill","url(#room-material-pattern-1)"),w(h,"d",n[0]),w(h,"fill","url(#room-material-pattern-2)")},m(u,m){O(u,t,m),x(t,e),x(e,i),x(t,s),x(s,o),O(u,r,m),O(u,a,m),O(u,l,m),O(u,c,m),O(u,d,m),O(u,h,m)},p(u,[m]){m&1&&w(a,"d",u[0]),m&1&&w(c,"d",u[0]),m&1&&w(h,"d",u[0])},i:q,o:q,d(u){u&&z(t),u&&z(r),u&&z(a),u&&z(l),u&&z(c),u&&z(d),u&&z(h)}}}function fp(n,t,e){let i,{path:s}=t;return n.$$set=o=>{"path"in o&&e(1,s=o.path)},n.$$.update=()=>{n.$$.dirty&2&&e(0,i=Po(s,{needZ:!0}))},[i,s]}class mp extends le{constructor(t){super(),ae(this,t,fp,up,se,{path:1})}}function gp(n){ue(n,"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 kl(n,t,e){const i=n.slice();return i[5]=t[e],i}function pp(n){let t,e;return t=new hp({props:{path:n[5].path}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function Ap(n){let t,e;return t=new mp({props:{path:n[5].path}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function vp(n){let t,e;return t=new lp({props:{path:n[5].path}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function xl(n){let t,e,i,s;const o=[vp,Ap,pp],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(n),i=r[e]=o[e](n),{c(){t=Oe("svg"),i.c(),w(t,"width","100%"),w(t,"height","100%"),w(t,"viewBox",`0 0 ${n[1]} ${n[2]}`),w(t,"class","svelte-1dykexu")},m(l,c){O(l,t,c),r[e].m(t,null),s=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(de(),L(r[d],1,1,()=>{r[d]=null}),he(),i=r[e],i?i.p(l,c):(i=r[e]=o[e](l),i.c()),k(i,1),i.m(t,null))},i(l){s||(k(i),s=!0)},o(l){L(i),s=!1},d(l){l&&z(t),r[e].d()}}}function bp(n){let t,e,i=n[0],s=[];for(let r=0;r<i.length;r+=1)s[r]=xl(kl(n,i,r));const o=r=>L(s[r],1,1,()=>{s[r]=null});return{c(){t=D("div");for(let r=0;r<s.length;r+=1)s[r].c();w(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){O(r,t,a);for(let l=0;l<s.length;l+=1)s[l]&&s[l].m(t,null);e=!0},p(r,[a]){if(a&7){i=r[0];let l;for(l=0;l<i.length;l+=1){const c=kl(r,i,l);s[l]?(s[l].p(c,a),k(s[l],1)):(s[l]=xl(c),s[l].c(),k(s[l],1),s[l].m(t,null))}for(de(),l=i.length;l<s.length;l+=1)o(l);he()}},i(r){if(!e){for(let a=0;a<i.length;a+=1)k(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)L(s[a]);e=!1},d(r){r&&z(t),Lt(s,r)}}}function yp(n,t,e){let i,{floorIndex:s}=t,{floorplanData:o}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return n.$$set=l=>{"floorIndex"in l&&e(3,s=l.floorIndex),"floorplanData"in l&&e(4,o=l.floorplanData)},n.$$.update=()=>{n.$$.dirty&24&&e(0,i=o.floorDatas[s].rooms.map(l=>Ae(G({},l),{path:l.path.map(c=>tu(c,o.bounding))})))},[i,r,a,s,o]}class wp extends le{constructor(t){super(),ae(this,t,yp,bp,se,{floorIndex:3,floorplanData:4},gp)}}function Cp(n){ue(n,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function Ip(n){let t,e,i,s;return{c(){t=Oe("path"),w(t,"d",n[5]),w(t,"fill","#fff"),w(t,"style",n[2]),w(t,"id",e=`${n[1]}_${n[0].id}`),w(t,"class","svelte-qq2273")},m(o,r){O(o,t,r),i||(s=[be(t,"mouseenter",n[3]),be(t,"mouseleave",n[4])],i=!0)},p(o,[r]){r&4&&w(t,"style",o[2]),r&3&&e!==(e=`${o[1]}_${o[0].id}`)&&w(t,"id",e)},i:q,o:q,d(o){o&&z(t),i=!1,Ze(s)}}}function Pp(n,t,e){let i,s,{room:o}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function d(){c==null||c.set(o)}function h(){c==null||c.set(void 0)}const{bounding:u}=a,m=Po(o.path,{needZ:!0,format:A=>tu(A,u)});return n.$$set=A=>{"room"in A&&e(0,o=A.room),"floorIndex"in A&&e(1,r=A.floorIndex),"floorplanData"in A&&e(6,a=A.floorplanData),"highlightData"in A&&e(7,l=A.highlightData),"hoveredRoom"in A&&e(8,c=A.hoveredRoom)},n.$$.update=()=>{n.$$.dirty&131&&e(9,i=l[`${r}_${o.id}`]),n.$$.dirty&512&&e(2,s=i?`fill: ${i.color}; --opacity: ${i.opacity}; pointer-events: ${i.disabled?"none":"auto"}`:null)},[o,r,s,d,h,m,a,l,c,i]}class Ep extends le{constructor(t){super(),ae(this,t,Pp,Ip,se,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},Cp)}}function Mp(n){ue(n,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function Dl(n,t,e){const i=n.slice();return i[6]=t[e],i}function Sl(n,t){let e,i,s;const o=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return i=new Ep({props:r}),{key:n,first:null,c(){e=Pe(),ne(i.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(i,a,l),s=!0},p(a,l){t=a;const c=l&15?lt(o,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};i.$set(c)},i(a){s||(k(i.$$.fragment,a),s=!0)},o(a){L(i.$$.fragment,a),s=!1},d(a){a&&z(e),ie(i,a)}}}function kp(n){let t,e,i=[],s=new Map,o,r=n[1].floorDatas[n[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=Dl(n,r,l),d=a(c);s.set(d,i[l]=Sl(d,c))}return{c(){t=D("div"),e=Oe("svg");for(let l=0;l<i.length;l+=1)i[l].c();w(e,"width","100%"),w(e,"height","100%"),w(e,"viewBox",`0 0 ${n[4]} ${n[5]}`),w(e,"class","svelte-1kqo6e4"),w(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){O(l,t,c),x(t,e);for(let d=0;d<i.length;d+=1)i[d]&&i[d].m(e,null);o=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,de(),i=zt(i,c,a,1,l,r,s,e,bi,Sl,null,Dl),he())},i(l){if(!o){for(let c=0;c<r.length;c+=1)k(i[c]);o=!0}},o(l){for(let c=0;c<i.length;c+=1)L(i[c]);o=!1},d(l){l&&z(t);for(let c=0;c<i.length;c+=1)i[c].d()}}}function xp(n,t,e){let{floorIndex:i}=t,{floorplanData:s}=t,{highlightData:o}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return n.$$set=c=>{"floorIndex"in c&&e(0,i=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"highlightData"in c&&e(2,o=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[i,s,o,r,a,l]}class iu extends le{constructor(t){super(),ae(this,t,xp,kp,se,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},Mp)}}function Dp(n){ue(n,"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 Tl(n){let t,e;const i=[{floorIndex:n[1],floorplanData:n[8],hoveredRoom:n[14],highlightData:n[13]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new iu({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&24834?lt(i,[{floorIndex:o[1],floorplanData:o[8],hoveredRoom:o[14],highlightData:o[13]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function Ll(n){let t,e;const i=[{floorplanData:n[8],roomAreaEnable:n[5],roomNameEnable:n[6],floorIndex:n[1],getRoomAreaText:n[9],getLabelElement:n[10],hoveredRoom:n[14],adaptiveRoomLabelVisibleEnable:n[12]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new Xg({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&22370?lt(i,[{floorplanData:o[8],roomAreaEnable:o[5],roomNameEnable:o[6],floorIndex:o[1],getRoomAreaText:o[9],getLabelElement:o[10],hoveredRoom:o[14],adaptiveRoomLabelVisibleEnable:o[12]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function jl(n){let t,e;const i=[{floorplanData:n[8],floorIndex:n[1],getRuleDistanceText:n[11]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new ip({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&2306?lt(i,[{floorplanData:o[8],floorIndex:o[1],getRuleDistanceText:o[11]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function Sp(n){let t,e,i,s,o,r,a,l,c;const d=[{floorIndex:n[1],floorplanData:n[8]}];let h={};for(let v=0;v<d.length;v+=1)h=et(h,d[v]);e=new wp({props:h});let u=(n[2]||n[3])&&Tl(n);const m=[{floorplanData:n[8],floorIndex:n[1]}];let A={};for(let v=0;v<m.length;v+=1)A=et(A,m[v]);o=new eu({props:A});let p=n[4]&&Ll(n),g=n[7]&&jl(n);return{c(){t=D("div"),ne(e.$$.fragment),i=$(),u&&u.c(),s=$(),ne(o.$$.fragment),r=$(),p&&p.c(),a=$(),g&&g.c(),w(t,"class",l=Re(`floorplan-plugin__floor${n[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,y){O(v,t,y),te(e,t,null),x(t,i),u&&u.m(t,null),x(t,s),te(o,t,null),x(t,r),p&&p.m(t,null),x(t,a),g&&g.m(t,null),c=!0},p(v,[y]){const P=y&258?lt(d,[{floorIndex:v[1],floorplanData:v[8]}]):{};e.$set(P),v[2]||v[3]?u?(u.p(v,y),y&12&&k(u,1)):(u=Tl(v),u.c(),k(u,1),u.m(t,s)):u&&(de(),L(u,1,1,()=>{u=null}),he());const M=y&258?lt(m,[{floorplanData:v[8],floorIndex:v[1]}]):{};o.$set(M),v[4]?p?(p.p(v,y),y&16&&k(p,1)):(p=Ll(v),p.c(),k(p,1),p.m(t,a)):p&&(de(),L(p,1,1,()=>{p=null}),he()),v[7]?g?(g.p(v,y),y&128&&k(g,1)):(g=jl(v),g.c(),k(g,1),g.m(t,null)):g&&(de(),L(g,1,1,()=>{g=null}),he()),(!c||y&1&&l!==(l=Re(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&w(t,"class",l)},i(v){c||(k(e.$$.fragment,v),k(u),k(o.$$.fragment,v),k(p),k(g),c=!0)},o(v){L(e.$$.fragment,v),L(u),L(o.$$.fragment,v),L(p),L(g),c=!1},d(v){v&&z(t),ie(e),u&&u.d(),ie(o),p&&p.d(),g&&g.d()}}}function Tp(n,t,e){let{isCurrent:i}=t,{floorIndex:s}=t,{highlightEnable:o}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{getRoomAreaText:u}=t,{getLabelElement:m}=t,{getRuleDistanceText:A}=t,{adaptiveRoomLabelVisibleEnable:p}=t,{highlightData:g}=t;const v=Da(void 0);return n.$$set=y=>{"isCurrent"in y&&e(0,i=y.isCurrent),"floorIndex"in y&&e(1,s=y.floorIndex),"highlightEnable"in y&&e(2,o=y.highlightEnable),"hoverEnable"in y&&e(3,r=y.hoverEnable),"roomLabelsEnable"in y&&e(4,a=y.roomLabelsEnable),"roomAreaEnable"in y&&e(5,l=y.roomAreaEnable),"roomNameEnable"in y&&e(6,c=y.roomNameEnable),"ruleLabelsEnable"in y&&e(7,d=y.ruleLabelsEnable),"floorplanData"in y&&e(8,h=y.floorplanData),"getRoomAreaText"in y&&e(9,u=y.getRoomAreaText),"getLabelElement"in y&&e(10,m=y.getLabelElement),"getRuleDistanceText"in y&&e(11,A=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(12,p=y.adaptiveRoomLabelVisibleEnable),"highlightData"in y&&e(13,g=y.highlightData)},[i,s,o,r,a,l,c,d,h,u,m,A,p,g,v]}let Lp=class extends le{constructor(t){super(),ae(this,t,Tp,Sp,se,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},Dp)}};function jp(n){ue(n,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function zl(n,t,e){const i=n.slice();return i[21]=t[e],i}function Ol(n){let t,e,i,s,o,r=n[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=Bl(zl(n,r,h));const l=h=>L(a[h],1,1,()=>{a[h]=null});let c=n[5]&&Vl(n),d=n[8]&&Rl(n);return{c(){t=D("div");for(let h=0;h<a.length;h+=1)a[h].c();e=$(),c&&c.c(),i=$(),d&&d.c(),w(t,"class","floorplan-main svelte-86bqav")},m(h,u){O(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);x(t,e),c&&c.m(t,null),x(t,i),d&&d.m(t,null),o=!0},p(h,u){if(n=h,u&2047696){r=n[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const A=zl(n,r,m);a[m]?(a[m].p(A,u),k(a[m],1)):(a[m]=Bl(A),a[m].c(),k(a[m],1),a[m].m(t,e))}for(de(),m=r.length;m<a.length;m+=1)l(m);he()}n[5]?c?(c.p(n,u),u&32&&k(c,1)):(c=Vl(n),c.c(),k(c,1),c.m(t,i)):c&&(de(),L(c,1,1,()=>{c=null}),he()),n[8]?d?(d.p(n,u),u&256&&k(d,1)):(d=Rl(n),d.c(),k(d,1),d.m(t,null)):d&&(de(),L(d,1,1,()=>{d=null}),he())},i(h){if(!o){for(let u=0;u<r.length;u+=1)k(a[u]);k(c),k(d),s||Ne(()=>{s=Gi(t,tt,{duration:n[0],easing:ti}),s.start()}),o=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)L(a[u]);L(c),L(d),o=!1},d(h){h&&z(t),Lt(a,h),c&&c.d(),d&&d.d()}}}function Bl(n){let t,e;const i=[{hoverEnable:n[6],highlightEnable:n[7],floorplanData:n[13],getRoomAreaText:n[16],getLabelElement:n[17],getRuleDistanceText:n[18],roomLabelsEnable:n[9],roomAreaEnable:n[10],roomNameEnable:n[11],ruleLabelsEnable:n[12],adaptiveRoomLabelVisibleEnable:n[19],highlightData:n[20]},{floorIndex:n[21].floorIndex},{isCurrent:n[21].floorIndex===n[4]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new Lp({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&2047696?lt(i,[r&2047680&&{hoverEnable:o[6],highlightEnable:o[7],floorplanData:o[13],getRoomAreaText:o[16],getLabelElement:o[17],getRuleDistanceText:o[18],roomLabelsEnable:o[9],roomAreaEnable:o[10],roomNameEnable:o[11],ruleLabelsEnable:o[12],adaptiveRoomLabelVisibleEnable:o[19],highlightData:o[20]},r&8192&&{floorIndex:o[21].floorIndex},r&8208&&{isCurrent:o[21].floorIndex===o[4]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function Vl(n){let t,e;const i=[{panoIndex:n[3],floorplanData:n[13],lastPanoramaLongitude:n[14],cameraImageUrl:n[15]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new Ag({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&57352?lt(i,[{panoIndex:o[3],floorplanData:o[13],lastPanoramaLongitude:o[14],cameraImageUrl:o[15]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function Rl(n){let t,e;return t=new Pg({props:{floorplanData:n[13],northDesc:n[2]}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&8192&&(o.floorplanData=i[13]),s&4&&(o.northDesc=i[2]),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function zp(n){let t,e,i=n[1]&&Ol(n);return{c(){i&&i.c(),t=Pe()},m(s,o){i&&i.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?i?(i.p(s,o),o&2&&k(i,1)):(i=Ol(s),i.c(),k(i,1),i.m(t.parentNode,t)):i&&(de(),L(i,1,1,()=>{i=null}),he())},i(s){e||(k(i),e=!0)},o(s){L(i),e=!1},d(s){i&&i.d(s),s&&z(t)}}}function Op(n,t,e){let{duration:i=0}=t,{visible:s}=t,{northDesc:o}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:d}=t,{compassEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:m}=t,{roomNameEnable:A}=t,{ruleLabelsEnable:p}=t,{floorplanData:g}=t,{lastPanoramaLongitude:v}=t,{cameraImageUrl:y}=t,{getRoomAreaText:P}=t,{getLabelElement:M}=t,{getRuleDistanceText:B}=t,{adaptiveRoomLabelVisibleEnable:E}=t,{highlightData:V}=t;return n.$$set=j=>{"duration"in j&&e(0,i=j.duration),"visible"in j&&e(1,s=j.visible),"northDesc"in j&&e(2,o=j.northDesc),"panoIndex"in j&&e(3,r=j.panoIndex),"floorIndex"in j&&e(4,a=j.floorIndex),"cameraEnable"in j&&e(5,l=j.cameraEnable),"hoverEnable"in j&&e(6,c=j.hoverEnable),"highlightEnable"in j&&e(7,d=j.highlightEnable),"compassEnable"in j&&e(8,h=j.compassEnable),"roomLabelsEnable"in j&&e(9,u=j.roomLabelsEnable),"roomAreaEnable"in j&&e(10,m=j.roomAreaEnable),"roomNameEnable"in j&&e(11,A=j.roomNameEnable),"ruleLabelsEnable"in j&&e(12,p=j.ruleLabelsEnable),"floorplanData"in j&&e(13,g=j.floorplanData),"lastPanoramaLongitude"in j&&e(14,v=j.lastPanoramaLongitude),"cameraImageUrl"in j&&e(15,y=j.cameraImageUrl),"getRoomAreaText"in j&&e(16,P=j.getRoomAreaText),"getLabelElement"in j&&e(17,M=j.getLabelElement),"getRuleDistanceText"in j&&e(18,B=j.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in j&&e(19,E=j.adaptiveRoomLabelVisibleEnable),"highlightData"in j&&e(20,V=j.highlightData)},[i,s,o,r,a,l,c,d,h,u,m,A,p,g,v,y,P,M,B,E,V]}let Sa=class extends le{constructor(t){super(),ae(this,t,Op,zp,se,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},jp)}};const Bp="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 Vp(n){return F(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return F(this,null,function*(){const o={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const r=yield fetch(s.svg_url,{headers:t}).then(a=>a.text());o.svgContent=r}return o})};return yield Promise.all(n.map(e))})}function Rp(n){return{id:n.id,size:n.size,name:n.name,path:n.path,roomType:n.room_type,floorType:n.floor_type,roomLabel:{position:n.room_label.position,positionInImage:n.room_label.position_in_image},observerIndexs:n.observer_indexs}}function Gp(n){return{floorName:n.floor_name,floorIndex:n.floor_index,rooms:n.rooms.map(Rp),rules:n.rules}}function Qp(n){return{index:n.index,floorIndex:n.floor_index,position:n.position,positionInImage:n.position_in_image}}function Np(n){return{rad:n.rad,position:n.position,positionInImage:n.position_in_image,northRad:n.north_rad,roomId:n.room_id,floorIndex:n.floor_index}}function gi(n){return F(this,null,function*(){const t=yield Vp(n.outlines),e=n.computed_data.bounding,i=n.computed_data.floor_datas.map(Gp),s=n.computed_data.entrance?Np(n.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:i,observers:n.computed_data.observers.map(Qp)}})}function Hp(n,t,e){return n.map(s=>{const o=s.position,r=s.icon?s.icon:{url:Bp,width:45,height:48},a=op(o,t),l=np(o,e),c=sp(l,e);return{floorIndex:a,icon:r,id:s.id,position:l,positionInImage:c}})}function Fp(n,t){return t(n),n}function Eo(n,t){return Fp({},e=>{for(const i in n)t.indexOf(i)===-1&&(e[i]=n[i])})}function Gl(n,t){const e=Math.max(...n.work.observers.map(i=>i.floorIndex));return t>e?n.model.bounding.max.y:Math.max(...n.work.observers.filter(i=>i.floorIndex===t).map(i=>i.standingPosition.y))}function Ta(n,t,e=hi.BOUNDING_CENTER){const i=Gl(n,t),s=Gl(n,t+1);return e===hi.BOUNDING_CENTER?(n.model.bounding.max.y+n.model.bounding.min.y)/2:e===hi.CEILING?s:i}function La(n,t,e,i){const s=Ta(n,e,i==null?void 0:i.attachedTo),o=new I.Vector3(0,s,0),r=new I.Vector3(1,s,0),a=o.clone().project(n.camera),l=r.clone().project(n.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let cs=class{constructor(t,e){f(this,"VERSION","2.28.5");f(this,"five");f(this,"hooks",new Ri);f(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}absoluteUrl(t){return pa(this.staticPrefix,t)}},si=class extends cs{};var Ct=(n=>(n.UnknownError="UnknownError",n.DataNotLoaded="DataNotLoaded",n.BreakOffByHide="BreakOffByHide",n.BreakOffByDisable="BreakOffByDisable",n.ModelNotLoaded="ModelNotLoaded",n.ChangeModeError="ChangeModeError",n.UpdateCameraError="UpdateCameraError",n))(Ct||{});const nu=500,_p=80;function Kr(n,t,e=4){return Math.floor(n*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Wp(n){return Object.prototype.toString.call(n)==="[object Object]"}function Ql(n){return Wp(n)&&!!n.isVector3}function ja(n,t){return F(this,null,function*(){const[e]=yield pn(n.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{n.once("initAnimationWillStart",()=>{n.once("initAnimationEnded",()=>r())})});const i=t[1];if(!i)return!0;const s=n.getCurrentState();if(!Yp(i,s))throw new Error("pose 与预期不符")})}function Yp(n,t){return Object.keys(n).every(e=>{const i=t[e],s=n[e];return i===void 0||s===void 0?!0:typeof i=="number"&&typeof s=="number"?Kr(i,s,2):Ql(s)&&Ql(i)?s.distanceTo(i)<.01:i===s})}function za(n,t){if(n.currentMode!==t.mode)return!1;const{latitude:e,longitude:i,fov:s,offset:o}=t,{latitude:r,longitude:a,offset:l}=n.getCurrentState(),c=n.camera.fov;return!(!Kr(e,r,2)||!Kr(i,a,2)||o!==void 0&&o.distanceTo(l)>.01||s!==c)}function su(n,t,e=!0){return F(this,null,function*(){if(za(n,t)===!0)return;const s=n.getCurrentState();if(s.mode!==t.mode){const[d]=yield pn(ja(n,[t.mode,t,void 0,e]));if(d)throw new Error(Ct.ChangeModeError);return}const{latitude:o,longitude:r,fov:a}=s,l=Math.min(1e3,Math.max(200,Math.abs(o-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield pn(n.updateCamera(t,l,e));if(c)throw new Error(Ct.UpdateCameraError)})}function vn(n,t,e=300){const i=n.getElement();i&&(i.style.opacity=t+"",i.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(s=>i.addEventListener("transitionend",s,{once:!0})),new Promise(s=>setTimeout(s,e))]).then(()=>{i.style.transition="none"}))}function Up(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return i||s}function Xp(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return i&&s}let Jp=class extends si{constructor(e,i){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$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")});f(this,"show",(...i)=>F(this,[...i],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));f(this,"hide",(...i)=>F(this,[...i],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!za(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=La(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);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})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o,r;const{userAction:i}=e;this.hooks.emit("disable",{userAction:i}),(s=this.showRejection)==null||s.call(this,Ct.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:i}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});f(this,"_show",e=>F(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ct.ModelNotLoaded);if(!this.data)throw new Error(Ct.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=G(G({},i),e),o=()=>F(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield pn(su(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ct.UnknownError);this.updateSize(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=s.modelOpacity,l=s.immediately?0:nu;vn(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,Ct.BreakOffByHide),this.showPromise=void 0;const s=G(G({},{userAction:!0,isAutoHide:!1}),e);vn(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,i)=>{if(!i||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||Xp(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,i)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();Up(s)&&(this.updateState({visible:!1},i),this._hide({userAction:i,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,i)=>{if(this.state.visible&&(i.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,i)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,i)=>{i==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,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:_p/((a=i==null?void 0:i.scale)!=null?a:1)};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:mi,attachedTo:hi.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},o=i?Eo(i,["selector","scale"]):{},r=G(G({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return F(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield gi(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}formatData(e){return F(this,null,function*(){return yield gi(e.data)})}updateState(e,i){const s=this.state,o=e.config?G(G({},s.config),e.config):s.config;this.state=Ae(G(G({},this.state),e),{config:o}),!ut(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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 e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=Ae(G({},this.state.config),{visible:this.state.visible,duration:e!=null?e: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 Sa({target:this.container,intro:!0,props:i})}};const Zp=(n,t)=>new Jp(n,t);function qp(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return i||s}function Kp(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return i&&s}let $p=class extends si{constructor(e,i){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$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")});f(this,"show",(...i)=>F(this,[...i],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));f(this,"hide",(...i)=>F(this,[...i],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!za(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=La(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);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})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o,r;const{userAction:i}=e;this.hooks.emit("disable",{userAction:i}),(s=this.showRejection)==null||s.call(this,Ct.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:i}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});f(this,"_show",e=>F(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ct.ModelNotLoaded);if(!this.data)throw new Error(Ct.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=G(G({},i),e),o=()=>F(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield pn(su(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ct.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=s.modelOpacity,l=s.immediately?0:nu;vn(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,Ct.BreakOffByHide),this.showPromise=void 0;const s=G(G({},{userAction:!0,isAutoHide:!1}),e);vn(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{const i=this.five.model.bounding.getCenter(new I.Vector3);if(this.showState.offset=i,this.state.enabled===!1||this.wrapper||!this.selector)return;const s=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!s)throw new Error("不正确的父容器选择器");this.wrapper=s,s.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,i)=>{if(!i||this.state.visible||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode===this.showState.mode&&Kp(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))});f(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,i)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),qp(s)&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});f(this,"onFiveWantsPanGesture",(e,i)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,i)=>{i==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,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,fov:80};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:mi,attachedTo:hi.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=i?Eo(i,["selector","scale"]):{},r=G(G({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return F(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield gi(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}updatePosition(){var a;const e=Ta(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!i)return;const s=i.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}formatData(e){return F(this,null,function*(){return yield gi(e.data)})}updateState(e,i){const s=this.state,o=e.config?G(G({},s.config),e.config):s.config;this.state=Ae(G(G({},this.state),e),{config:o}),!ut(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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 e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=Ae(G({},this.state.config),{visible:this.state.visible,duration:e!=null?e: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 Sa({target:this.container,intro:!0,props:i})}};const eA=(n,t)=>new $p(n,t);let tA=class extends si{constructor(e,i){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=La(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);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})});f(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$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")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o;const{userAction:i}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:i})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,i])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});f(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,i)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:i}=this.five.getCurrentState();i==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"));const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:mi,attachedTo:hi.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=i?Eo(i,["selector","scale"]):{},r=G(G({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return F(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield gi(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}updatePosition(){var a;const e=Ta(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!i)return;const s=i.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return F(this,arguments,function*(e={}){if(this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return F(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}formatData(e){return F(this,null,function*(){return yield gi(e.data)})}_show(e){return F(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:i}=e;this.hooks.emit("show",{userAction:i,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield ja(this.five,["Topview",void 0,void 0,i])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,o=this.state.config.modelOpacity;vn(this.five,o,s),this.hooks.emit("showAnimationEnded",{userAction:i,auto:!1}),this.render()})}_hide(e){return F(this,null,function*(){if(!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("hide",{userAction:i,auto:!1});const s=1,o=0;vn(this.five,s,o),this.render()})}_enable(e){const{userAction:i}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}updateState(e,i){const s=this.state,o=e.config?G(G({},s.config),e.config):s.config;this.state=Ae(G(G({},this.state),e),{config:o}),!ut(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.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(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const i=Ae(G({},this.state.config),{visible:this.state.visible,duration:e!=null?e: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 Sa({target:this.container,intro:!0,props:i})}};const iA=(n,t)=>new tA(n,t);function Oa(n,t=200){let e;return function(...i){e||(n(...i),e=setTimeout(function(){e=null},t))}}function nA(n){ue(n,"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 sA(n){let t,e,i;return{c(){t=D("div"),e=D("div"),i=D("div"),w(i,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),T(i,"background-image","url("+(n[0]||mi)+")"),T(i,"transform",n[1]),w(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),T(e,"transform",n[2]),w(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(s,o){O(s,t,o),x(t,e),x(e,i)},p(s,[o]){o&1&&T(i,"background-image","url("+(s[0]||mi)+")"),(o&1||o&3)&&T(i,"transform",s[1]),o&4&&T(e,"transform",s[2])},i:q,o:q,d(s){s&&z(t)}}}function oA(n){return`rotate(${Math.floor(n/Math.PI*180)*-1+45}deg)`}function rA(n,t,e){let i,s,{five:o}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=o.getCurrentState().panoIndex,d=o.getCurrentState().longitude;function h(A,p){const g=A.bounding,v=A.observers[p];if(!v)return"";const y=(g.max.x-g.min.x)*r,P=(g.max.y-g.min.y)*r,M=Math.floor(v.positionInImage.x*y),B=Math.floor(v.positionInImage.y*P);return`translate(${M}px, ${B}px)`}function u(A){e(6,c=A)}const m=Oa(A=>{e(7,d=A.longitude)},1e3/60);return bt(()=>(o.on("panoWillArrive",u),o.on("cameraDirectionUpdate",m),function(){o.off("panoWillArrive",u),o.off("cameraDirectionUpdate",m)})),n.$$set=A=>{"five"in A&&e(3,o=A.five),"pxmm"in A&&e(4,r=A.pxmm),"floorplanData"in A&&e(5,a=A.floorplanData),"cameraImageUrl"in A&&e(0,l=A.cameraImageUrl)},n.$$.update=()=>{n.$$.dirty&96&&e(2,i=h(a,c)),n.$$.dirty&128&&e(1,s=oA(d))},[l,s,i,o,r,a,c,d]}class aA extends le{constructor(t){super(),ae(this,t,rA,sA,se,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},nA)}}function lA(n){ue(n,"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 Nl(n,t,e){const i=n.slice();return i[1]=t[e],i}function Hl(n,t){let e,i,s=`${t[1].icon.width/16}rem`,o=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:n,first:null,c(){e=D("div"),i=D("div"),r=$(),w(i,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),T(i,"background-image",`url(${t[1].icon.url})`),T(i,"width",s),T(i,"height",o),w(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),T(e,"top",a),T(e,"left",l),this.first=e},m(c,d){O(c,e,d),x(e,i),x(e,r)},p(c,d){t=c,d&1&&T(i,"background-image",`url(${t[1].icon.url})`);const h=d&1;h&&T(i,"width",s),h&&T(i,"height",o),d&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&T(e,"top",a),d&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&T(e,"left",l)},d(c){c&&z(e)}}}function cA(n){let t,e=[],i=new Map,s=n[0];const o=r=>r[1].id;for(let r=0;r<s.length;r+=1){let a=Nl(n,s,r),l=o(a);i.set(l,e[r]=Hl(l,a))}return{c(){t=D("div");for(let r=0;r<e.length;r+=1)e[r].c();w(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){O(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(s=r[0],e=zt(e,a,o,1,r,s,i,t,ka,Hl,null,Nl))},i:q,o:q,d(r){r&&z(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function dA(n,t,e){let{extraObjects:i=[]}=t;return n.$$set=s=>{"extraObjects"in s&&e(0,i=s.extraObjects)},[i]}class hA extends le{constructor(t){super(),ae(this,t,dA,cA,se,{extraObjects:0},lA)}}function Fl(n){let t,e;const i=[{five:n[0],pxmm:n[1],floorIndex:n[2],floorplanData:n[4],onRoomHeightClick:n[7],highlightData:n[5],hoveredRoom:void 0}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new iu({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&183?lt(i,[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[7],highlightData:o[5],hoveredRoom:void 0}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function uA(n){let t,e,i,s,o,r;const a=[{floorIndex:n[2],floorplanData:n[4]}];let l={};for(let d=0;d<a.length;d+=1)l=et(l,a[d]);t=new eu({props:l}),i=new hA({props:{extraObjects:n[6]}});let c=n[3]&&Fl(n);return{c(){ne(t.$$.fragment),e=$(),ne(i.$$.fragment),s=$(),c&&c.c(),o=Pe()},m(d,h){te(t,d,h),O(d,e,h),te(i,d,h),O(d,s,h),c&&c.m(d,h),O(d,o,h),r=!0},p(d,[h]){const u=h&20?lt(a,[{floorIndex:d[2],floorplanData:d[4]}]):{};t.$set(u);const m={};h&64&&(m.extraObjects=d[6]),i.$set(m),d[3]?c?(c.p(d,h),h&8&&k(c,1)):(c=Fl(d),c.c(),k(c,1),c.m(o.parentNode,o)):c&&(de(),L(c,1,1,()=>{c=null}),he())},i(d){r||(k(t.$$.fragment,d),k(i.$$.fragment,d),k(c),r=!0)},o(d){L(t.$$.fragment,d),L(i.$$.fragment,d),L(c),r=!1},d(d){ie(t,d),d&&z(e),ie(i,d),d&&z(s),c&&c.d(d),d&&z(o)}}}function fA(n,t,e){let i,{five:s}=t,{pxmm:o}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:d}=t;const h=void 0;return n.$$set=u=>{"five"in u&&e(0,s=u.five),"pxmm"in u&&e(1,o=u.pxmm),"floorIndex"in u&&e(2,r=u.floorIndex),"hoverEnable"in u&&e(3,a=u.hoverEnable),"floorplanData"in u&&e(4,l=u.floorplanData),"extraObjects"in u&&e(8,c=u.extraObjects),"highlightData"in u&&e(5,d=u.highlightData)},n.$$.update=()=>{n.$$.dirty&260&&e(6,i=c==null?void 0:c.filter(u=>u.floorIndex===r))},[s,o,r,a,l,d,i,h,c]}class mA extends le{constructor(t){super(),ae(this,t,fA,uA,se,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function gA(n){ue(n,"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 _l(n){let t,e,i,s,o=n[7]!==0&&Wl(n);return{c(){t=D("div"),o&&o.c(),w(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){O(r,t,a),o&&o.m(t,null),e=!0,i||(s=[ei(Dn.call(null,t)),be(t,"clientWidth",n[13]),be(t,"clientHeight",n[14])],i=!0)},p(r,a){r[7]!==0?o?(o.p(r,a),a&128&&k(o,1)):(o=Wl(r),o.c(),k(o,1),o.m(t,null)):o&&(de(),L(o,1,1,()=>{o=null}),he())},i(r){e||(k(o),e=!0)},o(r){L(o),e=!1},d(r){r&&z(t),o&&o.d(),i=!1,Ze(s)}}}function Wl(n){let t,e,i,s,o=`${n[9]}px`,r=`${n[12]}px`,a;const l=[{five:n[0],pxmm:n[10],floorIndex:n[11],floorplanData:n[3],hoverEnable:n[2],extraObjects:n[5],highlightData:n[6]}];let c={};for(let u=0;u<l.length;u+=1)c=et(c,l[u]);e=new mA({props:c});const d=[{pxmm:n[10],five:n[0],floorplanData:n[3],cameraImageUrl:n[4]}];let h={};for(let u=0;u<d.length;u+=1)h=et(h,d[u]);return s=new aA({props:h}),{c(){t=D("div"),ne(e.$$.fragment),i=$(),ne(s.$$.fragment),w(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),T(t,"width",o),T(t,"height",r)},m(u,m){O(u,t,m),te(e,t,null),x(t,i),te(s,t,null),a=!0},p(u,m){const A=m&3181?lt(l,[{five:u[0],pxmm:u[10],floorIndex:u[11],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5],highlightData:u[6]}]):{};e.$set(A);const p=m&1049?lt(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};s.$set(p),m&512&&o!==(o=`${u[9]}px`)&&T(t,"width",o),m&4096&&r!==(r=`${u[12]}px`)&&T(t,"height",r)},i(u){a||(k(e.$$.fragment,u),k(s.$$.fragment,u),a=!0)},o(u){L(e.$$.fragment,u),L(s.$$.fragment,u),a=!1},d(u){u&&z(t),ie(e),ie(s)}}}function pA(n){let t,e,i=n[1]&&_l(n);return{c(){i&&i.c(),t=Pe()},m(s,o){i&&i.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?i?(i.p(s,o),o&2&&k(i,1)):(i=_l(s),i.c(),k(i,1),i.m(t.parentNode,t)):i&&(de(),L(i,1,1,()=>{i=null}),he())},i(s){e||(k(i),e=!0)},o(s){L(i),e=!1},d(s){i&&i.d(s),s&&z(t)}}}function AA(n,t,e){var P,M;let{five:i}=t,{visible:s}=t,{hoverEnable:o}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(M=(P=i.work.observers[i.getCurrentState().panoIndex])==null?void 0:P.floorIndex)!=null?M:0,u=0,m=0,A=0,p=0;function g(B){e(11,h=i.work.observers[B].floorIndex)}bt(()=>(i.on("panoArrived",g),()=>{i.off("panoArrived",g)}));const v=B=>{e(7,u=B.detail)},y=B=>{e(8,m=B.detail)};return n.$$set=B=>{"five"in B&&e(0,i=B.five),"visible"in B&&e(1,s=B.visible),"hoverEnable"in B&&e(2,o=B.hoverEnable),"floorplanData"in B&&e(3,r=B.floorplanData),"cameraImageUrl"in B&&e(4,a=B.cameraImageUrl),"extraObjects"in B&&e(5,l=B.extraObjects),"highlightData"in B&&e(6,c=B.highlightData)},n.$$.update=()=>{if(n.$$.dirty&904){const B=Math.min(u,m),{max:E,min:V}=r.bounding,j=E.x-V.x,X=E.y-V.y,Y=function(){return j>X?[B,B/j*X]:[B/X*j,B]}();e(9,A=Y[0]),e(12,p=Y[1]),e(10,d=A/j)}},[i,s,o,r,a,l,c,u,m,A,d,h,p,v,y]}class vA extends le{constructor(t){super(),ae(this,t,AA,pA,se,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},gA)}}let bA=class extends si{constructor(e,i){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"highlightData",{});f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s;const{userAction:i}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:i})});this.five=e;const s={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:mi},o=i!=null&&i.configs?i.configs:{},r=G(G({},s),o);this.state={enabled:!0,visible:!0,config:r},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),e.once("dispose",this.dispose)}load(e,i,s=!0){return F(this,null,function*(){function o(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=o(r)?r.data:r,l=this.data;this.data=yield gi(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),i&&this.updateState(i,s),this.render()})}show(){return F(this,arguments,function*(e={}){if(this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return F(this,arguments,function*(e={}){if(!this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,i=!0){this.setState({config:e},{userAction:i}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=Hp(e,this.five,this.data),this.render())}formatData(e){return F(this,null,function*(){return yield gi(e.data)})}_enable(e){const{userAction:i}=e;this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("show",{userAction:i}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("hide",{userAction:i}),this.render()}updateState(e,i){const s=this.state;this.state=G(G({},this.state),e),!ut(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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 e=Ae(G({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new vA({target:this.wrapper,props:e})}};const yA=(n,t)=>new bA(n,t),wA=[{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:"和室"}],CA=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],IA=[{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:"写字楼"}],Er=(n,t,e)=>{const i=new I.Matrix4,s=new I.Euler(n,t,e,"YXZ");return i.makeRotationFromEuler(s),i},PA=(n,{scale:t,rotation:e,position:i})=>{if(t&&n.scale.set(t,t,t),e){const[s,o,r]=e;s&&n.applyMatrix4(Er(s,0,0)),o&&n.applyMatrix4(Er(0,o,0)),r&&n.applyMatrix4(Er(0,0,r))}return i&&n.position.set(i.x,i.y,i.z),n};function ou(n,t){n.traverse(e=>{var i;if(e.type==="Mesh"){const s=e,o=G({map:s.material.map||{}},t);s.material=new R.MeshBasicMaterial(o),s.renderOrder=1,((i=e.parent)==null?void 0:i.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const EA=(n,t)=>{var p;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",i=(p=t.north_rad)!=null?p:void 0,s={};let o={x:0,y:0,z:0},r=[0,0,0],a=1,l=i;n.on("modelLoaded",A);const c=g=>F(exports,null,function*(){var M;const v=(g==null?void 0:g.fbx_url)||e;if(l=(M=g==null?void 0:g.north_rad)!=null?M:i,typeof l!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const P=yield new mh.FBXLoader().loadAsync(v);return ou(P,{transparent:!0,side:I.DoubleSide,blending:I.AdditiveBlending}),s.object=P,A(),!0}),d=({latitude:g})=>{if(!s.object)return;const v=h(g);v&&(s.object.position.y=v)},h=g=>{if(s.yBase===void 0)return;const v=.6;if(g>=Math.PI/4)return s.yBase-(v+1.6);const y=g*(4/Math.PI);return s.yBase-(v*y+1.6)},u=()=>{if(!s.object)return;const g=h(n.getPose().latitude);g&&(s.object.position.y=g),n.scene.add(s.object),n.needsRender=!0,n.on("cameraDirectionUpdate",d)},m=()=>{s.object&&(n.scene.remove(s.object),n.needsRender=!0,n.off("cameraDirectionUpdate",d))};function A(){const g=s.object;if(!g)return;const v=n.model.bounding,y=v.max.x-v.min.x,P=v.max.z-v.min.z,M=Math.max(y,P),{max:{x:B,z:E},min:{x:V,y:j,z:X}}=v;s.yBase=j,o={x:(B+V)/2,y:j-1.6,z:(E+X)/2},r=[0,l-Math.PI/2,0],a=.0045*M,PA(g,{position:o,rotation:r,scale:a})}return{load:c,disable:m,enable:u}};function MA(n,t){var c,d,h,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,i=(d=t==null?void 0:t.fontSize)!=null?d:e*(35/256)*1.2,s=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",o=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=s,l.fillRect(0,0,e,e),l.font=`${i}px "微软雅黑"`,l.textAlign=r,l.fillStyle=o,l.fillText(n,e/2,e*.7),new R.CanvasTexture(a)}const kA=({x:n,y:t,z:e})=>new R.Vector3(n,t,e),xA=(n,t)=>{var p,g,v;const e={},i=(p=t.animationEnabled)!=null?p:!0,s=(g=t.position)!=null?g:void 0,o=(v=t.rad)!=null?v:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>F(exports,null,function*(){var Y,N,H,_,Q,W,Z,J;const P=(Y=y==null?void 0:y.position)!=null?Y:s;if(!P)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const M=kA(P),B=(N=y==null?void 0:y.rad)!=null?N:o,E=(H=y==null?void 0:y.fbx_url)!=null?H:r;if(e.rad=B,B===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${B}`));const V=yield new mh.FBXLoader().loadAsync(E);V.position.copy(M),V.rotation.z=B,V.scale.set(.8,.8,.8),ou(V,{transparent:!0,side:I.DoubleSide});const j=(Z=(W=(Q=(_=V.children)==null?void 0:_[0])==null?void 0:Q.children)==null?void 0:W[3])==null?void 0:Z.clone();if(!j)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${j}`));const X=(J=t.name)!=null?J:"入户门";return j.material=new R.MeshBasicMaterial({transparent:!0,map:MA(X)}),j.renderOrder=3,V.children[0].add(j),e.object=V,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,P=new R.AnimationMixer(e.object);a.push(P);const M=P.clipAction(e.object.animations[0]);M.timeScale=y;let B;const E=()=>{let Y=0,N=0;const H=1e3/30,_=Q=>{Y=requestAnimationFrame(_);const W=Q-N;W<H||(N=Q,a.forEach(Z=>Z.update(W/1e3)),n.needsRender=!0)};return Y=requestAnimationFrame(_),()=>{cancelAnimationFrame(Y)}},X={play:()=>{B||(M.play(),B=E(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{M.stop(),B==null||B(),B=void 0}};e.animation=X},d=y=>{var M;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((M=y==null?void 0:y.animationEnable)!=null?M:i)&&(e.animation||c(),e.animation.play()),n.scene.add(e.object),n.needsRender=!0},h=()=>{e.object&&(e.animation&&e.animation.stop(),n.scene.remove(e.object),n.needsRender=!0)},u=y=>y==="Floorplan"?d():h();return{load:l,enable:y=>(e.enabled||(e.enabled=!0,u(n.currentMode),n.on("modeChange",u),d(y)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),n.off("modeChange",u)),!0)}},DA=Tt;function SA(n,t,e,i=DA.Linear.None){const s=new Ao(n).to(t,e).easing(i);vo(()=>s.start(0));const o=Cn(a=>{s.update(a)===!1&&o()}),r=[];return s.onDestroy=a=>(r.push(a),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();o()},s}function TA(n,t){return SA({progress:0},{progress:1},n,t)}var ru=(n=>(n.Move="Move",n.Rotate="Rotate",n))(ru||{}),Gt=(n=>(n.Clockwise="Clockwise",n.Anticlockwise="Anticlockwise",n.Loop="Loop",n))(Gt||{});const Xs=Math.PI*2;function Yl(n){return(n%Xs+Xs)%Xs}function Ul(n){return n%Xs}function Mr(n,t,e){return n+(t-n)*e}const $r=(n,t,e)=>{const i=Math.PI,s=i*2;let o=Yl(n),r=Yl(t);return e===Gt.Anticlockwise&&o<r&&(o+=s),e===Gt.Clockwise&&r<o&&(r+=s),e===Gt.Loop&&r-o>i?$r(o,r,Gt.Anticlockwise):e===Gt.Loop&&o-r>i?$r(o,r,Gt.Clockwise):{from:o,to:r}},LA=n=>{const t={},e=(l,c,...d)=>F(exports,[l,c,...d],function*(o,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),o.mode&&o.mode!==n.currentMode&&(yield n.changeMode(o.mode)),a.preload&&o.panoIndex!==void 0&&o.panoIndex!==n.panoIndex&&(yield n.preloadPano(o.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0?!0:yield new Promise((h,u)=>{const m=o.panoIndex!==void 0?o.panoIndex:n.panoIndex;m!==void 0?n.moveToPano(m,G({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},o)):u(new Error("unexpected error"))})}),i=o=>{const r=n.state,a=Ul(r.latitude),l=Ul(o.latitude),{from:c,to:d}=$r(r.longitude,o.longitude,o.rotation||Gt.Loop),h=r.fov,u=o.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>F(exports,[l,c,...d],function*(o,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),n.currentMode!==Le.Five.Mode.Panorama&&(yield n.changeMode(Le.Five.Mode.Panorama)),o.panoIndex!==void 0&&o.panoIndex!==n.panoIndex&&(a.preload&&(yield n.preloadPano(o.panoIndex)),yield new Promise((m,A)=>{if(!o.panoIndex){m(!0);return}n.moveToPano(o.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>A(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=i(o);return yield new Promise(m=>{const A=({progress:P})=>{const M={};M.longitude=Mr(h.longitude,u.longitude,P),M.latitude=Mr(h.latitude,u.latitude,P),M.fov=Mr(h.fov,u.fov,P),n.setState(M,!0)},p=()=>{m(!0)},g=()=>{m(!1)},v=o.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/o.rotateSpeed*1e3):r,y=TA(v,Tt.Linear.None).onUpdate(A).onComplete(p).onDestroy(g);o.rotation===Gt.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(P=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(P)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function Xl(n,t){return n.x===t.x&&n.y===t.y}function au(n,t){return Math.abs(n)===1/0&&Math.abs(t)===1/0?!0:Math.abs(n-t)<.001}function co(n,t){return(t.y-n.y)/(t.x-n.x)}function lu(n,t,e){const i=co(n[1],n[0]),s=co(t[1],t[0]);if(isNaN(i)||isNaN(s)||au(i,s))return!1;if(js(n[0],t))return n[0];if(js(n[1],t))return n[1];if(js(t[0],n))return t[0];if(js(t[1],n))return t[1];if(e&&!zA(n,t))return!1;const o=n[0],r=t[0];if(Math.abs(i)===1/0)return{x:o.x,y:t[1].y-(t[1].x-o.x)*s};if(Math.abs(s)===1/0)return{x:r.x,y:n[1].y-(n[1].x-r.x)*i};const a=(r.y-o.y+i*o.x-s*r.x)/(i-s),l=i*a-i*o.x+o.y;return{x:a,y:l}}function js(n,t){return Xl(n,t[0])||Xl(n,t[1])?!0:(t[0].x-n.x)*(n.x-t[1].x)>=0&&(t[0].y-n.y)*(n.y-t[1].y)>=0&&au(co(t[0],n),co(n,t[1]))}function jA(n){let t=1/0,e=-1/0,i=1/0,s=-1/0;return n.forEach(o=>{t=Math.min(t,o.x),e=Math.max(e,o.x),i=Math.min(i,o.y),s=Math.max(s,o.y)}),{x:(t+e)/2,y:(i+s)/2}}function zs(n,t,e){return(n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y)}function zA(n,t){return Math.max(n[0].x,n[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(n[0].x,n[1].x)&&Math.max(n[0].y,n[1].y)>=Math.min(t[0].y,t[1].y)&&zs(t[0],n[1],n[0])*zs(n[1],t[1],n[0])>0&&zs(n[0],t[1],t[0])*zs(t[1],n[1],t[0])>0?1:0}function cu(n,t=0){t<=0?requestAnimationFrame(n):requestAnimationFrame(()=>cu(n,t-1))}const OA=`<style type="text/css">
|
|
194
|
+
`;return n.$$set=o=>{"content"in o&&e(0,i=o.content)},[i,s]}class Lg extends le{constructor(t){super(),ae(this,t,Tg,Sg,se,{content:0},Dg)}}function jg(n){ue(n,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function zg(n){let t,e;return t=new xg({props:{url:n[1].url}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&2&&(o.url=i[1].url),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function Og(n){let t,e;return t=new Lg({props:{content:n[0]}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.content=i[0]),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function Bg(n){let t,e,i,s;const o=[Og,zg],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(n))&&(i=r[e]=o[e](n)),{c(){t=D("div"),i&&i.c(),w(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){O(l,t,c),~e&&r[e].m(t,null),s=!0},p(l,[c]){let d=e;e=a(l),e===d?~e&&r[e].p(l,c):(i&&(de(),L(r[d],1,1,()=>{r[d]=null}),he()),~e?(i=r[e],i?i.p(l,c):(i=r[e]=o[e](l),i.c()),k(i,1),i.m(t,null)):i=null)},i(l){s||(k(i),s=!0)},o(l){L(i),s=!1},d(l){l&&z(t),~e&&r[e].d()}}}function Vg(n,t,e){let i,s,{floorIndex:o}=t,{floorplanData:r}=t;return n.$$set=a=>{"floorIndex"in a&&e(2,o=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},n.$$.update=()=>{var a,l;n.$$.dirty&12&&e(1,i=r.outlines[o]),n.$$.dirty&12&&e(0,s=(l=(a=r.outlines)==null?void 0:a[o])==null?void 0:l.svgContent)},[s,i,o,r]}class eu extends le{constructor(t){super(),ae(this,t,Vg,Bg,se,{floorIndex:2,floorplanData:3},jg)}}function Rg(n){ue(n,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{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-size.svelte-12pzct5{opacity:0.45}")}function Gg(n){let t,e=n[8].outerHTML+"",i;return{c(){t=new eo(!1),i=Pe(),t.a=i},m(s,o){t.m(e,s,o),O(s,i,o)},p(s,o){o&256&&e!==(e=s[8].outerHTML+"")&&t.p(e)},d(s){s&&z(i),s&&t.d()}}}function Qg(n){let t,e,i=n[1]&&ml(n),s=n[0]&&gl(n);return{c(){i&&i.c(),t=$(),s&&s.c(),e=Pe()},m(o,r){i&&i.m(o,r),O(o,t,r),s&&s.m(o,r),O(o,e,r)},p(o,r){o[1]?i?i.p(o,r):(i=ml(o),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),o[0]?s?s.p(o,r):(s=gl(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(o){i&&i.d(o),o&&z(t),s&&s.d(o),o&&z(e)}}}function ml(n){let t,e=n[2].name+"",i;return{c(){t=D("span"),i=ke(e),w(t,"class","floorplan-plugin__room-name")},m(s,o){O(s,t,o),x(t,i)},p(s,o){o&4&&e!==(e=s[2].name+"")&&De(i,e)},d(s){s&&z(t)}}}function gl(n){let t,e;return{c(){t=D("span"),e=ke(n[7]),w(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(i,s){O(i,t,s),x(t,e)},p(i,s){s&128&&De(e,i[7])},d(i){i&&z(t)}}}function Ng(n){let t,e,i;function s(a,l){if(a[3]===void 0)return Qg;if(a[8])return Gg}let o=s(n),r=o&&o(n);return{c(){t=D("div"),r&&r.c(),w(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),T(t,"left",n[9]),T(t,"top",n[10]),T(t,"font-size",n[11]),T(t,"opacity",n[6]?"1":"0")},m(a,l){O(a,t,l),r&&r.m(t,null),e||(i=[ei(Dn.call(null,t)),be(t,"clientWidth",n[19]),be(t,"clientHeight",n[20])],e=!0)},p(a,[l]){o===(o=s(a))&&r?r.p(a,l):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null))),l&64&&T(t,"opacity",a[6]?"1":"0")},i:q,o:q,d(a){a&&z(t),r&&r.d(),e=!1,Ze(i)}}}function Hg(n,t){const e=n[0],i=n[1];let s=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){const a=t[o][0],l=t[o][1],c=t[r][0],d=t[r][1];l>i!=d>i&&e<(c-a)*(i-l)/(d-l)+a&&(s=!s)}return s}function Fg(n,t,e){let i,s,o,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:d}=t,{room:h}=t,{hoveredRoom:u}=t,{getRoomAreaText:m}=t,{getLabelElement:A}=t,{adaptiveRoomLabelVisibleEnable:p}=t;function g(H,_){if(_.width===0||_.height===0)return()=>!1;const Q=H.path.map(({x:Ce,y:pe})=>[Ce,pe]),W=H.roomLabel.position,{x:Z,y:J}=W,{width:ee,height:ce}=_,oe=ee/2,we=ce/2;return function(pe){const Be=Z*pe,ve=J*pe,We=Q.map(([ye,je])=>[ye*pe,je*pe]);return[[Be+oe,ve-we],[Be-oe,ve-we],[Be-oe,ve+we],[Be+oe,ve+we]].every(ye=>Hg(ye,We))}}const v=document.body.clientWidth,y=document.body.clientHeight,P=h.roomLabel,M=P.positionInImage.x*100+"%",B=P.positionInImage.y*100+"%",E=(v<500||y<500?10:14)+"px";let V=0,j=0,X=!1;u.subscribe(function(_){e(16,X=!!_&&_.id===h.id)});const Y=H=>{e(4,V=H.detail)},N=H=>{e(5,j=H.detail)};return n.$$set=H=>{"pxmm"in H&&e(12,l=H.pxmm),"roomAreaEnable"in H&&e(0,c=H.roomAreaEnable),"roomNameEnable"in H&&e(1,d=H.roomNameEnable),"room"in H&&e(2,h=H.room),"hoveredRoom"in H&&e(13,u=H.hoveredRoom),"getRoomAreaText"in H&&e(14,m=H.getRoomAreaText),"getLabelElement"in H&&e(3,A=H.getLabelElement),"adaptiveRoomLabelVisibleEnable"in H&&e(15,p=H.adaptiveRoomLabelVisibleEnable)},n.$$.update=()=>{n.$$.dirty&12&&e(8,i=A==null?void 0:A(h)),n.$$.dirty&16388&&e(7,s=h.size?m(h.size):""),n.$$.dirty&48&&e(18,o={width:V,height:j}),n.$$.dirty&262148&&e(17,r=o?g(h,o):void 0),n.$$.dirty&233472&&e(6,a=p?X?!0:!!(r!=null&&r(l)):!0)},[c,d,h,A,V,j,a,s,i,M,B,E,l,u,m,p,X,r,o,Y,N]}class _g extends le{constructor(t){super(),ae(this,t,Fg,Ng,se,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Rg)}}function Wg(n){ue(n,"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 pl(n,t,e){const i=n.slice();return i[12]=t[e],i}function Al(n){let t,e=[],i=new Map,s,o,r,a=n[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=pl(n,a,c),h=l(d);i.set(h,e[c]=vl(h,d))}return{c(){t=D("div");for(let c=0;c<e.length;c+=1)e[c].c();w(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,d){O(c,t,d);for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(t,null);s=!0,o||(r=[ei(Dn.call(null,t)),be(t,"clientWidth",n[11])],o=!0)},p(c,d){d&447&&(a=c[8],de(),e=zt(e,d,l,1,c,a,i,t,bi,vl,null,pl),he())},i(c){if(!s){for(let d=0;d<a.length;d+=1)k(e[d]);s=!0}},o(c){for(let d=0;d<e.length;d+=1)L(e[d]);s=!1},d(c){c&&z(t);for(let d=0;d<e.length;d+=1)e[d].d();o=!1,Ze(r)}}}function vl(n,t){let e,i,s;const o=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return i=new _g({props:r}),{key:n,first:null,c(){e=Pe(),ne(i.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(i,a,l),s=!0},p(a,l){t=a;const c=l&447?lt(o,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};i.$set(c)},i(a){s||(k(i.$$.fragment,a),s=!0)},o(a){L(i.$$.fragment,a),s=!1},d(a){a&&z(e),ie(i,a)}}}function Yg(n){let t,e,i=n[8]&&Al(n);return{c(){i&&i.c(),t=Pe()},m(s,o){i&&i.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[8]?i?(i.p(s,o),o&256&&k(i,1)):(i=Al(s),i.c(),k(i,1),i.m(t.parentNode,t)):i&&(de(),L(i,1,1,()=>{i=null}),he())},i(s){e||(k(i),e=!0)},o(s){L(i),e=!1},d(s){i&&i.d(s),s&&z(t)}}}function Ug(n,t,e){let i,{floorIndex:s}=t,{roomAreaEnable:o}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t,u=0,m=0;const A=p=>{e(6,u=p.detail)};return n.$$set=p=>{"floorIndex"in p&&e(9,s=p.floorIndex),"roomAreaEnable"in p&&e(0,o=p.roomAreaEnable),"roomNameEnable"in p&&e(1,r=p.roomNameEnable),"floorplanData"in p&&e(10,a=p.floorplanData),"hoveredRoom"in p&&e(2,l=p.hoveredRoom),"getRoomAreaText"in p&&e(3,c=p.getRoomAreaText),"getLabelElement"in p&&e(4,d=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(5,h=p.adaptiveRoomLabelVisibleEnable)},n.$$.update=()=>{if(n.$$.dirty&1536&&e(8,i=a.floorDatas[s].rooms),n.$$.dirty&1088){const{max:p,min:g}=a.bounding,v=p.x-g.x;e(7,m=u/v)}},[o,r,l,c,d,h,u,m,i,s,a,A]}class Xg extends le{constructor(t){super(),ae(this,t,Ug,Yg,se,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Wg)}}function Jg(n){ue(n,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function bl(n,t,e){const i=n.slice();return i[11]=t[e],i[13]=e,i}function yl(n,t,e){const i=n.slice();return i[14]=t[e],i}function wl(n){let t;return{c(){t=D("div"),w(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),T(t,"left",n[14].left*100+"%"),T(t,"bottom",n[14].bottom*100+"%")},m(e,i){O(e,t,i)},p:q,d(e){e&&z(t)}}}function Cl(n,t){let e,i,s=t[1](t[11].distance)+"",o,r;return{key:n,first:null,c(){e=D("div"),i=D("div"),o=ke(s),r=$(),w(i,"class","floorplan-plugin__rule-text svelte-djlmk4"),K(i,"is-row",t[2]),w(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),T(e,"left",t[11].left*100+"%"),T(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){O(a,e,l),x(e,i),x(i,o),x(e,r)},p(a,l){t=a,l&2&&s!==(s=t[1](t[11].distance)+"")&&De(o,s)},d(a){a&&z(e)}}}function Zg(n){let t,e,i,s,o,r,a=[],l=new Map,c,d=n[3],h=[];for(let A=0;A<d.length;A+=1)h[A]=wl(yl(n,d,A));let u=n[4];const m=A=>A[13];for(let A=0;A<u.length;A+=1){let p=bl(n,u,A),g=m(p);l.set(g,a[A]=Cl(g,p))}return{c(){t=D("div"),e=D("div"),i=$(),s=D("div");for(let A=0;A<h.length;A+=1)h[A].c();o=$(),r=D("div");for(let A=0;A<a.length;A+=1)a[A].c();w(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),w(s,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),K(s,"is-row",n[2]),w(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),w(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+n[0]+" svelte-djlmk4"),K(t,"is-row",n[2]),T(t,"width",n[2]?"100%":1/16+"rem"),T(t,"height",n[2]?1/16+"rem":"100%")},m(A,p){O(A,t,p),x(t,e),x(t,i),x(t,s);for(let g=0;g<h.length;g+=1)h[g]&&h[g].m(s,null);x(t,o),x(t,r);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(r,null)},p(A,[p]){if(p&8){d=A[3];let g;for(g=0;g<d.length;g+=1){const v=yl(A,d,g);h[g]?h[g].p(v,p):(h[g]=wl(v),h[g].c(),h[g].m(s,null))}for(;g<h.length;g+=1)h[g].d(1);h.length=d.length}p&22&&(u=A[4],a=zt(a,p,m,1,A,u,l,r,ka,Cl,null,bl)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+A[0]+" svelte-djlmk4")&&w(t,"class",c),p&5&&K(t,"is-row",A[2])},i:q,o:q,d(A){A&&z(t),Lt(h,A);for(let p=0;p<a.length;p+=1)a[p].d()}}}const en=1e3,tn=180;function qg(n,t,e){let{type:i}=t,{data:s}=t,{bounding:o}=t,{getRuleDistanceText:r}=t;const a=i==="top"||i==="bottom",l=o.max.x-o.min.x-(en-tn)*2,c=o.max.y-o.min.y-(en-tn)*2,d=s.map(([A,p])=>a?[A.x,p.x]:[A.y,p.y]).flat().sort().filter((A,p,g)=>p===0?!0:A!==g[p-1]),h=d.map(A=>{const p=a?(A-o.min.x-en+tn)/l:0,g=a?0:(A-o.min.y-en+tn)/c;return{left:p,bottom:g}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=d[d.length-1]-d[0],m=d.map((A,p,g)=>{const v=p===0?0:A-g[p-1],y=p===0?0:(A+g[p-1])/2,P=a?(y-o.min.x-en+tn)/l:0,M=a?0:(y-o.min.y-en+tn)/c;return{left:P,bottom:M,distance:v}}).filter(({distance:A})=>A/u>.1);return n.$$set=A=>{"type"in A&&e(0,i=A.type),"data"in A&&e(5,s=A.data),"bounding"in A&&e(6,o=A.bounding),"getRuleDistanceText"in A&&e(1,r=A.getRuleDistanceText)},[i,r,a,h,m,s,o]}class Kg extends le{constructor(t){super(),ae(this,t,qg,Zg,se,{type:0,data:5,bounding:6,getRuleDistanceText:1},Jg)}}function $g(n){ue(n,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Il(n,t,e){const i=n.slice();return i[13]=t[e][0],i[14]=t[e][1],i}function Pl(n,t){let e,i,s;const o=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return i=new Kg({props:r}),{key:n,first:null,c(){e=Pe(),ne(i.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(i,a,l),s=!0},p(a,l){t=a;const c=l&19?lt(o,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};i.$set(c)},i(a){s||(k(i.$$.fragment,a),s=!0)},o(a){L(i.$$.fragment,a),s=!1},d(a){a&&z(e),ie(i,a)}}}function ep(n){let t,e=[],i=new Map,s,o=n[4];const r=a=>a[13];for(let a=0;a<o.length;a+=1){let l=Il(n,o,a),c=r(l);i.set(c,e[a]=Pl(c,l))}return{c(){t=D("div");for(let a=0;a<e.length;a+=1)e[a].c();w(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),T(t,"width",n[3]),T(t,"height",n[2])},m(a,l){O(a,t,l);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(a,[l]){l&19&&(o=a[4],de(),e=zt(e,l,r,1,a,o,i,t,bi,Pl,null,Il),he()),l&8&&T(t,"width",a[3]),l&4&&T(t,"height",a[2])},i(a){if(!s){for(let l=0;l<o.length;l+=1)k(e[l]);s=!0}},o(a){for(let l=0;l<e.length;l+=1)L(e[l]);s=!1},d(a){a&&z(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const El=1e3,Ml=180;function tp(n,t,e){let i,s,o,r,a,l,c,d,h,u,{floorIndex:m}=t,{floorplanData:A}=t,{getRuleDistanceText:p}=t;return n.$$set=g=>{"floorIndex"in g&&e(5,m=g.floorIndex),"floorplanData"in g&&e(6,A=g.floorplanData),"getRuleDistanceText"in g&&e(0,p=g.getRuleDistanceText)},n.$$.update=()=>{n.$$.dirty&64&&e(1,i=A.bounding),n.$$.dirty&96&&e(11,s=A.floorDatas[m].rules),n.$$.dirty&2048&&e(12,o=Object.keys(s)),n.$$.dirty&6144&&e(4,r=o.map(g=>[g,s[g]])),n.$$.dirty&2&&e(9,a=i.max.x-i.min.x),n.$$.dirty&2&&e(7,l=i.max.y-i.min.y),n.$$.dirty&2&&e(10,c=i.max.x-i.min.x-(El-Ml)*2),n.$$.dirty&2&&e(8,d=i.max.y-i.min.y-(El-Ml)*2),n.$$.dirty&1536&&e(3,h=c/a*100+"%"),n.$$.dirty&384&&e(2,u=d/l*100+"%")},[p,i,u,h,r,m,A,l,d,a,c,s,o]}class ip extends le{constructor(t){super(),ae(this,t,tp,ep,se,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},$g)}}function Po(n,t={}){let e="";const{needZ:i,needA:s}=t;return(i?n.slice().concat(n[0]):n.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,d=l+","+c;return a===0?(e+="M"+d,e):s!=null&&s[a]?(e+="A"+s[a]+","+d,e):(e+="L"+d,e)}),e+(i?"Z":"")}function tu({x:n,y:t},e){const{max:i,min:s}=e;return{x:n-s.x,y:i.y-t}}function np(n,t){const e=n.x*1e3+t.bounding.origin.x,i=-n.z*1e3+t.bounding.origin.y;return{x:e,y:i}}function sp(n,t){const e=t.bounding,i=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(n.x-e.min.x)/i,y:(e.max.y-n.y)/s}}function op(n,t){return Math.max(...t.work.observers.map(i=>n.z>=i.standingPosition.z?i.floorIndex:0))}function rp(n){let t;return{c(){t=Oe("path"),w(t,"d",n[0]),w(t,"fill","#2F313A")},m(e,i){O(e,t,i)},p(e,[i]){i&1&&w(t,"d",e[0])},i:q,o:q,d(e){e&&z(t)}}}function ap(n,t,e){let i,{path:s}=t;return n.$$set=o=>{"path"in o&&e(1,s=o.path)},n.$$.update=()=>{n.$$.dirty&2&&e(0,i=Po(s,{needZ:!0}))},[i,s]}class lp extends le{constructor(t){super(),ae(this,t,ap,rp,se,{path:1})}}function cp(n){let t,e,i,s,o,r;return{c(){t=Oe("defs"),e=Oe("pattern"),i=Oe("rect"),s=Oe("path"),o=$(),r=Oe("path"),w(i,"x","0"),w(i,"y","0"),w(i,"width",n[1]),w(i,"height",n[1]),w(i,"fill","#323747"),w(s,"d",n[2]),w(s,"stroke","#ffffff"),w(s,"stroke-opacity","0.06"),w(s,"stroke-width","0.5"),w(s,"fill","none"),w(e,"id","fpm-room-pattern-0"),w(e,"x","0"),w(e,"y","0"),w(e,"width",n[1]),w(e,"height",n[1]),w(e,"patternUnits","userSpaceOnUse"),w(e,"patternTransform","scale(50 50)"),w(r,"d",n[0]),w(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){O(a,t,l),x(t,e),x(e,i),x(e,s),O(a,o,l),O(a,r,l)},p(a,[l]){l&1&&w(r,"d",a[0])},i:q,o:q,d(a){a&&z(t),a&&z(o),a&&z(r)}}}const Pr=6;function dp(n,t,e){let i,{path:s}=t;const o=Pr*2,r=`M0 ${Pr} h ${o} M${Pr} 0 v ${o}`;return n.$$set=a=>{"path"in a&&e(3,s=a.path)},n.$$.update=()=>{n.$$.dirty&8&&e(0,i=Po(s,{needZ:!0}))},[i,o,r,s]}class hp extends le{constructor(t){super(),ae(this,t,dp,cp,se,{path:3})}}function up(n){let t,e,i,s,o,r,a,l,c,d,h;return{c(){t=Oe("defs"),e=Oe("pattern"),i=Oe("rect"),s=Oe("pattern"),o=Oe("rect"),r=$(),a=Oe("path"),l=$(),c=Oe("path"),d=$(),h=Oe("path"),w(i,"x","0"),w(i,"y","0"),w(i,"width","6"),w(i,"height","50"),w(i,"fill","none"),w(i,"stroke","#4B4B57"),w(i,"stroke-width","0.5"),w(e,"id","room-material-pattern-1"),w(e,"x","0"),w(e,"y","0"),w(e,"width","12"),w(e,"height","50"),w(e,"patternUnits","userSpaceOnUse"),w(e,"patternTransform","scale(50 50)"),w(o,"x","0"),w(o,"y","0"),w(o,"width","6"),w(o,"height","50"),w(o,"fill","none"),w(o,"stroke","#4B4B57"),w(o,"stroke-width","0.5"),w(s,"id","room-material-pattern-2"),w(s,"x","6"),w(s,"y","25"),w(s,"width","12"),w(s,"height","50"),w(s,"patternUnits","userSpaceOnUse"),w(s,"patternTransform","scale(50 50)"),w(a,"d",n[0]),w(a,"fill","#43434D"),w(c,"d",n[0]),w(c,"fill","url(#room-material-pattern-1)"),w(h,"d",n[0]),w(h,"fill","url(#room-material-pattern-2)")},m(u,m){O(u,t,m),x(t,e),x(e,i),x(t,s),x(s,o),O(u,r,m),O(u,a,m),O(u,l,m),O(u,c,m),O(u,d,m),O(u,h,m)},p(u,[m]){m&1&&w(a,"d",u[0]),m&1&&w(c,"d",u[0]),m&1&&w(h,"d",u[0])},i:q,o:q,d(u){u&&z(t),u&&z(r),u&&z(a),u&&z(l),u&&z(c),u&&z(d),u&&z(h)}}}function fp(n,t,e){let i,{path:s}=t;return n.$$set=o=>{"path"in o&&e(1,s=o.path)},n.$$.update=()=>{n.$$.dirty&2&&e(0,i=Po(s,{needZ:!0}))},[i,s]}class mp extends le{constructor(t){super(),ae(this,t,fp,up,se,{path:1})}}function gp(n){ue(n,"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 kl(n,t,e){const i=n.slice();return i[5]=t[e],i}function pp(n){let t,e;return t=new hp({props:{path:n[5].path}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function Ap(n){let t,e;return t=new mp({props:{path:n[5].path}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function vp(n){let t,e;return t=new lp({props:{path:n[5].path}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&1&&(o.path=i[5].path),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function xl(n){let t,e,i,s;const o=[vp,Ap,pp],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(n),i=r[e]=o[e](n),{c(){t=Oe("svg"),i.c(),w(t,"width","100%"),w(t,"height","100%"),w(t,"viewBox",`0 0 ${n[1]} ${n[2]}`),w(t,"class","svelte-1dykexu")},m(l,c){O(l,t,c),r[e].m(t,null),s=!0},p(l,c){let d=e;e=a(l),e===d?r[e].p(l,c):(de(),L(r[d],1,1,()=>{r[d]=null}),he(),i=r[e],i?i.p(l,c):(i=r[e]=o[e](l),i.c()),k(i,1),i.m(t,null))},i(l){s||(k(i),s=!0)},o(l){L(i),s=!1},d(l){l&&z(t),r[e].d()}}}function bp(n){let t,e,i=n[0],s=[];for(let r=0;r<i.length;r+=1)s[r]=xl(kl(n,i,r));const o=r=>L(s[r],1,1,()=>{s[r]=null});return{c(){t=D("div");for(let r=0;r<s.length;r+=1)s[r].c();w(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){O(r,t,a);for(let l=0;l<s.length;l+=1)s[l]&&s[l].m(t,null);e=!0},p(r,[a]){if(a&7){i=r[0];let l;for(l=0;l<i.length;l+=1){const c=kl(r,i,l);s[l]?(s[l].p(c,a),k(s[l],1)):(s[l]=xl(c),s[l].c(),k(s[l],1),s[l].m(t,null))}for(de(),l=i.length;l<s.length;l+=1)o(l);he()}},i(r){if(!e){for(let a=0;a<i.length;a+=1)k(s[a]);e=!0}},o(r){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)L(s[a]);e=!1},d(r){r&&z(t),Lt(s,r)}}}function yp(n,t,e){let i,{floorIndex:s}=t,{floorplanData:o}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return n.$$set=l=>{"floorIndex"in l&&e(3,s=l.floorIndex),"floorplanData"in l&&e(4,o=l.floorplanData)},n.$$.update=()=>{n.$$.dirty&24&&e(0,i=o.floorDatas[s].rooms.map(l=>Ae(G({},l),{path:l.path.map(c=>tu(c,o.bounding))})))},[i,r,a,s,o]}class wp extends le{constructor(t){super(),ae(this,t,yp,bp,se,{floorIndex:3,floorplanData:4},gp)}}function Cp(n){ue(n,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function Ip(n){let t,e,i,s;return{c(){t=Oe("path"),w(t,"d",n[5]),w(t,"fill","#fff"),w(t,"style",n[2]),w(t,"id",e=`${n[1]}_${n[0].id}`),w(t,"class","svelte-qq2273")},m(o,r){O(o,t,r),i||(s=[be(t,"mouseenter",n[3]),be(t,"mouseleave",n[4])],i=!0)},p(o,[r]){r&4&&w(t,"style",o[2]),r&3&&e!==(e=`${o[1]}_${o[0].id}`)&&w(t,"id",e)},i:q,o:q,d(o){o&&z(t),i=!1,Ze(s)}}}function Pp(n,t,e){let i,s,{room:o}=t,{floorIndex:r}=t,{floorplanData:a}=t,{highlightData:l}=t,{hoveredRoom:c}=t;function d(){c==null||c.set(o)}function h(){c==null||c.set(void 0)}const{bounding:u}=a,m=Po(o.path,{needZ:!0,format:A=>tu(A,u)});return n.$$set=A=>{"room"in A&&e(0,o=A.room),"floorIndex"in A&&e(1,r=A.floorIndex),"floorplanData"in A&&e(6,a=A.floorplanData),"highlightData"in A&&e(7,l=A.highlightData),"hoveredRoom"in A&&e(8,c=A.hoveredRoom)},n.$$.update=()=>{n.$$.dirty&131&&e(9,i=l[`${r}_${o.id}`]),n.$$.dirty&512&&e(2,s=i?`fill: ${i.color}; --opacity: ${i.opacity}; pointer-events: ${i.disabled?"none":"auto"}`:null)},[o,r,s,d,h,m,a,l,c,i]}class Ep extends le{constructor(t){super(),ae(this,t,Pp,Ip,se,{room:0,floorIndex:1,floorplanData:6,highlightData:7,hoveredRoom:8},Cp)}}function Mp(n){ue(n,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function Dl(n,t,e){const i=n.slice();return i[6]=t[e],i}function Sl(n,t){let e,i,s;const o=[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}];let r={};for(let a=0;a<o.length;a+=1)r=et(r,o[a]);return i=new Ep({props:r}),{key:n,first:null,c(){e=Pe(),ne(i.$$.fragment),this.first=e},m(a,l){O(a,e,l),te(i,a,l),s=!0},p(a,l){t=a;const c=l&15?lt(o,[{room:t[6],floorplanData:t[1],hoveredRoom:t[3],floorIndex:t[0],highlightData:t[2]}]):{};i.$set(c)},i(a){s||(k(i.$$.fragment,a),s=!0)},o(a){L(i.$$.fragment,a),s=!1},d(a){a&&z(e),ie(i,a)}}}function kp(n){let t,e,i=[],s=new Map,o,r=n[1].floorDatas[n[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=Dl(n,r,l),d=a(c);s.set(d,i[l]=Sl(d,c))}return{c(){t=D("div"),e=Oe("svg");for(let l=0;l<i.length;l+=1)i[l].c();w(e,"width","100%"),w(e,"height","100%"),w(e,"viewBox",`0 0 ${n[4]} ${n[5]}`),w(e,"class","svelte-1kqo6e4"),w(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){O(l,t,c),x(t,e);for(let d=0;d<i.length;d+=1)i[d]&&i[d].m(e,null);o=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,de(),i=zt(i,c,a,1,l,r,s,e,bi,Sl,null,Dl),he())},i(l){if(!o){for(let c=0;c<r.length;c+=1)k(i[c]);o=!0}},o(l){for(let c=0;c<i.length;c+=1)L(i[c]);o=!1},d(l){l&&z(t);for(let c=0;c<i.length;c+=1)i[c].d()}}}function xp(n,t,e){let{floorIndex:i}=t,{floorplanData:s}=t,{highlightData:o}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return n.$$set=c=>{"floorIndex"in c&&e(0,i=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"highlightData"in c&&e(2,o=c.highlightData),"hoveredRoom"in c&&e(3,r=c.hoveredRoom)},[i,s,o,r,a,l]}class iu extends le{constructor(t){super(),ae(this,t,xp,kp,se,{floorIndex:0,floorplanData:1,highlightData:2,hoveredRoom:3},Mp)}}function Dp(n){ue(n,"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 Tl(n){let t,e;const i=[{floorIndex:n[1],floorplanData:n[8],hoveredRoom:n[14],highlightData:n[13]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new iu({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&24834?lt(i,[{floorIndex:o[1],floorplanData:o[8],hoveredRoom:o[14],highlightData:o[13]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function Ll(n){let t,e;const i=[{floorplanData:n[8],roomAreaEnable:n[5],roomNameEnable:n[6],floorIndex:n[1],getRoomAreaText:n[9],getLabelElement:n[10],hoveredRoom:n[14],adaptiveRoomLabelVisibleEnable:n[12]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new Xg({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&22370?lt(i,[{floorplanData:o[8],roomAreaEnable:o[5],roomNameEnable:o[6],floorIndex:o[1],getRoomAreaText:o[9],getLabelElement:o[10],hoveredRoom:o[14],adaptiveRoomLabelVisibleEnable:o[12]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function jl(n){let t,e;const i=[{floorplanData:n[8],floorIndex:n[1],getRuleDistanceText:n[11]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new ip({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&2306?lt(i,[{floorplanData:o[8],floorIndex:o[1],getRuleDistanceText:o[11]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function Sp(n){let t,e,i,s,o,r,a,l,c;const d=[{floorIndex:n[1],floorplanData:n[8]}];let h={};for(let v=0;v<d.length;v+=1)h=et(h,d[v]);e=new wp({props:h});let u=(n[2]||n[3])&&Tl(n);const m=[{floorplanData:n[8],floorIndex:n[1]}];let A={};for(let v=0;v<m.length;v+=1)A=et(A,m[v]);o=new eu({props:A});let p=n[4]&&Ll(n),g=n[7]&&jl(n);return{c(){t=D("div"),ne(e.$$.fragment),i=$(),u&&u.c(),s=$(),ne(o.$$.fragment),r=$(),p&&p.c(),a=$(),g&&g.c(),w(t,"class",l=Re(`floorplan-plugin__floor${n[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,y){O(v,t,y),te(e,t,null),x(t,i),u&&u.m(t,null),x(t,s),te(o,t,null),x(t,r),p&&p.m(t,null),x(t,a),g&&g.m(t,null),c=!0},p(v,[y]){const P=y&258?lt(d,[{floorIndex:v[1],floorplanData:v[8]}]):{};e.$set(P),v[2]||v[3]?u?(u.p(v,y),y&12&&k(u,1)):(u=Tl(v),u.c(),k(u,1),u.m(t,s)):u&&(de(),L(u,1,1,()=>{u=null}),he());const M=y&258?lt(m,[{floorplanData:v[8],floorIndex:v[1]}]):{};o.$set(M),v[4]?p?(p.p(v,y),y&16&&k(p,1)):(p=Ll(v),p.c(),k(p,1),p.m(t,a)):p&&(de(),L(p,1,1,()=>{p=null}),he()),v[7]?g?(g.p(v,y),y&128&&k(g,1)):(g=jl(v),g.c(),k(g,1),g.m(t,null)):g&&(de(),L(g,1,1,()=>{g=null}),he()),(!c||y&1&&l!==(l=Re(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&w(t,"class",l)},i(v){c||(k(e.$$.fragment,v),k(u),k(o.$$.fragment,v),k(p),k(g),c=!0)},o(v){L(e.$$.fragment,v),L(u),L(o.$$.fragment,v),L(p),L(g),c=!1},d(v){v&&z(t),ie(e),u&&u.d(),ie(o),p&&p.d(),g&&g.d()}}}function Tp(n,t,e){let{isCurrent:i}=t,{floorIndex:s}=t,{highlightEnable:o}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{getRoomAreaText:u}=t,{getLabelElement:m}=t,{getRuleDistanceText:A}=t,{adaptiveRoomLabelVisibleEnable:p}=t,{highlightData:g}=t;const v=Da(void 0);return n.$$set=y=>{"isCurrent"in y&&e(0,i=y.isCurrent),"floorIndex"in y&&e(1,s=y.floorIndex),"highlightEnable"in y&&e(2,o=y.highlightEnable),"hoverEnable"in y&&e(3,r=y.hoverEnable),"roomLabelsEnable"in y&&e(4,a=y.roomLabelsEnable),"roomAreaEnable"in y&&e(5,l=y.roomAreaEnable),"roomNameEnable"in y&&e(6,c=y.roomNameEnable),"ruleLabelsEnable"in y&&e(7,d=y.ruleLabelsEnable),"floorplanData"in y&&e(8,h=y.floorplanData),"getRoomAreaText"in y&&e(9,u=y.getRoomAreaText),"getLabelElement"in y&&e(10,m=y.getLabelElement),"getRuleDistanceText"in y&&e(11,A=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(12,p=y.adaptiveRoomLabelVisibleEnable),"highlightData"in y&&e(13,g=y.highlightData)},[i,s,o,r,a,l,c,d,h,u,m,A,p,g,v]}let Lp=class extends le{constructor(t){super(),ae(this,t,Tp,Sp,se,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},Dp)}};function jp(n){ue(n,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function zl(n,t,e){const i=n.slice();return i[21]=t[e],i}function Ol(n){let t,e,i,s,o,r=n[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=Bl(zl(n,r,h));const l=h=>L(a[h],1,1,()=>{a[h]=null});let c=n[5]&&Vl(n),d=n[8]&&Rl(n);return{c(){t=D("div");for(let h=0;h<a.length;h+=1)a[h].c();e=$(),c&&c.c(),i=$(),d&&d.c(),w(t,"class","floorplan-main svelte-86bqav")},m(h,u){O(h,t,u);for(let m=0;m<a.length;m+=1)a[m]&&a[m].m(t,null);x(t,e),c&&c.m(t,null),x(t,i),d&&d.m(t,null),o=!0},p(h,u){if(n=h,u&2047696){r=n[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const A=zl(n,r,m);a[m]?(a[m].p(A,u),k(a[m],1)):(a[m]=Bl(A),a[m].c(),k(a[m],1),a[m].m(t,e))}for(de(),m=r.length;m<a.length;m+=1)l(m);he()}n[5]?c?(c.p(n,u),u&32&&k(c,1)):(c=Vl(n),c.c(),k(c,1),c.m(t,i)):c&&(de(),L(c,1,1,()=>{c=null}),he()),n[8]?d?(d.p(n,u),u&256&&k(d,1)):(d=Rl(n),d.c(),k(d,1),d.m(t,null)):d&&(de(),L(d,1,1,()=>{d=null}),he())},i(h){if(!o){for(let u=0;u<r.length;u+=1)k(a[u]);k(c),k(d),s||Ne(()=>{s=Gi(t,tt,{duration:n[0],easing:ti}),s.start()}),o=!0}},o(h){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)L(a[u]);L(c),L(d),o=!1},d(h){h&&z(t),Lt(a,h),c&&c.d(),d&&d.d()}}}function Bl(n){let t,e;const i=[{hoverEnable:n[6],highlightEnable:n[7],floorplanData:n[13],getRoomAreaText:n[16],getLabelElement:n[17],getRuleDistanceText:n[18],roomLabelsEnable:n[9],roomAreaEnable:n[10],roomNameEnable:n[11],ruleLabelsEnable:n[12],adaptiveRoomLabelVisibleEnable:n[19],highlightData:n[20]},{floorIndex:n[21].floorIndex},{isCurrent:n[21].floorIndex===n[4]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new Lp({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&2047696?lt(i,[r&2047680&&{hoverEnable:o[6],highlightEnable:o[7],floorplanData:o[13],getRoomAreaText:o[16],getLabelElement:o[17],getRuleDistanceText:o[18],roomLabelsEnable:o[9],roomAreaEnable:o[10],roomNameEnable:o[11],ruleLabelsEnable:o[12],adaptiveRoomLabelVisibleEnable:o[19],highlightData:o[20]},r&8192&&{floorIndex:o[21].floorIndex},r&8208&&{isCurrent:o[21].floorIndex===o[4]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function Vl(n){let t,e;const i=[{panoIndex:n[3],floorplanData:n[13],lastPanoramaLongitude:n[14],cameraImageUrl:n[15]}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new Ag({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&57352?lt(i,[{panoIndex:o[3],floorplanData:o[13],lastPanoramaLongitude:o[14],cameraImageUrl:o[15]}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function Rl(n){let t,e;return t=new Pg({props:{floorplanData:n[13],northDesc:n[2]}}),{c(){ne(t.$$.fragment)},m(i,s){te(t,i,s),e=!0},p(i,s){const o={};s&8192&&(o.floorplanData=i[13]),s&4&&(o.northDesc=i[2]),t.$set(o)},i(i){e||(k(t.$$.fragment,i),e=!0)},o(i){L(t.$$.fragment,i),e=!1},d(i){ie(t,i)}}}function zp(n){let t,e,i=n[1]&&Ol(n);return{c(){i&&i.c(),t=Pe()},m(s,o){i&&i.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?i?(i.p(s,o),o&2&&k(i,1)):(i=Ol(s),i.c(),k(i,1),i.m(t.parentNode,t)):i&&(de(),L(i,1,1,()=>{i=null}),he())},i(s){e||(k(i),e=!0)},o(s){L(i),e=!1},d(s){i&&i.d(s),s&&z(t)}}}function Op(n,t,e){let{duration:i=0}=t,{visible:s}=t,{northDesc:o}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:d}=t,{compassEnable:h}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:m}=t,{roomNameEnable:A}=t,{ruleLabelsEnable:p}=t,{floorplanData:g}=t,{lastPanoramaLongitude:v}=t,{cameraImageUrl:y}=t,{getRoomAreaText:P}=t,{getLabelElement:M}=t,{getRuleDistanceText:B}=t,{adaptiveRoomLabelVisibleEnable:E}=t,{highlightData:V}=t;return n.$$set=j=>{"duration"in j&&e(0,i=j.duration),"visible"in j&&e(1,s=j.visible),"northDesc"in j&&e(2,o=j.northDesc),"panoIndex"in j&&e(3,r=j.panoIndex),"floorIndex"in j&&e(4,a=j.floorIndex),"cameraEnable"in j&&e(5,l=j.cameraEnable),"hoverEnable"in j&&e(6,c=j.hoverEnable),"highlightEnable"in j&&e(7,d=j.highlightEnable),"compassEnable"in j&&e(8,h=j.compassEnable),"roomLabelsEnable"in j&&e(9,u=j.roomLabelsEnable),"roomAreaEnable"in j&&e(10,m=j.roomAreaEnable),"roomNameEnable"in j&&e(11,A=j.roomNameEnable),"ruleLabelsEnable"in j&&e(12,p=j.ruleLabelsEnable),"floorplanData"in j&&e(13,g=j.floorplanData),"lastPanoramaLongitude"in j&&e(14,v=j.lastPanoramaLongitude),"cameraImageUrl"in j&&e(15,y=j.cameraImageUrl),"getRoomAreaText"in j&&e(16,P=j.getRoomAreaText),"getLabelElement"in j&&e(17,M=j.getLabelElement),"getRuleDistanceText"in j&&e(18,B=j.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in j&&e(19,E=j.adaptiveRoomLabelVisibleEnable),"highlightData"in j&&e(20,V=j.highlightData)},[i,s,o,r,a,l,c,d,h,u,m,A,p,g,v,y,P,M,B,E,V]}let Sa=class extends le{constructor(t){super(),ae(this,t,Op,zp,se,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},jp)}};const Bp="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 Vp(n){return F(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return F(this,null,function*(){const o={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const r=yield fetch(s.svg_url,{headers:t}).then(a=>a.text());o.svgContent=r}return o})};return yield Promise.all(n.map(e))})}function Rp(n){return{id:n.id,size:n.size,name:n.name,path:n.path,roomType:n.room_type,floorType:n.floor_type,roomLabel:{position:n.room_label.position,positionInImage:n.room_label.position_in_image},observerIndexs:n.observer_indexs}}function Gp(n){return{floorName:n.floor_name,floorIndex:n.floor_index,rooms:n.rooms.map(Rp),rules:n.rules}}function Qp(n){return{index:n.index,floorIndex:n.floor_index,position:n.position,positionInImage:n.position_in_image}}function Np(n){return{rad:n.rad,position:n.position,positionInImage:n.position_in_image,northRad:n.north_rad,roomId:n.room_id,floorIndex:n.floor_index}}function gi(n){return F(this,null,function*(){const t=yield Vp(n.outlines),e=n.computed_data.bounding,i=n.computed_data.floor_datas.map(Gp),s=n.computed_data.entrance?Np(n.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:i,observers:n.computed_data.observers.map(Qp)}})}function Hp(n,t,e){return n.map(s=>{const o=s.position,r=s.icon?s.icon:{url:Bp,width:45,height:48},a=op(o,t),l=np(o,e),c=sp(l,e);return{floorIndex:a,icon:r,id:s.id,position:l,positionInImage:c}})}function Fp(n,t){return t(n),n}function Eo(n,t){return Fp({},e=>{for(const i in n)t.indexOf(i)===-1&&(e[i]=n[i])})}function Gl(n,t){const e=Math.max(...n.work.observers.map(i=>i.floorIndex));return t>e?n.model.bounding.max.y:Math.max(...n.work.observers.filter(i=>i.floorIndex===t).map(i=>i.standingPosition.y))}function Ta(n,t,e=hi.BOUNDING_CENTER){const i=Gl(n,t),s=Gl(n,t+1);return e===hi.BOUNDING_CENTER?(n.model.bounding.max.y+n.model.bounding.min.y)/2:e===hi.CEILING?s:i}function La(n,t,e,i){const s=Ta(n,e,i==null?void 0:i.attachedTo),o=new I.Vector3(0,s,0),r=new I.Vector3(1,s,0),a=o.clone().project(n.camera),l=r.clone().project(n.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}let cs=class{constructor(t,e){f(this,"VERSION","2.28.6");f(this,"five");f(this,"hooks",new Ri);f(this,"staticPrefix","//vr-image-4.realsee-cdn.cn");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}absoluteUrl(t){return pa(this.staticPrefix,t)}},si=class extends cs{};var Ct=(n=>(n.UnknownError="UnknownError",n.DataNotLoaded="DataNotLoaded",n.BreakOffByHide="BreakOffByHide",n.BreakOffByDisable="BreakOffByDisable",n.ModelNotLoaded="ModelNotLoaded",n.ChangeModeError="ChangeModeError",n.UpdateCameraError="UpdateCameraError",n))(Ct||{});const nu=500,_p=80;function Kr(n,t,e=4){return Math.floor(n*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Wp(n){return Object.prototype.toString.call(n)==="[object Object]"}function Ql(n){return Wp(n)&&!!n.isVector3}function ja(n,t){return F(this,null,function*(){const[e]=yield pn(n.changeMode(...t));if(e)throw new Error("change mode canceled");yield new Promise(r=>{n.once("initAnimationWillStart",()=>{n.once("initAnimationEnded",()=>r())})});const i=t[1];if(!i)return!0;const s=n.getCurrentState();if(!Yp(i,s))throw new Error("pose 与预期不符")})}function Yp(n,t){return Object.keys(n).every(e=>{const i=t[e],s=n[e];return i===void 0||s===void 0?!0:typeof i=="number"&&typeof s=="number"?Kr(i,s,2):Ql(s)&&Ql(i)?s.distanceTo(i)<.01:i===s})}function za(n,t){if(n.currentMode!==t.mode)return!1;const{latitude:e,longitude:i,fov:s,offset:o}=t,{latitude:r,longitude:a,offset:l}=n.getCurrentState(),c=n.camera.fov;return!(!Kr(e,r,2)||!Kr(i,a,2)||o!==void 0&&o.distanceTo(l)>.01||s!==c)}function su(n,t,e=!0){return F(this,null,function*(){if(za(n,t)===!0)return;const s=n.getCurrentState();if(s.mode!==t.mode){const[d]=yield pn(ja(n,[t.mode,t,void 0,e]));if(d)throw new Error(Ct.ChangeModeError);return}const{latitude:o,longitude:r,fov:a}=s,l=Math.min(1e3,Math.max(200,Math.abs(o-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield pn(n.updateCamera(t,l,e));if(c)throw new Error(Ct.UpdateCameraError)})}function vn(n,t,e=300){const i=n.getElement();i&&(i.style.opacity=t+"",i.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(s=>i.addEventListener("transitionend",s,{once:!0})),new Promise(s=>setTimeout(s,e))]).then(()=>{i.style.transition="none"}))}function Up(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return i||s}function Xp(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return i&&s}let Jp=class extends si{constructor(e,i){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$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")});f(this,"show",(...i)=>F(this,[...i],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));f(this,"hide",(...i)=>F(this,[...i],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!za(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=La(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);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})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o,r;const{userAction:i}=e;this.hooks.emit("disable",{userAction:i}),(s=this.showRejection)==null||s.call(this,Ct.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:i}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});f(this,"_show",e=>F(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ct.ModelNotLoaded);if(!this.data)throw new Error(Ct.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=G(G({},i),e),o=()=>F(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield pn(su(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ct.UnknownError);this.updateSize(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=s.modelOpacity,l=s.immediately?0:nu;vn(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,Ct.BreakOffByHide),this.showPromise=void 0;const s=G(G({},{userAction:!0,isAutoHide:!1}),e);vn(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,i)=>{if(!i||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||Xp(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,i)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();Up(s)&&(this.updateState({visible:!1},i),this._hide({userAction:i,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,i)=>{if(this.state.visible&&(i.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,i)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,i)=>{i==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,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:_p/((a=i==null?void 0:i.scale)!=null?a:1)};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:mi,attachedTo:hi.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"㎡",getRuleDistanceText:l=>l.toString()},o=i?Eo(i,["selector","scale"]):{},r=G(G({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return F(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield gi(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}formatData(e){return F(this,null,function*(){return yield gi(e.data)})}updateState(e,i){const s=this.state,o=e.config?G(G({},s.config),e.config):s.config;this.state=Ae(G(G({},this.state),e),{config:o}),!ut(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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 e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=Ae(G({},this.state.config),{visible:this.state.visible,duration:e!=null?e: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 Sa({target:this.container,intro:!0,props:i})}};const Zp=(n,t)=>new Jp(n,t);function qp(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return i||s}function Kp(n){const{latitude:t,longitude:e}=n,i=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return i&&s}let $p=class extends si{constructor(e,i){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$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")});f(this,"show",(...i)=>F(this,[...i],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));f(this,"hide",(...i)=>F(this,[...i],function*(e={}){this.state.enabled&&(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!za(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=La(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);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})});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o,r;const{userAction:i}=e;this.hooks.emit("disable",{userAction:i}),(s=this.showRejection)==null||s.call(this,Ct.BreakOffByDisable),this.showPromise=void 0,(o=this.app)==null||o.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:i}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i}))});f(this,"_show",e=>F(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ct.ModelNotLoaded);if(!this.data)throw new Error(Ct.DataNotLoaded);if(this.showPromise)return this.showPromise;const i={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=G(G({},i),e),o=()=>F(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield pn(su(this.five,this.showState,s.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ct.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex)});return this.isHiddenByHideFunc=!1,this.showPromise=o().then(()=>{this.showPromise=void 0,this.showRejection=void 0;const a=s.modelOpacity,l=s.immediately?0:nu;vn(this.five,a,l),this.render(l),this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(a=>{if(this.showPromise=void 0,this.showRejection=void 0,this.updateState({visible:!1},s.userAction),!s.isAutoShow&&a instanceof Error)throw a}),this.showPromise}));f(this,"_hide",e=>{var o;(o=this.showRejection)==null||o.call(this,Ct.BreakOffByHide),this.showPromise=void 0;const s=G(G({},{userAction:!0,isAutoHide:!1}),e);vn(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{const i=this.five.model.bounding.getCenter(new I.Vector3);if(this.showState.offset=i,this.state.enabled===!1||this.wrapper||!this.selector)return;const s=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!s)throw new Error("不正确的父容器选择器");this.wrapper=s,s.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,i)=>{if(!i||this.state.visible||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode===this.showState.mode&&Kp(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0}))});f(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,i)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),qp(s)&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});f(this,"onFiveWantsPanGesture",(e,i)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1&&i&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,i)=>{i==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,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,fov:80};const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:mi,attachedTo:hi.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=i?Eo(i,["selector","scale"]):{},r=G(G({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return F(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield gi(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:o}):this._disable({userAction:o})),e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}updatePosition(){var a;const e=Ta(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!i)return;const s=i.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}formatData(e){return F(this,null,function*(){return yield gi(e.data)})}updateState(e,i){const s=this.state,o=e.config?G(G({},s.config),e.config):s.config;this.state=Ae(G(G({},this.state),e),{config:o}),!ut(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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 e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0||this.showPromise)return;const i=Ae(G({},this.state.config),{visible:this.state.visible,duration:e!=null?e: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 Sa({target:this.container,intro:!0,props:i})}};const eA=(n,t)=>new $p(n,t);let tA=class extends si{constructor(e,i){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:i}=this.data.bounding,s=i.x-e.x,o=i.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=La(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(s*a),c=Math.ceil(o*a);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})});f(this,"dispose",()=>{var e,i;this.removeEventListener(),(e=this.app)==null||e.$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")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s,o;const{userAction:i}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(o=this.container)==null||o.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:i})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("不正确的父容器选择器");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,i])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},i),this._hide({userAction:i}))});f(this,"onFivePanoArrived",e=>{var i;(i=this.five)!=null&&i.work&&(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,i)=>{this.state.visible&&(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:i}=this.five.getCurrentState();i==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const i=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[i].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});i!=null&&i.selector&&(this.selector=i.selector,console.warn("不推荐继续使用 params.selector 配置父容器,请使用 appendTo 方法"));const s={northDesc:"北",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:mi,attachedTo:hi.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"㎡",getRuleDistanceText:a=>a.toString()},o=i?Eo(i,["selector","scale"]):{},r=G(G({},s),o);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,i,s=!0){return F(this,null,function*(){function o(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const r=e;r&&!r.version&&console.warn("传入 serverData.data 的方式后续可能不再支持,请把 serverData 整体传入 load 函数");const a=JSON.parse(JSON.stringify(e)),l=o(a)?a.data:a,c=this.data;this.data=yield gi(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),i&&this.updateState(i,s),this.render()})}updatePosition(){var a;const e=Ta(this.five,this.floorIndex,this.state.config.attachedTo),i=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!i)return;const s=i.clone().project(this.five.camera),o=(s.x+1)/2,r=-(s.y-1)/2;this.container.style.left=o*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return F(this,arguments,function*(e={}){if(this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return F(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,i=!0){this.updateState({config:e},i),this.render()}formatData(e){return F(this,null,function*(){return yield gi(e.data)})}_show(e){return F(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:i}=e;this.hooks.emit("show",{userAction:i,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield ja(this.five,["Topview",void 0,void 0,i])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,o=this.state.config.modelOpacity;vn(this.five,o,s),this.hooks.emit("showAnimationEnded",{userAction:i,auto:!1}),this.render()})}_hide(e){return F(this,null,function*(){if(!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("hide",{userAction:i,auto:!1});const s=1,o=0;vn(this.five,s,o),this.render()})}_enable(e){const{userAction:i}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}updateState(e,i){const s=this.state,o=e.config?G(G({},s.config),e.config):s.config;this.state=Ae(G(G({},this.state),e),{config:o}),!ut(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:i})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.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(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const i=Ae(G({},this.state.config),{visible:this.state.visible,duration:e!=null?e: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 Sa({target:this.container,intro:!0,props:i})}};const iA=(n,t)=>new tA(n,t);function Oa(n,t=200){let e;return function(...i){e||(n(...i),e=setTimeout(function(){e=null},t))}}function nA(n){ue(n,"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 sA(n){let t,e,i;return{c(){t=D("div"),e=D("div"),i=D("div"),w(i,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),T(i,"background-image","url("+(n[0]||mi)+")"),T(i,"transform",n[1]),w(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),T(e,"transform",n[2]),w(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(s,o){O(s,t,o),x(t,e),x(e,i)},p(s,[o]){o&1&&T(i,"background-image","url("+(s[0]||mi)+")"),(o&1||o&3)&&T(i,"transform",s[1]),o&4&&T(e,"transform",s[2])},i:q,o:q,d(s){s&&z(t)}}}function oA(n){return`rotate(${Math.floor(n/Math.PI*180)*-1+45}deg)`}function rA(n,t,e){let i,s,{five:o}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=o.getCurrentState().panoIndex,d=o.getCurrentState().longitude;function h(A,p){const g=A.bounding,v=A.observers[p];if(!v)return"";const y=(g.max.x-g.min.x)*r,P=(g.max.y-g.min.y)*r,M=Math.floor(v.positionInImage.x*y),B=Math.floor(v.positionInImage.y*P);return`translate(${M}px, ${B}px)`}function u(A){e(6,c=A)}const m=Oa(A=>{e(7,d=A.longitude)},1e3/60);return bt(()=>(o.on("panoWillArrive",u),o.on("cameraDirectionUpdate",m),function(){o.off("panoWillArrive",u),o.off("cameraDirectionUpdate",m)})),n.$$set=A=>{"five"in A&&e(3,o=A.five),"pxmm"in A&&e(4,r=A.pxmm),"floorplanData"in A&&e(5,a=A.floorplanData),"cameraImageUrl"in A&&e(0,l=A.cameraImageUrl)},n.$$.update=()=>{n.$$.dirty&96&&e(2,i=h(a,c)),n.$$.dirty&128&&e(1,s=oA(d))},[l,s,i,o,r,a,c,d]}class aA extends le{constructor(t){super(),ae(this,t,rA,sA,se,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},nA)}}function lA(n){ue(n,"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 Nl(n,t,e){const i=n.slice();return i[1]=t[e],i}function Hl(n,t){let e,i,s=`${t[1].icon.width/16}rem`,o=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:n,first:null,c(){e=D("div"),i=D("div"),r=$(),w(i,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),T(i,"background-image",`url(${t[1].icon.url})`),T(i,"width",s),T(i,"height",o),w(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),T(e,"top",a),T(e,"left",l),this.first=e},m(c,d){O(c,e,d),x(e,i),x(e,r)},p(c,d){t=c,d&1&&T(i,"background-image",`url(${t[1].icon.url})`);const h=d&1;h&&T(i,"width",s),h&&T(i,"height",o),d&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&T(e,"top",a),d&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&T(e,"left",l)},d(c){c&&z(e)}}}function cA(n){let t,e=[],i=new Map,s=n[0];const o=r=>r[1].id;for(let r=0;r<s.length;r+=1){let a=Nl(n,s,r),l=o(a);i.set(l,e[r]=Hl(l,a))}return{c(){t=D("div");for(let r=0;r<e.length;r+=1)e[r].c();w(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){O(r,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(r,[a]){a&1&&(s=r[0],e=zt(e,a,o,1,r,s,i,t,ka,Hl,null,Nl))},i:q,o:q,d(r){r&&z(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function dA(n,t,e){let{extraObjects:i=[]}=t;return n.$$set=s=>{"extraObjects"in s&&e(0,i=s.extraObjects)},[i]}class hA extends le{constructor(t){super(),ae(this,t,dA,cA,se,{extraObjects:0},lA)}}function Fl(n){let t,e;const i=[{five:n[0],pxmm:n[1],floorIndex:n[2],floorplanData:n[4],onRoomHeightClick:n[7],highlightData:n[5],hoveredRoom:void 0}];let s={};for(let o=0;o<i.length;o+=1)s=et(s,i[o]);return t=new iu({props:s}),{c(){ne(t.$$.fragment)},m(o,r){te(t,o,r),e=!0},p(o,r){const a=r&183?lt(i,[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[7],highlightData:o[5],hoveredRoom:void 0}]):{};t.$set(a)},i(o){e||(k(t.$$.fragment,o),e=!0)},o(o){L(t.$$.fragment,o),e=!1},d(o){ie(t,o)}}}function uA(n){let t,e,i,s,o,r;const a=[{floorIndex:n[2],floorplanData:n[4]}];let l={};for(let d=0;d<a.length;d+=1)l=et(l,a[d]);t=new eu({props:l}),i=new hA({props:{extraObjects:n[6]}});let c=n[3]&&Fl(n);return{c(){ne(t.$$.fragment),e=$(),ne(i.$$.fragment),s=$(),c&&c.c(),o=Pe()},m(d,h){te(t,d,h),O(d,e,h),te(i,d,h),O(d,s,h),c&&c.m(d,h),O(d,o,h),r=!0},p(d,[h]){const u=h&20?lt(a,[{floorIndex:d[2],floorplanData:d[4]}]):{};t.$set(u);const m={};h&64&&(m.extraObjects=d[6]),i.$set(m),d[3]?c?(c.p(d,h),h&8&&k(c,1)):(c=Fl(d),c.c(),k(c,1),c.m(o.parentNode,o)):c&&(de(),L(c,1,1,()=>{c=null}),he())},i(d){r||(k(t.$$.fragment,d),k(i.$$.fragment,d),k(c),r=!0)},o(d){L(t.$$.fragment,d),L(i.$$.fragment,d),L(c),r=!1},d(d){ie(t,d),d&&z(e),ie(i,d),d&&z(s),c&&c.d(d),d&&z(o)}}}function fA(n,t,e){let i,{five:s}=t,{pxmm:o}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:d}=t;const h=void 0;return n.$$set=u=>{"five"in u&&e(0,s=u.five),"pxmm"in u&&e(1,o=u.pxmm),"floorIndex"in u&&e(2,r=u.floorIndex),"hoverEnable"in u&&e(3,a=u.hoverEnable),"floorplanData"in u&&e(4,l=u.floorplanData),"extraObjects"in u&&e(8,c=u.extraObjects),"highlightData"in u&&e(5,d=u.highlightData)},n.$$.update=()=>{n.$$.dirty&260&&e(6,i=c==null?void 0:c.filter(u=>u.floorIndex===r))},[s,o,r,a,l,d,i,h,c]}class mA extends le{constructor(t){super(),ae(this,t,fA,uA,se,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function gA(n){ue(n,"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 _l(n){let t,e,i,s,o=n[7]!==0&&Wl(n);return{c(){t=D("div"),o&&o.c(),w(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){O(r,t,a),o&&o.m(t,null),e=!0,i||(s=[ei(Dn.call(null,t)),be(t,"clientWidth",n[13]),be(t,"clientHeight",n[14])],i=!0)},p(r,a){r[7]!==0?o?(o.p(r,a),a&128&&k(o,1)):(o=Wl(r),o.c(),k(o,1),o.m(t,null)):o&&(de(),L(o,1,1,()=>{o=null}),he())},i(r){e||(k(o),e=!0)},o(r){L(o),e=!1},d(r){r&&z(t),o&&o.d(),i=!1,Ze(s)}}}function Wl(n){let t,e,i,s,o=`${n[9]}px`,r=`${n[12]}px`,a;const l=[{five:n[0],pxmm:n[10],floorIndex:n[11],floorplanData:n[3],hoverEnable:n[2],extraObjects:n[5],highlightData:n[6]}];let c={};for(let u=0;u<l.length;u+=1)c=et(c,l[u]);e=new mA({props:c});const d=[{pxmm:n[10],five:n[0],floorplanData:n[3],cameraImageUrl:n[4]}];let h={};for(let u=0;u<d.length;u+=1)h=et(h,d[u]);return s=new aA({props:h}),{c(){t=D("div"),ne(e.$$.fragment),i=$(),ne(s.$$.fragment),w(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),T(t,"width",o),T(t,"height",r)},m(u,m){O(u,t,m),te(e,t,null),x(t,i),te(s,t,null),a=!0},p(u,m){const A=m&3181?lt(l,[{five:u[0],pxmm:u[10],floorIndex:u[11],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5],highlightData:u[6]}]):{};e.$set(A);const p=m&1049?lt(d,[{pxmm:u[10],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};s.$set(p),m&512&&o!==(o=`${u[9]}px`)&&T(t,"width",o),m&4096&&r!==(r=`${u[12]}px`)&&T(t,"height",r)},i(u){a||(k(e.$$.fragment,u),k(s.$$.fragment,u),a=!0)},o(u){L(e.$$.fragment,u),L(s.$$.fragment,u),a=!1},d(u){u&&z(t),ie(e),ie(s)}}}function pA(n){let t,e,i=n[1]&&_l(n);return{c(){i&&i.c(),t=Pe()},m(s,o){i&&i.m(s,o),O(s,t,o),e=!0},p(s,[o]){s[1]?i?(i.p(s,o),o&2&&k(i,1)):(i=_l(s),i.c(),k(i,1),i.m(t.parentNode,t)):i&&(de(),L(i,1,1,()=>{i=null}),he())},i(s){e||(k(i),e=!0)},o(s){L(i),e=!1},d(s){i&&i.d(s),s&&z(t)}}}function AA(n,t,e){var P,M;let{five:i}=t,{visible:s}=t,{hoverEnable:o}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,d=0,h=(M=(P=i.work.observers[i.getCurrentState().panoIndex])==null?void 0:P.floorIndex)!=null?M:0,u=0,m=0,A=0,p=0;function g(B){e(11,h=i.work.observers[B].floorIndex)}bt(()=>(i.on("panoArrived",g),()=>{i.off("panoArrived",g)}));const v=B=>{e(7,u=B.detail)},y=B=>{e(8,m=B.detail)};return n.$$set=B=>{"five"in B&&e(0,i=B.five),"visible"in B&&e(1,s=B.visible),"hoverEnable"in B&&e(2,o=B.hoverEnable),"floorplanData"in B&&e(3,r=B.floorplanData),"cameraImageUrl"in B&&e(4,a=B.cameraImageUrl),"extraObjects"in B&&e(5,l=B.extraObjects),"highlightData"in B&&e(6,c=B.highlightData)},n.$$.update=()=>{if(n.$$.dirty&904){const B=Math.min(u,m),{max:E,min:V}=r.bounding,j=E.x-V.x,X=E.y-V.y,Y=function(){return j>X?[B,B/j*X]:[B/X*j,B]}();e(9,A=Y[0]),e(12,p=Y[1]),e(10,d=A/j)}},[i,s,o,r,a,l,c,u,m,A,d,h,p,v,y]}class vA extends le{constructor(t){super(),ae(this,t,AA,pA,se,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},gA)}}let bA=class extends si{constructor(e,i){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"highlightData",{});f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(this,"highlight",e=>{this.state.config.highlightEnable&&(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var s;const{userAction:i}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:i})});this.five=e;const s={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:mi},o=i!=null&&i.configs?i.configs:{},r=G(G({},s),o);this.state={enabled:!0,visible:!0,config:r},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),e.once("dispose",this.dispose)}load(e,i,s=!0){return F(this,null,function*(){function o(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=o(r)?r.data:r,l=this.data;this.data=yield gi(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),i&&this.updateState(i,s),this.render()})}show(){return F(this,arguments,function*(e={}){if(this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},i),this._show({userAction:i})})}hide(){return F(this,arguments,function*(e={}){if(!this.state.visible)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},i),this._hide({userAction:i})})}enable(e={}){if(this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||i),this._enable({userAction:i})}disable(e={}){if(!this.state.enabled)return;const i=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||i),this._disable({userAction:i})}setState(e,i={}){const s=this.state,o=i.userAction!==void 0?i.userAction:!0;if(this.updateState(e,o),e.enabled!==void 0&&s.enabled!==e.enabled){const r={userAction:o};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&s.visible!==e.visible){const r={userAction:o};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,i=!0){this.setState({config:e},{userAction:i}),this.render()}setExtraObjectsWith3DPositions(e){this.data&&(this.extraObjects=Hp(e,this.five,this.data),this.render())}formatData(e){return F(this,null,function*(){return yield gi(e.data)})}_enable(e){const{userAction:i}=e;this.hooks.emit("enable",{userAction:i}),this.state.visible&&this._show({userAction:i})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("show",{userAction:i}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:i}=e;this.hooks.emit("hide",{userAction:i}),this.render()}updateState(e,i){const s=this.state;this.state=G(G({},this.state),e),!ut(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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 e=Ae(G({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new vA({target:this.wrapper,props:e})}};const yA=(n,t)=>new bA(n,t),wA=[{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:"和室"}],CA=[{type:0,description:"木质地板"},{type:1,description:"瓷砖地面"},{type:2,description:"户外地面"},{type:3,description:"卫生间地面"},{type:4,description:"阳台地面"},{type:5,description:"车库地面"}],IA=[{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:"写字楼"}],Er=(n,t,e)=>{const i=new I.Matrix4,s=new I.Euler(n,t,e,"YXZ");return i.makeRotationFromEuler(s),i},PA=(n,{scale:t,rotation:e,position:i})=>{if(t&&n.scale.set(t,t,t),e){const[s,o,r]=e;s&&n.applyMatrix4(Er(s,0,0)),o&&n.applyMatrix4(Er(0,o,0)),r&&n.applyMatrix4(Er(0,0,r))}return i&&n.position.set(i.x,i.y,i.z),n};function ou(n,t){n.traverse(e=>{var i;if(e.type==="Mesh"){const s=e,o=G({map:s.material.map||{}},t);s.material=new R.MeshBasicMaterial(o),s.renderOrder=1,((i=e.parent)==null?void 0:i.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const EA=(n,t)=>{var p;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",i=(p=t.north_rad)!=null?p:void 0,s={};let o={x:0,y:0,z:0},r=[0,0,0],a=1,l=i;n.on("modelLoaded",A);const c=g=>F(exports,null,function*(){var M;const v=(g==null?void 0:g.fbx_url)||e;if(l=(M=g==null?void 0:g.north_rad)!=null?M:i,typeof l!="number")throw new Error('"northRad"配置参数缺失:未配置指南针指向!');const P=yield new mh.FBXLoader().loadAsync(v);return ou(P,{transparent:!0,side:I.DoubleSide,blending:I.AdditiveBlending}),s.object=P,A(),!0}),d=({latitude:g})=>{if(!s.object)return;const v=h(g);v&&(s.object.position.y=v)},h=g=>{if(s.yBase===void 0)return;const v=.6;if(g>=Math.PI/4)return s.yBase-(v+1.6);const y=g*(4/Math.PI);return s.yBase-(v*y+1.6)},u=()=>{if(!s.object)return;const g=h(n.getPose().latitude);g&&(s.object.position.y=g),n.scene.add(s.object),n.needsRender=!0,n.on("cameraDirectionUpdate",d)},m=()=>{s.object&&(n.scene.remove(s.object),n.needsRender=!0,n.off("cameraDirectionUpdate",d))};function A(){const g=s.object;if(!g)return;const v=n.model.bounding,y=v.max.x-v.min.x,P=v.max.z-v.min.z,M=Math.max(y,P),{max:{x:B,z:E},min:{x:V,y:j,z:X}}=v;s.yBase=j,o={x:(B+V)/2,y:j-1.6,z:(E+X)/2},r=[0,l-Math.PI/2,0],a=.0045*M,PA(g,{position:o,rotation:r,scale:a})}return{load:c,disable:m,enable:u}};function MA(n,t){var c,d,h,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,i=(d=t==null?void 0:t.fontSize)!=null?d:e*(35/256)*1.2,s=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",o=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=s,l.fillRect(0,0,e,e),l.font=`${i}px "微软雅黑"`,l.textAlign=r,l.fillStyle=o,l.fillText(n,e/2,e*.7),new R.CanvasTexture(a)}const kA=({x:n,y:t,z:e})=>new R.Vector3(n,t,e),xA=(n,t)=>{var p,g,v;const e={},i=(p=t.animationEnabled)!=null?p:!0,s=(g=t.position)!=null?g:void 0,o=(v=t.rad)!=null?v:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>F(exports,null,function*(){var Y,N,H,_,Q,W,Z,J;const P=(Y=y==null?void 0:y.position)!=null?Y:s;if(!P)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const M=kA(P),B=(N=y==null?void 0:y.rad)!=null?N:o,E=(H=y==null?void 0:y.fbx_url)!=null?H:r;if(e.rad=B,B===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${B}`));const V=yield new mh.FBXLoader().loadAsync(E);V.position.copy(M),V.rotation.z=B,V.scale.set(.8,.8,.8),ou(V,{transparent:!0,side:I.DoubleSide});const j=(Z=(W=(Q=(_=V.children)==null?void 0:_[0])==null?void 0:Q.children)==null?void 0:W[3])==null?void 0:Z.clone();if(!j)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${j}`));const X=(J=t.name)!=null?J:"入户门";return j.material=new R.MeshBasicMaterial({transparent:!0,map:MA(X)}),j.renderOrder=3,V.children[0].add(j),e.object=V,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,P=new R.AnimationMixer(e.object);a.push(P);const M=P.clipAction(e.object.animations[0]);M.timeScale=y;let B;const E=()=>{let Y=0,N=0;const H=1e3/30,_=Q=>{Y=requestAnimationFrame(_);const W=Q-N;W<H||(N=Q,a.forEach(Z=>Z.update(W/1e3)),n.needsRender=!0)};return Y=requestAnimationFrame(_),()=>{cancelAnimationFrame(Y)}},X={play:()=>{B||(M.play(),B=E(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{M.stop(),B==null||B(),B=void 0}};e.animation=X},d=y=>{var M;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((M=y==null?void 0:y.animationEnable)!=null?M:i)&&(e.animation||c(),e.animation.play()),n.scene.add(e.object),n.needsRender=!0},h=()=>{e.object&&(e.animation&&e.animation.stop(),n.scene.remove(e.object),n.needsRender=!0)},u=y=>y==="Floorplan"?d():h();return{load:l,enable:y=>(e.enabled||(e.enabled=!0,u(n.currentMode),n.on("modeChange",u),d(y)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),n.off("modeChange",u)),!0)}},DA=Tt;function SA(n,t,e,i=DA.Linear.None){const s=new Ao(n).to(t,e).easing(i);vo(()=>s.start(0));const o=Cn(a=>{s.update(a)===!1&&o()}),r=[];return s.onDestroy=a=>(r.push(a),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();o()},s}function TA(n,t){return SA({progress:0},{progress:1},n,t)}var ru=(n=>(n.Move="Move",n.Rotate="Rotate",n))(ru||{}),Gt=(n=>(n.Clockwise="Clockwise",n.Anticlockwise="Anticlockwise",n.Loop="Loop",n))(Gt||{});const Xs=Math.PI*2;function Yl(n){return(n%Xs+Xs)%Xs}function Ul(n){return n%Xs}function Mr(n,t,e){return n+(t-n)*e}const $r=(n,t,e)=>{const i=Math.PI,s=i*2;let o=Yl(n),r=Yl(t);return e===Gt.Anticlockwise&&o<r&&(o+=s),e===Gt.Clockwise&&r<o&&(r+=s),e===Gt.Loop&&r-o>i?$r(o,r,Gt.Anticlockwise):e===Gt.Loop&&o-r>i?$r(o,r,Gt.Clockwise):{from:o,to:r}},LA=n=>{const t={},e=(l,c,...d)=>F(exports,[l,c,...d],function*(o,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),o.mode&&o.mode!==n.currentMode&&(yield n.changeMode(o.mode)),a.preload&&o.panoIndex!==void 0&&o.panoIndex!==n.panoIndex&&(yield n.preloadPano(o.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0?!0:yield new Promise((h,u)=>{const m=o.panoIndex!==void 0?o.panoIndex:n.panoIndex;m!==void 0?n.moveToPano(m,G({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>u(new Error("move canceled"))},o)):u(new Error("unexpected error"))})}),i=o=>{const r=n.state,a=Ul(r.latitude),l=Ul(o.latitude),{from:c,to:d}=$r(r.longitude,o.longitude,o.rotation||Gt.Loop),h=r.fov,u=o.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:d,fov:u}}};return{move:e,rotate:(l,c,...d)=>F(exports,[l,c,...d],function*(o,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),n.currentMode!==Le.Five.Mode.Panorama&&(yield n.changeMode(Le.Five.Mode.Panorama)),o.panoIndex!==void 0&&o.panoIndex!==n.panoIndex&&(a.preload&&(yield n.preloadPano(o.panoIndex)),yield new Promise((m,A)=>{if(!o.panoIndex){m(!0);return}n.moveToPano(o.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>A(new Error("move canceled"))})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:u}=i(o);return yield new Promise(m=>{const A=({progress:P})=>{const M={};M.longitude=Mr(h.longitude,u.longitude,P),M.latitude=Mr(h.latitude,u.latitude,P),M.fov=Mr(h.fov,u.fov,P),n.setState(M,!0)},p=()=>{m(!0)},g=()=>{m(!1)},v=o.rotateSpeed?Math.ceil(Math.abs(u.longitude-h.longitude)/o.rotateSpeed*1e3):r,y=TA(v,Tt.Linear.None).onUpdate(A).onComplete(p).onDestroy(g);o.rotation===Gt.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(P=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(P)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function Xl(n,t){return n.x===t.x&&n.y===t.y}function au(n,t){return Math.abs(n)===1/0&&Math.abs(t)===1/0?!0:Math.abs(n-t)<.001}function co(n,t){return(t.y-n.y)/(t.x-n.x)}function lu(n,t,e){const i=co(n[1],n[0]),s=co(t[1],t[0]);if(isNaN(i)||isNaN(s)||au(i,s))return!1;if(js(n[0],t))return n[0];if(js(n[1],t))return n[1];if(js(t[0],n))return t[0];if(js(t[1],n))return t[1];if(e&&!zA(n,t))return!1;const o=n[0],r=t[0];if(Math.abs(i)===1/0)return{x:o.x,y:t[1].y-(t[1].x-o.x)*s};if(Math.abs(s)===1/0)return{x:r.x,y:n[1].y-(n[1].x-r.x)*i};const a=(r.y-o.y+i*o.x-s*r.x)/(i-s),l=i*a-i*o.x+o.y;return{x:a,y:l}}function js(n,t){return Xl(n,t[0])||Xl(n,t[1])?!0:(t[0].x-n.x)*(n.x-t[1].x)>=0&&(t[0].y-n.y)*(n.y-t[1].y)>=0&&au(co(t[0],n),co(n,t[1]))}function jA(n){let t=1/0,e=-1/0,i=1/0,s=-1/0;return n.forEach(o=>{t=Math.min(t,o.x),e=Math.max(e,o.x),i=Math.min(i,o.y),s=Math.max(s,o.y)}),{x:(t+e)/2,y:(i+s)/2}}function zs(n,t,e){return(n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y)}function zA(n,t){return Math.max(n[0].x,n[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(n[0].x,n[1].x)&&Math.max(n[0].y,n[1].y)>=Math.min(t[0].y,t[1].y)&&zs(t[0],n[1],n[0])*zs(n[1],t[1],n[0])>0&&zs(n[0],t[1],t[0])*zs(t[1],n[1],t[0])>0?1:0}function cu(n,t=0){t<=0?requestAnimationFrame(n):requestAnimationFrame(()=>cu(n,t-1))}const OA=`<style type="text/css">
|
|
195
195
|
.PanoRulerPlugin-rule-line {
|
|
196
196
|
position: absolute;
|
|
197
197
|
transform-origin: left center;
|
|
@@ -666,7 +666,7 @@ void main() {
|
|
|
666
666
|
gl_FragColor.a = gl_FragColor.a * linearGradientOpacity();
|
|
667
667
|
gl_FragColor.a = gl_FragColor.a * flicker;
|
|
668
668
|
}
|
|
669
|
-
`;class ca{constructor(t,e){f(this,"name","");f(this,"startTagContainer");f(this,"endTagContainer");f(this,"mesh");f(this,"five");f(this,"mode");f(this,"path",[]);f(this,"_curvePath",null);f(this,"_curvePoints",null);f(this,"_panoGroup",[]);f(this,"skippedPositions",null);f(this,"textureUrl","");f(this,"scale",1);f(this,"width",.5);f(this,"unitLength",.5);f(this,"_visibleFloorIndexes",null);f(this,"visible",null);f(this,"modeVisible",!1);f(this,"floorVisible",!0);f(this,"defaultVisible",!1);f(this,"inWalkAnimation",!1);f(this,"customVisible",null);f(this,"parent");f(this,"plugin");f(this,"textureHasLoaded",!1);f(this,"disposed",!1);f(this,"flowAnime",new zi({progress:0}).to({progress:1}).duration(1500).repeat(1/0));f(this,"flickerAnime",ss(300).yoyo(!0).repeat(5));f(this,"cacheLengths",[]);f(this,"dispose",()=>{var t,e;this.disposed||(this.disposed=!0,this.parent.hooks.off("show",this.updateVisible),this.parent.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("show",this.updateVisible),this.plugin.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("enable",this.updateVisible),this.plugin.hooks.off("disable",this.updateVisible),this.five.off("modeChange",this.onFiveModeChange),this.five.off("modelShownFloorChange",this.onFiveModelShownFloorChange),this.doHide(),(t=this.startTagContainer)==null||t.plugin.dispose(),(e=this.endTagContainer)==null||e.plugin.dispose())});f(this,"onWalkAnimationStart",()=>{this.inWalkAnimation=!0,this.updateVisible()});f(this,"onWalkAnimationEnd",()=>{this.inWalkAnimation=!1,this.updateVisible()});f(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?ma(t):Ch(t),this.updateVisible()});f(this,"onFiveModelShownFloorChange",t=>{this.floorVisible=t===null||this.visibleFloorIndexes===null||this.visibleFloorIndexes.includes(t),this.updateVisible()});f(this,"updateVisible",()=>{const t=(()=>!this.parent.visible||!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.inWalkAnimation?!0:this.modeVisible&&this.textureHasLoaded&&this.defaultVisible&&this.floorVisible)();this.visible!==t&&(this.visible=t,t?this.doShow():this.doHide())});f(this,"onFlowAnimeUpdate",t=>{const{progress:e}=t;this.mesh.material.uniforms.vOffset.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});f(this,"onFlickerAnimeUpdate",t=>{var s,o,r,a;const{progress:e}=t,i=1-e;this.mesh.material.uniforms.flicker.value=i,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0,this.startTagContainer.tag&&Br(this.startTagContainer.tag)&&((r=this.startTagContainer.app)==null||r.$set(Ae(G({},this.startTagContainer.tag.data),{opacity:i,name:this.name,distance:Math.round((o=(s=this.curvePath)==null?void 0:s.getLength())!=null?o:0)}))),this.endTagContainer.tag&&Br(this.endTagContainer.tag)&&((a=this.endTagContainer.app)==null||a.$set(Ae(G({},this.endTagContainer.tag.data),{opacity:i})))});f(this,"logWarning",t=>Fb("GuideLineModeItem: ",t));f(this,"logError",t=>Eu("GuideLineModeItem: ",t));var o,r;this.five=t,this.mode=e.mode,this.plugin=e.plugin,this.parent=e.parent,this.startTagContainer={tag:null,plugin:new po(this.five)},this.endTagContainer={tag:null,plugin:new po(this.five)};const i=new I.BufferGeometry,s=new I.ShaderMaterial({vertexShader:WP,fragmentShader:YP,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new I.Color},mapOpacity:{value:1},backgroundColor:{value:new I.Color},backgroundOpacity:{value:0},borderColor:{value:new I.Color},borderOpacity:{value:0},opacity:{value:1},flicker:{value:1},maxU:{value:0},vOffset:{value:0}}});this.mesh=new I.Mesh(i,s),this.mesh.name="GuideLineModeItem",this.mode==="panorama"&&(this.parent.hooks.on("walkStart",this.onWalkAnimationStart),this.parent.hooks.on("walkEnded",this.onWalkAnimationEnd)),this.updateVisible(),this.onFiveModeChange(this.five.getCurrentState().mode),this.onFiveModelShownFloorChange((r=(o=this.five.model)==null?void 0:o.shownFloor)!=null?r:null),this.flowAnime.onUpdate(this.onFlowAnimeUpdate),this.flickerAnime.onUpdate(this.onFlickerAnimeUpdate),this.parent.hooks.on("show",this.updateVisible),this.parent.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("show",this.updateVisible),this.plugin.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("enable",this.updateVisible),this.plugin.hooks.on("disable",this.updateVisible),this.plugin.hooks.on("dispose",this.dispose),this.five.on("modeChange",this.onFiveModeChange),this.five.on("modelShownFloorChange",this.onFiveModelShownFloorChange)}get panoGroup(){return this._panoGroup}get visibleFloorIndexes(){return this._visibleFloorIndexes}get curvePath(){return this._curvePath}get curvePoints(){return this._curvePoints}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setDefaultVisible(t){if(this.disposed)return this.logError("disposed");this.defaultVisible!==t&&(this.defaultVisible=t,this.updateVisible())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const i=_P(t);if(this._panoGroup=i,(e==null?void 0:e.skipPanoGroup)!==void 0){const o=e.skipPanoGroup?i.map(r=>this.five.work.observers[r]).map(r=>r.standingPosition.clone()):null;this.skippedPositions=o}const s=this.getPathFromPanoGroup(i,this.five.work,e);this.path=s,this.setGeometryByPath(s,e)}setGeometryByPath(t,e){var d,h,u;if(this.disposed)return this.logError("disposed");const i=(d=e==null?void 0:e.scale)!=null?d:this.scale,s=(h=e==null?void 0:e.width)!=null?h:this.width,o=(u=e==null?void 0:e.unit_length)!=null?u:this.unitLength;this.path=t,this.scale=i,this.width=s,this.unitLength=o;const{geometry:r,maxU:a,curvePath:l,curvePoints:c}=l1({path:t,width:s*i,unitLength:o*i,skipPositions:this.skippedPositions});this._curvePath=l,this._curvePoints=c,this.mesh.geometry=r,this.mesh.material.needsUpdate=!0,this.mesh.material.uniforms.maxU.value=a,this.five.needsRender=!0}setMartial(t){var e;if(this.disposed)return this.logError("disposed");(t==null?void 0:t.visible)!==void 0&&this.setDefaultVisible(t.visible),(t==null?void 0:t.color)!==void 0&&this.setColor(t.color),(t==null?void 0:t.opacity)!==void 0&&this.setOpacity(t.opacity),((e=t==null?void 0:t.texture)==null?void 0:e.url)!==void 0&&this.setTextureUrl(t.texture.url),(t==null?void 0:t.background_color)!==void 0&&this.setBackgroundColor(t.background_color),(t==null?void 0:t.background_opacity)!==void 0&&this.setBackgroundOpacity(t.background_opacity),(t==null?void 0:t.border_color)!==void 0&&this.setBorderColor(t.border_color),(t==null?void 0:t.border_opacity)!==void 0&&this.setBorderOpacity(t.border_opacity)}setColor(t){if(this.disposed)return this.logError("disposed");t&&(this.mesh.material.uniforms.mapColor.value=new I.Color().set(t)),this.mesh.material.uniforms.useMapColor.value=t?1:0,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderColor.value=new I.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundColor.value=new I.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.opacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.mapOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,Li(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=I.RepeatWrapping,this.textureHasLoaded=!0,this.mesh.material.uniforms.map.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.mesh.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}setVisibleFloorIndexes(t){var e,i;if(this.disposed)return this.logError("disposed");this._visibleFloorIndexes=t,this.onFiveModelShownFloorChange((i=(e=this.five.model)==null?void 0:e.shownFloor)!=null?i:null)}setStartTag(t){this.setTag("start",t)}setEndTag(t){this.setTag("end",t)}flicker(){if(this.disposed)return this.logError("disposed");this.flickerAnime.play()}getLengthByPanoGroupIndex(t){return this.disposed?this.logError("disposed"):this.cacheLengths.length!==0?this.cacheLengths[t]:(this.cacheLengths=this.getPanoGroupLengths(),this.cacheLengths[t])}getPanoGroupLengths(){var c;if(!this.curvePoints||!this.curvePath)return[];const t=this.panoGroup.map(d=>this.five.work.observers[d]),e=this.curvePoints.length,i=this.curvePath.getLength(),s=e-1,o=i/s,r=(c=this.curvePath.getLengths(s))!=null?c:[],a=[];let l=0;for(let d=0;d<e;d++){const h=this.curvePoints[d],u=t[l];if(!u)break;u.standingPosition.clone().setY(0).distanceTo(h.clone().setY(0))<o&&(a.push(r[d]),l+=1)}return a}setTag(t,e){const i=this.curvePath,s=t==="start"?this.startTagContainer:this.endTagContainer;e||s.plugin.clearTags();const r=Fe({},{contentType:"Custom",stickType:"2DPoint",config:{visibleConfig:{visibleFiveMode:["Floorplan","Mapview"],followModelVisibility:!1}},style:{point:{enabled:!1}},data:{}},e);s.tag=r,Br(r)&&(s.tag.element=a=>{var d,h;(d=s.app)==null||d.$destroy();const l=t==="start"?Ae(G({},r.data),{name:this.name,distance:Math.round((h=i.getLength())!=null?h:0),i18n:this.plugin.config.i18n}):r.data,c=new FP({target:a,intro:!0,props:l});return s.app=c,()=>c.$destroy()}),s.plugin.load({tagList:[s.tag]})}doShow(){this.mode==="model"&&this.flowAnime.play(),this.five.scene.add(this.mesh),this.startTagContainer.plugin.show(),this.endTagContainer.plugin.show(),this.five.needsRender=!0}doHide(){this.mode==="model"&&this.flowAnime.stop(),this.five.scene.remove(this.mesh),this.startTagContainer.plugin.hide(),this.endTagContainer.plugin.hide(),this.five.needsRender=!0}getPathFromPanoGroup(t,e,i){if(t.length<2)return[];const o=t.map(r=>e.observers[r]).map(r=>r.standingPosition.toArray());return[G({type:"CatmullRomCurve3",points:o},i)]}}function Br(n){return n.contentType==="Custom"}const UP=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:ca},Symbol.toStringTag,{value:"Module"}));function rh(n){const t=Math.abs(Math.cos(n.latitude));return new I.Vector3(-Math.sin(n.longitude)*t,-Math.sin(n.latitude),-Math.cos(n.longitude)*t)}function XP(n,t){const e=rh(n),i=rh(t);return e.angleTo(i)}const JP=n=>F(exports,null,function*(){try{n().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Ws=Math.PI*2;function ZP(n){return n>=0&&n<Ws?n:(n%Ws+Ws)%Ws}function qP(n){return{longitude:ZP(-Math.atan2(n.x,-n.z)),latitude:-Math.asin(n.y/1)}}function KP(n,t,e,i){const s=-n/e,o=n;return s*i+o}function $P(n){return new Promise(t=>{setTimeout(()=>{t()},n)})}const nf="v1.0.6",sf="CruisePlugin",To=`${sf}@${nf}`,ah=()=>{console.error(`${To} is disposed`)},e2=()=>{console.warn(`${To} is disabled`)},t2=()=>{console.error(`${To} is disabled`)},Vr=new Map;class ds extends si{constructor(e,i){super(e,i);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=i,Object.assign(window,{[`__${sf}_DEBUG__`]:this});const s=this.setFiveLinearUpdateCamera.bind(this),o=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",s),this.hooks.on("broke",o),this.hooks.on("end",o),this.hooks.on("pause",o),this.privateState.disposers.push(()=>{this.hooks.off("play",s),this.hooks.off("broke",o),this.hooks.off("end",o),this.hooks.off("pause",o)})}load(e,i,s){return F(this,null,function*(){var d,h,u,m,A,p;if(this.state.disposed)return ah();this.privateState.fiveOriginGetProgress||(h=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,o);let a=[],l;const c=this.data.keyframes.filter(g=>g.data.panoIndex!==void 0);c.filter((g,v)=>{var y;return g.data.panoIndex!==((y=c[v-1])==null?void 0:y.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var y,P;const v=(y=this.five.work.observers[g])==null?void 0:y.floorIndex;if(v!==void 0)if(l===v){const M=a.length-1;a[M]=[...(P=a[M])!=null?P:[],g]}else{l=v;const M=a.length;a[M]=[g]}}),!this.GuideLine&&((A=this.config)==null?void 0:A.useGuideLine)!==!1&&r.useGuildLine!==!1&&(this.GuideLine=af(this.five,this.config)),(p=this.GuideLine)==null||p.load({routes:a.map(g=>({panoIndexList:g})),config:r.guildPluginOptions}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),i&&this.setState(i,{userAction:s}),console.debug(`${To} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:i,id:s,userAction:o}=e;this.state.playing&&this.setState({playing:!1},{userAction:o}),this.setState({playing:!0},{userAction:o,playFromIndex:i,playFromId:s})}playFromStart(e){return this.playFrom(Ae(G({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,i){var o;if(this.state.disposed)return ah();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return t2();const s=G({},this.state);this.state=G(G({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,i==null?void 0:i.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,i==null?void 0:i.userAction),e.playing!==void 0&&e.playing!==s.playing&&this.changePlayState(e.playing,i),e.speed!==void 0&&e.speed!==s.speed&&this.changeSpeed(e.speed,i==null?void 0:i.userAction),ut(s,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=i==null?void 0:i.userAction)!=null?o:!0})}formatData(e){return F(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const i=this.five.work.observers,s=(()=>{const o=e;return typeof o=="object"&&o!==null&&o.version&&o.data?o.data:o})();if(s.keyframes)return{keyframesId:at(),keyframes:s.keyframes.map((o,r)=>{var c;const a=s.keyframes[r+1],l=(()=>!a||a.start===void 0||o.end===void 0?0:a.start-o.end)();return Ae(G({id:(c=o.uuid)!=null?c:at(),moveIndex:r,stay:l,index:r},o),{guildPluginOptions:s.guildPluginOptions})})};if(s.panoIndexList){let o=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=s;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,s.panoIndexList.forEach((c,d)=>{const h=(()=>{var g,v,y,P;const u=s.panoIndexList.slice(d).find(M=>M!==c);if(u===void 0)return;const m=(g=i[c])==null?void 0:g.position,A=(v=i[u])==null?void 0:v.position;if(!A||!m||((y=i[c])==null?void 0:y.floorIndex)!==((P=i[u])==null?void 0:P.floorIndex))return;const p=new I.Vector3().subVectors(A,m);return qP(p.normalize())})();s.moveType===void 0||s.moveType==="justMove"?o.push({moveIndex:d,stay:s.stay,data:G({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):s.moveType==="moveAndRotate"&&(o.push({moveIndex:d,stay:s.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&o.push({moveIndex:d,stay:s.stay,data:G({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:at(),keyframes:o.map((c,d)=>G({id:at(),index:d},c)),guildPluginOptions:s.guildPluginOptions,useGuildLine:s.useGuildLine}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,i=!0){var s,o;e?((s=this.GuideLine)==null||s.enable(),this.hooks.emit("enable",{userAction:i})):((o=this.GuideLine)==null||o.disable(),this.changePlayState(!1,{userAction:i}),this.hooks.emit("disable",{userAction:i})),this.state.enabled=e}handleVisible(e,i=!0){var s,o;e?((s=this.GuideLine)==null||s.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:i}))):((o=this.GuideLine)==null||o.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:i}))),this.state.visible=e}changePlayState(e,i){this.actionIfStateIsEnabled(()=>{var s;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(s=i==null?void 0:i.userAction)!=null?s:!0})}),e?this.handlePlay(i):this.handlePause(i),this.state.playing=e}handlePlay(e){return F(this,null,function*(){var m;const{data:i,state:s,privateState:o,hooks:r}=this;if(o.playing||!(i!=null&&i.keyframes)||(i==null?void 0:i.keyframes.length)===0)return;const a=at();o.playId=a,o.playing=!0,o.broke=!1;const l=i.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let d=!1;const u=yield(()=>F(this,null,function*(){var A,p;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(A=this.data)==null?void 0:A.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.keyframeId){const g=(p=this.data)==null?void 0:p.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:o.moveToFirstPanoEffect,duration:o.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:v}),d=!0,g.index+1}}}}))();this.clearPauseData();for(const A of l){if(o.broke||!s.playing||!o.playing||a!==o.playId)return;if(!(u!==void 0&&A.index<u))try{r.emit("playIndexChange",A.index,A),yield this.playKeyframe(A,{moveEffect:d===!1?o.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof o.moveToFirstPanoDuration=="number"?o.moveToFirstPanoDuration:void 0}),A.stay&&(yield $P(A.stay)),d===!1&&(d=!0)}catch(p){return Promise.resolve("broke")}}s.playing&&a===o.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:i,privateState:s,hooks:o}=this;i.playing=!1,s.playing!==!1&&(s.playing=!1,this.setPauseData(),s.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&o.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,i){return F(this,null,function*(){var o;const{privateState:s}=this;return((o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),s.currentPlayQueue.push(this.getPlayPromise(e,i)),this.actionPromiseQueue()})}addInterruptListener(e){const i=()=>{this.privateState.modeChanging||e()},s=e;return this.five.once("gesture",s),this.five.once("wantsChangeMode",i),()=>{this.five.off("gesture",s),this.five.once("wantsChangeMode",i)}}getPlayPromise(s){return F(this,arguments,function*(e,i={}){var r;const o=e.data;if(i.duration=(r=i.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(o.effect){case"Move":this.move(o,i).then(d);break;case"Rotate":this.rotate(o,i).then(d);break;default:this.rotate(o,i).then(d)}}catch(d){}})})}actionPromiseQueue(){return F(this,null,function*(){const{privateState:e}=this;return new Promise((i,s)=>{if(e.currentPlayQueue.length===0){i();return}const o=e.currentPlayQueue.shift();if(!o){i();return}o.then(i,s)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,i){return F(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,i);else return Promise.resolve()})}rotate(e,i){return F(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,i);yield this.updateCamera(e,i)})}updateCamera(s){return F(this,arguments,function*(e,i={}){const{five:o,privateState:r,state:a}=this,l=(()=>{var m,A;const h=(m=a.config)==null?void 0:m.speedConfig,u=(A=e.rotateSpeed)!=null?A:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return h.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(i.duration)return i.duration;if(l){const h=this.five.getCurrentState();return XP(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(h=>{JP(()=>o.updateCamera(e,d)),setTimeout(()=>h(),d)})})}changePano(e,i){return F(this,null,function*(){const{five:s,privateState:o,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===s.panoIndex)return;const a=s.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var u,m;const d=(u=r.config)==null?void 0:u.speedConfig,h=(m=e.moveSpeed)!=null?m:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return h;if(h!==void 0)return d.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(i!=null&&i.duration)return i.duration;if(l&&typeof s.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=s.work.observers[s.panoIndex].position,h=s.work.observers[e.panoIndex].position;return d.distanceTo(h)/l}return 800})();o.currentPlayKeyframe&&(o.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var h,u,m;s.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(m=(u=i==null?void 0:i.moveEffect)!=null?u:(h=this.state.config)==null?void 0:h.moveEffect)!=null?m:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&s.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,i=!0){const{state:s,privateState:o,hooks:r}=this,{currentPlayKeyframe:a}=o;if(r.emit("speedChange",e,{userAction:i}),s.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});o.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,i){return F(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,i),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,i;if((e=this.data)!=null&&e.keyframesId)return Vr.get((i=this.data)==null?void 0:i.keyframesId)}setPauseData(){var e,i,s,o;if((e=this.data)!=null&&e.keyframesId)return Vr.set((i=this.data)==null?void 0:i.keyframesId,{keyframeId:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id,fiveState:this.five.getCurrentState(),duration:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,i;if((e=this.data)!=null&&e.keyframesId)return Vr.delete((i=this.data)==null?void 0:i.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,i;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(i=this.privateState.disposers)==null||i.forEach(s=>s==null?void 0:s())}actionIfStateIsEnabled(e,i){if(this.state.enabled)return e();i!=null&&i.warnLog&&e2()}waitFiveLoaded(){return F(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=e=>{const i=this.five.controller.cameraMotion,s=e-i.startTime;return s<0?0:s>=i.duration?1:1-KP(1,i.startVelocity,i.duration,s)})}setFiveOriginUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(ds,"PluginVersion",nf);const i2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),n2=n=>new ds(n);class of{constructor(t){f(this,"id");f(this,"renderID");f(this,"isGuideLine",!0);f(this,"panoramaItem");f(this,"modelItem");f(this,"hooks",new Le.Subscribe);f(this,"_visible",!0);f(this,"plugin");f(this,"five");f(this,"logError",t=>Eu("GuideLineItem: ",t));this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new ca(this.five,{mode:"panorama",plugin:this.plugin,parent:this}),this.modelItem=new ca(this.five,{mode:"model",plugin:this.plugin,parent:this})}get visible(){return this._visible}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setHeightOffset(t){this.modelItem.mesh.position.y=t,this.panoramaItem.mesh.position.y=t}setDataByMode(t,e){var l;const i=t==="panorama"?this.panoramaItem:this.modelItem,s=t==="panorama"?e.panorama_style:e.model_style,o=e.path,r=s,a=s;if(e.pano_group){const c=t==="panorama";i.setGeometryByPanoGroup(e.pano_group,G({skipPanoGroup:c},r))}else e.path&&i.setGeometryByPath(o,r);i.name=e.name,i.setMartial(a),i.setVisibleFloorIndexes((l=e.visible_floor_indexes)!=null?l:null),i.setStartTag(s==null?void 0:s.start_tag),i.setEndTag(s==null?void 0:s.end_tag)}show(){this._visible=!0,this.hooks.emit("show",{userAction:!0})}hide(){this._visible=!1,this.hooks.emit("hide",{userAction:!0})}dispose(){this.panoramaItem.dispose(),this.modelItem.dispose()}walk(t){return F(this,null,function*(){if(!this.panoramaItem.panoGroup)return;const e=G({panoIndexList:this.panoramaItem.panoGroup},t);this.hooks.emit("walkStart",{userAction:!0});const[i]=yield pn(s2(this.five,e));if(this.hooks.emit("walkEnded",{userAction:!0}),i)return this.logError(i.message)})}}function s2(n,t){return F(this,null,function*(){if(t.panoIndexList.length===0)return;const e=n.getCurrentState();e.mode!=="Panorama"&&(yield ja(n,["Panorama",{longitude:e.longitude,latitude:0,panoIndex:t.panoIndexList[0]}]));const i=new ds(n,{useGuideLine:!1});yield i.load(t),yield new Promise((s,o)=>{const r=n.getCurrentState();let a=t.panoIndexList.slice();r.panoIndex===a[0]&&c(r.panoIndex),i.playFromStart();function l(m){if(m!=="Panorama")return h(new Error("mode not match"))}function c(m){const A=a[0];if(a=a.slice(1),m!==A)return h(new Error("panoIndex not match, wanted: "+A+", got: "+m));if(a.length===0)return u()}function d(){n.off("modeChange",l),n.off("panoArrived",c)}function h(m){d(),o(m)}function u(){d(),s()}n.on("modeChange",l),n.on("panoArrived",c)})})}const o2=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:of},Symbol.toStringTag,{value:"Module"})),rf="v1.1.0",da="GuideLinePlugin",lh=`${da}@${rf}`;let r2=class extends si{constructor(e,i){super(e,i);f(this,"version",rf);f(this,"name",da);f(this,"cruisePlugin");f(this,"itemMap",new Map);f(this,"state",{visible:!1,enabled:!0});f(this,"data");f(this,"heightOffset",0);f(this,"_config");f(this,"_disposed",!1);f(this,"disposedErrorLog",()=>{console.error(`${lh} is disposed`)});this._config=i!=null?i:{},this.cruisePlugin=new ds(e,{useGuideLine:!1}),Object.assign(window,{[`__${da}_DEBUG__`]:this})}get config(){return this._config}get disposed(){return this._disposed}load(e,i,s=!0){return F(this,null,function*(){var m,A,p,g,v,y,P;if(this.disposed)return;const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,o),this.data=r;const a=r.config,c={panorama_style:{visible:!!(!r.lines&&r.routes),unit_length:(m=a==null?void 0:a.unitHeight)!=null?m:.4,width:(A=a==null?void 0:a.unitWidth)!=null?A:.6,texture:{url:(p=a==null?void 0:a.arrowTextureUrl)!=null?p:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"}}},d=(v=(g=r.routes)==null?void 0:g.map(M=>{var B;return Fe({},c,{id:(B=M.id)!=null?B:Date.now(),pano_group:M.panoIndexList})}))!=null?v:[],h=(P=(y=r.lines)==null?void 0:y.map(M=>Fe({},c,M)))!=null?P:[],u=[...d,...h];yield this.waitFiveLoaded(),this.clear(),u.forEach(M=>{this.addGuideLineItem(M)}),this.updateTagsEnable(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),i&&this.setState(i,{userAction:s}),this.hooks.emit("dataLoaded",r),console.debug(`${lh} loaded`,r)})}formatData(e){return F(this,null,function*(){return this.getDataWithoutVersion(e)})}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.disposed||(this.clear(),this.hooks.emit("dispose"))}setState(e,i){var o;if(this.disposed)return this.disposedErrorLog();const s=G({},this.state);this.state=G(G({},this.state),e),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,i==null?void 0:i.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,i==null?void 0:i.userAction),ut(s,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=i==null?void 0:i.userAction)!=null?o:!0}),this.five.needsRender=!0)}addGuideLineItem(e){const i=e.render_id||e.id,s=this.itemMap.get(i);s&&this.removeGuideLineItem(s);const o=new of({five:this.five,id:i,plugin:this});return this.itemMap.set(i,o),e&&o.setData(e),this.heightOffset+=1e-4,o.setHeightOffset(this.heightOffset),o}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}updateTagsEnable(){const e=[];function i(r){return Array.isArray(r)&&r.every(a=>typeof a=="number")}function s(r,a){return new I.Vector3().fromArray(r).distanceTo(new I.Vector3().fromArray(a))<.01}function o(r){var l;const a=(l=r.tag)==null?void 0:l.position;return i(a)?e.every(c=>{var d;return i((d=c.tag)==null?void 0:d.position)?!s(a,c.tag.position):!0}):!1}this.itemMap.forEach(r=>{const a=r.modelItem.startTagContainer,l=r.modelItem.endTagContainer,c=o(a);c&&e.push(a),a.plugin.setState({enabled:c},{});const d=o(l);d&&e.push(l),l.plugin.setState({enabled:d},{})})}clear(){this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,i=!0){this.hooks.emit(e?"enable":"disable",{userAction:i})}handleVisible(e,i=!0){this.state.enabled&&this.hooks.emit(e?"show":"hide",{userAction:i})}waitFiveLoaded(){return F(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}};const af=(n,t)=>new r2(n,t);function lf(n,t,e){if(e){const s=new I.Vector3().subVectors(n.position,e).applyQuaternion(n.quaternion.clone().inverse()).applyQuaternion(t).add(e);n.position.copy(s)}n.quaternion.copy(t)}class Lo extends uu{constructor(e,i){var s;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(s=i==null?void 0:i.onRender)!=null?s:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,i=[]){return e.intersectObject(this,!0,i)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,i){this.scale.applyMatrix4(e)}setHelperQuaternion(e,i){lf(this,e,i)}applyHelperQuaternion(e,i){if(i){const s=new R.Vector3().subVectors(this.position,i).applyQuaternion(e).add(i);this.position.copy(s)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class a2 extends Lo{}class l2 extends Lo{}class c2 extends Lo{}class cf extends Lo{}class d2 extends cf{}class h2 extends I.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class ch extends I.Mesh{constructor(e,i,s){super(e,i);f(this,"direction");this.direction=s||"x"}}function u2(n,t){const{offsetWidth:e,offsetHeight:i}=t,{top:s,left:o}=t.getBoundingClientRect();return Object.assign(new I.Vector2,{x:(n.x-o)/e*2-1,y:-(n.y-s)/i*2+1})}function Za(n,t,e){if(!t||!e||!n)return;const i=u2(t,e);if(Math.abs(i.x)===1||Math.abs(i.y)===1)return;const s=new I.Raycaster;return s.setFromCamera(i,n),s}function f2(n,t){return!(Math.abs(n.x-t.x)>1e-5||Math.abs(n.y-t.y)>1e-5||Math.abs(n.z-t.z)>1e-5)}class Rr extends h2{constructor(e){var d;super(e.direction);f(this,"line");f(this,"arrow");f(this,"lineHeight",.4);f(this,"arrowHeight",.1);this.name="ArrowGroup";const i=new I.Color((d=e.color)!=null?d:16214315),s=new I.MeshBasicMaterial({color:i,depthTest:!1,opacity:1,transparent:!0,side:I.DoubleSide}),o=new I.ConeGeometry(.04,.1,32),r=new ch(o,s.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new I.CylinderGeometry(a,a,.4,32),c=new ch(l,s.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Gr={X:15618642,Y:4765519,Z:4227839};class fn{static get X(){return new I.Color(Gr.X).convertSRGBToLinear().clone()}static get Y(){return new I.Color(Gr.Y).convertSRGBToLinear().clone()}static get Z(){return new I.Color(Gr.Z).convertSRGBToLinear().clone()}}class m2 extends a2{constructor(e){super(e);f(this,"xArrow",new Rr({direction:"x",color:fn.X}));f(this,"yArrow",new Rr({direction:"y",color:fn.Y}));f(this,"zArrow",new Rr({direction:"z",color:fn.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function ji(n,t){return g2(document.createElement(t!=null?t:"div"),n)}function g2(n,t){if(!t)return n;for(const e in t)e&&t[e]&&(n.style[e]=t[e]);return n}function p2(n){const t=ji(G({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"99999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},n)),e=()=>{t.style.display!=="block"&&t.style.top&&t.style.left&&(t.style.display="block")};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(o,r)=>{t.style.left=o,t.style.top=r,e()}}}class A2 extends c2{constructor(e,i){super(e);f(this,"xCircle");f(this,"yCircle");f(this,"zCircle");f(this,"children",[]);f(this,"angleTips");f(this,"container");(i==null?void 0:i.yzCircleEnable)!==!1&&(this.xCircle=new Qr({direction:"x",color:fn.X})),(i==null?void 0:i.xzCircleEnable)!==!1&&(this.yCircle=new Qr({direction:"y",color:fn.Y})),(i==null?void 0:i.xyCircleEnable)!==!1&&(this.zCircle=new Qr({direction:"z",color:fn.Z})),i!=null&&i.container&&(i==null?void 0:i.angleTipsEnable)!==!1&&(this.container=i==null?void 0:i.container,this.angleTips=p2({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(i=>i.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var i;this.hide(),this.children.filter(s=>e.includes(s.direction)).forEach(s=>s.showRing()),(i=this.angleTips)==null||i.show()}dispose(){var e,i;this.removeFromParent(),(i=(e=this.angleTips)==null?void 0:e.element)==null||i.remove()}}class Qr extends I.Group{constructor(e){super();f(this,"direction");f(this,"circle");f(this,"ring");f(this,"angleSector");this.direction=e.direction,this.circle=new v2(e),this.ring=new b2(e),this.angleSector=new y2(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class v2 extends I.Mesh{constructor(e){var i;super();f(this,"direction");f(this,"gapAngle",.02);f(this,"geometry",new I.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new I.MeshBasicMaterial({opacity:.6,color:(i=e.color)!=null?i:16777215,transparent:!0,side:I.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class b2 extends I.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const i=.015,s=new Array(8).fill(null).map((o,r)=>{const a=new I.RingGeometry(.25,.3,20,8,Math.PI/4*r+i,Math.PI/4-i*2),l=new I.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),c=new I.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...s)}}class y2 extends I.Mesh{constructor(e){var s;super();f(this,"direction");f(this,"baseAxes");f(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new I.Vector3(0,0,1);break;case"y":this.baseAxes=new I.Vector3(1,0,0);break;case"z":this.baseAxes=new I.Vector3(1,0,0);break}const i=.3+5e-4;this.geometry=new I.CircleGeometry(i,48,0,1e-4),this.material=new I.MeshBasicMaterial({opacity:.4,color:(s=e.color)!=null?s:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function w2(){const n=ji({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=ji({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=ji({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});n.appendChild(t),t.appendChild(e);const i="-4px",s={direction:"nesw",element:ci({cursor:"nesw-resize",left:i,bottom:i})},o={direction:"ns",element:ci({cursor:"ns-resize",bottom:i})},r={direction:"nwse",element:ci({cursor:"nwse-resize",right:i,bottom:i})},a={direction:"ew",element:ci({cursor:"ew-resize",right:i})},l={direction:"nesw",element:ci({cursor:"nesw-resize",right:i,top:i})},c={direction:"ns",element:ci({cursor:"ns-resize",top:i})},d={direction:"nwse",element:ci({cursor:"nwse-resize",left:i,top:i})},h={direction:"ew",element:ci({cursor:"ew-resize",left:i})};return new Array(o,a,c,h,s,r,l,d).forEach(m=>t.appendChild(m.element)),{container:n,squares:[s,o,r,a,l,c,d,h]}}function ci(n){const t=ji(G({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},n)),e=ji({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),i=ji({width:"15px",height:"15px",cursor:n==null?void 0:n.cursor,pointerEvents:"auto",background:"transparent"});return i.draggable=!0,e.appendChild(i),t.appendChild(e),t}class C2 extends d2{constructor(e,i,s,o){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new mn);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=s,this.scene=o,this.container=i,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var i;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(i=this.plane)==null||i.applyMatrix4(e),this.cornerPositions.forEach(s=>s.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,i){var s;(s=this.plane)==null||s.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((i,s)=>{i.position.copy(e[s])})}applyHelperQuaternion(e,i){var o;const s=(o=this.css3DInstance)==null?void 0:o.css3DObject;if(s){const r=new I.Vector3().subVectors(s.position,i).applyQuaternion(e).add(i);s.position.copy(r),s.applyQuaternion(e)}if(this.plane){const r=new I.Vector3().subVectors(this.plane.position,i).applyQuaternion(e).add(i);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new I.Vector3().subVectors(r,i).applyQuaternion(e).add(i);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;this.enabled&&(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const i=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!i)return;this.css3DInstance=i,i.appendToElement(this.container);const s=i.css3DObject.container,{container:o,squares:r}=w2();this.points=r.map((c,d)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[d]})),s.insertBefore(o,(a=s.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("当前物体暂时不支持 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}function df(n){const t=new I.Box3,e=new I.Vector3;if(n.traverse(i=>{var o;if(i.name==="shadow")return;const s=i.geometry;if(s!==void 0)if((o=s==null?void 0:s.attributes)!=null&&o.position){const r=s.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(i.matrix),t.expandByPoint(e)}else s.vertices.forEach(r=>{const a=r.clone().applyMatrix4(i.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class I2 extends l2{constructor(e){super(e);f(this,"box");f(this,"outline");f(this,"originObject");f(this,"positionAttribute");this.originObject=e,this.positionAttribute=new I.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,i){return e.intersectObject(this,!1,i)}raycast(e,i){this.box.raycast(e,i)}update(){const e=df(this.originObject);if(!e)return;const{min:i,max:s}=e;this.positionAttribute.setXYZ(0,s.x,s.y,s.z),this.positionAttribute.setXYZ(1,i.x,s.y,s.z),this.positionAttribute.setXYZ(2,i.x,i.y,s.z),this.positionAttribute.setXYZ(3,s.x,i.y,s.z),this.positionAttribute.setXYZ(4,s.x,s.y,i.z),this.positionAttribute.setXYZ(5,i.x,s.y,i.z),this.positionAttribute.setXYZ(6,i.x,i.y,i.z),this.positionAttribute.setXYZ(7,s.x,i.y,i.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new I.BufferGeometry;i.setIndex(new I.BufferAttribute(e,1)),i.setAttribute("position",this.positionAttribute);const s=new I.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),o=new I.LineSegments(i,s);return o.matrixAutoUpdate=!1,o}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),i=new I.BufferGeometry;i.setIndex(new I.BufferAttribute(e,1)),i.setAttribute("position",this.positionAttribute);const s=new I.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new I.Mesh(i,s)}}class hs{constructor(t,e){f(this,"originObject3D");f(this,"hooks");f(this,"disposers",[]);f(this,"helperObject3D");f(this,"camera");f(this,"model");f(this,"scene");f(this,"container");f(this,"domEvents");f(this,"isDragging",!1);f(this,"enabled",!1);f(this,"name","BaseController");f(this,"boundingBox");f(this,"offset");f(this,"onRender");f(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,d;this.hooks=(c=t.sharedHooks)!=null?c:new Ri,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new Te(t.camera,t.container),this.onRender=(d=t.onRender)!=null?d:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const i=(...h)=>this.onSetOriginObjectScale(...h),s=(...h)=>this.onSetOriginObjectRotate(...h),o=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",i),this.hooks.on("setObjectRotate",s),this.hooks.on("setObjectPosition",o),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",i),this.hooks.off("setObjectRotate",s),this.hooks.off("setObjectPosition",o),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){this.enabled&&(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,i){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,i=new I.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),s=new I.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),o=this.calculateOffset(this.offset,{min:s,max:i});this.helperObject3D.position.copy(o),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,i=1){const s=(Array.isArray(t)?t:[t]).filter(ni),o=[];for(const r of s)if(r instanceof I.Mesh||r instanceof I.Group){const a=r instanceof I.Group?r.children.filter(u=>u instanceof I.Mesh):[r];a.forEach(u=>{u.__originalColor__=u.material.color.clone(),u.__originalOpacity__=u.material.opacity});const l=()=>{a.forEach(u=>{u.material.color.set(e),u.material.opacity=i}),this.render()},c=()=>{a.forEach(u=>{u.material.color.copy(u.__originalColor__),u.material.opacity=u.__originalOpacity__}),this.render()},d=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const u of a)this.domEvents.addEventListener(u,"mouseover",d),this.domEvents.addEventListener(u,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),o.push(()=>{this.domEvents.removeEventListener(u,"mouseover",d),this.domEvents.removeEventListener(u,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>o.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,i=this.helperObject3D;if(!i)return;const s=this.helperObject3D.raycasterIntersectObject(t)[0];if(!s)return;const o=s;if(o.object=i,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}calculateOffset(t,e){const i=this.originObject3D,s=new I.Vector3(0,0,0);if(!t)return s;const o=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=df(i),this.boundingBox));if(typeof t.x=="number")s.setX(t.x);else if(typeof t.x=="object"){const r=o();s.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")s.setY(t.y);else if(typeof t.y=="object"){const r=o();s.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")s.setZ(t.z);else if(typeof t.z=="object"){const r=o();s.setZ((r.max.z-r.min.z)*t.z.percents)}return s}}class P2 extends hs{constructor(...e){super(...e);f(this,"name","MoveController");f(this,"startInfo");f(this,"_moveByMouseEnable",!1);f(this,"mouseInfo");f(this,"mousedownEventListenerDisposer");const i=this.helperObject3D;this.hoverListener([i.xArrow,i.yArrow,i.zArrow]);const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(i=>i==null?void 0:i())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),i=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",i)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",i)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:i,y:s}=e;this.mouseInfo={x:i,y:s,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:i,y:s}=e;this.mouseInfo.x===i&&this.mouseInfo.y===s&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const i=e==null?void 0:e.intersect;if(!i)return this.dragEnd();const s=(i==null?void 0:i.object).direction;if(!s)return this.dragEnd();const o=new I.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new I.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new I.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(s){case"x":return o;case"y":return r;case"z":return a}})(),c=(()=>{switch(s){case"x":case"y":return a;case"z":return o}})(),d=i.point.clone(),h=new I.Plane;h.setFromNormalAndCoplanarPoint(c,d),this.startInfo={startVectorProject:d.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const i=Za(this.camera,e,this.container);return i?(this.move(i),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:i,directionVector:s,startVectorProject:o}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(i,new I.Vector3);if(!a)return;const l=a.clone().projectOnVector(s),c=l.clone().sub(o),d=new I.Matrix4;d.setPosition(c);const h=r.position.clone().applyMatrix4(d);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(d),o.copy(l),this.hooks.emit("applyObjectPosition",{matrix:d}),this.hooks.emit("move",h))}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class Zn{constructor(t,e,i,s,o,r){f(this,"helperController");f(this,"five");f(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});f(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});f(this,"onFiveIntersectionOnModelUpdate",(...t)=>{this.helperController&&this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,d=t.getElement();if(this.five=t,!a||!l||!d||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:i,helperObject3D:s,container:d,scene:c,onRender:h,sharedHooks:r},o),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const E2="v1.0.1",M2="Object3DHelper",qa=`${M2}@${E2}`,k2=()=>{console.error(`${qa} is disposed`)},x2=()=>{console.warn(`${qa} is disabled`)},D2=()=>{console.error(`${qa} is disabled`)};class S2{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new Ri);f(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return F(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return F(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return k2();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return D2();const i=G({},this.state);this.state=G(G({},this.state),t),t.disposed!==void 0&&t.disposed!==i.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:i})}addControllers(t){this.controllers=G(G({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(i=>{i.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(i=>{i.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(i=>{i.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(i=>{i.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(i=>{i==null||i.dispose()});for(const i in this.controllers){if(!i)continue;const s=i;(e=(t=this.eventListener)[s])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&x2()}}function Nr(n){return n*Math.PI/180}class T2 extends hs{constructor(...e){var c,d,h;super(...e);f(this,"name","RotateController");f(this,"startInfo");f(this,"removeListener");const i=this.helperObject3D;this.hoverListener([(c=i.xCircle)==null?void 0:c.circle,(d=i.yCircle)==null?void 0:d.circle,(h=i.zCircle)==null?void 0:h.circle].filter(Boolean));const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:i=0,y:s=0,z:o=0}=e,r=new I.Euler(Nr(i),Nr(s),Nr(o)),a=new I.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:d}=this;lf(c,a,d),this.hooks.emit("setObjectRotate",a,d),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const i=e==null?void 0:e.intersect;if(!i)return this.dragEnd();const s=(i==null?void 0:i.object).direction;if(!s)return this.dragEnd();const o=i.point,r=this.getAngleHelper(s);this.setTipsAngle(0);const a=o.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(s==="x")return new I.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(s==="y")return new I.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(s==="z")return new I.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new I.Plane().setFromNormalAndCoplanarPoint(l,o),h=c.projectPoint(o.clone(),new I.Vector3).clone().sub(this.rotateCenter),u=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(s,u),this.setAngleHelperLength(s,0),this.startInfo={direction:s,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const i=Za(this.camera,e,this.container);return i?(this.rotate(i),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:i,plane:s,angleHelper:o,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(s,new I.Vector3);if(!c)return;const d=this.rotateCenter.clone(),u=s.projectPoint(c.clone(),new I.Vector3).clone().sub(d);if(i.angleTo(u)===0)return;const m=new I.Quaternion().setFromUnitVectors(i.clone().normalize(),u.clone().normalize()),A=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",A))return;const v=new I.Euler().setFromQuaternion(new I.Quaternion().setFromUnitVectors(i.clone().normalize().applyQuaternion(a.clone().inverse()),u.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*o.angleDirection;if(this.startInfo.angle+=v,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle($h(this.startInfo.angle)),d){const y=new I.Vector3().subVectors(l.position,d).applyQuaternion(m).add(d);l.position.copy(y)}l.applyQuaternion(m),this.hooks.emit("applyObjectRotate",{quaternion:m,origin:d}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=u}dragEnd(){this.isDragging&&(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var i,s,o;switch(e){case"x":return(i=this.helperObject3D.xCircle)==null?void 0:i.angleSector;case"y":return(s=this.helperObject3D.yCircle)==null?void 0:s.angleSector;case"z":return(o=this.helperObject3D.zCircle)==null?void 0:o.angleSector}}setAngleHelperStart(e,i){const s=this.getAngleHelper(e);if(!s){console.warn("angleHelper is undefined");return}if(s instanceof I.Mesh&&s.geometry instanceof I.CircleGeometry){const{radius:o,segments:r,thetaLength:a}=s.geometry.parameters;s.geometry=new I.CircleGeometry(o,r,i,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,i){const o=i>=0?Math.max(i,.001):Math.min(i,-.001),r=this.getAngleHelper(e);if(r instanceof I.Mesh&&r.geometry instanceof I.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(o)*(40/(2*Math.PI)));r.geometry=new I.CircleGeometry(a,c,l,o)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var s;const i=(s=this.helperObject3D.angleTips)==null?void 0:s.element;i&&(i.innerText=`${e.toFixed(0)}°`)}setTipsPosition(e){const i=this.helperObject3D.angleTips;if(!i)return;const s=e.project(this.camera),{x:o,y:r,z:a}=s;if(a>1)return;const l=(o+1)/2*100+"%",c=(-r+1)/2*100+"%";i.setLeftTop(l,c)}}class L2 extends hs{constructor(...e){super(...e);f(this,"startInfo");f(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new I.Plane,i=this.helperObject3D.cornerPositions;if(i.length!==0)return i.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new R.Vector3),i[0]):e.setFromCoplanarPoints(i[0],i[1],i[2]),e}dragStart(e,i){var o,r;(r=(o=this.helperObject3D).updatePoints)==null||r.call(o);const s=this.getDragPlane();if(!s)return this.dragEnd();this.startInfo={startPoint:{position:i.position.clone(),direction:i.direction},plane:s},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const i=Za(this.camera,e,this.container);if(!i)return this.dragEnd();this.scale(i)}scale(e){var X,Y;if(!this.startInfo)return;const i=this.originObject3D,{startPoint:s,plane:o}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(o,new R.Vector3);if(!a||f2(a,this.camera.position))return;const l=new R.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:d}=s,h=new R.Vector3().subVectors(r[1],r[0]),u=new R.Vector3().subVectors(r[3],r[0]),m=N=>{const H=new R.Vector3(0,0,0);if(!this.startInfo)return H;const _=(N==="ew"?h:u).clone(),Q=c.clone().projectOnVector(_),W=a.clone().projectOnVector(_),Z=l.clone().projectOnVector(_);if(W.equals(Q))return H;if(N==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const ce=new R.Vector3().subVectors(W,Z),oe=ce.x<0&&_.x>=0,we=ce.y<0&&_.y>=0,Ce=ce.z<0&&_.z>=0;this.startInfo.dragPointInCenterBottom=oe||we||Ce}if(N==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const ce=new R.Vector3().subVectors(W,Z),oe=ce.x<0&&_.x>=0,we=ce.y<0&&_.y>=0,Ce=ce.z<0&&_.z>=0;this.startInfo.dragPointInCenterLeft=oe||we||Ce}const J=new R.Vector3().subVectors(W,Q),ee=J.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),H):J},A=m("ew"),p=m("ns"),g=()=>{const N=A;this.helperObject3D.cornerPositions.forEach((H,_)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterLeft?(_===0||_===3)&&H.add(N):(_===1||_===2)&&H.add(N)})},v=()=>{const N=p;this.helperObject3D.cornerPositions.forEach((H,_)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterBottom?(_===0||_===1)&&H.add(N):(_===2||_===3)&&H.add(N)})};switch(d){case"ew":g();break;case"ns":v();break;case"nesw":case"nwse":g(),v()}const y=new R.Vector3().subVectors(r[1],r[0]).length()/h.length(),P=new R.Vector3().subVectors(r[3],r[0]).length()/u.length(),M=new R.Vector3(y,P,1),B=new I.Matrix4().scale(M);i.isCSS3DObjectPlus?i.applyScaleMatrix4(B):i.scale.applyMatrix4(B),s.position.copy(a);const E=new R.Vector3().addVectors(r[0],r[2]).divideScalar(2),V=new R.Vector3().subVectors(E,l),j=new I.Matrix4().setPosition(V);i.applyMatrix4(j),(X=this.helperObject3D.css3DInstance)==null||X.css3DObject.applyMatrix4(j),(Y=this.helperObject3D.plane)==null||Y.applyMatrix4(j),this.hooks.emit("applyObjectScale",{matrix:B}),this.hooks.emit("applyObjectPosition",{matrix:j}),this.render()}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class j2 extends L2{constructor(...e){super(...e);f(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const i=e.point,s=a=>this.dragStart(a,e),o=this.dragging.bind(this),r=this.dragEnd.bind(this);i.addEventListener("dragstart",s),i.addEventListener("drag",o),i.addEventListener("dragend",r)})}}class z2 extends hs{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class O2 extends cf{constructor(t){super(t)}}class B2 extends hs{constructor(...e){super(...e);f(this,"name","ScaleController")}setScale(e){var l,c,d;let i=1,s=1,o=1;typeof e=="number"?(i=e,s=e,o=e):typeof e=="object"&&(i=(l=e.x)!=null?l:1,s=(c=e.y)!=null?c:1,o=(d=e.z)!=null?d:1);const r=new I.Vector3(i,s,o);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}const ha="Object3DHelperPlugin",jo=ha,V2=()=>{console.error(`${jo} is disposed`)},R2=()=>{console.warn(`${jo} is disabled`)},G2=()=>{console.error(`${jo} is disabled`)};class hf extends cs{constructor(e){super(e);f(this,"name",ha);f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"objectHelperMap",new Map);f(this,"css3DObjectParentMap",new Map);f(this,"css3DRender");this.five=e,this.css3DRender=new mn(this.five.scene),console.warn("Object3DHelper: 使用此插件,需要在初始化five时,设置five参数: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${ha.toUpperCase()}_DEBUG__`]:this})}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,i){if(this.state.disposed)return V2();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return G2();const s=G({},this.state);this.state=G(G({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:s})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,i={}){var m;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const s=new S2,o=[],r=(m=this.five.getElement())==null?void 0:m.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:d=!0,boundingBoxHelper:h=!1}=i,u=new Le.Subscribe;if(l){const A=new m2(e),p=this.getConfig(i.moveHelper),g=new Zn(this.five,P2,e,A,p,u);s.addControllers({moveController:g.helperController}),o.push(()=>g.dispose())}if(c){const A=this.getConfig(i.rotateHelper),p=new A2(e,G({container:r},A)),g=new Zn(this.five,T2,e,p,A,u);s.addControllers({rotateController:g.helperController}),o.push(()=>g.dispose())}if(h){const A=new I2(e),p=new Zn(this.five,z2,e,A,void 0,u);s.addControllers({boundingBoxController:p.helperController})}if(d)if(e.isCSS3DObjectPlus&&r){const A=new C2(e,r,a,this.five.scene),p=new Zn(this.five,j2,e,A,void 0,u);s.addControllers({scaleController:p.helperController}),o.push(()=>p.dispose()),yh(this.five).then(()=>{var g,v;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const P=(g=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?g:wh(this.five);P&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(P),(v=this.css3DRender.getBehindCSS3DObjectGroup())==null||v.add(y),this.css3DRender.render(this.five.camera))}})}else{const A=new O2(e),p=new Zn(this.five,B2,e,A,void 0,u);s.addControllers({scaleController:p.helperController}),o.push(()=>p.dispose())}return this.objectHelperMap.set(e,{helper:s,disposers:o}),s.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:i,disposers:s}=this.objectHelperMap.get(e);if(i){if(e.isCSS3DObjectPlus){const o=e,r=this.css3DObjectParentMap.get(o);r&&r.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),i.dispose(),s==null||s.forEach(o=>o==null?void 0:o())}}handleEnable(e,i=!0){e?(this.everyHelperDo(s=>s.enable()),this.hooks.emit("enable",{userAction:i})):(this.everyHelperDo(s=>s.disable()),this.hooks.emit("disable",{userAction:i})),this.state.enabled=e}handleVisible(e,i=!0){e?(this.everyHelperDo(s=>s.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:i}))):(this.everyHelperDo(s=>s.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:i}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:i})=>{e.dispose(),i==null||i.forEach(s=>s==null?void 0:s())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:i,disposers:s})=>{i&&e(i)})}actionIfStateIsEnabled(e,i){if(this.state.enabled)return e();i!=null&&i.warnLog&&R2()}getConfig(e){if(e&&typeof e!="boolean"&&e.enable)return e}}const Q2=n=>new hf(n),N2=`
|
|
669
|
+
`;class ca{constructor(t,e){f(this,"name","");f(this,"startTagContainer");f(this,"endTagContainer");f(this,"mesh");f(this,"five");f(this,"mode");f(this,"path",[]);f(this,"_curvePath",null);f(this,"_curvePoints",null);f(this,"_panoGroup",[]);f(this,"skippedPositions",null);f(this,"textureUrl","");f(this,"scale",1);f(this,"width",.5);f(this,"unitLength",.5);f(this,"_visibleFloorIndexes",null);f(this,"visible",null);f(this,"modeVisible",!1);f(this,"floorVisible",!0);f(this,"defaultVisible",!1);f(this,"inWalkAnimation",!1);f(this,"customVisible",null);f(this,"parent");f(this,"plugin");f(this,"textureHasLoaded",!1);f(this,"disposed",!1);f(this,"flowAnime",new zi({progress:0}).to({progress:1}).duration(1500).repeat(1/0));f(this,"flickerAnime",ss(300).yoyo(!0).repeat(5));f(this,"cacheLengths",[]);f(this,"dispose",()=>{var t,e;this.disposed||(this.disposed=!0,this.parent.hooks.off("show",this.updateVisible),this.parent.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("show",this.updateVisible),this.plugin.hooks.off("hide",this.updateVisible),this.plugin.hooks.off("enable",this.updateVisible),this.plugin.hooks.off("disable",this.updateVisible),this.five.off("modeChange",this.onFiveModeChange),this.five.off("modelShownFloorChange",this.onFiveModelShownFloorChange),this.doHide(),(t=this.startTagContainer)==null||t.plugin.dispose(),(e=this.endTagContainer)==null||e.plugin.dispose())});f(this,"onWalkAnimationStart",()=>{this.inWalkAnimation=!0,this.updateVisible()});f(this,"onWalkAnimationEnd",()=>{this.inWalkAnimation=!1,this.updateVisible()});f(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?ma(t):Ch(t),this.updateVisible()});f(this,"onFiveModelShownFloorChange",t=>{this.floorVisible=t===null||this.visibleFloorIndexes===null||this.visibleFloorIndexes.includes(t),this.updateVisible()});f(this,"updateVisible",()=>{const t=(()=>!this.parent.visible||!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.inWalkAnimation?!0:this.modeVisible&&this.textureHasLoaded&&this.defaultVisible&&this.floorVisible)();this.visible!==t&&(this.visible=t,t?this.doShow():this.doHide())});f(this,"onFlowAnimeUpdate",t=>{const{progress:e}=t;this.mesh.material.uniforms.vOffset.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0});f(this,"onFlickerAnimeUpdate",t=>{var s,o,r,a;const{progress:e}=t,i=1-e;this.mesh.material.uniforms.flicker.value=i,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0,this.startTagContainer.tag&&Br(this.startTagContainer.tag)&&((r=this.startTagContainer.app)==null||r.$set(Ae(G({},this.startTagContainer.tag.data),{opacity:i,name:this.name,distance:Math.round((o=(s=this.curvePath)==null?void 0:s.getLength())!=null?o:0)}))),this.endTagContainer.tag&&Br(this.endTagContainer.tag)&&((a=this.endTagContainer.app)==null||a.$set(Ae(G({},this.endTagContainer.tag.data),{opacity:i})))});f(this,"logWarning",t=>Fb("GuideLineModeItem: ",t));f(this,"logError",t=>Eu("GuideLineModeItem: ",t));var o,r;this.five=t,this.mode=e.mode,this.plugin=e.plugin,this.parent=e.parent,this.startTagContainer={tag:null,plugin:new po(this.five)},this.endTagContainer={tag:null,plugin:new po(this.five)};const i=new I.BufferGeometry,s=new I.ShaderMaterial({vertexShader:WP,fragmentShader:YP,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new I.Color},mapOpacity:{value:1},backgroundColor:{value:new I.Color},backgroundOpacity:{value:0},borderColor:{value:new I.Color},borderOpacity:{value:0},opacity:{value:1},flicker:{value:1},maxU:{value:0},vOffset:{value:0}}});this.mesh=new I.Mesh(i,s),this.mesh.name="GuideLineModeItem",this.mode==="panorama"&&(this.parent.hooks.on("walkStart",this.onWalkAnimationStart),this.parent.hooks.on("walkEnded",this.onWalkAnimationEnd)),this.updateVisible(),this.onFiveModeChange(this.five.getCurrentState().mode),this.onFiveModelShownFloorChange((r=(o=this.five.model)==null?void 0:o.shownFloor)!=null?r:null),this.flowAnime.onUpdate(this.onFlowAnimeUpdate),this.flickerAnime.onUpdate(this.onFlickerAnimeUpdate),this.parent.hooks.on("show",this.updateVisible),this.parent.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("show",this.updateVisible),this.plugin.hooks.on("hide",this.updateVisible),this.plugin.hooks.on("enable",this.updateVisible),this.plugin.hooks.on("disable",this.updateVisible),this.plugin.hooks.on("dispose",this.dispose),this.five.on("modeChange",this.onFiveModeChange),this.five.on("modelShownFloorChange",this.onFiveModelShownFloorChange)}get panoGroup(){return this._panoGroup}get visibleFloorIndexes(){return this._visibleFloorIndexes}get curvePath(){return this._curvePath}get curvePoints(){return this._curvePoints}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setDefaultVisible(t){if(this.disposed)return this.logError("disposed");this.defaultVisible!==t&&(this.defaultVisible=t,this.updateVisible())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const i=_P(t);if(this._panoGroup=i,(e==null?void 0:e.skipPanoGroup)!==void 0){const o=e.skipPanoGroup?i.map(r=>this.five.work.observers[r]).map(r=>r.standingPosition.clone()):null;this.skippedPositions=o}const s=this.getPathFromPanoGroup(i,this.five.work,e);this.path=s,this.setGeometryByPath(s,e)}setGeometryByPath(t,e){var d,h,u;if(this.disposed)return this.logError("disposed");const i=(d=e==null?void 0:e.scale)!=null?d:this.scale,s=(h=e==null?void 0:e.width)!=null?h:this.width,o=(u=e==null?void 0:e.unit_length)!=null?u:this.unitLength;this.path=t,this.scale=i,this.width=s,this.unitLength=o;const{geometry:r,maxU:a,curvePath:l,curvePoints:c}=l1({path:t,width:s*i,unitLength:o*i,skipPositions:this.skippedPositions});this._curvePath=l,this._curvePoints=c,this.mesh.geometry=r,this.mesh.material.needsUpdate=!0,this.mesh.material.uniforms.maxU.value=a,this.five.needsRender=!0}setMartial(t){var e;if(this.disposed)return this.logError("disposed");(t==null?void 0:t.visible)!==void 0&&this.setDefaultVisible(t.visible),(t==null?void 0:t.color)!==void 0&&this.setColor(t.color),(t==null?void 0:t.opacity)!==void 0&&this.setOpacity(t.opacity),((e=t==null?void 0:t.texture)==null?void 0:e.url)!==void 0&&this.setTextureUrl(t.texture.url),(t==null?void 0:t.background_color)!==void 0&&this.setBackgroundColor(t.background_color),(t==null?void 0:t.background_opacity)!==void 0&&this.setBackgroundOpacity(t.background_opacity),(t==null?void 0:t.border_color)!==void 0&&this.setBorderColor(t.border_color),(t==null?void 0:t.border_opacity)!==void 0&&this.setBorderOpacity(t.border_opacity)}setColor(t){if(this.disposed)return this.logError("disposed");t&&(this.mesh.material.uniforms.mapColor.value=new I.Color().set(t)),this.mesh.material.uniforms.useMapColor.value=t?1:0,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderColor.value=new I.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBorderOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.borderOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundColor.value=new I.Color().set(t),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.opacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.mapOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,Li(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=I.RepeatWrapping,this.textureHasLoaded=!0,this.mesh.material.uniforms.map.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.mesh.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}setVisibleFloorIndexes(t){var e,i;if(this.disposed)return this.logError("disposed");this._visibleFloorIndexes=t,this.onFiveModelShownFloorChange((i=(e=this.five.model)==null?void 0:e.shownFloor)!=null?i:null)}setStartTag(t){this.setTag("start",t)}setEndTag(t){this.setTag("end",t)}flicker(){if(this.disposed)return this.logError("disposed");this.flickerAnime.play()}getLengthByPanoGroupIndex(t){return this.disposed?this.logError("disposed"):this.cacheLengths.length!==0?this.cacheLengths[t]:(this.cacheLengths=this.getPanoGroupLengths(),this.cacheLengths[t])}getPanoGroupLengths(){var c;if(!this.curvePoints||!this.curvePath)return[];const t=this.panoGroup.map(d=>this.five.work.observers[d]),e=this.curvePoints.length,i=this.curvePath.getLength(),s=e-1,o=i/s,r=(c=this.curvePath.getLengths(s))!=null?c:[],a=[];let l=0;for(let d=0;d<e;d++){const h=this.curvePoints[d],u=t[l];if(!u)break;u.standingPosition.clone().setY(0).distanceTo(h.clone().setY(0))<o&&(a.push(r[d]),l+=1)}return a}setTag(t,e){const i=this.curvePath,s=t==="start"?this.startTagContainer:this.endTagContainer;e||s.plugin.clearTags();const r=Fe({},{contentType:"Custom",stickType:"2DPoint",config:{visibleConfig:{visibleFiveMode:["Floorplan","Mapview"],followModelVisibility:!1}},style:{point:{enabled:!1}},data:{}},e);s.tag=r,Br(r)&&(s.tag.element=a=>{var d,h;(d=s.app)==null||d.$destroy();const l=t==="start"?Ae(G({},r.data),{name:this.name,distance:Math.round((h=i.getLength())!=null?h:0),i18n:this.plugin.config.i18n}):r.data,c=new FP({target:a,intro:!0,props:l});return s.app=c,()=>c.$destroy()}),s.plugin.load({tagList:[s.tag]})}doShow(){this.mode==="model"&&this.flowAnime.play(),this.five.scene.add(this.mesh),this.startTagContainer.plugin.show(),this.endTagContainer.plugin.show(),this.five.needsRender=!0}doHide(){this.mode==="model"&&this.flowAnime.stop(),this.five.scene.remove(this.mesh),this.startTagContainer.plugin.hide(),this.endTagContainer.plugin.hide(),this.five.needsRender=!0}getPathFromPanoGroup(t,e,i){if(t.length<2)return[];const o=t.map(r=>e.observers[r]).map(r=>r.standingPosition.toArray());return[G({type:"CatmullRomCurve3",points:o},i)]}}function Br(n){return n.contentType==="Custom"}const UP=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:ca},Symbol.toStringTag,{value:"Module"}));function rh(n){const t=Math.abs(Math.cos(n.latitude));return new I.Vector3(-Math.sin(n.longitude)*t,-Math.sin(n.latitude),-Math.cos(n.longitude)*t)}function XP(n,t){const e=rh(n),i=rh(t);return e.angleTo(i)}const JP=n=>F(exports,null,function*(){try{n().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Ws=Math.PI*2;function ZP(n){return n>=0&&n<Ws?n:(n%Ws+Ws)%Ws}function qP(n){return{longitude:ZP(-Math.atan2(n.x,-n.z)),latitude:-Math.asin(n.y/1)}}function KP(n,t,e,i){const s=-n/e,o=n;return s*i+o}function $P(n){return new Promise(t=>{setTimeout(()=>{t()},n)})}const nf="v1.0.6",sf="CruisePlugin",To=`${sf}@${nf}`,ah=()=>{console.error(`${To} is disposed`)},e2=()=>{console.warn(`${To} is disabled`)},t2=()=>{console.error(`${To} is disabled`)},Vr=new Map;class ds extends si{constructor(e,i){super(e,i);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=i,Object.assign(window,{[`__${sf}_DEBUG__`]:this});const s=this.setFiveLinearUpdateCamera.bind(this),o=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",s),this.hooks.on("broke",o),this.hooks.on("end",o),this.hooks.on("pause",o),this.privateState.disposers.push(()=>{this.hooks.off("play",s),this.hooks.off("broke",o),this.hooks.off("end",o),this.hooks.off("pause",o)})}load(e,i,s){return F(this,null,function*(){var d,h,u,m,A,p;if(this.state.disposed)return ah();this.privateState.fiveOriginGetProgress||(h=(d=this.five.controller)==null?void 0:d.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,o);let a=[],l;const c=this.data.keyframes.filter(g=>g.data.panoIndex!==void 0);c.filter((g,v)=>{var y;return g.data.panoIndex!==((y=c[v-1])==null?void 0:y.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var y,P;const v=(y=this.five.work.observers[g])==null?void 0:y.floorIndex;if(v!==void 0)if(l===v){const M=a.length-1;a[M]=[...(P=a[M])!=null?P:[],g]}else{l=v;const M=a.length;a[M]=[g]}}),!this.GuideLine&&((A=this.config)==null?void 0:A.useGuideLine)!==!1&&r.useGuildLine!==!1&&(this.GuideLine=af(this.five,this.config)),(p=this.GuideLine)==null||p.load({routes:a.map(g=>({panoIndexList:g})),config:r.guildPluginOptions}),i?this.setState(i,{userAction:s}):(this.setState({playing:!1},{userAction:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing,{userAction:!1}),this.changeSpeed(this.state.speed)),this.clearPauseData(),console.debug(`${To} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:i,id:s,userAction:o}=e;this.state.playing&&this.setState({playing:!1},{userAction:o}),this.setState({playing:!0},{userAction:o,playFromIndex:i,playFromId:s})}playFromStart(e){return this.playFrom(Ae(G({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,i){var o;if(this.state.disposed)return ah();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return t2();const s=G({},this.state);this.state=G(G({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,i==null?void 0:i.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,i==null?void 0:i.userAction),e.playing!==void 0&&e.playing!==s.playing&&this.changePlayState(e.playing,i),e.speed!==void 0&&e.speed!==s.speed&&this.changeSpeed(e.speed,i==null?void 0:i.userAction),ut(s,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=i==null?void 0:i.userAction)!=null?o:!0})}formatData(e){return F(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const i=this.five.work.observers,s=(()=>{const o=e;return typeof o=="object"&&o!==null&&o.version&&o.data?o.data:o})();if(s.keyframes)return{keyframesId:at(),keyframes:s.keyframes.map((o,r)=>{var c;const a=s.keyframes[r+1],l=(()=>!a||a.start===void 0||o.end===void 0?0:a.start-o.end)();return Ae(G({id:(c=o.uuid)!=null?c:at(),moveIndex:r,stay:l,index:r},o),{guildPluginOptions:s.guildPluginOptions})})};if(s.panoIndexList){let o=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=s;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,s.panoIndexList.forEach((c,d)=>{const h=(()=>{var g,v,y,P;const u=s.panoIndexList.slice(d).find(M=>M!==c);if(u===void 0)return;const m=(g=i[c])==null?void 0:g.position,A=(v=i[u])==null?void 0:v.position;if(!A||!m||((y=i[c])==null?void 0:y.floorIndex)!==((P=i[u])==null?void 0:P.floorIndex))return;const p=new I.Vector3().subVectors(A,m);return qP(p.normalize())})();s.moveType===void 0||s.moveType==="justMove"?o.push({moveIndex:d,stay:s.stay,data:G({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):s.moveType==="moveAndRotate"&&(o.push({moveIndex:d,stay:s.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&o.push({moveIndex:d,stay:s.stay,data:G({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:at(),keyframes:o.map((c,d)=>G({id:at(),index:d},c)),guildPluginOptions:s.guildPluginOptions,useGuildLine:s.useGuildLine}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,i=!0){var s,o;e?((s=this.GuideLine)==null||s.enable(),this.hooks.emit("enable",{userAction:i})):((o=this.GuideLine)==null||o.disable(),this.changePlayState(!1,{userAction:i}),this.hooks.emit("disable",{userAction:i})),this.state.enabled=e}handleVisible(e,i=!0){var s,o;e?((s=this.GuideLine)==null||s.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:i}))):((o=this.GuideLine)==null||o.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:i}))),this.state.visible=e}changePlayState(e,i){this.actionIfStateIsEnabled(()=>{var s;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(s=i==null?void 0:i.userAction)!=null?s:!0})}),e?this.handlePlay(i):this.handlePause(i),this.state.playing=e}handlePlay(e){return F(this,null,function*(){var m;const{data:i,state:s,privateState:o,hooks:r}=this;if(o.playing||!(i!=null&&i.keyframes)||(i==null?void 0:i.keyframes.length)===0)return;const a=at();o.playId=a,o.playing=!0,o.broke=!1;const l=i.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let d=!1;const u=yield(()=>F(this,null,function*(){var A,p;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(A=this.data)==null?void 0:A.keyframes.findIndex(g=>g.id===e.playFromId);if(c!=null&&c.keyframeId){const g=(p=this.data)==null?void 0:p.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:o.moveToFirstPanoEffect,duration:o.moveToFirstPanoDuration})),g){if(g.data.effect==="Move")return g.index;if(g.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(g,{duration:v}),d=!0,g.index+1}}}}))();this.clearPauseData();for(const A of l){if(o.broke||!s.playing||!o.playing||a!==o.playId)return;if(!(u!==void 0&&A.index<u))try{r.emit("playIndexChange",A.index,A),yield this.playKeyframe(A,{moveEffect:d===!1?o.moveToFirstPanoEffect:void 0,duration:d===!1&&typeof o.moveToFirstPanoDuration=="number"?o.moveToFirstPanoDuration:void 0}),A.stay&&(yield $P(A.stay)),d===!1&&(d=!0)}catch(p){return Promise.resolve("broke")}}s.playing&&a===o.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:i,privateState:s,hooks:o}=this;i.playing=!1,s.playing!==!1&&(s.playing=!1,(e==null?void 0:e.userAction)!==!1&&this.setPauseData(),s.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&o.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,i){return F(this,null,function*(){var o;const{privateState:s}=this;return((o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),s.currentPlayQueue.push(this.getPlayPromise(e,i)),this.actionPromiseQueue()})}addInterruptListener(e){const i=()=>{this.privateState.modeChanging||e()},s=e;return this.five.once("gesture",s),this.five.once("wantsChangeMode",i),()=>{this.five.off("gesture",s),this.five.once("wantsChangeMode",i)}}getPlayPromise(s){return F(this,arguments,function*(e,i={}){var r;const o=e.data;if(i.duration=(r=i.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(o.effect){case"Move":this.move(o,i).then(d);break;case"Rotate":this.rotate(o,i).then(d);break;default:this.rotate(o,i).then(d)}}catch(d){}})})}actionPromiseQueue(){return F(this,null,function*(){const{privateState:e}=this;return new Promise((i,s)=>{if(e.currentPlayQueue.length===0){i();return}const o=e.currentPlayQueue.shift();if(!o){i();return}o.then(i,s)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,i){return F(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,i);else return Promise.resolve()})}rotate(e,i){return F(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,i);yield this.updateCamera(e,i)})}updateCamera(s){return F(this,arguments,function*(e,i={}){const{five:o,privateState:r,state:a}=this,l=(()=>{var m,A;const h=(m=a.config)==null?void 0:m.speedConfig,u=(A=e.rotateSpeed)!=null?A:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return u;if(u!==void 0)return h.rotateSpeedUnit==="rad/ms"?u:u/1e3})(),c=(()=>{if(i.duration)return i.duration;if(l){const h=this.five.getCurrentState();return XP(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const d=this.getSpeededDuration(c);return new Promise(h=>{JP(()=>o.updateCamera(e,d)),setTimeout(()=>h(),d)})})}changePano(e,i){return F(this,null,function*(){const{five:s,privateState:o,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===s.panoIndex)return;const a=s.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var u,m;const d=(u=r.config)==null?void 0:u.speedConfig,h=(m=e.moveSpeed)!=null?m:d==null?void 0:d.moveSpeed;if((d==null?void 0:d.moveSpeedUnit)===void 0)return h;if(h!==void 0)return d.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(i!=null&&i.duration)return i.duration;if(l&&typeof s.panoIndex=="number"&&typeof e.panoIndex=="number"){const d=s.work.observers[s.panoIndex].position,h=s.work.observers[e.panoIndex].position;return d.distanceTo(h)/l}return 800})();o.currentPlayKeyframe&&(o.currentPlayKeyframe.originDuration=c),yield new Promise(d=>{var h,u,m;s.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(m=(u=i==null?void 0:i.moveEffect)!=null?u:(h=this.state.config)==null?void 0:h.moveEffect)!=null?m:e.moveEffect,moveCancelCallback:()=>d(),moveEndCallback:()=>d()}),a&&s.once("panoArrived",()=>d())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,i=!0){const{state:s,privateState:o,hooks:r}=this,{currentPlayKeyframe:a}=o;if(r.emit("speedChange",e,{userAction:i}),s.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});o.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,i){return F(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,i),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,i;if((e=this.data)!=null&&e.keyframesId)return Vr.get((i=this.data)==null?void 0:i.keyframesId)}setPauseData(){var e,i,s,o;if((e=this.data)!=null&&e.keyframesId)return Vr.set((i=this.data)==null?void 0:i.keyframesId,{keyframeId:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id,fiveState:this.five.getCurrentState(),duration:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,i;if((e=this.data)!=null&&e.keyframesId)return Vr.delete((i=this.data)==null?void 0:i.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,i;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(i=this.privateState.disposers)==null||i.forEach(s=>s==null?void 0:s())}actionIfStateIsEnabled(e,i){if(this.state.enabled)return e();i!=null&&i.warnLog&&e2()}waitFiveLoaded(){return F(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=e=>{const i=this.five.controller.cameraMotion,s=e-i.startTime;return s<0?0:s>=i.duration?1:1-KP(1,i.startVelocity,i.duration,s)})}setFiveOriginUpdateCamera(){this.privateState.fiveOriginGetProgress&&(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(ds,"PluginVersion",nf);const i2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),n2=n=>new ds(n);class of{constructor(t){f(this,"id");f(this,"renderID");f(this,"isGuideLine",!0);f(this,"panoramaItem");f(this,"modelItem");f(this,"hooks",new Le.Subscribe);f(this,"_visible",!0);f(this,"plugin");f(this,"five");f(this,"logError",t=>Eu("GuideLineItem: ",t));this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new ca(this.five,{mode:"panorama",plugin:this.plugin,parent:this}),this.modelItem=new ca(this.five,{mode:"model",plugin:this.plugin,parent:this})}get visible(){return this._visible}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setHeightOffset(t){this.modelItem.mesh.position.y=t,this.panoramaItem.mesh.position.y=t}setDataByMode(t,e){var l;const i=t==="panorama"?this.panoramaItem:this.modelItem,s=t==="panorama"?e.panorama_style:e.model_style,o=e.path,r=s,a=s;if(e.pano_group){const c=t==="panorama";i.setGeometryByPanoGroup(e.pano_group,G({skipPanoGroup:c},r))}else e.path&&i.setGeometryByPath(o,r);i.name=e.name,i.setMartial(a),i.setVisibleFloorIndexes((l=e.visible_floor_indexes)!=null?l:null),i.setStartTag(s==null?void 0:s.start_tag),i.setEndTag(s==null?void 0:s.end_tag)}show(){this._visible=!0,this.hooks.emit("show",{userAction:!0})}hide(){this._visible=!1,this.hooks.emit("hide",{userAction:!0})}dispose(){this.panoramaItem.dispose(),this.modelItem.dispose()}walk(t){return F(this,null,function*(){if(!this.panoramaItem.panoGroup)return;const e=G({panoIndexList:this.panoramaItem.panoGroup},t);this.hooks.emit("walkStart",{userAction:!0});const[i]=yield pn(s2(this.five,e));if(this.hooks.emit("walkEnded",{userAction:!0}),i)return this.logError(i.message)})}}function s2(n,t){return F(this,null,function*(){if(t.panoIndexList.length===0)return;const e=n.getCurrentState();e.mode!=="Panorama"&&(yield ja(n,["Panorama",{longitude:e.longitude,latitude:0,panoIndex:t.panoIndexList[0]}]));const i=new ds(n,{useGuideLine:!1});yield i.load(t),yield new Promise((s,o)=>{const r=n.getCurrentState();let a=t.panoIndexList.slice();r.panoIndex===a[0]&&c(r.panoIndex),i.playFromStart();function l(m){if(m!=="Panorama")return h(new Error("mode not match"))}function c(m){const A=a[0];if(a=a.slice(1),m!==A)return h(new Error("panoIndex not match, wanted: "+A+", got: "+m));if(a.length===0)return u()}function d(){n.off("modeChange",l),n.off("panoArrived",c)}function h(m){d(),o(m)}function u(){d(),s()}n.on("modeChange",l),n.on("panoArrived",c)})})}const o2=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:of},Symbol.toStringTag,{value:"Module"})),rf="v1.1.0",da="GuideLinePlugin",lh=`${da}@${rf}`;let r2=class extends si{constructor(e,i){super(e,i);f(this,"version",rf);f(this,"name",da);f(this,"cruisePlugin");f(this,"itemMap",new Map);f(this,"state",{visible:!1,enabled:!0});f(this,"data");f(this,"heightOffset",0);f(this,"_config");f(this,"_disposed",!1);f(this,"disposedErrorLog",()=>{console.error(`${lh} is disposed`)});this._config=i!=null?i:{},this.cruisePlugin=new ds(e,{useGuideLine:!1}),Object.assign(window,{[`__${da}_DEBUG__`]:this})}get config(){return this._config}get disposed(){return this._disposed}load(e,i,s=!0){return F(this,null,function*(){var m,A,p,g,v,y,P;if(this.disposed)return;const o=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,o),this.data=r;const a=r.config,c={panorama_style:{visible:!!(!r.lines&&r.routes),unit_length:(m=a==null?void 0:a.unitHeight)!=null?m:.4,width:(A=a==null?void 0:a.unitWidth)!=null?A:.6,texture:{url:(p=a==null?void 0:a.arrowTextureUrl)!=null?p:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"}}},d=(v=(g=r.routes)==null?void 0:g.map(M=>{var B;return Fe({},c,{id:(B=M.id)!=null?B:Date.now(),pano_group:M.panoIndexList})}))!=null?v:[],h=(P=(y=r.lines)==null?void 0:y.map(M=>Fe({},c,M)))!=null?P:[],u=[...d,...h];yield this.waitFiveLoaded(),this.clear(),u.forEach(M=>{this.addGuideLineItem(M)}),this.updateTagsEnable(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),i&&this.setState(i,{userAction:s}),this.hooks.emit("dataLoaded",r),console.debug(`${lh} loaded`,r)})}formatData(e){return F(this,null,function*(){return this.getDataWithoutVersion(e)})}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.disposed||(this.clear(),this.hooks.emit("dispose"))}setState(e,i){var o;if(this.disposed)return this.disposedErrorLog();const s=G({},this.state);this.state=G(G({},this.state),e),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,i==null?void 0:i.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,i==null?void 0:i.userAction),ut(s,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(o=i==null?void 0:i.userAction)!=null?o:!0}),this.five.needsRender=!0)}addGuideLineItem(e){const i=e.render_id||e.id,s=this.itemMap.get(i);s&&this.removeGuideLineItem(s);const o=new of({five:this.five,id:i,plugin:this});return this.itemMap.set(i,o),e&&o.setData(e),this.heightOffset+=1e-4,o.setHeightOffset(this.heightOffset),o}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}updateTagsEnable(){const e=[];function i(r){return Array.isArray(r)&&r.every(a=>typeof a=="number")}function s(r,a){return new I.Vector3().fromArray(r).distanceTo(new I.Vector3().fromArray(a))<.01}function o(r){var l;const a=(l=r.tag)==null?void 0:l.position;return i(a)?e.every(c=>{var d;return i((d=c.tag)==null?void 0:d.position)?!s(a,c.tag.position):!0}):!1}this.itemMap.forEach(r=>{const a=r.modelItem.startTagContainer,l=r.modelItem.endTagContainer,c=o(a);c&&e.push(a),a.plugin.setState({enabled:c},{});const d=o(l);d&&e.push(l),l.plugin.setState({enabled:d},{})})}clear(){this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,i=!0){this.hooks.emit(e?"enable":"disable",{userAction:i})}handleVisible(e,i=!0){this.state.enabled&&this.hooks.emit(e?"show":"hide",{userAction:i})}waitFiveLoaded(){return F(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}};const af=(n,t)=>new r2(n,t);function lf(n,t,e){if(e){const s=new I.Vector3().subVectors(n.position,e).applyQuaternion(n.quaternion.clone().inverse()).applyQuaternion(t).add(e);n.position.copy(s)}n.quaternion.copy(t)}class Lo extends uu{constructor(e,i){var s;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(s=i==null?void 0:i.onRender)!=null?s:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,i=[]){return e.intersectObject(this,!0,i)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,i){this.scale.applyMatrix4(e)}setHelperQuaternion(e,i){lf(this,e,i)}applyHelperQuaternion(e,i){if(i){const s=new R.Vector3().subVectors(this.position,i).applyQuaternion(e).add(i);this.position.copy(s)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class a2 extends Lo{}class l2 extends Lo{}class c2 extends Lo{}class cf extends Lo{}class d2 extends cf{}class h2 extends I.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class ch extends I.Mesh{constructor(e,i,s){super(e,i);f(this,"direction");this.direction=s||"x"}}function u2(n,t){const{offsetWidth:e,offsetHeight:i}=t,{top:s,left:o}=t.getBoundingClientRect();return Object.assign(new I.Vector2,{x:(n.x-o)/e*2-1,y:-(n.y-s)/i*2+1})}function Za(n,t,e){if(!t||!e||!n)return;const i=u2(t,e);if(Math.abs(i.x)===1||Math.abs(i.y)===1)return;const s=new I.Raycaster;return s.setFromCamera(i,n),s}function f2(n,t){return!(Math.abs(n.x-t.x)>1e-5||Math.abs(n.y-t.y)>1e-5||Math.abs(n.z-t.z)>1e-5)}class Rr extends h2{constructor(e){var d;super(e.direction);f(this,"line");f(this,"arrow");f(this,"lineHeight",.4);f(this,"arrowHeight",.1);this.name="ArrowGroup";const i=new I.Color((d=e.color)!=null?d:16214315),s=new I.MeshBasicMaterial({color:i,depthTest:!1,opacity:1,transparent:!0,side:I.DoubleSide}),o=new I.ConeGeometry(.04,.1,32),r=new ch(o,s.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new I.CylinderGeometry(a,a,.4,32),c=new ch(l,s.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const Gr={X:15618642,Y:4765519,Z:4227839};class fn{static get X(){return new I.Color(Gr.X).convertSRGBToLinear().clone()}static get Y(){return new I.Color(Gr.Y).convertSRGBToLinear().clone()}static get Z(){return new I.Color(Gr.Z).convertSRGBToLinear().clone()}}class m2 extends a2{constructor(e){super(e);f(this,"xArrow",new Rr({direction:"x",color:fn.X}));f(this,"yArrow",new Rr({direction:"y",color:fn.Y}));f(this,"zArrow",new Rr({direction:"z",color:fn.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function ji(n,t){return g2(document.createElement(t!=null?t:"div"),n)}function g2(n,t){if(!t)return n;for(const e in t)e&&t[e]&&(n.style[e]=t[e]);return n}function p2(n){const t=ji(G({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"99999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},n)),e=()=>{t.style.display!=="block"&&t.style.top&&t.style.left&&(t.style.display="block")};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(o,r)=>{t.style.left=o,t.style.top=r,e()}}}class A2 extends c2{constructor(e,i){super(e);f(this,"xCircle");f(this,"yCircle");f(this,"zCircle");f(this,"children",[]);f(this,"angleTips");f(this,"container");(i==null?void 0:i.yzCircleEnable)!==!1&&(this.xCircle=new Qr({direction:"x",color:fn.X})),(i==null?void 0:i.xzCircleEnable)!==!1&&(this.yCircle=new Qr({direction:"y",color:fn.Y})),(i==null?void 0:i.xyCircleEnable)!==!1&&(this.zCircle=new Qr({direction:"z",color:fn.Z})),i!=null&&i.container&&(i==null?void 0:i.angleTipsEnable)!==!1&&(this.container=i==null?void 0:i.container,this.angleTips=p2({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(i=>i.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var i;this.hide(),this.children.filter(s=>e.includes(s.direction)).forEach(s=>s.showRing()),(i=this.angleTips)==null||i.show()}dispose(){var e,i;this.removeFromParent(),(i=(e=this.angleTips)==null?void 0:e.element)==null||i.remove()}}class Qr extends I.Group{constructor(e){super();f(this,"direction");f(this,"circle");f(this,"ring");f(this,"angleSector");this.direction=e.direction,this.circle=new v2(e),this.ring=new b2(e),this.angleSector=new y2(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class v2 extends I.Mesh{constructor(e){var i;super();f(this,"direction");f(this,"gapAngle",.02);f(this,"geometry",new I.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new I.MeshBasicMaterial({opacity:.6,color:(i=e.color)!=null?i:16777215,transparent:!0,side:I.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class b2 extends I.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const i=.015,s=new Array(8).fill(null).map((o,r)=>{const a=new I.RingGeometry(.25,.3,20,8,Math.PI/4*r+i,Math.PI/4-i*2),l=new I.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),c=new I.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...s)}}class y2 extends I.Mesh{constructor(e){var s;super();f(this,"direction");f(this,"baseAxes");f(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new I.Vector3(0,0,1);break;case"y":this.baseAxes=new I.Vector3(1,0,0);break;case"z":this.baseAxes=new I.Vector3(1,0,0);break}const i=.3+5e-4;this.geometry=new I.CircleGeometry(i,48,0,1e-4),this.material=new I.MeshBasicMaterial({opacity:.4,color:(s=e.color)!=null?s:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function w2(){const n=ji({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=ji({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=ji({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});n.appendChild(t),t.appendChild(e);const i="-4px",s={direction:"nesw",element:ci({cursor:"nesw-resize",left:i,bottom:i})},o={direction:"ns",element:ci({cursor:"ns-resize",bottom:i})},r={direction:"nwse",element:ci({cursor:"nwse-resize",right:i,bottom:i})},a={direction:"ew",element:ci({cursor:"ew-resize",right:i})},l={direction:"nesw",element:ci({cursor:"nesw-resize",right:i,top:i})},c={direction:"ns",element:ci({cursor:"ns-resize",top:i})},d={direction:"nwse",element:ci({cursor:"nwse-resize",left:i,top:i})},h={direction:"ew",element:ci({cursor:"ew-resize",left:i})};return new Array(o,a,c,h,s,r,l,d).forEach(m=>t.appendChild(m.element)),{container:n,squares:[s,o,r,a,l,c,d,h]}}function ci(n){const t=ji(G({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},n)),e=ji({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),i=ji({width:"15px",height:"15px",cursor:n==null?void 0:n.cursor,pointerEvents:"auto",background:"transparent"});return i.draggable=!0,e.appendChild(i),t.appendChild(e),t}class C2 extends d2{constructor(e,i,s,o){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new mn);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=s,this.scene=o,this.container=i,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var i;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(i=this.plane)==null||i.applyMatrix4(e),this.cornerPositions.forEach(s=>s.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,i){var s;(s=this.plane)==null||s.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((i,s)=>{i.position.copy(e[s])})}applyHelperQuaternion(e,i){var o;const s=(o=this.css3DInstance)==null?void 0:o.css3DObject;if(s){const r=new I.Vector3().subVectors(s.position,i).applyQuaternion(e).add(i);s.position.copy(r),s.applyQuaternion(e)}if(this.plane){const r=new I.Vector3().subVectors(this.plane.position,i).applyQuaternion(e).add(i);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new I.Vector3().subVectors(r,i).applyQuaternion(e).add(i);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;this.enabled&&(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a,l;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const i=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!i)return;this.css3DInstance=i,i.appendToElement(this.container);const s=i.css3DObject.container,{container:o,squares:r}=w2();this.points=r.map((c,d)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[d]})),s.insertBefore(o,(a=s.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("当前物体暂时不支持 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}function df(n){const t=new I.Box3,e=new I.Vector3;if(n.traverse(i=>{var o;if(i.name==="shadow")return;const s=i.geometry;if(s!==void 0)if((o=s==null?void 0:s.attributes)!=null&&o.position){const r=s.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(i.matrix),t.expandByPoint(e)}else s.vertices.forEach(r=>{const a=r.clone().applyMatrix4(i.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class I2 extends l2{constructor(e){super(e);f(this,"box");f(this,"outline");f(this,"originObject");f(this,"positionAttribute");this.originObject=e,this.positionAttribute=new I.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,i){return e.intersectObject(this,!1,i)}raycast(e,i){this.box.raycast(e,i)}update(){const e=df(this.originObject);if(!e)return;const{min:i,max:s}=e;this.positionAttribute.setXYZ(0,s.x,s.y,s.z),this.positionAttribute.setXYZ(1,i.x,s.y,s.z),this.positionAttribute.setXYZ(2,i.x,i.y,s.z),this.positionAttribute.setXYZ(3,s.x,i.y,s.z),this.positionAttribute.setXYZ(4,s.x,s.y,i.z),this.positionAttribute.setXYZ(5,i.x,s.y,i.z),this.positionAttribute.setXYZ(6,i.x,i.y,i.z),this.positionAttribute.setXYZ(7,s.x,i.y,i.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new I.BufferGeometry;i.setIndex(new I.BufferAttribute(e,1)),i.setAttribute("position",this.positionAttribute);const s=new I.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),o=new I.LineSegments(i,s);return o.matrixAutoUpdate=!1,o}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),i=new I.BufferGeometry;i.setIndex(new I.BufferAttribute(e,1)),i.setAttribute("position",this.positionAttribute);const s=new I.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new I.Mesh(i,s)}}class hs{constructor(t,e){f(this,"originObject3D");f(this,"hooks");f(this,"disposers",[]);f(this,"helperObject3D");f(this,"camera");f(this,"model");f(this,"scene");f(this,"container");f(this,"domEvents");f(this,"isDragging",!1);f(this,"enabled",!1);f(this,"name","BaseController");f(this,"boundingBox");f(this,"offset");f(this,"onRender");f(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,d;this.hooks=(c=t.sharedHooks)!=null?c:new Ri,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new Te(t.camera,t.container),this.onRender=(d=t.onRender)!=null?d:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const i=(...h)=>this.onSetOriginObjectScale(...h),s=(...h)=>this.onSetOriginObjectRotate(...h),o=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",i),this.hooks.on("setObjectRotate",s),this.hooks.on("setObjectPosition",o),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",i),this.hooks.off("setObjectRotate",s),this.hooks.off("setObjectPosition",o),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){this.enabled&&(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,i){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,i=new I.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),s=new I.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),o=this.calculateOffset(this.offset,{min:s,max:i});this.helperObject3D.position.copy(o),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,i=1){const s=(Array.isArray(t)?t:[t]).filter(ni),o=[];for(const r of s)if(r instanceof I.Mesh||r instanceof I.Group){const a=r instanceof I.Group?r.children.filter(u=>u instanceof I.Mesh):[r];a.forEach(u=>{u.__originalColor__=u.material.color.clone(),u.__originalOpacity__=u.material.opacity});const l=()=>{a.forEach(u=>{u.material.color.set(e),u.material.opacity=i}),this.render()},c=()=>{a.forEach(u=>{u.material.color.copy(u.__originalColor__),u.material.opacity=u.__originalOpacity__}),this.render()},d=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const u of a)this.domEvents.addEventListener(u,"mouseover",d),this.domEvents.addEventListener(u,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),o.push(()=>{this.domEvents.removeEventListener(u,"mouseover",d),this.domEvents.removeEventListener(u,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>o.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,i=this.helperObject3D;if(!i)return;const s=this.helperObject3D.raycasterIntersectObject(t)[0];if(!s)return;const o=s;if(o.object=i,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}calculateOffset(t,e){const i=this.originObject3D,s=new I.Vector3(0,0,0);if(!t)return s;const o=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=df(i),this.boundingBox));if(typeof t.x=="number")s.setX(t.x);else if(typeof t.x=="object"){const r=o();s.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")s.setY(t.y);else if(typeof t.y=="object"){const r=o();s.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")s.setZ(t.z);else if(typeof t.z=="object"){const r=o();s.setZ((r.max.z-r.min.z)*t.z.percents)}return s}}class P2 extends hs{constructor(...e){super(...e);f(this,"name","MoveController");f(this,"startInfo");f(this,"_moveByMouseEnable",!1);f(this,"mouseInfo");f(this,"mousedownEventListenerDisposer");const i=this.helperObject3D;this.hoverListener([i.xArrow,i.yArrow,i.zArrow]);const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(i=>i==null?void 0:i())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),i=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",i)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",i)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:i,y:s}=e;this.mouseInfo={x:i,y:s,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:i,y:s}=e;this.mouseInfo.x===i&&this.mouseInfo.y===s&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const i=e==null?void 0:e.intersect;if(!i)return this.dragEnd();const s=(i==null?void 0:i.object).direction;if(!s)return this.dragEnd();const o=new I.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new I.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new I.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(s){case"x":return o;case"y":return r;case"z":return a}})(),c=(()=>{switch(s){case"x":case"y":return a;case"z":return o}})(),d=i.point.clone(),h=new I.Plane;h.setFromNormalAndCoplanarPoint(c,d),this.startInfo={startVectorProject:d.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const i=Za(this.camera,e,this.container);return i?(this.move(i),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:i,directionVector:s,startVectorProject:o}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(i,new I.Vector3);if(!a)return;const l=a.clone().projectOnVector(s),c=l.clone().sub(o),d=new I.Matrix4;d.setPosition(c);const h=r.position.clone().applyMatrix4(d);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(d),o.copy(l),this.hooks.emit("applyObjectPosition",{matrix:d}),this.hooks.emit("move",h))}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class Zn{constructor(t,e,i,s,o,r){f(this,"helperController");f(this,"five");f(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});f(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});f(this,"onFiveIntersectionOnModelUpdate",(...t)=>{this.helperController&&this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,d=t.getElement();if(this.five=t,!a||!l||!d||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:i,helperObject3D:s,container:d,scene:c,onRender:h,sharedHooks:r},o),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const E2="v1.0.1",M2="Object3DHelper",qa=`${M2}@${E2}`,k2=()=>{console.error(`${qa} is disposed`)},x2=()=>{console.warn(`${qa} is disabled`)},D2=()=>{console.error(`${qa} is disabled`)};class S2{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new Ri);f(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return F(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return F(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return k2();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return D2();const i=G({},this.state);this.state=G(G({},this.state),t),t.disposed!==void 0&&t.disposed!==i.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:i})}addControllers(t){this.controllers=G(G({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(i=>{i.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(i=>{i.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(i=>{i.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(i=>{i.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(i=>{i==null||i.dispose()});for(const i in this.controllers){if(!i)continue;const s=i;(e=(t=this.eventListener)[s])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&x2()}}function Nr(n){return n*Math.PI/180}class T2 extends hs{constructor(...e){var c,d,h;super(...e);f(this,"name","RotateController");f(this,"startInfo");f(this,"removeListener");const i=this.helperObject3D;this.hoverListener([(c=i.xCircle)==null?void 0:c.circle,(d=i.yCircle)==null?void 0:d.circle,(h=i.zCircle)==null?void 0:h.circle].filter(Boolean));const s=this.dragStart.bind(this),o=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",s),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:i=0,y:s=0,z:o=0}=e,r=new I.Euler(Nr(i),Nr(s),Nr(o)),a=new I.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:d}=this;lf(c,a,d),this.hooks.emit("setObjectRotate",a,d),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const i=e==null?void 0:e.intersect;if(!i)return this.dragEnd();const s=(i==null?void 0:i.object).direction;if(!s)return this.dragEnd();const o=i.point,r=this.getAngleHelper(s);this.setTipsAngle(0);const a=o.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(s==="x")return new I.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(s==="y")return new I.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(s==="z")return new I.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new I.Plane().setFromNormalAndCoplanarPoint(l,o),h=c.projectPoint(o.clone(),new I.Vector3).clone().sub(this.rotateCenter),u=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(s,u),this.setAngleHelperLength(s,0),this.startInfo={direction:s,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const i=Za(this.camera,e,this.container);return i?(this.rotate(i),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:i,plane:s,angleHelper:o,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(s,new I.Vector3);if(!c)return;const d=this.rotateCenter.clone(),u=s.projectPoint(c.clone(),new I.Vector3).clone().sub(d);if(i.angleTo(u)===0)return;const m=new I.Quaternion().setFromUnitVectors(i.clone().normalize(),u.clone().normalize()),A=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",A))return;const v=new I.Euler().setFromQuaternion(new I.Quaternion().setFromUnitVectors(i.clone().normalize().applyQuaternion(a.clone().inverse()),u.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*o.angleDirection;if(this.startInfo.angle+=v,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle($h(this.startInfo.angle)),d){const y=new I.Vector3().subVectors(l.position,d).applyQuaternion(m).add(d);l.position.copy(y)}l.applyQuaternion(m),this.hooks.emit("applyObjectRotate",{quaternion:m,origin:d}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=u}dragEnd(){this.isDragging&&(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var i,s,o;switch(e){case"x":return(i=this.helperObject3D.xCircle)==null?void 0:i.angleSector;case"y":return(s=this.helperObject3D.yCircle)==null?void 0:s.angleSector;case"z":return(o=this.helperObject3D.zCircle)==null?void 0:o.angleSector}}setAngleHelperStart(e,i){const s=this.getAngleHelper(e);if(!s){console.warn("angleHelper is undefined");return}if(s instanceof I.Mesh&&s.geometry instanceof I.CircleGeometry){const{radius:o,segments:r,thetaLength:a}=s.geometry.parameters;s.geometry=new I.CircleGeometry(o,r,i,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,i){const o=i>=0?Math.max(i,.001):Math.min(i,-.001),r=this.getAngleHelper(e);if(r instanceof I.Mesh&&r.geometry instanceof I.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(o)*(40/(2*Math.PI)));r.geometry=new I.CircleGeometry(a,c,l,o)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var s;const i=(s=this.helperObject3D.angleTips)==null?void 0:s.element;i&&(i.innerText=`${e.toFixed(0)}°`)}setTipsPosition(e){const i=this.helperObject3D.angleTips;if(!i)return;const s=e.project(this.camera),{x:o,y:r,z:a}=s;if(a>1)return;const l=(o+1)/2*100+"%",c=(-r+1)/2*100+"%";i.setLeftTop(l,c)}}class L2 extends hs{constructor(...e){super(...e);f(this,"startInfo");f(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new I.Plane,i=this.helperObject3D.cornerPositions;if(i.length!==0)return i.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new R.Vector3),i[0]):e.setFromCoplanarPoints(i[0],i[1],i[2]),e}dragStart(e,i){var o,r;(r=(o=this.helperObject3D).updatePoints)==null||r.call(o);const s=this.getDragPlane();if(!s)return this.dragEnd();this.startInfo={startPoint:{position:i.position.clone(),direction:i.direction},plane:s},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const i=Za(this.camera,e,this.container);if(!i)return this.dragEnd();this.scale(i)}scale(e){var X,Y;if(!this.startInfo)return;const i=this.originObject3D,{startPoint:s,plane:o}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(o,new R.Vector3);if(!a||f2(a,this.camera.position))return;const l=new R.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:d}=s,h=new R.Vector3().subVectors(r[1],r[0]),u=new R.Vector3().subVectors(r[3],r[0]),m=N=>{const H=new R.Vector3(0,0,0);if(!this.startInfo)return H;const _=(N==="ew"?h:u).clone(),Q=c.clone().projectOnVector(_),W=a.clone().projectOnVector(_),Z=l.clone().projectOnVector(_);if(W.equals(Q))return H;if(N==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const ce=new R.Vector3().subVectors(W,Z),oe=ce.x<0&&_.x>=0,we=ce.y<0&&_.y>=0,Ce=ce.z<0&&_.z>=0;this.startInfo.dragPointInCenterBottom=oe||we||Ce}if(N==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const ce=new R.Vector3().subVectors(W,Z),oe=ce.x<0&&_.x>=0,we=ce.y<0&&_.y>=0,Ce=ce.z<0&&_.z>=0;this.startInfo.dragPointInCenterLeft=oe||we||Ce}const J=new R.Vector3().subVectors(W,Q),ee=J.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),H):J},A=m("ew"),p=m("ns"),g=()=>{const N=A;this.helperObject3D.cornerPositions.forEach((H,_)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterLeft?(_===0||_===3)&&H.add(N):(_===1||_===2)&&H.add(N)})},v=()=>{const N=p;this.helperObject3D.cornerPositions.forEach((H,_)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterBottom?(_===0||_===1)&&H.add(N):(_===2||_===3)&&H.add(N)})};switch(d){case"ew":g();break;case"ns":v();break;case"nesw":case"nwse":g(),v()}const y=new R.Vector3().subVectors(r[1],r[0]).length()/h.length(),P=new R.Vector3().subVectors(r[3],r[0]).length()/u.length(),M=new R.Vector3(y,P,1),B=new I.Matrix4().scale(M);i.isCSS3DObjectPlus?i.applyScaleMatrix4(B):i.scale.applyMatrix4(B),s.position.copy(a);const E=new R.Vector3().addVectors(r[0],r[2]).divideScalar(2),V=new R.Vector3().subVectors(E,l),j=new I.Matrix4().setPosition(V);i.applyMatrix4(j),(X=this.helperObject3D.css3DInstance)==null||X.css3DObject.applyMatrix4(j),(Y=this.helperObject3D.plane)==null||Y.applyMatrix4(j),this.hooks.emit("applyObjectScale",{matrix:B}),this.hooks.emit("applyObjectPosition",{matrix:j}),this.render()}dragEnd(){this.isDragging&&(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class j2 extends L2{constructor(...e){super(...e);f(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const i=e.point,s=a=>this.dragStart(a,e),o=this.dragging.bind(this),r=this.dragEnd.bind(this);i.addEventListener("dragstart",s),i.addEventListener("drag",o),i.addEventListener("dragend",r)})}}class z2 extends hs{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class O2 extends cf{constructor(t){super(t)}}class B2 extends hs{constructor(...e){super(...e);f(this,"name","ScaleController")}setScale(e){var l,c,d;let i=1,s=1,o=1;typeof e=="number"?(i=e,s=e,o=e):typeof e=="object"&&(i=(l=e.x)!=null?l:1,s=(c=e.y)!=null?c:1,o=(d=e.z)!=null?d:1);const r=new I.Vector3(i,s,o);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}const ha="Object3DHelperPlugin",jo=ha,V2=()=>{console.error(`${jo} is disposed`)},R2=()=>{console.warn(`${jo} is disabled`)},G2=()=>{console.error(`${jo} is disabled`)};class hf extends cs{constructor(e){super(e);f(this,"name",ha);f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"objectHelperMap",new Map);f(this,"css3DObjectParentMap",new Map);f(this,"css3DRender");this.five=e,this.css3DRender=new mn(this.five.scene),console.warn("Object3DHelper: 使用此插件,需要在初始化five时,设置five参数: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${ha.toUpperCase()}_DEBUG__`]:this})}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,i){if(this.state.disposed)return V2();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return G2();const s=G({},this.state);this.state=G(G({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:s})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,i={}){var m;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const s=new S2,o=[],r=(m=this.five.getElement())==null?void 0:m.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:d=!0,boundingBoxHelper:h=!1}=i,u=new Le.Subscribe;if(l){const A=new m2(e),p=this.getConfig(i.moveHelper),g=new Zn(this.five,P2,e,A,p,u);s.addControllers({moveController:g.helperController}),o.push(()=>g.dispose())}if(c){const A=this.getConfig(i.rotateHelper),p=new A2(e,G({container:r},A)),g=new Zn(this.five,T2,e,p,A,u);s.addControllers({rotateController:g.helperController}),o.push(()=>g.dispose())}if(h){const A=new I2(e),p=new Zn(this.five,z2,e,A,void 0,u);s.addControllers({boundingBoxController:p.helperController})}if(d)if(e.isCSS3DObjectPlus&&r){const A=new C2(e,r,a,this.five.scene),p=new Zn(this.five,j2,e,A,void 0,u);s.addControllers({scaleController:p.helperController}),o.push(()=>p.dispose()),yh(this.five).then(()=>{var g,v;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const P=(g=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?g:wh(this.five);P&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(P),(v=this.css3DRender.getBehindCSS3DObjectGroup())==null||v.add(y),this.css3DRender.render(this.five.camera))}})}else{const A=new O2(e),p=new Zn(this.five,B2,e,A,void 0,u);s.addControllers({scaleController:p.helperController}),o.push(()=>p.dispose())}return this.objectHelperMap.set(e,{helper:s,disposers:o}),s.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:i,disposers:s}=this.objectHelperMap.get(e);if(i){if(e.isCSS3DObjectPlus){const o=e,r=this.css3DObjectParentMap.get(o);r&&r.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),i.dispose(),s==null||s.forEach(o=>o==null?void 0:o())}}handleEnable(e,i=!0){e?(this.everyHelperDo(s=>s.enable()),this.hooks.emit("enable",{userAction:i})):(this.everyHelperDo(s=>s.disable()),this.hooks.emit("disable",{userAction:i})),this.state.enabled=e}handleVisible(e,i=!0){e?(this.everyHelperDo(s=>s.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:i}))):(this.everyHelperDo(s=>s.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:i}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:i})=>{e.dispose(),i==null||i.forEach(s=>s==null?void 0:s())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:i,disposers:s})=>{i&&e(i)})}actionIfStateIsEnabled(e,i){if(this.state.enabled)return e();i!=null&&i.warnLog&&R2()}getConfig(e){if(e&&typeof e!="boolean"&&e.enable)return e}}const Q2=n=>new hf(n),N2=`
|
|
670
670
|
varying vec2 vUv;
|
|
671
671
|
void main() {
|
|
672
672
|
vUv = uv;
|