import{d as h,o as k,X as C,b as e,w as o,$ as m,n as r,ah as V,h as B,V as y,a as x,a0 as T,Y as v,S as L,t as G,Z as N,ad as M,c as b,ak as R,j as I,r as A,c9 as j,A as g,ca as i,cb as E,cc as F,cd as O,ce as $,cf as z,cg as _,aj as P,ch as p,ci as s,ba as U,an as Q,u as X,e as w,l as Y}from"./index.6c36cb53.js";import{M as q}from"./index.a696a3d7.js";import{M as W}from"./index.42cbb984.js";const Z={class:"d-flex flex-wrap"},H={class:"d-flex my-1 w-50"},J=h({__name:"ObjectSnaps",props:{data:{},options:{},allSelect:{type:Function},allCancel:{type:Function}},setup(u){return(n,t)=>(k(),C("div",null,[e(V,{modelValue:n.options.isOpen,"onUpdate:modelValue":t[0]||(t[0]=a=>n.options.isOpen=a)},{label:o(()=>[e(m,{"key-name":"S"},{default:o(()=>[r("\u542F\u52A8\u5BF9\u8C61\u6355\u6349")]),_:1})]),_:1},8,["modelValue"]),e(M,{title:"\u5BF9\u8C61\u6355\u6349\u6A21\u5F0F",class:"mt-2"},{default:o(()=>[e(B,null,{default:o(()=>[e(y,{cols:9},{default:o(()=>[x("div",Z,[(k(!0),C(T,null,v(n.data,(a,d)=>(k(),C("div",H,[e(V,{class:"",modelValue:a.check,"onUpdate:modelValue":c=>a.check=c},{prepend:o(()=>[e(L,{icon:a.icon,class:"mr-1"},null,8,["icon"])]),label:o(()=>[e(m,{"key-name":a.key},{default:o(()=>[r(G(a.name),1)]),_:2},1032,["key-name"])]),_:2},1032,["modelValue","onUpdate:modelValue"])]))),256))])]),_:1}),e(y,{cols:2,"align-self":"start"},{default:o(()=>[e(N,{onClick:n.allSelect},{default:o(()=>[r("\u5168\u90E8\u9009\u62E9")]),_:1},8,["onClick"]),e(N,{class:"mt-3",onClick:n.allCancel},{default:o(()=>[r("\u5168\u90E8\u53D6\u6D88")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]))}}),K=h({__name:"PolarTracking",props:{options:{}},setup(u){return(n,t)=>(k(),b(B,null,{default:o(()=>[e(y,{cols:5},{default:o(()=>[e(V,{modelValue:n.options.isOpen,"onUpdate:modelValue":t[0]||(t[0]=a=>n.options.isOpen=a)},{label:o(()=>[e(m,{"key-name":"P"},{default:o(()=>[r("\u542F\u52A8\u6781\u8F74\u8FFD\u8E2A")]),_:1})]),_:1},8,["modelValue"]),e(M,{title:"\u6781\u8F74\u89D2\u8BBE\u7F6E",class:"mt-2",style:{height:"200px"}},{default:o(()=>[e(m,{"key-name":"I",colon:""},{default:o(()=>[r("\u589E\u91CF\u89D2")]),_:1}),e(R,{class:"mt-2",items:[5,10,15,20,30,45,60,90],modelValue:n.options.polarang,"onUpdate:modelValue":t[1]||(t[1]=a=>n.options.polarang=a)},null,8,["modelValue"])]),_:1})]),_:1}),e(y,{cols:7})]),_:1}))}}),ee=h({__name:"GridSnap",props:{options:{}},setup(u){return(n,t)=>(k(),b(B,null,{default:o(()=>[e(y,{cols:7},{default:o(()=>[e(V,{modelValue:n.options.isOpen,"onUpdate:modelValue":t[0]||(t[0]=a=>n.options.isOpen=a)},{label:o(()=>[e(m,{"key-name":"S"},{default:o(()=>[r("\u542F\u52A8\u6805\u683C\u6355\u6349")]),_:1})]),_:1},8,["modelValue"]),e(M,{title:"\u6781\u8F74\u89D2\u8BBE\u7F6E",class:"mt-2",style:{height:"200px"}},{default:o(()=>[e(m,{"key-name":"I",class:"mt-1",colon:""},{default:o(()=>[r("\u589E\u91CF\u89D2")]),_:1}),e(I,{class:"mt-1",modelValue:n.options.ptSnapUnit.x,"onUpdate:modelValue":t[1]||(t[1]=a=>n.options.ptSnapUnit.x=a)},{prepend:o(()=>[e(m,{"key-name":"P",colon:""},{default:o(()=>[r("\u6355\u6349X\u8F74\u95F4\u8DDD")]),_:1})]),_:1},8,["modelValue"]),e(I,{class:"mt-1",modelValue:n.options.ptSnapUnit.y,"onUpdate:modelValue":t[2]||(t[2]=a=>n.options.ptSnapUnit.y=a)},{prepend:o(()=>[e(m,{"key-name":"C",colon:""},{default:o(()=>[r("\u6355\u6349Y\u8F74\u95F4\u8DDD")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(y,{cols:5})]),_:1}))}}),ne=()=>{const u=P({options:{isOpen:!1},data:[{icon:"class:iconfont fangkuang",check:p(s.End),type:s.End,name:"\u7AEF\u70B9",key:"E"},{icon:"class:iconfont merge",check:p(s.Ins),type:s.Ins,name:"\u63D2\u5165\u70B9",key:"S"},{icon:"class:iconfont sanjiao",check:p(s.Mid),type:s.Mid,name:"\u4E2D\u5FC3",key:"M"},{icon:"class:iconfont chuizu",check:p(s.Perp),type:s.Perp,name:"\u5782\u8DB3",key:"P"},{icon:"class:iconfont yuan",check:p(s.Cen),type:s.Cen,name:"\u5706\u5FC3",key:"C"},{icon:"class:iconfont qiedian",check:p(s.Tan),type:s.Tan,name:"\u5207\u70B9",key:"N"},{icon:"class:iconfont yuanzhoncha",check:p(s.Node),type:s.Node,name:"\u8282\u70B9",key:"D"},{icon:"class:iconfont zuijindian",check:p(s.Near),type:s.Near,name:"\u6700\u8FD1\u70B9",key:"R"},{icon:"class:iconfont lingxingfangkuang",check:p(s.Quad),type:s.Quad,name:"\u8C61\u9650\u70B9",key:"Q"},{icon:"class:iconfont shizikuang",check:p(s.App),type:s.App,name:"\u5916\u89C2\u4EA4\u70B9",key:"A"},{icon:"class:iconfont cha",check:p(s.Int),type:s.Int,name:"\u4EA4\u70B9",key:"I"},{icon:"class:iconfont pinghangdu",check:p(s.Par),type:s.Par,name:"\u5E73\u884C",key:"L"},{icon:"class:iconfont yanshen",check:p(s.Ext),type:s.Ext,name:"\u5EF6\u4F38",key:"X"}],allSelect:function(){u.data.forEach(n=>{n.check=!0})},allCancel:function(){u.data.forEach(n=>{n.check=!1})}});return{tab:"\u5BF9\u8C61\u6355\u6349",props:u,component:()=>U(J,u)}},oe=()=>{const u=P({options:{isOpen:!1,polarang:0}});return{tab:"\u6781\u8F74\u8FFD\u8E2A",props:u,component:()=>U(K,u)}},ae=()=>{const u=P({options:{ptSnapUnit:new Q,isOpen:!1}});return{tab:"\u6805\u683C\u548C\u6355\u6349",props:u,component:()=>U(ee,u)}},se=u=>{const n=A([]),t=A(()=>{});return j(()=>{const a=ne(),d=oe(),c=ae();n.value=[a,d,c],g(()=>E.GRIDMODE,l=>{c.props.options.isOpen=l===i.On}),g(()=>E.AUTOSNAP,l=>{d.props.options.isOpen=l===i.On}),g(()=>E.OSMODE,l=>{a.props.options.isOpen=l===i.On}),g(u,l=>{l&&(c.props.options.isOpen=F("GRIDMODE")===i.On,c.props.options.ptSnapUnit=O().getSysVarPoint("SNAPUNIT"),d.props.options.isOpen=F("AUTOSNAP")===i.On,d.props.options.polarang=Math.round(O().getSysVarDouble("POLARANG")*(180/Math.PI)),a.props.options.isOpen=F("OSMODE")===i.On)}),t.value=()=>{let l;a.props.data.forEach(({check:S,type:f})=>{l=$(f,S,l)}),typeof l!="undefined"&&z(l),_("GRIDMODE",c.props.options.isOpen?i.On:i.Off),_("AUTOSNAP",d.props.options.isOpen?i.On:i.Off),O().setSysVarPoint2d("SNAPUNIT",c.props.options.ptSnapUnit),O().setSysVarDouble("POLARANG",d.props.options.polarang*(Math.PI/180)),_("OSMODE",a.props.options.isOpen?i.On:i.Off)}}),{items:n,define:t}},te={class:"px-3"},ie=h({__name:"index",setup(u){const n=A(0),{isShow:t,showDialog:a}=X(!1,"showDraftingSettingsDialog",(S={})=>{a(),S.tab&&(n.value=S.tab)}),{items:d,define:c}=se(t),l=[{name:"\u786E\u5B9A",fun:()=>{c.value(),a(!1)},primary:!0},{name:"\u5173\u95ED",fun:()=>a(!1)}];return(S,f)=>(k(),b(q,{title:"\u8349\u56FE\u8BBE\u7F6E",modelValue:w(t),"onUpdate:modelValue":f[1]||(f[1]=D=>Y(t)?t.value=D:null),footerBtnList:l,"max-width":"600"},{default:o(()=>[x("div",te,[e(W,{items:w(d),modelValue:n.value,"onUpdate:modelValue":f[0]||(f[0]=D=>n.value=D),height:312,tabsProps:{grow:!0}},null,8,["items","modelValue"])])]),_:1},8,["modelValue"]))}});export{ie as default};