import{d as t,aF as e,a as i,h as o,o as n,Y as s,Z as r,C as a,a0 as l,c as m,W as c,u,a5 as p,a1 as d}from"./index.3938ccd1.js";import{I as g}from"./IdxUtils.90eb8a31.js";import{E as y}from"./EditOutlined.6584eaab.js";import{B as f}from"./button.e008c943.js";import"./T3Data.cbe80363.js";import"./_commonjsHelpers.a5007c1f.js";import"./AntdIcon.ce0fcb4c.js";import"./index.33b844cc.js";import"./Serializer.f6a5f515.js";import"./_getTag.ea883084.js";const E=t({__name:"ObjectType2",props:{item:{},showArrows:{type:Boolean}},emits:["autoManualToggle","objectClicked","changeValue","updateWeldModel"],setup(t,{emit:E}){const v=t,j=E;function b(t){t.stopPropagation(),alert("Icon edit clicked")}function k(t){t.stopPropagation(),alert("Antd button clicked")}function w(){j("objectClicked")}return e.Debug("ObjectType2 props",v.item),i((()=>{var t;return g.getEntryRange(null==(t=v.item)?void 0:t.t3Entry)})),i((()=>{var t;if(!v.item.t3Entry)return"";const i=g.getEntryRange(v.item.t3Entry);if(e.Debug("= Ot range,t3e",i,v.item.t3Entry),"description"===v.item.settings.t3EntryDisplayField){const e=v.item.t3Entry.description||"",o=v.item.t3Entry.value||"";let n="";if(v.item.t3Entry.range>100){const e=null==(t=i.options)?void 0:t.find((t=>t.value===v.item.t3Entry.value));n=(null==e?void 0:e.name)||""}else 1===v.item.t3Entry.digital_analog?n=(o||"")+" "+((null==i?void 0:i.unit)||""):0===v.item.t3Entry.digital_analog&&(n=v.item.t3Entry.control?(null==i?void 0:i.on)||"":(null==i?void 0:i.off)||"");return e+" "+n}return v.item.t3Entry[v.item.settings.t3EntryDisplayField]||""})),i((()=>{var t,e;const i=v.item;return["Gauge","Dial"].includes(i.type||"")?"Gauge"===i.type?null==(t=i.settings.colors)?void 0:t.map((t=>[t.offset/100,t.color])):null==(e=i.settings.colors)?void 0:e.map(((t,e)=>{var o;return{from:e?null==(o=i.settings.colors)?void 0:o[e-1].offset:0,to:t.offset,color:[t.color]}})):null})),o(null),n((()=>{e.Debug("Component mounted with props:",{item:v.item,showArrows:v.showArrows,title:v.item.title,type:v.item.type,settings:v.item.settings})})),(t,e)=>t.item.title?(s(),r("div",{key:0,onClick:w},[a(l(t.item.title)+" ",1),m(u(y),{onClick:c(b,["stop"]),class:"edit-icon"}),m(u(f),{type:"primary",onClick:c(k,["stop"])},{default:p((()=>[...e[0]||(e[0]=[a("Antd Button",-1)])])),_:1})])):d("",!0)}});export{E as default};
