var w=Object.defineProperty;var P=(r,e,t)=>e in r?w(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var c=(r,e,t)=>(P(r,typeof e!="symbol"?e+"":e,t),t);import{aU as g,b7 as D,aV as O,aC as l,b8 as A,aL as B,b9 as M,p as f,e as p,C as T,s as u,E as F}from"./index-a76b28be.js";import"./index-4d966268.js";import"./postmen-a4b10828.js";function I(r){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...r,children:l.jsx("path",{fill:"currentColor",d:"M3 9a1 1 0 0 0 1-1V5a1 1 0 0 1 1-1h3a1 1 0 0 0 0-2H5a3 3 0 0 0-3 3v3a1 1 0 0 0 1 1m5 11H5a1 1 0 0 1-1-1v-3a1 1 0 0 0-2 0v3a3 3 0 0 0 3 3h3a1 1 0 0 0 0-2m9-7a1 1 0 0 0 0-2h-1.14A4 4 0 0 0 13 8.14V7a1 1 0 0 0-2 0v1.14A4 4 0 0 0 8.14 11H7a1 1 0 0 0 0 2h1.14A4 4 0 0 0 11 15.86V17a1 1 0 0 0 2 0v-1.14A4 4 0 0 0 15.86 13Zm-5 1a2 2 0 1 1 2-2a2 2 0 0 1-2 2m9 1a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1h-3a1 1 0 0 0 0 2h3a3 3 0 0 0 3-3v-3a1 1 0 0 0-1-1M19 2h-3a1 1 0 0 0 0 2h3a1 1 0 0 1 1 1v3a1 1 0 0 0 2 0V5a3 3 0 0 0-3-3"})})}const S=g(D),H=g(({inspectorConfig:r,models:e,onModelChange:t,model:o})=>{const{label:n,property:a,disabled:h}=r,{t:v}=O(),E=!o;e=e||[o];const z=o.root.sceneStore.entities,d=e[0],V=o.root.sceneStore.rootEntity.children,C=e.map(i=>i.id);function _(i){const b=d.engineObject,y=z.get(i);if(!y)return;const j=y.engineObject.getComponent(M);b.lookAt(j.worldPosition),d.syncRotation()}return l.jsx(S,{disabled:h,label:v(n),value:E?{x:null,y:null,z:null}:o[a],onChange:(i,b)=>{e.forEach(y=>y[a]=i),t&&t(a,i)},formEndSlot:l.jsx(A,{trigger:l.jsx(B,{variant:"subtle",corner:!0,children:l.jsx(I,{style:{width:"13px",height:"13px"}})}),disabledEntities:C,entityMap:V,entities:V,label:n,onSelect:_})})});var R=Object.defineProperty,q=Object.getOwnPropertyDescriptor,x=(r,e,t,o)=>{for(var n=o>1?void 0:o?q(e,t):e,a=r.length-1,h;a>=0;a--)(h=r[a])&&(n=(o?h(e,t,n):h(n))||n);return o&&n&&R(e,t,n),n},s;const m=(s=class extends F{constructor(){super(...arguments);c(this,"position",{x:0,y:0,z:0});c(this,"rotation",{x:0,y:0,z:0});c(this,"scale",{x:1,y:1,z:1})}static equalVector3(t,o){return t.x===o.x&&t.y===o.y&&t.z===o.z}static roundToThreeDecimal(t){return Math.round(t*1e3)/1e3}static roundVector2(t,o){return o.x=this.roundToThreeDecimal(t.x),o.y=this.roundToThreeDecimal(t.y),o}static copyVector2(t,o){o.x=t.x,o.y=t.y}static roundVector3(t,o){return o.x=this.roundToThreeDecimal(t.x),o.y=this.roundToThreeDecimal(t.y),o.z=this.roundToThreeDecimal(t.z),o}static copyVector3(t,o){o.x=t.x,o.y=t.y,o.z=t.z}syncTransformToEditor(t){this._syncTransformToEditor("position",t.position),this._syncTransformToEditor("rotation",t.rotation),this._syncTransformToEditor("scale",t.scale)}_syncTransformToEditor(t,o){const n=this[t],a=s.roundVector3(o,s._tempVector3);s.equalVector3(a,n)||(s.copyVector3(a,n),this.notifyPropertyChange(t,!1))}},c(s,"_tempVector2",{x:0,y:0}),c(s,"_tempVector3",{x:0,y:0,z:0}),s);x([f({label:p("transform.position.title"),info:p("transform.position.info"),type:T.Vector3,bindPath:"position"}),u()],m.prototype,"position",2);x([f({label:p("transform.rotation.title"),info:p("transform.rotation.info"),customComponent:H,type:T.Vector3,bindPath:"rotation"}),u()],m.prototype,"rotation",2);x([f({label:p("transform.scale.title"),info:p("transform.scale.info"),type:T.Vector3,constrainable:!0,bindPath:"scale"}),u()],m.prototype,"scale",2);let J=m;export{J as T};
