@chaibuilder/sdk 1.2.93 → 1.2.95

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 (44) hide show
  1. package/dist/{CodeEditor-7AhH7ll8.js → CodeEditor-rsNTHAnV.js} +28 -30
  2. package/dist/CodeEditor-sMmjIL-u.cjs +1 -0
  3. package/dist/{Topbar-X_79oQQf.js → Topbar-TkCq6YMq.js} +19 -21
  4. package/dist/Topbar-f4B5oRp1.cjs +1 -0
  5. package/dist/{UnsplashImages-TlLU5BkT.js → UnsplashImages-Ax3Ik6fg.js} +33 -35
  6. package/dist/UnsplashImages-vCpHQ4up.cjs +1 -0
  7. package/dist/{UploadImages-GiKofaXX.js → UploadImages-Jar31A7w.js} +62 -37
  8. package/dist/UploadImages-KO8wFdE8.cjs +1 -0
  9. package/dist/{context-menu-yLeOsx9j.js → context-menu-9cWJcKdh.js} +463 -427
  10. package/dist/context-menu-sQn7ryJ6.cjs +1 -0
  11. package/dist/core.cjs +1 -1
  12. package/dist/core.js +77 -79
  13. package/dist/iconBase-HBZkvN04.js +330 -0
  14. package/dist/iconBase-kuD_VwQx.cjs +1 -0
  15. package/dist/index-cUydM1n4.cjs +223 -0
  16. package/dist/{index-GjgkZP8W.js → index-esmAeUzA.js} +9012 -7760
  17. package/dist/{plugin-BXpjdQxx.cjs → plugin-P0tpo_XZ.cjs} +1 -1
  18. package/dist/plugin-_F-KZp1i.cjs +1 -0
  19. package/dist/{plugin-DdKuAR7p.js → plugin-f5uJtdXY.js} +1 -1
  20. package/dist/plugin-sJ3Hzvpv.js +57 -0
  21. package/dist/render.cjs +2 -2
  22. package/dist/render.js +6 -7
  23. package/dist/style.css +1 -1
  24. package/dist/tailwind.cjs +1 -1
  25. package/dist/tailwind.js +6 -7
  26. package/dist/ui.cjs +1 -1
  27. package/dist/ui.js +112 -113
  28. package/dist/web-blocks.cjs +1 -1
  29. package/dist/web-blocks.js +235 -265
  30. package/package.json +1 -1
  31. package/dist/CodeEditor-Iy57NpaR.cjs +0 -1
  32. package/dist/Topbar-oXx57vCi.cjs +0 -1
  33. package/dist/UnsplashImages-smJeXVat.cjs +0 -1
  34. package/dist/UploadImages-Ic_iZgWY.cjs +0 -1
  35. package/dist/_commonjsHelpers-f3sTPFkQ.js +0 -8
  36. package/dist/_commonjsHelpers-f52AuuUj.cjs +0 -1
  37. package/dist/button-9Duvj2dH.js +0 -42
  38. package/dist/button-oQgWN0j0.cjs +0 -1
  39. package/dist/context-menu-8MWP_Ikf.cjs +0 -1
  40. package/dist/iconBase-BnEC5_qG.js +0 -1583
  41. package/dist/iconBase-_bgMuxa5.cjs +0 -1
  42. package/dist/index-f5CPA351.cjs +0 -223
  43. package/dist/plugin-02QsHeBE.cjs +0 -1
  44. package/dist/plugin-VDzc8jUO.js +0 -52
package/dist/ui.js CHANGED
@@ -2,18 +2,15 @@ import { j as o } from "./jsx-runtime-Sp0orL4X.js";
2
2
  import * as n from "react";
3
3
  import * as m from "@radix-ui/react-toggle";
4
4
  import { cva as c } from "class-variance-authority";
5
- import { c as r } from "./button-9Duvj2dH.js";
6
- import { B as ye, b as Ne } from "./button-9Duvj2dH.js";
7
- import { G as we, J as Se, H as Me, I as je, _ as De, a6 as Te, a5 as Re, $ as Ie, a3 as Ae, a4 as ke, a0 as Pe, a1 as ze, a2 as Ge, ac as Le, f as He, i as Ve, h as Fe, k as Be, g as Ee, al as Oe, t as qe, ay as Je, w as Ke, x as _e, u as Qe, y as Ue, v as We, aA as Xe, az as Ye, C as Ze, aB as $e, b as ea, aG as aa, c as ta, aD as oa, aH as sa, aL as ra, aC as na, aE as ia, aF as da, aI as la, aJ as ca, aK as ma, a as pa, D as ua, m as fa, p as ga, q as xa, n as ba, o as ha, l as Ca, O as ya, a7 as Na, R as va, X as wa, Y as Sa, V as Ma, ar as ja, av as Da, aq as Ta, W as Ra, Z as Ia, as as Aa, at as ka, au as Pa, Q as za, a8 as Ga, aa as La, a9 as Ha, M as Va, L as Fa, P as Ba, s as Ea, r as Oa, U as qa, am as Ja, ad as Ka, ag as _a, an as Qa, ah as Ua, ao as Wa, ap as Xa, ae as Ya, af as Za, ab as $a, S as et, F as at, z as tt, E as ot, A as st, B as rt, j as nt, aj as it, T as dt, e as lt, N as ct, ai as mt, d as pt, ak as ut, aw as ft, ax as gt, K as xt } from "./context-menu-yLeOsx9j.js";
5
+ import { al as r } from "./context-menu-9cWJcKdh.js";
6
+ import { H as ye, K as Ne, I as ve, J as we, $ as Se, a7 as Me, a6 as je, a0 as De, a4 as Te, a5 as Re, a1 as Ie, a2 as Ae, a3 as ke, ad as Pe, B as ze, f as Ge, i as Le, h as He, k as Ve, g as Fe, ao as Be, t as Oe, aB as Ee, w as qe, x as Je, u as Ke, y as _e, v as Qe, aD as Ue, aC as We, C as Xe, aE as Ye, b as Ze, aJ as $e, c as ea, aG as aa, aK as ta, aO as oa, aF as sa, aH as ra, aI as na, aL as ia, aM as da, aN as la, a as ca, D as ma, m as pa, p as ua, q as fa, n as ga, o as xa, l as ba, Q as ha, a8 as Ca, U as ya, Y as Na, Z as va, W as wa, au as Sa, ay as Ma, at as ja, X as Da, _ as Ta, av as Ra, aw as Ia, ax as Aa, R as ka, a9 as Pa, ab as za, aa as Ga, N as La, L as Ha, P as Va, s as Fa, r as Ba, V as Oa, ap as Ea, ae as qa, ah as Ja, aq as Ka, ai as _a, ar as Qa, as as Ua, af as Wa, ag as Xa, ac as Ya, S as Za, G as $a, z as et, F as at, A as tt, E as ot, j as st, ak as rt, T as nt, e as it, O as dt, aj as lt, d as ct, an as mt, am as pt, az as ut, aA as ft, M as gt } from "./context-menu-9cWJcKdh.js";
8
7
  import { ChevronRightIcon as g, CheckIcon as x, DotFilledIcon as b, Cross2Icon as h } from "@radix-ui/react-icons";
9
8
  import * as s from "@radix-ui/react-menubar";
10
9
  import * as d from "@radix-ui/react-dialog";
11
- import "@radix-ui/react-slot";
12
- import "clsx";
13
- import "tailwind-merge";
14
10
  import "@radix-ui/react-switch";
15
11
  import "@radix-ui/react-accordion";
16
12
  import "@radix-ui/react-alert-dialog";
13
+ import "@radix-ui/react-slot";
17
14
  import "@radix-ui/react-label";
18
15
  import "@radix-ui/react-scroll-area";
19
16
  import "@radix-ui/react-tabs";
@@ -26,6 +23,8 @@ import "@radix-ui/react-separator";
26
23
  import "@radix-ui/react-toast";
27
24
  import "cmdk";
28
25
  import "@radix-ui/react-context-menu";
