@chaibuilder/sdk 3.0.13 → 3.0.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.
- package/README.md +1 -2
- package/dist/{code-editor-DFvtVxXd.cjs → code-editor-D5uDqrW1.cjs} +1 -1
- package/dist/{code-editor-GydqqBXp.js → code-editor-e5WfREx8.js} +1 -1
- package/dist/core.cjs +66 -48
- package/dist/core.js +2564 -2481
- package/dist/{css-import-modal-BvRHCuHm.js → css-import-modal-CSVrt6lz.js} +1 -1
- package/dist/{css-import-modal-DkVfKE_h.cjs → css-import-modal-Cm49bHmT.cjs} +1 -1
- package/dist/sdk.css +1 -1
- package/dist/{toggle-DrRMNSqS.js → toggle-C5YXnEL9.js} +409 -409
- package/dist/toggle-Ca6BayTf.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +279 -253
- package/package.json +3 -2
- package/dist/toggle-BaUXILMJ.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),ft=require("@radix-ui/react-dropdown-menu"),f=require("@radix-ui/react-icons"),gt=require("react"),N=require("class-variance-authority"),g=require("cmdk"),xt=require("@radix-ui/react-dialog"),bt=require("@radix-ui/react-popover"),ht=require("@radix-ui/react-tooltip"),vt=require("@radix-ui/react-accordion"),yt=require("@radix-ui/react-alert-dialog"),Nt=require("@radix-ui/react-slot"),wt=require("@radix-ui/react-avatar"),Ct=require("@radix-ui/react-context-menu"),jt=require("@radix-ui/react-hover-card"),St=require("@radix-ui/react-label"),Rt=require("@radix-ui/react-scroll-area"),Dt=require("@radix-ui/react-select"),Tt=require("@radix-ui/react-separator"),kt=require("@radix-ui/react-slider"),It=require("@radix-ui/react-switch"),_t=require("@radix-ui/react-tabs"),Mt=require("@radix-ui/react-toggle"),At=require("clsx"),Pt=require("tailwind-merge");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const d=p(ft),s=p(gt),i=p(xt),v=p(bt),y=p(ht),b=p(vt),u=p(yt),w=p(wt),l=p(Ct),j=p(jt),z=p(St),x=p(Rt),c=p(Dt),q=p(Tt),C=p(kt),R=p(It),h=p(_t),L=p(Mt);function r(...e){return Pt.twMerge(At.clsx(e))}const S=N.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),H=s.forwardRef(({className:e,variant:t,size:a,asChild:n=!1,...m},pt)=>{const ut=n?Nt.Slot:"button";return o.jsx(ut,{className:r(S({variant:t,size:a,className:e})),ref:pt,...m})});H.displayName="Button";const zt=d.Root,qt=d.Trigger,Lt=d.Group,Ht=d.Portal,Gt=d.Sub,Vt=d.RadioGroup,G=s.forwardRef(({className:e,inset:t,children:a,...n},m)=>o.jsxs(d.SubTrigger,{ref:m,className:r("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[a,o.jsx(f.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));G.displayName=d.SubTrigger.displayName;const V=s.forwardRef(({className:e,...t},a)=>o.jsx(d.SubContent,{ref:a,className:r("z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));V.displayName=d.SubContent.displayName;const O=s.forwardRef(({className:e,sideOffset:t=4,...a},n)=>o.jsx(d.Portal,{children:o.jsx(d.Content,{ref:n,sideOffset:t,className:r("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","origin-[--radix-dropdown-menu-content-transform-origin] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));O.displayName=d.Content.displayName;const F=s.forwardRef(({className:e,inset:t,...a},n)=>o.jsx(d.Item,{ref:n,className:r("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));F.displayName=d.Item.displayName;const B=s.forwardRef(({className:e,children:t,checked:a,...n},m)=>o.jsxs(d.CheckboxItem,{ref:m,className:r("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(d.ItemIndicator,{children:o.jsx(f.CheckIcon,{className:"h-4 w-4"})})}),t]}));B.displayName=d.CheckboxItem.displayName;const U=s.forwardRef(({className:e,children:t,...a},n)=>o.jsxs(d.RadioItem,{ref:n,className:r("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(d.ItemIndicator,{children:o.jsx(f.CircleIcon,{className:"h-2 w-2 fill-current"})})}),t]}));U.displayName=d.RadioItem.displayName;const E=s.forwardRef(({className:e,inset:t,...a},n)=>o.jsx(d.Label,{ref:n,className:r("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));E.displayName=d.Label.displayName;const J=s.forwardRef(({className:e,...t},a)=>o.jsx(d.Separator,{ref:a,className:r("-mx-1 my-1 h-px bg-muted",e),...t}));J.displayName=d.Separator.displayName;const K=({className:e,...t})=>o.jsx("span",{className:r("ml-auto text-xs tracking-widest opacity-60",e),...t});K.displayName="DropdownMenuShortcut";const Ot=N.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Q=s.forwardRef(({className:e,variant:t,...a},n)=>o.jsx("div",{ref:n,role:"alert",className:r(Ot({variant:t}),e),...a}));Q.displayName="Alert";const W=s.forwardRef(({className:e,...t},a)=>o.jsx("h5",{ref:a,className:r("mb-1 font-medium leading-none tracking-tight",e),...t}));W.displayName="AlertTitle";const X=s.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:r("text-sm [&_p]:leading-relaxed",e),...t}));X.displayName="AlertDescription";const Y=s.forwardRef(({className:e,type:t,...a},n)=>o.jsx("input",{type:t,className:r("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...a}));Y.displayName="Input";const Z=i.Root,Ft=i.Trigger,$=i.Portal,Bt=i.Close,D=s.forwardRef(({className:e,...t},a)=>o.jsx(i.Overlay,{ref:a,className:r("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));D.displayName=i.Overlay.displayName;const T=s.forwardRef(({className:e,children:t,...a},n)=>o.jsxs($,{children:[o.jsx(D,{}),o.jsxs(i.Content,{ref:n,className:r("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,o.jsxs(i.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(f.Cross1Icon,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));T.displayName=i.Content.displayName;const ee=({className:e,...t})=>o.jsx("div",{className:r("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ee.displayName="DialogHeader";const te=({className:e,...t})=>o.jsx("div",{className:r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});te.displayName="DialogFooter";const ae=s.forwardRef(({className:e,...t},a)=>o.jsx(i.Title,{ref:a,className:r("text-lg font-semibold leading-none tracking-tight",e),...t}));ae.displayName=i.Title.displayName;const oe=s.forwardRef(({className:e,...t},a)=>o.jsx(i.Description,{ref:a,className:r("text-sm text-muted-foreground",e),...t}));oe.displayName=i.Description.displayName;const k=s.forwardRef(({className:e,...t},a)=>o.jsx(g.Command,{ref:a,className:r("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));k.displayName=g.Command.displayName;const Ut=({children:e,...t})=>o.jsx(Z,{...t,children:o.jsx(T,{className:"overflow-hidden p-0",children:o.jsx(k,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),re=s.forwardRef(({className:e,...t},a)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(f.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(g.Command.Input,{ref:a,className:r("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));re.displayName=g.Command.Input.displayName;const se=s.forwardRef(({className:e,...t},a)=>o.jsx(g.Command.List,{ref:a,className:r("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));se.displayName=g.Command.List.displayName;const ne=s.forwardRef((e,t)=>o.jsx(g.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));ne.displayName=g.Command.Empty.displayName;const ie=s.forwardRef(({className:e,...t},a)=>o.jsx(g.Command.Group,{ref:a,className:r("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));ie.displayName=g.Command.Group.displayName;const de=s.forwardRef(({className:e,...t},a)=>o.jsx(g.Command.Separator,{ref:a,className:r("-mx-1 h-px bg-border",e),...t}));de.displayName=g.Command.Separator.displayName;const le=s.forwardRef(({className:e,...t},a)=>o.jsx(g.Command.Item,{ref:a,className:r("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));le.displayName=g.Command.Item.displayName;const ce=({className:e,...t})=>o.jsx("span",{className:r("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ce.displayName="CommandShortcut";const Et=v.Root,Jt=v.Trigger,Kt=v.Anchor,me=s.forwardRef(({className:e,align:t="center",sideOffset:a=4,...n},m)=>o.jsx(v.Portal,{children:o.jsx(v.Content,{ref:m,align:t,sideOffset:a,className:r("z-50 w-72 origin-[--radix-popover-content-transform-origin] rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));me.displayName=v.Content.displayName;const Qt=y.Provider,Wt=y.Root,Xt=y.Trigger,pe=s.forwardRef(({className:e,sideOffset:t=4,...a},n)=>o.jsx(y.Portal,{children:o.jsx(y.Content,{ref:n,sideOffset:t,className:r("z-50 origin-[--radix-tooltip-content-transform-origin] overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));pe.displayName=y.Content.displayName;const Yt=b.Root,ue=s.forwardRef(({className:e,...t},a)=>o.jsx(b.Item,{ref:a,className:r("border-b",e),...t}));ue.displayName="AccordionItem";const fe=s.forwardRef(({className:e,children:t,...a},n)=>o.jsx(b.Header,{className:"flex",children:o.jsxs(b.Trigger,{ref:n,className:r("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...a,children:[t,o.jsx(f.ChevronDownIcon,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));fe.displayName=b.Trigger.displayName;const ge=s.forwardRef(({className:e,children:t,...a},n)=>o.jsx(b.Content,{ref:n,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...a,children:o.jsx("div",{className:r("pb-4 pt-0",e),children:t})}));ge.displayName=b.Content.displayName;const Zt=u.Root,$t=u.Trigger,xe=u.Portal,I=s.forwardRef(({className:e,...t},a)=>o.jsx(u.Overlay,{className:r("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));I.displayName=u.Overlay.displayName;const be=s.forwardRef(({className:e,...t},a)=>o.jsxs(xe,{children:[o.jsx(I,{}),o.jsx(u.Content,{ref:a,className:r("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));be.displayName=u.Content.displayName;const he=({className:e,...t})=>o.jsx("div",{className:r("flex flex-col space-y-2 text-center sm:text-left",e),...t});he.displayName="AlertDialogHeader";const ve=({className:e,...t})=>o.jsx("div",{className:r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ve.displayName="AlertDialogFooter";const ye=s.forwardRef(({className:e,...t},a)=>o.jsx(u.Title,{ref:a,className:r("text-lg font-semibold",e),...t}));ye.displayName=u.Title.displayName;const Ne=s.forwardRef(({className:e,...t},a)=>o.jsx(u.Description,{ref:a,className:r("text-sm text-muted-foreground",e),...t}));Ne.displayName=u.Description.displayName;const we=s.forwardRef(({className:e,...t},a)=>o.jsx(u.Action,{ref:a,className:r(S(),e),...t}));we.displayName=u.Action.displayName;const Ce=s.forwardRef(({className:e,...t},a)=>o.jsx(u.Cancel,{ref:a,className:r(S({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ce.displayName=u.Cancel.displayName;const je=s.forwardRef(({className:e,...t},a)=>o.jsx(w.Root,{ref:a,className:r("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));je.displayName=w.Root.displayName;const Se=s.forwardRef(({className:e,...t},a)=>o.jsx(w.Image,{ref:a,className:r("aspect-square h-full w-full",e),...t}));Se.displayName=w.Image.displayName;const Re=s.forwardRef(({className:e,...t},a)=>o.jsx(w.Fallback,{ref:a,className:r("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Re.displayName=w.Fallback.displayName;const De=N.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ea({className:e,variant:t,...a}){return o.jsx("div",{className:r(De({variant:t}),e),...a})}const Te=s.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:r("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Te.displayName="Card";const ke=s.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:r("flex flex-col space-y-1.5 p-6",e),...t}));ke.displayName="CardHeader";const Ie=s.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:r("font-semibold leading-none tracking-tight",e),...t}));Ie.displayName="CardTitle";const _e=s.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:r("text-sm text-muted-foreground",e),...t}));_e.displayName="CardDescription";const Me=s.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:r("p-6 pt-0",e),...t}));Me.displayName="CardContent";const Ae=s.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:r("flex items-center p-6 pt-0",e),...t}));Ae.displayName="CardFooter";const ta=l.Root,aa=l.Trigger,oa=l.Group,ra=l.Portal,sa=l.Sub,na=l.RadioGroup,Pe=s.forwardRef(({className:e,inset:t,children:a,...n},m)=>o.jsxs(l.SubTrigger,{ref:m,className:r("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[a,o.jsx(f.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Pe.displayName=l.SubTrigger.displayName;const ze=s.forwardRef(({className:e,...t},a)=>o.jsx(l.SubContent,{ref:a,className:r("z-50 min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));ze.displayName=l.SubContent.displayName;const qe=s.forwardRef(({className:e,...t},a)=>o.jsx(l.Portal,{children:o.jsx(l.Content,{ref:a,className:r("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));qe.displayName=l.Content.displayName;const Le=s.forwardRef(({className:e,inset:t,...a},n)=>o.jsx(l.Item,{ref:n,className:r("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...a}));Le.displayName=l.Item.displayName;const He=s.forwardRef(({className:e,children:t,checked:a,...n},m)=>o.jsxs(l.CheckboxItem,{ref:m,className:r("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(l.ItemIndicator,{children:o.jsx(f.CheckIcon,{className:"h-4 w-4"})})}),t]}));He.displayName=l.CheckboxItem.displayName;const Ge=s.forwardRef(({className:e,children:t,...a},n)=>o.jsxs(l.RadioItem,{ref:n,className:r("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(l.ItemIndicator,{children:o.jsx(f.CircleIcon,{className:"h-2 w-2 fill-current"})})}),t]}));Ge.displayName=l.RadioItem.displayName;const Ve=s.forwardRef(({className:e,inset:t,...a},n)=>o.jsx(l.Label,{ref:n,className:r("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...a}));Ve.displayName=l.Label.displayName;const Oe=s.forwardRef(({className:e,...t},a)=>o.jsx(l.Separator,{ref:a,className:r("-mx-1 my-1 h-px bg-border",e),...t}));Oe.displayName=l.Separator.displayName;const Fe=({className:e,...t})=>o.jsx("span",{className:r("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Fe.displayName="ContextMenuShortcut";const ia=j.Root,da=j.Trigger,Be=s.forwardRef(({className:e,align:t="center",sideOffset:a=4,...n},m)=>o.jsx(j.Content,{ref:m,align:t,sideOffset:a,className:r("z-50 w-64 origin-[--radix-hover-card-content-transform-origin] rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Be.displayName=j.Content.displayName;const la=N.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ue=s.forwardRef(({className:e,...t},a)=>o.jsx(z.Root,{ref:a,className:r(la(),e),...t}));Ue.displayName=z.Root.displayName;const Ee=s.forwardRef(({className:e,children:t,...a},n)=>o.jsxs(x.Root,{ref:n,className:r("relative overflow-hidden",e),...a,children:[o.jsx(x.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(_,{}),o.jsx(x.Corner,{})]}));Ee.displayName=x.Root.displayName;const _=s.forwardRef(({className:e,orientation:t="vertical",...a},n)=>o.jsx(x.ScrollAreaScrollbar,{ref:n,orientation:t,className:r("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:o.jsx(x.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));_.displayName=x.ScrollAreaScrollbar.displayName;const ca=c.Root,ma=c.Group,pa=c.Value,Je=s.forwardRef(({className:e,children:t,...a},n)=>o.jsxs(c.Trigger,{ref:n,className:r("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",e),...a,children:[t,o.jsx(c.Icon,{asChild:!0,children:o.jsx(f.ChevronDownIcon,{className:"h-4 w-4 opacity-50"})})]}));Je.displayName=c.Trigger.displayName;const M=s.forwardRef(({className:e,...t},a)=>o.jsx(c.ScrollUpButton,{ref:a,className:r("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(f.ChevronUpIcon,{className:"h-4 w-4"})}));M.displayName=c.ScrollUpButton.displayName;const A=s.forwardRef(({className:e,...t},a)=>o.jsx(c.ScrollDownButton,{ref:a,className:r("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(f.ChevronDownIcon,{className:"h-4 w-4"})}));A.displayName=c.ScrollDownButton.displayName;const Ke=s.forwardRef(({className:e,children:t,position:a="popper",...n},m)=>o.jsx(c.Portal,{children:o.jsxs(c.Content,{ref:m,className:r("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...n,children:[o.jsx(M,{}),o.jsx(c.Viewport,{className:r("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(A,{})]})}));Ke.displayName=c.Content.displayName;const Qe=s.forwardRef(({className:e,...t},a)=>o.jsx(c.Label,{ref:a,className:r("px-2 py-1.5 text-sm font-semibold",e),...t}));Qe.displayName=c.Label.displayName;const We=s.forwardRef(({className:e,children:t,...a},n)=>o.jsxs(c.Item,{ref:n,className:r("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(c.ItemIndicator,{children:o.jsx(f.CheckIcon,{className:"h-4 w-4"})})}),o.jsx(c.ItemText,{children:t})]}));We.displayName=c.Item.displayName;const Xe=s.forwardRef(({className:e,...t},a)=>o.jsx(c.Separator,{ref:a,className:r("-mx-1 my-1 h-px bg-muted",e),...t}));Xe.displayName=c.Separator.displayName;const Ye=s.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...n},m)=>o.jsx(q.Root,{ref:m,decorative:a,orientation:t,className:r("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Ye.displayName=q.Root.displayName;const ua=i.Root,fa=i.Trigger,ga=i.Close,Ze=i.Portal,P=s.forwardRef(({className:e,...t},a)=>o.jsx(i.Overlay,{className:r("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));P.displayName=i.Overlay.displayName;const xa=N.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),$e=s.forwardRef(({side:e="right",className:t,children:a,...n},m)=>o.jsxs(Ze,{children:[o.jsx(P,{}),o.jsxs(i.Content,{ref:m,className:r(xa({side:e}),t),...n,children:[o.jsxs(i.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o.jsx(f.Cross1Icon,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));$e.displayName=i.Content.displayName;const et=({className:e,...t})=>o.jsx("div",{className:r("flex flex-col space-y-2 text-center sm:text-left",e),...t});et.displayName="SheetHeader";const tt=({className:e,...t})=>o.jsx("div",{className:r("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});tt.displayName="SheetFooter";const at=s.forwardRef(({className:e,...t},a)=>o.jsx(i.Title,{ref:a,className:r("text-lg font-semibold text-foreground",e),...t}));at.displayName=i.Title.displayName;const ot=s.forwardRef(({className:e,...t},a)=>o.jsx(i.Description,{ref:a,className:r("text-sm text-muted-foreground",e),...t}));ot.displayName=i.Description.displayName;function ba({className:e,...t}){return o.jsx("div",{className:r("animate-pulse rounded-md bg-primary/10",e),...t})}const rt=s.forwardRef(({className:e,...t},a)=>o.jsxs(C.Root,{ref:a,className:r("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx(C.Track,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral-300",children:o.jsx(C.Range,{className:"absolute h-full bg-neutral-900"})}),o.jsx(C.Thumb,{className:"block h-4 w-4 rounded-full border border-neutral-900 bg-neutral-900 shadow transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-900 disabled:pointer-events-none disabled:opacity-50"})]}));rt.displayName=C.Root.displayName;const st=s.forwardRef(({className:e,thumbClassName:t,...a},n)=>o.jsx(R.Root,{className:r("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...a,ref:n,children:o.jsx(R.Thumb,{className:r("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform",t,"data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0")})}));st.displayName=R.Root.displayName;const ha=h.Root,nt=s.forwardRef(({className:e,...t},a)=>o.jsx(h.List,{ref:a,className:r("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));nt.displayName=h.List.displayName;const it=s.forwardRef(({className:e,...t},a)=>o.jsx(h.Trigger,{ref:a,className:r("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all 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=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));it.displayName=h.Trigger.displayName;const dt=s.forwardRef(({className:e,...t},a)=>o.jsx(h.Content,{ref:a,className:r("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));dt.displayName=h.Content.displayName;const lt=s.forwardRef(({className:e,...t},a)=>o.jsx("textarea",{className:r("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...t}));lt.displayName="Textarea";const ct=N.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),mt=s.forwardRef(({className:e,variant:t,size:a,...n},m)=>o.jsx(L.Root,{ref:m,className:r(ct({variant:t,size:a,className:e})),...n}));mt.displayName=L.Root.displayName;exports.Accordion=Yt;exports.AccordionContent=ge;exports.AccordionItem=ue;exports.AccordionTrigger=fe;exports.Alert=Q;exports.AlertDescription=X;exports.AlertDialog=Zt;exports.AlertDialogAction=we;exports.AlertDialogCancel=Ce;exports.AlertDialogContent=be;exports.AlertDialogDescription=Ne;exports.AlertDialogFooter=ve;exports.AlertDialogHeader=he;exports.AlertDialogOverlay=I;exports.AlertDialogPortal=xe;exports.AlertDialogTitle=ye;exports.AlertDialogTrigger=$t;exports.AlertTitle=W;exports.Avatar=je;exports.AvatarFallback=Re;exports.AvatarImage=Se;exports.Badge=ea;exports.Button=H;exports.Card=Te;exports.CardContent=Me;exports.CardDescription=_e;exports.CardFooter=Ae;exports.CardHeader=ke;exports.CardTitle=Ie;exports.Command=k;exports.CommandDialog=Ut;exports.CommandEmpty=ne;exports.CommandGroup=ie;exports.CommandInput=re;exports.CommandItem=le;exports.CommandList=se;exports.CommandSeparator=de;exports.CommandShortcut=ce;exports.ContextMenu=ta;exports.ContextMenuCheckboxItem=He;exports.ContextMenuContent=qe;exports.ContextMenuGroup=oa;exports.ContextMenuItem=Le;exports.ContextMenuLabel=Ve;exports.ContextMenuPortal=ra;exports.ContextMenuRadioGroup=na;exports.ContextMenuRadioItem=Ge;exports.ContextMenuSeparator=Oe;exports.ContextMenuShortcut=Fe;exports.ContextMenuSub=sa;exports.ContextMenuSubContent=ze;exports.ContextMenuSubTrigger=Pe;exports.ContextMenuTrigger=aa;exports.Dialog=Z;exports.DialogClose=Bt;exports.DialogContent=T;exports.DialogDescription=oe;exports.DialogFooter=te;exports.DialogHeader=ee;exports.DialogOverlay=D;exports.DialogPortal=$;exports.DialogTitle=ae;exports.DialogTrigger=Ft;exports.DropdownMenu=zt;exports.DropdownMenuCheckboxItem=B;exports.DropdownMenuContent=O;exports.DropdownMenuGroup=Lt;exports.DropdownMenuItem=F;exports.DropdownMenuLabel=E;exports.DropdownMenuPortal=Ht;exports.DropdownMenuRadioGroup=Vt;exports.DropdownMenuRadioItem=U;exports.DropdownMenuSeparator=J;exports.DropdownMenuShortcut=K;exports.DropdownMenuSub=Gt;exports.DropdownMenuSubContent=V;exports.DropdownMenuSubTrigger=G;exports.DropdownMenuTrigger=qt;exports.HoverCard=ia;exports.HoverCardContent=Be;exports.HoverCardTrigger=da;exports.Input=Y;exports.Label=Ue;exports.Popover=Et;exports.PopoverAnchor=Kt;exports.PopoverContent=me;exports.PopoverTrigger=Jt;exports.ScrollArea=Ee;exports.ScrollBar=_;exports.Select=ca;exports.SelectContent=Ke;exports.SelectGroup=ma;exports.SelectItem=We;exports.SelectLabel=Qe;exports.SelectScrollDownButton=A;exports.SelectScrollUpButton=M;exports.SelectSeparator=Xe;exports.SelectTrigger=Je;exports.SelectValue=pa;exports.Separator=Ye;exports.Sheet=ua;exports.SheetClose=ga;exports.SheetContent=$e;exports.SheetDescription=ot;exports.SheetFooter=tt;exports.SheetHeader=et;exports.SheetOverlay=P;exports.SheetPortal=Ze;exports.SheetTitle=at;exports.SheetTrigger=fa;exports.Skeleton=ba;exports.Slider=rt;exports.Switch=st;exports.Tabs=ha;exports.TabsContent=dt;exports.TabsList=nt;exports.TabsTrigger=it;exports.Textarea=lt;exports.Toggle=mt;exports.Tooltip=Wt;exports.TooltipContent=pe;exports.TooltipProvider=Qt;exports.TooltipTrigger=Xt;exports.badgeVariants=De;exports.buttonVariants=S;exports.cn=r;exports.toggleVariants=ct;
|
package/dist/ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./toggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./toggle-Ca6BayTf.cjs");exports.Accordion=e.Accordion;exports.AccordionContent=e.AccordionContent;exports.AccordionItem=e.AccordionItem;exports.AccordionTrigger=e.AccordionTrigger;exports.Alert=e.Alert;exports.AlertDescription=e.AlertDescription;exports.AlertDialog=e.AlertDialog;exports.AlertDialogAction=e.AlertDialogAction;exports.AlertDialogCancel=e.AlertDialogCancel;exports.AlertDialogContent=e.AlertDialogContent;exports.AlertDialogDescription=e.AlertDialogDescription;exports.AlertDialogFooter=e.AlertDialogFooter;exports.AlertDialogHeader=e.AlertDialogHeader;exports.AlertDialogOverlay=e.AlertDialogOverlay;exports.AlertDialogPortal=e.AlertDialogPortal;exports.AlertDialogTitle=e.AlertDialogTitle;exports.AlertDialogTrigger=e.AlertDialogTrigger;exports.AlertTitle=e.AlertTitle;exports.Avatar=e.Avatar;exports.AvatarFallback=e.AvatarFallback;exports.AvatarImage=e.AvatarImage;exports.Badge=e.Badge;exports.Button=e.Button;exports.Card=e.Card;exports.CardContent=e.CardContent;exports.CardDescription=e.CardDescription;exports.CardFooter=e.CardFooter;exports.CardHeader=e.CardHeader;exports.CardTitle=e.CardTitle;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandGroup=e.CommandGroup;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandSeparator=e.CommandSeparator;exports.CommandShortcut=e.CommandShortcut;exports.ContextMenu=e.ContextMenu;exports.ContextMenuCheckboxItem=e.ContextMenuCheckboxItem;exports.ContextMenuContent=e.ContextMenuContent;exports.ContextMenuGroup=e.ContextMenuGroup;exports.ContextMenuItem=e.ContextMenuItem;exports.ContextMenuLabel=e.ContextMenuLabel;exports.ContextMenuPortal=e.ContextMenuPortal;exports.ContextMenuRadioGroup=e.ContextMenuRadioGroup;exports.ContextMenuRadioItem=e.ContextMenuRadioItem;exports.ContextMenuSeparator=e.ContextMenuSeparator;exports.ContextMenuShortcut=e.ContextMenuShortcut;exports.ContextMenuSub=e.ContextMenuSub;exports.ContextMenuSubContent=e.ContextMenuSubContent;exports.ContextMenuSubTrigger=e.ContextMenuSubTrigger;exports.ContextMenuTrigger=e.ContextMenuTrigger;exports.Dialog=e.Dialog;exports.DialogClose=e.DialogClose;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogOverlay=e.DialogOverlay;exports.DialogPortal=e.DialogPortal;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.DropdownMenu=e.DropdownMenu;exports.DropdownMenuCheckboxItem=e.DropdownMenuCheckboxItem;exports.DropdownMenuContent=e.DropdownMenuContent;exports.DropdownMenuGroup=e.DropdownMenuGroup;exports.DropdownMenuItem=e.DropdownMenuItem;exports.DropdownMenuLabel=e.DropdownMenuLabel;exports.DropdownMenuPortal=e.DropdownMenuPortal;exports.DropdownMenuRadioGroup=e.DropdownMenuRadioGroup;exports.DropdownMenuRadioItem=e.DropdownMenuRadioItem;exports.DropdownMenuSeparator=e.DropdownMenuSeparator;exports.DropdownMenuShortcut=e.DropdownMenuShortcut;exports.DropdownMenuSub=e.DropdownMenuSub;exports.DropdownMenuSubContent=e.DropdownMenuSubContent;exports.DropdownMenuSubTrigger=e.DropdownMenuSubTrigger;exports.DropdownMenuTrigger=e.DropdownMenuTrigger;exports.HoverCard=e.HoverCard;exports.HoverCardContent=e.HoverCardContent;exports.HoverCardTrigger=e.HoverCardTrigger;exports.Input=e.Input;exports.Label=e.Label;exports.Popover=e.Popover;exports.PopoverAnchor=e.PopoverAnchor;exports.PopoverContent=e.PopoverContent;exports.PopoverTrigger=e.PopoverTrigger;exports.ScrollArea=e.ScrollArea;exports.ScrollBar=e.ScrollBar;exports.Select=e.Select;exports.SelectContent=e.SelectContent;exports.SelectGroup=e.SelectGroup;exports.SelectItem=e.SelectItem;exports.SelectLabel=e.SelectLabel;exports.SelectScrollDownButton=e.SelectScrollDownButton;exports.SelectScrollUpButton=e.SelectScrollUpButton;exports.SelectSeparator=e.SelectSeparator;exports.SelectTrigger=e.SelectTrigger;exports.SelectValue=e.SelectValue;exports.Separator=e.Separator;exports.Sheet=e.Sheet;exports.SheetClose=e.SheetClose;exports.SheetContent=e.SheetContent;exports.SheetDescription=e.SheetDescription;exports.SheetFooter=e.SheetFooter;exports.SheetHeader=e.SheetHeader;exports.SheetOverlay=e.SheetOverlay;exports.SheetPortal=e.SheetPortal;exports.SheetTitle=e.SheetTitle;exports.SheetTrigger=e.SheetTrigger;exports.Skeleton=e.Skeleton;exports.Slider=e.Slider;exports.Switch=e.Switch;exports.Tabs=e.Tabs;exports.TabsContent=e.TabsContent;exports.TabsList=e.TabsList;exports.TabsTrigger=e.TabsTrigger;exports.Textarea=e.Textarea;exports.Toggle=e.Toggle;exports.Tooltip=e.Tooltip;exports.TooltipContent=e.TooltipContent;exports.TooltipProvider=e.TooltipProvider;exports.TooltipTrigger=e.TooltipTrigger;exports.badgeVariants=e.badgeVariants;exports.buttonVariants=e.buttonVariants;exports.toggleVariants=e.toggleVariants;
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as o, c as t, a as s, b as r, d as n, e as l, g as i, h as g, i as u, j as C, k as d, l as p, m as D, n as S, o as c, p as m, q as M, f as T, r as b, t as A, s as x, B as h, v as w, C as v, x as I, y as P, z as H, D as G, E as L, F as B, G as F, J as k, K as y, H as R, L as V, I as O, N as f, M as E, O as U, P as j, Q as q, R as z, S as J, T as K, U as N, V as Q, W, X, Y, Z, _, $, a0 as aa, a1 as ea, a2 as oa, a3 as ta, a4 as sa, a5 as ra, a6 as na, a7 as la, a8 as ia, a9 as ga, aa as ua, ab as Ca, ac as da, ad as pa, ae as Da, af as Sa, ag as ca, ah as ma, ai as Ma, aj as Ta, ak as ba, al as Aa, am as xa, an as ha, ao as wa, ap as va, aq as Ia, ar as Pa, as as Ha, at as Ga, au as La, av as Ba, aw as Fa, ax as ka, ay as ya, az as Ra, aA as Va, aB as Oa, aC as fa, aD as Ea, aE as Ua, aF as ja, aG as qa, aH as za, aI as Ja, aJ as Ka, aK as Na, aL as Qa, aM as Wa, aN as Xa, aO as Ya, aP as Za, aQ as _a, aR as $a, aS as ae, aT as ee, aU as oe, aV as te, aW as se, aX as re, aY as ne, aZ as le, a_ as ie, a$ as ge, b0 as ue, b1 as Ce, b2 as de, b4 as pe, b5 as De, b6 as Se, b7 as ce, u as me, w as Me, b3 as Te } from "./toggle-
|
|
1
|
+
import { A as o, c as t, a as s, b as r, d as n, e as l, g as i, h as g, i as u, j as C, k as d, l as p, m as D, n as S, o as c, p as m, q as M, f as T, r as b, t as A, s as x, B as h, v as w, C as v, x as I, y as P, z as H, D as G, E as L, F as B, G as F, J as k, K as y, H as R, L as V, I as O, N as f, M as E, O as U, P as j, Q as q, R as z, S as J, T as K, U as N, V as Q, W, X, Y, Z, _, $, a0 as aa, a1 as ea, a2 as oa, a3 as ta, a4 as sa, a5 as ra, a6 as na, a7 as la, a8 as ia, a9 as ga, aa as ua, ab as Ca, ac as da, ad as pa, ae as Da, af as Sa, ag as ca, ah as ma, ai as Ma, aj as Ta, ak as ba, al as Aa, am as xa, an as ha, ao as wa, ap as va, aq as Ia, ar as Pa, as as Ha, at as Ga, au as La, av as Ba, aw as Fa, ax as ka, ay as ya, az as Ra, aA as Va, aB as Oa, aC as fa, aD as Ea, aE as Ua, aF as ja, aG as qa, aH as za, aI as Ja, aJ as Ka, aK as Na, aL as Qa, aM as Wa, aN as Xa, aO as Ya, aP as Za, aQ as _a, aR as $a, aS as ae, aT as ee, aU as oe, aV as te, aW as se, aX as re, aY as ne, aZ as le, a_ as ie, a$ as ge, b0 as ue, b1 as Ce, b2 as de, b4 as pe, b5 as De, b6 as Se, b7 as ce, u as me, w as Me, b3 as Te } from "./toggle-C5YXnEL9.js";
|
|
2
2
|
export {
|
|
3
3
|
o as Accordion,
|
|
4
4
|
t as AccordionContent,
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@chaibuilder/runtime"),s=require("react/jsx-runtime"),C=require("./common-functions-BZmyleS1.cjs"),x=require("react"),u=require("@radix-ui/react-icons"),d=require("lodash-es");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const y=j(x),k=({className:e="",inBuilder:o})=>o?s.jsx("div",{className:C.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:s.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:s.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,L=e=>{const{blockProps:o,inBuilder:t,backgroundImage:r,children:i,tag:a="div",styles:n}=e;let c=i;i||(c=s.jsx(k,{inBuilder:t}));let p={};return r&&(p={backgroundImage:`url(${r})`}),y.createElement(a,{...o,...n,style:p},c)},N={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]},backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image"}}}}),canAcceptBlock:()=>!0},_=e=>{const{blockProps:o,iconSize:t,icon:r,content:i,styles:a,children:n,iconPos:c,link:p,inBuilder:m}=e,g=r,h=n||s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{children:i}),g&&s.jsx("div",{style:{width:t+"px"},className:c+" "+(i?c==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:g}})]}),f=x.createElement("button",{...o,...a,type:"button","aria-label":i},h);return d.isEmpty(d.get(p,"href"))?f:m?s.jsx("span",{children:f}):s.jsx("a",{"aria-label":i,href:d.get(p,"href")||"/",target:d.get(p,"target","_self"),children:f})},T={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:u.ButtonIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!0,title:"Prefetch Link"}}}),i18nProps:["content","link"],aiProps:["content"]},E=e=>{const{blockProps:o,styles:t,htmlCode:r,inBuilder:i}=e;return i?s.jsxs("div",{className:"relative",children:[i?s.jsx("div",{...o,...t,className:"absolute z-20 h-full w-full"}):null,y.createElement("div",{...t,dangerouslySetInnerHTML:{__html:r.replace(/<script.*?>.*?<\/script>/g,"")}})]}):y.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:r}})},R={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:u.CodeIcon,group:"advanced",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]},M=e=>{const{scripts:o,inBuilder:t,blockProps:r}=e;return t?s.jsx("div",{...r,children:s.jsx("div",{className:C.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:s.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:s.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.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},A={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:u.CodeIcon,group:"advanced",...l.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}}),hidden:!0},H=e=>{const{blockProps:o,styles:t}=e;return x.createElement("hr",{...t,...o})},$={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:u.DividerHorizontalIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},D=e=>{const{blockProps:o,styles:t,backgroundImage:r}=e;let i={};return r&&(i={backgroundImage:`url(${r})`}),y.createElement("div",{...o,...t,style:i})},z={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image"}}}})},V=e=>{const{blockProps:o,fieldName:t,label:r,styles:i,inputStyles:a,required:n,checked:c,showLabel:p=!0}=e;return p?s.jsxs("div",{...i,...o,children:[s.jsx("input",{...a,name:t,type:"checkbox",required:n,defaultChecked:c}),r&&s.jsx("label",{htmlFor:t,children:r})]}):s.jsx("input",{name:t,...o,...a,...i,type:"checkbox",required:n,defaultChecked:c})},U={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:u.CheckboxIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("flex items-center gap-x-2"),inputStyles:l.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},F=e=>{const{children:o,blockProps:t,errorMessage:r,successMessage:i,action:a,styles:n,inBuilder:c}=e;let p=o;o||(p=s.jsx(k,{inBuilder:c}));const m={"x-data":"{}","x-on:submit.prevent":"post"},g={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return s.jsxs("form",{...m,"data-error":r,"data-success":i,method:"post",action:a,...t,...n,children:[s.jsx("div",{...g}),p]})},q={type:"Form",label:"Form",category:"core",icon:u.FileTextIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},O=e=>{const{blockProps:o,inBuilder:t,label:r,styles:i,icon:a,iconSize:n,iconPos:c}=e;return s.jsxs("button",{...i,...o||{},type:t?"button":"submit","aria-label":r,children:[r,a&&s.jsx("div",{style:{width:n+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Z={type:"FormButton",label:"Submit Button",category:"core",icon:u.ButtonIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},G=e=>{const o={type:"text",autocomplete:"on"};return e?["text","password","number","hidden","range","color","date","time"].includes(e)?{type:e,autocomplete:"on"}:e==="email"?{type:"email",autocomplete:"email"}:e==="tel"?{type:"tel",autocomplete:"tel"}:e==="url"?{type:"url",autocomplete:"url"}:{off:{type:"text",autocomplete:"off"},on:{type:"text",autocomplete:"on"},name:{type:"text",autocomplete:"name"},"honorific-prefix":{type:"text",autocomplete:"honorific-prefix"},"given-name":{type:"text",autocomplete:"given-name"},"additional-name":{type:"text",autocomplete:"additional-name"},"family-name":{type:"text",autocomplete:"family-name"},"honorific-suffix":{type:"text",autocomplete:"honorific-suffix"},nickname:{type:"text",autocomplete:"nickname"},firstName:{type:"text",autocomplete:"given-name"},lastName:{type:"text",autocomplete:"family-name"},email:{type:"email",autocomplete:"email"},tel:{type:"tel",autocomplete:"tel"},"tel-country-code":{type:"tel",autocomplete:"tel-country-code"},"tel-national":{type:"tel",autocomplete:"tel-national"},"tel-area-code":{type:"tel",autocomplete:"tel-area-code"},"tel-local":{type:"tel",autocomplete:"tel-local"},"tel-extension":{type:"tel",autocomplete:"tel-extension"},"street-address":{type:"text",autocomplete:"street-address"},"address-line1":{type:"text",autocomplete:"address-line1"},"address-line2":{type:"text",autocomplete:"address-line2"},"address-line3":{type:"text",autocomplete:"address-line3"},"address-level1":{type:"text",autocomplete:"address-level1"},"address-level2":{type:"text",autocomplete:"address-level2"},"address-level3":{type:"text",autocomplete:"address-level3"},"address-level4":{type:"text",autocomplete:"address-level4"},country:{type:"text",autocomplete:"country"},"country-name":{type:"text",autocomplete:"country-name"},"postal-code":{type:"text",autocomplete:"postal-code"},"cc-name":{type:"text",autocomplete:"cc-name"},"cc-given-name":{type:"text",autocomplete:"cc-given-name"},"cc-additional-name":{type:"text",autocomplete:"cc-additional-name"},"cc-family-name":{type:"text",autocomplete:"cc-family-name"},"cc-number":{type:"text",autocomplete:"cc-number"},"cc-exp":{type:"text",autocomplete:"cc-exp"},"cc-exp-month":{type:"number",autocomplete:"cc-exp-month"},"cc-exp-year":{type:"number",autocomplete:"cc-exp-year"},"cc-csc":{type:"text",autocomplete:"cc-csc"},"cc-type":{type:"text",autocomplete:"cc-type"},bday:{type:"date",autocomplete:"bday"},"bday-day":{type:"number",autocomplete:"bday-day"},"bday-month":{type:"number",autocomplete:"bday-month"},"bday-year":{type:"number",autocomplete:"bday-year"},username:{type:"text",autocomplete:"username"},"new-password":{type:"password",autocomplete:"new-password"},"current-password":{type:"password",autocomplete:"current-password"},"one-time-code":{type:"text",autocomplete:"one-time-code"},"transaction-currency":{type:"text",autocomplete:"transaction-currency"},"transaction-amount":{type:"number",autocomplete:"transaction-amount"},url:{type:"url",autocomplete:"url"},photo:{type:"url",autocomplete:"photo"},sex:{type:"text",autocomplete:"sex"},"organization-title":{type:"text",autocomplete:"organization-title"},organization:{type:"text",autocomplete:"organization"},language:{type:"text",autocomplete:"language"}}[e]||o:o},W=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:i,styles:a,inputStyles:n,showLabel:c,required:p,inputType:m,defaultValue:g}=e,{type:h,autocomplete:f}=G(m);return c?s.jsxs("div",{...a,...o,children:[c&&s.jsx("label",{htmlFor:t,children:r}),s.jsx("input",{name:t,defaultValue:g,...n,type:h,placeholder:i,required:p,autoComplete:f})]}):s.jsx("input",{name:t,...o,...n,...a,type:h,placeholder:i,required:p,autoComplete:f,defaultValue:g})},Y={type:"Input",label:"web_blocks.input",category:"core",icon:u.InputIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"firstName",title:"First Name"},{const:"lastName",title:"Last Name"},{const:"tel-country-code",title:"Telephone Country Code"},{const:"tel-national",title:"Telephone National"},{const:"tel-area-code",title:"Telephone Area Code"},{const:"tel-local",title:"Telephone Local"},{const:"tel-extension",title:"Telephone Extension"},{const:"street-address",title:"Street Address"},{const:"address-line1",title:"Address Line 1"},{const:"address-line2",title:"Address Line 2"},{const:"address-line3",title:"Address Line 3"},{const:"address-level1",title:"Address Level 1"},{const:"address-level2",title:"Address Level 2"},{const:"address-level3",title:"Address Level 3"},{const:"address-level4",title:"Address Level 4"},{const:"country",title:"Country"},{const:"country-name",title:"Country Name"},{const:"postal-code",title:"Postal Code"},{const:"cc-name",title:"Credit Card Name"},{const:"cc-number",title:"Credit Card Number"},{const:"cc-exp",title:"Credit Card Expiry"},{const:"cc-exp-month",title:"Credit Card Expiry Month"},{const:"cc-exp-year",title:"Credit Card Expiry Year"},{const:"cc-csc",title:"Credit Card CSC"},{const:"cc-type",title:"Credit Card Type"},{const:"bday",title:"Birthday"},{const:"bday-day",title:"Birthday Day"},{const:"bday-month",title:"Birthday Month"},{const:"bday-year",title:"Birthday Year"},{const:"username",title:"Username"},{const:"new-password",title:"New Password"},{const:"current-password",title:"Current Password"},{const:"one-time-code",title:"One Time Code"},{const:"transaction-currency",title:"Transaction Currency"},{const:"transaction-amount",title:"Transaction Amount"},{const:"url",title:"URL"},{const:"photo",title:"Photo"},{const:"sex",title:"Sex"},{const:"organization-title",title:"Organization Title"},{const:"organization",title:"Organization"},{const:"language",title:"Language"}]},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Q=e=>{const{blockProps:o,content:t,styles:r,children:i}=e,a={...r,...o};return i?y.createElement("label",a,i):y.createElement("label",{...a,dangerouslySetInnerHTML:{__html:t}})},J={type:"Label",label:"Label",category:"core",icon:u.LetterCaseToggleIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},X=e=>{const{blockProps:o,fieldName:t,label:r,styles:i,inputStyles:a,required:n,checked:c,showLabel:p=!0}=e;return p?s.jsxs("div",{...i,...o,children:[s.jsx("input",{...a,name:t,type:"radio",required:n,defaultChecked:c}),r&&s.jsx("label",{htmlFor:t,children:r})]}):s.jsx("input",{name:t,...o,...a,...i,type:"radio",required:n,checked:c})},K={type:"Radio",label:"web_blocks.radio",category:"core",icon:u.RadiobuttonIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("flex items-center gap-x-2"),inputStyles:l.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},ee=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:i,styles:a,inputStyles:n,required:c,showLabel:p,_multiple:m,options:g,defaultValue:h}=e,f=m&&h?h.split(",").map(b=>b.trim()):h||"";return p?s.jsxs("div",{...a,...o,children:[p&&s.jsx("label",{htmlFor:t,children:r}),s.jsxs("select",{...n,required:c,multiple:m,name:t,defaultValue:f,children:[s.jsx("option",{value:"",disabled:!0,hidden:!0,children:i}),d.map(g,b=>s.jsx("option",{value:b==null?void 0:b.value,children:b==null?void 0:b.label},b==null?void 0:b.value))]})]}):s.jsxs("select",{...a,...o,required:c,multiple:m,name:t,defaultValue:f,children:[s.jsx("option",{value:"",disabled:!0,hidden:!0,children:i}),d.map(g,b=>s.jsx("option",{value:b==null?void 0:b.value,children:b==null?void 0:b.label},b==null?void 0:b.value))]})},te={type:"Select",label:"web_blocks.select",category:"core",icon:u.DropdownMenuIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},oe=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:i,styles:a,inputStyles:n,rows:c,showLabel:p,required:m,defaultValue:g}=e;return p?s.jsxs("div",{...a,...o,children:[p&&s.jsx("label",{htmlFor:t,children:r}),s.jsx("textarea",{name:t,...n,placeholder:i,rows:c,required:m,defaultValue:g})]}):s.jsx("textarea",{name:t,...o,...n,...a,placeholder:i,rows:c,required:m,defaultValue:g})},le={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:u.InputIcon,group:"form",...l.registerChaiBlockSchema({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},re=e=>{const{blockProps:o,inBuilder:t,children:r,globalBlock:i}=e;return t&&!i?s.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.jsxs("h1",{children:["Global Block - ",i]}),s.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):y.createElement("span",{...o},r)},se={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:u.FrameIcon,category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},ie=e=>{const{blockProps:o,styles:t,content:r,tag:i="h1",children:a=null}=e;return a?y.createElement(i,{...t,...o},a):y.createElement(i,{...t,...o,dangerouslySetInnerHTML:{__html:r}})},ae={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:u.HeadingIcon,group:"typography",...l.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:l.StylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Text"},ne=e=>{const{blockProps:o,styles:t}=e;return x.createElement("br",{...o,...t})},ce={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},pe=e=>{const{blockProps:o,children:t,styles:r}=e;return t?x.createElement("table",{...o,...r},t):s.jsx(k,{})},de=e=>{const{blockProps:o,children:t,styles:r}=e;return t?x.createElement("thead",{...o,...r},t):s.jsx(k,{})},ue=e=>{const{blockProps:o,children:t,styles:r}=e;return t?x.createElement("tbody",{...o,...r},t):s.jsx(k,{})},me=e=>{const{blockProps:o,children:t,styles:r}=e;return t?x.createElement("tr",{...o,...r},t):s.jsx(k,{})},ye=e=>{const{blockProps:o,children:t,content:r,styles:i}=e;return!t&&d.isEmpty(r)?s.jsx(k,{}):t?x.createElement("td",{...o,...i},t):x.createElement("td",{...o,...i,dangerouslySetInnerHTML:{__html:r}})};l.registerChaiBlock(pe,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:u.TableIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("Table")});l.registerChaiBlock(de,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:u.BorderTopIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableHead")});l.registerChaiBlock(ue,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:u.BorderAllIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableBody")});l.registerChaiBlock(me,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:u.ViewHorizontalIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:B("TableRow")});l.registerChaiBlock(ye,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:u.DragHandleHorizontalIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:B("TableCell"),i18nProps:["content"],aiProps:["content"]});function B(e){const o=(a,n)=>({_id:C.generateUUID(),_parent:a,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+n}`}),t=a=>{const n=C.generateUUID(),c={_type:"TableRow",_id:n,styles:"#styles:,border-b"};return a&&(c._parent=a),[c,o(n,"1"),o(n,"2"),o(n,"3")]},r=a=>{const n=C.generateUUID(),c={_id:n,_type:"TableHead",styles:"#styles:,font-medium"};return a&&(c._parent=a),[c,...t(n)]},i=a=>{const n=C.generateUUID(),c={_id:n,_type:"TableBody",styles:"#styles:,"};return a&&(c._parent=a),[c,...t(n),...t(n)]};if(e==="Table"){const a=C.generateUUID();return[{_id:a,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...r(a),...i(a)]}return e==="TableRow"?t():e==="TableHead"?r():e==="TableBody"?i():[]}const I=(e,...o)=>({...e,className:C.cn(e.className,...o)}),ge=e=>{const{blockProps:o,icon:t,styles:r,width:i,inBuilder:a,height:n}=e,c=I(r,"");if(d.isEmpty(t))return s.jsx(k,{inBuilder:a,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return y.createElement("span",{...o,...c,style:{width:i?`${i}px`:"auto",height:n?`${n}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},he={type:"Icon",label:"web_blocks.icon",category:"core",icon:u.SketchLogoIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),icon:{type:"string",title:"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>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},be="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",fe=e=>{const{blockProps:o,image:t,mobileImage:r,styles:i,alt:a,height:n,width:c,lazyLoading:p,mobileWidth:m,mobileHeight:g}=e;return d.isEmpty(t)?s.jsx(k,{className:"h-36"}):s.jsxs("picture",{children:[r&&s.jsx("source",{srcSet:r,media:"(max-width: 480px)",width:m,height:g}),s.jsx("img",{...o,...i,src:t,alt:a,loading:p?"lazy":"eager",width:c,height:n})]})},xe={type:"Image",description:"A image component",label:"Image",category:"core",icon:u.ImageIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),image:{type:"string",title:"Image",default:be,ui:{"ui:widget":"image"}},width:{type:"string",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"string",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},mobileWidth:{type:"string",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"string",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0}}}),aiProps:["alt"],i18nProps:["alt","image","_imageId","mobileImage","_mobileImageId"]},ke=e=>{const{blockProps:o,link:t,children:r,styles:i,inBuilder:a,content:n}=e;let c={};return!r&&d.isEmpty(n)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),a?r?s.jsx("span",{role:"link",...o,style:c,...i,children:r}):x.createElement("span",{...o,...i,style:c,role:"link"},n):r?s.jsx("a",{"aria-label":n,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...i,children:r}):x.createElement("a",{...o,...i,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":n},n)},Ce={type:"Link",description:"A link component",label:"Link",category:"core",icon:u.Link1Icon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"Link goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content","link"],canAcceptBlock:e=>e!=="Link"},Be=e=>{const{blockProps:o,children:t,styles:r,tag:i,inBuilder:a}=e;return!t&&d.isEmpty(r==null?void 0:r.className)?s.jsx(k,{inBuilder:a}):y.createElement(i||"ul",{...o,...r},t)},Se={type:"List",description:"A list component",label:"List",icon:u.RowsIcon,category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",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"}]},we=e=>{const{blockProps:o,content:t,styles:r,children:i,tag:a}=e;return i?y.createElement(a||"li",{...r,...o},i):y.createElement(a||"li",{...r,...o,dangerouslySetInnerHTML:{__html:t}})},Pe={type:"ListItem",description:"A list item component",label:"List Item",icon:u.ColumnsIcon,category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"},ve=e=>{const{blockProps:o,styles:t,content:r}=e;return d.isNull(e.children)?y.createElement("p",{...t,...o,dangerouslySetInnerHTML:{__html:r}}):y.createElement("p",{...t,...o},e.children)},Ie={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:u.TextIcon,group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"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.",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},je=e=>{const{blockProps:o,inBuilder:t,children:r,partialBlockId:i}=e;return t&&!i?s.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.jsxs("h1",{children:["Partial Block - ",i]}),s.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):y.createElement("span",{...o},r)},Le={type:"PartialBlock",description:"A partial block component",label:"Partial Block",icon:u.FrameIcon,category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})},S={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},Ne=e=>{const{blockProps:o,children:t,styles:r,colSpan:i,tabletColSpan:a,desktopColSpan:n}=e,p={className:[d.get(r,"className",""),d.get(S,["SMALL",isNaN(i)||!i?6:i],""),a?d.get(S,["MEDIUM",a||i],""):"",n?d.get(S,["LARGE",a||i],""):""].join(" ")};return s.jsx("div",{...o,...r,...p,children:t||s.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},_e={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:u.LayoutIcon,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Te=e=>{const{blockProps:o,children:t,styles:r,gutter:i}=e,n={className:[d.get(r,"className","")," grid grid-cols-12"].join()};return typeof(r==null?void 0:r.style)=="object"?r.style.gap=`${i}px`:n.style={gap:`${i}px`},s.jsx("div",{...o,...r,...n,children:t})},Ee={type:"Row",description:"A row component",label:"Row",group:"basic",icon:u.RowsIcon,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},Re=e=>{const{blockProps:o,content:t,styles:r}=e,i=I(r,"prose dark:prose-invert prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0","max-w-full");return s.jsx("div",{...o,...i,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",category:"core",icon:u.CursorTextIcon,group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},Ae=e=>{const{blockProps:o,styles:t,content:r,children:i=null,tag:a}=e;return i?y.createElement("span",{...t,...o},i):y.createElement(a||"span",{...t,...o,dangerouslySetInnerHTML:{__html:r||""}})},He={type:"Span",description:"A span component",label:"Span",category:"core",group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},$e=e=>e.inBuilder||e.forceWrapper?s.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,De={type:"Text",description:"A text component with no styling",label:"Text",hidden:!0,category:"core",group:"typography",icon:u.SpaceBetweenVerticallyIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},w={type:"object",title:"Controls",default:{autoplay:!0,controls:!1,loop:!0,muted:!0},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}},P=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,v=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,ze=(e,o)=>{const t=d.get(o,"autoplay",!1),r=d.get(o,"controls",!1),i=d.get(o,"loop",!1),a=t||d.get(o,"muted",!0);if(P.test(e)){const n=e.match(P);if(n){const c=n[4];let p=`https://www.youtube.com/embed/${c}`,m=t?"autoplay=1":"";return m+=i?`&loop=1&playlist=${c}`:"",m+=a?"&mute=1&muted=1":"",m+=r?"&controls=1":"&controls=0",`${p}?${m}`}}if(v.test(e)){const n=e.match(v);if(n){const c=n[1];let p="";return p+=t?"autoplay=1":"",p+=r?"&controls=1":"&controls=0",p+=a?"&muted=1":"",p+=i?"&loop=1":"",`https://player.vimeo.com/video/${c}?${p}`}}return null},Ve=e=>{const{url:o,blockProps:t,styles:r,controls:i,videoSource:a,inBuilder:n}=e,c=ze(o,i);return s.jsxs("div",{...d.omit(r,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!c&&n?s.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:d.isEmpty(o)?`Provided ${a} video link in settings Video URL.`:`Provided ${a} video link is invalid.`}):s.jsx("iframe",{width:"100%",src:c,...d.pick(r,"className")}),n&&s.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Ue=e=>{const{url:o,styles:t,controls:r,sources:i,poster:a,blockProps:n}=e;let c=a;const p=[...d.get(i,"srcsets",[])||[]];o&&typeof o=="string"&&p.push({url:o,width:"9999"});const m=p.sort((h,f)=>parseInt(h.width)-parseInt(f.width)).filter(h=>!d.isEmpty(h.url)&&!d.isEmpty(h.width));m.length===0&&!c&&(c="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const g=d.get(r,"autoplay",!1)||d.get(r,"muted",!0);return(c||!d.isEmpty(m))&&s.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:x.createElement("video",{...t,...n,key:JSON.stringify(m),controls:d.get(r,"controls",!1),autoPlay:d.get(r,"autoplay",!1),loop:d.get(r,"loop",!1),poster:c,...g?{muted:!0}:{}},m.map(h=>{if(!h.url||h.url.length<4||isNaN(h.width))return null;const f=`(max-width: ${h.width}px)`;return s.jsx("source",{src:h.url,media:f,type:h.type},h.url)}),"Your browser does not support the video tag.")})},Fe=e=>{const{videoSource:o}=e;return o==="Custom"?s.jsx(Ue,{...e}):o==="Youtube"||o==="Vimeo"?s.jsx(Ve,{...e}):s.jsxs("div",{children:["Invalid video source : ",o]})},qe={type:"Video",label:"Video",category:"core",icon:u.VideoIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...w}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...w}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...w}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url"]},Oe=e=>{const{styles:o}=e,t=l.getRegisteredChaiBlock("Pagination");return s.jsx("div",{...o,children:t?y.createElement(t.component,{...d.omit(e,["styles"]),blockProps:{}}):s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",disabled:!0,children:s.jsx(u.ChevronLeftIcon,{className:"h-4 w-4"})}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white",children:"1"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"2"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"3"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"4"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"5"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50",children:s.jsx(u.ChevronRightIcon,{className:"h-4 w-4"})})]})})},Ze=e=>{const{children:o,tag:t,styles:r,blockProps:i,$loading:a}=e,{pagination:n,inBuilder:c}=e;let p=o;return d.isEmpty(p)&&c&&(p=s.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?a&&c?Array.from({length:2}).map((m,g)=>s.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[s.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),s.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},g)):p:s.jsxs(s.Fragment,{children:[y.createElement(t,{...i,...r},a&&c?Array.from({length:2}).map((m,g)=>s.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[s.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),s.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},g)):p),n&&s.jsx(Oe,{...d.pick(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang"])})]})},Ge={type:"Repeater",label:"Repeater",icon:u.LoopIcon,group:"basic",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],...l.registerChaiBlockSchema({properties:{styles:l.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:l.stylesProp("flex items-center justify-center gap-2 p-4"),repeaterItems:{title:"Collection",type:"string",binding:"array",default:"",ui:{"ui:widget":"repeaterBinding","ui:readonly":!0}},tag:{title:"Tag",type:"string",default:"ul",enum:["none","div","ul","ol"]},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},pagination:{title:"Pagination",type:"boolean",default:!1}},allOf:[{if:{properties:{pagination:{const:!0}}},then:{properties:{paginationStrategy:{type:"string",title:"Pagination Strategy",default:"segment",enum:["query","segment"],enumNames:["Query(/items?page=1)","Segment(/items/1)"]},limit:{type:"number",title:"Items Per Page",default:10,minimum:1}}}},{if:{properties:{pagination:{const:!1}}},then:{properties:{limit:{type:"number",title:"Max items",default:10,minimum:1}}}}]}),canAcceptBlock:e=>e==="Pagination"},We=({children:e,blockProps:o,styles:t,parentTag:r,inBuilder:i})=>{let a="li";switch(r){case"ul":a="li";break;case"ol":a="li";break;default:a="div"}return!e&&i?y.createElement(a,{...o,...t},s.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Add children to repeater item"})):y.createElement(a,{...o,...t},e)},Ye={type:"RepeaterItem",label:"Repeater Item",icon:u.LoopIcon,hidden:!0,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.stylesProp(""),parentTag:l.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Qe=({children:e,blockProps:o,styles:t})=>y.createElement("div",{...o,...t},e),Je={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Xe=()=>{l.registerChaiBlock(L,N),l.registerChaiBlock(D,z),l.registerChaiBlock(_,T),l.registerChaiBlock(ie,ae),l.registerChaiBlock(ve,Ie),l.registerChaiBlock(Ae,He),l.registerChaiBlock(Re,Me),l.registerChaiBlock(ke,Ce),l.registerChaiBlock(Be,Se),l.registerChaiBlock(we,Pe),l.registerChaiBlock(ge,he),l.registerChaiBlock(fe,xe),l.registerChaiBlock(Fe,qe),l.registerChaiBlock(E,R),l.registerChaiBlock(M,A),l.registerChaiBlock($e,De),l.registerChaiBlock(F,q),l.registerChaiBlock(O,Z),l.registerChaiBlock(W,Y),l.registerChaiBlock(V,U),l.registerChaiBlock(X,K),l.registerChaiBlock(ee,te),l.registerChaiBlock(oe,le),l.registerChaiBlock(Q,J),l.registerChaiBlock(ne,ce),l.registerChaiBlock(H,$),l.registerChaiBlock(re,se),l.registerChaiBlock(je,Le),l.registerChaiBlock(Te,Ee),l.registerChaiBlock(Ne,_e),l.registerChaiBlock(Ze,Ge),l.registerChaiBlock(We,Ye),l.registerChaiBlock(Qe,Je)};exports.loadWebBlocks=Xe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@chaibuilder/runtime"),s=require("react/jsx-runtime"),C=require("./common-functions-BZmyleS1.cjs"),x=require("react"),u=require("@radix-ui/react-icons"),d=require("lodash-es");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const y=j(x),k=({className:e="",inBuilder:o})=>o?s.jsx("div",{className:C.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:s.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:s.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,L=e=>{const{blockProps:o,inBuilder:t,backgroundImage:r,children:i,tag:a="div",styles:n}=e;let c=i;i||(c=s.jsx(k,{inBuilder:t}));let p={};return r&&(p={backgroundImage:`url(${r})`}),y.createElement(a,{...o,...n,style:p},c)},N={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]},backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image"}}}}),canAcceptBlock:()=>!0},_=e=>{const{blockProps:o,iconSize:t,icon:r,content:i,styles:a,children:n,iconPos:c,link:p,inBuilder:m}=e,g=r,h=n||s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{children:i}),g&&s.jsx("div",{style:{width:t+"px"},className:c+" "+(i?c==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:g}})]}),f=x.createElement("button",{...o,...a,type:"button","aria-label":i},h);return d.isEmpty(d.get(p,"href"))?f:m?s.jsx("span",{children:f}):s.jsx("a",{"aria-label":i,href:d.get(p,"href")||"/",target:d.get(p,"target","_self"),children:f})},T={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:u.ButtonIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!0,title:"Prefetch Link"}}}),i18nProps:["content","link"],aiProps:["content"]},E=e=>{const{blockProps:o,styles:t,htmlCode:r,inBuilder:i}=e;return i?s.jsxs("div",{className:"relative",children:[i?s.jsx("div",{...o,...t,className:"absolute z-20 h-full w-full"}):null,y.createElement("div",{...t,dangerouslySetInnerHTML:{__html:r.replace(/<script.*?>.*?<\/script>/g,"")}})]}):y.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:r}})},R={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:u.CodeIcon,group:"advanced",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]},M=e=>{const{scripts:o,inBuilder:t,blockProps:r}=e;return t?s.jsx("div",{...r,children:s.jsx("div",{className:C.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:s.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:s.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.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},A={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:u.CodeIcon,group:"advanced",...l.registerChaiBlockSchema({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}}),hidden:!0},H=e=>{const{blockProps:o,styles:t}=e;return x.createElement("hr",{...t,...o})},$={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:u.DividerHorizontalIcon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},D=e=>{const{blockProps:o,styles:t,backgroundImage:r}=e;let i={};return r&&(i={backgroundImage:`url(${r})`}),y.createElement("div",{...o,...t,style:i})},z={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image"}}}})},q=e=>{const{blockProps:o,fieldName:t,label:r,styles:i,inputStyles:a,required:n,checked:c,showLabel:p=!0}=e;return p?s.jsxs("div",{...i,...o,children:[s.jsx("input",{...a,name:t,type:"checkbox",required:n,defaultChecked:c}),r&&s.jsx("label",{htmlFor:t,children:r})]}):s.jsx("input",{name:t,...o,...a,...i,type:"checkbox",required:n,defaultChecked:c})},V={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:u.CheckboxIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("flex items-center gap-x-2"),inputStyles:l.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},U=e=>{const{children:o,blockProps:t,errorMessage:r,successMessage:i,action:a,styles:n,inBuilder:c}=e;let p=o;o||(p=s.jsx(k,{inBuilder:c}));const m={"x-data":"{}","x-on:submit.prevent":"post"},g={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return s.jsxs("form",{...m,"data-error":r,"data-success":i,method:"post",action:a,...t,...n,children:[s.jsx("div",{...g}),p]})},F={type:"Form",label:"Form",category:"core",icon:u.FileTextIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},O=e=>{const{blockProps:o,inBuilder:t,label:r,styles:i,icon:a,iconSize:n,iconPos:c}=e;return s.jsxs("button",{...i,...o||{},type:t?"button":"submit","aria-label":r,children:[r,a&&s.jsx("div",{style:{width:n+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:a}})]})},Z={type:"FormButton",label:"Submit Button",category:"core",icon:u.ButtonIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},G=e=>{const o={type:"text",autocomplete:"on"};return e?["text","password","number","hidden","range","color","date","time"].includes(e)?{type:e,autocomplete:"on"}:e==="email"?{type:"email",autocomplete:"email"}:e==="tel"?{type:"tel",autocomplete:"tel"}:e==="url"?{type:"url",autocomplete:"url"}:{off:{type:"text",autocomplete:"off"},on:{type:"text",autocomplete:"on"},name:{type:"text",autocomplete:"name"},"honorific-prefix":{type:"text",autocomplete:"honorific-prefix"},"given-name":{type:"text",autocomplete:"given-name"},"additional-name":{type:"text",autocomplete:"additional-name"},"family-name":{type:"text",autocomplete:"family-name"},"honorific-suffix":{type:"text",autocomplete:"honorific-suffix"},nickname:{type:"text",autocomplete:"nickname"},firstName:{type:"text",autocomplete:"given-name"},lastName:{type:"text",autocomplete:"family-name"},email:{type:"email",autocomplete:"email"},tel:{type:"tel",autocomplete:"tel"},"tel-country-code":{type:"tel",autocomplete:"tel-country-code"},"tel-national":{type:"tel",autocomplete:"tel-national"},"tel-area-code":{type:"tel",autocomplete:"tel-area-code"},"tel-local":{type:"tel",autocomplete:"tel-local"},"tel-extension":{type:"tel",autocomplete:"tel-extension"},"street-address":{type:"text",autocomplete:"street-address"},"address-line1":{type:"text",autocomplete:"address-line1"},"address-line2":{type:"text",autocomplete:"address-line2"},"address-line3":{type:"text",autocomplete:"address-line3"},"address-level1":{type:"text",autocomplete:"address-level1"},"address-level2":{type:"text",autocomplete:"address-level2"},"address-level3":{type:"text",autocomplete:"address-level3"},"address-level4":{type:"text",autocomplete:"address-level4"},country:{type:"text",autocomplete:"country"},"country-name":{type:"text",autocomplete:"country-name"},"postal-code":{type:"text",autocomplete:"postal-code"},"cc-name":{type:"text",autocomplete:"cc-name"},"cc-given-name":{type:"text",autocomplete:"cc-given-name"},"cc-additional-name":{type:"text",autocomplete:"cc-additional-name"},"cc-family-name":{type:"text",autocomplete:"cc-family-name"},"cc-number":{type:"text",autocomplete:"cc-number"},"cc-exp":{type:"text",autocomplete:"cc-exp"},"cc-exp-month":{type:"number",autocomplete:"cc-exp-month"},"cc-exp-year":{type:"number",autocomplete:"cc-exp-year"},"cc-csc":{type:"text",autocomplete:"cc-csc"},"cc-type":{type:"text",autocomplete:"cc-type"},bday:{type:"date",autocomplete:"bday"},"bday-day":{type:"number",autocomplete:"bday-day"},"bday-month":{type:"number",autocomplete:"bday-month"},"bday-year":{type:"number",autocomplete:"bday-year"},username:{type:"text",autocomplete:"username"},"new-password":{type:"password",autocomplete:"new-password"},"current-password":{type:"password",autocomplete:"current-password"},"one-time-code":{type:"text",autocomplete:"one-time-code"},"transaction-currency":{type:"text",autocomplete:"transaction-currency"},"transaction-amount":{type:"number",autocomplete:"transaction-amount"},url:{type:"url",autocomplete:"url"},photo:{type:"url",autocomplete:"photo"},sex:{type:"text",autocomplete:"sex"},"organization-title":{type:"text",autocomplete:"organization-title"},organization:{type:"text",autocomplete:"organization"},language:{type:"text",autocomplete:"language"}}[e]||o:o},W=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:i,styles:a,inputStyles:n,showLabel:c,required:p,inputType:m,defaultValue:g}=e,{type:h,autocomplete:f}=G(m);return c?s.jsxs("div",{...a,...o,children:[c&&s.jsx("label",{htmlFor:t,children:r}),s.jsx("input",{name:t,defaultValue:g,...n,type:h,placeholder:i,required:p,autoComplete:f})]}):s.jsx("input",{name:t,...o,...n,...a,type:h,placeholder:i,required:p,autoComplete:f,defaultValue:g})},Y={type:"Input",label:"web_blocks.input",category:"core",icon:u.InputIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"firstName",title:"First Name"},{const:"lastName",title:"Last Name"},{const:"tel-country-code",title:"Telephone Country Code"},{const:"tel-national",title:"Telephone National"},{const:"tel-area-code",title:"Telephone Area Code"},{const:"tel-local",title:"Telephone Local"},{const:"tel-extension",title:"Telephone Extension"},{const:"street-address",title:"Street Address"},{const:"address-line1",title:"Address Line 1"},{const:"address-line2",title:"Address Line 2"},{const:"address-line3",title:"Address Line 3"},{const:"address-level1",title:"Address Level 1"},{const:"address-level2",title:"Address Level 2"},{const:"address-level3",title:"Address Level 3"},{const:"address-level4",title:"Address Level 4"},{const:"country",title:"Country"},{const:"country-name",title:"Country Name"},{const:"postal-code",title:"Postal Code"},{const:"cc-name",title:"Credit Card Name"},{const:"cc-number",title:"Credit Card Number"},{const:"cc-exp",title:"Credit Card Expiry"},{const:"cc-exp-month",title:"Credit Card Expiry Month"},{const:"cc-exp-year",title:"Credit Card Expiry Year"},{const:"cc-csc",title:"Credit Card CSC"},{const:"cc-type",title:"Credit Card Type"},{const:"bday",title:"Birthday"},{const:"bday-day",title:"Birthday Day"},{const:"bday-month",title:"Birthday Month"},{const:"bday-year",title:"Birthday Year"},{const:"username",title:"Username"},{const:"new-password",title:"New Password"},{const:"current-password",title:"Current Password"},{const:"one-time-code",title:"One Time Code"},{const:"transaction-currency",title:"Transaction Currency"},{const:"transaction-amount",title:"Transaction Amount"},{const:"url",title:"URL"},{const:"photo",title:"Photo"},{const:"sex",title:"Sex"},{const:"organization-title",title:"Organization Title"},{const:"organization",title:"Organization"},{const:"language",title:"Language"}]},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},Q=e=>{const{blockProps:o,content:t,styles:r,children:i}=e,a={...r,...o};return i?y.createElement("label",a,i):y.createElement("label",{...a,dangerouslySetInnerHTML:{__html:t}})},J={type:"Label",label:"Label",category:"core",icon:u.LetterCaseToggleIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},X=e=>{const{blockProps:o,fieldName:t,label:r,styles:i,inputStyles:a,required:n,checked:c,showLabel:p=!0}=e;return p?s.jsxs("div",{...i,...o,children:[s.jsx("input",{...a,name:t,type:"radio",required:n,defaultChecked:c}),r&&s.jsx("label",{htmlFor:t,children:r})]}):s.jsx("input",{name:t,...o,...a,...i,type:"radio",required:n,checked:c})},K={type:"Radio",label:"web_blocks.radio",category:"core",icon:u.RadiobuttonIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("flex items-center gap-x-2"),inputStyles:l.StylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},ee=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:i,styles:a,inputStyles:n,required:c,showLabel:p,_multiple:m,options:g,defaultValue:h}=e,f=m&&h?h.split(",").map(b=>b.trim()):h||"";return p?s.jsxs("div",{...a,...o,children:[p&&s.jsx("label",{htmlFor:t,children:r}),s.jsxs("select",{...n,required:c,multiple:m,name:t,defaultValue:f,children:[s.jsx("option",{value:"",disabled:!0,hidden:!0,children:i}),d.map(g,b=>s.jsx("option",{value:b==null?void 0:b.value,children:b==null?void 0:b.label},b==null?void 0:b.value))]})]}):s.jsxs("select",{...a,...o,required:c,multiple:m,name:t,defaultValue:f,children:[s.jsx("option",{value:"",disabled:!0,hidden:!0,children:i}),d.map(g,b=>s.jsx("option",{value:b==null?void 0:b.value,children:b==null?void 0:b.label},b==null?void 0:b.value))]})},te={type:"Select",label:"web_blocks.select",category:"core",icon:u.DropdownMenuIcon,group:"form",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},oe=e=>{const{blockProps:o,fieldName:t,label:r,placeholder:i,styles:a,inputStyles:n,rows:c,showLabel:p,required:m,defaultValue:g}=e;return p?s.jsxs("div",{...a,...o,children:[p&&s.jsx("label",{htmlFor:t,children:r}),s.jsx("textarea",{name:t,...n,placeholder:i,rows:c,required:m,defaultValue:g})]}):s.jsx("textarea",{name:t,...o,...n,...a,placeholder:i,rows:c,required:m,defaultValue:g})},le={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:u.InputIcon,group:"form",...l.registerChaiBlockSchema({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:l.StylesProp(""),inputStyles:l.StylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},re=e=>{const{blockProps:o,inBuilder:t,children:r,globalBlock:i}=e;return t&&!i?s.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.jsxs("h1",{children:["Global Block - ",i]}),s.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):y.createElement("span",{...o},r)},se={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:u.FrameIcon,category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},B=(e,...o)=>({...e,className:C.cn(e.className,...o)}),ie=e=>{const{blockProps:o,styles:t,content:r,tag:i="h1",children:a=null}=e;if(a)return y.createElement(i,{...t,...o},a);const n=B(t,"prose prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0","max-w-full");return y.createElement(i,{...n,...o,dangerouslySetInnerHTML:{__html:r}})},ae={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:u.HeadingIcon,group:"typography",...l.registerChaiBlockSchema({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:l.StylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Text"},ne=e=>{const{blockProps:o,styles:t}=e;return x.createElement("br",{...o,...t})},ce={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},pe=e=>{const{blockProps:o,children:t,styles:r}=e;return t?x.createElement("table",{...o,...r},t):s.jsx(k,{})},de=e=>{const{blockProps:o,children:t,styles:r}=e;return t?x.createElement("thead",{...o,...r},t):s.jsx(k,{})},ue=e=>{const{blockProps:o,children:t,styles:r}=e;return t?x.createElement("tbody",{...o,...r},t):s.jsx(k,{})},me=e=>{const{blockProps:o,children:t,styles:r}=e;return t?x.createElement("tr",{...o,...r},t):s.jsx(k,{})},ye=e=>{const{blockProps:o,children:t,content:r,styles:i}=e;return!t&&d.isEmpty(r)?s.jsx(k,{}):t?x.createElement("td",{...o,...i},t):x.createElement("td",{...o,...i,dangerouslySetInnerHTML:{__html:r}})};l.registerChaiBlock(pe,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:u.TableIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:S("Table")});l.registerChaiBlock(de,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:u.BorderTopIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:S("TableHead")});l.registerChaiBlock(ue,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:u.BorderAllIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:S("TableBody")});l.registerChaiBlock(me,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:u.ViewHorizontalIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),blocks:S("TableRow")});l.registerChaiBlock(ye,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:u.DragHandleHorizontalIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:S("TableCell"),i18nProps:["content"],aiProps:["content"]});function S(e){const o=(a,n)=>({_id:C.generateUUID(),_parent:a,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+n}`}),t=a=>{const n=C.generateUUID(),c={_type:"TableRow",_id:n,styles:"#styles:,border-b"};return a&&(c._parent=a),[c,o(n,"1"),o(n,"2"),o(n,"3")]},r=a=>{const n=C.generateUUID(),c={_id:n,_type:"TableHead",styles:"#styles:,font-medium"};return a&&(c._parent=a),[c,...t(n)]},i=a=>{const n=C.generateUUID(),c={_id:n,_type:"TableBody",styles:"#styles:,"};return a&&(c._parent=a),[c,...t(n),...t(n)]};if(e==="Table"){const a=C.generateUUID();return[{_id:a,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...r(a),...i(a)]}return e==="TableRow"?t():e==="TableHead"?r():e==="TableBody"?i():[]}const ge=e=>{const{blockProps:o,icon:t,styles:r,width:i,inBuilder:a,height:n}=e,c=B(r,"");if(d.isEmpty(t))return s.jsx(k,{inBuilder:a,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return y.createElement("span",{...o,...c,style:{width:i?`${i}px`:"auto",height:n?`${n}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},he={type:"Icon",label:"web_blocks.icon",category:"core",icon:u.SketchLogoIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),icon:{type:"string",title:"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>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},be="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",fe=e=>{const{blockProps:o,image:t,mobileImage:r,styles:i,alt:a,height:n,width:c,lazyLoading:p,mobileWidth:m,mobileHeight:g}=e;return d.isEmpty(t)?s.jsx(k,{className:"h-36"}):s.jsxs("picture",{children:[r&&s.jsx("source",{srcSet:r,media:"(max-width: 480px)",width:m,height:g}),s.jsx("img",{...o,...i,src:t,alt:a,loading:p?"lazy":"eager",width:c,height:n})]})},xe={type:"Image",description:"A image component",label:"Image",category:"core",icon:u.ImageIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),image:{type:"string",title:"Image",default:be,ui:{"ui:widget":"image"}},width:{type:"string",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"string",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},mobileWidth:{type:"string",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"string",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0}}}),aiProps:["alt"],i18nProps:["alt","image","_imageId","mobileImage","_mobileImageId"]},ke=e=>{const{blockProps:o,link:t,children:r,styles:i,inBuilder:a,content:n}=e;let c={};return!r&&d.isEmpty(n)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),a?r?s.jsx("span",{role:"link",...o,style:c,...i,children:r}):x.createElement("span",{...o,...i,style:c,role:"link"},n):r?s.jsx("a",{"aria-label":n,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...i,children:r}):x.createElement("a",{...o,...i,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":n},n)},Ce={type:"Link",description:"A link component",label:"Link",category:"core",icon:u.Link1Icon,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"Link goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content","link"],canAcceptBlock:e=>e!=="Link"},Be=e=>{const{blockProps:o,children:t,styles:r,tag:i,inBuilder:a}=e;return!t&&d.isEmpty(r==null?void 0:r.className)?s.jsx(k,{inBuilder:a}):y.createElement(i||"ul",{...o,...r},t)},Se={type:"List",description:"A list component",label:"List",icon:u.RowsIcon,category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("")}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",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"}]},we=e=>{const{blockProps:o,content:t,styles:r,children:i,tag:a}=e;return i?y.createElement(a||"li",{...r,...o},i):y.createElement(a||"li",{...r,...o,dangerouslySetInnerHTML:{__html:t}})},Pe={type:"ListItem",description:"A list item component",label:"List Item",icon:u.ColumnsIcon,category:"core",group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"},ve=e=>{const{blockProps:o,styles:t,content:r}=e;if(!d.isNull(e.children))return y.createElement("p",{...t,...o},e.children);const i=B(t,"prose prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0","max-w-full");return y.createElement("p",{...i,...o,dangerouslySetInnerHTML:{__html:r}})},Ie={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:u.TextIcon,group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"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.",ui:{"ui:widget":"richtext","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},je=e=>{const{blockProps:o,inBuilder:t,children:r,partialBlockId:i}=e;return t&&!i?s.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.jsxs("h1",{children:["Partial Block - ",i]}),s.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):y.createElement("span",{...o},r)},Le={type:"PartialBlock",description:"A partial block component",label:"Partial Block",icon:u.FrameIcon,category:"core",group:"basic",hidden:!0,...l.registerChaiBlockSchema({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})},w={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},Ne=e=>{const{blockProps:o,children:t,styles:r,colSpan:i,tabletColSpan:a,desktopColSpan:n}=e,p={className:[d.get(r,"className",""),d.get(w,["SMALL",isNaN(i)||!i?6:i],""),a?d.get(w,["MEDIUM",a||i],""):"",n?d.get(w,["LARGE",a||i],""):""].join(" ")};return s.jsx("div",{...o,...r,...p,children:t||s.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},_e={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:u.LayoutIcon,wrapper:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Te=e=>{const{blockProps:o,children:t,styles:r,gutter:i}=e,n={className:[d.get(r,"className","")," grid grid-cols-12"].join()};return typeof(r==null?void 0:r.style)=="object"?r.style.gap=`${i}px`:n.style={gap:`${i}px`},s.jsx("div",{...o,...r,...n,children:t})},Ee={type:"Row",description:"A row component",label:"Row",group:"basic",icon:u.RowsIcon,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},Re=e=>{const{blockProps:o,content:t,styles:r}=e,i=B(r,"prose prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0","max-w-full");return s.jsx("div",{...o,...i,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",category:"core",icon:u.CursorTextIcon,group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},Ae=e=>{const{blockProps:o,styles:t,content:r,children:i=null,tag:a}=e;if(i)return y.createElement("span",{...t,...o},i);const n=B(t,"prose prose-p:m-0 prose-p:min-h-[1rem] prose-blockquote:m-2 prose-blockquote:ml-4 prose-ul:m-0 prose-ol:m-0 prose-li:m-0","max-w-full");return y.createElement(a||"span",{...n,...o,dangerouslySetInnerHTML:{__html:r||""}})},He={type:"Span",description:"A span component",label:"Span",category:"core",group:"typography",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"richtext","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},$e=e=>e.inBuilder||e.forceWrapper?s.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,De={type:"Text",description:"A text component with no styling",label:"Text",hidden:!0,category:"core",group:"typography",icon:u.SpaceBetweenVerticallyIcon,...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},P={type:"object",title:"Controls",default:{autoplay:!0,controls:!1,loop:!0,muted:!0},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}},v=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,I=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,ze=(e,o)=>{const t=d.get(o,"autoplay",!1),r=d.get(o,"controls",!1),i=d.get(o,"loop",!1),a=t||d.get(o,"muted",!0);if(v.test(e)){const n=e.match(v);if(n){const c=n[4];let p=`https://www.youtube.com/embed/${c}`,m=t?"autoplay=1":"";return m+=i?`&loop=1&playlist=${c}`:"",m+=a?"&mute=1&muted=1":"",m+=r?"&controls=1":"&controls=0",`${p}?${m}`}}if(I.test(e)){const n=e.match(I);if(n){const c=n[1];let p="";return p+=t?"autoplay=1":"",p+=r?"&controls=1":"&controls=0",p+=a?"&muted=1":"",p+=i?"&loop=1":"",`https://player.vimeo.com/video/${c}?${p}`}}return null},qe=e=>{const{url:o,blockProps:t,styles:r,controls:i,videoSource:a,inBuilder:n}=e,c=ze(o,i);return s.jsxs("div",{...d.omit(r,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!c&&n?s.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:d.isEmpty(o)?`Provided ${a} video link in settings Video URL.`:`Provided ${a} video link is invalid.`}):s.jsx("iframe",{width:"100%",src:c,...d.pick(r,"className")}),n&&s.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Ve=e=>{const{url:o,styles:t,controls:r,sources:i,poster:a,blockProps:n}=e;let c=a;const p=[...d.get(i,"srcsets",[])||[]];o&&typeof o=="string"&&p.push({url:o,width:"9999"});const m=p.sort((h,f)=>parseInt(h.width)-parseInt(f.width)).filter(h=>!d.isEmpty(h.url)&&!d.isEmpty(h.width));m.length===0&&!c&&(c="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const g=d.get(r,"autoplay",!1)||d.get(r,"muted",!0);return(c||!d.isEmpty(m))&&s.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:x.createElement("video",{...t,...n,key:JSON.stringify(m),controls:d.get(r,"controls",!1),autoPlay:d.get(r,"autoplay",!1),loop:d.get(r,"loop",!1),poster:c,...g?{muted:!0}:{}},m.map(h=>{if(!h.url||h.url.length<4||isNaN(h.width))return null;const f=`(max-width: ${h.width}px)`;return s.jsx("source",{src:h.url,media:f,type:h.type},h.url)}),"Your browser does not support the video tag.")})},Ue=e=>{const{videoSource:o}=e;return o==="Custom"?s.jsx(Ve,{...e}):o==="Youtube"||o==="Vimeo"?s.jsx(qe,{...e}):s.jsxs("div",{children:["Invalid video source : ",o]})},Fe={type:"Video",label:"Video",category:"core",icon:u.VideoIcon,group:"media",...l.registerChaiBlockSchema({properties:{styles:l.StylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...P}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...P}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...P}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url"]},Oe=e=>{const{paginationStyles:o}=e,t=l.getRegisteredChaiBlock("Pagination");return s.jsx("div",{...o,children:t?y.createElement(t.component,{...d.omit(e,["paginationStyles"]),blockProps:{}}):s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",disabled:!0,children:s.jsx(u.ChevronLeftIcon,{className:"h-4 w-4"})}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white",children:"1"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"2"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"3"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"4"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"5"}),s.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50",children:s.jsx(u.ChevronRightIcon,{className:"h-4 w-4"})})]})})},Ze=e=>{const{children:o,tag:t,styles:r,blockProps:i,$loading:a}=e,{pagination:n,inBuilder:c}=e;let p=o;return d.isEmpty(p)&&c&&(p=s.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?a&&c?Array.from({length:2}).map((m,g)=>s.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[s.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),s.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},g)):p:s.jsxs(s.Fragment,{children:[y.createElement(t,{...i,...r},a&&c?Array.from({length:2}).map((m,g)=>s.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[s.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),s.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},g)):p),n&&s.jsx(Oe,{...d.pick(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang","paginationStyles"])})]})},Ge={type:"Repeater",label:"Repeater",icon:u.LoopIcon,group:"basic",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],...l.registerChaiBlockSchema({properties:{styles:l.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:l.stylesProp("flex items-center justify-center gap-2 p-4"),repeaterItems:{title:"Collection",type:"string",binding:"array",default:"",ui:{"ui:widget":"repeaterBinding","ui:readonly":!0}},tag:{title:"Tag",type:"string",default:"ul",enum:["none","div","ul","ol"]},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},pagination:{title:"Pagination",type:"boolean",default:!1}},allOf:[{if:{properties:{pagination:{const:!0}}},then:{properties:{paginationStrategy:{type:"string",title:"Pagination Strategy",default:"segment",enum:["query","segment"],enumNames:["Query(/items?page=1)","Segment(/items/1)"]},limit:{type:"number",title:"Items Per Page",default:10,minimum:1}}}},{if:{properties:{pagination:{const:!1}}},then:{properties:{limit:{type:"number",title:"Max items",default:10,minimum:1}}}}]}),canAcceptBlock:e=>e==="Pagination"},We=({children:e,blockProps:o,styles:t,parentTag:r,inBuilder:i})=>{let a="li";switch(r){case"ul":a="li";break;case"ol":a="li";break;default:a="div"}return!e&&i?y.createElement(a,{...o,...t},s.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Add children to repeater item"})):y.createElement(a,{...o,...t},e)},Ye={type:"RepeaterItem",label:"Repeater Item",icon:u.LoopIcon,hidden:!0,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.stylesProp(""),parentTag:l.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Qe=({children:e,blockProps:o,styles:t})=>y.createElement("div",{...o,...t},e),Je={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",...l.registerChaiBlockSchema({properties:{styles:l.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Xe=()=>{l.registerChaiBlock(L,N),l.registerChaiBlock(D,z),l.registerChaiBlock(_,T),l.registerChaiBlock(ie,ae),l.registerChaiBlock(ve,Ie),l.registerChaiBlock(Ae,He),l.registerChaiBlock(Re,Me),l.registerChaiBlock(ke,Ce),l.registerChaiBlock(Be,Se),l.registerChaiBlock(we,Pe),l.registerChaiBlock(ge,he),l.registerChaiBlock(fe,xe),l.registerChaiBlock(Ue,Fe),l.registerChaiBlock(E,R),l.registerChaiBlock(M,A),l.registerChaiBlock($e,De),l.registerChaiBlock(U,F),l.registerChaiBlock(O,Z),l.registerChaiBlock(W,Y),l.registerChaiBlock(q,V),l.registerChaiBlock(X,K),l.registerChaiBlock(ee,te),l.registerChaiBlock(oe,le),l.registerChaiBlock(Q,J),l.registerChaiBlock(ne,ce),l.registerChaiBlock(H,$),l.registerChaiBlock(re,se),l.registerChaiBlock(je,Le),l.registerChaiBlock(Te,Ee),l.registerChaiBlock(Ne,_e),l.registerChaiBlock(Ze,Ge),l.registerChaiBlock(We,Ye),l.registerChaiBlock(Qe,Je)};exports.loadWebBlocks=Xe;
|