import{B as M}from"./BuilderApp-B6IgXpcd.js";import{d as O,i as f,r as h,a as g,c,bo as P,bp as y,w as R,o as u,b as F,au as N,R as z,z as v,g as d,x as _,W as U,y as K,A as G,f as p,D as k,E as w,t as C,bi as H,bj as J,aM as Q,_ as X}from"./index-CVCbCfEn.js";import"./WdsCheckbox-CcVJELi1.js";import"./marked.esm-273vDTCT.js";const Y={class:"header"},Z={class:"tools"},ee=["data-writer-tooltip","data-component-type","onDragstart"],te={class:"name"},ae={class:"BuilderSidebarPanel__footer__autogen"},oe=O({__name:"BuilderSidebarToolkit",setup(re){const S=f(g.isAutogenModalShown,h(!1));function B(){S.value=!0}const T=f(g.core),m=f(g.builderManager),{removeInsertionCandidacy:D}=Q(T),l=h(""),x=m.activeRootId,L=["Layout","Content","Input","Embed","Writer","Logic","Triggers","Other"],s=c(()=>m.mode.value=="blueprints"?"blueprints":"core"),b=c(()=>{const t=L.map(e=>[e,j(e)]).filter(([e,n])=>n.length>0);return Object.fromEntries(t)}),I=c(()=>{if(l.value)return Object.values(b.value).reduce((t,e)=>t+e.length,0)}),A=c(()=>s.value=="core"?"Interface toolkit":s.value=="blueprints"?"Blueprints toolkit":"Toolkit");function j(t){const n=P().filter(a=>{const o=y(a);return!(o.category!=t||!o.toolkit&&s.value!=="core"||o.toolkit&&o.toolkit!==s.value||o.deprecated)}).map(a=>{const{name:o,description:W,category:q}=y(a);return{type:a,name:o,description:W,category:q??"Other"}}),i=l.value.toLocaleLowerCase();return n.filter(a=>!i||a.name.toLocaleLowerCase().includes(i)).sort((a,o)=>a.name.localeCompare(o.name,void 0,{sensitivity:"base"}))}function V(t,e){m.setSelection(null),t.dataTransfer.setData(`application/json;writer=${e},`,"{}")}function $(t){D(t)}function E(t){return[`/components/${t.type}.svg`,`/components/${s.value=="blueprints"?"blueprints_":""}category_${t.category}.svg`].map(e=>J(e))}return R(s,()=>{l.value=""}),(t,e)=>(u(),F(M,{modelValue:l.value,"onUpdate:modelValue":e[1]||(e[1]=n=>l.value=n),class:"BuilderSidebarToolkit",placeholder:A.value,"search-count":I.value},N({default:v(()=>[(u(!0),p(k,null,w(b.value,(n,i)=>(u(),p("div",{key:i,class:"category"},[d("div",Y,C(i),1),d("div",Z,[(u(!0),p(k,null,w(n,r=>(u(),p("div",{key:r.type,class:"tool","data-writer-tooltip":r.description,"data-writer-tooltip-placement":"right","data-writer-tooltip-gap":"8",draggable:"true","data-component-type":r.type,onDragend:e[0]||(e[0]=a=>$(a)),onDragstart:a=>V(a,r.type)},[_(H,{alt:`(Icon for ${r.name})`,draggable:"false",urls:E(r),"loader-max-width-px":18,"loader-max-height-px":18},null,8,["alt","urls"]),d("div",te,C(r.name),1)],40,ee))),128))])]))),128))]),_:2},[z(x)=="blueprints_root"?{name:"footer",fn:v(()=>[d("div",ae,[_(U,{variant:"special",size:"small",class:"BuilderSidebarPanel__footer__btn",onClick:B},{default:v(()=>[_(K,{name:"wand-sparkles"}),e[2]||(e[2]=G(" Autogenerate "))]),_:1})])]),key:"0"}:void 0]),1032,["modelValue","placeholder","search-count"]))}}),ue=X(oe,[["__scopeId","data-v-a2280457"]]);export{ue as default};