26
+ import "clsx";
27
+ import "tailwind-merge";
29
28
  const C = c(
30
29
  "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
31
30
  {
@@ -242,84 +241,84 @@ const F = ({ className: e, ...a }) => /* @__PURE__ */ o.jsx("div", { className:
242
241
  F.displayName = "SheetFooter";
243
242
  const B = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(d.Title, { ref: t, className: r("text-lg font-semibold text-foreground", e), ...a }));
244
243
  B.displayName = d.Title.displayName;
245
- const E = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(d.Description, { ref: t, className: r("text-sm text-muted-foreground", e), ...a }));
246
- E.displayName = d.Description.displayName;
244
+ const O = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(d.Description, { ref: t, className: r("text-sm text-muted-foreground", e), ...a }));
245
+ O.displayName = d.Description.displayName;
247
246
  export {
248
- we as Accordion,
249
- Se as AccordionContent,
250
- Me as AccordionItem,
251
- je as AccordionTrigger,
247
+ ye as Accordion,
248
+ Ne as AccordionContent,
249
+ ve as AccordionItem,
250
+ we as AccordionTrigger,
252
251
  v as Alert,
253
252
  S as AlertDescription,
254
- De as AlertDialog,
255
- Te as AlertDialogAction,
256
- Re as AlertDialogCancel,
257
- Ie as AlertDialogContent,
258
- Ae as AlertDialogDescription,
259
- ke as AlertDialogFooter,
260
- Pe as AlertDialogHeader,
261
- ze as AlertDialogTitle,
262
- Ge as AlertDialogTrigger,
253
+ Se as AlertDialog,
254
+ Me as AlertDialogAction,
255
+ je as AlertDialogCancel,
256
+ De as AlertDialogContent,
257
+ Te as AlertDialogDescription,
258
+ Re as AlertDialogFooter,
259
+ Ie as AlertDialogHeader,
260
+ Ae as AlertDialogTitle,
261
+ ke as AlertDialogTrigger,
263
262
  w as AlertTitle,
264
- Le as Badge,
265
- ye as Button,
266
- He as Card,
267
- Ve as CardContent,
268
- Fe as CardDescription,
269
- Be as CardFooter,
270
- Ee as CardHeader,
271
- Oe as CardTitle,
272
- qe as Command,
273
- Je as CommandDialog,
274
- Ke as CommandEmpty,
275
- _e as CommandGroup,
276
- Qe as CommandInput,
277
- Ue as CommandItem,
278
- We as CommandList,
279
- Xe as CommandSeparator,
280
- Ye as CommandShortcut,
281
- Ze as ContextMenu,
282
- $e as ContextMenuCheckboxItem,
283
- ea as ContextMenuContent,
284
- aa as ContextMenuGroup,
285
- ta as ContextMenuItem,
286
- oa as ContextMenuLabel,
287
- sa as ContextMenuPortal,
288
- ra as ContextMenuRadioGroup,
289
- na as ContextMenuRadioItem,
290
- ia as ContextMenuSeparator,
291
- da as ContextMenuShortcut,
292
- la as ContextMenuSub,
293
- ca as ContextMenuSubContent,
294
- ma as ContextMenuSubTrigger,
295
- pa as ContextMenuTrigger,
296
- ua as Dialog,
297
- fa as DialogContent,
298
- ga as DialogDescription,
299
- xa as DialogFooter,
300
- ba as DialogHeader,
301
- ha as DialogTitle,
302
- Ca as DialogTrigger,
303
- ya as DropdownMenu,
304
- Na as DropdownMenuCheckboxItem,
305
- va as DropdownMenuContent,
306
- wa as DropdownMenuGroup,
307
- Sa as DropdownMenuItem,
308
- Ma as DropdownMenuLabel,
309
- ja as DropdownMenuPortal,
310
- Da as DropdownMenuRadioGroup,
311
- Ta as DropdownMenuRadioItem,
312
- Ra as DropdownMenuSeparator,
313
- Ia as DropdownMenuShortcut,
314
- Aa as DropdownMenuSub,
315
- ka as DropdownMenuSubContent,
316
- Pa as DropdownMenuSubTrigger,
317
- za as DropdownMenuTrigger,
318
- Ga as HoverCard,
319
- La as HoverCardContent,
320
- Ha as HoverCardTrigger,
321
- Va as Input,
322
- Fa as Label,
263
+ Pe as Badge,
264
+ ze as Button,
265
+ Ge as Card,
266
+ Le as CardContent,
267
+ He as CardDescription,
268
+ Ve as CardFooter,
269
+ Fe as CardHeader,
270
+ Be as CardTitle,
271
+ Oe as Command,
272
+ Ee as CommandDialog,
273
+ qe as CommandEmpty,
274
+ Je as CommandGroup,
275
+ Ke as CommandInput,
276
+ _e as CommandItem,
277
+ Qe as CommandList,
278
+ Ue as CommandSeparator,
279
+ We as CommandShortcut,
280
+ Xe as ContextMenu,
281
+ Ye as ContextMenuCheckboxItem,
282
+ Ze as ContextMenuContent,
283
+ $e as ContextMenuGroup,
284
+ ea as ContextMenuItem,
285
+ aa as ContextMenuLabel,
286
+ ta as ContextMenuPortal,
287
+ oa as ContextMenuRadioGroup,
288
+ sa as ContextMenuRadioItem,
289
+ ra as ContextMenuSeparator,
290
+ na as ContextMenuShortcut,
291
+ ia as ContextMenuSub,
292
+ da as ContextMenuSubContent,
293
+ la as ContextMenuSubTrigger,
294
+ ca as ContextMenuTrigger,
295
+ ma as Dialog,
296
+ pa as DialogContent,
297
+ ua as DialogDescription,
298
+ fa as DialogFooter,
299
+ ga as DialogHeader,
300
+ xa as DialogTitle,
301
+ ba as DialogTrigger,
302
+ ha as DropdownMenu,
303
+ Ca as DropdownMenuCheckboxItem,
304
+ ya as DropdownMenuContent,
305
+ Na as DropdownMenuGroup,
306
+ va as DropdownMenuItem,
307
+ wa as DropdownMenuLabel,
308
+ Sa as DropdownMenuPortal,
309
+ Ma as DropdownMenuRadioGroup,
310
+ ja as DropdownMenuRadioItem,
311
+ Da as DropdownMenuSeparator,
312
+ Ta as DropdownMenuShortcut,
313
+ Ra as DropdownMenuSub,
314
+ Ia as DropdownMenuSubContent,
315
+ Aa as DropdownMenuSubTrigger,
316
+ ka as DropdownMenuTrigger,
317
+ Pa as HoverCard,
318
+ za as HoverCardContent,
319
+ Ga as HoverCardTrigger,
320
+ La as Input,
321
+ Ha as Label,
323
322
  M as Menubar,
324
323
  A as MenubarCheckboxItem,
325
324
  R as MenubarContent,
@@ -336,46 +335,46 @@ export {
336
335
  T as MenubarSubContent,
337
336
  D as MenubarSubTrigger,
338
337
  j as MenubarTrigger,
339
- Ba as Popover,
340
- Ea as PopoverContent,
341
- Oa as PopoverTrigger,
342
- qa as ScrollArea,
343
- Ja as ScrollBar,
344
- Ka as Select,
345
- _a as SelectContent,
346
- Qa as SelectGroup,
347
- Ua as SelectItem,
348
- Wa as SelectLabel,
349
- Xa as SelectSeparator,
350
- Ya as SelectTrigger,
351
- Za as SelectValue,
352
- $a as Separator,
338
+ Va as Popover,
339
+ Fa as PopoverContent,
340
+ Ba as PopoverTrigger,
341
+ Oa as ScrollArea,
342
+ Ea as ScrollBar,
343
+ qa as Select,
344
+ Ja as SelectContent,
345
+ Ka as SelectGroup,
346
+ _a as SelectItem,
347
+ Qa as SelectLabel,
348
+ Ua as SelectSeparator,
349
+ Wa as SelectTrigger,
350
+ Xa as SelectValue,
351
+ Ya as Separator,
353
352
  ge as Sheet,
354
353
  be as SheetClose,
355
354
  H as SheetContent,
356
- E as SheetDescription,
355
+ O as SheetDescription,
357
356
  F as SheetFooter,
358
357
  V as SheetHeader,
359
358
  B as SheetTitle,
360
359
  xe as SheetTrigger,
361
- et as Skeleton,
362
- at as Switch,
363
- tt as Tabs,
364
- ot as TabsContent,
365
- st as TabsList,
366
- rt as TabsTrigger,
367
- nt as Textarea,
368
- it as Toaster,
360
+ Za as Skeleton,
361
+ $a as Switch,
362
+ et as Tabs,
363
+ at as TabsContent,
364
+ tt as TabsList,
365
+ ot as TabsTrigger,
366
+ st as Textarea,
367
+ rt as Toaster,
369
368
  y as Toggle,
370
- dt as Tooltip,
371
- lt as TooltipContent,
372
- ct as TooltipPortal,
373
- mt as TooltipProvider,
374
- pt as TooltipTrigger,
375
- ut as badgeVariants,
376
- Ne as buttonVariants,
377
- ft as reducer,
378
- gt as toast,
369
+ nt as Tooltip,
370
+ it as TooltipContent,
371
+ dt as TooltipPortal,
372
+ lt as TooltipProvider,
373
+ ct as TooltipTrigger,
374
+ mt as badgeVariants,
375
+ pt as buttonVariants,
376
+ ut as reducer,
377
+ ft as toast,
379
378
  C as toggleVariants,
380
- xt as useToast
379
+ gt as useToast
381
380
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),s=require("./jsx-runtime-JYMCiFoE.cjs"),E=require("react"),e=require("./iconBase-_bgMuxa5.cjs");require("i18next");const m=require("@radix-ui/react-icons"),h=require("lodash-es"),B=require("lucide-react");require("react-i18next");const C=require("./button-oQgWN0j0.cjs");require("jotai");require("clsx");require("tailwind-merge");require("./_commonjsHelpers-f52AuuUj.cjs");require("@react-hookz/web");require("tree-model");require("@radix-ui/react-slot");require("class-variance-authority");function I(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(o,l,r.get?r:{enumerable:!0,get:()=>t[l]})}}return o.default=t,Object.freeze(o)}const b=I(E),R=({className:t="",inBuilder:o})=>o?s.jsxRuntimeExports.jsx("div",{className:e.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",t),children:s.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:s.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,x=R,L=t=>{const{blockProps:o,inBuilder:l,backgroundImage:r,children:n,tag:i="div",styles:a}=t;let u=n;n||(u=s.jsxRuntimeExports.jsx(x,{inBuilder:l}));let c={};return r&&(c={backgroundImage:`url(${r})`}),b.createElement(i,{...o,...a,style:c},u)},T={type:"Box",label:"web_blocks.box",category:"core",group:"basic",props:{styles:e.T({default:""}),tag:e.f({title:"web_blocks.tag",default:"div",options:[{value:"div",title:"web_blocks.div"},{value:"header",title:"web_blocks.header"},{value:"footer",title:"web_blocks.footer"},{value:"section",title:"web_blocks.section"},{value:"article",title:"web_blocks.article"},{value:"aside",title:"web_blocks.aside"},{value:"main",title:"web_blocks.main"},{value:"nav",title:"web_blocks.nav"},{value:"figure",title:"web_blocks.figure"},{value:"details",title:"web_blocks.details"},{value:"summary",title:"web_blocks.summary"},{value:"dialog",title:"web_blocks.dialog"},{value:"strike",title:"web_blocks.strike"},{value:"caption",title:"web_blocks.caption"},{value:"legend",title:"web_blocks.legend"},{value:"figcaption",title:"web_blocks.figcaption"},{value:"mark",title:"web_blocks.mark"}]}),backgroundImage:e.o({title:"web_blocks.background_image"})},canAcceptBlock:()=>!0},S=t=>{const{blockProps:o,iconSize:l,icon:r,content:n,iconPos:i,styles:a,children:u}=t,c=r,d=u||s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:n}),c&&s.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:i+" "+(i==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:c}})]});return b.createElement("button",{...o,...a,type:"button"},d)},M={type:"Button",label:"web_blocks.button",category:"core",icon:m.ButtonIcon,group:"basic",props:{content:e.g({title:"web_blocks.label",default:"Button"}),styles:e.T({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:e.q({title:"web_blocks.icon",default:""}),iconSize:e.y({title:"web_blocks.icon_size",default:24}),iconPos:e.f({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},N=t=>{const{blockProps:o,styles:l,htmlCode:r,inBuilder:n}=t;return n?s.jsxRuntimeExports.jsxs("div",{className:"relative",children:[n?s.jsxRuntimeExports.jsx("div",{...o,...l,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...l,dangerouslySetInnerHTML:{__html:r.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:r}})},P={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:m.CodeIcon,group:"advanced",props:{styles:e.T({default:""}),htmlCode:e.l({title:"web_blocks.html_code",default:"<div><p>Enter your HTML code here...</p></div>",placeholder:"web_blocks.placeholder"})}},$=b.memo(t=>{const{blockProps:o,styles:l}=t;return b.createElement("div",{...o,...l})}),q={type:"EmptyBox",label:"web_blocks.empty_box",category:"core",group:"basic",props:{styles:e.T({default:""}),backgroundImage:e.o({title:"web_blocks.background_image"})}},H=t=>{const{blockProps:o,styles:l,content:r,level:n="h1",children:i=null}=t;return i?b.createElement(n,{...l,...o},i):b.createElement(n,{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:r}})},D={type:"Heading",label:"web_blocks.heading",category:"core",icon:m.HeadingIcon,group:"typography",props:{level:e.f({title:"web_blocks.level",default:"h2",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:e.T({default:"text-3xl"}),content:e.c({title:"web_blocks.content",default:"Heading goes here"})},canAcceptBlock:t=>t==="Span"||t==="Text"},z=t=>{const{blockProps:o,styles:l,content:r}=t;return h.isNull(t.children)?b.createElement("p",{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:r}}):b.createElement("p",{...l,...o},t.children)},A={type:"Paragraph",label:"web_blocks.paragraph",category:"core",icon:m.TextIcon,group:"typography",props:{styles:e.T({default:""}),content:e.c({title:"web_blocks.content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:t=>t==="Span"||t==="Link"||t==="Text"},U=t=>{const{blockProps:o,styles:l,content:r,children:n=null,tag:i}=t;return n?b.createElement("span",{...l,...o},n):b.createElement(i||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:r}})},F={type:"Span",label:"web_blocks.span",category:"core",group:"typography",props:{styles:e.T({default:""}),content:e.c({title:"web_blocks.content",default:""})},canAcceptBlock:()=>!0},O=t=>{const{blockProps:o,content:l,styles:r}=t;return s.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:s.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...r,dangerouslySetInnerHTML:{__html:l}})})},G={type:"RichText",label:"web_blocks.richtext",category:"core",icon:m.CursorTextIcon,group:"typography",props:{styles:e.T({default:""}),content:e.m({title:"web_blocks.content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},V=t=>{const{blockProps:o,link:l,children:r,styles:n,inBuilder:i,content:a}=t;return!r&&h.isEmpty(n==null?void 0:n.className)&&h.isEmpty(a)?s.jsxRuntimeExports.jsx(x,{inBuilder:i}):i?r?s.jsxRuntimeExports.jsx("span",{...o,...n,children:r}):b.createElement("span",{...o,...n,dangerouslySetInnerHTML:{__html:a}}):r?s.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...n,children:r}):b.createElement("a",{...o,...n,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self",dangerouslySetInnerHTML:{__html:a}})},W={type:"Link",label:"web_blocks.link",category:"core",icon:m.Link1Icon,group:"basic",props:{styles:e.T({default:""}),content:e.g({title:"web_blocks.content",default:""}),link:e.v({title:"web_blocks.link",default:{type:"page",target:"_self",href:"#"}})},canAcceptBlock:t=>t!=="Link"},j=(t,...o)=>({...t,className:e.cn(t.className,...o)}),X=t=>{const{blockProps:o,children:l,styles:r,inBuilder:n,content:i,href:a}=t,{hrefType:u,autoplay:c,maxWidth:d,backdropColor:f,galleryName:g}=t,k=j(r,"cb-lightbox");if(!l&&h.isEmpty(r==null?void 0:r.className)&&h.isEmpty(i))return s.jsxRuntimeExports.jsx(x,{inBuilder:n});if(n)return l?s.jsxRuntimeExports.jsx("span",{...o,...k,children:l}):b.createElement("span",{...o,...k,dangerouslySetInnerHTML:{__html:i}});const y={};return y["data-vbtype"]=u,c&&(y["data-autoplay"]="true"),d&&(y["data-maxwidth"]=d+"px"),f&&(y["data-overlay"]=f),g&&(y["data-gall"]=g),l?s.jsxRuntimeExports.jsx("a",{...y,href:a||"#/",...o,...k,children:l}):b.createElement("a",{...o,...k,...y,href:a||"#",dangerouslySetInnerHTML:{__html:i}})},Y={type:"LightBoxLink",label:"web_blocks.lightbox_link",category:"core",icon:m.ImageIcon,group:"basic",props:{styles:e.T({default:""}),content:e.g({title:"web_blocks.content",default:"Link text or drop blocks inside"}),href:e.g({title:"web_blocks.href",default:""}),hrefType:e.f({title:"web_blocks.type",default:"video",options:[{value:"video",title:"web_blocks.video"},{value:"iframe",title:"web_blocks.iframe"},{value:"inline",title:"web_blocks.inline"},{value:"ajax",title:"web_blocks.ajax"}]}),autoplay:e.r({title:"web_blocks.autoplay",default:!1}),maxWidth:e.y({title:"web_blocks.max_width",default:""}),backdropColor:e.g({title:"backdrop_color",default:""}),galleryName:e.g({title:"web_blocks.gallery_name",default:""})},canAcceptBlock:t=>t!=="Link"&&t!=="LightBoxLink"},Z=t=>{const{blockProps:o,children:l,listType:r,styles:n,tag:i,inBuilder:a}=t,u=e.cn(h.get(n,"className",""),r);return!l&&h.isEmpty(n==null?void 0:n.className)?s.jsxRuntimeExports.jsx(x,{inBuilder:a}):b.createElement(i||(r==="list-decimal"?"ol":"ul"),{...o,...n,className:u},l)},J={type:"List",label:"web_blocks.list",icon:m.RowsIcon,category:"core",group:"basic",props:{styles:e.T({default:""}),listType:e.f({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.number"}]})},canAcceptBlock:t=>t==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]},K=t=>{const{blockProps:o,content:l,styles:r,children:n,tag:i}=t;return n?b.createElement(i||"li",{...r,...o},n):b.createElement(i||"li",{...r,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},Q={type:"ListItem",label:"web_blocks.listitem",icon:m.ColumnsIcon,category:"core",group:"basic",props:{styles:e.T({default:""}),content:e.c({title:"web_blocks.content",default:"List item"})},canAcceptBlock:t=>t!=="ListItem",canBeNested:t=>t==="List"},ee=t=>{const{blockProps:o,icon:l,styles:r,width:n,inBuilder:i,height:a}=t,u=j(r,e.cn(n?`w-[${n}px]`:"",a?`h-[${a}px]`:""));if(h.isEmpty(l))return s.jsxRuntimeExports.jsx(x,{inBuilder:i,className:"h-8 w-14"});const c=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...u,dangerouslySetInnerHTML:{__html:c}})},te={type:"Icon",label:"web_blocks.icon",category:"core",icon:m.SketchLogoIcon,group:"media",props:{styles:e.T({default:"text-black"}),icon:e.q({title:"web_blocks.icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:e.y({title:"web_blocks.width",default:""}),height:e.y({title:"web_blocks.height",default:""})}},le=t=>{const{blockProps:o,image:l,styles:r,alt:n,height:i,width:a}=t;return h.isEmpty(l)?s.jsxRuntimeExports.jsx(x,{className:"h-36"}):b.createElement("img",{...o,...r,src:l,alt:n,loading:"lazy",height:i,width:a})},oe={type:"Image",label:"web_blocks.image",category:"core",icon:m.ImageIcon,group:"media",props:{styles:e.T({default:""}),image:e.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:e.g({title:"web_blocks.alt",default:""}),width:e.g({title:"web_blocks.width",default:""}),height:e.g({title:"web_blocks.height",default:""})}},_=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,w=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,v=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,se=t=>{if(_.test(t)){const o=t.match(_);return o?`https://www.youtube.com/embed/${o[4]}`:t}if(w.test(t)){const o=t.match(w);return o?`https://player.vimeo.com/video/${o[3]}`:t}if(v.test(t)){const o=t.match(v);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:t}return null},re=b.memo(t=>{const{blockProps:o,inBuilder:l,styles:r,url:n,controls:i}=t,a=h.get(i,"autoPlay",!1),u=h.get(i,"controls",!1),c=a||h.get(i,"muted",!0),d=h.get(i,"loop",!1);if(h.isEmpty(n))return s.jsxRuntimeExports.jsx(x,{inBuilder:l,className:"h-36"});let f=se(n),g=null;if(f){if(!h.isEmpty(f)){const k=[];k.push(`autoplay=${a?1:0}`),k.push(`controls=${i?1:0}`),k.push(`mute=${c?1:0}&muted=${c?1:0}`),k.push(`loop=${d?1:0}`),f=`${f}?${k.join("&")}`}g=b.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:f,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=b.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:n,controls:u,muted:c,autoPlay:l?!1:a,loop:d});return s.jsxRuntimeExports.jsx("div",{...h.pick(r,["className"]),children:s.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?s.jsxRuntimeExports.jsx("div",{...o,...h.omit(r,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})}),ne={type:"Video",label:"web_blocks.video",category:"core",icon:m.VideoIcon,group:"media",props:{styles:e.T({default:""}),url:e.g({title:"web_blocks.video_url",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:e.b({title:"web_blocks.controls",properties:{autoPlay:e.r({title:"web_blocks.autoplay",default:!0}),controls:e.r({title:"web_blocks.controls",default:!1}),loop:e.r({title:"web_blocks.loop",default:!1}),muted:e.r({title:"web_blocks.muted",default:!0})}})}};function ie(t){return e.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(t)}const ae=t=>{const{scripts:o,inBuilder:l,blockProps:r}=t;return l?s.jsxRuntimeExports.jsx("div",{...r,children:s.jsxRuntimeExports.jsx("div",{className:e.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:s.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:s.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):s.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ce={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ie,group:"advanced",props:{scripts:e.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ue=t=>{const{blockProps:o,styles:l}=t;return b.createElement("hr",{...l,...o})},de={type:"Divider",label:"web_blocks.divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:{styles:e.T({default:"bg-gray-900 h-0.5 py-2 my-1"})}},pe=()=>null,be={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:m.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},me=()=>{const t=e.useSelectedBlock(),{data:o,refetch:l,isLoading:r}=e.useGlobalBlocksList(),n=e.useUpdateBlocksProps();return s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("label",{className:"text-sm",children:"Choose a global block"}),s.jsxRuntimeExports.jsxs("select",{className:"h-8 w-full rounded-md border border-gray-300 p-0 px-2 text-xs dark:border-gray-600",value:(t==null?void 0:t.globalBlock)||"",onChange:i=>{n([t._id],{globalBlock:i.target.value})},children:[s.jsxRuntimeExports.jsx("option",{value:"",children:"Select a global block"}),Object.keys(o).map(i=>s.jsxRuntimeExports.jsx("option",{value:i,children:o[i].name||i},i))]}),s.jsxRuntimeExports.jsx("div",{className:"mt-2 text-xs",children:s.jsxRuntimeExports.jsx(C.Button,{size:"sm",variant:"outline",onClick:l,className:"text-xs",children:r?"Loading...":"Refresh List"})})]})},ge=t=>{const{blockProps:o,inBuilder:l,children:r,globalBlock:n}=t;return l&&!n?s.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[s.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",n]}),s.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("div",{...o},r)},he={type:"GlobalBlock",label:"Global Block",icon:B.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:e.g({title:"global block",default:"",hidden:!0})},propsEditor:me},fe=t=>t.inBuilder||t.forceWrapper?s.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...t.blockProps,children:t.content}):`${t.content}`,ke={type:"Text",label:"web_blocks.text",hidden:!0,category:"core",group:"typography",icon:m.SpaceBetweenVerticallyIcon,props:{content:e.c({title:"web_blocks.content",defaultValue:""})}},xe=t=>{const{blockProps:o,backgroundImage:l,children:r,styles:n}=t;let i={};return l&&(i={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...n,style:i},r)},ye={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:e.T({default:"font-body antialiased"}),backgroundImage:e.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},_e=t=>{const{blockProps:o,styles:l}=t;return b.createElement("br",{...o,...l})},we={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:m.SpaceBetweenVerticallyIcon,props:{styles:e.T({default:""})}},ve=t=>{const{blockProps:o,errorMessage:l,name:r,_type:n,successMessage:i,action:a,styles:u,children:c}=t;let d=c;c||(d=s.jsxRuntimeExports.jsx(x,{}));const f={"x-data":"{}","x-on:submit.prevent":"post"},g={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return s.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":i,method:"post",action:a,...o,...u,children:[s.jsxRuntimeExports.jsx("div",{...g}),s.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:r||n}),d]})},je={type:"Form",label:"web_blocks.form",category:"core",icon:m.GroupIcon,group:"form",props:{styles:e.T({default:""}),action:e.g({title:"web_blocks.submit_url",default:"/api/form/submit"}),errorMessage:e.m({title:"web_blocks.error_message",default:"Something went wrong. Please try again"}),successMessage:e.m({title:"web_blocks.success_message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},Ee=t=>{const{blockProps:o,inBuilder:l,label:r,styles:n,inputStyles:i,icon:a,iconPos:u}=t,c=e.generateUUID(),d={"x-bind:disabled":"formLoading"};return s.jsxRuntimeExports.jsxs("button",{id:c,...d,...i,...n,...o||{},type:l?"button":"submit",children:[r,a&&s.jsxRuntimeExports.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:a}})]})},Be={type:"FormButton",label:"web_blocks.submit_button",category:"core",icon:m.ButtonIcon,group:"form",props:{label:e.g({title:"web_blocks.label",default:"Submit"}),styles:e.T({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:e.q({title:"Icon",default:""}),iconPos:e.f({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},Ce=t=>{const{blockProps:o,label:l,placeholder:r,styles:n,inputStyles:i,showLabel:a,required:u,inputType:c="text",inBuilder:d,fieldName:f}=t,g=e.generateUUID();return!a||c==="submit"?(c==="submit"&&(o.value=l),s.jsxRuntimeExports.jsx("input",{id:g,name:f,readOnly:d,...o,...i,...n,type:c,placeholder:r,required:u})):s.jsxRuntimeExports.jsxs("div",{...n,...o,children:[a&&s.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),s.jsxRuntimeExports.jsx("input",{name:f,readOnly:d,...i,id:g,type:c,placeholder:r,required:u})]})},Ie={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",props:{styles:e.T({default:""}),fieldName:e.g({title:"Field Name",default:"input"}),inputType:e.f({title:"web_blocks.type",options:h.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],t=>({value:t,title:t})),default:"text"}),value:e.g({title:"web_blocks.value",default:""}),showLabel:e.r({title:"web_blocks.show_label",default:!0}),inputStyles:e.T({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),required:e.r({title:"web_blocks.required",default:!1})}},Re=t=>{const{blockProps:o,fieldName:l,label:r,styles:n,inputStyles:i,checked:a,required:u,showLabel:c=!0}=t,d=e.generateUUID();return c?s.jsxRuntimeExports.jsxs("div",{...n,...o,children:[s.jsxRuntimeExports.jsx("input",{...i,name:l,id:d,type:"radio",required:u,defaultChecked:a}),r&&s.jsxRuntimeExports.jsx("label",{htmlFor:d,children:r})]}):s.jsxRuntimeExports.jsx("input",{id:d,...o,...i,...n,type:"radio",required:u,checked:a,name:l})},Le={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",props:{styles:e.T({default:"flex items-center w-max gap-x-2"}),fieldName:e.g({title:"web_blocks.field_name",default:"radio"}),label:e.g({title:"web_blocks.label",default:"Label"}),checked:e.r({title:"web_blocks.checked",default:!1}),required:e.r({title:"web_blocks.required",default:!1})}},Te=t=>{const{blockProps:o,fieldName:l,label:r,placeholder:n,styles:i,inputStyles:a,required:u,showLabel:c,_multiple:d=!1}=t,f=e.generateUUID();return c?s.jsxRuntimeExports.jsxs("div",{...i,children:[c&&s.jsxRuntimeExports.jsx("label",{htmlFor:f,children:r}),s.jsxRuntimeExports.jsxs("select",{...a,id:f,required:u,multiple:d,name:l,children:[s.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:n}),h.map(t.options,g=>s.jsxRuntimeExports.jsx("option",{selected:h.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):s.jsxRuntimeExports.jsxs("select",{id:f,...i,...o,required:u,multiple:d,name:l,children:[s.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:n}),h.map(t.options,g=>s.jsxRuntimeExports.jsx("option",{selected:h.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})},Se={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",props:{styles:e.T({default:""}),fieldName:e.g({title:"web_blocks.field_name",default:"select"}),showLabel:e.r({title:"web_blocks.show_label",default:!0}),inputStyles:e.T({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),required:e.r({title:"web_blocks.required",default:!1}),_multiple:e.r({title:"web_blocks.multiple",default:!1}),options:e.S({title:"web_blocks.options",itemProperties:{label:e.g({title:"web_blocks.label",default:""}),value:e.g({title:"web_blocks.value",default:""})}})}},Me=t=>{const{blockProps:o,fieldName:l,label:r,placeholder:n,styles:i,inputStyles:a,_rows:u,showLabel:c}=t,d=e.generateUUID();return c?s.jsxRuntimeExports.jsxs("div",{...i,...o,children:[c&&s.jsxRuntimeExports.jsx("label",{htmlFor:d,children:r}),s.jsxRuntimeExports.jsx("textarea",{name:l,...a,id:d,placeholder:n,rows:u})]}):s.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...a,...i,placeholder:n,rows:u})},Ne={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",props:{fieldName:e.g({title:"web_blocks.field_name",default:"textarea"}),showLabel:e.r({title:"web_blocks.show_label",default:!0}),styles:e.T({default:""}),inputStyles:e.T({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),_rows:e.y({title:"web_blocks.rows",default:3})}},Pe=t=>{const{blockProps:o,fieldName:l,label:r,styles:n,inputStyles:i,required:a,checked:u,showLabel:c=!0}=t,d=e.generateUUID();return c?s.jsxRuntimeExports.jsxs("div",{...n,...o,children:[s.jsxRuntimeExports.jsx("input",{...i,name:l,id:d,type:"checkbox",required:a,defaultChecked:u}),r&&r!=="Label"&&s.jsxRuntimeExports.jsx("label",{htmlFor:d,children:r})]}):s.jsxRuntimeExports.jsx("input",{id:d,...o,...i,...n,type:"checkbox",required:a,name:l})},$e={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",props:{fieldName:e.g({title:"Field Name",default:"checkbox"}),styles:e.T({default:"flex items-center gap-x-2"}),label:e.g({title:"web_blocks.label",default:"Label"}),checked:e.r({title:"web_blocks.checked",default:!1}),required:e.r({title:"web_blocks.required",default:!1})}},qe=()=>{p.registerChaiBlock(L,T),p.registerChaiBlock($,q),p.registerChaiBlock(S,M),p.registerChaiBlock(H,D),p.registerChaiBlock(z,A),p.registerChaiBlock(U,F),p.registerChaiBlock(O,G),p.registerChaiBlock(V,W),p.registerChaiBlock(X,Y),p.registerChaiBlock(Z,J),p.registerChaiBlock(K,Q),p.registerChaiBlock(ee,te),p.registerChaiBlock(le,oe),p.registerChaiBlock(re,ne),p.registerChaiBlock(N,P),p.registerChaiBlock(fe,ke),p.registerChaiBlock(ve,je),p.registerChaiBlock(Ee,Be),p.registerChaiBlock(Ce,Ie),p.registerChaiBlock(Pe,$e),p.registerChaiBlock(Re,Le),p.registerChaiBlock(Te,Se),p.registerChaiBlock(Me,Ne),p.registerChaiBlock(_e,we),p.registerChaiBlock(xe,ye),p.registerChaiBlock(ae,ce),p.registerChaiBlock(ue,de),p.registerChaiBlock(pe,be),p.registerChaiBlock(ge,he)};exports.loadWebBlocks=qe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@chaibuilder/runtime"),n=require("./jsx-runtime-JYMCiFoE.cjs"),B=require("react"),e=require("./iconBase-kuD_VwQx.cjs"),m=require("@radix-ui/react-icons"),h=require("lodash-es"),E=require("lucide-react");require("clsx");require("tailwind-merge");function I(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(o,l,s.get?s:{enumerable:!0,get:()=>t[l]})}}return o.default=t,Object.freeze(o)}const b=I(B),C=({className:t="",inBuilder:o})=>o?n.jsxRuntimeExports.jsx("div",{className:e.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",t),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:n.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,y=C,R=t=>{const{blockProps:o,inBuilder:l,backgroundImage:s,children:r,tag:a="div",styles:i}=t;let u=r;r||(u=n.jsxRuntimeExports.jsx(y,{inBuilder:l}));let c={};return s&&(c={backgroundImage:`url(${s})`}),b.createElement(a,{...o,...i,style:c},u)},T={type:"Box",label:"web_blocks.box",category:"core",group:"basic",props:{styles:e.T({default:""}),tag:e.f({title:"web_blocks.tag",default:"div",options:[{value:"div",title:"web_blocks.div"},{value:"header",title:"web_blocks.header"},{value:"footer",title:"web_blocks.footer"},{value:"section",title:"web_blocks.section"},{value:"article",title:"web_blocks.article"},{value:"aside",title:"web_blocks.aside"},{value:"main",title:"web_blocks.main"},{value:"nav",title:"web_blocks.nav"},{value:"figure",title:"web_blocks.figure"},{value:"details",title:"web_blocks.details"},{value:"summary",title:"web_blocks.summary"},{value:"dialog",title:"web_blocks.dialog"},{value:"strike",title:"web_blocks.strike"},{value:"caption",title:"web_blocks.caption"},{value:"legend",title:"web_blocks.legend"},{value:"figcaption",title:"web_blocks.figcaption"},{value:"mark",title:"web_blocks.mark"}]}),backgroundImage:e.o({title:"web_blocks.background_image"})},canAcceptBlock:()=>!0},L=t=>{const{blockProps:o,iconSize:l,icon:s,content:r,iconPos:a,styles:i,children:u}=t,c=s,d=u||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:r}),c&&n.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:c}})]});return b.createElement("button",{...o,...i,type:"button"},d)},S={type:"Button",label:"web_blocks.button",category:"core",icon:m.ButtonIcon,group:"basic",props:{content:e.g({title:"web_blocks.label",default:"Button"}),styles:e.T({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:e.q({title:"web_blocks.icon",default:""}),iconSize:e.y({title:"web_blocks.icon_size",default:24}),iconPos:e.f({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},M=t=>{const{blockProps:o,styles:l,htmlCode:s,inBuilder:r}=t;return r?n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...o,...l,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}})},N={type:"CustomHTML",label:"web_blocks.custom_html",category:"core",icon:m.CodeIcon,group:"advanced",props:{styles:e.T({default:""}),htmlCode:e.l({title:"web_blocks.html_code",default:"<div><p>Enter your HTML code here...</p></div>",placeholder:"web_blocks.placeholder"})}},P=b.memo(t=>{const{blockProps:o,styles:l}=t;return b.createElement("div",{...o,...l})}),$={type:"EmptyBox",label:"web_blocks.empty_box",category:"core",group:"basic",props:{styles:e.T({default:""}),backgroundImage:e.o({title:"web_blocks.background_image"})}},q=t=>{const{blockProps:o,styles:l,content:s,level:r="h1",children:a=null}=t;return a?b.createElement(r,{...l,...o},a):b.createElement(r,{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})},H={type:"Heading",label:"web_blocks.heading",category:"core",icon:m.HeadingIcon,group:"typography",props:{level:e.f({title:"web_blocks.level",default:"h2",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:e.T({default:"text-3xl"}),content:e.c({title:"web_blocks.content",default:"Heading goes here"})},canAcceptBlock:t=>t==="Span"||t==="Text"},D=t=>{const{blockProps:o,styles:l,content:s}=t;return h.isNull(t.children)?b.createElement("p",{...l,...o,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):b.createElement("p",{...l,...o},t.children)},z={type:"Paragraph",label:"web_blocks.paragraph",category:"core",icon:m.TextIcon,group:"typography",props:{styles:e.T({default:""}),content:e.c({title:"web_blocks.content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:t=>t==="Span"||t==="Link"||t==="Text"},A=t=>{const{blockProps:o,styles:l,content:s,children:r=null,tag:a}=t;return r?b.createElement("span",{...l,...o},r):b.createElement(a||"span",{...l,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})},U={type:"Span",label:"web_blocks.span",category:"core",group:"typography",props:{styles:e.T({default:""}),content:e.c({title:"web_blocks.content",default:""})},canAcceptBlock:()=>!0},F=t=>{const{blockProps:o,content:l,styles:s}=t;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...o,...s,dangerouslySetInnerHTML:{__html:l}})})},O={type:"RichText",label:"web_blocks.richtext",category:"core",icon:m.CursorTextIcon,group:"typography",props:{styles:e.T({default:""}),content:e.m({title:"web_blocks.content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}},G=t=>{const{blockProps:o,link:l,children:s,styles:r,inBuilder:a,content:i}=t;return!s&&h.isEmpty(r==null?void 0:r.className)&&h.isEmpty(i)?n.jsxRuntimeExports.jsx(y,{inBuilder:a}):a?s?n.jsxRuntimeExports.jsx("span",{...o,...r,children:s}):b.createElement("span",{...o,...r,dangerouslySetInnerHTML:{__html:i}}):s?n.jsxRuntimeExports.jsx("a",{href:(l==null?void 0:l.href)||"#/",target:l==null?void 0:l.target,...o,...r,children:s}):b.createElement("a",{...o,...r,"data-ai-key":"content",href:(l==null?void 0:l.href)||"#",target:(l==null?void 0:l.target)||"_self",dangerouslySetInnerHTML:{__html:i}})},V={type:"Link",label:"web_blocks.link",category:"core",icon:m.Link1Icon,group:"basic",props:{styles:e.T({default:""}),content:e.g({title:"web_blocks.content",default:""}),link:e.v({title:"web_blocks.link",default:{type:"page",target:"_self",href:"#"}})},canAcceptBlock:t=>t!=="Link"},j=(t,...o)=>({...t,className:e.cn(t.className,...o)}),W=t=>{const{blockProps:o,children:l,styles:s,inBuilder:r,content:a,href:i}=t,{hrefType:u,autoplay:c,maxWidth:d,backdropColor:f,galleryName:g}=t,k=j(s,"cb-lightbox");if(!l&&h.isEmpty(s==null?void 0:s.className)&&h.isEmpty(a))return n.jsxRuntimeExports.jsx(y,{inBuilder:r});if(r)return l?n.jsxRuntimeExports.jsx("span",{...o,...k,children:l}):b.createElement("span",{...o,...k,dangerouslySetInnerHTML:{__html:a}});const x={};return x["data-vbtype"]=u,c&&(x["data-autoplay"]="true"),d&&(x["data-maxwidth"]=d+"px"),f&&(x["data-overlay"]=f),g&&(x["data-gall"]=g),l?n.jsxRuntimeExports.jsx("a",{...x,href:i||"#/",...o,...k,children:l}):b.createElement("a",{...o,...k,...x,href:i||"#",dangerouslySetInnerHTML:{__html:a}})},X={type:"LightBoxLink",label:"web_blocks.lightbox_link",category:"core",icon:m.ImageIcon,group:"basic",props:{styles:e.T({default:""}),content:e.g({title:"web_blocks.content",default:"Link text or drop blocks inside"}),href:e.g({title:"web_blocks.href",default:""}),hrefType:e.f({title:"web_blocks.type",default:"video",options:[{value:"video",title:"web_blocks.video"},{value:"iframe",title:"web_blocks.iframe"},{value:"inline",title:"web_blocks.inline"},{value:"ajax",title:"web_blocks.ajax"}]}),autoplay:e.r({title:"web_blocks.autoplay",default:!1}),maxWidth:e.y({title:"web_blocks.max_width",default:""}),backdropColor:e.g({title:"backdrop_color",default:""}),galleryName:e.g({title:"web_blocks.gallery_name",default:""})},canAcceptBlock:t=>t!=="Link"&&t!=="LightBoxLink"},Y=t=>{const{blockProps:o,children:l,listType:s,styles:r,tag:a,inBuilder:i}=t,u=e.cn(h.get(r,"className",""),s);return!l&&h.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(y,{inBuilder:i}):b.createElement(a||(s==="list-decimal"?"ol":"ul"),{...o,...r,className:u},l)},Z={type:"List",label:"web_blocks.list",icon:m.RowsIcon,category:"core",group:"basic",props:{styles:e.T({default:""}),listType:e.f({title:"web_blocks.list_type",default:"list-none",options:[{value:"list-none",title:"web_blocks.none"},{value:"list-disc",title:"web_blocks.disc"},{value:"list-decimal",title:"web_blocks.number"}]})},canAcceptBlock:t=>t==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]},J=t=>{const{blockProps:o,content:l,styles:s,children:r,tag:a}=t;return r?b.createElement(a||"li",{...s,...o},r):b.createElement(a||"li",{...s,...o,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:l}})},K={type:"ListItem",label:"web_blocks.listitem",icon:m.ColumnsIcon,category:"core",group:"basic",props:{styles:e.T({default:""}),content:e.c({title:"web_blocks.content",default:"List item"})},canAcceptBlock:t=>t!=="ListItem",canBeNested:t=>t==="List"},Q=t=>{const{blockProps:o,icon:l,styles:s,width:r,inBuilder:a,height:i}=t,u=j(s,e.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(h.isEmpty(l))return n.jsxRuntimeExports.jsx(y,{inBuilder:a,className:"h-8 w-14"});const c=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...u,dangerouslySetInnerHTML:{__html:c}})},ee={type:"Icon",label:"web_blocks.icon",category:"core",icon:m.SketchLogoIcon,group:"media",props:{styles:e.T({default:"text-black"}),icon:e.q({title:"web_blocks.icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:e.y({title:"web_blocks.width",default:""}),height:e.y({title:"web_blocks.height",default:""})}},te=t=>{const{blockProps:o,image:l,styles:s,alt:r,height:a,width:i}=t;return h.isEmpty(l)?n.jsxRuntimeExports.jsx(y,{className:"h-36"}):b.createElement("img",{...o,...s,src:l,alt:r,loading:"lazy",height:a,width:i})},le={type:"Image",label:"web_blocks.image",category:"core",icon:m.ImageIcon,group:"media",props:{styles:e.T({default:""}),image:e.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:e.g({title:"web_blocks.alt",default:""}),width:e.g({title:"web_blocks.width",default:""}),height:e.g({title:"web_blocks.height",default:""})}},_=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,w=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,v=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,oe=t=>{if(_.test(t)){const o=t.match(_);return o?`https://www.youtube.com/embed/${o[4]}`:t}if(w.test(t)){const o=t.match(w);return o?`https://player.vimeo.com/video/${o[3]}`:t}if(v.test(t)){const o=t.match(v);return o?`https://www.dailymotion.com/embed/video/${o[4]}`:t}return null},se=b.memo(t=>{const{blockProps:o,inBuilder:l,styles:s,url:r,controls:a}=t,i=h.get(a,"autoPlay",!1),u=h.get(a,"controls",!1),c=i||h.get(a,"muted",!0),d=h.get(a,"loop",!1);if(h.isEmpty(r))return n.jsxRuntimeExports.jsx(y,{inBuilder:l,className:"h-36"});let f=oe(r),g=null;if(f){if(!h.isEmpty(f)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${a?1:0}`),k.push(`mute=${c?1:0}&muted=${c?1:0}`),k.push(`loop=${d?1:0}`),f=`${f}?${k.join("&")}`}g=b.createElement("iframe",{...o,className:"absolute inset-0 w-full h-full",src:f,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=b.createElement("video",{...o,className:"absolute inset-0 w-full h-full",src:r,controls:u,muted:c,autoPlay:l?!1:i,loop:d});return n.jsxRuntimeExports.jsx("div",{...h.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?n.jsxRuntimeExports.jsx("div",{...o,...h.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})}),re={type:"Video",label:"web_blocks.video",category:"core",icon:m.VideoIcon,group:"media",props:{styles:e.T({default:""}),url:e.g({title:"web_blocks.video_url",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:e.b({title:"web_blocks.controls",properties:{autoPlay:e.r({title:"web_blocks.autoplay",default:!0}),controls:e.r({title:"web_blocks.controls",default:!1}),loop:e.r({title:"web_blocks.loop",default:!1}),muted:e.r({title:"web_blocks.muted",default:!0})}})}};function ne(t){return e.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(t)}const ae=t=>{const{scripts:o,inBuilder:l,blockProps:s}=t;return l?n.jsxRuntimeExports.jsx("div",{...s,children:n.jsxRuntimeExports.jsx("div",{className:e.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:n.jsxRuntimeExports.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):n.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},ie={type:"CustomScript",label:"web_blocks.custom_script",category:"core",icon:ne,group:"advanced",props:{scripts:e.l({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})}},ce=t=>{const{blockProps:o,styles:l}=t;return b.createElement("hr",{...l,...o})},ue={type:"Divider",label:"web_blocks.divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:{styles:e.T({default:"bg-gray-900 h-0.5 py-2 my-1"})}},de=()=>null,pe={type:"Dark Mode",label:"web_blocks.dark_mode",category:"core",icon:m.MoonIcon,group:"advanced",props:{},blocks:()=>[{_id:"ultqCh",_type:"Span",tag:"span",styles:"#styles:,",_name:"Dark Mode Switcher"},{_id:"vroabi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'dark'","x-show":"darkMode === 'light'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Dark Mode Btn"},{_id:"eweibk",_parent:"vroabi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"nltBrv",_parent:"eweibk",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"},{_id:"gesydi",_parent:"ultqCh",_type:"Button",styles_attrs:{type:"button","x-on:click":"darkMode = 'light'","x-show":"darkMode === 'dark'"},styles:"#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",_name:"Light Mode Btn"},{_id:"sgbhDo",_parent:"gesydi",_type:"Span",tag:"span",styles:"#styles:,group inline-flex shrink-0 justify-center items-center size-9"},{_id:"AdDwBC",_parent:"sgbhDo",_type:"Icon",styles:"#styles:, shrink-0 size-4",icon:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"}]},be=t=>{const{blockProps:o,inBuilder:l,children:s,globalBlock:r}=t;return l&&!r?n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[n.jsxRuntimeExports.jsxs("h1",{children:["Global Block - ",r]}),n.jsxRuntimeExports.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("div",{...o},s)},me={type:"GlobalBlock",label:"Global Block",icon:E.GlobeIcon,category:"core",group:"advanced",props:{globalBlock:e.g({title:"global block",default:"",hidden:!0})}},ge=t=>t.inBuilder||t.forceWrapper?n.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...t.blockProps,children:t.content}):`${t.content}`,he={type:"Text",label:"web_blocks.text",hidden:!0,category:"core",group:"typography",icon:m.SpaceBetweenVerticallyIcon,props:{content:e.c({title:"web_blocks.content",defaultValue:""})}},fe=t=>{const{blockProps:o,backgroundImage:l,children:s,styles:r}=t;let a={};return l&&(a={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...r,style:a},s)},ke={type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:e.T({default:"font-body antialiased"}),backgroundImage:e.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},ye=t=>{const{blockProps:o,styles:l}=t;return b.createElement("br",{...o,...l})},xe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:m.SpaceBetweenVerticallyIcon,props:{styles:e.T({default:""})}},_e=t=>{const{blockProps:o,errorMessage:l,name:s,_type:r,successMessage:a,action:i,styles:u,children:c}=t;let d=c;c||(d=n.jsxRuntimeExports.jsx(y,{}));const f={"x-data":"{}","x-on:submit.prevent":"post"},g={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...f,"data-error":l,"data-success":a,method:"post",action:i,...o,...u,children:[n.jsxRuntimeExports.jsx("div",{...g}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),d]})},we={type:"Form",label:"web_blocks.form",category:"core",icon:m.GroupIcon,group:"form",props:{styles:e.T({default:""}),action:e.g({title:"web_blocks.submit_url",default:"/api/form/submit"}),errorMessage:e.m({title:"web_blocks.error_message",default:"Something went wrong. Please try again"}),successMessage:e.m({title:"web_blocks.success_message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0},ve=t=>{const{blockProps:o,inBuilder:l,label:s,styles:r,inputStyles:a,icon:i,iconPos:u}=t,c=e.generateUUID(),d={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:c,...d,...a,...r,...o||{},type:l?"button":"submit",children:[s,i&&n.jsxRuntimeExports.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:i}})]})},je={type:"FormButton",label:"web_blocks.submit_button",category:"core",icon:m.ButtonIcon,group:"form",props:{label:e.g({title:"web_blocks.label",default:"Submit"}),styles:e.T({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:e.q({title:"Icon",default:""}),iconPos:e.f({title:"web_blocks.icon_position",default:"order-last",options:[{title:"web_blocks.start",value:"order-first"},{title:"web_blocks.end",value:"order-last"}]})}},Be=t=>{const{blockProps:o,label:l,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:u,inputType:c="text",inBuilder:d,fieldName:f}=t,g=e.generateUUID();return!i||c==="submit"?(c==="submit"&&(o.value=l),n.jsxRuntimeExports.jsx("input",{id:g,name:f,readOnly:d,...o,...a,...r,type:c,placeholder:s,required:u})):n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),n.jsxRuntimeExports.jsx("input",{name:f,readOnly:d,...a,id:g,type:c,placeholder:s,required:u})]})},Ee={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",props:{styles:e.T({default:""}),fieldName:e.g({title:"Field Name",default:"input"}),inputType:e.f({title:"web_blocks.type",options:h.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],t=>({value:t,title:t})),default:"text"}),value:e.g({title:"web_blocks.value",default:""}),showLabel:e.r({title:"web_blocks.show_label",default:!0}),inputStyles:e.T({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),required:e.r({title:"web_blocks.required",default:!1})}},Ie=t=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:a,checked:i,required:u,showLabel:c=!0}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:d,type:"radio",required:u,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...a,...r,type:"radio",required:u,checked:i,name:l})},Ce={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",props:{styles:e.T({default:"flex items-center w-max gap-x-2"}),fieldName:e.g({title:"web_blocks.field_name",default:"radio"}),label:e.g({title:"web_blocks.label",default:"Label"}),checked:e.r({title:"web_blocks.checked",default:!1}),required:e.r({title:"web_blocks.required",default:!1})}},Re=t=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,required:u,showLabel:c,_multiple:d=!1}=t,f=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...a,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:f,required:u,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(t.options,g=>n.jsxRuntimeExports.jsx("option",{selected:h.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:f,...a,...o,required:u,multiple:d,name:l,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),h.map(t.options,g=>n.jsxRuntimeExports.jsx("option",{selected:h.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})},Te={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",props:{styles:e.T({default:""}),fieldName:e.g({title:"web_blocks.field_name",default:"select"}),showLabel:e.r({title:"web_blocks.show_label",default:!0}),inputStyles:e.T({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),required:e.r({title:"web_blocks.required",default:!1}),_multiple:e.r({title:"web_blocks.multiple",default:!1}),options:e.S({title:"web_blocks.options",itemProperties:{label:e.g({title:"web_blocks.label",default:""}),value:e.g({title:"web_blocks.value",default:""})}})}},Le=t=>{const{blockProps:o,fieldName:l,label:s,placeholder:r,styles:a,inputStyles:i,_rows:u,showLabel:c}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...a,...o,children:[c&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:d,placeholder:r,rows:u})]}):n.jsxRuntimeExports.jsx("textarea",{id:d,name:l,...o,...i,...a,placeholder:r,rows:u})},Se={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",props:{fieldName:e.g({title:"web_blocks.field_name",default:"textarea"}),showLabel:e.r({title:"web_blocks.show_label",default:!0}),styles:e.T({default:""}),inputStyles:e.T({default:"w-full p-1"}),label:e.g({title:"web_blocks.label",default:"Label"}),placeholder:e.g({title:"web_blocks.placeholder",default:"Placeholder"}),_rows:e.y({title:"web_blocks.rows",default:3})}},Me=t=>{const{blockProps:o,fieldName:l,label:s,styles:r,inputStyles:a,required:i,checked:u,showLabel:c=!0}=t,d=e.generateUUID();return c?n.jsxRuntimeExports.jsxs("div",{...r,...o,children:[n.jsxRuntimeExports.jsx("input",{...a,name:l,id:d,type:"checkbox",required:i,defaultChecked:u}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:d,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:d,...o,...a,...r,type:"checkbox",required:i,name:l})},Ne={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",props:{fieldName:e.g({title:"Field Name",default:"checkbox"}),styles:e.T({default:"flex items-center gap-x-2"}),label:e.g({title:"web_blocks.label",default:"Label"}),checked:e.r({title:"web_blocks.checked",default:!1}),required:e.r({title:"web_blocks.required",default:!1})}},Pe=()=>{p.registerChaiBlock(R,T),p.registerChaiBlock(P,$),p.registerChaiBlock(L,S),p.registerChaiBlock(q,H),p.registerChaiBlock(D,z),p.registerChaiBlock(A,U),p.registerChaiBlock(F,O),p.registerChaiBlock(G,V),p.registerChaiBlock(W,X),p.registerChaiBlock(Y,Z),p.registerChaiBlock(J,K),p.registerChaiBlock(Q,ee),p.registerChaiBlock(te,le),p.registerChaiBlock(se,re),p.registerChaiBlock(M,N),p.registerChaiBlock(ge,he),p.registerChaiBlock(_e,we),p.registerChaiBlock(ve,je),p.registerChaiBlock(Be,Ee),p.registerChaiBlock(Me,Ne),p.registerChaiBlock(Ie,Ce),p.registerChaiBlock(Re,Te),p.registerChaiBlock(Le,Se),p.registerChaiBlock(ye,xe),p.registerChaiBlock(fe,ke),p.registerChaiBlock(ae,ie),p.registerChaiBlock(ce,ue),p.registerChaiBlock(de,pe),p.registerChaiBlock(be,me)};exports.loadWebBlocks=Pe;