import{ae as W,af as j,bo as G,aQ as P,ag as i,aR as S,a$ as b,ah as h,ai as c,aj as k,ak as q,dL as z,dM as M,bC as Q,d as L,bx as X,al as y,an as u,aG as N,aP as A,at as E,ap as I,cq as Y,am as H,aD as Z,dN as ee,au as ae,aA as le,b7 as te,aW as se,aY as oe,b9 as ne,aX as re,z as ue,O as ie}from"./index-D68iA7pN.js";import{M as ce}from"./index-AOcxwHT9.js";const de={class:"d-flex algin-center"},ye=W({__name:"index",setup(fe){const f=j(!1,"showWalkThroughLayers"),{isShow:v}=f,w=G(),{setValue:_,stringifyJSON:D,remove:B,setLayerList:O}=w,{list:p}=P(w),n=i(!1),r=S(()=>p.value.filter(e=>e.name).map(({name:e})=>e)),t=i([...r.value]);let x;const g=i(!0);b(v,l=>{l?x=z():x&&g.value&&M(x)}),b(t,Q(l=>{p.value.forEach((e,s)=>{_("visible",l.includes(e.name),s)}),M(D())},100));const d=i(""),V=i(!1),R=async()=>{f.showDialog(!1);const l=await ue.userSelect(L("选择对象")),e=new Set;l.forEach(s=>{const a=s.getMcDbEntity();a&&e.add(a.layer)}),t.value=Array.from(e),f.showDialog(!0)};b(d,l=>{l===""&&(V.value=!1,n.value=!1)});const T=()=>{if(d.value===""){t.value=[];return}V.value=!0,n.value=!0,t.value=r.value.filter(l=>l.toLocaleLowerCase()===d.value.toLocaleLowerCase())},C=i([]),U=l=>{const{map:e}=l(C.value.map(a=>a.$el),(a,o)=>o);if(e.length===0)return;const s=n.value?t.value:r.value;t.value=e.map(a=>s[a])},$=(l,e,s)=>{if(l.ctrlKey)t.value.indexOf(e)===-1?t.value=[...t.value,e]:t.value=t.value.filter(o=>o!==e);else if(l.shiftKey){const a=t.value.map(K=>r.value.indexOf(K));let o=Math.min(...a),m=Math.max(...a);o>s?o=s:m=s,t.value=r.value.slice(o,m+1)}else t.value=[e]},F=S(()=>`${L("图层漫游")} - ${L("图层数")}:`+r.value.length),J=()=>{const l=new ie,e=new Set;l.allSelect(),l.forEach(a=>{let o=a.getMcDbEntity();o&&e.add(o.layer)});const s=Array.from(e);B(p.value.filter(({name:a})=>!s.includes(a)),"this"),O(D())};return(l,e)=>{const s=X("box-selection");return y(),h(ce,{maxWidth:"400px",ref:"layerDialog",modelValue:k(v),"onUpdate:modelValue":e[4]||(e[4]=a=>q(v)?v.value=a:null),title:F.value},{actions:c(()=>[u(Y,{class:"mx-1 mt-0 mb-1 py-0 px-2 bg-dialog-card-text d-flex justify-end"},{default:c(()=>[u(N,{class:"mr-5",label:l.t("740"),modelValue:g.value,"onUpdate:modelValue":e[2]||(e[2]=a=>g.value=a)},null,8,["label","modelValue"]),u(A,{onClick:J},{default:c(()=>[E(I(l.t("741")),1)]),_:1}),u(A,{onClick:e[3]||(e[3]=a=>k(f).showDialog(!1))},{default:c(()=>[E(I(l.t("159")),1)]),_:1})]),_:1})]),default:c(()=>[H("div",de,[u(Z,{onClick:R}),u(ae,{modelValue:d.value,"onUpdate:modelValue":e[0]||(e[0]=a=>d.value=a),onKeydown:ee(T,["enter"])},null,8,["modelValue"]),u(N,{label:l.t("739"),modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),disabled:!V.value},null,8,["label","modelValue","disabled"])]),le((y(),h(te,{density:"compact",color:"primary",style:{height:"300px"}},{default:c(()=>[(y(!0),se(re,null,oe(n.value?[...t.value]:r.value,(a,o)=>(y(),h(ne,{class:"ma-0",title:a,ref_for:!0,ref_key:"refItems",ref:C,key:o,onClick:m=>$(m,a,o),active:n.value?n.value:t.value.includes(a)},null,8,["title","onClick","active"]))),128))]),_:1})),[[s,U]])]),_:1},8,["modelValue","title"])}}});export{ye as default};