@chaibuilder/sdk 1.2.12 → 1.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/{AddBlocks-nMUkm4og.cjs → AddBlocks-tomDo_Is.cjs} +1 -1
  2. package/dist/{AddBlocks-ByeMUUzE.js → AddBlocks-zN5--UP6.js} +1 -1
  3. package/dist/{BrandingOptions-eeDfvB0R.cjs → BrandingOptions-BUmE4f72.cjs} +1 -1
  4. package/dist/{BrandingOptions--poS5shs.js → BrandingOptions-LbizrmRI.js} +2 -2
  5. package/dist/{CanvasArea-h4lA4oqP.cjs → CanvasArea-1PwexKQz.cjs} +1 -1
  6. package/dist/{CanvasArea--TKubnIM.js → CanvasArea-leUzGAdQ.js} +4 -4
  7. package/dist/{CurrentPage-B3YumhrX.cjs → CurrentPage-M6uJPKhj.cjs} +1 -1
  8. package/dist/{CurrentPage-Gw9LJ40j.js → CurrentPage-XSq62fdk.js} +3 -3
  9. package/dist/{Layers-d-xge4On.js → Layers-JoV3wull.js} +4 -4
  10. package/dist/{Layers-4r_4F6ST.cjs → Layers-tasAbEc8.cjs} +1 -1
  11. package/dist/{PagesPanel-E4wSgVcE.js → PagesPanel-5KjlPTtj.js} +4 -4
  12. package/dist/{PagesPanel-iZLDBwXQ.cjs → PagesPanel-v1B780fd.cjs} +1 -1
  13. package/dist/{ProjectPanel-q7upaf7h.js → ProjectPanel-4X2KLnOi.js} +4 -4
  14. package/dist/{ProjectPanel-2TcqGnfN.cjs → ProjectPanel-NZYWWYTt.cjs} +1 -1
  15. package/dist/{Settings-y3DHsT88.js → Settings-1WP3BWxr.js} +3 -3
  16. package/dist/{Settings-NuDNH2dR.cjs → Settings-FW-bX28i.cjs} +1 -1
  17. package/dist/{SidePanels-91l1CjYv.cjs → SidePanels-YpyBLRub.cjs} +1 -1
  18. package/dist/{SidePanels-BK_QnEh9.js → SidePanels-ZlDXRldT.js} +4 -4
  19. package/dist/{Topbar-rEO5z57t.cjs → Topbar-2sOsQD2d.cjs} +1 -1
  20. package/dist/{Topbar-b7jnOD57.js → Topbar-xvrno03z.js} +1 -1
  21. package/dist/{UnsplashImages-p-WdKs3b.cjs → UnsplashImages-EiYSWkBa.cjs} +1 -1
  22. package/dist/{UnsplashImages-Lb78FYx7.js → UnsplashImages-hhPOf7kt.js} +1 -1
  23. package/dist/{UploadImages-zk-IYDx8.cjs → UploadImages-GGCExfQd.cjs} +1 -1
  24. package/dist/{UploadImages-aWG_1r7N.js → UploadImages-JKjE44i7.js} +1 -1
  25. package/dist/{add-page-modal-7djj9GZj.js → add-page-modal-iYgzDs08.js} +4 -4
  26. package/dist/{add-page-modal-iUffBbAe.cjs → add-page-modal-ueEpfep_.cjs} +1 -1
  27. package/dist/{confirm-alert-QuqMrpWn.js → confirm-alert-Nw1JCtuu.js} +1 -1
  28. package/dist/{confirm-alert-i3FRAgP4.cjs → confirm-alert-_DCO6hCV.cjs} +1 -1
  29. package/dist/core.cjs +1 -1
  30. package/dist/core.js +3 -3
  31. package/dist/{delete-page-modal-RllDrgxs.cjs → delete-page-modal-CT-ZA6H5.cjs} +1 -1
  32. package/dist/{delete-page-modal-DEBiprds.js → delete-page-modal-hlR-A69E.js} +3 -3
  33. package/dist/email-blocks.cjs +1 -1
  34. package/dist/email-blocks.js +27 -27
  35. package/dist/email.cjs +1 -1
  36. package/dist/email.js +4 -4
  37. package/dist/{empty-slot-TF2kd-0X.cjs → empty-slot-2LSrWJaY.cjs} +1 -1
  38. package/dist/{empty-slot-MWycClTb.js → empty-slot-5FRrRq1E.js} +33 -33
  39. package/dist/{form-94xR0NG8.js → form-lbFCPUoE.js} +1 -1
  40. package/dist/{form-yz7h2msc.cjs → form-vNgf0kO2.cjs} +1 -1
  41. package/dist/{index-19nTm_cE.js → index-DXznIJrr.js} +665 -660
  42. package/dist/{index-XVud0HL8.cjs → index-TBa4RPnS.cjs} +22 -22
  43. package/dist/{index-TEfD-2ti.cjs → index-bfKqnRvZ.cjs} +1 -1
  44. package/dist/{index-0m8Zuv5X.js → index-m9VziIOy.js} +2 -2
  45. package/dist/{page-viewer-xPLhXv6k.js → page-viewer-Hgr72mrQ.js} +4 -4
  46. package/dist/{page-viewer-_ktv1pgX.cjs → page-viewer-voX6SLpK.cjs} +1 -1
  47. package/dist/{project-general-setting-XlORLtqJ.js → project-general-setting-OdZj-lfx.js} +4 -4
  48. package/dist/{project-general-setting-nULU3Tzw.cjs → project-general-setting-VFFXhGpN.cjs} +1 -1
  49. package/dist/{project-seo-setting-KQkeHwny.js → project-seo-setting-9V67NFil.js} +3 -3
  50. package/dist/{project-seo-setting-9QkARPhg.cjs → project-seo-setting-aRDdqu88.cjs} +1 -1
  51. package/dist/{single-page-detail-gtVN9hxR.js → single-page-detail-AjhWBVK1.js} +5 -5
  52. package/dist/{single-page-detail-Gb6O3Yyw.cjs → single-page-detail-FIwXvGx2.cjs} +1 -1
  53. package/dist/studio.cjs +1 -1
  54. package/dist/studio.d.ts +110 -2
  55. package/dist/studio.js +3 -3
  56. package/dist/ui.cjs +1 -1
  57. package/dist/ui.js +1 -1
  58. package/dist/{useAddBlockByDrop-GU5QLPtz.cjs → useAddBlockByDrop-1WvPoBXa.cjs} +1 -1
  59. package/dist/{useAddBlockByDrop-b5KJh_7w.js → useAddBlockByDrop-bs_SH7Tw.js} +1 -1
  60. package/dist/web-blocks.cjs +1 -1
  61. package/dist/web-blocks.js +129 -129
  62. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),Y=require("@react-hookz/web"),t=require("lodash-es"),A=require("react-i18next"),u=require("@radix-ui/react-icons"),o=require("./index-TEfD-2ti.cjs"),ae=require("./empty-slot-TF2kd-0X.cjs"),z=require("lucide-react"),U=require("@chaibuilder/runtime"),q=require("./index-XVud0HL8.cjs"),O=require("./index-gi1LIOCw.cjs"),ue=require("@rjsf/core"),pe=require("@rjsf/validator-ajv8"),de=require("jotai"),ce=require("react-autosuggest"),xe=require("fuse.js"),B=require("./Class-5ARpH_Tu.cjs"),me=require("./MODIFIERS-2FeVfZQ9.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");function ge(s){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(l,r,n.get?n:{enumerable:!0,get:()=>s[r]})}}return l.default=s,Object.freeze(l)}const M=ge(m);function ye(s){const l=[],r={};function n(i,c){t.forEach(c,(a,x)=>{const p=i?`${i}.${x}`:x,y=t.isArray(a)?"list":typeof a;l.push(p),r[p]=y==="string"?"text":y==="object"?"model":y,y==="object"&&!t.isArray(a)&&n(p,a)})}return n("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:l,pathsType:r}}const X=({data:s,fullView:l})=>{if(!s)return null;const r=typeof s;return l?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(q.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(O.JsonView,{data:s,shouldExpandNode:O.allExpanded,style:{...O.defaultStyles,container:"max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]}):e.jsxRuntimeExports.jsxs("div",{className:"max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},G=({type:s,value:l="",setValue:r,data:n,onChange:i,dataType:c,appliedBindings:a})=>{const{paths:x,pathsType:p}=ye(n),y=s==="PROP"?U.getBlockComponent(n==null?void 0:n._type):{},f=s==="PROP",[d,b]=m.useState(!1),h=m.useMemo(()=>s==="PROP"?x.filter(g=>!t.includes(a,g)&&t.get(y,`props.${t.first(t.split(g,"."))}.binding`)):x.filter(g=>c===t.get(p,g,"")),[s,x,a,c,y]);return m.useEffect(()=>{l&&i(l)},[l,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(o.Popover,{open:d,onOpenChange:b,children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(l)?"w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white":"min-w-[350px] items-center justify-between"}`,children:l?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"pr-8 text-sm",children:[f&&e.jsxRuntimeExports.jsx("span",{className:"mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(c)}),l]}),e.jsxRuntimeExports.jsx("span",{className:"cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{className:"z-[999] min-w-[300px] p-0",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(o.Command,{children:[e.jsxRuntimeExports.jsx(o.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs(o.CommandList,{children:[e.jsxRuntimeExports.jsx(o.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(o.CommandGroup,{children:t.map(h,g=>e.jsxRuntimeExports.jsxs(o.CommandItem,{value:g,className:`cursor-pointer ${f?"flex items-center justify-between":"flex flex-col items-start justify-start"}`,onSelect:v=>{r(t.find(h,E=>E===v)||null),b(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(z.Check,{className:`h-4 w-4 text-green-500 ${l===g?"":"opacity-0"}`}),g]}),f?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(t.get(p,g,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(X,{data:t.get(n,g)})})]},g))})]})]})})]})]}),!f&&!t.isEmpty(l)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(X,{data:t.get(n,l,""),fullView:!0})})]})},he=({appliedBindings:s=[],onAddBinding:l,editMode:r,item:n})=>{const[i,c]=m.useState(r?n.key:""),[a,x]=m.useState(r?n.value:""),p=o.useSelectedBlock(),[y]=q.useChaiExternalData(),f=m.useCallback((h,g)=>{if(t.isEmpty(h))return"";{const v=t.get(g==="PROP"?p:y,h,"");if(t.isArray(v))return"list";const E=typeof v;return E==="string"?"text":E==="object"?"model":E}},[p,y]),[d,b]=m.useState(r?f(n.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DialogHeader,{children:[e.jsxRuntimeExports.jsx(o.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(o.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col gap-1",children:[e.jsxRuntimeExports.jsx(G,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:c,onChange:h=>{const g=f(h,"PROP");c(h),d!==g&&x(""),b(g)},data:p,dataType:d,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(G,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:a,setValue:x,onChange:h=>{const g=f(h,"PATH");x(d===g?h:"")},data:y,dataType:d,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(o.DialogFooter,{children:e.jsxRuntimeExports.jsx(o.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(a),onClick:()=>l({key:i,value:a}),children:"Save"})})]})},re=({disabled:s,children:l,onAddBinding:r,appliedBindings:n,editMode:i=!0,item:c={}})=>{const[a,x]=m.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{disabled:s,asChild:!0,onClick:()=>x(!0),children:l}),a&&e.jsxRuntimeExports.jsx(o.DialogContent,{children:e.jsxRuntimeExports.jsx(he,{item:c,editMode:i,appliedBindings:n,onAddBinding:p=>{r(p),x(!1)}})})]})},be=({item:s,onAddBinding:l,onRemove:r,selectedBlock:n,dataProvider:i,appliedBindings:c})=>{const[a,x]=m.useState("string"),p=(y,f)=>{if(t.isEmpty(y))return"";{const d=t.get(f==="PROP"?n:i,y,"");if(t.isArray(d))return"list";const b=typeof d;return b==="string"?"text":b==="object"?"model":b}};return m.useEffect(()=>x(()=>p(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col rounded-md border border-gray-200 p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm font-normal text-gray-500",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(X,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(re,{editMode:!0,onAddBinding:l,appliedBindings:c,item:s,children:e.jsxRuntimeExports.jsx(z.EditIcon,{className:"mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white"})}),e.jsxRuntimeExports.jsx(z.TrashIcon,{onClick:()=>r(),className:"mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"})]}),!t.isEmpty(a)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600",children:t.startCase(a)})]})},fe=({bindingData:s,onChange:l})=>{const r=o.useSelectedBlock(),[n]=q.useChaiExternalData(),i=U.getChaiDataProviders(),[c,a]=m.useState(t.map(s,(d,b)=>({key:b,value:d})));m.useEffect(()=>{a(t.map(s,(d,b)=>({key:b,value:d})))},[r==null?void 0:r._id,s]);const x=m.useMemo(()=>{if(t.isEmpty(n))return!0;if(t.isEmpty(c))return!1;const d=t.last(c);return t.isEmpty(d==null?void 0:d.key)||t.isEmpty(d==null?void 0:d.value)},[n,c]),p=d=>{const b=t.filter(c,h=>h.key!==d.key);a([...b,d]),f([...b,d])},y=d=>{const b=t.filter(c,(h,g)=>d!==g);f([...b])},f=m.useCallback((d=[])=>{if(a(d),t.isEmpty(d)){l({});return}const b={};t.forEach(d,h=>{!t.isEmpty(h==null?void 0:h.key)&&!t.isEmpty(h==null?void 0:h.value)&&t.set(b,h.key,h.value)}),l(b)},[l]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 text-xs text-gray-500",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(c,(d,b)=>e.jsxRuntimeExports.jsx(be,{item:d,onAddBinding:p,onRemove:()=>y(b),selectedBlock:r,dataProvider:n,appliedBindings:t.map(c,"key")},d.key)),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{disabled:t.isEmpty(n),className:"w-full",children:e.jsxRuntimeExports.jsx(re,{disabled:x,appliedBindings:t.map(c,"key"),onAddBinding:p,children:e.jsxRuntimeExports.jsx("span",{className:`w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${x?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(n)?e.jsxRuntimeExports.jsx("small",{className:"text-[9.5px] text-gray-500",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),x&&e.jsxRuntimeExports.jsx(o.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(n)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},je=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),W=m.memo(({properties:s,formData:l,onChange:r})=>{const n={type:"object",properties:{}},i={};return Object.keys(s).forEach(c=>{const a=s[c];if(t.includes(["slot","styles"],a.type))return;const x=c;n.properties[x]=o.getBlockJSONFromSchemas(a),i[x]=o.getBlockJSONFromUISchemas(a)}),e.jsxRuntimeExports.jsx(ue,{widgets:{binding:je,richtext:o.RichTextEditorField,icon:o.IconPickerField,image:o.ImagePickerField},fields:{link:o.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator:pe,uiSchema:i,schema:n,formData:l,onChange:r})});function ve(){const s=o.useSelectedBlock(),l=o.useUpdateBlocksPropsRealtime(),r=o.useUpdateBlocksProps(),n=U.getBlockComponent(s._type),i={...s},[c,a]=m.useState(i),x=o.useBuilderProp("dataBindingSupport",!1),p=({formData:g},v,E)=>{if(v){const S=v.replace("root.","");r([s._id],{[S]:t.get(g,S)},E)}},y=m.useCallback(t.debounce(({formData:g},v,E)=>{p({formData:g},v,E),a(g)},1500),[]),f=({formData:g},v)=>{if(v){const E=v.replace("root.","");l([s._id],{[E]:t.get(g,E)}),y({formData:g},v,{[E]:t.get(c,E)})}},d={_name:ae.u({title:"Name",default:t.get(s,"_name",s._type)})},b=t.keys(t.get(i,"_bindings",{})),h=m.useMemo(()=>{const g=t.cloneDeep(t.get(n,"props",{}));return x&&t.each(b,v=>delete g[v]),g},[n,b,x]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(W,{onChange:f,formData:i,properties:d}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),x?e.jsxRuntimeExports.jsxs(o.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"px-4 pt-4",children:e.jsxRuntimeExports.jsx(fe,{bindingData:t.get(s,"_bindings",{}),onChange:g=>{p({formData:{_bindings:g}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(o.AccordionContent,{className:"pt-4",children:[t.isEmpty(b)?null:e.jsxRuntimeExports.jsxs("div",{className:"mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(b,t.capitalize).join(", ")})," ",b.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(W,{onChange:f,formData:i,properties:h})]})]})]}):e.jsxRuntimeExports.jsx(W,{onChange:f,formData:i,properties:h}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const J=new xe(B.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function Re(){var S;const[s]=o.useSelectedStylingBlocks(),l=o.useSelectedBlock(),r=o.useAddClassesToBlocks(),n=o.useRemoveClassesFromBlocks(),[i]=o.useSelectedBlockIds(),[c,a]=m.useState(""),x=(S=t.first(s))==null?void 0:S.prop,p=t.reject((t.get(l,x,"").replace(me.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),y=()=>{const w=c.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,w,!0),a("")},[f,d]=m.useState([]),b=({value:w})=>{const I=w.trim().toLowerCase(),_=I.match(/.+:/g);let C=[];if(_&&_.length>0){const[T]=_,V=I.replace(T,"");C=J.search(V).map(j=>({...j,item:{...j.item,name:T+j.item.name}}))}else C=J.search(I);d(t.map(C,"item"))},h=()=>{d([])},g=w=>w.name,v=w=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:w.name}),E={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:c,onKeyDown:w=>{w.key==="Enter"&&c.trim()!==""&&y()},onChange:(w,{newValue:I})=>a(I),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${f.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(o.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(ce,{suggestions:f,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:h,getSuggestionValue:g,renderSuggestion:v,inputProps:E,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:y,disabled:c.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(p)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),M.Children.toArray(p.map(w=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[w,e.jsxRuntimeExports.jsx(u.Cross2Icon,{onClick:()=>n(i,[w]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},w)))]})]})}const N=["px","%","em","rem","ch","vh","vw"],Ee={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:N,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},we={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},Ce=[{heading:"layout.heading",items:[{type:"arbitrary",label:"layout.width",units:N.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:N.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...N,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"multiple",label:"layout.space_bt",options:[{key:"spaceX",label:"layout.space_lr"},{key:"spaceY",label:"layout.space_tb"}]}]},{heading:"size.heading",items:[{styleType:"accordion",heading:"size.min_width_height",items:[{type:"arbitrary",label:"size.min_width",units:N.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"size.min_height",units:N.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"size.max_width_height",items:[{type:"arbitrary",label:"size.max_width",units:N.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"size.max_height",units:N.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"size.object_options_aspect_ratio",items:[{type:"dropdown",label:"size.aspect",property:"aspectRatio"},{type:"dropdown",label:"size.fit",property:"objectFit"},{type:"dropdown",label:"size.position",property:"objectPosition"}]}]},{heading:"display.heading",items:[{type:"dropdown",label:"display.display",property:"display",units:N},{styleType:"accordion",heading:"display.flex_options",items:[{type:"dropdown",label:"display.flex_direction",property:"flexDirection"},{type:"dropdown",label:"display.flex_wrap",property:"flexWrap"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"display.grid_options",items:[{type:"range",label:"display.grid_columns",property:"gridColumns"},{type:"range",label:"display.grid_rows",property:"gridRows"},{type:"dropdown",label:"display.grid_auto_flow",property:"gridAutoFlow"},{type:"dropdown",label:"display.grid_auto_cols",property:"gridAutoColumns"},{type:"dropdown",label:"display.grid_auto_rows",property:"gridAutoRows"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",units:["px","rem"],options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"display.visibility_opacity",items:[{type:"dropdown",label:"display.visibility",property:"visibility",units:N},{type:"arbitrary",label:"display.opacity",property:"opacity",units:["-"]}]}]},{heading:"position.heading",items:[{type:"icons",label:"position.position",property:"position"},{styleType:"accordion",heading:"position.options",items:[{styleType:"multiple",label:"position.direction",options:[{key:"top",label:"position.top"},{key:"right",label:"position.right"},{key:"bottom",label:"position.bottom"},{key:"left",label:"position.left"}]},{styleType:"multiple",label:"position.inset",options:[{key:"inset",label:"position.all"},{key:"insetX",label:"position.lr"},{key:"insetY",label:"position.tb"}]},{type:"arbitrary",label:"position.z_index",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"position.float_clear",items:[{type:"icons",label:"position.float",property:"float"},{type:"dropdown",label:"position.clear",property:"clear"}]},{styleType:"accordion",heading:"position.overflow_overscroll",items:[{styleType:"multiple",type:"dropdown",label:"position.overflow",options:[{key:"overflow",label:"position.all"},{key:"overflowX",label:"position.lr"},{key:"overflowY",label:"position.tb"}]},{styleType:"multiple",type:"dropdown",label:"position.overscroll",options:[{key:"overscroll",label:"position.all"},{key:"overscrollX",label:"position.lr"},{key:"overscrollY",label:"position.tb"}]}]}]},{heading:"typography.heading",items:[{type:"dropdown",property:"fontFamily",label:"typography.font"},{type:"arbitrary",property:"fontSize",label:"typography.size",units:N},{type:"arbitrary",property:"lineHeight",label:"typography.height",units:N.concat("-")},{type:"range",property:"fontWeight",label:"typography.weight"},{type:"color",property:"textColor",label:"typography.color"},{styleType:"accordion",heading:"typography.alignments",items:[{type:"dropdown",property:"textAlign",label:"typography.align"},{type:"dropdown",property:"verticalAlign",label:"typography.valign"}]},{styleType:"accordion",heading:"typography.spacing_decoration_more",items:[{type:"dropdown",property:"letterSpacing",label:"typography.spacing"},{type:"dropdown",property:"textDecoration",label:"typography.decoration"},{type:"range",property:"textDecorationThickness",label:"typography.thickness"},{type:"dropdown",property:"textTransform",label:"typography.transform"}]},{styleType:"accordion",heading:"typography.whitespace_breaks",items:[{type:"dropdown",property:"whitespace",label:"typography.whitespace"},{type:"dropdown",property:"wordbreak",label:"typography.wordbreak"}]}]},{heading:"background.heading",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{styleType:"accordion",heading:"background.position_size_more",items:[{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]},{type:"dropdown",label:"background.gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"background.gradient_colors",items:[{type:"color",label:"background.from_color",property:"fromColor"},{type:"color",label:"background.via_color",property:"viaColor"},{type:"color",label:"background.to_color",property:"toColor"}]}]},{heading:"border.heading",items:[{styleType:"multiple",type:"dropdown",label:"border.width",options:[{key:"border",label:"border.all"},{key:"borderX",label:"border.lr"},{key:"borderY",label:"border.tb"},{key:"borderTop",label:"border.top"},{key:"borderRight",label:"border.right"},{key:"borderBottom",label:"border.bottom"},{key:"borderLeft",label:"border.left"}]},{styleType:"multiple",type:"dropdown",label:"border.corners",options:[{key:"borderRadius",label:"border.all"},{key:"borderRadiusTop",label:"border.top"},{key:"borderRadiusRight",label:"border.right"},{key:"borderRadiusBottom",label:"border.bottom"},{key:"borderRadiusLeft",label:"border.left"},{key:"borderRadiusTopLeft",label:"border.top_left"},{key:"borderRadiusTopRight",label:"border.top_right"},{key:"borderRadiusBottomRight",label:"border.bottom_right"},{key:"borderRadiusBottomLeft",label:"border.bottom_left"}]},{type:"color",label:"border.color",property:"borderColor"},{type:"dropdown",label:"border.style",property:"borderStyle"},{styleType:"accordion",heading:"border.divide_options",items:[{styleType:"multiple",type:"range",label:"border.width",options:[{key:"divideXWidth",label:"border.lr"},{key:"divideYWidth",label:"border.tb"}]},{type:"color",label:"border.divide_color",property:"divideColor"},{type:"dropdown",label:"border.divide_style",property:"divideStyle"}]},{styleType:"accordion",heading:"border.outline_styling",items:[{type:"range",label:"border.outline_width",property:"outlineWidth"},{type:"range",label:"border.outline_offset",property:"outlineOffset"},{type:"dropdown",label:"border.outline_style",property:"outlineStyle"}]},{styleType:"accordion",heading:"border.ring_options",items:[{type:"range",label:"border.ring_width",property:"ringWidth"},{type:"color",label:"border.ring_color",property:"ringColor"},{type:"range",label:"border.ring_offset_width",property:"ringOffsetWidth"},{type:"color",label:"border.ring_offset_color",property:"ringOffsetColor"}]}]},{heading:"effect.heading",items:[{type:"range",label:"effect.shadow",property:"boxShadow"},{type:"color",label:"effect.color",property:"boxShadowColor"},{type:"dropdown",label:"effect.cursor",property:"cursor"},{styleType:"accordion",heading:"effect.blend_cursor",items:[{type:"dropdown",label:"effect.mix_blend",property:"mixBlendMode"},{type:"dropdown",label:"effect.bg_blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"effect.transform",items:[{type:"dropdown",label:"effect.origin",property:"transformOrigin"},{styleType:"multiple",label:"effect.scale",units:["-"],options:[{key:"scale",label:"effect.all"},{key:"scaleX",label:"effect.lr"},{key:"scaleY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.skew",units:["deg"],options:[{key:"skewX",label:"effect.lr"},{key:"skewY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.translate",negative:!0,options:[{key:"translateX",label:"effect.lr"},{key:"translateY",label:"effect.tb"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"effect.rotate",property:"rotate"}]},{styleType:"accordion",heading:"effect.animation",items:[{type:"dropdown",label:"effect.animation",property:"animation"},{type:"dropdown",label:"effect.transition",property:"transition"},{type:"dropdown",label:"effect.easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"effect.duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"effect.delay",property:"delay"}]}]},{heading:"classes.heading",items:[{component:Re}]}],se={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:u.EyeOpenIcon,invisible:u.EyeClosedIcon,hidden:u.EyeClosedIcon,gap:u.BorderAllIcon,gapX:u.WidthIcon,gapY:u.HeightIcon,spaceX:u.WidthIcon,spaceY:u.HeightIcon,overscroll:u.BorderAllIcon,overscrollX:u.WidthIcon,overscrollY:u.HeightIcon,overflow:u.BorderAllIcon,overflowX:u.WidthIcon,overflowY:u.HeightIcon,top:u.ArrowUpIcon,right:u.ArrowRightIcon,bottom:u.ArrowDownIcon,left:u.ArrowLeftIcon,inset:u.BorderAllIcon,insetX:u.WidthIcon,insetY:u.HeightIcon,border:u.BorderAllIcon,borderX:u.WidthIcon,borderY:u.HeightIcon,borderTop:u.ArrowUpIcon,borderRight:u.ArrowRightIcon,borderBottom:u.ArrowDownIcon,borderLeft:u.ArrowLeftIcon,borderRadius:u.BorderAllIcon,borderRadiusX:u.WidthIcon,borderRadiusY:u.HeightIcon,borderRadiusTop:u.ArrowUpIcon,borderRadiusRight:u.ArrowRightIcon,borderRadiusBottom:u.ArrowDownIcon,borderRadiusLeft:u.ArrowLeftIcon,borderRadiusTopLeft:u.ArrowTopLeftIcon,borderRadiusTopRight:u.ArrowTopRightIcon,borderRadiusBottomRight:u.ArrowBottomRightIcon,borderRadiusBottomLeft:u.ArrowBottomLeftIcon,divideXWidth:u.WidthIcon,divideYWidth:u.HeightIcon,scale:u.BorderAllIcon,scaleX:u.WidthIcon,scaleY:u.HeightIcon,skewX:u.WidthIcon,skewY:u.HeightIcon,translateX:u.WidthIcon,translateY:u.HeightIcon,padding:u.BorderAllIcon,paddingX:u.WidthIcon,paddingY:u.HeightIcon,paddingTop:u.ArrowUpIcon,paddingRight:u.ArrowRightIcon,paddingBottom:u.ArrowDownIcon,paddingLeft:u.ArrowLeftIcon,margin:u.BorderAllIcon,marginX:u.WidthIcon,marginY:u.HeightIcon,marginTop:u.ArrowUpIcon,marginRight:u.ArrowRightIcon,marginBottom:u.ArrowDownIcon,marginLeft:u.ArrowLeftIcon,textLeft:u.AlignLeftIcon,textCenter:u.AlignCenterHorizontallyIcon,textRight:u.AlignRightIcon,textJustify:u.StretchHorizontallyIcon,italic:u.FontItalicIcon,underline:u.UnderlineIcon,overline:u.OverlineIcon,uppercase:u.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":u.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:u.Cross1Icon},$=m.createContext({canReset:!1,canChange:!0}),ke=({children:s,canReset:l=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx($.Provider,{value:{canReset:l,canChange:r},children:s}),oe=({label:s,property:l,onChange:r})=>{const n=m.useMemo(()=>t.get(B.CLASSES_LIST,`${l}.classes`,[""]),[l]),i=L(l),c=m.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:a}=m.useContext($),x=/\[.*\]/g.test(c);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded":"grow",children:x?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:c}),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(Z,{rounded:s,onChange:p=>r(p,l),selected:c,options:n,disabled:!a})})};function Z({selected:s,onChange:l,rounded:r=!1,options:n,disabled:i=!1}){const c=s.replace(/.*:/g,"").trim(),{undo:a,redo:x}=o.useUndoManager();return e.jsxRuntimeExports.jsxs("select",{disabled:!n.length||i,className:`${r?"rounded-md border border-border":"border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:p=>l(p.target.value),onKeyDown:p=>{p.ctrlKey&&(p.key==="z"&&a(),p.key==="y"&&x())},value:c,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),m.Children.toArray(n.map(p=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:p,children:p})))]})}const Ne=({property:s,onChange:l})=>{const{canReset:r,canChange:n}=m.useContext($),i=L(s),c=m.useMemo(()=>t.get(i,"cls",""),[i]),a=m.useMemo(()=>t.get(B.CLASSES_LIST,`${s}.classes`,[""]),[s]),x=a.indexOf(c)>-1?a.indexOf(c):0,p=/\[.*\]/g.test(c);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:p?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:c}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!n&&(!r||x-1<0),onClick:()=>l(t.nth(a,x-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.MinusIcon,{className:!n&&(!r||x-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(oe,{label:!1,property:s,onChange:l})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!n&&(!r||x+1>=a.length),onClick:()=>l(t.nth(a,x+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{className:!n&&(!r||x+1>=a.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},Se=({property:s,onChange:l})=>{const r=m.useMemo(()=>t.get(B.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:n}=m.useContext($),i=L(s),c=m.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,a=>e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!n,onClick:()=>l(a,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${c===a?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:m.createElement(t.get(se,a,u.BoxIcon))})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(a))})]}))})},Te={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Ie=({property:s,onChange:l})=>{const r=L(s),n=m.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=m.useContext($),[c,a]=m.useState([]),[x,p]=m.useState({color:"",shade:""}),y=n.split("-"),f=t.get(y,"1",""),d=t.get(y,"2",""),b=m.useCallback(g=>{["current","inherit","transparent","black","white"].includes(g)?(a([]),p({color:g})):(a(["50","100","200","300","400","500","600","700","800","900"]),p(v=>({...v,color:g,shade:v.shade?v.shade:"500"})))},[a,p]);m.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(f))return a([]);a(["50","100","200","300","400","500","600","700","800","900"])},[f]);const h=m.useCallback(g=>{p({color:f,shade:g})},[f]);return m.useEffect(()=>{p({color:"",shade:""})},[r]),m.useEffect(()=>{const v=`${t.get(Te,s,"")}-${x.color}${x.shade?`-${x.shade}`:""}`;v.match(new RegExp(t.get(B.CLASSES_LIST,`${s}.regExp`,"")))&&l(v,s)},[x,l,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(Z,{disabled:!i,rounded:!0,selected:f,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(Z,{rounded:!0,selected:d,disabled:!f||!i,onChange:h,options:c})})]})},Q=(s,l)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&l.includes(r))return{value:"",unit:r};const n=l.length?new RegExp(l.join("|"),"g"):/XXXXXX/g;r=r.replace(n,"");const i=s.match(n),c=i&&i.length>1,a=!t.isEmpty(r)&&Number.isNaN(Number(r));return c||a?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}};const _e=s=>{const l=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${l}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${l}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${l}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${l}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const n=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(n)return{value:n[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[n,i]=t.map(r.split("/"),c=>parseInt(c,10));return{value:l+(n/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${l+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}};const He=s=>{if(t.isEmpty(s))return{value:"",unit:""};const l=s.match(/\[.*\]/g);if(l===null)return Ve(s);const r=t.get(l,"0","").replace(/\[|\]/g,""),n=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${n}${i}`,unit:r.replace(i,"")}},Ve=s=>t.isEmpty(s)?{value:"",unit:""}:_e(s),ne=m.createContext({setDragData:()=>{}}),Ae=({unit:s,currentValue:l,onDrag:r,onDragEnd:n,onDragStart:i,negative:c,cssProperty:a})=>{const{setDragData:x}=m.useContext(ne);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:p=>{const y={onDrag:r,onDragEnd:n,dragging:!0,dragStartY:p.pageY,dragStartValue:`${l}`,dragUnit:s,negative:c,cssProperty:a};i(y),x(y)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(u.RowSpacingIcon,{})})},Be=({onSelect:s,current:l,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(n=>e.jsxRuntimeExports.jsx(o.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:l===n?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(n)},children:n},n))}),ee=50,De=s=>{const[l,r]=m.useState(!1),[n,i]=m.useState(""),{currentClass:c,onChange:a,classPrefix:x,cssProperty:p,units:y,negative:f}=s,[d,b]=m.useState(p!=null&&p.toLowerCase().includes("width")?"%":y[0]),[h,g]=m.useState(!1),[v,E]=m.useState(""),[S,w]=m.useState(!1),[I,_]=m.useState(!1);m.useEffect(()=>{const{value:j,unit:R}=He(c);if(R===""){i(j),b(p!=null&&p.toLowerCase().includes("width")?"%":t.first(y));return}b(R),i(R==="class"||t.isEmpty(j)?"":j)},[c,p,y]);const C=Y.useThrottledCallback(j=>a(j),[a],ee),T=Y.useThrottledCallback(j=>a(j,!1),[a],ee),V=m.useCallback((j=!1)=>{const R=Q(`${n}`,y);if(t.get(R,"error",!1)){g(!0);return}const k=t.get(R,"unit")!==""?t.get(R,"unit"):d;if(k==="auto"||k==="none"){C(`${x}${k}`);return}if(t.get(R,"value")==="")return;const P=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;j?T(P):C(P)},[C,T,n,d,x,y]),D=m.useCallback(j=>{const R=Q(`${n}`,y);if(t.get(R,"error",!1)){g(!0);return}if(j==="auto"||j==="none"){C(`${x}${j}`);return}if(t.get(R,"value")==="")return;const k=t.get(R,"unit")!==""?t.get(R,"unit"):j,P=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;C(P)},[C,n,x,y]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:d==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:c}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${S?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(d)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:d==="class",onKeyPress:j=>{j.key==="Enter"&&V()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),_(!0);const R=t.parseInt(j.target.value);let k=t.isNaN(R)?0:R;j.keyCode===38&&(k+=1),j.keyCode===40&&(k-=1);const H=`${k}`,le=`${H.startsWith("-")?"-":""}${x}[${H.replace("-","")}${d==="-"?"":d}]`;T(le)},onKeyUp:j=>{I&&(j.preventDefault(),_(!1))},onBlur:()=>V(),onChange:j=>{g(!1),i(j.target.value)},onClick:j=>{var R;(R=j==null?void 0:j.target)==null||R.select(),r(!1)},value:S?v:n,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",h?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(o.Tooltip,{open:l,delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!l),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${y.length===1?"px-2 font-semibold":""}`,children:d}),y.length>1?e.jsxRuntimeExports.jsx(u.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(o.TooltipPortal,{children:e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(Be,{units:y,current:d,onSelect:j=>{r(!1),b(j),D(j)}})})})]})]}),["none","auto"].indexOf(d)!==-1||S?null:e.jsxRuntimeExports.jsx(Ae,{onDragStart:()=>w(!0),onDragEnd:j=>{if(E(()=>""),w(!1),t.isEmpty(j))return;const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${d==="-"?"":d}]`;C(H)},onDrag:j=>{if(t.isEmpty(j))return;E(j);const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${d==="-"?"":d}]`;T(H)},currentValue:n,unit:d,negative:f,cssProperty:p})]})})})},L=s=>{const l=o.useSelectedBlockCurrentClasses();return t.findLast(l,{property:s})},Pe=(s,l)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[l]},$e={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},te={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Le=s=>`${s.toUpperCase()} ${te[s]?`(${te[s]} & up)`:""}`,K=s=>{const{t:l}=A.useTranslation(),{type:r="icons",label:n,property:i,onEmitChange:c=()=>{},units:a,negative:x=!1}=s,[p]=o.useDarkMode(),[y]=o.useStylingState(),[,f]=o.useCanvasWidth(),d=L(i),b=o.useAddClassesToBlocks(),h=o.useRemoveClassesFromBlocks(),[g]=o.useSelectedBlockIds(),v=m.useMemo(()=>t.get(d,"fullCls",""),[d]),E=m.useCallback((T,V=!0)=>{const D={dark:p,mq:f,mod:y,cls:T,property:i,fullCls:""};(p||y!=="")&&(D.mq="xs");const j=B.generateFullClsName(D);b(g,[j],V)},[g,p,f,y,i,b]),S=m.useCallback(()=>{h(g,[v])},[g,v,h]),w=m.useMemo(()=>Pe(d,f),[d,f]);m.useEffect(()=>{c(w,d)},[w,c,d]);const[,,I]=o.useCanvasWidth(),_=m.useCallback(T=>{I({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[T])},[I]),C=t.get(d,"dark",null)===p&&t.get(d,"mod",null)===y&&t.get(d,"mq",null)===f;return e.jsxRuntimeExports.jsx(ke,{canChange:w,canReset:d&&C,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${d&&!C?"text-foreground":""}`,children:l(n)})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[r==="arbitrary"?e.jsxRuntimeExports.jsx(De,{currentClass:t.get(d,"cls",""),classPrefix:t.get($e,i,""),units:a||[],onChange:E,negative:x,cssProperty:i}):null,r==="icons"&&e.jsxRuntimeExports.jsx(Se,{property:i,onChange:E}),r==="range"&&e.jsxRuntimeExports.jsx(Ne,{property:i,onChange:E}),r==="color"&&e.jsxRuntimeExports.jsx(Ie,{property:i,onChange:E}),r==="dropdown"&&e.jsxRuntimeExports.jsx(oe,{label:n,property:i,onChange:E})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${v?"visible":"invisible"}`,children:C?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>S(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(u.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):w&&d?e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at  ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold",children:[Le(t.get(d,"mq")),p&&!d.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>_(t.get(d,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(d,"mq").toUpperCase()]})]})})})]}):null})]})]})})},Me=["px","%","em","rem","ch","vh","vw"],ie=({label:s,options:l,borderB:r=!1,borderT:n=!1,type:i="arbitrary",units:c=Me,negative:a=!1})=>{const{t:x}=A.useTranslation(),[p,y]=m.useState(l[0].key),f=o.useSelectedBlockCurrentClasses(),d=m.useCallback(b=>t.map(f,"property").includes(b),[f]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${n?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:x(s)}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:m.Children.toArray(l.map(({label:b,key:h})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>y(h),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${h===p?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[m.createElement("div",{className:d(h)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),m.createElement(t.get(se,h,u.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(b))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(K,{type:i,units:[...c],label:"",property:p,negative:a})})]})},qe=({heading:s,items:l})=>{const{t:r}=A.useTranslation(),n=o.useSelectedBlockCurrentClasses(),i=m.useMemo(()=>{const c=p=>t.flatten(p.map(y=>y.styleType==="multiple"?t.map(y.options,"key"):y.property)),a=t.flatten(l.map(p=>p.styleType==="accordion"?c(p.items):p.styleType==="multiple"?t.map(p.options,"key"):p.property)),x=t.map(n,"property");return t.intersection(a,x).length>0},[n,l]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[r(s),i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:l.map(c=>c.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...c},c.label):e.jsxRuntimeExports.jsx(K,{...c},c.label))})]})},Oe=m.createContext({}),F=({section:s})=>{const{t:l}=A.useTranslation(),r=o.useSelectedBlockCurrentClasses(),n=m.useCallback((a=[])=>{const x={};for(let y=0;y<r.length;y++)x[r[y].property]=r[y].cls;let p=!0;for(const y in a)if(!t.has(x,y)||x[y]!==a[y]){p=!1;break}return p},[r]),i=m.useMemo(()=>{if(r.length>0&&s.heading==="classes.heading")return!0;const a=y=>t.flatten(y.map(f=>f.styleType==="multiple"?t.flatten(t.map(f.options,"key")):f.property)),x=t.flatten(s.items.map(y=>y.styleType==="accordion"?a(y.items):y.styleType==="multiple"?t.flatten(t.map(y.options,"key")):y.property)),p=t.map(r,"property");return t.intersection(x,p).length>0},[r,s.heading,s.items]),c=m.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Oe.Provider,{value:c,children:e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),l(s.heading)]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:m.Children.toArray(s.items.map(a=>t.has(a,"component")?m.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...a},a.label):a.styleType==="accordion"&&n(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(qe,{...a},a.label):null:e.jsxRuntimeExports.jsx(K,{...a},a.label)))})]})})},We=({item:s,index:l,canDelete:r,onChange:n,onRemove:i})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${r?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:c=>n(c,l),value:s.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:c=>t.isEmpty(s.key)?{}:n(c,l),value:s.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(u.TrashIcon,{onClick:i,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),Fe=({section:s})=>{var b;const{setSyncState:l}=o.useSavePage(),r=o.useSelectedBlock(),[n,i]=m.useState([]),[c]=o.useSelectedStylingBlocks(),a=o.useUpdateBlocksPropsRealtime(),x=`${t.get(c,"0.prop")}_attrs`;M.useEffect(()=>{const h=t.map(t.get(r,x),(g,v)=>({key:v,value:g}));t.isEmpty(h)?i([]):i(h)},[t.get(r,x)]);const p=()=>i([...n,{key:"",value:""}]),y=h=>{const g=t.filter(n,(v,E)=>h!==E);d(g)},f=(h,g)=>{const v=[...n];v[g][h.target.name]=h.target.value,d(v)},d=M.useCallback((h=[])=>{const g={};t.forEach(h,v=>{t.isEmpty(v.key)||t.set(g,v.key,v.value)}),a([t.get(r,"_id")],{[x]:g}),l("UNSAVED")},[r,l,a,x]);return e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,x))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(o.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(n)&&t.isEmpty((b=t.last(n))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var h;!t.isEmpty(n)&&t.isEmpty((h=t.last(n))==null?void 0:h.key)||p()},children:[e.jsxRuntimeExports.jsx(u.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),M.Children.toArray(t.map(n,(h,g)=>{const v=n.length>0&&g<n.length-1;return e.jsxRuntimeExports.jsx(We,{item:h,index:g,canDelete:v,onChange:f,onRemove:()=>y(g)})}))]})]})})]})};function Ye(){const[s,l]=o.useStylingState(),{flexChild:r,gridChild:n}=o.useSelectedBlocksDisplayChild(),[,i]=de.useAtom(o.advanceStylingOpenAtom),{t:c}=A.useTranslation(),[a]=o.useSelectedStylingBlocks();return t.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:c("no_styling_block_selected")})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>i(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex h-12 flex-col space-x-4 space-y-3 border-b border-border px-4 py-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(o.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(o.Select,{defaultValue:s,onValueChange:x=>l(x),children:[e.jsxRuntimeExports.jsx(o.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(o.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(o.SelectContent,{children:[e.jsxRuntimeExports.jsx(o.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden",children:e.jsxRuntimeExports.jsxs(o.Accordion,{defaultValue:["Layout"],type:"multiple",className:"w-full",children:[r&&e.jsxRuntimeExports.jsx(F,{section:Ee}),n?e.jsxRuntimeExports.jsx(F,{section:we}):null,Ce.map(x=>e.jsxRuntimeExports.jsx(F,{section:x},x.heading)),e.jsxRuntimeExports.jsx(Fe,{section:{heading:"Attributes"}})]})})]})}const ze={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},Xe=()=>{const s=o.useSelectedBlock(),{t:l}=A.useTranslation(),[r,n]=m.useState(""),[i,c]=m.useState({onDrag:p=>p,onDragEnd:p=>p,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),a=Y.useThrottledCallback(p=>{const y=!t.get(i,"negative",!1),f=t.get(i,"cssProperty","");let d=parseFloat(i.dragStartValue);d=t.isNaN(d)?0:d;let b=ze[i.dragUnit];(t.startsWith(f,"scale")||f==="opacity")&&(b=10);let g=(i.dragStartY-p.pageY)/b+d;y&&g<0&&(g=0),f==="opacity"&&g>1&&(g=1),i.onDrag(`${g}`),n(`${g}`)},[i],50),x=m.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),c({onDrag:p=>p,onDragEnd:p=>p,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,c]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:l("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(q.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs(ne.Provider,{value:{setDragData:c},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:a,onMouseUp:()=>x(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"}):null,e.jsxRuntimeExports.jsxs(o.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(o.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"settings",children:l("settings")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"styling",children:l("styling")})]}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"settings",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5",children:e.jsxRuntimeExports.jsx(ve,{})})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"styling",className:"h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Ye,{})})]})]})})};exports.default=Xe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),Y=require("@react-hookz/web"),t=require("lodash-es"),A=require("react-i18next"),u=require("@radix-ui/react-icons"),o=require("./index-bfKqnRvZ.cjs"),ae=require("./empty-slot-2LSrWJaY.cjs"),z=require("lucide-react"),U=require("@chaibuilder/runtime"),q=require("./index-TBa4RPnS.cjs"),O=require("./index-gi1LIOCw.cjs"),ue=require("@rjsf/core"),pe=require("@rjsf/validator-ajv8"),de=require("jotai"),ce=require("react-autosuggest"),xe=require("fuse.js"),B=require("./Class-5ARpH_Tu.cjs"),me=require("./MODIFIERS-2FeVfZQ9.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");function ge(s){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(l,r,n.get?n:{enumerable:!0,get:()=>s[r]})}}return l.default=s,Object.freeze(l)}const M=ge(m);function ye(s){const l=[],r={};function n(i,c){t.forEach(c,(a,x)=>{const p=i?`${i}.${x}`:x,y=t.isArray(a)?"list":typeof a;l.push(p),r[p]=y==="string"?"text":y==="object"?"model":y,y==="object"&&!t.isArray(a)&&n(p,a)})}return n("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:l,pathsType:r}}const X=({data:s,fullView:l})=>{if(!s)return null;const r=typeof s;return l?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(q.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(O.JsonView,{data:s,shouldExpandNode:O.allExpanded,style:{...O.defaultStyles,container:"max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]}):e.jsxRuntimeExports.jsxs("div",{className:"max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},G=({type:s,value:l="",setValue:r,data:n,onChange:i,dataType:c,appliedBindings:a})=>{const{paths:x,pathsType:p}=ye(n),y=s==="PROP"?U.getBlockComponent(n==null?void 0:n._type):{},f=s==="PROP",[d,b]=m.useState(!1),h=m.useMemo(()=>s==="PROP"?x.filter(g=>!t.includes(a,g)&&t.get(y,`props.${t.first(t.split(g,"."))}.binding`)):x.filter(g=>c===t.get(p,g,"")),[s,x,a,c,y]);return m.useEffect(()=>{l&&i(l)},[l,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(o.Popover,{open:d,onOpenChange:b,children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(l)?"w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white":"min-w-[350px] items-center justify-between"}`,children:l?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"pr-8 text-sm",children:[f&&e.jsxRuntimeExports.jsx("span",{className:"mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(c)}),l]}),e.jsxRuntimeExports.jsx("span",{className:"cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{className:"z-[999] min-w-[300px] p-0",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(o.Command,{children:[e.jsxRuntimeExports.jsx(o.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs(o.CommandList,{children:[e.jsxRuntimeExports.jsx(o.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(o.CommandGroup,{children:t.map(h,g=>e.jsxRuntimeExports.jsxs(o.CommandItem,{value:g,className:`cursor-pointer ${f?"flex items-center justify-between":"flex flex-col items-start justify-start"}`,onSelect:v=>{r(t.find(h,E=>E===v)||null),b(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(z.Check,{className:`h-4 w-4 text-green-500 ${l===g?"":"opacity-0"}`}),g]}),f?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(t.get(p,g,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(X,{data:t.get(n,g)})})]},g))})]})]})})]})]}),!f&&!t.isEmpty(l)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(X,{data:t.get(n,l,""),fullView:!0})})]})},he=({appliedBindings:s=[],onAddBinding:l,editMode:r,item:n})=>{const[i,c]=m.useState(r?n.key:""),[a,x]=m.useState(r?n.value:""),p=o.useSelectedBlock(),[y]=q.useChaiExternalData(),f=m.useCallback((h,g)=>{if(t.isEmpty(h))return"";{const v=t.get(g==="PROP"?p:y,h,"");if(t.isArray(v))return"list";const E=typeof v;return E==="string"?"text":E==="object"?"model":E}},[p,y]),[d,b]=m.useState(r?f(n.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DialogHeader,{children:[e.jsxRuntimeExports.jsx(o.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(o.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col gap-1",children:[e.jsxRuntimeExports.jsx(G,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:c,onChange:h=>{const g=f(h,"PROP");c(h),d!==g&&x(""),b(g)},data:p,dataType:d,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(G,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:a,setValue:x,onChange:h=>{const g=f(h,"PATH");x(d===g?h:"")},data:y,dataType:d,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(o.DialogFooter,{children:e.jsxRuntimeExports.jsx(o.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(a),onClick:()=>l({key:i,value:a}),children:"Save"})})]})},re=({disabled:s,children:l,onAddBinding:r,appliedBindings:n,editMode:i=!0,item:c={}})=>{const[a,x]=m.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{disabled:s,asChild:!0,onClick:()=>x(!0),children:l}),a&&e.jsxRuntimeExports.jsx(o.DialogContent,{children:e.jsxRuntimeExports.jsx(he,{item:c,editMode:i,appliedBindings:n,onAddBinding:p=>{r(p),x(!1)}})})]})},be=({item:s,onAddBinding:l,onRemove:r,selectedBlock:n,dataProvider:i,appliedBindings:c})=>{const[a,x]=m.useState("string"),p=(y,f)=>{if(t.isEmpty(y))return"";{const d=t.get(f==="PROP"?n:i,y,"");if(t.isArray(d))return"list";const b=typeof d;return b==="string"?"text":b==="object"?"model":b}};return m.useEffect(()=>x(()=>p(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col rounded-md border border-gray-200 p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm font-normal text-gray-500",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(X,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(re,{editMode:!0,onAddBinding:l,appliedBindings:c,item:s,children:e.jsxRuntimeExports.jsx(z.EditIcon,{className:"mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white"})}),e.jsxRuntimeExports.jsx(z.TrashIcon,{onClick:()=>r(),className:"mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"})]}),!t.isEmpty(a)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600",children:t.startCase(a)})]})},fe=({bindingData:s,onChange:l})=>{const r=o.useSelectedBlock(),[n]=q.useChaiExternalData(),i=U.getChaiDataProviders(),[c,a]=m.useState(t.map(s,(d,b)=>({key:b,value:d})));m.useEffect(()=>{a(t.map(s,(d,b)=>({key:b,value:d})))},[r==null?void 0:r._id,s]);const x=m.useMemo(()=>{if(t.isEmpty(n))return!0;if(t.isEmpty(c))return!1;const d=t.last(c);return t.isEmpty(d==null?void 0:d.key)||t.isEmpty(d==null?void 0:d.value)},[n,c]),p=d=>{const b=t.filter(c,h=>h.key!==d.key);a([...b,d]),f([...b,d])},y=d=>{const b=t.filter(c,(h,g)=>d!==g);f([...b])},f=m.useCallback((d=[])=>{if(a(d),t.isEmpty(d)){l({});return}const b={};t.forEach(d,h=>{!t.isEmpty(h==null?void 0:h.key)&&!t.isEmpty(h==null?void 0:h.value)&&t.set(b,h.key,h.value)}),l(b)},[l]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 text-xs text-gray-500",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(c,(d,b)=>e.jsxRuntimeExports.jsx(be,{item:d,onAddBinding:p,onRemove:()=>y(b),selectedBlock:r,dataProvider:n,appliedBindings:t.map(c,"key")},d.key)),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{disabled:t.isEmpty(n),className:"w-full",children:e.jsxRuntimeExports.jsx(re,{disabled:x,appliedBindings:t.map(c,"key"),onAddBinding:p,children:e.jsxRuntimeExports.jsx("span",{className:`w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${x?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(n)?e.jsxRuntimeExports.jsx("small",{className:"text-[9.5px] text-gray-500",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),x&&e.jsxRuntimeExports.jsx(o.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(n)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},je=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),W=m.memo(({properties:s,formData:l,onChange:r})=>{const n={type:"object",properties:{}},i={};return Object.keys(s).forEach(c=>{const a=s[c];if(t.includes(["slot","styles"],a.type))return;const x=c;n.properties[x]=o.getBlockJSONFromSchemas(a),i[x]=o.getBlockJSONFromUISchemas(a)}),e.jsxRuntimeExports.jsx(ue,{widgets:{binding:je,richtext:o.RichTextEditorField,icon:o.IconPickerField,image:o.ImagePickerField},fields:{link:o.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator:pe,uiSchema:i,schema:n,formData:l,onChange:r})});function ve(){const s=o.useSelectedBlock(),l=o.useUpdateBlocksPropsRealtime(),r=o.useUpdateBlocksProps(),n=U.getBlockComponent(s._type),i={...s},[c,a]=m.useState(i),x=o.useBuilderProp("dataBindingSupport",!1),p=({formData:g},v,E)=>{if(v){const S=v.replace("root.","");r([s._id],{[S]:t.get(g,S)},E)}},y=m.useCallback(t.debounce(({formData:g},v,E)=>{p({formData:g},v,E),a(g)},1500),[]),f=({formData:g},v)=>{if(v){const E=v.replace("root.","");l([s._id],{[E]:t.get(g,E)}),y({formData:g},v,{[E]:t.get(c,E)})}},d={_name:ae.u({title:"Name",default:t.get(s,"_name",s._type)})},b=t.keys(t.get(i,"_bindings",{})),h=m.useMemo(()=>{const g=t.cloneDeep(t.get(n,"props",{}));return x&&t.each(b,v=>delete g[v]),g},[n,b,x]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(W,{onChange:f,formData:i,properties:d}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),x?e.jsxRuntimeExports.jsxs(o.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"px-4 pt-4",children:e.jsxRuntimeExports.jsx(fe,{bindingData:t.get(s,"_bindings",{}),onChange:g=>{p({formData:{_bindings:g}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(o.AccordionContent,{className:"pt-4",children:[t.isEmpty(b)?null:e.jsxRuntimeExports.jsxs("div",{className:"mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(b,t.capitalize).join(", ")})," ",b.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(W,{onChange:f,formData:i,properties:h})]})]})]}):e.jsxRuntimeExports.jsx(W,{onChange:f,formData:i,properties:h}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const J=new xe(B.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function Re(){var S;const[s]=o.useSelectedStylingBlocks(),l=o.useSelectedBlock(),r=o.useAddClassesToBlocks(),n=o.useRemoveClassesFromBlocks(),[i]=o.useSelectedBlockIds(),[c,a]=m.useState(""),x=(S=t.first(s))==null?void 0:S.prop,p=t.reject((t.get(l,x,"").replace(me.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),y=()=>{const w=c.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,w,!0),a("")},[f,d]=m.useState([]),b=({value:w})=>{const I=w.trim().toLowerCase(),_=I.match(/.+:/g);let C=[];if(_&&_.length>0){const[T]=_,V=I.replace(T,"");C=J.search(V).map(j=>({...j,item:{...j.item,name:T+j.item.name}}))}else C=J.search(I);d(t.map(C,"item"))},h=()=>{d([])},g=w=>w.name,v=w=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:w.name}),E={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:c,onKeyDown:w=>{w.key==="Enter"&&c.trim()!==""&&y()},onChange:(w,{newValue:I})=>a(I),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${f.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(o.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(ce,{suggestions:f,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:h,getSuggestionValue:g,renderSuggestion:v,inputProps:E,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:y,disabled:c.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(p)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),M.Children.toArray(p.map(w=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[w,e.jsxRuntimeExports.jsx(u.Cross2Icon,{onClick:()=>n(i,[w]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},w)))]})]})}const N=["px","%","em","rem","ch","vh","vw"],Ee={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:N,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},we={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},Ce=[{heading:"layout.heading",items:[{type:"arbitrary",label:"layout.width",units:N.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:N.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...N,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"multiple",label:"layout.space_bt",options:[{key:"spaceX",label:"layout.space_lr"},{key:"spaceY",label:"layout.space_tb"}]}]},{heading:"size.heading",items:[{styleType:"accordion",heading:"size.min_width_height",items:[{type:"arbitrary",label:"size.min_width",units:N.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"size.min_height",units:N.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"size.max_width_height",items:[{type:"arbitrary",label:"size.max_width",units:N.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"size.max_height",units:N.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"size.object_options_aspect_ratio",items:[{type:"dropdown",label:"size.aspect",property:"aspectRatio"},{type:"dropdown",label:"size.fit",property:"objectFit"},{type:"dropdown",label:"size.position",property:"objectPosition"}]}]},{heading:"display.heading",items:[{type:"dropdown",label:"display.display",property:"display",units:N},{styleType:"accordion",heading:"display.flex_options",items:[{type:"dropdown",label:"display.flex_direction",property:"flexDirection"},{type:"dropdown",label:"display.flex_wrap",property:"flexWrap"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"display.grid_options",items:[{type:"range",label:"display.grid_columns",property:"gridColumns"},{type:"range",label:"display.grid_rows",property:"gridRows"},{type:"dropdown",label:"display.grid_auto_flow",property:"gridAutoFlow"},{type:"dropdown",label:"display.grid_auto_cols",property:"gridAutoColumns"},{type:"dropdown",label:"display.grid_auto_rows",property:"gridAutoRows"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",units:["px","rem"],options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"display.visibility_opacity",items:[{type:"dropdown",label:"display.visibility",property:"visibility",units:N},{type:"arbitrary",label:"display.opacity",property:"opacity",units:["-"]}]}]},{heading:"position.heading",items:[{type:"icons",label:"position.position",property:"position"},{styleType:"accordion",heading:"position.options",items:[{styleType:"multiple",label:"position.direction",options:[{key:"top",label:"position.top"},{key:"right",label:"position.right"},{key:"bottom",label:"position.bottom"},{key:"left",label:"position.left"}]},{styleType:"multiple",label:"position.inset",options:[{key:"inset",label:"position.all"},{key:"insetX",label:"position.lr"},{key:"insetY",label:"position.tb"}]},{type:"arbitrary",label:"position.z_index",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"position.float_clear",items:[{type:"icons",label:"position.float",property:"float"},{type:"dropdown",label:"position.clear",property:"clear"}]},{styleType:"accordion",heading:"position.overflow_overscroll",items:[{styleType:"multiple",type:"dropdown",label:"position.overflow",options:[{key:"overflow",label:"position.all"},{key:"overflowX",label:"position.lr"},{key:"overflowY",label:"position.tb"}]},{styleType:"multiple",type:"dropdown",label:"position.overscroll",options:[{key:"overscroll",label:"position.all"},{key:"overscrollX",label:"position.lr"},{key:"overscrollY",label:"position.tb"}]}]}]},{heading:"typography.heading",items:[{type:"dropdown",property:"fontFamily",label:"typography.font"},{type:"arbitrary",property:"fontSize",label:"typography.size",units:N},{type:"arbitrary",property:"lineHeight",label:"typography.height",units:N.concat("-")},{type:"range",property:"fontWeight",label:"typography.weight"},{type:"color",property:"textColor",label:"typography.color"},{styleType:"accordion",heading:"typography.alignments",items:[{type:"dropdown",property:"textAlign",label:"typography.align"},{type:"dropdown",property:"verticalAlign",label:"typography.valign"}]},{styleType:"accordion",heading:"typography.spacing_decoration_more",items:[{type:"dropdown",property:"letterSpacing",label:"typography.spacing"},{type:"dropdown",property:"textDecoration",label:"typography.decoration"},{type:"range",property:"textDecorationThickness",label:"typography.thickness"},{type:"dropdown",property:"textTransform",label:"typography.transform"}]},{styleType:"accordion",heading:"typography.whitespace_breaks",items:[{type:"dropdown",property:"whitespace",label:"typography.whitespace"},{type:"dropdown",property:"wordbreak",label:"typography.wordbreak"}]}]},{heading:"background.heading",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{styleType:"accordion",heading:"background.position_size_more",items:[{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]},{type:"dropdown",label:"background.gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"background.gradient_colors",items:[{type:"color",label:"background.from_color",property:"fromColor"},{type:"color",label:"background.via_color",property:"viaColor"},{type:"color",label:"background.to_color",property:"toColor"}]}]},{heading:"border.heading",items:[{styleType:"multiple",type:"dropdown",label:"border.width",options:[{key:"border",label:"border.all"},{key:"borderX",label:"border.lr"},{key:"borderY",label:"border.tb"},{key:"borderTop",label:"border.top"},{key:"borderRight",label:"border.right"},{key:"borderBottom",label:"border.bottom"},{key:"borderLeft",label:"border.left"}]},{styleType:"multiple",type:"dropdown",label:"border.corners",options:[{key:"borderRadius",label:"border.all"},{key:"borderRadiusTop",label:"border.top"},{key:"borderRadiusRight",label:"border.right"},{key:"borderRadiusBottom",label:"border.bottom"},{key:"borderRadiusLeft",label:"border.left"},{key:"borderRadiusTopLeft",label:"border.top_left"},{key:"borderRadiusTopRight",label:"border.top_right"},{key:"borderRadiusBottomRight",label:"border.bottom_right"},{key:"borderRadiusBottomLeft",label:"border.bottom_left"}]},{type:"color",label:"border.color",property:"borderColor"},{type:"dropdown",label:"border.style",property:"borderStyle"},{styleType:"accordion",heading:"border.divide_options",items:[{styleType:"multiple",type:"range",label:"border.width",options:[{key:"divideXWidth",label:"border.lr"},{key:"divideYWidth",label:"border.tb"}]},{type:"color",label:"border.divide_color",property:"divideColor"},{type:"dropdown",label:"border.divide_style",property:"divideStyle"}]},{styleType:"accordion",heading:"border.outline_styling",items:[{type:"range",label:"border.outline_width",property:"outlineWidth"},{type:"range",label:"border.outline_offset",property:"outlineOffset"},{type:"dropdown",label:"border.outline_style",property:"outlineStyle"}]},{styleType:"accordion",heading:"border.ring_options",items:[{type:"range",label:"border.ring_width",property:"ringWidth"},{type:"color",label:"border.ring_color",property:"ringColor"},{type:"range",label:"border.ring_offset_width",property:"ringOffsetWidth"},{type:"color",label:"border.ring_offset_color",property:"ringOffsetColor"}]}]},{heading:"effect.heading",items:[{type:"range",label:"effect.shadow",property:"boxShadow"},{type:"color",label:"effect.color",property:"boxShadowColor"},{type:"dropdown",label:"effect.cursor",property:"cursor"},{styleType:"accordion",heading:"effect.blend_cursor",items:[{type:"dropdown",label:"effect.mix_blend",property:"mixBlendMode"},{type:"dropdown",label:"effect.bg_blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"effect.transform",items:[{type:"dropdown",label:"effect.origin",property:"transformOrigin"},{styleType:"multiple",label:"effect.scale",units:["-"],options:[{key:"scale",label:"effect.all"},{key:"scaleX",label:"effect.lr"},{key:"scaleY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.skew",units:["deg"],options:[{key:"skewX",label:"effect.lr"},{key:"skewY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.translate",negative:!0,options:[{key:"translateX",label:"effect.lr"},{key:"translateY",label:"effect.tb"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"effect.rotate",property:"rotate"}]},{styleType:"accordion",heading:"effect.animation",items:[{type:"dropdown",label:"effect.animation",property:"animation"},{type:"dropdown",label:"effect.transition",property:"transition"},{type:"dropdown",label:"effect.easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"effect.duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"effect.delay",property:"delay"}]}]},{heading:"classes.heading",items:[{component:Re}]}],se={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:u.EyeOpenIcon,invisible:u.EyeClosedIcon,hidden:u.EyeClosedIcon,gap:u.BorderAllIcon,gapX:u.WidthIcon,gapY:u.HeightIcon,spaceX:u.WidthIcon,spaceY:u.HeightIcon,overscroll:u.BorderAllIcon,overscrollX:u.WidthIcon,overscrollY:u.HeightIcon,overflow:u.BorderAllIcon,overflowX:u.WidthIcon,overflowY:u.HeightIcon,top:u.ArrowUpIcon,right:u.ArrowRightIcon,bottom:u.ArrowDownIcon,left:u.ArrowLeftIcon,inset:u.BorderAllIcon,insetX:u.WidthIcon,insetY:u.HeightIcon,border:u.BorderAllIcon,borderX:u.WidthIcon,borderY:u.HeightIcon,borderTop:u.ArrowUpIcon,borderRight:u.ArrowRightIcon,borderBottom:u.ArrowDownIcon,borderLeft:u.ArrowLeftIcon,borderRadius:u.BorderAllIcon,borderRadiusX:u.WidthIcon,borderRadiusY:u.HeightIcon,borderRadiusTop:u.ArrowUpIcon,borderRadiusRight:u.ArrowRightIcon,borderRadiusBottom:u.ArrowDownIcon,borderRadiusLeft:u.ArrowLeftIcon,borderRadiusTopLeft:u.ArrowTopLeftIcon,borderRadiusTopRight:u.ArrowTopRightIcon,borderRadiusBottomRight:u.ArrowBottomRightIcon,borderRadiusBottomLeft:u.ArrowBottomLeftIcon,divideXWidth:u.WidthIcon,divideYWidth:u.HeightIcon,scale:u.BorderAllIcon,scaleX:u.WidthIcon,scaleY:u.HeightIcon,skewX:u.WidthIcon,skewY:u.HeightIcon,translateX:u.WidthIcon,translateY:u.HeightIcon,padding:u.BorderAllIcon,paddingX:u.WidthIcon,paddingY:u.HeightIcon,paddingTop:u.ArrowUpIcon,paddingRight:u.ArrowRightIcon,paddingBottom:u.ArrowDownIcon,paddingLeft:u.ArrowLeftIcon,margin:u.BorderAllIcon,marginX:u.WidthIcon,marginY:u.HeightIcon,marginTop:u.ArrowUpIcon,marginRight:u.ArrowRightIcon,marginBottom:u.ArrowDownIcon,marginLeft:u.ArrowLeftIcon,textLeft:u.AlignLeftIcon,textCenter:u.AlignCenterHorizontallyIcon,textRight:u.AlignRightIcon,textJustify:u.StretchHorizontallyIcon,italic:u.FontItalicIcon,underline:u.UnderlineIcon,overline:u.OverlineIcon,uppercase:u.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":u.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:u.Cross1Icon},$=m.createContext({canReset:!1,canChange:!0}),ke=({children:s,canReset:l=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx($.Provider,{value:{canReset:l,canChange:r},children:s}),oe=({label:s,property:l,onChange:r})=>{const n=m.useMemo(()=>t.get(B.CLASSES_LIST,`${l}.classes`,[""]),[l]),i=L(l),c=m.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:a}=m.useContext($),x=/\[.*\]/g.test(c);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded":"grow",children:x?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:c}),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(Z,{rounded:s,onChange:p=>r(p,l),selected:c,options:n,disabled:!a})})};function Z({selected:s,onChange:l,rounded:r=!1,options:n,disabled:i=!1}){const c=s.replace(/.*:/g,"").trim(),{undo:a,redo:x}=o.useUndoManager();return e.jsxRuntimeExports.jsxs("select",{disabled:!n.length||i,className:`${r?"rounded-md border border-border":"border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:p=>l(p.target.value),onKeyDown:p=>{p.ctrlKey&&(p.key==="z"&&a(),p.key==="y"&&x())},value:c,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),m.Children.toArray(n.map(p=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:p,children:p})))]})}const Ne=({property:s,onChange:l})=>{const{canReset:r,canChange:n}=m.useContext($),i=L(s),c=m.useMemo(()=>t.get(i,"cls",""),[i]),a=m.useMemo(()=>t.get(B.CLASSES_LIST,`${s}.classes`,[""]),[s]),x=a.indexOf(c)>-1?a.indexOf(c):0,p=/\[.*\]/g.test(c);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:p?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:c}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!n&&(!r||x-1<0),onClick:()=>l(t.nth(a,x-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.MinusIcon,{className:!n&&(!r||x-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(oe,{label:!1,property:s,onChange:l})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!n&&(!r||x+1>=a.length),onClick:()=>l(t.nth(a,x+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{className:!n&&(!r||x+1>=a.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},Se=({property:s,onChange:l})=>{const r=m.useMemo(()=>t.get(B.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:n}=m.useContext($),i=L(s),c=m.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,a=>e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!n,onClick:()=>l(a,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${c===a?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:m.createElement(t.get(se,a,u.BoxIcon))})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(a))})]}))})},Te={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Ie=({property:s,onChange:l})=>{const r=L(s),n=m.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=m.useContext($),[c,a]=m.useState([]),[x,p]=m.useState({color:"",shade:""}),y=n.split("-"),f=t.get(y,"1",""),d=t.get(y,"2",""),b=m.useCallback(g=>{["current","inherit","transparent","black","white"].includes(g)?(a([]),p({color:g})):(a(["50","100","200","300","400","500","600","700","800","900"]),p(v=>({...v,color:g,shade:v.shade?v.shade:"500"})))},[a,p]);m.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(f))return a([]);a(["50","100","200","300","400","500","600","700","800","900"])},[f]);const h=m.useCallback(g=>{p({color:f,shade:g})},[f]);return m.useEffect(()=>{p({color:"",shade:""})},[r]),m.useEffect(()=>{const v=`${t.get(Te,s,"")}-${x.color}${x.shade?`-${x.shade}`:""}`;v.match(new RegExp(t.get(B.CLASSES_LIST,`${s}.regExp`,"")))&&l(v,s)},[x,l,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(Z,{disabled:!i,rounded:!0,selected:f,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(Z,{rounded:!0,selected:d,disabled:!f||!i,onChange:h,options:c})})]})},Q=(s,l)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&l.includes(r))return{value:"",unit:r};const n=l.length?new RegExp(l.join("|"),"g"):/XXXXXX/g;r=r.replace(n,"");const i=s.match(n),c=i&&i.length>1,a=!t.isEmpty(r)&&Number.isNaN(Number(r));return c||a?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}};const _e=s=>{const l=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${l}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${l}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${l}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${l}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const n=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(n)return{value:n[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[n,i]=t.map(r.split("/"),c=>parseInt(c,10));return{value:l+(n/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${l+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}};const He=s=>{if(t.isEmpty(s))return{value:"",unit:""};const l=s.match(/\[.*\]/g);if(l===null)return Ve(s);const r=t.get(l,"0","").replace(/\[|\]/g,""),n=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${n}${i}`,unit:r.replace(i,"")}},Ve=s=>t.isEmpty(s)?{value:"",unit:""}:_e(s),ne=m.createContext({setDragData:()=>{}}),Ae=({unit:s,currentValue:l,onDrag:r,onDragEnd:n,onDragStart:i,negative:c,cssProperty:a})=>{const{setDragData:x}=m.useContext(ne);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:p=>{const y={onDrag:r,onDragEnd:n,dragging:!0,dragStartY:p.pageY,dragStartValue:`${l}`,dragUnit:s,negative:c,cssProperty:a};i(y),x(y)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(u.RowSpacingIcon,{})})},Be=({onSelect:s,current:l,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(n=>e.jsxRuntimeExports.jsx(o.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:l===n?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(n)},children:n},n))}),ee=50,De=s=>{const[l,r]=m.useState(!1),[n,i]=m.useState(""),{currentClass:c,onChange:a,classPrefix:x,cssProperty:p,units:y,negative:f}=s,[d,b]=m.useState(p!=null&&p.toLowerCase().includes("width")?"%":y[0]),[h,g]=m.useState(!1),[v,E]=m.useState(""),[S,w]=m.useState(!1),[I,_]=m.useState(!1);m.useEffect(()=>{const{value:j,unit:R}=He(c);if(R===""){i(j),b(p!=null&&p.toLowerCase().includes("width")?"%":t.first(y));return}b(R),i(R==="class"||t.isEmpty(j)?"":j)},[c,p,y]);const C=Y.useThrottledCallback(j=>a(j),[a],ee),T=Y.useThrottledCallback(j=>a(j,!1),[a],ee),V=m.useCallback((j=!1)=>{const R=Q(`${n}`,y);if(t.get(R,"error",!1)){g(!0);return}const k=t.get(R,"unit")!==""?t.get(R,"unit"):d;if(k==="auto"||k==="none"){C(`${x}${k}`);return}if(t.get(R,"value")==="")return;const P=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;j?T(P):C(P)},[C,T,n,d,x,y]),D=m.useCallback(j=>{const R=Q(`${n}`,y);if(t.get(R,"error",!1)){g(!0);return}if(j==="auto"||j==="none"){C(`${x}${j}`);return}if(t.get(R,"value")==="")return;const k=t.get(R,"unit")!==""?t.get(R,"unit"):j,P=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;C(P)},[C,n,x,y]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:d==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:c}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${S?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(d)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:d==="class",onKeyPress:j=>{j.key==="Enter"&&V()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),_(!0);const R=t.parseInt(j.target.value);let k=t.isNaN(R)?0:R;j.keyCode===38&&(k+=1),j.keyCode===40&&(k-=1);const H=`${k}`,le=`${H.startsWith("-")?"-":""}${x}[${H.replace("-","")}${d==="-"?"":d}]`;T(le)},onKeyUp:j=>{I&&(j.preventDefault(),_(!1))},onBlur:()=>V(),onChange:j=>{g(!1),i(j.target.value)},onClick:j=>{var R;(R=j==null?void 0:j.target)==null||R.select(),r(!1)},value:S?v:n,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",h?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(o.Tooltip,{open:l,delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!l),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${y.length===1?"px-2 font-semibold":""}`,children:d}),y.length>1?e.jsxRuntimeExports.jsx(u.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(o.TooltipPortal,{children:e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(Be,{units:y,current:d,onSelect:j=>{r(!1),b(j),D(j)}})})})]})]}),["none","auto"].indexOf(d)!==-1||S?null:e.jsxRuntimeExports.jsx(Ae,{onDragStart:()=>w(!0),onDragEnd:j=>{if(E(()=>""),w(!1),t.isEmpty(j))return;const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${d==="-"?"":d}]`;C(H)},onDrag:j=>{if(t.isEmpty(j))return;E(j);const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${d==="-"?"":d}]`;T(H)},currentValue:n,unit:d,negative:f,cssProperty:p})]})})})},L=s=>{const l=o.useSelectedBlockCurrentClasses();return t.findLast(l,{property:s})},Pe=(s,l)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[l]},$e={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},te={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Le=s=>`${s.toUpperCase()} ${te[s]?`(${te[s]} & up)`:""}`,K=s=>{const{t:l}=A.useTranslation(),{type:r="icons",label:n,property:i,onEmitChange:c=()=>{},units:a,negative:x=!1}=s,[p]=o.useDarkMode(),[y]=o.useStylingState(),[,f]=o.useCanvasWidth(),d=L(i),b=o.useAddClassesToBlocks(),h=o.useRemoveClassesFromBlocks(),[g]=o.useSelectedBlockIds(),v=m.useMemo(()=>t.get(d,"fullCls",""),[d]),E=m.useCallback((T,V=!0)=>{const D={dark:p,mq:f,mod:y,cls:T,property:i,fullCls:""};(p||y!=="")&&(D.mq="xs");const j=B.generateFullClsName(D);b(g,[j],V)},[g,p,f,y,i,b]),S=m.useCallback(()=>{h(g,[v])},[g,v,h]),w=m.useMemo(()=>Pe(d,f),[d,f]);m.useEffect(()=>{c(w,d)},[w,c,d]);const[,,I]=o.useCanvasWidth(),_=m.useCallback(T=>{I({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[T])},[I]),C=t.get(d,"dark",null)===p&&t.get(d,"mod",null)===y&&t.get(d,"mq",null)===f;return e.jsxRuntimeExports.jsx(ke,{canChange:w,canReset:d&&C,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${d&&!C?"text-foreground":""}`,children:l(n)})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[r==="arbitrary"?e.jsxRuntimeExports.jsx(De,{currentClass:t.get(d,"cls",""),classPrefix:t.get($e,i,""),units:a||[],onChange:E,negative:x,cssProperty:i}):null,r==="icons"&&e.jsxRuntimeExports.jsx(Se,{property:i,onChange:E}),r==="range"&&e.jsxRuntimeExports.jsx(Ne,{property:i,onChange:E}),r==="color"&&e.jsxRuntimeExports.jsx(Ie,{property:i,onChange:E}),r==="dropdown"&&e.jsxRuntimeExports.jsx(oe,{label:n,property:i,onChange:E})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${v?"visible":"invisible"}`,children:C?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>S(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(u.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):w&&d?e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at  ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold",children:[Le(t.get(d,"mq")),p&&!d.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>_(t.get(d,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(d,"mq").toUpperCase()]})]})})})]}):null})]})]})})},Me=["px","%","em","rem","ch","vh","vw"],ie=({label:s,options:l,borderB:r=!1,borderT:n=!1,type:i="arbitrary",units:c=Me,negative:a=!1})=>{const{t:x}=A.useTranslation(),[p,y]=m.useState(l[0].key),f=o.useSelectedBlockCurrentClasses(),d=m.useCallback(b=>t.map(f,"property").includes(b),[f]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${n?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:x(s)}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:m.Children.toArray(l.map(({label:b,key:h})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>y(h),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${h===p?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[m.createElement("div",{className:d(h)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),m.createElement(t.get(se,h,u.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(b))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(K,{type:i,units:[...c],label:"",property:p,negative:a})})]})},qe=({heading:s,items:l})=>{const{t:r}=A.useTranslation(),n=o.useSelectedBlockCurrentClasses(),i=m.useMemo(()=>{const c=p=>t.flatten(p.map(y=>y.styleType==="multiple"?t.map(y.options,"key"):y.property)),a=t.flatten(l.map(p=>p.styleType==="accordion"?c(p.items):p.styleType==="multiple"?t.map(p.options,"key"):p.property)),x=t.map(n,"property");return t.intersection(a,x).length>0},[n,l]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[r(s),i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:l.map(c=>c.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...c},c.label):e.jsxRuntimeExports.jsx(K,{...c},c.label))})]})},Oe=m.createContext({}),F=({section:s})=>{const{t:l}=A.useTranslation(),r=o.useSelectedBlockCurrentClasses(),n=m.useCallback((a=[])=>{const x={};for(let y=0;y<r.length;y++)x[r[y].property]=r[y].cls;let p=!0;for(const y in a)if(!t.has(x,y)||x[y]!==a[y]){p=!1;break}return p},[r]),i=m.useMemo(()=>{if(r.length>0&&s.heading==="classes.heading")return!0;const a=y=>t.flatten(y.map(f=>f.styleType==="multiple"?t.flatten(t.map(f.options,"key")):f.property)),x=t.flatten(s.items.map(y=>y.styleType==="accordion"?a(y.items):y.styleType==="multiple"?t.flatten(t.map(y.options,"key")):y.property)),p=t.map(r,"property");return t.intersection(x,p).length>0},[r,s.heading,s.items]),c=m.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Oe.Provider,{value:c,children:e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),l(s.heading)]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:m.Children.toArray(s.items.map(a=>t.has(a,"component")?m.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...a},a.label):a.styleType==="accordion"&&n(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(qe,{...a},a.label):null:e.jsxRuntimeExports.jsx(K,{...a},a.label)))})]})})},We=({item:s,index:l,canDelete:r,onChange:n,onRemove:i})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${r?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:c=>n(c,l),value:s.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:c=>t.isEmpty(s.key)?{}:n(c,l),value:s.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(u.TrashIcon,{onClick:i,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),Fe=({section:s})=>{var b;const{setSyncState:l}=o.useSavePage(),r=o.useSelectedBlock(),[n,i]=m.useState([]),[c]=o.useSelectedStylingBlocks(),a=o.useUpdateBlocksPropsRealtime(),x=`${t.get(c,"0.prop")}_attrs`;M.useEffect(()=>{const h=t.map(t.get(r,x),(g,v)=>({key:v,value:g}));t.isEmpty(h)?i([]):i(h)},[t.get(r,x)]);const p=()=>i([...n,{key:"",value:""}]),y=h=>{const g=t.filter(n,(v,E)=>h!==E);d(g)},f=(h,g)=>{const v=[...n];v[g][h.target.name]=h.target.value,d(v)},d=M.useCallback((h=[])=>{const g={};t.forEach(h,v=>{t.isEmpty(v.key)||t.set(g,v.key,v.value)}),a([t.get(r,"_id")],{[x]:g}),l("UNSAVED")},[r,l,a,x]);return e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,x))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(o.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(n)&&t.isEmpty((b=t.last(n))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var h;!t.isEmpty(n)&&t.isEmpty((h=t.last(n))==null?void 0:h.key)||p()},children:[e.jsxRuntimeExports.jsx(u.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),M.Children.toArray(t.map(n,(h,g)=>{const v=n.length>0&&g<n.length-1;return e.jsxRuntimeExports.jsx(We,{item:h,index:g,canDelete:v,onChange:f,onRemove:()=>y(g)})}))]})]})})]})};function Ye(){const[s,l]=o.useStylingState(),{flexChild:r,gridChild:n}=o.useSelectedBlocksDisplayChild(),[,i]=de.useAtom(o.advanceStylingOpenAtom),{t:c}=A.useTranslation(),[a]=o.useSelectedStylingBlocks();return t.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:c("no_styling_block_selected")})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>i(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex h-12 flex-col space-x-4 space-y-3 border-b border-border px-4 py-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(o.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(o.Select,{defaultValue:s,onValueChange:x=>l(x),children:[e.jsxRuntimeExports.jsx(o.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(o.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(o.SelectContent,{children:[e.jsxRuntimeExports.jsx(o.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden",children:e.jsxRuntimeExports.jsxs(o.Accordion,{defaultValue:["Layout"],type:"multiple",className:"w-full",children:[r&&e.jsxRuntimeExports.jsx(F,{section:Ee}),n?e.jsxRuntimeExports.jsx(F,{section:we}):null,Ce.map(x=>e.jsxRuntimeExports.jsx(F,{section:x},x.heading)),e.jsxRuntimeExports.jsx(Fe,{section:{heading:"Attributes"}})]})})]})}const ze={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},Xe=()=>{const s=o.useSelectedBlock(),{t:l}=A.useTranslation(),[r,n]=m.useState(""),[i,c]=m.useState({onDrag:p=>p,onDragEnd:p=>p,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),a=Y.useThrottledCallback(p=>{const y=!t.get(i,"negative",!1),f=t.get(i,"cssProperty","");let d=parseFloat(i.dragStartValue);d=t.isNaN(d)?0:d;let b=ze[i.dragUnit];(t.startsWith(f,"scale")||f==="opacity")&&(b=10);let g=(i.dragStartY-p.pageY)/b+d;y&&g<0&&(g=0),f==="opacity"&&g>1&&(g=1),i.onDrag(`${g}`),n(`${g}`)},[i],50),x=m.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),c({onDrag:p=>p,onDragEnd:p=>p,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,c]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:l("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(q.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs(ne.Provider,{value:{setDragData:c},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:a,onMouseUp:()=>x(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"}):null,e.jsxRuntimeExports.jsxs(o.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(o.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"settings",children:l("settings")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"styling",children:l("styling")})]}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"settings",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5",children:e.jsxRuntimeExports.jsx(ve,{})})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"styling",className:"h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Ye,{})})]})]})})};exports.default=Xe;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("@radix-ui/react-icons"),i=require("react"),k=require("jotai"),a=require("lodash-es"),s=require("./index-TEfD-2ti.cjs"),g=require("lucide-react"),C=require("@chaibuilder/runtime"),q=require("react-i18next"),b=require("./index-gi1LIOCw.cjs"),P=require("./index-XVud0HL8.cjs"),T=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-TF2kd-0X.cjs");const D=({provider:t,onClose:x})=>{const{t:n}=q.useTranslation(),[l,p]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(u=>p(u))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:c=>c?"":x(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[n("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(P.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(b.JsonView,{data:l,shouldExpandNode:b.allExpanded,style:{...b.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function A({children:t,name:x,onRemove:n}){const{t:l}=q.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:l("remove_provider_confirmation").replace("{name}",x)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:l("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:l("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:n,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const _=()=>{const{t}=q.useTranslation(),x=i.useMemo(()=>C.getChaiDataProviders(),[]),[n,l]=s.usePageDataProviders(),[,p]=k.useAtom(s.pageSyncStateAtom),[c,u]=i.useState(a.filter(x,r=>a.map(n,"providerKey").includes(r.providerKey))),[E,v]=i.useState(""),[d,f]=i.useState(null),R=a.filter(x.map(r=>a.map(c,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!a.isNull(r)),o=r=>{const j=a.find(x,{providerKey:r});u(m=>[...m,j]),l(m=>[...m,{providerKey:j.providerKey,args:{}}]),v(""),p("UNSAVED")},h=r=>{u(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),l(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),p("UNSAVED")},S=r=>f(r);return a.isEmpty(x)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:E,onValueChange:r=>o(r),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:t("choose")}),R.map(r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.value,children:r.label},r.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${c.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500",children:[t("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:c.map(r=>e.jsxRuntimeExports.jsxs("div",{className:"w-full rounded-lg border bg-card text-card-foreground shadow-sm","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:r.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:r.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>S(r),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),t("view_data")]}),e.jsxRuntimeExports.jsx(A,{onRemove:()=>h(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(D,{onClose:()=>f(null),provider:d})]})]})},B=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-nMUkm4og.cjs"))),y=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-4r_4F6ST.cjs"))),z=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-eeDfvB0R.cjs"))),I=i.lazy(()=>Promise.resolve().then(()=>require("./index-TEfD-2ti.cjs")).then(t=>t.ImagesPanel));let N=null;const K=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[n,l]=k.useAtom(s.activePanelAtom),[p,c]=i.useState(n),[u,E]=i.useState(null),v={"add-blocks":B,layers:y,"branding-options":z,images:I};a.each(t,({name:o,panel:h})=>{v[o]=h});const d=o=>{clearTimeout(N),n!=="layers"&&o==="layers"?N=setTimeout(()=>l("layers"),500):c(o),l(o)},f=s.useBuilderProp("dataBindingSupport",!1);function R(){const o=setTimeout(()=>{u&&(d("layers"),clearTimeout(u))},500);E(o)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!=="layers"?e.jsxRuntimeExports.jsx("div",{onMouseEnter:R,onClick:()=>d("layers"),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{d("add-blocks")},size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("layers"),size:"sm",variant:n==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("branding-options"),size:"sm",variant:n==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:o,icon:h})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(o),size:"sm",className:"w-10",variant:n===o?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(x.map(o=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(o,{})})))})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${n!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:T.cn("relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",n==="layers"?"":"z-[100]"),onMouseEnter:()=>{u&&clearTimeout(u)},children:i.createElement(a.get(v,n,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:f?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"mr-2 h-3"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(g.DatabaseIcon,{className:"mr-2 w-3"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(_,{})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md bg-gray-200 py-1",children:[e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"ml-2 mr-2 h-4"})," Layers"]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)})]})})})]})};exports.default=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("@radix-ui/react-icons"),i=require("react"),k=require("jotai"),a=require("lodash-es"),s=require("./index-bfKqnRvZ.cjs"),g=require("lucide-react"),C=require("@chaibuilder/runtime"),q=require("react-i18next"),b=require("./index-gi1LIOCw.cjs"),P=require("./index-TBa4RPnS.cjs"),T=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const D=({provider:t,onClose:x})=>{const{t:n}=q.useTranslation(),[l,p]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(u=>p(u))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:c=>c?"":x(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[n("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(P.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(b.JsonView,{data:l,shouldExpandNode:b.allExpanded,style:{...b.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function A({children:t,name:x,onRemove:n}){const{t:l}=q.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:l("remove_provider_confirmation").replace("{name}",x)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:l("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:l("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:n,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const _=()=>{const{t}=q.useTranslation(),x=i.useMemo(()=>C.getChaiDataProviders(),[]),[n,l]=s.usePageDataProviders(),[,p]=k.useAtom(s.pageSyncStateAtom),[c,u]=i.useState(a.filter(x,r=>a.map(n,"providerKey").includes(r.providerKey))),[E,v]=i.useState(""),[d,f]=i.useState(null),R=a.filter(x.map(r=>a.map(c,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!a.isNull(r)),o=r=>{const j=a.find(x,{providerKey:r});u(m=>[...m,j]),l(m=>[...m,{providerKey:j.providerKey,args:{}}]),v(""),p("UNSAVED")},h=r=>{u(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),l(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),p("UNSAVED")},S=r=>f(r);return a.isEmpty(x)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:E,onValueChange:r=>o(r),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:t("choose")}),R.map(r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.value,children:r.label},r.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${c.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500",children:[t("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:c.map(r=>e.jsxRuntimeExports.jsxs("div",{className:"w-full rounded-lg border bg-card text-card-foreground shadow-sm","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:r.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:r.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>S(r),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),t("view_data")]}),e.jsxRuntimeExports.jsx(A,{onRemove:()=>h(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(D,{onClose:()=>f(null),provider:d})]})]})},B=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-tomDo_Is.cjs"))),y=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-tasAbEc8.cjs"))),z=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-BUmE4f72.cjs"))),I=i.lazy(()=>Promise.resolve().then(()=>require("./index-bfKqnRvZ.cjs")).then(t=>t.ImagesPanel));let N=null;const K=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[n,l]=k.useAtom(s.activePanelAtom),[p,c]=i.useState(n),[u,E]=i.useState(null),v={"add-blocks":B,layers:y,"branding-options":z,images:I};a.each(t,({name:o,panel:h})=>{v[o]=h});const d=o=>{clearTimeout(N),n!=="layers"&&o==="layers"?N=setTimeout(()=>l("layers"),500):c(o),l(o)},f=s.useBuilderProp("dataBindingSupport",!1);function R(){const o=setTimeout(()=>{u&&(d("layers"),clearTimeout(u))},500);E(o)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!=="layers"?e.jsxRuntimeExports.jsx("div",{onMouseEnter:R,onClick:()=>d("layers"),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{d("add-blocks")},size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("layers"),size:"sm",variant:n==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("branding-options"),size:"sm",variant:n==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:o,icon:h})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(o),size:"sm",className:"w-10",variant:n===o?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(x.map(o=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(o,{})})))})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${n!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:T.cn("relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",n==="layers"?"":"z-[100]"),onMouseEnter:()=>{u&&clearTimeout(u)},children:i.createElement(a.get(v,n,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:f?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"mr-2 h-3"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(g.DatabaseIcon,{className:"mr-2 w-3"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(_,{})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md bg-gray-200 py-1",children:[e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"ml-2 mr-2 h-4"})," Layers"]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)})]})})})]})};exports.default=K;
@@ -3,12 +3,12 @@ import { PlusIcon as V, Half2Icon as M } from "@radix-ui/react-icons";
3
3
  import h, { useState as x, useEffect as H, useMemo as I, lazy as y, Suspense as j } from "react";
4
4
  import { useAtom as z } from "jotai";
5
5
  import { filter as g, map as _, isNull as L, find as F, isEmpty as R, each as q, get as J } from "lodash-es";
6
- import { ad as O, ae as U, af as $, ag as G, ah as Z, A as Q, z as W, C as X, D as Y, E as ee, F as se, G as re, H as ae, ai as le, o as te, q as ie, aj as oe, ak as ne, al as ce, am as de, an as P, i as k, ao as me, B as b, S, ap as xe, aq as pe, ar as T, as as E } from "./index-0m8Zuv5X.js";
6
+ import { ad as O, ae as U, af as $, ag as G, ah as Z, A as Q, z as W, C as X, D as Y, E as ee, F as se, G as re, H as ae, ai as le, o as te, q as ie, aj as oe, ak as ne, al as ce, am as de, an as P, i as k, ao as me, B as b, S, ap as xe, aq as pe, ar as T, as as E } from "./index-m9VziIOy.js";
7
7
  import { ListTreeIcon as C, DatabaseIcon as ue } from "lucide-react";
8
8
  import { getChaiDataProviders as he } from "@chaibuilder/runtime";
9
9
  import { useTranslation as A } from "react-i18next";
10
10
  import { J as fe, a as ve, d as je } from "./index-e0c8PmRQ.js";
11
- import { E as ge } from "./index-19nTm_cE.js";
11
+ import { E as ge } from "./index-DXznIJrr.js";
12
12
  import { c as be } from "./Functions-7jnEwJyw.js";
13
13
  import "./_commonjsHelpers-UyOWmZb0.js";
14
14
  import "flat-to-nested";
@@ -51,7 +51,7 @@ import "sonner";
51
51
  import "./html-to-json-57841sEK.js";
52
52
  import "himalaya";
53
53
  import "./web-blocks.js";
54
- import "./empty-slot-MWycClTb.js";
54
+ import "./empty-slot-5FRrRq1E.js";
55
55
  const ye = ({ provider: r, onClose: i }) => {
56
56
  const { t: a } = A(), [t, p] = x(null);
57
57
  return H(() => {
@@ -208,7 +208,7 @@ const Ne = () => {
208
208
  /* @__PURE__ */ e.jsx(ye, { onClose: () => v(null), provider: c })
209
209
  ] })
210
210
  ] });
211
- }, ke = y(() => import("./AddBlocks-ByeMUUzE.js")), D = y(() => import("./Layers-d-xge4On.js")), Ce = y(() => import("./BrandingOptions--poS5shs.js")), De = y(() => import("./index-0m8Zuv5X.js").then((r) => r.cq));
211
+ }, ke = y(() => import("./AddBlocks-zN5--UP6.js")), D = y(() => import("./Layers-JoV3wull.js")), Ce = y(() => import("./BrandingOptions-LbizrmRI.js")), De = y(() => import("./index-m9VziIOy.js").then((r) => r.cq));
212
212
  let K = null;
213
213
  const As = () => {
214
214
  const r = k("sideBarComponents.top", []), i = k("sideBarComponents.bottom", []), [a, t] = z(me), [p, n] = x(a), [o, w] = x(null), f = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),l=require("@radix-ui/react-icons"),r=require("./index-TEfD-2ti.cjs"),a=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");const o=()=>r.useBuilderProp("languages",["en"]),c=()=>o().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(l.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),p=()=>{const{savePage:i,syncState:s}=r.useSavePage(),{t:x}=a.useTranslation(),u=n.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[s]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),i()},className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${u}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),s==="SAVING"?"Saving...":s==="SAVED"?x("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:s==="SAVING"?"Saving...":s==="SAVED"?"Saved":"Save changes"})})]})})},m=()=>{const i=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),x=r.useBuilderProp("topBarComponents.right",[]),u=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(c,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(p,{}):null,n.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),l=require("@radix-ui/react-icons"),r=require("./index-bfKqnRvZ.cjs"),a=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");const o=()=>r.useBuilderProp("languages",["en"]),c=()=>o().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(l.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),p=()=>{const{savePage:i,syncState:s}=r.useSavePage(),{t:x}=a.useTranslation(),u=n.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[s]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),i()},className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${u}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),s==="SAVING"?"Saving...":s==="SAVED"?x("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:s==="SAVING"?"Saving...":s==="SAVED"?"Saved":"Save changes"})})]})})},m=()=>{const i=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),x=r.useBuilderProp("topBarComponents.right",[]),u=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(c,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(p,{}):null,n.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=m;
@@ -1,7 +1,7 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import o, { useMemo as m, Suspense as c } from "react";
3
3
  import { FontFamilyIcon as x } from "@radix-ui/react-icons";
4
- import { i as a, aj as d, ak as h, al as u, am as j, at as g, au as v, an as r, a9 as f, av as S, aw as b, B as N, ax as w, S as p, ay as y } from "./index-0m8Zuv5X.js";
4
+ import { i as a, aj as d, ak as h, al as u, am as j, at as g, au as v, an as r, a9 as f, av as S, aw as b, B as N, ax as w, S as p, ay as y } from "./index-m9VziIOy.js";
5
5
  import { useTranslation as C } from "react-i18next";
6
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
7
  import "lodash-es";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-TEfD-2ti.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");const g=async(d,E)=>new Promise((a,n)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>n(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[c,q]=o.useState(0),[u,S]=o.useState(),[x,b]=o.useState(),[I,R]=o.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=o.useState(!1),P=async s=>{if(l.isEmpty(j))return;let i=c+1;s&&(s.preventDefault(),i=1),m(!0),q(i);const p={query:j,page:i};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(i===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...n,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(j)&&a){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,a).then(i=>{var p,r;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),R((r=i==null?void 0:i.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,a]),l.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"}),"  Loading..."]}),!l.isEmpty(n)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-bfKqnRvZ.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");const g=async(d,E)=>new Promise((a,n)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>n(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[c,q]=o.useState(0),[u,S]=o.useState(),[x,b]=o.useState(),[I,R]=o.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=o.useState(!1),P=async s=>{if(l.isEmpty(j))return;let i=c+1;s&&(s.preventDefault(),i=1),m(!0),q(i);const p={query:j,page:i};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(i===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...n,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(j)&&a){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,a).then(i=>{var p,r;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),R((r=i==null?void 0:i.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,a]),l.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"}),"  Loading..."]}),!l.isEmpty(n)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;