/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import{t,p as n,H as e,d as s,h as i,e as a}from"./p-DmsAWRoU.js";import{v as o,q as h,m as d,h as l}from"./p-Tvs4yxd5.js";import{o as c}from"./p-Dc9KNUUp.js";const r=()=>`:host{position:absolute;pointer-events:none;visibility:hidden}:host(.hydrated){visibility:hidden}:host(.ready){visibility:inherit}:host(:not([interactions-off]))>*{pointer-events:auto}`;const u=n(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.occlusionStateChanged=s(this,"occlusionStateChanged");this.detachedStateChanged=s(this,"detachedStateChanged");this.propertyChange=s(this,"propertyChange");this.position=o.origin();this.positionJson="";this.quaternion=h.create();this.quaternionJson="";this.scale=o.create(1,1,1);this.scaleJson="";this.matrix=d.makeIdentity();this.occlusionOff=false;this.occluded=false;this.detachedOff=true;this.detached=false;this.billboardOff=false;this.interactionsOff=false}handlePositionChange(){this.syncMatrix()}handlePositionJsonChanged(){this.syncPosition()}handleRotationChanged(){this.syncQuaternionWithRotation()}handleRotationJsonChanged(){this.syncRotation()}handleQuaternionChange(){this.syncMatrix()}handleQuaternionJsonChanged(){this.syncQuaternion()}handleScaleChange(){this.syncMatrix()}handleScaleJsonChanged(){this.syncScale()}handleMatrixChanged(t,n){if(!c.isEqual(t,n)){this.propertyChange.emit()}}connectedCallback(){this.syncProperties()}componentShouldUpdate(t,n,e){return e==="occluded"}handleOcclusionStateChanged(){this.occlusionStateChanged.emit(this.occluded)}handleDetachedStateChanged(){this.detachedStateChanged.emit(this.detached)}syncProperties(){this.syncPosition();this.syncRotation();this.syncQuaternion();this.syncScale();this.syncMatrix()}syncPosition(){this.position=this.positionJson.length>0?this.parseJson("positionJson",this.positionJson,o.fromJson):this.position}syncRotation(){this.rotation=this.rotationJson!=null&&this.rotationJson.length>0?this.parseJson("rotationJson",this.rotationJson,l.fromJson):this.rotation;this.syncQuaternionWithRotation()}syncQuaternionWithRotation(){this.quaternion=this.rotation!=null?h.fromEuler(this.rotation):this.quaternion}syncQuaternion(){this.quaternion=this.quaternionJson.length>0?this.parseJson("quaternionJson",this.quaternionJson,h.fromJson):this.quaternion}syncScale(){this.scale=this.scaleJson.length>0?this.parseJson("scaleJson",this.scaleJson,o.fromJson):this.scale}syncMatrix(){this.matrix=d.makeTRS(this.position,this.quaternion,this.scale)}parseJson(t,n,e){try{return e(n)}catch(n){console.warn(`Could not parse \`${t}\`. Invalid JSON.`);throw n}}render(){return i(a,{key:"30ea00b8927b7e205c3b8929853acbfe75cd1fd8"},i("slot",{key:"d74b2da44968c21b7e8fb425b672cf270c1d3fad"}))}static get watchers(){return{position:[{handlePositionChange:0}],positionJson:[{handlePositionJsonChanged:0}],rotation:[{handleRotationChanged:0}],rotationJson:[{handleRotationJsonChanged:0}],quaternion:[{handleQuaternionChange:0}],quaternionJson:[{handleQuaternionJsonChanged:0}],scale:[{handleScaleChange:0}],scaleJson:[{handleScaleJsonChanged:0}],matrix:[{handleMatrixChanged:0}],occluded:[{handleOcclusionStateChanged:0}],detached:[{handleDetachedStateChanged:0}]}}static get style(){return r()}},[257,"vertex-viewer-dom-element",{position:[1040],positionJson:[1,"position"],rotation:[1040],rotationJson:[1,"rotation"],quaternion:[1040],quaternionJson:[1,"quaternion"],scale:[1040],scaleJson:[1,"scale"],matrix:[1040],occlusionOff:[4,"occlusion-off"],occluded:[516],detachedOff:[4,"detached-off"],detached:[516],billboardOff:[4,"billboard-off"],interactionsOff:[516,"interactions-off"]},undefined,{position:[{handlePositionChange:0}],positionJson:[{handlePositionJsonChanged:0}],rotation:[{handleRotationChanged:0}],rotationJson:[{handleRotationJsonChanged:0}],quaternion:[{handleQuaternionChange:0}],quaternionJson:[{handleQuaternionJsonChanged:0}],scale:[{handleScaleChange:0}],scaleJson:[{handleScaleJsonChanged:0}],matrix:[{handleMatrixChanged:0}],occluded:[{handleOcclusionStateChanged:0}],detached:[{handleDetachedStateChanged:0}]}]);function f(){if(typeof customElements==="undefined"){return}const n=["vertex-viewer-dom-element"];n.forEach((n=>{switch(n){case"vertex-viewer-dom-element":if(!customElements.get(t(n))){customElements.define(t(n),u)}break}}))}f();export{u as V,f as d};
//# sourceMappingURL=p-ChMr_49H.js.map