import{B as P}from"./BuilderApp-iubkkTok.js";import{d as R,i as m,r as y,a as g,c,bg as W,bh as h,w as M,o as u,b as N,au as z,R as F,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,be as H,bi as J,aL as Q,_ as X}from"./index-t2KKsw-3.js";import"./WdsCheckbox-CkRWq0Pz.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=R({__name:"BuilderSidebarToolkit",setup(re){const B=m(g.isAutogenModalShown,y(!1));function S(){B.value=!0}const T=m(g.core),f=m(g.builderManager),{removeInsertionCandidacy:D}=Q(T),i=y(""),L=f.activeRootId,A=["Layout","Content","Input","Embed","Writer","Logic","Triggers","Other"],s=c(()=>f.mode.value=="blueprints"?"blueprints":"core"),b=c(()=>{const t=A.map(e=>[e,x(e)]).filter(([e,n])=>n.length>0);return Object.fromEntries(t)}),I=c(()=>{if(i.value)return Object.values(b.value).reduce((t,e)=>t+e.length,0)}),$=c(()=>s.value=="core"?"Interface toolkit":s.value=="blueprints"?"Blueprints toolkit":"Toolkit");function x(t){const n=W().filter(a=>{const o=h(a);return!(o.category!=t||!o.toolkit&&s.value!=="core"||o.toolkit&&o.toolkit!==s.value||o.deprecated)}).map(a=>{const{name:o,description:q,category:O}=h(a);return{type:a,name:o,description:q,category:O??"Other"}}),l=i.value.toLocaleLowerCase();return n.filter(a=>!l||a.name.toLocaleLowerCase().includes(l)).sort((a,o)=>a.name.localeCompare(o.name,void 0,{sensitivity:"base"}))}function V(t,e){f.setSelection(null),t.dataTransfer.setData(`application/json;writer=${e},`,"{}")}function j(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 M(s,()=>{i.value=""}),(t,e)=>(u(),N(P,{modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=n=>i.value=n),class:"BuilderSidebarToolkit",placeholder:$.value,"search-count":I.value},z({default:v(()=>[(u(!0),p(k,null,w(b.value,(n,l)=>(u(),p("div",{key:l,class:"category"},[d("div",Y,C(l),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=>j(a)),onDragstart:a=>V(a,r.type)},[_(H,{alt:`(Icon for ${r.name})`,draggable:"false",urls:E(r)},null,8,["alt","urls"]),d("div",te,C(r.name),1)],40,ee))),128))])]))),128))]),_:2},[F(L)=="blueprints_root"?{name:"footer",fn:v(()=>[d("div",ae,[_(U,{variant:"special",size:"small",class:"BuilderSidebarPanel__footer__btn",onClick:S},{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-f7960f33"]]);export{ue as default};
