@hatiolab/things-scene 10.0.0-beta.51 → 10.0.0-beta.52
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/things-scene-min.js
CHANGED
|
@@ -69,5 +69,5 @@ const jp=globalThis,Fp=t=>t,Bp=jp.trustedTypes,Np=Bp?Bp.createPolicy("lit-html",
|
|
|
69
69
|
</button>`:of}
|
|
70
70
|
${n?rf`<button class="closable" @click=${this.closeContainer}>close</button>`:of}
|
|
71
71
|
</div>
|
|
72
|
-
`,this.element)}catch(t){}}onchangeMinimized(){const{minimized:t}=this.state;t?this.setState("height",24):this.setState("height",this.get("height"))}}kf=new WeakMap,Ha.memoize(Df.prototype,"bounds",!0),Ha.register("container",Df);const Of=Math.sqrt(3),zf=2;function If(t,e,n,r,i){const s=5+i,o=n.x,a=n.y,c=r.x,l=r.y;if(Math.abs(o-c)>s&&Math.abs(a-l)>s){const n=(l-a)/(c-o),r=a-n*o;if(Math.abs(e-(n*t+r))>s)return!1}let h,d,u,p;return o>c?(d=o,h=c):(d=c,h=o),a>l?(p=a,u=l):(p=l,u=a),!(d+5<t)&&(!(h-5>t)&&(!(p+5<e)&&!(u-5>e)))}function Lf(t,e,n,r=2){for(let i=0;i<n.length-1;i++)if(If(t,e,n[i],n[i+1],r))return!0;return!1}function Rf(t,e,n,r){if("arrow"!=t.slice(-5))return n;const i=Math.atan2(r.y-n.y,r.x-n.x),s=1.5*e;return{x:n.x+Math.cos(i)*s,y:n.y+Math.sin(i)*s}}function jf(t,e,n){let{lineWidth:r=zf,strokeStyle:i="#000000",lineCap:s=!1,alpha:o=1,begin:a="none",end:c="none",beginSize:l="size5",endSize:h="size5"}=n;if(("none"!=a||"none"!=c)&&(r=Number(r)||zf,t.lineCap=s,t.lineWidth=r,t.strokeStyle=i,t.fillStyle=i,t.globalAlpha*=o,"none"!=a&&Ff(t,e[0],e[1],r,a,Bf(l,r)),"none"!=c)){const n=e.length;Ff(t,e[n-1],e[n-2],r,c,Bf(h,r))}}function Ff(t,e,n,r,i,s){const{x:o,y:a}=e,c=Math.atan2(n.y-a,n.x-o);switch(t.beginPath(),t.translate(o,a),t.rotate(c),i){case"oval":t.ellipse(0,0,s.X,s.Y,0,0,2*Math.PI),t.fill();break;case"diamond":t.moveTo(-s.X,0),t.lineTo(0,-s.Y),t.lineTo(s.X,0),t.lineTo(0,s.Y),t.fill();break;case"arrow":t.moveTo(0,0),t.lineTo(Of*s.X,-s.Y),t.lineTo(Of*s.X,s.Y),t.fill();break;case"sharp-arrow":t.moveTo(0,0),t.lineTo(Of*s.X,-s.Y),t.lineTo(-s.X/1.5+Of*s.X,0),t.lineTo(Of*s.X,s.Y),t.fill();break;case"open-arrow":t.moveTo(Of*s.X+r,-s.Y),t.lineTo(r,0),t.lineTo(Of*s.X+r,s.Y),t.stroke();break;case"cross":t.moveTo(-s.X,-s.Y),t.lineTo(s.X,s.Y),t.moveTo(s.X,-s.Y),t.lineTo(-s.X,s.Y),t.stroke()}t.rotate(-c),t.translate(-o,-a),t.closePath()}function Bf(t,e){const n={X:0,Y:0};switch(e*=1.2,t){case"size1":n.X=e,n.Y=e;break;case"size2":n.X=1.5*e,n.Y=e;break;case"size3":n.X=2*e,n.Y=e;break;case"size4":n.X=e,n.Y=1.5*e;break;case"size5":default:n.X=1.5*e,n.Y=1.5*e;break;case"size6":n.X=2*e,n.Y=1.5*e;break;case"size7":n.X=e,n.Y=2*e;break;case"size8":n.X=1.5*e,n.Y=2*e;break;case"size9":n.X=2*e,n.Y=2*e}return n}const Nf="N",Hf="S",Vf="E",Gf="W";class Yf{constructor({component:t,anchor:e,position:n,self:r}){this.component=t,this._anchorName=e,this._position=n,this.self=r}get position(){const t=this.anchor;if(t){const{position:e}=t,n=this.component.toScene(e.x,e.y);return this.self.transcoordT2P(n.x,n.y)}return this._position}set position({x:t,y:e}){this._position={x:t,y:e}}get anchor(){return this.component?.findAnchor(this._anchorName)}get direction(){const t=this.component.bounds,e=this.anchor;if(!e)return Vf;const n=e.position;return n.y<=t.top?Nf:n.y>=t.top+t.height?Hf:n.x<=t.left?Gf:Vf}get boundaryPosition(){const t=this.anchor;if(t){let{position:e}=t,n=0,r=0;switch(this.direction){case Hf:r=20;break;case Nf:r=-20;break;case Gf:n=-20;break;default:n=20}e={x:e.x+n,y:e.y+r};const i=this.component.toScene(e.x,e.y);return this.self.transcoordT2P(i.x,i.y)}}}class Uf extends Ha{isLine(){return!0}replaceRefids(t){["from","to"].forEach(e=>{const n=this.get(e);if(n?.component){const r=t.get(n.component)||n.component;this.set(e,{...n,component:r})}})}get fromEnd(){if(this.parent&&!this._fromEnd){const{component:t,anchor:e,position:n}=this.getState("from")||{};if(!t)return;const r=this.root?.findByRefid?.(t);if(!r)return;this._fromEnd=new Yf({component:r,fromto:"from",anchor:e,position:n,self:this})}return this._fromEnd}get from(){return this.getState("from")}set from(t){delete this._fromEnd,this.set("from",t)}get toEnd(){if(this.parent&&!this._toEnd){const{component:t,anchor:e,position:n}=this.getState("to")||{};if(!t)return;const r=this.root?.findByRefid?.(t);if(!r)return;this._toEnd=new Yf({component:r,fromto:"to",anchor:e,position:n,self:this})}return this._toEnd}get to(){return this.getState("to")}set to(t){delete this._toEnd,this.set("to",t)}move({x:t,y:e},n){n&&(this.from={position:this._fromEnd?.position||this.getState("from")?.position||{x:0,y:0}},this.to={position:this._toEnd?.position||this.getState("to")?.position||{x:0,y:0}}),super.move({x:t,y:e})}render(t){const{begin:e="none",end:n="none",lineWidth:r,round:i=0}=this.state;let s=this.drawPath;jf(t,s,this.state),t.beginPath();const o=Rf(e,r,s[0],s[1]),a=Rf(n,r,s[s.length-1],s[s.length-2]);s=[o,...s.slice(1,-1),a];let c={x:o.x,y:o.y};t.moveTo(o.x,o.y);for(let e=1;e<s.length;e++){const n=c;c=s[e];const r=s[e+1];if(n.x===c.x&&n.y===c.y)continue;if(!r){t.lineTo(c.x,c.y);break}let o=Math.sqrt((n.x-c.x)*(n.x-c.x)+(n.y-c.y)*(n.y-c.y)),a=0!==o?Math.atan2(n.x-c.x,n.y-c.y):0,l=Math.sin(a)*Math.min(i,o/2)+c.x,h=Math.cos(a)*Math.min(i,o/2)+c.y;const d=i>0||0!==o?{x:l,y:h}:c;o=Math.sqrt((r.x-c.x)*(r.x-c.x)+(r.y-c.y)*(r.y-c.y)),a=0!==o?Math.atan2(r.x-c.x,r.y-c.y):0,l=Math.sin(a)*Math.min(i,o/2)+c.x,h=Math.cos(a)*Math.min(i,o/2)+c.y;const u=i>0||0!==o?{x:l,y:h}:c;t.lineTo(d.x,d.y),i>0&&t.quadraticCurveTo(c.x,c.y,u.x,u.y)}this.drawStroke(t,void 0)}contains(t,e){const{lineWidth:n}=this.state;return Lf(t,e,this.drawPath,n)}get resizable(){return!1}get mutable(){return!0}get rotatable(){return!1}get path(){const{from:t,to:e}=this.state,{x1:n,y1:r,x2:i,y2:s}=this.state;return[this.fromEnd?.position||t?.position||{x:n,y:r},this.toEnd?.position||e?.position||{x:i,y:s}]}set path(t){const[e,n]=t,{from:r,to:i}=this.state;delete this._fromEnd,delete this._toEnd,this.set({from:{...r,position:e},to:{...i,position:n}})}get textBounds(){const t=this.drawPath;let e,n,r=0;for(let i=1;i<t.length;i++){const s=t[i-1],o=t[i],a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y);a>r&&(r=Math.ceil(a),e=s,n=o)}let{paddingTop:i,paddingLeft:s,paddingRight:o,paddingBottom:a}=this.state;return a||=0,i||=0,s||=0,o||=0,{left:Math.min(e.x,n.x)+s,top:Math.min(e.y,n.y)+i,width:Math.max(Math.abs(e.x-n.x)-s-o,0),height:Math.max(Math.abs(e.y-n.y)-i-a,0)}}get decorators(){return this.app.isEditMode?["decotag"]:[]}}Uf.getTipNeckPos=Rf,Uf.containedInPath=Lf,Uf.drawEndTips=jf,Ha.register("line",Uf);const $f={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"angle",label:"start-angle",name:"startAngle",property:"startAngle"},{type:"angle",label:"end-angle",name:"endAngle",property:"endAngle"}],"value-property":"text"};class Wf extends(gd(Va)){is3dish(){return!0}render(t){const{cx:e,cy:n,rx:r,ry:i,startAngle:s,endAngle:o,anticlockwise:a}=this.state;t.beginPath(),t.ellipse(e,n,Math.abs(r),Math.abs(i),0,s||0,o||2*Math.PI,a),void 0!==s&&void 0!==o&&(t.lineTo(e,n),t.closePath())}get path(){const{cx:t,cy:e,rx:n,ry:r}=this.state;return[{x:t-n,y:e-r},{x:t+n,y:e-r},{x:t+n,y:e+r},{x:t-n,y:e+r}]}set path(t){const e=t[0],n=t[2];this.set({cx:e.x+(n.x-e.x)/2,cy:e.y+(n.y-e.y)/2,rx:(n.x-e.x)/2,ry:(n.y-e.y)/2})}contains(t,e){const{cx:n,cy:r,rx:i,ry:s}=this.state,o=(t-n)/(2*i-.5),a=(e-r)/(2*s-.5);return o*o+a*a<.25}outline(t){return function(t,e){const{cx:n,cy:r,rx:i,ry:s}=t.model,o=2*Math.PI*e,a=n+i*Math.cos(o),c=r+s*Math.sin(o);return t.toScene(a,c)}(this,t)}get anchors(){return function(t){const{left:e,top:n,width:r,height:i}=t.bounds,s=e+r/2,o=n+i/2;return[{name:"TOP",position:{x:s,y:n}},{name:"RIGHT",position:{x:e+r,y:o}},{name:"BOTTOM",position:{x:s,y:n+i}},{name:"LEFT",position:{x:e,y:o}}]}(this)}get nature(){return $f}}Ha.memoize(Wf.prototype,"path",!1),Ha.register("ellipse",Wf);const qf={ondragstart:function(t,e,n){n.mutatePath(null,function(n){n.splice(e+1,0,t)})},ondragmove:function(t,e,n){n.mutatePath(null,function(n){n[e+1]=t})},ondragend:function(t,e,n){}},Xf={mutable:!0,resizable:!1,rotatable:!0,properties:[{type:"number",label:"round",name:"round",property:{min:0,max:100,step:1}}],help:"scene/component/polygon"};class Kf extends Va{is3dish(){return!0}get mutable(){return!0}get pathExtendable(){return!0}get path(){return this.state.path}set path(t){this.set("path",t)}contains(t,e){const n=this.state.path;let r=!1;return n.forEach((i,s)=>{const o=(s+n.length+1)%n.length,a=i.x,c=i.y,l=n[o].x,h=n[o].y;c>e!=h>e&&t<(l-a)*(e-c)/(h-c)+a&&(r=!r)}),r}get controls(){const t=this.path;return t.map((e,n)=>{const r=t[n+1>=t.length?0:n+1];return{x:(e.x+r.x)/2,y:(e.y+r.y)/2,handler:qf}})}get nature(){return Xf}}Ha.memoize(Kf.prototype,"controls",!1),Ha.register("polygon",Kf);const Qf={ondragstart:function(t,e,n){n.mutatePath(null,function(n){n.splice(e,0,t)})},ondragmove:function(t,e,n){n.mutatePath(null,function(n){n[e]=t})},ondragend:function(t,e,n){}},Zf={mutable:!1,resizable:!1,rotatable:!1,properties:[{type:"number",label:"round",name:"round",property:{min:0,max:100,step:1}}],help:"scene/component/polyline"};class Jf extends Uf{get pathExtendable(){return!0}get path(){const{from:t,to:e}=this.state,{path:n}=this.state;return[this.fromEnd?.position||t?.position||n[0],...n.slice(1,-1),this.toEnd?.position||e?.position||n[n.length-1]]}set path(t){const{from:e,to:n}=this.state;delete this._fromEnd,delete this._toEnd,this.set({from:{...e,position:t[0]},to:{...n,position:t[t.length-1]},path:t})}get controls(){const t=this.path,e=[];for(let n=0;n<t.length-1;n++){const r=t[n],i=t[n+1];0==n&&e.push({x:r.x,y:r.y,handler:Qf}),e.push({x:(r.x+i.x)/2,y:(r.y+i.y)/2,handler:Qf}),n==t.length-2&&e.push({x:i.x,y:i.y,handler:Qf})}return e}get nature(){return Zf}}Ha.register("polyline",Jf);const tg={mutable:!1,resizable:!1,rotatable:!1,properties:[{type:"number",label:"round",name:"round",property:{min:0,max:100,step:1}}],help:"scene/component/ortholine"};class eg extends Uf{get pathExtendable(){return!1}get drawPath(){const t=this.path[0],e=this.path[1],{component:n,direction:r,boundaryPosition:i=t}=this.fromEnd||{},{component:s,direction:o,boundaryPosition:a=e}=this.toEnd||{},c=[i,a],l=[];i&&l.push(i);let h,d=n?.bounds;d&&(h=n.toScene(d.left,d.top),h=this.transcoordT2P(h.x,h.y),d={...d,left:h.x,top:h.y});const u=d?{left:d.left-20,top:d.top-20,width:d.width+40,height:d.height+40}:{left:i.x,top:i.y,width:0,height:0};d=d||u;let p=s?.bounds;p&&(h=s.toScene(p.left,p.top),h=this.transcoordT2P(h.x,h.y),p={...p,left:h.x,top:h.y});const f=p?{left:p.left-20,top:p.top-20,width:p.width+40,height:p.height+40}:{left:a.x,top:a.y,width:0,height:0};p=p||f;const g=[u,f],m=u.left>f.left?f.left:u.left,y=u.top>f.top?f.top:u.top,b={left:m,top:y,width:u.left+u.width>f.left+f.width?u.left+u.width-m:f.left+f.width-m,height:u.top+u.height>f.top+f.height?u.top+u.height-y:f.top+f.height-y};let v,_,x,w,M,S,A,E,k,C,T=0,P=0;d.left+d.width<p.left?(w=0,M=1,k=r,C=o,v=(d.left+d.width+p.left)/2,T=p.left-v):p.left+p.width<d.left&&(w=1,M=0,k=o,C=r,v=(d.left+p.width+p.left)/2,T=d.left-v),d.top+d.height<p.top?(x=0,S=1,A=r,E=o,_=(d.top+d.height+p.top)/2,P=p.top-_):p.top+p.height<d.top&&(x=1,S=0,A=o,E=r,_=(d.top+p.height+p.top)/2,P=d.top-_);const D=[];if(v&&T>P){let t,e,n;switch(C){case Gf:switch(k){case Vf:D.push({x:v,y:c[w].y}),D.push({x:v,y:c[M].y});break;case Gf:t=g[w].top+g[w].height/2,e=t>c[M].y?Math.min(g[w].top,c[M].y):Math.max(g[w].top+g[w].height,c[M].y),D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:c[M].y});break;case Nf:case Hf:e=k===Hf?Math.max(c[w].y,c[M].y):Math.min(c[w].y,c[M].y),D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:c[M].y});break;default:return this.path}break;case Vf:switch(k){case Vf:e=c[w].y<c[M].y?Math.min(g[M].top,c[w].y):Math.max(g[M].top+g[M].height,c[w].y),n=e;break;case Gf:e=void 0!==_?_:c[w].y<c[M].y?b.top-.5*T:b.top+b.height+.5*T,n=e;break;case Hf:e=void 0!==_?Math.max(_,c[w].y):b.top+b.height,n=e;break;case Nf:e=_?Math.min(_,g[w].top):b.top,n=e;break;default:return this.path}D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:n}),D.push({x:c[M].x,y:n});break;case Hf:switch(k){case Vf:e=c[w].y,n=c[w].y>c[M].y?c[w].y:g[M].top+g[M].height;break;case Gf:e=_?Math.max(_,g[M].top+g[M].height):b.top+b.height,n=e;break;case Hf:e=b.top+b.height,n=e;break;case Nf:e=_?Math.min(_,g[w].top):g[w].top,n=_?Math.max(_,g[M].top+g[M].height):g[M].top+g[M].height;break;default:return this.path}D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:n}),D.push({x:c[M].x,y:n});break;case Nf:switch(k){case Vf:e=c[w].y,n=c[w].y<c[M].y?c[w].y:g[M].top;break;case Gf:e=_?Math.min(_,g[M].top):b.top,n=e;break;case Hf:e=void 0!==_?Math.max(_,c[w].y):c[w].y,n=void 0!==_?Math.min(_,c[M].y):c[M].y;break;case Nf:e=b.top,n=e;break;default:return this.path}D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:n}),D.push({x:c[M].x,y:n});break;default:return this.path}l.push(...0===w?D:D.reverse())}else if(_){let t,e,n;switch(E){case Nf:switch(A){case Hf:D.push({x:c[x].x,y:_}),D.push({x:c[S].x,y:_});break;case Nf:t=g[x].left+g[x].width/2,e=t>c[S].x?Math.min(g[x].left,c[S].x):Math.max(g[x].left+g[x].width,c[S].x),D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:c[S].x,y:_});break;case Gf:e=Math.min(c[x].x,c[S].x),D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:c[S].x,y:_});break;case Vf:e=Math.max(c[x].x,c[S].x),D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:c[S].x,y:_});break;default:return this.path}break;case Hf:switch(A){case Gf:e=b.left,n=e;break;case Vf:e=void 0!==v?Math.max(v,c[x].x):b.left+b.width,n=e;break;case Nf:e=void 0!==v?v:c[x].x<c[S].x?b.left-.5*P:b.left+b.width+.5*P,n=e;break;case Hf:e=c[x].x,n=c[x].x<c[S].x?Math.min(g[S].left,c[x].x):Math.max(g[S].left+g[S].width,c[x].x);break;default:return this.path}D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:n,y:_}),D.push({x:n,y:c[S].y});break;case Vf:switch(A){case Gf:e=void 0!==v?Math.min(v,c[x].x):c[x].x,n=void 0!==v?Math.max(v,c[S].x):c[S].x;break;case Vf:e=b.left+b.width,n=e;break;case Nf:e=void 0!==v?Math.max(v,c[S].x):b.left+b.width,n=e;break;case Hf:e=c[x].x,n=Math.max(g[S].left+g[S].width,c[x].x);break;default:return this.path}D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:n,y:_}),D.push({x:n,y:c[S].y});break;case Gf:switch(A){case Gf:e=b.left,n=e;break;case Vf:e=void 0!==v?Math.max(v,c[x].x):c[x].x,n=void 0!==v?Math.min(v,c[S].x):c[S].x;break;case Nf:e=b.left,n=e;break;case Hf:e=c[x].x<c[S].x?Math.min(g[S].left,c[x].x):c[x].x,n=Math.min(e,c[S].x);break;default:return this.path}D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:n,y:_}),D.push({x:n,y:c[S].y});break;default:return this.path}l.push(...0===x?D:D.reverse())}else{let t,e;switch(r){case Nf:switch(o){case Nf:e=b.top,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;case Hf:t=b.left+b.width,l.push({x:t,y:c[0].y}),l.push({x:t,y:b.top+b.height}),l.push({x:c[1].x,y:b.top+b.height});break;case Vf:t=c[1].y<c[0].y&&c[1].x<c[0].x?c[0].x:b.left+b.width,l.push({x:t,y:c[0].y}),l.push({x:t,y:c[1].y});break;case Gf:t=b.left,l.push({x:t,y:c[0].y}),l.push({x:t,y:c[1].y});break;default:return this.path}break;case Hf:switch(o){case Nf:t=b.left+b.width,l.push({x:t,y:c[0].y}),l.push({x:t,y:b.top}),l.push({x:c[1].x,y:b.top});break;case Hf:case Vf:case Gf:e=b.top+b.height,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;default:return this.path}break;case Gf:switch(o){case Nf:t=c[0].x>c[1].x&&c[0].y<c[1].y?c[1].x:b.left,e=c[0].x>c[1].x&&c[0].y<c[1].y?c[1].y:Math.min(b.top,c[0].y),l.push({x:t,y:c[0].y}),l.push({x:t,y:e}),l.push({x:c[1].x,y:e});break;case Hf:t=b.left,e=Math.max(b.top+b.height,c[0].y),l.push({x:t,y:c[0].y}),l.push({x:t,y:e}),l.push({x:c[1].x,y:e});break;case Vf:t=b.left+b.width,l.push({x:c[0].x,y:b.top}),l.push({x:t,y:b.top}),l.push({x:t,y:c[1].y});break;case Gf:t=b.left,l.push({x:t,y:c[0].y}),l.push({x:t,y:c[1].y});break;default:return this.path}break;case Vf:switch(o){case Nf:e=c[0].y<c[1].y&&c[0].x<c[1].x?c[0].y:b.top,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;case Hf:e=c[0].y>c[1].y&&c[0].x<c[1].x?c[0].y:b.top+b.height,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;case Vf:case Gf:e=b.top+b.height,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;default:return this.path}break;default:return this.path}}return a&&l.push(a),[t,...l,e].filter((t,e,n)=>{if(0===e)return!0;const r=n[e-1];return t.x!==r.x||t.y!==r.y}).filter((t,e,n)=>{if(0===e||e>=n.length-1)return!0;const r=n[e-1],i=n[e+1];return!(t.x===r.x&&t.x===i.x||t.y===r.y&&t.y===i.y)})}get nature(){return tg}}Ha.register("ortholine",eg);const ng={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"image-selector",label:"image-src",name:"src",property:{displayField:"id",displayFullUrl:!0,baseUrlAlias:"$base_url",defaultStorage:"scene-image",storageFilters:{type:Array,value:[{name:"category",value:"image"}]},useUpload:!0}},{type:"select",label:"cross-origin",name:"crossOrigin",property:{options:["","anonymous","use-credentials"]}}],"value-property":"src",help:"scene/component/image-view"};class rg extends(Ya(Va)){static get noimage(){return rg.NOIMAGE||(rg.NOIMAGE=new Image,rg.NOIMAGE.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABIBAMAAAD7Se1QAAAAIVBMVEUAAABHcEwBAQEREREBAQEEBAQGBgYLCwsDAwMDAwMICAi6HF9tAAAAC3RSTlNNAEAERiMYCS41Eac10lYAAAEgSURBVHhe7dY9asQwEAXgh7DNertNiJy48pIitY3SB7bYdk0ukL1BDDmA9gZecoH4pmFQ3MQayUMguPBrNPD4wD9TCMvJmt3M/AtYwXOlXiWgqADVCUBD46MAnGhMBaCiUQmAm8VA/Eh/eWl9Fn5WcxD+OLuRrUYJDKLluwH2InACUgkoACSdADxQc50Bytadb9RkM0CT13TcvlCT1HFg8UTHvasuUVACCa3El6u2UdD8LFTlKhUFFgA+d3dj10aABkUN72N3jAADCrJq7PIIsPidcxBoTHIIAjMFmyCwmGYIAA1P9gFgfCANAOsDSccCDW+uLDB+kLGg94OkZoAGkwsDDAe2DOg5oPxAg03rBR88OHpBz4N8UVeHFSwma74BTW6Ge4rIRa4AAAAASUVORK5CYII="),rg.NOIMAGE}dispose(){super.dispose(),this._offcanvas=null,this._image=null}render(t){const{left:e,top:n,width:r,height:i,isGray:s=!1,alpha:o=1,src:a}=this.state;if(this.prepareIf(!this._image&&a),t.beginPath(),t.globalAlpha*=o,this._image&&this._image.complete)if(s&&this._offcanvas)t.drawImage(this._offcanvas,e,n,r,i);else try{t.drawImage(this._image,e,n,r,i)}catch(s){t.drawImage(rg.noimage,e,n,r,i)}else!this.app.isViewMode&&t.drawImage(rg.noimage,e,n,r,i)}get nature(){return ng}get hasTextProperty(){return!1}async ready(){await super.ready();const{src:t}=this.state;if(!this._image&&t){const e=this.root?.app?.loadTracker;if(e){const n=new Promise((t,e)=>{this.prepare(()=>t(),t=>e(t))});e.track(`image:${t}`,"image",t,n)}else this.prepareIf(!0)}}prepare(t,e){const{src:n,crossOrigin:r}=this.state;if(n){this._image=new Image;try{r&&(this._image.crossOrigin=r),this._image.src=this.app.url(n)||""}catch(t){return void e(t)}this._image.onload=()=>{if(this.get("isGray")){const t=this._image.width,e=this._image.height;this._offcanvas=Ha.createCanvas(t,e);const n=this._offcanvas.getContext("2d");n.drawImage(this._image,0,0);const r=function(t,e,n){let r;try{r=t.getImageData(0,0,e,n)}catch(t){return Lr("Get Image Data Error: "+(t instanceof Error?t.message:String(t))),null}const i=r.data;for(let t=0;t<e*n*4;t+=4){const e=i[t],n=i[t+1],s=i[t+2],o=Math.floor((e+n+s)/3);r.data[t]=o,r.data[t+1]=o,r.data[t+2]=o}return r}(n,t,e);n.putImageData(r,0,0)}t(this)},this._image.onerror=t=>{this._image&&!this._image.currentSrc&&(this._image=null),e(t)}}else t(this)}get src(){return this.get("src")}set src(t){this.set("src",t)}onchange(t,e){(t.hasOwnProperty("src")||t.hasOwnProperty("isGray"))&&(this._offcanvas=null,this._image=null,this.prepareIf(t.src))}ondropfile(t,e){for(let n=0;n<t.length;n++)if(t[n].type.startsWith("image/"))return void(this.src=e[n])}}Ha.register("image-view",rg);class ig extends(Ef(Ya(Ha))){is3dish(){return!0}prerender(){}}var sg,og,ag={},cg={},lg={};function hg(){if(og)return cg;og=1,Object.defineProperty(cg,"__esModule",{value:!0});var t=function(){if(sg)return lg;sg=1,Object.defineProperty(lg,"__esModule",{value:!0});var t=function(){function t(){}return t.bitsToNum=function(t){return t.reduce(function(t,e){return 2*t+e},0)},t.byteToBitArr=function(t){for(var e=[],n=7;n>=0;n--)e.push(!!(t&1<<n));return e},t.lzwDecode=function(t,e){for(var n,r,i=0,s=function(t){for(var n=0,r=0;r<t;r++)e.charCodeAt(i>>3)&1<<(7&i)&&(n|=1<<r),i++;return n},o=[],a=1<<t,c=a+1,l=t+1,h=[],d=function(){h=[],l=t+1;for(var e=0;e<a;e++)h[e]=[e];h[a]=[],h[c]=null};;)if(r=n,(n=s(l))!==a){if(n===c)break;if(n<h.length)r!==a&&h.push(h[r].concat(h[n][0]));else{if(n!==h.length)throw new Error("Invalid LZW code.");h.push(h[r].concat(h[r][0]))}o.push.apply(o,h[n]),h.length===1<<l&&l<12&&l++}else d();return o},t}();return lg.SuperGifUtils=t,lg}(),e=function(){function e(t,e){this.stream=t,this.handler=e}return e.prototype.parseCT=function(t){for(var e=[],n=0;n<t;n++)e.push(this.stream.readBytes(3));return e},e.prototype.readSubBlocks=function(){var t,e;e="";do{t=this.stream.readByte(),e+=this.stream.read(t)}while(0!==t);return e},e.prototype.parseHeader=function(){var e={};if(e.sig=this.stream.read(3),e.ver=this.stream.read(3),"GIF"!==e.sig)throw new Error("Not a GIF file.");e.width=this.stream.readUnsigned(),e.height=this.stream.readUnsigned();var n=t.SuperGifUtils.byteToBitArr(this.stream.readByte());e.gctFlag=n.shift(),e.colorRes=t.SuperGifUtils.bitsToNum(n.splice(0,3)),e.sorted=n.shift(),e.gctSize=t.SuperGifUtils.bitsToNum(n.splice(0,3)),e.bgColor=this.stream.readByte(),e.pixelAspectRatio=this.stream.readByte(),e.gctFlag&&(e.gct=this.parseCT(1<<e.gctSize+1)),this.handler.hdr&&this.handler.hdr(e)},e.prototype.parseExt=function(e){var n=this;switch(e.label=this.stream.readByte(),e.label){case 249:e.extType="gce",function(e){n.stream.readByte();var r=t.SuperGifUtils.byteToBitArr(n.stream.readByte());e.reserved=r.splice(0,3),e.disposalMethod=t.SuperGifUtils.bitsToNum(r.splice(0,3)),e.userInput=r.shift(),e.transparencyGiven=r.shift(),e.delayTime=n.stream.readUnsigned(),e.transparencyIndex=n.stream.readByte(),e.terminator=n.stream.readByte(),n.handler.gce&&n.handler.gce(e)}(e);break;case 254:e.extType="com",function(t){t.comment=n.readSubBlocks(),n.handler.com&&n.handler.com(t)}(e);break;case 1:e.extType="pte",function(t){n.stream.readByte(),t.ptHeader=n.stream.readBytes(12),t.ptData=n.readSubBlocks(),n.handler.pte&&n.handler.pte(t)}(e);break;case 255:e.extType="app",function(t){n.stream.readByte(),t.identifier=n.stream.read(8),t.authCode=n.stream.read(3),"NETSCAPE"===t.identifier?function(t){n.stream.readByte(),t.unknown=n.stream.readByte(),t.iterations=n.stream.readUnsigned(),t.terminator=n.stream.readByte(),n.handler.app&&n.handler.app.NETSCAPE&&n.handler.app.NETSCAPE(t)}(t):function(t){t.appData=n.readSubBlocks(),n.handler.app&&n.handler.app[t.identifier]&&n.handler.app[t.identifier](t)}(t)}(e);break;default:e.extType="unknown",function(t){t.data=n.readSubBlocks(),n.handler.unknown&&n.handler.unknown(t)}(e)}},e.prototype.parseImg=function(e){e.leftPos=this.stream.readUnsigned(),e.topPos=this.stream.readUnsigned(),e.width=this.stream.readUnsigned(),e.height=this.stream.readUnsigned();var n=t.SuperGifUtils.byteToBitArr(this.stream.readByte());e.lctFlag=n.shift(),e.interlaced=n.shift(),e.sorted=n.shift(),e.reserved=n.splice(0,2),e.lctSize=t.SuperGifUtils.bitsToNum(n.splice(0,3)),e.lctFlag&&(e.lct=this.parseCT(1<<e.lctSize+1)),e.lzwMinCodeSize=this.stream.readByte();var r=this.readSubBlocks();e.pixels=t.SuperGifUtils.lzwDecode(e.lzwMinCodeSize,r),e.interlaced&&(e.pixels=function(t,e){for(var n=new Array(t.length),r=t.length/e,i=function(r,i){var s=t.slice(i*e,(i+1)*e);n.splice.apply(n,[r*e,e].concat(s))},s=[0,4,2,1],o=[8,8,4,2],a=0,c=0;c<4;c++)for(var l=s[c];l<r;l+=o[c])i(l,a),a++;return n}(e.pixels,e.width)),this.handler.img&&this.handler.img(e)},e.prototype.parseBlock=function(){var t={};switch(t.sentinel=this.stream.readByte(),String.fromCharCode(t.sentinel)){case"!":t.type="ext",this.parseExt(t);break;case",":t.type="img",this.parseImg(t);break;case";":t.type="eof",this.handler.eof&&this.handler.eof(t);break;default:throw new Error("Unknown block: 0x"+t.sentinel.toString(16))}"eof"!==t.type&&setTimeout(this.parseBlock.bind(this),0)},e.prototype.parse=function(){this.parseHeader(),setTimeout(this.parseBlock.bind(this),0)},e}();return cg.SuperGifParser=e,cg}var dg,ug,pg={};var fg=function(){if(ug)return ag;ug=1,Object.defineProperty(ag,"__esModule",{value:!0});var t=hg(),e=function(){if(dg)return pg;dg=1,Object.defineProperty(pg,"__esModule",{value:!0});var t=function(){function t(t){this.data=t,this.position=0}return t.prototype.readByte=function(){if(this.position>=this.data.length)throw new Error("Attempted to read past end of stream.");return this.data instanceof Uint8Array?this.data[this.position++]:255&this.data.charCodeAt(this.position++)},t.prototype.readBytes=function(t){for(var e=[],n=0;n<t;n++)e.push(this.readByte());return e},t.prototype.read=function(t){for(var e="",n=0;n<t;n++)e+=String.fromCharCode(this.readByte());return e},t.prototype.readUnsigned=function(){var t=this.readBytes(2);return(t[1]<<8)+t[0]},t}();return pg.SuperGifStream=t,pg}(),n=function(){function n(t,e){var n=this;for(var r in this.gifImgElement=t,this.options={autoPlay:!0},this.loading=!1,this.ready=!1,this.transparency=null,this.delay=null,this.disposalMethod=null,this.disposalRestoreFromIdx=null,this.lastDisposalMethod=null,this.frame=null,this.lastImg=null,this.playing=!0,this.forward=!0,this.ctxScaled=!1,this.frames=[],this.frameOffsets=[],this.initialized=!1,this.currentFrameIndex=-1,this.iterationCount=0,this.stepping=!1,this.handler={hdr:this.withProgress(this.doHdr.bind(this)),gce:this.withProgress(this.doGCE.bind(this)),com:this.withProgress(this.doNothing.bind(this)),app:{NETSCAPE:this.withProgress(this.doNothing.bind(this))},img:this.withProgress(this.doImg.bind(this)),eof:function(){n.pushFrame(),n.canvas.width=n.hdr.width*n.getCanvasScale(),n.canvas.height=n.hdr.height*n.getCanvasScale(),n.playerInit(),n.loading=!1,n.ready=!0,n.loadCallback&&n.loadCallback(n.gifImgElement)}},e)this.options[r]=e[r];this.onEndListener=e.onEnd,this.loopDelay=e.loopDelay||0,this.overrideLoopMode=null!=e.loopMode?e.loopMode:"auto",this.drawWhileLoading=null==e.drawWhileLoading||e.drawWhileLoading}return n.prototype.init=function(){var t=this.gifImgElement.parentNode,e=document.createElement("div");this.canvas=document.createElement("canvas"),this.canvasContext=this.canvas.getContext("2d"),this.tmpCanvas=document.createElement("canvas"),e.className=this.options.enclosingClass||"super-gif",e.appendChild(this.canvas),t&&(t.insertBefore(e,this.gifImgElement),t.removeChild(this.gifImgElement)),this.initialized=!0},n.prototype.loadSetup=function(t){return!this.loading&&(t&&(this.loadCallback=t),this.loading=!0,this.frames=[],this.clear(),this.disposalRestoreFromIdx=null,this.lastDisposalMethod=null,this.frame=null,this.lastImg=null,!0)},n.prototype.completeLoop=function(){this.onEndListener&&this.onEndListener(this.gifImgElement),this.iterationCount++,!1!==this.overrideLoopMode||this.iterationCount<0?this.doStep():(this.stepping=!1,this.playing=!1)},n.prototype.doStep=function(){if(this.stepping=this.playing,this.stepping){this.stepFrame(1);var t=10*this.frames[this.currentFrameIndex].delay;t||(t=100),0===this.getNextFrameNo()?(t+=this.loopDelay,setTimeout(this.completeLoop.bind(this),t)):setTimeout(this.doStep.bind(this),t)}},n.prototype.step=function(){this.stepping||setTimeout(this.doStep.bind(this),0)},n.prototype.putFrame=function(){var t;this.currentFrameIndex=parseInt(this.currentFrameIndex.toString(),10),this.currentFrameIndex>this.frames.length-1&&(this.currentFrameIndex=0),this.currentFrameIndex<0&&(this.currentFrameIndex=0),t=this.frameOffsets[this.currentFrameIndex],this.tmpCanvas.getContext("2d").putImageData(this.frames[this.currentFrameIndex].data,t.x,t.y),this.canvasContext.globalCompositeOperation="copy",this.canvasContext.drawImage(this.tmpCanvas,0,0)},n.prototype.playerInit=function(){this.loadErrorCause||(this.canvasContext.scale(this.getCanvasScale(),this.getCanvasScale()),this.options.autoPlay?this.step():(this.currentFrameIndex=0,this.putFrame()))},n.prototype.clear=function(){this.transparency=null,this.delay=null,this.lastDisposalMethod=this.disposalMethod,this.disposalMethod=null,this.frame=null},n.prototype.parseStream=function(e){try{new t.SuperGifParser(e,this.handler).parse()}catch(t){this.handleError("parse")}},n.prototype.setSizes=function(t,e){this.canvas.width=t*this.getCanvasScale(),this.canvas.height=e*this.getCanvasScale(),this.tmpCanvas.width=t,this.tmpCanvas.height=e,this.tmpCanvas.style.width=t+"px",this.tmpCanvas.style.height=e+"px",this.tmpCanvas.getContext("2d").setTransform(1,0,0,1,0,0)},n.prototype.drawError=function(){this.canvasContext.fillStyle="black",this.canvasContext.fillRect(0,0,this.hdr.width,this.hdr.height),this.canvasContext.strokeStyle="red",this.canvasContext.lineWidth=3,this.canvasContext.moveTo(0,0),this.canvasContext.lineTo(this.hdr.width,this.hdr.height),this.canvasContext.moveTo(0,this.hdr.height),this.canvasContext.lineTo(this.hdr.width,0),this.canvasContext.stroke()},n.prototype.handleError=function(t){this.loadErrorCause=t,this.hdr={width:this.gifImgElement.width,height:this.gifImgElement.height},this.frames=[],this.drawError()},n.prototype.doHdr=function(t){this.hdr=t,this.setSizes(this.hdr.width,this.hdr.height)},n.prototype.doGCE=function(t){this.pushFrame(),this.clear(),this.transparency=t.transparencyGiven?t.transparencyIndex:null,this.delay=t.delayTime,this.disposalMethod=t.disposalMethod},n.prototype.pushFrame=function(){this.frame&&(this.frames.push({data:this.frame.getImageData(0,0,this.hdr.width,this.hdr.height),delay:this.delay}),this.frameOffsets.push({x:0,y:0}))},n.prototype.doImg=function(t){var e=this;this.frame||(this.frame=this.tmpCanvas.getContext("2d"));var n=this.frames.length,r=t.lctFlag?t.lct:this.hdr.gct;n>0&&(3===this.lastDisposalMethod?null!==this.disposalRestoreFromIdx?this.frame.putImageData(frames[this.disposalRestoreFromIdx].data,0,0):this.frame.clearRect(this.lastImg.leftPos,this.lastImg.topPos,this.lastImg.width,this.lastImg.height):this.disposalRestoreFromIdx=n-1,2===this.lastDisposalMethod&&this.frame.clearRect(this.lastImg.leftPos,this.lastImg.topPos,this.lastImg.width,this.lastImg.height));var i=this.frame.getImageData(t.leftPos,t.topPos,t.width,t.height);t.pixels.forEach(function(t,n){t!==e.transparency&&(i.data[4*n+0]=r[t][0],i.data[4*n+1]=r[t][1],i.data[4*n+2]=r[t][2],i.data[4*n+3]=255)}),this.frame.putImageData(i,t.leftPos,t.topPos),this.ctxScaled||(this.canvasContext.scale(this.getCanvasScale(),this.getCanvasScale()),this.ctxScaled=!0),this.drawWhileLoading&&(this.canvasContext.drawImage(this.tmpCanvas,0,0),this.drawWhileLoading=this.options.autoPlay),this.lastImg=t},n.prototype.doNothing=function(){},n.prototype.withProgress=function(t){return function(e){t(e)}},n.prototype.getNextFrameNo=function(){var t=this.forward?1:-1;return(this.currentFrameIndex+t+this.frames.length)%this.frames.length},n.prototype.stepFrame=function(t){this.currentFrameIndex=this.currentFrameIndex+t,this.putFrame()},n.prototype.getCanvasScale=function(){return this.options.maxWidth&&this.hdr&&this.hdr.width>this.options.maxWidth?this.options.maxWidth/this.hdr.width:window.devicePixelRatio||1},n.prototype.play=function(){this.playing=!0,this.step()},n.prototype.pause=function(){this.playing=!1},n.prototype.isPlaying=function(){return this.playing},n.prototype.getCanvas=function(){return this.canvas},n.prototype.isLoading=function(){return this.loading},n.prototype.isReady=function(){return this.ready},n.prototype.isAutoPlay=function(){return this.options.autoPlay},n.prototype.getLength=function(){return this.frames.length},n.prototype.getCurrentFrame=function(){return this.currentFrameIndex},n.prototype.moveTo=function(t){this.currentFrameIndex=t,this.putFrame()},n.prototype.loadURL=function(t,n){var r=this;if(this.loadSetup(n)){var i=new XMLHttpRequest;i.open("GET",t,!0),"overrideMimeType"in i?i.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in i?i.responseType="arraybuffer":i.setRequestHeader("Accept-Charset","x-user-defined"),i.onloadstart=function(){r.initialized||r.init()},i.onload=function(){if(200===i.status){var t=i.response;t.toString().indexOf("ArrayBuffer")>0&&(t=new Uint8Array(t));var n=new e.SuperGifStream(t);setTimeout(function(){r.parseStream(n)},0)}else r.handleError("xhr - response")},i.onerror=function(){r.handleError("xhr")},i.send()}},n.prototype.load=function(t){this.loadURL(this.gifImgElement.src,t)},n}();return ag.SuperGif=n,ag}();const gg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"image-selector",label:"src",name:"src"},{type:"checkbox",label:"play",name:"play"}],"value-property":"src",help:"scene/component/gif-view"};class mg extends ig{async oncreate_element(t){const{src:e,play:n}=this.state;this.onchangesrc(e),this.onchangeplay(n)}buildImg(){const t=this.element;if(!t)return document.createElement("img");t.replaceChildren();const e=document.createElement("img");return e.style.width="100%",e.style.height="100%",t.appendChild(e),e}onchange(t,e){super.onchange(t,e),"src"in t&&this.onchangesrc(t.src),"play"in t&&this.onchangeplay(t.play)}setElementProperties(t){}onchangeplay(t){const e=this._superGif;e&&e.isReady()&&(t?e.play():e.pause())}onchangesrc(t){const e=this.buildImg();t||(t="data:image/gif;base64,R0lGODlhYABIAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKio+Pj5iYmKCgoKampqurq66urrCwsLGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrOzs7S0tLa2tre3t7m5ubu7u7+/v8DAwMHBwcPDw8XFxcfHx8vLy8/Pz9LS0tXV1dfX193d3eTk5Onp6fj4+Pz8/P7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v///////////////////////////////////////////////////////////////////////////////yH5BAkAAPUAIf47R2VuZXJhdGVkIGJ5IGpzZ2lmIChodHRwczovL2dpdGh1Yi5jb20vYW50aW1hdHRlcjE1L2pzZ2lmLykALAAAAABgAEgAAAj+AGcJHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmR9VKqXMmypcuXMGPKnJkSIs2bOHPqZGlzp8+fQOv1DEq0KMyhRpMmRaq0KVCmTqPmhCq1qkyqLrFRSyYwGTVsVo1iZXmNa8Fk18ISHasSm1mDycCq/ck2JTWF1ObSfTjz7cFken3WFbow8M7BDA3rHOwXruKpfGXeTZg3qDVrUge7RRg3KLZjx+Q2HVyvLNy0QaMJjBaVdD2tZr2K/mmNIObRkR+n9AsYt0Pddg1WXppb8bWDx1CLLW74GcJnSl3TtDY8Zu2Et4tKl7n52eyWnxXvhl7+26jqrspbnlfIWjtz2gWPZV95neH8veU9NxZYfbfD3kFt99J6Bnmn0mQO9XfYezrVxxlmx0GUXIAM4hSeffsxBN1TFd5E4Ef3QZbfTg6CNJ5gHXJ3TEntLThiTh+KFCJNAqZU4kgAitjQTheepOBMNcZI0oQ6JpbTjSZtiNN2PZ400IxHpdiSc07G911M0iFZZYtAStnWilUeBGVLrlEZpmM0elmPlmfO8iOZXl4DZpsGEYmll2bSWWCXLwJXVY1+urhjoGEBSuiSah6K36CKtpZoo4s9CimielZq6aWYZqrpppx26umnoIZ6UkAAOw=="),e.src=t,e.setAttribute("rel:animated_src",t),e.setAttribute("rel:auto_play",String(0)),this._superGif=new fg.SuperGif(e,{autoPlay:!1}),this._superGif.init(),this.element&&Array.from(this.element.children).forEach(t=>{t.style.width="100%",t.style.height="100%"});const n=this._superGif.getCanvas();n.style.width="100%",n.style.height="100%",this._superGif.load(()=>{setTimeout(()=>{this._superGif.moveTo(0),this.play&&this._superGif.play()},100)})}ondropfile(t,e){for(let n=0;n<t.length;n++)if(/\.gif$/.test(t[n].name))return void(this.src=e[n])}get src(){return this.getState("src")}set src(t){this.set("src",t)}get play(){return this.getState("play")}set play(t){this.setState("play",t)}get nature(){return gg}get tagName(){return"div"}}Ha.register("gif-view",mg);const yg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"attachment-selector",label:"src",name:"src",property:{category:"audio"}},{type:"checkbox",label:"started",name:"started"},{type:"checkbox",label:"loop",name:"loop"}],"value-property":"src",help:"scene/component/audio"};class bg extends(Ya(Va)){static get image(){return bg.IMAGE||(bg.IMAGE=new Image,bg.IMAGE.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAP1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACzJYIvAAAAFHRSTlMA8BAwgNBgQKB/wCBwUJDg37CvXyUlBK8AABFYSURBVHja7NsBkqIwFIThTiAQgyBq3/+sm6p1tnamZkaTMhJJf1f4S/JeEIiIiIiIiIiIiIiIiEhD7Hg4BH84TpAKjJ4f3NFCtjVd+InXz2RTs+FXlxGylYHfcVfIJmb+YFWSLUyGVJKKBJJKUo+Rd6w63l/qzLuCkryO5fe0l2xk5mMWbe+v0fNBRqf7S3je6CipQ2ACr+dWcYEpzBFS1plpguatsnomMgdIQSOTuQ5SjmE6/UgK8szgdJIUM/FG41YlFmYJ2kkKsY5ZzAwBurHDk3WGeRY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nnw8WGYSk40X/BOh4+El6LMSBnN2Cd0tPq4w/LJXGrMbCX06PZ2dcM65yzlNertShSHf3SzRAyPM332IcSAHUKPi8EHmXU0l8Uglmni0yipDoi16s+jJKejhywLooz68yiMEcHr2qM4h81CJ++VPJfTu5UwBpv4Pp9DJSi6MJx0bvUwiw4ewgT8zNR0LHUL+OccOpY/3ElzyGKD5pBlMJpDlsOkMythRoNbXh95PJsdA67MrMtAEYbjeDqNo+7oKqWUUkoppZRSSimllFJKFfMXp4vmSjB8n6sAAAAASUVORK5CYII="),bg.IMAGE}dispose(){super.dispose(),this.started=!1,delete this._audio}async ready(){super.ready(),this._audio=new Audio;const{src:t="",loop:e=!1,started:n=!1}=this.state;if(t){const e=this.root?.app?.loadTracker;if(e){const n=new Promise((e,n)=>{this._audio.addEventListener("canplay",()=>e(),{once:!0}),this._audio.addEventListener("error",()=>n(new Error(`Audio load failed: ${t}`)),{once:!0})});e.track(`audio:${t}`,"audio",t,n)}}this._audio.addEventListener("canplay",()=>{this.started&&this._audio.play()}),this.onchangeSrc(t),this.onchangeLoop(e),this.onchangeStarted(n)}render(t){const{left:e,top:n,width:r,height:i}=this.state;t.beginPath(),this.drawImage(t,bg.image,e,n,r,i)}get nature(){return yg}get hasTextProperty(){return!1}get src(){return this.get("src")}set src(t){this.set("src",t)}get started(){return!!this.get("started")}set started(t){this.set("started",t)}start(){this._audio&&(this._audio.classList.add("active"),this._audio.play())}pause(){this._audio&&(this._audio.classList.remove("active"),this._audio.pause())}onchangeSrc(t){try{"data"!==String(t).substring(0,4)?this._audio.crossOrigin="use-credentials":this._audio.crossOrigin=null,this._audio.src="string"==typeof t?this.app.url(t):t}catch(t){return void Lr(t)}}onchangeStarted(t){const e=this._audio;t?4==e.readyState&&e.play():e.pause()}onchangeLoop(t){this._audio.loop=t}onchange(t,e){"src"in t&&this.onchangeSrc(t.src),"started"in t&&this.onchangeStarted(t.started),"loop"in t&&this.onchangeLoop(t.loop)}ondblclick(t){this.started=!this.started}ondropfile(t,e){for(let n=0;n<t.length;n++)if(t[n].type.startsWith("audio/"))return void(this.src=e[n])}}Ha.register("audio",bg);class vg extends(Ya(Ha)){is3dish(){return!0}}Ha.register("text",vg);const _g=["refid","left","top","width","height","rotation","animation","zPos"];class xg extends Df{isGroup(){return!0}is3dish(){return!0}get(t){return this._model[t]}set(t,e){if("string"==typeof t)return this.set({[t]:e});const n=_g.reduce((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e),{});return super.set(n,void 0)}capture(t,e,n){const r=super.capture(t,e,n);if(r!==this)return r}set bounds(t){if(this.__MUTATING__)return void(super.bounds=t);const e=this.bounds,n=t.width/e.width,r=t.height/e.height;this.path=this.path.map(i=>({x:t.left+(i.x-e.left)*n,y:t.top+(i.y-e.top)*r})),this.components&&this.components.forEach(t=>{if(t.mutable)t.mutatePath(null,function(t){return t.map(function(t){return{x:t.x*n,y:t.y*r}})});else{const e=t.bounds,i=t.center,s={x:i.x*(1-n),y:i.y*(1-r)},o=e.width*(1-n),a=e.height*(1-r),c=-(s.x-o/2),l=-(s.y-a/2);t.bounds={left:e.left+c,top:e.top+l,width:e.width*n,height:e.height*r}}})}get focusible(){return!1}get bounds(){return super.bounds}get hasTextProperty(){return!1}isIdentifiable(){return!1}calculateBounds(){this.clearCache(),this.__MUTATING__=!0,this.mutateBounds(function(t){const e=Ha.union(this.components.map(t=>t.bounds));return this.components.forEach(t=>{const n=t.bounds;t.bounds={left:n.left-e.left,top:n.top-e.top,width:n.width,height:n.height}}),{left:t.left+e.left,top:t.top+e.top,width:e.width,height:e.height}},this),this.__MUTATING__=!1,this.parent.isGroup()&&this.parent.calculateBounds?.()}render(t){}postrender(t){const{top:e,left:n}=this.state;t.translate(n,e),this.layout.drawables(this).forEach(e=>{e.draw(t)}),t.translate(-n,-e)}}Ha.memoize(xg.prototype,"bounds",!0),Ha.register("group",xg);const wg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"id-input",label:"ref",name:"ref"},{type:"select",label:"fit",name:"fit",property:{options:["","both","ratio"]}}],"value-property":"ref",help:"scene/component/local-ref"};class Mg extends(Ya(Va)){get ref(){const t=this.getState("ref");return t&&"string"==typeof t?this.root.findById?.(t):null}set ref(t){this.setState("ref",t)}get refScale(){const t=this.ref;if(!t)return{x:1,y:1};const e=t.bounds,n=this.bounds,r=n.width/e.width,i=n.height/e.height;return"both"===this.model.fit?{x:r,y:i}:{x:Math.min(r,i),y:Math.min(r,i)}}draw(t){this._drawing||(this._drawing=!0,super.draw(t),this._drawing=!1)}prerender(t){if(super.prerender(t),this.ref){const e=this.ref.center,n=this.center,r=this.refScale;t.translate(n.x,n.y),t.scale(r.x,r.y),t.translate(-e.x,-e.y)}}postrender(t){if(this.ref)return this.ref.postrender(t);super.postrender(t)}render(t){if(this.ref)return this.ref.render(t);const{left:e,top:n,width:r,height:i}=this.bounds;t.beginPath(),t.rect(e,n,r,i)}get nature(){return wg}get hasTextProperty(){return!1}}Ha.memoize(Mg.prototype,"ref",!1),Ha.memoize(Mg.prototype,"refScale",!1),Ha.register("local-ref",Mg);class Sg extends(Ef(yc)){render(t){}is3dish(){return!0}get layout(){return Ka.get(this.get("layout"))||Qa}}const Ag={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"board-selector",label:"scene-number",name:"ref",placeholder:"SCENE-1"},{type:"number",label:"round",name:"round",property:{min:0}},{type:"select",label:"fit",name:"fit",property:{options:["","both","ratio","width","height","none"]}},{type:"select",label:"mode",name:"mode",property:{options:["view","interaction"]}}],"value-property":"ref",help:"scene/component/global-ref"};class Eg extends Sg{dispose(){this._releaseRef(),super.dispose()}get nature(){return Ag}get hasTextProperty(){return!1}get tagName(){return"div"}setElementProperties(t){const{mode:e="view",round:n=0}=this.state;t.style.pointerEvents="view"==e?"none":"inherit",t.style.borderRadius=n+"px"}async ready(){super.ready(),this.fetchRef()}reposition(){if(!this.element)return;super.reposition();const t=this._element_bounds,{offsetWidth:e,offsetHeight:n}=this.element;if(this._element_bounds={offsetWidth:e,offsetHeight:n},(!t||t.offsetWidth!=e||t.offsetHeight!=n)&&this.ref&&this.root.target_element){const{fit:t="ratio"}=this.state;this.ref.fit(t)}}async fetchRef(){this._releaseRef();const{ref:t,fit:e="ratio"}=this.state;if(!t)return;const n=this.app.refProvider;if(n&&t){const r=(async()=>{this.__ref=await n.get(t,!0),this.__ref.target=this.element,this.__ref.fit(e),this.__ref.data=this.data})();this.root?.app?.loadTracker?.track(`ref:${t}`,"ref-board",t,r);try{await r}catch(t){Lr(t)}}}get ref(){return this.__ref}set ref(t){this.setState("ref",t)}_releaseRef(){this.__ref&&this.__ref.release&&this.__ref.release(),delete this.__ref}onchange(t,e,n){super.onchange(t,e),"ref"in t&&this.fetchRef(),"fit"in t&&this.ref&&requestAnimationFrame(()=>{const{fit:t}=this.state;this.ref.fit(t)}),"data"in t&&this.ref&&requestAnimationFrame(()=>{this.ref.data=t.data})}}Ha.register("global-ref",Eg);const kg="center-middle",Cg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"board-selector",label:"board",name:"board"},{type:"checkbox",label:"modal",name:"modal"},{type:"checkbox",label:"closable",name:"closable"},{type:"checkbox",label:"draggable",name:"draggable"},{type:"checkbox",label:"minimizable",name:"minimizable"},{type:"checkbox",label:"show",name:"show"},{type:"select",label:"popup-position",name:"popupPosition",property:{options:["static","absolute"]}},{type:"select",label:"popup-origin",name:"origin",property:{options:["left-top","center-top","right-top","left-middle",kg,"right-middle","left-bottom","center-bottom","right-bottom","auto"]}},{type:"string",label:"title",name:"text"},{type:"data",label:"value",name:"value"}],help:"scene/component/popup"};class Tg extends(Ya(Va)){static get image(){return Tg._image||(Tg._image=new Image,Tg._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAMAAABG8BK2AAADJmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0Y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FTkSuQmCC"),Tg._image}async ready(){await super.ready(),this.show&&this.onchangeShow(!0)}render(t){const{left:e,top:n,width:r,height:i}=this.bounds;t.beginPath(),this.drawImage(t,Tg.image,e,n,r,i)}onchange(t,e){"value"in t?this.show?this.onchangeShow(!0):this.show=!0:"show"in t&&this.onchangeShow(this.show)}onchangeShow(t){!this.app.isEditMode&&this.getState("board")&&(t?this.openPopup(this.value):this.hidePopup())}openPopup(t,e){this.app.isEditMode||pc.show(this,this.getState("board"),{origin:this.getState("origin")||kg,modal:this.getState("modal"),closable:this.getState("closable")||!1,draggable:this.getState("draggable")||!1,minimizable:this.getState("minimizable")||!1,popupPosition:this.getState("popupPosition"),title:this.text,data:t||this.value,...e})}hidePopup(){pc.hide(this)}get board(){return this.getState("board")}set board(t){this.set("board",t)}get show(){return this.getState("show")}set show(t){this.setState("show",t)}get started(){return this.getState("show")}set started(t){this.setState("show",t)}get value(){return this.getState("value")}set value(t){this.setState("value",t)}get hasTextProperty(){return!1}get nature(){return Cg}}Ha.register("popup",Tg);class Pg extends Ha{render(t){const{path:e=[]}=this.state;if(!(e.length<=1)){t.beginPath(),t.moveTo(e[0].x,e[0].y);for(let n=1;n<e.length;n++)t.lineTo(e[n].x,e[n].y);t.closePath(),this.drawStroke(t,void 0)}}get path(){return this.model.path}set path(t){this.set("path",t)}contains(t,e){const n=this.state.path;let r=!1;return n.forEach((i,s)=>{const o=(s+n.length+1)%n.length,a=i.x,c=i.y,l=n[o].x,h=n[o].y;c>e!=h>e&&t<(l-a)*(e-c)/(h-c)+a&&(r=!r)}),r}}Ha.register("path",Pg);const Dg={mutable:!0,resizable:!1,rotatable:!0,properties:[{type:"number",label:"round",name:"round",property:{min:0,max:100,step:1}}],help:"scene/component/triangle"};class Og extends Va{is3dish(){return!0}contains(t,e){const{x1:n,y1:r,x2:i,y2:s,x3:o,y3:a}=this.state,c=[n,r,i,s,o,a];let l=!1;for(let n=0;n<c.length;n+=2){const r=(n+2)%c.length,i=c[n],s=c[n+1],o=c[r+1];s>e!=o>e&&t<(c[r]-i)*(e-s)/(o-s)+i&&(l=!l)}return l}get mutable(){return!0}get path(){const{x1:t,y1:e,x2:n,y2:r,x3:i,y3:s}=this.state;return[{x:t,y:e},{x:n,y:r},{x:i,y:s}]}set path(t){this.set({x1:t[0].x,y1:t[0].y,x2:t[1].x,y2:t[1].y,x3:t[2].x,y3:t[2].y})}get nature(){return Dg}}Ha.memoize(Og.prototype,"path",!1),Ha.register("triangle",Og);const zg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"ratio",name:"ratio",property:"ratio"}],help:"scene/component/donut"},Ig={ondragmove:function(t,e,n){let{cx:r,rx:i}=n.model;i=Math.abs(i);let s=(n.fromParent(t.x,t.y).x-r)/i*100;s=s>=100||s<=-100?100:Math.abs(s),n.set({ratio:s})}};class Lg extends Wf{is3dish(){return!0}render(t){let{ratio:e=50,cx:n,cy:r,rx:i,ry:s,startAngle:o,endAngle:a,anticlockwise:c}=this.state;i=Math.abs(i),s=Math.abs(s),t.beginPath(),t.ellipse(n,r,i,s,0,o||0,a||2*Math.PI,c),t.moveTo(n+i/100*e,r),t.ellipse(n,r,i/100*e,s/100*e,0,o||0,a||2*Math.PI,!0)}contains(t,e){let{cx:n,cy:r,rx:i,ry:s,ratio:o}=this.state;i=Math.abs(i),s=Math.abs(s);const a=(t-n)/(2*i-.5),c=(e-r)/(2*s-.5),l=(t-n)/(i/100*o*2-.5),h=(e-r)/(s/100*o*2-.5);let d=!1;return a*a+c*c<.25&&l*l+h*h>.25&&(d=!d),d}get controls(){let{cx:t,cy:e,rx:n,ratio:r}=this.state;return n=Math.abs(n),[{x:t+n/100*r,y:e,handler:Ig}]}get nature(){return zg}}Ha.memoize(Lg.prototype,"controls",!1),Ha.register("donut",Lg);const Rg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"ratio",name:"ratio",property:"ratio"},{type:"number",label:"wing",name:"wing",property:"wing"}],help:"scene/component/star"},jg={ondragmove:function(t,e,n){const{cy:r,ry:i}=n.model;let s=(n.fromParent(t.x,t.y).y-r)/i*100+100;s>=100?s=100:s<=0&&(s=0),n.set({ratio:s})}};class Fg extends Wf{is3dish(){return!0}render(t){const{ratio:e=30,wing:n=5,cx:r,cy:i,rx:s,ry:o}=this.state;if(n<3)return;const a=1.5707963267948966,c=2*Math.PI/n,l=s-e/100*s,h=o-e/100*o;t.save(),t.beginPath(),t.translate(r,i),t.moveTo(s*Math.cos(-a),o*Math.sin(-a)),t.lineTo((s-l)*(Math.cos(c-a)+Math.cos(0-a))/2,(o-h)*(Math.sin(c-a)+Math.sin(0-a))/2);for(let e=1;e<n;e++)t.lineTo(s*Math.cos(c*e-a),o*Math.sin(c*e-a)),t.lineTo((s-l)*(Math.cos(c*(e+1)-a)+Math.cos(c*e-a))/2,(o-h)*(Math.sin(c*(e+1)-a)+Math.sin(c*e-a))/2);t.closePath(),t.restore()}get controls(){const{cx:t,cy:e,ry:n,ratio:r}=this.state;return[{x:t,y:e-n+n*(r/100),handler:jg}]}get nature(){return Rg}}Ha.memoize(Fg.prototype,"controls",!1),Ha.register("star",Fg);const Bg={mutable:!1,resizable:!1,rotatable:!1,properties:[]};class Ng extends(gd(Va)){is3dish(){return!1}isDescendible(){return!1}render(t){const{cx:e,cy:n,anticlockwise:r}=this.state,i=this.app?.scale||1;t.beginPath(),t.scale(1/i,1/i),t.ellipse(e,n,Math.abs(Ng.RADIUS),Math.abs(Ng.RADIUS),0,0,2*Math.PI,r),t.scale(i,i),t.closePath()}get path(){const{cx:t,cy:e}=this.state;return[{x:t-Ng.RADIUS,y:e-Ng.RADIUS},{x:t+Ng.RADIUS,y:e-Ng.RADIUS},{x:t+Ng.RADIUS,y:e+Ng.RADIUS},{x:t-Ng.RADIUS,y:e+Ng.RADIUS}]}set path(t){const e=t[0],n=t[2];this.set({cx:e.x+(n.x-e.x)/2,cy:e.y+(n.y-e.y)/2})}contains(t,e){const{cx:n,cy:r}=this.state,i=(t-n)/(2*Ng.RADIUS-.5),s=(e-r)/(2*Ng.RADIUS-.5);return i*i+s*s<.25}outline(t){const{cx:e,cy:n}=this.state;return this.toScene(e,n)}get nature(){return Bg}}Ng.RADIUS=5,Ha.memoize(Ng.prototype,"path",!1),Ha.register("node",Ng);class Hg extends Sh{getObject3dInstance(){return new _.Mesh}build(){super.build();const{width:t,height:e}=this.component.bounds,n=this.component.state.depth||.5*Math.min(t,e),r=.15*Math.min(t,e,n),i=new b.RoundedBoxGeometry(1,1,1,4,r/Math.min(t,e,n));i.scale(t,n,e),this.object3d.geometry=i,this.object3d.material=new _.MeshStandardMaterial({color:"#5090d0",transparent:!0,opacity:.35,roughness:.6,metalness:.1,side:_.FrontSide,depthWrite:!1}),this.object3d.visible=!!this.component.app?.isEditMode}updateAlpha(){const t=this.object3d.material;t&&(t.opacity=this.component.app?.isEditMode?.35:0)}updateHidden(){this.object3d.visible=!!this.component.app?.isEditMode&&!this.component.state.hidden}updateDimension(){const{width:t,height:e}=this.component.bounds,n=this.component.state.depth||.5*Math.min(t,e);this.object3d.geometry.computeBoundingBox();const r=this.object3d.geometry.boundingBox;if(r){const i=r.max.x-r.min.x,s=r.max.y-r.min.y,o=r.max.z-r.min.z;this.object3d.scale.set(t/i,n/s,e/o)}}updateFillStyle(){}updateStrokeStyle(){}updateText(){}clear(){return _h(this.object3d),super.clear()}}const Vg="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="#5090d0">\n <path d="M32 20a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm0 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12z"/>\n <path d="M55.4 27.2l-3.6-.6c-.4-1.2-.8-2.4-1.4-3.4l2.2-3c.6-.8.4-2-.2-2.6l-3-3c-.8-.6-1.8-.8-2.6-.2l-3 2.2c-1.2-.6-2.2-1-3.4-1.4l-.6-3.6c-.2-1-1-1.6-2-1.6h-4.2c-1 0-1.8.6-2 1.6l-.6 3.6c-1.2.4-2.4.8-3.4 1.4l-3-2.2c-.8-.6-2-.4-2.6.2l-3 3c-.6.8-.8 1.8-.2 2.6l2.2 3c-.6 1.2-1 2.2-1.4 3.4l-3.6.6c-1 .2-1.6 1-1.6 2v4.2c0 1 .6 1.8 1.6 2l3.6.6c.4 1.2.8 2.4 1.4 3.4l-2.2 3c-.6.8-.4 2 .2 2.6l3 3c.8.6 1.8.8 2.6.2l3-2.2c1.2.6 2.2 1 3.4 1.4l.6 3.6c.2 1 1 1.6 2 1.6h4.2c1 0 1.8-.6 2-1.6l.6-3.6c1.2-.4 2.4-.8 3.4-1.4l3 2.2c.8.6 2 .4 2.6-.2l3-3c.6-.8.8-1.8.2-2.6l-2.2-3c.6-1.2 1-2.2 1.4-3.4l3.6-.6c1-.2 1.6-1 1.6-2v-4.2c0-1-.6-1.8-1.6-2z"/>\n</svg>');class Gg extends(Ya(Ha)){static get icon(){return Gg._defaultIcon||(Gg._defaultIcon=new Image,Gg._defaultIcon.src=Vg),Gg._defaultIcon}get serviceName(){}get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new Hg(this)}render(t){if(this.app?.isViewMode)return;const{left:e,top:n,width:r,height:i}=this.bounds,s=this.constructor.icon;t.beginPath(),t.globalAlpha=.6,this.drawImage(t,s,e,n,r,i),t.globalAlpha=1}added(t){super.added(t);const e=this.serviceName;e&&(this._registeredRoot=this.root,this._registeredRoot?.registerService?.(e,this))}removed(t){const e=this.serviceName;e&&this._registeredRoot&&(this._registeredRoot.unregisterService?.(e),this._registeredRoot=void 0),super.removed(t)}get controls(){return[]}}function Yg(t){return class extends t{animOnValueChange(t,e=!1,n){if(t==this._lastValue)return;let r;r=e?t-(Number(n)||0):t-(this._lastValue||0),this._lastValue=t,this._anim_alpha=-r,this.animate({step:t=>{this._anim_alpha=r*(t-1),this.invalidate()},duration:1e3,delta:"circ",options:{x:1},ease:"out"}).start()}dispose(){super.dispose(),delete this._value_substitutor}onchange(t,e){t.hasOwnProperty("value")&&delete this._value_substitutor}get animAlpha(){return this._anim_alpha||0}get animValue(){return(this._lastValue||0)+(this._anim_alpha||0)}defaultValueSubstitutor(){return this.getState("value")}get valueSubstitutor(){return this._value_substitutor||(this._value_substitutor=ms(this.getState("value"),this,void 0)||this.defaultValueSubstitutor),this._value_substitutor}get value(){return Number(this.valueSubstitutor())||0}set value(t){delete this._value_substitutor,this.setState("value",Number(sr(t)))}}}function Ug(t){return class extends t{_convertDataFormat(t,e){let n;if("json"===e)n=JSON.parse(t);else n=t;return n}isDataSource(){return!0}}}function $g(t){return function(e){return Array.isArray(t)?t.forEach(t=>{Ha.register(t,e)}):Ha.register(t,e),e}}let Wg=0;const qg=new FinalizationRegistry(()=>{Wg--});class Xg{static get residents(){return Wg}static get residentsCount(){return Wg}constructor(t,e){this.counters={},this.references={},this.creator=t,this.disposer=e,Wg++,qg.register(this,Wg)}dispose(){if(this.disposer)for(const t in this.references)this.disposer(t,this.references[t]);this.references={},this.counters={}}get ids(){return Object.keys(this.references)}create(t){return new Promise((e,n)=>{this.creator?this.creator(t,n=>{n.release=()=>{this.disposer?.(t,n),delete n.release,jr("RELEASED",t)},e(n)},n):n(Error("Reference id("+t+") could not be created. Reference creator should be defined."))})}add(t,e){const n=new Promise((n,r)=>{const i=this.references[t];if(i)i===e?r(Error("Reference ID and target duplicate")):e?r(Error("Reference ID duplicate")):n(i);else{const i=e=>{e.release=()=>{this.release(e)},this.references[t]=e,this.counters[t]=1,n(e)};if(e)i(e);else{if(!this.creator)return void r(Error("Reference id("+t+") is not allowed. Reference creator should be defined."));this.creator(t,i,r)}}});return this.references[t]||(this.references[t]=n),n}async get(t,e=!1){let n=this.references[t];if(n){if(!(n instanceof Promise)){if(!(t in this.counters))throw new Error("No Reference Count");return this.counters[t]++,n}if(e)return n=await n,this.counters[t]++,n}if(e)return await this.add(t);throw new Error("No References for "+t)}_id(t){for(const e in this.references){if(this.references[e]===t)return e}}release(t){const e=this._id(t);if(!e)return void Lr("No Referenced ID");const n=this.references[e];n&&(this.counters[e]--,0==this.counters[e]&&(this.disposer?.(e,n),delete this.references[e],delete this.counters[e],delete t.release,jr("RELEASED",e)))}}const Kg={},Qg={};let Zg=[];function Jg(t){const e=t.target,n="SCRIPT"===e.tagName?Kg:Qg,r=e.src||e.href;n[r]=!0,Zg.forEach((t,e)=>{if(!t)return;const{resolve:i,scripts:s,styles:o}=t;if(n===Kg){const t=s.indexOf(r);t>-1&&t<s.length-1&&em(s[t+1])}s.some(t=>!Kg[t])||o?.some(t=>!Qg[t])||(i(),Zg[e]=null)}),Zg=Zg.filter(Boolean)}function tm(t){if("string"==typeof t)return;const e=t.target,n=e.src,r="SCRIPT"===e.tagName?Kg:Qg;Zg.forEach((e,i)=>{if(!e)return;const{reject:s,scripts:o,styles:a}=e;(r===Kg&&o.includes(n)||r===Qg&&!!a?.includes(n))&&(s(t),Zg[i]=null)}),Zg=Zg.filter(Boolean),delete r[n],document.head.removeChild(e)}function em(t){Kg[t]=!1;const e=document.createElement("script");e.onload=Jg,e.onerror=tm,e.type="text/javascript",e.src=t,document.head.appendChild(e)}class nm{static load(t,e){const n="string"==typeof t?[t]:t,r="string"==typeof e?[e]:e;return new Promise(function(t,e){if(n&&!Array.isArray(n)||r&&!Array.isArray(r))return void e(new Error("invalid sources for load"));let i,s=!0;if(r?.forEach(t=>{t in Qg||function(t){Qg[t]=!1;const e=document.createElement("link");e.onload=Jg,e.onerror=tm,e.type="text/css",e.rel="stylesheet",e.media="screen,print",e.href=t,document.head.appendChild(e)}(t),Qg[t]||(s=!1)}),n&&n.length>0)for(const t of n)t in Kg?Kg[t]||(s=!1):i??=t;if(i)em(i);else if(s)return void t();Zg.push({resolve:t,reject:e,scripts:n,styles:r})})}}const rm="0.0.0";class im extends Sh{getObject3dInstance(){return new _.Sprite}build(){super.build(),this.buildMaterial()}get cz(){const{zPos:t=0}=this.component.state,{height:e}=this.component.bounds,{tz:n=0}=this.component.delta();return t+n+e/2}updateAlpha(){const{alpha:t=1,fillStyle:e}=this.component.state;ah(this.object3d.material,t,e)}updateHidden(){this.object3d.visible=!this.component.state.hidden}updateFillStyle(){const{fillStyle:t}=this.component.state,e=this.object3d.material;if(!e)return;const n=Sh.buildFillStyleTexture(this.component);n?(e.map&&e.map.dispose(),n.needsUpdate=!0,e.map=n):"string"==typeof t&&("transparent"!==t?e.color.set(ch(t)):e.opacity=0)}}function sm(t){if(!(t>0))return 1;let e=0;if(!(t&t-1))return t;for(;0!=t;)t>>=1,e+=1;return 1<<e}function om(t){const{lineWidth:e=0}=t.state;let{width:n,height:r}=t.bounds;n+=e,r+=e;const i=sm(2*n),s=sm(2*r),o=th(i,s),a=new _.CanvasTexture(o);return am(o,t,2),a.needsUpdate=!0,a.wrapS=_.RepeatWrapping,a.wrapT=_.RepeatWrapping,a.offset.set(0,1-2*r/s),a.repeat.set(2*n/i,2*r/s),a.magFilter=_.NearestFilter,a.minFilter=_.LinearFilter,a.colorSpace=_.SRGBColorSpace,a}function am(t,e,n){const{lineWidth:r=0}=e.state;let{left:i,top:s}=e.bounds;i-=r/2,s-=r/2;const o=t.getContext("2d");o.scale(n,n),o.translate(-i,-s),e.render(o),e.postrender(o)}class cm extends im{buildMaterial(){const t=this.object3d.material;t&&t.dispose(),this.object3d.material=new _.SpriteMaterial({map:om(this.component),alphaTest:.01,sizeAttenuation:!1})}get scale(){const{width:t,height:e}=this.component.bounds,n=this.threeContainer,{width:r=1,height:i=1}=n?.bounds??{},{scale:s=1}=this.component.state;return{x:s*t/r,y:s*e/i,z:s}}update(){this.build(),this.updateHidden()}updateFillStyle(){this.update()}updateStrokeStyle(){this.update()}updateAlpha(){this.update()}updateText(){this.update()}}class lm extends Sh{get syncZPosOffset(){return this.effectiveDepth}getObject3dInstance(){return new _.Mesh}build(){super.build();const t=fh(this.component.state.material3d),e=new _.PlaneGeometry(1,1);e.rotateX(-Math.PI/2),this.object3d.geometry=e;const n=om(this.component);this.object3d.material=new _.MeshStandardMaterial({map:n,transparent:!0,alphaTest:.01,side:_.DoubleSide,metalness:t.metalness,roughness:t.roughness,emissive:new _.Color(t.emissive),emissiveIntensity:t.emissiveIntensity}),this.object3d.castShadow=t.castShadow,this.object3d.receiveShadow=t.receiveShadow}updateAlpha(){const{alpha:t=1,fillStyle:e}=this.component.state;ah(this.object3d.material,t,e)}updateHidden(){this.object3d.visible=!this.component.state.hidden}updateDimension(){const{width:t,height:e}=this.component.bounds;this.object3d.scale.set(t,1,e)}update(){this.clear(),this.build(),this.updateDimension(),this.updateTransform(),this.updateHidden()}updateFillStyle(){this.update()}updateStrokeStyle(){this.update()}updateText(){this.update()}updateMaterial3d(){super.updateMaterial3d();const t=this.object3d.material;if(!t)return;const e=fh(this.component.state.material3d);t.metalness=e.metalness,t.roughness=e.roughness,t.emissive.set(e.emissive),t.emissiveIntensity=e.emissiveIntensity}clear(){return _h(this.object3d),super.clear()}}class hm extends Sh{getObject3dInstance(){return new _.Mesh}build(){super.build(),this.buildGeometry(),this.buildMaterial()}updateAlpha(){const{alpha:t=1,fillStyle:e}=this.component.state;ah(this.object3d.material,t,e)}updateHidden(){this.object3d.visible=!this.component.state.hidden}updateFillStyle(){const{fillStyle:t}=this.component.state,e=this.object3d.material;if(!e)return;const n=Sh.buildFillStyleTexture(this.component);n?(e.map&&e.map.dispose(),n.needsUpdate=!0,e.map=n):"string"==typeof t&&("transparent"!==t?e.color.set(ch(t)):e.opacity=0)}updateStrokeStyle(){const t=this.object3d.getObjectByName("__edgeLines__");t&&(this.object3d.remove(t),_h(t));const{strokeStyle:e}=this.component.state;if(!e||"transparent"===e||"none"===e)return;const n=this.object3d.geometry;if(!n?.getAttribute("position"))return;const r=new _.EdgesGeometry(n),i=new _.LineBasicMaterial({color:e}),s=new _.LineSegments(r,i);s.name="__edgeLines__",this.object3d.add(s)}updateDimension(){const{width:t,height:e}=this.component.bounds,{depth:n=1}=this.component.state;if(!this.object3d)return;this.object3d.geometry.computeBoundingBox();const r=this.object3d.geometry.boundingBox;if(r){const i=r.max.x-r.min.x,s=r.max.y-r.min.y,o=r.max.z-r.min.z;this.object3d.scale.set(t/i,n/s,e/o)}}buildMaterial(){const t=fh(this.component.state.material3d),e=new _.MeshStandardMaterial({transparent:!0});yh(e,t),this.object3d.material=e}updateMaterial3d(){super.updateMaterial3d();const t=this.object3d.material;t&&yh(t,fh(this.component.state.material3d))}clear(){return _h(this.object3d),super.clear()}}function dm(t,e,n,r){return[["bold",t],["italic",e],[n+"px",!0],[r,!0]].filter(t=>t[1]).map(t=>t[0]).join(" ")}function um(t){let e=0;if(!((t=Math.abs(t)||1)&t-1))return t;for(;0!=t;)t>>=1,e+=1;return 1<<e}function pm(t,e,n){const{bold:r=!1,italic:i=!1,fontFamily:s="Serif",fontSize:o=10,fontColor:a="black",textAlign:c="center",textBaseline:l="middle",width:h=t.width,height:d=t.height}=n||{},u=t.getContext("2d");let p,f;u.imageSmoothingEnabled=!1,u.fillStyle=a,u.strokeStyle=a,u.font=dm(r,i,o,s),"left"===c||"start"===c?(u.textAlign="left",p=0):"right"===c||"end"===c?(u.textAlign="right",p=h):(u.textAlign="center",p=h/2);const g=1.2*o,m=String(e).split("\n"),y=g*m.length;f="top"===l||"hanging"===l?.1*o:"bottom"===l||"alphabetic"===l?d-y+.1*o:(d-y)/2+.1*o,u.textBaseline="top";for(const t of m)u.fillText(t,p,f),f+=g}function fm(t,e,n,r){const i=um(2*e),s=um(2*n),o=th(i,s),a=o.getContext("2d"),{fillStyle:c}=r||{};if(c&&"object"==typeof c&&c.colorStops?.length){const t=xh(c,2*e,2*n);t&&a.drawImage(t,0,0)}a.scale(2,2),"string"==typeof c&&""!==c&&"transparent"!==c&&(a.fillStyle=c,a.fillRect(0,0,e,n)),pm(o,t,r);const l=new _.CanvasTexture(o);return l.needsUpdate=!0,l.wrapS=_.RepeatWrapping,l.wrapT=_.RepeatWrapping,l.offset.set(0,1-2*n/s),l.repeat.set(2*e/i,2*n/s),l.minFilter=_.LinearFilter,l.colorSpace=_.SRGBColorSpace,l}function gm(t,e,n,r,i,s,o){const a=new Image;a.crossOrigin="anonymous",a.onload=()=>{const t=2*n,c=2*r,l=um(t),h=um(c),d=th(l,h),u=d.getContext("2d");if(s.color&&(u.fillStyle=s.color,u.fillRect(0,0,t,c)),s.fitPattern)u.drawImage(a,0,0,t,c);else{const e=2*(s.width||a.naturalWidth),n=2*(s.height||a.naturalHeight),r=2*(s.offsetX||0),i=2*(s.offsetY||0);let o=0,l=0;switch(s.align){case"center":o=(t-e)/2,l=(c-n)/2;break;case"left-top":break;case"left-bottom":l=c-n;break;case"right-top":o=t-e;break;case"right-bottom":o=t-e,l=c-n;break;case"left":l=(c-n)/2;break;case"right":o=t-e,l=(c-n)/2;break;case"top":o=(t-e)/2;break;case"bottom":o=(t-e)/2,l=c-n}const h=r+o,d=i+l;if(s.noRepeat)u.drawImage(a,0,0,a.naturalWidth,a.naturalHeight,h,d,e,n);else{u.save(),u.rect(0,0,t,c),u.clip();const r=h>0?h-Math.ceil(h/e)*e:h;for(let i=d>0?d-Math.ceil(d/n)*n:d;i<c;i+=n)for(let s=r;s<t;s+=e)u.drawImage(a,0,0,a.naturalWidth,a.naturalHeight,s,i,e,n);u.restore()}}e&&(u.scale(2,2),pm(d,e,i));const p=new _.CanvasTexture(d);p.needsUpdate=!0,p.wrapS=_.RepeatWrapping,p.wrapT=_.RepeatWrapping,p.offset.set(0,1-c/h),p.repeat.set(t/l,c/h),p.minFilter=_.LinearFilter,p.colorSpace=_.SRGBColorSpace,o(p)},a.onerror=()=>{const t=fm(e,n,r,i);o(t)},a.src=t}function mm(t,e){let{bold:n=!1,italic:r=!1,fontFamily:i="Serif",fontSize:s=10,lineHeight:o="normal"}=e||{};t=void 0===t||""==t?" ":String(t);const a=document.createElement("span");a.style.font=dm(n,r,s,i),a.style.lineHeight=String(o),a.style.whiteSpace="pre",a.style.position="absolute",a.textContent=t,document.body.appendChild(a);const c=a.getBoundingClientRect();return document.body.removeChild(a),{width:c.width,height:c.height}}class ym extends hm{get syncZPosOffset(){return this.effectiveDepth}buildGeometry(){this.updateDimension()}updateStrokeStyle(){}updateFillStyle(){this.updateText()}updateDimension(){const{width:t,height:e}=this.component.state,n=Math.abs(t)||1,r=Math.abs(e)||1;this.object3d.geometry&&this.object3d.geometry.dispose();const i=new _.PlaneGeometry(n,r);i.rotateX(-Math.PI/2),this.object3d.geometry=i}updateText(){const t=this.object3d.material;if(!t)return;const{width:e,height:n,bold:r=!1,italic:i=!1,fontFamily:s="Serif",fontSize:o=10,fontColor:a="black",textAlign:c="center",textBaseline:l="middle",fillStyle:h}=this.component.state,d=Math.abs(e)||1,u=Math.abs(n)||1,p=this.component.text,f=h&&"none"!==h?h:"transparent",g={bold:r,italic:i,fontFamily:s,fontSize:o,fontColor:a,textAlign:c,textBaseline:l,width:d,height:u,fillStyle:f};if("object"==typeof f&&"pattern"===f?.type&&f.image){return void gm(this.component.app.url(h.image),p,d,u,g,h,e=>{t.map&&t.map.dispose(),t.map=e,t.color.set(16777215),t.needsUpdate=!0})}const m=fm(p,d,u,g);m?(t.map&&t.map.dispose(),t.map=m,t.color.set(16777215),m.needsUpdate=!0):"string"==typeof h&&(""!==h&&"transparent"!==h?t.color.set(ch(h)):t.opacity=0)}updateAlpha(){const{alpha:t=1}=this.component.state,e=this.object3d.material;e.opacity=t,e.transparent=!0}}Ch("text",t=>new ym(t));class bm extends Sh{get syncZPosOffset(){return this.effectiveDepth}getObject3dInstance(){return new _.Mesh}build(){super.build();const{width:t,height:e}=this.component.bounds;if(!t||!e)return;const n=fh(this.component.state.material3d),r=new _.PlaneGeometry(1,1);r.rotateX(-Math.PI/2),this.object3d.geometry=r;const i=om(this.component);this.object3d.material=new _.MeshStandardMaterial({map:i,transparent:!0,side:_.DoubleSide,metalness:n.metalness,roughness:n.roughness,emissive:new _.Color(n.emissive),emissiveIntensity:n.emissiveIntensity}),this.object3d.castShadow=n.castShadow,this.object3d.receiveShadow=n.receiveShadow}updateDimension(){const{width:t,height:e}=this.component.bounds;this.object3d.scale.set(t,1,e)}updateAlpha(){const{alpha:t=1,fillStyle:e}=this.component.state;ah(this.object3d.material,t,e)}updateHidden(){this.object3d.visible=!this.component.state.hidden}_debouncedRebuild(){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this._rebuildTexture()},100)}_rebuildTexture(){this.clear(),this.build(),this.updateDimension(),this.updateTransform(),this.updateHidden()}updateFillStyle(){this._debouncedRebuild()}updateStrokeStyle(){this._debouncedRebuild()}updateText(){this._debouncedRebuild()}updateMaterial3d(){super.updateMaterial3d();const t=this.object3d.material;if(!t)return;const e=fh(this.component.state.material3d);t.metalness=e.metalness,t.roughness=e.roughness,t.emissive.set(e.emissive),t.emissiveIntensity=e.emissiveIntensity}clear(){return this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),_h(this.object3d),super.clear()}dispose(){this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),super.dispose()}}const vm={input:"css3d",select:"css3d",textarea:"css3d",button:"css3d",iframe:"css3d",video:"css3d",label:"texture",table:"texture",progress:"texture"};function _m(t){const e=function(t){const e=t.state?.material3d?.renderMode;if("css3d"===e||"texture"===e)return e;const n=t.model?.type??"";return vm[n]??"css3d"}(t);return"texture"===e?new bm(t):new Ah(t)}Ch("html-overlay-element",_m),Ch("html-overlay-container",_m);class xm{setShape({extrudedShape:t,extrudedOptions:e}){this.extrudedShape=t,this.bb=new _.Box2,this.bb.setFromPoints(this.extrudedShape?.extractPoints(0).shape),this.extrudedOptions=e}generateTopUV(t,e,n,r,i){const s=e[3*n],o=e[3*n+1],a=e[3*r],c=e[3*r+1],l=e[3*i],h=e[3*i+1],d=this.bb,u=d.max.x-d.min.x,p=d.max.y-d.min.y;return[new _.Vector2((s-d.min.x)/u,1-(o-d.min.y)/p),new _.Vector2((a-d.min.x)/u,1-(c-d.min.y)/p),new _.Vector2((l-d.min.x)/u,1-(h-d.min.y)/p)]}generateSideWallUV(t,e,n,r,i,s){const o=e[3*n],a=e[3*n+1],c=e[3*n+2],l=e[3*r],h=e[3*r+1],d=e[3*r+2],u=e[3*i],p=e[3*i+1],f=e[3*i+2],g=e[3*s],m=e[3*s+1],y=e[3*s+2],b=this.extrudedOptions?.depth||100,v=this.bb,x=v.max.x-v.min.x,w=v.max.y-v.min.y;return Math.abs(a-h)<.01?[new _.Vector2(o/x,1-c/b),new _.Vector2(l/x,1-d/b),new _.Vector2(u/x,1-f/b),new _.Vector2(g/x,1-y/b)]:[new _.Vector2(a/w,1-c/b),new _.Vector2(h/w,1-d/b),new _.Vector2(p/w,1-f/b),new _.Vector2(m/w,1-y/b)]}}class wm extends Sh{clear(){return this._mesh=void 0,super.clear()}get shape(){return null}get boundUVGenerator(){return this._boundUVGenerator||(this._boundUVGenerator=new xm),this._boundUVGenerator}build(){super.build();const t=this.effectiveDepth,e=this.shape;if(!e)return;const n=this.boundUVGenerator;n&&n.setShape({extrudedShape:e,extrudedOptions:{depth:t}});const r=this.createGeometry(e),i=this.createMaterials();this._mesh=new _.Mesh(r,i),this._mesh.rotation.x=-Math.PI/2,this._mesh.rotation.y=-Math.PI,this._mesh.rotation.z=-Math.PI,this._mesh.castShadow=!0,this.object3d.add(this._mesh),this.updateFillStyle(),this.updateStrokeStyle()}createGeometry(t){const e=this.effectiveDepth,{lineWidth:n=0}=this.component.state,r={steps:1,depth:e,bevelEnabled:n>0,bevelThickness:0,bevelSize:n,bevelSegments:1,UVGenerator:this.boundUVGenerator},i=new _.ExtrudeGeometry(t,r);return i.center(),i}createMaterials(){const t=fh(this.component.state.material3d),e=new _.MeshStandardMaterial;yh(e,t);const n=new _.MeshStandardMaterial;return yh(n,t),[e,n]}createTexture(){const{width:t,height:e}=this.component.bounds,n=um(t),r=um(e),i=th(n,r);this.component.render(i.getContext("2d"));const s=new _.CanvasTexture(i);return s.needsUpdate=!0,s.wrapS=_.RepeatWrapping,s.wrapT=_.RepeatWrapping,s.offset.set(0,1-e/r),s.repeat.set(t/n,e/r),s.minFilter=_.LinearFilter,s}getMaterials(){if(!this._mesh)return;const t=this._mesh.material;return Array.isArray(t)?t:void 0}updateMaterial3d(){super.updateMaterial3d();const t=this.getMaterials();if(!t)return;const e=fh(this.component.state.material3d);for(const n of t)yh(n,e)}updateAlpha(){const{alpha:t=1,fillStyle:e,strokeStyle:n}=this.component.state,r=this.getMaterials();r&&(ah(r[0],t,e),ah(r[1],t,n))}updateStrokeStyle(){const t=this.getMaterials();if(!t)return;const{strokeStyle:e}=this.component.state;t[1].color.set(ch(e))}updateFillStyle(){this._applyCapTexture()}updateText(){this._applyCapTexture()}_applyCapTexture(){const t=this.getMaterials();if(!t)return;const e=t[0],{fillStyle:n}=this.component.state,r=this.component.hasTextProperty?this.component.text:"";if(!r){const t=Sh.buildFillStyleTexture(this.component);return t?(e.map&&e.map.dispose(),e.map=t,e.color.set(16777215)):(e.map&&(e.map.dispose(),e.map=null),e.color.set(ch(n))),void(e.needsUpdate=!0)}const{width:i,height:s,bold:o=!1,italic:a=!1,fontFamily:c="Serif",fontSize:l=10,fontColor:h="black",textAlign:d="center",textBaseline:u="middle"}=this.component.state,p=Math.abs(i)||1,f=Math.abs(s)||1,g={bold:o,italic:a,fontFamily:c,fontSize:l,fontColor:h,textAlign:d,textBaseline:u,width:p,height:f,fillStyle:n};if("object"==typeof n&&"pattern"===n?.type&&n.image){return void gm(this.component.app.url(n.image),r,p,f,g,n,t=>{e.map&&e.map.dispose(),e.map=t,e.color.set(16777215),e.needsUpdate=!0})}e.map&&e.map.dispose();const m=fm(r,p,f,g);e.map=m,e.color.set(16777215),e.needsUpdate=!0}updateDimension(){super.updateDimension()}}class Mm extends wm{get shape(){const{cx:t=0,cy:e=0,rx:n=1,ry:r=1,startAngle:i=0,endAngle:s=2*Math.PI,anticlockwise:o=!1}=this.component.state,a=new _.EllipseCurve(t,e,Math.abs(n),Math.abs(r),i,s,o,0);return new _.Shape(a.getPoints(50))}}Ch("ellipse",t=>new Mm(t));class Sm extends wm{get shape(){const{width:t,height:e,round:n}=this.component.state,r=new _.Shape;if(n>0){const i=n/100*(t/2);r.moveTo(i,0),r.lineTo(t-i,0),r.quadraticCurveTo(t,0,t,i),r.lineTo(t,e-i),r.quadraticCurveTo(t,e,t-i,e),r.lineTo(i,e),r.quadraticCurveTo(0,e,0,e-i),r.lineTo(0,i),r.quadraticCurveTo(0,0,i,0)}else r.moveTo(0,0),r.lineTo(t,0),r.lineTo(t,e),r.lineTo(0,e),r.lineTo(0,0);return r}}Ch("rect",t=>new Sm(t));class Am extends wm{get shape(){const{path:t=[],round:e=0}=this.component.state,n=new _.Shape;for(let r=0;r<t.length;r++){const i=t[(r-1+t.length)%t.length],s=t[(r+t.length)%t.length],o=t[(r+1)%t.length];if(i.x===s.x&&i.y===s.y)continue;let a=Math.sqrt((i.x-s.x)*(i.x-s.x)+(i.y-s.y)*(i.y-s.y)),c=0!==a?Math.atan2(i.x-s.x,i.y-s.y):0,l=Math.sin(c)*Math.min(e,a/2)+s.x,h=Math.cos(c)*Math.min(e,a/2)+s.y;const d=e>0||0!==a?{x:l,y:h}:s;a=Math.sqrt((o.x-s.x)*(o.x-s.x)+(o.y-s.y)*(o.y-s.y)),c=0!==a?Math.atan2(o.x-s.x,o.y-s.y):0,l=Math.sin(c)*Math.min(e,a/2)+s.x,h=Math.cos(c)*Math.min(e,a/2)+s.y;const u=e>0||0!==a?{x:l,y:h}:s;0==r?n.moveTo(d.x,d.y):n.lineTo(d.x,d.y),e>0&&n.quadraticCurveTo(s.x,s.y,u.x,u.y)}return n}get minMax(){if(!this._minMax){const{path:t}=this.component.state;let e,n,r,i;t.forEach((t,s)=>{if(0==s)return e=r=t.x,void(n=i=t.y);e=Math.min(e,t.x),r=Math.max(r,t.x),n=Math.min(n,t.y),i=Math.max(i,t.y)}),this._minMax={minX:e,minY:n,maxX:r,maxY:i}}return this._minMax}}Ch("polygon",t=>new Am(t));class Em extends wm{get shape(){const{cx:t=0,cy:e=0,rx:n=1,ry:r=1,ratio:i=50,startAngle:s=0,endAngle:o=2*Math.PI,anticlockwise:a=!1}=this.component.state,c=Math.abs(n),l=Math.abs(r),h=new _.EllipseCurve(t,e,c,l,s,o,a,0),d=new _.Shape(h.getPoints(50)),u=c/100*i,p=l/100*i;if(u>0&&p>0){const n=new _.EllipseCurve(t,e,u,p,s,o,a,0),r=new _.Path(n.getPoints(50));d.holes.push(r)}return d}}Ch("donut",t=>new Em(t));class km extends wm{get shape(){const{x1:t=0,y1:e=0,x2:n=0,y2:r=0,x3:i=0,y3:s=0}=this.component.state,o=new _.Shape;return o.moveTo(t,e),o.lineTo(n,r),o.lineTo(i,s),o.closePath(),o}}Ch("triangle",t=>new km(t));class Cm extends wm{get shape(){const{ratio:t=30,wing:e=5,cx:n=0,cy:r=0,rx:i=1,ry:s=1}=this.component.state;if(e<3)return null;const o=Math.PI/2,a=2*Math.PI/e,c=i-t/100*i,l=s-t/100*s,h=new _.Shape;h.moveTo(n+i*Math.cos(-o),r+s*Math.sin(-o)),h.lineTo(n+(i-c)*(Math.cos(a-o)+Math.cos(0-o))/2,r+(s-l)*(Math.sin(a-o)+Math.sin(0-o))/2);for(let t=1;t<e;t++)h.lineTo(n+i*Math.cos(a*t-o),r+s*Math.sin(a*t-o)),h.lineTo(n+(i-c)*(Math.cos(a*(t+1)-o)+Math.cos(a*t-o))/2,r+(s-l)*(Math.sin(a*(t+1)-o)+Math.sin(a*t-o))/2);return h.closePath(),h}}Ch("star",t=>new Cm(t));const Tm={mutable:!1,resizable:!0,rotatable:!0,properties:[],help:"scene/component/sphere"};class Pm extends hm{buildGeometry(){const{rx:t=0,ry:e=0,rz:n}=this.component.state,r=n??t,i=new _.SphereGeometry(1,32,16);i.scale(t,r,e),this.object3d.geometry=i}updateDimension(){this.buildGeometry()}}t.Sphere=class extends Wf{get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new Pm(this)}get nature(){return Tm}},t.Sphere=pp([$g("sphere")],t.Sphere);const Dm={mutable:!1,resizable:!0,rotatable:!0,properties:[]};t.Sprite=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new cm(this)}get nature(){return Dm}},t.Sprite=pp([$g("sprite")],t.Sprite);const Om={mutable:!1,resizable:!0,rotatable:!0,properties:[],help:"scene/component/cube"};class zm extends hm{buildGeometry(){const{width:t=0,height:e=0,depth:n=0}=this.component.state,r=new _.BoxGeometry(1,1,1);r.scale(t,n,e),this.object3d.geometry=r}}t.Cube=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new zm(this)}get nature(){return Om}},t.Cube=pp([$g("cube")],t.Cube);const Im={mutable:!1,resizable:!0,rotatable:!0,properties:[],help:"scene/component/cylinder"};class Lm extends hm{buildGeometry(){const{rx:t=0,ry:e=0}=this.component.state,n=this.component.state.depth??1,r=new _.CylinderGeometry(1,1,1,25);r.scale(t||1,n||1,e||1),this.object3d.geometry=r}updateDimension(){this.buildGeometry()}}t.Cylinder=class extends Wf{get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new Lm(this)}get nature(){return Im}},t.Cylinder=pp([$g("cylinder")],t.Cylinder);const Rm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"color",label:"box-color",name:"boxColor",property:"boxColor"}],help:"scene/component/banner"};class jm extends Sh{build(){super.build();const{width:t=1,height:e=1,depth:n=1}=this.component.state;this.object3d.add(this.createCube(t,e,n));const r=this.createTextureBoard(t,n);r.position.set(0,0,.5*e+1),this.object3d.add(r)}createCube(t,e,n){const{boxColor:r="#ccaa76"}=this.component.state,i=fh(this.component.state.material3d),s=new _.BoxGeometry(t,n,e),o=new _.MeshStandardMaterial({color:r,side:_.FrontSide});yh(o,i);const a=new _.Mesh(s,o);return a.castShadow=i.castShadow,a.receiveShadow=i.receiveShadow,a}createTextureBoard(t,e){const n=fh(this.component.state.material3d),{fillStyle:r="#ccaa76"}=this.component.state,i=Sh.buildFillStyleTexture(this.component),s=new _.MeshStandardMaterial(i?{map:i}:{color:r||"#ccaa76",side:_.FrontSide});yh(s,n);const o=new _.PlaneGeometry(t,e,1,1),a=new _.Mesh(o,s);return a.castShadow=n.castShadow,a.receiveShadow=n.receiveShadow,a}updateMaterial3d(){super.updateMaterial3d();const t=fh(this.component.state.material3d);this.object3d.traverse(e=>{if(e.isMesh){const n=e.material;n&&yh(n,t),e.castShadow=t.castShadow,e.receiveShadow=t.receiveShadow}})}}var Fm;t.Banner=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}get nature(){return Rm}buildRealObject(){return new jm(this)}},t.Banner=pp([$g("banner")],t.Banner);const Bm={far:1e5,fov:80,near:1,zoom:1},Nm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"near",name:"near"},{type:"number",label:"far",name:"far"},{type:"number",label:"fov",name:"fov"},{type:"number",label:"zoom",name:"zoom"},{type:"checkbox",label:"show-helper",name:"showHelper"}],help:"scene/component/camera"};class Hm extends Sh{getObject3dInstance(){return new _.Mesh}updateCamera(){const{near:t=Bm.near,far:e=Bm.far,fov:n=Bm.fov,zoom:r=Bm.zoom,showHelper:i}=this.component.state;this.camera.far=e,this.camera.fov=n,this.camera.near=t,this.camera.zoom=r,i?this.helper||(this.helper=new _.CameraHelper(this.camera),this.object3d.add(this.helper)):this.helper&&(this.object3d.remove(this.helper),delete this.helper)}build(){super.build();const{width:t=0,height:e=0,depth:n=0,fillStyle:r="lightgray"}=this.component.state;this.object3d.geometry=new _.BoxGeometry(t,n,e),this.object3d.material=new _.MeshStandardMaterial({color:r,side:_.FrontSide}),this.camera=new _.PerspectiveCamera,this.camera.position.set(0,0,0),this.object3d.add(this.camera),this.object3d.lookAt(0,0,0),this.updateCamera()}}t.Camera=Fm=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}static get image(){return Fm._image||(Fm._image=new Image,Fm._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA1IAAANSAQMAAABV6G1EAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAABlBMVEX6+voBAQGV71ZvAAAFO0l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WFlvJc6Si0lGdzK88cV57bLj2PvgitLLSS0IpCKwgtL7Sc0qpCqwitLLSS0IpCKwgtL7Sc0qpCqwitLLSS0IpCKwgtL7Sc0qpCqwitLLSS0IpCKwgtL7Sc0qpCqwitLLSS0IpCKwgtL7Sc0qpCqxyyahcrH7JKFysJ54rCuYJwLi+cywnn+vdlLp+rCOfKwrnStXP95zLxiJX7WEFoeaHljO/xEqsaf9/FWqz1bM+VzloP655df2uxrnP9XPHKue7OeMDsuWInyx+Y67T1Yv0gs+cKvay6P5fvZZULrdnYFBbbcr2sdKF1MxbZFdZkLLItq3aay6/vJ102eusD2rJKl633nw/o3n+uxbrpLSv1svL6M95hQ3xYNz33t16sC21Zoc+28Xahm+u+Ic7WhbYs1+dRfrvQ5LpvHOaFNq3SZ8n/faEt6twDtli7wrJpxT6P1183/di0Ti36u3XT903Ld1qGrzf9smmdWhyTddNzf8t8UqdtK/dZGq8P2DZ1ZnHcrQ/osWO5PkvDuby7NE58Yctk7Qq3PSv3+bpc3F0aJ56wF+uLX9xu6eOb4es9z/vWc0vR3oZuByjnf2t/fP/54B/2WvvWEREREREREREREREREREREREREREREREREREREREREREREREREX2J/QlrTpqHD8xO1gAAAABJRU5ErkJggg=="),Fm._image}render(t){const{left:e,top:n,width:r,height:i}=this.bounds;t.beginPath(),this.drawImage(t,Fm.image,e,n,r,i)}buildRealObject(){return new Hm(this)}get nature(){return Nm}},t.Camera=Fm=pp([$g("camera")],t.Camera);const Vm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"gltf-selector",label:"url",name:"src",property:{displayField:"id",displayFullUrl:!0,baseUrlAlias:"$base_url",defaultStorage:"3d-model",storageFilters:{type:Array,value:[{name:"category",value:"image"}]},useUpload:!0,category:"application"},observe:function(t){this.parentNode.querySelector("[name=gltfInfo]").src=t;const e=this.parentNode.querySelector("[name=fillStyleTargets]");e&&(e.src=t);const n=this.parentNode.querySelector("[name=playTargets]");n&&(n.src=t)}},{type:"gltf-info",label:"",name:"gltfInfo",readonly:!0,property:{action:(t,e)=>{t._ratioLocking=!0;try{t.set(e)}finally{t._ratioLocking=!1}}},editor:{fullwidth:!0}},{type:"gltf-fill-targets",label:"fill-targets",name:"fillStyleTargets",editor:{fullwidth:!0}},{type:"gltf-play-targets",label:"play-targets",name:"playTargets",editor:{fullwidth:!0}}],"value-property":"source",help:"scene/component/gltf-object"};t.GLTFObject=class extends(Ya(Va)){constructor(){super(...arguments),this._ratioLocking=!1}get hasTextProperty(){return!1}is3dish(){return!0}get controls(){return[]}render(t){const{left:e,top:n,width:r,height:i}=this.bounds;t.beginPath();const s=this._topViewSnapshot;if(s)t.drawImage(s,e,n,r,i);else{t.rect(e,n,r,i),t.fillStyle="#f0f0f0",t.fill(),t.strokeStyle="#999",t.lineWidth=1,t.stroke();const s=this.getState("src"),o=s&&s.split("/").pop()?.replace(/\.[^.]+$/,"")||"GLTF",a=Math.max(10,.12*Math.min(r,i));t.fillStyle="#666",t.font=`${a}px sans-serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(o,e+r/2,n+i/2,.9*r)}}async ready(){await super.ready(),this._ensureTopViewSnapshot()}onchange(t,e){super.onchange(t,e),"src"in t&&(this._topViewSnapshot=void 0,this._ensureTopViewSnapshot())}_ensureTopViewSnapshot(){const t=this.getState("src");if(!t)return;const e=rp.getTopViewCache(t);if(e)return this._topViewSnapshot=e,void this.invalidate();const n=this.app.url(t);rp.loadGLTF(n).then(e=>{if(this.getState("src")!==t)return;const n=rp.getTopViewCache(t);if(n)return this._topViewSnapshot=n,void this.invalidate();const r=rp.renderTopView(e.scene);rp.setTopViewCache(t,r),this._topViewSnapshot=r,this.invalidate()})}buildRealObject(){return new rp(this)}get nature(){return Vm}get source(){return this.getState("src")}set source(t){this.setState("src",t)}set dimension(t){const{width:e=1,height:n=1,depth:r=1}=t;this.setState({width:e,height:n,depth:r}),this.realObject?.updateDimension()}_applyRatioLock(t){if(!("width"in t||"height"in t||"depth"in t))return t;const e=this.state.width||1,n=this.state.height||1,r=this.state.depth||1,i=Uh([(t.width??e)/e,(t.height??n)/n,(t.depth??r)/r]);return i?{...t,width:Math.round(e*i),height:Math.round(n*i),depth:Math.round(r*i)}:t}set(t,e){"string"==typeof t&&(t={[t]:e}),this.state.ratioLock&&!this._ratioLocking&&(this._ratioLocking=!0,t=this._applyRatioLock(t));try{return super.set(t)}finally{this._ratioLocking=!1}}setState(t,e){"string"==typeof t&&(t={[t]:e}),this.state.ratioLock&&!this._ratioLocking&&(this._ratioLocking=!0,t=this._applyRatioLock(t));try{return super.setState(t)}finally{this._ratioLocking=!1}}get play(){return!1!==this.getState("play")}set play(t){this.setState("play",t)}get nodes(){return this.getState("nodes")}set nodes(t){this.setState("nodes",t)}get animations(){return this.getState("animations")}set animations(t){this.setState("animations",t)}get playTargets(){return this.getState("playTargets")}set playTargets(t){this.setState("playTargets",t)}get fillStyleTargets(){return this.getState("fillStyleTargets")}set fillStyleTargets(t){this.setState("fillStyleTargets",t)}get nodeNames(){const t=this.realObject;return t?.nodeNames??[]}get animationNames(){const t=this.realObject;return t?.animationNames??[]}},t.GLTFObject=pp([$g("gltf-object")],t.GLTFObject);const Gm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"select",label:"light-type",name:"lightType",property:{options:["","point","directional"]}},{type:"number",label:"intensity",name:"intensity"},{type:"number",label:"distance",name:"distance"},{type:"number",label:"decay",name:"decay"},{type:"checkbox",label:"cast-shadow",name:"castShadow"},{type:"number",label:"near",name:"near",placeholder:"0.5"},{type:"number",label:"far",name:"far",placeholder:"1000"},{type:"number",label:"fov",name:"fov",placeholder:"90"},{type:"number",label:"zoom",name:"zoom",placeholder:"1"},{type:"checkbox",label:"show-helper",name:"showHelper"}],help:"scene/component/light"};class Ym extends Sh{updatePointLight(){const{lightType:t="point",distance:e=0,intensity:n=10,decay:r=1,fillStyle:i="white",castShadow:s,near:o=.5,far:a=1e3,fov:c=90,zoom:l=1,showHelper:h}=this.component.state;if(this.object3d.color=new _.Color(i),"point"==t&&(this.object3d.distance=e,this.object3d.decay=r),this.object3d.intensity=n,this.object3d.castShadow=s,s){const t=this.object3d.shadow?.camera;t.far=a,t.near=o,t.fov=c,t.zoom=l}if(h){const t=this.object3d.shadow?.camera;this.helper||(this.helper=new _.CameraHelper(t),this.object3d.add(this.helper))}else this.helper&&(this.object3d.remove(this.helper),delete this.helper)}getObject3dInstance(){const{lightType:t="point"}=this.component.state;return"point"==t?new _.PointLight:new _.DirectionalLight}update(){this.clear(),this.build(),this.updateDimension(),this.updateHidden(),this.updatePointLight()}}t.PointLight=class extends Wf{get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new Ym(this)}get anchors(){return[]}get nature(){return Gm}},t.PointLight=pp([$g("light")],t.PointLight);const Um={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"depth",name:"depth",property:"depth"}],help:"scene/component/wall"};class $m extends hm{buildGeometry(){const{width:t=0,height:e=0,depth:n=0}=this.component.state,r=new _.BoxGeometry(1,1,1);r.scale(t,n,e),this.object3d.geometry=r}}t.Wall=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new $m(this)}get nature(){return Um}},t.Wall=pp([$g("wall")],t.Wall);const Wm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"depth",name:"depth",property:"depth"}],help:"scene/component/floor-plate"};class qm extends Sh{clear(){return this._topTexture&&(this._topTexture.dispose(),this._topTexture=void 0),this._mesh=void 0,super.clear()}build(){super.build();const{width:t,height:e,depth:n=1}=this.component.state;if(!t||!e)return;const r=Math.abs(t),i=Math.abs(e),s=Math.max(n,.5),o=new _.BoxGeometry(r,s,i),a=this._buildTopMaterial(),c=this._buildSideMaterial(),l=[c,c,a,c,c,c];this._mesh=new _.Mesh(o,l),this._mesh.position.y=s/2,this._mesh.receiveShadow=!0,this._mesh.castShadow=!1,this.object3d.add(this._mesh)}_buildTopMaterial(){const{alpha:t=1}=this.component.state,e=fh(this.component.state.material3d),n=Sh.buildFillStyleTexture(this.component);if(n){this._topTexture=n;const r=new _.MeshStandardMaterial({map:n,side:_.DoubleSide,transparent:!0,opacity:t,depthWrite:t>=.9});return yh(r,e),r}const{fillStyle:r}=this.component.state,i="string"==typeof r&&"none"!==r?r:"#e0e0e0",s=new _.MeshStandardMaterial({color:i,side:_.DoubleSide,transparent:!0,opacity:t,depthWrite:t>=.9});return yh(s,e),s}_buildSideMaterial(){const{strokeStyle:t,alpha:e=1}=this.component.state,n="string"==typeof t&&t?t:"#999999";return new _.MeshStandardMaterial({color:n,side:_.DoubleSide,transparent:!0,opacity:.8*e,depthWrite:e>=.9})}updateAlpha(){if(!this._mesh)return;const{alpha:t=1}=this.component.state,e=this._mesh.material;for(let n=0;n<e.length;n++){const r=e[n];r.opacity=2===n?t:.8*t,r.transparent=!0,r.depthWrite=t>=.9}}updateFillStyle(){if(!this._mesh)return;this._topTexture&&(this._topTexture.dispose(),this._topTexture=void 0);const t=this._mesh.material;t[2].dispose(),t[2]=this._buildTopMaterial()}updateStrokeStyle(){if(!this._mesh)return;const t=this._mesh.material,e=this._buildSideMaterial();for(let n=0;n<t.length;n++)2!==n&&(t[n].dispose(),t[n]=e)}}function Xm(t,e){return"none"===t?0:t.endsWith("arrow")?1.5*e:0}function Km(t,e,n,r){const i=[];for(let s=1;s<=r;s++){const o=s/r,a=1-o;i.push(new _.Vector3(a*a*t.x+2*a*o*e.x+o*o*n.x,a*a*t.y+2*a*o*e.y+o*o*n.y,a*a*t.z+2*a*o*e.z+o*o*n.z))}return i}t.FloorPlate=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new qm(this)}get nature(){return Wm}},t.FloorPlate=pp([$g("floor-plate")],t.FloorPlate);class Qm extends Sh{getObject3dInstance(){return new _.Group}get gizmoTransformable(){return!0}get syncZPosOffset(){return 0}syncFromObject3D(){}applyDimensionFromGizmo(t){}build(){super.build(),this._buildLine()}get smoothedPath(){const t=this.worldPath;if(t.length<2)return t;const{round:e=0}=this.component.state;if(e<=0||t.length<3)return t;const n=[];n.push(t[0]);for(let r=1;r<t.length;r++){const i=t[r-1],s=t[r],o=t[r+1];if(!o){n.push(s);break}const a=i.x-s.x,c=i.y-s.y,l=i.z-s.z,h=Math.sqrt(a*a+c*c+l*l),d=Math.min(e,h/2),u=o.x-s.x,p=o.y-s.y,f=o.z-s.z,g=Math.sqrt(u*u+p*p+f*f),m=Math.min(e,g/2),y=h>0?new _.Vector3(s.x+a/h*d,s.y+c/h*d,s.z+l/h*d):s.clone(),b=g>0?new _.Vector3(s.x+u/g*m,s.y+p/g*m,s.z+f/g*m):s.clone();n.push(y),n.push(...Km(y,s,b,8))}return n}_buildLine(){const t=this.smoothedPath;if(t.length<2)return;const{strokeStyle:e,lineWidth:n=2,alpha:o=1,lineDash:a,begin:c="none",beginSize:l="size5",end:h="none",endSize:d="size5"}=this.component.state,u=Math.max(n,1),p="string"==typeof e&&"transparent"!==e?ch(e):"#000000",f=new _.Color(p),g=this._getResolution(),m=c,y=h,b=Xm(m,u),v=Xm(y,u),x=t[0],w=t[t.length-1],M=(new _.Vector3).subVectors(t[1],x).normalize(),S=(new _.Vector3).subVectors(t[t.length-2],w).normalize(),A=[...t];b>0&&(A[0]=x.clone().add(M.clone().multiplyScalar(b))),v>0&&(A[A.length-1]=w.clone().add(S.clone().multiplyScalar(v)));const E=new s.LineGeometry;E.setPositions(A.flatMap(t=>[t.x,t.y,t.z]));const k=function(t,e){switch(t){case"round-dot":return{dashSize:e,gapSize:e};case"square-dot":return{dashSize:2*e,gapSize:e};case"dash":return{dashSize:4*e,gapSize:1.5*e};case"dash-dot":return{dashSize:4*e,gapSize:2*e};case"long-dash":return{dashSize:6*e,gapSize:3*e};case"long-dash-dot":return{dashSize:6*e,gapSize:2*e};case"long-dash-dot-dot":return{dashSize:6*e,gapSize:e};default:return null}}(a,u),C=new i.LineMaterial({color:f.getHex(),linewidth:u,worldUnits:!0,transparent:o<1,opacity:o,resolution:g,dashed:!!k,dashSize:k?.dashSize??1,gapSize:k?.gapSize??1,dashScale:1});if(this._line2=new r.Line2(E,C),this._line2.computeLineDistances(),this.object3d.add(this._line2),"none"!==m){const t=rh(m,nh(l,u));if(t){const e=(new _.Quaternion).setFromUnitVectors(new _.Vector3(1,0,0),M.clone().negate());this._placeTip(t,x,e,f,o,g)}}if("none"!==y){const t=rh(y,nh(d,u));if(t){const e=(new _.Quaternion).setFromUnitVectors(new _.Vector3(1,0,0),S.clone().negate());this._placeTip(t,w,e,f,o,g)}}}_placeTip(t,e,n,r,i,s){const o=t.mesh||t.line2||t.group;if(o){if(o.position.copy(e),o.setRotationFromQuaternion(n),t.mesh){const e=t.mesh.material;e.color.copy(r),e.transparent=i<1,e.opacity=i}else if(t.line2){const e=t.line2.material;e.color.copy(r),e.transparent=i<1,e.opacity=i,e.resolution.copy(s)}else t.group&&t.group.traverse(t=>{if(t.material){const e=t.material;e.color&&e.color.copy(r),e.transparent=i<1,e.opacity=i,e.resolution&&e.resolution.copy(s)}});this.object3d.add(o)}}_getResolution(){const t=this.threeContainer?.renderer3d;if(t){return t.getSize(new _.Vector2)}return new _.Vector2(window.innerWidth,window.innerHeight)}onGizmoDragEnd(t){const e=this._component,n=e.path;if(!n||n.length<2)return;const r=this.object3d,{width:i=0,height:s=0}=e.parent?.bounds??{},{x:o,y:a}=e.center,c=r.position,l=r.rotation,h=r.scale,d=this.position;if(Math.abs(c.x-d.x)<.001&&Math.abs(c.y-d.y)<.001&&Math.abs(c.z-d.z)<.001&&Math.abs(l.x)<.001&&Math.abs(l.y)<.001&&Math.abs(l.z)<.001&&Math.abs(h.x-1)<.001&&Math.abs(h.y-1)<.001&&Math.abs(h.z-1)<.001)return;const u=Qm.computeBakedPath(n,{x:o,y:a},{width:i,height:s},r);this._suppressOnchange=!0,e.set({rotation:0,rotationX:0,rotationY:0,zPos:0}),e.mutatePath(null,()=>u),this._suppressOnchange=!1,this.update()}static computeBakedPath(t,e,n,r){const i=n.width,s=n.height,o=e.x,a=e.y;return r.updateMatrixWorld(!0),t.map(t=>{const e=new _.Vector3(t.x-o,t.z||0,t.y-a).applyMatrix4(r.matrixWorld),n={x:e.x+i/2,y:e.z+s/2};return Math.abs(e.y)>.001&&(n.z=e.y),n})}updateStrokeStyle(){this.updateDimension()}updateAlpha(){this.updateDimension()}updateDimension(){this.clear(),this.build()}onchange(t,e){("path"in t||"from"in t||"to"in t)&&(this.updateDimension(),this.updatePosition()),("round"in t||"lineDash"in t||"lineWidth"in t||"begin"in t||"end"in t||"beginSize"in t||"endSize"in t)&&this.updateDimension(),super.onchange(t,e)}clear(){for(;this.object3d.children.length>0;){const t=this.object3d.children[0];this.object3d.remove(t),_h(t)}return this._line2=void 0,super.clear()}}class Zm extends Qm{get worldPath(){const t=this.component.path;if(!t||t.length<2)return[];const{x:e,y:n}=this.component.center;return t.map(t=>new _.Vector3(t.x-e,t.z||0,t.y-n))}}Ch("line",t=>new Zm(t));class Jm extends Qm{get worldPath(){const t=this.component.path;if(!t||t.length<2)return[];const{x:e,y:n}=this.component.center;return t.map(t=>new _.Vector3(t.x-e,t.z||0,t.y-n))}}Ch("polyline",t=>new Jm(t));class ty extends Sh{getObject3dInstance(){return new _.Group}get allowedGizmoModes(){return this.component.isGroup?.()?["translate"]:null}}Ch("group",t=>new ty(t));class ey extends Sh{build(){super.build()}update(){}}const ny={far:1e5,fov:80,near:1,zoom:1};class ry extends Sh{build(){super.build()}update(){super.update(),this.updateCamera()}getObject3dInstance(){return new _.PerspectiveCamera}updateCamera(){const{near:t=ny.near,far:e=ny.far,fov:n=ny.fov,zoom:r=ny.zoom}=this.component.state;this.object3d.far=e,this.object3d.fov=n,this.object3d.near=t,this.object3d.zoom=r}}class iy extends hm{buildGeometry(){const{width:t,height:e}=this.component.state.dimension;this.object3d.geometry=new _.PlaneGeometry(t,e)}buildMaterial(){this.object3d.material=new _.MeshStandardMaterial({opacity:0,side:_.DoubleSide,blending:_.NoBlending})}}class sy extends Sh{getObject3dInstance(){return new _.Scene}dispose(){for(const t of this.object3d.children)_h(t);this._animationMixer&&(this._animationMixer.stopAllAction(),this._animationMixer.uncacheRoot(this.object3d),this._animationMixer=void 0),super.dispose()}clear(){return this._floor&&(this.object3d.remove(this._floor),this._floor.material instanceof Array?this._floor.material.forEach(t=>t.dispose()):this._floor.material.dispose(),this._floor.geometry.dispose(),delete this._floor),super.clear()}get floor(){return this._floor}set floor(t){this._floor&&(this.object3d.remove(this._floor),this._floor.clear(),delete this._floor),t&&(this._floor=t,this.object3d.add(t)),this.component.invalidate()}build(){super.build(),this.floor=Ih(this.component)}updateTransform(){}updateDimension(){}updatePosition(){}updateRotate(){}updateScale(){}updateAlpha(){}updateHidden(){}get animationMixer(){return this._animationMixer||(this._animationMixer=new _.AnimationMixer(this.object3d)),this._animationMixer}}const oy={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"select",label:"precision",name:"precision",property:{options:[{display:"High",value:"highp"},{display:"Medium",value:"mediump"},{display:"Low",value:"lowp"}]}},{type:"checkbox",label:"anti-alias",name:"antialias",property:"antialias"},{type:"checkbox",label:"3dmode",name:"threed",property:"threed"},{type:"checkbox",label:"auto-rotate",name:"autoRotate",property:"autoRotate"},{type:"checkbox",label:"debug",name:"debug",property:"debug"}],help:"scene/component/three-container"};var ay;t.ThreeContainer=class extends Df{constructor(){super(...arguments),this._capability=new nd}get sceneManager(){return this._capability.sceneManager}get cameraManager(){return this._capability.cameraManager}get rendererManager(){return this._capability.rendererManager}get lightManager(){return this._capability.lightManager}get controlsManager(){return this._capability.controlsManager}get eventManager(){return this._capability.eventManager}containable(t){return!0}is3dContainer(){return!0}getLightingConfig(){return{hemisphere:{skyColor:16777215,groundColor:14540253,intensity:1},directional:{color:16777215,intensity:1.2,attachToCamera:!0,castShadow:!1}}}getCss3DSceneAttribute(){return"three-container:css3d-renderer"}init_scene3d(){this._capability.isInitialized&&this._capability.destroy(),this._capability.init(this,{lightingConfig:this.getLightingConfig(),css3DSceneAttribute:this.getCss3DSceneAttribute(),skipEnvironment:!0,skipPostprocessing:!0,skipShadowMap:!0}),this._capability.buildOverlays(),this._capability.resize(),this.onchangeData&&this.onchangeData(this.data,this.data)}destroy_scene3d(){this.stop(),this._capability.destroy()}stop(){}resize(){this._capability.resize()}get scene3d(){return this._capability.isInitialized||this.init_scene3d(),this._capability.scene3d}get renderer3d(){return this._capability.renderer3d}get mixer(){return this._capability.mixer}get css3DScene(){return this._capability.css3DScene}get css3DRenderer(){return this._capability.css3DRenderer}render_threed(){this._capability.renderThreeD()}get _parentIs3dMode(){return!!this.rootModel?.is3dMode}render(t){this._parentIs3dMode||(this.app.isViewMode&&this.setState("threed",!0),!this.state.threed||this._capability.noSupportWebgl?super.render(t):this._capability.camera&&this._capability.renderCSS3D())}postrender(t){if(this._parentIs3dMode)return;const{left:e,top:n,debug:r,threed:i}=this.state;let{width:s,height:o}=this.bounds;if(s=Math.floor(s),o=Math.floor(o),i){if(this._capability.isInitialized||this.init_scene3d(),this._capability.noSupportWebgl)return void this._capability.showWebglNoSupportText(t,this.state.width,this.state.height);if(!this._capability.renderer3d)return;this._capability.renderThreeD();const i=this._capability.domElement;if(!i||!i.width||!i.height)return;t.drawImage(i,0,0,i.width,i.height,e,n,s,o),r&&this._capability.showDebugFPS(t)}else super.postrender(t)}dispose(){this._capability.dispose(),super.dispose()}get layout(){return Ka.get("three")}get nature(){return oy}getObjectByRaycast(){return this._capability.getObjectByRaycast()}getObjectsByRaycast(){return this._capability.getObjectsByRaycast()}onchange(t,e){(t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&this._capability.destroy(),this._capability.onchange(t)}onmousedown(t){this._capability.onMouseDown(t)}onmouseup(t){this._capability.onMouseUp(t)}onmousemove(t){this._capability.onMouseMove(t)}onmouseleave(t){this._capability.onMouseLeave(t)}onwheel(t){this._capability.onWheel(t)&&this.invalidate()}ondblclick(t){this._capability.onDblClick(t)&&this.invalidate()}ondragstart(t){this._capability.onDragStart(t)}ondragmove(t){this._capability.onDragMove(t)&&this.invalidate()}ondragend(t){this._capability.onDragEnd(t)&&this.invalidate()}ontouchstart(t){this._capability.onTouchStart(t)}onpan(t){this._capability.onPan(t)&&this.invalidate()}ontouchend(t){this._capability.onTouchEnd(t)}onkeydown(t){this._capability.onKeyDown(t)}onpinch(t){this._capability.onPinch(t)&&this.invalidate()}ondoubletap(){this._capability.onDoubleTap(),this.invalidate()}},t.ThreeContainer=pp([$g("3d-container")],t.ThreeContainer),Th(t=>{const e=t.state.material3d?.spriteMode;return"plane"===e?new lm(t):new cm(t)}),t.Model=void 0,(ay=t.Model||(t.Model={})).compile=tl,ay.duplicate=el,ay.select=fa,ay.match=da,_r.registerResidents(()=>({componentResidentsCount:Ha.residentsCount,sceneResidentsCount:hp.residentsCount,referenceMapResidentsCount:Xg.residentsCount,sceneResidents:Ha.residents}));var cy=Object.freeze({__proto__:null,AbsoluteLayout:Za,Animation:Fo,AudioPlayer:bg,get Banner(){return t.Banner},Banner3D:jm,BoxSelectionManager:Zh,get Camera(){return t.Camera},Camera3D:Hm,CameraBookmarkManager:Qh,CameraManager:jh,CardLayout:tc,Component:Ha,Connectable:gd,Container:Df,ContainerAbstract:yc,ControlsManager:Hh,get Cube(){return t.Cube},Cube3D:zm,get Cylinder(){return t.Cylinder},Cylinder3D:Lm,DEFAULT:Mi,DPPX:_i,DataLagTracker:Lu,DataSource:Ug,Donut:Lg,DonutExtrude:Em,Ellipse:Wf,EllipseExtrude:Mm,EventManager3D:Vh,EventMap:mu,FPS:Zl,get FloorPlate(){return t.FloorPlate},GESTURES:xi,get GLTFObject(){return t.GLTFObject},GifView:mg,GizmoManager:Gh,GizmoOperationManager:$h,GlobalRef:Eg,Group:xg,HTMLAbsoluteLayout:Qa,HTMLOverlayContainer:Sg,HTMLOverlayElement:ig,ImageView:rg,InfoWindow:qa,InteractionManager:Wh,KEYEVENTS:wi,Layer:bc,Layout:Ka,LightManager:Bh,LightObject:Ym,Line:Uf,Line3D:Zm,LinearHorizontalLayout:nc,LinearVerticalLayout:ic,LoadTracker:ju,LoadingOverlay:Ju,LocalRef:Mg,MATERIAL_PRESETS:ph,MAX_UNDO_SIZE:30,MODE_ADD:3,MODE_EDIT:1,MODE_PASTE_DATABIND:5,MODE_PASTE_STYLE:4,MODE_SHIFT:2,MODE_VIEW:0,get Model(){return t.Model},MoveHandle:gc,NOTHING:bi,Node:Ng,OrthoLine:eg,PIXEL_RATIO:Jl,Path:Pg,PlacementManager:qh,get PointLight(){return t.PointLight},Polygon:Kf,PolygonExtrude:Am,Polyline:Jf,Polyline3D:Jm,Popup:Tg,RealObject:Sh,RealObjectCamera:ry,RealObjectDomElement:Ah,RealObjectDomTexture:bm,RealObjectDummy:ey,RealObjectExtrude:wm,RealObjectGLTF:rp,RealObjectGroup:ty,RealObjectLine:Qm,RealObjectMesh:hm,RealObjectPlane:iy,RealObjectPlane2D:lm,RealObjectScene:sy,RealObjectService:Hg,RealObjectSprite:im,RealObjectSprite2D:cm,RealObjectText:ym,Rect:bd,RectExtrude:Sm,RectPath:Ya,ReferenceMap:Xg,RendererManager:Fh,RootContainer:zu,Ruler:_d,SCALE_MIN:oh,SCENE_MODE:vi,Scene:hp,SceneManager:Rh,ScenePopup:pc,SceneSearchEngine:sp,ScriptLoader:nm,SearchOverlay:ap,ServiceComponent:Gg,Shape:Va,get Sphere(){return t.Sphere},Sphere3D:Pm,get Sprite(){return t.Sprite},Star:Fg,StarExtrude:Cm,TableLayout:sc,Text:vg,ThreeCapability:nd,get ThreeContainer(){return t.ThreeContainer},TransitionEffect:Pu,Triangle:Og,TriangleExtrude:km,UNIT_DIMENSION:lh,UNIT_ROTATE:uh,UNIT_SCALE:hh,UNIT_TRANSLATE:dh,ValueHolder:Yg,VertexGizmoManager:ed,get Wall(){return t.Wall},Wall3D:$m,animate:jo,applyAlpha:ah,applyMaterial3dProps:yh,buildArrow3D:sh,compile:No,create:up,createCanvas:th,createCanvasTexture:om,createFloor:Ih,createRealObjectFor:Ph,debug:jr,delta:Lo,disposeObject3D:_h,drawTextTexture:pm,error:Lr,fontStyle:dm,initFontFamilyWatcher:Ai,inspector:Xu,metrics:_r,opaqueColor:ch,projectToScreen:Ac,registerDefaultRealObjectFactory:Th,registerRealObjectFactory:Ch,renderCanvasTexture:am,resolveMaterial3d:fh,sceneComponent:$g,stopFPSMeasure:Ql,textBounds:mm,textTexture:fm,toThreeSide:mh,updateDefaultFontFamily:Si,version:rm,warn:Rr});const ly=globalThis;"undefined"==typeof globalThis||ly.scene||(ly.scene=cy),t.AbsoluteLayout=Za,t.Animation=Fo,t.AudioPlayer=bg,t.Banner3D=jm,t.BoxSelectionManager=Zh,t.Camera3D=Hm,t.CameraBookmarkManager=Qh,t.CameraManager=jh,t.CardLayout=tc,t.Component=Ha,t.Connectable=gd,t.Container=Df,t.ContainerAbstract=yc,t.ControlsManager=Hh,t.Cube3D=zm,t.Cylinder3D=Lm,t.DEFAULT=Mi,t.DPPX=_i,t.DataLagTracker=Lu,t.DataSource=Ug,t.Donut=Lg,t.DonutExtrude=Em,t.Ellipse=Wf,t.EllipseExtrude=Mm,t.EventManager3D=Vh,t.EventMap=mu,t.FPS=Zl,t.GESTURES=xi,t.GifView=mg,t.GizmoManager=Gh,t.GizmoOperationManager=$h,t.GlobalRef=Eg,t.Group=xg,t.HTMLAbsoluteLayout=Qa,t.HTMLOverlayContainer=Sg,t.HTMLOverlayElement=ig,t.ImageView=rg,t.InfoWindow=qa,t.InteractionManager=Wh,t.KEYEVENTS=wi,t.Layer=bc,t.Layout=Ka,t.LightManager=Bh,t.LightObject=Ym,t.Line=Uf,t.Line3D=Zm,t.LinearHorizontalLayout=nc,t.LinearVerticalLayout=ic,t.LoadTracker=ju,t.LoadingOverlay=Ju,t.LocalRef=Mg,t.MATERIAL_PRESETS=ph,t.MAX_UNDO_SIZE=30,t.MODE_ADD=3,t.MODE_EDIT=1,t.MODE_PASTE_DATABIND=5,t.MODE_PASTE_STYLE=4,t.MODE_SHIFT=2,t.MODE_VIEW=0,t.MoveHandle=gc,t.NOTHING=bi,t.Node=Ng,t.OrthoLine=eg,t.PIXEL_RATIO=Jl,t.Path=Pg,t.PlacementManager=qh,t.Polygon=Kf,t.PolygonExtrude=Am,t.Polyline=Jf,t.Polyline3D=Jm,t.Popup=Tg,t.RealObject=Sh,t.RealObjectCamera=ry,t.RealObjectDomElement=Ah,t.RealObjectDomTexture=bm,t.RealObjectDummy=ey,t.RealObjectExtrude=wm,t.RealObjectGLTF=rp,t.RealObjectGroup=ty,t.RealObjectLine=Qm,t.RealObjectMesh=hm,t.RealObjectPlane=iy,t.RealObjectPlane2D=lm,t.RealObjectScene=sy,t.RealObjectService=Hg,t.RealObjectSprite=im,t.RealObjectSprite2D=cm,t.RealObjectText=ym,t.Rect=bd,t.RectExtrude=Sm,t.RectPath=Ya,t.ReferenceMap=Xg,t.RendererManager=Fh,t.RootContainer=zu,t.Ruler=_d,t.SCALE_MIN=oh,t.SCENE_MODE=vi,t.Scene=hp,t.SceneManager=Rh,t.ScenePopup=pc,t.SceneSearchEngine=sp,t.ScriptLoader=nm,t.SearchOverlay=ap,t.ServiceComponent=Gg,t.Shape=Va,t.Sphere3D=Pm,t.Star=Fg,t.StarExtrude=Cm,t.TableLayout=sc,t.Text=vg,t.ThreeCapability=nd,t.TransitionEffect=Pu,t.Triangle=Og,t.TriangleExtrude=km,t.UNIT_DIMENSION=lh,t.UNIT_ROTATE=uh,t.UNIT_SCALE=hh,t.UNIT_TRANSLATE=dh,t.ValueHolder=Yg,t.VertexGizmoManager=ed,t.Wall3D=$m,t.animate=jo,t.applyAlpha=ah,t.applyMaterial3dProps=yh,t.buildArrow3D=sh,t.compile=No,t.create=up,t.createCanvas=th,t.createCanvasTexture=om,t.createFloor=Ih,t.createRealObjectFor=Ph,t.debug=jr,t.delta=Lo,t.disposeObject3D=_h,t.drawTextTexture=pm,t.error=Lr,t.fontStyle=dm,t.initFontFamilyWatcher=Ai,t.inspector=Xu,t.metrics=_r,t.opaqueColor=ch,t.projectToScreen=Ac,t.registerDefaultRealObjectFactory=Th,t.registerRealObjectFactory=Ch,t.renderCanvasTexture=am,t.resolveMaterial3d=fh,t.sceneComponent=$g,t.stopFPSMeasure=Ql,t.textBounds=mm,t.textTexture=fm,t.toThreeSide=mh,t.updateDefaultFontFamily=Si,t.version=rm,t.warn=Rr});
|
|
72
|
+
`,this.element)}catch(t){}}onchangeMinimized(){const{minimized:t}=this.state;t?this.setState("height",24):this.setState("height",this.get("height"))}}kf=new WeakMap,Ha.memoize(Df.prototype,"bounds",!0),Ha.register("container",Df);const Of=Math.sqrt(3),zf=2;function If(t,e,n,r,i){const s=5+i,o=n.x,a=n.y,c=r.x,l=r.y;if(Math.abs(o-c)>s&&Math.abs(a-l)>s){const n=(l-a)/(c-o),r=a-n*o;if(Math.abs(e-(n*t+r))>s)return!1}let h,d,u,p;return o>c?(d=o,h=c):(d=c,h=o),a>l?(p=a,u=l):(p=l,u=a),!(d+5<t)&&(!(h-5>t)&&(!(p+5<e)&&!(u-5>e)))}function Lf(t,e,n,r=2){for(let i=0;i<n.length-1;i++)if(If(t,e,n[i],n[i+1],r))return!0;return!1}function Rf(t,e,n,r){if("arrow"!=t.slice(-5))return n;const i=Math.atan2(r.y-n.y,r.x-n.x),s=1.5*e;return{x:n.x+Math.cos(i)*s,y:n.y+Math.sin(i)*s}}function jf(t,e,n){let{lineWidth:r=zf,strokeStyle:i="#000000",lineCap:s=!1,alpha:o=1,begin:a="none",end:c="none",beginSize:l="size5",endSize:h="size5"}=n;if(("none"!=a||"none"!=c)&&(r=Number(r)||zf,t.lineCap=s,t.lineWidth=r,t.strokeStyle=i,t.fillStyle=i,t.globalAlpha*=o,"none"!=a&&Ff(t,e[0],e[1],r,a,Bf(l,r)),"none"!=c)){const n=e.length;Ff(t,e[n-1],e[n-2],r,c,Bf(h,r))}}function Ff(t,e,n,r,i,s){const{x:o,y:a}=e,c=Math.atan2(n.y-a,n.x-o);switch(t.beginPath(),t.translate(o,a),t.rotate(c),i){case"oval":t.ellipse(0,0,s.X,s.Y,0,0,2*Math.PI),t.fill();break;case"diamond":t.moveTo(-s.X,0),t.lineTo(0,-s.Y),t.lineTo(s.X,0),t.lineTo(0,s.Y),t.fill();break;case"arrow":t.moveTo(0,0),t.lineTo(Of*s.X,-s.Y),t.lineTo(Of*s.X,s.Y),t.fill();break;case"sharp-arrow":t.moveTo(0,0),t.lineTo(Of*s.X,-s.Y),t.lineTo(-s.X/1.5+Of*s.X,0),t.lineTo(Of*s.X,s.Y),t.fill();break;case"open-arrow":t.moveTo(Of*s.X+r,-s.Y),t.lineTo(r,0),t.lineTo(Of*s.X+r,s.Y),t.stroke();break;case"cross":t.moveTo(-s.X,-s.Y),t.lineTo(s.X,s.Y),t.moveTo(s.X,-s.Y),t.lineTo(-s.X,s.Y),t.stroke()}t.rotate(-c),t.translate(-o,-a),t.closePath()}function Bf(t,e){const n={X:0,Y:0};switch(e*=1.2,t){case"size1":n.X=e,n.Y=e;break;case"size2":n.X=1.5*e,n.Y=e;break;case"size3":n.X=2*e,n.Y=e;break;case"size4":n.X=e,n.Y=1.5*e;break;case"size5":default:n.X=1.5*e,n.Y=1.5*e;break;case"size6":n.X=2*e,n.Y=1.5*e;break;case"size7":n.X=e,n.Y=2*e;break;case"size8":n.X=1.5*e,n.Y=2*e;break;case"size9":n.X=2*e,n.Y=2*e}return n}const Nf="N",Hf="S",Vf="E",Gf="W";class Yf{constructor({component:t,anchor:e,position:n,self:r}){this.component=t,this._anchorName=e,this._position=n,this.self=r}get position(){const t=this.anchor;if(t){const{position:e}=t,n=this.component.toScene(e.x,e.y);return this.self.transcoordT2P(n.x,n.y)}return this._position}set position({x:t,y:e}){this._position={x:t,y:e}}get anchor(){return this.component?.findAnchor(this._anchorName)}get direction(){const t=this.component.bounds,e=this.anchor;if(!e)return Vf;const n=e.position;return n.y<=t.top?Nf:n.y>=t.top+t.height?Hf:n.x<=t.left?Gf:Vf}get boundaryPosition(){const t=this.anchor;if(t){let{position:e}=t,n=0,r=0;switch(this.direction){case Hf:r=20;break;case Nf:r=-20;break;case Gf:n=-20;break;default:n=20}e={x:e.x+n,y:e.y+r};const i=this.component.toScene(e.x,e.y);return this.self.transcoordT2P(i.x,i.y)}}}class Uf extends Ha{isLine(){return!0}replaceRefids(t){["from","to"].forEach(e=>{const n=this.get(e);if(n?.component){const r=t.get(n.component)||n.component;this.set(e,{...n,component:r})}})}get fromEnd(){if(this.parent&&!this._fromEnd){const{component:t,anchor:e,position:n}=this.getState("from")||{};if(!t)return;const r=this.root?.findByRefid?.(t);if(!r)return;this._fromEnd=new Yf({component:r,fromto:"from",anchor:e,position:n,self:this})}return this._fromEnd}get from(){return this.getState("from")}set from(t){delete this._fromEnd,this.set("from",t)}get toEnd(){if(this.parent&&!this._toEnd){const{component:t,anchor:e,position:n}=this.getState("to")||{};if(!t)return;const r=this.root?.findByRefid?.(t);if(!r)return;this._toEnd=new Yf({component:r,fromto:"to",anchor:e,position:n,self:this})}return this._toEnd}get to(){return this.getState("to")}set to(t){delete this._toEnd,this.set("to",t)}move({x:t,y:e},n){n&&(this.from={position:this._fromEnd?.position||this.getState("from")?.position||{x:0,y:0}},this.to={position:this._toEnd?.position||this.getState("to")?.position||{x:0,y:0}}),super.move({x:t,y:e})}render(t){const{begin:e="none",end:n="none",lineWidth:r,round:i=0}=this.state;let s=this.drawPath;jf(t,s,this.state),t.beginPath();const o=Rf(e,r,s[0],s[1]),a=Rf(n,r,s[s.length-1],s[s.length-2]);s=[o,...s.slice(1,-1),a];let c={x:o.x,y:o.y};t.moveTo(o.x,o.y);for(let e=1;e<s.length;e++){const n=c;c=s[e];const r=s[e+1];if(n.x===c.x&&n.y===c.y)continue;if(!r){t.lineTo(c.x,c.y);break}let o=Math.sqrt((n.x-c.x)*(n.x-c.x)+(n.y-c.y)*(n.y-c.y)),a=0!==o?Math.atan2(n.x-c.x,n.y-c.y):0,l=Math.sin(a)*Math.min(i,o/2)+c.x,h=Math.cos(a)*Math.min(i,o/2)+c.y;const d=i>0||0!==o?{x:l,y:h}:c;o=Math.sqrt((r.x-c.x)*(r.x-c.x)+(r.y-c.y)*(r.y-c.y)),a=0!==o?Math.atan2(r.x-c.x,r.y-c.y):0,l=Math.sin(a)*Math.min(i,o/2)+c.x,h=Math.cos(a)*Math.min(i,o/2)+c.y;const u=i>0||0!==o?{x:l,y:h}:c;t.lineTo(d.x,d.y),i>0&&t.quadraticCurveTo(c.x,c.y,u.x,u.y)}this.drawStroke(t,void 0)}contains(t,e){const{lineWidth:n}=this.state;return Lf(t,e,this.drawPath,n)}get resizable(){return!1}get mutable(){return!0}get rotatable(){return!1}get path(){const{from:t,to:e}=this.state,{x1:n,y1:r,x2:i,y2:s}=this.state;return[this.fromEnd?.position||t?.position||{x:n,y:r},this.toEnd?.position||e?.position||{x:i,y:s}]}set path(t){const[e,n]=t,{from:r,to:i}=this.state;delete this._fromEnd,delete this._toEnd,this.set({from:{...r,position:e},to:{...i,position:n}})}get textBounds(){const t=this.drawPath;let e,n,r=0;for(let i=1;i<t.length;i++){const s=t[i-1],o=t[i],a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y);a>r&&(r=Math.ceil(a),e=s,n=o)}let{paddingTop:i,paddingLeft:s,paddingRight:o,paddingBottom:a}=this.state;return a||=0,i||=0,s||=0,o||=0,{left:Math.min(e.x,n.x)+s,top:Math.min(e.y,n.y)+i,width:Math.max(Math.abs(e.x-n.x)-s-o,0),height:Math.max(Math.abs(e.y-n.y)-i-a,0)}}get decorators(){return this.app.isEditMode?["decotag"]:[]}}Uf.getTipNeckPos=Rf,Uf.containedInPath=Lf,Uf.drawEndTips=jf,Ha.register("line",Uf);const $f={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"angle",label:"start-angle",name:"startAngle",property:"startAngle"},{type:"angle",label:"end-angle",name:"endAngle",property:"endAngle"}],"value-property":"text"};class Wf extends(gd(Va)){is3dish(){return!0}render(t){const{cx:e,cy:n,rx:r,ry:i,startAngle:s,endAngle:o,anticlockwise:a}=this.state;t.beginPath(),t.ellipse(e,n,Math.abs(r),Math.abs(i),0,s||0,o||2*Math.PI,a),void 0!==s&&void 0!==o&&(t.lineTo(e,n),t.closePath())}get path(){const{cx:t,cy:e,rx:n,ry:r}=this.state;return[{x:t-n,y:e-r},{x:t+n,y:e-r},{x:t+n,y:e+r},{x:t-n,y:e+r}]}set path(t){const e=t[0],n=t[2];this.set({cx:e.x+(n.x-e.x)/2,cy:e.y+(n.y-e.y)/2,rx:(n.x-e.x)/2,ry:(n.y-e.y)/2})}contains(t,e){const{cx:n,cy:r,rx:i,ry:s}=this.state,o=(t-n)/(2*i-.5),a=(e-r)/(2*s-.5);return o*o+a*a<.25}outline(t){return function(t,e){const{cx:n,cy:r,rx:i,ry:s}=t.model,o=2*Math.PI*e,a=n+i*Math.cos(o),c=r+s*Math.sin(o);return t.toScene(a,c)}(this,t)}get anchors(){return function(t){const{left:e,top:n,width:r,height:i}=t.bounds,s=e+r/2,o=n+i/2;return[{name:"TOP",position:{x:s,y:n}},{name:"RIGHT",position:{x:e+r,y:o}},{name:"BOTTOM",position:{x:s,y:n+i}},{name:"LEFT",position:{x:e,y:o}}]}(this)}get nature(){return $f}}Ha.memoize(Wf.prototype,"path",!1),Ha.register("ellipse",Wf);const qf={ondragstart:function(t,e,n){n.mutatePath(null,function(n){n.splice(e+1,0,t)})},ondragmove:function(t,e,n){n.mutatePath(null,function(n){n[e+1]=t})},ondragend:function(t,e,n){}},Xf={mutable:!0,resizable:!1,rotatable:!0,properties:[{type:"number",label:"round",name:"round",property:{min:0,max:100,step:1}}],help:"scene/component/polygon"};class Kf extends Va{is3dish(){return!0}get mutable(){return!0}get pathExtendable(){return!0}get path(){return this.state.path}set path(t){this.set("path",t)}contains(t,e){const n=this.state.path;let r=!1;return n.forEach((i,s)=>{const o=(s+n.length+1)%n.length,a=i.x,c=i.y,l=n[o].x,h=n[o].y;c>e!=h>e&&t<(l-a)*(e-c)/(h-c)+a&&(r=!r)}),r}get controls(){const t=this.path;return t.map((e,n)=>{const r=t[n+1>=t.length?0:n+1];return{x:(e.x+r.x)/2,y:(e.y+r.y)/2,handler:qf}})}get nature(){return Xf}}Ha.memoize(Kf.prototype,"controls",!1),Ha.register("polygon",Kf);const Qf={ondragstart:function(t,e,n){n.mutatePath(null,function(n){n.splice(e,0,t)})},ondragmove:function(t,e,n){n.mutatePath(null,function(n){n[e]=t})},ondragend:function(t,e,n){}},Zf={mutable:!1,resizable:!1,rotatable:!1,properties:[{type:"number",label:"round",name:"round",property:{min:0,max:100,step:1}}],help:"scene/component/polyline"};class Jf extends Uf{get pathExtendable(){return!0}get path(){const{from:t,to:e}=this.state,{path:n}=this.state;return[this.fromEnd?.position||t?.position||n[0],...n.slice(1,-1),this.toEnd?.position||e?.position||n[n.length-1]]}set path(t){const{from:e,to:n}=this.state;delete this._fromEnd,delete this._toEnd,this.set({from:{...e,position:t[0]},to:{...n,position:t[t.length-1]},path:t})}get controls(){const t=this.path,e=[];for(let n=0;n<t.length-1;n++){const r=t[n],i=t[n+1];0==n&&e.push({x:r.x,y:r.y,handler:Qf}),e.push({x:(r.x+i.x)/2,y:(r.y+i.y)/2,handler:Qf}),n==t.length-2&&e.push({x:i.x,y:i.y,handler:Qf})}return e}get nature(){return Zf}}Ha.register("polyline",Jf);const tg={mutable:!1,resizable:!1,rotatable:!1,properties:[{type:"number",label:"round",name:"round",property:{min:0,max:100,step:1}}],help:"scene/component/ortholine"};class eg extends Uf{get pathExtendable(){return!1}get drawPath(){const t=this.path[0],e=this.path[1],{component:n,direction:r,boundaryPosition:i=t}=this.fromEnd||{},{component:s,direction:o,boundaryPosition:a=e}=this.toEnd||{},c=[i,a],l=[];i&&l.push(i);let h,d=n?.bounds;d&&(h=n.toScene(d.left,d.top),h=this.transcoordT2P(h.x,h.y),d={...d,left:h.x,top:h.y});const u=d?{left:d.left-20,top:d.top-20,width:d.width+40,height:d.height+40}:{left:i.x,top:i.y,width:0,height:0};d=d||u;let p=s?.bounds;p&&(h=s.toScene(p.left,p.top),h=this.transcoordT2P(h.x,h.y),p={...p,left:h.x,top:h.y});const f=p?{left:p.left-20,top:p.top-20,width:p.width+40,height:p.height+40}:{left:a.x,top:a.y,width:0,height:0};p=p||f;const g=[u,f],m=u.left>f.left?f.left:u.left,y=u.top>f.top?f.top:u.top,b={left:m,top:y,width:u.left+u.width>f.left+f.width?u.left+u.width-m:f.left+f.width-m,height:u.top+u.height>f.top+f.height?u.top+u.height-y:f.top+f.height-y};let v,_,x,w,M,S,A,E,k,C,T=0,P=0;d.left+d.width<p.left?(w=0,M=1,k=r,C=o,v=(d.left+d.width+p.left)/2,T=p.left-v):p.left+p.width<d.left&&(w=1,M=0,k=o,C=r,v=(d.left+p.width+p.left)/2,T=d.left-v),d.top+d.height<p.top?(x=0,S=1,A=r,E=o,_=(d.top+d.height+p.top)/2,P=p.top-_):p.top+p.height<d.top&&(x=1,S=0,A=o,E=r,_=(d.top+p.height+p.top)/2,P=d.top-_);const D=[];if(v&&T>P){let t,e,n;switch(C){case Gf:switch(k){case Vf:D.push({x:v,y:c[w].y}),D.push({x:v,y:c[M].y});break;case Gf:t=g[w].top+g[w].height/2,e=t>c[M].y?Math.min(g[w].top,c[M].y):Math.max(g[w].top+g[w].height,c[M].y),D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:c[M].y});break;case Nf:case Hf:e=k===Hf?Math.max(c[w].y,c[M].y):Math.min(c[w].y,c[M].y),D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:c[M].y});break;default:return this.path}break;case Vf:switch(k){case Vf:e=c[w].y<c[M].y?Math.min(g[M].top,c[w].y):Math.max(g[M].top+g[M].height,c[w].y),n=e;break;case Gf:e=void 0!==_?_:c[w].y<c[M].y?b.top-.5*T:b.top+b.height+.5*T,n=e;break;case Hf:e=void 0!==_?Math.max(_,c[w].y):b.top+b.height,n=e;break;case Nf:e=_?Math.min(_,g[w].top):b.top,n=e;break;default:return this.path}D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:n}),D.push({x:c[M].x,y:n});break;case Hf:switch(k){case Vf:e=c[w].y,n=c[w].y>c[M].y?c[w].y:g[M].top+g[M].height;break;case Gf:e=_?Math.max(_,g[M].top+g[M].height):b.top+b.height,n=e;break;case Hf:e=b.top+b.height,n=e;break;case Nf:e=_?Math.min(_,g[w].top):g[w].top,n=_?Math.max(_,g[M].top+g[M].height):g[M].top+g[M].height;break;default:return this.path}D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:n}),D.push({x:c[M].x,y:n});break;case Nf:switch(k){case Vf:e=c[w].y,n=c[w].y<c[M].y?c[w].y:g[M].top;break;case Gf:e=_?Math.min(_,g[M].top):b.top,n=e;break;case Hf:e=void 0!==_?Math.max(_,c[w].y):c[w].y,n=void 0!==_?Math.min(_,c[M].y):c[M].y;break;case Nf:e=b.top,n=e;break;default:return this.path}D.push({x:c[w].x,y:e}),D.push({x:v,y:e}),D.push({x:v,y:n}),D.push({x:c[M].x,y:n});break;default:return this.path}l.push(...0===w?D:D.reverse())}else if(_){let t,e,n;switch(E){case Nf:switch(A){case Hf:D.push({x:c[x].x,y:_}),D.push({x:c[S].x,y:_});break;case Nf:t=g[x].left+g[x].width/2,e=t>c[S].x?Math.min(g[x].left,c[S].x):Math.max(g[x].left+g[x].width,c[S].x),D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:c[S].x,y:_});break;case Gf:e=Math.min(c[x].x,c[S].x),D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:c[S].x,y:_});break;case Vf:e=Math.max(c[x].x,c[S].x),D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:c[S].x,y:_});break;default:return this.path}break;case Hf:switch(A){case Gf:e=b.left,n=e;break;case Vf:e=void 0!==v?Math.max(v,c[x].x):b.left+b.width,n=e;break;case Nf:e=void 0!==v?v:c[x].x<c[S].x?b.left-.5*P:b.left+b.width+.5*P,n=e;break;case Hf:e=c[x].x,n=c[x].x<c[S].x?Math.min(g[S].left,c[x].x):Math.max(g[S].left+g[S].width,c[x].x);break;default:return this.path}D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:n,y:_}),D.push({x:n,y:c[S].y});break;case Vf:switch(A){case Gf:e=void 0!==v?Math.min(v,c[x].x):c[x].x,n=void 0!==v?Math.max(v,c[S].x):c[S].x;break;case Vf:e=b.left+b.width,n=e;break;case Nf:e=void 0!==v?Math.max(v,c[S].x):b.left+b.width,n=e;break;case Hf:e=c[x].x,n=Math.max(g[S].left+g[S].width,c[x].x);break;default:return this.path}D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:n,y:_}),D.push({x:n,y:c[S].y});break;case Gf:switch(A){case Gf:e=b.left,n=e;break;case Vf:e=void 0!==v?Math.max(v,c[x].x):c[x].x,n=void 0!==v?Math.min(v,c[S].x):c[S].x;break;case Nf:e=b.left,n=e;break;case Hf:e=c[x].x<c[S].x?Math.min(g[S].left,c[x].x):c[x].x,n=Math.min(e,c[S].x);break;default:return this.path}D.push({x:e,y:c[x].y}),D.push({x:e,y:_}),D.push({x:n,y:_}),D.push({x:n,y:c[S].y});break;default:return this.path}l.push(...0===x?D:D.reverse())}else{let t,e;switch(r){case Nf:switch(o){case Nf:e=b.top,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;case Hf:t=b.left+b.width,l.push({x:t,y:c[0].y}),l.push({x:t,y:b.top+b.height}),l.push({x:c[1].x,y:b.top+b.height});break;case Vf:t=c[1].y<c[0].y&&c[1].x<c[0].x?c[0].x:b.left+b.width,l.push({x:t,y:c[0].y}),l.push({x:t,y:c[1].y});break;case Gf:t=b.left,l.push({x:t,y:c[0].y}),l.push({x:t,y:c[1].y});break;default:return this.path}break;case Hf:switch(o){case Nf:t=b.left+b.width,l.push({x:t,y:c[0].y}),l.push({x:t,y:b.top}),l.push({x:c[1].x,y:b.top});break;case Hf:case Vf:case Gf:e=b.top+b.height,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;default:return this.path}break;case Gf:switch(o){case Nf:t=c[0].x>c[1].x&&c[0].y<c[1].y?c[1].x:b.left,e=c[0].x>c[1].x&&c[0].y<c[1].y?c[1].y:Math.min(b.top,c[0].y),l.push({x:t,y:c[0].y}),l.push({x:t,y:e}),l.push({x:c[1].x,y:e});break;case Hf:t=b.left,e=Math.max(b.top+b.height,c[0].y),l.push({x:t,y:c[0].y}),l.push({x:t,y:e}),l.push({x:c[1].x,y:e});break;case Vf:t=b.left+b.width,l.push({x:c[0].x,y:b.top}),l.push({x:t,y:b.top}),l.push({x:t,y:c[1].y});break;case Gf:t=b.left,l.push({x:t,y:c[0].y}),l.push({x:t,y:c[1].y});break;default:return this.path}break;case Vf:switch(o){case Nf:e=c[0].y<c[1].y&&c[0].x<c[1].x?c[0].y:b.top,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;case Hf:e=c[0].y>c[1].y&&c[0].x<c[1].x?c[0].y:b.top+b.height,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;case Vf:case Gf:e=b.top+b.height,l.push({x:c[0].x,y:e}),l.push({x:c[1].x,y:e});break;default:return this.path}break;default:return this.path}}return a&&l.push(a),[t,...l,e].filter((t,e,n)=>{if(0===e)return!0;const r=n[e-1];return t.x!==r.x||t.y!==r.y}).filter((t,e,n)=>{if(0===e||e>=n.length-1)return!0;const r=n[e-1],i=n[e+1];return!(t.x===r.x&&t.x===i.x||t.y===r.y&&t.y===i.y)})}get nature(){return tg}}Ha.register("ortholine",eg);const ng={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"image-selector",label:"image-src",name:"src",property:{displayField:"id",displayFullUrl:!0,baseUrlAlias:"$base_url",defaultStorage:"scene-image",storageFilters:{type:Array,value:[{name:"category",value:"image"}]},useUpload:!0}},{type:"select",label:"cross-origin",name:"crossOrigin",property:{options:["","anonymous","use-credentials"]}}],"value-property":"src",help:"scene/component/image-view"};class rg extends(Ya(Va)){static get noimage(){return rg.NOIMAGE||(rg.NOIMAGE=new Image,rg.NOIMAGE.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABIBAMAAAD7Se1QAAAAIVBMVEUAAABHcEwBAQEREREBAQEEBAQGBgYLCwsDAwMDAwMICAi6HF9tAAAAC3RSTlNNAEAERiMYCS41Eac10lYAAAEgSURBVHhe7dY9asQwEAXgh7DNertNiJy48pIitY3SB7bYdk0ukL1BDDmA9gZecoH4pmFQ3MQayUMguPBrNPD4wD9TCMvJmt3M/AtYwXOlXiWgqADVCUBD46MAnGhMBaCiUQmAm8VA/Eh/eWl9Fn5WcxD+OLuRrUYJDKLluwH2InACUgkoACSdADxQc50Bytadb9RkM0CT13TcvlCT1HFg8UTHvasuUVACCa3El6u2UdD8LFTlKhUFFgA+d3dj10aABkUN72N3jAADCrJq7PIIsPidcxBoTHIIAjMFmyCwmGYIAA1P9gFgfCANAOsDSccCDW+uLDB+kLGg94OkZoAGkwsDDAe2DOg5oPxAg03rBR88OHpBz4N8UVeHFSwma74BTW6Ge4rIRa4AAAAASUVORK5CYII="),rg.NOIMAGE}dispose(){super.dispose(),this._offcanvas=null,this._image=null}render(t){const{left:e,top:n,width:r,height:i,isGray:s=!1,alpha:o=1,src:a}=this.state;if(this.prepareIf(!this._image&&a),t.beginPath(),t.globalAlpha*=o,this._image&&this._image.complete)if(s&&this._offcanvas)t.drawImage(this._offcanvas,e,n,r,i);else try{t.drawImage(this._image,e,n,r,i)}catch(s){t.drawImage(rg.noimage,e,n,r,i)}else!this.app.isViewMode&&t.drawImage(rg.noimage,e,n,r,i)}get nature(){return ng}get hasTextProperty(){return!1}async ready(){await super.ready();const{src:t}=this.state;if(!this._image&&t){const e=this.root?.app?.loadTracker;if(e){const n=new Promise((t,e)=>{this.prepare(()=>t(),t=>e(t))});e.track(`image:${t}`,"image",t,n)}else this.prepareIf(!0)}}prepare(t,e){const{src:n,crossOrigin:r}=this.state;if(n){this._image=new Image;try{r&&(this._image.crossOrigin=r),this._image.src=this.app.url(n)||""}catch(t){return void e(t)}this._image.onload=()=>{if(this.get("isGray")){const t=this._image.width,e=this._image.height;this._offcanvas=Ha.createCanvas(t,e);const n=this._offcanvas.getContext("2d");n.drawImage(this._image,0,0);const r=function(t,e,n){let r;try{r=t.getImageData(0,0,e,n)}catch(t){return Lr("Get Image Data Error: "+(t instanceof Error?t.message:String(t))),null}const i=r.data;for(let t=0;t<e*n*4;t+=4){const e=i[t],n=i[t+1],s=i[t+2],o=Math.floor((e+n+s)/3);r.data[t]=o,r.data[t+1]=o,r.data[t+2]=o}return r}(n,t,e);n.putImageData(r,0,0)}t(this)},this._image.onerror=t=>{this._image&&!this._image.currentSrc&&(this._image=null),e(t)}}else t(this)}get src(){return this.get("src")}set src(t){this.set("src",t)}onchange(t,e){(t.hasOwnProperty("src")||t.hasOwnProperty("isGray"))&&(this._offcanvas=null,this._image=null,this.prepareIf(t.src))}ondropfile(t,e){for(let n=0;n<t.length;n++)if(t[n].type.startsWith("image/"))return void(this.src=e[n])}}Ha.register("image-view",rg);class ig extends(Ef(Ya(Ha))){is3dish(){return!0}prerender(){}}var sg,og,ag={},cg={},lg={};function hg(){if(og)return cg;og=1,Object.defineProperty(cg,"__esModule",{value:!0});var t=function(){if(sg)return lg;sg=1,Object.defineProperty(lg,"__esModule",{value:!0});var t=function(){function t(){}return t.bitsToNum=function(t){return t.reduce(function(t,e){return 2*t+e},0)},t.byteToBitArr=function(t){for(var e=[],n=7;n>=0;n--)e.push(!!(t&1<<n));return e},t.lzwDecode=function(t,e){for(var n,r,i=0,s=function(t){for(var n=0,r=0;r<t;r++)e.charCodeAt(i>>3)&1<<(7&i)&&(n|=1<<r),i++;return n},o=[],a=1<<t,c=a+1,l=t+1,h=[],d=function(){h=[],l=t+1;for(var e=0;e<a;e++)h[e]=[e];h[a]=[],h[c]=null};;)if(r=n,(n=s(l))!==a){if(n===c)break;if(n<h.length)r!==a&&h.push(h[r].concat(h[n][0]));else{if(n!==h.length)throw new Error("Invalid LZW code.");h.push(h[r].concat(h[r][0]))}o.push.apply(o,h[n]),h.length===1<<l&&l<12&&l++}else d();return o},t}();return lg.SuperGifUtils=t,lg}(),e=function(){function e(t,e){this.stream=t,this.handler=e}return e.prototype.parseCT=function(t){for(var e=[],n=0;n<t;n++)e.push(this.stream.readBytes(3));return e},e.prototype.readSubBlocks=function(){var t,e;e="";do{t=this.stream.readByte(),e+=this.stream.read(t)}while(0!==t);return e},e.prototype.parseHeader=function(){var e={};if(e.sig=this.stream.read(3),e.ver=this.stream.read(3),"GIF"!==e.sig)throw new Error("Not a GIF file.");e.width=this.stream.readUnsigned(),e.height=this.stream.readUnsigned();var n=t.SuperGifUtils.byteToBitArr(this.stream.readByte());e.gctFlag=n.shift(),e.colorRes=t.SuperGifUtils.bitsToNum(n.splice(0,3)),e.sorted=n.shift(),e.gctSize=t.SuperGifUtils.bitsToNum(n.splice(0,3)),e.bgColor=this.stream.readByte(),e.pixelAspectRatio=this.stream.readByte(),e.gctFlag&&(e.gct=this.parseCT(1<<e.gctSize+1)),this.handler.hdr&&this.handler.hdr(e)},e.prototype.parseExt=function(e){var n=this;switch(e.label=this.stream.readByte(),e.label){case 249:e.extType="gce",function(e){n.stream.readByte();var r=t.SuperGifUtils.byteToBitArr(n.stream.readByte());e.reserved=r.splice(0,3),e.disposalMethod=t.SuperGifUtils.bitsToNum(r.splice(0,3)),e.userInput=r.shift(),e.transparencyGiven=r.shift(),e.delayTime=n.stream.readUnsigned(),e.transparencyIndex=n.stream.readByte(),e.terminator=n.stream.readByte(),n.handler.gce&&n.handler.gce(e)}(e);break;case 254:e.extType="com",function(t){t.comment=n.readSubBlocks(),n.handler.com&&n.handler.com(t)}(e);break;case 1:e.extType="pte",function(t){n.stream.readByte(),t.ptHeader=n.stream.readBytes(12),t.ptData=n.readSubBlocks(),n.handler.pte&&n.handler.pte(t)}(e);break;case 255:e.extType="app",function(t){n.stream.readByte(),t.identifier=n.stream.read(8),t.authCode=n.stream.read(3),"NETSCAPE"===t.identifier?function(t){n.stream.readByte(),t.unknown=n.stream.readByte(),t.iterations=n.stream.readUnsigned(),t.terminator=n.stream.readByte(),n.handler.app&&n.handler.app.NETSCAPE&&n.handler.app.NETSCAPE(t)}(t):function(t){t.appData=n.readSubBlocks(),n.handler.app&&n.handler.app[t.identifier]&&n.handler.app[t.identifier](t)}(t)}(e);break;default:e.extType="unknown",function(t){t.data=n.readSubBlocks(),n.handler.unknown&&n.handler.unknown(t)}(e)}},e.prototype.parseImg=function(e){e.leftPos=this.stream.readUnsigned(),e.topPos=this.stream.readUnsigned(),e.width=this.stream.readUnsigned(),e.height=this.stream.readUnsigned();var n=t.SuperGifUtils.byteToBitArr(this.stream.readByte());e.lctFlag=n.shift(),e.interlaced=n.shift(),e.sorted=n.shift(),e.reserved=n.splice(0,2),e.lctSize=t.SuperGifUtils.bitsToNum(n.splice(0,3)),e.lctFlag&&(e.lct=this.parseCT(1<<e.lctSize+1)),e.lzwMinCodeSize=this.stream.readByte();var r=this.readSubBlocks();e.pixels=t.SuperGifUtils.lzwDecode(e.lzwMinCodeSize,r),e.interlaced&&(e.pixels=function(t,e){for(var n=new Array(t.length),r=t.length/e,i=function(r,i){var s=t.slice(i*e,(i+1)*e);n.splice.apply(n,[r*e,e].concat(s))},s=[0,4,2,1],o=[8,8,4,2],a=0,c=0;c<4;c++)for(var l=s[c];l<r;l+=o[c])i(l,a),a++;return n}(e.pixels,e.width)),this.handler.img&&this.handler.img(e)},e.prototype.parseBlock=function(){var t={};switch(t.sentinel=this.stream.readByte(),String.fromCharCode(t.sentinel)){case"!":t.type="ext",this.parseExt(t);break;case",":t.type="img",this.parseImg(t);break;case";":t.type="eof",this.handler.eof&&this.handler.eof(t);break;default:throw new Error("Unknown block: 0x"+t.sentinel.toString(16))}"eof"!==t.type&&setTimeout(this.parseBlock.bind(this),0)},e.prototype.parse=function(){this.parseHeader(),setTimeout(this.parseBlock.bind(this),0)},e}();return cg.SuperGifParser=e,cg}var dg,ug,pg={};var fg=function(){if(ug)return ag;ug=1,Object.defineProperty(ag,"__esModule",{value:!0});var t=hg(),e=function(){if(dg)return pg;dg=1,Object.defineProperty(pg,"__esModule",{value:!0});var t=function(){function t(t){this.data=t,this.position=0}return t.prototype.readByte=function(){if(this.position>=this.data.length)throw new Error("Attempted to read past end of stream.");return this.data instanceof Uint8Array?this.data[this.position++]:255&this.data.charCodeAt(this.position++)},t.prototype.readBytes=function(t){for(var e=[],n=0;n<t;n++)e.push(this.readByte());return e},t.prototype.read=function(t){for(var e="",n=0;n<t;n++)e+=String.fromCharCode(this.readByte());return e},t.prototype.readUnsigned=function(){var t=this.readBytes(2);return(t[1]<<8)+t[0]},t}();return pg.SuperGifStream=t,pg}(),n=function(){function n(t,e){var n=this;for(var r in this.gifImgElement=t,this.options={autoPlay:!0},this.loading=!1,this.ready=!1,this.transparency=null,this.delay=null,this.disposalMethod=null,this.disposalRestoreFromIdx=null,this.lastDisposalMethod=null,this.frame=null,this.lastImg=null,this.playing=!0,this.forward=!0,this.ctxScaled=!1,this.frames=[],this.frameOffsets=[],this.initialized=!1,this.currentFrameIndex=-1,this.iterationCount=0,this.stepping=!1,this.handler={hdr:this.withProgress(this.doHdr.bind(this)),gce:this.withProgress(this.doGCE.bind(this)),com:this.withProgress(this.doNothing.bind(this)),app:{NETSCAPE:this.withProgress(this.doNothing.bind(this))},img:this.withProgress(this.doImg.bind(this)),eof:function(){n.pushFrame(),n.canvas.width=n.hdr.width*n.getCanvasScale(),n.canvas.height=n.hdr.height*n.getCanvasScale(),n.playerInit(),n.loading=!1,n.ready=!0,n.loadCallback&&n.loadCallback(n.gifImgElement)}},e)this.options[r]=e[r];this.onEndListener=e.onEnd,this.loopDelay=e.loopDelay||0,this.overrideLoopMode=null!=e.loopMode?e.loopMode:"auto",this.drawWhileLoading=null==e.drawWhileLoading||e.drawWhileLoading}return n.prototype.init=function(){var t=this.gifImgElement.parentNode,e=document.createElement("div");this.canvas=document.createElement("canvas"),this.canvasContext=this.canvas.getContext("2d"),this.tmpCanvas=document.createElement("canvas"),e.className=this.options.enclosingClass||"super-gif",e.appendChild(this.canvas),t&&(t.insertBefore(e,this.gifImgElement),t.removeChild(this.gifImgElement)),this.initialized=!0},n.prototype.loadSetup=function(t){return!this.loading&&(t&&(this.loadCallback=t),this.loading=!0,this.frames=[],this.clear(),this.disposalRestoreFromIdx=null,this.lastDisposalMethod=null,this.frame=null,this.lastImg=null,!0)},n.prototype.completeLoop=function(){this.onEndListener&&this.onEndListener(this.gifImgElement),this.iterationCount++,!1!==this.overrideLoopMode||this.iterationCount<0?this.doStep():(this.stepping=!1,this.playing=!1)},n.prototype.doStep=function(){if(this.stepping=this.playing,this.stepping){this.stepFrame(1);var t=10*this.frames[this.currentFrameIndex].delay;t||(t=100),0===this.getNextFrameNo()?(t+=this.loopDelay,setTimeout(this.completeLoop.bind(this),t)):setTimeout(this.doStep.bind(this),t)}},n.prototype.step=function(){this.stepping||setTimeout(this.doStep.bind(this),0)},n.prototype.putFrame=function(){var t;this.currentFrameIndex=parseInt(this.currentFrameIndex.toString(),10),this.currentFrameIndex>this.frames.length-1&&(this.currentFrameIndex=0),this.currentFrameIndex<0&&(this.currentFrameIndex=0),t=this.frameOffsets[this.currentFrameIndex],this.tmpCanvas.getContext("2d").putImageData(this.frames[this.currentFrameIndex].data,t.x,t.y),this.canvasContext.globalCompositeOperation="copy",this.canvasContext.drawImage(this.tmpCanvas,0,0)},n.prototype.playerInit=function(){this.loadErrorCause||(this.canvasContext.scale(this.getCanvasScale(),this.getCanvasScale()),this.options.autoPlay?this.step():(this.currentFrameIndex=0,this.putFrame()))},n.prototype.clear=function(){this.transparency=null,this.delay=null,this.lastDisposalMethod=this.disposalMethod,this.disposalMethod=null,this.frame=null},n.prototype.parseStream=function(e){try{new t.SuperGifParser(e,this.handler).parse()}catch(t){this.handleError("parse")}},n.prototype.setSizes=function(t,e){this.canvas.width=t*this.getCanvasScale(),this.canvas.height=e*this.getCanvasScale(),this.tmpCanvas.width=t,this.tmpCanvas.height=e,this.tmpCanvas.style.width=t+"px",this.tmpCanvas.style.height=e+"px",this.tmpCanvas.getContext("2d").setTransform(1,0,0,1,0,0)},n.prototype.drawError=function(){this.canvasContext.fillStyle="black",this.canvasContext.fillRect(0,0,this.hdr.width,this.hdr.height),this.canvasContext.strokeStyle="red",this.canvasContext.lineWidth=3,this.canvasContext.moveTo(0,0),this.canvasContext.lineTo(this.hdr.width,this.hdr.height),this.canvasContext.moveTo(0,this.hdr.height),this.canvasContext.lineTo(this.hdr.width,0),this.canvasContext.stroke()},n.prototype.handleError=function(t){this.loadErrorCause=t,this.hdr={width:this.gifImgElement.width,height:this.gifImgElement.height},this.frames=[],this.drawError()},n.prototype.doHdr=function(t){this.hdr=t,this.setSizes(this.hdr.width,this.hdr.height)},n.prototype.doGCE=function(t){this.pushFrame(),this.clear(),this.transparency=t.transparencyGiven?t.transparencyIndex:null,this.delay=t.delayTime,this.disposalMethod=t.disposalMethod},n.prototype.pushFrame=function(){this.frame&&(this.frames.push({data:this.frame.getImageData(0,0,this.hdr.width,this.hdr.height),delay:this.delay}),this.frameOffsets.push({x:0,y:0}))},n.prototype.doImg=function(t){var e=this;this.frame||(this.frame=this.tmpCanvas.getContext("2d"));var n=this.frames.length,r=t.lctFlag?t.lct:this.hdr.gct;n>0&&(3===this.lastDisposalMethod?null!==this.disposalRestoreFromIdx?this.frame.putImageData(frames[this.disposalRestoreFromIdx].data,0,0):this.frame.clearRect(this.lastImg.leftPos,this.lastImg.topPos,this.lastImg.width,this.lastImg.height):this.disposalRestoreFromIdx=n-1,2===this.lastDisposalMethod&&this.frame.clearRect(this.lastImg.leftPos,this.lastImg.topPos,this.lastImg.width,this.lastImg.height));var i=this.frame.getImageData(t.leftPos,t.topPos,t.width,t.height);t.pixels.forEach(function(t,n){t!==e.transparency&&(i.data[4*n+0]=r[t][0],i.data[4*n+1]=r[t][1],i.data[4*n+2]=r[t][2],i.data[4*n+3]=255)}),this.frame.putImageData(i,t.leftPos,t.topPos),this.ctxScaled||(this.canvasContext.scale(this.getCanvasScale(),this.getCanvasScale()),this.ctxScaled=!0),this.drawWhileLoading&&(this.canvasContext.drawImage(this.tmpCanvas,0,0),this.drawWhileLoading=this.options.autoPlay),this.lastImg=t},n.prototype.doNothing=function(){},n.prototype.withProgress=function(t){return function(e){t(e)}},n.prototype.getNextFrameNo=function(){var t=this.forward?1:-1;return(this.currentFrameIndex+t+this.frames.length)%this.frames.length},n.prototype.stepFrame=function(t){this.currentFrameIndex=this.currentFrameIndex+t,this.putFrame()},n.prototype.getCanvasScale=function(){return this.options.maxWidth&&this.hdr&&this.hdr.width>this.options.maxWidth?this.options.maxWidth/this.hdr.width:window.devicePixelRatio||1},n.prototype.play=function(){this.playing=!0,this.step()},n.prototype.pause=function(){this.playing=!1},n.prototype.isPlaying=function(){return this.playing},n.prototype.getCanvas=function(){return this.canvas},n.prototype.isLoading=function(){return this.loading},n.prototype.isReady=function(){return this.ready},n.prototype.isAutoPlay=function(){return this.options.autoPlay},n.prototype.getLength=function(){return this.frames.length},n.prototype.getCurrentFrame=function(){return this.currentFrameIndex},n.prototype.moveTo=function(t){this.currentFrameIndex=t,this.putFrame()},n.prototype.loadURL=function(t,n){var r=this;if(this.loadSetup(n)){var i=new XMLHttpRequest;i.open("GET",t,!0),"overrideMimeType"in i?i.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in i?i.responseType="arraybuffer":i.setRequestHeader("Accept-Charset","x-user-defined"),i.onloadstart=function(){r.initialized||r.init()},i.onload=function(){if(200===i.status){var t=i.response;t.toString().indexOf("ArrayBuffer")>0&&(t=new Uint8Array(t));var n=new e.SuperGifStream(t);setTimeout(function(){r.parseStream(n)},0)}else r.handleError("xhr - response")},i.onerror=function(){r.handleError("xhr")},i.send()}},n.prototype.load=function(t){this.loadURL(this.gifImgElement.src,t)},n}();return ag.SuperGif=n,ag}();const gg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"image-selector",label:"src",name:"src"},{type:"checkbox",label:"play",name:"play"}],"value-property":"src",help:"scene/component/gif-view"};class mg extends ig{async oncreate_element(t){const{src:e,play:n}=this.state;this.onchangesrc(e),this.onchangeplay(n)}buildImg(){const t=this.element;if(!t)return document.createElement("img");t.replaceChildren();const e=document.createElement("img");return e.style.width="100%",e.style.height="100%",t.appendChild(e),e}onchange(t,e){super.onchange(t,e),"src"in t&&this.onchangesrc(t.src),"play"in t&&this.onchangeplay(t.play)}setElementProperties(t){}onchangeplay(t){const e=this._superGif;e&&e.isReady()&&(t?e.play():e.pause())}onchangesrc(t){const e=this.buildImg();t||(t="data:image/gif;base64,R0lGODlhYABIAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKio+Pj5iYmKCgoKampqurq66urrCwsLGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrOzs7S0tLa2tre3t7m5ubu7u7+/v8DAwMHBwcPDw8XFxcfHx8vLy8/Pz9LS0tXV1dfX193d3eTk5Onp6fj4+Pz8/P7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v///////////////////////////////////////////////////////////////////////////////yH5BAkAAPUAIf47R2VuZXJhdGVkIGJ5IGpzZ2lmIChodHRwczovL2dpdGh1Yi5jb20vYW50aW1hdHRlcjE1L2pzZ2lmLykALAAAAABgAEgAAAj+AGcJHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmR9VKqXMmypcuXMGPKnJkSIs2bOHPqZGlzp8+fQOv1DEq0KMyhRpMmRaq0KVCmTqPmhCq1qkyqLrFRSyYwGTVsVo1iZXmNa8Fk18ISHasSm1mDycCq/ck2JTWF1ObSfTjz7cFken3WFbow8M7BDA3rHOwXruKpfGXeTZg3qDVrUge7RRg3KLZjx+Q2HVyvLNy0QaMJjBaVdD2tZr2K/mmNIObRkR+n9AsYt0Pddg1WXppb8bWDx1CLLW74GcJnSl3TtDY8Zu2Et4tKl7n52eyWnxXvhl7+26jqrspbnlfIWjtz2gWPZV95neH8veU9NxZYfbfD3kFt99J6Bnmn0mQO9XfYezrVxxlmx0GUXIAM4hSeffsxBN1TFd5E4Ef3QZbfTg6CNJ5gHXJ3TEntLThiTh+KFCJNAqZU4kgAitjQTheepOBMNcZI0oQ6JpbTjSZtiNN2PZ400IxHpdiSc07G911M0iFZZYtAStnWilUeBGVLrlEZpmM0elmPlmfO8iOZXl4DZpsGEYmll2bSWWCXLwJXVY1+urhjoGEBSuiSah6K36CKtpZoo4s9CimielZq6aWYZqrpppx26umnoIZ6UkAAOw=="),e.src=t,e.setAttribute("rel:animated_src",t),e.setAttribute("rel:auto_play",String(0)),this._superGif=new fg.SuperGif(e,{autoPlay:!1}),this._superGif.init(),this.element&&Array.from(this.element.children).forEach(t=>{t.style.width="100%",t.style.height="100%"});const n=this._superGif.getCanvas();n.style.width="100%",n.style.height="100%",this._superGif.load(()=>{setTimeout(()=>{this._superGif.moveTo(0),this.play&&this._superGif.play()},100)})}ondropfile(t,e){for(let n=0;n<t.length;n++)if(/\.gif$/.test(t[n].name))return void(this.src=e[n])}get src(){return this.getState("src")}set src(t){this.set("src",t)}get play(){return this.getState("play")}set play(t){this.setState("play",t)}get nature(){return gg}get tagName(){return"div"}}Ha.register("gif-view",mg);const yg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"attachment-selector",label:"src",name:"src",property:{category:"audio"}},{type:"checkbox",label:"started",name:"started"},{type:"checkbox",label:"loop",name:"loop"}],"value-property":"src",help:"scene/component/audio"};class bg extends(Ya(Va)){static get image(){return bg.IMAGE||(bg.IMAGE=new Image,bg.IMAGE.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAP1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACzJYIvAAAAFHRSTlMA8BAwgNBgQKB/wCBwUJDg37CvXyUlBK8AABFYSURBVHja7NsBkqIwFIThTiAQgyBq3/+sm6p1tnamZkaTMhJJf1f4S/JeEIiIiIiIiIiIiIiIiEhD7Hg4BH84TpAKjJ4f3NFCtjVd+InXz2RTs+FXlxGylYHfcVfIJmb+YFWSLUyGVJKKBJJKUo+Rd6w63l/qzLuCkryO5fe0l2xk5mMWbe+v0fNBRqf7S3je6CipQ2ACr+dWcYEpzBFS1plpguatsnomMgdIQSOTuQ5SjmE6/UgK8szgdJIUM/FG41YlFmYJ2kkKsY5ZzAwBurHDk3WGeRY0bvYrGa1+rqNI22f7dS32ZnUK1GMr0eSK3mEc9dhKMxp+ZTo8kT2emOXS5LQ1kCxbJBocSd2k5PaIjMVzjWcdJPk9ooBnmzx1t5XbIxqBKpJ4NGTgzwKiGpK4do72gb+ZUMIYtCPm9WCPMsYTE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pp9DJSi6MJx0bvUwiw4ewgT8zNR0LHUL+OccOpY/3ElzyGKD5pBlMJpDlsOkMythRoNbXh95PJsdA67MrMtAEYbjeDqNo+7oKqWUUkoppZRSSimllFJKFfMXp4vmSjB8n6sAAAAASUVORK5CYII="),bg.IMAGE}dispose(){super.dispose(),this.started=!1,delete this._audio}async ready(){super.ready(),this._audio=new Audio;const{src:t="",loop:e=!1,started:n=!1}=this.state;if(t){const e=this.root?.app?.loadTracker;if(e){const n=new Promise((e,n)=>{this._audio.addEventListener("canplay",()=>e(),{once:!0}),this._audio.addEventListener("error",()=>n(new Error(`Audio load failed: ${t}`)),{once:!0})});e.track(`audio:${t}`,"audio",t,n)}}this._audio.addEventListener("canplay",()=>{this.started&&this._audio.play()}),this.onchangeSrc(t),this.onchangeLoop(e),this.onchangeStarted(n)}render(t){const{left:e,top:n,width:r,height:i}=this.state;t.beginPath(),this.drawImage(t,bg.image,e,n,r,i)}get nature(){return yg}get hasTextProperty(){return!1}get src(){return this.get("src")}set src(t){this.set("src",t)}get started(){return!!this.get("started")}set started(t){this.set("started",t)}start(){this._audio&&(this._audio.classList.add("active"),this._audio.play())}pause(){this._audio&&(this._audio.classList.remove("active"),this._audio.pause())}onchangeSrc(t){try{"data"!==String(t).substring(0,4)?this._audio.crossOrigin="use-credentials":this._audio.crossOrigin=null,this._audio.src="string"==typeof t?this.app.url(t):t}catch(t){return void Lr(t)}}onchangeStarted(t){const e=this._audio;t?4==e.readyState&&e.play():e.pause()}onchangeLoop(t){this._audio.loop=t}onchange(t,e){"src"in t&&this.onchangeSrc(t.src),"started"in t&&this.onchangeStarted(t.started),"loop"in t&&this.onchangeLoop(t.loop)}ondblclick(t){this.started=!this.started}ondropfile(t,e){for(let n=0;n<t.length;n++)if(t[n].type.startsWith("audio/"))return void(this.src=e[n])}}Ha.register("audio",bg);class vg extends(Ya(Ha)){is3dish(){return!0}}Ha.register("text",vg);const _g=["refid","left","top","width","height","rotation","animation","zPos"];class xg extends Df{isGroup(){return!0}is3dish(){return!0}get(t){return this._model[t]}set(t,e){if("string"==typeof t)return this.set({[t]:e});const n=_g.reduce((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e),{});return super.set(n,void 0)}capture(t,e,n){const r=super.capture(t,e,n);if(r!==this)return r}set bounds(t){if(this.__MUTATING__)return void(super.bounds=t);const e=this.bounds,n=t.width/e.width,r=t.height/e.height;this.path=this.path.map(i=>({x:t.left+(i.x-e.left)*n,y:t.top+(i.y-e.top)*r})),this.components&&this.components.forEach(t=>{if(t.mutable)t.mutatePath(null,function(t){return t.map(function(t){return{x:t.x*n,y:t.y*r}})});else{const e=t.bounds,i=t.center,s={x:i.x*(1-n),y:i.y*(1-r)},o=e.width*(1-n),a=e.height*(1-r),c=-(s.x-o/2),l=-(s.y-a/2);t.bounds={left:e.left+c,top:e.top+l,width:e.width*n,height:e.height*r}}})}get focusible(){return!1}get bounds(){return super.bounds}get hasTextProperty(){return!1}isIdentifiable(){return!1}calculateBounds(){this.clearCache(),this.__MUTATING__=!0,this.mutateBounds(function(t){const e=Ha.union(this.components.map(t=>t.bounds));return this.components.forEach(t=>{const n=t.bounds;t.bounds={left:n.left-e.left,top:n.top-e.top,width:n.width,height:n.height}}),{left:t.left+e.left,top:t.top+e.top,width:e.width,height:e.height}},this),this.__MUTATING__=!1,this.parent.isGroup()&&this.parent.calculateBounds?.()}render(t){}postrender(t){const{top:e,left:n}=this.state;t.translate(n,e),this.layout.drawables(this).forEach(e=>{e.draw(t)}),t.translate(-n,-e)}}Ha.memoize(xg.prototype,"bounds",!0),Ha.register("group",xg);const wg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"id-input",label:"ref",name:"ref"},{type:"select",label:"fit",name:"fit",property:{options:["","both","ratio"]}}],"value-property":"ref",help:"scene/component/local-ref"};class Mg extends(Ya(Va)){get ref(){const t=this.getState("ref");return t&&"string"==typeof t?this.root.findById?.(t):null}set ref(t){this.setState("ref",t)}get refScale(){const t=this.ref;if(!t)return{x:1,y:1};const e=t.bounds,n=this.bounds,r=n.width/e.width,i=n.height/e.height;return"both"===this.model.fit?{x:r,y:i}:{x:Math.min(r,i),y:Math.min(r,i)}}draw(t){this._drawing||(this._drawing=!0,super.draw(t),this._drawing=!1)}prerender(t){if(super.prerender(t),this.ref){const e=this.ref.center,n=this.center,r=this.refScale;t.translate(n.x,n.y),t.scale(r.x,r.y),t.translate(-e.x,-e.y)}}postrender(t){if(this.ref)return this.ref.postrender(t);super.postrender(t)}render(t){if(this.ref)return this.ref.render(t);const{left:e,top:n,width:r,height:i}=this.bounds;t.beginPath(),t.rect(e,n,r,i)}get nature(){return wg}get hasTextProperty(){return!1}}Ha.memoize(Mg.prototype,"ref",!1),Ha.memoize(Mg.prototype,"refScale",!1),Ha.register("local-ref",Mg);class Sg extends(Ef(yc)){render(t){}is3dish(){return!0}get layout(){return Ka.get(this.get("layout"))||Qa}}const Ag={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"board-selector",label:"scene-number",name:"ref",placeholder:"SCENE-1"},{type:"number",label:"round",name:"round",property:{min:0}},{type:"select",label:"fit",name:"fit",property:{options:["","both","ratio","width","height","none"]}},{type:"select",label:"mode",name:"mode",property:{options:["view","interaction"]}}],"value-property":"ref",help:"scene/component/global-ref"};class Eg extends Sg{dispose(){this._releaseRef(),super.dispose()}get nature(){return Ag}get hasTextProperty(){return!1}get tagName(){return"div"}setElementProperties(t){const{mode:e="view",round:n=0}=this.state;t.style.pointerEvents="view"==e?"none":"inherit",t.style.borderRadius=n+"px"}async ready(){super.ready(),this.fetchRef()}reposition(){if(!this.element)return;super.reposition();const t=this._element_bounds,{offsetWidth:e,offsetHeight:n}=this.element;if(this._element_bounds={offsetWidth:e,offsetHeight:n},(!t||t.offsetWidth!=e||t.offsetHeight!=n)&&this.ref&&this.root.target_element){const{fit:t="ratio"}=this.state;this.ref.fit(t)}}async fetchRef(){this._releaseRef();const{ref:t,fit:e="ratio"}=this.state;if(!t)return;const n=this.app.refProvider;if(n&&t){const r=(async()=>{this.__ref=await n.get(t,!0),this.__ref.target=this.element,this.__ref.fit(e),this.__ref.data=this.data})();this.root?.app?.loadTracker?.track(`ref:${t}`,"ref-board",t,r);try{await r}catch(t){Lr(t)}}}get ref(){return this.__ref}set ref(t){this.setState("ref",t)}_releaseRef(){this.__ref&&this.__ref.release&&this.__ref.release(),delete this.__ref}onchange(t,e,n){super.onchange(t,e),"ref"in t&&this.fetchRef(),"fit"in t&&this.ref&&requestAnimationFrame(()=>{const{fit:t}=this.state;this.ref.fit(t)}),"data"in t&&this.ref&&requestAnimationFrame(()=>{this.ref.data=t.data})}}Ha.register("global-ref",Eg);const kg="center-middle",Cg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"board-selector",label:"board",name:"board"},{type:"checkbox",label:"modal",name:"modal"},{type:"checkbox",label:"closable",name:"closable"},{type:"checkbox",label:"draggable",name:"draggable"},{type:"checkbox",label:"minimizable",name:"minimizable"},{type:"checkbox",label:"show",name:"show"},{type:"select",label:"popup-position",name:"popupPosition",property:{options:["static","absolute"]}},{type:"select",label:"popup-origin",name:"origin",property:{options:["left-top","center-top","right-top","left-middle",kg,"right-middle","left-bottom","center-bottom","right-bottom","auto"]}},{type:"string",label:"title",name:"text"},{type:"data",label:"value",name:"value"}],help:"scene/component/popup"};class Tg extends(Ya(Va)){static get image(){return Tg._image||(Tg._image=new Image,Tg._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAMAAABG8BK2AAADJmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4xLWMwMDAgNzkuZGFiYWNiYiwgMjAyMS8wNC8xNC0wMDozOTo0NCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM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MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzOguTm2AAAATHRSTlMARhB73r9B7YLrsqdE+0cq9Avzeg31eQx4aQ+Ks6aUd5DsYKixEX1w8vyT2VjoZ3YezY/cCEDvl+QTvRwJ0ifwK/5T/aw6+IuFuCImAcS6MQAAAeJJREFUWMPt2FlX2zAQhuHJYmOSFhIggbC0QNn3rS1dKXSH9///Hi58CJLxKIpEWi6YO8c5z4lG/nxGEXmu/1OVLGnhrFaSVQYg1SZetTTvUibqeFZ9QlfmvRWoV1VmCaCRzroXPpsuAjTV7gLUfPahBqD1OQMW/fazAWTKvQRI/ZgUSJR7U8CM/dHZ+/2VcatWdvdEZAaYUhiAwkerJXt0rnzXwdRKmHfDM0fHD5kxjTFyVLzVfvvirn7+cDJWjhy7c7XlYuwc6Urvu2tRhRypyhwAf1sKY+TIxfQA+H39q5wxc+RgVrcBduTmZTlj5khnDgH4IzKpMGaOVCbvyyvRGTNHGtPrKypjXirM5jb910I4k69oQeKY+77EMAcALEsck/+W6f71tyCma/ZFROTrJVwMy7wmf3bv6/MX+Dgkkysblvxps/dhOKZb6IvrTakzXXuPApnpYneDGOeKvJlaSXcDmA7AicQyW84VeTOnY+NdiWcG1uiZksFEHdyAlsJEjEkmkwGNsKHNZCJGSKtVTYC1tO022mnjwUBrMdXg8dreuOBhv7D/62/8lGZ1wLxXyZKOm+iUHIQintyny0TkaATHjYgcjeAoFpEje9R/nGPqIx2aw3NU9odCQI6e6x/VLY32cKQXVBnkAAAAAElFTkSuQmCC"),Tg._image}async ready(){await super.ready(),this.show&&this.onchangeShow(!0)}render(t){const{left:e,top:n,width:r,height:i}=this.bounds;t.beginPath(),this.drawImage(t,Tg.image,e,n,r,i)}onchange(t,e){"value"in t?this.show?this.onchangeShow(!0):this.show=!0:"show"in t&&this.onchangeShow(this.show)}onchangeShow(t){!this.app.isEditMode&&this.getState("board")&&(t?this.openPopup(this.value):this.hidePopup())}openPopup(t,e){this.app.isEditMode||pc.show(this,this.getState("board"),{origin:this.getState("origin")||kg,modal:this.getState("modal"),closable:this.getState("closable")||!1,draggable:this.getState("draggable")||!1,minimizable:this.getState("minimizable")||!1,popupPosition:this.getState("popupPosition"),title:this.text,data:t||this.value,...e})}hidePopup(){pc.hide(this)}get board(){return this.getState("board")}set board(t){this.set("board",t)}get show(){return this.getState("show")}set show(t){this.setState("show",t)}get started(){return this.getState("show")}set started(t){this.setState("show",t)}get value(){return this.getState("value")}set value(t){this.setState("value",t)}get hasTextProperty(){return!1}get nature(){return Cg}}Ha.register("popup",Tg);class Pg extends Ha{render(t){const{path:e=[]}=this.state;if(!(e.length<=1)){t.beginPath(),t.moveTo(e[0].x,e[0].y);for(let n=1;n<e.length;n++)t.lineTo(e[n].x,e[n].y);t.closePath(),this.drawStroke(t,void 0)}}get path(){return this.model.path}set path(t){this.set("path",t)}contains(t,e){const n=this.state.path;let r=!1;return n.forEach((i,s)=>{const o=(s+n.length+1)%n.length,a=i.x,c=i.y,l=n[o].x,h=n[o].y;c>e!=h>e&&t<(l-a)*(e-c)/(h-c)+a&&(r=!r)}),r}}Ha.register("path",Pg);const Dg={mutable:!0,resizable:!1,rotatable:!0,properties:[{type:"number",label:"round",name:"round",property:{min:0,max:100,step:1}}],help:"scene/component/triangle"};class Og extends Va{is3dish(){return!0}contains(t,e){const{x1:n,y1:r,x2:i,y2:s,x3:o,y3:a}=this.state,c=[n,r,i,s,o,a];let l=!1;for(let n=0;n<c.length;n+=2){const r=(n+2)%c.length,i=c[n],s=c[n+1],o=c[r+1];s>e!=o>e&&t<(c[r]-i)*(e-s)/(o-s)+i&&(l=!l)}return l}get mutable(){return!0}get path(){const{x1:t,y1:e,x2:n,y2:r,x3:i,y3:s}=this.state;return[{x:t,y:e},{x:n,y:r},{x:i,y:s}]}set path(t){this.set({x1:t[0].x,y1:t[0].y,x2:t[1].x,y2:t[1].y,x3:t[2].x,y3:t[2].y})}get nature(){return Dg}}Ha.memoize(Og.prototype,"path",!1),Ha.register("triangle",Og);const zg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"ratio",name:"ratio",property:"ratio"}],help:"scene/component/donut"},Ig={ondragmove:function(t,e,n){let{cx:r,rx:i}=n.model;i=Math.abs(i);let s=(n.fromParent(t.x,t.y).x-r)/i*100;s=s>=100||s<=-100?100:Math.abs(s),n.set({ratio:s})}};class Lg extends Wf{is3dish(){return!0}render(t){let{ratio:e=50,cx:n,cy:r,rx:i,ry:s,startAngle:o,endAngle:a,anticlockwise:c}=this.state;i=Math.abs(i),s=Math.abs(s),t.beginPath(),t.ellipse(n,r,i,s,0,o||0,a||2*Math.PI,c),t.moveTo(n+i/100*e,r),t.ellipse(n,r,i/100*e,s/100*e,0,o||0,a||2*Math.PI,!0)}contains(t,e){let{cx:n,cy:r,rx:i,ry:s,ratio:o}=this.state;i=Math.abs(i),s=Math.abs(s);const a=(t-n)/(2*i-.5),c=(e-r)/(2*s-.5),l=(t-n)/(i/100*o*2-.5),h=(e-r)/(s/100*o*2-.5);let d=!1;return a*a+c*c<.25&&l*l+h*h>.25&&(d=!d),d}get controls(){let{cx:t,cy:e,rx:n,ratio:r}=this.state;return n=Math.abs(n),[{x:t+n/100*r,y:e,handler:Ig}]}get nature(){return zg}}Ha.memoize(Lg.prototype,"controls",!1),Ha.register("donut",Lg);const Rg={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"ratio",name:"ratio",property:"ratio"},{type:"number",label:"wing",name:"wing",property:"wing"}],help:"scene/component/star"},jg={ondragmove:function(t,e,n){const{cy:r,ry:i}=n.model;let s=(n.fromParent(t.x,t.y).y-r)/i*100+100;s>=100?s=100:s<=0&&(s=0),n.set({ratio:s})}};class Fg extends Wf{is3dish(){return!0}render(t){const{ratio:e=30,wing:n=5,cx:r,cy:i,rx:s,ry:o}=this.state;if(n<3)return;const a=1.5707963267948966,c=2*Math.PI/n,l=s-e/100*s,h=o-e/100*o;t.save(),t.beginPath(),t.translate(r,i),t.moveTo(s*Math.cos(-a),o*Math.sin(-a)),t.lineTo((s-l)*(Math.cos(c-a)+Math.cos(0-a))/2,(o-h)*(Math.sin(c-a)+Math.sin(0-a))/2);for(let e=1;e<n;e++)t.lineTo(s*Math.cos(c*e-a),o*Math.sin(c*e-a)),t.lineTo((s-l)*(Math.cos(c*(e+1)-a)+Math.cos(c*e-a))/2,(o-h)*(Math.sin(c*(e+1)-a)+Math.sin(c*e-a))/2);t.closePath(),t.restore()}get controls(){const{cx:t,cy:e,ry:n,ratio:r}=this.state;return[{x:t,y:e-n+n*(r/100),handler:jg}]}get nature(){return Rg}}Ha.memoize(Fg.prototype,"controls",!1),Ha.register("star",Fg);const Bg={mutable:!1,resizable:!1,rotatable:!1,properties:[]};class Ng extends(gd(Va)){is3dish(){return!1}isDescendible(){return!1}render(t){const{cx:e,cy:n,anticlockwise:r}=this.state,i=this.app?.scale||1;t.beginPath(),t.scale(1/i,1/i),t.ellipse(e,n,Math.abs(Ng.RADIUS),Math.abs(Ng.RADIUS),0,0,2*Math.PI,r),t.scale(i,i),t.closePath()}get path(){const{cx:t,cy:e}=this.state;return[{x:t-Ng.RADIUS,y:e-Ng.RADIUS},{x:t+Ng.RADIUS,y:e-Ng.RADIUS},{x:t+Ng.RADIUS,y:e+Ng.RADIUS},{x:t-Ng.RADIUS,y:e+Ng.RADIUS}]}set path(t){const e=t[0],n=t[2];this.set({cx:e.x+(n.x-e.x)/2,cy:e.y+(n.y-e.y)/2})}contains(t,e){const{cx:n,cy:r}=this.state,i=(t-n)/(2*Ng.RADIUS-.5),s=(e-r)/(2*Ng.RADIUS-.5);return i*i+s*s<.25}outline(t){const{cx:e,cy:n}=this.state;return this.toScene(e,n)}get nature(){return Bg}}Ng.RADIUS=5,Ha.memoize(Ng.prototype,"path",!1),Ha.register("node",Ng);class Hg extends Sh{getObject3dInstance(){return new _.Mesh}build(){super.build();const{width:t,height:e}=this.component.bounds,n=this.component.state.depth||.5*Math.min(t,e),r=.15*Math.min(t,e,n),i=new b.RoundedBoxGeometry(1,1,1,4,r/Math.min(t,e,n));i.scale(t,n,e),this.object3d.geometry=i,this.object3d.material=new _.MeshStandardMaterial({color:"#5090d0",transparent:!0,opacity:.35,roughness:.6,metalness:.1,side:_.FrontSide,depthWrite:!1}),this.object3d.visible=!!this.component.app?.isEditMode}updateAlpha(){const t=this.object3d.material;t&&(t.opacity=this.component.app?.isEditMode?.35:0)}updateHidden(){this.object3d.visible=!!this.component.app?.isEditMode&&!this.component.state.hidden}updateDimension(){const{width:t,height:e}=this.component.bounds,n=this.component.state.depth||.5*Math.min(t,e);this.object3d.geometry.computeBoundingBox();const r=this.object3d.geometry.boundingBox;if(r){const i=r.max.x-r.min.x,s=r.max.y-r.min.y,o=r.max.z-r.min.z;this.object3d.scale.set(t/i,n/s,e/o)}}updateFillStyle(){}updateStrokeStyle(){}updateText(){}clear(){return _h(this.object3d),super.clear()}}const Vg="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="#5090d0">\n <path d="M32 20a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm0 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12z"/>\n <path d="M55.4 27.2l-3.6-.6c-.4-1.2-.8-2.4-1.4-3.4l2.2-3c.6-.8.4-2-.2-2.6l-3-3c-.8-.6-1.8-.8-2.6-.2l-3 2.2c-1.2-.6-2.2-1-3.4-1.4l-.6-3.6c-.2-1-1-1.6-2-1.6h-4.2c-1 0-1.8.6-2 1.6l-.6 3.6c-1.2.4-2.4.8-3.4 1.4l-3-2.2c-.8-.6-2-.4-2.6.2l-3 3c-.6.8-.8 1.8-.2 2.6l2.2 3c-.6 1.2-1 2.2-1.4 3.4l-3.6.6c-1 .2-1.6 1-1.6 2v4.2c0 1 .6 1.8 1.6 2l3.6.6c.4 1.2.8 2.4 1.4 3.4l-2.2 3c-.6.8-.4 2 .2 2.6l3 3c.8.6 1.8.8 2.6.2l3-2.2c1.2.6 2.2 1 3.4 1.4l.6 3.6c.2 1 1 1.6 2 1.6h4.2c1 0 1.8-.6 2-1.6l.6-3.6c1.2-.4 2.4-.8 3.4-1.4l3 2.2c.8.6 2 .4 2.6-.2l3-3c.6-.8.8-1.8.2-2.6l-2.2-3c.6-1.2 1-2.2 1.4-3.4l3.6-.6c1-.2 1.6-1 1.6-2v-4.2c0-1-.6-1.8-1.6-2z"/>\n</svg>');class Gg extends(Ya(Ha)){static get icon(){return Gg._defaultIcon||(Gg._defaultIcon=new Image,Gg._defaultIcon.src=Vg),Gg._defaultIcon}get serviceName(){}get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new Hg(this)}render(t){if(this.app?.isViewMode)return;const{left:e,top:n,width:r,height:i}=this.bounds,s=this.constructor.icon;t.beginPath(),t.globalAlpha=.6,this.drawImage(t,s,e,n,r,i),t.globalAlpha=1}added(t){super.added(t);const e=this.serviceName;e&&(this._registeredRoot=this.root,this._registeredRoot?.registerService?.(e,this))}removed(t){const e=this.serviceName;e&&this._registeredRoot&&(this._registeredRoot.unregisterService?.(e),this._registeredRoot=void 0),super.removed(t)}get controls(){return[]}}function Yg(t){return class extends t{animOnValueChange(t,e=!1,n){if(t==this._lastValue)return;let r;r=e?t-(Number(n)||0):t-(this._lastValue||0),this._lastValue=t,this._anim_alpha=-r,this.animate({step:t=>{this._anim_alpha=r*(t-1),this.invalidate()},duration:1e3,delta:"circ",options:{x:1},ease:"out"}).start()}dispose(){super.dispose(),delete this._value_substitutor}onchange(t,e){t.hasOwnProperty("value")&&delete this._value_substitutor}get animAlpha(){return this._anim_alpha||0}get animValue(){return(this._lastValue||0)+(this._anim_alpha||0)}defaultValueSubstitutor(){return this.getState("value")}get valueSubstitutor(){return this._value_substitutor||(this._value_substitutor=ms(this.getState("value"),this,void 0)||this.defaultValueSubstitutor),this._value_substitutor}get value(){return Number(this.valueSubstitutor())||0}set value(t){delete this._value_substitutor,this.setState("value",Number(sr(t)))}}}function Ug(t){return class extends t{_convertDataFormat(t,e){let n;if("json"===e)n=JSON.parse(t);else n=t;return n}isDataSource(){return!0}}}function $g(t){return function(e){return Array.isArray(t)?t.forEach(t=>{Ha.register(t,e)}):Ha.register(t,e),e}}let Wg=0;const qg=new FinalizationRegistry(()=>{Wg--});class Xg{static get residents(){return Wg}static get residentsCount(){return Wg}constructor(t,e){this.counters={},this.references={},this.creator=t,this.disposer=e,Wg++,qg.register(this,Wg)}dispose(){if(this.disposer)for(const t in this.references)this.disposer(t,this.references[t]);this.references={},this.counters={}}get ids(){return Object.keys(this.references)}create(t){return new Promise((e,n)=>{this.creator?this.creator(t,n=>{n.release=()=>{this.disposer?.(t,n),delete n.release,jr("RELEASED",t)},e(n)},n):n(Error("Reference id("+t+") could not be created. Reference creator should be defined."))})}add(t,e){const n=new Promise((n,r)=>{const i=this.references[t];if(i)i===e?r(Error("Reference ID and target duplicate")):e?r(Error("Reference ID duplicate")):n(i);else{const i=e=>{e.release=()=>{this.release(e)},this.references[t]=e,this.counters[t]=1,n(e)};if(e)i(e);else{if(!this.creator)return void r(Error("Reference id("+t+") is not allowed. Reference creator should be defined."));this.creator(t,i,r)}}});return this.references[t]||(this.references[t]=n),n}async get(t,e=!1){let n=this.references[t];if(n){if(!(n instanceof Promise)){if(!(t in this.counters))throw new Error("No Reference Count");return this.counters[t]++,n}if(e)return n=await n,this.counters[t]++,n}if(e)return await this.add(t);throw new Error("No References for "+t)}_id(t){for(const e in this.references){if(this.references[e]===t)return e}}release(t){const e=this._id(t);if(!e)return void Lr("No Referenced ID");const n=this.references[e];n&&(this.counters[e]--,0==this.counters[e]&&(this.disposer?.(e,n),delete this.references[e],delete this.counters[e],delete t.release,jr("RELEASED",e)))}}const Kg={},Qg={};let Zg=[];function Jg(t){const e=t.target,n="SCRIPT"===e.tagName?Kg:Qg,r=e.src||e.href;n[r]=!0,Zg.forEach((t,e)=>{if(!t)return;const{resolve:i,scripts:s,styles:o}=t;if(n===Kg){const t=s.indexOf(r);t>-1&&t<s.length-1&&em(s[t+1])}s.some(t=>!Kg[t])||o?.some(t=>!Qg[t])||(i(),Zg[e]=null)}),Zg=Zg.filter(Boolean)}function tm(t){if("string"==typeof t)return;const e=t.target,n=e.src,r="SCRIPT"===e.tagName?Kg:Qg;Zg.forEach((e,i)=>{if(!e)return;const{reject:s,scripts:o,styles:a}=e;(r===Kg&&o.includes(n)||r===Qg&&!!a?.includes(n))&&(s(t),Zg[i]=null)}),Zg=Zg.filter(Boolean),delete r[n],document.head.removeChild(e)}function em(t){Kg[t]=!1;const e=document.createElement("script");e.onload=Jg,e.onerror=tm,e.type="text/javascript",e.src=t,document.head.appendChild(e)}class nm{static load(t,e){const n="string"==typeof t?[t]:t,r="string"==typeof e?[e]:e;return new Promise(function(t,e){if(n&&!Array.isArray(n)||r&&!Array.isArray(r))return void e(new Error("invalid sources for load"));let i,s=!0;if(r?.forEach(t=>{t in Qg||function(t){Qg[t]=!1;const e=document.createElement("link");e.onload=Jg,e.onerror=tm,e.type="text/css",e.rel="stylesheet",e.media="screen,print",e.href=t,document.head.appendChild(e)}(t),Qg[t]||(s=!1)}),n&&n.length>0)for(const t of n)t in Kg?Kg[t]||(s=!1):i??=t;if(i)em(i);else if(s)return void t();Zg.push({resolve:t,reject:e,scripts:n,styles:r})})}}const rm="0.0.0";class im extends Sh{getObject3dInstance(){return new _.Sprite}build(){super.build(),this.buildMaterial()}get cz(){const{zPos:t=0}=this.component.state,{height:e}=this.component.bounds,{tz:n=0}=this.component.delta();return t+n+e/2}updateAlpha(){const{alpha:t=1,fillStyle:e}=this.component.state;ah(this.object3d.material,t,e)}updateHidden(){this.object3d.visible=!this.component.state.hidden}updateFillStyle(){const{fillStyle:t}=this.component.state,e=this.object3d.material;if(!e)return;const n=Sh.buildFillStyleTexture(this.component);n?(e.map&&e.map.dispose(),n.needsUpdate=!0,e.map=n):"string"==typeof t&&("transparent"!==t?e.color.set(ch(t)):e.opacity=0)}}function sm(t){if(!(t>0))return 1;let e=0;if(!(t&t-1))return t;for(;0!=t;)t>>=1,e+=1;return 1<<e}function om(t){const{lineWidth:e=0}=t.state;let{width:n,height:r}=t.bounds;n+=e,r+=e;const i=sm(2*n),s=sm(2*r),o=th(i,s),a=new _.CanvasTexture(o);return am(o,t,2),a.needsUpdate=!0,a.wrapS=_.RepeatWrapping,a.wrapT=_.RepeatWrapping,a.offset.set(0,1-2*r/s),a.repeat.set(2*n/i,2*r/s),a.magFilter=_.NearestFilter,a.minFilter=_.LinearFilter,a.colorSpace=_.SRGBColorSpace,a}function am(t,e,n){const{lineWidth:r=0}=e.state;let{left:i,top:s}=e.bounds;i-=r/2,s-=r/2;const o=t.getContext("2d");o.scale(n,n),o.translate(-i,-s),e.render(o),e.postrender(o)}class cm extends im{buildMaterial(){const t=this.object3d.material;t&&t.dispose(),this.object3d.material=new _.SpriteMaterial({map:om(this.component),alphaTest:.01,sizeAttenuation:!1})}get scale(){const{width:t,height:e}=this.component.bounds,n=this.threeContainer,{width:r=1,height:i=1}=n?.bounds??{},{scale:s=1}=this.component.state;return{x:s*t/r,y:s*e/i,z:s}}update(){this.build(),this.updateHidden()}updateFillStyle(){this.update()}updateStrokeStyle(){this.update()}updateAlpha(){this.update()}updateText(){this.update()}}class lm extends Sh{get syncZPosOffset(){return this.effectiveDepth}getObject3dInstance(){return new _.Mesh}build(){super.build();const t=fh(this.component.state.material3d),e=new _.PlaneGeometry(1,1);e.rotateX(-Math.PI/2),this.object3d.geometry=e;const n=om(this.component);this.object3d.material=new _.MeshStandardMaterial({map:n,transparent:!0,alphaTest:.01,side:_.DoubleSide,metalness:t.metalness,roughness:t.roughness,emissive:new _.Color(t.emissive),emissiveIntensity:t.emissiveIntensity}),this.object3d.castShadow=t.castShadow,this.object3d.receiveShadow=t.receiveShadow}updateAlpha(){const{alpha:t=1,fillStyle:e}=this.component.state;ah(this.object3d.material,t,e)}updateHidden(){this.object3d.visible=!this.component.state.hidden}updateDimension(){const{width:t,height:e}=this.component.bounds;this.object3d.scale.set(t,1,e)}update(){this.clear(),this.build(),this.updateDimension(),this.updateTransform(),this.updateHidden()}updateFillStyle(){this.update()}updateStrokeStyle(){this.update()}updateText(){this.update()}updateMaterial3d(){super.updateMaterial3d();const t=this.object3d.material;if(!t)return;const e=fh(this.component.state.material3d);t.metalness=e.metalness,t.roughness=e.roughness,t.emissive.set(e.emissive),t.emissiveIntensity=e.emissiveIntensity}clear(){return _h(this.object3d),super.clear()}}class hm extends Sh{getObject3dInstance(){return new _.Mesh}build(){super.build(),this.buildGeometry(),this.buildMaterial()}updateAlpha(){const{alpha:t=1,fillStyle:e}=this.component.state;ah(this.object3d.material,t,e)}updateHidden(){this.object3d.visible=!this.component.state.hidden}updateFillStyle(){const{fillStyle:t}=this.component.state,e=this.object3d.material;if(!e)return;const n=Sh.buildFillStyleTexture(this.component);n?(e.map&&e.map.dispose(),n.needsUpdate=!0,e.map=n):"string"==typeof t&&("transparent"!==t?e.color.set(ch(t)):e.opacity=0)}updateStrokeStyle(){const t=this.object3d.getObjectByName("__edgeLines__");t&&(this.object3d.remove(t),_h(t));const{strokeStyle:e}=this.component.state;if(!e||"transparent"===e||"none"===e)return;const n=this.object3d.geometry;if(!n?.getAttribute("position"))return;const r=new _.EdgesGeometry(n),i=new _.LineBasicMaterial({color:e}),s=new _.LineSegments(r,i);s.name="__edgeLines__",this.object3d.add(s)}updateDimension(){const{width:t,height:e}=this.component.bounds,{depth:n=1}=this.component.state;if(!this.object3d)return;this.object3d.geometry.computeBoundingBox();const r=this.object3d.geometry.boundingBox;if(r){const i=r.max.x-r.min.x,s=r.max.y-r.min.y,o=r.max.z-r.min.z;this.object3d.scale.set(t/i,n/s,e/o)}}buildMaterial(){const t=fh(this.component.state.material3d),e=new _.MeshStandardMaterial({transparent:!0});yh(e,t),this.object3d.material=e}updateMaterial3d(){super.updateMaterial3d();const t=this.object3d.material;t&&yh(t,fh(this.component.state.material3d))}clear(){return _h(this.object3d),super.clear()}}function dm(t,e,n,r){return[["bold",t],["italic",e],[n+"px",!0],[r,!0]].filter(t=>t[1]).map(t=>t[0]).join(" ")}function um(t){let e=0;if(!((t=Math.abs(t)||1)&t-1))return t;for(;0!=t;)t>>=1,e+=1;return 1<<e}function pm(t,e,n){const{bold:r=!1,italic:i=!1,fontFamily:s="Serif",fontSize:o=10,fontColor:a="black",textAlign:c="center",textBaseline:l="middle",width:h=t.width,height:d=t.height}=n||{},u=t.getContext("2d");let p,f;u.imageSmoothingEnabled=!1,u.fillStyle=a,u.strokeStyle=a,u.font=dm(r,i,o,s),"left"===c||"start"===c?(u.textAlign="left",p=0):"right"===c||"end"===c?(u.textAlign="right",p=h):(u.textAlign="center",p=h/2);const g=1.2*o,m=String(e).split("\n"),y=g*m.length;f="top"===l||"hanging"===l?.1*o:"bottom"===l||"alphabetic"===l?d-y+.1*o:(d-y)/2+.1*o,u.textBaseline="top";for(const t of m)u.fillText(t,p,f),f+=g}function fm(t,e,n,r){const i=um(2*e),s=um(2*n),o=th(i,s),a=o.getContext("2d"),{fillStyle:c}=r||{};if(c&&"object"==typeof c&&c.colorStops?.length){const t=xh(c,2*e,2*n);t&&a.drawImage(t,0,0)}a.scale(2,2),"string"==typeof c&&""!==c&&"transparent"!==c&&(a.fillStyle=c,a.fillRect(0,0,e,n)),pm(o,t,r);const l=new _.CanvasTexture(o);return l.needsUpdate=!0,l.wrapS=_.RepeatWrapping,l.wrapT=_.RepeatWrapping,l.offset.set(0,1-2*n/s),l.repeat.set(2*e/i,2*n/s),l.minFilter=_.LinearFilter,l.colorSpace=_.SRGBColorSpace,l}function gm(t,e,n,r,i,s,o){const a=new Image;a.crossOrigin="anonymous",a.onload=()=>{const t=2*n,c=2*r,l=um(t),h=um(c),d=th(l,h),u=d.getContext("2d");if(s.color&&(u.fillStyle=s.color,u.fillRect(0,0,t,c)),s.fitPattern)u.drawImage(a,0,0,t,c);else{const e=2*(s.width||a.naturalWidth),n=2*(s.height||a.naturalHeight),r=2*(s.offsetX||0),i=2*(s.offsetY||0);let o=0,l=0;switch(s.align){case"center":o=(t-e)/2,l=(c-n)/2;break;case"left-top":break;case"left-bottom":l=c-n;break;case"right-top":o=t-e;break;case"right-bottom":o=t-e,l=c-n;break;case"left":l=(c-n)/2;break;case"right":o=t-e,l=(c-n)/2;break;case"top":o=(t-e)/2;break;case"bottom":o=(t-e)/2,l=c-n}const h=r+o,d=i+l;if(s.noRepeat)u.drawImage(a,0,0,a.naturalWidth,a.naturalHeight,h,d,e,n);else{u.save(),u.rect(0,0,t,c),u.clip();const r=h>0?h-Math.ceil(h/e)*e:h;for(let i=d>0?d-Math.ceil(d/n)*n:d;i<c;i+=n)for(let s=r;s<t;s+=e)u.drawImage(a,0,0,a.naturalWidth,a.naturalHeight,s,i,e,n);u.restore()}}e&&(u.scale(2,2),pm(d,e,i));const p=new _.CanvasTexture(d);p.needsUpdate=!0,p.wrapS=_.RepeatWrapping,p.wrapT=_.RepeatWrapping,p.offset.set(0,1-c/h),p.repeat.set(t/l,c/h),p.minFilter=_.LinearFilter,p.colorSpace=_.SRGBColorSpace,o(p)},a.onerror=()=>{const t=fm(e,n,r,i);o(t)},a.src=t}function mm(t,e){let{bold:n=!1,italic:r=!1,fontFamily:i="Serif",fontSize:s=10,lineHeight:o="normal"}=e||{};t=void 0===t||""==t?" ":String(t);const a=document.createElement("span");a.style.font=dm(n,r,s,i),a.style.lineHeight=String(o),a.style.whiteSpace="pre",a.style.position="absolute",a.textContent=t,document.body.appendChild(a);const c=a.getBoundingClientRect();return document.body.removeChild(a),{width:c.width,height:c.height}}class ym extends hm{get syncZPosOffset(){return this.effectiveDepth}buildGeometry(){this.updateDimension()}updateStrokeStyle(){}updateFillStyle(){this.updateText()}updateDimension(){const{width:t,height:e}=this.component.state,n=Math.abs(t)||1,r=Math.abs(e)||1;this.object3d.geometry&&this.object3d.geometry.dispose();const i=new _.PlaneGeometry(n,r);i.rotateX(-Math.PI/2),this.object3d.geometry=i}updateText(){const t=this.object3d.material;if(!t)return;const{width:e,height:n,bold:r=!1,italic:i=!1,fontFamily:s="Serif",fontSize:o=10,fontColor:a="black",textAlign:c="center",textBaseline:l="middle",fillStyle:h}=this.component.state,d=Math.abs(e)||1,u=Math.abs(n)||1,p=this.component.text,f=h&&"none"!==h?h:"transparent",g={bold:r,italic:i,fontFamily:s,fontSize:o,fontColor:a,textAlign:c,textBaseline:l,width:d,height:u,fillStyle:f};if("object"==typeof f&&"pattern"===f?.type&&f.image){return void gm(this.component.app.url(h.image),p,d,u,g,h,e=>{t.map&&t.map.dispose(),t.map=e,t.color.set(16777215),t.needsUpdate=!0})}const m=fm(p,d,u,g);m?(t.map&&t.map.dispose(),t.map=m,t.color.set(16777215),m.needsUpdate=!0):"string"==typeof h&&(""!==h&&"transparent"!==h?t.color.set(ch(h)):t.opacity=0)}updateAlpha(){const{alpha:t=1}=this.component.state,e=this.object3d.material;e.opacity=t,e.transparent=!0}}Ch("text",t=>new ym(t));class bm extends Sh{get syncZPosOffset(){return this.effectiveDepth}getObject3dInstance(){return new _.Mesh}build(){super.build();const{width:t,height:e}=this.component.bounds;if(!t||!e)return;const n=fh(this.component.state.material3d),r=new _.PlaneGeometry(1,1);r.rotateX(-Math.PI/2),this.object3d.geometry=r;const i=om(this.component);this.object3d.material=new _.MeshStandardMaterial({map:i,transparent:!0,side:_.DoubleSide,metalness:n.metalness,roughness:n.roughness,emissive:new _.Color(n.emissive),emissiveIntensity:n.emissiveIntensity}),this.object3d.castShadow=n.castShadow,this.object3d.receiveShadow=n.receiveShadow}updateDimension(){const{width:t,height:e}=this.component.bounds;this.object3d.scale.set(t,1,e)}updateAlpha(){const{alpha:t=1,fillStyle:e}=this.component.state;ah(this.object3d.material,t,e)}updateHidden(){this.object3d.visible=!this.component.state.hidden}_debouncedRebuild(){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this._rebuildTexture()},100)}_rebuildTexture(){this.clear(),this.build(),this.updateDimension(),this.updateTransform(),this.updateHidden()}updateFillStyle(){this._debouncedRebuild()}updateStrokeStyle(){this._debouncedRebuild()}updateText(){this._debouncedRebuild()}updateMaterial3d(){super.updateMaterial3d();const t=this.object3d.material;if(!t)return;const e=fh(this.component.state.material3d);t.metalness=e.metalness,t.roughness=e.roughness,t.emissive.set(e.emissive),t.emissiveIntensity=e.emissiveIntensity}clear(){return this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),_h(this.object3d),super.clear()}dispose(){this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),super.dispose()}}const vm={input:"css3d",select:"css3d",textarea:"css3d",button:"css3d",iframe:"css3d",video:"css3d",label:"texture",table:"texture",progress:"texture"};function _m(t){const e=function(t){const e=t.state?.material3d?.renderMode;if("css3d"===e||"texture"===e)return e;const n=t.model?.type??"";return vm[n]??"css3d"}(t);return"texture"===e?new bm(t):new Ah(t)}Ch("html-overlay-element",_m),Ch("html-overlay-container",_m);class xm{setShape({extrudedShape:t,extrudedOptions:e}){this.extrudedShape=t,this.bb=new _.Box2,this.bb.setFromPoints(this.extrudedShape?.extractPoints(0).shape),this.extrudedOptions=e}generateTopUV(t,e,n,r,i){const s=e[3*n],o=e[3*n+1],a=e[3*r],c=e[3*r+1],l=e[3*i],h=e[3*i+1],d=this.bb,u=d.max.x-d.min.x,p=d.max.y-d.min.y;return[new _.Vector2((s-d.min.x)/u,1-(o-d.min.y)/p),new _.Vector2((a-d.min.x)/u,1-(c-d.min.y)/p),new _.Vector2((l-d.min.x)/u,1-(h-d.min.y)/p)]}generateSideWallUV(t,e,n,r,i,s){const o=e[3*n],a=e[3*n+1],c=e[3*n+2],l=e[3*r],h=e[3*r+1],d=e[3*r+2],u=e[3*i],p=e[3*i+1],f=e[3*i+2],g=e[3*s],m=e[3*s+1],y=e[3*s+2],b=this.extrudedOptions?.depth||100,v=this.bb,x=v.max.x-v.min.x,w=v.max.y-v.min.y;return Math.abs(a-h)<.01?[new _.Vector2(o/x,1-c/b),new _.Vector2(l/x,1-d/b),new _.Vector2(u/x,1-f/b),new _.Vector2(g/x,1-y/b)]:[new _.Vector2(a/w,1-c/b),new _.Vector2(h/w,1-d/b),new _.Vector2(p/w,1-f/b),new _.Vector2(m/w,1-y/b)]}}class wm extends Sh{clear(){return this._mesh=void 0,super.clear()}get shape(){return null}get boundUVGenerator(){return this._boundUVGenerator||(this._boundUVGenerator=new xm),this._boundUVGenerator}build(){super.build();const t=this.effectiveDepth,e=this.shape;if(!e)return;const n=this.boundUVGenerator;n&&n.setShape({extrudedShape:e,extrudedOptions:{depth:t}});const r=this.createGeometry(e),i=this.createMaterials();this._mesh=new _.Mesh(r,i),this._mesh.rotation.x=-Math.PI/2,this._mesh.rotation.y=-Math.PI,this._mesh.rotation.z=-Math.PI,this._mesh.castShadow=!0,this.object3d.add(this._mesh),this.updateFillStyle(),this.updateStrokeStyle()}createGeometry(t){const e=this.effectiveDepth,{lineWidth:n=0}=this.component.state,r={steps:1,depth:e,bevelEnabled:n>0,bevelThickness:0,bevelSize:n,bevelSegments:1,UVGenerator:this.boundUVGenerator},i=new _.ExtrudeGeometry(t,r);return i.center(),i}createMaterials(){const t=fh(this.component.state.material3d),e=new _.MeshStandardMaterial;yh(e,t);const n=new _.MeshStandardMaterial;return yh(n,t),[e,n]}createTexture(){const{width:t,height:e}=this.component.bounds,n=um(t),r=um(e),i=th(n,r);this.component.render(i.getContext("2d"));const s=new _.CanvasTexture(i);return s.needsUpdate=!0,s.wrapS=_.RepeatWrapping,s.wrapT=_.RepeatWrapping,s.offset.set(0,1-e/r),s.repeat.set(t/n,e/r),s.minFilter=_.LinearFilter,s}getMaterials(){if(!this._mesh)return;const t=this._mesh.material;return Array.isArray(t)?t:void 0}updateMaterial3d(){super.updateMaterial3d();const t=this.getMaterials();if(!t)return;const e=fh(this.component.state.material3d);for(const n of t)yh(n,e)}updateAlpha(){const{alpha:t=1,fillStyle:e,strokeStyle:n}=this.component.state,r=this.getMaterials();r&&(ah(r[0],t,e),ah(r[1],t,n))}updateStrokeStyle(){const t=this.getMaterials();if(!t)return;const{strokeStyle:e}=this.component.state;t[1].color.set(ch(e))}updateFillStyle(){this._applyCapTexture()}updateText(){this._applyCapTexture()}_applyCapTexture(){const t=this.getMaterials();if(!t)return;const e=t[0],{fillStyle:n}=this.component.state,r=this.component.hasTextProperty?this.component.text:"";if(!r){const t=Sh.buildFillStyleTexture(this.component);return t?(e.map&&e.map.dispose(),e.map=t,e.color.set(16777215)):(e.map&&(e.map.dispose(),e.map=null),e.color.set(ch(n))),void(e.needsUpdate=!0)}const{width:i,height:s,bold:o=!1,italic:a=!1,fontFamily:c="Serif",fontSize:l=10,fontColor:h="black",textAlign:d="center",textBaseline:u="middle"}=this.component.state,p=Math.abs(i)||1,f=Math.abs(s)||1,g={bold:o,italic:a,fontFamily:c,fontSize:l,fontColor:h,textAlign:d,textBaseline:u,width:p,height:f,fillStyle:n};if("object"==typeof n&&"pattern"===n?.type&&n.image){return void gm(this.component.app.url(n.image),r,p,f,g,n,t=>{e.map&&e.map.dispose(),e.map=t,e.color.set(16777215),e.needsUpdate=!0})}e.map&&e.map.dispose();const m=fm(r,p,f,g);e.map=m,e.color.set(16777215),e.needsUpdate=!0}updateDimension(){super.updateDimension()}}class Mm extends wm{get shape(){const{cx:t=0,cy:e=0,rx:n=1,ry:r=1,startAngle:i=0,endAngle:s=2*Math.PI,anticlockwise:o=!1}=this.component.state,a=new _.EllipseCurve(t,e,Math.abs(n),Math.abs(r),i,s,o,0);return new _.Shape(a.getPoints(50))}}Ch("ellipse",t=>new Mm(t));class Sm extends wm{get shape(){const{width:t,height:e,round:n}=this.component.state,r=new _.Shape;if(n>0){const i=n/100*(t/2);r.moveTo(i,0),r.lineTo(t-i,0),r.quadraticCurveTo(t,0,t,i),r.lineTo(t,e-i),r.quadraticCurveTo(t,e,t-i,e),r.lineTo(i,e),r.quadraticCurveTo(0,e,0,e-i),r.lineTo(0,i),r.quadraticCurveTo(0,0,i,0)}else r.moveTo(0,0),r.lineTo(t,0),r.lineTo(t,e),r.lineTo(0,e),r.lineTo(0,0);return r}}Ch("rect",t=>new Sm(t));class Am extends wm{get shape(){const{path:t=[],round:e=0}=this.component.state,n=new _.Shape;for(let r=0;r<t.length;r++){const i=t[(r-1+t.length)%t.length],s=t[(r+t.length)%t.length],o=t[(r+1)%t.length];if(i.x===s.x&&i.y===s.y)continue;let a=Math.sqrt((i.x-s.x)*(i.x-s.x)+(i.y-s.y)*(i.y-s.y)),c=0!==a?Math.atan2(i.x-s.x,i.y-s.y):0,l=Math.sin(c)*Math.min(e,a/2)+s.x,h=Math.cos(c)*Math.min(e,a/2)+s.y;const d=e>0||0!==a?{x:l,y:h}:s;a=Math.sqrt((o.x-s.x)*(o.x-s.x)+(o.y-s.y)*(o.y-s.y)),c=0!==a?Math.atan2(o.x-s.x,o.y-s.y):0,l=Math.sin(c)*Math.min(e,a/2)+s.x,h=Math.cos(c)*Math.min(e,a/2)+s.y;const u=e>0||0!==a?{x:l,y:h}:s;0==r?n.moveTo(d.x,d.y):n.lineTo(d.x,d.y),e>0&&n.quadraticCurveTo(s.x,s.y,u.x,u.y)}return n}get minMax(){if(!this._minMax){const{path:t}=this.component.state;let e,n,r,i;t.forEach((t,s)=>{if(0==s)return e=r=t.x,void(n=i=t.y);e=Math.min(e,t.x),r=Math.max(r,t.x),n=Math.min(n,t.y),i=Math.max(i,t.y)}),this._minMax={minX:e,minY:n,maxX:r,maxY:i}}return this._minMax}}Ch("polygon",t=>new Am(t));class Em extends wm{get shape(){const{cx:t=0,cy:e=0,rx:n=1,ry:r=1,ratio:i=50,startAngle:s=0,endAngle:o=2*Math.PI,anticlockwise:a=!1}=this.component.state,c=Math.abs(n),l=Math.abs(r),h=new _.EllipseCurve(t,e,c,l,s,o,a,0),d=new _.Shape(h.getPoints(50)),u=c/100*i,p=l/100*i;if(u>0&&p>0){const n=new _.EllipseCurve(t,e,u,p,s,o,a,0),r=new _.Path(n.getPoints(50));d.holes.push(r)}return d}}Ch("donut",t=>new Em(t));class km extends wm{get shape(){const{x1:t=0,y1:e=0,x2:n=0,y2:r=0,x3:i=0,y3:s=0}=this.component.state,o=new _.Shape;return o.moveTo(t,e),o.lineTo(n,r),o.lineTo(i,s),o.closePath(),o}}Ch("triangle",t=>new km(t));class Cm extends wm{get shape(){const{ratio:t=30,wing:e=5,cx:n=0,cy:r=0,rx:i=1,ry:s=1}=this.component.state;if(e<3)return null;const o=Math.PI/2,a=2*Math.PI/e,c=i-t/100*i,l=s-t/100*s,h=new _.Shape;h.moveTo(n+i*Math.cos(-o),r+s*Math.sin(-o)),h.lineTo(n+(i-c)*(Math.cos(a-o)+Math.cos(0-o))/2,r+(s-l)*(Math.sin(a-o)+Math.sin(0-o))/2);for(let t=1;t<e;t++)h.lineTo(n+i*Math.cos(a*t-o),r+s*Math.sin(a*t-o)),h.lineTo(n+(i-c)*(Math.cos(a*(t+1)-o)+Math.cos(a*t-o))/2,r+(s-l)*(Math.sin(a*(t+1)-o)+Math.sin(a*t-o))/2);return h.closePath(),h}}Ch("star",t=>new Cm(t));const Tm={mutable:!1,resizable:!0,rotatable:!0,properties:[],help:"scene/component/sphere"};class Pm extends hm{buildGeometry(){const{rx:t=0,ry:e=0,rz:n}=this.component.state,r=n??t,i=new _.SphereGeometry(1,32,16);i.scale(t,r,e),this.object3d.geometry=i}updateDimension(){this.buildGeometry()}}t.Sphere=class extends Wf{get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new Pm(this)}get nature(){return Tm}},t.Sphere=pp([$g("sphere")],t.Sphere);const Dm={mutable:!1,resizable:!0,rotatable:!0,properties:[]};t.Sprite=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new cm(this)}get nature(){return Dm}},t.Sprite=pp([$g("sprite")],t.Sprite);const Om={mutable:!1,resizable:!0,rotatable:!0,properties:[],help:"scene/component/cube"};class zm extends hm{buildGeometry(){const{width:t=0,height:e=0,depth:n=0}=this.component.state,r=new _.BoxGeometry(1,1,1);r.scale(t,n,e),this.object3d.geometry=r}}t.Cube=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new zm(this)}get nature(){return Om}},t.Cube=pp([$g("cube")],t.Cube);const Im={mutable:!1,resizable:!0,rotatable:!0,properties:[],help:"scene/component/cylinder"};class Lm extends hm{buildGeometry(){const{rx:t=0,ry:e=0}=this.component.state,n=this.component.state.depth??1,r=new _.CylinderGeometry(1,1,1,25);r.scale(t||1,n||1,e||1),this.object3d.geometry=r}updateDimension(){this.buildGeometry()}}t.Cylinder=class extends Wf{get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new Lm(this)}get nature(){return Im}},t.Cylinder=pp([$g("cylinder")],t.Cylinder);const Rm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"color",label:"box-color",name:"boxColor",property:"boxColor"}],help:"scene/component/banner"};class jm extends Sh{build(){super.build();const{width:t=1,height:e=1,depth:n=1}=this.component.state;this.object3d.add(this.createCube(t,e,n));const r=this.createTextureBoard(t,n);r.position.set(0,0,.5*e+1),this.object3d.add(r)}createCube(t,e,n){const{boxColor:r="#ccaa76"}=this.component.state,i=fh(this.component.state.material3d),s=new _.BoxGeometry(t,n,e),o=new _.MeshStandardMaterial({color:r,side:_.FrontSide});yh(o,i);const a=new _.Mesh(s,o);return a.castShadow=i.castShadow,a.receiveShadow=i.receiveShadow,a}createTextureBoard(t,e){const n=fh(this.component.state.material3d),{fillStyle:r="#ccaa76"}=this.component.state,i=Sh.buildFillStyleTexture(this.component),s=new _.MeshStandardMaterial(i?{map:i}:{color:r||"#ccaa76",side:_.FrontSide});yh(s,n);const o=new _.PlaneGeometry(t,e,1,1),a=new _.Mesh(o,s);return a.castShadow=n.castShadow,a.receiveShadow=n.receiveShadow,a}updateMaterial3d(){super.updateMaterial3d();const t=fh(this.component.state.material3d);this.object3d.traverse(e=>{if(e.isMesh){const n=e.material;n&&yh(n,t),e.castShadow=t.castShadow,e.receiveShadow=t.receiveShadow}})}}var Fm;t.Banner=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}get nature(){return Rm}buildRealObject(){return new jm(this)}},t.Banner=pp([$g("banner")],t.Banner);const Bm={far:1e5,fov:80,near:1,zoom:1},Nm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"near",name:"near"},{type:"number",label:"far",name:"far"},{type:"number",label:"fov",name:"fov"},{type:"number",label:"zoom",name:"zoom"},{type:"checkbox",label:"show-helper",name:"showHelper"}],help:"scene/component/camera"};class Hm extends Sh{getObject3dInstance(){return new _.Mesh}updateCamera(){const{near:t=Bm.near,far:e=Bm.far,fov:n=Bm.fov,zoom:r=Bm.zoom,showHelper:i}=this.component.state;this.camera.far=e,this.camera.fov=n,this.camera.near=t,this.camera.zoom=r,i?this.helper||(this.helper=new _.CameraHelper(this.camera),this.object3d.add(this.helper)):this.helper&&(this.object3d.remove(this.helper),delete this.helper)}build(){super.build();const{width:t=0,height:e=0,depth:n=0,fillStyle:r="lightgray"}=this.component.state;this.object3d.geometry=new _.BoxGeometry(t,n,e),this.object3d.material=new _.MeshStandardMaterial({color:r,side:_.FrontSide}),this.camera=new _.PerspectiveCamera,this.camera.position.set(0,0,0),this.object3d.add(this.camera),this.object3d.lookAt(0,0,0),this.updateCamera()}}t.Camera=Fm=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}static get image(){return Fm._image||(Fm._image=new Image,Fm._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA1IAAANSAQMAAABV6G1EAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAABlBMVEX6+voBAQGV71ZvAAAFO0lEQVR42u3dMZLkNBiGYakUKFRIqKOISxDvETiCTBEQcgQOQE7clyAi8REm7KDXIhgYoMa/7fbIX+2K9w022MCP/25Z28GW5RwRERERERERERERERERERERERERERERERERERERERERERERERHRl9mv7fdPn7879sf8Mcq3J3r5EJXaUy3W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xyyahcrH7JKFysJ54rCuYJwLi+cywnn+vdlLp+rCOfKwrnStXP95zLxiJX7WEFoeaHljO/xEqsaf9/FWqz1bM+VzloP655df2uxrnP9XPHKue7OeMDsuWInyx+Y67T1Yv0gs+cKvay6P5fvZZULrdnYFBbbcr2sdKF1MxbZFdZkLLItq3aay6/vJ102eusD2rJKl633nw/o3n+uxbrpLSv1svL6M95hQ3xYNz33t16sC21Zoc+28Xahm+u+Ic7WhbYs1+dRfrvQ5LpvHOaFNq3SZ8n/faEt6twDtli7wrJpxT6P1183/di0Ti36u3XT903Ld1qGrzf9smmdWhyTddNzf8t8UqdtK/dZGq8P2DZ1ZnHcrQ/osWO5PkvDuby7NE58Yctk7Qq3PSv3+bpc3F0aJ56wF+uLX9xu6eOb4es9z/vWc0vR3oZuByjnf2t/fP/54B/2WvvWEREREREREREREREREREREREREREREREREREREREREREREREREX2J/QlrTpqHD8xO1gAAAABJRU5ErkJggg=="),Fm._image}render(t){const{left:e,top:n,width:r,height:i}=this.bounds;t.beginPath(),this.drawImage(t,Fm.image,e,n,r,i)}buildRealObject(){return new Hm(this)}get nature(){return Nm}},t.Camera=Fm=pp([$g("camera")],t.Camera);const Vm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"gltf-selector",label:"url",name:"src",property:{displayField:"id",displayFullUrl:!0,baseUrlAlias:"$base_url",defaultStorage:"3d-model",storageFilters:{type:Array,value:[{name:"category",value:"image"}]},useUpload:!0,category:"application"},observe:function(t){this.parentNode.querySelector("[name=gltfInfo]").src=t;const e=this.parentNode.querySelector("[name=fillStyleTargets]");e&&(e.src=t);const n=this.parentNode.querySelector("[name=playTargets]");n&&(n.src=t)}},{type:"gltf-info",label:"",name:"gltfInfo",readonly:!0,property:{action:(t,e)=>{t._ratioLocking=!0;try{t.set(e)}finally{t._ratioLocking=!1}}},editor:{fullwidth:!0}},{type:"gltf-fill-targets",label:"fill-targets",name:"fillStyleTargets",editor:{fullwidth:!0}},{type:"gltf-play-targets",label:"play-targets",name:"playTargets",editor:{fullwidth:!0}}],"value-property":"source",help:"scene/component/gltf-object"};t.GLTFObject=class extends(Ya(Va)){constructor(){super(...arguments),this._ratioLocking=!1}get hasTextProperty(){return!1}is3dish(){return!0}get controls(){return[]}render(t){const{left:e,top:n,width:r,height:i}=this.bounds;t.beginPath();const s=this._topViewSnapshot;if(s)t.drawImage(s,e,n,r,i);else{t.rect(e,n,r,i),t.fillStyle="#f0f0f0",t.fill(),t.strokeStyle="#999",t.lineWidth=1,t.stroke();const s=this.getState("src"),o=s&&s.split("/").pop()?.replace(/\.[^.]+$/,"")||"GLTF",a=Math.max(10,.12*Math.min(r,i));t.fillStyle="#666",t.font=`${a}px sans-serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(o,e+r/2,n+i/2,.9*r)}}async ready(){await super.ready(),this._ensureTopViewSnapshot()}onchange(t,e){super.onchange(t,e),"src"in t&&(this._topViewSnapshot=void 0,this._ensureTopViewSnapshot())}_ensureTopViewSnapshot(){const t=this.getState("src");if(!t)return;const e=rp.getTopViewCache(t);if(e)return this._topViewSnapshot=e,void this.invalidate();const n=this.app.url(t);rp.loadGLTF(n).then(e=>{if(this.getState("src")!==t)return;const n=rp.getTopViewCache(t);if(n)return this._topViewSnapshot=n,void this.invalidate();const r=rp.renderTopView(e.scene);rp.setTopViewCache(t,r),this._topViewSnapshot=r,this.invalidate()})}buildRealObject(){return new rp(this)}get nature(){return Vm}get source(){return this.getState("src")}set source(t){this.setState("src",t)}set dimension(t){const{width:e=1,height:n=1,depth:r=1}=t;this.setState({width:e,height:n,depth:r}),this.realObject?.updateDimension()}_applyRatioLock(t){if(!("width"in t||"height"in t||"depth"in t))return t;const e=this.state.width||1,n=this.state.height||1,r=this.state.depth||1,i=Uh([(t.width??e)/e,(t.height??n)/n,(t.depth??r)/r]);return i?{...t,width:Math.round(e*i),height:Math.round(n*i),depth:Math.round(r*i)}:t}set(t,e){"string"==typeof t&&(t={[t]:e}),this.state.ratioLock&&!this._ratioLocking&&(this._ratioLocking=!0,t=this._applyRatioLock(t));try{return super.set(t)}finally{this._ratioLocking=!1}}setState(t,e){"string"==typeof t&&(t={[t]:e}),this.state.ratioLock&&!this._ratioLocking&&(this._ratioLocking=!0,t=this._applyRatioLock(t));try{return super.setState(t)}finally{this._ratioLocking=!1}}get play(){return!1!==this.getState("play")}set play(t){this.setState("play",t)}get nodes(){return this.getState("nodes")}set nodes(t){this.setState("nodes",t)}get animations(){return this.getState("animations")}set animations(t){this.setState("animations",t)}get playTargets(){return this.getState("playTargets")}set playTargets(t){this.setState("playTargets",t)}get fillStyleTargets(){return this.getState("fillStyleTargets")}set fillStyleTargets(t){this.setState("fillStyleTargets",t)}get nodeNames(){const t=this.realObject;return t?.nodeNames??[]}get animationNames(){const t=this.realObject;return t?.animationNames??[]}},t.GLTFObject=pp([$g("gltf-object")],t.GLTFObject);const Gm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"select",label:"light-type",name:"lightType",property:{options:["","point","directional"]}},{type:"number",label:"intensity",name:"intensity"},{type:"number",label:"distance",name:"distance"},{type:"number",label:"decay",name:"decay"},{type:"checkbox",label:"cast-shadow",name:"castShadow"},{type:"number",label:"near",name:"near",placeholder:"0.5"},{type:"number",label:"far",name:"far",placeholder:"1000"},{type:"number",label:"fov",name:"fov",placeholder:"90"},{type:"number",label:"zoom",name:"zoom",placeholder:"1"},{type:"checkbox",label:"show-helper",name:"showHelper"}],help:"scene/component/light"};class Ym extends Sh{updatePointLight(){const{lightType:t="point",distance:e=0,intensity:n=10,decay:r=1,fillStyle:i="white",castShadow:s,near:o=.5,far:a=1e3,fov:c=90,zoom:l=1,showHelper:h}=this.component.state;if(this.object3d.color=new _.Color(i),"point"==t&&(this.object3d.distance=e,this.object3d.decay=r),this.object3d.intensity=n,this.object3d.castShadow=s,s){const t=this.object3d.shadow?.camera;t.far=a,t.near=o,t.fov=c,t.zoom=l}if(h){const t=this.object3d.shadow?.camera;this.helper||(this.helper=new _.CameraHelper(t),this.object3d.add(this.helper))}else this.helper&&(this.object3d.remove(this.helper),delete this.helper)}getObject3dInstance(){const{lightType:t="point"}=this.component.state;return"point"==t?new _.PointLight:new _.DirectionalLight}update(){this.clear(),this.build(),this.updateDimension(),this.updateHidden(),this.updatePointLight()}}t.PointLight=class extends Wf{get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new Ym(this)}get anchors(){return[]}get nature(){return Gm}},t.PointLight=pp([$g("light")],t.PointLight);const Um={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"depth",name:"depth",property:"depth"}],help:"scene/component/wall"};class $m extends hm{buildGeometry(){const{width:t=0,height:e=0,depth:n=0}=this.component.state,r=new _.BoxGeometry(1,1,1);r.scale(t,n,e),this.object3d.geometry=r}}t.Wall=class extends(Ya(Va)){get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new $m(this)}get nature(){return Um}},t.Wall=pp([$g("wall")],t.Wall);const Wm={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"number",label:"depth",name:"depth",property:"depth"}],help:"scene/component/floor-plate"};class qm extends Sh{clear(){return this._topTexture&&(this._topTexture.dispose(),this._topTexture=void 0),this._mesh=void 0,super.clear()}build(){super.build();const{width:t,height:e,depth:n=1}=this.component.state;if(!t||!e)return;const r=Math.abs(t),i=Math.abs(e),s=Math.max(n,.5),o=new _.BoxGeometry(r,s,i),a=this._buildTopMaterial(),c=this._buildSideMaterial(),l=[c,c,a,c,c,c];this._mesh=new _.Mesh(o,l),this._mesh.position.y=s/2,this._mesh.receiveShadow=!0,this._mesh.castShadow=!1,this.object3d.add(this._mesh)}_buildTopMaterial(){const{alpha:t=1}=this.component.state,e=fh(this.component.state.material3d),n=Sh.buildFillStyleTexture(this.component);if(n){this._topTexture=n;const r=new _.MeshStandardMaterial({map:n,side:_.DoubleSide,transparent:!0,opacity:t,depthWrite:t>=.9});return yh(r,e),r}const{fillStyle:r}=this.component.state,i="string"==typeof r&&"none"!==r?r:"#e0e0e0",s=new _.MeshStandardMaterial({color:i,side:_.DoubleSide,transparent:!0,opacity:t,depthWrite:t>=.9});return yh(s,e),s}_buildSideMaterial(){const{strokeStyle:t,alpha:e=1}=this.component.state,n="string"==typeof t&&t?t:"#999999";return new _.MeshStandardMaterial({color:n,side:_.DoubleSide,transparent:!0,opacity:.8*e,depthWrite:e>=.9})}updateAlpha(){if(!this._mesh)return;const{alpha:t=1}=this.component.state,e=this._mesh.material;for(let n=0;n<e.length;n++){const r=e[n];r.opacity=2===n?t:.8*t,r.transparent=!0,r.depthWrite=t>=.9}}updateFillStyle(){if(!this._mesh)return;this._topTexture&&(this._topTexture.dispose(),this._topTexture=void 0);const t=this._mesh.material;t[2].dispose(),t[2]=this._buildTopMaterial()}updateStrokeStyle(){if(!this._mesh)return;const t=this._mesh.material,e=this._buildSideMaterial();for(let n=0;n<t.length;n++)2!==n&&(t[n].dispose(),t[n]=e)}}function Xm(t,e){return"none"===t?0:t.endsWith("arrow")?1.5*e:0}function Km(t,e,n,r){const i=[];for(let s=1;s<=r;s++){const o=s/r,a=1-o;i.push(new _.Vector3(a*a*t.x+2*a*o*e.x+o*o*n.x,a*a*t.y+2*a*o*e.y+o*o*n.y,a*a*t.z+2*a*o*e.z+o*o*n.z))}return i}t.FloorPlate=class extends yc{get hasTextProperty(){return!1}is3dish(){return!0}buildRealObject(){return new qm(this)}get nature(){return Wm}},t.FloorPlate=pp([$g("floor-plate")],t.FloorPlate);class Qm extends Sh{getObject3dInstance(){return new _.Group}get gizmoTransformable(){return!0}get syncZPosOffset(){return 0}syncFromObject3D(){}applyDimensionFromGizmo(t){}build(){super.build(),this._buildLine()}get smoothedPath(){const t=this.worldPath;if(t.length<2)return t;const{round:e=0}=this.component.state;if(e<=0||t.length<3)return t;const n=[];n.push(t[0]);for(let r=1;r<t.length;r++){const i=t[r-1],s=t[r],o=t[r+1];if(!o){n.push(s);break}const a=i.x-s.x,c=i.y-s.y,l=i.z-s.z,h=Math.sqrt(a*a+c*c+l*l),d=Math.min(e,h/2),u=o.x-s.x,p=o.y-s.y,f=o.z-s.z,g=Math.sqrt(u*u+p*p+f*f),m=Math.min(e,g/2),y=h>0?new _.Vector3(s.x+a/h*d,s.y+c/h*d,s.z+l/h*d):s.clone(),b=g>0?new _.Vector3(s.x+u/g*m,s.y+p/g*m,s.z+f/g*m):s.clone();n.push(y),n.push(...Km(y,s,b,8))}return n}_buildLine(){const t=this.smoothedPath;if(t.length<2)return;const{strokeStyle:e,lineWidth:n=2,alpha:o=1,lineDash:a,begin:c="none",beginSize:l="size5",end:h="none",endSize:d="size5"}=this.component.state,u=Math.max(n,1),p="string"==typeof e&&"transparent"!==e?ch(e):"#000000",f=new _.Color(p),g=this._getResolution(),m=c,y=h,b=Xm(m,u),v=Xm(y,u),x=t[0],w=t[t.length-1],M=(new _.Vector3).subVectors(t[1],x).normalize(),S=(new _.Vector3).subVectors(t[t.length-2],w).normalize(),A=[...t];b>0&&(A[0]=x.clone().add(M.clone().multiplyScalar(b))),v>0&&(A[A.length-1]=w.clone().add(S.clone().multiplyScalar(v)));const E=new s.LineGeometry;E.setPositions(A.flatMap(t=>[t.x,t.y,t.z]));const k=function(t,e){switch(t){case"round-dot":return{dashSize:e,gapSize:e};case"square-dot":return{dashSize:2*e,gapSize:e};case"dash":return{dashSize:4*e,gapSize:1.5*e};case"dash-dot":return{dashSize:4*e,gapSize:2*e};case"long-dash":return{dashSize:6*e,gapSize:3*e};case"long-dash-dot":return{dashSize:6*e,gapSize:2*e};case"long-dash-dot-dot":return{dashSize:6*e,gapSize:e};default:return null}}(a,u),C=new i.LineMaterial({color:f.getHex(),linewidth:u,worldUnits:!0,transparent:o<1,opacity:o,resolution:g,dashed:!!k,dashSize:k?.dashSize??1,gapSize:k?.gapSize??1,dashScale:1});if(this._line2=new r.Line2(E,C),this._line2.computeLineDistances(),this.object3d.add(this._line2),"none"!==m){const t=rh(m,nh(l,u));if(t){const e=(new _.Quaternion).setFromUnitVectors(new _.Vector3(1,0,0),M.clone().negate());this._placeTip(t,x,e,f,o,g)}}if("none"!==y){const t=rh(y,nh(d,u));if(t){const e=(new _.Quaternion).setFromUnitVectors(new _.Vector3(1,0,0),S.clone().negate());this._placeTip(t,w,e,f,o,g)}}}_placeTip(t,e,n,r,i,s){const o=t.mesh||t.line2||t.group;if(o){if(o.position.copy(e),o.setRotationFromQuaternion(n),t.mesh){const e=t.mesh.material;e.color.copy(r),e.transparent=i<1,e.opacity=i}else if(t.line2){const e=t.line2.material;e.color.copy(r),e.transparent=i<1,e.opacity=i,e.resolution.copy(s)}else t.group&&t.group.traverse(t=>{if(t.material){const e=t.material;e.color&&e.color.copy(r),e.transparent=i<1,e.opacity=i,e.resolution&&e.resolution.copy(s)}});this.object3d.add(o)}}_getResolution(){const t=this.threeContainer?.renderer3d;if(t){return t.getSize(new _.Vector2)}return new _.Vector2(window.innerWidth,window.innerHeight)}onGizmoDragEnd(t){const e=this._component,n=e.path;if(!n||n.length<2)return;const r=this.object3d,{width:i=0,height:s=0}=e.parent?.bounds??{},{x:o,y:a}=e.center,c=r.position,l=r.rotation,h=r.scale,d=this.position;if(Math.abs(c.x-d.x)<.001&&Math.abs(c.y-d.y)<.001&&Math.abs(c.z-d.z)<.001&&Math.abs(l.x)<.001&&Math.abs(l.y)<.001&&Math.abs(l.z)<.001&&Math.abs(h.x-1)<.001&&Math.abs(h.y-1)<.001&&Math.abs(h.z-1)<.001)return;const u=Qm.computeBakedPath(n,{x:o,y:a},{width:i,height:s},r);this._suppressOnchange=!0,e.set({rotation:0,rotationX:0,rotationY:0,zPos:0}),e.mutatePath(null,()=>u),this._suppressOnchange=!1,this.update()}static computeBakedPath(t,e,n,r){const i=n.width,s=n.height,o=e.x,a=e.y;return r.updateMatrixWorld(!0),t.map(t=>{const e=new _.Vector3(t.x-o,t.z||0,t.y-a).applyMatrix4(r.matrixWorld),n={x:e.x+i/2,y:e.z+s/2};return Math.abs(e.y)>.001&&(n.z=e.y),n})}updateStrokeStyle(){this.updateDimension()}updateAlpha(){this.updateDimension()}updateDimension(){this.clear(),this.build()}onchange(t,e){("path"in t||"from"in t||"to"in t)&&(this.updateDimension(),this.updatePosition()),("round"in t||"lineDash"in t||"lineWidth"in t||"begin"in t||"end"in t||"beginSize"in t||"endSize"in t)&&this.updateDimension(),super.onchange(t,e)}clear(){for(;this.object3d.children.length>0;){const t=this.object3d.children[0];this.object3d.remove(t),_h(t)}return this._line2=void 0,super.clear()}}class Zm extends Qm{get worldPath(){const t=this.component.path;if(!t||t.length<2)return[];const{x:e,y:n}=this.component.center;return t.map(t=>new _.Vector3(t.x-e,t.z||0,t.y-n))}}Ch("line",t=>new Zm(t));class Jm extends Qm{get worldPath(){const t=this.component.path;if(!t||t.length<2)return[];const{x:e,y:n}=this.component.center;return t.map(t=>new _.Vector3(t.x-e,t.z||0,t.y-n))}}Ch("polyline",t=>new Jm(t));class ty extends Sh{getObject3dInstance(){return new _.Group}get allowedGizmoModes(){return this.component.isGroup?.()?["translate"]:null}}Ch("group",t=>new ty(t));class ey extends Sh{build(){super.build()}update(){}}const ny={far:1e5,fov:80,near:1,zoom:1};class ry extends Sh{build(){super.build()}update(){super.update(),this.updateCamera()}getObject3dInstance(){return new _.PerspectiveCamera}updateCamera(){const{near:t=ny.near,far:e=ny.far,fov:n=ny.fov,zoom:r=ny.zoom}=this.component.state;this.object3d.far=e,this.object3d.fov=n,this.object3d.near=t,this.object3d.zoom=r}}class iy extends hm{buildGeometry(){const{width:t,height:e}=this.component.state.dimension;this.object3d.geometry=new _.PlaneGeometry(t,e)}buildMaterial(){this.object3d.material=new _.MeshStandardMaterial({opacity:0,side:_.DoubleSide,blending:_.NoBlending})}}class sy extends Sh{getObject3dInstance(){return new _.Scene}dispose(){for(const t of this.object3d.children)_h(t);this._animationMixer&&(this._animationMixer.stopAllAction(),this._animationMixer.uncacheRoot(this.object3d),this._animationMixer=void 0),super.dispose()}clear(){return this._floor&&(this.object3d.remove(this._floor),this._floor.material instanceof Array?this._floor.material.forEach(t=>t.dispose()):this._floor.material.dispose(),this._floor.geometry.dispose(),delete this._floor),super.clear()}get floor(){return this._floor}set floor(t){this._floor&&(this.object3d.remove(this._floor),this._floor.clear(),delete this._floor),t&&(this._floor=t,this.object3d.add(t)),this.component.invalidate()}build(){super.build(),this.floor=Ih(this.component)}updateTransform(){}updateDimension(){}updatePosition(){}updateRotate(){}updateScale(){}updateAlpha(){}updateHidden(){}get animationMixer(){return this._animationMixer||(this._animationMixer=new _.AnimationMixer(this.object3d)),this._animationMixer}}const oy={mutable:!1,resizable:!0,rotatable:!0,properties:[{type:"select",label:"precision",name:"precision",property:{options:[{display:"High",value:"highp"},{display:"Medium",value:"mediump"},{display:"Low",value:"lowp"}]}},{type:"checkbox",label:"anti-alias",name:"antialias",property:"antialias"},{type:"checkbox",label:"3dmode",name:"threed",property:"threed"},{type:"checkbox",label:"auto-rotate",name:"autoRotate",property:"autoRotate"},{type:"checkbox",label:"debug",name:"debug",property:"debug"}],help:"scene/component/three-container"};var ay;t.ThreeContainer=class extends Df{constructor(){super(...arguments),this._capability=new nd}get sceneManager(){return this._capability.sceneManager}get cameraManager(){return this._capability.cameraManager}get rendererManager(){return this._capability.rendererManager}get lightManager(){return this._capability.lightManager}get controlsManager(){return this._capability.controlsManager}get eventManager(){return this._capability.eventManager}containable(t){return!0}is3dContainer(){return!0}getLightingConfig(){return{hemisphere:{skyColor:16777215,groundColor:14540253,intensity:1},directional:{color:16777215,intensity:1.2,attachToCamera:!0,castShadow:!1}}}getCss3DSceneAttribute(){return"three-container:css3d-renderer"}init_scene3d(){this._capability.isInitialized&&this._capability.destroy(),this._capability.init(this,{lightingConfig:this.getLightingConfig(),css3DSceneAttribute:this.getCss3DSceneAttribute(),skipEnvironment:!0,skipPostprocessing:!0,skipShadowMap:!0}),this._capability.buildOverlays(),this._capability.resize(),this.onchangeData&&this.onchangeData(this.data,this.data)}destroy_scene3d(){this.stop(),this._capability.destroy()}stop(){}resize(){this._capability.resize()}get scene3d(){return this._capability.isInitialized||this.init_scene3d(),this._capability.scene3d}get renderer3d(){return this._capability.renderer3d}get mixer(){return this._capability.mixer}get css3DScene(){return this._capability.css3DScene}get css3DRenderer(){return this._capability.css3DRenderer}render_threed(){this._capability.renderThreeD()}get _parentIs3dMode(){return!!this.rootModel?.is3dMode}render(t){this._parentIs3dMode||(this.app.isViewMode&&this.setState("threed",!0),!this.state.threed||this._capability.noSupportWebgl?super.render(t):this._capability.camera&&this._capability.renderCSS3D())}postrender(t){if(this._parentIs3dMode)return;const{left:e,top:n,debug:r,threed:i}=this.state;let{width:s,height:o}=this.bounds;if(s=Math.floor(s),o=Math.floor(o),i){if(this._capability.isInitialized||this.init_scene3d(),this._capability.noSupportWebgl)return void this._capability.showWebglNoSupportText(t,this.state.width,this.state.height);if(!this._capability.renderer3d)return;this._capability.renderThreeD();const i=this._capability.domElement;if(!i||!i.width||!i.height)return;t.drawImage(i,0,0,i.width,i.height,e,n,s,o),r&&this._capability.showDebugFPS(t)}else super.postrender(t)}dispose(){this._capability.dispose(),super.dispose()}get layout(){return Ka.get("three")}get nature(){return oy}getObjectByRaycast(){return this._capability.getObjectByRaycast()}getObjectsByRaycast(){return this._capability.getObjectsByRaycast()}onchange(t,e){(t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&this._capability.destroy(),this._capability.onchange(t)}onmousedown(t){this._capability.onMouseDown(t)}onmouseup(t){this._capability.onMouseUp(t)}onmousemove(t){this._capability.onMouseMove(t)}onmouseleave(t){this._capability.onMouseLeave(t)}onwheel(t){this._capability.onWheel(t)&&this.invalidate()}ondblclick(t){this._capability.onDblClick(t)&&this.invalidate()}ondragstart(t){this._capability.onDragStart(t)}ondragmove(t){this._capability.onDragMove(t)&&this.invalidate()}ondragend(t){this._capability.onDragEnd(t)&&this.invalidate()}ontouchstart(t){this._capability.onTouchStart(t)}onpan(t){this._capability.onPan(t)&&this.invalidate()}ontouchend(t){this._capability.onTouchEnd(t)}onkeydown(t){this._capability.onKeyDown(t)}onpinch(t){this._capability.onPinch(t)&&this.invalidate()}ondoubletap(){this._capability.onDoubleTap(),this.invalidate()}},t.ThreeContainer=pp([$g("3d-container")],t.ThreeContainer),Th(t=>{const e=t.state.material3d?.spriteMode;return"plane"===e?new lm(t):new cm(t)}),t.Model=void 0,(ay=t.Model||(t.Model={})).compile=tl,ay.duplicate=el,ay.select=fa,ay.match=da,_r.registerResidents(()=>({componentResidentsCount:Ha.residentsCount,sceneResidentsCount:hp.residentsCount,referenceMapResidentsCount:Xg.residentsCount,sceneResidents:Ha.residents}));var cy=Object.freeze({__proto__:null,AbsoluteLayout:Za,Animation:Fo,AudioPlayer:bg,get Banner(){return t.Banner},Banner3D:jm,BoxSelectionManager:Zh,get Camera(){return t.Camera},Camera3D:Hm,CameraBookmarkManager:Qh,CameraManager:jh,CardLayout:tc,Component:Ha,Connectable:gd,Container:Df,ContainerAbstract:yc,ControlsManager:Hh,get Cube(){return t.Cube},Cube3D:zm,get Cylinder(){return t.Cylinder},Cylinder3D:Lm,DEFAULT:Mi,DPPX:_i,DataLagTracker:Lu,DataSource:Ug,Donut:Lg,DonutExtrude:Em,Ellipse:Wf,EllipseExtrude:Mm,EventManager3D:Vh,EventMap:mu,FPS:Zl,get FloorPlate(){return t.FloorPlate},GESTURES:xi,get GLTFObject(){return t.GLTFObject},GifView:mg,GizmoManager:Gh,GizmoOperationManager:$h,GlobalRef:Eg,Group:xg,HTMLAbsoluteLayout:Qa,HTMLOverlayContainer:Sg,HTMLOverlayElement:ig,ImageView:rg,InfoWindow:qa,InteractionManager:Wh,KEYEVENTS:wi,Layer:bc,Layout:Ka,LightManager:Bh,LightObject:Ym,Line:Uf,Line3D:Zm,LinearHorizontalLayout:nc,LinearVerticalLayout:ic,LoadTracker:ju,LoadingOverlay:Ju,LocalRef:Mg,MATERIAL_PRESETS:ph,MAX_UNDO_SIZE:30,MODE_ADD:3,MODE_EDIT:1,MODE_PASTE_DATABIND:5,MODE_PASTE_STYLE:4,MODE_SHIFT:2,MODE_VIEW:0,get Model(){return t.Model},MoveHandle:gc,NOTHING:bi,Node:Ng,OrthoLine:eg,PIXEL_RATIO:Jl,Path:Pg,PlacementManager:qh,get PointLight(){return t.PointLight},Polygon:Kf,PolygonExtrude:Am,Polyline:Jf,Polyline3D:Jm,Popup:Tg,RealObject:Sh,RealObjectCamera:ry,RealObjectDomElement:Ah,RealObjectDomTexture:bm,RealObjectDummy:ey,RealObjectExtrude:wm,RealObjectGLTF:rp,RealObjectGroup:ty,RealObjectLine:Qm,RealObjectMesh:hm,RealObjectPlane:iy,RealObjectPlane2D:lm,RealObjectScene:sy,RealObjectService:Hg,RealObjectSprite:im,RealObjectSprite2D:cm,RealObjectText:ym,Rect:bd,RectExtrude:Sm,RectPath:Ya,ReferenceMap:Xg,RendererManager:Fh,RootContainer:zu,Ruler:_d,SCALE_MIN:oh,SCENE_MODE:vi,Scene:hp,SceneManager:Rh,ScenePopup:pc,SceneSearchEngine:sp,ScriptLoader:nm,SearchOverlay:ap,ServiceComponent:Gg,Shape:Va,get Sphere(){return t.Sphere},Sphere3D:Pm,get Sprite(){return t.Sprite},Star:Fg,StarExtrude:Cm,TableLayout:sc,Text:vg,ThreeCapability:nd,get ThreeContainer(){return t.ThreeContainer},TransitionEffect:Pu,Triangle:Og,TriangleExtrude:km,UNIT_DIMENSION:lh,UNIT_ROTATE:uh,UNIT_SCALE:hh,UNIT_TRANSLATE:dh,ValueHolder:Yg,VertexGizmoManager:ed,get Wall(){return t.Wall},Wall3D:$m,animate:jo,applyAlpha:ah,applyMaterial3dProps:yh,buildArrow3D:sh,compile:No,create:up,createCanvas:th,createCanvasTexture:om,createFloor:Ih,createRealObjectFor:Ph,debug:jr,delta:Lo,disposeObject3D:_h,drawTextTexture:pm,error:Lr,fontStyle:dm,initFontFamilyWatcher:Ai,inspector:Xu,metrics:_r,opaqueColor:ch,projectToScreen:Ac,registerDefaultRealObjectFactory:Th,registerRealObjectFactory:Ch,renderCanvasTexture:am,resolveMaterial3d:fh,sceneComponent:$g,stopFPSMeasure:Ql,textBounds:mm,textTexture:fm,toThreeSide:mh,updateDefaultFontFamily:Si,version:rm,warn:Rr});const ly=globalThis;"undefined"==typeof globalThis||ly.scene||(ly.scene=cy),t.AbsoluteLayout=Za,t.Animation=Fo,t.AudioPlayer=bg,t.Banner3D=jm,t.BoxSelectionManager=Zh,t.Camera3D=Hm,t.CameraBookmarkManager=Qh,t.CameraManager=jh,t.CardLayout=tc,t.Component=Ha,t.Connectable=gd,t.Container=Df,t.ContainerAbstract=yc,t.ControlsManager=Hh,t.Cube3D=zm,t.Cylinder3D=Lm,t.DEFAULT=Mi,t.DPPX=_i,t.DataLagTracker=Lu,t.DataSource=Ug,t.Donut=Lg,t.DonutExtrude=Em,t.Ellipse=Wf,t.EllipseExtrude=Mm,t.EventManager3D=Vh,t.EventMap=mu,t.FPS=Zl,t.GESTURES=xi,t.GifView=mg,t.GizmoManager=Gh,t.GizmoOperationManager=$h,t.GlobalRef=Eg,t.Group=xg,t.HTMLAbsoluteLayout=Qa,t.HTMLOverlayContainer=Sg,t.HTMLOverlayElement=ig,t.ImageView=rg,t.InfoWindow=qa,t.InteractionManager=Wh,t.KEYEVENTS=wi,t.Layer=bc,t.Layout=Ka,t.LightManager=Bh,t.LightObject=Ym,t.Line=Uf,t.Line3D=Zm,t.LinearHorizontalLayout=nc,t.LinearVerticalLayout=ic,t.LoadTracker=ju,t.LoadingOverlay=Ju,t.LocalRef=Mg,t.MATERIAL_PRESETS=ph,t.MAX_UNDO_SIZE=30,t.MODE_ADD=3,t.MODE_EDIT=1,t.MODE_PASTE_DATABIND=5,t.MODE_PASTE_STYLE=4,t.MODE_SHIFT=2,t.MODE_VIEW=0,t.MoveHandle=gc,t.NOTHING=bi,t.Node=Ng,t.OrthoLine=eg,t.PIXEL_RATIO=Jl,t.Path=Pg,t.PlacementManager=qh,t.Polygon=Kf,t.PolygonExtrude=Am,t.Polyline=Jf,t.Polyline3D=Jm,t.Popup=Tg,t.RealObject=Sh,t.RealObjectCamera=ry,t.RealObjectDomElement=Ah,t.RealObjectDomTexture=bm,t.RealObjectDummy=ey,t.RealObjectExtrude=wm,t.RealObjectGLTF=rp,t.RealObjectGroup=ty,t.RealObjectLine=Qm,t.RealObjectMesh=hm,t.RealObjectPlane=iy,t.RealObjectPlane2D=lm,t.RealObjectScene=sy,t.RealObjectService=Hg,t.RealObjectSprite=im,t.RealObjectSprite2D=cm,t.RealObjectText=ym,t.Rect=bd,t.RectExtrude=Sm,t.RectPath=Ya,t.ReferenceMap=Xg,t.RendererManager=Fh,t.RootContainer=zu,t.Ruler=_d,t.SCALE_MIN=oh,t.SCENE_MODE=vi,t.Scene=hp,t.SceneManager=Rh,t.ScenePopup=pc,t.SceneSearchEngine=sp,t.ScriptLoader=nm,t.SearchOverlay=ap,t.ServiceComponent=Gg,t.Shape=Va,t.Sphere3D=Pm,t.Star=Fg,t.StarExtrude=Cm,t.TableLayout=sc,t.Text=vg,t.ThreeCapability=nd,t.TransitionEffect=Pu,t.Triangle=Og,t.TriangleExtrude=km,t.UNIT_DIMENSION=lh,t.UNIT_ROTATE=uh,t.UNIT_SCALE=hh,t.UNIT_TRANSLATE=dh,t.ValueHolder=Yg,t.VertexGizmoManager=ed,t.Wall3D=$m,t.animate=jo,t.applyAlpha=ah,t.applyMaterial3dProps=yh,t.buildArrow3D=sh,t.compile=No,t.create=up,t.createCanvas=th,t.createCanvasTexture=om,t.createFloor=Ih,t.createRealObjectFor=Ph,t.debug=jr,t.delta=Lo,t.disposeObject3D=_h,t.drawTextTexture=pm,t.error=Lr,t.fontStyle=dm,t.initFontFamilyWatcher=Ai,t.inspector=Xu,t.metrics=_r,t.opaqueColor=ch,t.projectToScreen=Ac,t.registerDefaultRealObjectFactory=Th,t.registerRealObjectFactory=Ch,t.renderCanvasTexture=am,t.resolveMaterial3d=fh,t.sceneComponent=$g,t.stopFPSMeasure=Ql,t.textBounds=mm,t.textTexture=fm,t.toThreeSide=mh,t.updateDefaultFontFamily=Si,t.version=rm,t.warn=Rr});
|
|
73
73
|
//# sourceMappingURL=things-scene-min.js.map
|