import{u as e,N as a,r as t,a as o,D as d,o as l,p as n,b as s,c as r,d as i,e as u,k as p,l as m,F as c,f as v,g as f,h as g,T as y,j as x,G,m as k}from"./index.1696777084030.js";import{_ as T,S as h}from"./index.16967770840302.js";import{$ as j}from"./jquery.1696777084030.js";import"./href.1696777084030.js";const B=["onClick"],C={__name:"GroupItem",props:{data:Object,reload:Function},setup(k){const C=k,_=e(),D=a([]),I=t(),b=t({});window.$=j;const w=()=>{_.state.editStatus&&(_.state.editStatus=!1)};let O=!0;const L=()=>{_.commit("setLink",b.value),j(`[data-id='${I.value}']`).find(".names").text(b.value.name)};var N=null;const S=()=>{var e=N.toArray();let a=[];e.forEach(((e,t)=>{let o=_.getters.find(e);o.pid=I.value,o.sort=t,a.push(o)})),_.commit("updateDiffLink",Object.assign([],a)),n.emit("RefreshLink"),"add"==C.data.type&&(clearTimeout(A),C.reload())};let V=null;let A=setTimeout((()=>{}));return o((()=>{var e,a;A=setTimeout((()=>{"add"===C.data.type&&O&&(clearTimeout(A),C.reload())}),2e3),I.value=C.data.pid,b.value=_.getters.find(C.data.pid),D.value=d([],_.getters.findChildren(C.data.pid)),e=document.getElementById("iconGroupItem"),a={animation:200,delay:500,delayOnTouchOnly:!0,draggable:".item",group:{name:"it",pull:function(e){let a=e.el.id;return"icon"!==V.item.dataset.type||"footer-itxst"!==a||"clone"},put:!0},onChoose:function(e){V=e,window.MoveData={type:e.item.dataset.type}},onMove:function(e){return!e.dragged.dataset.type&&!e.related.dataset.url||"component"===e.dragged.dataset.type||"iconGroup"!==e.related.dataset.url},onUpdate(e){S()},onAdd(e){S()}},N=h.create(e,a)})),l((()=>{n.off("saveGroup",S)})),(e,a)=>{const t=s("el-input");return r(),i("div",{id:"iconGroupBox",onClick:a[5]||(a[5]=(...e)=>C.reload&&C.reload(...e))},[u("div",{class:"groupName",onClick:a[1]||(a[1]=m((()=>{}),["stop"]))},[p(t,{onBlur:L,modelValue:b.value.name,"onUpdate:modelValue":a[0]||(a[0]=e=>b.value.name=e)},null,8,["modelValue"])]),u("div",{class:"model",onDragleave:a[3]||(a[3]=e=>{"model"===e.relatedTarget.className&&(O=!0,clearTimeout(A),C.reload())}),onDragenter:a[4]||(a[4]=e=>{"iconGroupBox"===e.relatedTarget.id&&(O=!1)})},[u("div",{id:"iconGroupItem",class:"iconGroupItem itxst",onClick:m(w,["stop"])},[(r(!0),i(c,null,v(x(G)(x(D)),(e=>(r(),f(y,{key:e.id},{default:g((()=>[p(T,{onClick:a[2]||(a[2]=m((()=>{}),["stop"])),data:e,"data-type":null==e?void 0:e.type,"data-id":null==e?void 0:e.id},null,8,["data","data-type","data-id"])])),_:2},1024)))),128))],8,B)],32)])}}};const _={__name:"iconGroupBox",setup(e){const a=t(!1),o=t(),d=e=>{o.value=e,a.value=!0},s=()=>{a.value=!1};return n.on("addGroupBox",d),l((()=>{n.off("addGroupBox",d)})),(e,t)=>(r(),i("div",null,[p(y,{name:"groupBox"},{default:g((()=>[a.value?(r(),f(C,{key:0,data:o.value,reload:s},null,8,["data"])):k("",!0)])),_:1})]))}};export{_ as default};
