var h=Object.defineProperty,C=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var m=(r,e,o)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,f=(r,e)=>{for(var o in e||(e={}))u.call(e,o)&&m(r,o,e[o]);if(i)for(var o of i(e))b.call(e,o)&&m(r,o,e[o]);return r},k=(r,e)=>C(r,A(e));var y=(r,e)=>{var o={};for(var a in r)u.call(r,a)&&e.indexOf(a)<0&&(o[a]=r[a]);if(r!=null&&i)for(var a of i(r))e.indexOf(a)<0&&b.call(r,a)&&(o[a]=r[a]);return o};import{jsx as n,jsxs as l}from"react/jsx-runtime";import{FolderIcon as N,ChevronsUpDownIcon as g,PanelLeftIcon as v,MessageSquareIcon as L,MenuIcon as E,ListIcon as M,SquareIcon as I,LayoutGridIcon as T,Link2Icon as j,BoxSelectIcon as q,Columns3Icon as B,Columns2Icon as D,AppWindowIcon as F,BoxIcon as G}from"lucide-react";import{D as S,E as _,c as P,F as U,G as V}from"./ui-components-B24mpb8o.js";import{useEditor as W}from"./use-editor-D8T8wKX0.js";import w from"./layers-tree-leaf-Cnyj1odA.js";import"next-themes";import"sonner";import"react";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./editor-provider-CwMLJaUa.js";import"uuid";const p=z=>{var d=z,{className:r,data:e,handleSelectChange:o,expandedItemIds:a}=d,x=y(d,["className","data","handleSelectChange","expandedItemIds"]);const{editor:s}=W();return n("div",k(f({role:"tree",className:r},x),{children:n("ul",{children:e instanceof Array?e.map((c,H)=>{let t;switch(c.type){case"container":t=G;break;case"__body":t=F;break;case"2Col":t=D;break;case"3Col":t=B;break;case"section":t=q;break;case"link":t=j;break;case"div":t=I;break;case"header":case"footer":case"nav":case"article":case"aside":t=T;break;case"form":t=I;break;case"ul":case"li":t=M;break;case"dropdownMenu":case"dropdownMenuContent":t=E;break;case"popover":case"popoverContent":t=L;break;case"drawer":case"drawerContent":t=v;break;case"accordion":case"accordionItem":case"accordionContent":case"accordionTrigger":t=g;break;case"tabs":case"tabsList":case"tabsContent":t=N;break}return n("li",{children:Array.isArray(c.content)?n(S,{type:"multiple",defaultValue:a,children:l(_,{className:P("border-b-0 border-l"),value:c.id,children:[n(U,{onClick:()=>o(c),className:"w-full p-3",children:l("div",{className:"flex w-full items-center gap-2 pr-2",children:[t&&n(t,{className:"h-5 w-5 flex-grow text-muted-foreground","aria-hidden":"true"}),l("span",{className:"inline-flex w-full items-center justify-between gap-2 truncate text-sm",children:[c.name,c.id===s.editor.selectedElement.id&&n("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"})]})]})}),n(V,{className:"pl-4",children:Array.isArray(c.content)&&c.content.length?n(p,{data:c.content?c.content:c,handleSelectChange:o,expandedItemIds:a}):n("p",{className:"w-full text-center text-sm text-muted-foreground",children:"No content inside."})})]})}):n(w,{item:c,isSelected:c.id===s.editor.selectedElement.id,type:c.type,onClick:()=>o(c)})},c.id)}):n("li",{children:n(w,{item:e,isSelected:e.id===s.editor.selectedElement.id,type:e.type,onClick:()=>o(e)})})})}))};p.displayName=p.name;export{p as default};
